diff options
author | Steve Ellcey <sellcey@mips.com> | 2013-10-22 18:24:43 +0000 |
---|---|---|
committer | Steve Ellcey <sje@gcc.gnu.org> | 2013-10-22 18:24:43 +0000 |
commit | ade97eb169cc5dd93cd617f4b13d6de21873756b (patch) | |
tree | fc2369893f56654e9d5fd427be8c1feaa68b615d /gcc | |
parent | 88f4509ce6f2b0035b0997b5dc72736d356e6c58 (diff) | |
download | gcc-ade97eb169cc5dd93cd617f4b13d6de21873756b.zip gcc-ade97eb169cc5dd93cd617f4b13d6de21873756b.tar.gz gcc-ade97eb169cc5dd93cd617f4b13d6de21873756b.tar.bz2 |
mips.c (mips_rtx_costs): Fix cost estimate for nor (AND (NOT OP1) (NOT OP2)).
2013-10-22 Steve Ellcey <sellcey@mips.com>
* config/mips/mips.c (mips_rtx_costs): Fix cost estimate for nor
(AND (NOT OP1) (NOT OP2)).
From-SVN: r203932
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/mips/mips.c | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c1d3ba8..71fdd7d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2013-10-22 Steve Ellcey <sellcey@mips.com> + + * config/mips/mips.c (mips_rtx_costs): Fix cost estimate for nor + (AND (NOT OP1) (NOT OP2)). + 2013-10-22 Bill Schmidt <wschmidt@vnet.ibm.com> * config/rs6000/rs6000.c (altivec_expand_vec_perm_const): Reverse diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index 5993aab..60e5e78 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -3796,6 +3796,18 @@ mips_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED, return true; } } + /* (AND (NOT op0) (NOT op1) is a nor operation that can be done in + a single instruction. */ + if (!TARGET_MIPS16 + && GET_CODE (XEXP (x, 0)) == NOT + && GET_CODE (XEXP (x, 1)) == NOT) + { + cost = GET_MODE_SIZE (mode) > UNITS_PER_WORD ? 2 : 1; + *total = (COSTS_N_INSNS (cost) + + set_src_cost (XEXP (XEXP (x, 0), 0), speed) + + set_src_cost (XEXP (XEXP (x, 1), 0), speed)); + return true; + } /* Fall through. */ |