Unify all assembler file generators
[openssl.git] / crypto / poly1305 / asm / poly1305-x86.pl
index 9db38b5ecc4b60ce79462ad1a2c070ed50d47dd0..9aa1bc1600e176f0a1a13d2f22aee2cad90bc034 100755 (executable)
@@ -1,7 +1,7 @@
 #! /usr/bin/env perl
-# Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
 #
-# Licensed under the OpenSSL license (the "License").  You may not use
+# Licensed under the Apache License 2.0 (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
 # in the file LICENSE in the source distribution or at
 # https://www.openssl.org/source/license.html
@@ -47,10 +47,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 push(@INC,"${dir}","${dir}../../perlasm");
 require "x86asm.pl";
 
-$output=pop;
-open STDOUT,">$output";
+$output=pop and open STDOUT,">$output";
 
-&asm_init($ARGV[0],"poly1305-x86.pl",$ARGV[$#ARGV] eq "386");
+&asm_init($ARGV[0],$ARGV[$#ARGV] eq "386");
 
 $sse2=$avx=0;
 for (@ARGV) { $sse2=1 if (/-DOPENSSL_IA32_SSE2/); }
@@ -71,7 +70,7 @@ if ($sse2) {
        $avx = ($1>=2.09) + ($1>=2.10);
        }
 
-       if (!$avx && `$ENV{CC} -v 2>&1` =~ /(^clang version|based on LLVM) ([3-9]\.[0-9]+)/) {
+       if (!$avx && `$ENV{CC} -v 2>&1` =~ /((?:^clang|LLVM) version|based on LLVM) ([3-9]\.[0-9]+)/) {
                $avx = ($2>=3.0) + ($2>3.0);
        }
 }
@@ -730,7 +729,7 @@ my $extra = shift;
 
        &movdqa         ($T0,$T1);                      # -> base 2^26 ...
        &pand           ($T1,$MASK);
-       &paddd          ($D0,$T1);                      # ... and accumuate
+       &paddd          ($D0,$T1);                      # ... and accumulate
 
        &movdqa         ($T1,$T0);
        &psrlq          ($T0,26);