target/xtensa: extract test for window underflow exception

- mark retw and retw.n instructions;
- extract window inderflow test from retw helper;
- put underflow exception check generation right after the overflow
  check;

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
This commit is contained in:
Max Filippov 2018-08-30 17:55:33 -07:00
parent 6416d16f75
commit f473019a97
3 changed files with 25 additions and 9 deletions

View file

@ -1071,6 +1071,13 @@ static void disas_xtensa_insn(CPUXtensaState *env, DisasContext *dc)
return;
}
if (op_flags & XTENSA_OP_UNDERFLOW) {
TCGv_i32 tmp = tcg_const_i32(dc->pc);
gen_helper_test_underflow_retw(cpu_env, tmp);
tcg_temp_free(tmp);
}
for (slot = 0; slot < slots; ++slot) {
XtensaOpcodeOps *ops = slot_prop[slot].ops;
@ -3485,10 +3492,12 @@ static const XtensaOpcodeOps core_ops[] = {
.name = "retw",
.translate = translate_retw,
.test_ill = test_ill_retw,
.op_flags = XTENSA_OP_UNDERFLOW,
}, {
.name = "retw.n",
.translate = translate_retw,
.test_ill = test_ill_retw,
.op_flags = XTENSA_OP_UNDERFLOW,
}, {
.name = "rfdd",
.op_flags = XTENSA_OP_ILL,