From eb77e8886df84526f42f566632be71d4ed373308 Mon Sep 17 00:00:00 2001 From: Andy Polyakov Date: Tue, 8 Mar 2016 09:46:19 +0100 Subject: SPARCv9 assembly pack: unify build rules and argument handling. Make all scripts produce .S, make interpretation of $(CFLAGS) pre-processor's responsibility, start accepting $(PERLASM_SCHEME). [$(PERLASM_SCHEME) is redundant in this case, because there are no deviataions between Solaris and Linux assemblers. This is purely to unify .pl->.S handling across all targets.] Reviewed-by: Richard Levitte --- crypto/aes/Makefile.in | 8 ++++---- crypto/aes/asm/aes-sparcv9.pl | 17 ++++++++++------- crypto/aes/asm/aest4-sparcv9.pl | 11 +++++++---- crypto/aes/build.info | 6 +++--- 4 files changed, 24 insertions(+), 18 deletions(-) (limited to 'crypto/aes') diff --git a/crypto/aes/Makefile.in b/crypto/aes/Makefile.in index 938ad3c404..6ece34378a 100644 --- a/crypto/aes/Makefile.in +++ b/crypto/aes/Makefile.in @@ -66,10 +66,10 @@ aesni-sha256-x86_64.s: asm/aesni-sha256-x86_64.pl aesni-mb-x86_64.s: asm/aesni-mb-x86_64.pl $(PERL) asm/aesni-mb-x86_64.pl $(PERLASM_SCHEME) > $@ -aes-sparcv9.s: asm/aes-sparcv9.pl - $(PERL) asm/aes-sparcv9.pl $(CFLAGS) > $@ -aest4-sparcv9.s: asm/aest4-sparcv9.pl ../perlasm/sparcv9_modes.pl - $(PERL) asm/aest4-sparcv9.pl $(CFLAGS) > $@ +aes-sparcv9.S: asm/aes-sparcv9.pl + $(PERL) asm/aes-sparcv9.pl $(PERLASM_SCHEME) $@ +aest4-sparcv9.S: asm/aest4-sparcv9.pl ../perlasm/sparcv9_modes.pl + $(PERL) asm/aest4-sparcv9.pl $(PERLASM_SCHEME) $@ aes-ppc.s: asm/aes-ppc.pl $(PERL) asm/aes-ppc.pl $(PERLASM_SCHEME) $@ diff --git a/crypto/aes/asm/aes-sparcv9.pl b/crypto/aes/asm/aes-sparcv9.pl index 403c4d1290..9eb0c3d9c1 100755 --- a/crypto/aes/asm/aes-sparcv9.pl +++ b/crypto/aes/asm/aes-sparcv9.pl @@ -30,10 +30,11 @@ # optimal decrypt procedure]. Compared to GNU C generated code both # procedures are more than 60% faster:-) -$bits=32; -for (@ARGV) { $bits=64 if (/\-m64/ || /\-xarch\=v9/); } -if ($bits==64) { $bias=2047; $frame=192; } -else { $bias=0; $frame=112; } +$output = pop; +open STDOUT,">$output"; + +$frame="STACK_FRAME"; +$bias="STACK_BIAS"; $locals=16; $acc0="%l0"; @@ -74,11 +75,13 @@ sub _data_word() while(defined($i=shift)) { $code.=sprintf"\t.long\t0x%08x,0x%08x\n",$i,$i; } } -$code.=<<___ if ($bits==64); +$code.=<<___; +#include "sparc_arch.h" + +#ifdef __arch64__ .register %g2,#scratch .register %g3,#scratch -___ -$code.=<<___; +#endif .section ".text",#alloc,#execinstr .align 256 diff --git a/crypto/aes/asm/aest4-sparcv9.pl b/crypto/aes/asm/aest4-sparcv9.pl index 536f23b47c..5b0159e222 100644 --- a/crypto/aes/asm/aest4-sparcv9.pl +++ b/crypto/aes/asm/aest4-sparcv9.pl @@ -68,7 +68,8 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; push(@INC,"${dir}","${dir}../../perlasm"); require "sparcv9_modes.pl"; -&asm_init(@ARGV); +$output = pop; +open STDOUT,">$output"; $::evp=1; # if $evp is set to 0, script generates module with # AES_[en|de]crypt, AES_set_[en|de]crypt_key and AES_cbc_encrypt entry @@ -83,12 +84,14 @@ $::evp=1; # if $evp is set to 0, script generates module with { my ($inp,$out,$key,$rounds,$tmp,$mask)=map("%o$_",(0..5)); -$code.=<<___ if ($::abibits==64); +$code.=<<___; +#include "sparc_arch.h" + +#ifdef __arch64__ .register %g2,#scratch .register %g3,#scratch +#endif -___ -$code.=<<___; .text .globl aes_t4_encrypt diff --git a/crypto/aes/build.info b/crypto/aes/build.info index 599e9ab6dc..40e01d3424 100644 --- a/crypto/aes/build.info +++ b/crypto/aes/build.info @@ -31,10 +31,10 @@ BEGINRAW[Makefile] {- $builddir -}/aesni-mb-x86_64.s: {- $sourcedir -}/asm/aesni-mb-x86_64.pl CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesni-mb-x86_64.pl $(PERLASM_SCHEME) > $@ -{- $builddir -}/aes-sparcv9.s: {- $sourcedir -}/asm/aes-sparcv9.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-sparcv9.pl $(CFLAGS) > $@ +{- $builddir -}/aes-sparcv9.S: {- $sourcedir -}/asm/aes-sparcv9.pl + CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-sparcv9.pl $(PERLASM_SCHEME) $@ {- $builddir -}/aest4-sparcv9.s: {- $sourcedir -}/asm/aest4-sparcv9.pl {- $sourcetop -}/crypto/perlasm/sparcv9_modes.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aest4-sparcv9.pl $(CFLAGS) > $@ + CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aest4-sparcv9.pl $(PERLASM_SCHEME) $@ {- $builddir -}/aes-ppc.s: {- $sourcedir -}/asm/aes-ppc.pl CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aes-ppc.pl $(PERLASM_SCHEME) $@ -- cgit v1.2.3