On Mon, Aug 08, 2016 at 12:10:00PM +0100, Bin.Cheng wrote: > On Mon, Aug 8, 2016 at 11:40 AM, James Greenhalgh > <james.greenha...@arm.com> wrote: > > On Mon, Aug 01, 2016 at 01:18:53PM +0000, Bin Cheng wrote: > >> Hi, > >> This is the 3rd version patch implementing vcond_mask and vec_cmp patterns > >> on > >> AArch64. Bootstrap and test along with next patch on AArch64, is it OK? > > > > OK, with a couple of comments below, one on an extension and once style nit. > > > >> 2016-07-28 Alan Lawrence <alan.lawre...@arm.com> > >> Renlin Li <renlin...@arm.com> > >> Bin Cheng <bin.ch...@arm.com> > >> > >> * config/aarch64/aarch64-simd.md (vec_cmp<mode><mode>): New pattern. > >> (vec_cmp<mode><v_cmp_result>): New pattern. > >> (vec_cmpu<mode><mode>): New pattern. > >> (vcond_mask_<mode><v_cmp_result>): New pattern. > > > >> +(define_expand "vcond_mask_<mode><v_cmp_result>" > >> + [(match_operand:VALLDI 0 "register_operand") > >> + (match_operand:VALLDI 1 "nonmemory_operand") > >> + (match_operand:VALLDI 2 "nonmemory_operand") > >> + (match_operand:<V_cmp_result> 3 "register_operand")] > >> + "TARGET_SIMD" > >> +{ > >> + /* If we have (a = (P) ? -1 : 0); > >> + Then we can simply move the generated mask (result must be int). */ > >> + if (operands[1] == CONSTM1_RTX (<MODE>mode) > >> + && operands[2] == CONST0_RTX (<MODE>mode)) > >> + emit_move_insn (operands[0], operands[3]); > >> + /* Similarly, (a = (P) ? 0 : -1) is just inverting the generated mask. > >> */ > >> + else if (operands[1] == CONST0_RTX (<MODE>mode) > >> + && operands[2] == CONSTM1_RTX (<MODE>mode)) > >> + emit_insn (gen_one_cmpl<v_cmp_result>2 (operands[0], operands[3])); > Hi, > Thanks for reviewing, here is updated patch. > > > > Should we be also be catching these in a generic way before expanding? > This pattern was copied unchanged from Alan's original patch. > Yes, standard match-and-simplify pattern may be added to check such > special simplifications. Not sure what the current behavior is, we'd > better keep this at expanding too?
Yes, that's what I'd expect. > Comment issues fixed. Is this version OK? Yes this is OK. Thanks, James