diff options
| author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-16 07:53:47 +0000 |
|---|---|---|
| committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-07-16 07:53:47 +0000 |
| commit | fcd8d2196ca39a63a07bfe4cb40da57b2df55774 (patch) | |
| tree | 08a150079f4dff10c6ceb2b77fe6f36df831bf1e | |
| parent | c0faa4a52ae9d43d6134057851e917b248f218f2 (diff) | |
| download | ppe42-gcc-fcd8d2196ca39a63a07bfe4cb40da57b2df55774.tar.gz ppe42-gcc-fcd8d2196ca39a63a07bfe4cb40da57b2df55774.zip | |
* config/mips/mips.c (mips_zero_if_equal): Only use XORs if the second
operand is an uns_arith_operand; use subtraction otherwise.
* config/mips/mips.md (cmpsi, cmpdi): Allow any nonmemory_operand,
not just arith_operands.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84809 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/ChangeLog | 7 | ||||
| -rw-r--r-- | gcc/config/mips/mips.c | 6 | ||||
| -rw-r--r-- | gcc/config/mips/mips.md | 4 |
3 files changed, 14 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a57ee1c7d86..52c646fe2ef 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 2004-07-16 Richard Sandiford <rsandifo@redhat.com> + * config/mips/mips.c (mips_zero_if_equal): Only use XORs if the second + operand is an uns_arith_operand; use subtraction otherwise. + * config/mips/mips.md (cmpsi, cmpdi): Allow any nonmemory_operand, + not just arith_operands. + +2004-07-16 Richard Sandiford <rsandifo@redhat.com> + * config/mips/mips-protos.h (gen_int_relational): Delete. (mips_emit_scc): Declare. * config/mips/mips.c (internal_test): Delete. diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 648abbf00d2..489016af464 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -2776,7 +2776,11 @@ mips_zero_if_equal (rtx cmp0, rtx cmp1) if (cmp1 == const0_rtx) return cmp0; - return expand_binop (GET_MODE (cmp0), xor_optab, + if (uns_arith_operand (cmp1, VOIDmode)) + return expand_binop (GET_MODE (cmp0), xor_optab, + cmp0, cmp1, 0, 0, OPTAB_DIRECT); + + return expand_binop (GET_MODE (cmp0), sub_optab, cmp0, cmp1, 0, 0, OPTAB_DIRECT); } diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index 08f04f8ded3..abb5d442949 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -5472,7 +5472,7 @@ dsrl\t%3,%3,1\n\ (define_expand "cmpsi" [(set (cc0) (compare:CC (match_operand:SI 0 "register_operand") - (match_operand:SI 1 "arith_operand")))] + (match_operand:SI 1 "nonmemory_operand")))] "" { cmp_operands[0] = operands[0]; @@ -5483,7 +5483,7 @@ dsrl\t%3,%3,1\n\ (define_expand "cmpdi" [(set (cc0) (compare:CC (match_operand:DI 0 "register_operand") - (match_operand:DI 1 "arith_operand")))] + (match_operand:DI 1 "nonmemory_operand")))] "TARGET_64BIT" { cmp_operands[0] = operands[0]; |

