Skip to content

Commit 7e5a7e5

Browse files
authored
asm: improve DSL's understanding of prefixes (#10475)
* asm: improve DSL's understanding of prefixes Previously, Cranelift's x64 backend only understood a subset of the available prefixes that can be encoded and the documentation for these was quite sparse. This change upgrades the assembler to understand all kinds of prefixes, even those as yet unused, and drastically increases the amount of documentation around these prefixes. This, along with some new `Group`-based typing, should prevent accidental misuse but also increase confidence that this implementation is correctly covering the possible cases. * review: check for empty byte slice
1 parent 79b09fa commit 7e5a7e5

File tree

3 files changed

+247
-112
lines changed

3 files changed

+247
-112
lines changed

cranelift/assembler-x64/meta/src/dsl.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ mod encoding;
88
mod features;
99
pub mod format;
1010

11-
pub use encoding::{rex, vex, Encoding, LegacyPrefix, Rex};
11+
pub use encoding::{rex, vex};
12+
pub use encoding::{
13+
Encoding, Group1Prefix, Group2Prefix, Group3Prefix, Group4Prefix, Opcodes, Prefixes, Rex,
14+
};
1215
pub use features::{Feature, Features, ALL_FEATURES};
1316
pub use format::{align, fmt, r, rw, sxl, sxq, sxw};
1417
pub use format::{Extension, Format, Location, Mutability, Operand, OperandKind};

0 commit comments

Comments
 (0)