target-microblaze: Remove pointer indirection for ld/st addresses
Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
This commit is contained in:
parent
0dc4af5c1a
commit
0a87e691b3
@ -848,7 +848,7 @@ static void dec_imm(DisasContext *dc)
|
|||||||
dc->clear_imm = 0;
|
dc->clear_imm = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void compute_ldst_addr(DisasContext *dc, TCGv_i32 *t)
|
static inline void compute_ldst_addr(DisasContext *dc, TCGv_i32 t)
|
||||||
{
|
{
|
||||||
bool extimm = dc->tb_flags & IMM_FLAG;
|
bool extimm = dc->tb_flags & IMM_FLAG;
|
||||||
/* Should be set to true if r1 is used by loadstores. */
|
/* Should be set to true if r1 is used by loadstores. */
|
||||||
@ -863,10 +863,10 @@ static inline void compute_ldst_addr(DisasContext *dc, TCGv_i32 *t)
|
|||||||
if (!dc->type_b) {
|
if (!dc->type_b) {
|
||||||
/* If any of the regs is r0, set t to the value of the other reg. */
|
/* If any of the regs is r0, set t to the value of the other reg. */
|
||||||
if (dc->ra == 0) {
|
if (dc->ra == 0) {
|
||||||
tcg_gen_mov_i32(*t, cpu_R[dc->rb]);
|
tcg_gen_mov_i32(t, cpu_R[dc->rb]);
|
||||||
return;
|
return;
|
||||||
} else if (dc->rb == 0) {
|
} else if (dc->rb == 0) {
|
||||||
tcg_gen_mov_i32(*t, cpu_R[dc->ra]);
|
tcg_gen_mov_i32(t, cpu_R[dc->ra]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -874,27 +874,27 @@ static inline void compute_ldst_addr(DisasContext *dc, TCGv_i32 *t)
|
|||||||
stackprot = true;
|
stackprot = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
tcg_gen_add_i32(*t, cpu_R[dc->ra], cpu_R[dc->rb]);
|
tcg_gen_add_i32(t, cpu_R[dc->ra], cpu_R[dc->rb]);
|
||||||
|
|
||||||
if (stackprot) {
|
if (stackprot) {
|
||||||
gen_helper_stackprot(cpu_env, *t);
|
gen_helper_stackprot(cpu_env, t);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* Immediate. */
|
/* Immediate. */
|
||||||
if (!extimm) {
|
if (!extimm) {
|
||||||
if (dc->imm == 0) {
|
if (dc->imm == 0) {
|
||||||
tcg_gen_mov_i32(*t, cpu_R[dc->ra]);
|
tcg_gen_mov_i32(t, cpu_R[dc->ra]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tcg_gen_movi_i32(*t, (int32_t)((int16_t)dc->imm));
|
tcg_gen_movi_i32(t, (int32_t)((int16_t)dc->imm));
|
||||||
tcg_gen_add_i32(*t, cpu_R[dc->ra], *t);
|
tcg_gen_add_i32(t, cpu_R[dc->ra], t);
|
||||||
} else {
|
} else {
|
||||||
tcg_gen_add_i32(*t, cpu_R[dc->ra], *(dec_alu_op_b(dc)));
|
tcg_gen_add_i32(t, cpu_R[dc->ra], *(dec_alu_op_b(dc)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stackprot) {
|
if (stackprot) {
|
||||||
gen_helper_stackprot(cpu_env, *t);
|
gen_helper_stackprot(cpu_env, t);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -929,7 +929,7 @@ static void dec_load(DisasContext *dc)
|
|||||||
|
|
||||||
t_sync_flags(dc);
|
t_sync_flags(dc);
|
||||||
addr = tcg_temp_new_i32();
|
addr = tcg_temp_new_i32();
|
||||||
compute_ldst_addr(dc, &addr);
|
compute_ldst_addr(dc, addr);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When doing reverse accesses we need to do two things.
|
* When doing reverse accesses we need to do two things.
|
||||||
@ -1041,7 +1041,7 @@ static void dec_store(DisasContext *dc)
|
|||||||
sync_jmpstate(dc);
|
sync_jmpstate(dc);
|
||||||
/* SWX needs a temp_local. */
|
/* SWX needs a temp_local. */
|
||||||
addr = ex ? tcg_temp_local_new_i32() : tcg_temp_new_i32();
|
addr = ex ? tcg_temp_local_new_i32() : tcg_temp_new_i32();
|
||||||
compute_ldst_addr(dc, &addr);
|
compute_ldst_addr(dc, addr);
|
||||||
|
|
||||||
if (ex) { /* swx */
|
if (ex) { /* swx */
|
||||||
TCGv_i32 tval;
|
TCGv_i32 tval;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user