From f39677d5273077beb0e63bc2385d2421345bca5c Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 5 Sep 2025 12:53:37 -0700 Subject: [PATCH] test: add -DSRC as a standard option; bin32 and bin64 targets Make it a little easier to run bench tests which include multiple bit sizes, and add the SRC define to make SRC/BIN tests easier to run on the bench. Signed-off-by: H. Peter Anvin (Intel) --- Makefile.in | 2 +- test/Makefile.in | 8 ++++++-- test/crc32.asm | 16 ++++++++++------ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Makefile.in b/Makefile.in index 450bed53..2ee8b998 100644 --- a/Makefile.in +++ b/Makefile.in @@ -165,7 +165,7 @@ LIBOBJ_NW = \ macros/macros.$(O) \ \ nasmlib/ver.$(O) \ - nasmlib/alloc.$(O) nasmlib/asprintf.$(O) nasmlib/errfile.$(O) \ + nasmlib/alloc.$(O) nasmlib/asprintf.$(O) \ nasmlib/crc32.$(O) nasmlib/crc64.$(O) nasmlib/md5c.$(O) \ nasmlib/string.$(O) nasmlib/nctype.$(O) \ nasmlib/file.$(O) nasmlib/mmap.$(O) nasmlib/ilog2.$(O) \ diff --git a/test/Makefile.in b/test/Makefile.in index 981d7469..851effe1 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -1,6 +1,7 @@ @SET_MAKE@ -.SUFFIXES: .bin .o .o64 .aout .aoutb .obj .obj64 .exe .asm .lst .pl +.SUFFIXES: .bin .bin32 .bin64 .o .o64 .aout .aoutb .obj .obj64 \ + .exe .asm .lst .pl # Binary suffixes O = @OBJEXT@ @@ -11,7 +12,7 @@ NASM = ../nasm$(X) NDISASM = ../ndisasm$(X) OMFDUMP = ../misc/omfdump$(X) LISTOPT = -L+ -NASMOPT = -Ox -I../misc $(LISTOPT) $(OPT) +NASMOPT = -DSRC -Ox -I../misc $(LISTOPT) $(OPT) PERL = perl TESTS = $(wildcard *.asm) RM_F = rm -f @@ -30,6 +31,9 @@ $(NASM) $(NDISASM): %.bin: %.asm $(NASM) $(NASM) $(NASMOPT) -f bin -o $@ -MD $@.dep -l $@.lst $< +%.bin32: %.asm $(NASM) + + %.ith: %.asm $(NASM) $(NASM) $(NASMOPT) -f ith -o $@ -MD $@.dep -l $@.lst $< diff --git a/test/crc32.asm b/test/crc32.asm index c1ddb296..d3c52062 100644 --- a/test/crc32.asm +++ b/test/crc32.asm @@ -1,6 +1,12 @@ ;Testname=test; Arguments=-fbin -ocrc32.bin; Files=stdout stderr crc32.bin - bits 16 +%ifndef BITS + %define BITS 64 +%endif + + bits BITS + +%if __?BITS?__ == 16 crc32 eax,cl crc32 eax,byte [di] @@ -9,8 +15,7 @@ crc32 eax,ecx crc32 eax,dword [di] - bits 32 - align 16 +%elif __?BITS?__ == 32 crc32 eax,cl crc32 eax,byte [edi] @@ -19,9 +24,7 @@ crc32 eax,ecx crc32 eax,dword [edi] - bits 64 - align 16 - +%else crc32 eax,cl crc32 eax,byte [rdi] crc32 eax,r9b @@ -35,3 +38,4 @@ crc32 rax,rcx crc32 rax,qword [rdi] crc32 rax,r9 +%endif