components/openssl/openssl-1.0.1/patches/103-openssl_t4_inline.patch
author Ivo Raisr <ivo.raisr@oracle.com>
Mon, 01 Jun 2015 08:19:05 -0700
changeset 4424 a844132a7d4b
parent 4370 7043c27399f1
permissions -rw-r--r--
21179246 passing incompatible argument in crypto/evp/e_aes.c:861
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
     1
#
1341
af3d6ef22d65 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1294
diff changeset
     2
# This file adds inline T4 instruction support to OpenSSL upstream code.
1752
84e093c079e2 PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1641
diff changeset
     3
# The change was brought in from OpenSSL 1.0.2.
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
     4
#
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
     5
Index: Configure
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
     6
===================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
     7
diff -ru openssl-1.0.1e/Configure openssl-1.0.1e/Configure
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
     8
--- openssl-1.0.1e/Configure 2011-05-24 17:02:24.000000000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
     9
+++ openssl-1.0.1e/Configure 2011-07-27 10:48:17.817470000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    10
@@ -135,7 +135,7 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    11
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    12
 my $x86_64_asm="x86_64cpuid.o:x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o modexp512-x86_64.o::aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o::md5-x86_64.o:sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o::rc4-x86_64.o rc4-md5-x86_64.o:::wp-x86_64.o:cmll-x86_64.o cmll_misc.o:ghash-x86_64.o:";
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    13
 my $ia64_asm="ia64cpuid.o:bn-ia64.o ia64-mont.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 rc4_skey.o:::::ghash-ia64.o::void";
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    14
-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:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void";
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    15
+my $sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o sparcv9a-mont.o vis3-mont.o sparct4-mont.o sparcv9-gf2m.o:des_enc-sparc.o fcrypt_b.o dest4-sparcv9.o:aes_core.o aes_cbc.o aes-sparcv9.o aest4-sparcv9.o::md5-sparcv9.o:sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void";
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
    16
 my $fips_sparcv9_asm="sparcv9cap.o sparccpuid.o:bn-sparcv9.o sparcv9-mont.o:des_enc-sparc.o fcrypt_b.o:aes_core.o aes_cbc.o aes-sparcv9.o:::sha1-sparcv9.o sha256-sparcv9.o sha512-sparcv9.o:::::::ghash-sparcv9.o::void";
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    17
 my $sparcv8_asm=":sparcv8.o:des_enc-sparc.o fcrypt_b.o:::::::::::::void";
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    18
 my $alpha_asm="alphacpuid.o:bn_asm.o alpha-mont.o:::::sha1-alpha.o:::::::ghash-alpha.o::void";
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    19
Index: crypto/sparccpuid.S
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    20
===================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    21
diff -ru openssl-1.0.1e/crypto/sparccpuid.S openssl-1.0.1e/crypto/sparccpuid.S
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    22
--- openssl-1.0.1e/crypto/sparccpuid.S 2011-05-24 17:02:24.000000000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    23
+++ openssl-1.0.1e/crypto/sparccpuid.S 2011-07-27 10:48:17.817470000 -0700
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    24
@@ -1,3 +1,7 @@
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    25
+#ifdef OPENSSL_FIPSCANISTER
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    26
+#include <openssl/fipssyms.h>
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    27
+#endif
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    28
+
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    29
 #if defined(__SUNPRO_C) && defined(__sparcv9)
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    30
 # define ABI64  /* They've said -xarch=v9 at command line */
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    31
 #elif defined(__GNUC__) && defined(__arch64__)
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
    32
@@ -241,7 +245,12 @@
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    33
 !	UltraSPARC IIe		7
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    34
 !	UltraSPARC III		7
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    35
 !	UltraSPARC T1		24
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    36
+!	SPARC T4		65(*)
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    37
 !
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    38
+! (*)	result has lesser to do with VIS instruction latencies, rdtick
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    39
+!	appears that slow, but it does the trick in sense that FP and
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    40
+!	VIS code paths are still slower than integer-only ones.
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    41
+!
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    42
 ! Numbers for T2 and SPARC64 V-VII are more than welcomed.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    43
 !
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    44
 ! It would be possible to detect specifically US-T1 by instrumenting
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
    45
@@ -250,6 +259,8 @@
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    46
 .global	_sparcv9_vis1_instrument
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    47
 .align	8
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    48
 _sparcv9_vis1_instrument:
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    49
+	.word	0x81b00d80	!fxor	%f0,%f0,%f0
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    50
+	.word	0x85b08d82	!fxor	%f2,%f2,%f2
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    51
 	.word	0x91410000	!rd	%tick,%o0
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    52
 	.word	0x81b00d80	!fxor	%f0,%f0,%f0
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    53
 	.word	0x85b08d82	!fxor	%f2,%f2,%f2
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
    54
@@ -286,6 +297,30 @@
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
    55
 .type	_sparcv9_vis1_instrument,#function
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
    56
 .size	_sparcv9_vis1_instrument,.-_sparcv9_vis1_instrument
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    57
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    58
+.global	_sparcv9_rdcfr
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    59
+.align	8
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    60
+_sparcv9_rdcfr:
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    61
+	retl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    62
+	.word	0x91468000	!rd	%asr26,%o0
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    63
+.type	_sparcv9_rdcfr,#function
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    64
+.size	_sparcv9_rdcfr,.-_sparcv9_rdcfr
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    65
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    66
+.global	_sparcv9_vis3_probe
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    67
+.align	8
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    68
+_sparcv9_vis3_probe:
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    69
+	retl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    70
+	.word	0x81b022a0	!xmulx	%g0,%g0,%g0
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    71
+.type	_sparcv9_vis3_probe,#function
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    72
+.size	_sparcv9_vis3_probe,.-_sparcv9_vis3_probe
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    73
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    74
+.global	_sparcv9_random
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    75
+.align	8
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    76
+_sparcv9_random:
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    77
+	retl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    78
+	.word	0x91b002a0	!random	%o0
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    79
+.type	_sparcv9_random,#function
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    80
+.size	_sparcv9_random,.-_sparcv9_vis3_probe
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    81
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    82
 .global	OPENSSL_cleanse
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    83
 .align	32
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
    84
 OPENSSL_cleanse:
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
    85
@@ -370,6 +405,102 @@
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    86
 .size	OPENSSL_cleanse,.-OPENSSL_cleanse
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    87
 
1401
367855861774 17191153 ld: warning: symbol '_init' not found but .init section exists on s12_26
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1382
diff changeset
    88
 #ifndef _BOOT
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    89
+.global	_sparcv9_vis1_instrument_bus
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    90
+.align	8
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    91
+_sparcv9_vis1_instrument_bus:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
    92
+    mov    %o1,%o3                    ! save cnt
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
    93
+    .word    0x99410000    !rd    %tick,%o4    ! tick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
    94
+    mov    %o4,%o5                    ! lasttick = tick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
    95
+    set    0,%g4                    ! diff
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
    96
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
    97
+    andn    %o0,63,%g1
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
    98
+    .word    0xc1985e00    !ldda    [%g1]0xf0,%f0    ! block load
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
    99
+    .word    0x8143e040    !membar    #Sync
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   100
+    .word    0xc1b85c00    !stda    %f0,[%g1]0xe0    ! block store and commit
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   101
+    .word    0x8143e040    !membar    #Sync
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   102
+    ld    [%o0],%o4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   103
+    add    %o4,%g4,%g4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   104
+    .word    0xc9e2100c    !cas    [%o0],%o4,%g4
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   105
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   106
+.Loop:    .word    0x99410000    !rd    %tick,%o4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   107
+    sub    %o4,%o5,%g4                ! diff=tick-lasttick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   108
+    mov    %o4,%o5                    ! lasttick=tick
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   109
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   110
+    andn    %o0,63,%g1
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   111
+    .word    0xc1985e00    !ldda    [%g1]0xf0,%f0    ! block load
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   112
+    .word    0x8143e040    !membar    #Sync
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   113
+    .word    0xc1b85c00    !stda    %f0,[%g1]0xe0    ! block store and commit
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   114
+    .word    0x8143e040    !membar    #Sync
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   115
+    ld    [%o0],%o4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   116
+    add    %o4,%g4,%g4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   117
+    .word    0xc9e2100c    !cas    [%o0],%o4,%g4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   118
+    subcc    %o1,1,%o1                ! --$cnt
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   119
+    bnz    .Loop
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   120
+    add    %o0,4,%o0                ! ++$out
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   121
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   122
+    retl
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   123
+    mov    %o3,%o0
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   124
+.type    _sparcv9_vis1_instrument_bus,#function
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   125
+.size    _sparcv9_vis1_instrument_bus,.-_sparcv9_vis1_instrument_bus
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   126
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   127
+.global    _sparcv9_vis1_instrument_bus2
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   128
+.align    8
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   129
+_sparcv9_vis1_instrument_bus2:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   130
+    mov    %o1,%o3                    ! save cnt
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   131
+    sll    %o1,2,%o1                ! cnt*=4
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   132
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   133
+    .word    0x99410000    !rd    %tick,%o4    ! tick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   134
+    mov    %o4,%o5                    ! lasttick = tick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   135
+    set    0,%g4                    ! diff
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   136
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   137
+    andn    %o0,63,%g1
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   138
+    .word    0xc1985e00    !ldda    [%g1]0xf0,%f0    ! block load
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   139
+    .word    0x8143e040    !membar    #Sync
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   140
+    .word    0xc1b85c00    !stda    %f0,[%g1]0xe0    ! block store and commit
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   141
+    .word    0x8143e040    !membar    #Sync
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   142
+    ld    [%o0],%o4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   143
+    add    %o4,%g4,%g4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   144
+    .word    0xc9e2100c    !cas    [%o0],%o4,%g4
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   145
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   146
+    .word    0x99410000    !rd    %tick,%o4    ! tick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   147
+    sub    %o4,%o5,%g4                ! diff=tick-lasttick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   148
+    mov    %o4,%o5                    ! lasttick=tick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   149
+    mov    %g4,%g5                    ! lastdiff=diff
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   150
+.Loop2:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   151
+    andn    %o0,63,%g1
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   152
+    .word    0xc1985e00    !ldda    [%g1]0xf0,%f0    ! block load
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   153
+    .word    0x8143e040    !membar    #Sync
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   154
+    .word    0xc1b85c00    !stda    %f0,[%g1]0xe0    ! block store and commit
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   155
+    .word    0x8143e040    !membar    #Sync
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   156
+    ld    [%o0],%o4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   157
+    add    %o4,%g4,%g4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   158
+    .word    0xc9e2100c    !cas    [%o0],%o4,%g4
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   159
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   160
+    subcc    %o2,1,%o2                ! --max
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   161
+    bz    .Ldone2
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   162
+    nop
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   163
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   164
+    .word    0x99410000    !rd    %tick,%o4    ! tick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   165
+    sub    %o4,%o5,%g4                ! diff=tick-lasttick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   166
+    mov    %o4,%o5                    ! lasttick=tick
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   167
+    cmp    %g4,%g5
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   168
+    mov    %g4,%g5                    ! lastdiff=diff
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   169
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   170
+    .word    0x83408000    !rd    %ccr,%g1
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   171
+    and    %g1,4,%g1                ! isolate zero flag
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   172
+    xor    %g1,4,%g1                ! flip zero flag
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   173
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   174
+    subcc    %o1,%g1,%o1                ! conditional --$cnt
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   175
+    bnz    .Loop2
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   176
+    add    %o0,%g1,%o0                ! conditional ++$out
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   177
+
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   178
+.Ldone2:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   179
+    srl    %o1,2,%o1
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   180
+    retl
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   181
+    sub    %o3,%o1,%o0
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   182
+.type    _sparcv9_vis1_instrument_bus2,#function
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   183
+.size    _sparcv9_vis1_instrument_bus2,.-_sparcv9_vis1_instrument_bus2
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   184
+
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   185
 .section	".init",#alloc,#execinstr
1752
84e093c079e2 PSARC/2014/077 OpenSSL Thread and Fork Safety
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1641
diff changeset
   186
 	call	solaris_locking_setup
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   187
 	nop
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   188
Index: crypto/sparcv9cap.c
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   189
===================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   190
diff -ru openssl-1.0.1e/crypto/sparcv9cap.c openssl-1.0.1e/crypto/sparcv9cap.c
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   191
--- openssl-1.0.1e/crypto/sparcv9cap.c 2011-05-24 17:02:24.000000000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   192
+++ openssl-1.0.1e/crypto/sparcv9cap.c 2011-07-27 10:48:17.817470000 -0700
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   193
@@ -3,36 +3,59 @@
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   194
 #include <string.h>
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   195
 #include <setjmp.h>
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   196
 #include <sys/time.h>
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   197
+#include <unistd.h>
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   198
 #include <openssl/bn.h>
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   199
 #include <sys/auxv.h>
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   200
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   201
-#define SPARCV9_TICK_PRIVILEGED (1<<0)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   202
-#define SPARCV9_PREFER_FPU      (1<<1)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   203
-#define SPARCV9_VIS1            (1<<2)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   204
-#define SPARCV9_VIS2            (1<<3) /* reserved */
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   205
-#define SPARCV9_FMADD           (1<<4) /* reserved for SPARC64 V */
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   206
-#define SPARCV9_BLK             (1<<5)
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   207
+#include "sparc_arch.h"
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   208
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   209
+#if defined(__GNUC__) && defined(__linux)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   210
+__attribute__((visibility("hidden")))
1294
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   211
+#endif
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   212
 #ifndef        _BOOT
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   213
-static int OPENSSL_sparcv9cap_P = SPARCV9_TICK_PRIVILEGED;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   214
+unsigned int OPENSSL_sparcv9cap_P[2] = {SPARCV9_TICK_PRIVILEGED, 0};
1294
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   215
 #else
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   216
-static int OPENSSL_sparcv9cap_P = SPARCV9_VIS1;
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   217
+unsigned int OPENSSL_sparcv9cap_P[2] = {SPARCV9_VIS1, 0};
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   218
 #endif
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   219
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   220
 int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   221
                 const BN_ULONG *np, const BN_ULONG *n0, int num)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   222
 {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   223
+    int bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   224
+                         const BN_ULONG *np,const BN_ULONG *n0, int num);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   225
     int bn_mul_mont_fpu(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   226
                         const BN_ULONG *np, const BN_ULONG *n0, int num);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   227
     int bn_mul_mont_int(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   228
                         const BN_ULONG *np, const BN_ULONG *n0, int num);
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   229
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   230
-    if (num >= 8 && !(num & 1) &&
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   231
-        (OPENSSL_sparcv9cap_P & (SPARCV9_PREFER_FPU | SPARCV9_VIS1)) ==
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   232
-        (SPARCV9_PREFER_FPU | SPARCV9_VIS1))
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   233
-        return bn_mul_mont_fpu(rp, ap, bp, np, n0, num);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   234
-    else
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   235
-        return bn_mul_mont_int(rp, ap, bp, np, n0, num);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   236
+    if (!(num&1) && num>=6) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   237
+        if ((num&15)==0 && num<=64 &&
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   238
+            (OPENSSL_sparcv9cap_P[1]&(CFR_MONTMUL|CFR_MONTSQR))== 
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   239
+                             (CFR_MONTMUL|CFR_MONTSQR))
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   240
+            {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   241
+            typedef int (*bn_mul_mont_f)(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np,const BN_ULONG *n0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   242
+            int bn_mul_mont_t4_8(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np,const BN_ULONG *n0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   243
+            int bn_mul_mont_t4_16(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np,const BN_ULONG *n0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   244
+            int bn_mul_mont_t4_24(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np,const BN_ULONG *n0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   245
+            int bn_mul_mont_t4_32(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, const BN_ULONG *np,const BN_ULONG *n0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   246
+            static const bn_mul_mont_f funcs[4] = {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   247
+                bn_mul_mont_t4_8,    bn_mul_mont_t4_16,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   248
+                bn_mul_mont_t4_24,    bn_mul_mont_t4_32 };
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   249
+            bn_mul_mont_f worker = funcs[num/16-1];
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   250
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   251
+            if ((*worker)(rp,ap,bp,np,n0)) return 1;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   252
+            /* retry once and fall back */
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   253
+            if ((*worker)(rp,ap,bp,np,n0)) return 1;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   254
+            return bn_mul_mont_vis3(rp,ap,bp,np,n0,num);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   255
+            }
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   256
+        if ((OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS3))
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   257
+            return bn_mul_mont_vis3(rp,ap,bp,np,n0,num);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   258
+        else if (num>=8 &&
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   259
+            (OPENSSL_sparcv9cap_P[0]&(SPARCV9_PREFER_FPU|SPARCV9_VIS1)) ==
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   260
+            (SPARCV9_PREFER_FPU|SPARCV9_VIS1))
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   261
+            return bn_mul_mont_fpu(rp,ap,bp,np,n0,num);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   262
+        }
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   263
+    return bn_mul_mont_int(rp,ap,bp,np,n0,num);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   264
 }
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   265
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   266
 unsigned long _sparcv9_rdtick(void);
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   267
@@ -37,11 +60,16 @@
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   268
 
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   269
 unsigned long _sparcv9_rdtick(void);
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   270
 unsigned long _sparcv9_vis1_instrument(void);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   271
+unsigned long _sparcv9_rdcfr(void);
1401
367855861774 17191153 ld: warning: symbol '_init' not found but .init section exists on s12_26
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1382
diff changeset
   272
+#ifndef _BOOT
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   273
+size_t _sparcv9_vis1_instrument_bus(unsigned int *,size_t);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   274
+size_t _sparcv9_vis1_instrument_bus2(unsigned int *,size_t,size_t);
1401
367855861774 17191153 ld: warning: symbol '_init' not found but .init section exists on s12_26
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1382
diff changeset
   275
+#endif
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   276
 
1294
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   277
 #ifndef _BOOT
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   278
 unsigned long OPENSSL_rdtsc(void)
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   279
 {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   280
-    if (OPENSSL_sparcv9cap_P & SPARCV9_TICK_PRIVILEGED)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   281
+    if (OPENSSL_sparcv9cap_P[0] & SPARCV9_TICK_PRIVILEGED)
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   282
 #if defined(__sun) && defined(__SVR4)
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   283
         return gethrtime();
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   284
 #else
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   285
@@ -50,6 +80,24 @@
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   286
     else
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   287
         return _sparcv9_rdtick();
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   288
 }
1401
367855861774 17191153 ld: warning: symbol '_init' not found but .init section exists on s12_26
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1382
diff changeset
   289
+
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   290
+size_t OPENSSL_instrument_bus(unsigned int *out,size_t cnt)
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   291
+{
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   292
+    if ((OPENSSL_sparcv9cap_P[0]&(SPARCV9_TICK_PRIVILEGED|SPARCV9_BLK)) ==
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   293
+            SPARCV9_BLK)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   294
+        return _sparcv9_vis1_instrument_bus(out,cnt);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   295
+    else
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   296
+        return 0;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   297
+}
1294
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   298
+
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   299
+size_t OPENSSL_instrument_bus2(unsigned int *out,size_t cnt,size_t max)
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   300
+{
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   301
+    if ((OPENSSL_sparcv9cap_P[0]&(SPARCV9_TICK_PRIVILEGED|SPARCV9_BLK)) ==
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   302
+            SPARCV9_BLK)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   303
+        return _sparcv9_vis1_instrument_bus2(out,cnt,max);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   304
+    else
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   305
+        return 0;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   306
+}
1401
367855861774 17191153 ld: warning: symbol '_init' not found but .init section exists on s12_26
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1382
diff changeset
   307
 #endif
367855861774 17191153 ld: warning: symbol '_init' not found but .init section exists on s12_26
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1382
diff changeset
   308
1294
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   309
 #if defined(_BOOT)
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   310
@@ -59,7 +107,7 @@
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   311
  */
1294
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   312
 void OPENSSL_cpuid_setup(void)
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   313
        {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   314
-       OPENSSL_sparcv9cap_P = SPARCV9_VIS1;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   315
+       OPENSSL_sparcv9cap_P[0] = SPARCV9_VIS1;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   316
        }
1294
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   317
 
c7701e5ea3fc 16700305 wanboot MMU Miss trap only in secure standalone phase build 17+
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1267
diff changeset
   318
 #elif 0 && defined(__sun) && defined(__SVR4)
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   319
@@ -88,11 +136,11 @@
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   320
     if (!strcmp(name, "SUNW,UltraSPARC") ||
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   321
         /* covers II,III,IV */
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   322
         !strncmp(name, "SUNW,UltraSPARC-I", 17)) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   323
-        OPENSSL_sparcv9cap_P |= SPARCV9_PREFER_FPU | SPARCV9_VIS1;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   324
+        OPENSSL_sparcv9cap_P[0] |= SPARCV9_PREFER_FPU | SPARCV9_VIS1;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   325
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   326
         /* %tick is privileged only on UltraSPARC-I/II, but not IIe */
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   327
         if (name[14] != '\0' && name[17] != '\0' && name[18] != '\0')
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   328
-            OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   329
+            OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   330
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   331
         return DI_WALK_TERMINATE;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   332
     }
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   333
@@ -98,7 +146,7 @@
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   334
     }
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   335
     /* This is expected to catch remaining UltraSPARCs, such as T1 */
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   336
     else if (!strncmp(name, "SUNW,UltraSPARC", 15)) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   337
-        OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   338
+        OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   339
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   340
         return DI_WALK_TERMINATE;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   341
     }
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   342
@@ -117,7 +165,7 @@
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   343
     trigger = 1;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   344
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   345
     if ((e = getenv("OPENSSL_sparcv9cap"))) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   346
-        OPENSSL_sparcv9cap_P = strtoul(e, NULL, 0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   347
+        OPENSSL_sparcv9cap_P[0] = strtoul(e, NULL, 0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   348
         return;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   349
     }
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   350
 
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   351
@@ -124,15 +172,15 @@
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   352
     if (sysinfo(SI_MACHINE, si, sizeof(si)) > 0) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   353
         if (strcmp(si, "sun4v"))
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   354
             /* FPU is preferred for all CPUs, but US-T1/2 */
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   355
-            OPENSSL_sparcv9cap_P |= SPARCV9_PREFER_FPU;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   356
+            OPENSSL_sparcv9cap_P[0] |= SPARCV9_PREFER_FPU;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   357
     }
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   358
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   359
     if (sysinfo(SI_ISALIST, si, sizeof(si)) > 0) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   360
         if (strstr(si, "+vis"))
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   361
-            OPENSSL_sparcv9cap_P |= SPARCV9_VIS1;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   362
+            OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS1 | SPARCV9_BLK;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   363
         if (strstr(si, "+vis2")) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   364
-            OPENSSL_sparcv9cap_P |= SPARCV9_VIS2;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   365
-            OPENSSL_sparcv9cap_P &= ~SPARCV9_TICK_PRIVILEGED;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   366
+            OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   367
+            OPENSSL_sparcv9cap_P[0] &= ~SPARCV9_TICK_PRIVILEGED;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   368
             return;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   369
         }
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   370
     }
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   371
@@ -195,7 +241,9 @@
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   372
     trigger = 1;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   373
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   374
     if ((e = getenv("OPENSSL_sparcv9cap"))) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   375
-        OPENSSL_sparcv9cap_P = strtoul(e, NULL, 0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   376
+        OPENSSL_sparcv9cap_P[0] = strtoul(e, NULL, 0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   377
+        if ((e = strchr(e, ':')))
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   378
+            OPENSSL_sparcv9cap_P[1] = strtoul(e + 1, NULL, 0);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   379
         return;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   380
     }
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   381
 
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   382
@@ -202,21 +250,48 @@
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   383
     (void) getisax(&ui, 1);
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   384
 
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   385
     /* Initial value, fits UltraSPARC-I&II... */
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   386
-    OPENSSL_sparcv9cap_P = SPARCV9_BLK;
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   387
+    OPENSSL_sparcv9cap_P[0] = SPARCV9_BLK;
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   388
 
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   389
     if (ui & AV_SPARC_VIS) {
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   390
-        /* detect UltraSPARC-Tx, see sparccpuid.S for details... */
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   391
+        /* detect UltraSPARC-Tx, see sparccpud.S for details... */
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   392
         if (_sparcv9_vis1_instrument() < 7)
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   393
-            OPENSSL_sparcv9cap_P |= SPARCV9_TICK_PRIVILEGED;
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   394
+            OPENSSL_sparcv9cap_P[0] |= SPARCV9_TICK_PRIVILEGED;
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   395
         if (_sparcv9_vis1_instrument() < 12) {
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   396
-            OPENSSL_sparcv9cap_P |= SPARCV9_VIS1|SPARCV9_PREFER_FPU;
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   397
+            OPENSSL_sparcv9cap_P[0] |= (SPARCV9_VIS1 | SPARCV9_PREFER_FPU);
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   398
             if (ui & AV_SPARC_VIS2)
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   399
-                OPENSSL_sparcv9cap_P |= SPARCV9_VIS2;
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   400
-        }
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   401
+                OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS2;
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   402
+         }
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   403
     }
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   404
 
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   405
     if (ui & AV_SPARC_FMAF)
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   406
-        OPENSSL_sparcv9cap_P |= SPARCV9_FMADD;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   407
+        OPENSSL_sparcv9cap_P[0] |= SPARCV9_FMADD;
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   408
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   409
+    /*
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   410
+     * VIS3 flag is tested independently from VIS1, unlike VIS2 that is,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   411
+     * because VIS3 defines even integer instructions.
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   412
+     */
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   413
+    if (ui & AV_SPARC_VIS3)
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   414
+            OPENSSL_sparcv9cap_P[0] |= SPARCV9_VIS3;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   415
+
4370
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   416
+#define AV_T4_MECHS     (AV_SPARC_AES | AV_SPARC_DES | AV_SPARC_KASUMI | \
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   417
+                         AV_SPARC_CAMELLIA | AV_SPARC_MD5 | AV_SPARC_SHA1 | \
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   418
+                         AV_SPARC_SHA256 | AV_SPARC_SHA512 | AV_SPARC_MPMUL | \
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   419
+                         AV_SPARC_CRC32C)
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   420
+
7043c27399f1 19375978 Common code between openssl-1.0.1 and openssl-1.0.1-fips-140 should be shared
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 4002
diff changeset
   421
+    if ((OPENSSL_sparcv9cap_P[0]&SPARCV9_VIS3) && (ui & AV_T4_MECHS))
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   422
+        OPENSSL_sparcv9cap_P[1] = (unsigned int)_sparcv9_rdcfr();
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   423
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   424
+    if (sizeof(size_t) == 8)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   425
+        OPENSSL_sparcv9cap_P[0] |= SPARCV9_64BIT_STACK;
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   426
+#ifdef __linux
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   427
+    else
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   428
+        {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   429
+        int ret = syscall(340);
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   430
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   431
+        if (ret >= 0 && ret & 1)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   432
+            OPENSSL_sparcv9cap_P[0] |= SPARCV9_64BIT_STACK;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   433
+        }
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   434
+#endif
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   435
 }
1382
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   436
 
3515c1afdfc8 PSARC 2013/034 OpenSSL 1.0.1
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1373
diff changeset
   437
 #endif
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   438
Index: crypto/md5/Makefile
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   439
===================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   440
diff -ru openssl-1.0.1e/crypto/md5/Makefile openssl-1.0.1e/crypto/md5/Makefile
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   441
--- openssl-1.0.1e/crypto/md5/Makefile	2011-05-24 17:02:24.000000000 -0700
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   442
+++ openssl-1.0.1e/crypto/md5/Makefile	2011-07-27 10:48:17.817470000 -0700
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   443
@@ -52,6 +52,9 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   444
 	$(CC) $(CFLAGS) -E asm/md5-ia64.S | \
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   445
 	$(PERL) -ne 's/;\s+/;\n/g; print;' > [email protected]
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   446
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   447
+md5-sparcv9.S:	asm/md5-sparcv9.pl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   448
+	$(PERL) asm/md5-sparcv9.pl [email protected] $(CFLAGS)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   449
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   450
 files:
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   451
 	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   452
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   453
Index: crypto/md5/md5_locl.h
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   454
===================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   455
diff -ru openssl-1.0.1e/crypto/md5/md5_locl.h openssl-1.0.1e/crypto/md5/md5_locl.h
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   456
--- openssl-1.0.1e/crypto/md5/md5_locl.h    2011-05-24 17:02:24.000000000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   457
+++ openssl-1.0.1e/crypto/md5/md5_locl.h    2011-07-27 10:48:17.817470000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   458
@@ -71,6 +71,8 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   459
 #  define md5_block_data_order md5_block_asm_data_order
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   460
 # elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   461
 #  define md5_block_data_order md5_block_asm_data_order
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   462
+# elif defined(__sparc) || defined(__sparc__)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   463
+#  define md5_block_data_order md5_block_asm_data_order
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   464
 # endif
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   465
 #endif
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   466
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   467
Index: crypto/sha/Makefile
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   468
===================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   469
diff -ru openssl-1.0.1e/crypto/sha/Makefile openssl-1.0.1e/crypto/sha/Makefile
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   470
--- openssl-1.0.1e/crypto/sha/Makefile    2011-05-24 17:02:24.000000000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   471
+++ openssl-1.0.1e/crypto/sha/Makefile    2011-07-27 10:48:17.817470000 -0700
1641
2fc479afcf70 18024740 problem in UTILITY/OPENSSL
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1401
diff changeset
   472
@@ -68,9 +68,9 @@
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   473
 sha1-x86_64.s:	asm/sha1-x86_64.pl;	$(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > [email protected]
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   474
 sha256-x86_64.s:asm/sha512-x86_64.pl;	$(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) [email protected]
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   475
 sha512-x86_64.s:asm/sha512-x86_64.pl;	$(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) [email protected]
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   476
-sha1-sparcv9.s:	asm/sha1-sparcv9.pl;	$(PERL) asm/sha1-sparcv9.pl [email protected] $(CFLAGS)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   477
-sha256-sparcv9.s:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl [email protected] $(CFLAGS)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   478
-sha512-sparcv9.s:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl [email protected] $(CFLAGS)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   479
+sha1-sparcv9.S:	asm/sha1-sparcv9.pl;	$(PERL) asm/sha1-sparcv9.pl [email protected] $(CFLAGS)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   480
+sha256-sparcv9.S:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl [email protected] $(CFLAGS)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   481
+sha512-sparcv9.S:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl [email protected] $(CFLAGS)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   482
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   483
 sha1-ppc.s:	asm/sha1-ppc.pl;	$(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) [email protected]
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   484
 sha256-ppc.s:	asm/sha512-ppc.pl;	$(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) [email protected]
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   485
Index: crypto/sha/asm/sha1-sparcv9.pl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   486
===================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   487
diff -ru openssl-1.0.1e/crypto/sha/asm/sha1-sparcv9.pl openssl-1.0.1e/crypto/sha/asm/sha1-sparcv9.pl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   488
--- openssl-1.0.1e/crypto/sha/asm/sha1-sparcv9.pl 2011-05-24 17:02:24.000000000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   489
+++ openssl-1.0.1e/crypto/sha/asm/sha1-sparcv9.pl 2011-07-27 10:48:17.817470000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   490
@@ -5,6 +5,8 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   491
 # project. The module is, however, dual licensed under OpenSSL and
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   492
 # CRYPTOGAMS licenses depending on where you obtain it. For further
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   493
 # details see http://www.openssl.org/~appro/cryptogams/.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   494
+#
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   495
+# Hardware SPARC T4 support by David S. Miller <[email protected]>.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   496
 # ====================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   497
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   498
 # Performance improvement is not really impressive on pre-T1 CPU: +8%
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   499
@@ -18,6 +20,11 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   500
 # ensure scalability on UltraSPARC T1, or rather to avoid decay when
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   501
 # amount of active threads exceeds the number of physical cores.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   502
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   503
+# SPARC T4 SHA1 hardware achieves 3.72 cycles per byte, which is 3.1x
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   504
+# faster than software. Multi-process benchmark saturates at 11x
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   505
+# single-process result on 8-core processor, or ~9GBps per 2.85GHz
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   506
+# socket.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   507
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   508
 $bits=32;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   509
 for (@ARGV)	{ $bits=64 if (/\-m64/ || /\-xarch\=v9/); }
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   510
 if ($bits==64)	{ $bias=2047; $frame=192; }
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   511
@@ -183,11 +190,93 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   512
 .register	%g3,#scratch
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   513
 ___
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   514
 $code.=<<___;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   515
+#include "sparc_arch.h"
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   516
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   517
 .section	".text",#alloc,#execinstr
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   518
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   519
+#ifdef __PIC__
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   520
+SPARC_PIC_THUNK(%g1)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   521
+#endif
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   522
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   523
 .align	32
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   524
 .globl	sha1_block_data_order
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   525
 sha1_block_data_order:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   526
+    SPARC_LOAD_ADDRESS_LEAF(OPENSSL_sparcv9cap_P,%g1,%g5)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   527
+    ld    [%g1+4],%g1        ! OPENSSL_sparcv9cap_P[1]
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   528
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   529
+    andcc    %g1, CFR_SHA1, %g0
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   530
+    be    .Lsoftware
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   531
+    nop
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   532
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   533
+    ld    [%o0 + 0x00], %f0    ! load context
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   534
+    ld    [%o0 + 0x04], %f1
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   535
+    ld    [%o0 + 0x08], %f2
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   536
+    andcc    %o1, 0x7, %g0
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   537
+    ld    [%o0 + 0x0c], %f3
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   538
+    bne,pn    %icc, .Lhwunaligned
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   539
+     ld    [%o0 + 0x10], %f4
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   540
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   541
+.Lhw_loop:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   542
+    ldd    [%o1 + 0x00], %f8
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   543
+    ldd    [%o1 + 0x08], %f10
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   544
+    ldd    [%o1 + 0x10], %f12
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   545
+    ldd    [%o1 + 0x18], %f14
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   546
+    ldd    [%o1 + 0x20], %f16
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   547
+    ldd    [%o1 + 0x28], %f18
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   548
+    ldd    [%o1 + 0x30], %f20
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   549
+    subcc    %o2, 1, %o2        ! done yet? 
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   550
+    ldd    [%o1 + 0x38], %f22
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   551
+    add    %o1, 0x40, %o1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   552
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   553
+    .word    0x81b02820        ! SHA1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   554
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   555
+    bne,pt    `$bits==64?"%xcc":"%icc"`, .Lhw_loop
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   556
+    nop
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   557
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   558
+.Lhwfinish:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   559
+    st    %f0, [%o0 + 0x00]    ! store context
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   560
+    st    %f1, [%o0 + 0x04]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   561
+    st    %f2, [%o0 + 0x08]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   562
+    st    %f3, [%o0 + 0x0c]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   563
+    retl
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   564
+    st    %f4, [%o0 + 0x10]
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   565
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   566
+.align    8
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   567
+.Lhwunaligned:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   568
+    alignaddr %o1, %g0, %o1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   569
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   570
+    ldd    [%o1 + 0x00], %f10
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   571
+.Lhwunaligned_loop:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   572
+    ldd    [%o1 + 0x08], %f12
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   573
+    ldd    [%o1 + 0x10], %f14
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   574
+    ldd    [%o1 + 0x18], %f16
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   575
+    ldd    [%o1 + 0x20], %f18
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   576
+    ldd    [%o1 + 0x28], %f20
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   577
+    ldd    [%o1 + 0x30], %f22
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   578
+    ldd    [%o1 + 0x38], %f24
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   579
+    subcc    %o2, 1, %o2        ! done yet?
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   580
+    ldd    [%o1 + 0x40], %f26
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   581
+    add    %o1, 0x40, %o1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   582
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   583
+    faligndata %f10, %f12, %f8
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   584
+    faligndata %f12, %f14, %f10
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   585
+    faligndata %f14, %f16, %f12
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   586
+    faligndata %f16, %f18, %f14
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   587
+    faligndata %f18, %f20, %f16
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   588
+    faligndata %f20, %f22, %f18
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   589
+    faligndata %f22, %f24, %f20
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   590
+    faligndata %f24, %f26, %f22
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   591
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   592
+    .word    0x81b02820        ! SHA1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   593
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   594
+    bne,pt    `$bits==64?"%xcc":"%icc"`, .Lhwunaligned_loop
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   595
+    for    %f26, %f26, %f10    ! %f10=%f26
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   596
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   597
+    ba    .Lhwfinish
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   598
+    nop
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   599
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   600
+.align    16
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   601
+.Lsoftware:
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   602
 	save	%sp,-$frame,%sp
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   603
 	sllx	$len,6,$len
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   604
 	add	$inp,$len,$len
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   605
@@ -279,6 +368,62 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   606
 .align	4
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   607
 ___
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   608
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   609
-$code =~ s/\`([^\`]*)\`/eval $1/gem;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   610
-print $code;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   611
+# Purpose of these subroutines is to explicitly encode VIS instructions,
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   612
+# so that one can compile the module without having to specify VIS
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   613
+# extentions on compiler command line, e.g. -xarch=v9 vs. -xarch=v9a.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   614
+# Idea is to reserve for option to produce "universal" binary and let
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   615
+# programmer detect if current CPU is VIS capable at run-time.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   616
+sub unvis {
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   617
+my ($mnemonic,$rs1,$rs2,$rd)[email protected]_;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   618
+my $ref,$opf;
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   619
+my %visopf = (    "faligndata"    => 0x048,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   620
+        "for"        => 0x07c    );
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   621
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   622
+    $ref = "$mnemonic\t$rs1,$rs2,$rd";
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   623
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   624
+    if ($opf=$visopf{$mnemonic}) {
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   625
+    foreach ($rs1,$rs2,$rd) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   626
+        return $ref if (!/%f([0-9]{1,2})/);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   627
+        $_=$1;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   628
+        if ($1>=32) {
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   629
+        return $ref if ($1&1);
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   630
+        # re-encode for upper double register addressing
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   631
+        $_=($1|$1>>5)&31;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   632
+        }
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   633
+    }
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   634
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   635
+    return    sprintf ".word\t0x%08x !%s",
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   636
+            0x81b00000|$rd<<25|$rs1<<14|$opf<<5|$rs2,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   637
+            $ref;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   638
+    } else {
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   639
+    return $ref;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   640
+    }
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   641
+}
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   642
+sub unalignaddr {
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   643
+my ($mnemonic,$rs1,$rs2,$rd)[email protected]_;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   644
+my %bias = ( "g" => 0, "o" => 8, "l" => 16, "i" => 24 );
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   645
+my $ref="$mnemonic\t$rs1,$rs2,$rd";
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   646
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   647
+    foreach ($rs1,$rs2,$rd) {
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   648
+    if (/%([goli])([0-7])/)    { $_=$bias{$1}+$2; }
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   649
+    else            { return $ref; }
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   650
+    }
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   651
+    return  sprintf ".word\t0x%08x !%s",
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   652
+            0x81b00300|$rd<<25|$rs1<<14|$rs2,
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   653
+            $ref;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   654
+}
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   655
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   656
+foreach (split("\n",$code)) {
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   657
+    s/\`([^\`]*)\`/eval $1/ge;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   658
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   659
+    s/\b(f[^\s]*)\s+(%f[0-9]{1,2}),\s*(%f[0-9]{1,2}),\s*(%f[0-9]{1,2})/
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   660
+        &unvis($1,$2,$3,$4)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   661
+     /ge;
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   662
+    s/\b(alignaddr)\s+(%[goli][0-7]),\s*(%[goli][0-7]),\s*(%[goli][0-7])/
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   663
+        &unalignaddr($1,$2,$3,$4)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   664
+     /ge;
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   665
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   666
+    print $_,"\n";
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   667
+}
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   668
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   669
 close STDOUT;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   670
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   671
Index: crypto/sha/asm/sha512-sparcv9.pl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   672
===================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   673
diff -ru openssl-1.0.1e/crypto/sha/asm/sha512-sparcv9.pl openssl-1.0.1e/crypto/sha/asm/sha512-sparcv9.pl
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   674
--- openssl-1.0.1e/crypto/sha/asm/sha512-sparcv9.pl 2011-05-24 17:02:24.000000000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   675
+++ openssl-1.0.1e/crypto/sha/asm/sha512-sparcv9.pl 2011-07-27 10:48:17.817470000 -0700
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   676
@@ -5,6 +5,8 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   677
 # project. The module is, however, dual licensed under OpenSSL and
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   678
 # CRYPTOGAMS licenses depending on where you obtain it. For further
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   679
 # details see http://www.openssl.org/~appro/cryptogams/.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   680
+#
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   681
+# Hardware SPARC T4 support by David S. Miller <[email protected]>.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   682
 # ====================================================================
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   683
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   684
 # SHA256 performance improvement over compiler generated code varies
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   685
@@ -41,6 +43,12 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   686
 #	loads are always slower than one 64-bit load. Once again this
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   687
 #	is unlike pre-T1 UltraSPARC, where, if scheduled appropriately,
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   688
 #	2x32-bit loads can be as fast as 1x64-bit ones.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   689
+#
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   690
+# SPARC T4 SHA256/512 hardware achieves 3.17/2.01 cycles per byte,
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   691
+# which is 9.3x/11.1x faster than software. Multi-process benchmark
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   692
+# saturates at 11.5x single-process result on 8-core processor, or
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   693
+# ~11/16GBps per 2.85GHz socket.
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   694
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   695
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   696
 $bits=32;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   697
 for (@ARGV)	{ $bits=64 if (/\-m64/ || /\-xarch\=v9/); }
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   698
@@ -386,6 +394,8 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   699
 .register	%g3,#scratch
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   700
 ___
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   701
 $code.=<<___;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   702
+#include "sparc_arch.h"
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   703
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   704
 .section	".text",#alloc,#execinstr
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   705
 
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   706
 .align	64
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   707
@@ -457,8 +467,196 @@
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   708
 }
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   709
 $code.=<<___;
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   710
 .size	K${label},.-K${label}
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   711
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   712
+#ifdef __PIC__
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   713
+SPARC_PIC_THUNK(%g1)
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   714
+#endif
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   715
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   716
 .globl	sha${label}_block_data_order
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   717
+.align	32
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   718
 sha${label}_block_data_order:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   719
+    SPARC_LOAD_ADDRESS_LEAF(OPENSSL_sparcv9cap_P,%g1,%g5)
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   720
+    ld    [%g1+4],%g1        ! OPENSSL_sparcv9cap_P[1]
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   721
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   722
+    andcc    %g1, CFR_SHA${label}, %g0
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   723
+    be    .Lsoftware
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   724
+    nop
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   725
+___
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   726
+$code.=<<___ if ($SZ==8);         # SHA512
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   727
+    ldd    [%o0 + 0x00], %f0    ! load context
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   728
+    ldd    [%o0 + 0x08], %f2
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   729
+    ldd    [%o0 + 0x10], %f4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   730
+    ldd    [%o0 + 0x18], %f6
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   731
+    ldd    [%o0 + 0x20], %f8
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   732
+    ldd    [%o0 + 0x28], %f10
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   733
+    andcc    %o1, 0x7, %g0
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   734
+    ldd    [%o0 + 0x30], %f12
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   735
+    bne,pn    %icc, .Lhwunaligned
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   736
+     ldd    [%o0 + 0x38], %f14
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   737
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   738
+.Lhwaligned_loop:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   739
+    ldd    [%o1 + 0x00], %f16
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   740
+    ldd    [%o1 + 0x08], %f18
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   741
+    ldd    [%o1 + 0x10], %f20
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   742
+    ldd    [%o1 + 0x18], %f22
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   743
+    ldd    [%o1 + 0x20], %f24
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   744
+    ldd    [%o1 + 0x28], %f26
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   745
+    ldd    [%o1 + 0x30], %f28
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   746
+    ldd    [%o1 + 0x38], %f30
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   747
+    ldd    [%o1 + 0x40], %f32
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   748
+    ldd    [%o1 + 0x48], %f34
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   749
+    ldd    [%o1 + 0x50], %f36
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   750
+    ldd    [%o1 + 0x58], %f38
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   751
+    ldd    [%o1 + 0x60], %f40
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   752
+    ldd    [%o1 + 0x68], %f42
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   753
+    ldd    [%o1 + 0x70], %f44
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   754
+    subcc    %o2, 1, %o2        ! done yet?
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   755
+    ldd    [%o1 + 0x78], %f46
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   756
+    add    %o1, 0x80, %o1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   757
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   758
+    .word    0x81b02860        ! SHA512
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   759
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   760
+    bne,pt    `$bits==64?"%xcc":"%icc"`, .Lhwaligned_loop
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   761
+    nop
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   762
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   763
+.Lhwfinish:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   764
+    std    %f0, [%o0 + 0x00]    ! store context
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   765
+    std    %f2, [%o0 + 0x08]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   766
+    std    %f4, [%o0 + 0x10]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   767
+    std    %f6, [%o0 + 0x18]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   768
+    std    %f8, [%o0 + 0x20]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   769
+    std    %f10, [%o0 + 0x28]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   770
+    std    %f12, [%o0 + 0x30]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   771
+    retl
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   772
+     std    %f14, [%o0 + 0x38]
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   773
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   774
+.align    16
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   775
+.Lhwunaligned:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   776
+    alignaddr %o1, %g0, %o1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   777
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   778
+    ldd    [%o1 + 0x00], %f18
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   779
+.Lhwunaligned_loop:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   780
+    ldd    [%o1 + 0x08], %f20
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   781
+    ldd    [%o1 + 0x10], %f22
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   782
+    ldd    [%o1 + 0x18], %f24
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   783
+    ldd    [%o1 + 0x20], %f26
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   784
+    ldd    [%o1 + 0x28], %f28
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   785
+    ldd    [%o1 + 0x30], %f30
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   786
+    ldd    [%o1 + 0x38], %f32
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   787
+    ldd    [%o1 + 0x40], %f34
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   788
+    ldd    [%o1 + 0x48], %f36
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   789
+    ldd    [%o1 + 0x50], %f38
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   790
+    ldd    [%o1 + 0x58], %f40
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   791
+    ldd    [%o1 + 0x60], %f42
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   792
+    ldd    [%o1 + 0x68], %f44
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   793
+    ldd    [%o1 + 0x70], %f46
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   794
+    ldd    [%o1 + 0x78], %f48
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   795
+    subcc    %o2, 1, %o2        ! done yet?
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   796
+    ldd    [%o1 + 0x80], %f50
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   797
+    add    %o1, 0x80, %o1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   798
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   799
+    faligndata %f18, %f20, %f16
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   800
+    faligndata %f20, %f22, %f18
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   801
+    faligndata %f22, %f24, %f20
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   802
+    faligndata %f24, %f26, %f22
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   803
+    faligndata %f26, %f28, %f24
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   804
+    faligndata %f28, %f30, %f26
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   805
+    faligndata %f30, %f32, %f28
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   806
+    faligndata %f32, %f34, %f30
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   807
+    faligndata %f34, %f36, %f32
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   808
+    faligndata %f36, %f38, %f34
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   809
+    faligndata %f38, %f40, %f36
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   810
+    faligndata %f40, %f42, %f38
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   811
+    faligndata %f42, %f44, %f40
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   812
+    faligndata %f44, %f46, %f42
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   813
+    faligndata %f46, %f48, %f44
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   814
+    faligndata %f48, %f50, %f46
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   815
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   816
+    .word    0x81b02860        ! SHA512
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   817
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   818
+    bne,pt    `$bits==64?"%xcc":"%icc"`, .Lhwunaligned_loop
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   819
+    for    %f50, %f50, %f18    ! %f18=%f50
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   820
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   821
+    ba    .Lhwfinish
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   822
+    nop
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   823
+___
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   824
+$code.=<<___ if ($SZ==4);         # SHA256
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   825
+    ld    [%o0 + 0x00], %f0
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   826
+    ld    [%o0 + 0x04], %f1
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   827
+    ld    [%o0 + 0x08], %f2
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   828
+    ld    [%o0 + 0x0c], %f3
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   829
+    ld    [%o0 + 0x10], %f4
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   830
+    ld    [%o0 + 0x14], %f5
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   831
+    andcc    %o1, 0x7, %g0
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   832
+    ld    [%o0 + 0x18], %f6
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   833
+    bne,pn    %icc, .Lhwunaligned
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   834
+     ld    [%o0 + 0x1c], %f7
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   835
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   836
+.Lhwloop:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   837
+    ldd    [%o1 + 0x00], %f8
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   838
+    ldd    [%o1 + 0x08], %f10
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   839
+    ldd    [%o1 + 0x10], %f12
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   840
+    ldd    [%o1 + 0x18], %f14
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   841
+    ldd    [%o1 + 0x20], %f16
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   842
+    ldd    [%o1 + 0x28], %f18
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   843
+    ldd    [%o1 + 0x30], %f20
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   844
+    subcc    %o2, 1, %o2        ! done yet?
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   845
+    ldd    [%o1 + 0x38], %f22
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   846
+    add    %o1, 0x40, %o1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   847
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   848
+    .word    0x81b02840        ! SHA256
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   849
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   850
+    bne,pt    `$bits==64?"%xcc":"%icc"`, .Lhwloop
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   851
+    nop
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   852
+
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   853
+.Lhwfinish:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   854
+    st    %f0, [%o0 + 0x00]    ! store context
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   855
+    st    %f1, [%o0 + 0x04]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   856
+    st    %f2, [%o0 + 0x08]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   857
+    st    %f3, [%o0 + 0x0c]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   858
+    st    %f4, [%o0 + 0x10]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   859
+    st    %f5, [%o0 + 0x14]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   860
+    st    %f6, [%o0 + 0x18]
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   861
+    retl
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   862
+     st    %f7, [%o0 + 0x1c]
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   863
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   864
+.align    8
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   865
+.Lhwunaligned:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   866
+    alignaddr %o1, %g0, %o1
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   867
+
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   868
+    ldd    [%o1 + 0x00], %f10
1267
3d7359ef8168 15824599 SUNBT7206151 T4 hash should be embedded in the OpenSSL upstream src
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents:
diff changeset
   869
+.Lhwunaligned_loop:
4002
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   870
+    ldd    [%o1 + 0x08], %f12
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   871
+    ldd    [%o1 + 0x10], %f14
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   872
+    ldd    [%o1 + 0x18], %f16
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   873
+    ldd    [%o1 + 0x20], %f18
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   874
+    ldd    [%o1 + 0x28], %f20
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   875
+    ldd    [%o1 + 0x30], %f22
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   876
+    ldd    [%o1 + 0x38], %f24
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   877
+    subcc    %o2, 1, %o2        ! done yet?
95b8f35fcdd5 20735615 Upgrade OpenSSL version to 1.0.1m
Misaki Miyashita <Misaki.Miyashita@Oracle.COM>
parents: 1884
diff changeset
   878
+    ldd    [%o1 + 0x40], %f26