Linux MIPS Architecture development
 help / color / mirror / Atom feed
* inconsistent operand constraints in 'asm' in unaligned.h:66 using gcc 3.4
@ 2004-04-23  3:22 Bradley D. LaRonde
  2004-04-23  3:22 ` Bradley D. LaRonde
  2004-04-23 13:07 ` Maciej W. Rozycki
  0 siblings, 2 replies; 5+ messages in thread
From: Bradley D. LaRonde @ 2004-04-23  3:22 UTC (permalink / raw)
  To: linux-mips

gcc 3.4 complians about:

include/asm/unaligned.h:66: error: inconsistent operand constraints in an
`asm'

from linux CVS 2.4 branch.  That's:

/*
 * Store doubleword ununaligned.
 */
static inline void __stq_u(unsigned long __val, unsigned long long * __addr)
{
        __asm__("usw\t%1, %0\n\t"
                "usw\t%D1, 4+%0"
                : "=m" (*__addr)
                : "r" (__val));
}

I was baffled by the "%D1" syntax until Thiemo Seufer pointed out that %D1
assembled to "one register higher than the register chosen for %1".
Ooooookay.  But gcc complains about a constraint problem.  Maybe "r" and
"%Dn" don't get along (long)?

Anyway... what about __val's type?  I would expect that to be "unsigned long
long" for -mabi=32.  Otherwise will "%D" get what the asm author expected?
If I do change it to "unsigned long long" then I get two of the constraint
errors.  Ooooookay.  Anyone got a constraint that means "consecutive
register pair"?

I finally decided to punt and write:

static inline void __stq_u(unsigned long long __val, unsigned long long *
__addr)
{
        *__addr = __val;
}

Is this OK?  Is there a better solution?


Regards,
Brad

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-06-15 13:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-23  3:22 inconsistent operand constraints in 'asm' in unaligned.h:66 using gcc 3.4 Bradley D. LaRonde
2004-04-23  3:22 ` Bradley D. LaRonde
2004-04-23 13:07 ` Maciej W. Rozycki
2004-04-23 13:14   ` Ralf Baechle
2004-06-15 13:57     ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox