(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))])]
""
"
{
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))]
""
"*
{
(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\";
}")