From f76e3b059ec8549ecd76db85143e1fbdb625e0ad Mon Sep 17 00:00:00 2001 From: James Van Artsdalen Date: Fri, 10 Apr 1992 16:04:07 +0000 Subject: [PATCH] *** empty log message *** From-SVN: r714 --- gcc/config/i386/i386.md | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 0770422d1bd..5d8027edbd4 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -3464,8 +3464,7 @@ (use (match_operand:SI 4 "immediate_operand" "")) (clobber (match_dup 1)) (clobber (match_dup 2)) - (clobber (match_dup 3)) - (clobber (match_scratch:SI 5 ""))])] + (clobber (match_dup 3))])] "" " { @@ -3474,16 +3473,22 @@ operands[3] = copy_to_mode_reg (SImode, operands[3]); }") +;; memcmp recognizers. The `cmpsb' opcode does nothing if the count is +;; zero. Emit extra code to make sure that a zero-length compare is EQ. + +;; ??? Most comparisons have a constant length, and it's therefore +;; possible to know that the length is non-zero, and to avoid the extra +;; code to handle zero-length compares. + (define_insn "" - [(set (match_operand:QI 0 "general_operand" "=q") + [(set (match_operand:QI 0 "general_operand" "=&q") (compare (mem:BLK (match_operand:SI 1 "general_operand" "S")) (mem:BLK (match_operand:SI 2 "general_operand" "D")))) (use (match_operand:SI 3 "general_operand" "c")) (use (match_operand:SI 4 "immediate_operand" "i")) (clobber (match_dup 1)) (clobber (match_dup 2)) - (clobber (match_dup 3)) - (clobber (match_scratch:SI 5 "=&r"))] + (clobber (match_dup 3))] "" "* { @@ -3515,12 +3520,16 @@ (use (match_operand:SI 3 "immediate_operand" "i")) (clobber (match_dup 0)) (clobber (match_dup 1)) - (clobber (match_dup 2)) - (clobber (match_scratch:SI 4 "=&r"))] + (clobber (match_dup 2))] "" "* { - output_asm_insn (AS2 (xor%L4,%4,%4), operands); + rtx xops[2]; + + xops[0] = gen_rtx (REG, QImode, 0); + xops[1] = CONST0_RTX (QImode); + + output_asm_insn (AS2 (test%B0,%1,%0), xops); return \"repz\;cmps%B2\"; }") -- 2.30.2