Alex Coplan writes:
>> -Original Message-
>> From: Richard Sandiford
>> Sent: 06 May 2020 11:28
>> To: Alex Coplan
>> Cc: gcc-patches@gcc.gnu.org; Richard Earnshaw ;
>> Marcus Shawcroft ; Kyrylo Tkachov
>> ; nd
>> Subject: Re: [PATCH] a
> -Original Message-
> From: Richard Sandiford
> Sent: 06 May 2020 11:28
> To: Alex Coplan
> Cc: gcc-patches@gcc.gnu.org; Richard Earnshaw ;
> Marcus Shawcroft ; Kyrylo Tkachov
> ; nd
> Subject: Re: [PATCH] aarch64: prefer using csinv, csneg in zero extend
&g
Alex Coplan writes:
>> -Original Message-
>> From: Richard Sandiford
>> Sent: 30 April 2020 15:13
>> To: Alex Coplan
>> Cc: gcc-patches@gcc.gnu.org; Richard Earnshaw ;
>> Marcus Shawcroft ; Kyrylo Tkachov
>> ; nd
>> Subject: Re: [PATCH] a
> -Original Message-
> From: Richard Sandiford
> Sent: 30 April 2020 15:13
> To: Alex Coplan
> Cc: gcc-patches@gcc.gnu.org; Richard Earnshaw ;
> Marcus Shawcroft ; Kyrylo Tkachov
> ; nd
> Subject: Re: [PATCH] aarch64: prefer using csinv, csneg in zero extend
>
Alex Coplan writes:
>> At the risk of feature creep :-) a useful third pattern could be
>> to combine a zero-extended operator result with an existing DImode value.
>> In that case, the existing DImode value really can be "rZ" and should
>> always be in the "else" arm of the if_then_else. E.g.:
>
gcc.gnu.org; Richard Earnshaw ;
> Marcus Shawcroft ; Kyrylo Tkachov
> ; nd
> Subject: Re: [PATCH] aarch64: prefer using csinv, csneg in zero extend
> contexts
>
> Yeah. The thing that surprised me was that the non-extending form
> has the operator in the "then" arm o
Thanks for doing this.
Alex Coplan writes:
> Hello,
>
> The attached patch adds an optimization to the AArch64 backend to catch
> additional cases where we can use csinv and csneg.
>
> Given the C code:
>
> unsigned long long inv(unsigned a, unsigned b, unsigned c)
> {
> return a ? b : ~c;
> }
Hello,
The attached patch adds an optimization to the AArch64 backend to catch
additional cases where we can use csinv and csneg.
Given the C code:
unsigned long long inv(unsigned a, unsigned b, unsigned c)
{
return a ? b : ~c;
}
Prior to this patch, AArch64 GCC at -O2 generates:
inv: