1 #include "hphp/util/etch-helpers.h"
3 #if defined(__x86_64__) && !defined(NO_HWCRC) && !defined(_MSC_VER)
5 .file "hphp/util/hash-crc-x64.S"
8 * If SSE4.2 is explicitly specified, we define the HPHP::hash_string* functions
9 * here, otherwise those functions are the same as the 'fallback' version, which
10 * check CPUID and possibly jumps here. Thus the function name is different
11 * depending on whether __SSE4_2__ is defined.
14 #define IF_SSE42(x, y) ETCH_NAME(x)
16 #define IF_SSE42(x, y) ETCH_NAME(y)
19 #define HASH_FUNC_NAME IF_SSE42(_ZN4HPHP20hash_string_i_unsafeEPKcj, hash_string_i_crc)
21 ETCH_SECTION(HASH_FUNC_NAME)
23 ETCH_TYPE(HASH_FUNC_NAME, @function)
30 movabs $0xdfdfdfdfdfdfdfdf, %r8
31 jmp ETCH_LABEL(iheader)
51 ETCH_SIZE(HASH_FUNC_NAME)
55 #define HASH_FUNC_NAME IF_SSE42(_ZN4HPHP13hash_string_iEPKcj, hash_string_i_unaligned_crc)
57 ETCH_SECTION(HASH_FUNC_NAME)
59 ETCH_TYPE(HASH_FUNC_NAME, @function)
67 movabs $0xdfdfdfdfdfdfdfdf, %r8
69 jnz ETCH_LABEL(iuheader)
70 jmp ETCH_LABEL(icheader)
80 jnc ETCH_LABEL(icloop)
99 jnc ETCH_LABEL(iuloop)
106 ETCH_LABEL(iutailloop):
111 jnz ETCH_LABEL(iutailloop)
120 ETCH_SIZE(HASH_FUNC_NAME)
121 #undef HASH_FUNC_NAME
124 #define HASH_FUNC_NAME IF_SSE42(_ZN4HPHP21hash_string_cs_unsafeEPKcj, hash_string_cs_crc)
126 ETCH_SECTION(HASH_FUNC_NAME)
127 .globl HASH_FUNC_NAME
128 ETCH_TYPE(HASH_FUNC_NAME, @function)
135 jmp ETCH_LABEL(csheader)
140 ETCH_LABEL(csheader):
143 jnc ETCH_LABEL(csloop)
153 ETCH_SIZE(HASH_FUNC_NAME)
154 #undef HASH_FUNC_NAME
157 #define HASH_FUNC_NAME IF_SSE42(_ZN4HPHP14hash_string_csEPKcj, hash_string_cs_unaligned_crc)
159 ETCH_SECTION(HASH_FUNC_NAME)
160 .globl HASH_FUNC_NAME
161 ETCH_TYPE(HASH_FUNC_NAME, @function)
166 js ETCH_LABEL(csutail)
173 jns ETCH_LABEL(csuloop)
177 je ETCH_LABEL(csuend)
181 ETCH_LABEL(csutailloop):
185 loop ETCH_LABEL(csutailloop)
194 ETCH_SIZE(HASH_FUNC_NAME)
195 #undef HASH_FUNC_NAME