Skip to content

Commit 2d2d9a8

Browse files
author
Eddie
committed
Cleaning
1 parent efeb812 commit 2d2d9a8

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

inc/zoo/swar/associative_iteration.h

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
#include "zoo/swar/SWAR.h"
55

6-
#define ZOO_DEVELOPMENT_DEBUGGING
6+
//#define ZOO_DEVELOPMENT_DEBUGGING
77
#ifdef ZOO_DEVELOPMENT_DEBUGGING
88
#include <iostream>
99

@@ -54,7 +54,7 @@ constexpr SWAR<NB, B> parallelSuffix(SWAR<NB, B> input) {
5454
auto
5555
bitsToXOR = NB,
5656
power = 1;
57-
#define ZTE(...) __VA_ARGS__
57+
#define ZTE(...) ZOO_TRACEABLE_EXPRESSION(__VA_ARGS__)
5858
for(;;) {
5959
ZTE(doubling);
6060
if(1 & bitsToXOR) {
@@ -183,7 +183,7 @@ compress(SWAR<NB, B> input, SWAR<NB, B> compressionMask) {
183183
// Because we want to detect the "oddness" of groups of zeroes to the right,
184184
// we flip the compression mask. To not count the bit position itself,
185185
// we shift by one.
186-
// #define ZTE ZOO_TRACEABLE_EXPRESSION
186+
#define ZTE(...) ZOO_TRACEABLE_EXPRESSION(__VA_ARGS__)
187187
ZTE(input);
188188
ZTE(compressionMask);
189189
using S = SWAR<NB, B>;
@@ -451,27 +451,6 @@ constexpr auto halvePrecision(SWAR<NB, T> even, SWAR<NB, T> odd) {
451451
return evenHalf | oddHalf;
452452
}
453453

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-
475454
}
476455

477456
#endif

0 commit comments

Comments
 (0)