public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/meissner/heads/work078)] Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
@ 2022-02-15 16:59 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2022-02-15 16:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:fbba485fd024ba15d8c6940614f44e87c6a5e7c1

commit fbba485fd024ba15d8c6940614f44e87c6a5e7c1
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Tue Feb 15 11:59:08 2022 -0500

    Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
    
    Define the sizes of the PowerPC specific types __float128 and __ibm128.
    
    2022-02-15  Michael Meissner  <meissner@the-meissners.org>
    
    gcc/
            PR target/99708
            * config/rs6000/rs6000-c.cc (rs6000_target_modify_macros): Define
            __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ if we have float128
            support.
    
    gcc/testsuite/
            PR target/99708
            * gcc.target/powerpc/pr99708.c: New test.

Diff:
---
 gcc/config/rs6000/rs6000-c.cc              | 12 ++++++++++--
 gcc/testsuite/gcc.target/powerpc/pr99708.c | 21 +++++++++++++++++++++
 2 files changed, 31 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index 15251efc209..b5f771d1308 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -581,9 +581,17 @@ rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags,
     {
       rs6000_define_or_undefine_macro (define_p, "__FLOAT128__");
       if (define_p)
-	rs6000_define_or_undefine_macro (true, "__float128=__ieee128");
+	{
+	  rs6000_define_or_undefine_macro (true, "__float128=__ieee128");
+	  rs6000_define_or_undefine_macro (true, "__SIZEOF_FLOAT128__=16");
+	  rs6000_define_or_undefine_macro (true, "__SIZEOF_IBM128__=16");
+	}
       else
-	rs6000_define_or_undefine_macro (false, "__float128");
+	{
+	  rs6000_define_or_undefine_macro (false, "__float128");
+	  rs6000_define_or_undefine_macro (false, "__SIZEOF_FLOAT128__");
+	  rs6000_define_or_undefine_macro (false, "__SIZEOF_IBM128__");
+	}
     }
   /* OPTION_MASK_FLOAT128_HARDWARE can be turned on if -mcpu=power9 is used or
      via the target attribute/pragma.  */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c b/gcc/testsuite/gcc.target/powerpc/pr99708.c
new file mode 100644
index 00000000000..d478f7bc4c0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx -mfloat128" } */
+
+/*
+ * PR target/99708
+ *
+ * Verify that __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ are properly defined.
+ */
+
+#include <stdlib.h>
+
+int main (void)
+{
+  if (__SIZEOF_FLOAT128__ != sizeof (__float128)
+      || __SIZEOF_IBM128__ != sizeof (__ibm128))
+    abort ();
+
+  return 0;
+}
+


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/meissner/heads/work078)] Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
@ 2022-02-17  0:37 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2022-02-17  0:37 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8dce1b423d3705fd8ba7923f5ffbd0cc8af89239

commit 8dce1b423d3705fd8ba7923f5ffbd0cc8af89239
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Wed Feb 16 19:36:17 2022 -0500

    Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
    
    Define the sizes of the PowerPC specific types __float128 and __ibm128 if those
    types are enabled.
    
    This patch will define __SIZEOF_IBM128__ and __SIZEOF_FLOAT128__ if their
    respective types are created in the compiler.  Currently, this means both of
    these will be defined if float128 support is enabled.  But at some point in
    the future, __ibm128 could be enabled without enabling float128 support and
    __SIZEOF_IBM128__ would be defined.
    
    2022-02-16  Michael Meissner  <meissner@the-meissners.org>
    
    gcc/
            PR target/99708
            * config/rs6000/rs6000-c.cc (rs6000_cpu_cpp_builtins): Define
            __SIZEOF_IBM128__ if the IBM 128-bit long double type is created.
            Define __SIZEOF_FLOAT128__ if the IEEE 128-bit floating point type
             is created.
    
    gcc/testsuite/
            PR target/99708
            * gcc.target/powerpc/pr99708.c: New test.

Diff:
---
 gcc/config/rs6000/rs6000-c.cc              |  6 +++++-
 gcc/testsuite/gcc.target/powerpc/pr99708.c | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index 15251efc209..d2e480ad7df 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -623,7 +623,11 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
   if (TARGET_FRSQRTES)
     builtin_define ("__RSQRTEF__");
   if (TARGET_FLOAT128_TYPE)
-    builtin_define ("__FLOAT128_TYPE__");
+      builtin_define ("__FLOAT128_TYPE__");
+  if (ibm128_float_type_node)
+    builtin_define ("__SIZEOF_IBM128__=16");
+  if (ieee128_float_type_node)
+    builtin_define ("__SIZEOF_FLOAT128__=16");
 #ifdef TARGET_LIBC_PROVIDES_HWCAP_IN_TCB
   builtin_define ("__BUILTIN_CPU_SUPPORTS__");
 #endif
diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c b/gcc/testsuite/gcc.target/powerpc/pr99708.c
new file mode 100644
index 00000000000..d478f7bc4c0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx -mfloat128" } */
+
+/*
+ * PR target/99708
+ *
+ * Verify that __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ are properly defined.
+ */
+
+#include <stdlib.h>
+
+int main (void)
+{
+  if (__SIZEOF_FLOAT128__ != sizeof (__float128)
+      || __SIZEOF_IBM128__ != sizeof (__ibm128))
+    abort ();
+
+  return 0;
+}
+


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/meissner/heads/work078)] Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
@ 2022-02-16 20:25 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2022-02-16 20:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:dcfc76034e46e8be67f92f427c16293b04a0febe

commit dcfc76034e46e8be67f92f427c16293b04a0febe
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Wed Feb 16 15:25:09 2022 -0500

    Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
    
    Define the sizes of the PowerPC specific types __float128 and __ibm128 if those
    types are enabled.
    
    2022-02-16  Michael Meissner  <meissner@the-meissners.org>
    
    gcc/
            PR target/99708
            * config/rs6000/rs6000-c.cc (rs6000_cpu_cpp_builtins): Define
            __SIZEOF_IBM128__ if the IBM 128-bit long double type is created.
            Define __SIZEOF_FLOAT128__ if we have float128 support.
    
    gcc/testsuite/
            PR target/99708
            * gcc.target/powerpc/pr99708.c: New test.

Diff:
---
 gcc/config/rs6000/rs6000-c.cc              |  7 ++++++-
 gcc/testsuite/gcc.target/powerpc/pr99708.c | 21 +++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index 15251efc209..ec4e5c3f53a 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -622,8 +622,13 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
     builtin_define ("__RSQRTE__");
   if (TARGET_FRSQRTES)
     builtin_define ("__RSQRTEF__");
+  if (ibm128_float_type_node)
+    builtin_define ("__SIZEOF_IBM128__=16");
   if (TARGET_FLOAT128_TYPE)
-    builtin_define ("__FLOAT128_TYPE__");
+    {
+      builtin_define ("__FLOAT128_TYPE__");
+      builtin_define ("__SIZEOF_FLOAT128__=16");
+    }
 #ifdef TARGET_LIBC_PROVIDES_HWCAP_IN_TCB
   builtin_define ("__BUILTIN_CPU_SUPPORTS__");
 #endif
diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c b/gcc/testsuite/gcc.target/powerpc/pr99708.c
new file mode 100644
index 00000000000..d478f7bc4c0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx -mfloat128" } */
+
+/*
+ * PR target/99708
+ *
+ * Verify that __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ are properly defined.
+ */
+
+#include <stdlib.h>
+
+int main (void)
+{
+  if (__SIZEOF_FLOAT128__ != sizeof (__float128)
+      || __SIZEOF_IBM128__ != sizeof (__ibm128))
+    abort ();
+
+  return 0;
+}
+


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/meissner/heads/work078)] Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
@ 2022-02-16 17:58 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2022-02-16 17:58 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:df890e3deb6574509ad451fb6b5892927bdd2d6b

commit df890e3deb6574509ad451fb6b5892927bdd2d6b
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Wed Feb 16 12:57:58 2022 -0500

    Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
    
    Define the sizes of the PowerPC specific types __float128 and __ibm128 if those
    types are enabled.
    
    2022-02-16  Michael Meissner  <meissner@the-meissners.org>
    
    gcc/
            PR target/99708
            * config/rs6000/rs6000-c.cc (rs6000_cpu_cpp_builtins): Define
            __SIZEOF_IBM128__ if the IBM 128-bit long double type is created.
            Define __SIZEOF_FLOAT128__ if we have float128 support.
    
    gcc/testsuite/
            PR target/99708
            * gcc.target/powerpc/pr99708.c: New test.

Diff:
---
 gcc/config/rs6000/rs6000-c.cc              |  7 ++++++-
 gcc/testsuite/gcc.target/powerpc/pr99708.c | 21 +++++++++++++++++++++
 2 files changed, 27 insertions(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index 15251efc209..17f3d1d92eb 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -622,8 +622,13 @@ rs6000_cpu_cpp_builtins (cpp_reader *pfile)
     builtin_define ("__RSQRTE__");
   if (TARGET_FRSQRTES)
     builtin_define ("__RSQRTEF__");
+  if (ibm128_float_type_node)
+    builtin_define ("__SIZEOF_IBM128__");
   if (TARGET_FLOAT128_TYPE)
-    builtin_define ("__FLOAT128_TYPE__");
+    {
+      builtin_define ("__FLOAT128_TYPE__");
+      builtin_define ("__SIZEOF_FLOAT128__=16");
+    }
 #ifdef TARGET_LIBC_PROVIDES_HWCAP_IN_TCB
   builtin_define ("__BUILTIN_CPU_SUPPORTS__");
 #endif
diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c b/gcc/testsuite/gcc.target/powerpc/pr99708.c
new file mode 100644
index 00000000000..d478f7bc4c0
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
@@ -0,0 +1,21 @@
+/* { dg-do run } */
+/* { require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx -mfloat128" } */
+
+/*
+ * PR target/99708
+ *
+ * Verify that __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ are properly defined.
+ */
+
+#include <stdlib.h>
+
+int main (void)
+{
+  if (__SIZEOF_FLOAT128__ != sizeof (__float128)
+      || __SIZEOF_IBM128__ != sizeof (__ibm128))
+    abort ();
+
+  return 0;
+}
+


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [gcc(refs/users/meissner/heads/work078)] Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
@ 2022-02-15  4:58 Michael Meissner
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Meissner @ 2022-02-15  4:58 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:458834e27382b840b6ce6a246821cf5072fa8d0f

commit 458834e27382b840b6ce6a246821cf5072fa8d0f
Author: Michael Meissner <meissner@linux.ibm.com>
Date:   Mon Feb 14 23:58:04 2022 -0500

    Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__.
    
    Define the sizes of the PowerPC specific types __float128 and __ibm128.
    
    2022-02-15  Michael Meissner  <meissner@the-meissners.org>
    
    gcc/
            PR target/99708
            * config/rs6000/rs6000-c.cc (rs6000_target_modify_macros): Define
            __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ if we have float128
            support.
    
    gcc/testsuite/
            PR target/99708
            * gcc.target/powerpc/pr99708.c: New test.

Diff:
---
 gcc/config/rs6000/rs6000-c.cc              | 12 ++++++++++--
 gcc/testsuite/gcc.target/powerpc/pr99708.c | 19 +++++++++++++++++++
 2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index 15251efc209..b5f771d1308 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -581,9 +581,17 @@ rs6000_target_modify_macros (bool define_p, HOST_WIDE_INT flags,
     {
       rs6000_define_or_undefine_macro (define_p, "__FLOAT128__");
       if (define_p)
-	rs6000_define_or_undefine_macro (true, "__float128=__ieee128");
+	{
+	  rs6000_define_or_undefine_macro (true, "__float128=__ieee128");
+	  rs6000_define_or_undefine_macro (true, "__SIZEOF_FLOAT128__=16");
+	  rs6000_define_or_undefine_macro (true, "__SIZEOF_IBM128__=16");
+	}
       else
-	rs6000_define_or_undefine_macro (false, "__float128");
+	{
+	  rs6000_define_or_undefine_macro (false, "__float128");
+	  rs6000_define_or_undefine_macro (false, "__SIZEOF_FLOAT128__");
+	  rs6000_define_or_undefine_macro (false, "__SIZEOF_IBM128__");
+	}
     }
   /* OPTION_MASK_FLOAT128_HARDWARE can be turned on if -mcpu=power9 is used or
      via the target attribute/pragma.  */
diff --git a/gcc/testsuite/gcc.target/powerpc/pr99708.c b/gcc/testsuite/gcc.target/powerpc/pr99708.c
new file mode 100644
index 00000000000..dd7a3bccc03
--- /dev/null
+++ b/gcc/testsuite/gcc.target/powerpc/pr99708.c
@@ -0,0 +1,19 @@
+/* { dg-do run } */
+/* { require-effective-target ppc_float128_sw } */
+/* { dg-options "-O2 -mvsx -mfloat128" } */
+
+/*
+ * PR target/99708
+ *
+ * Verify that __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ are properly defined.
+ */
+
+int main (void)
+{
+  if (__SIZEOF_FLOAT128__ != sizeof (__float128)
+      || __SIZEOF_IBM128 != sizeof (__ibm128))
+    abort ();
+
+  return 0;
+}
+


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-02-17  0:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 16:59 [gcc(refs/users/meissner/heads/work078)] Define __SIZEOF_FLOAT128__ and __SIZEOF_IBM128__ Michael Meissner
  -- strict thread matches above, loose matches on Subject: below --
2022-02-17  0:37 Michael Meissner
2022-02-16 20:25 Michael Meissner
2022-02-16 17:58 Michael Meissner
2022-02-15  4:58 Michael Meissner

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).