Skip to content

Commit

Permalink
Fix bge/bgeu for RISC-V (#1163)
Browse files Browse the repository at this point in the history
This fixes `bge` and `bgeu` branch prediction for RISC-V due to a typo
in the original code.
  • Loading branch information
ThePuzzlemaker authored Jan 9, 2025
1 parent 5225358 commit 538c7c6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -2607,7 +2607,7 @@ def long_to_twos_complement(v: int) -> int:
if rs1 <= rs2: taken, reason = True, f"{rs1}<={rs2}"
else: taken, reason = False, f"{rs1}>{rs2}"
elif condition == "ge":
if rs1 < rs2: taken, reason = True, f"{rs1}>={rs2}"
if rs1 >= rs2: taken, reason = True, f"{rs1}>={rs2}"
else: taken, reason = False, f"{rs1}<{rs2}"
else:
raise OSError(f"RISC-V: Conditional instruction `{insn}` not supported yet")
Expand Down

0 comments on commit 538c7c6

Please sign in to comment.