Commit ff3cc569 by Andrew Waterman Committed by Jim Wilson

RISC-V: Increase mult/div cost if not implemented in hardware.

	2018-01-15  Andrew Waterman  <andrew@sifive.com>
	gcc/
	* config/riscv/riscv.c (riscv_rtx_costs) <MULT>: Increase cost if
	!TARGET_MUL.
	<UDIV>: Increase cost if !TARGET_DIV.

From-SVN: r256722
parent 66a366a0
2018-01-15 Andrew Waterman <andrew@sifive.com>
* config/riscv/riscv.c (riscv_rtx_costs) <MULT>: Increase cost if
!TARGET_MUL.
<UDIV>: Increase cost if !TARGET_DIV.
2018-01-15 Segher Boessenkool <segher@kernel.crashing.org> 2018-01-15 Segher Boessenkool <segher@kernel.crashing.org>
* config/rs6000/rs6000.md (define_attr "type"): Remove delayed_cr. * config/rs6000/rs6000.md (define_attr "type"): Remove delayed_cr.
......
...@@ -1615,6 +1615,9 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN ...@@ -1615,6 +1615,9 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN
case MULT: case MULT:
if (float_mode_p) if (float_mode_p)
*total = tune_info->fp_mul[mode == DFmode]; *total = tune_info->fp_mul[mode == DFmode];
else if (!TARGET_MUL)
/* Estimate the cost of a library call. */
*total = COSTS_N_INSNS (speed ? 32 : 6);
else if (GET_MODE_SIZE (mode) > UNITS_PER_WORD) else if (GET_MODE_SIZE (mode) > UNITS_PER_WORD)
*total = 3 * tune_info->int_mul[0] + COSTS_N_INSNS (2); *total = 3 * tune_info->int_mul[0] + COSTS_N_INSNS (2);
else if (!speed) else if (!speed)
...@@ -1635,7 +1638,10 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN ...@@ -1635,7 +1638,10 @@ riscv_rtx_costs (rtx x, machine_mode mode, int outer_code, int opno ATTRIBUTE_UN
case UDIV: case UDIV:
case UMOD: case UMOD:
if (speed) if (!TARGET_DIV)
/* Estimate the cost of a library call. */
*total = COSTS_N_INSNS (speed ? 32 : 6);
else if (speed)
*total = tune_info->int_div[mode == DImode]; *total = tune_info->int_div[mode == DImode];
else else
*total = COSTS_N_INSNS (1); *total = COSTS_N_INSNS (1);
......
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