Struct wasmtime_environ::ir::types::Type [−][src]
pub struct Type(_);
Expand description
The type of an SSA value.
The INVALID
type isn’t a real type, and is used as a placeholder in the IR where a type
field is present put no type is needed, such as the controlling type variable for a
non-polymorphic instruction.
Basic integer types: I8
, I16
, I32
, I64
, and I128
. These types are sign-agnostic.
Basic floating point types: F32
and F64
. IEEE single and double precision.
Boolean types: B1
, B8
, B16
, B32
, B64
, and B128
. These all encode ‘true’ or ‘false’. The
larger types use redundant bits.
SIMD vector types have power-of-two lanes, up to 256. Lanes can be any int/float/bool type.
Implementations
impl Type
[src]
impl Type
[src]pub fn lane_type(self) -> Type
[src]
pub fn lane_type(self) -> Type
[src]Get the lane type of this SIMD vector type.
A lane type is the same as a SIMD vector type with one lane, so it returns itself.
pub fn lane_of(self) -> Type
[src]
pub fn lane_of(self) -> Type
[src]The type transformation that returns the lane type of a type variable; it is just a renaming of lane_type() to be used in context where we think in terms of type variable transformations.
pub fn log2_lane_bits(self) -> u8
[src]
pub fn log2_lane_bits(self) -> u8
[src]Get log_2 of the number of bits in a lane.
pub fn as_bool_pedantic(self) -> Type
[src]
pub fn as_bool_pedantic(self) -> Type
[src]Get a type with the same number of lanes as this type, but with the lanes replaced by booleans of the same size.
Lane types are treated as vectors with one lane, so they are converted to the multi-bit boolean types.
pub fn as_bool(self) -> Type
[src]
pub fn as_bool(self) -> Type
[src]Get a type with the same number of lanes as this type, but with the lanes replaced by booleans of the same size.
Scalar types are all converted to b1
which is usually what you want.
pub fn half_width(self) -> Option<Type>
[src]
pub fn half_width(self) -> Option<Type>
[src]Get a type with the same number of lanes as this type, but with lanes that are half the number of bits.
pub fn double_width(self) -> Option<Type>
[src]
pub fn double_width(self) -> Option<Type>
[src]Get a type with the same number of lanes as this type, but with lanes that are twice the number of bits.
pub fn is_invalid(self) -> bool
[src]
pub fn is_invalid(self) -> bool
[src]Is this the INVALID type?
pub fn is_special(self) -> bool
[src]
pub fn is_special(self) -> bool
[src]Is this a special type?
pub fn is_lane(self) -> bool
[src]
pub fn is_lane(self) -> bool
[src]Is this a lane type?
This is a scalar type that can also appear as the lane type of a SIMD vector.
pub fn log2_lane_count(self) -> u8
[src]
pub fn log2_lane_count(self) -> u8
[src]Get log_2 of the number of lanes in this SIMD vector type.
All SIMD types have a lane count that is a power of two and no larger than 256, so this will be a number in the range 0-8.
A scalar type is the same as a SIMD vector type with one lane, so it returns 0.
pub fn lane_count(self) -> u16
[src]
pub fn lane_count(self) -> u16
[src]Get the number of lanes in this SIMD vector type.
A scalar type is the same as a SIMD vector type with one lane, so it returns 1.
pub fn by(self, n: u16) -> Option<Type>
[src]
pub fn by(self, n: u16) -> Option<Type>
[src]Get a SIMD vector type with n
times more lanes than this one.
If this is a scalar type, this produces a SIMD type with this as a lane type and n
lanes.
If this is already a SIMD vector type, this produces a SIMD vector type with n * self.lane_count()
lanes.
pub fn half_vector(self) -> Option<Type>
[src]
pub fn half_vector(self) -> Option<Type>
[src]Get a SIMD vector with half the number of lanes.
There is no double_vector()
method. Use t.by(2)
instead.
pub fn split_lanes(self) -> Option<Type>
[src]
pub fn split_lanes(self) -> Option<Type>
[src]Split the lane width in half and double the number of lanes to maintain the same bit-width.
If this is a scalar type of n
bits, it produces a SIMD vector type of (n/2)x2
.
pub fn merge_lanes(self) -> Option<Type>
[src]
pub fn merge_lanes(self) -> Option<Type>
[src]Merge lanes to half the number of lanes and double the lane width to maintain the same bit-width.
If this is a scalar type, it will return None
.
pub fn wider_or_equal(self, other: Type) -> bool
[src]
pub fn wider_or_equal(self, other: Type) -> bool
[src]True iff:
self.lane_count() == other.lane_count()
andself.lane_bits() >= other.lane_bits()
pub fn triple_pointer_type(triple: &Triple) -> Type
[src]
pub fn triple_pointer_type(triple: &Triple) -> Type
[src]Return the pointer type for the given target triple.
Trait Implementations
impl<'de> Deserialize<'de> for Type
[src]
impl<'de> Deserialize<'de> for Type
[src]pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Type, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Type, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl Serialize for Type
[src]
impl Serialize for Type
[src]pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]Serialize this value into the given Serde serializer. Read more
impl Copy for Type
[src]
impl Eq for Type
[src]
impl StructuralEq for Type
[src]
impl StructuralPartialEq for Type
[src]
Auto Trait Implementations
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]pub fn equivalent(&self, key: &K) -> bool
[src]
pub fn equivalent(&self, key: &K) -> bool
[src]Compare self to key
and return true
if they are equal.
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,