Summary:
This PR is necessary for both Folly and HHVM to compile on PPC64 (https://github.com/PPC64/hhvm) and other platforms that are not compatible with SSE instructions.
It also removes GroupVarint32 tables generator dependency on x86 platform.
Closes https://github.com/facebook/folly/pull/339
Reviewed By: mxw
Differential Revision:
D2760156
fb-gh-sync-id:
b4e93b54b62d6f68ccf684d34840678f677bf276
#include <folly/Portability.h>
#include <folly/Portability.h>
-#if FOLLY_X64 || defined(__i386__)
+#if FOLLY_X64 || defined(__i386__) || FOLLY_PPC64
#define HAVE_GROUP_VARINT 1
#include <cstdint>
#define HAVE_GROUP_VARINT 1
#include <cstdint>
-#endif /* FOLLY_X64 || defined(__i386__) */
+#endif /* FOLLY_X64 || defined(__i386__) || FOLLY_PPC64 */
#endif /* FOLLY_GROUPVARINT_H_ */
#endif /* FOLLY_GROUPVARINT_H_ */
f.write("""
#include <folly/Portability.h>
f.write("""
#include <folly/Portability.h>
-#if (FOLLY_X64 || defined(__i386__)) && (FOLLY_SSE >= 2)
+
+#if (FOLLY_X64 || defined(__i386__)) && (FOLLY_SSE >= 2)
namespace folly {
namespace detail {
namespace folly {
namespace detail {
+#if (FOLLY_X64 || defined(__i386__)) && (FOLLY_SSE >= 2)
extern const __m128i groupVarintSSEMasks[] = {
""")
extern const __m128i groupVarintSSEMasks[] = {
""")
"static_cast<int64_t>(0x{3:08x}{2:08x})}},\n".format(*vals))
f.write("};\n"
"static_cast<int64_t>(0x{3:08x}{2:08x})}},\n".format(*vals))
f.write("};\n"
- "\n"
- "extern const uint8_t groupVarintLengths[] = {\n")
+ "#endif /*#if (FOLLY_X64 || defined(__i386__)) && (FOLLY_SSE >= 2)*/\n"
+ "\n"
+ "extern const uint8_t groupVarintLengths[] = {\n")
# Also compute total encoded lengths, including key byte
for i in range(0, 256):
# Also compute total encoded lengths, including key byte
for i in range(0, 256):
} // namespace detail
} // namespace folly
} // namespace detail
} // namespace folly
-#endif /* (FOLLY_X64 || defined(__i386__)) && (FOLLY_SSE >= 2) */