pub trait TargetIsa: Display + Send + Sync {
fn name(&self) -> &'static str;
fn triple(&self) -> &Triple;
fn flags(&self) -> &Flags;
fn isa_flags(&self) -> Vec<Value, Global>;
fn compile_function(
&self,
func: &Function,
want_disasm: bool
) -> Result<MachCompileResult, CodegenError>;
fn unsigned_add_overflow_condition(&self) -> IntCC;
fn text_section_builder(
&self,
num_labeled_funcs: u32
) -> Box<dyn TextSectionBuilder + 'static, Global>;
}
Expand description
Methods that are specialized to a target ISA.
Implies a Display trait that shows the shared flags, as well as any ISA-specific flags.
Required Methods
Get the ISA-independent flags that were used to make this trait object.
Get the ISA-dependent flag values that were used to make this trait object.
fn compile_function(
&self,
func: &Function,
want_disasm: bool
) -> Result<MachCompileResult, CodegenError>
fn compile_function(
&self,
func: &Function,
want_disasm: bool
) -> Result<MachCompileResult, CodegenError>
Compile the given function.
fn unsigned_add_overflow_condition(&self) -> IntCC
fn unsigned_add_overflow_condition(&self) -> IntCC
IntCC condition for Unsigned Addition Overflow (Carry).
fn text_section_builder(
&self,
num_labeled_funcs: u32
) -> Box<dyn TextSectionBuilder + 'static, Global>
fn text_section_builder(
&self,
num_labeled_funcs: u32
) -> Box<dyn TextSectionBuilder + 'static, Global>
Returns an object that can be used to build the text section of an executable.
This object will internally attempt to handle as many relocations as possible using relative calls/jumps/etc between functions.
The num_labeled_funcs
argument here is the number of functions which
will be “labeled” or might have calls between them, typically the number
of defined functions in the object file.
Implementations
sourceimpl<'a> dyn TargetIsa + 'a
impl<'a> dyn TargetIsa + 'a
Methods implemented for free for target ISA!
sourcepub fn default_call_conv(&self) -> CallConv
pub fn default_call_conv(&self) -> CallConv
Get the default calling convention of this target.
sourcepub fn endianness(&self) -> Endianness
pub fn endianness(&self) -> Endianness
Get the endianness of this ISA.
sourcepub fn code_section_alignment(&self) -> u64
pub fn code_section_alignment(&self) -> u64
Returns the code (text) section alignment for this ISA.
sourcepub fn pointer_type(&self) -> Type
pub fn pointer_type(&self) -> Type
Get the pointer type of this ISA.
sourcepub fn pointer_bits(&self) -> u8
pub fn pointer_bits(&self) -> u8
Get the width of pointers on this ISA, in units of bits.
sourcepub fn pointer_bytes(&self) -> u8
pub fn pointer_bytes(&self) -> u8
Get the width of pointers on this ISA, in units of bytes.
sourcepub fn frontend_config(&self) -> TargetFrontendConfig
pub fn frontend_config(&self) -> TargetFrontendConfig
Get the information needed by frontends producing Cranelift IR.
Trait Implementations
sourceimpl<'a> From<&'a (dyn TargetIsa + 'a)> for FlagsOrIsa<'a>
impl<'a> From<&'a (dyn TargetIsa + 'a)> for FlagsOrIsa<'a>
sourcefn from(isa: &'a (dyn TargetIsa + 'a)) -> FlagsOrIsa<'a>
fn from(isa: &'a (dyn TargetIsa + 'a)) -> FlagsOrIsa<'a>
Converts to this type from the input type.