diff options
author | Jakub Jelinek <jakub@redhat.com> | 2003-07-11 23:04:56 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2003-07-11 23:04:56 +0200 |
commit | 358b8f011484b845868d977d9bc0caaa096c96a3 (patch) | |
tree | a3656da4466c54cd571525ec90e2a1bf57bccbda /gcc/config/s390 | |
parent | 8634e925a9f53c086210ee461a0002278bc5c3d2 (diff) | |
download | gcc-358b8f011484b845868d977d9bc0caaa096c96a3.zip gcc-358b8f011484b845868d977d9bc0caaa096c96a3.tar.gz gcc-358b8f011484b845868d977d9bc0caaa096c96a3.tar.bz2 |
optabs.c (prepare_cmp_insn): Try cmpmemM first if it exists, then fall back to cmpstrM.
* optabs.c (prepare_cmp_insn): Try cmpmemM first if it exists,
then fall back to cmpstrM.
* builtins.c (expand_builtin_memcmp): Likewise.
* config/s390/s390-protos.h (s390_expand_cmpstr): Rename to...
(s390_expand_cmpmem): ... this.
* config/s390/s390.md (cmpmemdi, cmpmemsi, cmpmem_short_64,
cmpmem_short_31, cmpmem_long_64, cmpmem_long_31): Renamed
from cmpstr* patterns. Rename call to s390_expand_cmpstr
to s390_expand_cmpmem.
* config/s390/s390.c (s390_expand_cmpstr): Rename to...
(s390_expand_cmpstr): ... this. Rename cmpstr* instructions
to cmpmem*.
* config/i370/i370.md (cmpmemsi, cmpmemsi_1): Renamed from
cmpstr* patterns.
* doc/md.texi (cmpstrM): Describe as String compare insn, not
Block compare insn.
(cmpmemM): Add.
* gcc.dg/20030711-1.c: New test.
From-SVN: r69243
Diffstat (limited to 'gcc/config/s390')
-rw-r--r-- | gcc/config/s390/s390-protos.h | 2 | ||||
-rw-r--r-- | gcc/config/s390/s390.c | 6 | ||||
-rw-r--r-- | gcc/config/s390/s390.md | 18 |
3 files changed, 13 insertions, 13 deletions
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h index 7641fcb..3d3f53a 100644 --- a/gcc/config/s390/s390-protos.h +++ b/gcc/config/s390/s390-protos.h @@ -68,7 +68,7 @@ extern void emit_symbolic_move PARAMS ((rtx *)); extern void s390_load_address PARAMS ((rtx, rtx)); extern void s390_expand_movstr PARAMS ((rtx, rtx, rtx)); extern void s390_expand_clrstr PARAMS ((rtx, rtx)); -extern void s390_expand_cmpstr PARAMS ((rtx, rtx, rtx, rtx)); +extern void s390_expand_cmpmem PARAMS ((rtx, rtx, rtx, rtx)); extern rtx s390_return_addr_rtx PARAMS ((int, rtx)); extern void s390_output_symbolic_const PARAMS ((FILE *, rtx)); diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 7db180d..07d3032 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -3116,16 +3116,16 @@ s390_expand_clrstr (dst, len) and return the result in TARGET. */ void -s390_expand_cmpstr (target, op0, op1, len) +s390_expand_cmpmem (target, op0, op1, len) rtx target; rtx op0; rtx op1; rtx len; { rtx (*gen_short) PARAMS ((rtx, rtx, rtx)) = - TARGET_64BIT ? gen_cmpstr_short_64 : gen_cmpstr_short_31; + TARGET_64BIT ? gen_cmpmem_short_64 : gen_cmpmem_short_31; rtx (*gen_long) PARAMS ((rtx, rtx, rtx, rtx)) = - TARGET_64BIT ? gen_cmpstr_long_64 : gen_cmpstr_long_31; + TARGET_64BIT ? gen_cmpmem_long_64 : gen_cmpmem_long_31; rtx (*gen_result) PARAMS ((rtx)) = GET_MODE (target) == DImode ? gen_cmpint_di : gen_cmpint_si; diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md index 703f0d7..fc1af11 100644 --- a/gcc/config/s390/s390.md +++ b/gcc/config/s390/s390.md @@ -1958,33 +1958,33 @@ (set_attr "length" "8")]) ; -; cmpstrM instruction pattern(s). +; cmpmemM instruction pattern(s). ; -(define_expand "cmpstrdi" +(define_expand "cmpmemdi" [(set (match_operand:DI 0 "register_operand" "") (compare:DI (match_operand:BLK 1 "memory_operand" "") (match_operand:BLK 2 "memory_operand" "") ) ) (use (match_operand:DI 3 "general_operand" "")) (use (match_operand:DI 4 "" ""))] "TARGET_64BIT" - "s390_expand_cmpstr (operands[0], operands[1], + "s390_expand_cmpmem (operands[0], operands[1], operands[2], operands[3]); DONE;") -(define_expand "cmpstrsi" +(define_expand "cmpmemsi" [(set (match_operand:SI 0 "register_operand" "") (compare:SI (match_operand:BLK 1 "memory_operand" "") (match_operand:BLK 2 "memory_operand" "") ) ) (use (match_operand:SI 3 "general_operand" "")) (use (match_operand:SI 4 "" ""))] "" - "s390_expand_cmpstr (operands[0], operands[1], + "s390_expand_cmpmem (operands[0], operands[1], operands[2], operands[3]); DONE;") ; Compare a block that is up to 256 bytes in length. ; The block length is taken as (operands[2] % 256) + 1. -(define_insn "cmpstr_short_64" +(define_insn "cmpmem_short_64" [(set (reg:CCS 33) (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q") (match_operand:BLK 1 "memory_operand" "Q,Q"))) @@ -2012,7 +2012,7 @@ (set_attr "atype" "*,agen") (set_attr "length" "*,14")]) -(define_insn "cmpstr_short_31" +(define_insn "cmpmem_short_31" [(set (reg:CCS 33) (compare:CCS (match_operand:BLK 0 "memory_operand" "=Q,Q") (match_operand:BLK 1 "memory_operand" "Q,Q"))) @@ -2042,7 +2042,7 @@ ; Compare a block of arbitrary length. -(define_insn "cmpstr_long_64" +(define_insn "cmpmem_long_64" [(clobber (match_operand:TI 0 "register_operand" "=d")) (clobber (match_operand:TI 1 "register_operand" "=d")) (set (reg:CCS 33) @@ -2055,7 +2055,7 @@ [(set_attr "op_type" "RR") (set_attr "type" "vs")]) -(define_insn "cmpstr_long_31" +(define_insn "cmpmem_long_31" [(clobber (match_operand:DI 0 "register_operand" "=d")) (clobber (match_operand:DI 1 "register_operand" "=d")) (set (reg:CCS 33) |