Module dsl

Source
Expand description

Defines a domain-specific language (DSL) for describing x64 instructions.

This language is intended to be:

  • compact–i.e., define an x64 instruction on a single line, and
  • a close-to-direct mapping of what we read in the x64 reference manual.

Re-exports§

pub use format::Eflags;
pub use format::Extension;
pub use format::Format;
pub use format::Location;
pub use format::Mutability;
pub use format::Operand;
pub use format::OperandKind;
pub use format::RegClass;
pub use format::align;
pub use format::fmt;
pub use format::implicit;
pub use format::r;
pub use format::rw;
pub use format::sxl;
pub use format::sxq;
pub use format::sxw;
pub use format::w;

Modules§

format
A DSL for describing x64 instruction formats–the shape of the operands.

Structs§

Alternate
An alternate version of an instruction.
Custom
Evex
Inst
An x64 instruction.
Opcodes
Describe an instruction’s opcodes. From section 2.1.2 “Opcodes” in the reference manual:
Prefixes
The allowed prefixes for an instruction. From the reference manual (section 2.1.1):
Rex
The traditional x64 encoding.
Vex
The VEX encoding, introduced for AVX instructions.

Enums§

Customization
Encoding
Enumerate the ways x64 encodes instructions.
Feature
A CPU feature.
Features
A boolean term of CPU features.
Group1Prefix
Group2Prefix
Contains the segment override prefixes or a (deprecated) branch hint when used on a Jcc instruction. Note that using the segment override prefixes on a branch instruction is reserved. See section 2.1.1, “Instruction Prefixes,” in the reference manual.
Group3Prefix
Contains the operand-size override prefix (0x66); also used as a SIMD prefix. From the reference manual:
Group4Prefix
Contains the address-size override prefix (0x67). From the reference manual:
Length
Contains vector length definitions.
ModRmKind
OpcodeMod
Indicate the size of the reg used when modifying the lower three bits of the opcode byte; this corresponds to the +rb, +rw, +rd, and +ro modifiers in the reference manual.
TupleType
Tuple Type definitions used in EVEX encodings.
VexEscape
Contains the escape sequences allowed for VEX-encoded instructions.
VexPrefix
Contains the legacy prefixes allowed for VEX-encoded instructions.

Constants§

ALL_FEATURES
List all CPU features.

Functions§

evex
An abbreviated constructor for EVEX-encoded instructions.
inst
Abbreviated constructor for an x64 instruction.
rex
An abbreviated constructor for REX-encoded instructions.
vex
An abbreviated constructor for VEX-encoded instructions.