public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] sparc: Use existing macros to avoid code duplication
Date: Thu, 18 Jan 2024 11:47:49 +0000 (GMT)	[thread overview]
Message-ID: <20240118114750.06C9F3858D33@sourceware.org> (raw)

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)

                 reply	other threads:[~2024-01-18 11:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240118114750.06C9F3858D33@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).