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: cleanup machine description (4/3)


On Wed, Dec 14, 2005 at 01:20:57PM +0100, Adrian Straetling wrote:
> Hi,
> 
> this little series of patches performs some cleanup that is waiting on
> my disk for some time now.
> 
> All bootstrap fine and regtest without regressions.

this patch finally combines several tst* pattern.

Also ok for 4.2?

Bye,
Adrian

2005-12-14  Adrian Straetling  <straetling@de.ibm.com>

        * gcc/config/s390/s390.md ("d0","1"): New mode attributes.
        ("*tstdi_extimm","*tstsi_extimm"): Merge.
        ("*tstdi_cconly_extimm","*tstsi_cconly_extimm"): Merge.
        ("*tstdi_cconly2","*tstsi_cconly2"): Merge.
        Move other tst* pattern to retain partial order.


Index: gcc/config/s390/s390.md
===================================================================
*** gcc/config/s390/s390.md.orig	2005-12-13 11:43:12.356521831 +0100
--- gcc/config/s390/s390.md	2005-12-13 11:43:16.526521831 +0100
*************** (define_insn "*tm<mode>_full"
*** 430,436 ****
--- 430,440 ----
    [(set_attr "op_type" "RI")])
  
  
+ ;
  ; Load-and-Test instructions
+ ;
+ 
+ ; tst(di|si) intruction pattern(s).
  
  (define_insn "*tstdi_sign"
    [(set (reg CC_REGNUM)
*************** (define_insn "*tstdi_sign"
*** 443,470 ****
    "ltgfr\t%2,%0"
    [(set_attr "op_type" "RRE")])
  
! (define_insn "*tstdi_extimm"
    [(set (reg CC_REGNUM)
!         (compare (match_operand:DI 0 "nonimmediate_operand" "d,m")
!                  (match_operand:DI 1 "const0_operand" "")))
!    (set (match_operand:DI 2 "register_operand" "=d,d")
          (match_dup 0))]
!   "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT && TARGET_EXTIMM"
    "@
!    ltgr\t%2,%0
!    ltg\t%2,%0"
!   [(set_attr "op_type" "RRE,RXY")])
! 
! (define_insn "*tstdi_cconly_extimm"
!   [(set (reg CC_REGNUM)
!         (compare (match_operand:DI 0 "nonimmediate_operand" "d,m")
!                  (match_operand:DI 1 "const0_operand" "")))
!    (clobber (match_scratch:DI 2 "=X,d"))]
!   "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT && TARGET_EXTIMM"
    "@
!    ltgr\t%0,%0
!    ltg\t%2,%0"
!   [(set_attr "op_type" "RRE,RXY")])
  
  (define_insn "*tstdi"
    [(set (reg CC_REGNUM)
--- 447,474 ----
    "ltgfr\t%2,%0"
    [(set_attr "op_type" "RRE")])
  
! (define_insn "*tst<mode>_extimm"
    [(set (reg CC_REGNUM)
!         (compare (match_operand:GPR 0 "nonimmediate_operand" "d,m")
!                  (match_operand:GPR 1 "const0_operand" "")))
!    (set (match_operand:GPR 2 "register_operand" "=d,d")
          (match_dup 0))]
!   "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM"
    "@
!    lt<g>r\t%2,%0
!    lt<g>\t%2,%0"
!   [(set_attr "op_type" "RR<E>,RXY")])
! 
! (define_insn "*tst<mode>_cconly_extimm"
!   [(set (reg CC_REGNUM)
!         (compare (match_operand:GPR 0 "nonimmediate_operand" "d,m")
!                  (match_operand:GPR 1 "const0_operand" "")))
!    (clobber (match_scratch:GPR 2 "=X,d"))]
!   "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM"
    "@
!    lt<g>r\t%0,%0
!    lt<g>\t%2,%0"
!   [(set_attr "op_type" "RR<E>,RXY")])
  
  (define_insn "*tstdi"
    [(set (reg CC_REGNUM)
*************** (define_insn "*tstdi"
*** 476,521 ****
    "ltgr\t%2,%0"
    [(set_attr "op_type" "RRE")])
  
- (define_insn "*tstdi_cconly"
-   [(set (reg CC_REGNUM)
-         (compare (match_operand:DI 0 "register_operand" "d")
-                  (match_operand:DI 1 "const0_operand" "")))]
-   "s390_match_ccmode(insn, CCSmode) && TARGET_64BIT"
-   "ltgr\t%0,%0"
-   [(set_attr "op_type" "RRE")])
- 
- (define_insn "*tstdi_cconly_31"
-   [(set (reg CC_REGNUM)
-         (compare (match_operand:DI 0 "register_operand" "d")
-                  (match_operand:DI 1 "const0_operand" "")))]
-   "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT"
-   "srda\t%0,0"
-   [(set_attr "op_type" "RS")
-    (set_attr "atype"   "reg")])
- 
- (define_insn "*tstsi_extimm"
-   [(set (reg CC_REGNUM)
-         (compare (match_operand:SI 0 "nonimmediate_operand" "d,m")
-                  (match_operand:SI 1 "const0_operand" "")))
-    (set (match_operand:SI 2 "register_operand" "=d,d")
-         (match_dup 0))]
-   "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM"
-   "@
-    ltr\t%2,%0
-    lt\t%2,%0"
-   [(set_attr "op_type" "RR,RXY")])
- 
- (define_insn "*tstsi_cconly_extimm"
-   [(set (reg CC_REGNUM)
-         (compare (match_operand:SI 0 "nonimmediate_operand" "d,m")
-                  (match_operand:SI 1 "const0_operand" "")))
-    (clobber (match_scratch:SI 2 "=X,d"))]
-   "s390_match_ccmode(insn, CCSmode) && TARGET_EXTIMM"
-   "@
-    ltr\t%0,%0
-    lt\t%2,%0"
-   [(set_attr "op_type" "RR,RXY")])
- 
  (define_insn "*tstsi"
    [(set (reg CC_REGNUM)
          (compare (match_operand:SI 0 "nonimmediate_operand" "d,Q,S")
--- 480,485 ----
*************** (define_insn "*tstsi_cconly"
*** 541,553 ****
     icmy\t%2,15,%S0"
    [(set_attr "op_type" "RR,RS,RSY")])
  
! (define_insn "*tstsi_cconly2"
    [(set (reg CC_REGNUM)
!         (compare (match_operand:SI 0 "register_operand" "d")
!                  (match_operand:SI 1 "const0_operand" "")))]
    "s390_match_ccmode(insn, CCSmode)"
!   "ltr\t%0,%0"
!   [(set_attr "op_type" "RR")])
  
  (define_insn "*tst<mode>CCT"
    [(set (reg CC_REGNUM)
--- 505,528 ----
     icmy\t%2,15,%S0"
    [(set_attr "op_type" "RR,RS,RSY")])
  
! (define_insn "*tstdi_cconly_31"
!   [(set (reg CC_REGNUM)
!         (compare (match_operand:DI 0 "register_operand" "d")
!                  (match_operand:DI 1 "const0_operand" "")))]
!   "s390_match_ccmode(insn, CCSmode) && !TARGET_64BIT"
!   "srda\t%0,0"
!   [(set_attr "op_type" "RS")
!    (set_attr "atype"   "reg")])
! 
! (define_insn "*tst<mode>_cconly2"
    [(set (reg CC_REGNUM)
!         (compare (match_operand:GPR 0 "register_operand" "d")
!                  (match_operand:GPR 1 "const0_operand" "")))]
    "s390_match_ccmode(insn, CCSmode)"
!   "lt<g>r\t%0,%0"
!   [(set_attr "op_type" "RR<E>")])
! 
! ; tst(hi|qi) intruction pattern(s).
  
  (define_insn "*tst<mode>CCT"
    [(set (reg CC_REGNUM)


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