From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 2394A38618F6; Thu, 17 Dec 2020 05:49:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2394A38618F6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Michael Meissner To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/meissner/heads/work030)] PowerPC: Add long double target-supports. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work030 X-Git-Oldrev: 1aa62ff911040e4aae291ddfcc3a5436e45302de X-Git-Newrev: 2e1bf94b0abcd550c3918e2dc076759bc8fd6f19 Message-Id: <20201217054958.2394A38618F6@sourceware.org> Date: Thu, 17 Dec 2020 05:49:58 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2020 05:49:58 -0000 https://gcc.gnu.org/g:2e1bf94b0abcd550c3918e2dc076759bc8fd6f19 commit 2e1bf94b0abcd550c3918e2dc076759bc8fd6f19 Author: Michael Meissner Date: Thu Dec 17 00:49:03 2020 -0500 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. gcc/testsuite/ 2020-12-17 Michael Meissner * 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. Diff: --- 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 11343d0192f..9475889e501 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2348,6 +2348,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. @@ -8060,6 +8113,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] }