Compile RangeSse42.cpp with -msse4.2
[folly.git] / folly / SpookyHashV2.cpp
index 877e0e7295c2184d8dfb99e804302264b9eea0fb..b945bc6f49badd6dafb63c6ab786b7fbb4ec8d52 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2015 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -35,8 +35,6 @@
 namespace folly {
 namespace hash {
 
-static constexpr auto kAllowUnalignedReads = bool(FOLLY_HAVE_UNALIGNED_READS);
-
 //
 // short hash ... it could be used on any message,
 // but it's used by Spooky just for short messages.
@@ -58,7 +56,7 @@ void SpookyHashV2::Short(
 
     u.p8 = (const uint8_t *)message;
 
-    if (!kAllowUnalignedReads && (u.i & 0x7))
+    if (!kHasUnalignedAccess && (u.i & 0x7))
     {
         memcpy(buf, message, length);
         u.p64 = buf;
@@ -178,7 +176,7 @@ void SpookyHashV2::Hash128(
     end = u.p64 + (length/sc_blockSize)*sc_numVars;
 
     // handle all whole sc_blockSize blocks of bytes
-    if (kAllowUnalignedReads || ((u.i & 0x7) == 0))
+    if (kHasUnalignedAccess || ((u.i & 0x7) == 0))
     {
         while (u.p64 < end)
         {
@@ -286,7 +284,7 @@ void SpookyHashV2::Update(const void *message, size_t length)
     // handle all whole blocks of sc_blockSize bytes
     end = u.p64 + (length/sc_blockSize)*sc_numVars;
     remainder = (uint8_t)(length-((const uint8_t *)end-u.p8));
-    if (kAllowUnalignedReads || (u.i & 0x7) == 0)
+    if (kHasUnalignedAccess || (u.i & 0x7) == 0)
     {
         while (u.p64 < end)
         {