|
3 | 3 |
|
4 | 4 | #include "zoo/swar/SWAR.h" |
5 | 5 |
|
6 | | -#define ZOO_DEVELOPMENT_DEBUGGING |
| 6 | +//#define ZOO_DEVELOPMENT_DEBUGGING |
7 | 7 | #ifdef ZOO_DEVELOPMENT_DEBUGGING |
8 | 8 | #include <iostream> |
9 | 9 |
|
@@ -54,7 +54,7 @@ constexpr SWAR<NB, B> parallelSuffix(SWAR<NB, B> input) { |
54 | 54 | auto |
55 | 55 | bitsToXOR = NB, |
56 | 56 | power = 1; |
57 | | - #define ZTE(...) __VA_ARGS__ |
| 57 | + #define ZTE(...) ZOO_TRACEABLE_EXPRESSION(__VA_ARGS__) |
58 | 58 | for(;;) { |
59 | 59 | ZTE(doubling); |
60 | 60 | if(1 & bitsToXOR) { |
@@ -183,7 +183,7 @@ compress(SWAR<NB, B> input, SWAR<NB, B> compressionMask) { |
183 | 183 | // Because we want to detect the "oddness" of groups of zeroes to the right, |
184 | 184 | // we flip the compression mask. To not count the bit position itself, |
185 | 185 | // we shift by one. |
186 | | - // #define ZTE ZOO_TRACEABLE_EXPRESSION |
| 186 | + #define ZTE(...) ZOO_TRACEABLE_EXPRESSION(__VA_ARGS__) |
187 | 187 | ZTE(input); |
188 | 188 | ZTE(compressionMask); |
189 | 189 | using S = SWAR<NB, B>; |
@@ -451,27 +451,6 @@ constexpr auto halvePrecision(SWAR<NB, T> even, SWAR<NB, T> odd) { |
451 | 451 | return evenHalf | oddHalf; |
452 | 452 | } |
453 | 453 |
|
454 | | -/* |
455 | | -template<int NB, typename T> |
456 | | -constexpr auto compress(SWAR<NB, T> input, SWAR<NB, T> mask) { |
457 | | - using S = SWAR<NB, T>; |
458 | | - // Follows Henry S. Warren's "Hacker's Delight" 7-4 |
459 | | - auto movers = input & mask; |
460 | | - // The mechanism detects positions with an odd number of zeroes to the |
461 | | - // right. |
462 | | - // To count odd zeroes, invert the mask |
463 | | - // The "parallel suffix" gives this, but including the position, to exclude |
464 | | - // the position, shift left by one |
465 | | - auto preOddZeroesToTheRight = ~S{~mask.value() << 1}; |
466 | | - auto oddZeroesToTheRight = parallelSuffix(preOddZeroesToTheRight); |
467 | | - auto moveSelector1 = oddZeroesToTheRight & mask; |
468 | | - auto shiftRightMask = ~S::LeastSignificantBit; |
469 | | - auto move1 = moveSelector1 & movers; |
470 | | - auto result = (moveSelector1 ^ move1) | movers.shiftIntraLaneRight(1, shiftRightMask); |
471 | | - return result; |
472 | | -} |
473 | | -*/ |
474 | | - |
475 | 454 | } |
476 | 455 |
|
477 | 456 | #endif |
0 commit comments