Struct cranelift_codegen_shared::isa::x86::EncodingBits
source · [−]pub struct EncodingBits(_);
Expand description
Named interface to the u16
Encoding bits, representing an opcode.
Cranelift requires each recipe to have a single encoding size in bytes. X86 opcodes are variable length, so we use separate recipes for different styles of opcodes and prefixes. The opcode format is indicated by the recipe name prefix.
VEX/XOP and EVEX prefixes are not yet supported. Encodings using any of these prefixes are represented by separate recipes.
The encoding bits are:
0-7: The opcode byte
Implementations
sourceimpl EncodingBits
impl EncodingBits
sourcepub fn new(op_bytes: &[u8], rrr: u16, rex_w: u16) -> Self
pub fn new(op_bytes: &[u8], rrr: u16, rex_w: u16) -> Self
Constructs a new EncodingBits from parts.
sourcepub fn with_rrr(self, rrr: u8) -> Self
pub fn with_rrr(self, rrr: u8) -> Self
Returns a copy of the EncodingBits with the RRR bits set.
sourcepub fn with_rex_w(self) -> Self
pub fn with_rex_w(self) -> Self
Returns a copy of the EncodingBits with the REX.W bit set.
sourcepub fn opcode_byte(self) -> u8
pub fn opcode_byte(self) -> u8
Instruction opcode byte, without the prefix.
sourcepub fn prefix(self) -> OpcodePrefix
pub fn prefix(self) -> OpcodePrefix
Prefix kind for the instruction, as an enum.
Trait Implementations
sourceimpl Clone for EncodingBits
impl Clone for EncodingBits
sourcefn clone(&self) -> EncodingBits
fn clone(&self) -> EncodingBits
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl PartialEq<EncodingBits> for EncodingBits
impl PartialEq<EncodingBits> for EncodingBits
sourcefn eq(&self, other: &EncodingBits) -> bool
fn eq(&self, other: &EncodingBits) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &EncodingBits) -> bool
fn ne(&self, other: &EncodingBits) -> bool
This method tests for !=
.
impl Copy for EncodingBits
impl StructuralPartialEq for EncodingBits
Auto Trait Implementations
impl RefUnwindSafe for EncodingBits
impl Send for EncodingBits
impl Sync for EncodingBits
impl Unpin for EncodingBits
impl UnwindSafe for EncodingBits
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more