On Fri, Oct 28, 2011 at 10:57 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Thu, Oct 27, 2011 at 10:07:13PM +0200, Uros Bizjak wrote: >> Please use expressive RTX forms for expanders, similar to the above >> define_insn RTX. You can avoid calling gen_avx2_lshrv<mode> at the end >> of c code. Also, expanders can have nonimmediate_operand as operand 2 >> and conditionally move it to register in C code block if needed. > > Like this?
Yes. > In addition to that the patch also enables all the 3 patterns for V2DImode > for -mxop too (all this depends on some solution for the vectorizable_shift > ICE I've posted yesterday) and except for the left shift xop only pattern > uses nonimmediate_operand on the last arg - even the xop pattern that start > with negation of the last operand can use nonimmediate_operand which > neg<mode>2 uses. I see some more cleanup opportunities with XOP patterns, I will try to create a follow-up patch. > 2011-10-28 Jakub Jelinek <ja...@redhat.com> > > * config/i386/sse.md (VI4SD_AVX2): Removed. > (VI48_AVX2, VI128_128, VI48_128, VI48_256): New mode iterators. > (vashl<mode>3): Use VI12_128 iterator instead of VI124_128. > Add another expander using VI48_128 iterator for > TARGET_AVX2 || TARGET_XOP and another using VI48_256 iterator > for TARGET_AVX2. > (vlshr<mode>3): Likewise. Change register_operand predicate to > nonimmediate_operand on last operand in the VI12_128 expander. > (vashr<mode>3): Use VI128_128 iterator instead of VI124_128. > (vashrv4si3, vashrv8si3): New expanders. > (avx2_ashrvv8si, avx2_ashrvv4si, avx2_<lshift>vv8si, > avx2_<lshift>vv2di): Removed. > (avx2_ashrv<mode>): New insn with VI4_AVX2 iterator. > (avx2_<lshift>v<mode>): Macroize using VI48_AVX2 > iterator. Simplify pattern. > > * gcc.dg/vshift-1.c: New test. > * gcc.dg/vshift-2.c: New test. > * gcc.target/i386/xop-vshift-1.c: New test. > * gcc.target/i386/xop-vshift-2.c: New test. > * gcc.target/i386/avx2-vshift-1.c: New test. OK. Thanks, Uros.