summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/clzdi2.c
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/builtins/clzdi2.c')
-rw-r--r--compiler-rt/lib/builtins/clzdi2.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/compiler-rt/lib/builtins/clzdi2.c b/compiler-rt/lib/builtins/clzdi2.c
index cc8c96fe421..0ad2abc09bc 100644
--- a/compiler-rt/lib/builtins/clzdi2.c
+++ b/compiler-rt/lib/builtins/clzdi2.c
@@ -16,8 +16,7 @@
/* Returns: the number of leading 0-bits */
#if !defined(__clang__) && \
- ((defined(__sparc__) && defined(__arch64__)) || \
- defined(__mips64) || \
+ ((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
@@ -28,12 +27,10 @@ extern si_int __clzsi2(si_int);
/* Precondition: a != 0 */
-COMPILER_RT_ABI si_int
-__clzdi2(di_int a)
-{
- dwords x;
- x.all = a;
- const si_int f = -(x.s.high == 0);
- return __builtin_clz((x.s.high & ~f) | (x.s.low & f)) +
- (f & ((si_int)(sizeof(si_int) * CHAR_BIT)));
+COMPILER_RT_ABI si_int __clzdi2(di_int a) {
+ dwords x;
+ x.all = a;
+ const si_int f = -(x.s.high == 0);
+ return __builtin_clz((x.s.high & ~f) | (x.s.low & f)) +
+ (f & ((si_int)(sizeof(si_int) * CHAR_BIT)));
}
OpenPOWER on IntegriCloud