On 5/22/25 07:55, Song Gao wrote:
on qemu we got an aborted error
**
ERROR:../target/loongarch/tcg/insn_trans/trans_vec.c.inc:3574:vldi_get_value:
code should not be reached
Bail out!
ERROR:../target/loongarch/tcg/insn_trans/trans_vec.c.inc:3574:vldi_get_value:
code should not be reached
Aborted (core dumped)
bu on 3A600/3A5000 we got a "Illegal instruction" error.
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2971
Signed-off-by: Song Gao <gaos...@loongson.cn>
---
target/loongarch/tcg/insn_trans/trans_vec.c.inc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc
b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
index dff92772ad..b33622ff79 100644
--- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
@@ -3465,7 +3465,7 @@ TRANS(xvmsknz_b, LASX, gen_xx, gen_helper_vmsknz_b)
static uint64_t vldi_get_value(DisasContext *ctx, uint32_t imm)
{
int mode;
- uint64_t data, t;
+ uint64_t data=0, t;
/*
* imm bit [11:8] is mode, mode value is 0-12.
@@ -3571,7 +3571,6 @@ static uint64_t vldi_get_value(DisasContext *ctx,
uint32_t imm)
break;
default:
generate_exception(ctx, EXCCODE_INE);
- g_assert_not_reached();
}
return data;
}
This is correct, in that it eliminates the incorrect assertion.
However, is the priority between EXCCODE_INE and EXCCODE_{A}SXD correct? For Arm, at
least, decode errors take precedence over disabled functional units.
I suspect that vldi_get_value needs to be merged into gen_vldi, so that the exception case
can return early, and this needs to happen before the check_vec().
r~