@@ -92,7 +92,7 @@ AS_IF([test "x$enable_debug" = "xyes"], [
92
92
AC_DEFINE ( ENABLE_DEBUG , [ 1] , [ Debug messages.] )
93
93
] )
94
94
95
- # If this build is for x86, look for yasm and nasm
95
+ # If this build is for x86, look for nasm
96
96
if test x"$is_x86" = x"yes"; then
97
97
AC_MSG_CHECKING ( [ whether Intel CET is enabled] )
98
98
AC_COMPILE_IFELSE ( [ AC_LANG_PROGRAM ( [ [ ] ] , [ [
@@ -122,48 +122,8 @@ int main(int argc, char **argv)
122
122
LDFLAGS=""]
123
123
)
124
124
125
- # Pick an assembler yasm or nasm
125
+ # Pick NASM assembler
126
126
if test x"$AS" = x""; then
127
- # Check for yasm and yasm features
128
- yasm_feature_level=0
129
- AC_CHECK_PROG ( HAVE_YASM , yasm , yes , no )
130
- if test "$HAVE_YASM" = "yes"; then
131
- yasm_feature_level=1
132
- else
133
- AC_MSG_RESULT ( [ no yasm] )
134
- fi
135
- if test x"$yasm_feature_level" = x"1"; then
136
- AC_MSG_CHECKING ( [ for modern yasm] )
137
- AC_LANG_CONFTEST ( [ AC_LANG_SOURCE ( [ [ vmovdqa %xmm0, %xmm1;] ] ) ] )
138
- if yasm -f elf64 -p gas conftest.c ; then
139
- AC_MSG_RESULT ( [ yes] )
140
- yasm_feature_level=4
141
- else
142
- AC_MSG_RESULT ( [ no] )
143
- fi
144
- fi
145
- if test x"$yasm_feature_level" = x"4"; then
146
- AC_MSG_CHECKING ( [ for optional yasm AVX512 support] )
147
- AC_LANG_CONFTEST ( [ AC_LANG_SOURCE ( [ [ vpshufb %zmm0, %zmm1, %zmm2;] ] ) ] )
148
- if yasm -f elf64 -p gas conftest.c 2> /dev/null; then
149
- AC_MSG_RESULT ( [ yes] )
150
- yasm_feature_level=6
151
- else
152
- AC_MSG_RESULT ( [ no] )
153
- fi
154
- fi
155
- if test x"$yasm_feature_level" = x"6"; then
156
- AC_MSG_CHECKING ( [ for additional yasm AVX512 support] )
157
- AC_LANG_CONFTEST ( [ AC_LANG_SOURCE ( [ [ vpcompressb zmm0, k1, zmm1;] ] ) ] )
158
- sed -i -e '/vpcompressb/!d' conftest.c
159
- if yasm -f elf64 conftest.c 2> /dev/null; then
160
- AC_MSG_RESULT ( [ yes] )
161
- yasm_feature_level=10
162
- else
163
- AC_MSG_RESULT ( [ no] )
164
- fi
165
- fi
166
-
167
127
# Check for nasm and nasm features
168
128
nasm_feature_level=0
169
129
AC_CHECK_PROG ( HAVE_NASM , nasm , yes , no )
@@ -207,13 +167,8 @@ int main(int argc, char **argv)
207
167
fi
208
168
fi
209
169
210
- if test $nasm_feature_level -ge $yasm_feature_level ; then
211
- AS=nasm
212
- as_feature_level=$nasm_feature_level
213
- else
214
- AS=yasm
215
- as_feature_level=$yasm_feature_level
216
- fi
170
+ AS=nasm
171
+ as_feature_level=$nasm_feature_level
217
172
218
173
else
219
174
# Check for $AS supported features
@@ -261,26 +216,17 @@ int main(int argc, char **argv)
261
216
fi
262
217
263
218
if test $as_feature_level -lt 2 ; then
264
- AC_MSG_ERROR ( [ No modern nasm or yasm found as required. Nasm should be v2.11.01 or later (v2.13 for AVX512) and yasm should be 1.2.0 or later .] )
219
+ AC_MSG_ERROR ( [ No modern nasm found as required. Nasm should be v2.11.01 or later (v2.13 for AVX512).] )
265
220
fi
266
221
267
222
case $host_os in
268
- *linux*) arch=linux yasm_args ="-f elf64";;
269
- *darwin*) arch=darwin yasm_args ="-f macho64 --prefix=_ ";;
270
- *netbsd*) arch=netbsd yasm_args ="-f elf64";;
271
- *mingw*) arch=mingw yasm_args ="-f win64";;
272
- *) arch=unknown yasm_args ="-f elf64";;
223
+ *linux*) arch=linux asm_args ="-f elf64";;
224
+ *darwin*) arch=darwin asm_args ="-f macho64 --prefix=_ ";;
225
+ *netbsd*) arch=netbsd asm_args ="-f elf64";;
226
+ *mingw*) arch=mingw asm_args ="-f win64";;
227
+ *) arch=unknown asm_args ="-f elf64";;
273
228
esac
274
229
275
- # Fix for nasm missing windows features
276
- if test x"$arch" = x"mingw"; then
277
- AS=yasm
278
- as_feature_level=$yasm_feature_level
279
- if test $as_feature_level -lt 2 ; then
280
- AC_MSG_ERROR ( [ Mingw build requires Yasm 1.2.0 or later.] )
281
- fi
282
- fi
283
-
284
230
AC_DEFINE_UNQUOTED ( AS_FEATURE_LEVEL , [ $as_feature_level] , [ Assembler feature level.] )
285
231
if test $as_feature_level -ge 6 ; then
286
232
AC_DEFINE ( HAVE_AS_KNOWS_AVX512 , [ 1] , [ Assembler can do AVX512.] )
@@ -289,15 +235,13 @@ int main(int argc, char **argv)
289
235
AC_MSG_RESULT ( [ Assembler does not understand AVX512 opcodes. Consider upgrading for best performance.] )
290
236
fi
291
237
292
- AM_CONDITIONAL(USE_YASM, test x"$AS" = x"yasm")
293
238
AM_CONDITIONAL(USE_NASM, test x"$AS" = x"nasm")
294
239
AM_CONDITIONAL(WITH_AVX512, test x"$have_as_knows_avx512" = x"yes")
295
- AC_SUBST ( [ yasm_args ] )
240
+ AC_SUBST ( [ asm_args ] )
296
241
AM_CONDITIONAL(DARWIN, test x"$arch" = x"darwin")
297
- AC_MSG_RESULT ( [ Using $AS args target "$arch" "$yasm_args "] )
242
+ AC_MSG_RESULT ( [ Using $AS args target "$arch" "$asm_args "] )
298
243
else
299
244
# Disable below conditionals if not x86
300
- AM_CONDITIONAL(USE_YASM, test "x" = "y")
301
245
AM_CONDITIONAL(USE_NASM, test "x" = "y")
302
246
AM_CONDITIONAL(WITH_AVX512, test "x" = "y")
303
247
AM_CONDITIONAL(DARWIN, test "x" = "y")
0 commit comments