Commit cef58349 by Alan Modra Committed by Alan Modra

[RS6000] cost SLOW_UNALIGNED_ACCESS

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

From-SVN: r239012
parent d1f0a70a
2016-08-03 Alan Modra <amodra@gmail.com> 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 * config/rs6000/rs6000.md (fix_trunc<mode>si2): Force source operand
to a reg. Localize vars. to a reg. Localize vars.
......
...@@ -34336,11 +34336,16 @@ rs6000_rtx_costs (rtx x, machine_mode mode, int outer_code, ...@@ -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:
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment