Skip to content

Commit c6a93fe

Browse files
authored
[libc] Use __builtin_ffsll for RPC lane mask (llvm#85000)
src/__support/GPU/utils.h doesn't compile on a 32-bit platforms because __builtin_ffsl uses long which is a 32-bit number. Use __builtin_ffsll which uses long long which is guaranteed to be at least 64-bits.
1 parent 16ae493 commit c6a93fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libc/src/__support/GPU/utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace LIBC_NAMESPACE {
2323
namespace gpu {
2424
/// Get the first active thread inside the lane.
2525
LIBC_INLINE uint64_t get_first_lane_id(uint64_t lane_mask) {
26-
return __builtin_ffsl(lane_mask) - 1;
26+
return __builtin_ffsll(lane_mask) - 1;
2727
}
2828

2929
/// Conditional that is only true for a single thread in a lane.

0 commit comments

Comments
 (0)