Skip to content

Commit

Permalink
Revert change
Browse files Browse the repository at this point in the history
  • Loading branch information
kg committed May 21, 2024
1 parent d648ed4 commit 1553bd7
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/native/containers/dn-simdhash-specialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ DN_SIMDHASH_SCAN_BUCKET_INTERNAL (DN_SIMDHASH_T_PTR hash, bucket_t *restrict buc
// no good reason.
#define bucket_suffixes (bucket->suffixes)
#endif
// Don't load the cascaded slot early, since we won't need it if we find a match,
// and loading it too early will waste a valuable register or worse, spill to the stack
uint8_t count = dn_simdhash_extract_lane(bucket_suffixes, DN_SIMDHASH_COUNT_SLOT);
uint8_t count = dn_simdhash_extract_lane(bucket_suffixes, DN_SIMDHASH_COUNT_SLOT),
overflow_count = dn_simdhash_extract_lane(bucket_suffixes, DN_SIMDHASH_CASCADED_SLOT);
// We could early-out here when count==0, but it doesn't appear to meaningfully improve
// search performance to do so, and might actually worsen it
#ifdef DN_SIMDHASH_USE_SCALAR_FALLBACK
Expand All @@ -212,15 +211,10 @@ DN_SIMDHASH_SCAN_BUCKET_INTERNAL (DN_SIMDHASH_T_PTR hash, bucket_t *restrict buc
return index;
}

#ifdef DN_SIMDHASH_USE_SCALAR_FALLBACK
if (bucket->suffixes.values[DN_SIMDHASH_CASCADED_SLOT])
#else
if (dn_simdhash_extract_lane(bucket_suffixes, DN_SIMDHASH_CASCADED_SLOT))
#endif
if (overflow_count)
return DN_SIMDHASH_SCAN_BUCKET_OVERFLOWED;
else
return DN_SIMDHASH_SCAN_BUCKET_NO_OVERFLOW;
#undef bucket_suffixes
}

// Helper macros so that we can optimize and change scan logic more easily
Expand Down

0 comments on commit 1553bd7

Please sign in to comment.