Re: Asm function to count clock ticks
>>>>> On Fri, 12 Jul 2002 16:07:39 +0200, "firstname.lastname@example.org"<email@example.com> said:
David.D> I try to count clock ticks on my itanium with the asm
David.D> assembly code line included in a C program:
David.D> __asm__ __volatile__("mov %0=ar.itc" : "=r"((t).tick) ::
David.D> where (t).tick is a unsigned long int and i got the
David.D> following message when i compiled it:
David.D> Can't find a register in class `AR_M_REGS' while
David.D> reloading `asm'.
David.D> Does anyone encounter the same kind of message while
David.D> trying to include asm in his C program ?
The code you quote looks fine in principle (though the details
obviously depend on what "t" is. What compiler are you using? It
worked fine for me both with gcc 2.96 and 3.1.
Note that Itanium has an errata for the itc: to work around this
errata, you need to re-read ar.itc if the low 32 bits of the returned
value are equal to 0xffffffff. (No such errata exists for Itanium 2,
To UNSUBSCRIBE, email to firstname.lastname@example.org
with a subject of "unsubscribe". Trouble? Contact email@example.com