From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1005) id 039BE3858C27; Thu, 3 Dec 2020 21:38:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 039BE3858C27 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/work029)] PowerPC: Add long double target-supports. X-Act-Checkin: gcc X-Git-Author: Michael Meissner X-Git-Refname: refs/users/meissner/heads/work029 X-Git-Oldrev: f7c007b4c3720d3db0483d0c477fab4c411bc514 X-Git-Newrev: c8641f4384a45de97985c220d2f4cc923a5c5edb Message-Id: <20201203213807.039BE3858C27@sourceware.org> Date: Thu, 3 Dec 2020 21:38:06 +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, 03 Dec 2020 21:38:07 -0000 https://gcc.gnu.org/g:c8641f4384a45de97985c220d2f4cc923a5c5edb commit c8641f4384a45de97985c220d2f4cc923a5c5edb Author: Michael Meissner Date: Thu Dec 3 16:37:46 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-03 Michael Meissner * lib/target-supports.exp (check_effective_target_ppc_long_double_ibm): New function. (check_effective_target_ppc_long_double_ieee): New function. (check_effective_target_ppc_long_double_128bit): New function. (check_effective_target_ppc_long_double_64bit): New function. Diff: --- gcc/testsuite/lib/target-supports.exp | 151 ++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ff6bc5f4b92..0871970efe6 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2348,6 +2348,77 @@ 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 { } { + 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_effective_target_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 one of the +# two 128-bit types (i.e. IEEE 128-bit or IBM 128-bit extended double). + +proc check_effective_target_ppc_long_double_128bit { } { + return [check_cached_effective_target ppc_long_double_128bit { + check_runtime_nocache ppc_long_double_128bit { + int main() + { + #ifndef _ARCH_PPC + return 1; + #else + return sizeof (long double) != 128; + #endif + } + } + }] +} + +# 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 { + 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. @@ -10662,3 +10733,83 @@ proc check_effective_target_no_fsanitize_address {} { } return 0; } + +# Return 1 if this target supports 'R' flag in .section directive, 0 +# otherwise. Cache the result. + +proc check_effective_target_R_flag_in_section { } { + global tool + global GCC_UNDER_TEST + + # Need auto-host.h to check linker support. + if { ![file exists ../../auto-host.h ] } { + return 0 + } + + return [check_cached_effective_target R_flag_in_section { + + set src pie[pid].c + set obj pie[pid].o + + set f [open $src "w"] + puts $f "#include \"../../auto-host.h\"" + puts $f "#if HAVE_GAS_SHF_GNU_RETAIN == 0" + puts $f "# error Assembler does not support 'R' flag in .section directive." + puts $f "#endif" + close $f + + verbose "check_effective_target_R_flag_in_section compiling testfile $src" 2 + set lines [${tool}_target_compile $src $obj assembly ""] + + file delete $src + file delete $obj + + if [string match "" $lines] then { + verbose "check_effective_target_R_flag_in_section testfile compilation passed" 2 + return 1 + } else { + verbose "check_effective_target_R_flag_in_section testfile compilation failed" 2 + return 0 + } + }] +} + +# Return 1 if this target supports 'o' flag in .section directive, 0 +# otherwise. Cache the result. + +proc check_effective_target_o_flag_in_section { } { + global tool + global GCC_UNDER_TEST + + # Need auto-host.h to check linker support. + if { ![file exists ../../auto-host.h ] } { + return 0 + } + + return [check_cached_effective_target o_flag_in_section { + + set src pie[pid].c + set obj pie[pid].o + + set f [open $src "w"] + puts $f "#include \"../../auto-host.h\"" + puts $f "#if HAVE_GAS_SECTION_LINK_ORDER == 0" + puts $f "# error Assembler does not support 'o' flag in .section directive." + puts $f "#endif" + close $f + + verbose "check_effective_target_o_flag_in_section compiling testfile $src" 2 + set lines [${tool}_target_compile $src $obj object ""] + + file delete $src + file delete $obj + + if [string match "" $lines] then { + verbose "check_effective_target_o_flag_in_section testfile compilation passed" 2 + return 1 + } else { + verbose "check_effective_target_o_flag_in_section testfile compilation failed" 2 + return 0 + } + }] +}