diff options
author | Max Filippov <jcmvbkbc@gmail.com> | 2018-08-30 18:21:22 -0700 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2018-10-01 11:08:35 -0700 |
commit | 90d6494d130afa6de932fb1fa2eed8296d702836 (patch) | |
tree | 48a169d8ff1cd6b312a4e0e8fa8df87f12a190a0 /target/xtensa | |
parent | f473019a97d7c890ddb816367dc9f89fdfefa22e (diff) |
target/xtensa: extract test for alloca exception
- mark movsp instruction;
- put test for alloca exception right after the test for window
underflow;
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'target/xtensa')
-rw-r--r-- | target/xtensa/translate.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/target/xtensa/translate.c b/target/xtensa/translate.c index 187de7467f..12c54b674e 100644 --- a/target/xtensa/translate.c +++ b/target/xtensa/translate.c @@ -1078,6 +1078,13 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc) tcg_temp_free(tmp); } + if (op_flags & XTENSA_OP_ALLOCA) { + TCGv_i32 tmp = tcg_const_i32(dc->pc); + + gen_helper_movsp(cpu_env, tmp); + tcg_temp_free(tmp); + } + for (slot = 0; slot < slots; ++slot) { XtensaOpcodeOps *ops = slot_prop[slot].ops; @@ -1918,10 +1925,7 @@ static void translate_movp(DisasContext *dc, const uint32_t arg[], static void translate_movsp(DisasContext *dc, const uint32_t arg[], const uint32_t par[]) { - TCGv_i32 pc = tcg_const_i32(dc->pc); - gen_helper_movsp(cpu_env, pc); tcg_gen_mov_i32(cpu_R[arg[0]], cpu_R[arg[1]]); - tcg_temp_free(pc); } static void translate_mul16(DisasContext *dc, const uint32_t arg[], @@ -3062,6 +3066,7 @@ static const XtensaOpcodeOps core_ops[] = { .name = "movsp", .translate = translate_movsp, .windowed_register_op = 0x3, + .op_flags = XTENSA_OP_ALLOCA, }, { .name = "movt", .translate = translate_movp, |