This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
i386 integer comparison patch
- To: egcs-patches at cygnus dot com
- Subject: i386 integer comparison patch
- From: john at feith dot com (John Wehle)
- Date: Sun, 31 May 1998 00:44:12 -0400
Hello,
This change updates the integer comparison patterns so that
the register allocator can hopefully do a better job.
ChangeLog:
Sun May 31 00:28:08 EDT 1998 John Wehle (john@feith.com)
* i386.md (cmpsi_1, cmphi_1, cmpqi_1): Update constraints
and remove code which set CC_REVERSED since reload should
ensure that the operands are already the correct type.
(movsicc+1, movsicc+2, movhicc+1, movhicc+2, movsfcc+1,
movsfcc+2, movdfcc+1, movdfcc+2, movxfcc+1, movxfcc+2,
movdicc+1, movdicc+2): Update the constraints and specify
the mode for the comparison operands.
Notes:
1) This patch is built on top of the conditional move patch
sent earlier.
Enjoy!
-- John Wehle
------------------8<------------------------8<------------------------
*** gcc/config/i386/i386.md.ORIGINAL Thu May 28 01:08:21 1998
--- gcc/config/i386/i386.md Sat May 30 23:37:43 1998
***************
*** 325,342 ****
(define_insn "cmpsi_1"
[(set (cc0)
! (compare (match_operand:SI 0 "nonimmediate_operand" "mr,r")
! (match_operand:SI 1 "general_operand" "ri,mr")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
! "*
! {
! if (CONSTANT_P (operands[0]) || GET_CODE (operands[1]) == MEM)
! {
! cc_status.flags |= CC_REVERSED;
! return AS2 (cmp%L0,%0,%1);
! }
! return AS2 (cmp%L0,%1,%0);
! }")
(define_expand "cmpsi"
[(set (cc0)
--- 325,334 ----
(define_insn "cmpsi_1"
[(set (cc0)
! (compare (match_operand:SI 0 "nonimmediate_operand" "r,rm")
! (match_operand:SI 1 "general_operand" "rmi,ri")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
! "* return AS2 (cmp%L0,%1,%0);")
(define_expand "cmpsi"
[(set (cc0)
***************
*** 356,373 ****
(define_insn "cmphi_1"
[(set (cc0)
! (compare (match_operand:HI 0 "nonimmediate_operand" "mr,r")
! (match_operand:HI 1 "general_operand" "ri,mr")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
! "*
! {
! if (CONSTANT_P (operands[0]) || GET_CODE (operands[1]) == MEM)
! {
! cc_status.flags |= CC_REVERSED;
! return AS2 (cmp%W0,%0,%1);
! }
! return AS2 (cmp%W0,%1,%0);
! }")
(define_expand "cmphi"
[(set (cc0)
--- 348,357 ----
(define_insn "cmphi_1"
[(set (cc0)
! (compare (match_operand:HI 0 "nonimmediate_operand" "r,rm")
! (match_operand:HI 1 "general_operand" "rmi,ri")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
! "* return AS2 (cmp%W0,%1,%0);")
(define_expand "cmphi"
[(set (cc0)
***************
*** 387,404 ****
(define_insn "cmpqi_1"
[(set (cc0)
! (compare (match_operand:QI 0 "nonimmediate_operand" "q,mq")
! (match_operand:QI 1 "general_operand" "qm,nq")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
! "*
! {
! if (CONSTANT_P (operands[0]) || GET_CODE (operands[1]) == MEM)
! {
! cc_status.flags |= CC_REVERSED;
! return AS2 (cmp%B0,%0,%1);
! }
! return AS2 (cmp%B0,%1,%0);
! }")
(define_expand "cmpqi"
[(set (cc0)
--- 371,380 ----
(define_insn "cmpqi_1"
[(set (cc0)
! (compare (match_operand:QI 0 "nonimmediate_operand" "q,qm")
! (match_operand:QI 1 "general_operand" "qmn,qn")))]
"GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM"
! "* return AS2 (cmp%B0,%1,%0);")
(define_expand "cmpqi"
[(set (cc0)
***************
*** 7254,7261 ****
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
(if_then_else:SI (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:SI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
(match_operand:SI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
"TARGET_CMOVE"
--- 7230,7237 ----
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
(if_then_else:SI (match_operator 1 "comparison_operator"
! [(match_operand:SI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:SI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:SI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
(match_operand:SI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
"TARGET_CMOVE"
***************
*** 7264,7274 ****
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
(if_then_else:SI (match_operator 1 "comparison_operator"
! [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
! (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:SI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
(match_operand:SI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
! "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
"#")
(define_split
--- 7240,7260 ----
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
(if_then_else:SI (match_operator 1 "comparison_operator"
! [(match_operand:HI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:HI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:SI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
(match_operand:SI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
! "TARGET_CMOVE"
! "#")
!
! (define_insn ""
! [(set (match_operand:SI 0 "register_operand" "=r,r,r,r,r,r")
! (if_then_else:SI (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,qm,q,qm,q,qm")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
! (match_operand:SI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
! (match_operand:SI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
! "TARGET_CMOVE"
"#")
(define_split
***************
*** 7356,7363 ****
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")
(if_then_else:HI (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:HI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
(match_operand:HI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
"TARGET_CMOVE"
--- 7342,7359 ----
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")
(if_then_else:HI (match_operator 1 "comparison_operator"
! [(match_operand:SI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:SI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
! (match_operand:HI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
! (match_operand:HI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
! "TARGET_CMOVE"
! "#")
!
! (define_insn ""
! [(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")
! (if_then_else:HI (match_operator 1 "comparison_operator"
! [(match_operand:HI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:HI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:HI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
(match_operand:HI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
"TARGET_CMOVE"
***************
*** 7366,7376 ****
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")
(if_then_else:HI (match_operator 1 "comparison_operator"
! [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
! (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:HI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
(match_operand:HI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
! "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
"#")
(define_split
--- 7362,7372 ----
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r,r,r,r,r,r")
(if_then_else:HI (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,qm,q,qm,q,qm")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:HI 4 "nonimmediate_operand" "rm,rm,0,0,rm,rm")
(match_operand:HI 5 "nonimmediate_operand" "0,0,rm,rm,rm,rm")))]
! "TARGET_CMOVE"
"#")
(define_split
***************
*** 7459,7466 ****
(define_insn ""
[(set (match_operand:SF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:SF (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
"TARGET_CMOVE"
--- 7455,7462 ----
(define_insn ""
[(set (match_operand:SF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:SF (match_operator 1 "comparison_operator"
! [(match_operand:SI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:SI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
"TARGET_CMOVE"
***************
*** 7469,7479 ****
(define_insn ""
[(set (match_operand:SF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:SF (match_operator 1 "comparison_operator"
! [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
! (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
"#")
(define_split
--- 7465,7485 ----
(define_insn ""
[(set (match_operand:SF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:SF (match_operator 1 "comparison_operator"
! [(match_operand:HI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:HI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE"
! "#")
!
! (define_insn ""
! [(set (match_operand:SF 0 "register_operand" "=f,f,f,f,f,f")
! (if_then_else:SF (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,qm,q,qm,q,qm")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
! (match_operand:SF 4 "register_operand" "f,f,0,0,f,f")
! (match_operand:SF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE"
"#")
(define_split
***************
*** 7561,7568 ****
(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:DF (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
"TARGET_CMOVE"
--- 7567,7584 ----
(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:DF (match_operator 1 "comparison_operator"
! [(match_operand:SI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:SI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
! (match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
! (match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE"
! "#")
!
! (define_insn ""
! [(set (match_operand:DF 0 "register_operand" "=f,f,f,f,f,f")
! (if_then_else:DF (match_operator 1 "comparison_operator"
! [(match_operand:HI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:HI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
"TARGET_CMOVE"
***************
*** 7571,7581 ****
(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:DF (match_operator 1 "comparison_operator"
! [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
! (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
"#")
(define_split
--- 7587,7597 ----
(define_insn ""
[(set (match_operand:DF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:DF (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,qm,q,qm,q,qm")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:DF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:DF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE"
"#")
(define_split
***************
*** 7663,7670 ****
(define_insn ""
[(set (match_operand:XF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:XF (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
"TARGET_CMOVE"
--- 7679,7696 ----
(define_insn ""
[(set (match_operand:XF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:XF (match_operator 1 "comparison_operator"
! [(match_operand:SI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:SI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
! (match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
! (match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE"
! "#")
!
! (define_insn ""
! [(set (match_operand:XF 0 "register_operand" "=f,f,f,f,f,f")
! (if_then_else:XF (match_operator 1 "comparison_operator"
! [(match_operand:HI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:HI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
"TARGET_CMOVE"
***************
*** 7673,7683 ****
(define_insn ""
[(set (match_operand:XF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:XF (match_operator 1 "comparison_operator"
! [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
! (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
"#")
(define_split
--- 7699,7709 ----
(define_insn ""
[(set (match_operand:XF 0 "register_operand" "=f,f,f,f,f,f")
(if_then_else:XF (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,qm,q,qm,q,qm")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:XF 4 "register_operand" "f,f,0,0,f,f")
(match_operand:XF 5 "register_operand" "0,0,f,f,f,f")))]
! "TARGET_CMOVE"
"#")
(define_split
***************
*** 7765,7772 ****
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=&r,&r,&r,&r,&r,&r")
(if_then_else:DI (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,m,q,m,q,m")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
(match_operand:DI 4 "nonimmediate_operand" "ro,ro,0,0,ro,ro")
(match_operand:DI 5 "nonimmediate_operand" "0,0,ro,ro,ro,ro")))]
"TARGET_CMOVE"
--- 7791,7798 ----
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=&r,&r,&r,&r,&r,&r")
(if_then_else:DI (match_operator 1 "comparison_operator"
! [(match_operand:SI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:SI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:DI 4 "nonimmediate_operand" "ro,ro,0,0,ro,ro")
(match_operand:DI 5 "nonimmediate_operand" "0,0,ro,ro,ro,ro")))]
"TARGET_CMOVE"
***************
*** 7775,7785 ****
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=&r,&r,&r,&r,&r,&r")
(if_then_else:DI (match_operator 1 "comparison_operator"
! [(match_operand 2 "nonimmediate_operand" "r,m,r,m,r,m")
! (match_operand 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:DI 4 "nonimmediate_operand" "ro,ro,0,0,ro,ro")
(match_operand:DI 5 "nonimmediate_operand" "0,0,ro,ro,ro,ro")))]
! "TARGET_CMOVE && GET_MODE_CLASS (GET_MODE (operands[2])) == MODE_INT"
"#")
(define_split
--- 7801,7821 ----
(define_insn ""
[(set (match_operand:DI 0 "register_operand" "=&r,&r,&r,&r,&r,&r")
(if_then_else:DI (match_operator 1 "comparison_operator"
! [(match_operand:HI 2 "nonimmediate_operand" "r,rm,r,rm,r,rm")
! (match_operand:HI 3 "general_operand" "rmi,ri,rmi,ri,rmi,ri")])
(match_operand:DI 4 "nonimmediate_operand" "ro,ro,0,0,ro,ro")
(match_operand:DI 5 "nonimmediate_operand" "0,0,ro,ro,ro,ro")))]
! "TARGET_CMOVE"
! "#")
!
! (define_insn ""
! [(set (match_operand:DI 0 "register_operand" "=&r,&r,&r,&r,&r,&r")
! (if_then_else:DI (match_operator 1 "comparison_operator"
! [(match_operand:QI 2 "nonimmediate_operand" "q,qm,q,qm,q,qm")
! (match_operand:QI 3 "general_operand" "qmn,qn,qmn,qn,qmn,qn")])
! (match_operand:DI 4 "nonimmediate_operand" "ro,ro,0,0,ro,ro")
! (match_operand:DI 5 "nonimmediate_operand" "0,0,ro,ro,ro,ro")))]
! "TARGET_CMOVE"
"#")
(define_split
-------------------------------------------------------------------------
| Feith Systems | Voice: 1-215-646-8000 | Email: john@feith.com |
| John Wehle | Fax: 1-215-540-5495 | |
-------------------------------------------------------------------------