------- Comment #2 from andreas dot freimuth at united-bits dot de  2009-08-21 
14:16 -------
I supposed that the "A" constraints was introduced to support instructions that
use a combination of d and a registers as parameters. These instructions that
use DX:AX, EDX:EAX and RDX:RAX as source or destination still exists in long
mode. But this support is at least for 64bit code completely lost/broken while
there is no int128_t.

As you said: "The "A" constraint supposed to be used for a _PAIR_."
But as I tried to show, GCC does not use any pair in most cases.
  asm("…" :: "A" (0) ); 
This should initialize the _pair_ to 0, shouldn't it?
But gcc initializes only the lower bits (rAX), not the upper (rDX).
And I assume that rDX is not even in the clobber list(but I was not yet able to
prove that), where it definitely has to be.


So if it is supposed to be used for fixed size values, what means no support
for (e)DX:(e)AX in 32bit(64bit) code, I would expect it to work as
  int64_t EDX_EAX = some_32bit_value;
( int128_t RDX_RAX = some_64bit_or_32bit_value; )
with an implicit typecast to be usable for at least some instruction that use
rDX:rAX as operand.


If this is still considered to be no bug in gcc, then the documentation need to
be fixed.


-- 


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

Reply via email to