tcg_gen_brcond_tl(TCG_COND_EQ, r_temp, tcg_const_tl(0), l1);
tcg_gen_helper_0_1(raise_exception, tcg_const_i32(TT_TOVF));
gen_set_label(l1);
- tcg_gen_discard_tl(r_temp);
}
static inline void gen_op_sub_cc(TCGv dst, TCGv src1, TCGv src2)
/* do addition and update flags */
tcg_gen_add_tl(dst, cpu_cc_src, cpu_cc_src2);
- tcg_gen_discard_tl(r_temp);
gen_cc_clear_icc();
gen_cc_NZ_icc(dst);
#else
tcg_gen_trunc_i64_tl(dst, r_temp2);
#endif
-
- tcg_gen_discard_i64(r_temp);
- tcg_gen_discard_i64(r_temp2);
}
static inline void gen_op_smul(TCGv dst, TCGv src1, TCGv src2)
#else
tcg_gen_trunc_i64_tl(dst, r_temp2);
#endif
-
- tcg_gen_discard_i64(r_temp);
- tcg_gen_discard_i64(r_temp2);
}
#ifdef TARGET_SPARC64
r_asi = gen_get_asi(insn, addr);
tcg_gen_helper_1_4(helper_ld_asi, dst, addr, r_asi,
tcg_const_i32(size), tcg_const_i32(sign));
- tcg_gen_discard_i32(r_asi);
}
static inline void gen_st_asi(TCGv src, TCGv addr, int insn, int size)
r_asi = gen_get_asi(insn, addr);
tcg_gen_helper_0_4(helper_st_asi, addr, src, r_asi, tcg_const_i32(size));
- tcg_gen_discard_i32(r_asi);
}
static inline void gen_ldf_asi(TCGv addr, int insn, int size, int rd)
r_asi = gen_get_asi(insn, addr);
tcg_gen_helper_0_4(helper_ldf_asi, addr, r_asi, tcg_const_i32(size),
tcg_const_i32(rd));
- tcg_gen_discard_i32(r_asi);
}
static inline void gen_stf_asi(TCGv addr, int insn, int size, int rd)
r_asi = gen_get_asi(insn, addr);
tcg_gen_helper_0_4(helper_stf_asi, addr, r_asi, tcg_const_i32(size),
tcg_const_i32(rd));
- tcg_gen_discard_i32(r_asi);
}
static inline void gen_swap_asi(TCGv dst, TCGv addr, int insn)
tcg_gen_helper_0_4(helper_st_asi, addr, dst, r_asi,
tcg_const_i32(4));
tcg_gen_extu_i32_tl(dst, r_temp);
- tcg_gen_discard_i32(r_asi);
- tcg_gen_discard_i32(r_temp);
}
static inline void gen_ldda_asi(TCGv lo, TCGv hi, TCGv addr, int insn)
tcg_gen_andi_i64(lo, cpu_tmp64, 0xffffffffULL);
tcg_gen_shri_i64(cpu_tmp64, cpu_tmp64, 32);
tcg_gen_andi_i64(hi, cpu_tmp64, 0xffffffffULL);
- tcg_gen_discard_i32(r_asi);
}
static inline void gen_stda_asi(TCGv hi, TCGv addr, int insn, int rd)
r_asi = gen_get_asi(insn, addr);
tcg_gen_helper_0_4(helper_st_asi, addr, cpu_tmp64, r_asi,
tcg_const_i32(8));
- tcg_gen_discard_i32(r_asi);
- tcg_gen_discard_i32(r_temp);
}
static inline void gen_cas_asi(TCGv dst, TCGv addr, TCGv val2, int insn, int rd)
gen_movl_reg_TN(rd, r_val1);
r_asi = gen_get_asi(insn, addr);
tcg_gen_helper_1_4(helper_cas_asi, dst, addr, r_val1, val2, r_asi);
- tcg_gen_discard_i32(r_asi);
- tcg_gen_discard_i32(r_val1);
}
static inline void gen_casx_asi(TCGv dst, TCGv addr, TCGv val2, int insn, int rd)
gen_movl_reg_TN(rd, cpu_tmp64);
r_asi = gen_get_asi(insn, addr);
tcg_gen_helper_1_4(helper_casx_asi, dst, addr, cpu_tmp64, val2, r_asi);
- tcg_gen_discard_i32(r_asi);
}
#elif !defined(CONFIG_USER_ONLY)
tcg_gen_helper_0_4(helper_st_asi, addr, dst, tcg_const_i32(asi),
tcg_const_i32(4));
tcg_gen_extu_i32_tl(dst, r_temp);
- tcg_gen_discard_i32(r_temp);
}
static inline void gen_ldda_asi(TCGv lo, TCGv hi, TCGv addr, int insn)
goto jmp_insn;
}
case 0x4: /* SETHI */
-#define OPTIM
-#if defined(OPTIM)
if (rd) { // nop
-#endif
uint32_t value = GET_FIELD(insn, 10, 31);
tcg_gen_movi_tl(cpu_dst, value << 10);
gen_movl_TN_reg(rd, cpu_dst);
-#if defined(OPTIM)
}
-#endif
break;
case 0x0: /* UNIMPL */
default:
tcg_gen_addi_tl(cpu_dst, cpu_src1, rs2);
} else {
rs2 = GET_FIELD(insn, 27, 31);
-#if defined(OPTIM)
if (rs2 != 0) {
-#endif
gen_movl_reg_TN(rs2, cpu_src2);
tcg_gen_add_tl(cpu_dst, cpu_src1, cpu_src2);
-#if defined(OPTIM)
}
-#endif
}
cond = GET_FIELD(insn, 3, 6);
if (cond == 0x8) {
gen_cond(r_cond, 0, cond);
#endif
tcg_gen_helper_0_2(helper_trapcc, cpu_dst, r_cond);
- tcg_gen_discard_tl(r_cond);
}
gen_op_next_insn();
tcg_gen_exit_tb(0);
tcg_gen_helper_1_1(helper_tick_get_count, cpu_dst,
r_tickptr);
gen_movl_TN_reg(rd, cpu_dst);
- tcg_gen_discard_ptr(r_tickptr);
}
break;
case 0x5: /* V9 rdpc */
tcg_gen_helper_1_1(helper_tick_get_count, cpu_dst,
r_tickptr);
gen_movl_TN_reg(rd, cpu_dst);
- tcg_gen_discard_ptr(r_tickptr);
}
break;
case 0x19: /* System tick compare */
offsetof(CPUState, tsptr));
tcg_gen_ld_tl(cpu_dst, r_tsptr,
offsetof(trap_state, tpc));
- tcg_gen_discard_ptr(r_tsptr);
}
break;
case 1: // tnpc
offsetof(CPUState, tsptr));
tcg_gen_ld_tl(cpu_dst, r_tsptr,
offsetof(trap_state, tnpc));
- tcg_gen_discard_ptr(r_tsptr);
}
break;
case 2: // tstate
offsetof(CPUState, tsptr));
tcg_gen_ld_tl(cpu_dst, r_tsptr,
offsetof(trap_state, tstate));
- tcg_gen_discard_ptr(r_tsptr);
}
break;
case 3: // tt
offsetof(CPUState, tsptr));
tcg_gen_ld_i32(cpu_dst, r_tsptr,
offsetof(trap_state, tt));
- tcg_gen_discard_ptr(r_tsptr);
}
break;
case 4: // tick
tcg_gen_helper_1_1(helper_tick_get_count, cpu_dst,
r_tickptr);
gen_movl_TN_reg(rd, cpu_dst);
- tcg_gen_discard_ptr(r_tickptr);
}
break;
case 5: // tba
glue(glue(gen_op_load_fpr_, size_FDQ), T0)(glue(size_FDQ, FPREG(rs2))); \
glue(glue(gen_op_store_, size_FDQ), T0_fpr)(glue(size_FDQ, FPREG(rd))); \
gen_set_label(l1); \
- tcg_gen_discard_tl(r_cond); \
}
case 0x001: /* V9 fmovscc %fcc0 */
FMOVCC(F, 0);
glue(glue(gen_op_load_fpr_, size_FDQ), T0)(glue(size_FDQ, FPREG(rs2))); \
glue(glue(gen_op_store_, size_FDQ), T0_fpr)(glue(size_FDQ, FPREG(rd))); \
gen_set_label(l1); \
- tcg_gen_discard_tl(r_cond); \
}
case 0x101: /* V9 fmovscc %icc */
default:
goto illegal_insn;
}
-#if defined(OPTIM)
} else if (xop == 0x2) {
// clr/mov shortcut
}
}
gen_movl_TN_reg(rd, cpu_dst);
-#endif
#ifdef TARGET_SPARC64
} else if (xop == 0x25) { /* sll, V9 sllx */
cpu_src1 = get_src1(insn, cpu_src1);
offsetof(CPUState, tick));
tcg_gen_helper_0_2(helper_tick_set_limit,
r_tickptr, cpu_dst);
- tcg_gen_discard_ptr(r_tickptr);
}
break;
case 0x18: /* System tick */
offsetof(CPUState, stick));
tcg_gen_helper_0_2(helper_tick_set_count,
r_tickptr, cpu_dst);
- tcg_gen_discard_ptr(r_tickptr);
}
break;
case 0x19: /* System tick compare */
offsetof(CPUState, stick));
tcg_gen_helper_0_2(helper_tick_set_limit,
r_tickptr, cpu_dst);
- tcg_gen_discard_ptr(r_tickptr);
}
break;
offsetof(CPUState, tsptr));
tcg_gen_st_tl(cpu_dst, r_tsptr,
offsetof(trap_state, tpc));
- tcg_gen_discard_ptr(r_tsptr);
}
break;
case 1: // tnpc
offsetof(CPUState, tsptr));
tcg_gen_st_tl(cpu_dst, r_tsptr,
offsetof(trap_state, tnpc));
- tcg_gen_discard_ptr(r_tsptr);
}
break;
case 2: // tstate
offsetof(CPUState, tsptr));
tcg_gen_st_tl(cpu_dst, r_tsptr,
offsetof(trap_state, tstate));
- tcg_gen_discard_ptr(r_tsptr);
}
break;
case 3: // tt
offsetof(CPUState, tsptr));
tcg_gen_st_i32(cpu_dst, r_tsptr,
offsetof(trap_state, tt));
- tcg_gen_discard_ptr(r_tsptr);
}
break;
case 4: // tick
offsetof(CPUState, tick));
tcg_gen_helper_0_2(helper_tick_set_count,
r_tickptr, cpu_dst);
- tcg_gen_discard_ptr(r_tickptr);
}
break;
case 5: // tba
offsetof(CPUState, hstick));
tcg_gen_helper_0_2(helper_tick_set_limit,
r_tickptr, cpu_dst);
- tcg_gen_discard_ptr(r_tickptr);
}
break;
case 6: // hver readonly
}
gen_movl_TN_reg(rd, cpu_dst);
gen_set_label(l1);
- tcg_gen_discard_tl(r_cond);
break;
}
case 0x2d: /* V9 sdivx */
tcg_gen_addi_tl(cpu_dst, cpu_src1, (int)rs2);
} else { /* register */
rs2 = GET_FIELD(insn, 27, 31);
-#if defined(OPTIM)
if (rs2) {
-#endif
gen_movl_reg_TN(rs2, cpu_src2);
tcg_gen_add_tl(cpu_dst, cpu_src1, cpu_src2);
-#if defined(OPTIM)
}
-#endif
}
tcg_gen_helper_0_0(helper_restore);
gen_mov_pc_npc(dc, cpu_cond);
tcg_gen_addi_tl(cpu_dst, cpu_src1, (int)rs2);
} else { /* register */
rs2 = GET_FIELD(insn, 27, 31);
-#if defined(OPTIM)
if (rs2) {
-#endif
gen_movl_reg_TN(rs2, cpu_src2);
tcg_gen_add_tl(cpu_dst, cpu_src1, cpu_src2);
-#if defined(OPTIM)
}
-#endif
}
switch (xop) {
case 0x38: /* jmpl */
tcg_gen_addi_tl(cpu_addr, cpu_src1, (int)rs2);
} else { /* register */
rs2 = GET_FIELD(insn, 27, 31);
-#if defined(OPTIM)
if (rs2 != 0) {
-#endif
gen_movl_reg_TN(rs2, cpu_src2);
tcg_gen_add_tl(cpu_addr, cpu_src1, cpu_src2);
-#if defined(OPTIM)
}
-#endif
}
if (xop < 4 || (xop > 7 && xop < 0x14 && xop != 0x0e) ||
(xop > 0x17 && xop <= 0x1d ) ||