pub enum DataValue {
I8(i8),
I16(i16),
I32(i32),
I64(i64),
I128(i128),
F16(Ieee16),
F32(Ieee32),
F64(Ieee64),
F128(Ieee128),
V128([u8; 16]),
V64([u8; 8]),
}
Expand description
Variants§
I8(i8)
I16(i16)
I32(i32)
I64(i64)
I128(i128)
F16(Ieee16)
F32(Ieee32)
F64(Ieee64)
F128(Ieee128)
V128([u8; 16])
V64([u8; 8])
Implementations§
source§impl DataValue
impl DataValue
sourcepub fn from_integer(
imm: i128,
ty: Type,
) -> Result<DataValue, DataValueCastFailure>
pub fn from_integer( imm: i128, ty: Type, ) -> Result<DataValue, DataValueCastFailure>
Try to cast an immediate integer (a wrapped i64
on most Cranelift instructions) to the
given Cranelift Type.
sourcepub fn write_to_slice_ne(&self, dst: &mut [u8])
pub fn write_to_slice_ne(&self, dst: &mut [u8])
sourcepub fn write_to_slice_be(&self, dst: &mut [u8])
pub fn write_to_slice_be(&self, dst: &mut [u8])
sourcepub fn write_to_slice_le(&self, dst: &mut [u8])
pub fn write_to_slice_le(&self, dst: &mut [u8])
sourcepub fn read_from_slice_ne(src: &[u8], ty: Type) -> Self
pub fn read_from_slice_ne(src: &[u8], ty: Type) -> Self
sourcepub fn read_from_slice_be(src: &[u8], ty: Type) -> Self
pub fn read_from_slice_be(src: &[u8], ty: Type) -> Self
sourcepub fn read_from_slice_le(src: &[u8], ty: Type) -> Self
pub fn read_from_slice_le(src: &[u8], ty: Type) -> Self
sourcepub unsafe fn write_value_to(&self, p: *mut u128)
pub unsafe fn write_value_to(&self, p: *mut u128)
Write a DataValue to a memory location in native-endian byte order.
sourcepub unsafe fn read_value_from(p: *const u128, ty: Type) -> Self
pub unsafe fn read_value_from(p: *const u128, ty: Type) -> Self
sourcepub fn bitwise_eq(&self, other: &DataValue) -> bool
pub fn bitwise_eq(&self, other: &DataValue) -> bool
Performs a bitwise comparison over the contents of DataValue.
Returns true if all bits are equal.
This behaviour is different from PartialEq for NaN floats.
Trait Implementations§
source§impl PartialOrd for DataValue
impl PartialOrd for DataValue
Auto Trait Implementations§
impl Freeze for DataValue
impl RefUnwindSafe for DataValue
impl Send for DataValue
impl Sync for DataValue
impl Unpin for DataValue
impl UnwindSafe for DataValue
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)