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 . 8-9: pp, mandatory prefix: 00: none (Op*) 01: 66 (Mp*) 10: F3 (Mp*) 11: F2 (Mp*) 10-11: mm, opcode map: 00: (Op1/Mp1) 01: 0F (Op2/Mp2) 10: 0F 38 (Op3/Mp3) 11: 0F 3A (Op3/Mp3) 12-14 rrr, opcode bits for the ModR/M byte for certain opcodes. 15: REX.W bit (or VEX.W/E)

Implementations

Constructs a new EncodingBits from parts.

Returns a copy of the EncodingBits with the RRR bits set.

Returns a copy of the EncodingBits with the REX.W bit set.

Returns the raw bits.

Instruction opcode byte, without the prefix.

Prefix kind for the instruction, as an enum.

Extracts the PP bits of the OpcodePrefix.

Extracts the MM bits of the OpcodePrefix.

Bits for the ModR/M byte for certain opcodes.

REX.W bit (or VEX.W/E).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.