Skip to content

asm/assemble.c: make "cpu noapx" reject all APX-only encodings - #337

Open
Zaneham wants to merge 1 commit into
netwide-assembler:masterfrom
Zaneham:cpu-noapx
Open

Zaneham wants to merge 1 commit into
netwide-assembler:masterfrom
Zaneham:cpu-noapx

Conversation

@Zaneham

@Zaneham Zaneham commented Nov 3, 2026

Copy link
Copy Markdown

Hello! "cpu noapx" only blocked APX when an instruction needed REX2 for
r16-r31, so the other APX forms (NDD, {nf}, PUSH2/POP2, CCMP, CFCMOV,
JMPABS) still got emitted. This checks the APX template flag in matches()
next to the cpu level check, and adds a travis/cpuapx test that fails
without the fix. I've also documented the APX cpu flag and fixed two
typos in the VEX entry. Related to #328.

The APX cpu flag was only checked when an instruction needed REX2 for
registers r16-r31. The other APX forms (new data destination, {nf},
PUSH2/POP2, CCMP, CFCMOV, JMPABS) carry the APX template flag but it
was never checked, so "cpu noapx" still emitted them. Check it in
matches() next to the cpu level check.

Also document the APX cpu flag and fix two typos in the VEX entry.

Related to netwide-assembler#328.

Signed-off-by: Zane Hambly <zanehambly@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant