[Committed] S/390: Exploit the 'enabled' insn attribute

Andreas Krebbel Andreas.Krebbel@de.ibm.com
Tue May 27 12:37:00 GMT 2008


Applied to mainline.

Bye,

-Andreas-

2008-05-27  Andreas Krebbel  <krebbel1@de.ibm.com>

	* config/s390/s390.md ("cpu_facility", "enabled"): Attribute
	definitions added.
	("*movdi_64dfp", "*movdi_64extimm", "*movdi_64"): Merged into
	"*movdi_64".
	("*anddi3_extimm", "*anddi3"): Merged into "*anddi3".
	("*iordi3_extimm", "*iordi3"): Merged into "*iordi3".
	("*xordi3_extimm", "*xordi3"): Merged into "*xordi3".


Index: gcc/config/s390/s390.md
===================================================================
*** gcc/config/s390/s390.md.orig	2008-05-15 10:27:36.000000000 +0200
--- gcc/config/s390/s390.md	2008-05-27 08:46:00.000000000 +0200
***************
*** 231,236 ****
--- 231,264 ----
  (define_attr "cpu" "g5,g6,z900,z990,z9_109"
    (const (symbol_ref "s390_tune")))
  
+ (define_attr "cpu_facility" "standard,ieee,zarch,longdisp,extimm,dfp"
+   (const_string "standard"))
+ 
+ (define_attr "enabled" ""
+   (cond [(eq_attr "cpu_facility" "standard")
+ 	 (const_int 1)
+ 
+          (and (eq_attr "cpu_facility" "ieee")
+ 	      (ne (symbol_ref "TARGET_CPU_IEEE_FLOAT") (const_int 0)))
+ 	 (const_int 1)
+ 
+ 	 (and (eq_attr "cpu_facility" "zarch")
+ 	      (ne (symbol_ref "TARGET_ZARCH") (const_int 0)))
+ 	 (const_int 1)
+ 
+ 	 (and (eq_attr "cpu_facility" "longdisp")
+ 	      (ne (symbol_ref "TARGET_LONG_DISPLACEMENT") (const_int 0)))
+ 	 (const_int 1)
+ 
+          (and (eq_attr "cpu_facility" "extimm")
+ 	      (ne (symbol_ref "TARGET_EXTIMM") (const_int 0)))
+ 	 (const_int 1)
+ 
+          (and (eq_attr "cpu_facility" "dfp")
+ 	      (ne (symbol_ref "TARGET_DFP") (const_int 0)))
+ 	 (const_int 1)]
+ 	(const_int 0)))
+ 
  ;; Pipeline description for z900.  For lack of anything better,
  ;; this description is also used for the g5 and g6.
  (include "2064.md")
***************
*** 986,999 ****
     [(set_attr "op_type" "RIL")
      (set_attr "type"    "larl")])
  
! (define_insn "*movdi_64dfp"
    [(set (match_operand:DI 0 "nonimmediate_operand"
                              "=d,d,d,d,d,d,d,d,f,d,d,d,d,
                               m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
          (match_operand:DI 1 "general_operand"
                              "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,d,f,L,d,m,
                               d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
!   "TARGET_64BIT && TARGET_DFP"
    "@
     lghi\t%0,%h1
     llihh\t%0,%i1
--- 1014,1027 ----
     [(set_attr "op_type" "RIL")
      (set_attr "type"    "larl")])
  
! (define_insn "*movdi_64"
    [(set (match_operand:DI 0 "nonimmediate_operand"
                              "=d,d,d,d,d,d,d,d,f,d,d,d,d,
                               m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
          (match_operand:DI 1 "general_operand"
                              "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,d,f,L,d,m,
                               d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
!   "TARGET_64BIT"
    "@
     lghi\t%0,%h1
     llihh\t%0,%i1
***************
*** 1022,1093 ****
    [(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RRE,RRE,RXY,RRE,RXY,RXY,
                          RR,RX,RXY,RX,RXY,*,*,RS,RS,SS")
     (set_attr "type" "*,*,*,*,*,*,*,*,floaddf,floaddf,la,lr,load,store,
!                      floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")])
! 
! (define_insn "*movdi_64extimm"
!   [(set (match_operand:DI 0 "nonimmediate_operand"
!                             "=d,d,d,d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
!         (match_operand:DI 1 "general_operand"
!                             "K,N0HD0,N1HD0,N2HD0,N3HD0,Os,N0SD0,N1SD0,L,d,m,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
!   "TARGET_64BIT && TARGET_EXTIMM"
!   "@
!    lghi\t%0,%h1
!    llihh\t%0,%i1
!    llihl\t%0,%i1
!    llilh\t%0,%i1
!    llill\t%0,%i1
!    lgfi\t%0,%1
!    llihf\t%0,%k1
!    llilf\t%0,%k1
!    lay\t%0,%a1
!    lgr\t%0,%1
!    lg\t%0,%1
!    stg\t%1,%0
!    ldr\t%0,%1
!    ld\t%0,%1
!    ldy\t%0,%1
!    std\t%1,%0
!    stdy\t%1,%0
!    #
!    #
!    stam\t%1,%N1,%S0
!    lam\t%0,%N0,%S1
!    #"
!   [(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RXY,RRE,RXY,RXY,
!                         RR,RX,RXY,RX,RXY,*,*,RS,RS,SS")
!    (set_attr "type" "*,*,*,*,*,*,*,*,la,lr,load,store,
!                      floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")])
! 
! (define_insn "*movdi_64"
!   [(set (match_operand:DI 0 "nonimmediate_operand"
!                             "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,d,t,Q,t,?Q")
!         (match_operand:DI 1 "general_operand"
!                             "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,t,d,t,Q,?Q"))]
!   "TARGET_64BIT && !TARGET_EXTIMM"
!   "@
!    lghi\t%0,%h1
!    llihh\t%0,%i1
!    llihl\t%0,%i1
!    llilh\t%0,%i1
!    llill\t%0,%i1
!    lay\t%0,%a1
!    lgr\t%0,%1
!    lg\t%0,%1
!    stg\t%1,%0
!    ldr\t%0,%1
!    ld\t%0,%1
!    ldy\t%0,%1
!    std\t%1,%0
!    stdy\t%1,%0
!    #
!    #
!    stam\t%1,%N1,%S0
!    lam\t%0,%N0,%S1
!    #"
!   [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,
!                         RR,RX,RXY,RX,RXY,*,*,RS,RS,SS")
!    (set_attr "type" "*,*,*,*,*,la,lr,load,store,
!                      floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")])
  
  (define_split
    [(set (match_operand:DI 0 "register_operand" "")
--- 1050,1058 ----
    [(set_attr "op_type" "RI,RI,RI,RI,RI,RIL,RIL,RIL,RRE,RRE,RXY,RRE,RXY,RXY,
                          RR,RX,RXY,RX,RXY,*,*,RS,RS,SS")
     (set_attr "type" "*,*,*,*,*,*,*,*,floaddf,floaddf,la,lr,load,store,
!                      floaddf,floaddf,floaddf,fstoredf,fstoredf,*,*,*,*,*")
!    (set_attr "cpu_facility" "*,*,*,*,*,extimm,extimm,extimm,dfp,dfp,longdisp,
!                              *,*,*,*,*,longdisp,*,longdisp,*,*,*,*,*")])
  
  (define_split
    [(set (match_operand:DI 0 "register_operand" "")
***************
*** 5135,5148 ****
     ng\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")])
  
! (define_insn "*anddi3_extimm"
    [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,d,d,AQ,Q")
          (and:DI (match_operand:DI 1 "nonimmediate_operand"
                                      "%d,o,0,0,0,0,0,0,0,0,0,0")
                  (match_operand:DI 2 "general_operand"
                                      "M,M,N0HDF,N1HDF,N2HDF,N3HDF,N0SDF,N1SDF,d,m,NxQDF,Q")))
     (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
    "@
     #
     #
--- 5100,5113 ----
     ng\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")])
  
! (define_insn "*anddi3"
    [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,d,d,AQ,Q")
          (and:DI (match_operand:DI 1 "nonimmediate_operand"
                                      "%d,o,0,0,0,0,0,0,0,0,0,0")
                  (match_operand:DI 2 "general_operand"
                                      "M,M,N0HDF,N1HDF,N2HDF,N3HDF,N0SDF,N1SDF,d,m,NxQDF,Q")))
     (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
    "@
     #
     #
***************
*** 5156,5183 ****
     ng\t%0,%2
     #
     #"
!   [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")])
! 
! (define_insn "*anddi3"
!   [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
!         (and:DI (match_operand:DI 1 "nonimmediate_operand"
!                                     "%d,o,0,0,0,0,0,0,0,0")
!                 (match_operand:DI 2 "general_operand"
!                                     "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m,NxQDF,Q")))
!    (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
!   "@
!    #
!    #
!    nihh\t%0,%j2
!    nihl\t%0,%j2
!    nilh\t%0,%j2
!    nill\t%0,%j2
!    ngr\t%0,%2
!    ng\t%0,%2
!    #
!    #"
!   [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY,SI,SS")])
  
  (define_split
    [(set (match_operand:DI 0 "s_operand" "")
--- 5121,5128 ----
     ng\t%0,%2
     #
     #"
!   [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")
!    (set_attr "cpu_facility" "*,*,*,*,*,*,extimm,extimm,*,*,*,*")])
  
  (define_split
    [(set (match_operand:DI 0 "s_operand" "")
***************
*** 5438,5450 ****
     og\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")])
  
! (define_insn "*iordi3_extimm"
    [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
          (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0,0,0")
                  (match_operand:DI 2 "general_operand"
                                      "N0HD0,N1HD0,N2HD0,N3HD0,N0SD0,N1SD0,d,m,NxQD0,Q")))
     (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
    "@
     oihh\t%0,%i2
     oihl\t%0,%i2
--- 5383,5395 ----
     og\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")])
  
! (define_insn "*iordi3"
    [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,d,d,AQ,Q")
          (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0,0,0")
                  (match_operand:DI 2 "general_operand"
                                      "N0HD0,N1HD0,N2HD0,N3HD0,N0SD0,N1SD0,d,m,NxQD0,Q")))
     (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
    "@
     oihh\t%0,%i2
     oihl\t%0,%i2
***************
*** 5456,5480 ****
     og\t%0,%2
     #
     #"
!   [(set_attr "op_type"  "RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")])
! 
! (define_insn "*iordi3"
!   [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,d,d,AQ,Q")
!         (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0,0,0")
!                 (match_operand:DI 2 "general_operand"
!                                     "N0HD0,N1HD0,N2HD0,N3HD0,d,m,NxQD0,Q")))
!    (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
!   "@
!    oihh\t%0,%i2
!    oihl\t%0,%i2
!    oilh\t%0,%i2
!    oill\t%0,%i2
!    ogr\t%0,%2
!    og\t%0,%2
!    #
!    #"
!   [(set_attr "op_type"  "RI,RI,RI,RI,RRE,RXY,SI,SS")])
  
  (define_split
    [(set (match_operand:DI 0 "s_operand" "")
--- 5401,5408 ----
     og\t%0,%2
     #
     #"
!   [(set_attr "op_type"  "RI,RI,RI,RI,RIL,RIL,RRE,RXY,SI,SS")
!    (set_attr "cpu_facility" "*,*,*,*,extimm,extimm,*,*,*,*")])
  
  (define_split
    [(set (match_operand:DI 0 "s_operand" "")
***************
*** 5728,5739 ****
     xg\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")])
  
! (define_insn "*xordi3_extimm"
    [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,AQ,Q")
          (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0")
                  (match_operand:DI 2 "general_operand" "N0SD0,N1SD0,d,m,NxQD0,Q")))
     (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
    "@
     xihf\t%0,%k2
     xilf\t%0,%k2
--- 5656,5667 ----
     xg\t%0,%2"
    [(set_attr "op_type"  "RRE,RXY")])
  
! (define_insn "*xordi3"
    [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,d,d,AQ,Q")
          (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0,0,0")
                  (match_operand:DI 2 "general_operand" "N0SD0,N1SD0,d,m,NxQD0,Q")))
     (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && s390_logical_operator_ok_p (operands)"
    "@
     xihf\t%0,%k2
     xilf\t%0,%k2
***************
*** 5741,5760 ****
     xg\t%0,%2
     #
     #"
!   [(set_attr "op_type"  "RIL,RIL,RRE,RXY,SI,SS")])
! 
! (define_insn "*xordi3"
!   [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,AQ,Q")
!         (xor:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0,0,0")
!                 (match_operand:DI 2 "general_operand" "d,m,NxQD0,Q")))
!    (clobber (reg:CC CC_REGNUM))]
!   "TARGET_64BIT && !TARGET_EXTIMM && s390_logical_operator_ok_p (operands)"
!   "@
!    xgr\t%0,%2
!    xg\t%0,%2
!    #
!    #"
!   [(set_attr "op_type"  "RRE,RXY,SI,SS")])
  
  (define_split
    [(set (match_operand:DI 0 "s_operand" "")
--- 5669,5676 ----
     xg\t%0,%2
     #
     #"
!   [(set_attr "op_type"  "RIL,RIL,RRE,RXY,SI,SS")
!    (set_attr "cpu_facility" "extimm,extimm,*,*,*,*")])
  
  (define_split
    [(set (match_operand:DI 0 "s_operand" "")



More information about the Gcc-patches mailing list