mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-29 00:32:29 +00:00
Revert whitespace fixes to third_party (#501)
This commit is contained in:
parent
d4000bb8f7
commit
9de3d8f1e6
365 changed files with 39190 additions and 39211 deletions
12
third_party/compiler_rt/floatsisf.c
vendored
12
third_party/compiler_rt/floatsisf.c
vendored
|
@ -23,24 +23,24 @@ STATIC_YOINK("huge_compiler_rt_license");
|
|||
|
||||
COMPILER_RT_ABI fp_t
|
||||
__floatsisf(int a) {
|
||||
|
||||
|
||||
const int aWidth = sizeof a * CHAR_BIT;
|
||||
|
||||
|
||||
// Handle zero as a special case to protect clz
|
||||
if (a == 0)
|
||||
return fromRep(0);
|
||||
|
||||
|
||||
// All other cases begin by extracting the sign and absolute value of a
|
||||
rep_t sign = 0;
|
||||
if (a < 0) {
|
||||
sign = signBit;
|
||||
a = -a;
|
||||
}
|
||||
|
||||
|
||||
// Exponent of (fp_t)a is the width of abs(a).
|
||||
const int exponent = (aWidth - 1) - __builtin_clz(a);
|
||||
rep_t result;
|
||||
|
||||
|
||||
// Shift a into the significand field, rounding if it is a right-shift
|
||||
if (exponent <= significandBits) {
|
||||
const int shift = significandBits - exponent;
|
||||
|
@ -52,7 +52,7 @@ __floatsisf(int a) {
|
|||
if (round > signBit) result++;
|
||||
if (round == signBit) result += result & 1;
|
||||
}
|
||||
|
||||
|
||||
// Insert the exponent
|
||||
result += (rep_t)(exponent + exponentBias) << significandBits;
|
||||
// Insert the sign bit and return
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue