mirror of
https://github.com/qemu/qemu.git
synced 2024-12-15 15:33:29 +08:00
target/cris: Drop tcg_temp_free
Translators are no longer required to free tcg temporaries. Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
7932f23260
commit
2a215577b2
@ -178,7 +178,6 @@ static const int preg_sizes[] = {
|
|||||||
do { \
|
do { \
|
||||||
TCGv tc = tcg_const_tl(c); \
|
TCGv tc = tcg_const_tl(c); \
|
||||||
t_gen_mov_env_TN(member, tc); \
|
t_gen_mov_env_TN(member, tc); \
|
||||||
tcg_temp_free(tc); \
|
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
static inline void t_gen_mov_TN_preg(TCGv tn, int r)
|
static inline void t_gen_mov_TN_preg(TCGv tn, int r)
|
||||||
@ -271,7 +270,6 @@ static inline void t_gen_raise_exception(uint32_t index)
|
|||||||
{
|
{
|
||||||
TCGv_i32 tmp = tcg_const_i32(index);
|
TCGv_i32 tmp = tcg_const_i32(index);
|
||||||
gen_helper_raise_exception(cpu_env, tmp);
|
gen_helper_raise_exception(cpu_env, tmp);
|
||||||
tcg_temp_free_i32(tmp);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void t_gen_lsl(TCGv d, TCGv a, TCGv b)
|
static void t_gen_lsl(TCGv d, TCGv a, TCGv b)
|
||||||
@ -286,8 +284,6 @@ static void t_gen_lsl(TCGv d, TCGv a, TCGv b)
|
|||||||
tcg_gen_sar_tl(t0, t0, t_31);
|
tcg_gen_sar_tl(t0, t0, t_31);
|
||||||
tcg_gen_and_tl(t0, t0, d);
|
tcg_gen_and_tl(t0, t0, d);
|
||||||
tcg_gen_xor_tl(d, d, t0);
|
tcg_gen_xor_tl(d, d, t0);
|
||||||
tcg_temp_free(t0);
|
|
||||||
tcg_temp_free(t_31);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void t_gen_lsr(TCGv d, TCGv a, TCGv b)
|
static void t_gen_lsr(TCGv d, TCGv a, TCGv b)
|
||||||
@ -303,8 +299,6 @@ static void t_gen_lsr(TCGv d, TCGv a, TCGv b)
|
|||||||
tcg_gen_sar_tl(t0, t0, t_31);
|
tcg_gen_sar_tl(t0, t0, t_31);
|
||||||
tcg_gen_and_tl(t0, t0, d);
|
tcg_gen_and_tl(t0, t0, d);
|
||||||
tcg_gen_xor_tl(d, d, t0);
|
tcg_gen_xor_tl(d, d, t0);
|
||||||
tcg_temp_free(t0);
|
|
||||||
tcg_temp_free(t_31);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void t_gen_asr(TCGv d, TCGv a, TCGv b)
|
static void t_gen_asr(TCGv d, TCGv a, TCGv b)
|
||||||
@ -319,8 +313,6 @@ static void t_gen_asr(TCGv d, TCGv a, TCGv b)
|
|||||||
tcg_gen_sub_tl(t0, t_31, b);
|
tcg_gen_sub_tl(t0, t_31, b);
|
||||||
tcg_gen_sar_tl(t0, t0, t_31);
|
tcg_gen_sar_tl(t0, t0, t_31);
|
||||||
tcg_gen_or_tl(d, d, t0);
|
tcg_gen_or_tl(d, d, t0);
|
||||||
tcg_temp_free(t0);
|
|
||||||
tcg_temp_free(t_31);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void t_gen_cris_dstep(TCGv d, TCGv a, TCGv b)
|
static void t_gen_cris_dstep(TCGv d, TCGv a, TCGv b)
|
||||||
@ -335,7 +327,6 @@ static void t_gen_cris_dstep(TCGv d, TCGv a, TCGv b)
|
|||||||
tcg_gen_shli_tl(d, a, 1);
|
tcg_gen_shli_tl(d, a, 1);
|
||||||
tcg_gen_sub_tl(t, d, b);
|
tcg_gen_sub_tl(t, d, b);
|
||||||
tcg_gen_movcond_tl(TCG_COND_GEU, d, d, b, t, d);
|
tcg_gen_movcond_tl(TCG_COND_GEU, d, d, b, t, d);
|
||||||
tcg_temp_free(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void t_gen_cris_mstep(TCGv d, TCGv a, TCGv b, TCGv ccs)
|
static void t_gen_cris_mstep(TCGv d, TCGv a, TCGv b, TCGv ccs)
|
||||||
@ -353,7 +344,6 @@ static void t_gen_cris_mstep(TCGv d, TCGv a, TCGv b, TCGv ccs)
|
|||||||
tcg_gen_sari_tl(t, t, 31);
|
tcg_gen_sari_tl(t, t, 31);
|
||||||
tcg_gen_and_tl(t, t, b);
|
tcg_gen_and_tl(t, t, b);
|
||||||
tcg_gen_add_tl(d, d, t);
|
tcg_gen_add_tl(d, d, t);
|
||||||
tcg_temp_free(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Extended arithmetics on CRIS. */
|
/* Extended arithmetics on CRIS. */
|
||||||
@ -369,7 +359,6 @@ static inline void t_gen_add_flag(TCGv d, int flag)
|
|||||||
tcg_gen_shri_tl(c, c, flag);
|
tcg_gen_shri_tl(c, c, flag);
|
||||||
}
|
}
|
||||||
tcg_gen_add_tl(d, d, c);
|
tcg_gen_add_tl(d, d, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void t_gen_addx_carry(DisasContext *dc, TCGv d)
|
static inline void t_gen_addx_carry(DisasContext *dc, TCGv d)
|
||||||
@ -381,7 +370,6 @@ static inline void t_gen_addx_carry(DisasContext *dc, TCGv d)
|
|||||||
/* C flag is already at bit 0. */
|
/* C flag is already at bit 0. */
|
||||||
tcg_gen_andi_tl(c, c, C_FLAG);
|
tcg_gen_andi_tl(c, c, C_FLAG);
|
||||||
tcg_gen_add_tl(d, d, c);
|
tcg_gen_add_tl(d, d, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -394,7 +382,6 @@ static inline void t_gen_subx_carry(DisasContext *dc, TCGv d)
|
|||||||
/* C flag is already at bit 0. */
|
/* C flag is already at bit 0. */
|
||||||
tcg_gen_andi_tl(c, c, C_FLAG);
|
tcg_gen_andi_tl(c, c, C_FLAG);
|
||||||
tcg_gen_sub_tl(d, d, c);
|
tcg_gen_sub_tl(d, d, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -414,8 +401,6 @@ static inline void t_gen_swapb(TCGv d, TCGv s)
|
|||||||
tcg_gen_shri_tl(t, org_s, 8);
|
tcg_gen_shri_tl(t, org_s, 8);
|
||||||
tcg_gen_andi_tl(t, t, 0x00ff00ff);
|
tcg_gen_andi_tl(t, t, 0x00ff00ff);
|
||||||
tcg_gen_or_tl(d, d, t);
|
tcg_gen_or_tl(d, d, t);
|
||||||
tcg_temp_free(t);
|
|
||||||
tcg_temp_free(org_s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Swap the halfwords of the s operand. */
|
/* Swap the halfwords of the s operand. */
|
||||||
@ -428,7 +413,6 @@ static inline void t_gen_swapw(TCGv d, TCGv s)
|
|||||||
tcg_gen_shli_tl(d, t, 16);
|
tcg_gen_shli_tl(d, t, 16);
|
||||||
tcg_gen_shri_tl(t, t, 16);
|
tcg_gen_shri_tl(t, t, 16);
|
||||||
tcg_gen_or_tl(d, d, t);
|
tcg_gen_or_tl(d, d, t);
|
||||||
tcg_temp_free(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reverse the within each byte.
|
/* Reverse the within each byte.
|
||||||
@ -475,8 +459,6 @@ static void t_gen_swapr(TCGv d, TCGv s)
|
|||||||
tcg_gen_andi_tl(t, t, bitrev[i].mask);
|
tcg_gen_andi_tl(t, t, bitrev[i].mask);
|
||||||
tcg_gen_or_tl(d, d, t);
|
tcg_gen_or_tl(d, d, t);
|
||||||
}
|
}
|
||||||
tcg_temp_free(t);
|
|
||||||
tcg_temp_free(org_s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool use_goto_tb(DisasContext *dc, target_ulong dest)
|
static bool use_goto_tb(DisasContext *dc, target_ulong dest)
|
||||||
@ -778,9 +760,6 @@ static void cris_alu(DisasContext *dc, int op,
|
|||||||
}
|
}
|
||||||
tcg_gen_or_tl(d, d, tmp);
|
tcg_gen_or_tl(d, d, tmp);
|
||||||
}
|
}
|
||||||
if (tmp != d) {
|
|
||||||
tcg_temp_free(tmp);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int arith_cc(DisasContext *dc)
|
static int arith_cc(DisasContext *dc)
|
||||||
@ -919,8 +898,6 @@ static void gen_tst_cc (DisasContext *dc, TCGv cc, int cond)
|
|||||||
tcg_gen_shli_tl(cc, tmp, 2);
|
tcg_gen_shli_tl(cc, tmp, 2);
|
||||||
tcg_gen_and_tl(cc, tmp, cc);
|
tcg_gen_and_tl(cc, tmp, cc);
|
||||||
tcg_gen_andi_tl(cc, cc, Z_FLAG);
|
tcg_gen_andi_tl(cc, cc, Z_FLAG);
|
||||||
|
|
||||||
tcg_temp_free(tmp);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CC_GE:
|
case CC_GE:
|
||||||
@ -959,9 +936,6 @@ static void gen_tst_cc (DisasContext *dc, TCGv cc, int cond)
|
|||||||
tcg_gen_xori_tl(n, n, 2);
|
tcg_gen_xori_tl(n, n, 2);
|
||||||
tcg_gen_and_tl(cc, z, n);
|
tcg_gen_and_tl(cc, z, n);
|
||||||
tcg_gen_andi_tl(cc, cc, 2);
|
tcg_gen_andi_tl(cc, cc, 2);
|
||||||
|
|
||||||
tcg_temp_free(n);
|
|
||||||
tcg_temp_free(z);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CC_LE:
|
case CC_LE:
|
||||||
@ -980,9 +954,6 @@ static void gen_tst_cc (DisasContext *dc, TCGv cc, int cond)
|
|||||||
tcg_gen_xor_tl(n, n, cpu_PR[PR_CCS]);
|
tcg_gen_xor_tl(n, n, cpu_PR[PR_CCS]);
|
||||||
tcg_gen_or_tl(cc, z, n);
|
tcg_gen_or_tl(cc, z, n);
|
||||||
tcg_gen_andi_tl(cc, cc, 2);
|
tcg_gen_andi_tl(cc, cc, 2);
|
||||||
|
|
||||||
tcg_temp_free(n);
|
|
||||||
tcg_temp_free(z);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case CC_P:
|
case CC_P:
|
||||||
@ -1282,7 +1253,6 @@ static int dec_addq(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(dc->op1);
|
c = tcg_const_tl(dc->op1);
|
||||||
cris_alu(dc, CC_OP_ADD,
|
cris_alu(dc, CC_OP_ADD,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
static int dec_moveq(CPUCRISState *env, DisasContext *dc)
|
static int dec_moveq(CPUCRISState *env, DisasContext *dc)
|
||||||
@ -1307,7 +1277,6 @@ static int dec_subq(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(dc->op1);
|
c = tcg_const_tl(dc->op1);
|
||||||
cris_alu(dc, CC_OP_SUB,
|
cris_alu(dc, CC_OP_SUB,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
static int dec_cmpq(CPUCRISState *env, DisasContext *dc)
|
static int dec_cmpq(CPUCRISState *env, DisasContext *dc)
|
||||||
@ -1323,7 +1292,6 @@ static int dec_cmpq(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(imm);
|
c = tcg_const_tl(imm);
|
||||||
cris_alu(dc, CC_OP_CMP,
|
cris_alu(dc, CC_OP_CMP,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
static int dec_andq(CPUCRISState *env, DisasContext *dc)
|
static int dec_andq(CPUCRISState *env, DisasContext *dc)
|
||||||
@ -1339,7 +1307,6 @@ static int dec_andq(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(imm);
|
c = tcg_const_tl(imm);
|
||||||
cris_alu(dc, CC_OP_AND,
|
cris_alu(dc, CC_OP_AND,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
static int dec_orq(CPUCRISState *env, DisasContext *dc)
|
static int dec_orq(CPUCRISState *env, DisasContext *dc)
|
||||||
@ -1354,7 +1321,6 @@ static int dec_orq(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(imm);
|
c = tcg_const_tl(imm);
|
||||||
cris_alu(dc, CC_OP_OR,
|
cris_alu(dc, CC_OP_OR,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
static int dec_btstq(CPUCRISState *env, DisasContext *dc)
|
static int dec_btstq(CPUCRISState *env, DisasContext *dc)
|
||||||
@ -1368,7 +1334,6 @@ static int dec_btstq(CPUCRISState *env, DisasContext *dc)
|
|||||||
cris_evaluate_flags(dc);
|
cris_evaluate_flags(dc);
|
||||||
gen_helper_btst(cpu_PR[PR_CCS], cpu_env, cpu_R[dc->op2],
|
gen_helper_btst(cpu_PR[PR_CCS], cpu_env, cpu_R[dc->op2],
|
||||||
c, cpu_PR[PR_CCS]);
|
c, cpu_PR[PR_CCS]);
|
||||||
tcg_temp_free(c);
|
|
||||||
cris_alu(dc, CC_OP_MOVE,
|
cris_alu(dc, CC_OP_MOVE,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], cpu_R[dc->op2], 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], cpu_R[dc->op2], 4);
|
||||||
cris_update_cc_op(dc, CC_OP_FLAGS, 4);
|
cris_update_cc_op(dc, CC_OP_FLAGS, 4);
|
||||||
@ -1437,7 +1402,6 @@ static int dec_move_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
cris_alu(dc, CC_OP_MOVE,
|
cris_alu(dc, CC_OP_MOVE,
|
||||||
cpu_R[dc->op2],
|
cpu_R[dc->op2],
|
||||||
cpu_R[dc->op2], t0, size);
|
cpu_R[dc->op2], t0, size);
|
||||||
tcg_temp_free(t0);
|
|
||||||
}
|
}
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@ -1492,7 +1456,6 @@ static int dec_lz_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
t0 = tcg_temp_new();
|
t0 = tcg_temp_new();
|
||||||
dec_prep_alu_r(dc, dc->op1, dc->op2, 4, 0, cpu_R[dc->op2], t0);
|
dec_prep_alu_r(dc, dc->op1, dc->op2, 4, 0, cpu_R[dc->op2], t0);
|
||||||
cris_alu(dc, CC_OP_LZ, cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
cris_alu(dc, CC_OP_LZ, cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1609,7 +1572,6 @@ static int dec_bound_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
l0 = tcg_temp_new();
|
l0 = tcg_temp_new();
|
||||||
dec_prep_move_r(dc, dc->op1, dc->op2, size, 0, l0);
|
dec_prep_move_r(dc, dc->op1, dc->op2, size, 0, l0);
|
||||||
cris_alu(dc, CC_OP_BOUND, cpu_R[dc->op2], cpu_R[dc->op2], l0, 4);
|
cris_alu(dc, CC_OP_BOUND, cpu_R[dc->op2], cpu_R[dc->op2], l0, 4);
|
||||||
tcg_temp_free(l0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1724,7 +1686,6 @@ static int dec_swap_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
t_gen_swapr(t0, t0);
|
t_gen_swapr(t0, t0);
|
||||||
}
|
}
|
||||||
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->op1], cpu_R[dc->op1], t0, 4);
|
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->op1], cpu_R[dc->op1], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1750,7 +1711,6 @@ static int dec_addi_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
t0 = tcg_temp_new();
|
t0 = tcg_temp_new();
|
||||||
tcg_gen_shli_tl(t0, cpu_R[dc->op2], dc->zzsize);
|
tcg_gen_shli_tl(t0, cpu_R[dc->op2], dc->zzsize);
|
||||||
tcg_gen_add_tl(cpu_R[dc->op1], cpu_R[dc->op1], t0);
|
tcg_gen_add_tl(cpu_R[dc->op1], cpu_R[dc->op1], t0);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1763,7 +1723,6 @@ static int dec_addi_acr(CPUCRISState *env, DisasContext *dc)
|
|||||||
t0 = tcg_temp_new();
|
t0 = tcg_temp_new();
|
||||||
tcg_gen_shli_tl(t0, cpu_R[dc->op2], dc->zzsize);
|
tcg_gen_shli_tl(t0, cpu_R[dc->op2], dc->zzsize);
|
||||||
tcg_gen_add_tl(cpu_R[R_ACR], cpu_R[dc->op1], t0);
|
tcg_gen_add_tl(cpu_R[R_ACR], cpu_R[dc->op1], t0);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1822,7 +1781,6 @@ static int dec_movu_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
t0 = tcg_temp_new();
|
t0 = tcg_temp_new();
|
||||||
dec_prep_move_r(dc, dc->op1, dc->op2, size, 0, t0);
|
dec_prep_move_r(dc, dc->op1, dc->op2, size, 0, t0);
|
||||||
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1841,7 +1799,6 @@ static int dec_movs_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
t_gen_sext(t0, cpu_R[dc->op1], size);
|
t_gen_sext(t0, cpu_R[dc->op1], size);
|
||||||
cris_alu(dc, CC_OP_MOVE,
|
cris_alu(dc, CC_OP_MOVE,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op1], t0, 4);
|
cpu_R[dc->op2], cpu_R[dc->op1], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1859,7 +1816,6 @@ static int dec_addu_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
/* Size can only be qi or hi. */
|
/* Size can only be qi or hi. */
|
||||||
t_gen_zext(t0, cpu_R[dc->op1], size);
|
t_gen_zext(t0, cpu_R[dc->op1], size);
|
||||||
cris_alu(dc, CC_OP_ADD, cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
cris_alu(dc, CC_OP_ADD, cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1878,7 +1834,6 @@ static int dec_adds_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
t_gen_sext(t0, cpu_R[dc->op1], size);
|
t_gen_sext(t0, cpu_R[dc->op1], size);
|
||||||
cris_alu(dc, CC_OP_ADD,
|
cris_alu(dc, CC_OP_ADD,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1897,7 +1852,6 @@ static int dec_subu_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
t_gen_zext(t0, cpu_R[dc->op1], size);
|
t_gen_zext(t0, cpu_R[dc->op1], size);
|
||||||
cris_alu(dc, CC_OP_SUB,
|
cris_alu(dc, CC_OP_SUB,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1916,7 +1870,6 @@ static int dec_subs_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
t_gen_sext(t0, cpu_R[dc->op1], size);
|
t_gen_sext(t0, cpu_R[dc->op1], size);
|
||||||
cris_alu(dc, CC_OP_SUB,
|
cris_alu(dc, CC_OP_SUB,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
cpu_R[dc->op2], cpu_R[dc->op2], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1996,8 +1949,6 @@ static int dec_move_rs(CPUCRISState *env, DisasContext *dc)
|
|||||||
c2 = tcg_const_tl(dc->op2);
|
c2 = tcg_const_tl(dc->op2);
|
||||||
cris_cc_mask(dc, 0);
|
cris_cc_mask(dc, 0);
|
||||||
gen_helper_movl_sreg_reg(cpu_env, c2, c1);
|
gen_helper_movl_sreg_reg(cpu_env, c2, c1);
|
||||||
tcg_temp_free(c1);
|
|
||||||
tcg_temp_free(c2);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
static int dec_move_sr(CPUCRISState *env, DisasContext *dc)
|
static int dec_move_sr(CPUCRISState *env, DisasContext *dc)
|
||||||
@ -2008,8 +1959,6 @@ static int dec_move_sr(CPUCRISState *env, DisasContext *dc)
|
|||||||
c2 = tcg_const_tl(dc->op2);
|
c2 = tcg_const_tl(dc->op2);
|
||||||
cris_cc_mask(dc, 0);
|
cris_cc_mask(dc, 0);
|
||||||
gen_helper_movl_reg_sreg(cpu_env, c1, c2);
|
gen_helper_movl_reg_sreg(cpu_env, c1, c2);
|
||||||
tcg_temp_free(c1);
|
|
||||||
tcg_temp_free(c2);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2029,7 +1978,6 @@ static int dec_move_rp(CPUCRISState *env, DisasContext *dc)
|
|||||||
tcg_gen_andi_tl(t[0], t[0], 0x39f);
|
tcg_gen_andi_tl(t[0], t[0], 0x39f);
|
||||||
tcg_gen_andi_tl(t[1], cpu_PR[PR_CCS], ~0x39f);
|
tcg_gen_andi_tl(t[1], cpu_PR[PR_CCS], ~0x39f);
|
||||||
tcg_gen_or_tl(t[0], t[1], t[0]);
|
tcg_gen_or_tl(t[0], t[1], t[0]);
|
||||||
tcg_temp_free(t[1]);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
tcg_gen_mov_tl(t[0], cpu_R[dc->op1]);
|
tcg_gen_mov_tl(t[0], cpu_R[dc->op1]);
|
||||||
@ -2040,7 +1988,6 @@ static int dec_move_rp(CPUCRISState *env, DisasContext *dc)
|
|||||||
cris_update_cc_op(dc, CC_OP_FLAGS, 4);
|
cris_update_cc_op(dc, CC_OP_FLAGS, 4);
|
||||||
dc->flags_uptodate = 1;
|
dc->flags_uptodate = 1;
|
||||||
}
|
}
|
||||||
tcg_temp_free(t[0]);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
static int dec_move_pr(CPUCRISState *env, DisasContext *dc)
|
static int dec_move_pr(CPUCRISState *env, DisasContext *dc)
|
||||||
@ -2061,7 +2008,6 @@ static int dec_move_pr(CPUCRISState *env, DisasContext *dc)
|
|||||||
cris_alu(dc, CC_OP_MOVE,
|
cris_alu(dc, CC_OP_MOVE,
|
||||||
cpu_R[dc->op1], cpu_R[dc->op1], t0,
|
cpu_R[dc->op1], cpu_R[dc->op1], t0,
|
||||||
preg_sizes[dc->op2]);
|
preg_sizes[dc->op2]);
|
||||||
tcg_temp_free(t0);
|
|
||||||
}
|
}
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@ -2089,7 +2035,6 @@ static int dec_move_mr(CPUCRISState *env, DisasContext *dc)
|
|||||||
cris_cc_mask(dc, CC_MASK_NZ);
|
cris_cc_mask(dc, CC_MASK_NZ);
|
||||||
cris_alu(dc, CC_OP_MOVE,
|
cris_alu(dc, CC_OP_MOVE,
|
||||||
cpu_R[dc->op2], cpu_R[dc->op2], t0, memsize);
|
cpu_R[dc->op2], cpu_R[dc->op2], t0, memsize);
|
||||||
tcg_temp_free(t0);
|
|
||||||
}
|
}
|
||||||
do_postinc(dc, memsize);
|
do_postinc(dc, memsize);
|
||||||
return insn_len;
|
return insn_len;
|
||||||
@ -2295,7 +2240,6 @@ static int dec_test_m(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(0);
|
c = tcg_const_tl(0);
|
||||||
cris_alu(dc, CC_OP_CMP,
|
cris_alu(dc, CC_OP_CMP,
|
||||||
cpu_R[dc->op2], t[1], c, memsize_zz(dc));
|
cpu_R[dc->op2], t[1], c, memsize_zz(dc));
|
||||||
tcg_temp_free(c);
|
|
||||||
do_postinc(dc, memsize);
|
do_postinc(dc, memsize);
|
||||||
return insn_len;
|
return insn_len;
|
||||||
}
|
}
|
||||||
@ -2371,8 +2315,6 @@ static int dec_bound_m(CPUCRISState *env, DisasContext *dc)
|
|||||||
cris_cc_mask(dc, CC_MASK_NZ);
|
cris_cc_mask(dc, CC_MASK_NZ);
|
||||||
cris_alu(dc, CC_OP_BOUND, cpu_R[dc->op2], l[0], l[1], 4);
|
cris_alu(dc, CC_OP_BOUND, cpu_R[dc->op2], l[0], l[1], 4);
|
||||||
do_postinc(dc, memsize);
|
do_postinc(dc, memsize);
|
||||||
tcg_temp_free(l[0]);
|
|
||||||
tcg_temp_free(l[1]);
|
|
||||||
return insn_len;
|
return insn_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2484,7 +2426,6 @@ static int dec_move_pm(CPUCRISState *env, DisasContext *dc)
|
|||||||
t_gen_mov_TN_preg(t0, dc->op2);
|
t_gen_mov_TN_preg(t0, dc->op2);
|
||||||
cris_flush_cc_state(dc);
|
cris_flush_cc_state(dc);
|
||||||
gen_store(dc, cpu_R[dc->op1], t0, memsize);
|
gen_store(dc, cpu_R[dc->op1], t0, memsize);
|
||||||
tcg_temp_free(t0);
|
|
||||||
|
|
||||||
cris_cc_mask(dc, 0);
|
cris_cc_mask(dc, 0);
|
||||||
if (dc->postinc) {
|
if (dc->postinc) {
|
||||||
@ -2519,17 +2460,14 @@ static int dec_movem_mr(CPUCRISState *env, DisasContext *dc)
|
|||||||
} else {
|
} else {
|
||||||
tmp32 = NULL;
|
tmp32 = NULL;
|
||||||
}
|
}
|
||||||
tcg_temp_free(addr);
|
|
||||||
|
|
||||||
for (i = 0; i < (nr >> 1); i++) {
|
for (i = 0; i < (nr >> 1); i++) {
|
||||||
tcg_gen_extrl_i64_i32(cpu_R[i * 2], tmp[i]);
|
tcg_gen_extrl_i64_i32(cpu_R[i * 2], tmp[i]);
|
||||||
tcg_gen_shri_i64(tmp[i], tmp[i], 32);
|
tcg_gen_shri_i64(tmp[i], tmp[i], 32);
|
||||||
tcg_gen_extrl_i64_i32(cpu_R[i * 2 + 1], tmp[i]);
|
tcg_gen_extrl_i64_i32(cpu_R[i * 2 + 1], tmp[i]);
|
||||||
tcg_temp_free_i64(tmp[i]);
|
|
||||||
}
|
}
|
||||||
if (nr & 1) {
|
if (nr & 1) {
|
||||||
tcg_gen_mov_tl(cpu_R[dc->op2], tmp32);
|
tcg_gen_mov_tl(cpu_R[dc->op2], tmp32);
|
||||||
tcg_temp_free(tmp32);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* writeback the updated pointer value. */
|
/* writeback the updated pointer value. */
|
||||||
@ -2567,8 +2505,6 @@ static int dec_movem_rm(CPUCRISState *env, DisasContext *dc)
|
|||||||
tcg_gen_mov_tl(cpu_R[dc->op1], addr);
|
tcg_gen_mov_tl(cpu_R[dc->op1], addr);
|
||||||
}
|
}
|
||||||
cris_cc_mask(dc, 0);
|
cris_cc_mask(dc, 0);
|
||||||
tcg_temp_free(tmp);
|
|
||||||
tcg_temp_free(addr);
|
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2648,7 +2584,6 @@ static int dec_jas_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
}
|
}
|
||||||
c = tcg_const_tl(dc->pc + 4);
|
c = tcg_const_tl(dc->pc + 4);
|
||||||
t_gen_mov_preg_TN(dc, dc->op2, c);
|
t_gen_mov_preg_TN(dc, dc->op2, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
|
|
||||||
cris_prepare_jmp(dc, JMP_INDIRECT);
|
cris_prepare_jmp(dc, JMP_INDIRECT);
|
||||||
return 2;
|
return 2;
|
||||||
@ -2666,7 +2601,6 @@ static int dec_jas_im(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(dc->pc + 8);
|
c = tcg_const_tl(dc->pc + 8);
|
||||||
/* Store the return address in Pd. */
|
/* Store the return address in Pd. */
|
||||||
t_gen_mov_preg_TN(dc, dc->op2, c);
|
t_gen_mov_preg_TN(dc, dc->op2, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
|
|
||||||
dc->jmp_pc = imm;
|
dc->jmp_pc = imm;
|
||||||
cris_prepare_jmp(dc, JMP_DIRECT);
|
cris_prepare_jmp(dc, JMP_DIRECT);
|
||||||
@ -2685,7 +2619,6 @@ static int dec_jasc_im(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(dc->pc + 8 + 4);
|
c = tcg_const_tl(dc->pc + 8 + 4);
|
||||||
/* Store the return address in Pd. */
|
/* Store the return address in Pd. */
|
||||||
t_gen_mov_preg_TN(dc, dc->op2, c);
|
t_gen_mov_preg_TN(dc, dc->op2, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
|
|
||||||
dc->jmp_pc = imm;
|
dc->jmp_pc = imm;
|
||||||
cris_prepare_jmp(dc, JMP_DIRECT);
|
cris_prepare_jmp(dc, JMP_DIRECT);
|
||||||
@ -2701,7 +2634,6 @@ static int dec_jasc_r(CPUCRISState *env, DisasContext *dc)
|
|||||||
tcg_gen_mov_tl(env_btarget, cpu_R[dc->op1]);
|
tcg_gen_mov_tl(env_btarget, cpu_R[dc->op1]);
|
||||||
c = tcg_const_tl(dc->pc + 4 + 4);
|
c = tcg_const_tl(dc->pc + 4 + 4);
|
||||||
t_gen_mov_preg_TN(dc, dc->op2, c);
|
t_gen_mov_preg_TN(dc, dc->op2, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
cris_prepare_jmp(dc, JMP_INDIRECT);
|
cris_prepare_jmp(dc, JMP_INDIRECT);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
@ -2735,7 +2667,6 @@ static int dec_bas_im(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(dc->pc + 8);
|
c = tcg_const_tl(dc->pc + 8);
|
||||||
/* Store the return address in Pd. */
|
/* Store the return address in Pd. */
|
||||||
t_gen_mov_preg_TN(dc, dc->op2, c);
|
t_gen_mov_preg_TN(dc, dc->op2, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
|
|
||||||
dc->jmp_pc = dc->pc + simm;
|
dc->jmp_pc = dc->pc + simm;
|
||||||
cris_prepare_jmp(dc, JMP_DIRECT);
|
cris_prepare_jmp(dc, JMP_DIRECT);
|
||||||
@ -2753,7 +2684,6 @@ static int dec_basc_im(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(dc->pc + 12);
|
c = tcg_const_tl(dc->pc + 12);
|
||||||
/* Store the return address in Pd. */
|
/* Store the return address in Pd. */
|
||||||
t_gen_mov_preg_TN(dc, dc->op2, c);
|
t_gen_mov_preg_TN(dc, dc->op2, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
|
|
||||||
dc->jmp_pc = dc->pc + simm;
|
dc->jmp_pc = dc->pc + simm;
|
||||||
cris_prepare_jmp(dc, JMP_DIRECT);
|
cris_prepare_jmp(dc, JMP_DIRECT);
|
||||||
|
@ -90,9 +90,6 @@ static void gen_store_v10_conditional(DisasContext *dc, TCGv addr, TCGv val,
|
|||||||
gen_set_label(l1);
|
gen_set_label(l1);
|
||||||
tcg_gen_shri_tl(t1, t1, 1); /* shift F to P position */
|
tcg_gen_shri_tl(t1, t1, 1); /* shift F to P position */
|
||||||
tcg_gen_or_tl(cpu_PR[PR_CCS], cpu_PR[PR_CCS], t1); /*P=F*/
|
tcg_gen_or_tl(cpu_PR[PR_CCS], cpu_PR[PR_CCS], t1); /*P=F*/
|
||||||
tcg_temp_free(t1);
|
|
||||||
tcg_temp_free(tval);
|
|
||||||
tcg_temp_free(taddr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void gen_store_v10(DisasContext *dc, TCGv addr, TCGv val,
|
static void gen_store_v10(DisasContext *dc, TCGv addr, TCGv val,
|
||||||
@ -215,7 +212,6 @@ static int dec10_prep_move_m(CPUCRISState *env, DisasContext *dc,
|
|||||||
else
|
else
|
||||||
t_gen_zext(dst, dst, memsize);
|
t_gen_zext(dst, dst, memsize);
|
||||||
insn_len += crisv10_post_memaddr(dc, memsize);
|
insn_len += crisv10_post_memaddr(dc, memsize);
|
||||||
tcg_temp_free(addr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dc->mode == CRISV10_MODE_INDIRECT && (dc->tb_flags & PFIX_FLAG)) {
|
if (dc->mode == CRISV10_MODE_INDIRECT && (dc->tb_flags & PFIX_FLAG)) {
|
||||||
@ -258,7 +254,6 @@ static unsigned int dec10_quick_imm(DisasContext *dc)
|
|||||||
c = tcg_const_tl(simm);
|
c = tcg_const_tl(simm);
|
||||||
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->dst],
|
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->dst],
|
||||||
cpu_R[dc->dst], c, 4);
|
cpu_R[dc->dst], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_QIMM_CMPQ:
|
case CRISV10_QIMM_CMPQ:
|
||||||
LOG_DIS("cmpq %d, $r%d\n", simm, dc->dst);
|
LOG_DIS("cmpq %d, $r%d\n", simm, dc->dst);
|
||||||
@ -267,7 +262,6 @@ static unsigned int dec10_quick_imm(DisasContext *dc)
|
|||||||
c = tcg_const_tl(simm);
|
c = tcg_const_tl(simm);
|
||||||
cris_alu(dc, CC_OP_CMP, cpu_R[dc->dst],
|
cris_alu(dc, CC_OP_CMP, cpu_R[dc->dst],
|
||||||
cpu_R[dc->dst], c, 4);
|
cpu_R[dc->dst], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_QIMM_ADDQ:
|
case CRISV10_QIMM_ADDQ:
|
||||||
LOG_DIS("addq %d, $r%d\n", imm, dc->dst);
|
LOG_DIS("addq %d, $r%d\n", imm, dc->dst);
|
||||||
@ -276,7 +270,6 @@ static unsigned int dec10_quick_imm(DisasContext *dc)
|
|||||||
c = tcg_const_tl(imm);
|
c = tcg_const_tl(imm);
|
||||||
cris_alu(dc, CC_OP_ADD, cpu_R[dc->dst],
|
cris_alu(dc, CC_OP_ADD, cpu_R[dc->dst],
|
||||||
cpu_R[dc->dst], c, 4);
|
cpu_R[dc->dst], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_QIMM_ANDQ:
|
case CRISV10_QIMM_ANDQ:
|
||||||
LOG_DIS("andq %d, $r%d\n", simm, dc->dst);
|
LOG_DIS("andq %d, $r%d\n", simm, dc->dst);
|
||||||
@ -285,7 +278,6 @@ static unsigned int dec10_quick_imm(DisasContext *dc)
|
|||||||
c = tcg_const_tl(simm);
|
c = tcg_const_tl(simm);
|
||||||
cris_alu(dc, CC_OP_AND, cpu_R[dc->dst],
|
cris_alu(dc, CC_OP_AND, cpu_R[dc->dst],
|
||||||
cpu_R[dc->dst], c, 4);
|
cpu_R[dc->dst], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_QIMM_ASHQ:
|
case CRISV10_QIMM_ASHQ:
|
||||||
LOG_DIS("ashq %d, $r%d\n", simm, dc->dst);
|
LOG_DIS("ashq %d, $r%d\n", simm, dc->dst);
|
||||||
@ -303,7 +295,6 @@ static unsigned int dec10_quick_imm(DisasContext *dc)
|
|||||||
gen_helper_btst(cpu_PR[PR_CCS], cpu_env, cpu_R[dc->dst],
|
gen_helper_btst(cpu_PR[PR_CCS], cpu_env, cpu_R[dc->dst],
|
||||||
c, cpu_PR[PR_CCS]);
|
c, cpu_PR[PR_CCS]);
|
||||||
}
|
}
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_QIMM_LSHQ:
|
case CRISV10_QIMM_LSHQ:
|
||||||
LOG_DIS("lshq %d, $r%d\n", simm, dc->dst);
|
LOG_DIS("lshq %d, $r%d\n", simm, dc->dst);
|
||||||
@ -317,7 +308,6 @@ static unsigned int dec10_quick_imm(DisasContext *dc)
|
|||||||
c = tcg_const_tl(imm);
|
c = tcg_const_tl(imm);
|
||||||
cris_alu(dc, op, cpu_R[dc->dst],
|
cris_alu(dc, op, cpu_R[dc->dst],
|
||||||
cpu_R[dc->dst], c, 4);
|
cpu_R[dc->dst], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_QIMM_SUBQ:
|
case CRISV10_QIMM_SUBQ:
|
||||||
LOG_DIS("subq %d, $r%d\n", imm, dc->dst);
|
LOG_DIS("subq %d, $r%d\n", imm, dc->dst);
|
||||||
@ -326,7 +316,6 @@ static unsigned int dec10_quick_imm(DisasContext *dc)
|
|||||||
c = tcg_const_tl(imm);
|
c = tcg_const_tl(imm);
|
||||||
cris_alu(dc, CC_OP_SUB, cpu_R[dc->dst],
|
cris_alu(dc, CC_OP_SUB, cpu_R[dc->dst],
|
||||||
cpu_R[dc->dst], c, 4);
|
cpu_R[dc->dst], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_QIMM_ORQ:
|
case CRISV10_QIMM_ORQ:
|
||||||
LOG_DIS("andq %d, $r%d\n", simm, dc->dst);
|
LOG_DIS("andq %d, $r%d\n", simm, dc->dst);
|
||||||
@ -335,7 +324,6 @@ static unsigned int dec10_quick_imm(DisasContext *dc)
|
|||||||
c = tcg_const_tl(simm);
|
c = tcg_const_tl(simm);
|
||||||
cris_alu(dc, CC_OP_OR, cpu_R[dc->dst],
|
cris_alu(dc, CC_OP_OR, cpu_R[dc->dst],
|
||||||
cpu_R[dc->dst], c, 4);
|
cpu_R[dc->dst], c, 4);
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CRISV10_QIMM_BCC_R0:
|
case CRISV10_QIMM_BCC_R0:
|
||||||
@ -426,8 +414,6 @@ static void dec10_reg_alu(DisasContext *dc, int op, int size, int sext)
|
|||||||
|
|
||||||
assert(dc->dst != 15);
|
assert(dc->dst != 15);
|
||||||
cris_alu(dc, op, cpu_R[dc->dst], t[0], t[1], size);
|
cris_alu(dc, op, cpu_R[dc->dst], t[0], t[1], size);
|
||||||
tcg_temp_free(t[0]);
|
|
||||||
tcg_temp_free(t[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dec10_reg_bound(DisasContext *dc, int size)
|
static void dec10_reg_bound(DisasContext *dc, int size)
|
||||||
@ -437,7 +423,6 @@ static void dec10_reg_bound(DisasContext *dc, int size)
|
|||||||
t = tcg_temp_new();
|
t = tcg_temp_new();
|
||||||
t_gen_zext(t, cpu_R[dc->src], size);
|
t_gen_zext(t, cpu_R[dc->src], size);
|
||||||
cris_alu(dc, CC_OP_BOUND, cpu_R[dc->dst], cpu_R[dc->dst], t, 4);
|
cris_alu(dc, CC_OP_BOUND, cpu_R[dc->dst], cpu_R[dc->dst], t, 4);
|
||||||
tcg_temp_free(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dec10_reg_mul(DisasContext *dc, int size, int sext)
|
static void dec10_reg_mul(DisasContext *dc, int size, int sext)
|
||||||
@ -451,9 +436,6 @@ static void dec10_reg_mul(DisasContext *dc, int size, int sext)
|
|||||||
t[0], t[1], cpu_R[dc->dst], cpu_R[dc->src]);
|
t[0], t[1], cpu_R[dc->dst], cpu_R[dc->src]);
|
||||||
|
|
||||||
cris_alu(dc, op, cpu_R[dc->dst], t[0], t[1], 4);
|
cris_alu(dc, op, cpu_R[dc->dst], t[0], t[1], 4);
|
||||||
|
|
||||||
tcg_temp_free(t[0]);
|
|
||||||
tcg_temp_free(t[1]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -472,7 +454,6 @@ static void dec10_reg_movs(DisasContext *dc)
|
|||||||
t_gen_zext(t, cpu_R[dc->src], size);
|
t_gen_zext(t, cpu_R[dc->src], size);
|
||||||
|
|
||||||
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->dst], cpu_R[dc->dst], t, 4);
|
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->dst], cpu_R[dc->dst], t, 4);
|
||||||
tcg_temp_free(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dec10_reg_alux(DisasContext *dc, int op)
|
static void dec10_reg_alux(DisasContext *dc, int op)
|
||||||
@ -490,7 +471,6 @@ static void dec10_reg_alux(DisasContext *dc, int op)
|
|||||||
t_gen_zext(t, cpu_R[dc->src], size);
|
t_gen_zext(t, cpu_R[dc->src], size);
|
||||||
|
|
||||||
cris_alu(dc, op, cpu_R[dc->dst], cpu_R[dc->dst], t, 4);
|
cris_alu(dc, op, cpu_R[dc->dst], cpu_R[dc->dst], t, 4);
|
||||||
tcg_temp_free(t);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dec10_reg_mov_pr(DisasContext *dc)
|
static void dec10_reg_mov_pr(DisasContext *dc)
|
||||||
@ -522,7 +502,6 @@ static void dec10_reg_abs(DisasContext *dc)
|
|||||||
tcg_gen_sub_tl(t0, cpu_R[dc->dst], t0);
|
tcg_gen_sub_tl(t0, cpu_R[dc->dst], t0);
|
||||||
|
|
||||||
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->dst], cpu_R[dc->dst], t0, 4);
|
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->dst], cpu_R[dc->dst], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dec10_reg_swap(DisasContext *dc)
|
static void dec10_reg_swap(DisasContext *dc)
|
||||||
@ -543,7 +522,6 @@ static void dec10_reg_swap(DisasContext *dc)
|
|||||||
if (dc->dst & 1)
|
if (dc->dst & 1)
|
||||||
t_gen_swapr(t0, t0);
|
t_gen_swapr(t0, t0);
|
||||||
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->src], cpu_R[dc->src], t0, 4);
|
cris_alu(dc, CC_OP_MOVE, cpu_R[dc->src], cpu_R[dc->src], t0, 4);
|
||||||
tcg_temp_free(t0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dec10_reg_scc(DisasContext *dc)
|
static void dec10_reg_scc(DisasContext *dc)
|
||||||
@ -623,7 +601,6 @@ static unsigned int dec10_reg(DisasContext *dc)
|
|||||||
LOG_DIS("addi r%d r%d size=%d\n", dc->src, dc->dst, dc->size);
|
LOG_DIS("addi r%d r%d size=%d\n", dc->src, dc->dst, dc->size);
|
||||||
tcg_gen_shli_tl(t, cpu_R[dc->dst], dc->size & 3);
|
tcg_gen_shli_tl(t, cpu_R[dc->dst], dc->size & 3);
|
||||||
tcg_gen_add_tl(cpu_R[dc->src], cpu_R[dc->src], t);
|
tcg_gen_add_tl(cpu_R[dc->src], cpu_R[dc->src], t);
|
||||||
tcg_temp_free(t);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_REG_LSL:
|
case CRISV10_REG_LSL:
|
||||||
LOG_DIS("lsl $r%d, $r%d sz=%d\n", dc->src, dc->dst, size);
|
LOG_DIS("lsl $r%d, $r%d sz=%d\n", dc->src, dc->dst, size);
|
||||||
@ -669,7 +646,6 @@ static unsigned int dec10_reg(DisasContext *dc)
|
|||||||
} else {
|
} else {
|
||||||
tcg_gen_add_tl(cpu_PR[PR_PREFIX], cpu_R[dc->src], t);
|
tcg_gen_add_tl(cpu_PR[PR_PREFIX], cpu_R[dc->src], t);
|
||||||
}
|
}
|
||||||
tcg_temp_free(t);
|
|
||||||
cris_set_prefix(dc);
|
cris_set_prefix(dc);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -778,7 +754,6 @@ static unsigned int dec10_ind_move_m_r(CPUCRISState *env, DisasContext *dc,
|
|||||||
dc->delayed_branch = 1;
|
dc->delayed_branch = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tcg_temp_free(t);
|
|
||||||
return insn_len;
|
return insn_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -792,7 +767,6 @@ static unsigned int dec10_ind_move_r_m(DisasContext *dc, unsigned int size)
|
|||||||
crisv10_prepare_memaddr(dc, addr, size);
|
crisv10_prepare_memaddr(dc, addr, size);
|
||||||
gen_store_v10(dc, addr, cpu_R[dc->dst], size);
|
gen_store_v10(dc, addr, cpu_R[dc->dst], size);
|
||||||
insn_len += crisv10_post_memaddr(dc, size);
|
insn_len += crisv10_post_memaddr(dc, size);
|
||||||
tcg_temp_free(addr);
|
|
||||||
|
|
||||||
return insn_len;
|
return insn_len;
|
||||||
}
|
}
|
||||||
@ -815,7 +789,6 @@ static unsigned int dec10_ind_move_m_pr(CPUCRISState *env, DisasContext *dc)
|
|||||||
tcg_gen_mov_tl(cpu_PR[rd], t);
|
tcg_gen_mov_tl(cpu_PR[rd], t);
|
||||||
dc->cpustate_changed = 1;
|
dc->cpustate_changed = 1;
|
||||||
}
|
}
|
||||||
tcg_temp_free(t);
|
|
||||||
return insn_len;
|
return insn_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -833,12 +806,10 @@ static unsigned int dec10_ind_move_pr_m(DisasContext *dc)
|
|||||||
cris_evaluate_flags(dc);
|
cris_evaluate_flags(dc);
|
||||||
tcg_gen_andi_tl(t0, cpu_PR[PR_CCS], ~PFIX_FLAG);
|
tcg_gen_andi_tl(t0, cpu_PR[PR_CCS], ~PFIX_FLAG);
|
||||||
gen_store_v10(dc, addr, t0, size);
|
gen_store_v10(dc, addr, t0, size);
|
||||||
tcg_temp_free(t0);
|
|
||||||
} else {
|
} else {
|
||||||
gen_store_v10(dc, addr, cpu_PR[dc->dst], size);
|
gen_store_v10(dc, addr, cpu_PR[dc->dst], size);
|
||||||
}
|
}
|
||||||
insn_len += crisv10_post_memaddr(dc, size);
|
insn_len += crisv10_post_memaddr(dc, size);
|
||||||
tcg_temp_free(addr);
|
|
||||||
cris_lock_irq(dc);
|
cris_lock_irq(dc);
|
||||||
|
|
||||||
return insn_len;
|
return insn_len;
|
||||||
@ -872,8 +843,6 @@ static void dec10_movem_r_m(DisasContext *dc)
|
|||||||
if (!pfix && dc->mode == CRISV10_MODE_AUTOINC) {
|
if (!pfix && dc->mode == CRISV10_MODE_AUTOINC) {
|
||||||
tcg_gen_mov_tl(cpu_R[dc->src], addr);
|
tcg_gen_mov_tl(cpu_R[dc->src], addr);
|
||||||
}
|
}
|
||||||
tcg_temp_free(addr);
|
|
||||||
tcg_temp_free(t0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dec10_movem_m_r(DisasContext *dc)
|
static void dec10_movem_m_r(DisasContext *dc)
|
||||||
@ -900,8 +869,6 @@ static void dec10_movem_m_r(DisasContext *dc)
|
|||||||
if (!pfix && dc->mode == CRISV10_MODE_AUTOINC) {
|
if (!pfix && dc->mode == CRISV10_MODE_AUTOINC) {
|
||||||
tcg_gen_mov_tl(cpu_R[dc->src], addr);
|
tcg_gen_mov_tl(cpu_R[dc->src], addr);
|
||||||
}
|
}
|
||||||
tcg_temp_free(addr);
|
|
||||||
tcg_temp_free(t0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dec10_ind_alu(CPUCRISState *env, DisasContext *dc,
|
static int dec10_ind_alu(CPUCRISState *env, DisasContext *dc,
|
||||||
@ -939,7 +906,6 @@ static int dec10_ind_bound(CPUCRISState *env, DisasContext *dc,
|
|||||||
dc->delayed_branch = 1;
|
dc->delayed_branch = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tcg_temp_free(t);
|
|
||||||
return insn_len;
|
return insn_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -964,7 +930,6 @@ static int dec10_alux_m(CPUCRISState *env, DisasContext *dc, int op)
|
|||||||
dc->delayed_branch = 1;
|
dc->delayed_branch = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
tcg_temp_free(t);
|
|
||||||
return insn_len;
|
return insn_len;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1052,7 +1017,6 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc)
|
|||||||
c = tcg_const_tl(0);
|
c = tcg_const_tl(0);
|
||||||
cris_alu(dc, CC_OP_CMP, cpu_R[dc->dst],
|
cris_alu(dc, CC_OP_CMP, cpu_R[dc->dst],
|
||||||
t[0], c, size);
|
t[0], c, size);
|
||||||
tcg_temp_free(c);
|
|
||||||
break;
|
break;
|
||||||
case CRISV10_IND_ADD:
|
case CRISV10_IND_ADD:
|
||||||
LOG_DIS("add size=%d op=%d %d\n", size, dc->src, dc->dst);
|
LOG_DIS("add size=%d op=%d %d\n", size, dc->src, dc->dst);
|
||||||
@ -1149,7 +1113,6 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc)
|
|||||||
|
|
||||||
c = tcg_const_tl(dc->pc + insn_len);
|
c = tcg_const_tl(dc->pc + insn_len);
|
||||||
t_gen_mov_preg_TN(dc, dc->dst, c);
|
t_gen_mov_preg_TN(dc, dc->dst, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
dc->jmp_pc = imm;
|
dc->jmp_pc = imm;
|
||||||
cris_prepare_jmp(dc, JMP_DIRECT);
|
cris_prepare_jmp(dc, JMP_DIRECT);
|
||||||
dc->delayed_branch--; /* v10 has no dslot here. */
|
dc->delayed_branch--; /* v10 has no dslot here. */
|
||||||
@ -1160,7 +1123,6 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc)
|
|||||||
tcg_gen_movi_tl(env_pc, dc->pc + 2);
|
tcg_gen_movi_tl(env_pc, dc->pc + 2);
|
||||||
c = tcg_const_tl(dc->src + 2);
|
c = tcg_const_tl(dc->src + 2);
|
||||||
t_gen_mov_env_TN(trap_vector, c);
|
t_gen_mov_env_TN(trap_vector, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
t_gen_raise_exception(EXCP_BREAK);
|
t_gen_raise_exception(EXCP_BREAK);
|
||||||
dc->base.is_jmp = DISAS_NORETURN;
|
dc->base.is_jmp = DISAS_NORETURN;
|
||||||
return insn_len;
|
return insn_len;
|
||||||
@ -1170,13 +1132,11 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc)
|
|||||||
t[0] = tcg_temp_new();
|
t[0] = tcg_temp_new();
|
||||||
c = tcg_const_tl(dc->pc + insn_len);
|
c = tcg_const_tl(dc->pc + insn_len);
|
||||||
t_gen_mov_preg_TN(dc, dc->dst, c);
|
t_gen_mov_preg_TN(dc, dc->dst, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
crisv10_prepare_memaddr(dc, t[0], size);
|
crisv10_prepare_memaddr(dc, t[0], size);
|
||||||
gen_load(dc, env_btarget, t[0], 4, 0);
|
gen_load(dc, env_btarget, t[0], 4, 0);
|
||||||
insn_len += crisv10_post_memaddr(dc, size);
|
insn_len += crisv10_post_memaddr(dc, size);
|
||||||
cris_prepare_jmp(dc, JMP_INDIRECT);
|
cris_prepare_jmp(dc, JMP_INDIRECT);
|
||||||
dc->delayed_branch--; /* v10 has no dslot here. */
|
dc->delayed_branch--; /* v10 has no dslot here. */
|
||||||
tcg_temp_free(t[0]);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1195,7 +1155,6 @@ static unsigned int dec10_ind(CPUCRISState *env, DisasContext *dc)
|
|||||||
tcg_gen_mov_tl(env_btarget, cpu_R[dc->src]);
|
tcg_gen_mov_tl(env_btarget, cpu_R[dc->src]);
|
||||||
c = tcg_const_tl(dc->pc + insn_len);
|
c = tcg_const_tl(dc->pc + insn_len);
|
||||||
t_gen_mov_preg_TN(dc, dc->dst, c);
|
t_gen_mov_preg_TN(dc, dc->dst, c);
|
||||||
tcg_temp_free(c);
|
|
||||||
cris_prepare_jmp(dc, JMP_INDIRECT);
|
cris_prepare_jmp(dc, JMP_INDIRECT);
|
||||||
dc->delayed_branch--; /* v10 has no dslot here. */
|
dc->delayed_branch--; /* v10 has no dslot here. */
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user