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

Function insn_rs2

crates/virtual-machine/src/cpu/hazard_unit.rs:61–73  ·  view source on GitHub ↗

Second integer source register of a decoded instruction; 0 = none.

(insn: &DecodedInsn)

Source from the content-addressed store, hash-verified

59 | DecodedInsn::Alu32 { rs2, .. }
60 | DecodedInsn::FStore { rs2, .. }
61 | DecodedInsn::FOp { rs2, .. }
62 | DecodedInsn::FMac { rs2, .. }
63 | DecodedInsn::Atomic { rs2, .. } => *rs2,
64 _ => 0,
65 }
66}
67
68/// True when the instruction is a (potentially FP) memory load.
69pub fn insn_is_load(insn: &DecodedInsn) -> bool {
70 matches!(insn, DecodedInsn::Load { .. } | DecodedInsn::FLoad { .. })
71}
72
73/// True when the instruction is an atomic (acts as load for hazard purposes).
74pub fn insn_is_atomic(insn: &DecodedInsn) -> bool {
75 matches!(insn, DecodedInsn::Atomic { .. })
76}

Callers 1

stage_idMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected