]> sourceware.org Git - 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)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 5 Sep 2022 13:54:41 +0000 (10:54 -0300)
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 5892f4f5fe58d1a01b45232c1bc234db45af7ba4..bc3fe332df58f8418f2e02605b402151732cfc5b 100644 (file)
@@ -39,9 +39,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
This page took 0.046733 seconds and 5 git commands to generate.