Fix x86 compile error

This commit is contained in:
Nick Peng
2018-11-03 21:50:37 +08:00
parent 307ebe234f
commit db4fad058e

View File

@@ -183,16 +183,17 @@ static art_node** find_child(art_node *n, unsigned char c) {
p.p2 = (art_node16*)n; p.p2 = (art_node16*)n;
// support non-86 architectures // support non-86 architectures
#ifdef __i386__
// Compare the key to all 16 stored keys // #ifdef __i386__
__m128i cmp; // // Compare the key to all 16 stored keys
cmp = _mm_cmpeq_epi8(_mm_set1_epi8(c), // __m128i cmp;
_mm_loadu_si128((__m128i*)p.p2->keys)); // cmp = _mm_cmpeq_epi8(_mm_set1_epi8(c),
// _mm_loadu_si128((__m128i*)p.p2->keys));
// Use a mask to ignore children that don't exist // // Use a mask to ignore children that don't exist
mask = (1 << n->num_children) - 1; // mask = (1 << n->num_children) - 1;
bitfield = _mm_movemask_epi8(cmp) & mask; // bitfield = _mm_movemask_epi8(cmp) & mask;
#else // #else
#ifdef __amd64__ #ifdef __amd64__
// Compare the key to all 16 stored keys // Compare the key to all 16 stored keys
__m128i cmp; __m128i cmp;
@@ -214,7 +215,7 @@ static art_node** find_child(art_node *n, unsigned char c) {
mask = (1 << n->num_children) - 1; mask = (1 << n->num_children) - 1;
bitfield &= mask; bitfield &= mask;
#endif #endif
#endif // #endif
/* /*
* If we have a match (any bit set) then we can * If we have a match (any bit set) then we can