On 14 September 2011 13:30, Richard Sandiford <richard.sandif...@linaro.org> wrote: > neon_vget_high and neon_vget_low extract one half of a vector. > The patterns look like: > > (define_insn "neon_vget_highv16qi" > [(set (match_operand:V8QI 0 "s_register_operand" "=w") > (vec_select:V8QI (match_operand:V16QI 1 "s_register_operand" "w") > (parallel [(const_int 8) (const_int 9) > (const_int 10) (const_int 11) > (const_int 12) (const_int 13) > (const_int 14) (const_int 15)])))] > "TARGET_NEON" > { > int dest = REGNO (operands[0]); > int src = REGNO (operands[1]); > > if (dest != src + 2) > return "vmov\t%P0, %f1"; > else > return ""; > } > [(set_attr "neon_type" "neon_bp_simple")] > ) > > But there's nothing here to tell the register allocator what's expected > of it, so we do often get the move. The patch below makes the patterns > expand to normal subreg moves instead. > > Unfortunately, when I first tried this, I ran across some bugs in > simplify-rtx.c. They should be fixed now. Of course, I can't > guarantee that there are other similar bugs elsewhere, but I'll > try to fix any that crop up. > > The new patterns preserve the current treatment on big-endian targets. > Namely, the "low" half is always in the lower-numbered registers > (subreg byte offset 0). > > Tested on arm-linux-gnueabi. OK to install?
This is OK . Please watch out for any fallout that comes as a result of this . It would be useful to do some big endian testing at some point but I'm not going to let that hold up this patch. While you are here can you look at the quad_halves_<code>v4si etc. patterns neon_move_lo_quad_<mode> and neon_move_hi_quad_<mode> patterns which seem to have the same problem ? And then I remembered this ancient FIXME: > ; FIXME: We wouldn't need the following insns if we could write subregs of > ; vector registers. Make an attempt at removing unnecessary moves, though > ; we're really at the mercy of the register allocator. > But that can be a follow-up patch. And it's nice to be able to remove such FIXME's :) cheers Ramana