Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions compiler-rt/lib/builtins/clzdi2.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@

// Returns: the number of leading 0-bits

#if !defined(__clang__) && \
((defined(__sparc__) && defined(__arch64__)) || defined(__mips64) || \
#if ((defined(__sparc__) && defined(__arch64__)) || defined(__mips64) || \
(defined(__riscv) && __SIZEOF_POINTER__ >= 8))
// On 64-bit architectures with neither a native clz instruction nor a native
// ctz instruction, gcc resolves __builtin_clz to __clzdi2 rather than
// ctz instruction, resolves __builtin_clz resolves to __clzdi2 rather than
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// ctz instruction, resolves __builtin_clz resolves to __clzdi2 rather than
// ctz instruction, `__builtin_clz` resolves to `__clzdi2` rather than

// __clzsi2, leading to infinite recursion.
// This is because on those platforms, libgcc doesn't ship with __clzsi2.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// __clzsi2, leading to infinite recursion.
// This is because on those platforms, libgcc doesn't ship with __clzsi2.
// `__clzsi2` as libgcc does not ship with `__clzsi2`, leading to infinite recursion.

#define __builtin_clz(a) __clzsi2(a)
extern int __clzsi2(si_int);
#endif
Expand Down
Loading