nasm/travis/insns/prefetch
H. Peter Anvin (Intel) 941aa2ba16 testgen: add modrm-memory disp8/disp32 boundary coverage
Extend gen-insn-tests.pl to synthesize, for every distinct template
across a mnemonic's entire template set that has a modrm-memory-
capable operand (mem*, rm*, xmmrm*/ymmrm256/zmmrm512, mmxrm*), two
additional candidate lines using [eax+1] and [eax+64] addressing in
place of that operand's usual bare-displacement or register form.

Whether an instruction has a disp8-encodable form (or, for EVEX, what
its compressed-displacement scale factor is) is instruction-specific,
so rather than computing the exact boundary per instruction these two
fixed offsets are used as a baseline: +1 is unambiguously disp8-
encodable everywhere, and +64 lands past the disp8 boundary for
byte-granular encodings while still being a clean multiple of the
larger EVEX compressed-displacement scales.

[eax+N] (rather than a bare displacement, or a bit-width-specific base
register) is used because it's valid addressing syntax at every
--bits width via the 0x67 address-size prefix, confirmed empirically.
Candidates are routed through the same staged, cumulative probe as the
hireg/apxreg/EVEX-decorator buckets, so one bad candidate (e.g. an
instruction with memory-operand restrictions this generator doesn't
model) can't cost a mnemonic its pre-existing coverage.

Regenerated travis/insns/ (2606 mnemonics, 16 dropped, unchanged from
before; 1987 mnemonics gained at least one disp-boundary line).
Validated: nasm-t.py run against a scratch regeneration is 6955/6955
PASS/0 FAIL with per-mnemonic bit-width success counts identical to
the previous committed baseline, and make -j32 travis passes in ~26s.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-07-04 12:21:31 -07:00
..
prefetch.asm testgen: add modrm-memory disp8/disp32 boundary coverage 2026-07-04 12:21:31 -07:00
prefetch.bin16.t tools/testgen: pseudorandom instruction test generator 2026-07-01 23:42:14 -07:00
prefetch.bin32.t tools/testgen: pseudorandom instruction test generator 2026-07-01 23:42:14 -07:00
prefetch.bin64.t testgen: add modrm-memory disp8/disp32 boundary coverage 2026-07-04 12:21:31 -07:00
prefetch.json testgen: add modrm-memory disp8/disp32 boundary coverage 2026-07-04 12:21:31 -07:00
prefetch_narrow.asm testgen: add modrm-memory disp8/disp32 boundary coverage 2026-07-04 12:21:31 -07:00