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]

Trivial scheduling update




This just fixes a few trivial cases where we'd compute incorrect pairing
attributes for the Pentium processors.  Bootstrapped, tested, etc.  Installed
on the mainline tree.

	* i386.md (type attribute): Add "rotate" for rotate insns.
	(rotate insns): Set type to "rotate".
	(various attributes and function units): Treat rotate like shift.
	(pent_pair attribute): Only rotates by one bit position are
	pairable.
	(sbb insns): Explicitly set pent_pair attribute on a couple
	that were missing it.

	

Index: i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.354
diff -c -3 -p -r1.354 i386.md
*** i386.md	9 May 2002 13:45:20 -0000	1.354
--- i386.md	9 May 2002 17:34:03 -0000
***************
*** 123,129 ****
  ;; A basic instruction type.  Refinements due to arguments to be
  ;; provided in other attributes.
  (define_attr "type"
!   "other,multi,alu1,negnot,alu,icmp,test,imov,imovx,lea,incdec,ishift,imul,idiv,ibr,setcc,push,pop,call,callv,icmov,fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,str,cld,sse,sseadd,ssemul,ssediv,ssemov,ssecmp,ssecvt,sselog,sseiadd,sseishft,sseimul,mmx,mmxmov,mmxadd,mmxshft,mmxcmp,mmxcvt,mmxmul,fistp"
    (const_string "other"))
  
  ;; Main data type used by the insn
--- 123,129 ----
  ;; A basic instruction type.  Refinements due to arguments to be
  ;; provided in other attributes.
  (define_attr "type"
!   "other,multi,alu1,negnot,alu,icmp,test,imov,imovx,lea,incdec,ishift,rotate,imul,idiv,ibr,setcc,push,pop,call,callv,icmov,fmov,fop,fsgn,fmul,fdiv,fpspc,fcmov,fcmp,fxch,str,cld,sse,sseadd,ssemul,ssediv,ssemov,ssecmp,ssecvt,sselog,sseiadd,sseishft,sseimul,mmx,mmxmov,mmxadd,mmxshft,mmxcmp,mmxcvt,mmxmul,fistp"
    (const_string "other"))
  
  ;; Main data type used by the insn
***************
*** 146,152 ****
  	   (const_int 0)
  	 (eq_attr "unit" "i387,sse,mmx")
  	   (const_int 0)
! 	 (eq_attr "type" "alu1,negnot,alu,icmp,imovx,ishift,imul,push,pop")
  	   (symbol_ref "ix86_attr_length_immediate_default(insn,1)")
  	 (eq_attr "type" "imov,test")
  	   (symbol_ref "ix86_attr_length_immediate_default(insn,0)")
--- 146,152 ----
  	   (const_int 0)
  	 (eq_attr "unit" "i387,sse,mmx")
  	   (const_int 0)
! 	 (eq_attr "type" "alu1,negnot,alu,icmp,imovx,ishift,rotate,imul,push,pop")
  	   (symbol_ref "ix86_attr_length_immediate_default(insn,1)")
  	 (eq_attr "type" "imov,test")
  	   (symbol_ref "ix86_attr_length_immediate_default(insn,0)")
***************
*** 305,311 ****
  	      (and (match_operand 0 "memory_displacement_operand" "")
  		   (match_operand 1 "immediate_operand" "")))
  	   (const_string "true")
! 	 (and (eq_attr "type" "alu,ishift,imul,idiv")
  	      (and (match_operand 0 "memory_displacement_operand" "")
  		   (match_operand 2 "immediate_operand" "")))
  	   (const_string "true")
--- 305,311 ----
  	      (and (match_operand 0 "memory_displacement_operand" "")
  		   (match_operand 1 "immediate_operand" "")))
  	   (const_string "true")
! 	 (and (eq_attr "type" "alu,ishift,rotate,imul,idiv")
  	      (and (match_operand 0 "memory_displacement_operand" "")
  		   (match_operand 2 "immediate_operand" "")))
  	   (const_string "true")
***************
*** 356,361 ****
--- 356,364 ----
  	 (and (eq_attr "type" "ishift")
  	      (match_operand 2 "const_int_operand" ""))
  	   (const_string "pu")
+ 	 (and (eq_attr "type" "rotate")
+ 	      (match_operand 2 "const_int_1_operand" ""))
+ 	   (const_string "pu")
  	 (and (eq_attr "type" "call")
  	      (match_operand 0 "constant_call_address_operand" ""))
  	   (const_string "pv")
***************
*** 651,657 ****
  
  (define_function_unit "ppro_p0" 1 0
    (and (eq_attr "cpu" "pentiumpro")
!        (eq_attr "type" "ishift,lea,ibr,cld"))
    1 1)
  
  (define_function_unit "ppro_p0" 1 0
--- 654,660 ----
  
  (define_function_unit "ppro_p0" 1 0
    (and (eq_attr "cpu" "pentiumpro")
!        (eq_attr "type" "ishift,rotate,lea,ibr,cld"))
    1 1)
  
  (define_function_unit "ppro_p0" 1 0
***************
*** 766,772 ****
  ;; Shift instructions and certain arithmetic are issued only to X pipe.
  (define_function_unit "k6_alux" 1 0
    (and (eq_attr "cpu" "k6")
!        (eq_attr "type" "ishift,alu1,negnot,cld"))
    1 1)
  
  ;; The QI mode arithmetic is issued to X pipe only.
--- 769,775 ----
  ;; Shift instructions and certain arithmetic are issued only to X pipe.
  (define_function_unit "k6_alux" 1 0
    (and (eq_attr "cpu" "k6")
!        (eq_attr "type" "ishift,rotate,alu1,negnot,cld"))
    1 1)
  
  ;; The QI mode arithmetic is issued to X pipe only.
***************
*** 778,784 ****
  
  (define_function_unit "k6_alu" 2 0
    (and (eq_attr "cpu" "k6")
!        (eq_attr "type" "ishift,alu1,negnot,alu,icmp,test,imovx,incdec,setcc,lea"))
    1 1)
  
  (define_function_unit "k6_alu" 2 0
--- 781,787 ----
  
  (define_function_unit "k6_alu" 2 0
    (and (eq_attr "cpu" "k6")
!        (eq_attr "type" "ishift,rotate,alu1,negnot,alu,icmp,test,imovx,incdec,setcc,lea"))
    1 1)
  
  (define_function_unit "k6_alu" 2 0
***************
*** 907,913 ****
  
  (define_function_unit "athlon_ieu" 3 0
    (and (eq_attr "cpu" "athlon")
!        (eq_attr "type" "alu1,negnot,alu,icmp,test,imov,imovx,lea,incdec,ishift,ibr,call,callv,icmov,cld,pop,setcc,push,pop"))
    1 1)
  
  (define_function_unit "athlon_ieu" 3 0
--- 910,916 ----
  
  (define_function_unit "athlon_ieu" 3 0
    (and (eq_attr "cpu" "athlon")
!        (eq_attr "type" "alu1,negnot,alu,icmp,test,imov,imovx,lea,incdec,ishift,rotate,ibr,call,callv,icmov,cld,pop,setcc,push,pop"))
    1 1)
  
  (define_function_unit "athlon_ieu" 3 0
***************
*** 12237,12243 ****
    "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, DImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{q}\t%0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand:DI 0 "register_operand" "") 
  	(const_string "2")
--- 12240,12246 ----
    "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, DImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{q}\t%0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand:DI 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12252,12258 ****
    "@
     rol{q}\t{%2, %0|%0, %2}
     rol{q}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "DI")])
  
  (define_expand "rotlsi3"
--- 12255,12261 ----
    "@
     rol{q}\t{%2, %0|%0, %2}
     rol{q}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "DI")])
  
  (define_expand "rotlsi3"
***************
*** 12271,12277 ****
    "ix86_binary_operator_ok (ROTATE, SImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{l}\t%0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand:SI 0 "register_operand" "") 
  	(const_string "2")
--- 12274,12280 ----
    "ix86_binary_operator_ok (ROTATE, SImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{l}\t%0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand:SI 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12286,12292 ****
    "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, SImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{l}\t%k0"
!   [(set_attr "type" "ishift")
     (set_attr "length" "2")])
  
  (define_insn "*rotlsi3_1"
--- 12289,12295 ----
    "TARGET_64BIT && ix86_binary_operator_ok (ROTATE, SImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{l}\t%k0"
!   [(set_attr "type" "rotate")
     (set_attr "length" "2")])
  
  (define_insn "*rotlsi3_1"
***************
*** 12298,12304 ****
    "@
     rol{l}\t{%2, %0|%0, %2}
     rol{l}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "SI")])
  
  (define_insn "*rotlsi3_1_zext"
--- 12301,12307 ----
    "@
     rol{l}\t{%2, %0|%0, %2}
     rol{l}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "SI")])
  
  (define_insn "*rotlsi3_1_zext"
***************
*** 12311,12317 ****
    "@
     rol{l}\t{%2, %k0|%k0, %2}
     rol{l}\t{%b2, %k0|%k0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "SI")])
  
  (define_expand "rotlhi3"
--- 12314,12320 ----
    "@
     rol{l}\t{%2, %k0|%k0, %2}
     rol{l}\t{%b2, %k0|%k0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "SI")])
  
  (define_expand "rotlhi3"
***************
*** 12330,12336 ****
    "ix86_binary_operator_ok (ROTATE, HImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{w}\t%0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand 0 "register_operand" "") 
  	(const_string "2")
--- 12333,12339 ----
    "ix86_binary_operator_ok (ROTATE, HImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{w}\t%0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12345,12351 ****
    "@
     rol{w}\t{%2, %0|%0, %2}
     rol{w}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "HI")])
  
  (define_expand "rotlqi3"
--- 12348,12354 ----
    "@
     rol{w}\t{%2, %0|%0, %2}
     rol{w}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "HI")])
  
  (define_expand "rotlqi3"
***************
*** 12364,12370 ****
    "ix86_binary_operator_ok (ROTATE, QImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{b}\t%0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand 0 "register_operand" "") 
  	(const_string "2")
--- 12367,12373 ----
    "ix86_binary_operator_ok (ROTATE, QImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "rol{b}\t%0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12379,12385 ****
    "@
     rol{b}\t{%2, %0|%0, %2}
     rol{b}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "QI")])
  
  (define_expand "rotrdi3"
--- 12382,12388 ----
    "@
     rol{b}\t{%2, %0|%0, %2}
     rol{b}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "QI")])
  
  (define_expand "rotrdi3"
***************
*** 12398,12404 ****
    "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, DImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{q}\t%0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand:DI 0 "register_operand" "") 
  	(const_string "2")
--- 12401,12407 ----
    "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, DImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{q}\t%0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand:DI 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12413,12419 ****
    "@
     ror{q}\t{%2, %0|%0, %2}
     ror{q}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "DI")])
  
  (define_expand "rotrsi3"
--- 12416,12422 ----
    "@
     ror{q}\t{%2, %0|%0, %2}
     ror{q}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "DI")])
  
  (define_expand "rotrsi3"
***************
*** 12432,12438 ****
    "ix86_binary_operator_ok (ROTATERT, SImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{l}\t%0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand:SI 0 "register_operand" "") 
  	(const_string "2")
--- 12435,12441 ----
    "ix86_binary_operator_ok (ROTATERT, SImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{l}\t%0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand:SI 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12447,12453 ****
    "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, SImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{l}\t%k0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand:SI 0 "register_operand" "") 
  	(const_string "2")
--- 12450,12456 ----
    "TARGET_64BIT && ix86_binary_operator_ok (ROTATERT, SImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{l}\t%k0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand:SI 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12462,12468 ****
    "@
     ror{l}\t{%2, %0|%0, %2}
     ror{l}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "SI")])
  
  (define_insn "*rotrsi3_1_zext"
--- 12465,12471 ----
    "@
     ror{l}\t{%2, %0|%0, %2}
     ror{l}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "SI")])
  
  (define_insn "*rotrsi3_1_zext"
***************
*** 12475,12481 ****
    "@
     ror{l}\t{%2, %k0|%k0, %2}
     ror{l}\t{%b2, %k0|%k0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "SI")])
  
  (define_expand "rotrhi3"
--- 12478,12484 ----
    "@
     ror{l}\t{%2, %k0|%k0, %2}
     ror{l}\t{%b2, %k0|%k0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "SI")])
  
  (define_expand "rotrhi3"
***************
*** 12494,12500 ****
    "ix86_binary_operator_ok (ROTATERT, HImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{w}\t%0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand 0 "register_operand" "") 
  	(const_string "2")
--- 12497,12503 ----
    "ix86_binary_operator_ok (ROTATERT, HImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{w}\t%0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12509,12515 ****
    "@
     ror{w}\t{%2, %0|%0, %2}
     ror{w}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "HI")])
  
  (define_expand "rotrqi3"
--- 12512,12518 ----
    "@
     ror{w}\t{%2, %0|%0, %2}
     ror{w}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "HI")])
  
  (define_expand "rotrqi3"
***************
*** 12528,12534 ****
    "ix86_binary_operator_ok (ROTATERT, QImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{b}\t%0"
!   [(set_attr "type" "ishift")
     (set (attr "length") 
       (if_then_else (match_operand 0 "register_operand" "") 
  	(const_string "2")
--- 12531,12537 ----
    "ix86_binary_operator_ok (ROTATERT, QImode, operands)
     && (TARGET_PENTIUM || TARGET_PENTIUMPRO)"
    "ror{b}\t%0"
!   [(set_attr "type" "rotate")
     (set (attr "length") 
       (if_then_else (match_operand 0 "register_operand" "") 
  	(const_string "2")
***************
*** 12543,12549 ****
    "@
     ror{b}\t{%2, %0|%0, %2}
     ror{b}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "ishift")
     (set_attr "mode" "QI")])
  
  ;; Bit set / bit test instructions
--- 12546,12552 ----
    "@
     ror{b}\t{%2, %0|%0, %2}
     ror{b}\t{%b2, %0|%0, %b2}"
!   [(set_attr "type" "rotate")
     (set_attr "mode" "QI")])
  
  ;; Bit set / bit test instructions
***************
*** 15961,15966 ****
--- 15964,15970 ----
    ; Since we don't have the proper number of operands for an alu insn,
    ; fill in all the blanks.
    [(set_attr "type" "alu")
+    (set_attr "pent_pair" "pu")
     (set_attr "memory" "none")
     (set_attr "imm_disp" "false")
     (set_attr "mode" "DI")
***************
*** 16003,16008 ****
--- 16007,16013 ----
    ; Since we don't have the proper number of operands for an alu insn,
    ; fill in all the blanks.
    [(set_attr "type" "alu")
+    (set_attr "pent_pair" "pu")
     (set_attr "memory" "none")
     (set_attr "imm_disp" "false")
     (set_attr "mode" "SI")



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