From: Jim Wilson Date: Wed, 26 Apr 1995 18:06:52 +0000 (-0700) Subject: (truncdiqi2+[456]): Add patterns to simplify ZERO_EXTEND X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99f762bff753e425603fb24473155a1c63582b95;p=gcc.git (truncdiqi2+[456]): Add patterns to simplify ZERO_EXTEND of a TRUNCATE. From-SVN: r9478 --- diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 9717b0748ed..775013eec32 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -2113,6 +2113,38 @@ move\\t%0,%z4\\n\\ [(set_attr "type" "darith") (set_attr "mode" "SI") (set_attr "length" "2")]) + +;; Combiner patterns to optimize truncate/zero_extend combinations. + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (zero_extend:SI (truncate:HI + (match_operand:DI 1 "register_operand" "d"))))] + "TARGET_64BIT" + "andi\\t%0,%1,0xffff" + [(set_attr "type" "darith") + (set_attr "mode" "SI") + (set_attr "length" "1")]) + +(define_insn "" + [(set (match_operand:SI 0 "register_operand" "=d") + (zero_extend:SI (truncate:QI + (match_operand:DI 1 "register_operand" "d"))))] + "TARGET_64BIT" + "andi\\t%0,%1,0xff" + [(set_attr "type" "darith") + (set_attr "mode" "SI") + (set_attr "length" "1")]) + +(define_insn "" + [(set (match_operand:HI 0 "register_operand" "=d") + (zero_extend:HI (truncate:QI + (match_operand:DI 1 "register_operand" "d"))))] + "TARGET_64BIT" + "andi\\t%0,%1,0xff" + [(set_attr "type" "darith") + (set_attr "mode" "HI") + (set_attr "length" "1")]) ;; ;; ....................