Commit 19c93809 by Kito Cheng Committed by Chung-Ju Wu

[NDS32] Rewrite cost model.

gcc/
	* config/nds32/nds32-cost.c (rtx_cost_model_t): New structure.
	(insn_size_16bit, insn_size_32bit): New variables for cost evaluation.
	(nds32_rtx_costs_impl): Simplify.
	(nds32_address_cost_impl): Simplify.
	(nds32_init_rtx_costs): New function.
	(nds32_rtx_costs_speed_prefer): Likewise.
	(nds32_rtx_costs_size_prefer): Likewise.
	(nds32_address_cost_speed_prefer): Likewise.
	(nds32_address_cost_speed_fwprop): Likewise.
	(nds32_address_cost_size_prefer): Likewise.
	* config/nds32/nds32-protos.h (nds32_init_rtx_costs): Declare.
	* config/nds32/nds32.c (nds32_option_override): Use
	nds32_init_rtx_costs function.

Co-Authored-By: Chung-Ju Wu <jasonwucj@gmail.com>

From-SVN: r260411
parent b5535ac2
2018-05-20 Kito Cheng <kito.cheng@gmail.com>
Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32-cost.c (rtx_cost_model_t): New structure.
(insn_size_16bit, insn_size_32bit): New variables for cost evaluation.
(nds32_rtx_costs_impl): Simplify.
(nds32_address_cost_impl): Simplify.
(nds32_init_rtx_costs): New function.
(nds32_rtx_costs_speed_prefer): Likewise.
(nds32_rtx_costs_size_prefer): Likewise.
(nds32_address_cost_speed_prefer): Likewise.
(nds32_address_cost_speed_fwprop): Likewise.
(nds32_address_cost_size_prefer): Likewise.
* config/nds32/nds32-protos.h (nds32_init_rtx_costs): Declare.
* config/nds32/nds32.c (nds32_option_override): Use
nds32_init_rtx_costs function.
2018-05-20 Chung-Ju Wu <jasonwucj@gmail.com> 2018-05-20 Chung-Ju Wu <jasonwucj@gmail.com>
* config/nds32/nds32.c (nds32_asm_file_start): Output pipeline model. * config/nds32/nds32.c (nds32_asm_file_start): Output pipeline model.
......
...@@ -311,6 +311,7 @@ extern bool nds32_isr_function_p (tree); ...@@ -311,6 +311,7 @@ extern bool nds32_isr_function_p (tree);
/* Auxiliary functions for cost calculation. */ /* Auxiliary functions for cost calculation. */
extern void nds32_init_rtx_costs (void);
extern bool nds32_rtx_costs_impl (rtx, machine_mode, int, int, int *, bool); extern bool nds32_rtx_costs_impl (rtx, machine_mode, int, int, int *, bool);
extern int nds32_address_cost_impl (rtx, machine_mode, addr_space_t, bool); extern int nds32_address_cost_impl (rtx, machine_mode, addr_space_t, bool);
......
...@@ -4096,6 +4096,7 @@ nds32_option_override (void) ...@@ -4096,6 +4096,7 @@ nds32_option_override (void)
"must be enable '-mext-fpu-sp' or '-mext-fpu-dp'"); "must be enable '-mext-fpu-sp' or '-mext-fpu-dp'");
} }
nds32_init_rtx_costs ();
nds32_register_passes (); nds32_register_passes ();
} }
......
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