From: Wei Mi Date: Tue, 2 Apr 2013 16:54:58 +0000 (+0000) Subject: i386.c (ix86_rtx_costs): Set proper rtx cost for ashl3_mask... X-Git-Tag: releases/gcc-4.6.4~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b3b7eb9b5e827bffabaa5fbfc19b71f3cae3189;p=thirdparty%2Fgcc.git i386.c (ix86_rtx_costs): Set proper rtx cost for ashl3_mask... 2013-04-02 Wei Mi * config/i386/i386.c (ix86_rtx_costs): Set proper rtx cost for ashl3_mask, *3_mask and *3_mask in i386.md. From-SVN: r197365 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0ad32d9b3bd8..d87072232313 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2013-04-02 Wei Mi + + * config/i386/i386.c (ix86_rtx_costs): Set proper rtx cost for + ashl3_mask, *3_mask and + *3_mask in i386.md. + 2013-04-01 Wei Mi * config/i386/i386.md (*ashl3_mask): Rewrite as define_insn. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 86804a472a58..c43d3ed57f03 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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; }