On 4/27/21 10:32 AM, Bill Schmidt wrote:
The design of the target-specific built-in function support in the
Power back end has not stood the test of time.  The machinery is
grossly inefficient, confusing, and arcane; and adding new built-in
functions is inefficient and error-prone.  This patch set introduces a
replacement.

After I submitted these patches, Iain Sandoe was kind enough to test them on a PPC 970 running Darwin, and uncovered a couple of bugs.  I appreciate the extra testing!

This is the second of two patches to fix these problems.  This one is simple:  I had unnecessarily restricted two built-ins to Power5 or later, when they should be treated as always available. Fixed by moving them to the correct stanza in rs6000-builtin-new.def.

I'd appreciate consideration of this patch along with the rest of the patch set.  Thank you!

Bill

2021-04-29  Bill Schmidt  <wschm...@linux.ibm.com>

gcc/
        * config/rs6000/rs6000-builtin-new.def
        (__builtin_pack_longdouble): Move from [power5] to [always].
        (__builtin_unpack_longdouble): Likewise.
---
 gcc/config/rs6000/rs6000-builtin-new.def | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtin-new.def 
b/gcc/config/rs6000/rs6000-builtin-new.def
index 0ff2a0e1ed1..f106e1de1fd 100644
--- a/gcc/config/rs6000/rs6000-builtin-new.def
+++ b/gcc/config/rs6000/rs6000-builtin-new.def
@@ -208,6 +208,10 @@
   double __builtin_mffs ();
     MFFS rs6000_mffs {}
+; This will break for long double == _Float128. libgcc history.
+  const long double __builtin_pack_longdouble (double, double);
+    PACK_TF packtf {}
+
   unsigned long __builtin_ppc_mftb ();
     MFTB rs6000_mftb_di {32bit}
@@ -229,13 +233,13 @@
   const double __builtin_unpack_ibm128 (__ibm128, const int<1>);
     UNPACK_IF unpackif {}
+; This will break for long double == _Float128. libgcc history.
+  const double __builtin_unpack_longdouble (long double, const int<1>);
+    UNPACK_TF unpacktf {}
+
; Builtins that have been around just about forever, but not quite.
 [power5]
-; This will break for long double == _Float128.  libgcc history.
-  const long double __builtin_pack_longdouble (double, double);
-    PACK_TF packtf {}
-
   fpmath double __builtin_recipdiv (double, double);
     RECIP recipdf3 {}
@@ -248,10 +252,6 @@
   fpmath float __builtin_rsqrtf (float);
     RSQRTF rsqrtsf2 {}
-; This will break for long double == _Float128. libgcc history.
-  const double __builtin_unpack_longdouble (long double, const int<1>);
-    UNPACK_TF unpacktf {}
-
; Power6 builtins.
 [power6]
--
2.27.0


Reply via email to