Message ID | 20201121053352.GC17995@ibm-toto.the-meissners.org |
---|---|
State | New |
Headers | show |
Series | Updated PowerPC tests for long double | expand |
Hi! On Sat, Nov 21, 2020 at 12:33:52AM -0500, Michael Meissner wrote: > +# See if the target is a powerpc with the long double format that uses the IBM > +# extended double format. "Return 1 if the target is PowerPC, and long double is IBM extended double." > @@ -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] } Why this? It just defines aliases to the exact same name? Segher
On Mon, Nov 23, 2020 at 02:28:57PM -0600, Segher Boessenkool wrote: > Hi! > > On Sat, Nov 21, 2020 at 12:33:52AM -0500, Michael Meissner wrote: > > +# See if the target is a powerpc with the long double format that uses the IBM > > +# extended double format. > > "Return 1 if the target is PowerPC, and long double is IBM extended double." > > > @@ -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] } > > Why this? It just defines aliases to the exact same name? If you remove those lines you get the failure from the default case: default { error "unknown effective target keyword `$arg'" }
On Tue, Nov 24, 2020 at 04:44:19PM -0500, Michael Meissner wrote: > On Mon, Nov 23, 2020 at 02:28:57PM -0600, Segher Boessenkool wrote: > > On Sat, Nov 21, 2020 at 12:33:52AM -0500, Michael Meissner wrote: > > > +# See if the target is a powerpc with the long double format that uses the IBM > > > +# extended double format. > > > > "Return 1 if the target is PowerPC, and long double is IBM extended double." > > > > > @@ -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] } > > > > Why this? It just defines aliases to the exact same name? > > If you remove those lines you get the failure from the default case: > > default { error "unknown effective target keyword `$arg'" } So name the functions check_effective_target_ppc_long_double_ibm etc.? Then it is all handled by the generic code, and yes you can use these same names in the testcases. Segher
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] }