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