diff options
author | Herbert Xu <herbert@gondor.apana.org.au> | 2009-11-03 09:11:15 -0500 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2009-11-03 09:11:15 -0500 |
commit | 3b0d65969b549b796abc6f0230f6142fed365d49 (patch) | |
tree | 0cce8ac977df20e0902cda3d6092bcb6e90e03c1 /arch/x86/crypto | |
parent | 2d06ef7f42ed8c9969c9aa84e95df5d5c6378327 (diff) |
crypto: ghash-intel - Add PSHUFB macros
Add PSHUFB macros instead of repeating byte sequences, suggested
by Ingo.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/crypto')
-rw-r--r-- | arch/x86/crypto/ghash-clmulni-intel_asm.S | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/crypto/ghash-clmulni-intel_asm.S b/arch/x86/crypto/ghash-clmulni-intel_asm.S index 71768d543dbb..59584982fb75 100644 --- a/arch/x86/crypto/ghash-clmulni-intel_asm.S +++ b/arch/x86/crypto/ghash-clmulni-intel_asm.S | |||
@@ -17,6 +17,7 @@ | |||
17 | */ | 17 | */ |
18 | 18 | ||
19 | #include <linux/linkage.h> | 19 | #include <linux/linkage.h> |
20 | #include <asm/i387.h> | ||
20 | 21 | ||
21 | .align 16 | 22 | .align 16 |
22 | .Lbswap_mask: | 23 | .Lbswap_mask: |
@@ -101,7 +102,7 @@ ENTRY(clmul_ghash_mul) | |||
101 | movups (%rsi), SHASH | 102 | movups (%rsi), SHASH |
102 | movaps .Lbswap_mask, BSWAP | 103 | movaps .Lbswap_mask, BSWAP |
103 | # pshufb BSWAP, DATA | 104 | # pshufb BSWAP, DATA |
104 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 105 | PSHUFB_XMM5_XMM0 |
105 | call __clmul_gf128mul_ble | 106 | call __clmul_gf128mul_ble |
106 | # pshufb BSWAP, DATA | 107 | # pshufb BSWAP, DATA |
107 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 108 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 |
@@ -119,12 +120,12 @@ ENTRY(clmul_ghash_update) | |||
119 | movups (%rdi), DATA | 120 | movups (%rdi), DATA |
120 | movups (%rcx), SHASH | 121 | movups (%rcx), SHASH |
121 | # pshufb BSWAP, DATA | 122 | # pshufb BSWAP, DATA |
122 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 123 | PSHUFB_XMM5_XMM0 |
123 | .align 4 | 124 | .align 4 |
124 | .Lupdate_loop: | 125 | .Lupdate_loop: |
125 | movups (%rsi), IN1 | 126 | movups (%rsi), IN1 |
126 | # pshufb BSWAP, IN1 | 127 | # pshufb BSWAP, IN1 |
127 | .byte 0x66, 0x0f, 0x38, 0x00, 0xf5 | 128 | PSHUFB_XMM5_XMM6 |
128 | pxor IN1, DATA | 129 | pxor IN1, DATA |
129 | call __clmul_gf128mul_ble | 130 | call __clmul_gf128mul_ble |
130 | sub $16, %rdx | 131 | sub $16, %rdx |
@@ -132,7 +133,7 @@ ENTRY(clmul_ghash_update) | |||
132 | cmp $16, %rdx | 133 | cmp $16, %rdx |
133 | jge .Lupdate_loop | 134 | jge .Lupdate_loop |
134 | # pshufb BSWAP, DATA | 135 | # pshufb BSWAP, DATA |
135 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 136 | PSHUFB_XMM5_XMM0 |
136 | movups DATA, (%rdi) | 137 | movups DATA, (%rdi) |
137 | .Lupdate_just_ret: | 138 | .Lupdate_just_ret: |
138 | ret | 139 | ret |
@@ -146,7 +147,7 @@ ENTRY(clmul_ghash_setkey) | |||
146 | movaps .Lbswap_mask, BSWAP | 147 | movaps .Lbswap_mask, BSWAP |
147 | movups (%rsi), %xmm0 | 148 | movups (%rsi), %xmm0 |
148 | # pshufb BSWAP, %xmm0 | 149 | # pshufb BSWAP, %xmm0 |
149 | .byte 0x66, 0x0f, 0x38, 0x00, 0xc5 | 150 | PSHUFB_XMM5_XMM0 |
150 | movaps %xmm0, %xmm1 | 151 | movaps %xmm0, %xmm1 |
151 | psllq $1, %xmm0 | 152 | psllq $1, %xmm0 |
152 | psrlq $63, %xmm1 | 153 | psrlq $63, %xmm1 |