File ibm304071-z10-3 of Package gcc43

From gcc-patches-return-218928-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org Tue May 27 12:00:29 2008
Return-Path: <gcc-patches-return-218928-listarch-gcc-patches=gcc dot gnu dot org at gcc dot gnu dot org>
Delivered-To: listarch-gcc-patches at gcc dot gnu dot org
Received: (qmail 20383 invoked by alias); 27 May 2008 12:00:25 -0000
Received: (qmail 20300 invoked by uid 22791); 27 May 2008 12:00:22 -0000
X-Spam-Check-By: sourceware.org
Received: from mtagate1.de.ibm.com (HELO mtagate1.de.ibm.com) (195.212.29.150)     by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 27 May 2008 12:00:03 +0000
Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) 	by mtagate1.de.ibm.com (8.13.8/8.13.8) with ESMTP id m4RBxrjg111948 	for <gcc-patches@gcc.gnu.org>; Tue, 27 May 2008 11:59:53 GMT
Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) 	by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4RBxrlx3883202 	for <gcc-patches@gcc.gnu.org>; Tue, 27 May 2008 13:59:53 +0200
Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) 	by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4RBxrON017486 	for <gcc-patches@gcc.gnu.org>; Tue, 27 May 2008 13:59:53 +0200
Received: from lc4eb0107015440.ibm.com (dyn-9-152-216-52.boeblingen.de.ibm.com [9.152.216.52]) 	by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m4RBxqMj017463 	for <gcc-patches@gcc.gnu.org>; Tue, 27 May 2008 13:59:52 +0200
Received: by lc4eb0107015440.ibm.com (sSMTP sendmail emulation); Tue, 27 May 2008 13:59:56 +0200
From: "Andreas Krebbel" <Andreas dot Krebbel at de dot ibm dot com>
Date: Tue, 27 May 2008 13:59:56 +0200
To: gcc-patches at gcc dot gnu dot org
Subject: [Committed] S/390: Exploit the 'enabled' insn attribute
Message-ID: <20080527115956.GB18965@homer.boeblingen.de.ibm.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.4.2.2i
Mailing-List: contact gcc-patches-help at gcc dot gnu dot org; run by ezmlm
Precedence: bulk
List-Id: <gcc-patches.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-patches/>
List-Post: <mailto:gcc-patches at gcc dot gnu dot org>
List-Help: <mailto:gcc-patches-help at gcc dot gnu dot org>
Sender: gcc-patches-owner at gcc dot gnu dot org
Delivered-To: mailing list gcc-patches at gcc dot gnu dot org

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" "")