Skip to content

Commit 7dfab62

Browse files
committed
Tweak can_branch of sret instruction
sret instruction is used for returning from a trap when trap occurs in S-mode level. Thus, the execution flow will not be sequential. During basic block translation, the sret instruction should be considered as can_branch instruction.
1 parent b8e20f6 commit 7dfab62

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/decode.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ enum op_field {
7777
/* RISC-V Privileged Instruction */ \
7878
_(wfi, 0, 4, 0, ENC(rs1, rd)) \
7979
_(uret, 0, 4, 0, ENC(rs1, rd)) \
80-
_(sret, 0, 4, 0, ENC(rs1, rd)) \
80+
_(sret, 1, 4, 0, ENC(rs1, rd)) \
8181
_(hret, 0, 4, 0, ENC(rs1, rd)) \
8282
_(mret, 1, 4, 0, ENC(rs1, rd)) \
8383
/* RV32 Zifencei Standard Extension */ \

0 commit comments

Comments
 (0)