@@ -254,7 +254,7 @@ Load(EmulateInstructionRISCV &emulator, I inst, uint64_t (*extend)(E)) {
254254 return false ;
255255
256256 // Set context type based on whether this is a stack-based load
257- if (inst.rs1 .rs == RISCV_GPR_SP) // x2 is the stack pointer in RISC-V
257+ if (inst.rs1 .rs == RISCV_GPR_SP)
258258 context.type = EmulateInstruction::eContextPopRegisterOffStack;
259259 else
260260 context.type = EmulateInstruction::eContextRegisterLoad;
@@ -805,7 +805,7 @@ class Executor {
805805 int64_t result = rs1 + int64_t (SignExt (inst.imm ));
806806 // Check if this is a stack pointer adjustment
807807 if (inst.rd .rd == RISCV_GPR_SP &&
808- inst.rs1 .rs == RISCV_GPR_SP) { // rd=sp, rs1=sp
808+ inst.rs1 .rs == RISCV_GPR_SP) {
809809 EmulateInstruction::Context context;
810810 context.type =
811811 EmulateInstruction::eContextAdjustStackPointer;
@@ -819,7 +819,7 @@ class Executor {
819819 // Check if this is setting up the frame pointer
820820 // addi fp, sp, imm -> fp = sp + imm (frame pointer setup)
821821 if (inst.rd .rd == RISCV_GPR_FP &&
822- inst.rs1 .rs == RISCV_GPR_SP) { // rd=fp, rs1=sp
822+ inst.rs1 .rs == RISCV_GPR_SP) {
823823 EmulateInstruction::Context context;
824824 context.type = EmulateInstruction::eContextSetFramePointer;
825825 auto sp_reg_info = m_emu.GetRegisterInfo (
0 commit comments