vyre_reference/dual_impls/bitwise/popcount/mod.rs
1/// Population-count dual implementation reference.
2pub mod reference {}
3
4/// Operation ID for population-count dual references.
5pub const OP_ID: &str = "primitive.bitwise.popcount";
6
7/// Direct word-oriented population-count reference.
8pub mod reference_a {
9 /// Evaluate `count_ones` over one little-endian u32 input.
10 #[must_use]
11 pub fn reference(input: &[u8]) -> Vec<u8> {
12 super::super::common::unary_direct(input, u32::count_ones)
13 }
14}
15
16/// Independent bit-walk population-count reference.
17pub mod reference_b {
18 /// Count bits by walking every lane explicitly.
19 #[must_use]
20 pub fn reference(input: &[u8]) -> Vec<u8> {
21 super::super::common::popcount_bits(input)
22 }
23}