aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGavin Koch <gavin@cygnus.com>1998-02-12 11:06:08 +0000
committerGavin Romig-Koch <gavin@gcc.gnu.org>1998-02-12 11:06:08 +0000
commit00bb4b6208ccd1dfbec9a6ac24a106bafb80ae04 (patch)
treeb0ce1394436b0dfeb84ae9cee2f2d76fc4ad2538 /gcc
parent3871c609278860dacf2b324449a6d00e550d5121 (diff)
downloadgcc-00bb4b6208ccd1dfbec9a6ac24a106bafb80ae04.zip
gcc-00bb4b6208ccd1dfbec9a6ac24a106bafb80ae04.tar.gz
gcc-00bb4b6208ccd1dfbec9a6ac24a106bafb80ae04.tar.bz2
mips.md (trucndihi2,truncdiqi2): Change these to support mips16.
* mips.md (trucndihi2,truncdiqi2): Change these to support mips16. From-SVN: r17868
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.md27
2 files changed, 25 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e4a07cb..e8fc0c87 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+Thu Feb 12 14:04:09 1998 Gavin Koch <gavin@cygnus.com>
+
+ * mips.md (trucndihi2,truncdiqi2): Change these to support
+ mips16.
+
Thu Feb 12 11:34:55 1998 Gavin Koch <gavin@cygnus.com>
* mips/mips.c (movdi_operand): Direct referances to symbols
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index 76e0d43..2745797 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -3188,20 +3188,33 @@ move\\t%0,%z4\\n\\
(define_insn "truncdihi2"
[(set (match_operand:HI 0 "register_operand" "=d")
(truncate:HI (match_operand:DI 1 "se_register_operand" "d")))]
- "TARGET_64BIT && !TARGET_MIPS16"
- "andi\\t%0,%1,0xffff"
+ "TARGET_64BIT"
+ "*
+{
+ if (TARGET_MIPS16)
+ return \"dsll\\t%0,%1,48\;dsra\\t%0,48\";
+ return \"andi\\t%0,%1,0xffff\";
+}"
[(set_attr "type" "darith")
(set_attr "mode" "HI")
- (set_attr "length" "1")])
-
+ (set (attr "length") (if_then_else (eq (symbol_ref "mips16") (const_int 0))
+ (const_int 1)
+ (const_int 4)))])
(define_insn "truncdiqi2"
[(set (match_operand:QI 0 "register_operand" "=d")
(truncate:QI (match_operand:DI 1 "se_register_operand" "d")))]
- "TARGET_64BIT && !TARGET_MIPS16"
- "andi\\t%0,%1,0x00ff"
+ "TARGET_64BIT"
+ "*
+{
+ if (TARGET_MIPS16)
+ return \"dsll\\t%0,%1,56\;dsra\\t%0,56\";
+ return \"andi\\t%0,%1,0x00ff\";
+}"
[(set_attr "type" "darith")
(set_attr "mode" "QI")
- (set_attr "length" "1")])
+ (set (attr "length") (if_then_else (eq (symbol_ref "mips16") (const_int 0))
+ (const_int 1)
+ (const_int 4)))])
;; Combiner patterns to optimize shift/truncate combinations.
(define_insn ""