From a632d0cbbbb87c2bd6ab6d8abf8ed7b238aafcdc Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sat, 3 Feb 2024 13:16:13 -0800 Subject: [PATCH] gcc fixes --- ConflictSet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index c157a19..b1f5aa2 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -176,11 +176,11 @@ int getNodeIndex(Node16 *self, uint8_t index) { // Build a mask to select only the first node->num_children values from the // comparison (because the other values are meaningless) - int mask = (1 << self->numChildren) - 1; + uint32_t mask = (1 << self->numChildren) - 1; // Change the results of the comparison into a bitfield, masking off any // invalid comparisons. - int bitfield = _mm_movemask_epi8(results) & mask; + uint32_t bitfield = _mm_movemask_epi8(results) & mask; // No match if there are no '1's in the bitfield. if (bitfield == 0) @@ -260,7 +260,7 @@ int getChildGeq(Node *self, int child) { memcpy(&indices, self16->index, sizeof(self16->index)); __m128i results = _mm_cmpeq_epi8(key_vec, _mm_min_epu8(key_vec, indices)); int mask = (1 << self16->numChildren) - 1; - int bitfield = _mm_movemask_epi8(results) & mask; + uint32_t bitfield = _mm_movemask_epi8(results) & mask; int result = bitfield == 0 ? -1 : self16->index[std::countr_zero(bitfield)]; assert(result == [&]() -> int { for (int i = 0; i < self16->numChildren; ++i) { @@ -338,7 +338,7 @@ int getChildLeq(Node *self, int child) { memcpy(&indices, self16->index, sizeof(self16->index)); __m128i results = _mm_cmpeq_epi8(key_vec, _mm_max_epu8(key_vec, indices)); int mask = (1 << self16->numChildren) - 1; - int bitfield = _mm_movemask_epi8(results) & mask; + uint32_t bitfield = _mm_movemask_epi8(results) & mask; int result = bitfield == 0 ? -1 : self16->index[31 - std::countl_zero(bitfield)]; assert(result == [&]() -> int {