aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/x86
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-03-10 14:48:44 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2022-09-05 10:54:41 -0300
commit2fc7320668ee843f9d1e5a2ec6c6fdbf00c735a3 (patch)
tree318b1aac031ffd33005b14f3b9abebc43c0ecb8d /sysdeps/x86
parent0784e7913f97370388d590b32afeab48522b7026 (diff)
downloadglibc-2fc7320668ee843f9d1e5a2ec6c6fdbf00c735a3.zip
glibc-2fc7320668ee843f9d1e5a2ec6c6fdbf00c735a3.tar.gz
glibc-2fc7320668ee843f9d1e5a2ec6c6fdbf00c735a3.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.
Diffstat (limited to 'sysdeps/x86')
-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 5892f4f..bc3fe33 100644
--- a/sysdeps/x86/fpu/sfp-machine.h
+++ b/sysdeps/x86/fpu/sfp-machine.h
@@ -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