File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,21 @@ $architecture = zarch if ($data =~ /ARCH_ZARCH/);
201
201
$binformat = bin32;
202
202
$binformat = bin64 if ($data =~ / BINARY_64/ );
203
203
204
+ $no_avx512 = 0;
205
+ if (($architecture eq " x86" ) || ($architecture eq " x86_64" )) {
206
+ $code = ' "vaddps %zmm1, %zmm0, %zmm0"' ;
207
+ print $tmpf " void main(void){ __asm__ volatile($code ); }\n " ;
208
+ $args = " -o $tmpf .o -x c $tmpf " ;
209
+ my @cmd = (" $compiler_name $args " );
210
+ system (@cmd ) == 0;
211
+ if ($? != 0) {
212
+ $no_avx512 = 1;
213
+ } else {
214
+ $no_avx512 = 0;
215
+ }
216
+ unlink (" tmpf.o" );
217
+ }
218
+
204
219
$data = ` $compiler_name -S ctest1.c && grep globl ctest1.s | head -n 1 && rm -f ctest1.s` ;
205
220
206
221
$data =~ / globl\s ([_\. ]*)(.*)/ ;
@@ -288,6 +303,7 @@ print MAKEFILE "CROSS=1\n" if $cross != 0;
288
303
print MAKEFILE " CEXTRALIB=$linker_L $linker_l $linker_a \n " ;
289
304
print MAKEFILE " HAVE_MSA=1\n " if $have_msa eq 1;
290
305
print MAKEFILE " MSA_FLAGS=$msa_flags \n " if $have_msa eq 1;
306
+ print MAKEFILE " NO_AVX512=1\n " if $no_avx512 eq 1;
291
307
292
308
$os =~ tr / [a-z]/ [A-Z]/ ;
293
309
$architecture =~ tr / [a-z]/ [A-Z]/ ;
You can’t perform that action at this time.
0 commit comments