SSE intrinsic rename
This commit is contained in:
parent
a87a99bbeb
commit
d5fb99b41f
2 changed files with 8 additions and 7 deletions
|
|
@ -38,9 +38,10 @@
|
||||||
#include <boost/endian/buffers.hpp>
|
#include <boost/endian/buffers.hpp>
|
||||||
|
|
||||||
#if defined(__SSE4_2__) && defined(__x86_64__)
|
#if defined(__SSE4_2__) && defined(__x86_64__)
|
||||||
#include <nmmintrin.h>
|
#include <nmmintrin.h>
|
||||||
|
#define _mm_crc32_u64_impl _mm_crc32_u64
|
||||||
#else
|
#else
|
||||||
uint64_t _mm_crc32_u64(uint64_t a, uint64_t b );
|
uint64_t _mm_crc32_u64_impl(uint64_t a, uint64_t b );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
|
|
@ -563,9 +564,9 @@ static void CityHashCrc256Long(const char *s, size_t len,
|
||||||
g += e; \
|
g += e; \
|
||||||
e += z; \
|
e += z; \
|
||||||
g += x; \
|
g += x; \
|
||||||
z = _mm_crc32_u64(z, b + g); \
|
z = _mm_crc32_u64_impl(z, b + g); \
|
||||||
y = _mm_crc32_u64(y, e + h); \
|
y = _mm_crc32_u64_impl(y, e + h); \
|
||||||
x = _mm_crc32_u64(x, f + a); \
|
x = _mm_crc32_u64_impl(x, f + a); \
|
||||||
e = Rotate(e, r); \
|
e = Rotate(e, r); \
|
||||||
c += e; \
|
c += e; \
|
||||||
s += 40
|
s += 40
|
||||||
|
|
|
||||||
|
|
@ -604,7 +604,7 @@ static const uint32_t crc_c[256] = {
|
||||||
#if !defined __SSE4_2__ || (defined __SSE4_2__ && !defined __x86_64__)
|
#if !defined __SSE4_2__ || (defined __SSE4_2__ && !defined __x86_64__)
|
||||||
|
|
||||||
|
|
||||||
uint64_t _mm_crc32_u64(uint64_t a, uint64_t b )
|
uint64_t _mm_crc32_u64_impl(uint64_t a, uint64_t b )
|
||||||
{
|
{
|
||||||
// Squelch warning about unusued variable crc_c
|
// Squelch warning about unusued variable crc_c
|
||||||
(void)(crc_c);
|
(void)(crc_c);
|
||||||
|
|
@ -619,7 +619,7 @@ int main( int argc, char** argv )
|
||||||
{
|
{
|
||||||
uint64_t f = 0x1234;
|
uint64_t f = 0x1234;
|
||||||
uint64_t a = 0x5678;
|
uint64_t a = 0x5678;
|
||||||
uint32_t f1 = _mm_crc32_u64(f, a);
|
uint32_t f1 = _mm_crc32_u64_impl(f, a);
|
||||||
uint32_t f4 = crc32cSlicingBy8(f, (unsigned char*)&a, sizeof(a));
|
uint32_t f4 = crc32cSlicingBy8(f, (unsigned char*)&a, sizeof(a));
|
||||||
std::cout<<std::hex<<f1<<"\n"<<f2<<"\n"<<f3<<"\n"<<f4<<"\n";
|
std::cout<<std::hex<<f1<<"\n"<<f2<<"\n"<<f3<<"\n"<<f4<<"\n";
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue