aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEvgeny Stupachenko <evstupac@gmail.com>2014-04-17 07:47:37 +0000
committerKirill Yukhin <kyukhin@gcc.gnu.org>2014-04-17 07:47:37 +0000
commit170c1776c45f875d346519a06514d510b0905fa8 (patch)
treeab64c63326f988f34afd2f448449b18d1890b461 /gcc
parenta4ef7f3e579651f4007cdadf0d7c2a1c25706201 (diff)
downloadgcc-170c1776c45f875d346519a06514d510b0905fa8.zip
gcc-170c1776c45f875d346519a06514d510b0905fa8.tar.gz
gcc-170c1776c45f875d346519a06514d510b0905fa8.tar.bz2
i386.c (x86_add_stmt_cost): Fix vector cost model for Silvermont.
gcc/ * config/i386/i386.c (x86_add_stmt_cost): Fix vector cost model for Silvermont. From-SVN: r209466
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/i386/i386.c13
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c6fa5c0..320e15a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2014-04-17 Evgeny Stupachenko <evstupac@gmail.com>
+ * config/i386/i386.c (x86_add_stmt_cost): Fix vector cost model for
+ Silvermont.
+
+2014-04-17 Evgeny Stupachenko <evstupac@gmail.com>
+
* config/i386/x86-tune.def (TARGET_SLOW_PSHUFB): New tune definition.
* config/i386/i386.h (TARGET_SLOW_PSHUFB): New tune flag.
* config/i386/i386.c (expand_vec_perm_even_odd_1): Avoid byte shuffles
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 0ae3cda..88142a8 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -81,6 +81,7 @@ along with GCC; see the file COPYING3. If not see
#include "context.h"
#include "pass_manager.h"
#include "target-globals.h"
+#include "tree-vectorizer.h"
static rtx legitimize_dllimport_symbol (rtx, bool);
static rtx legitimize_pe_coff_extern_decl (rtx, bool);
@@ -46329,6 +46330,18 @@ ix86_add_stmt_cost (void *data, int count, enum vect_cost_for_stmt kind,
count *= 50; /* FIXME. */
retval = (unsigned) (count * stmt_cost);
+
+ /* We need to multiply all vector stmt cost by 1.7 (estimated cost)
+ for Silvermont as it has out of order integer pipeline and can execute
+ 2 scalar instruction per tick, but has in order SIMD pipeline. */
+ if (TARGET_SILVERMONT || TARGET_INTEL)
+ if (stmt_info && stmt_info->stmt)
+ {
+ tree lhs_op = gimple_get_lhs (stmt_info->stmt);
+ if (lhs_op && TREE_CODE (TREE_TYPE (lhs_op)) == INTEGER_TYPE)
+ retval = (retval * 17) / 10;
+ }
+
cost[where] += retval;
return retval;