]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
sparc: Use existing macros to avoid code duplication
authorDaniel Cederman <cederman@gaisler.com>
Mon, 15 Jan 2024 14:53:44 +0000 (15:53 +0100)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 18 Jan 2024 11:27:43 +0000 (08:27 -0300)
Macros for using inline assembly to access the fp state register exists
in both fenv_private.h and in fpu_control.h. Let fenv_private.h use the
macros from fpu_control.h

Signed-off-by: Daniel Cederman <cederman@gaisler.com>
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/sparc/fpu/fenv_private.h

index da7c7fe332f54895f49aed62be4de0957629c510..a31ba3cc7baaa1476d4000cf28511db263ffbe71 100644 (file)
@@ -2,15 +2,11 @@
 #define SPARC_FENV_PRIVATE_H 1
 
 #include <fenv.h>
+#include <fpu_control.h>
 
 /* For internal use only: access the fp state register.  */
-#if __WORDSIZE == 64
-# define __fenv_stfsr(X)   __asm__ __volatile__ ("stx %%fsr,%0" : "=m" (X))
-# define __fenv_ldfsr(X)   __asm__ __volatile__ ("ldx %0,%%fsr" : : "m" (X))
-#else
-# define __fenv_stfsr(X)   __asm__ __volatile__ ("st %%fsr,%0" : "=m" (X))
-# define __fenv_ldfsr(X)   __asm__ __volatile__ ("ld %0,%%fsr" : : "m" (X))
-#endif
+#define __fenv_stfsr(X)   _FPU_GETCW (X)
+#define __fenv_ldfsr(X)   _FPU_SETCW (X)
 
 static __always_inline void
 libc_feholdexcept (fenv_t *e)