Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

asm: comprehend 1-, 2-, and 3-byte opcodes #10232

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

abrown
Copy link
Contributor

@abrown abrown commented Feb 14, 2025

How IA-32e describes and encodes opcodes is a bit confusing, but section 2.1.2 in the reference manual does a decent job explaining how the various prefixes, escape bytes, and primary/secondary opcodes may be used. This change uses this explanation to create what is essentially a parser for [u8]; this allows us to compactly express instruction definitions, e.g., rex([0x66, 0x25]). Improper use of this DSL syntax should result in an immediate compilation error when attempting to generate the assembler.

How IA-32e describes and encodes opcodes is a bit confusing, but section
2.1.2 in the reference manual does a decent job explaining how the
various prefixes, escape bytes, and primary/secondary opcodes may be
used. This change uses this explanation to create what is essentially a
parser for `[u8]`; this allows us to compactly express instruction
definitions, e.g., `rex([0x66, 0x25])`. Improper use of this DSL syntax
should result in an immediate compilation error when attempting to
generate the assembler.
@abrown abrown requested a review from a team as a code owner February 14, 2025 00:19
@abrown abrown requested review from fitzgen and removed request for a team February 14, 2025 00:19
@github-actions github-actions bot added the cranelift Issues related to the Cranelift code generator label Feb 14, 2025
@abrown abrown enabled auto-merge February 14, 2025 17:19
@abrown abrown added this pull request to the merge queue Feb 14, 2025
Merged via the queue into bytecodealliance:main with commit dc10471 Feb 14, 2025
39 checks passed
@abrown abrown deleted the assembler-opcodes branch February 14, 2025 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants