Commit 2180ee9
committed
fix: replace static __m256i initializer with byte array to fix GCC 13 build
GCC 13 rejects _mm256_setr_epi8() as a file-scope static initializer
because the intrinsic is not a constant expression, producing:
error: initializer element is not constant
Replace the static __m256i popcount_lut with a plain char[32] byte
array (which is a valid constant initializer) and load it with
_mm256_loadu_si256 at the top of popcount_avx2(). The loaded value
is semantically identical; modern compilers hoist the load out of
loops when the function is inlined.
Tested on GCC 13.3 (Ubuntu 24.04, x86-64).1 parent b68d34a commit 2180ee9
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
959 | 959 | | |
960 | 960 | | |
961 | 961 | | |
962 | | - | |
963 | | - | |
| 962 | + | |
| 963 | + | |
964 | 964 | | |
965 | 965 | | |
| 966 | + | |
966 | 967 | | |
967 | 968 | | |
968 | 969 | | |
| |||
0 commit comments