aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-10 14:48:44 -0300
committerPranav Kant <prka@google.com>2023-09-27 19:03:26 +0000
commitaacd7e0eb6429854f6133bea49c1c4938ff30608 (patch)
treed7ed18c576dbe2c5ead60786f6e6c58189234884
parentfe59db4d1bb6e1030cfb95fa800503191ad4c4e8 (diff)
downloadglibc-aacd7e0eb6429854f6133bea49c1c4938ff30608.zip
glibc-aacd7e0eb6429854f6133bea49c1c4938ff30608.tar.gz
glibc-aacd7e0eb6429854f6133bea49c1c4938ff30608.tar.bz2
math: x86: Use prefix for FP_INIT_ROUNDMODE
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.
-rw-r--r--sysdeps/x86/fpu/sfp-machine.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h
index fcbcf69..f06e3c0 100644
--- a/sysdeps/x86/fpu/sfp-machine.h
+++ b/sysdeps/x86/fpu/sfp-machine.h
@@ -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