@@ -117,6 +117,11 @@ target_ulong helper_udiv_cc(CPUSPARCState *env,
target_ulong a, target_ulong b)
return do_udiv(env, a, b, 1, GETPC());
}
+target_ulong helper_asr17(CPUSPARCState *env, target_ulong input)
+{
+ return input | (CPU(sparc_env_get_cpu(env))->cpu_index << 28);
+}
+
static target_ulong do_sdiv(CPUSPARCState *env, target_ulong a,
target_ulong b, int cc, uintptr_t ra)
{
@@ -166,3 +166,4 @@ VIS_CMPHELPER(cmpne)
#undef VIS_CMPHELPER
DEF_HELPER_1(compute_psr, void, env)
DEF_HELPER_FLAGS_1(compute_C_icc, TCG_CALL_NO_WG_SE, i32, env)
+DEF_HELPER_2(asr17, tl, env, tl)
@@ -3440,6 +3440,7 @@ static void disas_sparc_insn(DisasContext * dc, unsigned
int insn)
TCGv t = gen_dest_gpr(dc, rd);
/* Read Asr17 for a Leon3 monoprocessor */
tcg_gen_movi_tl(t, (1 << 8) | (dc->def->nwindows -
1));
+ gen_helper_asr17(t, cpu_env, t);
gen_store_gpr(dc, rd, t);