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/divti3.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/divti3.c')
| -rw-r--r-- | compiler-rt/lib/builtins/divti3.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/compiler-rt/lib/builtins/divti3.c b/compiler-rt/lib/builtins/divti3.c index 7c8f11668b5..59786fa6ebd 100644 --- a/compiler-rt/lib/builtins/divti3.c +++ b/compiler-rt/lib/builtins/divti3.c @@ -17,16 +17,15 @@ /* Returns: a / b */ -COMPILER_RT_ABI ti_int -__divti3(ti_int a, ti_int b) -{ - const int bits_in_tword_m1 = (int)(sizeof(ti_int) * CHAR_BIT) - 1; - ti_int s_a = a >> bits_in_tword_m1; /* s_a = a < 0 ? -1 : 0 */ - ti_int s_b = b >> bits_in_tword_m1; /* s_b = b < 0 ? -1 : 0 */ - a = (a ^ s_a) - s_a; /* negate if s_a == -1 */ - b = (b ^ s_b) - s_b; /* negate if s_b == -1 */ - s_a ^= s_b; /* sign of quotient */ - return (__udivmodti4(a, b, (tu_int*)0) ^ s_a) - s_a; /* negate if s_a == -1 */ +COMPILER_RT_ABI ti_int __divti3(ti_int a, ti_int b) { + const int bits_in_tword_m1 = (int)(sizeof(ti_int) * CHAR_BIT) - 1; + ti_int s_a = a >> bits_in_tword_m1; /* s_a = a < 0 ? -1 : 0 */ + ti_int s_b = b >> bits_in_tword_m1; /* s_b = b < 0 ? -1 : 0 */ + a = (a ^ s_a) - s_a; /* negate if s_a == -1 */ + b = (b ^ s_b) - s_b; /* negate if s_b == -1 */ + s_a ^= s_b; /* sign of quotient */ + return (__udivmodti4(a, b, (tu_int *)0) ^ s_a) - + s_a; /* negate if s_a == -1 */ } #endif /* CRT_HAS_128BIT */ |

