The documentation of the constraint A says:

"The a and d registers, as a pair (for instructions that return half the result
in one and half in the other)."

So I expect:
asm("/*  dx = 0,  ax = 1 */" :: "A" ((int32_t)1) );
asm("/* edx = 0, eax = 1 */" :: "A" ((int64_t)1) );
//asm("/* rdx = 0, rax = 1 */" :: "A" ((int128_t)1));

but the behavior of gcc is different:
with -m32 switch:
asm("/* eDX = undef, eax = 1 */" :: "A" ((int32_t)1) );
asm("/* edx =     0, eax = 1 */" :: "A" ((int64_t)1) );

with -m64 switch:
asm("/* rDX = undef, eax = 1 */" :: "A" ((int32_t)1) );
asm("/* rDX = undef, rax = 1 */" :: "A" ((int64_t)1) );

so for -m64 there is no difference between a and A


-- 
           Summary: Inline Assembler: Constraint A expected different
                    behavior
           Product: gcc
           Version: 4.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: inline-asm
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: andreas dot freimuth at united-bits dot de
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu


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

Reply via email to