Use fxsave64 and fxrstor64 mnemonics instead of old-school rex64 prefix
bz#339636
Before:
== 591 tests, 232 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
After:
== 591 tests, 232 stderr failures, 22 stdout failures, 0 stderrB failures, 0 stdoutB failures, 30 post failures ==
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15198 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/NEWS b/NEWS
index 89a2c3d..4d88267 100644
--- a/NEWS
+++ b/NEWS
@@ -87,6 +87,7 @@
339288 support Cavium Octeon MIPS specific BBIT*32 instructions
339442 Fix testsuite build failure on OS X 10.9
339542 Enable compilation with Intel's ICC compiler
+339636 Use fxsave64 and fxrstor64 mnemonics instead of old-school rex64 prefix
339688 Mac-specific ASM does not support .version directive (cpuid,
tronical and pushfpopf tests)
339745 Valgrind crash when check Marmalade app (partial fix)
diff --git a/memcheck/tests/amd64/fxsave-amd64.c b/memcheck/tests/amd64/fxsave-amd64.c
index 49281dd..de04037 100644
--- a/memcheck/tests/amd64/fxsave-amd64.c
+++ b/memcheck/tests/amd64/fxsave-amd64.c
@@ -17,7 +17,11 @@
__attribute__((noinline))
void do_fxsave ( void* p, int rexw ) {
if (rexw) {
+#if defined(VGO_linux)
+ asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
+#else
asm __volatile__("rex64/fxsave (%0)" : : "r" (p) : "memory" );
+#endif
} else {
asm __volatile__("fxsave (%0)" : : "r" (p) : "memory" );
}
@@ -26,7 +30,11 @@
__attribute__((noinline))
void do_fxrstor ( void* p, int rexw ) {
if (rexw) {
+#if defined(VGO_linux)
+ asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
+#else
asm __volatile__("rex64/fxrstor (%0)" : : "r" (p) : "memory" );
+#endif
} else {
asm __volatile__("fxrstor (%0)" : : "r" (p) : "memory" );
}