Add generic logical guards and atomic storage publication

This commit is contained in:
2026-10-22 22:24:28 +01:00
parent f7d7c16753
commit d9b9eeb171
17 changed files with 749 additions and 4 deletions
@@ -76,6 +76,14 @@ impl<'a> DecodedInstr<'a> {
Ok(f64::from_le_bytes(self.imm.try_into().unwrap()))
}
/// Four independent u32 operands; widths are resolved through the Registry.
pub fn imm_u32x4(&self) -> Result<[u32; 4], DecodeError> {
self.ensure_len(16)?;
Ok(std::array::from_fn(|i| {
u32::from_le_bytes(self.imm[i * 4..i * 4 + 4].try_into().unwrap())
}))
}
/// Helper for opcodes carrying two u32 values packed in 8 bytes (e.g., ALLOC meta).
#[inline]
pub fn imm_u32x2(&self) -> Result<(u32, u32), DecodeError> {