[RS6000] cost SLOW_UNALIGNED_ACCESS

* config/rs6000/rs6000.c (rs6000_rtx_costs): Make unaligned mem
	cost more.

From-SVN: r239012
This commit is contained in:
Alan Modra 2016-08-03 10:05:14 +09:30 committed by Alan Modra
parent d1f0a70a12
commit cef58349a0
2 changed files with 10 additions and 0 deletions

View File

@ -1,3 +1,8 @@
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> 2016-08-03 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.md (fix_trunc<mode>si2): Force source operand * config/rs6000/rs6000.md (fix_trunc<mode>si2): Force source operand

View File

@ -34336,11 +34336,16 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code,
case CONST: case CONST:
case HIGH: case HIGH:
case SYMBOL_REF: case SYMBOL_REF:
*total = !speed ? COSTS_N_INSNS (1) + 1 : COSTS_N_INSNS (2);
return true;
case MEM: case MEM:
/* When optimizing for size, MEM should be slightly more expensive /* When optimizing for size, MEM should be slightly more expensive
than generating address, e.g., (plus (reg) (const)). than generating address, e.g., (plus (reg) (const)).
L1 cache latency is about two instructions. */ L1 cache latency is about two instructions. */
*total = !speed ? COSTS_N_INSNS (1) + 1 : COSTS_N_INSNS (2); *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; return true;
case LABEL_REF: case LABEL_REF: