PowerPC: Add long double target-supports. This patch adds 3 target supports to test what type of PowerPC long double is used by the test:
1) Long double uses the IBM 128-bit extended double format; 2) Long double uses the IEEE 128-bit format; (and) 3) Long double uses the 64-bit format. I have tested this patch and the following two patches in this series with compilers with the 3 different long double types. I verified that the two tests being modified both are labeled as UNSUPPORTED if long double is not IBM 128-bit, and if long double is IBM 128-bit, the tests pass. Can I check this into the master branch? I think this patch should also be back ported to the earlier branches. gcc/testsuite/ 2020-11-21 Michael Meissner <meiss...@linux.ibm.com> * lib/target-supports.exp (check_ppc_long_double_ibm): New function. (check_ppc_long_double_ieee): New function. (check_ppc_long_double_64bit): New function. (is-effective-target): Add ppc_long_double_ibm, ppc_long_double_ieee, and ppc_long_double_64bit. --- gcc/testsuite/lib/target-supports.exp | 56 +++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 22acda2a74f..adcb789d136 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2336,6 +2336,59 @@ 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_ppc_long_double_ibm { } { + return [check_cached_effective_target ppc_long_double_ibm { + check_runtime_nocache ppc_long_double_ibm { + int main() + { + #if !defined(_ARCH_PPC) || !defined(__LONG_DOUBLE_IBM128__) + return 1; + #else + return 0; + #endif + } + } + }] +} + +# See if the target is a powerpc with the long double format that uses the IEEE +# 128-bit format. + +proc check_ppc_long_double_ieee { } { + return [check_cached_effective_target ppc_long_double_ieee { + check_runtime_nocache ppc_long_double_ieee { + int main() + { + #if !defined(_ARCH_PPC) || !defined(__LONG_DOUBLE_IEEE128__) + return 1; + #else + return 0; + #endif + } + } + }] +} + +# See if the target is a powerpc with the long double format that is 64-bit. + +proc check_ppc_long_double_64bit { } { + return [check_cached_effective_target ppc_long_double_64bit { + check_runtime_nocache ppc_long_double_64bit { + int main() + { + #ifndef _ARCH_PPC + return 1; + #else + return sizeof (long double) != 64; + #endif + } + } + }] +} + # Return 1 if the target supports executing VSX instructions, 0 # otherwise. Cache the result. @@ -7939,6 +7992,9 @@ 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_long_double_ieee" { set selected [check_ppc_long_double_ieee] } + "ppc_long_double_64bit" { set selected [check_ppc_long_double_64bit] } "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 -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.ibm.com, phone: +1 (978) 899-4797