pub struct ScalableVectorType<'ctx> { /* private fields */ }Expand description
A ScalableVectorType is the type of a scalable multiple value SIMD constant or variable.
Implementations§
Source§impl<'ctx> ScalableVectorType<'ctx>
impl<'ctx> ScalableVectorType<'ctx>
Sourcepub unsafe fn new(scalable_vector_type: LLVMTypeRef) -> Self
pub unsafe fn new(scalable_vector_type: LLVMTypeRef) -> Self
Create ScalableVectorType from LLVMTypeRef
§Safety
Undefined behavior, if referenced type isn’t scalable vector type
Sourcepub fn size_of(self) -> Option<IntValue<'ctx>>
pub fn size_of(self) -> Option<IntValue<'ctx>>
Gets the size of this ScalableVectorType. Value may vary depending on the target architecture.
§Example
use inkwell::context::Context;
let context = Context::create();
let f32_type = context.f32_type();
let f32_scalable_vec_type = f32_type.scalable_vec_type(3);
let f32_scalable_vec_type_size = f32_scalable_vec_type.size_of();Sourcepub fn get_size(self) -> u32
pub fn get_size(self) -> u32
Gets the size of this ScalableVectorType.
§Example
use inkwell::context::Context;
let context = Context::create();
let f32_type = context.f32_type();
let f32_scalable_vector_type = f32_type.scalable_vec_type(3);
assert_eq!(f32_scalable_vector_type.get_size(), 3);
assert_eq!(f32_scalable_vector_type.get_element_type().into_float_type(), f32_type);Sourcepub fn const_zero(self) -> ScalableVectorValue<'ctx>
pub fn const_zero(self) -> ScalableVectorValue<'ctx>
Sourcepub fn print_to_string(self) -> LLVMString
pub fn print_to_string(self) -> LLVMString
Print the definition of a ScalableVectorType to LLVMString.
Sourcepub fn get_undef(self) -> ScalableVectorValue<'ctx>
pub fn get_undef(self) -> ScalableVectorValue<'ctx>
Creates an undefined instance of a ScalableVectorType.
§Example
use inkwell::context::Context;
use inkwell::AddressSpace;
let context = Context::create();
let f32_type = context.f32_type();
let f32_scalable_vec_type = f32_type.scalable_vec_type(3);
let f32_scalable_vec_undef = f32_scalable_vec_type.get_undef();
assert!(f32_scalable_vec_undef.is_undef());Sourcepub fn get_poison(self) -> ScalableVectorValue<'ctx>
pub fn get_poison(self) -> ScalableVectorValue<'ctx>
Creates a poison instance of a ScalableVectorType.
§Example
use inkwell::context::Context;
use inkwell::AddressSpace;
let context = Context::create();
let f32_type = context.f32_type();
let f32_scalable_vec_type = f32_type.scalable_vec_type(3);
let f32_scalable_vec_poison = f32_scalable_vec_type.get_undef();
assert!(f32_scalable_vec_poison.is_undef());Sourcepub fn get_element_type(self) -> BasicTypeEnum<'ctx>
pub fn get_element_type(self) -> BasicTypeEnum<'ctx>
Gets the element type of this ScalableVectorType.
§Example
use inkwell::context::Context;
let context = Context::create();
let f32_type = context.f32_type();
let f32_scalable_vector_type = f32_type.scalable_vec_type(3);
assert_eq!(f32_scalable_vector_type.get_size(), 3);
assert_eq!(f32_scalable_vector_type.get_element_type().into_float_type(), f32_type);Sourcepub fn ptr_type(self, address_space: AddressSpace) -> PointerType<'ctx>
👎Deprecated: Starting from version 15.0, LLVM doesn’t differentiate between pointer types. Use Context::ptr_type instead.
pub fn ptr_type(self, address_space: AddressSpace) -> PointerType<'ctx>
Starting from version 15.0, LLVM doesn’t differentiate between pointer types. Use Context::ptr_type instead.
Creates a PointerType with this ScalableVectorType for its element type.
§Example
use inkwell::context::Context;
use inkwell::AddressSpace;
let context = Context::create();
let f32_type = context.f32_type();
let f32_scalable_vec_type = f32_type.scalable_vec_type(3);
let f32_scalable_vec_ptr_type = f32_scalable_vec_type.ptr_type(AddressSpace::default());
#[cfg(feature = "typed-pointers")]
assert_eq!(f32_scalable_vec_ptr_type.get_element_type().into_scalable_vector_type(), f32_scalable_vec_type);Sourcepub fn fn_type(
self,
param_types: &[BasicMetadataTypeEnum<'ctx>],
is_var_args: bool,
) -> FunctionType<'ctx>
pub fn fn_type( self, param_types: &[BasicMetadataTypeEnum<'ctx>], is_var_args: bool, ) -> FunctionType<'ctx>
Sourcepub fn array_type(self, size: u32) -> ArrayType<'ctx>
pub fn array_type(self, size: u32) -> ArrayType<'ctx>
Creates an ArrayType with this ScalableVectorType for its element type.
§Example
use inkwell::context::Context;
let context = Context::create();
let f32_type = context.f32_type();
let f32_scalable_vec_type = f32_type.scalable_vec_type(3);
let f32_scalable_vec_array_type = f32_scalable_vec_type.array_type(3);
assert_eq!(f32_scalable_vec_array_type.len(), 3);
assert_eq!(f32_scalable_vec_array_type.get_element_type().into_scalable_vector_type(), f32_scalable_vec_type);Sourcepub fn const_array(
self,
values: &[ScalableVectorValue<'ctx>],
) -> ArrayValue<'ctx>
pub fn const_array( self, values: &[ScalableVectorValue<'ctx>], ) -> ArrayValue<'ctx>
Creates a constant ArrayValue.
§Example
use inkwell::context::Context;
use inkwell::types::ScalableVectorType;
let context = Context::create();
let f32_type = context.f32_type();
let f32_val = f32_type.const_float(0.);
let f32_val2 = f32_type.const_float(2.);
let f32_scalable_vec_type = f32_type.scalable_vec_type(2);
let f32_scalable_vec_val = f32_scalable_vec_type.const_zero();
let f32_array = f32_scalable_vec_type.const_array(&[f32_scalable_vec_val, f32_scalable_vec_val]);
assert!(f32_array.is_const());Sourcepub fn get_context(self) -> ContextRef<'ctx>
pub fn get_context(self) -> ContextRef<'ctx>
Trait Implementations§
Source§impl<'ctx> AnyType<'ctx> for ScalableVectorType<'ctx>
impl<'ctx> AnyType<'ctx> for ScalableVectorType<'ctx>
Source§fn as_any_type_enum(&self) -> AnyTypeEnum<'ctx>
fn as_any_type_enum(&self) -> AnyTypeEnum<'ctx>
AnyTypeEnum that represents the current type.Source§fn print_to_string(&self) -> LLVMString
fn print_to_string(&self) -> LLVMString
LLVMString.Source§impl AsTypeRef for ScalableVectorType<'_>
impl AsTypeRef for ScalableVectorType<'_>
Source§fn as_type_ref(&self) -> LLVMTypeRef
fn as_type_ref(&self) -> LLVMTypeRef
Source§impl<'ctx> BasicType<'ctx> for ScalableVectorType<'ctx>
impl<'ctx> BasicType<'ctx> for ScalableVectorType<'ctx>
Source§fn as_basic_type_enum(&self) -> BasicTypeEnum<'ctx>
fn as_basic_type_enum(&self) -> BasicTypeEnum<'ctx>
BasicTypeEnum that represents the current type.Source§fn fn_type(
&self,
param_types: &[BasicMetadataTypeEnum<'ctx>],
is_var_args: bool,
) -> FunctionType<'ctx>
fn fn_type( &self, param_types: &[BasicMetadataTypeEnum<'ctx>], is_var_args: bool, ) -> FunctionType<'ctx>
Source§fn is_sized(&self) -> bool
fn is_sized(&self) -> bool
BasicType is sized or not.
For example, opaque structs are unsized. Read moreSource§fn size_of(&self) -> Option<IntValue<'ctx>>
fn size_of(&self) -> Option<IntValue<'ctx>>
BasicType. Value may vary depending on the target architecture. Read moreSource§fn get_alignment(&self) -> IntValue<'ctx>
fn get_alignment(&self) -> IntValue<'ctx>
BasicType. Value may vary depending on the target architecture. Read moreSource§fn array_type(&self, size: u32) -> ArrayType<'ctx>
fn array_type(&self, size: u32) -> ArrayType<'ctx>
Source§fn ptr_type(&self, address_space: AddressSpace) -> PointerType<'ctx>
fn ptr_type(&self, address_space: AddressSpace) -> PointerType<'ctx>
Starting from version 15.0, LLVM doesn’t differentiate between pointer types. Use Context::ptr_type instead.
Source§impl<'ctx> Clone for ScalableVectorType<'ctx>
impl<'ctx> Clone for ScalableVectorType<'ctx>
Source§fn clone(&self) -> ScalableVectorType<'ctx>
fn clone(&self) -> ScalableVectorType<'ctx>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more