]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
math: x86: Use prefix for FP_INIT_ROUNDMODE
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 10 Mar 2022 17:48:44 +0000 (14:48 -0300)
committerPranav Kant <prka@google.com>
Wed, 27 Sep 2023 19:03:26 +0000 (19:03 +0000)
Not all compilers support the inline asm prefix '%v' to emit the avx
instruction if AVX is enable.  Use a prefix instead.

Checked on x86_64-linux-gnu and i686-linux-gnu.

sysdeps/x86/fpu/sfp-machine.h

index fcbcf690531b7beb16626183729cb3d941f317a9..f06e3c0ca12a12e1aaed8f0a80841925475e4083 100644 (file)
@@ -48,9 +48,15 @@ typedef unsigned int UTItype __attribute__ ((mode (TI)));
 
 # define FP_RND_MASK           0x6000
 
+# ifdef __AVX__
+#  define AVX_INSN_PREFIX      "v"
+# else
+#  define AVX_INSN_PREFIX      ""
+# endif
+
 # define FP_INIT_ROUNDMODE                                     \
   do {                                                         \
-    __asm__ __volatile__ ("%vstmxcsr\t%0" : "=m" (_fcw));      \
+    __asm__ __volatile__ (AVX_INSN_PREFIX "stmxcsr\t%0" : "=m" (_fcw)); \
   } while (0)
 #else
 # define _FP_W_TYPE_SIZE       32