diff --git a/riscv/src/elf.rs b/riscv/src/elf.rs index 95451de61..075bc31df 100644 --- a/riscv/src/elf.rs +++ b/riscv/src/elf.rs @@ -898,11 +898,10 @@ impl TwoOrOneMapper for InstructionLifter<'_> { }, }; - // For some reason, atomic instructions come with the immediate set to - // zero instead of None (maybe to mimic assembly syntax? Who knows). We - // must fix this: + // The acquire and release bits of an atomic instructions are decoded as + // the immediate value, but we don't need the bits and an immediate is + // not expected, so we must remove it. if let Extensions::A = insn.extension { - assert!(matches!(imm, HighLevelImmediate::Value(0))); imm = HighLevelImmediate::None; }