Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-09-02 Thread Kyrill Tkachov
Hi Richard, Sorry for the delay. On 19/08/14 17:09, Richard Henderson wrote: (define_special_predicate cc_register_zero (match_code reg) { return (REGNO (op) == CC_REGNUM (GET_MODE (op) == CCmode || GET_MODE (op) == CC_Zmode || GET_MODE (op) ==

Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-09-02 Thread Richard Henderson
On 09/02/2014 08:34 AM, Kyrill Tkachov wrote: 2014-09-02 Kyrylo Tkachov kyrylo.tkac...@arm.com * config/aarch64/predicates.md (aarch64_comparison_operation): New special predicate. * config/aarch64/aarch64.md (*csinc2mode_insn): Use aarch64_comparison_operation instead of

Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-09-02 Thread Kyrill Tkachov
On 02/09/14 16:47, Richard Henderson wrote: On 09/02/2014 08:34 AM, Kyrill Tkachov wrote: 2014-09-02 Kyrylo Tkachov kyrylo.tkac...@arm.com * config/aarch64/predicates.md (aarch64_comparison_operation): New special predicate. * config/aarch64/aarch64.md (*csinc2mode_insn): Use

Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-08-19 Thread Kyrill Tkachov
On 18/08/14 19:52, Richard Henderson wrote: On 08/18/2014 05:24 AM, Kyrill Tkachov wrote: -(define_insn *csinc2mode_insn +(define_insn *csinc2mode_CC_ZERO:mode_insn [(set (match_operand:GPI 0 register_operand =r) (plus:GPI (match_operator:GPI 2 aarch64_comparison_operator -

Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-08-19 Thread Richard Henderson
On 08/19/2014 06:29 AM, Kyrill Tkachov wrote: +(define_special_predicate cc_register_zero + (and (match_code reg) + (and (match_test REGNO (op) == CC_REGNUM) + (ior (match_test mode == GET_MODE (op)) + (ior (match_test mode == VOIDmode +

Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-08-19 Thread Kyrill Tkachov
On 19/08/14 16:25, Richard Henderson wrote: On 08/19/2014 06:29 AM, Kyrill Tkachov wrote: +(define_special_predicate cc_register_zero + (and (match_code reg) + (and (match_test REGNO (op) == CC_REGNUM) + (ior (match_test mode == GET_MODE (op)) +(ior (match_test

Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-08-19 Thread Richard Henderson
(define_special_predicate cc_register_zero (match_code reg) { return (REGNO (op) == CC_REGNUM (GET_MODE (op) == CCmode || GET_MODE (op) == CC_Zmode || GET_MODE (op) == CC_NZmode)); }) ... and now that I read the backend more closely, I see _zero

Re: [PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-08-19 Thread Kyrill Tkachov
On 19/08/14 17:09, Richard Henderson wrote: (define_special_predicate cc_register_zero (match_code reg) { return (REGNO (op) == CC_REGNUM (GET_MODE (op) == CCmode || GET_MODE (op) == CC_Zmode || GET_MODE (op) == CC_NZmode)); }) ... and now that I

[PATCH][AArch64] Use CC_Z and CC_NZ with csinc and similar instructions

2014-08-18 Thread Kyrill Tkachov
Hi all, Currently for code: int foo (unsigned a, unsigned b) { int r = 0; r = a b; if (a b) return ++ r; return r; } we generate: foo: andw0, w0, w1 cmpw0, wzr csincw0, wzr, w0, eq ret If we relax the csinc and similar patterns to accept the CC_Z and