Skip to content

Commit 8045bee

Browse files
pablodelaratkanteck
authored andcommitted
Bump minimum NASM version to 2.14.01
NASM version 2.14.01 supports all x86 ISA in this library. Since this version has been out since 2018, it is safe to only permit the library to be compiled with this minimum version, as announced in issue #297. Signed-off-by: Pablo de Lara <[email protected]>
1 parent d20335b commit 8045bee

File tree

63 files changed

+25
-423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+25
-423
lines changed

Makefile.nmake

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,11 @@ objs = \
193193
bin\mem_multibinary.obj
194194

195195
INCLUDES = -I./ -Ierasure_code/ -Iraid/ -Icrc/ -Iigzip/ -Iprograms/ -Imem/ -Iinclude/ -Itests/fuzz/ -Iexamples/ec/
196-
# Modern asm feature level, consider upgrading nasm before decreasing feature_level
197-
FEAT_FLAGS = -DHAVE_AS_KNOWS_AVX512 -DAS_FEATURE_LEVEL=10
198196
CFLAGS_REL = -O2 -DNDEBUG /Z7 /Gy
199197
CFLAGS_DBG = -Od -DDEBUG /Z7
200198
LINKFLAGS = -nologo -incremental:no -debug
201-
CFLAGS = $(CFLAGS_REL) -nologo -D_USE_MATH_DEFINES $(FEAT_FLAGS) $(INCLUDES) $(D)
202-
AFLAGS = -f win64 $(FEAT_FLAGS) $(INCLUDES) $(D)
199+
CFLAGS = $(CFLAGS_REL) -nologo -D_USE_MATH_DEFINES $(INCLUDES) $(D)
200+
AFLAGS = -f win64 $(INCLUDES) $(D)
203201
CC = cl
204202
# or CC = icl -Qstd=c99
205203
AS = nasm

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ Building ISA-L
3939
* Optional: Manual generation requires help2man package.
4040

4141
x86_64:
42-
* Assembler: nasm. Version 2.15 or later suggested (other versions of nasm
43-
may build but with limited function [support](doc/build.md)).
42+
* Assembler: nasm. 2.14.01 minimum version required [support](doc/build.md)).
4443
* Compiler: gcc, clang, icc or VC compiler.
4544

4645
aarch64:

Release_notes.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,9 @@ v2.10
141141

142142
v2.32
143143

144+
* General:
145+
- Minimum NASM version required for x86 architecture is 2.14.01 now.
146+
144147
* RISCV support.
145148
- Initial riscv64 support with runtime and build-time CPU feature detection.
146149

configure.ac

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -135,31 +135,9 @@ int main(int argc, char **argv)
135135

136136
if test x"$nasm_feature_level" = x"1"; then
137137
AC_MSG_CHECKING([for modern nasm])
138-
AC_LANG_CONFTEST([AC_LANG_SOURCE([[pblendvb xmm2, xmm1;]])])
139-
sed -i -e '/pblendvb/!d' conftest.c
140-
if nasm -f elf64 conftest.c 2> /dev/null; then
141-
AC_MSG_RESULT([yes])
142-
nasm_feature_level=4
143-
else
144-
AC_MSG_RESULT([no])
145-
fi
146-
fi
147-
if test x"$nasm_feature_level" = x"4"; then
148-
AC_MSG_CHECKING([for optional nasm AVX512 support])
149-
AC_LANG_CONFTEST([AC_LANG_SOURCE([[vinserti32x8 zmm0, ymm1, 1;]])])
150-
sed -i -e '/vinsert/!d' conftest.c
151-
if nasm -f elf64 conftest.c 2> /dev/null; then
152-
AC_MSG_RESULT([yes])
153-
nasm_feature_level=6
154-
else
155-
AC_MSG_RESULT([no])
156-
fi
157-
fi
158-
if test x"$nasm_feature_level" = x"6"; then
159-
AC_MSG_CHECKING([for additional nasm AVX512 support])
160138
AC_LANG_CONFTEST([AC_LANG_SOURCE([[vpcompressb zmm0 {k1}, zmm1;]])])
161139
sed -i -e '/vpcompressb/!d' conftest.c
162-
if nasm -f elf64 conftest.c 2> /dev/null; then
140+
if nasm -f elf64 conftest.c 2> /dev/null; then
163141
AC_MSG_RESULT([yes])
164142
nasm_feature_level=10
165143
else
@@ -181,29 +159,6 @@ int main(int argc, char **argv)
181159
fi
182160

183161
if test x"$as_feature_level" = x"1"; then
184-
AC_MSG_CHECKING([for modern $AS])
185-
AC_LANG_CONFTEST([AC_LANG_SOURCE([[pblendvb xmm2, xmm1;]])])
186-
sed -i -e '/pblendvb/!d' conftest.c
187-
if $AS -f elf64 conftest.c 2> /dev/null; then
188-
AC_MSG_RESULT([yes])
189-
as_feature_level=4
190-
else
191-
AC_MSG_RESULT([no])
192-
fi
193-
fi
194-
if test x"$as_feature_level" = x"4"; then
195-
AC_MSG_CHECKING([for optional as AVX512 support])
196-
AC_LANG_CONFTEST([AC_LANG_SOURCE([[vinserti32x8 zmm0, ymm1, 1;]])])
197-
sed -i -e '/vinsert/!d' conftest.c
198-
if $AS -f elf64 conftest.c 2> /dev/null; then
199-
AC_MSG_RESULT([yes])
200-
as_feature_level=6
201-
else
202-
AC_MSG_RESULT([no])
203-
fi
204-
fi
205-
if test x"$as_feature_level" = x"6"; then
206-
AC_MSG_CHECKING([for additional as AVX512 support])
207162
AC_LANG_CONFTEST([AC_LANG_SOURCE([[vpcompressb zmm0, k1, zmm1;]])])
208163
sed -i -e '/vpcompressb/!d' conftest.c
209164
if $AS -f elf64 conftest.c 2> /dev/null; then
@@ -215,8 +170,8 @@ int main(int argc, char **argv)
215170
fi
216171
fi
217172

218-
if test $as_feature_level -lt 2 ; then
219-
AC_MSG_ERROR([No modern nasm found as required. Nasm should be v2.11.01 or later (v2.13 for AVX512).])
173+
if test $as_feature_level -lt 10 ; then
174+
AC_MSG_ERROR([No modern nasm found as required. Nasm should be v2.14.01 or later.])
220175
fi
221176

222177
case $host_os in
@@ -227,23 +182,13 @@ int main(int argc, char **argv)
227182
*) arch=unknown asm_args="-f elf64";;
228183
esac
229184

230-
AC_DEFINE_UNQUOTED(AS_FEATURE_LEVEL, [$as_feature_level], [Assembler feature level.])
231-
if test $as_feature_level -ge 6 ; then
232-
AC_DEFINE(HAVE_AS_KNOWS_AVX512, [1], [Assembler can do AVX512.])
233-
have_as_knows_avx512=yes
234-
else
235-
AC_MSG_RESULT([Assembler does not understand AVX512 opcodes. Consider upgrading for best performance.])
236-
fi
237-
238185
AM_CONDITIONAL(USE_NASM, test x"$AS" = x"nasm")
239-
AM_CONDITIONAL(WITH_AVX512, test x"$have_as_knows_avx512" = x"yes")
240186
AC_SUBST([asm_args])
241187
AM_CONDITIONAL(DARWIN, test x"$arch" = x"darwin")
242188
AC_MSG_RESULT([Using $AS args target "$arch" "$asm_args"])
243189
else
244190
# Disable below conditionals if not x86
245191
AM_CONDITIONAL(USE_NASM, test "x" = "y")
246-
AM_CONDITIONAL(WITH_AVX512, test "x" = "y")
247192
AM_CONDITIONAL(DARWIN, test "x" = "y")
248193
fi
249194

crc/crc16_t10dif_by16_10.asm

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
%define FUNCTION_NAME crc16_t10dif_by16_10
5252
%endif
5353

54-
%if (AS_FEATURE_LEVEL) >= 10
55-
5654
[bits 64]
5755
default rel
5856

@@ -576,10 +574,3 @@ dq 0x8786858483828100, 0x8f8e8d8c8b8a8988
576574
dq 0x0706050403020100, 0x000e0d0c0b0a0908
577575
dq 0x8080808080808080, 0x0f0e0d0c0b0a0908
578576
dq 0x8080808080808080, 0x8080808080808080
579-
580-
%else ; Assembler doesn't understand these opcodes. Add empty symbol for windows.
581-
%ifidn __OUTPUT_FORMAT__, win64
582-
global no_ %+ FUNCTION_NAME
583-
no_ %+ FUNCTION_NAME %+ :
584-
%endif
585-
%endif ; (AS_FEATURE_LEVEL) >= 10

crc/crc32_gzip_refl_by16_10.asm

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@
5959
%define FUNCTION_NAME crc32_gzip_refl_by16_10
6060
%endif
6161

62-
%if (AS_FEATURE_LEVEL) >= 10
63-
6462
%define fetch_dist 1024
6563

6664
[bits 64]
@@ -534,10 +532,3 @@ pshufb_shift_table:
534532
mask: dq 0xFFFFFFFFFFFFFFFF, 0x0000000000000000
535533
mask2: dq 0xFFFFFFFF00000000, 0xFFFFFFFFFFFFFFFF
536534
mask3: dq 0x8080808080808080, 0x8080808080808080
537-
538-
%else ; Assembler doesn't understand these opcodes. Add empty symbol for windows.
539-
%ifidn __OUTPUT_FORMAT__, win64
540-
global no_ %+ FUNCTION_NAME
541-
no_ %+ FUNCTION_NAME %+ :
542-
%endif
543-
%endif ; (AS_FEATURE_LEVEL) >= 10

crc/crc32_ieee_by16_10.asm

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
%define FUNCTION_NAME crc32_ieee_by16_10
5252
%endif
5353

54-
%if (AS_FEATURE_LEVEL) >= 10
55-
5654
[bits 64]
5755
default rel
5856

@@ -557,10 +555,3 @@ dq 0x8786858483828100, 0x8f8e8d8c8b8a8988
557555
dq 0x0706050403020100, 0x000e0d0c0b0a0908
558556
dq 0x8080808080808080, 0x0f0e0d0c0b0a0908
559557
dq 0x8080808080808080, 0x8080808080808080
560-
561-
%else ; Assembler doesn't understand these opcodes. Add empty symbol for windows.
562-
%ifidn __OUTPUT_FORMAT__, win64
563-
global no_ %+ FUNCTION_NAME
564-
no_ %+ FUNCTION_NAME %+ :
565-
%endif
566-
%endif ; (AS_FEATURE_LEVEL) >= 10

crc/crc32_iscsi_by16_10.asm

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
%define FUNCTION_NAME crc32_iscsi_by16_10
5252
%endif
5353

54-
%if (AS_FEATURE_LEVEL) >= 10
55-
5654
[bits 64]
5755
default rel
5856

@@ -504,10 +502,3 @@ dq 0x0706050403020100, 0x000e0d0c0b0a0908
504502
mask: dq 0xFFFFFFFFFFFFFFFF, 0x0000000000000000
505503
mask2: dq 0xFFFFFFFF00000000, 0xFFFFFFFFFFFFFFFF
506504
mask3: dq 0x8080808080808080, 0x8080808080808080
507-
508-
%else ; Assembler doesn't understand these opcodes. Add empty symbol for windows.
509-
%ifidn __OUTPUT_FORMAT__, win64
510-
global no_ %+ FUNCTION_NAME
511-
no_ %+ FUNCTION_NAME %+ :
512-
%endif
513-
%endif ; (AS_FEATURE_LEVEL) >= 10

crc/crc64_iso_norm_by16_10.asm

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
%define FUNCTION_NAME crc64_iso_norm_by16_10
4242
%endif
4343

44-
%if (AS_FEATURE_LEVEL) >= 10
45-
4644
%define fetch_dist 1024
4745

4846
[bits 64]
@@ -463,11 +461,3 @@ dw 0x0000, 0x0001, 0x0003, 0x0007,
463461
dw 0x000f, 0x001f, 0x003f, 0x007f,
464462
dw 0x00ff, 0x01ff, 0x03ff, 0x07ff,
465463
dw 0x0fff, 0x1fff, 0x3fff, 0x7fff,
466-
467-
468-
%else ; Assembler doesn't understand these opcodes. Add empty symbol for windows.
469-
%ifidn __OUTPUT_FORMAT__, win64
470-
global no_ %+ FUNCTION_NAME
471-
no_ %+ FUNCTION_NAME %+ :
472-
%endif
473-
%endif ; (AS_FEATURE_LEVEL) >= 10

crc/crc64_iso_refl_by16_10.asm

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
%define FUNCTION_NAME crc64_iso_refl_by16_10
4242
%endif
4343

44-
%if (AS_FEATURE_LEVEL) >= 10
45-
4644
%define fetch_dist 1024
4745

4846
[bits 64]
@@ -474,10 +472,3 @@ dq 0x0706050403020100, 0x000e0d0c0b0a0908
474472
mask: dq 0xFFFFFFFFFFFFFFFF, 0x0000000000000000
475473
mask2: dq 0xFFFFFFFF00000000, 0xFFFFFFFFFFFFFFFF
476474
mask3: dq 0x8080808080808080, 0x8080808080808080
477-
478-
%else ; Assembler doesn't understand these opcodes. Add empty symbol for windows.
479-
%ifidn __OUTPUT_FORMAT__, win64
480-
global no_ %+ FUNCTION_NAME
481-
no_ %+ FUNCTION_NAME %+ :
482-
%endif
483-
%endif ; (AS_FEATURE_LEVEL) >= 10

0 commit comments

Comments
 (0)