alexcrichton requested abrown for a review on PR #10889.
alexcrichton requested wasmtime-compiler-reviewers for a review on PR #10889.
alexcrichton opened PR #10889 from alexcrichton:x64-refactor-modrm-emission to bytecodealliance:main:
Right now there are two intertwined
matchstatements in the DSL
betweengenerate_{rex,vex}_prefixandgenerate_modrm_byte. Whenever
one is updated it typically is accompanied with a modification of the
other. This commit is an attempt to simplify this and to also decouple
the two a bit more.Specifically this commit adds a new
ModRmStyleenum to the code
generator which is a structure returned fromgenerate_{r,v}ex_prefix.
This is then passed togenerate_modrm_byteand means that it doesn't
need to perform the same pattern-match on the operands. This simplifies
thegenerate_modrm_bytemethod and enables selection of the ModR/M
byte to be different in REX/VEX as will be required for theblsi
instruction. Forblsithe same list of operands is encoded differently
with VEX than it is with REX, and this will enable that decoupling to be
easier to specify.
abrown created PR review comment:
I wonder if we should merge these two into
RegRm { reg: ..., rm: ... }since that ends up being the way the manual describes this.
abrown submitted PR review:
Good call!
abrown created PR review comment:
Ah, I see: I guess we do need to differentiate
RegMemandRegRegfor this kind of thing.
abrown merged PR #10889.
Last updated: Dec 06 2025 at 07:03 UTC