[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 11/13] target-alpha: Indicate NORETURN status when r
From: |
Richard Henderson |
Subject: |
[Qemu-devel] [PATCH 11/13] target-alpha: Indicate NORETURN status when raising exception. |
Date: |
Wed, 7 Apr 2010 13:32:50 -0700 |
When (indirectly) calling raise_exception, don't emit cleanup
code at the end of the TB, as it is unused.
Signed-off-by: Richard Henderson <address@hidden>
---
target-alpha/translate.c | 27 ++++++++++++++-------------
1 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/target-alpha/translate.c b/target-alpha/translate.c
index 2360a0e..5636f60 100644
--- a/target-alpha/translate.c
+++ b/target-alpha/translate.c
@@ -74,7 +74,11 @@ typedef enum {
/* We are exiting the TB, but have neither emitted a goto_tb, nor
updated the PC for the next instruction to be executed. */
- EXIT_PC_STALE
+ EXIT_PC_STALE,
+
+ /* We are ending the TB with a noreturn function call, e.g. longjmp.
+ No following code will be executed. */
+ EXIT_NORETURN,
} ExitStatus;
/* global register indexes */
@@ -134,7 +138,7 @@ static void alpha_translate_init(void)
done_init = 1;
}
-static inline void gen_excp(DisasContext *ctx, int exception, int error_code)
+static ExitStatus gen_excp(DisasContext *ctx, int exception, int error_code)
{
TCGv_i32 tmp1, tmp2;
@@ -144,11 +148,13 @@ static inline void gen_excp(DisasContext *ctx, int
exception, int error_code)
gen_helper_excp(tmp1, tmp2);
tcg_temp_free_i32(tmp2);
tcg_temp_free_i32(tmp1);
+
+ return EXIT_NORETURN;
}
-static inline void gen_invalid(DisasContext *ctx)
+static inline ExitStatus gen_invalid(DisasContext *ctx)
{
- gen_excp(ctx, EXCP_OPCDEC, 0);
+ return gen_excp(ctx, EXCP_OPCDEC, 0);
}
static inline void gen_qemu_ldf(TCGv t0, TCGv t1, int flags)
@@ -1458,9 +1464,7 @@ static ExitStatus translate_one(DisasContext *ctx,
uint32_t insn)
#endif
if (palcode >= 0x80 && palcode < 0xC0) {
/* Unprivileged PAL call */
- gen_excp(ctx, EXCP_CALL_PAL + ((palcode & 0x3F) << 6), 0);
- /* PC updated by gen_excp. */
- ret = EXIT_PC_UPDATED;
+ ret = gen_excp(ctx, EXCP_CALL_PAL + ((palcode & 0x3F) << 6), 0);
break;
}
#ifndef CONFIG_USER_ONLY
@@ -1468,9 +1472,7 @@ static ExitStatus translate_one(DisasContext *ctx,
uint32_t insn)
/* Privileged PAL code */
if (ctx->mem_idx & 1)
goto invalid_opc;
- gen_excp(ctx, EXCP_CALL_PALP + ((palcode & 0x3F) << 6), 0);
- /* PC updated by gen_excp. */
- ret = EXIT_PC_UPDATED;
+ ret = gen_excp(ctx, EXCP_CALL_PALP + ((palcode & 0x3F) << 6), 0);
}
#endif
/* Invalid PAL call */
@@ -3078,9 +3080,7 @@ static ExitStatus translate_one(DisasContext *ctx,
uint32_t insn)
ret = gen_bcond(ctx, TCG_COND_GT, ra, disp21, 0);
break;
invalid_opc:
- gen_invalid(ctx);
- /* PC updated by gen_excp. */
- ret = EXIT_PC_UPDATED;
+ ret = gen_invalid(ctx);
break;
}
@@ -3184,6 +3184,7 @@ static inline void
gen_intermediate_code_internal(CPUState *env,
switch (ret) {
case EXIT_GOTO_TB:
+ case EXIT_NORETURN:
break;
case EXIT_PC_STALE:
tcg_gen_movi_i64(cpu_pc, ctx.pc);
--
1.6.6.1
- Re: [Qemu-devel] [PATCH 06/13] target-alpha: Use setcond for int comparisons., (continued)
- [Qemu-devel] [PATCH 09/13] target-alpha: Update commentary for opcode 0x1A., Richard Henderson, 2010/04/07
- [Qemu-devel] [PATCH 01/13] target-alpha: Add flags markups to helpers.h., Richard Henderson, 2010/04/07
- [Qemu-devel] [PATCH 10/13] target-alpha: Enable NPTL., Richard Henderson, 2010/04/07
- [Qemu-devel] [PATCH 07/13] target-alpha: Use non-inverted arguments to gen_{f}cmov., Richard Henderson, 2010/04/07
- [Qemu-devel] [PATCH 03/13] target-alpha: Implement rs/rc properly., Richard Henderson, 2010/04/07
- [Qemu-devel] [PATCH 11/13] target-alpha: Indicate NORETURN status when raising exception.,
Richard Henderson <=
- [Qemu-devel] [PATCH 08/13] target-alpha: Emit goto_tb opcodes., Richard Henderson, 2010/04/07
- [Qemu-devel] [PATCH 13/13] target-alpha: Implement RPCC., Richard Henderson, 2010/04/07
- [Qemu-devel] [PATCH 12/13] target-alpha: Fix load-locked/store-conditional., Richard Henderson, 2010/04/07
- [Qemu-devel] [PATCH 00/10] target-alpha improvments, version 5, Richard Henderson, 2010/04/12
- [Qemu-devel] [PATCH 03/10] target-alpha: Implement cvtlq inline., Richard Henderson, 2010/04/12
- [Qemu-devel] [PATCH 05/10] target-alpha: Update commentary for opcode 0x1A., Richard Henderson, 2010/04/12
- [Qemu-devel] [PATCH 04/10] target-alpha: Emit goto_tb opcodes., Richard Henderson, 2010/04/12
- [Qemu-devel] [PATCH 08/10] target-alpha: Fix load-locked/store-conditional., Richard Henderson, 2010/04/12
- [Qemu-devel] [PATCH 07/10] target-alpha: Indicate NORETURN status when raising exception., Richard Henderson, 2010/04/12