From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2066) id 9DEE739450FF; Thu, 19 Mar 2020 05:46:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DEE739450FF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1584596797; bh=rr9ODxy4fE3eYqRI7pMHbfPgDFQy3rVh7dU3qtvzUwc=; h=From:To:Subject:Date:From; b=FVucil6Z1HRuscDbYY4CIrju/jCJFI5hrYoR4jAJ0JZilv+37cVYsMxrJPp5CuM2d aX5Nrd+fnBMZFgn/EK2PRYcXh2hTehtVpGmv4BEwDDbUTktYyTiNi52eB/4CmcRlNh OLqUO5dIw7osYgZhOaSKxpX0d7X7DYJ/p7xKGwk8= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Jiu Fu Guo To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/vendors/ibm/heads/perf)] [PATCH, GCC/ARM] Fix MVE scalar shift tests X-Act-Checkin: gcc X-Git-Author: Mihail Ionescu X-Git-Refname: refs/vendors/ibm/heads/perf X-Git-Oldrev: b150c838d9dcf2aa9a50bffdc1eb3012200a4d21 X-Git-Newrev: bf5582c356eb795ab8dfbe1b1df6b9571ec1bd81 Message-Id: <20200319054637.9DEE739450FF@sourceware.org> Date: Thu, 19 Mar 2020 05:46:37 +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, 19 Mar 2020 05:46:37 -0000 https://gcc.gnu.org/g:bf5582c356eb795ab8dfbe1b1df6b9571ec1bd81 commit bf5582c356eb795ab8dfbe1b1df6b9571ec1bd81 Author: Mihail Ionescu Date: Fri Feb 21 15:21:23 2020 +0000 [PATCH, GCC/ARM] Fix MVE scalar shift tests *** gcc/ChangeLog *** 2020-02-21 Mihail-Calin Ionescu * config/arm/arm.md: Prevent scalar shifts from being used when big endian is enabled. *** gcc/testsuite/ChangeLog *** 2020-02-21 Mihail-Calin Ionescu * gcc.target/arm/armv8_1m-shift-imm-1.c: Add MVE target checks. * gcc.target/arm/armv8_1m-shift-reg-1.c: Likewise. * lib/target-supports.exp (check_effective_target_arm_v8_1m_mve_ok_nocache): New. (check_effective_target_arm_v8_1m_mve_ok): New. (add_options_for_v8_1m_mve): New. Diff: --- gcc/ChangeLog | 5 +++ gcc/config/arm/arm.md | 6 ++-- gcc/testsuite/ChangeLog | 9 +++++ .../gcc.target/arm/armv8_1m-shift-imm-1.c | 4 ++- .../gcc.target/arm/armv8_1m-shift-reg-1.c | 4 ++- gcc/testsuite/lib/target-supports.exp | 42 ++++++++++++++++++++++ 6 files changed, 65 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 85630f3613f..3d4d799ed5d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2020-02-21 Mihail-Calin Ionescu + + * config/arm/arm.md: Prevent scalar shifts from being used when big + endian is enabled. + 2020-02-21 Jan Hubicka Richard Biener diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index ab277996462..951596217ad 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -4399,7 +4399,7 @@ (match_operand:SI 2 "reg_or_int_operand")))] "TARGET_32BIT" " - if (TARGET_HAVE_MVE) + if (TARGET_HAVE_MVE && !BYTES_BIG_ENDIAN) { if (!reg_or_int_operand (operands[2], SImode)) operands[2] = force_reg (SImode, operands[2]); @@ -4443,7 +4443,7 @@ "TARGET_32BIT" " /* Armv8.1-M Mainline double shifts are not expanded. */ - if (TARGET_HAVE_MVE + if (TARGET_HAVE_MVE && !BYTES_BIG_ENDIAN && arm_reg_or_long_shift_imm (operands[2], GET_MODE (operands[2]))) { if (!reg_overlap_mentioned_p(operands[0], operands[1])) @@ -4478,7 +4478,7 @@ "TARGET_32BIT" " /* Armv8.1-M Mainline double shifts are not expanded. */ - if (TARGET_HAVE_MVE + if (TARGET_HAVE_MVE && !BYTES_BIG_ENDIAN && long_shift_imm (operands[2], GET_MODE (operands[2]))) { if (!reg_overlap_mentioned_p(operands[0], operands[1])) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5f3d619c0b2..02fa22ef23c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2020-02-21 Mihail-Calin Ionescu + + * gcc.target/arm/armv8_1m-shift-imm-1.c: Add MVE target checks. + * gcc.target/arm/armv8_1m-shift-reg-1.c: Likewise. + * lib/target-supports.exp + (check_effective_target_arm_v8_1m_mve_ok_nocache): New. + (check_effective_target_arm_v8_1m_mve_ok): New. + (add_options_for_v8_1m_mve): New. + 2020-02-21 Uroš Bizjak * gcc.dg/vect/vect-epilogues.c (scan-tree-dump): Require diff --git a/gcc/testsuite/gcc.target/arm/armv8_1m-shift-imm-1.c b/gcc/testsuite/gcc.target/arm/armv8_1m-shift-imm-1.c index 5ffa3769e6b..883fbb092b1 100644 --- a/gcc/testsuite/gcc.target/arm/armv8_1m-shift-imm-1.c +++ b/gcc/testsuite/gcc.target/arm/armv8_1m-shift-imm-1.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv8.1-m.main+mve -mfloat-abi=softfp" } */ +/* { dg-options "-O2 -mfloat-abi=softfp -mlittle-endian" } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ long long longval1; long long unsigned longval2; diff --git a/gcc/testsuite/gcc.target/arm/armv8_1m-shift-reg-1.c b/gcc/testsuite/gcc.target/arm/armv8_1m-shift-reg-1.c index a97e9d687ef..e125ff83c22 100644 --- a/gcc/testsuite/gcc.target/arm/armv8_1m-shift-reg-1.c +++ b/gcc/testsuite/gcc.target/arm/armv8_1m-shift-reg-1.c @@ -1,5 +1,7 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -march=armv8.1-m.main+mve -mfloat-abi=softfp" } */ +/* { dg-options "-O2 -mfloat-abi=softfp -mlittle-endian" } */ +/* { dg-require-effective-target arm_v8_1m_mve_ok } */ +/* { dg-add-options arm_v8_1m_mve } */ long long longval2; int intval2; diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index ec462315860..9592c539c11 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -4828,6 +4828,48 @@ proc check_effective_target_arm_v8_2a_dotprod_neon_ok_nocache { } { return 0; } +# Return 1 if the target supports ARMv8.1-M MVE +# instructions, 0 otherwise. The test is valid for ARM. +# Record the command line options needed. + +proc check_effective_target_arm_v8_1m_mve_ok_nocache { } { + global et_arm_v8_1m_mve_flags + set et_arm_v8_1m_mve_flags "" + + if { ![istarget arm*-*-*] } { + return 0; + } + + # Iterate through sets of options to find the compiler flags that + # need to be added to the -march option. + foreach flags {"" "-mfloat-abi=softfp -mfpu=auto" "-mfloat-abi=hard -mfpu=auto"} { + if { [check_no_compiler_messages_nocache \ + arm_v8_1m_mve_ok object { + #if !defined (__ARM_FEATURE_MVE) + #error "__ARM_FEATURE_MVE not defined" + #endif + } "$flags -mthumb"] } { + set et_arm_v8_1m_mve_flags "$flags -mthumb" + return 1 + } + } + + return 0; +} + +proc check_effective_target_arm_v8_1m_mve_ok { } { + return [check_cached_effective_target arm_v8_1m_mve_ok \ + check_effective_target_arm_v8_1m_mve_ok_nocache] +} + +proc add_options_for_arm_v8_1m_mve { flags } { + if { ! [check_effective_target_arm_v8_1m_mve_ok] } { + return "$flags" + } + global et_arm_v8_1m_mve_flags + return "$flags $et_arm_v8_1m_mve_flags" +} + proc check_effective_target_arm_v8_2a_dotprod_neon_ok { } { return [check_cached_effective_target arm_v8_2a_dotprod_neon_ok \ check_effective_target_arm_v8_2a_dotprod_neon_ok_nocache]