On 2/21/20 11:51 AM, Kyrill Tkachov wrote:
Hi Mihail,

On 2/19/20 4:27 PM, Mihail Ionescu wrote:
Hi Christophe,

On 01/23/2020 09:34 AM, Christophe Lyon wrote:
> On Mon, 20 Jan 2020 at 19:01, Mihail Ionescu
> <mihail.ione...@foss.arm.com> wrote:
>>
>> Hi,
>>
>> This patch fixes the scalar shifts tests added in:
>> https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01195.html
>> https://gcc.gnu.org/ml/gcc-patches/2019-11/msg01196.html
>> By adding mthumb and ensuring that the target supports
>> thumb2 instructions.
>>
>>
>> *** gcc/testsuite/ChangeLog ***
>>
>> 2020-01-20  Mihail-Calin Ionescu <mihail.ione...@arm.com>
>>
>>          * gcc/testsuite/gcc.target/arm/armv8_1m-shift-imm-1.c: Add mthumb and target check. >>          * gcc/testsuite/gcc.target/arm/armv8_1m-shift-reg-1.c: Likewise.
>>
>>
>> Is this ok for trunk?
>>
>
> Why not add a new entry in check_effective_target_arm_arch_FUNC_ok?
> (there are already plenty, including v8m_main for instance)
>

Sorry for the delay, we were going to add the check_effective_target
to the MVE framework patches and then update this one. But I came
across some big endian issues and decided to update this now.

I've added the target check and changed the patch so it also
disables the scalar shift patterns when generating big endian
code. At the moment they are broken because the MVE shift instructions
have the restriction of having an even gp register specified first,
followed by the odd one, which requires swapping the data twice in
big endian. In this case, the previous code gen is preferred.



*** gcc/ChangeLog ***

2020-02-19  Mihail-Calin Ionescu <mihail.ione...@arm.com>

        * config/arm/arm.md (ashldi3, ashrdi3, lshrdi3): Prevent scalar
        shifts from being used on when big endian is enabled.

*** gcc/testsuite/ChangeLog ***

2020-02-19  Mihail-Calin Ionescu <mihail.ione...@arm.com>

        * 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.

Is this ok for trunk?


This is ok, but please do a follow up patch to add the new effective target check to sourcebuild.texi (I know, we tend to forget to do it!)


I should say that such a patch is pre-approved.

Thanks,

Kyrill





> Christophe
>
>>
>> Regards,
>> Mihail
>>
>>
>> ###############     Attachment also inlined for ease of reply    ###############
>>
>>
>> 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 5ffa3769e6ba42466242d3038857734e87b2f1fc..9822f59643c662c9302ad43c09057c59f3cbe07a 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,6 @@
>>   /* { dg-do compile } */
>> -/* { dg-options "-O2 -march=armv8.1-m.main+mve -mfloat-abi=softfp" } */ >> +/* { dg-options "-O2 -mthumb -march=armv8.1-m.main+mve -mfloat-abi=softfp" } */
>> +/* { dg-require-effective-target arm_thumb2_ok } */
>>
>>   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 a97e9d687ef66e9642dd1d735125c8ee941fb151..a9aa7ed3ad9204c03d2c15dc6920ca3159403fa0 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,6 @@
>>   /* { dg-do compile } */
>> -/* { dg-options "-O2 -march=armv8.1-m.main+mve -mfloat-abi=softfp" } */ >> +/* { dg-options "-O2 -mthumb -march=armv8.1-m.main+mve -mfloat-abi=softfp" } */
>> +/* { dg-require-effective-target arm_thumb2_ok  } */
>>
>>   long long longval2;
>>   int intval2;
>>

Regards,
Mihail

Reply via email to