Skip to content

Commit

Permalink
leveldb: Fix compilation warnings in port_posix_sse.cc on x86 (32-bit).
Browse files Browse the repository at this point in the history
LE_LOAD64 is only used when _mm_crc32_u64 is available, on 64-bit x86 processors.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=148906169
  • Loading branch information
pwnall authored and cmumford committed Mar 1, 2017
1 parent d0883b6 commit eb4f097
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions port/port_posix_sse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,17 @@ static inline uint32_t LE_LOAD32(const uint8_t *p) {
return word;
}

#if defined(_M_X64) || defined(__x86_64__) // LE_LOAD64 is only used on x64.

// Used to fetch a naturally-aligned 64-bit word in little endian byte-order
static inline uint64_t LE_LOAD64(const uint8_t *p) {
uint64_t dword;
memcpy(&dword, p, sizeof(dword));
return dword;
}

#endif // defined(_M_X64) || defined(__x86_64__)

static inline bool HaveSSE42() {
#if defined(_MSC_VER)
int cpu_info[4];
Expand Down

0 comments on commit eb4f097

Please sign in to comment.