mips64 inline question
d p chang
weasel@meer.net
Wed Jan 23 17:21:00 GMT 2002
I'm still going through the mips-linux archives, but I'm having a
problem w/ what appears to be a working (for simple programs) cross
compiler (that I built from cvs a few days ago).
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);
}
This produces the following errors (the last part I assume comes from
the first errors):
panic.c: In function `panic':
/home/dpc/src/linux-2.4.17/include/asm/delay.h:47: impossible register constraint in `asm'
/home/dpc/src/linux-2.4.17/include/asm/delay.h:47: impossible register constraint in `asm'
/home/dpc/src/linux-2.4.17/include/asm/delay.h:47: impossible register constraint in `asm'
/home/dpc/src/linux-2.4.17/include/asm/delay.h:47: impossible register constraint in `asm'
/home/dpc/src/linux-2.4.17/include/asm/delay.h:47: impossible register constraint in `asm'
/home/dpc/src/linux-2.4.17/include/asm/delay.h:47: impossible register constraint in `asm'
panic.c:101: unrecognizable insn:
(insn 300 299 423 (parallel[
(set (reg:DI 10 t2)
(asm_operands:DI ("dmultu %2,%3") ("=h") 0[
(reg:DI 2 v0 [157])
(reg:DI 4 a0 [166])
]
[
(asm_input:DI ("r"))
(asm_input:DI ("r"))
] ("/home/dpc/src/linux-2.4.17/include/asm/delay.h") 47))
(set (reg:DI 12 t4)
(asm_operands:DI ("dmultu %2,%3") ("=l") 1[
(reg:DI 2 v0 [157])
(reg:DI 4 a0 [166])
]
[
(asm_input:DI ("r"))
(asm_input:DI ("r"))
] ("/home/dpc/src/linux-2.4.17/include/asm/delay.h") 47))
] ) -1 (insn_list 288 (nil))
(nil))
panic.c:101: confused by earlier errors, bailing out
I've tried playing around w/ the source registers some (expanding the
inline to include explicit moves to registers etc), but it appears
that the destination hi/lo register constraints are upsetting gcc.
Am I missing something else from the docs?
p
More information about the Gcc
mailing list