pub struct RexPrefix { /* private fields */ }Expand description
Construct and emit the REX prefix byte.
For more details, see section 2.2.1, “REX Prefixes” in Intel’s reference manual.
Implementations§
Source§impl RexPrefix
impl RexPrefix
Sourcepub const fn one_op(enc: u8, w_bit: bool, uses_8bit: bool) -> Self
pub const fn one_op(enc: u8, w_bit: bool, uses_8bit: bool) -> Self
Construct the RexPrefix for a unary instruction.
Used with a single register operand:
xandrare unused.bextends theregregister, allowing access to r8-r15, or the top bit of the opcode digit.
Sourcepub const fn two_op(
enc_reg: u8,
enc_rm: u8,
w_bit: bool,
uses_8bit: bool,
) -> Self
pub const fn two_op( enc_reg: u8, enc_rm: u8, w_bit: bool, uses_8bit: bool, ) -> Self
Construct the RexPrefix for a binary instruction.
Used without a SIB byte or for register-to-register addressing:
rextends theregoperand, allowing access to r8-r15.xis unused.bextends ther/moperand, allowing access to r8-r15.
Sourcepub const fn mem_op(
enc_reg: u8,
enc_rm: u8,
w_bit: bool,
uses_8bit: bool,
) -> Self
pub const fn mem_op( enc_reg: u8, enc_rm: u8, w_bit: bool, uses_8bit: bool, ) -> Self
Construct the RexPrefix for a binary instruction where one operand
is a memory address.
This is the same as RexPrefix::two_op except that enc_rm is
guaranteed to address a 64-bit register. This has a slightly different
meaning when uses_8bit is true to omit the REX prefix in more cases
than two_op would emit.
Sourcepub const fn with_digit(
digit: u8,
enc_reg: u8,
w_bit: bool,
uses_8bit: bool,
) -> Self
pub const fn with_digit( digit: u8, enc_reg: u8, w_bit: bool, uses_8bit: bool, ) -> Self
Construct the RexPrefix for an instruction using an opcode digit.
:
rextends the opcode digit.xis unused.bextends theregoperand, allowing access to r8-r15.
Sourcepub const fn three_op(
enc_reg: u8,
enc_index: u8,
enc_base: u8,
w_bit: bool,
uses_8bit: bool,
) -> Self
pub const fn three_op( enc_reg: u8, enc_index: u8, enc_base: u8, w_bit: bool, uses_8bit: bool, ) -> Self
Construct the RexPrefix for a ternary instruction, typically using a
memory address.
Used with a SIB byte:
rextends theregoperand, allowing access to r8-r15.xextends the index register, allowing access to r8-r15.bextends the base register, allowing access to r8-r15.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RexPrefix
impl RefUnwindSafe for RexPrefix
impl Send for RexPrefix
impl Sync for RexPrefix
impl Unpin for RexPrefix
impl UnwindSafe for RexPrefix
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)