On Fri, Jul 28, 2017 at 04:08:50PM -0500, Segher Boessenkool wrote: > > "emit" is not a good name for this: that is generally used for something > that does emit_insn, i.e. put an insn in the instruction stream. This > function returns a string a define_insn can return. For the rl* insns > I called the similar functions rs6000_insn_for_*, maybe something like > that is better here? ... > I think calling this with the rtx elementN args makes this only more > complicated (the function comment doesn't say what they are or what > NULL means, btw). ... > In this and the other testcase, should you test no other insns at all > are generated? Here are the revised patches. I tested on a little endian power8 system and a big endian power7 system. Are these patches ok for the trunk? [gcc] 2017-08-02 Michael Meissner PR target/81593 * config/rs6000/rs6000-protos.h (rs6000_output_xxpermdi): New declaration. * config/rs6000/rs6000.c (rs6000_output_xxpermdi): New function to emit XXPERMDI accessing either double word in either vector register inputs. * config/rs6000/vsx.md (vsx_concat_, VSX_D iterator): Rewrite VEC_CONCAT insn to call rs6000_output_xxpermdi. Simplify the constraints with the removal of the -mupper-regs-* switches. (vsx_concat__1): New combiner insns to optimize CONCATs where either register might have come from VEC_SELECT. (vsx_concat__2): Likewise. (vsx_concat__3): Likewise. (vsx_set_, VSX_D iterator): Rewrite insn to generate a VEC_CONCAT rather than use an UNSPEC to specify the option. [gcc/testsuite] 2017-08-02 Michael Meissner PR target/81593 * gcc.target/powerpc/vsx-extract-6.c: New test. * gcc.target/powerpc/vsx-extract-7.c: Likewise. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797