Skip to main content

OpRwInfo

Struct OpRwInfo 

Source
pub struct OpRwInfo {
    pub op_flags: OpRwFlags,
    pub phys_id: u8,
    pub rm_size: u8,
    pub consecutive_lead_count: u8,
    pub read_byte_mask: u64,
    pub write_byte_mask: u64,
    pub extend_byte_mask: u64,
}
Expand description

Read/write information related to a single operand, used by InstRwInfo.

phys_id is always INVALID_PHYS_ID unless a physical register is required — unlike AsmJit (where value-initialization leaves it 0), asmkit keeps one “no phys id” sentinel.

Fields§

§op_flags: OpRwFlags

Read/write flags.

§phys_id: u8

Physical register index, if required (INVALID_PHYS_ID otherwise).

§rm_size: u8

Size of a possible memory operand that can replace a register operand.

§consecutive_lead_count: u8

If non-zero, this is a consecutive lead register and the value describes how many registers follow.

§read_byte_mask: u64

Read bit-mask where each bit represents one byte read from Reg/Mem.

§write_byte_mask: u64

Write bit-mask where each bit represents one byte written to Reg/Mem.

§extend_byte_mask: u64

Zero/sign extend bit-mask where each bit represents one byte written to Reg/Mem.

Implementations§

Source§

impl OpRwInfo

Source

pub const fn new() -> Self

Returns this operand info with all members reset to zero.

Source

pub fn reset(&mut self, op_flags: OpRwFlags, register_size: u32, phys_id: u8)

Resets this operand info to op_flags, register_size, and possibly phys_id, computing full byte masks from the flags (mirrors AsmJit’s OpRWInfo::reset).

Source

pub const fn is_read(&self) -> bool

Tests whether this operand is read from.

Source

pub const fn is_write(&self) -> bool

Tests whether this operand is written to.

Source

pub const fn is_read_write(&self) -> bool

Tests whether this operand is both read and written.

Source

pub const fn is_read_only(&self) -> bool

Tests whether this operand is read-only.

Source

pub const fn is_write_only(&self) -> bool

Tests whether this operand is write-only.

Trait Implementations§

Source§

impl Clone for OpRwInfo

Source§

fn clone(&self) -> OpRwInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for OpRwInfo

Source§

impl Debug for OpRwInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for OpRwInfo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for OpRwInfo

Source§

impl PartialEq for OpRwInfo

Source§

fn eq(&self, other: &OpRwInfo) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for OpRwInfo

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
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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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.