diff options
Diffstat (limited to 'arch/sparc/crypto/sha256_asm.S')
| -rw-r--r-- | arch/sparc/crypto/sha256_asm.S | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/arch/sparc/crypto/sha256_asm.S b/arch/sparc/crypto/sha256_asm.S new file mode 100644 index 000000000000..b5f3d5826eb4 --- /dev/null +++ b/arch/sparc/crypto/sha256_asm.S | |||
| @@ -0,0 +1,78 @@ | |||
| 1 | #include <linux/linkage.h> | ||
| 2 | #include <asm/visasm.h> | ||
| 3 | |||
| 4 | #include "opcodes.h" | ||
| 5 | |||
| 6 | ENTRY(sha256_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 | ld [%o0 + 0x0c], %f3 | ||
| 13 | ld [%o0 + 0x10], %f4 | ||
| 14 | ld [%o0 + 0x14], %f5 | ||
| 15 | andcc %o1, 0x7, %g0 | ||
| 16 | ld [%o0 + 0x18], %f6 | ||
| 17 | bne,pn %xcc, 10f | ||
| 18 | ld [%o0 + 0x1c], %f7 | ||
| 19 | |||
| 20 | 1: | ||
| 21 | ldd [%o1 + 0x00], %f8 | ||
| 22 | ldd [%o1 + 0x08], %f10 | ||
| 23 | ldd [%o1 + 0x10], %f12 | ||
| 24 | ldd [%o1 + 0x18], %f14 | ||
| 25 | ldd [%o1 + 0x20], %f16 | ||
| 26 | ldd [%o1 + 0x28], %f18 | ||
| 27 | ldd [%o1 + 0x30], %f20 | ||
| 28 | ldd [%o1 + 0x38], %f22 | ||
| 29 | |||
| 30 | SHA256 | ||
| 31 | |||
| 32 | subcc %o2, 1, %o2 | ||
| 33 | bne,pt %xcc, 1b | ||
| 34 | add %o1, 0x40, %o1 | ||
| 35 | |||
| 36 | 5: | ||
| 37 | st %f0, [%o0 + 0x00] | ||
| 38 | st %f1, [%o0 + 0x04] | ||
| 39 | st %f2, [%o0 + 0x08] | ||
| 40 | st %f3, [%o0 + 0x0c] | ||
| 41 | st %f4, [%o0 + 0x10] | ||
| 42 | st %f5, [%o0 + 0x14] | ||
| 43 | st %f6, [%o0 + 0x18] | ||
| 44 | st %f7, [%o0 + 0x1c] | ||
| 45 | retl | ||
| 46 | VISExitHalf | ||
| 47 | 10: | ||
| 48 | alignaddr %o1, %g0, %o1 | ||
| 49 | |||
| 50 | ldd [%o1 + 0x00], %f10 | ||
| 51 | 1: | ||
| 52 | ldd [%o1 + 0x08], %f12 | ||
| 53 | ldd [%o1 + 0x10], %f14 | ||
| 54 | ldd [%o1 + 0x18], %f16 | ||
| 55 | ldd [%o1 + 0x20], %f18 | ||
| 56 | ldd [%o1 + 0x28], %f20 | ||
| 57 | ldd [%o1 + 0x30], %f22 | ||
| 58 | ldd [%o1 + 0x38], %f24 | ||
| 59 | ldd [%o1 + 0x40], %f26 | ||
| 60 | |||
| 61 | faligndata %f10, %f12, %f8 | ||
| 62 | faligndata %f12, %f14, %f10 | ||
| 63 | faligndata %f14, %f16, %f12 | ||
| 64 | faligndata %f16, %f18, %f14 | ||
| 65 | faligndata %f18, %f20, %f16 | ||
| 66 | faligndata %f20, %f22, %f18 | ||
| 67 | faligndata %f22, %f24, %f20 | ||
| 68 | faligndata %f24, %f26, %f22 | ||
| 69 | |||
| 70 | SHA256 | ||
| 71 | |||
| 72 | subcc %o2, 1, %o2 | ||
| 73 | fsrc2 %f26, %f10 | ||
| 74 | bne,pt %xcc, 1b | ||
| 75 | add %o1, 0x40, %o1 | ||
| 76 | |||
| 77 | ba,a,pt %xcc, 5b | ||
| 78 | ENDPROC(sha256_sparc64_transform) | ||
