Hi!

On Wed, Sep 13, 2017 at 06:13:50PM +0100, Kyrill Tkachov wrote:
> +;; Specialized OR instruction for combiner.  The AND is masking out bits
> +;; not needed in the OR (doing a zero_extend).  The zero_extend is not
> +;; needed because we know from the subreg that the upper part of the reg
> +;; is zero.
> +(define_insn "*iorqi3_uxtw"
> +  [(set (match_operand:SI 0 "register_operand" "=r")
> +        (ior:SI (and:SI
> +               (subreg:SI (match_operand:QI 1 "register_operand" "r") 0)
> +               (match_operand:SI 2 "const_int_operand" "n"))
> +             (match_operand:SI 3 "aarch64_logical_operand" "K")))]
> +  "INTVAL (operands[2]) + INTVAL (operands[3]) == 255"
> +  "orr\\t%w0, %w1, %3"
> +  [(set_attr "type" "logic_imm")]
> +)
> 
> We are usually hesitant to add explicit subreg matching in the MD pattern
> (though I don't remember if there's a hard rule against it).
> In this case this looks like a missing simplification from combine 
> (simplify-rtx) so
> I think adding it there would be better.

Yes, it probably belongs as a generic simplification in simplify-rtx.c;
if there is a reason not to do that, it can be done in combine.c instead.


Segher

Reply via email to