The vt.maskc and vt.maskcn encodings are classified as RV64-only in 
XVentanaCondOps.decode, but their translators have no XLEN check. With 
xventanacondops enabled, RV32 can therefore retire these encodings. Gate both 
translators with the standard XLEN check.

Tested with the 6-case RV32/RV64 linux-user witness and control matrix on a 
clean patched QEMU build.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/4405

Signed-off-by: wangyang <[email protected]>
---
 target/riscv/tcg/insn_trans/trans_xventanacondops.c.inc | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/target/riscv/tcg/insn_trans/trans_xventanacondops.c.inc 
b/target/riscv/tcg/insn_trans/trans_xventanacondops.c.inc
index 38c15f2825..50d761e451 100644
--- a/target/riscv/tcg/insn_trans/trans_xventanacondops.c.inc
+++ b/target/riscv/tcg/insn_trans/trans_xventanacondops.c.inc
@@ -18,10 +18,12 @@
 
 static bool trans_vt_maskc(DisasContext *ctx, arg_r *a)
 {
+    REQUIRE_64_OR_128BIT(ctx);
     return gen_logic(ctx, a, gen_czero_eqz);
 }
 
 static bool trans_vt_maskcn(DisasContext *ctx, arg_r *a)
 {
+    REQUIRE_64_OR_128BIT(ctx);
     return gen_logic(ctx, a, gen_czero_nez);
 }
-- 
2.55.0.windows.2


Reply via email to