This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add rlwimi to PowerPC scheduling model


	The "rlwimi" instruction is cracked on POWER4.  The appended patch
distinguishes that instruction from the default integer type for
scheduling purposes.

David

2003-06-09  David Edelsohn  <edelsohn@gnu.org>
            Ayal Zaks  <gcchaifa@us.ibm.com>

	* config/rs6000/rs6000.md (define_attr "type"): Add insert_word.
	(insvsi*): Add insert_word attribute.
	* config/rs6000/rs6000.c (rs6000_variable_issue): Add TYPE_INSERT_WORD.
	* config/rs6000/{40x.md,603.md,6xx.md,7450.md,7xx.md,mpc.md,
	power4.md,rios1.md,rios2.md,rs64.md}: Add insert_word.

Index: 40x.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/40x.md,v
retrieving revision 1.7
diff -c -p -r1.7 40x.md
*** 40x.md	1 May 2003 17:05:16 -0000	1.7
--- 40x.md	9 Jun 2003 17:05:38 -0000
***************
*** 36,42 ****
    "iu_40x")
  
  (define_insn_reservation "ppc403-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "ppc403,ppc405"))
    "iu_40x")
  
--- 36,42 ----
    "iu_40x")
  
  (define_insn_reservation "ppc403-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "ppc403,ppc405"))
    "iu_40x")
  
Index: 440.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/440.md,v
retrieving revision 1.2
diff -c -p -r1.2 440.md
*** 440.md	24 May 2003 16:54:04 -0000	1.2
--- 440.md	9 Jun 2003 17:05:38 -0000
***************
*** 54,60 ****
    "ppc440_issue,ppc440_l_pipe")
  
  (define_insn_reservation "ppc440-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "ppc440"))
    "ppc440_issue,ppc440_i_pipe|ppc440_j_pipe")
  
--- 54,60 ----
    "ppc440_issue,ppc440_l_pipe")
  
  (define_insn_reservation "ppc440-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "ppc440"))
    "ppc440_issue,ppc440_i_pipe|ppc440_j_pipe")
  
Index: 603.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/603.md,v
retrieving revision 1.8
diff -c -p -r1.8 603.md
*** 603.md	2 May 2003 14:49:50 -0000	1.8
--- 603.md	9 Jun 2003 17:05:38 -0000
***************
*** 54,60 ****
    "lsu_603")
  
  (define_insn_reservation "ppc603-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "ppc603"))
    "iu_603")
  
--- 54,60 ----
    "lsu_603")
  
  (define_insn_reservation "ppc603-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "ppc603"))
    "iu_603")
  
Index: 6xx.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/6xx.md,v
retrieving revision 1.8
diff -c -p -r1.8 6xx.md
*** 6xx.md	2 May 2003 14:49:51 -0000	1.8
--- 6xx.md	9 Jun 2003 17:05:38 -0000
***************
*** 64,70 ****
    "lsu_6xx")
  
  (define_insn_reservation "ppc604-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630"))
    "iu1_6xx|iu2_6xx")
  
--- 64,70 ----
    "lsu_6xx")
  
  (define_insn_reservation "ppc604-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "ppc604,ppc604e,ppc620,ppc630"))
    "iu1_6xx|iu2_6xx")
  
Index: 7450.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/7450.md,v
retrieving revision 1.8
diff -c -p -r1.8 7450.md
*** 7450.md	2 May 2003 14:49:51 -0000	1.8
--- 7450.md	9 Jun 2003 17:05:38 -0000
***************
*** 64,70 ****
    "ppc7450_du,lsu_7450*3")
  
  (define_insn_reservation "ppc7450-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "ppc7450"))
    "ppc7450_du,(iu1_7450|iu2_7450|iu3_7450)")
  
--- 64,70 ----
    "ppc7450_du,lsu_7450*3")
  
  (define_insn_reservation "ppc7450-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "ppc7450"))
    "ppc7450_du,(iu1_7450|iu2_7450|iu3_7450)")
  
Index: 7xx.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/7xx.md,v
retrieving revision 1.8
diff -c -p -r1.8 7xx.md
*** 7xx.md	2 May 2003 14:49:51 -0000	1.8
--- 7xx.md	9 Jun 2003 17:05:38 -0000
***************
*** 59,65 ****
    "ppc750_du,lsu_7xx")
  
  (define_insn_reservation "ppc750-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "ppc750,ppc7400"))
    "ppc750_du,(iu1_7xx|iu2_7xx)")
  
--- 59,65 ----
    "ppc750_du,lsu_7xx")
  
  (define_insn_reservation "ppc750-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "ppc750,ppc7400"))
    "ppc750_du,(iu1_7xx|iu2_7xx)")
  
Index: 8540.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/8540.md,v
retrieving revision 1.6
diff -c -p -r1.6 8540.md
*** 8540.md	1 May 2003 17:05:17 -0000	1.6
--- 8540.md	9 Jun 2003 17:05:38 -0000
***************
*** 85,91 ****
  
  ;; Simple SU insns
  (define_insn_reservation "ppc8540_su" 1
!   (and (eq_attr "type" "integer,cmp,compare,delayed_compare,fast_compare")
         (eq_attr "cpu" "ppc8540"))
    "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire")
  
--- 85,91 ----
  
  ;; Simple SU insns
  (define_insn_reservation "ppc8540_su" 1
!   (and (eq_attr "type" "integer,insert_word,cmp,compare,delayed_compare,fast_compare")
         (eq_attr "cpu" "ppc8540"))
    "ppc8540_decode,ppc8540_issue+ppc8540_su_stage0+ppc8540_retire")
  
Index: mpc.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/mpc.md,v
retrieving revision 1.7
diff -c -p -r1.7 mpc.md
*** mpc.md	1 May 2003 17:05:17 -0000	1.7
--- mpc.md	9 Jun 2003 17:05:38 -0000
***************
*** 42,48 ****
    "lsu_mpc")
  
  (define_insn_reservation "mpccore-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "mpccore"))
    "iu_mpc")
  
--- 42,48 ----
    "lsu_mpc")
  
  (define_insn_reservation "mpccore-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "mpccore"))
    "iu_mpc")
  
Index: power4.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/power4.md,v
retrieving revision 1.12
diff -c -p -r1.12 power4.md
*** power4.md	1 May 2003 17:05:17 -0000	1.12
--- power4.md	9 Jun 2003 17:05:38 -0000
***************
*** 183,188 ****
--- 183,195 ----
         (eq_attr "cpu" "power4"))
    "iq_power4")
  
+ (define_insn_reservation "power4-insert" 4
+   (and (eq_attr "type" "insert_word")
+        (eq_attr "cpu" "power4"))
+   "(du1_power4+du2_power4,iu1_power4,nothing,iu2_power4)\
+   |(du2_power4+du3_power4,iu2_power4,nothing,iu2_power4)\
+   |(du3_power4+du4_power4,iu2_power4,nothing,iu1_power4)")
+ 
  (define_insn_reservation "power4-cmp" 3
    (and (eq_attr "type" "cmp,fast_compare")
         (eq_attr "cpu" "power4"))
Index: rios1.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rios1.md,v
retrieving revision 1.7
diff -c -p -r1.7 rios1.md
*** rios1.md	1 May 2003 17:05:17 -0000	1.7
--- rios1.md	9 Jun 2003 17:05:38 -0000
***************
*** 51,57 ****
    "iu_rios1+fpu_rios1")
  
  (define_insn_reservation "rios1-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "rios1,ppc601"))
    "iu_rios1")
  
--- 51,57 ----
    "iu_rios1+fpu_rios1")
  
  (define_insn_reservation "rios1-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "rios1,ppc601"))
    "iu_rios1")
  
Index: rios2.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rios2.md,v
retrieving revision 1.7
diff -c -p -r1.7 rios2.md
*** rios2.md	1 May 2003 17:05:17 -0000	1.7
--- rios2.md	9 Jun 2003 17:05:38 -0000
***************
*** 39,45 ****
    "iu1_rios2|iu2_rios2")
  
  (define_insn_reservation "rios2-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "rios2"))
    "iu1_rios2|iu2_rios2")
  
--- 39,45 ----
    "iu1_rios2|iu2_rios2")
  
  (define_insn_reservation "rios2-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "rios2"))
    "iu1_rios2|iu2_rios2")
  
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.485
diff -c -p -r1.485 rs6000.c
*** rs6000.c	7 Jun 2003 17:11:47 -0000	1.485
--- rs6000.c	9 Jun 2003 17:05:38 -0000
*************** rs6000_variable_issue (stream, verbose, 
*** 13055,13061 ****
  	       || type == TYPE_LOAD_EXT || type == TYPE_DELAYED_CR
  	       || type == TYPE_COMPARE || type == TYPE_DELAYED_COMPARE
  	       || type == TYPE_IMUL_COMPARE || type == TYPE_LMUL_COMPARE
! 	       || type == TYPE_IDIV || type == TYPE_LDIV)
  	return more > 2 ? more - 2 : 0;
      }
  
--- 13055,13062 ----
  	       || type == TYPE_LOAD_EXT || type == TYPE_DELAYED_CR
  	       || type == TYPE_COMPARE || type == TYPE_DELAYED_COMPARE
  	       || type == TYPE_IMUL_COMPARE || type == TYPE_LMUL_COMPARE
! 	       || type == TYPE_IDIV || type == TYPE_LDIV
! 	       || type == TYPE_INSERT_WORD)
  	return more > 2 ? more - 2 : 0;
      }
  
Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.258
diff -c -p -r1.258 rs6000.md
*** rs6000.md	4 Jun 2003 15:23:41 -0000	1.258
--- rs6000.md	9 Jun 2003 17:05:38 -0000
***************
*** 62,68 ****
  
  ;; Define an insn type attribute.  This is used in function unit delay
  ;; computations.
! (define_attr "type" "integer,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,branch,cmp,fast_compare,compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv"
    (const_string "integer"))
  
  ;; Length (in bytes).
--- 62,68 ----
  
  ;; Define an insn type attribute.  This is used in function unit delay
  ;; computations.
! (define_attr "type" "integer,load,load_ext,load_ext_u,load_ext_ux,load_ux,load_u,store,store_ux,store_u,fpload,fpload_ux,fpload_u,fpstore,fpstore_ux,fpstore_u,vecload,vecstore,imul,imul2,imul3,lmul,idiv,ldiv,insert_word,branch,cmp,fast_compare,compare,delayed_compare,imul_compare,lmul_compare,fpcompare,cr_logical,delayed_cr,mfcr,mtcr,mfjmpr,mtjmpr,fp,fpsimple,dmul,sdiv,ddiv,ssqrt,dsqrt,jmpreg,brinc,vecsimple,veccomplex,vecdiv,veccmp,veccmpsimple,vecperm,vecfloat,vecfdiv"
    (const_string "integer"))
  
  ;; Length (in bytes).
***************
*** 2951,2957 ****
    operands[4] = GEN_INT (32 - start - size);
    operands[1] = GEN_INT (start + size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
! }")
  
  (define_insn "*insvsi_internal1"
    [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
--- 2951,2958 ----
    operands[4] = GEN_INT (32 - start - size);
    operands[1] = GEN_INT (start + size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
! }"
!   [(set_attr "type" "insert_word")])
  
  (define_insn "*insvsi_internal1"
    [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
***************
*** 2969,2975 ****
    operands[4] = GEN_INT (shift - start - size);
    operands[1] = GEN_INT (start + size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
! }")
  
  (define_insn "*insvsi_internal2"
    [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
--- 2970,2977 ----
    operands[4] = GEN_INT (shift - start - size);
    operands[1] = GEN_INT (start + size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
! }"
!   [(set_attr "type" "insert_word")])
  
  (define_insn "*insvsi_internal2"
    [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
***************
*** 2987,2993 ****
    operands[4] = GEN_INT (32 - shift - start - size);
    operands[1] = GEN_INT (start + size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
! }")
  
  (define_insn "*insvsi_internal3"
    [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
--- 2989,2996 ----
    operands[4] = GEN_INT (32 - shift - start - size);
    operands[1] = GEN_INT (start + size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
! }"
!   [(set_attr "type" "insert_word")])
  
  (define_insn "*insvsi_internal3"
    [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
***************
*** 3005,3011 ****
    operands[4] = GEN_INT (32 - shift - start - size);
    operands[1] = GEN_INT (start + size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
! }")
  
  (define_insn "*insvsi_internal4"
    [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
--- 3008,3015 ----
    operands[4] = GEN_INT (32 - shift - start - size);
    operands[1] = GEN_INT (start + size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h4,%h2,%h1\";
! }"
!   [(set_attr "type" "insert_word")])
  
  (define_insn "*insvsi_internal4"
    [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r")
***************
*** 3026,3032 ****
    operands[5] = GEN_INT (extract_start + extract_size - insert_start - insert_size);
    operands[1] = GEN_INT (insert_start + insert_size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h5,%h2,%h1\";
! }")
  
  (define_insn "insvdi"
    [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r")
--- 3030,3037 ----
    operands[5] = GEN_INT (extract_start + extract_size - insert_start - insert_size);
    operands[1] = GEN_INT (insert_start + insert_size - 1);
    return \"{rlimi|rlwimi} %0,%3,%h5,%h2,%h1\";
! }"
!   [(set_attr "type" "insert_word")])
  
  (define_insn "insvdi"
    [(set (zero_extract:DI (match_operand:DI 0 "gpc_reg_operand" "+r")
Index: rs64.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs64.md,v
retrieving revision 1.8
diff -c -p -r1.8 rs64.md
*** rs64.md	2 May 2003 14:49:52 -0000	1.8
--- rs64.md	9 Jun 2003 17:05:38 -0000
***************
*** 42,48 ****
    "lsu_rs64")
  
  (define_insn_reservation "rs64a-integer" 1
!   (and (eq_attr "type" "integer")
         (eq_attr "cpu" "rs64a"))
    "iu_rs64")
  
--- 42,48 ----
    "lsu_rs64")
  
  (define_insn_reservation "rs64a-integer" 1
!   (and (eq_attr "type" "integer,insert_word")
         (eq_attr "cpu" "rs64a"))
    "iu_rs64")
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]