Merge pull request #3579 from martin-frbg/issue3557-2

Fix malfunctioning AVX512 check
This commit is contained in:
Martin Kroeker 2022-03-24 08:28:37 +01:00 committed by GitHub
commit 2519c9d93f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 11 deletions

View File

@ -71,7 +71,8 @@ endif
getarch : getarch.c cpuid.S dummy $(CPUIDEMU) getarch : getarch.c cpuid.S dummy $(CPUIDEMU)
$(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) -o $(@F) getarch.c cpuid.S $(CPUIDEMU) avx512=$$(perl c_check - - gcc | grep NO_AVX512); \
$(HOSTCC) $(HOST_CFLAGS) $(EXFLAGS) $${avx512:+-D$${avx512}} -o $(@F) getarch.c cpuid.S $(CPUIDEMU)
getarch_2nd : getarch_2nd.c config.h dummy getarch_2nd : getarch_2nd.c config.h dummy
ifndef TARGET_CORE ifndef TARGET_CORE

View File

@ -254,7 +254,7 @@ if (($architecture eq "x86") || ($architecture eq "x86_64")) {
# $tmpf = new File::Temp( UNLINK => 1 ); # $tmpf = new File::Temp( UNLINK => 1 );
($fh,$tmpf) = tempfile( SUFFIX => '.c' , UNLINK => 1 ); ($fh,$tmpf) = tempfile( SUFFIX => '.c' , UNLINK => 1 );
$code = '"vbroadcastss -4 * 4(%rsi), %zmm2"'; $code = '"vbroadcastss -4 * 4(%rsi), %zmm2"';
print $tmpf "#include <immintrin.h>\n\nint main(void){ __asm__ volatile($code); }\n"; print $fh "#include <immintrin.h>\n\nint main(void){ __asm__ volatile($code); }\n";
$args = " -march=skylake-avx512 -c -o $tmpf.o $tmpf"; $args = " -march=skylake-avx512 -c -o $tmpf.o $tmpf";
if ($compiler eq "PGI") { if ($compiler eq "PGI") {
$args = " -tp skylake -c -o $tmpf.o $tmpf"; $args = " -tp skylake -c -o $tmpf.o $tmpf";
@ -278,7 +278,7 @@ if ($data =~ /HAVE_C11/) {
$c11_atomics = 0; $c11_atomics = 0;
} else { } else {
($fh,$tmpf) = tempfile( SUFFIX => '.c' , UNLINK => 1 ); ($fh,$tmpf) = tempfile( SUFFIX => '.c' , UNLINK => 1 );
print $tmpf "#include <stdatomic.h>\nint main(void){}\n"; print $fh "#include <stdatomic.h>\nint main(void){}\n";
$args = " -c -o $tmpf.o $tmpf"; $args = " -c -o $tmpf.o $tmpf";
my @cmd = ("$compiler_name $flags $args >/dev/null 2>/dev/null"); my @cmd = ("$compiler_name $flags $args >/dev/null 2>/dev/null");
system(@cmd) == 0; system(@cmd) == 0;

View File

@ -94,14 +94,6 @@ USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <sys/sysinfo.h> #include <sys/sysinfo.h>
#endif #endif
#if defined(__x86_64__) || defined(_M_X64)
#if (( defined(__GNUC__) && __GNUC__ > 6 && defined(__AVX2__)) || (defined(__clang__) && __clang_major__ >= 6))
#else
#ifndef NO_AVX512
#define NO_AVX512
#endif
#endif
#endif
/* #define FORCE_P2 */ /* #define FORCE_P2 */
/* #define FORCE_KATMAI */ /* #define FORCE_KATMAI */
/* #define FORCE_COPPERMINE */ /* #define FORCE_COPPERMINE */