From: Adhemerval Zanella Date: Thu, 10 Mar 2022 17:48:44 +0000 (-0300) Subject: math: x86: Use prefix for FP_INIT_ROUNDMODE X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aacd7e0eb6429854f6133bea49c1c4938ff30608;p=thirdparty%2Fglibc.git 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 --git a/sysdeps/x86/fpu/sfp-machine.h b/sysdeps/x86/fpu/sfp-machine.h index fcbcf690531..f06e3c0ca12 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