diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1995-04-26 11:06:52 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1995-04-26 11:06:52 -0700 |
commit | 99f762bff753e425603fb24473155a1c63582b95 (patch) | |
tree | 9f84dbc7c1297bc71d95266a2fe960f5df7ab386 | |
parent | 6ac342776accd452ebff3e1484731d0da2f8fd84 (diff) | |
download | gcc-99f762bff753e425603fb24473155a1c63582b95.zip gcc-99f762bff753e425603fb24473155a1c63582b95.tar.gz gcc-99f762bff753e425603fb24473155a1c63582b95.tar.bz2 |
(truncdiqi2+[456]): Add patterns to simplify ZERO_EXTEND
of a TRUNCATE.
From-SVN: r9478
-rw-r--r-- | gcc/config/mips/mips.md | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 9717b07..775013e 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")]) ;; ;; .................... |