OSDN Git Service

(truncdiqi2+[456]): Add patterns to simplify ZERO_EXTEND
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Apr 1995 18:06:52 +0000 (18:06 +0000)
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 26 Apr 1995 18:06:52 +0000 (18:06 +0000)
of a TRUNCATE.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9478 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/config/mips/mips.md

index 9717b07..775013e 100644 (file)
@@ -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")])
 \f
 ;;
 ;;  ....................