ASM_OP(HAVE_SSSE3 "ssse3")
SET(ASM_CODE "pblendw \$0, %xmm0, %xmm0")
ASM_OP(HAVE_SSE41 "sse41")
+ SET(ASM_CODE "crc32 %eax, %eax")
+ ASM_OP(HAVE_SSE42 "sse42")
if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
SET(POLYSRC ${POLYSRC} ${CMAKE_CURRENT_SOURCE_DIR}/poly1305/ref-64.c)
__asm__ volatile ("pcmpeqq %xmm0, %xmm0");
break;
#endif
+#ifdef HAVE_SSE42
+ case CPUID_SSE42:
+ __asm__ volatile ("pushq %rax\n"
+ "xorq %rax, %rax\n"
+ "crc32 %rax, %rax\n"
+ "popq %rax");
+ break;
+#endif
#ifdef HAVE_AVX
case CPUID_AVX:
__asm__ volatile ("vpaddq %xmm0, %xmm0, %xmm0");
cpu_config |= CPUID_SSE41;
}
}
+ if ((cpu[2] & ((guint32)1 << 20))) {
+ if (rspamd_cryptobox_test_instr (CPUID_SSE42)) {
+ cpu_config |= CPUID_SSE42;
+ }
+ }
if ((cpu[2] & ((guint32)1 << 30))) {
if (rspamd_cryptobox_test_instr (CPUID_RDRAND)) {
cpu_config |= CPUID_RDRAND;
case CPUID_SSE41:
rspamd_printf_gstring (buf, "sse4.1, ");
break;
+ case CPUID_SSE42:
+ rspamd_printf_gstring (buf, "sse4.2, ");
+ break;
case CPUID_AVX:
rspamd_printf_gstring (buf, "avx, ");
break;
#define CPUID_SSE3 0x8
#define CPUID_SSSE3 0x10
#define CPUID_SSE41 0x20
-#define CPUID_RDRAND 0x40
+#define CPUID_SSE42 0x40
+#define CPUID_RDRAND 0x80
typedef guchar rspamd_pk_t[rspamd_cryptobox_MAX_PKBYTES];
typedef guchar rspamd_sk_t[rspamd_cryptobox_MAX_SKBYTES];
#cmakedefine HAVE_AVX 1
#cmakedefine HAVE_SSE2 1
#cmakedefine HAVE_SSE41 1
+#cmakedefine HAVE_SSE42 1
#cmakedefine HAVE_SSE3 1
#cmakedefine HAVE_SSSE3 1
#cmakedefine HAVE_SLASHMACRO 1