]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000: Make all divide instructions one type
authorSegher Boessenkool <segher@kernel.crashing.org>
Fri, 23 May 2014 16:39:42 +0000 (18:39 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Fri, 23 May 2014 16:39:42 +0000 (18:39 +0200)
This uses the attribute "size" to specify the differences:

idiv -> div size=32
ldiv -> div size=64

It could use "dot" as well, but the current code doesn't handle that.

From-SVN: r210869

27 files changed:
gcc/ChangeLog
gcc/config/rs6000/40x.md
gcc/config/rs6000/440.md
gcc/config/rs6000/476.md
gcc/config/rs6000/601.md
gcc/config/rs6000/603.md
gcc/config/rs6000/6xx.md
gcc/config/rs6000/7450.md
gcc/config/rs6000/7xx.md
gcc/config/rs6000/8540.md
gcc/config/rs6000/a2.md
gcc/config/rs6000/cell.md
gcc/config/rs6000/e300c2c3.md
gcc/config/rs6000/e500mc.md
gcc/config/rs6000/e500mc64.md
gcc/config/rs6000/e5500.md
gcc/config/rs6000/e6500.md
gcc/config/rs6000/mpc.md
gcc/config/rs6000/power4.md
gcc/config/rs6000/power5.md
gcc/config/rs6000/power6.md
gcc/config/rs6000/power7.md
gcc/config/rs6000/power8.md
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.md
gcc/config/rs6000/rs64.md
gcc/config/rs6000/titan.md

index b0a478a27b38f0974950aa8d1ef3b41d76884256..84d9817827c6982d0d22247e7ef7924b975ce505 100644 (file)
@@ -1,3 +1,40 @@
+2014-05-23  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       * config/rs6000/rs6000.md (type): Delete "idiv", "ldiv".  Add
+       "div".
+       (bits): New mode_attr.
+       (idiv_ldiv): Delete mode_attr.
+       (udiv<mode>3, *div<mode>3, div<div_extend>_<mode>): Adjust.
+       * config/rs6000/rs6000.c (rs6000_adjust_cost, is_cracked_insn,
+       rs6000_adjust_priority, is_nonpipeline_insn,
+       insn_must_be_first_in_group, insn_must_be_last_in_group): Adjust.
+
+       * config/rs6000/40x.md (ppc403-idiv): Adjust.
+       * config/rs6000/440.md (ppc440-idiv): Adjust.
+       * config/rs6000/476.md (ppc476-idiv): Adjust.
+       * config/rs6000/601.md (ppc601-idiv): Adjust.
+       * config/rs6000/603.md (ppc603-idiv): Adjust.
+       * config/rs6000/6xx.md (ppc604-idiv, ppc620-idiv, ppc630-idiv,
+       ppc620-ldiv): Adjust.
+       * config/rs6000/7450.md (ppc7450-idiv): Adjust.
+       * config/rs6000/7xx.md (ppc750-idiv): Adjust.
+       * config/rs6000/8540.md (ppc8540_divide): Adjust.
+       * config/rs6000/a2.md (ppca2-idiv, ppca2-ldiv): Adjust.
+       * config/rs6000/cell.md (cell-idiv, cell-ldiv): Adjust.
+       * config/rs6000/e300c2c3.md (ppce300c3_divide): Adjust.
+       * config/rs6000/e500mc.md (e500mc_divide): Adjust.
+       * config/rs6000/e500mc64.md (e500mc64_divide): Adjust.
+       * config/rs6000/e5500.md (e5500_divide, e5500_divide_d): Adjust.
+       * config/rs6000/e6500.md (e6500_divide, e6500_divide_d): Adjust.
+       * config/rs6000/mpc.md (mpccore-idiv): Adjust.
+       * config/rs6000/power4.md (power4-idiv, power4-ldiv): Adjust.
+       * config/rs6000/power5.md (power5-idiv, power5-ldiv): Adjust.
+       * config/rs6000/power6.md (power6-idiv, power6-ldiv): Adjust.
+       * config/rs6000/power7.md (power7-idiv, power7-ldiv): Adjust.
+       * config/rs6000/power8.md (power8-idiv, power8-ldiv): Adjust.
+       * config/rs6000/rs64.md (rs64a-idiv, rs64a-ldiv): Adjust.
+       * config/rs6000/titan.md (titan_fxu_div): Adjust.
+
 2014-05-23  Segher Boessenkool  <segher@kernel.crashing.org>
 
        * config/rs6000/rs6000.md (type): Delete "insert_word",
index 02971cbeef47cc6ee417bd55c218b64ba567cb96..8ddccbacde4c8fe8df5ddfdf7e72e5903b011fa9 100644 (file)
@@ -82,7 +82,7 @@
   "iu_40x")
 
 (define_insn_reservation "ppc403-idiv" 33
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc403,ppc405"))
   "iu_40x*33")
 
index 292177d5e14e006a225eb4e33722e84b43ae183d..e6c28a7060ef7c1b61a5e0922b703a2edb28dd96 100644 (file)
@@ -84,7 +84,7 @@
   "ppc440_issue,ppc440_i_pipe")
 
 (define_insn_reservation "ppc440-idiv" 34
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc440"))
   "ppc440_issue,ppc440_i_pipe*33")
 
index 403752a9d620089e056bd2e2dff679c2b5e281f5..5acd6682a1da6b51af9dabdd46dbee2e224f4928 100644 (file)
@@ -88,7 +88,7 @@
    ppc476_i_pipe")
 
 (define_insn_reservation "ppc476-idiv" 11
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc476"))
   "ppc476_issue,\
    ppc476_i_pipe*11")
index d0afcf710ac98ce92d23c697685cc37b1352724f..85892c88006b5069a84b1f545fc99bdcb35b0659 100644 (file)
@@ -66,7 +66,7 @@
   "iu_ppc601*5")
 
 (define_insn_reservation "ppc601-idiv" 36
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc601"))
   "iu_ppc601*36")
 
index e6cc444362bdc3517f59acc9eb5f939e5e6c5e96..5f38741af19fe57ea2a854f1391b561d28ad3202 100644 (file)
@@ -87,7 +87,7 @@
   "iu_603*2")
 
 (define_insn_reservation "ppc603-idiv" 37
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc603"))
   "iu_603*37")
 
index 3a3271e6eff5176558763e81feeea5a48234316e..3ff4caf2b01d45d5a243e13369ff093756c84576 100644 (file)
   "mciu_6xx*5")
 
 (define_insn_reservation "ppc604-idiv" 20
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc604,ppc604e"))
   "mciu_6xx*19")
 
 (define_insn_reservation "ppc620-idiv" 37
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "ppc620"))
   "mciu_6xx*36")
 
 (define_insn_reservation "ppc630-idiv" 21
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "ppc630"))
   "mciu_6xx*20")
 
 (define_insn_reservation "ppc620-ldiv" 37
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "ppc620,ppc630"))
   "mciu_6xx*36")
 
index a6a4a1b1b49afad539603283254344d65da4173b..3333fd9b0ad12d358b19cc192e9634af23ef7be2 100644 (file)
   "ppc7450_du,mciu_7450")
 
 (define_insn_reservation "ppc7450-idiv" 23
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc7450"))
   "ppc7450_du,mciu_7450*23")
 
index 332a663f36056d01d8ed8197a2e2f4a93896ba49..67f3d11c1fda2b77735f0c75d8a9df3401979690 100644 (file)
@@ -95,7 +95,7 @@
   "ppc750_du,iu1_7xx")
 
 (define_insn_reservation "ppc750-idiv" 19
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc750,ppc7400"))
   "ppc750_du,iu1_7xx*19")
 
index 53545eeb71c70941ddca6791d5b7a3ba10c50b91..578cf8ea979f38910170e9e1a70ceb9a5afbebf3 100644 (file)
 ;; reservation of miu_stage3 here because we use the average latency
 ;; time.
 (define_insn_reservation "ppc8540_divide" 14
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppc8540,ppc8548"))
   "ppc8540_decode,ppc8540_issue+ppc8540_mu_stage0+ppc8540_mu_div,\
    ppc8540_mu_div*13")
index 7cab4d38931dd73c053c81c4dcd97351c0cc29dc..52dbbd4735d8a9c34186a9454c8a5237dd91dc6a 100644 (file)
 
 ;; D.4.9
 (define_insn_reservation "ppca2-idiv" 32
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "ppca2"))
   "mult*32")
 
 (define_insn_reservation "ppca2-ldiv" 65
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "ppca2"))
   "mult*65")
 
index 3a2668f211ec08f25d70840f3412d85a5d068746..1bf308eec3d82fc0f188759b4cf3894a9fad31c2 100644 (file)
  
 ;; divide
 (define_insn_reservation "cell-idiv" 32
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "cell"))
   "slot1,nonpipeline,nonpipeline*30")
 
 (define_insn_reservation "cell-ldiv" 64
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "cell"))
   "slot1,nonpipeline,nonpipeline*62")
 
index e9c8f18a0c7b7890ac4fd2abdbd74f0e04ce4fa0..2abdfdb8163a0db8154073c35784ac91326b3d73 100644 (file)
 ;; Divide.  We use the average latency time here.  We omit reserving a
 ;; retire unit because of the result automata will be huge.
 (define_insn_reservation "ppce300c3_divide" 20
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (ior (eq_attr "cpu" "ppce300c2") (eq_attr "cpu" "ppce300c3")))
   "ppce300c3_decode,ppce300c3_issue+ppce300c3_iu_stage0+ppce300c3_mu_div,\
    ppce300c3_mu_div*19")
index 426903de79208cbd0a5f10b0745114d324192949..580c30d13695cac5abf2211fd25ad9068fb0262b 100644 (file)
@@ -98,7 +98,7 @@
 
 ;; Divide. We use the average latency time here.
 (define_insn_reservation "e500mc_divide" 14
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppce500mc"))
   "e500mc_decode,e500mc_issue+e500mc_mu_stage0+e500mc_mu_div,\
    e500mc_mu_div*13")
index 584aef3ea5627c78c03ae90c3dba9a2848e59922..8844113f32a708cdb21ef2124ea2a436cb758c39 100644 (file)
 
 ;; Divide. We use the average latency time here.
 (define_insn_reservation "e500mc64_divide" 14
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "ppce500mc64"))
   "e500mc64_decode,e500mc64_issue+e500mc64_mu_stage0+e500mc64_mu_div,\
    e500mc64_mu_div*13")
index fd79ca558514cef5133c664bfc5b7a759dbca147..6b257d6578bfb523ebd1dd7958ee996840f77a56 100644 (file)
 
 ;; CFX - Divide.
 (define_insn_reservation "e5500_divide" 16
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "ppce5500"))
   "e5500_decode,e5500_cfx_stage0+e5500_cfx_div,\
    e5500_cfx_div*15")
 
 (define_insn_reservation "e5500_divide_d" 26
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "ppce5500"))
   "e5500_decode,e5500_cfx_stage0+e5500_cfx_div,\
    e5500_cfx_div*25")
index b84f7038b18d5bc351f4e8015a12872c6ce13fd1..52565d9727eed38f348330097b76a00ef08b0e91 100644 (file)
 
 ;; CFX - Divide.
 (define_insn_reservation "e6500_divide" 16
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "ppce6500"))
   "e6500_decode,e6500_cfx_stage0+e6500_cfx_div,\
    e6500_cfx_div*15")
 
 (define_insn_reservation "e6500_divide_d" 26
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "ppce6500"))
   "e6500_decode,e6500_cfx_stage0+e6500_cfx_div,\
    e6500_cfx_div*25")
index c4dff563bec94cfec10e367810ac996ea8db5003..7fe889c4be86485b82e903eeeffe106793bdc1c7 100644 (file)
@@ -63,7 +63,7 @@
 
 ; Divide latency varies greatly from 2-11, use 6 as average
 (define_insn_reservation "mpccore-idiv" 6
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "mpccore"))
   "mciu_mpc*6")
 
index f905a0d0db482b86bb136c1e61c24099da45136d..73eac1fd2fc94aa7ec2c87ff5107fc0b8db2b31c 100644 (file)
 ; SPR move only executes in first IU.
 ; Integer division only executes in second IU.
 (define_insn_reservation "power4-idiv" 36
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "power4"))
   "du1_power4+du2_power4,iu2_power4*35")
 
 (define_insn_reservation "power4-ldiv" 68
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "power4"))
   "du1_power4+du2_power4,iu2_power4*67")
 
index 407ec71159b403e3f178f0ce40900a3e6fe045d3..8aa477a1c15e72b22ea91edaa0a32e18dd385ed6 100644 (file)
 ; SPR move only executes in first IU.
 ; Integer division only executes in second IU.
 (define_insn_reservation "power5-idiv" 36
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "power5"))
   "du1_power5+du2_power5,iu2_power5*35")
 
 (define_insn_reservation "power5-ldiv" 68
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "power5"))
   "du1_power5+du2_power5,iu2_power5*67")
 
index 3a77fc52c970d0ddbac78de633c8ad34a0b0df58..26e17f962ea2b872278a685bf3a5e1476ac201a9 100644 (file)
   "store_data_bypass_p")
 
 (define_insn_reservation "power6-idiv" 44
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "power6"))
   "(iu1_power6*44+iu2_power6*44+fpu1_power6*44)\
   |(iu1_power6*44+iu2_power6*44+fpu2_power6*44)");
 ;  "store_data_bypass_p")
 
 (define_insn_reservation "power6-ldiv" 56
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "power6"))
   "(iu1_power6*56+iu2_power6*56+fpu1_power6*56)\
   |(iu1_power6*56+iu2_power6*56+fpu2_power6*56)");
index d6ddc2434c6cf5aef2f4f9ae54945096f9f10b36..5527829b84f946b23b6fbe4385d9e3a7f4032ac1 100644 (file)
   "DU2F_power7,FXU_power7,nothing*3,FXU_power7")
 
 (define_insn_reservation "power7-idiv" 36
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "power7"))
   "DU2F_power7,iu1_power7*36|iu2_power7*36")
 
 (define_insn_reservation "power7-ldiv" 68
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "power7"))
   "DU2F_power7,iu1_power7*68|iu2_power7*68")
 
index f7bd9f86087751a42b9afd6a677d5bbc9d76837f..99c9ec705e556b8b10e124b9b6c36d354f11edbf 100644 (file)
 
 ; FXU divides are not pipelined
 (define_insn_reservation "power8-idiv" 37
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "power8"))
   "DU_any_power8,fxu0_power8*37|fxu1_power8*37")
 
 (define_insn_reservation "power8-ldiv" 68
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "power8"))
   "DU_any_power8,fxu0_power8*68|fxu1_power8*68")
 
index c8aba1fbcf3cac2945290f6690796230d18b14c6..46cf08e8a23aa20de282b8a850da455982af83d0 100644 (file)
@@ -26261,16 +26261,10 @@ rs6000_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
                         return 17;
                       break;
                     }
-                  case TYPE_IDIV:
+                  case TYPE_DIV:
                     {
                       if (! store_data_bypass_p (dep_insn, insn))
-                        return 45;
-                      break;
-                    }
-                  case TYPE_LDIV:
-                    {
-                      if (! store_data_bypass_p (dep_insn, insn))
-                        return 57;
+                        return get_attr_size (dep_insn) == SIZE_32 ? 45 : 57;
                       break;
                     }
                   default:
@@ -26331,16 +26325,10 @@ rs6000_adjust_cost (rtx insn, rtx link, rtx dep_insn, int cost)
                         return 17;
                       break;
                     }
-                  case TYPE_IDIV:
-                    {
-                      if (set_to_load_agen (dep_insn, insn))
-                        return 45;
-                      break;
-                    }
-                  case TYPE_LDIV:
+                  case TYPE_DIV:
                     {
                       if (set_to_load_agen (dep_insn, insn))
-                        return 57;
+                        return get_attr_size (dep_insn) == SIZE_32 ? 45 : 57;
                       break;
                     }
                   default:
@@ -26492,7 +26480,7 @@ is_cracked_insn (rtx insn)
          || type == TYPE_COMPARE || type == TYPE_DELAYED_COMPARE
          || (type == TYPE_MUL
              && get_attr_dot (insn) == DOT_YES)
-         || type == TYPE_IDIV || type == TYPE_LDIV
+         || type == TYPE_DIV
          || (type == TYPE_INSERT
              && get_attr_size (insn) == SIZE_32))
        return true;
@@ -26649,7 +26637,7 @@ rs6000_adjust_priority (rtx insn ATTRIBUTE_UNUSED, int priority)
        break;
 
       case TYPE_MUL:
-      case TYPE_IDIV:
+      case TYPE_DIV:
        fprintf (stderr, "priority was %#x (%d) before adjustment\n",
                 priority, priority);
        if (priority >= 0 && priority < 0x01000000)
@@ -26703,8 +26691,7 @@ is_nonpipeline_insn (rtx insn)
 
   type = get_attr_type (insn);
   if (type == TYPE_MUL
-      || type == TYPE_IDIV
-      || type == TYPE_LDIV
+      || type == TYPE_DIV
       || type == TYPE_SDIV
       || type == TYPE_DDIV
       || type == TYPE_SSQRT
@@ -27303,8 +27290,7 @@ insn_must_be_first_in_group (rtx insn)
         case TYPE_CR_LOGICAL:
         case TYPE_MTJMPR:
         case TYPE_MFJMPR:
-        case TYPE_IDIV:
-        case TYPE_LDIV:
+        case TYPE_DIV:
         case TYPE_LOAD_L:
         case TYPE_STORE_C:
         case TYPE_ISYNC:
@@ -27325,7 +27311,6 @@ insn_must_be_first_in_group (rtx insn)
         case TYPE_VAR_SHIFT_ROTATE:
         case TYPE_TRAP:
         case TYPE_MUL:
-        case TYPE_IDIV:
         case TYPE_INSERT:
         case TYPE_DELAYED_COMPARE:
         case TYPE_FPCOMPARE:
@@ -27338,6 +27323,11 @@ insn_must_be_first_in_group (rtx insn)
         case TYPE_LOAD_L:
         case TYPE_STORE_C:
           return true;
+        case TYPE_DIV:
+          if (get_attr_size (insn) == SIZE_32)
+            return true;
+          else
+            break;
         case TYPE_LOAD:
         case TYPE_STORE:
         case TYPE_FPLOAD:
@@ -27359,8 +27349,7 @@ insn_must_be_first_in_group (rtx insn)
         case TYPE_MFCR:
         case TYPE_MFCRF:
         case TYPE_MTCR:
-        case TYPE_IDIV:
-        case TYPE_LDIV:
+        case TYPE_DIV:
         case TYPE_COMPARE:
         case TYPE_DELAYED_COMPARE:
         case TYPE_VAR_DELAYED_COMPARE:
@@ -27469,7 +27458,6 @@ insn_must_be_last_in_group (rtx insn)
       case TYPE_VAR_SHIFT_ROTATE:
       case TYPE_TRAP:
       case TYPE_MUL:
-      case TYPE_IDIV:
       case TYPE_DELAYED_COMPARE:
       case TYPE_FPCOMPARE:
       case TYPE_MFCR:
@@ -27481,6 +27469,11 @@ insn_must_be_last_in_group (rtx insn)
       case TYPE_LOAD_L:
       case TYPE_STORE_C:
         return true;
+      case TYPE_DIV:
+        if (get_attr_size (insn) == SIZE_32)
+          return true;
+        else
+          break;
       default:
         break;
     }
index 0150e435a377702c3e1ad28a5aed0506f039d908..0de26c925c448b6d4af40dfafc4f4e248bc12f8f 100644 (file)
 (define_attr "type"
   "integer,two,three,
    shift,var_shift_rotate,insert,
-   mul,halfmul,idiv,ldiv,
+   mul,halfmul,div,
    exts,cntlz,popcnt,isel,
    load,store,fpload,fpstore,vecload,vecstore,
    cmp,
                      (V4SI  "w")
                      (V2DI  "d")])
 
+;; How many bits in this mode?
+(define_mode_attr bits [(QI "8") (HI "16") (SI "32") (DI "64")])
+
 ; DImode bits
 (define_mode_attr dbits [(QI "56") (HI "48") (SI "32")])
 
                                         (V2DI  "X,X,X,X,X")
                                         (V2DF  "X,X,X,X,X")
                                         (V1TI  "X,X,X,X,X")])
-
-;; Mode attribute to give the correct type for integer divides
-(define_mode_attr idiv_ldiv [(SI "idiv")
-                            (DI "ldiv")])
-
 \f
 ;; Start with fixed-point load and store insns.  Here we put only the more
 ;; complex forms.  Basic data transfer is done later.
                  (match_operand:GPR 2 "gpc_reg_operand" "r")))]
   ""
   "div<wd>u %0,%1,%2"
-   [(set_attr "type" "<idiv_ldiv>")])
+  [(set_attr "type" "div")
+   (set_attr "size" "<bits>")])
 
 
 ;; For powers of two we can do srai/aze for divide and then adjust for
                 (match_operand:GPR 2 "gpc_reg_operand" "r")))]
   ""
   "div<wd> %0,%1,%2"
-  [(set_attr "type" "<idiv_ldiv>")])
+  [(set_attr "type" "div")
+   (set_attr "size" "<bits>")])
 
 (define_expand "mod<mode>3"
   [(use (match_operand:GPR 0 "gpc_reg_operand" ""))
                    UNSPEC_DIV_EXTEND))]
   "TARGET_POPCNTD"
   "div<wd><div_extend> %0,%1,%2"
-  [(set_attr "type" "<idiv_ldiv>")])
+  [(set_attr "type" "div")
+   (set_attr "size" "<bits>")])
 
 \f
 ;; Pack/unpack 128-bit floating point types that take 2 scalar registers
index aaddb5979d6fd5099d3aa1e128188056675cdb6b..0260a1c9349202ddf9b63bc94c38bcca5c7ed6f1 100644 (file)
   "mciu_rs64*34")
 
 (define_insn_reservation "rs64a-idiv" 66
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "32")
        (eq_attr "cpu" "rs64a"))
   "mciu_rs64*66")
 
 (define_insn_reservation "rs64a-ldiv" 66
-  (and (eq_attr "type" "ldiv")
+  (and (eq_attr "type" "div")
+       (eq_attr "size" "64")
        (eq_attr "cpu" "rs64a"))
   "mciu_rs64*66")
 
index 6c7516d3bb251dafeabc9088961be0864ac868ed..1d33c0f6474b58ad7175166532b8d546f50a42d4 100644 (file)
@@ -67,7 +67,7 @@
 ;; through its latency and initial disptach bottlenecks (i.e. issue
 ;; slots and fxu scheduler availability)
 (define_insn_reservation "titan_fxu_div" 34
-  (and (eq_attr "type" "idiv")
+  (and (eq_attr "type" "div")
        (eq_attr "cpu" "titan"))
   "titan_issue,titan_fxu_sh")