From: Daniel Cederman Date: Mon, 15 Jan 2024 14:53:44 +0000 (+0100) Subject: sparc: Use existing macros to avoid code duplication X-Git-Tag: glibc-2.39~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3bb1350c3681c5ca330dd92500dc59fba94b37eb;p=thirdparty%2Fglibc.git sparc: Use existing macros to avoid code duplication 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 Reviewed-by: Adhemerval Zanella --- diff --git a/sysdeps/sparc/fpu/fenv_private.h b/sysdeps/sparc/fpu/fenv_private.h index da7c7fe332f..a31ba3cc7ba 100644 --- a/sysdeps/sparc/fpu/fenv_private.h +++ b/sysdeps/sparc/fpu/fenv_private.h @@ -2,15 +2,11 @@ #define SPARC_FENV_PRIVATE_H 1 #include +#include /* 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)