Unify all assembler file generators
authorRichard Levitte <levitte@openssl.org>
Thu, 12 Sep 2019 22:06:46 +0000 (00:06 +0200)
committerRichard Levitte <levitte@openssl.org>
Mon, 16 Sep 2019 14:29:57 +0000 (16:29 +0200)
commit1aa89a7a3afb053d0c0b7fad8d3ea1b0a5447289
treeec9b4705f579c93debe2484db1e93bcbb755d29e
parenta1c8befd661fa2145d330bb04ebc6061660db4fd
Unify all assembler file generators

They now generally conform to the following argument sequence:

    script.pl "$(PERLASM_SCHEME)" [ C preprocessor arguments ... ] \
              $(PROCESSOR) <output file>

However, in the spirit of being able to use these scripts manually,
they also allow for no argument, or for only the flavour, or for only
the output file.  This is done by only using the last argument as
output file if it's a file (it has an extension), and only using the
first argument as flavour if it isn't a file (it doesn't have an
extension).

While we're at it, we make all $xlate calls the same, i.e. the $output
argument is always quoted, and we always die on error when trying to
start $xlate.

There's a perl lesson in this, regarding operator priority...

This will always succeed, even when it fails:

    open FOO, "something" || die "ERR: $!";

The reason is that '||' has higher priority than list operators (a
function is essentially a list operator and gobbles up everything
following it that isn't lower priority), and since a non-empty string
is always true, so that ends up being exactly the same as:

    open FOO, "something";

This, however, will fail if "something" can't be opened:

    open FOO, "something" or die "ERR: $!";

The reason is that 'or' has lower priority that list operators,
i.e. it's performed after the 'open' call.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9884)
165 files changed:
crypto/aes/asm/aes-586.pl
crypto/aes/asm/aes-armv4.pl
crypto/aes/asm/aes-c64xplus.pl
crypto/aes/asm/aes-mips.pl
crypto/aes/asm/aes-parisc.pl
crypto/aes/asm/aes-ppc.pl
crypto/aes/asm/aes-s390x.pl
crypto/aes/asm/aes-sparcv9.pl
crypto/aes/asm/aes-x86_64.pl
crypto/aes/asm/aesfx-sparcv9.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-x86.pl
crypto/aes/asm/aesni-x86_64.pl
crypto/aes/asm/aesp8-ppc.pl
crypto/aes/asm/aest4-sparcv9.pl
crypto/aes/asm/aesv8-armx.pl
crypto/aes/asm/bsaes-armv7.pl
crypto/aes/asm/bsaes-x86_64.pl
crypto/aes/asm/vpaes-armv8.pl
crypto/aes/asm/vpaes-ppc.pl
crypto/aes/asm/vpaes-x86.pl
crypto/aes/asm/vpaes-x86_64.pl
crypto/alphacpuid.pl
crypto/arm64cpuid.pl
crypto/armv4cpuid.pl
crypto/bf/asm/bf-586.pl
crypto/bn/asm/alpha-mont.pl
crypto/bn/asm/armv4-gf2m.pl
crypto/bn/asm/armv4-mont.pl
crypto/bn/asm/armv8-mont.pl
crypto/bn/asm/bn-586.pl
crypto/bn/asm/c64xplus-gf2m.pl
crypto/bn/asm/co-586.pl
crypto/bn/asm/ia64-mont.pl
crypto/bn/asm/mips-mont.pl
crypto/bn/asm/mips.pl
crypto/bn/asm/parisc-mont.pl
crypto/bn/asm/ppc-mont.pl
crypto/bn/asm/ppc.pl
crypto/bn/asm/ppc64-mont.pl
crypto/bn/asm/rsaz-avx2.pl
crypto/bn/asm/rsaz-x86_64.pl
crypto/bn/asm/s390x-gf2m.pl
crypto/bn/asm/s390x-mont.pl
crypto/bn/asm/sparct4-mont.pl
crypto/bn/asm/sparcv9-gf2m.pl
crypto/bn/asm/sparcv9-mont.pl
crypto/bn/asm/sparcv9a-mont.pl
crypto/bn/asm/via-mont.pl
crypto/bn/asm/vis3-mont.pl
crypto/bn/asm/x86-gf2m.pl
crypto/bn/asm/x86-mont.pl
crypto/bn/asm/x86_64-gf2m.pl
crypto/bn/asm/x86_64-mont.pl
crypto/bn/asm/x86_64-mont5.pl
crypto/camellia/asm/cmll-x86.pl
crypto/camellia/asm/cmll-x86_64.pl
crypto/camellia/asm/cmllt4-sparcv9.pl
crypto/cast/asm/cast-586.pl
crypto/chacha/asm/chacha-armv4.pl
crypto/chacha/asm/chacha-armv8.pl
crypto/chacha/asm/chacha-c64xplus.pl
crypto/chacha/asm/chacha-ia64.pl
crypto/chacha/asm/chacha-ppc.pl
crypto/chacha/asm/chacha-s390x.pl
crypto/chacha/asm/chacha-x86.pl
crypto/chacha/asm/chacha-x86_64.pl
crypto/des/asm/crypt586.pl
crypto/des/asm/des-586.pl
crypto/des/asm/dest4-sparcv9.pl
crypto/ec/asm/ecp_nistz256-armv4.pl
crypto/ec/asm/ecp_nistz256-armv8.pl
crypto/ec/asm/ecp_nistz256-avx2.pl
crypto/ec/asm/ecp_nistz256-ppc64.pl
crypto/ec/asm/ecp_nistz256-sparcv9.pl
crypto/ec/asm/ecp_nistz256-x86.pl
crypto/ec/asm/ecp_nistz256-x86_64.pl
crypto/ec/asm/x25519-ppc64.pl
crypto/ec/asm/x25519-x86_64.pl
crypto/md5/asm/md5-586.pl
crypto/md5/asm/md5-sparcv9.pl
crypto/md5/asm/md5-x86_64.pl
crypto/modes/asm/aesni-gcm-x86_64.pl
crypto/modes/asm/ghash-armv4.pl
crypto/modes/asm/ghash-c64xplus.pl
crypto/modes/asm/ghash-parisc.pl
crypto/modes/asm/ghash-s390x.pl
crypto/modes/asm/ghash-sparcv9.pl
crypto/modes/asm/ghash-x86.pl
crypto/modes/asm/ghash-x86_64.pl
crypto/modes/asm/ghashp8-ppc.pl
crypto/modes/asm/ghashv8-armx.pl
crypto/pariscid.pl
crypto/poly1305/asm/poly1305-armv4.pl
crypto/poly1305/asm/poly1305-armv8.pl
crypto/poly1305/asm/poly1305-c64xplus.pl
crypto/poly1305/asm/poly1305-mips.pl
crypto/poly1305/asm/poly1305-ppc.pl
crypto/poly1305/asm/poly1305-ppcfp.pl
crypto/poly1305/asm/poly1305-s390x.pl
crypto/poly1305/asm/poly1305-sparcv9.pl
crypto/poly1305/asm/poly1305-x86.pl
crypto/poly1305/asm/poly1305-x86_64.pl
crypto/ppccpuid.pl
crypto/rc4/asm/rc4-586.pl
crypto/rc4/asm/rc4-c64xplus.pl
crypto/rc4/asm/rc4-md5-x86_64.pl
crypto/rc4/asm/rc4-parisc.pl
crypto/rc4/asm/rc4-s390x.pl
crypto/rc4/asm/rc4-x86_64.pl
crypto/rc5/asm/rc5-586.pl
crypto/ripemd/asm/rmd-586.pl
crypto/s390xcpuid.pl
crypto/sha/asm/keccak1600-armv4.pl
crypto/sha/asm/keccak1600-armv8.pl
crypto/sha/asm/keccak1600-avx2.pl
crypto/sha/asm/keccak1600-avx512.pl
crypto/sha/asm/keccak1600-avx512vl.pl
crypto/sha/asm/keccak1600-c64x.pl
crypto/sha/asm/keccak1600-mmx.pl
crypto/sha/asm/keccak1600-ppc64.pl
crypto/sha/asm/keccak1600-s390x.pl
crypto/sha/asm/keccak1600-x86_64.pl
crypto/sha/asm/keccak1600p8-ppc.pl
crypto/sha/asm/sha1-586.pl
crypto/sha/asm/sha1-armv4-large.pl
crypto/sha/asm/sha1-armv8.pl
crypto/sha/asm/sha1-c64xplus.pl
crypto/sha/asm/sha1-ia64.pl
crypto/sha/asm/sha1-mb-x86_64.pl
crypto/sha/asm/sha1-mips.pl
crypto/sha/asm/sha1-parisc.pl
crypto/sha/asm/sha1-ppc.pl
crypto/sha/asm/sha1-s390x.pl
crypto/sha/asm/sha1-sparcv9.pl
crypto/sha/asm/sha1-sparcv9a.pl
crypto/sha/asm/sha1-thumb.pl
crypto/sha/asm/sha1-x86_64.pl
crypto/sha/asm/sha256-586.pl
crypto/sha/asm/sha256-armv4.pl
crypto/sha/asm/sha256-c64xplus.pl
crypto/sha/asm/sha256-mb-x86_64.pl
crypto/sha/asm/sha512-586.pl
crypto/sha/asm/sha512-armv4.pl
crypto/sha/asm/sha512-armv8.pl
crypto/sha/asm/sha512-c64xplus.pl
crypto/sha/asm/sha512-ia64.pl
crypto/sha/asm/sha512-mips.pl
crypto/sha/asm/sha512-parisc.pl
crypto/sha/asm/sha512-ppc.pl
crypto/sha/asm/sha512-s390x.pl
crypto/sha/asm/sha512-sparcv9.pl
crypto/sha/asm/sha512-x86_64.pl
crypto/sha/asm/sha512p8-ppc.pl
crypto/whrlpool/asm/wp-mmx.pl
crypto/whrlpool/asm/wp-x86_64.pl
crypto/x86_64cpuid.pl
crypto/x86cpuid.pl
engines/asm/e_padlock-x86.pl
engines/asm/e_padlock-x86_64.pl
ms/uplink-ia64.pl
ms/uplink-x86.pl
ms/uplink-x86_64.pl