diff --git a/Configurations/00-base-templates.conf b/Configurations/00-base-templates.conf index 026cdab077b57d5a1e9b89fd6a09b4d841087e0e..4308c5c1d876fff881628fbeb8926b9d9f83203b 100644 --- a/Configurations/00-base-templates.conf +++ b/Configurations/00-base-templates.conf @@ -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" }, diff --git a/crypto/aes/Makefile.in b/crypto/aes/Makefile.in index 938ad3c4049caa4a75992d994bf4a1d15189096d..6ece34378af691d70e3eb10b54dc7bfcacf78d8e 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 403c4d12904873e1eda4afe06d89272dac7788f6..9eb0c3d9c1f436be9bfe6d5e629ec621bf3377bf 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 536f23b47c70bd3f428cec8841ba65fa1d21695f..5b0159e22289de8e18e8cdc81e54d301e4e9ab68 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 599e9ab6dcd366cc631b6cd3a91bc58d85ae9cd8..40e01d3424086d2948fd7f7dd545655ac5f03d31 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) $@ diff --git a/crypto/bn/Makefile.in b/crypto/bn/Makefile.in index 594667fc8498b162ce28f87602ddb902af9d6eda..6ae831ccda3978a371511eb6ec98a196d68a8efe 100644 --- a/crypto/bn/Makefile.in +++ b/crypto/bn/Makefile.in @@ -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) $@ diff --git a/crypto/bn/asm/sparcv9-mont.pl b/crypto/bn/asm/sparcv9-mont.pl index c08d8223f7d9318e5bca9472afa0dce532f2f5ab..4f922c3110e1230c472b5e6b85d3dfc7a9059ffc 100644 --- a/crypto/bn/asm/sparcv9-mont.pl +++ b/crypto/bn/asm/sparcv9-mont.pl @@ -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] diff --git a/crypto/bn/asm/sparcv9a-mont.pl b/crypto/bn/asm/sparcv9a-mont.pl index 433ec9ecf99d7fdf262f32cc6cd478032c07271e..7a4782e7876457bf03bc67594e3bb54771feb17a 100755 --- a/crypto/bn/asm/sparcv9a-mont.pl +++ b/crypto/bn/asm/sparcv9a-mont.pl @@ -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 diff --git a/crypto/bn/asm/vis3-mont.pl b/crypto/bn/asm/vis3-mont.pl index 8bab5a16b638d4cbe0f82c3a4ea1b3726a3f4cec..7b953a2be040ab1016600bad40cbe87b2f00ebd8 100644 --- a/crypto/bn/asm/vis3-mont.pl +++ b/crypto/bn/asm/vis3-mont.pl @@ -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 ___ diff --git a/crypto/bn/build.info b/crypto/bn/build.info index e9cde755565be07a2be987eb5cbe4ebf10a8cb2d..8e424945b9639ace3aa146cff7bba11d8f99d945 100644 --- a/crypto/bn/build.info +++ b/crypto/bn/build.info @@ -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) diff --git a/crypto/camellia/Makefile.in b/crypto/camellia/Makefile.in index 10c5a753414b48218c9de0848e8e810ac4683670..e32a73be64abb8ee98be52ce19f39dcb63fa04c8 100644 --- a/crypto/camellia/Makefile.in +++ b/crypto/camellia/Makefile.in @@ -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 diff --git a/crypto/camellia/asm/cmllt4-sparcv9.pl b/crypto/camellia/asm/cmllt4-sparcv9.pl index a813168b42ec47b4b0af702fab6d15ea55ecedf6..fac53623a7bca21cb992841fe0412d0964dee31f 100644 --- a/crypto/camellia/asm/cmllt4-sparcv9.pl +++ b/crypto/camellia/asm/cmllt4-sparcv9.pl @@ -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 diff --git a/crypto/camellia/build.info b/crypto/camellia/build.info index d212d5441de7d0d84acc9551a9f30dabebb3fc06..b5c1114bace459cdf503eadc22eb66f7e816433d 100644 --- a/crypto/camellia/build.info +++ b/crypto/camellia/build.info @@ -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] diff --git a/crypto/des/Makefile.in b/crypto/des/Makefile.in index 248b53d70044b9bc997da9700b554baa28a6c3cc..c056804d352db70364b0074ab8739d1662206b71 100644 --- a/crypto/des/Makefile.in +++ b/crypto/des/Makefile.in @@ -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) > $@ diff --git a/crypto/des/asm/dest4-sparcv9.pl b/crypto/des/asm/dest4-sparcv9.pl index 1dc60243d4fbda91314f2d2dc33ca1eb0aa1b6c3..858df0ba84e3910272545086b6b18a44af6bf05e 100644 --- a/crypto/des/asm/dest4-sparcv9.pl +++ b/crypto/des/asm/dest4-sparcv9.pl @@ -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 ___ diff --git a/crypto/des/build.info b/crypto/des/build.info index a0ac1de1484114b7d98ae00b6f1ea16cdbebba39..d3c5c1f64cf91c3e1a432131faaea6d0aa00aac5 100644 --- a/crypto/des/build.info +++ b/crypto/des/build.info @@ -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) > $@ diff --git a/crypto/ec/Makefile.in b/crypto/ec/Makefile.in index decc1740aa8739def2576c3ae1d2fc99102186e6..342b98d316315054d5db326107830de826c3ec19 100644 --- a/crypto/ec/Makefile.in +++ b/crypto/ec/Makefile.in @@ -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 diff --git a/crypto/ec/asm/ecp_nistz256-sparcv9.pl b/crypto/ec/asm/ecp_nistz256-sparcv9.pl index 5693b75e5b7655a5ac2887048e1f210d8691cee4..29a089b4a2706ae6bd8acdd520691f5c0902fd31 100755 --- a/crypto/ec/asm/ecp_nistz256-sparcv9.pl +++ b/crypto/ec/asm/ecp_nistz256-sparcv9.pl @@ -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" diff --git a/crypto/ec/build.info b/crypto/ec/build.info index 39a9f4754c7a9cb03d1377351098574669391412..469a7ddc5ea408dd5a232ef08275c777602eea3e 100644 --- a/crypto/ec/build.info +++ b/crypto/ec/build.info @@ -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) $@ diff --git a/crypto/md5/Makefile.in b/crypto/md5/Makefile.in index aec94b6d6b12b037717c6d735156b8b08d7d8198..625bdc8a10538c153ba90e8759c49d1c5880140e 100644 --- a/crypto/md5/Makefile.in +++ b/crypto/md5/Makefile.in @@ -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 diff --git a/crypto/md5/asm/md5-sparcv9.pl b/crypto/md5/asm/md5-sparcv9.pl index 47a66c584e5f0870239d30d74f433883d303cb0f..1c4ae5200b981764ffc5a6b741fd10d0899ca3bd 100644 --- a/crypto/md5/asm/md5-sparcv9.pl +++ b/crypto/md5/asm/md5-sparcv9.pl @@ -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; diff --git a/crypto/md5/build.info b/crypto/md5/build.info index 09f417c68fdefbbe4e1e510788496e64227a7702..6a04f37cfcc4fea750c1892176f12319e7070575 100644 --- a/crypto/md5/build.info +++ b/crypto/md5/build.info @@ -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] diff --git a/crypto/modes/Makefile.in b/crypto/modes/Makefile.in index 5e4415c4314ea061d15bbfd4c135307cf8c2e5e0..a62486ed13d92e3aa98c3a3e618c42c1715f05aa 100644 --- a/crypto/modes/Makefile.in +++ b/crypto/modes/Makefile.in @@ -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 && \ diff --git a/crypto/modes/asm/ghash-sparcv9.pl b/crypto/modes/asm/ghash-sparcv9.pl index e928c42cd7d77acce141e2519160710b07db33ff..badfcf7b092c1146723ab0baeef5f242a28ecdb0 100644 --- a/crypto/modes/asm/ghash-sparcv9.pl +++ b/crypto/modes/asm/ghash-sparcv9.pl @@ -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 diff --git a/crypto/modes/build.info b/crypto/modes/build.info index 220cdaf18dde29583cce4565c84eec435bec67d9..dfce733cd36fd21681455c477fafcaca6264bb32 100644 --- a/crypto/modes/build.info +++ b/crypto/modes/build.info @@ -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 && \ diff --git a/crypto/perlasm/sparcv9_modes.pl b/crypto/perlasm/sparcv9_modes.pl index 74544fbe2c22c0536a6becc68f0153907860c97d..81e602671b38208c00b537cdd72f7c68dd22d165 100644 --- a/crypto/perlasm/sparcv9_modes.pl +++ b/crypto/perlasm/sparcv9_modes.pl @@ -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"; } diff --git a/crypto/poly1305/Makefile.in b/crypto/poly1305/Makefile.in index 10f009ffec406160273b9306aae21ba8d71314bd..2f1b25657862317f51e25eb2eaaf6eee415b84a7 100644 --- a/crypto/poly1305/Makefile.in +++ b/crypto/poly1305/Makefile.in @@ -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 diff --git a/crypto/poly1305/asm/poly1305-sparcv9.pl b/crypto/poly1305/asm/poly1305-sparcv9.pl index a4f883ea3a48b50abe050be9f84964b97f703251..f0ce259c02cfe5e0a9a4398fd25e5ee15917a659 100755 --- a/crypto/poly1305/asm/poly1305-sparcv9.pl +++ b/crypto/poly1305/asm/poly1305-sparcv9.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)); diff --git a/crypto/poly1305/build.info b/crypto/poly1305/build.info index 5d389dc49268de926e2d632290d28dfed60459ef..c93c5724f82791e0cb909e43dfc4c027f182cf5f 100644 --- a/crypto/poly1305/build.info +++ b/crypto/poly1305/build.info @@ -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 diff --git a/crypto/sha/Makefile.in b/crypto/sha/Makefile.in index afb161be9e6e24ab66e1f1b72e83b7cca0e4a008..ba06085b3333126886c7d52ce0f7dd3d7452780e 100644 --- a/crypto/sha/Makefile.in +++ b/crypto/sha/Makefile.in @@ -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) $@ diff --git a/crypto/sha/asm/sha1-sparcv9.pl b/crypto/sha/asm/sha1-sparcv9.pl index 9ce376cbdcb38ce769de904b649f835c4f966229..9f20725363f16c132942ec4b8c515cb991a6da5e 100644 --- a/crypto/sha/asm/sha1-sparcv9.pl +++ b/crypto/sha/asm/sha1-sparcv9.pl @@ -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"); diff --git a/crypto/sha/asm/sha512-sparcv9.pl b/crypto/sha/asm/sha512-sparcv9.pl index bd4af64066fcf99b6ffc540c4df826cfba788566..866a7b0999aaa9b2853bfef1de738d6a0a4a199b 100644 --- a/crypto/sha/asm/sha512-sparcv9.pl +++ b/crypto/sha/asm/sha512-sparcv9.pl @@ -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/) { diff --git a/crypto/sha/build.info b/crypto/sha/build.info index c6fac544a250d359a5e501968f60610fe62621ba..2543414774140c67de29f2c2a5e178464c0d69e4 100644 --- a/crypto/sha/build.info +++ b/crypto/sha/build.info @@ -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) $@