Skip to content

Commit

Permalink
Unify sparcv9 assembler naming and build rules among 32- and 64-bit b…
Browse files Browse the repository at this point in the history
…uilds.

Engage run-time switch between bn_mul_mont_fpu and bn_mul_mont_int.
  • Loading branch information
Andy Polyakov committed Dec 16, 2005
1 parent 4c5e19b commit a00e414
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 77 deletions.
20 changes: 10 additions & 10 deletions Configure
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ my $x86_out_asm="x86cpuid-out.o:bn86-out.o co86-out.o mo86-out.o:dx86-out.o yx86

my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o::aes-x86_64.o::md5-x86_64.o:sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o:::wp-x86_64.o";
my $ia64_asm="ia64cpuid.o:bn-ia64.o::aes_core.o aes_cbc.o aes-ia64.o::md5-ia64.o:sha1-ia64.o sha256-ia64.o sha512-ia64.o::rc4-ia64.o:::";

my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o::md5-sparcv9.o::::::";
my $no_asm=":::::::::::";

# As for $BSDthreads. Idea is to maintain "collective" set of flags,
Expand Down Expand Up @@ -201,23 +201,23 @@ my %table=(
"solaris-sparcv7-gcc","gcc:-O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv8-gcc","gcc:-mv8 -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# -m32 should be safe to add as long as driver recognizes -mcpu=ultrasparc
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o::md5-sparcv8plus.o:::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::bn_asm.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o::md5-sparcv9.o:::::::dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv9-gcc","gcc:-m32 -mcpu=ultrasparc -O3 -fomit-frame-pointer -Wall -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-gcc","gcc:-m64 -mcpu=ultrasparc -O3 -Wall -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-m64 -shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
####
"debug-solaris-sparcv8-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:::::::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o:des_enc-sparc.o fcrypt_b.o:::md5-sparcv8plus.o:::::::dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-gcc","gcc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -DPEDANTIC -O -g -mcpu=ultrasparc -pedantic -ansi -Wall -Wshadow -Wno-long-long -D__EXTENSIONS__ -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",

#### SPARC Solaris with Sun C setups
# SC4.0 doesn't pass 'make test', upgrade to SC5.0 or SC4.2.
# SC4.2 is ok, better than gcc even on bn as long as you tell it -xarch=v8
# SC5.0 note: Compiler common patch 107357-01 or later is required!
"solaris-sparcv7-cc","cc:-xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${no_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv8-cc","cc:-xarch=v8 -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plusa -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o::md5-sparcv8plus.o:::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9a -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR::bn_asm.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o::md5-sparcv9.o:::::::dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
"solaris-sparcv9-cc","cc:-xtarget=ultra -xarch=v8plusa -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"solaris64-sparcv9-cc","cc:-xtarget=ultra -xarch=v9a -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-xarch=v9 -G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs",
####
"debug-solaris-sparcv8-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xarch=v8 -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8.o:::::::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR::sparcv8plus.o::::md5-sparcv8plus.o:::::::dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"debug-solaris-sparcv9-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DBN_CTX_DEBUG -DCRYPTO_MDEBUG_ALL -xtarget=ultra -xarch=v8plus -g -O -xstrconst -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-G -dy -z text:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",

#### SunOS configs, assuming sparc for the gcc one.
#"sunos-cc", "cc:-O4 -DNOPROTO -DNOCONST::(unknown):SUNOS::DES_UNROLL:${no_asm}::",
Expand Down Expand Up @@ -333,9 +333,9 @@ my %table=(
"linux-sparcv8","gcc:-mv8 -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -DBN_DIV2W::-D_REENTRANT::-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8.o:des_enc-sparc.o fcrypt_b.o::::::::::dlfcn:linux-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# it's a real mess with -mcpu=ultrasparc option under Linux, but
# -Wa,-Av8plus should do the trick no matter what.
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plusa -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::sparcv8plus.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o::md5-sparcv8plus.o:::::::dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux-sparcv9","gcc:-m32 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall -Wa,-Av8plusa -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m32:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
# GCC 3.1 is a requirement
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR::bn_asm.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o::md5-sparcv9.o:::::::dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"linux64-sparcv9","gcc:-m64 -mcpu=ultrasparc -DB_ENDIAN -DTERMIO -O3 -fomit-frame-pointer -Wall::-D_REENTRANT:ULTRASPARC:-ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:linux-shared:-fPIC:-m64:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
#### Alpha Linux with GNU C and Compaq C setups
# Special notes:
# - linux-alpha+bwx-gcc is ment to be used from ./config only. If you
Expand Down Expand Up @@ -365,7 +365,7 @@ my %table=(
# -DMD32_REG_T=int doesn't actually belong in sparc64 target, it
# simply *happens* to work around a compiler bug in gcc 3.3.3,
# triggered by RIPEMD160 code.
"BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR::bn_asm.o sparcv9a-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o::md5-sparcv9.o:::::::dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"BSD-sparc64", "gcc:-DB_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR:${sparcv9_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"BSD-ia64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_UNROLL DES_INT:${ia64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
"BSD-x86_64", "gcc:-DL_ENDIAN -DTERMIOS -O3 -DMD32_REG_T=int -Wall::${BSDthreads}:::SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${x86_64_asm}:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",

Expand Down
52 changes: 26 additions & 26 deletions TABLE
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ $thread_cflag = -pthread -D_THREAD_SAFE -D_REENTRANT
$sys_id =
$lflags =
$bn_ops = BN_LLONG RC2_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC2 BF_PTR
$cpuid_obj =
$bn_obj = bn_asm.o sparcv9a-mont.o
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
Expand Down Expand Up @@ -1660,12 +1660,12 @@ $thread_cflag = -D_REENTRANT
$sys_id = ULTRASPARC
$lflags = -lsocket -lnsl -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj = sparcv8plus.o
$des_obj =
$aes_obj =
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
$md5_obj = md5-sparcv8plus.o
$md5_obj = md5-sparcv9.o
$sha1_obj =
$cast_obj =
$rc4_obj =
Expand All @@ -1688,12 +1688,12 @@ $thread_cflag = -D_REENTRANT
$sys_id = ULTRASPARC
$lflags = -lsocket -lnsl -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj = sparcv8plus.o
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj =
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
$md5_obj = md5-sparcv8plus.o
$md5_obj = md5-sparcv9.o
$sha1_obj =
$cast_obj =
$rc4_obj =
Expand Down Expand Up @@ -2976,12 +2976,12 @@ $thread_cflag = -D_REENTRANT
$sys_id = ULTRASPARC
$lflags = -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj = sparcv8plus.o sparcv9a-mont.o
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
$md5_obj = md5-sparcv8plus.o
$md5_obj = md5-sparcv9.o
$sha1_obj =
$cast_obj =
$rc4_obj =
Expand Down Expand Up @@ -3032,8 +3032,8 @@ $thread_cflag = -D_REENTRANT
$sys_id = ULTRASPARC
$lflags = -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj = bn_asm.o sparcv9a-mont.o
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
Expand Down Expand Up @@ -3648,12 +3648,12 @@ $thread_cflag = -D_REENTRANT
$sys_id = ULTRASPARC
$lflags = -lsocket -lnsl -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj = sparcv8plus.o sparcv9a-mont.o
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
$md5_obj = md5-sparcv8plus.o
$md5_obj = md5-sparcv9.o
$sha1_obj =
$cast_obj =
$rc4_obj =
Expand All @@ -3676,12 +3676,12 @@ $thread_cflag = -D_REENTRANT
$sys_id = ULTRASPARC
$lflags = -lsocket -lnsl -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj = sparcv8plus.o sparcv9a-mont.o
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
$md5_obj = md5-sparcv8plus.o
$md5_obj = md5-sparcv9.o
$sha1_obj =
$cast_obj =
$rc4_obj =
Expand Down Expand Up @@ -3760,8 +3760,8 @@ $thread_cflag = -D_REENTRANT
$sys_id = ULTRASPARC
$lflags = -lsocket -lnsl -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj = bn_asm.o sparcv9a-mont.o
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
Expand All @@ -3788,8 +3788,8 @@ $thread_cflag = -D_REENTRANT
$sys_id = ULTRASPARC
$lflags = -lsocket -lnsl -ldl
$bn_ops = BN_LLONG RC4_CHAR RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR
$cpuid_obj =
$bn_obj = bn_asm.o sparcv9a-mont.o
$cpuid_obj = sparcv9cap.o sparccpuid.o
$bn_obj = bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o
$des_obj = des_enc-sparc.o fcrypt_b.o
$aes_obj = aes_core.o aes_cbc.o aes-sparcv9.o
$bf_obj =
Expand Down
6 changes: 4 additions & 2 deletions crypto/bn/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,12 @@ mo86-out.s: asm/x86-mont.pl ../perlasm/x86asm.pl

sparcv8.o: asm/sparcv8.S
$(CC) $(CFLAGS) -c asm/sparcv8.S
sparcv8plus.o: asm/sparcv8plus.S
$(CC) $(CFLAGS) -c asm/sparcv8plus.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) > $@

bn-mips3.o: asm/mips3.s
@if [ "$(CC)" = "gcc" ]; then \
Expand Down
15 changes: 13 additions & 2 deletions crypto/bn/asm/sparcv8plus.S
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,19 @@
* }
*/

#if defined(__SUNPRO_C) && defined(__sparcv9)
/* They've said -xarch=v9 at command line */
.register %g2,#scratch
.register %g3,#scratch
# define FRAME_SIZE -192
#elif defined(__GNUC__) && defined(__arch64__)
/* They've said -m64 at command line */
.register %g2,#scratch
.register %g3,#scratch
# define FRAME_SIZE -192
#else
# define FRAME_SIZE -96
#endif
/*
* GNU assembler can't stand stuw:-(
*/
Expand Down Expand Up @@ -619,8 +632,6 @@ bn_sub_words:
* Andy.
*/

#define FRAME_SIZE -96

/*
* Here is register usage map for *all* routines below.
*/
Expand Down
5 changes: 3 additions & 2 deletions crypto/bn/asm/sparcv9-mont.pl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
$npj="%l6";
$tpj="%l7";

$fname="bn_mul_mont";
$fname="bn_mul_mont_int";

$code=<<___;
.section ".text",#alloc,#execinstr
Expand Down Expand Up @@ -298,7 +298,8 @@
___

########
######## bn_sqr_mont gives up to 20% improvement over above code
######## .Lbn_sqr_mont gives up to 20% *overall* improvement over
######## code without following dedicated squaring procedure.
########
$sbit="%i2"; # re-use $bp!

Expand Down
6 changes: 3 additions & 3 deletions crypto/bn/asm/sparcv9a-mont.pl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
# which is perfectly usable in this context... In other words, as far
# as HAL/Fujitsu SPARC64 family goes, talk to the author:-)

# In 32-bit context the implementation implies following additional
# limitations on input arguments:
# The implementation implies following "non-natural" limitations on
# input arguments:
# - num may not be less than 4;
# - num has to be even;
# - ap, bp, rp, np has to be 64-bit aligned [which is not a problem
Expand All @@ -47,7 +47,7 @@
# noticeable(!) improvement);
# - dedicated squaring procedure[?];

$fname="bn_mul_mont";
$fname="bn_mul_mont_fpu";
$bits=32;
for (@ARGV) {
$bits=64 if (/\-m64/ || /\-xarch\=v9/);
Expand Down
2 changes: 1 addition & 1 deletion crypto/cryptlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ void OPENSSL_cpuid_setup(void)
unsigned long *OPENSSL_ia32cap_loc(void) { return NULL; }
#endif
int OPENSSL_NONPIC_relocated = 0;
#if !defined(OPENSSL_CPUID_SETUP)
#if !defined(OPENSSL_CPUID_SETUP) && !defined(OPENSSL_CPUID_OBJ)
void OPENSSL_cpuid_setup(void) {}
#endif

Expand Down
14 changes: 0 additions & 14 deletions crypto/md5/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,20 +52,6 @@ mx86-cof.s: asm/md5-586.pl ../perlasm/x86asm.pl
mx86-out.s: asm/md5-586.pl ../perlasm/x86asm.pl
(cd asm; $(PERL) md5-586.pl a.out $(CFLAGS) > ../$@)

md5-sparcv8plus.o: asm/md5-sparcv9.S
$(CC) $(ASFLAGS) -DMD5_BLOCK_DATA_ORDER -c \
-o md5-sparcv8plus.o asm/md5-sparcv9.S

# Old GNU assembler doesn't understand V9 instructions, so we
# hire /usr/ccs/bin/as to do the job. Note that option is called
# *-gcc27, but even gcc 2>=8 users may experience similar problem
# if they didn't bother to upgrade GNU assembler. Such users should
# not choose this option, but be adviced to *remove* GNU assembler
# or upgrade it.
md5-sparcv8plus-gcc27.o: asm/md5-sparcv9.S
$(CC) $(ASFLAGS) -DMD5_BLOCK_DATA_ORDER -E asm/md5-sparcv9.S | \
/usr/ccs/bin/as -xarch=v8plus - -o md5-sparcv8plus-gcc27.o

md5-sparcv9.o: asm/md5-sparcv9.S
$(CC) $(ASFLAGS) -DMD5_BLOCK_DATA_ORDER -c \
-o md5-sparcv9.o asm/md5-sparcv9.S
Expand Down
8 changes: 4 additions & 4 deletions crypto/sparccpuid.S
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ OPENSSL_atomic_add:
sra %o0,%g0,%o0 ! we return signed int, remember?
.size OPENSSL_atomic_add,.-OPENSSL_atomic_add

.global OPENSSL_rdtick
.global _sparcv9_rdtick
.align 32
OPENSSL_rdtick:
_sparcv9_rdtick:
subcc %g0,1,%o0
.word 0x91408000 !rd %ccr,%o0
cmp %o0,0x99
Expand All @@ -229,8 +229,8 @@ OPENSSL_rdtick:
.notick:
retl
xor %o1,%o1,%o1
.type OPENSSL_rdtick,#function
.size OPENSSL_rdtick,.-OPENSSL_rdtick
.type _sparcv9_rdtick,#function
.size _sparcv9_rdtick,.-_sparcv9_rdtick

.section ".init",#alloc,#execinstr
call OPENSSL_cpuid_setup
Expand Down

0 comments on commit a00e414

Please sign in to comment.