History

crypto: sha1 - use Kbuild supplied flags for AVX test

Commit ea4d26ae ("raid5: add AVX optimized RAID5 checksumming") introduced x86/ arch wide defines for AFLAGS and CFLAGS indicating AVX support in binutils based on the same test we have in x86/crypto/ right now. To minimize duplication drop our implementation in favour to the one in x86/.

Mathias Krause committed 14 years ago

Commit 65df5771 parent 4e3c8a13 files · +4 −11Browse files

Unified · Split

3 files
  1. arch/x86/crypto/Makefile +0 −7
  2. arch/x86/crypto/sha1_ssse3_asm.S +1 −1
  3. arch/x86/crypto/sha1_ssse3_glue.c +3 −3
arch/x86/crypto/Makefile+0−7
@@ -34,12 +34,5 @@ salsa20-x86_64-y := salsa20-x86_64-asm_64.o salsa20_glue.o · 33 unmodified lines
3434 serpent-sse2-x86_64-y := serpent-sse2-x86_64-asm_64.o serpent_sse2_glue.o
3535
3636 aesni-intel-y := aesni-intel_asm.o aesni-intel_glue.o fpu.o
37−
3837 ghash-clmulni-intel-y := ghash-clmulni-intel_asm.o ghash-clmulni-intel_glue.o
39−
40−# enable AVX support only when $(AS) can actually assemble the instructions
41−ifeq ($(call as-instr,vpxor %xmm0$(comma)%xmm1$(comma)%xmm2,yes,no),yes)
42−AFLAGS_sha1_ssse3_asm.o += -DSHA1_ENABLE_AVX_SUPPORT
43−CFLAGS_sha1_ssse3_glue.o += -DSHA1_ENABLE_AVX_SUPPORT
44−endif
4538 sha1-ssse3-y := sha1_ssse3_asm.o sha1_ssse3_glue.o
arch/x86/crypto/sha1_ssse3_asm.S+1−1
@@ -468,7 +468,7 @@ W_PRECALC_SSSE3 · 467 unmodified lines
468468 */
469469 SHA1_VECTOR_ASM sha1_transform_ssse3
470470
471−#ifdef SHA1_ENABLE_AVX_SUPPORT
471+#ifdef CONFIG_AS_AVX
472472
473473 .macro W_PRECALC_AVX
474474
arch/x86/crypto/sha1_ssse3_glue.c+3−3
@@ -35,7 +35,7 @@ · 34 unmodified lines
3535
3636 asmlinkage void sha1_transform_ssse3(u32 *digest, const char *data,
3737 unsigned int rounds);
38−#ifdef SHA1_ENABLE_AVX_SUPPORT
38+#ifdef CONFIG_AS_AVX
3939 asmlinkage void sha1_transform_avx(u32 *digest, const char *data,
4040 unsigned int rounds);
4141 #endif
@@ -184,7 +184,7 @@ static struct shash_alg alg = { · 142 unmodified lines
184184 }
185185 };
186186
187−#ifdef SHA1_ENABLE_AVX_SUPPORT
187+#ifdef CONFIG_AS_AVX
188188 static bool __init avx_usable(void)
189189 {
190190 u64 xcr0;
@@ -209,7 +209,7 @@ static int __init sha1_ssse3_mod_init(void) · 18 unmodified lines
209209 if (cpu_has_ssse3)
210210 sha1_transform_asm = sha1_transform_ssse3;
211211
212−#ifdef SHA1_ENABLE_AVX_SUPPORT
212+#ifdef CONFIG_AS_AVX
213213 /* allow AVX to override SSSE3, it's a little faster */
214214 if (avx_usable())
215215 sha1_transform_asm = sha1_transform_avx;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t