]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (ix86_rtx_costs): Set proper rtx cost for ashl<mode>3_mask...
authorWei Mi <wmi@google.com>
Tue, 2 Apr 2013 16:54:58 +0000 (16:54 +0000)
committerWei Mi <wmi@gcc.gnu.org>
Tue, 2 Apr 2013 16:54:58 +0000 (16:54 +0000)
2013-04-02  Wei Mi  <wmi@google.com>

* config/i386/i386.c (ix86_rtx_costs): Set proper rtx cost for
ashl<mode>3_mask, *<shift_insn><mode>3_mask and
*<rotate_insn><mode>3_mask in i386.md.

From-SVN: r197365

gcc/ChangeLog
gcc/config/i386/i386.c

index 0ad32d9b3bd8368d5401cda08de2e8efa72a651f..d87072232313ab4ed193e501522b9d6e3696e8db 100644 (file)
@@ -1,3 +1,9 @@
+2013-04-02  Wei Mi  <wmi@google.com>
+
+       * config/i386/i386.c (ix86_rtx_costs): Set proper rtx cost for
+       ashl<mode>3_mask, *<shift_insn><mode>3_mask and
+       *<rotate_insn><mode>3_mask in i386.md.
+
 2013-04-01  Wei Mi  <wmi@google.com>
 
        * config/i386/i386.md (*ashl<mode>3_mask): Rewrite as define_insn.
index 86804a472a58c7e218ef88ddaeafc6e60ba29539..c43d3ed57f034b10b37bb877e842fcccb894fdfb 100644 (file)
@@ -29179,6 +29179,13 @@ ix86_rtx_costs (rtx x, int code, int outer_code_i, int *total, bool speed)
        {
          if (CONST_INT_P (XEXP (x, 1)))
            *total = cost->shift_const;
+         else if (GET_CODE (XEXP (x, 1)) == SUBREG
+                  && GET_CODE (XEXP (XEXP (x, 1), 0)) == AND)
+           {
+             /* Return the cost after shift-and truncation.  */
+             *total = cost->shift_var;
+             return true;
+           }
          else
            *total = cost->shift_var;
        }