re PR target/51278 (gcc.target/mips/octeon-baddu-1.c fails on the trunk)
authorRichard Sandiford <rdsandiford@googlemail.com>
Sun, 27 Nov 2011 10:18:25 +0000 (10:18 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 27 Nov 2011 10:18:25 +0000 (10:18 +0000)
gcc/
PR target/51278
* config/mips/mips.c (mips_rtx_costs): Handle baddu.

From-SVN: r181763

gcc/ChangeLog
gcc/config/mips/mips.c

index 88ad9d84baf7d22ba6d809b6865a0ba6abede6d1..2105c646c3af11440787e4738428a55f1ba10557 100644 (file)
@@ -1,3 +1,8 @@
+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.
index 0559a9b78d951bc847500c297c2638530be6634a..d3fd7097f5739391e0c2de0d3bcdbc90adea3fd9 100644 (file)
@@ -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;