sparc64: Add CAMELLIA driver making use of the new camellia opcodes.
[linux-2.6-block.git] / arch / sparc / crypto / sha1_asm.S
CommitLineData
4ff28d4c
DM
1#include <linux/linkage.h>
2#include <asm/visasm.h>
3
4ENTRY(sha1_sparc64_transform)
5 /* %o0 = digest, %o1 = data, %o2 = rounds */
6 VISEntryHalf
7 ld [%o0 + 0x00], %f0
8 ld [%o0 + 0x04], %f1
9 ld [%o0 + 0x08], %f2
10 andcc %o1, 0x7, %g0
11 ld [%o0 + 0x0c], %f3
12 bne,pn %xcc, 10f
13 ld [%o0 + 0x10], %f4
14
151:
16 ldd [%o1 + 0x00], %f8
17 ldd [%o1 + 0x08], %f10
18 ldd [%o1 + 0x10], %f12
19 ldd [%o1 + 0x18], %f14
20 ldd [%o1 + 0x20], %f16
21 ldd [%o1 + 0x28], %f18
22 ldd [%o1 + 0x30], %f20
23 ldd [%o1 + 0x38], %f22
24
25 /* sha1 */
26 .word 0x81b02820
27
28 subcc %o2, 1, %o2
29 bne,pt %xcc, 1b
30 add %o1, 0x40, %o1
31
325:
33 st %f0, [%o0 + 0x00]
34 st %f1, [%o0 + 0x04]
35 st %f2, [%o0 + 0x08]
36 st %f3, [%o0 + 0x0c]
37 st %f4, [%o0 + 0x10]
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
63 /* sha1 */
64 .word 0x81b02820
65
66 subcc %o2, 1, %o2
67 fsrc1 %f26, %f10
68 bne,pt %xcc, 1b
69 add %o1, 0x40, %o1
70
71 ba,a,pt %xcc, 5b
72ENDPROC(sha1_sparc64_transform)