dfa500
commit 81ecb0ee4970865cbe5d1da733c4879b999c528f
dfa500
Author: Paul A. Clarke <pc@us.ibm.com>
dfa500
Date:   Thu Sep 19 11:58:46 2019 -0500
dfa500
dfa500
    [powerpc] Rename fegetenv_status to fegetenv_control
dfa500
    
dfa500
    fegetenv_status is used variously to retrieve the FPSCR exception enable
dfa500
    bits, rounding mode bits, or both.  These are referred to as the control
dfa500
    bits in the POWER ISA.  FPSCR status bits are also returned by the
dfa500
    'mffs' and 'mffsl' instructions, but they are uniformly ignored by all
dfa500
    uses of fegetenv_status.  Change the name to be reflective of its
dfa500
    current and expected use.
dfa500
    
dfa500
    Reviewed-By: Paul E Murphy <murphyp@linux.ibm.com>
dfa500
dfa500
diff --git a/sysdeps/powerpc/fpu/fedisblxcpt.c b/sysdeps/powerpc/fpu/fedisblxcpt.c
dfa500
index bdf55ac62f1ffe4f..1273987459655585 100644
dfa500
--- a/sysdeps/powerpc/fpu/fedisblxcpt.c
dfa500
+++ b/sysdeps/powerpc/fpu/fedisblxcpt.c
dfa500
@@ -26,7 +26,7 @@ fedisableexcept (int excepts)
dfa500
   int result, new;
dfa500
 
dfa500
   /* Get current exception mask to return.  */
dfa500
-  fe.fenv = curr.fenv = fegetenv_status ();
dfa500
+  fe.fenv = curr.fenv = fegetenv_control ();
dfa500
   result = fenv_reg_to_exceptions (fe.l);
dfa500
 
dfa500
   if ((excepts & FE_ALL_INVALID) == FE_ALL_INVALID)
dfa500
diff --git a/sysdeps/powerpc/fpu/feenablxcpt.c b/sysdeps/powerpc/fpu/feenablxcpt.c
dfa500
index 78ebabed9232c0ad..fa233c305aedd5f6 100644
dfa500
--- a/sysdeps/powerpc/fpu/feenablxcpt.c
dfa500
+++ b/sysdeps/powerpc/fpu/feenablxcpt.c
dfa500
@@ -26,7 +26,7 @@ feenableexcept (int excepts)
dfa500
   int result, new;
dfa500
 
dfa500
   /* Get current exception mask to return.  */
dfa500
-  fe.fenv = curr.fenv = fegetenv_status ();
dfa500
+  fe.fenv = curr.fenv = fegetenv_control ();
dfa500
   result = fenv_reg_to_exceptions (fe.l);
dfa500
 
dfa500
   if ((excepts & FE_ALL_INVALID) == FE_ALL_INVALID)
dfa500
diff --git a/sysdeps/powerpc/fpu/fegetexcept.c b/sysdeps/powerpc/fpu/fegetexcept.c
dfa500
index 9d77adea59939ece..6bbf11d9d5df61e5 100644
dfa500
--- a/sysdeps/powerpc/fpu/fegetexcept.c
dfa500
+++ b/sysdeps/powerpc/fpu/fegetexcept.c
dfa500
@@ -25,7 +25,7 @@ __fegetexcept (void)
dfa500
   fenv_union_t fe;
dfa500
   int result = 0;
dfa500
 
dfa500
-  fe.fenv = fegetenv_status ();
dfa500
+  fe.fenv = fegetenv_control ();
dfa500
 
dfa500
   if (fe.l & (1 << (31 - FPSCR_XE)))
dfa500
       result |= FE_INEXACT;
dfa500
diff --git a/sysdeps/powerpc/fpu/fegetmode.c b/sysdeps/powerpc/fpu/fegetmode.c
dfa500
index 75493e5f24c8b05b..57d6d5275485ebdc 100644
dfa500
--- a/sysdeps/powerpc/fpu/fegetmode.c
dfa500
+++ b/sysdeps/powerpc/fpu/fegetmode.c
dfa500
@@ -21,6 +21,6 @@
dfa500
 int
dfa500
 fegetmode (femode_t *modep)
dfa500
 {
dfa500
-  *modep = fegetenv_status ();
dfa500
+  *modep = fegetenv_control ();
dfa500
   return 0;
dfa500
 }
dfa500
diff --git a/sysdeps/powerpc/fpu/fenv_libc.h b/sysdeps/powerpc/fpu/fenv_libc.h
dfa500
index c3f541c08440b20e..b5c8da1adefe93cb 100644
dfa500
--- a/sysdeps/powerpc/fpu/fenv_libc.h
dfa500
+++ b/sysdeps/powerpc/fpu/fenv_libc.h
dfa500
@@ -61,7 +61,7 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden;
dfa500
    'mffs' on architectures older than "power9" because the additional
dfa500
    bits set for 'mffsl' are "don't care" for 'mffs'.  'mffs' is a superset
dfa500
    of 'mffsl'.  */
dfa500
-#define fegetenv_status()					\
dfa500
+#define fegetenv_control()					\
dfa500
   ({register double __fr;						\
dfa500
     __asm__ __volatile__ (						\
dfa500
       ".machine push; .machine \"power9\"; mffsl %0; .machine pop"	\
dfa500
@@ -85,7 +85,7 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden;
dfa500
     __fr.fenv;								\
dfa500
   })
dfa500
 
dfa500
-/* Like fegetenv_status, but also sets the rounding mode.  */
dfa500
+/* Like fegetenv_control, but also sets the rounding mode.  */
dfa500
 #ifdef _ARCH_PWR9
dfa500
 #define fegetenv_and_set_rn(rn) __fe_mffscrn (rn)
dfa500
 #else
dfa500
@@ -116,7 +116,7 @@ extern const fenv_t *__fe_mask_env (void) attribute_hidden;
dfa500
 
dfa500
 /* Set the last 2 nibbles of the FPSCR, which contain the
dfa500
    exception enables and the rounding mode.
dfa500
-   'fegetenv_status' retrieves these bits by reading the FPSCR.  */
dfa500
+   'fegetenv_control' retrieves these bits by reading the FPSCR.  */
dfa500
 #define fesetenv_mode(env) __builtin_mtfsf (0b00000011, (env));
dfa500
 
dfa500
 /* This very handy macro:
dfa500
diff --git a/sysdeps/powerpc/fpu/fesetenv.c b/sysdeps/powerpc/fpu/fesetenv.c
dfa500
index 4eab5045c48105e3..252114141cd87f8d 100644
dfa500
--- a/sysdeps/powerpc/fpu/fesetenv.c
dfa500
+++ b/sysdeps/powerpc/fpu/fesetenv.c
dfa500
@@ -26,7 +26,7 @@ __fesetenv (const fenv_t *envp)
dfa500
 
dfa500
   /* get the currently set exceptions.  */
dfa500
   new.fenv = *envp;
dfa500
-  old.fenv = fegetenv_status ();
dfa500
+  old.fenv = fegetenv_control ();
dfa500
 
dfa500
   __TEST_AND_EXIT_NON_STOP (old.l, new.l);
dfa500
   __TEST_AND_ENTER_NON_STOP (old.l, new.l);
dfa500
diff --git a/sysdeps/powerpc/fpu/fesetmode.c b/sysdeps/powerpc/fpu/fesetmode.c
dfa500
index 58ba02c0a1e64c27..e5938af04cb71ca1 100644
dfa500
--- a/sysdeps/powerpc/fpu/fesetmode.c
dfa500
+++ b/sysdeps/powerpc/fpu/fesetmode.c
dfa500
@@ -27,7 +27,7 @@ fesetmode (const femode_t *modep)
dfa500
   /* Logic regarding enabled exceptions as in fesetenv.  */
dfa500
 
dfa500
   new.fenv = *modep;
dfa500
-  old.fenv = fegetenv_status ();
dfa500
+  old.fenv = fegetenv_control ();
dfa500
   new.l = (new.l & ~FPSCR_STATUS_MASK) | (old.l & FPSCR_STATUS_MASK);
dfa500
 
dfa500
   if (old.l == new.l)