crypto: sha - split sha.h into sha1.h and sha2.h
[linux-block.git] / arch / sparc / crypto / md5_asm.S
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
fa4dfedc
DM
2#include <linux/linkage.h>
3#include <asm/visasm.h>
4
7cff82f5
DM
5#include "opcodes.h"
6
fa4dfedc
DM
7ENTRY(md5_sparc64_transform)
8 /* %o0 = digest, %o1 = data, %o2 = rounds */
9 VISEntryHalf
10 ld [%o0 + 0x00], %f0
11 ld [%o0 + 0x04], %f1
12 andcc %o1, 0x7, %g0
13 ld [%o0 + 0x08], %f2
14 bne,pn %xcc, 10f
15 ld [%o0 + 0x0c], %f3
16
171:
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
7cff82f5 27 MD5
fa4dfedc
DM
28
29 subcc %o2, 1, %o2
30 bne,pt %xcc, 1b
31 add %o1, 0x40, %o1
32
335:
34 st %f0, [%o0 + 0x00]
35 st %f1, [%o0 + 0x04]
36 st %f2, [%o0 + 0x08]
37 st %f3, [%o0 + 0x0c]
38 retl
39 VISExitHalf
4010:
41 alignaddr %o1, %g0, %o1
42
43 ldd [%o1 + 0x00], %f10
441:
45 ldd [%o1 + 0x08], %f12
46 ldd [%o1 + 0x10], %f14
47 ldd [%o1 + 0x18], %f16
48 ldd [%o1 + 0x20], %f18
49 ldd [%o1 + 0x28], %f20
50 ldd [%o1 + 0x30], %f22
51 ldd [%o1 + 0x38], %f24
52 ldd [%o1 + 0x40], %f26
53
54 faligndata %f10, %f12, %f8
55 faligndata %f12, %f14, %f10
56 faligndata %f14, %f16, %f12
57 faligndata %f16, %f18, %f14
58 faligndata %f18, %f20, %f16
59 faligndata %f20, %f22, %f18
60 faligndata %f22, %f24, %f20
61 faligndata %f24, %f26, %f22
62
7cff82f5 63 MD5
fa4dfedc
DM
64
65 subcc %o2, 1, %o2
45dfe237 66 fsrc2 %f26, %f10
fa4dfedc
DM
67 bne,pt %xcc, 1b
68 add %o1, 0x40, %o1
69
70 ba,a,pt %xcc, 5b
71ENDPROC(md5_sparc64_transform)