diff options
| author | Petr Hosek <phosek@chromium.org> | 2019-04-28 21:53:32 +0000 |
|---|---|---|
| committer | Petr Hosek <phosek@chromium.org> | 2019-04-28 21:53:32 +0000 |
| commit | 082b89b25faae3e45a023caf51b65ca0f02f377f (patch) | |
| tree | 4f7f1b6b689478ec222262aaa1ac364fc7c00dc6 /compiler-rt/lib/builtins/clzdi2.c | |
| parent | 65f12f66f6f6ca400ab32f6ded79cd41e14010b3 (diff) | |
| download | bcm5719-llvm-082b89b25faae3e45a023caf51b65ca0f02f377f.tar.gz bcm5719-llvm-082b89b25faae3e45a023caf51b65ca0f02f377f.zip | |
[builtins] Reformat builtins with clang-format
Update formatting to use the LLVM style.
This is part of the cleanup proposed in "[RFC] compiler-rt builtins
cleanup and refactoring".
Differential Revision: https://reviews.llvm.org/D60351
llvm-svn: 359410
Diffstat (limited to 'compiler-rt/lib/builtins/clzdi2.c')
| -rw-r--r-- | compiler-rt/lib/builtins/clzdi2.c | 17 |
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))); } |

