Browse Source

[Minor] Limit x86_64 assembly to x86_64

Issue: #3967
tags/3.2
Vsevolod Stakhov 2 years ago
parent
commit
eee7acb309
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      src/libcryptobox/chacha20/chacha.c

+ 6
- 6
src/libcryptobox/chacha20/chacha.c View File

@@ -52,15 +52,15 @@ typedef struct chacha_impl_t {
#define CHACHA_IMPL(cpuflags, desc, ext) \
{(cpuflags), desc, chacha_##ext, xchacha_##ext, chacha_blocks_##ext, hchacha_##ext}

#if defined(HAVE_AVX2)
#if defined(HAVE_AVX2) && defined(__x86_64__)
CHACHA_DECLARE(avx2)
#define CHACHA_AVX2 CHACHA_IMPL(CPUID_AVX2, "avx2", avx2)
#endif
#if defined(HAVE_AVX)
#if defined(HAVE_AVX) && defined(__x86_64__)
CHACHA_DECLARE(avx)
#define CHACHA_AVX CHACHA_IMPL(CPUID_AVX, "avx", avx)
#endif
#if defined(HAVE_SSE2)
#if defined(HAVE_SSE2) && defined(__x86_64__)
CHACHA_DECLARE(sse2)
#define CHACHA_SSE2 CHACHA_IMPL(CPUID_SSE2, "sse2", sse2)
#endif
@@ -70,13 +70,13 @@ CHACHA_DECLARE(ref)

static const chacha_impl_t chacha_list[] = {
CHACHA_GENERIC,
#if defined(CHACHA_AVX2)
#if defined(CHACHA_AVX2) && defined(__x86_64__)
CHACHA_AVX2,
#endif
#if defined(CHACHA_AVX)
#if defined(CHACHA_AVX) && defined(__x86_64__)
CHACHA_AVX,
#endif
#if defined(CHACHA_SSE2)
#if defined(CHACHA_SSE2) && defined(__x86_64__)
CHACHA_SSE2
#endif
};

Loading…
Cancel
Save