Re: [PATCH] aarch64: prefer using csinv, csneg in zero extend contexts

2020-05-11 Thread Richard Sandiford
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

RE: [PATCH] aarch64: prefer using csinv, csneg in zero extend contexts

2020-05-07 Thread Alex Coplan
> -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

Re: [PATCH] aarch64: prefer using csinv, csneg in zero extend contexts

2020-05-06 Thread Richard Sandiford
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

RE: [PATCH] aarch64: prefer using csinv, csneg in zero extend contexts

2020-04-30 Thread Alex Coplan
> -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 >

Re: [PATCH] aarch64: prefer using csinv, csneg in zero extend contexts

2020-04-30 Thread Richard Sandiford
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.: >

RE: [PATCH] aarch64: prefer using csinv, csneg in zero extend contexts

2020-04-30 Thread Alex Coplan
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

Re: [PATCH] aarch64: prefer using csinv, csneg in zero extend contexts

2020-04-29 Thread Richard Sandiford
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; > }

[PATCH] aarch64: prefer using csinv, csneg in zero extend contexts

2020-04-29 Thread Alex Coplan
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: