Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Andrew Pinski
On Tue, Jul 14, 2015 at 3:06 AM, Andrew Pinski pins...@gmail.com wrote: On Tue, Jul 14, 2015 at 1:18 AM, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi Segher, On 14/07/15 01:38, Segher Boessenkool wrote: On Mon, Jul 13, 2015 at 10:48:19AM +0100, Kyrill Tkachov wrote: For the testcase

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Kyrill Tkachov
On 14/07/15 11:06, Andrew Pinski wrote: On Tue, Jul 14, 2015 at 1:18 AM, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi Segher, On 14/07/15 01:38, Segher Boessenkool wrote: On Mon, Jul 13, 2015 at 10:48:19AM +0100, Kyrill Tkachov wrote: For the testcase in the patch we were generating an

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread pinskia
On Jul 13, 2015, at 5:48 PM, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi all, For the testcase in the patch we were generating an extra neg instruction: cmp w0, wzr csneg w0, w0, w0, ge neg w0, w0 ret instead of the optimal: cmp

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Kyrill Tkachov
Hi Segher, On 14/07/15 01:38, Segher Boessenkool wrote: On Mon, Jul 13, 2015 at 10:48:19AM +0100, Kyrill Tkachov wrote: For the testcase in the patch we were generating an extra neg instruction: cmp w0, wzr csneg w0, w0, w0, ge neg w0, w0 ret

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Andrew Pinski
On Tue, Jul 14, 2015 at 1:18 AM, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi Segher, On 14/07/15 01:38, Segher Boessenkool wrote: On Mon, Jul 13, 2015 at 10:48:19AM +0100, Kyrill Tkachov wrote: For the testcase in the patch we were generating an extra neg instruction: cmp

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Andrew Pinski
On Tue, Jul 14, 2015 at 3:13 AM, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: On 14/07/15 11:06, Andrew Pinski wrote: On Tue, Jul 14, 2015 at 1:18 AM, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi Segher, On 14/07/15 01:38, Segher Boessenkool wrote: On Mon, Jul 13, 2015 at 10:48:19AM

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Segher Boessenkool
On Tue, Jul 14, 2015 at 07:04:13PM +0800, pins...@gmail.com wrote: Combine knows how to use define_split without being an insn. Combine uses define_split in very different circumstances than it uses define_insn. In this case, define_split will only do anything if the nabs is combined from

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Segher Boessenkool
On Tue, Jul 14, 2015 at 09:18:06AM +0100, Kyrill Tkachov wrote: Before combine, you have two insns, a negation and an abs, so that is not so very strange :-) Oh, hrm, my aarch64 cross was three months old, and this now changed. Or I messed up. Sorry for the noise. It does look like the

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Kyrill Tkachov
On 14/07/15 11:40, Andrew Pinski wrote: On Tue, Jul 14, 2015 at 3:13 AM, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: On 14/07/15 11:06, Andrew Pinski wrote: On Tue, Jul 14, 2015 at 1:18 AM, Kyrill Tkachov kyrylo.tkac...@arm.com wrote: Hi Segher, On 14/07/15 01:38, Segher Boessenkool wrote:

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-14 Thread Kyrill Tkachov
On 14/07/15 13:55, Segher Boessenkool wrote: On Tue, Jul 14, 2015 at 09:18:06AM +0100, Kyrill Tkachov wrote: Before combine, you have two insns, a negation and an abs, so that is not so very strange :-) Oh, hrm, my aarch64 cross was three months old, and this now changed. Or I messed up.

[PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-13 Thread Kyrill Tkachov
Hi all, For the testcase in the patch we were generating an extra neg instruction: cmp w0, wzr csneg w0, w0, w0, ge neg w0, w0 ret instead of the optimal: cmp w0, wzr csneg w0, w0, w0, lt ret The reason is that combine

Re: [PATCH][AArch64] Handle -|x| case using a single csneg

2015-07-13 Thread Segher Boessenkool
On Mon, Jul 13, 2015 at 10:48:19AM +0100, Kyrill Tkachov wrote: For the testcase in the patch we were generating an extra neg instruction: cmp w0, wzr csneg w0, w0, w0, ge neg w0, w0 ret instead of the optimal: cmp w0, wzr