From b5d36b7969f2759147d58a80e0e5b62c215d2998 Mon Sep 17 00:00:00 2001 From: taitep Date: Sat, 27 Dec 2025 21:03:24 +0100 Subject: [PATCH] Initial FENCE implementation --- src/instructions.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/instructions.rs b/src/instructions.rs index 8e55d37..e7b95f1 100644 --- a/src/instructions.rs +++ b/src/instructions.rs @@ -112,6 +112,16 @@ pub(crate) fn find_and_exec(instr: Instruction, core: &mut Core) -> Result<(), E Err(IllegalInstruction) } } + 0b00011 => match instr.funct3() { + // MISC_MEM + 0b000 => { + // FENCE is just implemented as a SeqCst fence always here + // I dont yet care about the potential performance issue this may bring + std::sync::atomic::fence(std::sync::atomic::Ordering::SeqCst); + Ok(()) + } + _ => Err(IllegalInstruction), + }, _ => Err(IllegalInstruction), } }