From: Richard Levitte Date: Mon, 7 Mar 2016 14:48:25 +0000 (+0100) Subject: Unified - adapt the generation of poly1305 assembler to use GENERATE X-Git-Tag: OpenSSL_1_1_0-pre4~184 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3aa3af68a52ed8e6fba9c5a7659943714593ac88;p=oweals%2Fopenssl.git Unified - adapt the generation of poly1305 assembler to use GENERATE This gets rid of the BEGINRAW..ENDRAW sections in crypto/poly1305/build.info. This also moves the assembler generating perl scripts to take the output file name as last command line argument, where necessary. Reviewed-by: Andy Polyakov --- diff --git a/crypto/poly1305/Makefile.in b/crypto/poly1305/Makefile.in index 2f1b256578..e27fcafa31 100644 --- a/crypto/poly1305/Makefile.in +++ b/crypto/poly1305/Makefile.in @@ -39,9 +39,9 @@ lib: $(LIBOBJ) poly1305-sparcv9.S: asm/poly1305-sparcv9.pl $(PERL) asm/poly1305-sparcv9.pl $(PERLASM_SCHEME) $@ poly1305-x86.s: asm/poly1305-x86.pl - $(PERL) asm/poly1305-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ + $(PERL) asm/poly1305-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) $@ poly1305-x86_64.s: asm/poly1305-x86_64.pl - $(PERL) asm/poly1305-x86_64.pl $(PERLASM_SCHEME) > $@ + $(PERL) asm/poly1305-x86_64.pl $(PERLASM_SCHEME) $@ poly1305-ppc.s: asm/poly1305-ppc.pl $(PERL) asm/poly1305-ppc.pl $(PERLASM_SCHEME) $@ poly1305-ppcfp.s: asm/poly1305-ppcfp.pl diff --git a/crypto/poly1305/asm/poly1305-c64xplus.pl b/crypto/poly1305/asm/poly1305-c64xplus.pl index fc765e14fe..f750a6e5eb 100755 --- a/crypto/poly1305/asm/poly1305-c64xplus.pl +++ b/crypto/poly1305/asm/poly1305-c64xplus.pl @@ -19,6 +19,9 @@ # time dependent on input length. This module on the other hand is free # from such limitation. +$output=pop; +open STDOUT,">$output"; + ($CTXA,$INPB,$LEN,$PADBIT)=("A4","B4","A6","B6"); ($H0,$H1,$H2,$H3,$H4,$H4a)=("A8","B8","A10","B10","B2",$LEN); ($D0,$D1,$D2,$D3)= ("A9","B9","A11","B11"); diff --git a/crypto/poly1305/asm/poly1305-sparcv9.pl b/crypto/poly1305/asm/poly1305-sparcv9.pl index f0ce259c02..5452887981 100755 --- a/crypto/poly1305/asm/poly1305-sparcv9.pl +++ b/crypto/poly1305/asm/poly1305-sparcv9.pl @@ -42,6 +42,9 @@ my ($r0,$r1,$r2,$r3,$s1,$s2,$s3,$h4) = map("%l$_",(0..7)); my ($h0,$h1,$h2,$h3, $t0,$t1,$t2) = map("%o$_",(0..5,7)); my ($d0,$d1,$d2,$d3) = map("%g$_",(1..4)); +my $output = pop; +open STDOUT,">$stdout"; + $code.=<<___; #include "sparc_arch.h" diff --git a/crypto/poly1305/asm/poly1305-x86.pl b/crypto/poly1305/asm/poly1305-x86.pl index fb9fa2bc34..4307c9978a 100755 --- a/crypto/poly1305/asm/poly1305-x86.pl +++ b/crypto/poly1305/asm/poly1305-x86.pl @@ -38,6 +38,9 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1; push(@INC,"${dir}","${dir}../../perlasm"); require "x86asm.pl"; +$output=pop; +open STDOUT,">$output"; + &asm_init($ARGV[0],"poly1305-x86.pl",$ARGV[$#ARGV] eq "386"); $sse2=$avx=0; @@ -1795,3 +1798,5 @@ sub vlazy_reduction { &align (4); &asm_finish(); + +close STDOUT; diff --git a/crypto/poly1305/build.info b/crypto/poly1305/build.info index c93c5724f8..5b548e6294 100644 --- a/crypto/poly1305/build.info +++ b/crypto/poly1305/build.info @@ -2,18 +2,13 @@ LIBS=../../libcrypto SOURCE[../../libcrypto]=\ poly1305.c {- $target{poly1305_asm_src} -} -BEGINRAW[Makefile(unix)] -{- $builddir -}/poly1305-sparcv9.S: {- $sourcedir -}/asm/poly1305-sparcv9.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-sparcv9.pl $(PERLASM_SCHEME) $@ -{- $builddir -}/poly1305-x86.s: {- $sourcedir -}/asm/poly1305-x86.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@ -{- $builddir -}/poly1305-x86_64.s: {- $sourcedir -}/asm/poly1305-x86_64.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-x86_64.pl $(PERLASM_SCHEME) > $@ -{- $builddir -}/poly1305-ppc.s: {- $sourcedir -}/asm/poly1305-ppc.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-ppc.pl $(PERLASM_SCHEME) $@ -{- $builddir -}/poly1305-ppcfp.s: {- $sourcedir -}/asm/poly1305-ppcfp.pl - CC="$(CC)" $(PERL) {- $sourcedir -}/asm/poly1305-ppcfp.pl $(PERLASM_SCHEME) $@ +GENERATE[poly1305-sparcv9.S]=asm/poly1305-sparcv9.pl $(PERLASM_SCHEME) +GENERATE[poly1305-x86.s]=asm/poly1305-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) +GENERATE[poly1305-x86_64.s]=asm/poly1305-x86_64.pl $(PERLASM_SCHEME) +GENERATE[poly1305-ppc.s]=asm/poly1305-ppc.pl $(PERLASM_SCHEME) +GENERATE[poly1305-ppcfp.s]=asm/poly1305-ppcfp.pl $(PERLASM_SCHEME) +BEGINRAW[Makefile(unix)] {- $builddir -}/poly1305-%.S: {- $sourcedir -}/asm/poly1305-%.pl CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@ ENDRAW[Makefile(unix)]