Commit 98166149 by James Van Artsdalen

(cmpstrM patterns): Compare strings of unsigned chars, not strings of

signed chars.

From-SVN: r2414
parent b329456e
...@@ -3976,7 +3976,7 @@ ...@@ -3976,7 +3976,7 @@
}") }")
(define_expand "cmpstrsi" (define_expand "cmpstrsi"
[(parallel [(set (match_operand:QI 0 "general_operand" "") [(parallel [(set (match_operand:SI 0 "general_operand" "")
(compare:CC (match_operand:BLK 1 "general_operand" "") (compare:CC (match_operand:BLK 1 "general_operand" "")
(match_operand:BLK 2 "general_operand" ""))) (match_operand:BLK 2 "general_operand" "")))
(use (match_operand:SI 3 "general_operand" "")) (use (match_operand:SI 3 "general_operand" ""))
...@@ -4013,7 +4013,7 @@ ...@@ -4013,7 +4013,7 @@
;; code to handle zero-length compares. ;; code to handle zero-length compares.
(define_insn "" (define_insn ""
[(set (match_operand:QI 0 "general_operand" "=&q") [(set (match_operand:SI 0 "general_operand" "=&r")
(compare:CC (mem:BLK (match_operand:SI 1 "address_operand" "S")) (compare:CC (mem:BLK (match_operand:SI 1 "address_operand" "S"))
(mem:BLK (match_operand:SI 2 "address_operand" "D")))) (mem:BLK (match_operand:SI 2 "address_operand" "D"))))
(use (match_operand:SI 3 "register_operand" "c")) (use (match_operand:SI 3 "register_operand" "c"))
...@@ -4024,12 +4024,12 @@ ...@@ -4024,12 +4024,12 @@
"" ""
"* "*
{ {
rtx xops[3], label; rtx xops[4], label;
label = gen_label_rtx (); label = gen_label_rtx ();
output_asm_insn (\"cld\", operands); output_asm_insn (\"cld\", operands);
output_asm_insn (AS2 (xor%B0,%0,%0), operands); output_asm_insn (AS2 (xor%L0,%0,%0), operands);
output_asm_insn (\"repz\;cmps%B2\", operands); output_asm_insn (\"repz\;cmps%B2\", operands);
output_asm_insn (\"je %l0\", &label); output_asm_insn (\"je %l0\", &label);
...@@ -4038,9 +4038,12 @@ ...@@ -4038,9 +4038,12 @@
gen_rtx (PLUS, SImode, operands[1], constm1_rtx)); gen_rtx (PLUS, SImode, operands[1], constm1_rtx));
xops[2] = gen_rtx (MEM, QImode, xops[2] = gen_rtx (MEM, QImode,
gen_rtx (PLUS, SImode, operands[2], constm1_rtx)); gen_rtx (PLUS, SImode, operands[2], constm1_rtx));
xops[3] = operands[3];
output_asm_insn (AS2 (mov%B0,%1,%b0), xops); output_asm_insn (AS2 (movz%B1%L0,%1,%0), xops);
output_asm_insn (AS2 (sub%B0,%2,%b0), xops); output_asm_insn (AS2 (movz%B2%L3,%2,%3), xops);
output_asm_insn (AS2 (sub%L0,%3,%0), xops);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (label)); ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (label));
RET; RET;
}") }")
...@@ -4059,6 +4062,8 @@ ...@@ -4059,6 +4062,8 @@
{ {
rtx xops[2]; rtx xops[2];
cc_status.flags |= CC_NOT_SIGNED;
xops[0] = gen_rtx (REG, QImode, 0); xops[0] = gen_rtx (REG, QImode, 0);
xops[1] = CONST0_RTX (QImode); xops[1] = CONST0_RTX (QImode);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment