[3.0] Re: egcs/gcc ChangeLog config/i386/i386.md
Richard Henderson
rth@redhat.com
Fri Oct 5 11:18:00 GMT 2001
On Thu, Oct 04, 2001 at 02:20:39PM -0000, hubicka@gcc.gnu.org wrote:
> * i386.c (setcc peep2): Do not use clobber of flags.
This severely pessimizes the PII core.
The "xor reg,reg" is special in that it sets a "register clear"
flag that avoids a partial register stall with the subsequent
setcc. Unfortunately, "mov $0,reg" does not have the same effect.
I think the following is in order. Bootstrapped on i686-linux
with -march=k6 in BOOT_CFLAGS.
Ok, Mark?
r~
* i386.md (movsi_xor): Export.
(setcc peep2): Use it when available.
Index: i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.204.2.17
diff -c -p -d -r1.204.2.17 i386.md
*** i386.md 2001/10/04 14:20:33 1.204.2.17
--- i386.md 2001/10/05 18:08:47
***************
*** 1581,1587 ****
[(set_attr "type" "pop")
(set_attr "mode" "SI")])
! (define_insn "*movsi_xor"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "const0_operand" "i"))
(clobber (reg:CC 17))]
--- 1581,1587 ----
[(set_attr "type" "pop")
(set_attr "mode" "SI")])
! (define_insn "movsi_xor"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operand:SI 1 "const0_operand" "i"))
(clobber (reg:CC 17))]
***************
*** 9606,9617 ****
(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))
(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]));")
;; Call instructions.
--- 9606,9623 ----
(zero_extend (match_dup 1)))]
"peep2_reg_dead_p (3, operands[1])
&& ! reg_overlap_mentioned_p (operands[3], operands[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]));
! if (HAVE_movsi_xor)
! emit_insn (gen_movsi_xor (operands[3], const0_rtx));
! else
! emit_insn (gen_movsi (operands[3], const0_rtx));
! }")
;; Call instructions.
More information about the Gcc-patches
mailing list