diff options
author | Petr Hosek <phosek@google.com> | 2024-03-12 18:25:36 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-12 18:25:36 -0700 |
commit | c6a93fe80b3cf30ff82d06e959c1177798c858ae (patch) | |
tree | 60de4c92e930a7ff2d68b592c3e8917f328b5d8e | |
parent | 16ae493f56c1857ec0f6f2777e9b8a2e5151b4ef (diff) | |
download | llvm-c6a93fe80b3cf30ff82d06e959c1177798c858ae.zip llvm-c6a93fe80b3cf30ff82d06e959c1177798c858ae.tar.gz llvm-c6a93fe80b3cf30ff82d06e959c1177798c858ae.tar.bz2 |
[libc] Use __builtin_ffsll for RPC lane mask (#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.
-rw-r--r-- | libc/src/__support/GPU/utils.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/src/__support/GPU/utils.h b/libc/src/__support/GPU/utils.h index 93022e8..cb04a35 100644 --- a/libc/src/__support/GPU/utils.h +++ b/libc/src/__support/GPU/utils.h @@ -23,7 +23,7 @@ namespace LIBC_NAMESPACE { namespace gpu { /// Get the first active thread inside the lane. LIBC_INLINE uint64_t get_first_lane_id(uint64_t lane_mask) { - return __builtin_ffsl(lane_mask) - 1; + return __builtin_ffsll(lane_mask) - 1; } /// Conditional that is only true for a single thread in a lane. |