提交 3aa3af68 编写于 作者: R Richard Levitte

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: NAndy Polyakov <appro@openssl.org>
上级 6d33da34
......@@ -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
......
......@@ -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");
......
......@@ -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"
......
......@@ -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;
......@@ -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)]
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册