MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / decode_fence

Function decode_fence

crates/virtual-machine/src/cpu/decoder.rs:807–817  ·  view source on GitHub ↗
(word: u32)

Source from the content-addressed store, hash-verified

805// --- Sub-decoders ---
806
807fn decode_fence(word: u32) -> Result<DecodedInsn, VmError> {
808 match funct3(word) {
809 0 => Ok(DecodedInsn::Fence {
810 fm: field(word, 31, 28) as u8,
811 pred: field(word, 27, 24) as u8,
812 succ: field(word, 23, 20) as u8,
813 }),
814 1 => Ok(DecodedInsn::FenceI),
815 _ => Err(VmError::IllegalInstruction(word)),
816 }
817}
818
819fn decode_system(word: u32) -> Result<DecodedInsn, VmError> {
820 // Check for SFENCE.VMA first (opcode 0x73, funct3=0, but with specific pattern)

Callers 1

decodeFunction · 0.85

Calls 2

funct3Function · 0.85
fieldFunction · 0.85

Tested by

no test coverage detected