Richard Henderson <r...@redhat.com> writes: > + /* Use PUL/PLU to produce { L, H } op { H, L }. > + By reversing the pair order, rather a pure interleave high, > + we don't produce erroneous exceptional conditions. */
"rather than". We don't produce erroneous exceptional conditions that would result from H op H? It probably should be obvious, but it took me a few seconds to work out... > + case V4HImode: > + /* Perform the first reduction with interleave, > + and subsequent reductions with shifts. */ > + emit_insn (gen_loongson_punpckhwd_hi (tmp, in, in)); > + emit_insn (gen (in, in, tmp)); > + emit_insn (gen_vec_shr_v4hi (tmp, in, force_reg (SImode, GEN_INT > (16)))); > + break; > + > + case V8QImode: > + emit_insn (gen_loongson_punpckhwd_qi (tmp, in, in)); > + emit_insn (gen (in, in, tmp)); > + emit_insn (gen_vec_shr_v8qi (tmp, in, force_reg (SImode, GEN_INT > (16)))); > + emit_insn (gen (in, in, tmp)); > + emit_insn (gen_vec_shr_v8qi (tmp, in, force_reg (SImode, GEN_INT > (8)))); > + break; Seems safer to have a second temporary rather than assign to the input here. Richard