public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Michael Meissner <meissner@linux.ibm.com>
To: Michael Meissner <meissner@linux.ibm.com>,
	gcc-patches@gcc.gnu.org,
	Segher Boessenkool <segher@kernel.crashing.org>,
	"Kewen.Lin" <linkw@linux.ibm.com>,
	David Edelsohn <dje.gcc@gmail.com>,
	Peter Bergner <bergner@linux.ibm.com>,
	Will Schmidt <will_schmidt@vnet.ibm.com>
Subject: [PATCH 5/5] Support IEEE 128-bit overload test data built-in functions.
Date: Thu, 28 Jul 2022 00:54:15 -0400	[thread overview]
Message-ID: <YuIWd+k7A3+lf6Hd@toto.the-meissners.org> (raw)
In-Reply-To: <YuIUBVkLjqjYMZhp@toto.the-meissners.org>

[PATCH 5/5] Support IEEE 128-bit overload test data built-in functions.

This patch adds support for overloading the IEEE 128-bit test data and
test data negate built-in functions bewteeen KFmode and TFmode arguments.

I have tested these patches on a power10 that is running Fedora 36, which
defaults to using long doubles that are IEEE 128-bit.  I have built two
parallel GCC compilers, one that defaults to using IEEE 128-bit long doubles
and one that defaults to using IBM 128-bit long doubles.

I have compared the test results to the original compiler results, comparing a
modified GCC to the original compiler using an IEEE 128-bit long double
default, and also comparing a modified GCC to the original compiler using an
IBM 128-bit long double default.  In both cases, the results are the same.

I have also compared the compilers with the future patch in progress that does
switch the internal type handling.  Once those patches are installed, the
overload mechanism will insure the correct built-in is used.

Can I install this patch to the trunk, assuming I have installed the first
four patches in the series?

2022-07-27   Michael Meissner  <meissner@linux.ibm.com>

gcc/

	* config/rs6000/rs6000-builtins.def
	(__builtin_vsx_scalar_test_data_class_qp_kf): Rename KFmode IEEE
	128-bit test data built-in functions to have a KF suffix to allow
	overloading.
	(__builtin_vsx_scalar_test_neg_qp_kf): Likewise.
	(__builtin_vsx_scalar_test_data_class_qp_tf): Add TFmode variants
	for IEEE 128-bit insert and extract support.
	(__builtin_vsx_scalar_test_neg_qp_tf): Likewise.
	* config/rs6000/rs6000-overload.def
	(__builtin_vec_scalar_test_data_class): Add TFmode overloads.
	(__builtin_vec_scalar_test_neg): Likewise.
	(__builtin_vec_scalar_test_neg_qp): Likewise.
	(__builtin_vec_scalar_test_data_class_qp): Likewise.

gcc/testsuite/

	* gcc.target/powerpc/bfp/scalar-test-data-class-11.c:  Update the
	expected error message.
	* gcc.target/powerpc/bfp/scalar-test-neg-5.c: Likewise.
---
 gcc/config/rs6000/rs6000-builtins.def          | 17 ++++++++++++-----
 gcc/config/rs6000/rs6000-overload.def          | 18 +++++++++++++-----
 .../powerpc/bfp/scalar-test-data-class-11.c    |  2 +-
 .../gcc.target/powerpc/bfp/scalar-test-neg-5.c |  2 +-
 4 files changed, 27 insertions(+), 12 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-builtins.def b/gcc/config/rs6000/rs6000-builtins.def
index 2ac66b39975..e12efc95965 100644
--- a/gcc/config/rs6000/rs6000-builtins.def
+++ b/gcc/config/rs6000/rs6000-builtins.def
@@ -2918,12 +2918,12 @@
 							 unsigned long long);
     VSIEQPF_KF xsiexpqpf_kf {}
 
-  const signed int __builtin_vsx_scalar_test_data_class_qp (_Float128, \
-                                                            const int<7>);
-    VSTDCQP xststdcqp_kf {}
+  const signed int __builtin_vsx_scalar_test_data_class_qp_kf (_Float128, \
+							       const int<7>);
+    VSTDCQP_KF xststdcqp_kf {}
 
-  const signed int __builtin_vsx_scalar_test_neg_qp (_Float128);
-    VSTDCNQP xststdcnegqp_kf {}
+  const signed int __builtin_vsx_scalar_test_neg_qp_kf (_Float128);
+    VSTDCNQP_KF xststdcnegqp_kf {}
 
 
 ; Builtins requiring hardware support for IEEE-128 floating-point.  Long double
@@ -2980,6 +2980,13 @@
 							   unsigned long long);
     VSIEQPF_TF xsiexpqpf_tf {ieeeld}
 
+  const signed int __builtin_vsx_scalar_test_data_class_qp_tf (_Float128, \
+							       const int<7>);
+    VSTDCQP_TF xststdcqp_tf {ieeeld}
+
+  const signed int __builtin_vsx_scalar_test_neg_qp_tf (_Float128);
+    VSTDCNQP_TF xststdcnegqp_tf {ieeeld}
+
 
 ; Decimal floating-point builtins.
 [dfp]
diff --git a/gcc/config/rs6000/rs6000-overload.def b/gcc/config/rs6000/rs6000-overload.def
index 546883ece19..572e3510360 100644
--- a/gcc/config/rs6000/rs6000-overload.def
+++ b/gcc/config/rs6000/rs6000-overload.def
@@ -4536,7 +4536,9 @@
   unsigned int __builtin_vec_scalar_test_data_class (double, const int);
     VSTDCDP
   unsigned int __builtin_vec_scalar_test_data_class (_Float128, const int);
-    VSTDCQP
+    VSTDCQP_KF
+  unsigned int __builtin_vec_scalar_test_data_class (long double, const int);
+    VSTDCQP_TF
 
 [VEC_VSTDCN, scalar_test_neg, __builtin_vec_scalar_test_neg]
   unsigned int __builtin_vec_scalar_test_neg (float);
@@ -4544,7 +4546,9 @@
   unsigned int __builtin_vec_scalar_test_neg (double);
     VSTDCNDP
   unsigned int __builtin_vec_scalar_test_neg (_Float128);
-    VSTDCNQP
+    VSTDCNQP_KF
+  unsigned int __builtin_vec_scalar_test_neg (long double);
+    VSTDCNQP_TF
 
 [VEC_VTDC, vec_test_data_class, __builtin_vec_test_data_class]
   vbi __builtin_vec_test_data_class (vf, const int);
@@ -5928,9 +5932,11 @@
   unsigned int __builtin_vec_scalar_test_neg_dp (double);
     VSTDCNDP  VSTDCNDP_DEPR1
 
-[VEC_VSTDCNQP, scalar_test_neg_qp, __builtin_vec_scalar_test_neg_qp]
+[VEC_VSTDCNQP_KF, scalar_test_neg_qp, __builtin_vec_scalar_test_neg_qp]
   unsigned int __builtin_vec_scalar_test_neg_qp (_Float128);
-    VSTDCNQP  VSTDCNQP_DEPR1
+    VSTDCNQP_KF  VSTDCNQP_KF_DEPR1
+  unsigned int __builtin_vec_scalar_test_neg_qp (long double);
+    VSTDCNQP_TF  VSTDCNQP_TF_DEPR1
 
 [VEC_VSTDCNSP, scalar_test_neg_sp, __builtin_vec_scalar_test_neg_sp]
   unsigned int __builtin_vec_scalar_test_neg_sp (float);
@@ -5938,7 +5944,9 @@
 
 [VEC_VSTDCQP, scalar_test_data_class_qp, __builtin_vec_scalar_test_data_class_qp]
   unsigned int __builtin_vec_scalar_test_data_class_qp (_Float128, const int);
-    VSTDCQP  VSTDCQP_DEPR1
+    VSTDCQP_KF  VSTDCQP_KF_DEPR1
+  unsigned int __builtin_vec_scalar_test_data_class_qp (long double, const int);
+    VSTDCQP_TF  VSTDCQP_TF_DEPR1
 
 [VEC_VSTDCSP, scalar_test_data_class_sp, __builtin_vec_scalar_test_data_class_sp]
   unsigned int __builtin_vec_scalar_test_data_class_sp (float, const int);
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c
index 7c6fca2b729..82da5956e05 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-data-class-11.c
@@ -10,5 +10,5 @@ test_data_class (__ieee128 *p)
 {
   __ieee128 source = *p;
 
-  return __builtin_vec_scalar_test_data_class (source, 3); /* { dg-error "'__builtin_vsx_scalar_test_data_class_qp' requires" } */
+  return __builtin_vec_scalar_test_data_class (source, 3); /* { dg-error "'__builtin_vsx_scalar_test_data_class_qp.*' requires" } */
 }
diff --git a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-5.c b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-5.c
index 8c55c1cfb5c..eef02f40f3d 100644
--- a/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-5.c
+++ b/gcc/testsuite/gcc.target/powerpc/bfp/scalar-test-neg-5.c
@@ -10,5 +10,5 @@ test_neg (__ieee128 *p)
 {
   __ieee128 source = *p;
 
-  return __builtin_vec_scalar_test_neg (source); /* { dg-error "'__builtin_vsx_scalar_test_neg_qp' requires" } */
+  return __builtin_vec_scalar_test_neg (source); /* { dg-error "'__builtin_vsx_scalar_test_neg_qp.*' requires" } */
 }
-- 
2.35.3


-- 
Michael Meissner, IBM
PO Box 98, Ayer, Massachusetts, USA, 01432
email: meissner@linux.ibm.com

  parent reply	other threads:[~2022-07-28  4:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-28  4:43 [PATCH 0/5] IEEE 128-bit built-in overload support Michael Meissner
2022-07-28  4:47 ` [PATCH 1/5] " Michael Meissner
2022-07-28  4:48 ` [PATCH 2/5] Support IEEE 128-bit overload round_to_odd built-in functions Michael Meissner
2022-07-28  4:50 ` [PATCH 3/5] Support IEEE 128-bit overload comparison " Michael Meissner
2022-07-28  4:52 ` [PATCH 4/5] Support IEEE 128-bit overload extract and insert " Michael Meissner
2022-07-28  4:54 ` Michael Meissner [this message]
2022-08-03 17:58 ` Ping: [PATCH 0/5] IEEE 128-bit built-in overload support Michael Meissner
2022-08-05 18:19 ` Segher Boessenkool
2022-08-10  6:23   ` Michael Meissner
2022-08-10 17:03     ` Segher Boessenkool
2022-08-11 20:01       ` Michael Meissner
2022-08-11 20:44         ` Joseph Myers
2022-08-16 18:07           ` Jakub Jelinek
2022-08-16 18:55             ` Segher Boessenkool

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=YuIWd+k7A3+lf6Hd@toto.the-meissners.org \
    --to=meissner@linux.ibm.com \
    --cc=bergner@linux.ibm.com \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=linkw@linux.ibm.com \
    --cc=segher@kernel.crashing.org \
    --cc=will_schmidt@vnet.ibm.com \
    /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).