> +(define_expand "one_cmpl<mode>2"
> + [(match_operand:IMSA 0 "register_operand")
> + (match_operand:IMSA 1 "register_operand")]
> + "ISA_HAS_MSA"
> +{
> + if (<MODE>mode == V16QImode)
> + emit_insn (gen_msa_nori_b (operands[0], operands[1], const0_rtx));
> + else
> + {
> + rtx reg = gen_reg_rtx (<MODE>mode);
> + emit_insn (gen_msa_ldi<mode> (reg, const0_rtx));
> + emit_insn (gen_msa_nor_v_<msafmt> (operands[0], reg, operands[1]));
> + }
> + DONE;
> +})
Surely ~(x | x) would be preferable to ~(x | 0) if you actually have to load 0
into a register.
And most definitely combine would prefer to see NOT instead of a complex
expression. I think you're better off with a define_insn than an expand.
r~