From f57ad21fa94e7477c12ea885cf9d3b1aedfc7860 Mon Sep 17 00:00:00 2001 From: Rhys Kidd Date: Sat, 9 May 2015 23:32:13 +0000 Subject: [PATCH] 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 --- NEWS | 1 + memcheck/tests/amd64/fxsave-amd64.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 89a2c3d52a..4d88267914 100644 --- a/NEWS +++ b/NEWS @@ -87,6 +87,7 @@ where XXXXXX is the bug number as listed below. 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 49281dd8e4..de0403763d 100644 --- a/memcheck/tests/amd64/fxsave-amd64.c +++ b/memcheck/tests/amd64/fxsave-amd64.c @@ -17,7 +17,11 @@ const unsigned int vecZ[4] __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 @@ void do_fxsave ( void* p, int rexw ) { __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" ); } -- 2.47.3