From 33a07fa2db66376e6ee780d4a8b064dc5118cf34 Mon Sep 17 00:00:00 2001 From: Leon Alrae Date: Mon, 11 Feb 2019 16:09:23 +0100 Subject: target/mips: reimplement SC instruction emulation and use cmpxchg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Completely rewrite conditional stores handling. Use cmpxchg. This eliminates need for separate implementations of SC instruction emulation for user and system emulation. Signed-off-by: Leon Alrae Signed-off-by: Miodrag Dinic Signed-off-by: Aleksandar Markovic Acked-by: Alex Bennée Tested-by: Emilio G. Cota Reviewed-by: Richard Henderson --- target/mips/op_helper.c | 27 --------------------------- 1 file changed, 27 deletions(-) (limited to 'target/mips/op_helper.c') diff --git a/target/mips/op_helper.c b/target/mips/op_helper.c index 44f2626f3f..943a7ea579 100644 --- a/target/mips/op_helper.c +++ b/target/mips/op_helper.c @@ -380,33 +380,6 @@ HELPER_LD_ATOMIC(ll, lw, 0x3) HELPER_LD_ATOMIC(lld, ld, 0x7) #endif #undef HELPER_LD_ATOMIC - -#define HELPER_ST_ATOMIC(name, ld_insn, st_insn, almask) \ -target_ulong helper_##name(CPUMIPSState *env, target_ulong arg1, \ - target_ulong arg2, int mem_idx) \ -{ \ - target_long tmp; \ - \ - if (arg2 & almask) { \ - if (!(env->hflags & MIPS_HFLAG_DM)) { \ - env->CP0_BadVAddr = arg2; \ - } \ - do_raise_exception(env, EXCP_AdES, GETPC()); \ - } \ - if (arg2 == env->lladdr) { \ - tmp = do_##ld_insn(env, arg2, mem_idx, GETPC()); \ - if (tmp == env->llval) { \ - do_##st_insn(env, arg2, arg1, mem_idx, GETPC()); \ - return 1; \ - } \ - } \ - return 0; \ -} -HELPER_ST_ATOMIC(sc, lw, sw, 0x3) -#ifdef TARGET_MIPS64 -HELPER_ST_ATOMIC(scd, ld, sd, 0x7) -#endif -#undef HELPER_ST_ATOMIC #endif #ifdef TARGET_WORDS_BIGENDIAN -- cgit v1.2.3