On Sun, 2020-11-15 at 12:23 -0500, Michael Meissner via Gcc-patches wrote: > PowerPC: Restrict long double test to use IBM long double. > > I posted this patch previously as a set of 3 testsuite patches. I have > separated them into separate patches. This patch marks the convert-bfp-11.c > patch as needing IBM extended double. If you look at the code, it is > specifically designed around testing the limits of the IBM 128-bit extended > double representation. I added a new target-supports that says the test > requires IBM extended long double, and changed the test to require this > effective test. Can I check this into the master branch?
It's harder to review that without all the history handy here. This will stand alone better if you lead with what you are adding and keep it clean. i.e. Subject: PowerPC: Add ppc_long_double_ibm effective-target check "Add a ppc_long_double_ibm dg-require-effective-target check to ensure tests that require LONG_DOUBLE_IBM128 . " An additional statement to clarify it's relationship with IEEEEEEEE128 wouldn't hurt if that is the case. i.e. "This is a counterpart to LONG_DOUBLE_IEEEEEEE 128 " > > gcc/testsuite/ > 2020-11-15 Michael Meissner <meiss...@linux.ibm.com> > > * c-c++-common/dfp/convert-bfp-11.c: Require IBM 128-bit long > double. > * lib/target-supports.exp (check_ppc_long_double_ibm): New > function. > (is-effective-target): Add ppc_long_double_ibm. > --- > .../c-c++-common/dfp/convert-bfp-11.c | 1 + > gcc/testsuite/lib/target-supports.exp | 19 +++++++++++++++++++ > 2 files changed, 20 insertions(+) > > 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 95c433d2c24..87f6716afb3 100644 > --- a/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c > +++ b/gcc/testsuite/c-c++-common/dfp/convert-bfp-11.c > @@ -1,4 +1,5 @@ > /* { dg-skip-if "" { ! "powerpc*-*-linux*" } } */ > +/* { dg-require-effective-target ppc_long_double_ibm } */ > > /* Test decimal float conversions to and from IBM 128-bit long double. > Checks are skipped at runtime if long double is not 128 bits. ok > diff --git a/gcc/testsuite/lib/target-supports.exp > b/gcc/testsuite/lib/target-supports.exp > index ceee78c26a9..dc1100ba96c 100644 > --- a/gcc/testsuite/lib/target-supports.exp > +++ b/gcc/testsuite/lib/target-supports.exp > @@ -2336,6 +2336,24 @@ proc check_effective_target_ppc_ieee128_ok { } { > }] > } > > +# Return 1 if the target is a powerpc with the long double format uses the > IBM > +# extended double format. > + > +proc check_ppc_long_double_ibm { } { > + return [check_cached_effective_target ppc_long_double_ibm { > + check_runtime_nocache ppc_long_double_ibm { > + int main() > + { > + #ifndef __LONG_DOUBLE_IBM128__ > + return 1; Hmm, I have those backwards in my head apparently. Can the return 1 if not-defined logic be flattened out so we see the direct relationship? > + #else > + return 0; > + #endif > + } > + } > + }] > +} > + > # Return 1 if the target supports executing VSX instructions, 0 > # otherwise. Cache the result. > > @@ -7939,6 +7957,7 @@ proc is-effective-target { arg } { > "power10_hw" { set selected [check_power10_hw_available] } > "ppc_float128_sw" { set selected [check_ppc_float128_sw_available] } > "ppc_float128_hw" { set selected [check_ppc_float128_hw_available] } > + "ppc_long_double_ibm" { set selected [check_ppc_long_double_ibm] } > "ppc_recip_hw" { set selected [check_ppc_recip_hw_available] } > "ppc_cpu_supports_hw" { set selected > [check_ppc_cpu_supports_hw_available] } > "ppc_mma_hw" { set selected [check_ppc_mma_hw_available] } > -- > 2.22.0 > >