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