Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
SMH "good bits", without DEBUG code
struct SIMD_SMH_PART {
m256 shuf_mask;
m256 cmp_mask;
m256 and_mask; // not yet used
m256 sub_mask; // not yet used
u32 doit(m256 d) {
return _mm256_movemask_epi8(
_mm256_cmpeq_epi8(_mm256_shuffle_epi8(d, shuf_mask),
struct GPR_SMH_PART {
u64 hi;
u64 low;
u64 doit(u64 m, bool loose_fit) {
if (loose_fit) {
return (m + low) & hi;
} else {
return ((m & ~hi) + low) & (m & hi);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment