From 1c41605b53fcb670f03a095a2dcc748d25ac84f9 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Sat, 3 Aug 2024 10:01:12 -0700 Subject: [PATCH] Use std::countr_zero instead of __builtin_ctz Doesn't seem to affect codegen in these cases. --- ConflictSet.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ConflictSet.cpp b/ConflictSet.cpp index 555e65e..02216ce 100644 --- a/ConflictSet.cpp +++ b/ConflictSet.cpp @@ -2148,7 +2148,7 @@ bool checkMaxBetweenExclusiveImpl(Node *n, int begin, int end, if (!mask) { return true; } - auto *child = self->children[__builtin_ctz(mask)]; + auto *child = self->children[std::countr_zero(mask)]; const bool firstRangeOk = !child->entryPresent || child->entry.rangeVersion <= readVersion; uint32_t compared = 0; @@ -2183,7 +2183,7 @@ bool checkMaxBetweenExclusiveImpl(Node *n, int begin, int end, if (!mask) { return true; } - auto *child = self->children[__builtin_ctzll(mask) >> 2]; + auto *child = self->children[std::countr_zero(mask) >> 2]; const bool firstRangeOk = !child->entryPresent || child->entry.rangeVersion <= readVersion; @@ -2223,7 +2223,7 @@ bool checkMaxBetweenExclusiveImpl(Node *n, int begin, int end, if (!mask) { return true; } - auto *child = self->children[__builtin_ctz(mask)]; + auto *child = self->children[std::countr_zero(mask)]; const bool firstRangeOk = !child->entryPresent || child->entry.rangeVersion <= readVersion; @@ -2254,7 +2254,7 @@ bool checkMaxBetweenExclusiveImpl(Node *n, int begin, int end, if (!mask) { return true; } - auto *child = self->children[__builtin_ctz(mask)]; + auto *child = self->children[std::countr_zero(mask)]; const bool firstRangeOk = !child->entryPresent || child->entry.rangeVersion <= readVersion; uint32_t compared = 0;