RE: [Ping] [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-10-27 Thread Zhenqiang Chen
-Original Message- From: Richard Henderson [mailto:r...@redhat.com] Sent: Sunday, October 12, 2014 5:40 AM To: Zhenqiang Chen; gcc-patches@gcc.gnu.org Subject: Re: [Ping] [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov On 09/22/2014 11:46 PM, Zhenqiang

Re: [Ping] [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-10-27 Thread Richard Henderson
On 10/27/2014 12:50 AM, Zhenqiang Chen wrote: Good point. It is not ccmp special. It is cbranchcc4 related. If I understand correct, without cbranchcc4, we need put the result to a tmp register and generate additional compares, which is not good for performance. It won't be an additional

Re: [Ping] [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-10-11 Thread Richard Henderson
On 09/22/2014 11:46 PM, Zhenqiang Chen wrote: @@ -2375,10 +2387,21 @@ noce_get_condition (rtx_insn *jump, rtx_insn **earliest, bool then_else_reversed return cond; } + /* For conditional compare, set ALLOW_CC_MODE to TRUE. */ + if (targetm.gen_ccmp_first) +{ +

[Ping] [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-09-23 Thread Zhenqiang Chen
Ping? Patch is rebased and attached. Thanks! -Zhenqiang ChangeLog 2014-09-23 Zhenqiang Chen zhenqiang.c...@linaro.org Andrew Pinski apin...@cavium.com * ccmp.c (used_in_cond_stmt_p): Hande ? expr. * expr.c (expand_cond_expr_using_cmove): Handle CCmode. *

Re: [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-07-04 Thread Zhenqiang Chen
Andrew, Thanks for the input. Patch is updated with your codes. In addition, add cstorecc4 and 4 test cases. So it can optimized the following example int foo (int a, int b) { return a 0 b 7; } to: cmpw0, wzr ccmpw1, #6, #9, gt csetw0, le Bootstrap and no make

[PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-06-23 Thread Zhenqiang Chen
Hi, The patch enhances ifcvt to handle conditional compare instruction (ccmp) to make it work with cmov. For ccmp, ALLOW_CC_MODE is set to TRUE when calling canonicalize_condition. And the backend does not need to generate additional compare (CC, 0) for it. Bootstrap and no check regression on

Re: [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-06-23 Thread Andrew Pinski
On Mon, Jun 23, 2014 at 12:01 AM, Zhenqiang Chen zhenqiang.c...@linaro.org wrote: Hi, The patch enhances ifcvt to handle conditional compare instruction (ccmp) to make it work with cmov. For ccmp, ALLOW_CC_MODE is set to TRUE when calling canonicalize_condition. And the backend does not need

Re: [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-06-23 Thread Andrew Pinski
On Mon, Jun 23, 2014 at 12:09 AM, Andrew Pinski pins...@gmail.com wrote: On Mon, Jun 23, 2014 at 12:01 AM, Zhenqiang Chen zhenqiang.c...@linaro.org wrote: Hi, The patch enhances ifcvt to handle conditional compare instruction (ccmp) to make it work with cmov. For ccmp, ALLOW_CC_MODE is set

Re: [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-06-23 Thread Zhenqiang Chen
On 23 June 2014 15:09, Andrew Pinski pins...@gmail.com wrote: On Mon, Jun 23, 2014 at 12:01 AM, Zhenqiang Chen zhenqiang.c...@linaro.org wrote: Hi, The patch enhances ifcvt to handle conditional compare instruction (ccmp) to make it work with cmov. For ccmp, ALLOW_CC_MODE is set to TRUE

Re: [PATCH, 10/10] aarch64: Handle ccmp in ifcvt to make it work with cmov

2014-06-23 Thread pinskia
On Jun 23, 2014, at 12:37 AM, Zhenqiang Chen zhenqiang.c...@linaro.org wrote: On 23 June 2014 15:09, Andrew Pinski pins...@gmail.com wrote: On Mon, Jun 23, 2014 at 12:01 AM, Zhenqiang Chen zhenqiang.c...@linaro.org wrote: Hi, The patch enhances ifcvt to handle conditional compare