No description
Find a file
H. Peter Anvin (Intel) 629cf75c3d tools/testgen: cover high register numbers (r8-r15, r16-r31)
Add register-number-focused coverage for every operand-class token that
has a hireg (r8-r15 / xmm-zmm8-15) or apxreg (r16-r31 / xmm-zmm16-31)
tier: registers 8+ only exist in 64-bit mode (they need a REX prefix,
or REX2/EVEX register-extension bits for 16-31), so this coverage is
64-bit-only regardless of the base token's own size.

Per template with at least one such token, generate one extra all-hireg
and one extra all-apxreg instruction line (once per template, not once
per --variants instance). Since NASM's own template-matching engine
transparently selects an alternate (e.g. APX/EVEX-encoded) pattern when
the operand syntax calls for it, the generator doesn't need to special-
case APX/EVEX iflags to decide whether extended registers are legal for
a given mnemonic -- it can simply try assembling and keep whichever
combination works. A staged-fallback probe (try hireg+apxreg, then
hireg alone, then apxreg alone, then neither) avoids letting one
genuinely-incompatible extra line (e.g. NOAPX/NOLONG-only mnemonics)
cost the whole mnemonic its pre-existing 64-bit coverage; the probe
checks --bits 16/32 too whenever a mnemonic's *only* templates need
64-bit registers regardless of number (e.g. URDMSR/UWRMSR), since in
that case the generated 'full' file is reused for every bit width.

Also fixes a latent bug: xmmreg/ymmreg/zmmreg previously drew uniformly
from registers 0-15, but 8-15 needs 64-bit mode just like the GPR
case -- so a template could non-deterministically lose its 16/32-bit
coverage whenever the RNG happened to land on 8-15 (e.g. ADDPD was
missing bin16/bin32 goldens before this fix). Register pools are now
split into explicit low (0-7)/hireg (8-15)/apxreg (16-31) tiers per
register class, threaded through gen_operand() via a new
parameter (defaulting to the existing 'low' behavior at all pre-
existing call sites).

Regenerated travis/insns/ (2606 mnemonics, 16 dropped -- unchanged
counts). Full suite validated via make -j32 travis: all tests PASS in
~27s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-04 11:38:35 -07:00
.github/workflows Setup CI/CD pipeline 2025-10-04 10:51:08 -07:00
asm outbin: register the mapfile; check for input clobber; remove on fail 2026-06-29 18:22:39 -07:00
autoconf autoconf: sync with upstream pa_option_lto.m4 2026-06-04 10:50:54 -07:00
common Refactor the handling of primary input/output files 2026-06-29 18:22:26 -07:00
config treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
contrib contrib/MSVC6.txt: Add guide how to use nasm in MSVC6 2010-01-24 23:17:55 +03:00
disasm Merge remote-tracking branch 'maciej/for-hpa-fixes' 2026-02-26 15:32:29 -08:00
doc doc: fix the example for saving and restoring list options 2026-06-29 07:10:26 -07:00
editors editors/dumpbuiltin.sh: make a little more user-friendly 2026-06-26 14:35:07 -07:00
include outbin: register the mapfile; check for input clobber; remove on fail 2026-06-29 18:22:39 -07:00
macros Disable other warnings in endstruc 2025-10-03 10:30:33 -07:00
misc omfdump.c: add updates from Bernd Böckmann 2026-06-07 21:00:04 -07:00
Mkfiles Refactor the handling of primary input/output files 2026-06-29 18:22:26 -07:00
nasmlib nasmlib/file: add nasm_remove() 2026-06-29 13:30:03 -07:00
nsis nsis: remove references to RDOFF tools 2022-11-08 18:22:25 -08:00
output outobj: fix buffer overflow when too many segments in a group 2026-06-29 18:22:44 -07:00
perllib Fix some typos 2022-01-09 17:34:35 +01:00
stdlib nasmlib: move filename_set_extension() into path.c 2025-12-15 09:58:42 -08:00
templates Rename "headers" directory to "templates", add .h template 2025-10-15 17:34:29 -07:00
test travis: reorganize directories, add tests from the test/ directory 2026-06-30 20:54:46 -07:00
tools tools/testgen: cover high register numbers (r8-r15, r16-r31) 2026-07-04 11:38:35 -07:00
travis tools/testgen: cover high register numbers (r8-r15, r16-r31) 2026-07-04 11:38:35 -07:00
win windows host: add embedded manifest file 2024-01-29 17:19:32 -08:00
x86 x86/insns.pl, tools/testgen: share cc/scc condition-code tables 2026-07-02 00:05:47 -07:00
zlib zlib: yet one more portability hack 2025-09-05 20:08:18 -07:00
.editorconfig .editorconfig: hard tabs are still 8 spaces 2024-06-10 21:12:52 -07:00
.gitattributes gitattributes: don't try to merge the version file 2020-06-30 13:48:13 -07:00
.gitignore travis: run from a Makefile to parallelize testing 2026-06-30 23:12:52 -07:00
.travis.yml travis: Disable osx for a while 2018-10-17 21:40:14 +03:00
AUTHORS Correct name spelling and email address 2015-01-18 20:21:14 +02:00
autogen.sh autogen.sh: Use $PATH_SEPARATOR as a path separator of ACLOCAL_PATH 2025-10-03 10:29:57 -07:00
ChangeLog Fix some typos 2022-01-09 17:34:35 +01:00
CHANGES Move the revision history into the documentation 2008-07-14 02:45:57 -04:00
configure.ac travis: run from a Makefile to parallelize testing 2026-06-30 23:12:52 -07:00
INSTALL Fix some typos 2022-01-09 17:34:35 +01:00
LICENSE treewide: replace verbose copyright headers with SPDX tags 2025-10-01 11:45:31 -07:00
Makefile.in x86/insns.pl, tools/testgen: share cc/scc condition-code tables 2026-07-02 00:05:47 -07:00
nasm.spec.in nasm.spec.in: change http:// to https:// 2025-10-09 17:19:54 -07:00
nasm.spec.sed nasm.spec: use a sed file to insert perl dependencies 2017-04-23 18:54:23 -07:00
nasm.txt Fix some typos 2022-01-09 17:34:35 +01:00
ndisasm.txt ndisasm: man -- Add missing -p option 2013-04-20 20:18:46 +04:00
README.md doc: remove references to sourceforge 2020-07-01 21:48:44 -07:00
SubmittingPatches SubmittingPatches: more up to date information about the patch format 2026-06-11 12:47:32 -07:00
travis.mk.in travis: run from a Makefile to parallelize testing 2026-06-30 23:12:52 -07:00
version NASM 3.02 2026-06-28 20:37:13 -07:00
version.pl Move editor help files to editors/, add NASM version number 2025-10-02 13:49:43 -07:00

NASM, the Netwide Assembler

master

Many many developers all over the net respect NASM for what it is: a widespread (thus netwide), portable (thus netwide!), very flexible and mature assembler tool with support for many output formats (thus netwide!!).

Now we have good news for you: NASM is licensed under the "simplified" (2-clause) BSD license. This means its development is open to even wider society of programmers wishing to improve their lovely assembler.

Visit our nasm.us website for more details.

With best regards, the NASM crew.