From b8b991d636e3eae0d6cc2e36846166652699f0c2 Mon Sep 17 00:00:00 2001 From: Guokai Chen Date: Thu, 20 Jul 2023 15:46:39 +0800 Subject: [PATCH] Predecode: fix ebreak predecoded as jalr (#2186) --- .../xiangshan/backend/decode/isa/predecode/predecode.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/scala/xiangshan/backend/decode/isa/predecode/predecode.scala b/src/main/scala/xiangshan/backend/decode/isa/predecode/predecode.scala index 4bb2fef5e..a8e6b8a1a 100644 --- a/src/main/scala/xiangshan/backend/decode/isa/predecode/predecode.scala +++ b/src/main/scala/xiangshan/backend/decode/isa/predecode/predecode.scala @@ -22,7 +22,8 @@ import xiangshan.frontend.BrType object PreDecodeInst { // def C_JAL = BitPat("b????????????????_?01_?_??_???_??_???_01") // RV32C def C_J = BitPat("b????????????????_101_?_??_???_??_???_01") - def C_JALR = BitPat("b????????????????_100_?_??_???_00_000_10") //c.jalr & c.jr + def C_EBREAK = BitPat("b????????????????_100_?_00_000_00_000_10") + def C_JALR = BitPat("b????????????????_100_?_??_???_00_000_10") // c.jalr & c.jr def C_BRANCH = BitPat("b????????????????_11?_?_??_???_??_???_01") def JAL = BitPat("b????????????????_???_?????_1101111") def JALR = BitPat("b????????????????_000_?????_1100111") @@ -32,6 +33,7 @@ object PreDecodeInst { val brTable = Array( // C_JAL -> List(BrType.jal), + C_EBREAK -> List(BrType.notCFI), // c.ebreak should not be decoded as jalr, higher priority than c.jalr C_J -> List(BrType.jal), C_JALR -> List(BrType.jalr), C_BRANCH -> List(BrType.branch), -- GitLab