From 441d2f1190901fe67b3536bd8c0142fdbfab8b9c Mon Sep 17 00:00:00 2001 From: EvelynVusky <85813643+EvelynVusky@users.noreply.github.com> Date: Tue, 8 Aug 2023 13:49:07 -0400 Subject: [PATCH] VEX IR generator added for RISCV WFI instruction (#56) --- priv/guest_riscv64_toIR.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/priv/guest_riscv64_toIR.c b/priv/guest_riscv64_toIR.c index 3412105d1..cfac9b409 100644 --- a/priv/guest_riscv64_toIR.c +++ b/priv/guest_riscv64_toIR.c @@ -3283,6 +3283,14 @@ static Bool dis_RV64Zicsr(/*MB_OUT*/ DisResult* dres, } } + /* ----------------- wfi ------------------ */ + if (INSN(6, 0) == 0b1110011 && INSN(14, 12) == 0b000 && INSN(24, 20) == 0b00101) { + /* Add a noOp statement to the list held by irsb. */ + stmt(irsb, IRStmt_NoOp()); + DIP("wfi\n"); + return True; + } + return False; }