pub struct AssemblerX64 {
pub inner: VecAssembler<X64Relocation>,
pub simd_arch: Option<CpuFeature>,
pub target: Option<Target>,
}
Fields§
§inner: VecAssembler<X64Relocation>
the actual inner
simd_arch: Option<CpuFeature>
the simd instructions set on the target. Currently only supports SSE 4.2 and AVX
target: Option<Target>
Full Target cpu
Implementations§
Methods from Deref<Target = VecAssembler<X64Relocation>>§
pub fn new_dynamic_label(&mut self) -> DynamicLabel
pub fn new_dynamic_label(&mut self) -> DynamicLabel
Create a new dynamic label ID
pub fn commit(&mut self) -> Result<(), DynasmError>
pub fn commit(&mut self) -> Result<(), DynasmError>
Resolves any relocations emitted to the assembler before this point. If an impossible relocation was specified before this point, returns them here.
pub fn alter(&mut self) -> UncommittedModifier<'_>
pub fn alter(&mut self) -> UncommittedModifier<'_>
Use an UncommittedModifier
to alter uncommitted code.
This does not allow the user to change labels/relocations.
pub fn labels(&self) -> &LabelRegistry
pub fn labels(&self) -> &LabelRegistry
Provides access to the assemblers internal labels registry
pub fn labels_mut(&mut self) -> &mut LabelRegistry
pub fn labels_mut(&mut self) -> &mut LabelRegistry
Provides mutable access to the assemblers internal labels registry
Trait Implementations§
source§impl Deref for AssemblerX64
impl Deref for AssemblerX64
source§impl DerefMut for AssemblerX64
impl DerefMut for AssemblerX64
source§impl EmitterX64 for AssemblerX64
impl EmitterX64 for AssemblerX64
fn get_simd_arch(&self) -> Option<&CpuFeature>
fn get_label(&mut self) -> DynamicLabel
fn get_offset(&self) -> AssemblyOffset
fn get_jmp_instr_size(&self) -> u8
fn finalize_function(&mut self) -> Result<(), CompileError>
fn arch_has_xzcnt(&self) -> bool
fn arch_emit_lzcnt( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn arch_emit_tzcnt( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_u64(&mut self, x: u64) -> Result<(), CompileError>
fn emit_bytes(&mut self, bytes: &[u8]) -> Result<(), CompileError>
fn emit_label(&mut self, label: DynamicLabel) -> Result<(), CompileError>
fn emit_nop(&mut self) -> Result<(), CompileError>
source§fn emit_nop_n(&mut self, n: usize) -> Result<(), CompileError>
fn emit_nop_n(&mut self, n: usize) -> Result<(), CompileError>
A high-level assembler method. Emits an instruction sequence of length
n
that is functionally
equivalent to a nop
instruction, without guarantee about the underlying implementation.fn emit_mov( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_lea( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_lea_label( &mut self, label: DynamicLabel, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_cdq(&mut self) -> Result<(), CompileError>
fn emit_cqo(&mut self) -> Result<(), CompileError>
fn emit_xor( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_jmp( &mut self, condition: Condition, label: DynamicLabel, ) -> Result<(), CompileError>
fn emit_jmp_location( &mut self, loc: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_set( &mut self, condition: Condition, dst: GPR, ) -> Result<(), CompileError>
fn emit_push( &mut self, sz: Size, src: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_pop( &mut self, sz: Size, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_cmp( &mut self, sz: Size, left: Location<GPR, XMM>, right: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_add( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_sub( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_neg( &mut self, sz: Size, value: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_imul( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_imul_imm32_gpr64( &mut self, src: u32, dst: GPR, ) -> Result<(), CompileError>
fn emit_div( &mut self, sz: Size, divisor: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_idiv( &mut self, sz: Size, divisor: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_shl( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_shr( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_sar( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_rol( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_ror( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_and( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_test( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_or( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_bsr( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_bsf( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_popcnt( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_movzx( &mut self, sz_src: Size, src: Location<GPR, XMM>, sz_dst: Size, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_movsx( &mut self, sz_src: Size, src: Location<GPR, XMM>, sz_dst: Size, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_xchg( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_lock_xadd( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_lock_cmpxchg( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_rep_stosq(&mut self) -> Result<(), CompileError>
fn emit_btc_gpr_imm8_32( &mut self, src: u8, dst: GPR, ) -> Result<(), CompileError>
fn emit_btc_gpr_imm8_64( &mut self, src: u8, dst: GPR, ) -> Result<(), CompileError>
fn emit_cmovae_gpr_32(&mut self, src: GPR, dst: GPR) -> Result<(), CompileError>
fn emit_cmovae_gpr_64(&mut self, src: GPR, dst: GPR) -> Result<(), CompileError>
fn emit_vmovaps( &mut self, src: XMMOrMemory, dst: XMMOrMemory, ) -> Result<(), CompileError>
fn emit_vmovapd( &mut self, src: XMMOrMemory, dst: XMMOrMemory, ) -> Result<(), CompileError>
fn emit_vxorps( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vxorpd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vaddss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vaddsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vsubss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vsubsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vmulss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vmulsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vdivss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vdivsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vmaxss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vmaxsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vminss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vminsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpeqss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpeqsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpneqss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpneqsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpltss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpltsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpless( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmplesd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpgtss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpgtsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpgess( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpgesd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpunordss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpunordsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpordss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcmpordsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vsqrtss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vsqrtsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcvtss2sd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcvtsd2ss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vroundss_nearest( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vroundsd_nearest( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vroundss_floor( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vroundsd_floor( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vroundss_ceil( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vroundsd_ceil( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vroundss_trunc( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vroundsd_trunc( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcvtsi2ss_32( &mut self, src1: XMM, src2: GPROrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcvtsi2sd_32( &mut self, src1: XMM, src2: GPROrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcvtsi2ss_64( &mut self, src1: XMM, src2: GPROrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vcvtsi2sd_64( &mut self, src1: XMM, src2: GPROrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_vblendvps( &mut self, src1: XMM, src2: XMMOrMemory, mask: XMM, dst: XMM, ) -> Result<(), CompileError>
fn emit_vblendvpd( &mut self, src1: XMM, src2: XMMOrMemory, mask: XMM, dst: XMM, ) -> Result<(), CompileError>
fn emit_ucomiss( &mut self, src: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_ucomisd( &mut self, src: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>
fn emit_cvttss2si_32( &mut self, src: XMMOrMemory, dst: GPR, ) -> Result<(), CompileError>
fn emit_cvttss2si_64( &mut self, src: XMMOrMemory, dst: GPR, ) -> Result<(), CompileError>
fn emit_cvttsd2si_32( &mut self, src: XMMOrMemory, dst: GPR, ) -> Result<(), CompileError>
fn emit_cvttsd2si_64( &mut self, src: XMMOrMemory, dst: GPR, ) -> Result<(), CompileError>
fn emit_test_gpr_64(&mut self, reg: GPR) -> Result<(), CompileError>
fn emit_ud2(&mut self) -> Result<(), CompileError>
fn emit_ud1_payload(&mut self, payload: u8) -> Result<(), CompileError>
fn emit_ret(&mut self) -> Result<(), CompileError>
fn emit_call_label(&mut self, label: DynamicLabel) -> Result<(), CompileError>
fn emit_call_location( &mut self, loc: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn emit_call_register(&mut self, reg: GPR) -> Result<(), CompileError>
fn emit_bkpt(&mut self) -> Result<(), CompileError>
fn emit_host_redirection(&mut self, target: GPR) -> Result<(), CompileError>
fn arch_mov64_imm_offset(&self) -> Result<usize, CompileError>
fn arch_has_itruncf(&self) -> bool
fn arch_emit_i32_trunc_sf32( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>
fn arch_emit_i32_trunc_sf64( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>
fn arch_emit_i32_trunc_uf32( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>
fn arch_emit_i32_trunc_uf64( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>
fn arch_emit_i64_trunc_sf32( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>
fn arch_emit_i64_trunc_sf64( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>
fn arch_emit_i64_trunc_uf32( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>
fn arch_emit_i64_trunc_uf64( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>
fn arch_has_fconverti(&self) -> bool
fn arch_emit_f32_convert_si32( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>
fn arch_emit_f32_convert_si64( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>
fn arch_emit_f32_convert_ui32( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>
fn arch_emit_f32_convert_ui64( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>
fn arch_emit_f64_convert_si32( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>
fn arch_emit_f64_convert_si64( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>
fn arch_emit_f64_convert_ui32( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>
fn arch_emit_f64_convert_ui64( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>
fn arch_has_fneg(&self) -> bool
fn arch_emit_f32_neg( &mut self, _src: XMM, _dst: XMM, ) -> Result<(), CompileError>
fn arch_emit_f64_neg( &mut self, _src: XMM, _dst: XMM, ) -> Result<(), CompileError>
fn arch_supports_canonicalize_nan(&self) -> bool
fn arch_requires_indirect_call_trampoline(&self) -> bool
fn arch_emit_indirect_call_with_trampoline( &mut self, _loc: Location<GPR, XMM>, ) -> Result<(), CompileError>
fn arch_emit_entry_trampoline(&mut self) -> Result<(), CompileError>
Auto Trait Implementations§
impl Freeze for AssemblerX64
impl RefUnwindSafe for AssemblerX64
impl Send for AssemblerX64
impl Sync for AssemblerX64
impl Unpin for AssemblerX64
impl UnwindSafe for AssemblerX64
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2where
T: SharedNiching<N1, N2>,
N1: Niching<T>,
N2: Niching<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> Upcastable for T
impl<T> Upcastable for T
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
§fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
upcast boxed dyn