提交 eb77e888 编写于 作者: A Andy Polyakov

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: NRichard Levitte <levitte@openssl.org>
上级 b76998b8
......@@ -191,14 +191,14 @@
sparcv9_asm => {
template => 1,
cpuid_asm_src => "sparcv9cap.c sparccpuid.S",
bn_asm_src => "asm/sparcv8plus.S sparcv9-mont.s sparcv9a-mont.s vis3-mont.s sparct4-mont.S sparcv9-gf2m.S",
bn_asm_src => "asm/sparcv8plus.S sparcv9-mont.S sparcv9a-mont.S vis3-mont.S sparct4-mont.S sparcv9-gf2m.S",
ec_asm_src => "ecp_nistz256.c ecp_nistz256-sparcv9.S",
des_asm_src => "des_enc-sparc.S fcrypt_b.c dest4-sparcv9.s",
aes_asm_src => "aes_core.c aes_cbc.c aes-sparcv9.s aest4-sparcv9.s",
des_asm_src => "des_enc-sparc.S fcrypt_b.c dest4-sparcv9.S",
aes_asm_src => "aes_core.c aes_cbc.c aes-sparcv9.S aest4-sparcv9.S",
md5_asm_src => "md5-sparcv9.S",
sha1_asm_src => "sha1-sparcv9.S sha256-sparcv9.S sha512-sparcv9.S",
cmll_asm_src => "camellia.c cmll_misc.c cmll_cbc.c cmllt4-sparcv9.s",
modes_asm_src => "ghash-sparcv9.s",
cmll_asm_src => "camellia.c cmll_misc.c cmll_cbc.c cmllt4-sparcv9.S",
modes_asm_src => "ghash-sparcv9.S",
poly1305_asm_src=> "poly1305-sparcv9.S",
perlasm_scheme => "void"
},
......
......@@ -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) $@
......
......@@ -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
......
......@@ -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
......
......@@ -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) $@
......
......@@ -70,16 +70,16 @@ sparcv8.o: asm/sparcv8.S
$(CC) $(CFLAGS) -c asm/sparcv8.S
bn-sparcv9.o: asm/sparcv8plus.S
$(CC) $(CFLAGS) -c -o $@ asm/sparcv8plus.S
sparcv9a-mont.s: asm/sparcv9a-mont.pl
$(PERL) asm/sparcv9a-mont.pl $(CFLAGS) $@
sparcv9-mont.s: asm/sparcv9-mont.pl
$(PERL) asm/sparcv9-mont.pl $(CFLAGS) $@
vis3-mont.s: asm/vis3-mont.pl
$(PERL) asm/vis3-mont.pl $(CFLAGS) $@
sparcv9a-mont.S: asm/sparcv9a-mont.pl
$(PERL) asm/sparcv9a-mont.pl $(PERLASM_SCHEME) $@
sparcv9-mont.S: asm/sparcv9-mont.pl
$(PERL) asm/sparcv9-mont.pl $(PERLASM_SCHEME) $@
vis3-mont.S: asm/vis3-mont.pl
$(PERL) asm/vis3-mont.pl $(PERLASM_SCHEME) $@
sparct4-mont.S: asm/sparct4-mont.pl
$(PERL) asm/sparct4-mont.pl $(CFLAGS) $@
$(PERL) asm/sparct4-mont.pl $(PERLASM_SCHEME) $@
sparcv9-gf2m.S: asm/sparcv9-gf2m.pl
$(PERL) asm/sparcv9-gf2m.pl $(CFLAGS) $@
$(PERL) asm/sparcv9-gf2m.pl $(PERLASM_SCHEME) $@
bn-mips.s: asm/mips.pl
$(PERL) asm/mips.pl $(PERLASM_SCHEME) $@
......
......@@ -53,10 +53,8 @@ $np="%i3"; # const BN_ULONG *np,
$n0="%i4"; # const BN_ULONG *n0,
$num="%i5"; # int num);
$bits=32;
for (@ARGV) { $bits=64 if (/\-m64/ || /\-xarch\=v9/); }
if ($bits==64) { $bias=2047; $frame=192; }
else { $bias=0; $frame=128; }
$frame="STACK_FRAME";
$bias="STACK_BIAS";
$car0="%o0";
$car1="%o1";
......@@ -79,6 +77,8 @@ $tpj="%l7";
$fname="bn_mul_mont_int";
$code=<<___;
#include "sparc_arch.h"
.section ".text",#alloc,#execinstr
.global $fname
......@@ -108,7 +108,7 @@ $fname:
ld [$np],$car1 ! np[0]
sub %o7,$bias,%sp ! alloca
ld [$np+4],$npj ! np[1]
be,pt `$bits==32?"%icc":"%xcc"`,.Lbn_sqr_mont
be,pt SIZE_T_CC,.Lbn_sqr_mont
mov 12,$j
mulx $car0,$mul0,$car0 ! ap[0]*bp[0]
......
......@@ -59,16 +59,9 @@ $output = pop;
open STDOUT,">$output";
$fname="bn_mul_mont_fpu";
$bits=32;
for (@ARGV) { $bits=64 if (/\-m64/ || /\-xarch\=v9/); }
if ($bits==64) {
$bias=2047;
$frame=192;
} else {
$bias=0;
$frame=128; # 96 rounded up to largest known cache-line
}
$frame="STACK_FRAME";
$bias="STACK_BIAS";
$locals=64;
# In order to provide for 32-/64-bit ABI duality, I keep integers wider
......@@ -124,6 +117,8 @@ $nhia="%f56"; $nhib="%f58"; $nhic="%f60"; $nhid="%f62";
$ASI_FL16_P=0xD2; # magic ASI value to engage 16-bit FP load
$code=<<___;
#include "sparc_arch.h"
.section ".text",#alloc,#execinstr
.global $fname
......
......@@ -21,16 +21,17 @@
$output = pop;
open STDOUT,">$output";
$bits=32;
for (@ARGV) { $bits=64 if (/\-m64/ || /\-xarch\=v9/); }
if ($bits==64) { $bias=2047; $frame=192; }
else { $bias=0; $frame=112; }
$frame = "STACK_FRAME";
$bias = "STACK_BIAS";
$code.=<<___ if ($bits==64);
$code.=<<___;
#include "sparc_arch.h"
#ifdef __arch64__
.register %g2,#scratch
.register %g3,#scratch
___
$code.=<<___;
#endif
.section ".text",#alloc,#execinstr
___
......
......@@ -22,11 +22,11 @@ GENERATE[x86-gf2m.s]=asm/x86-gf2m.pl \
$(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR)
DEPEND[x86-gf2m.s]=../perlasm/x86asm.pl
GENERATE[sparcv9a-mont.s]=asm/sparcv9a-mont.pl $(CFLAGS)
GENERATE[sparcv9-mont.s]=asm/sparcv9-mont.pl $(CFLAGS)
GENERATE[vis3-mont.s]=asm/vis3-mont.pl $(CFLAGS)
GENERATE[sparct4-mont.S]=asm/sparct4-mont.pl $(CFLAGS)
GENERATE[sparcv9-gf2m.S]=asm/sparcv9-gf2m.pl $(CFLAGS)
GENERATE[sparcv9a-mont.S]=asm/sparcv9a-mont.pl $(PERLASM_SCHEME)
GENERATE[sparcv9-mont.S]=asm/sparcv9-mont.pl $(PERLASM_SCHEME)
GENERATE[vis3-mont.S]=asm/vis3-mont.pl $(PERLASM_SCHEME)
GENERATE[sparct4-mont.S]=asm/sparct4-mont.pl $(PERLASM_SCHEME)
GENERATE[sparcv9-gf2m.S]=asm/sparcv9-gf2m.pl $(PERLASM_SCHEME)
GENERATE[bn-mips.s]=asm/mips.pl $(PERLASM_SCHEME)
GENERATE[mips-mont.s]=asm/mips-mont.pl $(PERLASM_SCHEME)
......
......@@ -45,8 +45,8 @@ cmll-x86.s: asm/cmll-x86.pl ../perlasm/x86asm.pl
$(PERL) asm/cmll-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
cmll-x86_64.s: asm/cmll-x86_64.pl
$(PERL) asm/cmll-x86_64.pl $(PERLASM_SCHEME) > $@
cmllt4-sparcv9.s: asm/cmllt4-sparcv9.pl ../perlasm/sparcv9_modes.pl
$(PERL) asm/cmllt4-sparcv9.pl $(CFLAGS) > $@
cmllt4-sparcv9.S: asm/cmllt4-sparcv9.pl ../perlasm/sparcv9_modes.pl
$(PERL) asm/cmllt4-sparcv9.pl $(PERLASM_SCHEME) $@
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
......
......@@ -46,7 +46,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
# Camellia_[en|de]crypt, Camellia_set_key and Camellia_cbc_encrypt
......@@ -59,6 +60,8 @@ $::evp=1; # if $evp is set to 0, script generates module with
my ($inp,$out,$key,$rounds,$tmp,$mask)=map("%o$_",(0..5));
$code=<<___;
#include "sparc_arch.h"
.text
.globl cmll_t4_encrypt
......
......@@ -8,6 +8,6 @@ BEGINRAW[Makefile]
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/cmll-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
{- $builddir -}/cmll-x86_64.s: {- $sourcedir -}/asm/cmll-x86_64.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/cmll-x86_64.pl $(PERLASM_SCHEME) > $@
{- $builddir -}/cmllt4-sparcv9.s: {- $sourcedir -}/asm/cmllt4-sparcv9.pl {- $sourcetop -}/crypto/perlasm/sparcv9_modes.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/cmllt4-sparcv9.pl $(CFLAGS) > $@
{- $builddir -}/cmllt4-sparcv9.S: {- $sourcedir -}/asm/cmllt4-sparcv9.pl {- $sourcetop -}/crypto/perlasm/sparcv9_modes.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/cmllt4-sparcv9.pl $(PERLASM_SCHEME) $@
ENDRAW[Makefile]
......@@ -55,8 +55,8 @@ lib: $(LIBOBJ)
des_enc-sparc.S: asm/des_enc.m4
m4 -B 8192 asm/des_enc.m4 > des_enc-sparc.S
dest4-sparcv9.s: asm/dest4-sparcv9.pl
$(PERL) asm/dest4-sparcv9.pl $(CFLAGS) > $@
dest4-sparcv9.S: asm/dest4-sparcv9.pl
$(PERL) asm/dest4-sparcv9.pl $(PERLASM_SCHEME) $@
des-586.s: asm/des-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
$(PERL) asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
......
......@@ -27,14 +27,17 @@ $0 =~ m/(.*[\/\\])[^\/\\]+$/; $dir=$1;
push(@INC,"${dir}","${dir}../../perlasm");
require "sparcv9_modes.pl";
&asm_init(@ARGV);
$output=pop;
open STDOUT,">$output";
$code.=<<___ if ($::abibits==64);
$code.=<<___;
#include "sparc_arch.h"
#ifdef __arch64__
.register %g2,#scratch
.register %g3,#scratch
___
#endif
$code.=<<___;
.text
___
......
......@@ -13,8 +13,8 @@ BEGINRAW[Makefile]
{- $builddir -}/des_enc-sparc.S: {- $sourcedir -}/asm/des_enc.m4
m4 -B 8192 {- $sourcedir -}/asm/des_enc.m4 > $@
{- $builddir -}/dest4-sparcv9.s: {- $sourcedir -}/asm/dest4-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/dest4-sparcv9.pl $(CFLAGS) > $@
{- $builddir -}/dest4-sparcv9.S: {- $sourcedir -}/asm/dest4-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/dest4-sparcv9.pl $(PERLASM_SCHEME) $@
{- $builddir -}/des-586.s: {- $sourcedir -}/asm/des-586.pl {- $sourcetop -}/crypto/perlasm/x86asm.pl {- $sourcetop -}/crypto/perlasm/cbc.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/des-586.pl $(PERLASM_SCHEME) $(CFLAGS) > $@
......
......@@ -58,7 +58,7 @@ ecp_nistz256-avx2.s: asm/ecp_nistz256-avx2.pl
$(PERL) asm/ecp_nistz256-avx2.pl $(PERLASM_SCHEME) > $@
ecp_nistz256-sparcv9.S: asm/ecp_nistz256-sparcv9.pl
$(PERL) asm/ecp_nistz256-sparcv9.pl $(CFLAGS) > $@
$(PERL) asm/ecp_nistz256-sparcv9.pl $(PERLASM_SCHEME) $@
ecp_nistz256-%.S: asm/ecp_nistz256-%.pl; $(PERL) $< $(PERLASM_SCHEME) $@
ecp_nistz256-armv4.o: ecp_nistz256-armv4.S
......
......@@ -24,6 +24,9 @@
# on benchmark. Lower coefficients are for ECDSA sign, server-side
# operation. Keep in mind that +200% means 3x improvement.
$output = pop;
open STDOUT,">$output";
$code.=<<___;
#include "sparc_arch.h"
......
......@@ -19,7 +19,7 @@ BEGINRAW[Makefile]
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ecp_nistz256-avx2.pl $(PERLASM_SCHEME) > $@
{- $builddir -}/ecp_nistz256-sparcv9.S: {- $sourcedir -}/asm/ecp_nistz256-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ecp_nistz256-sparcv9.pl $(CFLAGS) > $@
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ecp_nistz256-sparcv9.pl $(PERLASM_SCHEME) $@
{- $builddir -}/ecp_nistz256-%.S: {- $sourcedir -}/asm/ecp_nistz256-%.pl
CC="$(CC)" $(PERL) $< $(PERLASM_SCHEME) $@
......
......@@ -50,7 +50,7 @@ md5-ia64.s: asm/md5-ia64.S
$(PERL) -ne 's/;\s+/;\n/g; print;' > $@
md5-sparcv9.S: asm/md5-sparcv9.pl
$(PERL) asm/md5-sparcv9.pl $@ $(CFLAGS)
$(PERL) asm/md5-sparcv9.pl $(PERLASM_SCHEME) $@
files:
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
......
......@@ -17,7 +17,7 @@
# single-process result on 8-core processor, or ~11GBps per 2.85GHz
# socket.
$output=shift;
$output=pop;
open STDOUT,">$output";
use integer;
......
......@@ -14,5 +14,5 @@ BEGINRAW[Makefile]
$(PERL) -ne 's/;\s+/;\n/g; print;' > $@
{- $builddir -}/md5-sparcv9.S: {- $sourcedir -}/asm/md5-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/md5-sparcv9.pl $@ $(CFLAGS)
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/md5-sparcv9.pl $(PERLASM_SCHEME) $@
ENDRAW[Makefile]
......@@ -48,8 +48,8 @@ ghash-x86_64.s: asm/ghash-x86_64.pl
$(PERL) asm/ghash-x86_64.pl $(PERLASM_SCHEME) > $@
aesni-gcm-x86_64.s: asm/aesni-gcm-x86_64.pl
$(PERL) asm/aesni-gcm-x86_64.pl $(PERLASM_SCHEME) > $@
ghash-sparcv9.s: asm/ghash-sparcv9.pl
$(PERL) asm/ghash-sparcv9.pl $@ $(CFLAGS)
ghash-sparcv9.S: asm/ghash-sparcv9.pl
$(PERL) asm/ghash-sparcv9.pl $(PERLASM_SCHEME) $@
ghash-alpha.s: asm/ghash-alpha.pl
(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
$(PERL) asm/ghash-alpha.pl > $$preproc && \
......
......@@ -46,14 +46,12 @@
# saturates at ~15.5x single-process result on 8-core processor,
# or ~20.5GBps per 2.85GHz socket.
$bits=32;
for (@ARGV) { $bits=64 if (/\-m64/ || /\-xarch\=v9/); }
if ($bits==64) { $bias=2047; $frame=192; }
else { $bias=0; $frame=112; }
$output=shift;
$output=pop;
open STDOUT,">$output";
$frame="STACK_FRAME";
$bias="STACK_BIAS";
$Zhi="%o0"; # 64-bit values
$Zlo="%o1";
$Thi="%o2";
......@@ -75,11 +73,14 @@ $Htbl="%i1";
$inp="%i2";
$len="%i3";
$code.=<<___ if ($bits==64);
$code.=<<___;
#include "sparc_arch.h"
#ifdef __arch64__
.register %g2,#scratch
.register %g3,#scratch
___
$code.=<<___;
#endif
.section ".text",#alloc,#execinstr
.align 64
......@@ -183,7 +184,7 @@ gcm_ghash_4bit:
add $inp,16,$inp
cmp $inp,$len
be,pn `$bits==64?"%xcc":"%icc"`,.Ldone
be,pn SIZE_T_CC,.Ldone
and $Zlo,0xf,$remi
ldx [$Htblo+$nhi],$Tlo
......
......@@ -13,8 +13,8 @@ BEGINRAW[Makefile]
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-x86_64.pl $(PERLASM_SCHEME) > $@
{- $builddir -}/aesni-gcm-x86_64.s: {- $sourcedir -}/asm/aesni-gcm-x86_64.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/aesni-gcm-x86_64.pl $(PERLASM_SCHEME) > $@
{- $builddir -}/ghash-sparcv9.s: {- $sourcedir -}/asm/ghash-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-sparcv9.pl $@ $(CFLAGS)
{- $builddir -}/ghash-sparcv9.S: {- $sourcedir -}/asm/ghash-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-sparcv9.pl $(PERLASM_SCHEME) $@
{- $builddir -}/ghash-alpha.s: {- $sourcedir -}/asm/ghash-alpha.pl
(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/ghash-alpha.pl > $$preproc && \
......
......@@ -16,6 +16,10 @@
# block sizes [though few percent better for not so long ones]. All
# this based on suggestions from David Miller.
$::bias="STACK_BIAS";
$::frame="STACK_FRAME";
$::size_t_cc="SIZE_T_CC";
sub asm_init { # to be called with @ARGV as argument
for (@_) { $::abibits=64 if (/\-m64/ || /\-xarch\=v9/); }
if ($::abibits==64) { $::bias=2047; $::frame=192; $::size_t_cc="%xcc"; }
......
......@@ -37,7 +37,7 @@ lib: $(LIBOBJ)
@touch lib
poly1305-sparcv9.S: asm/poly1305-sparcv9.pl
$(PERL) 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) > $@
poly1305-x86_64.s: asm/poly1305-x86_64.pl
......
......@@ -34,6 +34,9 @@
# (***) Multi-process benchmark saturates at ~12.5x single-process
# result on 8-core processor, or ~21GBps per 2.85GHz socket.
my $output = pop;
open STDOUT,">$output";
my ($ctx,$inp,$len,$padbit,$shl,$shr) = map("%i$_",(0..5));
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));
......
......@@ -4,7 +4,7 @@ SOURCE[../../libcrypto]=\
BEGINRAW[Makefile(unix)]
{- $builddir -}/poly1305-sparcv9.S: {- $sourcedir -}/asm/poly1305-sparcv9.pl
CC="$(CC)" $(PERL) {- $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
......
......@@ -67,9 +67,9 @@ sha1-mb-x86_64.s: asm/sha1-mb-x86_64.pl; $(PERL) asm/sha1-mb-x86_64.pl $(PERLASM
sha256-x86_64.s:asm/sha512-x86_64.pl; $(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
sha256-mb-x86_64.s: asm/sha256-mb-x86_64.pl; $(PERL) asm/sha256-mb-x86_64.pl $(PERLASM_SCHEME) > $@
sha512-x86_64.s:asm/sha512-x86_64.pl; $(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
sha1-sparcv9.S: asm/sha1-sparcv9.pl; $(PERL) asm/sha1-sparcv9.pl $@ $(CFLAGS)
sha256-sparcv9.S:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS)
sha512-sparcv9.S:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS)
sha1-sparcv9.S: asm/sha1-sparcv9.pl; $(PERL) asm/sha1-sparcv9.pl $(PERLASM_SCHEME) $@
sha256-sparcv9.S:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $(PERLASM_SCHEME) $@
sha512-sparcv9.S:asm/sha512-sparcv9.pl; $(PERL) asm/sha512-sparcv9.pl $(PERLASM_SCHEME) $@
sha1-ppc.s: asm/sha1-ppc.pl; $(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) $@
sha256-ppc.s: asm/sha512-ppc.pl; $(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
......
......@@ -25,7 +25,7 @@
# single-process result on 8-core processor, or ~9GBps per 2.85GHz
# socket.
$output=shift;
$output=pop;
open STDOUT,">$output";
@X=("%o0","%o1","%o2","%o3","%o4","%o5","%g1","%o7");
......
......@@ -49,7 +49,7 @@
# saturates at 11.5x single-process result on 8-core processor, or
# ~11/16GBps per 2.85GHz socket.
$output=shift;
$output=pop;
open STDOUT,">$output";
if ($output =~ /512/) {
......
......@@ -39,11 +39,11 @@ BEGINRAW[Makefile]
{- $builddir -}/sha512-x86_64.s:{- $sourcedir -}/asm/sha512-x86_64.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
{- $builddir -}/sha1-sparcv9.S: {- $sourcedir -}/asm/sha1-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-sparcv9.pl $@ $(CFLAGS)
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-sparcv9.pl $(PERLASM_SCHEME) $@
{- $builddir -}/sha256-sparcv9.S:{- $sourcedir -}/asm/sha512-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-sparcv9.pl $@ $(CFLAGS)
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-sparcv9.pl $(PERLASM_SCHEME) $@
{- $builddir -}/sha512-sparcv9.S:{- $sourcedir -}/asm/sha512-sparcv9.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-sparcv9.pl $@ $(CFLAGS)
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha512-sparcv9.pl $(PERLASM_SCHEME) $@
{- $builddir -}/sha1-ppc.s: {- $sourcedir -}/asm/sha1-ppc.pl
CC="$(CC)" $(PERL) {- $sourcedir -}/asm/sha1-ppc.pl $(PERLASM_SCHEME) $@
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册