public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] math: x86: Use prefix for FP_INIT_ROUNDMODE
@ 2022-09-05 14:01 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2022-09-05 14:01 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2fc7320668ee843f9d1e5a2ec6c6fdbf00c735a3

commit 2fc7320668ee843f9d1e5a2ec6c6fdbf00c735a3
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 14:48:44 2022 -0300

    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.

Diff:
---
 sysdeps/x86/fpu/sfp-machine.h | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h
index 5892f4f5fe..bc3fe332df 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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-09-05 14:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-05 14:01 [glibc] math: x86: Use prefix for FP_INIT_ROUNDMODE Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).