diff options
| author | taitep <taitep@taitep.se> | 2025-12-27 21:03:24 +0100 |
|---|---|---|
| committer | taitep <taitep@taitep.se> | 2025-12-27 21:03:24 +0100 |
| commit | b5d36b7969f2759147d58a80e0e5b62c215d2998 (patch) | |
| tree | 8e100f81dbfd31e45537a366f79d7c92de2f5c53 /src/instructions.rs | |
| parent | 970c1adcb056cae744f09f73ba3836534e31352a (diff) | |
Initial FENCE implementation
Diffstat (limited to 'src/instructions.rs')
| -rw-r--r-- | src/instructions.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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), } } |
