Use the accelerated Count on AVX-512 CPUs

The AVX-512 level fell through to the generic loop. _count only needs
POPCNT, which every AVX-512 CPU has.

Fixes #46
This commit is contained in:
dualfroz committed 2026-10-02 16:28:14 +02:00
1 parent 47698fd8b9
commit d648d30d86
2 files changed
+15 -1

No files matched your search

+1 -1
View File
@@ -156,7 +156,7 @@ func (dst Bitmap) Count() int {
}
switch hardware {
case isAccelerated:
case isAccelerated, isAVX512:
var res uint64
_count(unsafe.Pointer(&dst[0]), uint64(len(dst)), unsafe.Pointer(&res))
return int(res)