mips64 inline question
d p chang
weasel@meer.net
Wed Jan 23 18:20:00 GMT 2002
To followup to my own question
d p chang <weasel@meer.net> writes:
> The code in question is in delay.h as:
>
> extern __inline__ void __udelay(unsigned long usecs, unsigned long lpj)
> {
> unsigned long lo;
>
> usecs *= 0x00068db8bac710cbUL; /* 2**64 / (1000000 / HZ) */
> __asm__ ("dmultu\t%2,%3"
> :"=h" (usecs), "=l" (lo)
> :"r" (usecs),"r" (lpj));
> __delay(hi);
> }
I've gotten around this (the kernel compile is still running, but the
.s looks ok) w/ this:
__asm__ ("dmultu\t%2,%3 ; mfhi %0 ; mflo %1"
: "=r" (hi), "=r" (lo)
: "r" (usecs), "r" (lpj)
: "hi", "lo");
The clobbering of hi/lo is what I'm wondering about here. The whole
expression does clobber, but do I need anything else to be safe?
\p
More information about the Gcc
mailing list