diff options
author | Richard Henderson <rth@redhat.com> | 2012-06-26 20:20:08 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2012-06-26 20:20:08 -0700 |
commit | a247af8371ad9ad4e244cf664ed33ca7d945b768 (patch) | |
tree | a9c63a4b7197e02e38966e6ba619cc7ec2083e7c /gcc | |
parent | 87b78516208e45cacb666e5ce824417438456911 (diff) | |
download | gcc-a247af8371ad9ad4e244cf664ed33ca7d945b768.zip gcc-a247af8371ad9ad4e244cf664ed33ca7d945b768.tar.gz gcc-a247af8371ad9ad4e244cf664ed33ca7d945b768.tar.bz2 |
i386: Correct costs on CONST_DOUBLE and CONST_VECTOR
We were always falling through to the memory default.
Also use standard_sse_constant_p on CONST_VECTOR.
* config/i386/i386.c (ix86_rtx_costs): Use standard_sse_constant_p
and don't fall thru from standard_80387_constant_p to the memory
fallback,
From-SVN: r189007
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 48 |
2 files changed, 37 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2eb5259..1d98b79 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2012-06-26 Richard Henderson <rth@redhat.com> + * config/i386/i386.c (ix86_rtx_costs): Use standard_sse_constant_p + and don't fall thru from standard_80387_constant_p to the memory + fallback, + +2012-06-26 Richard Henderson <rth@redhat.com> + * config/i386/i386.c (bdesc_args): Update. Change IX86_BUILTIN_VEC_WIDEN_SMUL_ODD_V4SI to OPTION_MASK_ISA_SSE2. (IX86_BUILTIN_VEC_WIDEN_SMUL_EVEN_V4SI): New. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index b96fc6e..edfc649 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -32102,24 +32102,38 @@ ix86_rtx_costs (rtx x, int code_i, int outer_code_i, int opno, int *total, case CONST_DOUBLE: if (mode == VOIDmode) - *total = 0; - else - switch (standard_80387_constant_p (x)) - { - case 1: /* 0.0 */ - *total = 1; - break; - default: /* Other constants */ - *total = 2; - break; - case 0: - case -1: - break; - } - /* FALLTHRU */ - + { + *total = 0; + return true; + } + switch (standard_80387_constant_p (x)) + { + case 1: /* 0.0 */ + *total = 1; + return true; + default: /* Other constants */ + *total = 2; + return true; + case 0: + case -1: + break; + } + if (SSE_FLOAT_MODE_P (mode)) + { case CONST_VECTOR: - /* Start with (MEM (SYMBOL_REF)), since that's where + switch (standard_sse_constant_p (x)) + { + case 0: + break; + case 1: /* 0: xor eliminates false dependency */ + *total = 0; + return true; + default: /* -1: cmp contains false dependency */ + *total = 1; + return true; + } + } + /* Fall back to (MEM (SYMBOL_REF)), since that's where it'll probably end up. Add a penalty for size. */ *total = (COSTS_N_INSNS (1) + (flag_pic != 0 && !TARGET_64BIT) |