]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Add icx compiler version support in perl asm scripts
authorWolfgang Beck <beck.wolfgang@oracle.com>
Fri, 6 Mar 2026 02:48:46 +0000 (02:48 +0000)
committerNikola Pajkovsky <nikolap@openssl.org>
Mon, 27 Apr 2026 06:44:12 +0000 (06:44 +0000)
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
MergeDate: Mon Apr 27 06:44:52 2026
(Merged from https://github.com/openssl/openssl/pull/30313)

30 files changed:
crypto/aes/asm/aes-cfb-avx512.pl
crypto/aes/asm/aesni-mb-x86_64.pl
crypto/aes/asm/aesni-sha1-x86_64.pl
crypto/aes/asm/aesni-sha256-x86_64.pl
crypto/aes/asm/aesni-xts-avx512.pl
crypto/bn/asm/rsaz-2k-avx512.pl
crypto/bn/asm/rsaz-2k-avxifma.pl
crypto/bn/asm/rsaz-3k-avx512.pl
crypto/bn/asm/rsaz-3k-avxifma.pl
crypto/bn/asm/rsaz-4k-avx512.pl
crypto/bn/asm/rsaz-4k-avxifma.pl
crypto/bn/asm/rsaz-avx2.pl
crypto/bn/asm/rsaz-x86_64.pl
crypto/bn/asm/x86_64-mont.pl
crypto/bn/asm/x86_64-mont5.pl
crypto/chacha/asm/chacha-x86.pl
crypto/chacha/asm/chacha-x86_64.pl
crypto/ec/asm/ecp_nistz256-x86_64.pl
crypto/ec/asm/x25519-x86_64.pl
crypto/modes/asm/aes-gcm-avx512.pl
crypto/modes/asm/aesni-gcm-x86_64.pl
crypto/modes/asm/ghash-x86_64.pl
crypto/poly1305/asm/poly1305-x86.pl
crypto/poly1305/asm/poly1305-x86_64.pl
crypto/sha/asm/sha1-586.pl
crypto/sha/asm/sha1-mb-x86_64.pl
crypto/sha/asm/sha1-x86_64.pl
crypto/sha/asm/sha256-586.pl
crypto/sha/asm/sha256-mb-x86_64.pl
crypto/sha/asm/sha512-x86_64.pl

index 01047a0d664260cd6001a5c4d537090adf0168c9..d9e1815ee69c090808883ce03cfd48705b09ed5f 100644 (file)
@@ -49,6 +49,13 @@ if (!$avx512vaes && `$ENV{CC} -v 2>&1`
     }
 }
 
+if (!$avx512vaes && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avx512vaes = ($1>=11); #icx started with clang 11
+    }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index 852c484727d63286e05f4e1652f7d43b998c410f..154f1bc70f1b4a45cacdcded5f2d09e3eecadfbc 100644 (file)
@@ -80,6 +80,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index e7c218f097d0dc76cd5eb7c5b12e3547454db2e5..003c0e971662fa8c5a368802d3111e06ce482f73 100644 (file)
@@ -111,6 +111,9 @@ $avx=1 if (!$avx && $win64 && ($flavour =~ /masm/ || $ENV{ASM} =~ /ml64/) &&
           $1>=10);
 $avx=1 if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0-9]+\.[0-9]+)/ && $2>=3.0);
 
+$avx=1 if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__` =~ /#define __clang_major__.([0-9]+)/ &&
+          $1>=11); #icx started with clang 11
+
 $shaext=1;     ### set to zero if compiling for 1.0.1
 
 $stitched_decrypt=0;
index da39d483c29a3c400ae95fe8cbc36874f3bc4604..aecd6e7b40cd3047024149a6a48c3b46104de71a 100644 (file)
@@ -75,6 +75,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 $shaext=$avx;  ### set to zero if compiling for 1.0.1
 $avx=1         if (!$shaext && $avx);
 
index d89564112e31352cba0c8afb26b9a11390800383..16f2bbe789649c3dafd8233e33122e9d92d46ee5 100644 (file)
@@ -59,6 +59,13 @@ if (!$avx512vaes && `$ENV{CC} -v 2>&1`
     }
 }
 
+if (!$avx512vaes && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avx512vaes = ($1>=11); #icx started with clang 11
+    }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index 27f2e9b4b9385b01a7b89fb6ea4a9e87fba30eb4..7e1db31e223accfc40ff43e2a00fd88b5b816f95 100644 (file)
@@ -64,6 +64,13 @@ if (!$avx512ifma && `$ENV{CC} -v 2>&1`
     }
 }
 
+if (!$avx512ifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avx512ifma = ($1>=11); #icx started with clang 11
+    }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index 1c020842a7dcd07f56140030793ab607799f972d..652d659442892fb23c862a09130c606e4de4ffc5 100644 (file)
@@ -39,6 +39,13 @@ if (!$avxifma && `$ENV{CC} -v 2>&1`
     $avxifma = ($ver>=16.0);
 }
 
+if (!$avxifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avxifma = ($1>=16);
+    }
+}
+
 if ($win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
        `nasm -v 2>&1` =~ /NASM version ([0-9]+)\.([0-9]+)(?:\.([0-9]+))?(rc[0-9]+)?/) {
     my $ver = $1 + $2/100.0 + $3/10000.0; # 3.1.0->3.01, 3.10.1->3.1001
index b2ed3e8ca7cfd475a17d80ad2f1919f77eb66f24..403e09099f73216918dfd5506b8023aaea61fbd0 100644 (file)
@@ -63,6 +63,13 @@ if (!$avx512ifma && `$ENV{CC} -v 2>&1`
     }
 }
 
+if (!$avx512ifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avx512ifma = ($1>=11); #icx started with clang 11
+    }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index 91237a058680c1a61a9c72638572d3050b23bb23..9141e552bd334134f7cd413f0cdd8a77ee0e62dc 100644 (file)
@@ -38,6 +38,13 @@ if (!$avxifma && `$ENV{CC} -v 2>&1`
     $avxifma = ($ver>=16.0);
 }
 
+if (!$avxifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avxifma = ($1>=16);
+    }
+}
+
 if ($win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
        `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?(rc[0-9]+)?/) {
     $avxifma = ($1>2.16) + ($1==2.16 && ((!defined($2) && !defined($3)) || (defined($2))));
index b76ab5904c88798c69f0e923b64070a7ca8b0096..f41c1c60df8388b58b9d1924d85bc6c745de8b94 100644 (file)
@@ -63,6 +63,13 @@ if (!$avx512ifma && `$ENV{CC} -v 2>&1`
     }
 }
 
+if (!$avx512ifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avx512ifma = ($1>=11); #icx started with clang 11
+    }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index 9afbb3b7e2fce460a9c34763b59d6355c30c46fd..2f7b036e5d5baf45214365a1ccaee539af3004da 100644 (file)
@@ -38,6 +38,13 @@ if (!$avxifma && `$ENV{CC} -v 2>&1`
     $avxifma = ($ver>=16.0);
 }
 
+if (!$avxifma && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avxifma = ($1>=16);
+    }
+}
+
 if ($win64 && ($flavour =~ /nasm/ || $ENV{ASM} =~ /nasm/) &&
        `nasm -v 2>&1` =~ /NASM version ([2-9]\.[0-9]+)(?:\.([0-9]+))?(rc[0-9]+)?/) {
     $avxifma = ($1>2.16) + ($1==2.16 && ((!defined($2) && !defined($3)) || (defined($2))));
index 30ba4e0b5834fa0b2d14c1b4d2c6f2bb762aa4bc..239ffb7e2b72c03ade0b75dd46326a9dc45d1ae9 100755 (executable)
@@ -73,6 +73,14 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9
        $addx = ($ver>=3.03);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $addx = ($1>=11); #icx started with clang 11
+               $avx = ($1>=11);
+       }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT = *OUT;
index ebb4762b635a94185f2ddc824bb7de0eb8526b49..ea6f3f2ac6c5236539439e25c64c96383274fc1b 100755 (executable)
@@ -90,6 +90,13 @@ if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([
        $addx = ($ver>=3.03);
 }
 
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $addx = ($1>=11); #icx started with clang 11
+       }
+}
+
 ($out, $inp, $mod) = ("%rdi", "%rsi", "%rbp"); # common internal API
 {
 my ($out,$inp,$mod,$n0,$times) = ("%rdi","%rsi","%rdx","%rcx","%r8d");
index 78c006126f085bc9261918238db351fc08ed7426..3b3bd747e5a8a3f8177415ece3fd65a20aae5e91 100755 (executable)
@@ -82,6 +82,13 @@ if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([
        $addx = ($ver>=3.03);
 }
 
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $addx = ($1>=11); #icx started with clang 11
+       }
+}
+
 # int bn_mul_mont(
 $rp="%rdi";    # BN_ULONG *rp,
 $ap="%rsi";    # const BN_ULONG *ap,
index 6b40f789b397368fa031b388d2b1451b00d2db4b..95d34e0b508675ce5a8506989a9e76f64e185070 100755 (executable)
@@ -69,6 +69,13 @@ if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([
        $addx = ($ver>=3.03);
 }
 
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $addx = ($1>=11); #icx started with clang 11
+       }
+}
+
 # int bn_mul_mont_gather5(
 $rp="%rdi";    # BN_ULONG *rp,
 $ap="%rsi";    # const BN_ULONG *ap,
index 9cda820ff07c466c7971754cdc992178eeff6da6..6a64a57651dfa64d62842cb4c9b67861b2307f50 100755 (executable)
@@ -64,6 +64,10 @@ $ymm=1 if ($xmm && !$ymm &&
                `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/ &&
                $2>=3.0);       # first version supporting AVX
 
+$ymm=1 if ($xmm && !$ymm &&
+               `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__` =~ /#define __clang_major__.([0-9]+)/ &&
+               $1>=11); #icx started with clang 11
+
 $a="eax";
 ($b,$b_)=("ebx","ebp");
 ($c,$c_)=("ecx","esi");
index 9e5e1ba1e178bba19f2c1778e5357ffa39865316..ed54836dbf215965df45f471c7eb5a6772fa2a05 100755 (executable)
@@ -91,6 +91,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index bfd767642ac14d693c0fd9e3ae23d0d0dccd10f1..f30811bc866026ba24b2c705cedc8c337b78786f 100755 (executable)
@@ -80,6 +80,14 @@ if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([
        $addx = ($ver>=3.03);
 }
 
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+               $addx = ($1>=11);
+       }
+}
+
 $code.=<<___;
 .text
 .extern        OPENSSL_ia32cap_P
index a0771494b1f119483f32b65d601412554f1b5903..d2fdd76948c39ecbe4caa3fbb6998e0fed325c22 100755 (executable)
@@ -97,6 +97,13 @@ if (!$addx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([
        $addx = ($ver>=3.03);
 }
 
+if (!$addx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $addx = ($1>=11); #icx started with clang 11
+       }
+}
+
 $code.=<<___;
 .text
 
index 054672bb6b9bf6b8f945b64969df816f2ea50424..ad6461f9e52fb5f71edc75b4ffed25d0f7b876af 100644 (file)
@@ -72,6 +72,13 @@ if (!$avx512vaes && `$ENV{CC} -v 2>&1`
     }
 }
 
+if (!$avx512vaes && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+    =~ /#define __clang_major__.([0-9]+)/) {
+    if ($1) {
+        $avx512vaes = ($1>=11); #icx started with clang 11
+    }
+}
+
 open OUT, "| \"$^X\" \"$xlate\" $flavour \"$output\""
   or die "can't call $xlate: $!";
 *STDOUT = *OUT;
index a2b3d853640112c9b3bb0d4f4d19958829254af0..f3b920bb3a7e165e3434224952a8faba08ce2e4a 100644 (file)
@@ -73,6 +73,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index eea064868229c53ecbdc491922991c21d65037e0..5a761cfb1f62b8272fc9294ad32851fdfe9f50e4 100644 (file)
@@ -121,6 +121,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index 7a81cd758485a7f26b16763adff2198ab93d6370..42e575516e18fc626fba6480c29e1d4bd7856a81 100755 (executable)
@@ -73,6 +73,13 @@ if ($sse2) {
        if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/) {
                $avx = ($2>=3.0) + ($2>3.0);
        }
+
+       if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+               =~ /#define __clang_major__.([0-9]+)/) {
+               if ($1) {
+                       $avx = ($1>=11); #icx started with clang 11
+               }
+       }
 }
 
 ########################################################################
index 04c6da3c617467035a68194b498be636534727f5..a70ec0f952cbb26efea998094e90a7b749150aec 100755 (executable)
@@ -95,6 +95,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index d98be771b0ff0b280370e73d8a7d1f752a4079be..277c33ea7fb3169a5d0436062ac68da27bc0a48e 100644 (file)
@@ -146,6 +146,9 @@ $ymm=1 if ($xmm && !$ymm && $ARGV[0] eq "win32" &&
 $ymm=1 if ($xmm && !$ymm && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLVM) ([0-9]+\.[0-9]+)/ &&
                $2>=3.0);       # first version supporting AVX
 
+$ymm=1 if ($xmm && !$ymm && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__` =~ /#define __clang_major__.([0-9]+)/ &&
+               $1>=11); #icx started with clang 11
+
 $shaext=$xmm;  ### set to zero if compiling for 1.0.1
 
 &external_label("OPENSSL_ia32cap_P") if ($xmm);
index 8edb96d2f79c23d17fb8bb26dc3b324bc323879c..5a8c0755e1714f2c04f7a8791d8ae379c8c58e87 100644 (file)
@@ -76,6 +76,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index 5b9eb8f96fe2cf4dfe8ed69ae657d56c3ed26511..af9d172153b5b2b37bec7798af3fd9e443e78e7f 100755 (executable)
@@ -124,6 +124,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 $shaext=1;     ### set to zero if compiling for 1.0.1
 $avx=1         if (!$shaext && $avx);
 
index 97a7bccba9596ffeb46b4d606cfcd2c89a67f450..68a9fa9e6481ec855e72e24bdc5b5c92b03ce09a 100644 (file)
@@ -99,6 +99,13 @@ if ($xmm && !$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|based on LLV
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if ($xmm && !$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 $shaext=$xmm;  ### set to zero if compiling for 1.0.1
 
 $unroll_after = 64*4;  # If pre-evicted from L1P cache first spin of
index 3f904027415e78ad351d08c630a47726fe2faeda..0175f5b36f4d018275c1a5d5322160a0fce915f4 100644 (file)
@@ -77,6 +77,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 open OUT,"| \"$^X\" \"$xlate\" $flavour \"$output\""
     or die "can't call $xlate: $!";
 *STDOUT=*OUT;
index 029468db9ffee1bf8c4f23eec2c78c501c3de763..4db4b1beb08f598c251349925aa81f0aa2cbff96 100755 (executable)
@@ -144,6 +144,13 @@ if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:clang|LLVM) version|.*based on LLVM) ([0
        $avx = ($2>=3.0) + ($2>3.0);
 }
 
+if (!$avx && `$ENV{CC} -x c /dev/null -dM -E|grep __clang_major__`
+       =~ /#define __clang_major__.([0-9]+)/) {
+       if ($1) {
+               $avx = ($1>=11); #icx started with clang 11
+       }
+}
+
 $shaext=1;     ### set to zero if compiling for 1.0.1
 $avx=1         if (!$shaext && $avx);