public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] sparc: Use existing macros to avoid code duplication
@ 2024-01-18 11:47 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2024-01-18 11:47 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3bb1350c3681c5ca330dd92500dc59fba94b37eb

commit 3bb1350c3681c5ca330dd92500dc59fba94b37eb
Author: Daniel Cederman <cederman@gaisler.com>
Date:   Mon Jan 15 15:53:44 2024 +0100

    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 <cederman@gaisler.com>
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 sysdeps/sparc/fpu/fenv_private.h | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/sysdeps/sparc/fpu/fenv_private.h b/sysdeps/sparc/fpu/fenv_private.h
index da7c7fe332..a31ba3cc7b 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 <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)

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

only message in thread, other threads:[~2024-01-18 11:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 11:47 [glibc] sparc: Use existing macros to avoid code duplication 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).