This is the mail archive of the
mailing list for the GCC project.
Re: mips64 inline question
- From: d p chang <weasel at meer dot net>
- To: gcc at gcc dot gnu dot org
- Date: 23 Jan 2002 17:08:11 -0800
- Subject: Re: mips64 inline question
- References: <200201232346.PAA2674792@meer.meer.net>
- Reply-to: weasel at cs dot stanford dot edu
To followup to my own question
d p chang <email@example.com> 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));
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?