aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/nds32/nds32.c24
2 files changed, 28 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 63e5c66..d76ff7d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,6 +1,12 @@
2018-05-20 Kito Cheng <kito.cheng@gmail.com>
Chung-Ju Wu <jasonwucj@gmail.com>
+ * config/nds32/nds32.c (nds32_register_move_cost): Take garywolf cpu
+ into consideration.
+
+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.
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index ac67ba4..649e6f4 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -3005,13 +3005,33 @@ nds32_canonicalize_comparison (int *code,
/* Describing Relative Costs of Operations. */
static int
-nds32_register_move_cost (machine_mode mode ATTRIBUTE_UNUSED,
+nds32_register_move_cost (machine_mode mode,
reg_class_t from,
reg_class_t to)
{
+ /* In garywolf cpu, FPR to GPR is chaper than other cpu. */
+ if (TARGET_PIPELINE_GRAYWOLF)
+ {
+ if (GET_MODE_SIZE (mode) == 8)
+ {
+ /* DPR to GPR. */
+ if (from == FP_REGS && to != FP_REGS)
+ return 3;
+ /* GPR to DPR. */
+ if (from != FP_REGS && to == FP_REGS)
+ return 2;
+ }
+ else
+ {
+ if ((from == FP_REGS && to != FP_REGS)
+ || (from != FP_REGS && to == FP_REGS))
+ return 2;
+ }
+ }
+
if ((from == FP_REGS && to != FP_REGS)
|| (from != FP_REGS && to == FP_REGS))
- return 9;
+ return 3;
else if (from == HIGH_REGS || to == HIGH_REGS)
return optimize_size ? 6 : 2;
else