From 00058031313f8aa610f1e3f29906e3d5bf556371 Mon Sep 17 00:00:00 2001 From: Yinan Xu Date: Tue, 29 Oct 2024 10:35:15 +0800 Subject: [PATCH] fix(rvb): restore the decode table of zext.h This is to avoid unused warnings by compilers. The code should never be reached. It should be fixed in the future to distinguish Zbb and Zbk*. Only if Zbk* exists, zext.h is a pseudo instruction of pack.w. --- src/isa/riscv64/instr/rvi/decode.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/isa/riscv64/instr/rvi/decode.h b/src/isa/riscv64/instr/rvi/decode.h index 322832b6a..c87235299 100644 --- a/src/isa/riscv64/instr/rvi/decode.h +++ b/src/isa/riscv64/instr/rvi/decode.h @@ -263,16 +263,18 @@ def_THelper(op32) { def_INSTR_TAB("0000000 ????? ????? 001 ????? ????? ??", sllw); def_INSTR_TAB("0000000 ????? ????? 101 ????? ????? ??", srlw); def_INSTR_TAB("0100000 ????? ????? 101 ????? ????? ??", sraw); - #ifdef CONFIG_RVB +#ifdef CONFIG_RVB def_INSTR_TAB("0000100 ????? ????? 000 ????? ????? ??", adduw); - // def_INSTR_TAB("0000100 ????? ????? 100 ????? ????? ??", zext_h); def_INSTR_TAB("0010000 ????? ????? 010 ????? ????? ??", sh1adduw); def_INSTR_TAB("0010000 ????? ????? 100 ????? ????? ??", sh2adduw); def_INSTR_TAB("0010000 ????? ????? 110 ????? ????? ??", sh3adduw); def_INSTR_TAB("0110000 ????? ????? 001 ????? ????? ??", rolw); def_INSTR_TAB("0110000 ????? ????? 101 ????? ????? ??", rorw); def_INSTR_TAB("0000100 ????? ????? 100 ????? ????? ??", packw); - #endif + // Put here to avoid compiler unused warnings. Should never reach here. + // TODO: enable this if Zbb exists but Zbk* does not exist. + def_INSTR_TAB("0000100 00000 ????? 100 ????? ????? ??", zext_h); +#endif return EXEC_ID_inv; }