Skip to content

Commit 8371c77

Browse files
committed
Reapply "Use compiler builtin for countl_zero"
This reverts commit 6d39182. Signed-off-by: Stefan Marr <git@stefan-marr.de>
1 parent 6d39182 commit 8371c77

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/primitives/Integer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
#include "Integer.h"
2828

29-
#include <bit> // NOLINT(misc-include-cleaner)
3029
#include <cassert>
3130
#include <cmath>
3231
#include <cstdint>
@@ -105,7 +104,7 @@ static vm_oop_t intLeftShift(vm_oop_t leftObj, vm_oop_t rightObj) {
105104
int64_t const right = SMALL_INT_VAL(rightObj);
106105

107106
// NOLINTNEXTLINE(misc-include-cleaner)
108-
auto const numberOfLeadingZeros = std::countl_zero((uint64_t)left);
107+
auto const numberOfLeadingZeros = __builtin_clzll((uint64_t)left);
109108

110109
if (64 - numberOfLeadingZeros + right > 63) {
111110
return Universe::NewBigInteger(InfInt(left) << right);

0 commit comments

Comments
 (0)