ASM_OP(HAVE_AVX2 "vpaddq %ymm0, %ymm0, %ymm0" "avx2")
ASM_OP(HAVE_AVX "vpaddq %xmm0, %xmm0, %xmm0" "avx")
ASM_OP(HAVE_SSE2 "pmuludq %xmm0, %xmm0" "sse2")
+ ASM_OP(HAVE_SSE3 "lddqu 0(%esi), %xmm0" "sse3")
+ ASM_OP(HAVE_SSSE3 "pshufb %xmm0, %xmm0" "ssse3")
+ ASM_OP(HAVE_SSE41 "pblendw \$0, %xmm0, %xmm0" "sse41")
ASM_OP(HAVE_SLASHMACRO "
.macro TEST1 op
#endif
}
-
void
rspamd_cryptobox_init (void)
{
if ((cpu[2] & ((gint)1 << 28))) {
cpu_config |= CPUID_AVX;
}
+ if ((cpu[2] & ((gint)1 << 0))) {
+ cpu_config |= CPUID_SSE3;
+ }
+ if ((cpu[2] & ((gint)1 << 9))) {
+ cpu_config |= CPUID_SSSE3;
+ }
+ if ((cpu[2] & ((gint)1 << 19))) {
+ cpu_config |= CPUID_SSE41;
+ }
+
if (nid > 7) {
rspamd_cryptobox_cpuid (cpu, 7);
if ((cpu[1] & ((gint)1 << 5))) {
#cmakedefine HAVE_AVX2 1
#cmakedefine HAVE_AVX 1
#cmakedefine HAVE_SSE2 1
+#cmakedefine HAVE_SSE41 1
+#cmakedefine HAVE_SSE3 1
+#cmakedefine HAVE_SSSE3 1
#cmakedefine HAVE_SLASHMACRO 1
#cmakedefine HAVE_DOLLARMACRO 1
#define CPUID_AVX2 0x1
#define CPUID_AVX 0x2
#define CPUID_SSE2 0x4
+#define CPUID_SSE3 0x8
+#define CPUID_SSSE3 0x16
+#define CPUID_SSE41 0x32
#endif
\ No newline at end of file
{ 0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95, }
};
unsigned char in[64];
- static const unsigned char k[] =
- {'\000', '\001', '\002', '\003', '\004',
- '\005', '\006', '\007', '\010', '\011',
- '\012', '\013', '\014', '\015', '\016', '\017'};
+ static const unsigned char k[] ={
+ '\000', '\001', '\002', '\003', '\004',
+ '\005', '\006', '\007', '\010', '\011',
+ '\012', '\013', '\014', '\015', '\016', '\017'
+ };
size_t i, cycles;
union {
guint64 m;