Fix some assembler generating scripts for better unification
authorRichard Levitte <levitte@openssl.org>
Thu, 10 Mar 2016 23:49:47 +0000 (00:49 +0100)
committerRichard Levitte <levitte@openssl.org>
Thu, 10 Mar 2016 23:54:31 +0000 (00:54 +0100)
Some of these scripts would recognise an output parameter if it looks
like a file path.  That works both in both the classic and new build
schemes.  Some fo these scripts would only recognise it if it's a
basename (i.e. no directory component).  Those need to be corrected,
as the output parameter in the new build scheme is more likely to
contain a directory component than not.

Reviewed-by: Andy Polyakov <appro@openssl.org>
27 files changed:
crypto/aes/asm/aes-armv4.pl
crypto/aes/asm/aes-mips.pl
crypto/aes/asm/aes-s390x.pl
crypto/aes/asm/bsaes-armv7.pl
crypto/aes/asm/vpaes-armv8.pl
crypto/bn/asm/armv4-gf2m.pl
crypto/bn/asm/armv4-mont.pl
crypto/bn/asm/mips-mont.pl
crypto/bn/asm/mips.pl
crypto/bn/asm/s390x-gf2m.pl
crypto/bn/asm/s390x-mont.pl
crypto/chacha/asm/chacha-armv4.pl
crypto/chacha/asm/chacha-s390x.pl
crypto/ec/asm/ecp_nistz256-armv4.pl
crypto/ec/asm/ecp_nistz256-armv8.pl
crypto/modes/asm/ghash-armv4.pl
crypto/modes/asm/ghash-s390x.pl
crypto/poly1305/asm/poly1305-armv4.pl
crypto/poly1305/asm/poly1305-s390x.pl
crypto/rc4/asm/rc4-s390x.pl
crypto/sha/asm/sha1-armv4-large.pl
crypto/sha/asm/sha1-mips.pl
crypto/sha/asm/sha1-s390x.pl
crypto/sha/asm/sha256-armv4.pl
crypto/sha/asm/sha512-armv4.pl
crypto/sha/asm/sha512-mips.pl
crypto/sha/asm/sha512-s390x.pl

index f72d027458f3ddfb460c5789b7d04dda10195eb7..3efe415e66e60ddd6c9b52d2cc81d93c3bcb94b7 100644 (file)
@@ -33,8 +33,8 @@
 # improvement on Cortex A8 core and ~21.5 cycles per byte.
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index a82d8af6f26b469cea7674b52e2aed92606e7551..77dfe1ac9b11e6374a2604a458107fea398246cc 100644 (file)
@@ -81,13 +81,13 @@ $pf = ($flavour =~ /nubi/i) ? $t0 : $t2;
 
 $big_endian=(`echo MIPSEL | $ENV{CC} -E -`=~/MIPSEL/)?1:0 if ($ENV{CC});
 
-for (@ARGV) {  $output=$_ if (/^\w[\w\-]*\.\w+$/);     }
+for (@ARGV) {  $output=$_ if (/\w[\w\-]*\.\w+$/);      }
 open STDOUT,">$output";
 
 if (!defined($big_endian))
 {    $big_endian=(unpack('L',pack('N',1))==1);   }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 my ($MSB,$LSB)=(0,3);  # automatically converted to little-endian
index 71d5b55077fab3a930e79a75e97610be54564981..4aacf1b6b5ea4f1a66c5707d92b7f7131fe03145 100644 (file)
@@ -92,7 +92,7 @@ if ($flavour =~ /3[12]/) {
        $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 $softonly=0;   # allow hardware support
index 03b8d825cd5f5f6ed6e01457173692f0b3e2d1bc..58d0173de2464440a1b811c94c1a468e6c07b4f0 100644 (file)
@@ -48,8 +48,8 @@
 #                                      <ard.biesheuvel@linaro.org>
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index bc90b9f3bb6ad692c3a4482415144a41f41f8da2..f44c62a0a28e3890f0e61d8c783f939550b7cddc 100755 (executable)
@@ -30,7 +30,7 @@
 # (***)        presented for reference/comparison purposes;
 
 $flavour = shift;
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
index 22aa4830f8edcee997589b1528e52412ec6b3105..36681ee9cfd67410fb1cd1a6e1629e7cc0fdc0de 100644 (file)
@@ -33,8 +33,8 @@
 # http://conradoplg.cryptoland.net/files/2010/12/mocrysen13.pdf
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index 6fb5bb40fb5c9bdec33e10bd0690f10028c09849..c791502e996924f3c19eb3c6b832d253ee069a6d 100644 (file)
@@ -48,8 +48,8 @@
 # Snapdragon S4.
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index a33cdf411121ff0a14aa3c1084a19956022e82ff..3bccdf6931deb9affb00c0ed963e4969d299c0f9 100644 (file)
@@ -67,7 +67,7 @@ $SAVED_REGS_MASK = ($flavour =~ /nubi/i) ? 0x00fff000 : 0x00ff0000;
 #
 ######################################################################
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 if ($flavour =~ /64|n32/i) {
index acafde5e5685ccb7e2d59b218d45d1bda0572fbd..4c8eba0a052776064b7af39896e4b8ecc1a474e1 100644 (file)
@@ -49,7 +49,7 @@
 # key length, more for longer keys.
 
 $flavour = shift || "o32";
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 if ($flavour =~ /64|n32/i) {
index 9d18d40e778467677d45549b83755d0b53d0a40b..1d76c9f416c3f0e6efbe63a09ffb87c36be559f2 100644 (file)
@@ -35,7 +35,7 @@ if ($flavour =~ /3[12]/) {
         $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 $stdframe=16*$SIZE_T+4*8;
index 9fd64e81eef36cbde53332d10743b934218530e5..bdad486e4f4732fbcb9ce50b615e14804994041c 100644 (file)
@@ -54,7 +54,7 @@ if ($flavour =~ /3[12]/) {
        $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 $stdframe=16*$SIZE_T+4*8;
index 4545101c3103a54a00b91b3ae578dad2f527de60..c9083998349ce4e81c10d79f7a2492f70b9a9a9c 100755 (executable)
@@ -28,8 +28,8 @@
 #      20-25% worse;
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index 00e4a146b250b60d42991e4f146163fe05e756f8..42faadcd7f57b9f00288356faefe5bab9e50cec7 100755 (executable)
@@ -23,7 +23,7 @@ if ($flavour =~ /3[12]/) {
        $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 sub AUTOLOAD()         # thunk [simplified] x86-style perlasm
index ab11a8782e298e81ebad6fda5c15794394499818..d777459fd187b4db0dc9bbdecc0ba21488f89523 100755 (executable)
@@ -27,8 +27,8 @@
 # operation. Keep in mind that +200% means 3x improvement.
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index 4b2e925434ad0549e0432dc48567e86213fc59f1..5a60f0b2fa144b32816c1b321f59c3e1954ef39c 100644 (file)
@@ -26,7 +26,7 @@
 # operation. Keep in mind that +400% means 5x improvement.
 
 $flavour = shift;
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 
 $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
 ( $xlate="${dir}arm-xlate.pl" and -f $xlate ) or
index 0d5b8ef3a76e08e91caf5cd6569c8872ad09bc81..6cc36532fa27a9eff78dba80028b780bda569eae 100644 (file)
@@ -72,8 +72,8 @@
 # example...
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index 39096b423ad805d7e6475e6aa42bdc8b6ed041ae..a46f3eba6a24bc34d74c6a62dfba8b53b3409dd0 100644 (file)
@@ -47,7 +47,7 @@ if ($flavour =~ /3[12]/) {
        $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 $softonly=0;
index 06301aa2e199fea9d1363efa87422a54f8fab957..4c4b417fcdc82478151b000bc11fcafc663b139b 100755 (executable)
@@ -22,8 +22,8 @@
 #      to improve Cortex-A9 result, but then A5/A7 loose more than 20%;
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index 635db0e6866ba159188d77a6ca63ae013434c822..ce6a85f0afc37c3e938a256f9308ba5621854340 100755 (executable)
@@ -27,7 +27,7 @@ if ($flavour =~ /3[12]/) {
        $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 $sp="%r15";
index 1aa754820c64e905cf75956c27aff6866e172dae..fa6a23e1daf9ee9dde8849987604dde988c767df 100644 (file)
@@ -33,7 +33,7 @@ if ($flavour =~ /3[12]/) {
        $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 $rp="%r14";
index e1bb92bad764dd26c9ca9a60819d2804f152a034..6fd23031c9b733d3324aac37b44a4397336d0f53 100644 (file)
@@ -69,8 +69,8 @@
 # Add ARMv8 code path performing at 2.35 cpb on Apple A7.
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index e228f6c588827250480fd18ed8e8e38175fda01b..26db5cdad8d8447a62c989f5173cf5e90e4ea05b 100644 (file)
@@ -70,7 +70,7 @@ if ($flavour =~ /64|n32/i) {
 
 $big_endian=(`echo MIPSEL | $ENV{CC} -E -`=~/MIPSEL/)?1:0 if ($ENV{CC});
 
-for (@ARGV) {  $output=$_ if (/^\w[\w\-]*\.\w+$/);   }
+for (@ARGV) {  $output=$_ if (/\w[\w\-]*\.\w+$/);   }
 open STDOUT,">$output";
 
 if (!defined($big_endian))
index 9ce8a4cd5cf33e8cd00d208406d6d145b4ff35e1..a62cc31892e2d3cb37f84927a2208f71bb88d257 100644 (file)
@@ -43,7 +43,7 @@ if ($flavour =~ /3[12]/) {
        $g="g";
 }
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 $K_00_39="%r0"; $K=$K_00_39;
index 5e56992d8ef6d2be9de7a7df96f168c480e2e887..621bcdb6284ca081055e1520d0238fabcf8c59f0 100644 (file)
@@ -38,8 +38,8 @@
 # Add ARMv8 code path performing at 2.0 cpb on Apple A7.
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index 9e3c4dbf1c1d8c177ee5dc73cede00c79c0a85e4..0840a8d8147a0ca0f8e2b805b7824194746f892f 100644 (file)
@@ -51,8 +51,8 @@ $lo="LO";
 # ====================================================================
 
 $flavour = shift;
-if ($flavour=~/^\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
-else { while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {} }
+if ($flavour=~/\w[\w\-]*\.\w+$/) { $output=$flavour; undef $flavour; }
+else { while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {} }
 
 if ($flavour && $flavour ne "void") {
     $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
index b468cfb4569e963f77fee03959dddff7b2077c6b..79429ab749a04d716ad83b247a366adba8bddbac 100644 (file)
@@ -74,7 +74,7 @@ $pf = ($flavour =~ /nubi/i) ? $t0 : $t2;
 
 $big_endian=(`echo MIPSEL | $ENV{CC} -E -`=~/MIPSEL/)?1:0 if ($ENV{CC});
 
-for (@ARGV) {  $output=$_ if (/^\w[\w\-]*\.\w+$/);     }
+for (@ARGV) {  $output=$_ if (/\w[\w\-]*\.\w+$/);      }
 open STDOUT,">$output";
 
 if (!defined($big_endian)) { $big_endian=(unpack('L',pack('N',1))==1); }
index 160997e31d478c63f12ef8b8e4d6cafed2f7e6a6..7780627131e93e938b100f391e512a2e04bcfd89 100644 (file)
@@ -64,7 +64,7 @@ $tbl="%r13";
 $T1="%r14";
 $sp="%r15";
 
-while (($output=shift) && ($output!~/^\w[\w\-]*\.\w+$/)) {}
+while (($output=shift) && ($output!~/\w[\w\-]*\.\w+$/)) {}
 open STDOUT,">$output";
 
 if ($output =~ /512/) {