未验证 提交 b8b991d6 编写于 作者: G Guokai Chen 提交者: GitHub

Predecode: fix ebreak predecoded as jalr (#2186)

上级 fa7f2c26
...@@ -22,7 +22,8 @@ import xiangshan.frontend.BrType ...@@ -22,7 +22,8 @@ import xiangshan.frontend.BrType
object PreDecodeInst { object PreDecodeInst {
// def C_JAL = BitPat("b????????????????_?01_?_??_???_??_???_01") // RV32C // def C_JAL = BitPat("b????????????????_?01_?_??_???_??_???_01") // RV32C
def C_J = BitPat("b????????????????_101_?_??_???_??_???_01") 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 C_BRANCH = BitPat("b????????????????_11?_?_??_???_??_???_01")
def JAL = BitPat("b????????????????_???_?????_1101111") def JAL = BitPat("b????????????????_???_?????_1101111")
def JALR = BitPat("b????????????????_000_?????_1100111") def JALR = BitPat("b????????????????_000_?????_1100111")
...@@ -32,6 +33,7 @@ object PreDecodeInst { ...@@ -32,6 +33,7 @@ object PreDecodeInst {
val brTable = Array( val brTable = Array(
// C_JAL -> List(BrType.jal), // 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_J -> List(BrType.jal),
C_JALR -> List(BrType.jalr), C_JALR -> List(BrType.jalr),
C_BRANCH -> List(BrType.branch), C_BRANCH -> List(BrType.branch),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册