Fix bug #339636 Use fxsave64 and fxrstor64 mnemonics again.

Just add a configure check to see if the assembler understands
fxsave64/fxrstor64 and fall back to the old-school rex64 prefix
otherwise.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15625 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.ac b/configure.ac
index 95bc904..f257d93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2231,6 +2231,24 @@
 fi
 
 
+# does the amd64 assembler understand "fxsave64" and "fxrstor64"?
+AC_MSG_CHECKING([if amd64 assembler supports fxsave64/fxrstor64])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+void* p;
+asm __volatile__("fxsave64 (%0)" : : "r" (p) : "memory" );
+asm __volatile__("fxrstor64 (%0)" : : "r" (p) : "memory" );
+]])], [
+ac_have_as_amd64_fxsave64=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_as_amd64_fxsave64=no
+AC_MSG_RESULT([no])
+])
+if test x$ac_have_as_amd64_fxsave64 = xyes ; then
+  AC_DEFINE(HAVE_AS_AMD64_FXSAVE64, 1, [Define to 1 if as supports fxsave64/fxrstor64.])
+fi
+
 # does the x86/amd64 assembler understand SSE3 instructions?
 # Note, this doesn't generate a C-level symbol.  It generates a
 # automake-level symbol (BUILD_SSE3_TESTS), used in test Makefile.am's