[−][src]Struct cranelift_codegen_shared::isa::x86::EncodingBits
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
Fields
opcode_byte: u8Instruction opcode byte, without the prefix.
prefix: OpcodePrefixPrefix kind for the instruction, as an enum.
rrr: Integer<u8, Bits3>Bits for the ModR/M byte for certain opcodes.
rex_w: Integer<u8, Bits1>REX.W bit (or VEX.W/E).
Methods
impl EncodingBits[src]
pub fn packed_struct_display_formatter<'a>(
&'a self
) -> PackedStructDisplay<'a, Self, [u8; 2]>[src]
&'a self
) -> PackedStructDisplay<'a, Self, [u8; 2]>
Display formatter for console applications
impl EncodingBits[src]
pub fn new(op_bytes: &[u8], rrr: u16, rex_w: u16) -> Self[src]
Constructs a new EncodingBits from parts.
pub fn bits(self) -> u16[src]
Returns the raw bits.
pub fn pp(self) -> u8[src]
Extracts the PP bits of the OpcodePrefix.
pub fn mm(self) -> u8[src]
Extracts the MM bits of the OpcodePrefix.
Trait Implementations
impl From<u16> for EncodingBits[src]
fn from(bits: u16) -> EncodingBits[src]
impl Clone for EncodingBits[src]
fn clone(&self) -> EncodingBits[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Copy for EncodingBits[src]
impl PartialEq<EncodingBits> for EncodingBits[src]
fn eq(&self, other: &EncodingBits) -> bool[src]
fn ne(&self, other: &EncodingBits) -> bool[src]
impl Display for EncodingBits[src]
impl StructuralPartialEq for EncodingBits[src]
impl PackedStruct<[u8; 2]> for EncodingBits[src]
Structure that can be packed an unpacked into 2 bytes.
| Bit, MSB0 | Name | Type |
| 8:15 | opcode_byte | u8 |
| 4:7 | prefix | OpcodePrefix |
| 1:3 | rrr | Integer < u8 , packed_bits :: Bits3 > |
| 0 | rex_w | Integer < u8 , packed_bits :: Bits1 > |
impl PackedStructInfo for EncodingBits[src]
fn packed_bits() -> usize[src]
impl PackedStructSlice for EncodingBits[src]
fn pack_to_slice(&self, output: &mut [u8]) -> Result<(), PackingError>[src]
fn unpack_from_slice(src: &[u8]) -> Result<Self, PackingError>[src]
fn packed_bytes() -> usize[src]
fn pack_to_vec(&self) -> Result<Vec<u8>, PackingError>[src]
impl PackedStructDebug for EncodingBits[src]
fn fmt_fields(&self, fmt: &mut Formatter) -> Result<(), Error>[src]
fn packed_struct_display_header() -> &'static str[src]
Auto Trait Implementations
impl Send for EncodingBits
impl Sync for EncodingBits
impl Unpin for EncodingBits
impl UnwindSafe for EncodingBits
impl RefUnwindSafe for EncodingBits
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,