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]

[PATCH] S/390: Pipline description lacks insn reservations for imul and idiv


Hi,

in the scheduler descpription for S/390 were the define_insn_reservations
for the idiv and imul instruction types missing.
The attached patch adds these and splits the imul type into three 
different types in order to allow for more precise scheduling.

Patch bootstrapped and regtested on s390 and s390x with gcc 4.0 and head.

OK for 4.0 and head?

Bye,

-Andreas-


2005-04-01  Andreas Krebbel  <krebbel1@de.ibm.com>
            Adrian Straetling  <straetling@de.ibm.com>

	* config/s390/2064.md ("z_mul", "z_inf"): New insn reservations.
	* config/s390/2084.md ("x_mul_hi", "x_mul_sidi", "x_div"): Likewise.
	* config/s390/s390.md ("imulhi", "imulsi", "imuldi"): Added to "type"
	attribute.
	("imul"): Removed from "type" attribute.
	("*muldi3_sign", "muldi3"): Changed type to imuldi.
	("mulsi3/1", "mulsi3/3", "mulsi/4", "mulsidi3", "umulsidi3"): 
	Changed type to imulsi.
	("*mulsi3_sign", "mulsi3/2"): Changed type to imulhi.
	

Index: gcc/config/s390/2064.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/2064.md,v
retrieving revision 1.9
diff -p -c -r1.9 2064.md
*** gcc/config/s390/2064.md	6 Nov 2004 19:57:41 -0000	1.9
--- gcc/config/s390/2064.md	18 Mar 2005 08:55:39 -0000
***************
*** 72,77 ****
--- 72,87 ----
         (eq_attr "type" "jsr"))
    "z_e1*5,z_wr")
  
+ (define_insn_reservation "z_mul" 5
+   (and (eq_attr "cpu" "g5,g6,z900")
+        (eq_attr "type" "imulsi,imulhi"))
+   "z_e1*5,z_wr")
+ 
+ (define_insn_reservation "z_inf" 10
+   (and (eq_attr "cpu" "g5,g6,z900")
+        (eq_attr "type" "idiv,imuldi"))
+   "z_e1*10,z_wr")
+ 
  ;; For everything else we check the atype flag.
  
  (define_insn_reservation "z_int" 1
Index: gcc/config/s390/2084.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/2084.md,v
retrieving revision 1.5
diff -p -c -r1.5 2084.md
*** gcc/config/s390/2084.md	6 Nov 2004 19:57:41 -0000	1.5
--- gcc/config/s390/2084.md	18 Mar 2005 08:55:39 -0000
***************
*** 106,112 ****
  (define_insn_reservation "x_call" 5 
    (and (eq_attr "cpu" "z990")
         (eq_attr "type" "jsr"))
!   "x-e1-np*5,x-wr-np") 
  
  ;;
  ;; Multicycle insns
--- 106,127 ----
  (define_insn_reservation "x_call" 5 
    (and (eq_attr "cpu" "z990")
         (eq_attr "type" "jsr"))
!   "x-e1-np*5,x-wr-np")
!  
! (define_insn_reservation "x_mul_hi" 2
!   (and (eq_attr "cpu" "z990")
!        (eq_attr "type" "imulhi"))
!   "x-e1-np*2,x-wr-np")
! 
! (define_insn_reservation "x_mul_sidi" 4
!   (and (eq_attr "cpu" "z990")
!        (eq_attr "type" "imulsi,imuldi"))
!   "x-e1-np*4,x-wr-np")
! 
! (define_insn_reservation "x_div" 10
!   (and (eq_attr "cpu" "z990")
!        (eq_attr "type" "idiv"))
!   "x-e1-np*10,x-wr-np")
  
  ;;
  ;; Multicycle insns
Index: gcc/config/s390/s390.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/s390/s390.md,v
retrieving revision 1.154.2.1
diff -p -c -r1.154.2.1 s390.md
*** gcc/config/s390/s390.md	9 Mar 2005 22:07:47 -0000	1.154.2.1
--- gcc/config/s390/s390.md	18 Mar 2005 08:55:40 -0000
***************
*** 156,162 ****
  ;; Instruction type attribute used for scheduling.
  
  (define_attr "type" "none,integer,load,lr,la,larl,lm,stm,
! 	             cs,vs,store,imul,idiv,
  		     branch,jsr,fsimpd,fsimps,
  		     floadd,floads,fstored, fstores,
  		     fmuld,fmuls,fdivd,fdivs,
--- 156,163 ----
  ;; Instruction type attribute used for scheduling.
  
  (define_attr "type" "none,integer,load,lr,la,larl,lm,stm,
! 	             cs,vs,store,idiv,
!                      imulhi,imulsi,imuldi,
  		     branch,jsr,fsimpd,fsimps,
  		     floadd,floads,fstored, fstores,
  		     fmuld,fmuls,fdivd,fdivs,
***************
*** 4512,4518 ****
     msgfr\t%0,%2
     msgf\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")
!    (set_attr "type"     "imul")])
  
  (define_insn "muldi3"
    [(set (match_operand:DI 0 "register_operand" "=d,d,d")
--- 4513,4519 ----
     msgfr\t%0,%2
     msgf\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")
!    (set_attr "type"     "imuldi")])
  
  (define_insn "muldi3"
    [(set (match_operand:DI 0 "register_operand" "=d,d,d")
***************
*** 4524,4530 ****
     mghi\t%0,%h2
     msg\t%0,%2"
    [(set_attr "op_type"  "RRE,RI,RXY")
!    (set_attr "type"     "imul")])
  
  ;
  ; mulsi3 instruction pattern(s).
--- 4525,4531 ----
     mghi\t%0,%h2
     msg\t%0,%2"
    [(set_attr "op_type"  "RRE,RI,RXY")
!    (set_attr "type"     "imuldi")])
  
  ;
  ; mulsi3 instruction pattern(s).
***************
*** 4537,4543 ****
    ""
    "mh\t%0,%2"
    [(set_attr "op_type"  "RX")
!    (set_attr "type"     "imul")])
  
  (define_insn "mulsi3"
    [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
--- 4538,4544 ----
    ""
    "mh\t%0,%2"
    [(set_attr "op_type"  "RX")
!    (set_attr "type"     "imulhi")])
  
  (define_insn "mulsi3"
    [(set (match_operand:SI 0 "register_operand" "=d,d,d,d")
***************
*** 4550,4556 ****
     ms\t%0,%2
     msy\t%0,%2"
    [(set_attr "op_type"  "RRE,RI,RX,RXY")
!    (set_attr "type"     "imul")])
  
  ;
  ; mulsidi3 instruction pattern(s).
--- 4551,4557 ----
     ms\t%0,%2
     msy\t%0,%2"
    [(set_attr "op_type"  "RRE,RI,RX,RXY")
!    (set_attr "type"     "imulsi,imulhi,imulsi,imulsi")])
  
  ;
  ; mulsidi3 instruction pattern(s).
***************
*** 4567,4573 ****
     mr\t%0,%2
     m\t%0,%2"
    [(set_attr "op_type"  "RR,RX")
!    (set_attr "type"     "imul")])
  
  ;
  ; umulsidi3 instruction pattern(s).
--- 4568,4574 ----
     mr\t%0,%2
     m\t%0,%2"
    [(set_attr "op_type"  "RR,RX")
!    (set_attr "type"     "imulsi")])
  
  ;
  ; umulsidi3 instruction pattern(s).
***************
*** 4584,4590 ****
     mlr\t%0,%2
     ml\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")
!    (set_attr "type"     "imul")])
  
  ;
  ; muldf3 instruction pattern(s).
--- 4585,4591 ----
     mlr\t%0,%2
     ml\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")
!    (set_attr "type"     "imulsi")])
  
  ;
  ; muldf3 instruction pattern(s).


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