aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2011-11-27 10:18:25 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2011-11-27 10:18:25 +0000
commita1c48edc71e032f01eb3661bb8fccf46cf98306c (patch)
tree3538d28fe515e18e7ede606f5d67cf4757aaff89
parentfd2d6b1b1657813bbe5ef1d73e42ffb4071a5d06 (diff)
downloadgcc-a1c48edc71e032f01eb3661bb8fccf46cf98306c.zip
gcc-a1c48edc71e032f01eb3661bb8fccf46cf98306c.tar.gz
gcc-a1c48edc71e032f01eb3661bb8fccf46cf98306c.tar.bz2
re PR target/51278 (gcc.target/mips/octeon-baddu-1.c fails on the trunk)
gcc/ PR target/51278 * config/mips/mips.c (mips_rtx_costs): Handle baddu. From-SVN: r181763
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c10
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 88ad9d8..2105c64 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2011-11-27 Richard Sandiford <rdsandiford@googlemail.com>
+ PR target/51278
+ * config/mips/mips.c (mips_rtx_costs): Handle baddu.
+
+2011-11-27 Richard Sandiford <rdsandiford@googlemail.com>
+
* config/mips/mips.c (mips16_unextended_reference_p): Test for BLKmode.
2011-11-27 Richard Sandiford <rdsandiford@googlemail.com>
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 0559a9b..d3fd709 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -3777,6 +3777,16 @@ mips_rtx_costs (rtx x, int code, int outer_code, int opno ATTRIBUTE_UNUSED,
return false;
case ZERO_EXTEND:
+ if (outer_code == SET
+ && ISA_HAS_BADDU
+ && (GET_CODE (XEXP (x, 0)) == TRUNCATE
+ || GET_CODE (XEXP (x, 0)) == SUBREG)
+ && GET_MODE (XEXP (x, 0)) == QImode
+ && GET_CODE (XEXP (XEXP (x, 0), 0)) == PLUS)
+ {
+ *total = set_src_cost (XEXP (XEXP (x, 0), 0), speed);
+ return true;
+ }
*total = mips_zero_extend_cost (mode, XEXP (x, 0));
return false;