Expand description
A DSL for describing x64 instruction formats–the shape of the operands.
Every instruction has a format that corresponds to its encoding’s expected operands. The format is what allows us to generate code that accepts operands of the right type and check that the operands are used in the right way.
The entry point for this module is fmt
.
let f = fmt("rm", [rw(r32), r(rm32)]);
assert_eq!(f.to_string(), "rm(r32[rw], rm32)")
Structs§
Enums§
- Eflags
- Describes if an instruction uses EFLAGS, and whether it reads, writes, or reads/writes the EFLAGS register. In the future, we might want to model specific EFLAGS bits instead of the entire EFLAGS register. Some related discussion in this GitHub issue https://github.com/bytecodealliance/wasmtime/issues/10298
- Extension
- x64 operands may be sign- or zero-extended.
- Location
- An operand location, as expressed in Intel’s Instruction Set Reference.
- Mutability
- x64 operands can be mutable or not.
- Operand
Kind - Organize the operand locations by kind.
- RegClass
- The kind of register used in a
Location
.
Functions§
- align
- An abbreviated constructor for a memory operand that requires alignment.
- fmt
- An abbreviated constructor for an instruction “format.”
- implicit
- An abbreviated constructor for an operand that is used by the instruction but not visible in its disassembly.
- r
- An abbreviated constructor for a “read” operand.
- rw
- An abbreviated constructor for a “read-write” operand.
- sxl
- An abbreviated constructor for a “read” operand that is sign-extended to 32 bits (longword).
- sxq
- An abbreviated constructor for a “read” operand that is sign-extended to 64 bits (quadword).
- sxw
- An abbreviated constructor for a “read” operand that is sign-extended to 16 bits (word).
- w
- An abbreviated constructor for a “write” operand.