]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
mips.md (type): Add imul3.
authorDavid Ung <davidu@mips.com>
Wed, 11 May 2005 12:52:58 +0000 (12:52 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Wed, 11 May 2005 12:52:58 +0000 (12:52 +0000)
* config/mips/mips.md (type): Add imul3.
(length, hazard, may_clobber_hilo): Check for imul3.
(mulsi3_mult3, muldi3_mult3, *muls, <su>mulsi3_highpart_mulhi_internal)
(*<su>mulsi3_highpart_neg_mulhi_internal): Set attr to imul3.
* config/mips/24k.md (r24k_int_mul3): Enable this reservation
for a 3 operand mul and its bypasses.
* config/mips/3000.md (r3k_imul): Add imul3 to reservations.
* config/mips/4000.md (r4k_imul): Likewise.
* config/mips/4100.md (r4100_imul_si, r4100_imul_di):  Likewise.
* config/mips/4130.md (vr4130_class, vr4130_mulsi)
(vr4130_muldi): Likewise.
* config/mips/4300.md (r4300_imul_si, r4300_imul_di): Likewise.
* config/mips/4600.md (r4600_imul, r4650_imul): Likewise.
* config/mips/5000.md (r5k_imul_si, r5k_imul_di): Likewise.
* config/mips/5400.md (ir_vr54_imul_si, ir_vr54_imul_di)
(ir_vr54_imadd_si): Likewise.
* config/mips/5500.md (ir_vr55_imul_si, ir_vr55_imul_di):  Likewise.
* config/mips/7000.md (rm7_impy_si_mult, rm7_impy_si_mul)
(rm7_impy_di): Likewise.
* config/mips/9000.md (rm9k_mulsi, rm9k_muldi):  Likewise.
* config/mips/generic.md (generic_imul): Likewise.
* config/mips/sb1.md (ir_sb1_mulsi, ir_sb1_muldi): Likewise.
* config/mips/sr71k.md (ir_sr70_imul_si, ir_sr70_imul_di):  Likewise.

From-SVN: r99577

17 files changed:
gcc/ChangeLog
gcc/config/mips/24k.md
gcc/config/mips/3000.md
gcc/config/mips/4000.md
gcc/config/mips/4100.md
gcc/config/mips/4130.md
gcc/config/mips/4300.md
gcc/config/mips/4600.md
gcc/config/mips/5000.md
gcc/config/mips/5400.md
gcc/config/mips/5500.md
gcc/config/mips/7000.md
gcc/config/mips/9000.md
gcc/config/mips/generic.md
gcc/config/mips/mips.md
gcc/config/mips/sb1.md
gcc/config/mips/sr71k.md

index 145839cb65427d957d4bed6f3ba333c1dca669af..d620fc48c9d4c501ccf075ae87d24ae34308ecf8 100644 (file)
@@ -1,3 +1,29 @@
+2005-05-11  David Ung  <davidu@mips.com>
+
+       * config/mips/mips.md (type): Add imul3.
+       (length, hazard, may_clobber_hilo): Check for imul3.
+       (mulsi3_mult3, muldi3_mult3, *muls, <su>mulsi3_highpart_mulhi_internal)
+       (*<su>mulsi3_highpart_neg_mulhi_internal): Set attr to imul3.
+       * config/mips/24k.md (r24k_int_mul3): Enable this reservation
+       for a 3 operand mul and its bypasses.
+       * config/mips/3000.md (r3k_imul): Add imul3 to reservations.
+       * config/mips/4000.md (r4k_imul): Likewise.
+       * config/mips/4100.md (r4100_imul_si, r4100_imul_di):  Likewise.
+       * config/mips/4130.md (vr4130_class, vr4130_mulsi)
+       (vr4130_muldi): Likewise.
+       * config/mips/4300.md (r4300_imul_si, r4300_imul_di): Likewise.
+       * config/mips/4600.md (r4600_imul, r4650_imul): Likewise.
+       * config/mips/5000.md (r5k_imul_si, r5k_imul_di): Likewise.
+       * config/mips/5400.md (ir_vr54_imul_si, ir_vr54_imul_di)
+       (ir_vr54_imadd_si): Likewise.
+       * config/mips/5500.md (ir_vr55_imul_si, ir_vr55_imul_di):  Likewise.
+       * config/mips/7000.md (rm7_impy_si_mult, rm7_impy_si_mul)
+       (rm7_impy_di): Likewise.
+       * config/mips/9000.md (rm9k_mulsi, rm9k_muldi):  Likewise.
+       * config/mips/generic.md (generic_imul): Likewise.
+       * config/mips/sb1.md (ir_sb1_mulsi, ir_sb1_muldi): Likewise.
+       * config/mips/sr71k.md (ir_sr70_imul_si, ir_sr70_imul_di):  Likewise.
+
 2005-05-11  J"orn Rennecke <joern.rennecke@st.com>
 
        PR middle-end/20371:
index 4f6d50f6ad250a9dc39b2c11c195394c9bd3819c..feac2fe07cfeb8d0452decce48461b38e1f5ee1b 100644 (file)
   "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)")
 
 ;; mul - delivers result to gpr in 5 cycles 
-;; (disabled for now until we introduce the 3 operand mul into the general 
-;;  patterns).
-;;(define_insn_reservation "r24k_int_mul3" 5 
-;; (and (eq_attr "cpu" "24k,24kx")
-;;   (eq_attr "type" "imul3")) 
-;; "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)*5")
+(define_insn_reservation "r24k_int_mul3" 5 
+  (and (eq_attr "cpu" "24k,24kx")
+       (eq_attr "type" "imul3")) 
+  "r24k_iss+(r24k_mul3a|r24k_mul3b|r24k_mul3c)*5")
 
 ;; mfhi, mflo, mflhxu - deliver result to gpr in 5 cycles
 (define_insn_reservation "r24k_int_mfhilo" 5 
 ;; mul3->next use : 5 cycles (default)
 ;; mul3->l/s base : 6 cycles
 ;; mul3->prefetch : 6 cycles
-;;(define_bypass 6 "r24k_int_mul3" "r24k_int_load")
-;;(define_bypass 6 "r24k_int_mul3" "r24k_int_store" "!store_data_bypass_p")
-;;(define_bypass 6 "r24k_int_mul3" "r24k_int_prefetch")
+(define_bypass 6 "r24k_int_mul3" "r24k_int_load")
+(define_bypass 6 "r24k_int_mul3" "r24k_int_store" "!store_data_bypass_p")
+(define_bypass 6 "r24k_int_mul3" "r24k_int_prefetch")
 
 ;; mfhilo->next use  : 5 cycles (default)
 ;; mfhilo->l/s base  : 6 cycles 
index f9a829175d4bea7f52fd25746a71d1678e2607e0..bc748d8758fd461bedec6245835dbd0c38d8ab07 100644 (file)
@@ -29,7 +29,7 @@
 
 (define_insn_reservation "r3k_imul" 12
   (and (eq_attr "cpu" "r3000,r3900")
-       (eq_attr "type" "imul,imadd"))
+       (eq_attr "type" "imul,imul3,imadd"))
   "imuldiv*12")
 
 (define_insn_reservation "r3k_idiv" 35
index 97149a55fc8719c2401773b342e3d073b67f7881..4fcd240279c2d146d311d4cae67292e1a0f3e0d5 100644 (file)
@@ -24,7 +24,7 @@
 
 (define_insn_reservation "r4k_imul" 10
   (and (eq_attr "cpu" "r4000")
-       (eq_attr "type" "imul,imadd"))
+       (eq_attr "type" "imul,imul3,imadd"))
   "imuldiv*10")
 
 (define_insn_reservation "r4k_idiv" 69
index 2a0dcddaf6ac558f50e7f432c23555f5f86c5c10..5601c979edbfdc2f6e7db8fc354f5c0dcd73ee4a 100644 (file)
 
 (define_insn_reservation "r4100_imul_si" 1
   (and (eq_attr "cpu" "r4100,r4120")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "SI")))
   "imuldiv")
 
 (define_insn_reservation "r4100_imul_di" 4
   (and (eq_attr "cpu" "r4100,r4120")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "DI")))
   "imuldiv*4")
 
index eddc405de34fe557aba6e9e1e9aac0cae86e021b..6feeab38bbfe75eb71c698f76bed07b9a164ce71 100644 (file)
@@ -55,7 +55,7 @@
   (cond [(eq_attr "type" "load,store")
         (const_string "mem")
 
-        (eq_attr "type" "mfhilo,mthilo,imul,imadd,idiv")
+        (eq_attr "type" "mfhilo,mthilo,imul,imul3,imadd,idiv")
         (const_string "mul")]
        (const_string "alu")))
 
@@ -95,7 +95,7 @@
 ;; use "mtlo; macc" instead of "mult; mflo".
 (define_insn_reservation "vr4130_mulsi" 4
   (and (eq_attr "cpu" "r4130")
-       (and (eq_attr "type" "imul")
+       (and (eq_attr "type" "imul,imul3")
            (eq_attr "mode" "SI")))
   "vr4130_muldiv + (vr4130_mulpre * 2)")
 
 ;; after 3 cycles.
 (define_insn_reservation "vr4130_muldi" 6
   (and (eq_attr "cpu" "r4130")
-       (and (eq_attr "type" "imul")
+       (and (eq_attr "type" "imul,imul3")
            (eq_attr "mode" "DI")))
   "(vr4130_muldiv * 3) + (vr4130_mulpre * 4)")
 
index d663f16d6fbf4c1a905e2dc045812a4a7ce54ab8..0b319eaaac8e203e96a6dd7c7dfd5c4029d896a8 100644 (file)
 
 (define_insn_reservation "r4300_imul_si" 5
   (and (eq_attr "cpu" "r4300")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "SI")))
   "imuldiv*5")
 
 (define_insn_reservation "r4300_imul_di" 8
   (and (eq_attr "cpu" "r4300")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "DI")))
   "imuldiv*8")
 
index 58b309959d705805ba7122a3556add9699f5bcc8..7892200f20ab1a879ba7dc4ae4269d23a50bd8d5 100644 (file)
@@ -27,7 +27,7 @@
 
 (define_insn_reservation "r4600_imul" 10
   (and (eq_attr "cpu" "r4600")
-       (eq_attr "type" "imul,imadd"))
+       (eq_attr "type" "imul,imul3,imadd"))
   "imuldiv*10")
 
 (define_insn_reservation "r4600_idiv" 42
@@ -38,7 +38,7 @@
 
 (define_insn_reservation "r4650_imul" 4
   (and (eq_attr "cpu" "r4650")
-       (eq_attr "type" "imul,imadd"))
+       (eq_attr "type" "imul,imul3,imadd"))
   "imuldiv*4")
 
 (define_insn_reservation "r4650_idiv" 36
index 9b02ac32942c367d631aceaffc7bf02488f5223e..b00e707f1bd582977f008aeba528642e33a3c64a 100644 (file)
 
 (define_insn_reservation "r5k_imul_si" 5
   (and (eq_attr "cpu" "r5000")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "SI")))
   "imuldiv*5")
 
 (define_insn_reservation "r5k_imul_di" 9
   (and (eq_attr "cpu" "r5000")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "DI")))
   "imuldiv*9")
 
index f39dc884d04a23de21679fe46fbcde07684f1c81..8571308c96ea26b8eccb2fa20a3b8037aec94d59 100644 (file)
 
 (define_insn_reservation "ir_vr54_imul_si" 3
   (and (eq_attr "cpu" "r5400")
-       (and (eq_attr "type" "imul")
+       (and (eq_attr "type" "imul,imul3")
             (eq_attr "mode" "SI")))
   "vr54_dp0|vr54_dp1")
 
 (define_insn_reservation "ir_vr54_imul_di" 4
   (and (eq_attr "cpu" "r5400")
-       (and (eq_attr "type" "imul")
+       (and (eq_attr "type" "imul,imul3")
             (eq_attr "mode" "DI")))
   "vr54_dp0|vr54_dp1")
 
 (define_insn_reservation "ir_vr54_imadd_si" 3
   (and (eq_attr "cpu" "r5400")
-       (eq_attr "type" "imul"))
+       (eq_attr "type" "imul,imul3"))
   "vr54_mac")
 
 (define_insn_reservation "ir_vr54_idiv_si" 42
index fbcc6f62d6e5638e63379215c8b3aa1f7411253b..881cbcb4cff8c7b77667e6b2dd9464f9b0013254 100644 (file)
@@ -78,7 +78,7 @@
 ;; latency of {mul,mult}->{mfhi,mflo}.
 (define_insn_reservation "ir_vr55_imul_si" 5
   (and (eq_attr "cpu" "r5500")
-       (and (eq_attr "type" "imul")
+       (and (eq_attr "type" "imul,imul3")
             (eq_attr "mode" "SI")))
   "vr55_mac")
 
@@ -91,7 +91,7 @@
 ;; between it and the dmult.
 (define_insn_reservation "ir_vr55_imul_di" 9
   (and (eq_attr "cpu" "r5500")
-       (and (eq_attr "type" "imul")
+       (and (eq_attr "type" "imul,imul3")
             (eq_attr "mode" "DI")))
   "vr55_mac*4")
 
index ec75ffc96f800e85343d295d710d9d50649fe340..0323472aedee8c74e1058c261a6cee91aed94301 100644 (file)
 
 (define_insn_reservation "rm7_impy_si_mult" 5
                 (and (eq_attr "cpu" "r7000")
-                     (and (eq_attr "type" "imul,imadd")
+                     (and (eq_attr "type" "imul,imul3,imadd")
                           (and (eq_attr "mode" "SI")
                                (match_operand 0 "hilo_operand"))))
                         "rm7_impydiv+(rm7_impydiv_iter*3)")
 ;; There are an additional 2 stall cycles.
 (define_insn_reservation "rm7_impy_si_mul" 2
                 (and (eq_attr "cpu" "r7000")
-                     (and (eq_attr "type" "imul,imadd")
+                     (and (eq_attr "type" "imul,imul3,imadd")
                           (and (eq_attr "mode" "SI")
                                (not (match_operand 0 "hilo_operand")))))
                         "rm7_impydiv")
 
 (define_insn_reservation "rm7_impy_di" 9 (and (eq_attr "cpu" "r7000")
-                                         (and (eq_attr "type" "imul")
+                                         (and (eq_attr "type" "imul,imul3")
                                               (eq_attr "mode" "DI")))
                         "rm7_impydiv+(rm7_impydiv_iter*8)")
 
index b5501c3d696c7eb8a5e399028b34bebc809e09a5..4aa3ff6b2aa96f06f0cfab2e5818cd436a57fe9c 100644 (file)
 ;; This applies to both 'mul' and 'mult'.
 (define_insn_reservation "rm9k_mulsi" 3
   (and (eq_attr "cpu" "r9000")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "!DI")))
   "rm9k_f_int")
 
 (define_insn_reservation "rm9k_muldi" 7
   (and (eq_attr "cpu" "r9000")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "DI")))
   "rm9k_f_int + rm9k_imul * 7")
 
index 237272eb8afee094ee165eae57a02a529f65a411..7ddb0bd5163c267b3bea75d89ede2156157c6302 100644 (file)
@@ -48,7 +48,7 @@
   "imuldiv*3")
 
 (define_insn_reservation "generic_imul" 17
-  (eq_attr "type" "imul,imadd")
+  (eq_attr "type" "imul,imul3,imadd")
   "imuldiv*17")
 
 (define_insn_reservation "generic_idiv" 38
index 90a73054998fb48c20d58308fc0cc5e439d28c6e..1473f55a9274a98da259a33a23a5c142f4df05fb 100644 (file)
 ;; slt         set less than instructions
 ;; clz         the clz and clo instructions
 ;; trap                trap if instructions
-;; imul                integer multiply
+;; imul                integer multiply 2 operands
+;; imul3       integer multiply 3 operands
 ;; imadd       integer multiply-add
 ;; idiv                integer divide
 ;; fmove       floating point register move
 ;; multi       multiword sequence (or user asm statements)
 ;; nop         no operation
 (define_attr "type"
-  "unknown,branch,jump,call,load,fpload,fpidxload,store,fpstore,fpidxstore,prefetch,prefetchx,condmove,xfer,mthilo,mfhilo,const,arith,shift,slt,clz,trap,imul,imadd,idiv,fmove,fadd,fmul,fmadd,fdiv,frdiv,frdiv1,frdiv2,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,frsqrt1,frsqrt2,multi,nop"
+  "unknown,branch,jump,call,load,fpload,fpidxload,store,fpstore,fpidxstore,prefetch,prefetchx,condmove,xfer,mthilo,mfhilo,const,arith,shift,slt,clz,trap,imul,imul3,imadd,idiv,fmove,fadd,fmul,fmadd,fdiv,frdiv,frdiv1,frdiv2,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,frsqrt1,frsqrt2,multi,nop"
   (cond [(eq_attr "jal" "!unset") (const_string "call")
         (eq_attr "got" "load") (const_string "load")]
        (const_string "unknown")))
          ;; VR4120 errata MD(4): if there are consecutive dmult instructions,
          ;; the result of the second one is missed.  The assembler should work
          ;; around this by inserting a nop after the first dmult.
-         (and (eq_attr "type" "imul")
+         (and (eq_attr "type" "imul,imul3")
               (and (eq_attr "mode" "DI")
                    (ne (symbol_ref "TARGET_FIX_VR4120") (const_int 0))))
          (const_int 8)
 ;; True if an instruction might assign to hi or lo when reloaded.
 ;; This is used by the TUNE_MACC_CHAINS code.
 (define_attr "may_clobber_hilo" "no,yes"
-  (if_then_else (eq_attr "type" "imul,imadd,idiv,mthilo")
+  (if_then_else (eq_attr "type" "imul,imul3,imadd,idiv,mthilo")
                (const_string "yes")
                (const_string "no")))
 
     return "mul\t%0,%1,%2";
   return "mult\t%0,%1,%2";
 }
-  [(set_attr "type" "imul")
+  [(set_attr "type" "imul3,imul")
    (set_attr "mode" "SI")])
 
 (define_insn "muldi3_mult3"
    (clobber (match_scratch:DI 4 "=l"))]
   "TARGET_64BIT && GENERATE_MULT3_DI"
   "dmult\t%0,%1,%2"
-  [(set_attr "type" "imul")
+  [(set_attr "type" "imul3")
    (set_attr "mode" "DI")])
 
 ;; If a register gets allocated to LO, and we spill to memory, the reload
   "@
    muls\t$0,%1,%2
    muls\t%0,%1,%2"
-  [(set_attr "type"     "imul")
+  [(set_attr "type"     "imul,imul3")
    (set_attr "mode"     "SI")])
 
 ;; ??? We could define a mulditi3 pattern when TARGET_64BIT.
   "@
    mult<u>\t%1,%2
    mulhi<u>\t%0,%1,%2"
-  [(set_attr "type" "imul")
+  [(set_attr "type" "imul,imul3")
    (set_attr "mode" "SI")])
 
 (define_insn "*<su>mulsi3_highpart_neg_mulhi_internal"
   "@
    mulshi<u>\t%.,%1,%2
    mulshi<u>\t%0,%1,%2"
-  [(set_attr "type" "imul")
+  [(set_attr "type" "imul,imul3")
    (set_attr "mode" "SI")])
 
 ;; Disable unsigned multiplication for -mfix-vr4120.  This is for VR4120
index 3ab033302fd1127ebea56c947a92f02088f6668f..b1b085f45ed121e8858bd63914bdd6c0e0ff8294 100644 (file)
 
 (define_insn_reservation "ir_sb1_mulsi" 3
   (and (eq_attr "cpu" "sb1")
-       (and (eq_attr "type" "imul,imadd")
+       (and (eq_attr "type" "imul,imul3,imadd")
            (eq_attr "mode" "SI")))
   "sb1_ex1+sb1_mul")
 
 
 (define_insn_reservation "ir_sb1_muldi" 4
   (and (eq_attr "cpu" "sb1")
-       (and (eq_attr "type" "imul")
+       (and (eq_attr "type" "imul,imul3")
            (eq_attr "mode" "DI")))
   "sb1_ex1+sb1_mul, sb1_mul")
 
index d40e27e8cda6a71b571c47e5f1f770e13ac79873..9ccfc5942d95d802e72559d0573c784ad61e4eb9 100644 (file)
 (define_insn_reservation "ir_sr70_imul_si"
                                  4
                           (and (eq_attr "cpu" "sr71000")
-                               (and (eq_attr "type" "imul,imadd")
+                               (and (eq_attr "type" "imul,imul3,imadd")
                                     (eq_attr "mode" "SI")))
                          "ri_alux,ipu_alux,ipu_macc_iter")
 
 (define_insn_reservation "ir_sr70_imul_di"
                                  6
                           (and (eq_attr "cpu" "sr71000")
-                               (and (eq_attr "type" "imul,imadd")
+                               (and (eq_attr "type" "imul,imul3,imadd")
                                     (eq_attr "mode" "DI")))
                          "ri_alux,ipu_alux,(ipu_macc_iter*3)")