Add generic logical guards and atomic storage publication
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user