mips.md (muldi3_r4000): Broaden the output template and attribute assignments to...
authorGavin Koch <gavin@cygnus.com>
Wed, 3 Dec 1997 16:47:25 +0000 (16:47 +0000)
committerGavin Romig-Koch <gavin@gcc.gnu.org>
Wed, 3 Dec 1997 16:47:25 +0000 (16:47 +0000)
* mips/mips.md (muldi3_r4000): Broaden the output template
and attribute assignments to handle three operand dmult;
rename to muldi3_internal2.
(muldi3): Call the new muldi3_internal2 for R4000, and
any GENERATE_MULT3 chip.

From-SVN: r16927

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

index 580a64f635f5c2f6c97c6f562b6ecca46e23767c..8f9f3245604fb153c8f39f72d963cd7b64026a78 100644 (file)
@@ -1,3 +1,11 @@
+Wed Dec  3 11:41:13 1997  Gavin Koch  <gavin@cygnus.com>
+
+       * mips/mips.md (muldi3_r4000): Broaden the output template
+       and attribute assignments to handle three operand dmult;
+       rename to muldi3_internal2.
+       (muldi3): Call the new muldi3_internal2 for R4000, and
+       any GENERATE_MULT3 chip.
+
 Tue Dec  2 19:40:43 1997  Jason Merrill  <jason@yorick.cygnus.com>
 
        * stmt.c (expand_decl_cleanup): Update thisblock after eh_region_start.
index 9c6852fc007f85aebb3982992449fa094346c1e8..dcd82fde57149ede648de41986c17ac3b3457a5d 100644 (file)
   "TARGET_64BIT"
   "
 {
-  if (mips_cpu != PROCESSOR_R4000)
-    emit_insn (gen_muldi3_internal (operands[0], operands[1], operands[2]));
+  if (GENERATE_MULT3 || mips_cpu == PROCESSOR_R4000)
+    emit_insn (gen_muldi3_internal2 (operands[0], operands[1], operands[2]));
   else
-    emit_insn (gen_muldi3_r4000 (operands[0], operands[1], operands[2]));
+    emit_insn (gen_muldi3_internal (operands[0], operands[1], operands[2]));
   DONE;
 }")
 
    (set_attr "mode"    "DI")
    (set_attr "length"  "1")])
 
-(define_insn "muldi3_r4000"
+(define_insn "muldi3_internal2"
   [(set (match_operand:DI 0 "register_operand" "=d")
        (mult:DI (match_operand:DI 1 "se_register_operand" "d")
                 (match_operand:DI 2 "register_operand" "d")))
    (clobber (match_scratch:DI 3 "=h"))
    (clobber (match_scratch:DI 4 "=l"))
    (clobber (match_scratch:DI 5 "=a"))]
-  "TARGET_64BIT && mips_cpu == PROCESSOR_R4000"
+  "TARGET_64BIT && (GENERATE_MULT3 || mips_cpu == PROCESSOR_R4000)"
   "*
 {
-  rtx xoperands[10];
+  if (GENERATE_MULT3)
+    output_asm_insn (\"dmult\\t%0,%1,%2\", operands);
+  else 
+    {
+    rtx xoperands[10];
 
-  xoperands[0] = operands[0];
-  xoperands[1] = gen_rtx (REG, DImode, LO_REGNUM);
+    xoperands[0] = operands[0];
+    xoperands[1] = gen_rtx (REG, DImode, LO_REGNUM);
 
-  output_asm_insn (\"dmult\\t%1,%2\", operands);
-  output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
+    output_asm_insn (\"dmult\\t%1,%2\", operands);
+    output_asm_insn (mips_move_1word (xoperands, insn, FALSE), xoperands);
+    }
   return \"\";
 }"
   [(set_attr "type"    "imul")
    (set_attr "mode"    "DI")
-   (set_attr "length"  "3")])          ;; mult + mflo + delay
+   (set (attr "length")
+       (if_then_else (ne (symbol_ref "GENERATE_MULT3") (const_int 0))
+                      (const_int 1)
+                      (const_int 3)))])        ;; mult + mflo + delay
 
 ;; ??? We could define a mulditi3 pattern when TARGET_64BIT.