mips.md (trucndihi2,truncdiqi2): Change these to support mips16.
authorGavin Koch <gavin@cygnus.com>
Thu, 12 Feb 1998 11:06:08 +0000 (11:06 +0000)
committerGavin Romig-Koch <gavin@gcc.gnu.org>
Thu, 12 Feb 1998 11:06:08 +0000 (11:06 +0000)
* mips.md (trucndihi2,truncdiqi2): Change these to support
mips16.

From-SVN: r17868

gcc/ChangeLog
gcc/config/mips/mips.md

index e4a07cb2a67b42a0a2a84b0240c3903991ad1e34..e8fc0c8773ee4abbee5298c25e3eb24f5f8fe96a 100644 (file)
@@ -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
index 76e0d43bceac8be8cd87fb1450f8ad68299e6e62..2745797610fc642e87200f093bdaf314af168c13 100644 (file)
@@ -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 ""