summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-03 00:35:14 +0000
committeramodra <amodra@138bc75d-0d04-0410-961f-82ee72b054a4>2016-08-03 00:35:14 +0000
commite73779580613a2c4bafae651820c768405cbb610 (patch)
treefe32ca16242d64026f5b1384c7e000a4c3057333
parentd1d05ab7c21ea7d42f9da669564c759f7bf7c58c (diff)
downloadgcc-e73779580613a2c4bafae651820c768405cbb610.tar.gz
[RS6000] cost SLOW_UNALIGNED_ACCESS
* config/rs6000/rs6000.c (rs6000_rtx_costs): Make unaligned mem cost more. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239012 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rs6000/rs6000.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a75f39fdbbb..e8de5b9f605 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2016-08-03 Alan Modra <amodra@gmail.com>
+ * config/rs6000/rs6000.c (rs6000_rtx_costs): Make unaligned mem
+ cost more.
+
+2016-08-03 Alan Modra <amodra@gmail.com>
+
* config/rs6000/rs6000.md (fix_trunc<mode>si2): Force source operand
to a reg. Localize vars.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 5b9aae27681..2ae3e7e6796 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -34336,11 +34336,16 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code,
case CONST:
case HIGH:
case SYMBOL_REF:
+ *total = !speed ? COSTS_N_INSNS (1) + 1 : COSTS_N_INSNS (2);
+ return true;
+
case MEM:
/* When optimizing for size, MEM should be slightly more expensive
than generating address, e.g., (plus (reg) (const)).
L1 cache latency is about two instructions. */
*total = !speed ? COSTS_N_INSNS (1) + 1 : COSTS_N_INSNS (2);
+ if (SLOW_UNALIGNED_ACCESS (mode, MEM_ALIGN (x)))
+ *total += COSTS_N_INSNS (100);
return true;
case LABEL_REF: