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]

tweek setcc peephole



Hi,
this patch fixes the setcc splitter, so it matches the case where
same register is used for the temporary and output (this is commonly
the case) and adds new variant when AND instead of movzx is used.

Fri Oct  5 21:44:45 CEST 2001  Jan Hubicka  <jh@suse.cz>

	* i386.md (setcc peep2): Fix; add new variant.

*** i386.md.old	Fri Oct  5 20:53:48 2001
--- config/i386/i386.md	Fri Oct  5 21:23:57 2001
***************
*** 13133,13139 ****
  	  [(reg 17) (const_int 0)]))
     (set (match_operand 3 "q_regs_operand" "")
  	(zero_extend (match_dup 1)))]
!   "peep2_reg_dead_p (3, operands[1])
     && ! reg_overlap_mentioned_p (operands[3], operands[0])"
    [(set (match_dup 3) (const_int 0))
     (set (match_dup 4) (match_dup 0))
--- 13133,13158 ----
  	  [(reg 17) (const_int 0)]))
     (set (match_operand 3 "q_regs_operand" "")
  	(zero_extend (match_dup 1)))]
!   "(peep2_reg_dead_p (3, operands[1])
!     || operands_match_p (operands[1], operands[3]))
!    && ! reg_overlap_mentioned_p (operands[3], operands[0])"
!   [(set (match_dup 3) (const_int 0))
!    (set (match_dup 4) (match_dup 0))
!    (set (strict_low_part (match_dup 5))
! 	(match_dup 2))]
!   "operands[4] = gen_rtx_REG (GET_MODE (operands[0]), 17);
!    operands[5] = gen_rtx_REG (QImode, REGNO (operands[3]));")
! 
! (define_peephole2
!   [(set (reg 17) (match_operand 0 "" ""))
!    (set (match_operand:QI 1 "register_operand" "")
! 	(match_operator:QI 2 "ix86_comparison_operator"
! 	  [(reg 17) (const_int 0)]))
!    (parallel [(set (match_operand 3 "q_regs_operand" "")
! 		   (zero_extend (match_dup 1)))
! 	      (clobber (reg:CC 17))])]
!   "(peep2_reg_dead_p (3, operands[1])
!     || operands_match_p (operands[1], operands[3]))
     && ! reg_overlap_mentioned_p (operands[3], operands[0])"
    [(set (match_dup 3) (const_int 0))
     (set (match_dup 4) (match_dup 0))


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