Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
torvalds
GitHub Repository: torvalds/linux
Path: blob/master/lib/crypto/sparc/sha1_asm.S
26282 views
1
/* SPDX-License-Identifier: GPL-2.0 */
2
#include <linux/linkage.h>
3
#include <asm/opcodes.h>
4
#include <asm/visasm.h>
5
6
ENTRY(sha1_sparc64_transform)
7
/* %o0 = digest, %o1 = data, %o2 = rounds */
8
VISEntryHalf
9
ld [%o0 + 0x00], %f0
10
ld [%o0 + 0x04], %f1
11
ld [%o0 + 0x08], %f2
12
andcc %o1, 0x7, %g0
13
ld [%o0 + 0x0c], %f3
14
bne,pn %xcc, 10f
15
ld [%o0 + 0x10], %f4
16
17
1:
18
ldd [%o1 + 0x00], %f8
19
ldd [%o1 + 0x08], %f10
20
ldd [%o1 + 0x10], %f12
21
ldd [%o1 + 0x18], %f14
22
ldd [%o1 + 0x20], %f16
23
ldd [%o1 + 0x28], %f18
24
ldd [%o1 + 0x30], %f20
25
ldd [%o1 + 0x38], %f22
26
27
SHA1
28
29
subcc %o2, 1, %o2
30
bne,pt %xcc, 1b
31
add %o1, 0x40, %o1
32
33
5:
34
st %f0, [%o0 + 0x00]
35
st %f1, [%o0 + 0x04]
36
st %f2, [%o0 + 0x08]
37
st %f3, [%o0 + 0x0c]
38
st %f4, [%o0 + 0x10]
39
retl
40
VISExitHalf
41
10:
42
alignaddr %o1, %g0, %o1
43
44
ldd [%o1 + 0x00], %f10
45
1:
46
ldd [%o1 + 0x08], %f12
47
ldd [%o1 + 0x10], %f14
48
ldd [%o1 + 0x18], %f16
49
ldd [%o1 + 0x20], %f18
50
ldd [%o1 + 0x28], %f20
51
ldd [%o1 + 0x30], %f22
52
ldd [%o1 + 0x38], %f24
53
ldd [%o1 + 0x40], %f26
54
55
faligndata %f10, %f12, %f8
56
faligndata %f12, %f14, %f10
57
faligndata %f14, %f16, %f12
58
faligndata %f16, %f18, %f14
59
faligndata %f18, %f20, %f16
60
faligndata %f20, %f22, %f18
61
faligndata %f22, %f24, %f20
62
faligndata %f24, %f26, %f22
63
64
SHA1
65
66
subcc %o2, 1, %o2
67
fsrc2 %f26, %f10
68
bne,pt %xcc, 1b
69
add %o1, 0x40, %o1
70
71
ba,a,pt %xcc, 5b
72
ENDPROC(sha1_sparc64_transform)
73
74