public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug inline-asm/39590]  New: inline asm %z on amd64 says "ll" instead of "q"
@ 2009-03-30 18:17 felix-gcc at fefe dot de
  2009-03-30 19:19 ` [Bug inline-asm/39590] " hjl dot tools at gmail dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: felix-gcc at fefe dot de @ 2009-03-30 18:17 UTC (permalink / raw)
  To: gcc-bugs

I am trying to write an inline asm statement that atomically adds a number to a
memory variable.  Here's what I came up with:

#define atomic_add(mem,val) asm volatile ("lock; add%z0 %1, %0": "+m" (mem):
"ir" (val))

This appears to work fine on x86, but in 64-bit mode %z returns "ll" instead of
"q" for 64-bit values like size_t, and thus the assembler complains like this:

t.c:53: Error: no such instruction: `addll $3,x.5802(%rip)'

If I understand %z correctly, this is exactly what it is meant for... right?
Please make it return "q" in this case.


-- 
           Summary: inline asm %z on amd64 says "ll" instead of "q"
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: felix-gcc at fefe dot de
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39590


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

end of thread, other threads:[~2009-04-25  8:23 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-30 18:17 [Bug inline-asm/39590] New: inline asm %z on amd64 says "ll" instead of "q" felix-gcc at fefe dot de
2009-03-30 19:19 ` [Bug inline-asm/39590] " hjl dot tools at gmail dot com
2009-03-30 19:55 ` felix-gcc at fefe dot de
2009-03-30 20:00 ` hjl dot tools at gmail dot com
2009-03-30 20:27 ` felix-gcc at fefe dot de
2009-03-30 21:07 ` hjl dot tools at gmail dot com
2009-03-30 22:11 ` felix-gcc at fefe dot de
2009-03-31  1:28 ` hjl dot tools at gmail dot com
2009-03-31 22:42 ` hjl dot tools at gmail dot com
2009-04-01  1:09 ` hjl dot tools at gmail dot com
2009-04-01 19:09 ` hjl dot tools at gmail dot com
2009-04-16 18:34 ` pinskia at gcc dot gnu dot org
2009-04-25  8:11 ` uros at gcc dot gnu dot org
2009-04-25  8:23 ` ubizjak at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).