summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJohannes Bucher <johannes.bucher2@student.kit.edu>2019-06-07 17:55:50 +0200
committerJohannes Bucher <johannes.bucher2@student.kit.edu>2019-06-11 16:34:58 +0200
commitdeef39158f6e8bf329ab524766cbc397785baace (patch)
treea6c79f9ba725f328338f52a31ca9b123efeec3d5
parent3115f120a9a6e11e2a152af65d6e1e1943d68d33 (diff)
riscv: rename register s0 -> fp
fp is an alternative ABI name for register s0
-rw-r--r--ir/be/riscv/riscv_bearch.c10
-rw-r--r--ir/be/riscv/riscv_cconv.c2
-rw-r--r--ir/be/riscv/riscv_spec.pl2
-rw-r--r--ir/be/riscv/riscv_transform.c6
4 files changed, 10 insertions, 10 deletions
diff --git a/ir/be/riscv/riscv_bearch.c b/ir/be/riscv/riscv_bearch.c
index 4f36823..edb78f4 100644
--- a/ir/be/riscv/riscv_bearch.c
+++ b/ir/be/riscv/riscv_bearch.c
@@ -183,7 +183,7 @@ static void riscv_introduce_prologue(ir_graph *const irg, unsigned const size, b
ir_node *const start = get_irg_start(irg);
ir_node *const block = get_nodes_block(start);
ir_node *const start_sp = be_get_Start_proj(irg, &riscv_registers[REG_SP]);
- ir_node *const start_fp = be_get_Start_proj(irg, &riscv_registers[REG_S0]);
+ ir_node *const start_fp = be_get_Start_proj(irg, &riscv_registers[REG_FP]);
if (!omit_fp) {
ir_node *const mem = get_irg_initial_mem(irg);
@@ -223,7 +223,7 @@ static void riscv_introduce_prologue(ir_graph *const irg, unsigned const size, b
/* set current fp */
ir_node *const curr_fp = be_new_Copy(block, add);
- arch_set_irn_register(curr_fp, &riscv_registers[REG_S0]);
+ arch_set_irn_register(curr_fp, &riscv_registers[REG_FP]);
sched_add_after(store_fp, curr_fp);
edges_reroute_except(start_fp, curr_fp, store_fp);
} else {
@@ -236,7 +236,7 @@ static void riscv_introduce_prologue(ir_graph *const irg, unsigned const size, b
ir_node *const curr_fp = new_bd_riscv_addi(NULL, block, inc_sp, NULL, aligned);
sched_add_after(store_fp, curr_fp);
edges_reroute_except(start_fp, curr_fp, store_fp);
- arch_set_irn_register(curr_fp, &riscv_registers[REG_S0]);
+ arch_set_irn_register(curr_fp, &riscv_registers[REG_FP]);
}
be_keep_if_unused(inc_sp);
@@ -251,7 +251,7 @@ static void riscv_introduce_epilogue(ir_node *const ret, unsigned const size, bo
{
ir_node *const block = get_nodes_block(ret);
if (!omit_fp) {
- int const n_fp = be_get_input_pos_for_req(ret, &riscv_single_reg_req_gp_s0);
+ int const n_fp = be_get_input_pos_for_req(ret, &riscv_single_reg_req_gp_fp);
ir_node *curr_fp = get_irn_n(ret, n_fp);
ir_node *curr_mem = get_irn_n(ret, n_riscv_ret_mem);
@@ -268,7 +268,7 @@ static void riscv_introduce_epilogue(ir_node *const ret, unsigned const size, bo
/* set fp to old fp */
ir_node *const restored_fp = be_new_Copy(block, old_fp);
- arch_set_irn_register(restored_fp, &riscv_registers[REG_S0]);
+ arch_set_irn_register(restored_fp, &riscv_registers[REG_FP]);
sched_add_before(ret, restored_fp);
set_irn_n(ret, n_fp, restored_fp);
diff --git a/ir/be/riscv/riscv_cconv.c b/ir/be/riscv/riscv_cconv.c
index fea096c..2cb74cf 100644
--- a/ir/be/riscv/riscv_cconv.c
+++ b/ir/be/riscv/riscv_cconv.c
@@ -104,7 +104,7 @@ void riscv_determine_calling_convention(riscv_calling_convention_t *const cconv,
if (irg != NULL) {
be_irg_t *birg = be_birg_from_irg(irg);
if (!omit_fp)
- rbitset_clear(birg->allocatable_regs, REG_S0); // s0 = frame pointer
+ rbitset_clear(birg->allocatable_regs, REG_FP);
}
cconv->omit_fp = omit_fp;
}
diff --git a/ir/be/riscv/riscv_spec.pl b/ir/be/riscv/riscv_spec.pl
index 1a0ff7d..6e1a92b 100644
--- a/ir/be/riscv/riscv_spec.pl
+++ b/ir/be/riscv/riscv_spec.pl
@@ -17,7 +17,7 @@ my $mode_gp = "mode_Iu";
{ name => "t0", encoding => 5 },
{ name => "t1", encoding => 6 },
{ name => "t2", encoding => 7 },
- { name => "s0", encoding => 8 },
+ { name => "fp", encoding => 8 },
{ name => "s1", encoding => 9 },
{ name => "a0", encoding => 10 },
{ name => "a1", encoding => 11 },
diff --git a/ir/be/riscv/riscv_transform.c b/ir/be/riscv/riscv_transform.c
index 7502fbd..86b9f7e 100644
--- a/ir/be/riscv/riscv_transform.c
+++ b/ir/be/riscv/riscv_transform.c
@@ -26,7 +26,7 @@ static const unsigned ignore_regs[] = {
};
static unsigned const callee_saves[] = {
- REG_S0,
+ REG_FP,
REG_S1,
REG_S2,
REG_S3,
@@ -65,7 +65,7 @@ static ir_node *get_Start_sp(ir_graph *const irg)
static ir_node *get_Start_fp(ir_graph *const irg)
{
- return be_get_Start_proj(irg, &riscv_registers[REG_S0]);
+ return be_get_Start_proj(irg, &riscv_registers[REG_FP]);
}
ir_node *get_Start_zero(ir_graph *const irg)
@@ -1080,7 +1080,7 @@ static ir_node *gen_Start(ir_node *const node)
outs[reg->global_index] = BE_START_REG;
}
if (!cur_cconv.omit_fp)
- outs[REG_S0] = BE_START_IGNORE;
+ outs[REG_FP] = BE_START_IGNORE;
return be_new_Start(irg, outs);
}