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§

source§

impl AssemblerX64

source

fn new(baseaddr: usize, target: Option<Target>) -> Result<Self, CompileError>

source

fn finalize(self) -> Result<Vec<u8>, DynasmError>

Methods from Deref<Target = VecAssembler<X64Relocation>>§

pub fn new_dynamic_label(&mut self) -> DynamicLabel

Create a new dynamic label ID

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<'_>

Use an UncommittedModifier to alter uncommitted code. This does not allow the user to change labels/relocations.

pub fn labels(&self) -> &LabelRegistry

Provides access to the assemblers internal labels registry

pub fn labels_mut(&mut self) -> &mut LabelRegistry

Provides mutable access to the assemblers internal labels registry

Trait Implementations§

source§

impl Deref for AssemblerX64

§

type Target = VecAssembler<X64Relocation>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl DerefMut for AssemblerX64

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl EmitterX64 for AssemblerX64

source§

fn get_simd_arch(&self) -> Option<&CpuFeature>

source§

fn get_label(&mut self) -> DynamicLabel

source§

fn get_offset(&self) -> AssemblyOffset

source§

fn get_jmp_instr_size(&self) -> u8

source§

fn finalize_function(&mut self) -> Result<(), CompileError>

source§

fn arch_has_xzcnt(&self) -> bool

source§

fn arch_emit_lzcnt( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn arch_emit_tzcnt( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_u64(&mut self, x: u64) -> Result<(), CompileError>

source§

fn emit_bytes(&mut self, bytes: &[u8]) -> Result<(), CompileError>

source§

fn emit_label(&mut self, label: DynamicLabel) -> Result<(), CompileError>

source§

fn emit_nop(&mut self) -> Result<(), CompileError>

source§

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.
source§

fn emit_mov( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_lea( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_lea_label( &mut self, label: DynamicLabel, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_cdq(&mut self) -> Result<(), CompileError>

source§

fn emit_cqo(&mut self) -> Result<(), CompileError>

source§

fn emit_xor( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_jmp( &mut self, condition: Condition, label: DynamicLabel, ) -> Result<(), CompileError>

source§

fn emit_jmp_location( &mut self, loc: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_set( &mut self, condition: Condition, dst: GPR, ) -> Result<(), CompileError>

source§

fn emit_push( &mut self, sz: Size, src: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_pop( &mut self, sz: Size, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_cmp( &mut self, sz: Size, left: Location<GPR, XMM>, right: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_add( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_sub( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_neg( &mut self, sz: Size, value: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_imul( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_imul_imm32_gpr64( &mut self, src: u32, dst: GPR, ) -> Result<(), CompileError>

source§

fn emit_div( &mut self, sz: Size, divisor: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_idiv( &mut self, sz: Size, divisor: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_shl( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_shr( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_sar( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_rol( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_ror( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_and( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_test( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_or( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_bsr( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_bsf( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_popcnt( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_movzx( &mut self, sz_src: Size, src: Location<GPR, XMM>, sz_dst: Size, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_movsx( &mut self, sz_src: Size, src: Location<GPR, XMM>, sz_dst: Size, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_xchg( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_lock_xadd( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_lock_cmpxchg( &mut self, sz: Size, src: Location<GPR, XMM>, dst: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_rep_stosq(&mut self) -> Result<(), CompileError>

source§

fn emit_btc_gpr_imm8_32( &mut self, src: u8, dst: GPR, ) -> Result<(), CompileError>

source§

fn emit_btc_gpr_imm8_64( &mut self, src: u8, dst: GPR, ) -> Result<(), CompileError>

source§

fn emit_cmovae_gpr_32(&mut self, src: GPR, dst: GPR) -> Result<(), CompileError>

source§

fn emit_cmovae_gpr_64(&mut self, src: GPR, dst: GPR) -> Result<(), CompileError>

source§

fn emit_vmovaps( &mut self, src: XMMOrMemory, dst: XMMOrMemory, ) -> Result<(), CompileError>

source§

fn emit_vmovapd( &mut self, src: XMMOrMemory, dst: XMMOrMemory, ) -> Result<(), CompileError>

source§

fn emit_vxorps( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vxorpd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vaddss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vaddsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vsubss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vsubsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vmulss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vmulsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vdivss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vdivsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vmaxss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vmaxsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vminss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vminsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpeqss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpeqsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpneqss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpneqsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpltss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpltsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpless( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmplesd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpgtss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpgtsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpgess( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpgesd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpunordss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpunordsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpordss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcmpordsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vsqrtss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vsqrtsd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcvtss2sd( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcvtsd2ss( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vroundss_nearest( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vroundsd_nearest( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vroundss_floor( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vroundsd_floor( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vroundss_ceil( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vroundsd_ceil( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vroundss_trunc( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vroundsd_trunc( &mut self, src1: XMM, src2: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcvtsi2ss_32( &mut self, src1: XMM, src2: GPROrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcvtsi2sd_32( &mut self, src1: XMM, src2: GPROrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcvtsi2ss_64( &mut self, src1: XMM, src2: GPROrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vcvtsi2sd_64( &mut self, src1: XMM, src2: GPROrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vblendvps( &mut self, src1: XMM, src2: XMMOrMemory, mask: XMM, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_vblendvpd( &mut self, src1: XMM, src2: XMMOrMemory, mask: XMM, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_ucomiss( &mut self, src: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_ucomisd( &mut self, src: XMMOrMemory, dst: XMM, ) -> Result<(), CompileError>

source§

fn emit_cvttss2si_32( &mut self, src: XMMOrMemory, dst: GPR, ) -> Result<(), CompileError>

source§

fn emit_cvttss2si_64( &mut self, src: XMMOrMemory, dst: GPR, ) -> Result<(), CompileError>

source§

fn emit_cvttsd2si_32( &mut self, src: XMMOrMemory, dst: GPR, ) -> Result<(), CompileError>

source§

fn emit_cvttsd2si_64( &mut self, src: XMMOrMemory, dst: GPR, ) -> Result<(), CompileError>

source§

fn emit_test_gpr_64(&mut self, reg: GPR) -> Result<(), CompileError>

source§

fn emit_ud2(&mut self) -> Result<(), CompileError>

source§

fn emit_ud1_payload(&mut self, payload: u8) -> Result<(), CompileError>

source§

fn emit_ret(&mut self) -> Result<(), CompileError>

source§

fn emit_call_label(&mut self, label: DynamicLabel) -> Result<(), CompileError>

source§

fn emit_call_location( &mut self, loc: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn emit_call_register(&mut self, reg: GPR) -> Result<(), CompileError>

source§

fn emit_bkpt(&mut self) -> Result<(), CompileError>

source§

fn emit_host_redirection(&mut self, target: GPR) -> Result<(), CompileError>

source§

fn arch_mov64_imm_offset(&self) -> Result<usize, CompileError>

source§

fn arch_has_itruncf(&self) -> bool

source§

fn arch_emit_i32_trunc_sf32( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>

source§

fn arch_emit_i32_trunc_sf64( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>

source§

fn arch_emit_i32_trunc_uf32( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>

source§

fn arch_emit_i32_trunc_uf64( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>

source§

fn arch_emit_i64_trunc_sf32( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>

source§

fn arch_emit_i64_trunc_sf64( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>

source§

fn arch_emit_i64_trunc_uf32( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>

source§

fn arch_emit_i64_trunc_uf64( &mut self, _src: XMM, _dst: GPR, ) -> Result<(), CompileError>

source§

fn arch_has_fconverti(&self) -> bool

source§

fn arch_emit_f32_convert_si32( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_emit_f32_convert_si64( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_emit_f32_convert_ui32( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_emit_f32_convert_ui64( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_emit_f64_convert_si32( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_emit_f64_convert_si64( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_emit_f64_convert_ui32( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_emit_f64_convert_ui64( &mut self, _src: GPR, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_has_fneg(&self) -> bool

source§

fn arch_emit_f32_neg( &mut self, _src: XMM, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_emit_f64_neg( &mut self, _src: XMM, _dst: XMM, ) -> Result<(), CompileError>

source§

fn arch_supports_canonicalize_nan(&self) -> bool

source§

fn arch_requires_indirect_call_trampoline(&self) -> bool

source§

fn arch_emit_indirect_call_with_trampoline( &mut self, _loc: Location<GPR, XMM>, ) -> Result<(), CompileError>

source§

fn arch_emit_entry_trampoline(&mut self) -> Result<(), CompileError>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

§

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 N2
where T: SharedNiching<N1, N2>, N1: Niching<T>, N2: Niching<T>,

§

unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool

Returns whether the given value has been niched. Read more
§

fn resolve_niched(out: Place<NichedOption<T, N1>>)

Writes data to out indicating that a T is niched.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

The metadata type for pointers and references to this type.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcastable for T
where T: Any + Send + Sync + 'static,

§

fn upcast_any_ref(&self) -> &(dyn Any + 'static)

upcast ref
§

fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)

upcast mut ref
§

fn upcast_any_box(self: Box<T>) -> Box<dyn Any>

upcast boxed dyn