diff options
author | Richard Sandiford <rdsandiford@googlemail.com> | 2012-08-26 19:19:31 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2012-08-26 19:19:31 +0000 |
commit | 1209ab5ed6540a37f5b0afe0c494c5771ba515ab (patch) | |
tree | 2aeb0fe5f8218124ea3971295e298cf86d3caada /gcc/config/mips/mips.c | |
parent | 3f5685dc35e4fea18c19eb5c32337c3020f323fe (diff) | |
download | gcc-1209ab5ed6540a37f5b0afe0c494c5771ba515ab.zip gcc-1209ab5ed6540a37f5b0afe0c494c5771ba515ab.tar.gz gcc-1209ab5ed6540a37f5b0afe0c494c5771ba515ab.tar.bz2 |
mips.c (mips_rtx_costs): Add costs for CINS.
gcc/
* config/mips/mips.c (mips_rtx_costs): Add costs for CINS.
From-SVN: r190699
Diffstat (limited to 'gcc/config/mips/mips.c')
-rw-r--r-- | gcc/config/mips/mips.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index b8210de..1f0c9ae 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -3677,6 +3677,18 @@ mips_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED, + set_src_cost (XEXP (x, 0), speed)); return true; } + if (ISA_HAS_CINS && CONST_INT_P (XEXP (x, 1))) + { + rtx op = XEXP (x, 0); + if (GET_CODE (op) == ASHIFT + && CONST_INT_P (XEXP (op, 1)) + && mask_low_and_shift_p (mode, XEXP (x, 1), XEXP (op, 1), 32)) + { + *total = COSTS_N_INSNS (1) + set_src_cost (XEXP (op, 0), speed); + return true; + } + } + /* Fall through. */ case IOR: |