nasm/travis/optimization/optimization.asm
H. Peter Anvin (Intel) 7f69cf689c travis: reorganize directories, add tests from the test/ directory
This is a mostly automated, partially AI-assisted migration of tests
from the test/ directory into the travis framework.

Running tests manually in the test/ directory is still supported, but
move common include files into travis/test and add a default -I option
to Makefile.in in the test/ directory.

The incbin test fails for pre-existing reasons; for now it contains an
stderr file with the errors. The problem is that INCBIN is both a
macro and a special instruction (not even a directive...), but there
currently is no way to handle prefixes, *especially* TIMES, in
multi-line macros. This is a separate problem and needs to be dealt
with as such.

Reorganize the travis directory so that each test or collection of
tests are in a separate subdirectory of travis/, and travis itself
lives in tools/travis to avoid creating deeper paths.

Add support for recording compression options in the travis .json
files, so that compressed files can be recreated with the same
options: because of the generally repetitive nature of the binary
output test files, the parameters used for xz compression can matter
enormously.

These are combined into a single huge commit to avoid adding large
binary files into the repository that then would immediately be
obsoleted, but still retained in git.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2026-06-30 20:54:46 -07:00

100 lines
1.5 KiB
NASM

BITS 32
; Simple
jmp foo
times 124 nop
foo:
; Must start short to converge optimally
jmp car
times 127 nop
car:
; Always near
jmp cdr
times 128 nop
cdr:
; Simple
add eax, quux2 - quux1
quux1:
times 127 nop
quux2:
; Must start short
corge1:
add eax, corge2 - corge1
times 127 - 3 nop
corge2:
; Simple
lea eax, [bolug2-bolug1]
bolug1:
times 127 nop
bolug2:
; Must start short
calog1:
lea eax, [calog2-calog1]
times 127 - 3 nop
calog2:
; Simple
lea eax, [eax+dolug2-dolug1]
dolug1:
times 127 nop
dolug2:
; Must start short
ealog1:
lea eax, [eax+ealog2-ealog1]
times 127 - 3 nop
ealog2:
; Must stay long!
lea eax, [eax+folug2-folug1]
folug1:
times 128 nop
folug2:
; Must stay long!
galog1:
lea eax, [eax+galog2-galog1]
times 128 - 3 nop
galog2:
; Sbyte tests...
onetwentysix equ 126
onetwentynine equ 129
add eax,onetwentyseven ; sbyte (forward)
add eax,onetwentyeight ; not sbyte (forward)
add eax,onetwentyseven ; sbyte (forward)
add eax,onetwentysix ; sbyte (backward)
add eax,onetwentynine ; not sbyte (backward)
add ecx,onetwentyseven ; sbyte (forward)
add ecx,onetwentyeight ; not sbyte (forward)
add ecx,onetwentyseven ; sbyte (forward)
add ecx,onetwentysix ; sbyte (backward)
add ecx,onetwentynine ; not sbyte (backward)
onetwentyseven equ 127
onetwentyeight equ 128
; Simple
add eax, holug2-holug1
holug1:
times 127 nop
holug2:
; Must start short
ialog1:
add eax, ialog2-ialog1
times 127 - 3 nop
ialog2:
; Do not confuse forward references and segmentless addresses!
jmp 12345