*/
#include "cpu.h"
-#include "dyngen-exec.h"
#include "helper.h"
-static uint32_t compute_all_flags(void)
+static uint32_t compute_all_flags(CPUState *env)
{
return env->psr & PSR_ICC;
}
-static uint32_t compute_C_flags(void)
+static uint32_t compute_C_flags(CPUState *env)
{
return env->psr & PSR_CARRY;
}
}
#ifdef TARGET_SPARC64
-static uint32_t compute_all_flags_xcc(void)
+static uint32_t compute_all_flags_xcc(CPUState *env)
{
return env->xcc & PSR_ICC;
}
-static uint32_t compute_C_flags_xcc(void)
+static uint32_t compute_C_flags_xcc(CPUState *env)
{
return env->xcc & PSR_CARRY;
}
return ret;
}
-static uint32_t compute_all_div(void)
+static uint32_t compute_all_div(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_div(void)
+static uint32_t compute_C_div(CPUState *env)
{
return 0;
}
return ret;
}
-static uint32_t compute_all_add_xcc(void)
+static uint32_t compute_all_add_xcc(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_add_xcc(void)
+static uint32_t compute_C_add_xcc(CPUState *env)
{
return get_C_add_xcc(CC_DST, CC_SRC);
}
#endif
-static uint32_t compute_all_add(void)
+static uint32_t compute_all_add(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_add(void)
+static uint32_t compute_C_add(CPUState *env)
{
return get_C_add_icc(CC_DST, CC_SRC);
}
#ifdef TARGET_SPARC64
-static uint32_t compute_all_addx_xcc(void)
+static uint32_t compute_all_addx_xcc(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_addx_xcc(void)
+static uint32_t compute_C_addx_xcc(CPUState *env)
{
uint32_t ret;
}
#endif
-static uint32_t compute_all_addx(void)
+static uint32_t compute_all_addx(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_addx(void)
+static uint32_t compute_C_addx(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_all_tadd(void)
+static uint32_t compute_all_tadd(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_all_taddtv(void)
+static uint32_t compute_all_taddtv(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_all_sub_xcc(void)
+static uint32_t compute_all_sub_xcc(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_sub_xcc(void)
+static uint32_t compute_C_sub_xcc(CPUState *env)
{
return get_C_sub_xcc(CC_SRC, CC_SRC2);
}
#endif
-static uint32_t compute_all_sub(void)
+static uint32_t compute_all_sub(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_sub(void)
+static uint32_t compute_C_sub(CPUState *env)
{
return get_C_sub_icc(CC_SRC, CC_SRC2);
}
#ifdef TARGET_SPARC64
-static uint32_t compute_all_subx_xcc(void)
+static uint32_t compute_all_subx_xcc(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_subx_xcc(void)
+static uint32_t compute_C_subx_xcc(CPUState *env)
{
uint32_t ret;
}
#endif
-static uint32_t compute_all_subx(void)
+static uint32_t compute_all_subx(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_C_subx(void)
+static uint32_t compute_C_subx(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_all_tsub(void)
+static uint32_t compute_all_tsub(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_all_tsubtv(void)
+static uint32_t compute_all_tsubtv(CPUState *env)
{
uint32_t ret;
return ret;
}
-static uint32_t compute_all_logic(void)
+static uint32_t compute_all_logic(CPUState *env)
{
return get_NZ_icc(CC_DST);
}
-static uint32_t compute_C_logic(void)
+static uint32_t compute_C_logic(CPUState *env)
{
return 0;
}
#ifdef TARGET_SPARC64
-static uint32_t compute_all_logic_xcc(void)
+static uint32_t compute_all_logic_xcc(CPUState *env)
{
return get_NZ_xcc(CC_DST);
}
#endif
typedef struct CCTable {
- uint32_t (*compute_all)(void); /* return all the flags */
- uint32_t (*compute_c)(void); /* return the C flag */
+ uint32_t (*compute_all)(CPUState *env); /* return all the flags */
+ uint32_t (*compute_c)(CPUState *env); /* return the C flag */
} CCTable;
static const CCTable icc_table[CC_OP_NB] = {
};
#endif
-void helper_compute_psr(void)
+void helper_compute_psr(CPUState *env)
{
uint32_t new_psr;
- new_psr = icc_table[CC_OP].compute_all();
+ new_psr = icc_table[CC_OP].compute_all(env);
env->psr = new_psr;
#ifdef TARGET_SPARC64
- new_psr = xcc_table[CC_OP].compute_all();
+ new_psr = xcc_table[CC_OP].compute_all(env);
env->xcc = new_psr;
#endif
CC_OP = CC_OP_FLAGS;
}
-uint32_t helper_compute_C_icc(void)
+uint32_t helper_compute_C_icc(CPUState *env)
{
uint32_t ret;
- ret = icc_table[CC_OP].compute_c() >> PSR_CARRY_SHIFT;
+ ret = icc_table[CC_OP].compute_c(env) >> PSR_CARRY_SHIFT;
return ret;
}
default:
/* We need external help to produce the carry. */
carry_32 = tcg_temp_new_i32();
- gen_helper_compute_C_icc(carry_32);
+ gen_helper_compute_C_icc(carry_32, cpu_env);
break;
}
default:
/* We need external help to produce the carry. */
carry_32 = tcg_temp_new_i32();
- gen_helper_compute_C_icc(carry_32);
+ gen_helper_compute_C_icc(carry_32, cpu_env);
break;
}
/* flush pending conditional evaluations before exposing cpu state */
if (dc->cc_op != CC_OP_FLAGS) {
dc->cc_op = CC_OP_FLAGS;
- gen_helper_compute_psr();
+ gen_helper_compute_psr(cpu_env);
}
save_npc(dc, cond);
}
case CC_OP_FLAGS:
break;
default:
- gen_helper_compute_psr();
+ gen_helper_compute_psr(cpu_env);
dc->cc_op = CC_OP_FLAGS;
break;
}
break;
#ifdef TARGET_SPARC64
case 0x2: /* V9 rdccr */
- gen_helper_compute_psr();
+ gen_helper_compute_psr(cpu_env);
gen_helper_rdccr(cpu_dst);
gen_movl_TN_reg(rd, cpu_dst);
break;
#ifndef TARGET_SPARC64
if (!supervisor(dc))
goto priv_insn;
- gen_helper_compute_psr();
+ gen_helper_compute_psr(cpu_env);
dc->cc_op = CC_OP_FLAGS;
gen_helper_rdpsr(cpu_dst);
#else
dc->cc_op = CC_OP_TSUBTV;
break;
case 0x24: /* mulscc */
- gen_helper_compute_psr();
+ gen_helper_compute_psr(cpu_env);
gen_op_mulscc(cpu_dst, cpu_src1, cpu_src2);
gen_movl_TN_reg(rd, cpu_dst);
tcg_gen_movi_i32(cpu_cc_op, CC_OP_ADD);
cpu state */
if (dc->cc_op != CC_OP_FLAGS) {
dc->cc_op = CC_OP_FLAGS;
- gen_helper_compute_psr();
+ gen_helper_compute_psr(cpu_env);
}
cpu_src1 = get_src1(insn, cpu_src1);
if (xop == 0x3c || xop == 0x3e) { // V9 casa/casxa
/* flush pending conditional evaluations before exposing cpu state */
if (CC_OP != CC_OP_FLAGS) {
- helper_compute_psr();
+ helper_compute_psr(env);
}
}