On Mon, 8 Jul 2019 at 11:06, Kyrill Tkachov <kyrylo.tkac...@foss.arm.com> wrote: > > Hi Christophe > > On 7/8/19 10:01 AM, Christophe Lyon wrote: > > Hi, > > > > This patch fixes PR 91060 where the lane ordering was no longer the > > right one (GCC's vs architecture's). > > > > OK? > > > > Thanks to both Richards for most of the debugging! > > Thank you to all for tracking this down. > > > > > Christophe > > > pr91060.patch.txt > > diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c > index 820502a..4c7b5a8 100644 > --- a/gcc/config/arm/arm.c > +++ b/gcc/config/arm/arm.c > @@ -12471,7 +12471,7 @@ neon_expand_vector_init (rtx target, rtx vals) > if (n_var == 1) > { > rtx copy = copy_rtx (vals); > - rtx index = GEN_INT (one_var); > + rtx index = GEN_INT (1 << one_var); > > /* Load constant part of vector, substitute neighboring value for > varying element. */ > @@ -12483,31 +12483,31 @@ neon_expand_vector_init (rtx target, rtx vals) > switch (mode) > { > case E_V8QImode: > - emit_insn (gen_neon_vset_lanev8qi (target, x, target, index)); > + emit_insn (gen_vec_setv8qi_internal (target, x, index, target)); > break; > case E_V16QImode: > - emit_insn (gen_neon_vset_lanev16qi (target, x, target, index)); > + emit_insn (gen_vec_setv16qi_internal (target, x, index, target)); > break; > case E_V4HImode: > - emit_insn (gen_neon_vset_lanev4hi (target, x, target, index)); > + emit_insn (gen_vec_setv4hi_internal (target, x, index, target)); > break; > case E_V8HImode: > - emit_insn (gen_neon_vset_lanev8hi (target, x, target, index)); > + emit_insn (gen_vec_setv8hi_internal (target, x, index, target)); > break; > case E_V2SImode: > - emit_insn (gen_neon_vset_lanev2si (target, x, target, index)); > + emit_insn (gen_vec_setv2si_internal (target, x, index, target)); > break; > case E_V4SImode: > - emit_insn (gen_neon_vset_lanev4si (target, x, target, index)); > + emit_insn (gen_vec_setv4si_internal (target, x, index, target)); > break; > case E_V2SFmode: > - emit_insn (gen_neon_vset_lanev2sf (target, x, target, index)); > + emit_insn (gen_vec_setv2sf_internal (target, x, index, target)); > break; > case E_V4SFmode: > - emit_insn (gen_neon_vset_lanev4sf (target, x, target, index)); > + emit_insn (gen_vec_setv4sf_internal (target, x, index, target)); > break; > case E_V2DImode: > - emit_insn (gen_neon_vset_lanev2di (target, x, target, index)); > + emit_insn (gen_vec_setv2di_internal (target, x, index, target)); > break; > default: > gcc_unreachable (); > > > Can we take the opportunity here to remove that switch statement and use the > parametrised names machinery: > https://gcc.gnu.org/onlinedocs/gccint/Parameterized-Names.html#Parameterized-Names > > so that we can instead have one call to gen_vec_setv8hi_internal (mode, > target, x, merge_mask, target) or something.
Yes, that's what Richard posted in bugzilla, it's much nicer indeed. > Thanks, > Kyrill >