x86: fix instruction emulator test's xgetbv constraints
authorJan Beulich <jbeulich@suse.com>
Wed, 16 Apr 2014 16:18:35 +0000 (18:18 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 16 Apr 2014 16:18:35 +0000 (18:18 +0200)
commit09c856316d67045d170679b6980f34348e4c402f
treea6061c433152a655289523858c65f8ff9bb6fd63
parentc82fbfe6ec8be597218eb943641d1f7a81c4c01e
x86: fix instruction emulator test's xgetbv constraints

The "A" constraint, while documented up to gcc 4.5 as "The a and d
registers, as a pair (for instructions that return half the result in
one and half in the other)," never really behaved that (natural) way,
but always meant (and is now also documented so) %eax _or_ %edx (%rax
_or_ %rdx on x86-64) unless the operand was wide enough to require both
(i.e. more than 32 bits on ix86 and more than 64 bits on x86-64).

Interestingly something internal to the compiler changed between 4.4
and 4.5 to actually expose the difference - up to gcc 4.4 I was unable
to construct a case where, when only the low half of the result is
actually looked at, the result would be considered to be in %edx/%rdx
(and %eax/%rax would be treated as unmodified by the instruction).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Tested-by: Don Slutz <dslutz@verizon.com>
tools/tests/x86_emulator/test_x86_emulator.c