@@ -3,8 +3,6 @@
* Copyright (c) 2021 Loongson Technology Corporation Limited
*/
-DEF_HELPER_2(raise_exception, noreturn, env, i32)
-
DEF_HELPER_FLAGS_3(asrtle_d, TCG_CALL_NO_WG, void, env, tl, tl)
DEF_HELPER_FLAGS_3(asrtgt_d, TCG_CALL_NO_WG, void, env, tl, tl)
@@ -16,12 +16,6 @@
#include <zlib.h> /* for crc32 */
#include "cpu-csr.h"
-/* Exceptions helpers */
-void helper_raise_exception(CPULoongArchState *env, uint32_t exception)
-{
- do_raise_exception(env, exception, GETPC());
-}
-
/* loongarch assert op */
void helper_asrtle_d(CPULoongArchState *env, target_ulong rj, target_ulong rk)
{
@@ -69,9 +69,7 @@ void G_NORETURN do_raise_exception(CPULoongArchState *env,
__func__,
exception,
loongarch_exception_name(exception));
- cs->exception_index = exception;
-
- cpu_loop_exit_restore(cs, pc);
+ cpu_loop_exit_excp(cs, exception, pc);
}
#ifndef CONFIG_USER_ONLY
@@ -95,7 +95,7 @@ static void gen_nanbox_s(TCGv_i64 out, TCGv_i64 in)
void generate_exception(DisasContext *ctx, int excp)
{
tcg_gen_movi_tl(cpu_pc, ctx->base.pc_next);
- gen_helper_raise_exception(tcg_env, tcg_constant_i32(excp));
+ gen_helper_raise_excp_restore(tcg_env, tcg_constant_i32(excp));
ctx->base.is_jmp = DISAS_NORETURN;
}
Translate through raise_excp_restore after storing PC. Drop TCG raise_exception. Keep C do_raise_exception and use cpu_loop_exit_excp. Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> --- target/loongarch/tcg/helper.h | 2 -- target/loongarch/tcg/op_helper.c | 6 ------ target/loongarch/tcg/tcg_cpu.c | 4 +--- target/loongarch/tcg/translate.c | 2 +- 4 files changed, 2 insertions(+), 12 deletions(-)