pub enum LoopType {
Void,
Scalar(ScalarType),
Vector(ScalarType, u8),
Ptr(Box<LoopType>),
}Expand description
Types in Loop IR.
Variants§
Void
Void (no value).
Scalar(ScalarType)
Scalar type.
Vector(ScalarType, u8)
Vector type (SIMD).
Ptr(Box<LoopType>)
Pointer to memory.
Implementations§
Source§impl LoopType
impl LoopType
Sourcepub fn natural_vector_width(scalar: ScalarType, target: TargetArch) -> u8
pub fn natural_vector_width(scalar: ScalarType, target: TargetArch) -> u8
Returns the natural vector width for a scalar type on the target.
§Target Widths
| Target | F32 | F64 | I32 |
|---|---|---|---|
| x86_64 (SSE) | 4 | 2 | 4 |
| x86_64 (AVX) | 8 | 4 | 8 |
| aarch64 (NEON) | 4 | 2 | 4 |
Sourcepub const fn vector(scalar: ScalarType, width: u8) -> Self
pub const fn vector(scalar: ScalarType, width: u8) -> Self
Creates a vector type for the given scalar and width.
Sourcepub fn vector_width(&self) -> Option<u8>
pub fn vector_width(&self) -> Option<u8>
Returns the vector width if this is a vector type, otherwise None.
Sourcepub fn element_type(&self) -> Option<ScalarType>
pub fn element_type(&self) -> Option<ScalarType>
Returns the scalar element type if this is a vector type.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for LoopType
impl<'de> Deserialize<'de> for LoopType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for LoopType
impl StructuralPartialEq for LoopType
Auto Trait Implementations§
impl Freeze for LoopType
impl RefUnwindSafe for LoopType
impl Send for LoopType
impl Sync for LoopType
impl Unpin for LoopType
impl UnsafeUnpin for LoopType
impl UnwindSafe for LoopType
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