[gcc(refs/users/meissner/heads/work032)] Checkpoint changes.
Michael Meissner
meissner@gcc.gnu.org
Thu Jan 14 23:25:32 GMT 2021
https://gcc.gnu.org/g:7b2bbbf3464475b66242b5602f1adb1b6b86b630
commit 7b2bbbf3464475b66242b5602f1adb1b6b86b630
Author: Michael Meissner <meissner@linux.ibm.com>
Date: Thu Jan 14 18:23:48 2021 -0500
Checkpoint changes.
gcc/testsuite/
2021-01-13 Michael Meissner <meissner@linux.ibm.com>
* lib/target-supports.exp: Checkpoint.
* c-c++-common/dfp/convert-bfp-11.c: Checkpoint.
* gcc.target/powerpc/pr70117.c: Checkpoint.
Diff:
---
gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c | 4 +-
gcc/testsuite/gcc.target/powerpc/pr70117.c | 5 +-
gcc/testsuite/lib/target-supports.exp | 93 +++++++++++++++++--------
3 files changed, 68 insertions(+), 34 deletions(-)
diff --git a/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c b/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c
index d19d6aa9220..35da07d1fa4 100644
--- a/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c
+++ b/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c
@@ -1,6 +1,6 @@
/* { dg-require-effective-target dfp } */
-/* { dg-require-effective-target ppc_long_double_override_ibm } */
-/* { dg-options "-O2 -mlong-double-128 -mabi=ibmlongdouble -Wno-psabi" } */
+/* { dg-require-effective-target ppc_long_double_override_ibm128 } */
+/* { dg-add-options ppc_long_double_override_ibm128 } */
/* We force the long double type to be IBM 128-bit because the CONVERT_TO_PINF
tests will fail if we use IEEE 128-bit floating point. This is due to IEEE
diff --git a/gcc/testsuite/gcc.target/powerpc/pr70117.c b/gcc/testsuite/gcc.target/powerpc/pr70117.c
index 6efece1c7c8..8a5fad1dee0 100644
--- a/gcc/testsuite/gcc.target/powerpc/pr70117.c
+++ b/gcc/testsuite/gcc.target/powerpc/pr70117.c
@@ -1,6 +1,7 @@
/* { dg-do run } */
-/* { dg-require-effective-target ppc_long_double_override_ibm } */
-/* { dg-options "-std=c99 -O2 -mlong-double-128 -mabi=ibmlongdouble -Wno-psabi" } */
+/* { dg-require-effective-target ppc_long_double_override_ibm128 } */
+/* { dg-options "-std=c99 -O2" } */
+/* { dg-add-options ppc_long_double_override_ibm128 } */
#include <float.h>
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 9834ba708fe..2badb495adc 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -2357,7 +2357,7 @@ proc check_effective_target_ppc_ieee128_ok { } {
# See if the target is a powerpc with the long double format that uses the IBM
# extended double format.
-proc check_effective_target_ppc_long_double_ibm { } {
+proc check_effective_target_ppc_long_double_ibm128 { } {
return [check_cached_effective_target ppc_long_double_ibm {
int main()
{
@@ -2373,7 +2373,7 @@ proc check_effective_target_ppc_long_double_ibm { } {
# See if the target is a powerpc with the long double format that uses the IEEE
# 128-bit format.
-proc check_effective_target_ppc_long_double_ieee { } {
+proc check_effective_target_ppc_long_double_ieee128 { } {
return [check_cached_effective_target ppc_long_double_ieee {
int main()
{
@@ -2386,14 +2386,35 @@ proc check_effective_target_ppc_long_double_ieee { } {
}]
}
-# Like check_effective_target_ppc_long_double_ibm, but check if we can
+# See if the target is a powerpc with the long double format that is 64-bit.
+
+proc check_effective_target_ppc_long_double_64bit { } {
+ return [check_cached_effective_target ppc_long_double_64bit {
+ int main()
+ {
+ #ifndef _ARCH_PPC
+ return 1;
+ #else
+ return sizeof (long double) != 8;
+ #endif
+ }
+ }]
+}
+
+# Like check_effective_target_ppc_long_double_ibm128, but check if we can
# explicitly override the long double format to use the IBM 128-bit extended
# double format, and GLIBC supports doing this override by switching the
# sprintf to handle long double.
-proc check_effective_target_ppc_long_double_override_ibm { } {
- set options "-mlong-double-128 -mabi=ibmlongdouble -Wno-psabi"
- check_runtime_nocache ppc_long_double_ovveride_ibm {
+proc add_options_for_ppc_long_double_override_ibm128 { flags } {
+ if { [istarget powerpc*-*-*] } {
+ return "$flags -mlong-double-128 -Wno-psabi -mabi=ibmlongdouble"
+ }
+ return "$flags"
+}
+
+proc check_effective_target_ppc_long_double_override_ibm128 { } {
+ return [check_runtime_nocache ppc_long_double_ovveride_ibm128 {
#include <string.h>
#include <stdio.h>
volatile __ibm128 a = (__ibm128) 3.0;
@@ -2413,7 +2434,7 @@ proc check_effective_target_ppc_long_double_override_ibm { } {
return strcmp (buffer, "3") != 0;
#endif
}
- } $options
+ } [add_options_for_ppc_long_double_override_ibm128 ""]]
}
# Like check_effective_target_ppc_long_double_ieee, but check if we can
@@ -2421,9 +2442,15 @@ proc check_effective_target_ppc_long_double_override_ibm { } {
# and GLIBC supports doing this override by switching the sprintf to handle
# long double.
-proc check_effective_target_ppc_long_double_override_ieee { } {
- set options "-mlong-double-128 -mabi=ieeelongdouble -Wno-psabi"
- check_runtime_nocache ppc_long_double_ovveride_ieee {
+proc add_options_for_ppc_long_double_override_ieee128 { flags } {
+ if { [istarget powerpc*-*-*] } {
+ return "$flags -mlong-double-128 -Wno-psabi -mabi=ieeelongdouble"
+ }
+ return "$flags"
+}
+
+proc check_effective_target_ppc_long_double_override_ieee128 { } {
+ return [check_runtime_nocache ppc_long_double_ovveride_ieee128 {
#include <string.h>
#include <stdio.h>
volatile _Float128 a = 3.0f128;
@@ -2443,37 +2470,43 @@ proc check_effective_target_ppc_long_double_override_ieee { } {
return strcmp (buffer, "3") != 0;
#endif
}
- } $options
+ } [add_options_for_ppc_long_double_override_ieee128 ""]]
}
-# See if the target is a powerpc with the long double format that is 128-bits.
+# Like check_effective_target_ppc_long_double_64bit, but override the long
+# double format to be 64-bit explicitly.
-proc check_effective_target_ppc_long_double_128bit { } {
- return [check_cached_effective_target ppc_long_double_128bit {
- int main()
- {
- #ifndef _ARCH_PPC
- return 1;
- #else
- return sizeof (long double) != 16;
- #endif
- }
- }]
+proc add_options_for_ppc_long_double_override_64bit { flags } {
+ if { [istarget powerpc*-*-*] } {
+ return "$flags -mlong-double-64"
+ }
+ return "$flags"
}
-# See if the target is a powerpc with the long double format that is 64-bit.
-
-proc check_effective_target_ppc_long_double_64bit { } {
- return [check_cached_effective_target ppc_long_double_64bit {
+proc check_effective_target_ppc_long_double_override_64bit { } {
+ return [check_runtime_nocache ppc_long_double_ovveride_64bit {
+ #include <string.h>
+ #include <stdio.h>
+ volatile double a = 3.0;
+ volatile long double one = 1.0L;
+ volatile long double two = 2.0L;
+ volatile long double b;
+ char buffer[20];
int main()
{
- #ifndef _ARCH_PPC
+ #if !defined(_ARCH_PPC) || defined(__LONG_DOUBLE_128__)
return 1;
#else
- return sizeof (long double) != 8;
+ if (sizeof (long double) != sizeof (double))
+ return 1;
+ b = one + two;
+ if (memcmp ((void *)&a, (void *)&b, sizeof (long double)) != 0)
+ return 1;
+ sprintf (buffer, "%lg", b);
+ return strcmp (buffer, "3") != 0;
#endif
}
- }]
+ } [add_options_for_ppc_long_double_override_64bit ""]]
}
# Return 1 if the target supports executing VSX instructions, 0
More information about the Gcc-cvs
mailing list