* atomic_sub_and_test() asm constraints
@ 2010-03-14 12:59 Geert Uytterhoeven
2010-03-14 14:30 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: Geert Uytterhoeven @ 2010-03-14 12:59 UTC (permalink / raw)
To: Linux/m68k
| CC mm/memcontrol.o
| {standard input}: Assembler messages:
| {standard input}:4076: Error: operands mismatch -- statement `subl
12(%fp),170(%a0)' ignored
Seems like we have bad asm constraints in
static inline int atomic_sub_and_test(int i, atomic_t *v)
{
char c;
__asm__ __volatile__("subl %2,%1; seq %0" : "=d" (c), "+m"
(*v): "g" (i));
return c != 0;
}
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: atomic_sub_and_test() asm constraints
2010-03-14 12:59 atomic_sub_and_test() asm constraints Geert Uytterhoeven
@ 2010-03-14 14:30 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2010-03-14 14:30 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: Linux/m68k
Geert Uytterhoeven <geert@linux-m68k.org> writes:
> | CC mm/memcontrol.o
> | {standard input}: Assembler messages:
> | {standard input}:4076: Error: operands mismatch -- statement `subl
> 12(%fp),170(%a0)' ignored
>
> Seems like we have bad asm constraints in
>
> static inline int atomic_sub_and_test(int i, atomic_t *v)
> {
> char c;
> __asm__ __volatile__("subl %2,%1; seq %0" : "=d" (c), "+m"
> (*v): "g" (i));
Surely "g" is wrong, sub only accepts a data register as source operand
when the destination is in memory.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-14 14:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-14 12:59 atomic_sub_and_test() asm constraints Geert Uytterhoeven
2010-03-14 14:30 ` Andreas Schwab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox