Enum cranelift_codegen::data_value::DataValue[][src]

pub enum DataValue {
    B(bool),
    I8(i8),
    I16(i16),
    I32(i32),
    I64(i64),
    U8(u8),
    U16(u16),
    U32(u32),
    U64(u64),
    F32(Ieee32),
    F64(Ieee64),
    V128([u8; 16]),
}
Expand description

Represent a data value. Where Value is an SSA reference, DataValue is the type + value that would be referred to by a Value.

Variants

B(bool)
I8(i8)
I16(i16)
I32(i32)
I64(i64)
U8(u8)
U16(u16)
U32(u32)
U64(u64)
F32(Ieee32)
F64(Ieee64)
V128([u8; 16])

Implementations

impl DataValue[src]

pub fn from_integer(
    imm: i64,
    ty: Type
) -> Result<DataValue, DataValueCastFailure>
[src]

Try to cast an immediate integer (a wrapped i64 on most Cranelift instructions) to the given Cranelift Type.

pub fn ty(&self) -> Type[src]

Return the Cranelift IR Type for this DataValue.

pub fn is_vector(&self) -> bool[src]

Return true if the value is a vector (i.e. DataValue::V128).

pub unsafe fn write_value_to(&self, p: *mut u128)[src]

Write a DataValue to a memory location.

pub unsafe fn read_value_from(p: *const u128, ty: Type) -> Self[src]

Read a DataValue from a memory location using a given Type.

Trait Implementations

impl Clone for DataValue[src]

fn clone(&self) -> DataValue[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for DataValue[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Display for DataValue[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl From<[u8; 16]> for DataValue[src]

fn from(data: [u8; 16]) -> Self[src]

Performs the conversion.

impl From<Ieee32> for DataValue[src]

fn from(data: Ieee32) -> Self[src]

Performs the conversion.

impl From<Ieee64> for DataValue[src]

fn from(data: Ieee64) -> Self[src]

Performs the conversion.

impl From<Offset32> for DataValue[src]

fn from(o: Offset32) -> Self[src]

Performs the conversion.

impl From<bool> for DataValue[src]

fn from(data: bool) -> Self[src]

Performs the conversion.

impl From<i16> for DataValue[src]

fn from(data: i16) -> Self[src]

Performs the conversion.

impl From<i32> for DataValue[src]

fn from(data: i32) -> Self[src]

Performs the conversion.

impl From<i64> for DataValue[src]

fn from(data: i64) -> Self[src]

Performs the conversion.

impl From<i8> for DataValue[src]

fn from(data: i8) -> Self[src]

Performs the conversion.

impl From<u16> for DataValue[src]

fn from(data: u16) -> Self[src]

Performs the conversion.

impl From<u32> for DataValue[src]

fn from(data: u32) -> Self[src]

Performs the conversion.

impl From<u64> for DataValue[src]

fn from(data: u64) -> Self[src]

Performs the conversion.

impl From<u8> for DataValue[src]

fn from(data: u8) -> Self[src]

Performs the conversion.

impl PartialEq<DataValue> for DataValue[src]

fn eq(&self, other: &DataValue) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &DataValue) -> bool[src]

This method tests for !=.

impl PartialOrd<DataValue> for DataValue[src]

fn partial_cmp(&self, other: &DataValue) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl TryInto<[u8; 16]> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<[u8; 16], Self::Error>[src]

Performs the conversion.

impl TryInto<Ieee32> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Ieee32, Self::Error>[src]

Performs the conversion.

impl TryInto<Ieee64> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<Ieee64, Self::Error>[src]

Performs the conversion.

impl TryInto<bool> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<bool, Self::Error>[src]

Performs the conversion.

impl TryInto<i16> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<i16, Self::Error>[src]

Performs the conversion.

impl TryInto<i32> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<i32, Self::Error>[src]

Performs the conversion.

impl TryInto<i64> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<i64, Self::Error>[src]

Performs the conversion.

impl TryInto<i8> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<i8, Self::Error>[src]

Performs the conversion.

impl TryInto<u16> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<u16, Self::Error>[src]

Performs the conversion.

impl TryInto<u32> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<u32, Self::Error>[src]

Performs the conversion.

impl TryInto<u64> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<u64, Self::Error>[src]

Performs the conversion.

impl TryInto<u8> for DataValue[src]

type Error = DataValueCastFailure

The type returned in the event of a conversion error.

fn try_into(self) -> Result<u8, Self::Error>[src]

Performs the conversion.

impl StructuralPartialEq for DataValue[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T> ToString for T where
    T: Display + ?Sized
[src]

pub default fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.