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