File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,29 @@ if (($architecture eq "x86") || ($architecture eq "x86_64")) {
270
270
}
271
271
}
272
272
273
+ $no_rv64gv = 0;
274
+ if (($architecture eq " riscv64" )) {
275
+ eval " use File::Temp qw(tempfile)" ;
276
+ if ($@ ){
277
+ warn " could not load PERL module File::Temp, so could not check compiler compatibility with the RISCV vector extension" ;
278
+ $no_rv64gv = 0;
279
+ } else {
280
+ # $tmpf = new File::Temp( UNLINK => 1 );
281
+ ($fh ,$tmpf ) = tempfile( SUFFIX => ' .c' , UNLINK => 1 );
282
+ $code = ' "vsetvli zero, zero, e8, m1\n"' ;
283
+ print $fh " int main(void){ __asm__ volatile($code ); }\n " ;
284
+ $args = " -march=rv64gv -c -o $tmpf .o $tmpf " ;
285
+ my @cmd = (" $compiler_name $flags $args >/dev/null 2>/dev/null" );
286
+ system (@cmd ) == 0;
287
+ if ($? != 0) {
288
+ $no_rv64gv = 1;
289
+ } else {
290
+ $no_rv64gv = 0;
291
+ }
292
+ unlink (" $tmpf .o" );
293
+ }
294
+ }
295
+
273
296
$c11_atomics = 0;
274
297
if ($data =~ / HAVE_C11/ ) {
275
298
eval " use File::Temp qw(tempfile)" ;
@@ -392,6 +415,7 @@ print MAKEFILE "CROSS=1\n" if $cross != 0;
392
415
print MAKEFILE " CEXTRALIB=$linker_L $linker_l $linker_a \n " ;
393
416
print MAKEFILE " HAVE_MSA=1\n " if $have_msa eq 1;
394
417
print MAKEFILE " MSA_FLAGS=$msa_flags \n " if $have_msa eq 1;
418
+ print MAKEFILE " NO_RV64GV=1\n " if $no_rv64gv eq 1;
395
419
print MAKEFILE " NO_AVX512=1\n " if $no_avx512 eq 1;
396
420
print MAKEFILE " NO_AVX2=1\n " if $no_avx2 eq 1;
397
421
print MAKEFILE " OLDGCC=1\n " if $oldgcc eq 1;
You can’t perform that action at this time.
0 commit comments