aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJames Van Artsdalen <jrv@gnu.org>1992-04-10 16:04:07 +0000
committerJames Van Artsdalen <jrv@gnu.org>1992-04-10 16:04:07 +0000
commitf76e3b059ec8549ecd76db85143e1fbdb625e0ad (patch)
tree18cfdbab468b2f13a653802b28c151ada52c089e /gcc
parent1f7da38ef9526fc6ce11d02c97d9c5db4448e46a (diff)
downloadgcc-f76e3b059ec8549ecd76db85143e1fbdb625e0ad.zip
gcc-f76e3b059ec8549ecd76db85143e1fbdb625e0ad.tar.gz
gcc-f76e3b059ec8549ecd76db85143e1fbdb625e0ad.tar.bz2
*** empty log message ***
From-SVN: r714
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/i386.md25
1 files changed, 17 insertions, 8 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 0770422..5d8027e 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\";
}")