Use 64 bit little endian on ppc64le.

This has tangible performance benefits.

This lands https://github.com/google/snappy/pull/27
This commit is contained in:
alkis 2017-06-06 01:05:05 -07:00 committed by Victor Costan
parent 7b9532b878
commit 18488d6212
2 changed files with 6 additions and 3 deletions

View File

@ -80,9 +80,8 @@ char* CompressFragment(const char* input,
// Does not read *(s1 + (s2_limit - s2)) or beyond. // Does not read *(s1 + (s2_limit - s2)) or beyond.
// Requires that s2_limit >= s2. // Requires that s2_limit >= s2.
// //
// Separate implementation for x86_64, for speed. Uses the fact that // Separate implementation for 64-bit, little-endian cpus.
// x86_64 is little endian. #if defined(ARCH_K8) || (defined(ARCH_PPC) && !defined(WORDS_BIGENDIAN))
#if defined(ARCH_K8)
static inline std::pair<size_t, bool> FindMatchLength(const char* s1, static inline std::pair<size_t, bool> FindMatchLength(const char* s1,
const char* s2, const char* s2,
const char* s2_limit) { const char* s2_limit) {

View File

@ -52,6 +52,10 @@
// Enable 64-bit optimized versions of some routines. // Enable 64-bit optimized versions of some routines.
#define ARCH_K8 1 #define ARCH_K8 1
#elif defined(__ppc64__)
#define ARCH_PPC 1
#endif #endif
// Needed by OS X, among others. // Needed by OS X, among others.