Stream: git-wasmtime

Topic: wasmtime / PR #10889 x64: Simplify ModR/M byte emission i...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 01 2025 at 00:53):

alexcrichton requested abrown for a review on PR #10889.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 01 2025 at 00:53):

alexcrichton requested wasmtime-compiler-reviewers for a review on PR #10889.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 01 2025 at 00:53):

alexcrichton opened PR #10889 from alexcrichton:x64-refactor-modrm-emission to bytecodealliance:main:

Right now there are two intertwined match statements in the DSL
between generate_{rex,vex}_prefix and generate_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 ModRmStyle enum to the code
generator which is a structure returned from generate_{r,v}ex_prefix.
This is then passed to generate_modrm_byte and means that it doesn't
need to perform the same pattern-match on the operands. This simplifies
the generate_modrm_byte method and enables selection of the ModR/M
byte to be different in REX/VEX as will be required for the blsi
instruction. For blsi the 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.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 02 2025 at 17:22):

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.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 02 2025 at 17:22):

abrown submitted PR review:

Good call!

view this post on Zulip Wasmtime GitHub notifications bot (Jun 02 2025 at 17:22):

abrown created PR review comment:

Ah, I see: I guess we do need to differentiate RegMem and RegReg for this kind of thing.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 02 2025 at 17:50):

abrown merged PR #10889.


Last updated: Dec 06 2025 at 07:03 UTC