summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/builtins/ppc
diff options
context:
space:
mode:
authorPetr Hosek <phosek@chromium.org>2019-04-28 22:47:49 +0000
committerPetr Hosek <phosek@chromium.org>2019-04-28 22:47:49 +0000
commit0ba22f51d128bee9d69756c56c4678097270e10b (patch)
tree75aa9d20dd483e2eb23ccdcf520e18754e86065c /compiler-rt/lib/builtins/ppc
parent082b89b25faae3e45a023caf51b65ca0f02f377f (diff)
downloadbcm5719-llvm-0ba22f51d128bee9d69756c56c4678097270e10b.tar.gz
bcm5719-llvm-0ba22f51d128bee9d69756c56c4678097270e10b.zip
[builtins] Use single line C++/C99 comment style
Use the uniform single line C++/99 style for code comments. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60352 llvm-svn: 359411
Diffstat (limited to 'compiler-rt/lib/builtins/ppc')
-rw-r--r--compiler-rt/lib/builtins/ppc/DD.h2
-rw-r--r--compiler-rt/lib/builtins/ppc/divtc3.c9
-rw-r--r--compiler-rt/lib/builtins/ppc/fixtfdi.c56
-rw-r--r--compiler-rt/lib/builtins/ppc/fixunstfdi.c34
-rw-r--r--compiler-rt/lib/builtins/ppc/fixunstfti.c74
-rw-r--r--compiler-rt/lib/builtins/ppc/floatditf.c25
-rw-r--r--compiler-rt/lib/builtins/ppc/floattitf.c39
-rw-r--r--compiler-rt/lib/builtins/ppc/floatunditf.c29
-rw-r--r--compiler-rt/lib/builtins/ppc/gcc_qadd.c24
-rw-r--r--compiler-rt/lib/builtins/ppc/gcc_qdiv.c16
-rw-r--r--compiler-rt/lib/builtins/ppc/gcc_qmul.c18
-rw-r--r--compiler-rt/lib/builtins/ppc/gcc_qsub.c24
-rw-r--r--compiler-rt/lib/builtins/ppc/multc3.c7
13 files changed, 165 insertions, 192 deletions
diff --git a/compiler-rt/lib/builtins/ppc/DD.h b/compiler-rt/lib/builtins/ppc/DD.h
index 542f7e7815b..8f31a962fc7 100644
--- a/compiler-rt/lib/builtins/ppc/DD.h
+++ b/compiler-rt/lib/builtins/ppc/DD.h
@@ -42,4 +42,4 @@ long double __gcc_qsub(long double, long double);
long double __gcc_qmul(long double, long double);
long double __gcc_qdiv(long double, long double);
-#endif /* COMPILERRT_DD_HEADER */
+#endif // COMPILERRT_DD_HEADER
diff --git a/compiler-rt/lib/builtins/ppc/divtc3.c b/compiler-rt/lib/builtins/ppc/divtc3.c
index bce54e187f7..afaccf5a8fd 100644
--- a/compiler-rt/lib/builtins/ppc/divtc3.c
+++ b/compiler-rt/lib/builtins/ppc/divtc3.c
@@ -1,7 +1,6 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "../int_math.h"
#include "DD.h"
@@ -13,7 +12,7 @@
#if !defined(CRT_INFINITY) && defined(HUGE_VAL)
#define CRT_INFINITY HUGE_VAL
-#endif /* CRT_INFINITY */
+#endif // CRT_INFINITY
#define makeFinite(x) \
{ \
diff --git a/compiler-rt/lib/builtins/ppc/fixtfdi.c b/compiler-rt/lib/builtins/ppc/fixtfdi.c
index d33194a68f2..a97aaf09584 100644
--- a/compiler-rt/lib/builtins/ppc/fixtfdi.c
+++ b/compiler-rt/lib/builtins/ppc/fixtfdi.c
@@ -1,11 +1,9 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-/* int64_t __fixunstfdi(long double x);
- * This file implements the PowerPC 128-bit double-double -> int64_t conversion
- */
+// int64_t __fixunstfdi(long double x);
+// This file implements the PowerPC 128-bit double-double -> int64_t conversion
#include "../int_math.h"
#include "DD.h"
@@ -18,37 +16,35 @@ uint64_t __fixtfdi(long double input) {
(uint32_t)(hibits.x >> 32) & UINT32_C(0x7fffffff);
const uint32_t absHighWordMinusOne = absHighWord - UINT32_C(0x3ff00000);
- /* If (1.0 - tiny) <= input < 0x1.0p63: */
+ // If (1.0 - tiny) <= input < 0x1.0p63:
if (UINT32_C(0x03f00000) > absHighWordMinusOne) {
- /* Do an unsigned conversion of the absolute value, then restore the sign.
- */
+ // Do an unsigned conversion of the absolute value, then restore the sign.
const int unbiasedHeadExponent = absHighWordMinusOne >> 20;
- int64_t result = hibits.x & INT64_C(0x000fffffffffffff); /* mantissa(hi) */
- result |= INT64_C(0x0010000000000000); /* matissa(hi) with implicit bit */
- result <<= 10; /* mantissa(hi) with one zero preceding bit. */
+ int64_t result = hibits.x & INT64_C(0x000fffffffffffff); // mantissa(hi)
+ result |= INT64_C(0x0010000000000000); // matissa(hi) with implicit bit
+ result <<= 10; // mantissa(hi) with one zero preceding bit.
const int64_t hiNegationMask = ((int64_t)(hibits.x)) >> 63;
- /* If the tail is non-zero, we need to patch in the tail bits. */
+ // If the tail is non-zero, we need to patch in the tail bits.
if (0.0 != x.s.lo) {
const doublebits lobits = {.d = x.s.lo};
int64_t tailMantissa = lobits.x & INT64_C(0x000fffffffffffff);
tailMantissa |= INT64_C(0x0010000000000000);
- /* At this point we have the mantissa of |tail| */
- /* We need to negate it if head and tail have different signs. */
+ // At this point we have the mantissa of |tail|
+ // We need to negate it if head and tail have different signs.
const int64_t loNegationMask = ((int64_t)(lobits.x)) >> 63;
const int64_t negationMask = loNegationMask ^ hiNegationMask;
tailMantissa = (tailMantissa ^ negationMask) - negationMask;
- /* Now we have the mantissa of tail as a signed 2s-complement integer */
+ // Now we have the mantissa of tail as a signed 2s-complement integer
const int biasedTailExponent = (int)(lobits.x >> 52) & 0x7ff;
- /* Shift the tail mantissa into the right position, accounting for the
- * bias of 10 that we shifted the head mantissa by.
- */
+ // Shift the tail mantissa into the right position, accounting for the
+ // bias of 10 that we shifted the head mantissa by.
tailMantissa >>=
(unbiasedHeadExponent - (biasedTailExponent - (1023 - 10)));
@@ -57,36 +53,34 @@ uint64_t __fixtfdi(long double input) {
result >>= (62 - unbiasedHeadExponent);
- /* Restore the sign of the result and return */
+ // Restore the sign of the result and return
result = (result ^ hiNegationMask) - hiNegationMask;
return result;
}
- /* Edge cases handled here: */
+ // Edge cases handled here:
- /* |x| < 1, result is zero. */
+ // |x| < 1, result is zero.
if (1.0 > crt_fabs(x.s.hi))
return INT64_C(0);
- /* x very close to INT64_MIN, care must be taken to see which side we are on.
- */
+ // x very close to INT64_MIN, care must be taken to see which side we are on.
if (x.s.hi == -0x1.0p63) {
int64_t result = INT64_MIN;
if (0.0 < x.s.lo) {
- /* If the tail is positive, the correct result is something other than
- * INT64_MIN. we'll need to figure out what it is.
- */
+ // If the tail is positive, the correct result is something other than
+ // INT64_MIN. we'll need to figure out what it is.
const doublebits lobits = {.d = x.s.lo};
int64_t tailMantissa = lobits.x & INT64_C(0x000fffffffffffff);
tailMantissa |= INT64_C(0x0010000000000000);
- /* Now we negate the tailMantissa */
+ // Now we negate the tailMantissa
tailMantissa = (tailMantissa ^ INT64_C(-1)) + INT64_C(1);
- /* And shift it by the appropriate amount */
+ // And shift it by the appropriate amount
const int biasedTailExponent = (int)(lobits.x >> 52) & 0x7ff;
tailMantissa >>= 1075 - biasedTailExponent;
@@ -96,7 +90,7 @@ uint64_t __fixtfdi(long double input) {
return result;
}
- /* Signed overflows, infinities, and NaNs */
+ // Signed overflows, infinities, and NaNs
if (x.s.hi > 0.0)
return INT64_MAX;
else
diff --git a/compiler-rt/lib/builtins/ppc/fixunstfdi.c b/compiler-rt/lib/builtins/ppc/fixunstfdi.c
index 11b97766213..8d53f372527 100644
--- a/compiler-rt/lib/builtins/ppc/fixunstfdi.c
+++ b/compiler-rt/lib/builtins/ppc/fixunstfdi.c
@@ -1,11 +1,9 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-/* uint64_t __fixunstfdi(long double x); */
-/* This file implements the PowerPC 128-bit double-double -> uint64_t conversion
- */
+// uint64_t __fixunstfdi(long double x);
+// This file implements the PowerPC 128-bit double-double -> uint64_t conversion
#include "DD.h"
@@ -16,33 +14,31 @@ uint64_t __fixunstfdi(long double input) {
const uint32_t highWordMinusOne =
(uint32_t)(hibits.x >> 32) - UINT32_C(0x3ff00000);
- /* If (1.0 - tiny) <= input < 0x1.0p64: */
+ // If (1.0 - tiny) <= input < 0x1.0p64:
if (UINT32_C(0x04000000) > highWordMinusOne) {
const int unbiasedHeadExponent = highWordMinusOne >> 20;
- uint64_t result =
- hibits.x & UINT64_C(0x000fffffffffffff); /* mantissa(hi) */
- result |= UINT64_C(0x0010000000000000); /* matissa(hi) with implicit bit */
- result <<= 11; /* mantissa(hi) left aligned in the int64 field. */
+ uint64_t result = hibits.x & UINT64_C(0x000fffffffffffff); // mantissa(hi)
+ result |= UINT64_C(0x0010000000000000); // matissa(hi) with implicit bit
+ result <<= 11; // mantissa(hi) left aligned in the int64 field.
- /* If the tail is non-zero, we need to patch in the tail bits. */
+ // If the tail is non-zero, we need to patch in the tail bits.
if (0.0 != x.s.lo) {
const doublebits lobits = {.d = x.s.lo};
int64_t tailMantissa = lobits.x & INT64_C(0x000fffffffffffff);
tailMantissa |= INT64_C(0x0010000000000000);
- /* At this point we have the mantissa of |tail| */
+ // At this point we have the mantissa of |tail|
const int64_t negationMask = ((int64_t)(lobits.x)) >> 63;
tailMantissa = (tailMantissa ^ negationMask) - negationMask;
- /* Now we have the mantissa of tail as a signed 2s-complement integer */
+ // Now we have the mantissa of tail as a signed 2s-complement integer
const int biasedTailExponent = (int)(lobits.x >> 52) & 0x7ff;
- /* Shift the tail mantissa into the right position, accounting for the
- * bias of 11 that we shifted the head mantissa by.
- */
+ // Shift the tail mantissa into the right position, accounting for the
+ // bias of 11 that we shifted the head mantissa by.
tailMantissa >>=
(unbiasedHeadExponent - (biasedTailExponent - (1023 - 11)));
@@ -53,7 +49,7 @@ uint64_t __fixunstfdi(long double input) {
return result;
}
- /* Edge cases are handled here, with saturation. */
+ // Edge cases are handled here, with saturation.
if (1.0 > x.s.hi)
return UINT64_C(0);
else
diff --git a/compiler-rt/lib/builtins/ppc/fixunstfti.c b/compiler-rt/lib/builtins/ppc/fixunstfti.c
index a6199232712..1d19e01e3a9 100644
--- a/compiler-rt/lib/builtins/ppc/fixunstfti.c
+++ b/compiler-rt/lib/builtins/ppc/fixunstfti.c
@@ -14,10 +14,10 @@
#include "../int_math.h"
#define BIAS 1023
-/* Convert long double into an unsigned 128-bit integer. */
+// Convert long double into an unsigned 128-bit integer.
__uint128_t __fixunstfti(long double input) {
- /* If we are trying to convert a NaN, return the NaN bit pattern. */
+ // If we are trying to convert a NaN, return the NaN bit pattern.
if (crt_isnan(input)) {
return ((__uint128_t)0x7FF8000000000000ll) << 64 |
(__uint128_t)0x0000000000000000ll;
@@ -25,59 +25,59 @@ __uint128_t __fixunstfti(long double input) {
__uint128_t result, hiResult, loResult;
int hiExponent, loExponent, shift;
- /* The long double representation, with the high and low portions of
- * the long double, and the corresponding bit patterns of each double. */
+ // The long double representation, with the high and low portions of
+ // the long double, and the corresponding bit patterns of each double.
union {
long double ld;
- double d[2]; /* [0] is the high double, [1] is the low double. */
- unsigned long long ull[2]; /* High and low doubles as 64-bit integers. */
+ double d[2]; // [0] is the high double, [1] is the low double.
+ unsigned long long ull[2]; // High and low doubles as 64-bit integers.
} ldUnion;
- /* If the long double is less than 1.0 or negative,
- * return 0.0. */
+ // If the long double is less than 1.0 or negative,
+ // return 0.0.
if (input < 1.0)
return 0.0;
- /* Retrieve the 64-bit patterns of high and low doubles.
- * Compute the unbiased exponent of both high and low doubles by
- * removing the signs, isolating the exponent, and subtracting
- * the bias from it. */
+ // Retrieve the 64-bit patterns of high and low doubles.
+ // Compute the unbiased exponent of both high and low doubles by
+ // removing the signs, isolating the exponent, and subtracting
+ // the bias from it.
ldUnion.ld = input;
hiExponent = ((ldUnion.ull[0] & 0x7FFFFFFFFFFFFFFFll) >> 52) - BIAS;
loExponent = ((ldUnion.ull[1] & 0x7FFFFFFFFFFFFFFFll) >> 52) - BIAS;
- /* Convert each double into int64; they will be added to the int128 result.
- * CASE 1: High or low double fits in int64
- * - Convert the each double normally into int64.
- *
- * CASE 2: High or low double does not fit in int64
- * - Scale the double to fit within a 64-bit integer
- * - Calculate the shift (amount to scale the double by in the int128)
- * - Clear all the bits of the exponent (with 0x800FFFFFFFFFFFFF)
- * - Add BIAS+53 (0x4350000000000000) to exponent to correct the value
- * - Scale (move) the double to the correct place in the int128
- * (Move it by 2^53 places)
- *
- * Note: If the high double is assumed to be positive, an unsigned conversion
- * from long double to 64-bit integer is needed. The low double can be either
- * positive or negative, so a signed conversion is needed to retain the result
- * of the low double and to ensure it does not simply get converted to 0. */
+ // Convert each double into int64; they will be added to the int128 result.
+ // CASE 1: High or low double fits in int64
+ // - Convert the each double normally into int64.
+ //
+ // CASE 2: High or low double does not fit in int64
+ // - Scale the double to fit within a 64-bit integer
+ // - Calculate the shift (amount to scale the double by in the int128)
+ // - Clear all the bits of the exponent (with 0x800FFFFFFFFFFFFF)
+ // - Add BIAS+53 (0x4350000000000000) to exponent to correct the value
+ // - Scale (move) the double to the correct place in the int128
+ // (Move it by 2^53 places)
+ //
+ // Note: If the high double is assumed to be positive, an unsigned conversion
+ // from long double to 64-bit integer is needed. The low double can be either
+ // positive or negative, so a signed conversion is needed to retain the result
+ // of the low double and to ensure it does not simply get converted to 0.
- /* CASE 1 - High double fits in int64. */
+ // CASE 1 - High double fits in int64.
if (hiExponent < 63) {
hiResult = (unsigned long long)ldUnion.d[0];
} else if (hiExponent < 128) {
- /* CASE 2 - High double does not fit in int64, scale and convert it. */
+ // CASE 2 - High double does not fit in int64, scale and convert it.
shift = hiExponent - 54;
ldUnion.ull[0] &= 0x800FFFFFFFFFFFFFll;
ldUnion.ull[0] |= 0x4350000000000000ll;
hiResult = (unsigned long long)ldUnion.d[0];
hiResult <<= shift;
} else {
- /* Detect cases for overflow. When the exponent of the high
- * double is greater than 128 bits and when the long double
- * input is positive, return the max 128-bit integer.
- * For negative inputs with exponents > 128, return 1, like gcc. */
+ // Detect cases for overflow. When the exponent of the high
+ // double is greater than 128 bits and when the long double
+ // input is positive, return the max 128-bit integer.
+ // For negative inputs with exponents > 128, return 1, like gcc.
if (ldUnion.d[0] > 0) {
return ((__uint128_t)0xFFFFFFFFFFFFFFFFll) << 64 |
(__uint128_t)0xFFFFFFFFFFFFFFFFll;
@@ -87,11 +87,11 @@ __uint128_t __fixunstfti(long double input) {
}
}
- /* CASE 1 - Low double fits in int64. */
+ // CASE 1 - Low double fits in int64.
if (loExponent < 63) {
loResult = (long long)ldUnion.d[1];
} else {
- /* CASE 2 - Low double does not fit in int64, scale and convert it. */
+ // CASE 2 - Low double does not fit in int64, scale and convert it.
shift = loExponent - 54;
ldUnion.ull[1] &= 0x800FFFFFFFFFFFFFll;
ldUnion.ull[1] |= 0x4350000000000000ll;
@@ -99,7 +99,7 @@ __uint128_t __fixunstfti(long double input) {
loResult <<= shift;
}
- /* Add the high and low doublewords together to form a 128 bit integer. */
+ // Add the high and low doublewords together to form a 128 bit integer.
result = loResult + hiResult;
return result;
}
diff --git a/compiler-rt/lib/builtins/ppc/floatditf.c b/compiler-rt/lib/builtins/ppc/floatditf.c
index a5a4df4e097..4c365418f08 100644
--- a/compiler-rt/lib/builtins/ppc/floatditf.c
+++ b/compiler-rt/lib/builtins/ppc/floatditf.c
@@ -1,10 +1,9 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-/* long double __floatditf(long long x); */
-/* This file implements the PowerPC long long -> long double conversion */
+// long double __floatditf(long long x);
+// This file implements the PowerPC long long -> long double conversion
#include "DD.h"
@@ -14,18 +13,16 @@ long double __floatditf(int64_t a) {
static const double twop52 = 0x1.0p52;
doublebits low = {.d = twop52};
- low.x |= a & UINT64_C(0x00000000ffffffff); /* 0x1.0p52 + low 32 bits of a. */
+ low.x |= a & UINT64_C(0x00000000ffffffff); // 0x1.0p52 + low 32 bits of a.
const double high_addend = (double)((int32_t)(a >> 32)) * twop32 - twop52;
- /* At this point, we have two double precision numbers
- * high_addend and low.d, and we wish to return their sum
- * as a canonicalized long double:
- */
+ // At this point, we have two double precision numbers
+ // high_addend and low.d, and we wish to return their sum
+ // as a canonicalized long double:
- /* This implementation sets the inexact flag spuriously.
- * This could be avoided, but at some substantial cost.
- */
+ // This implementation sets the inexact flag spuriously.
+ // This could be avoided, but at some substantial cost.
DD result;
diff --git a/compiler-rt/lib/builtins/ppc/floattitf.c b/compiler-rt/lib/builtins/ppc/floattitf.c
index b722ac97828..6deac649812 100644
--- a/compiler-rt/lib/builtins/ppc/floattitf.c
+++ b/compiler-rt/lib/builtins/ppc/floattitf.c
@@ -13,35 +13,34 @@
#include <stdint.h>
-/* Conversions from signed and unsigned 64-bit int to long double. */
+// Conversions from signed and unsigned 64-bit int to long double.
long double __floatditf(int64_t);
long double __floatunditf(uint64_t);
-/* Convert a signed 128-bit integer to long double.
- * This uses the following property: Let hi and lo be 64-bits each,
- * and let signed_val_k() and unsigned_val_k() be the value of the
- * argument interpreted as a signed or unsigned k-bit integer. Then,
- *
- * signed_val_128(hi,lo) = signed_val_64(hi) * 2^64 + unsigned_val_64(lo)
- * = (long double)hi * 2^64 + (long double)lo,
- *
- * where (long double)hi and (long double)lo are signed and
- * unsigned 64-bit integer to long double conversions, respectively.
- */
+// Convert a signed 128-bit integer to long double.
+// This uses the following property: Let hi and lo be 64-bits each,
+// and let signed_val_k() and unsigned_val_k() be the value of the
+// argument interpreted as a signed or unsigned k-bit integer. Then,
+//
+// signed_val_128(hi,lo) = signed_val_64(hi) * 2^64 + unsigned_val_64(lo)
+// = (long double)hi * 2^64 + (long double)lo,
+//
+// where (long double)hi and (long double)lo are signed and
+// unsigned 64-bit integer to long double conversions, respectively.
long double __floattitf(__int128_t arg) {
- /* Split the int128 argument into 64-bit high and low int64 parts. */
+ // Split the int128 argument into 64-bit high and low int64 parts.
int64_t ArgHiPart = (int64_t)(arg >> 64);
uint64_t ArgLoPart = (uint64_t)arg;
- /* Convert each 64-bit part into long double. The high part
- * must be a signed conversion and the low part an unsigned conversion
- * to ensure the correct result. */
+ // Convert each 64-bit part into long double. The high part
+ // must be a signed conversion and the low part an unsigned conversion
+ // to ensure the correct result.
long double ConvertedHiPart = __floatditf(ArgHiPart);
long double ConvertedLoPart = __floatunditf(ArgLoPart);
- /* The low bit of ArgHiPart corresponds to the 2^64 bit in arg.
- * Multiply the high part by 2^64 to undo the right shift by 64-bits
- * done in the splitting. Then, add to the low part to obtain the
- * final result. */
+ // The low bit of ArgHiPart corresponds to the 2^64 bit in arg.
+ // Multiply the high part by 2^64 to undo the right shift by 64-bits
+ // done in the splitting. Then, add to the low part to obtain the
+ // final result.
return ((ConvertedHiPart * 0x1.0p64) + ConvertedLoPart);
}
diff --git a/compiler-rt/lib/builtins/ppc/floatunditf.c b/compiler-rt/lib/builtins/ppc/floatunditf.c
index d2d01d29dc3..fb4cd3f91d8 100644
--- a/compiler-rt/lib/builtins/ppc/floatunditf.c
+++ b/compiler-rt/lib/builtins/ppc/floatunditf.c
@@ -1,17 +1,15 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-/* long double __floatunditf(unsigned long long x); */
-/* This file implements the PowerPC unsigned long long -> long double conversion
- */
+// long double __floatunditf(unsigned long long x);
+// This file implements the PowerPC unsigned long long -> long double conversion
#include "DD.h"
long double __floatunditf(uint64_t a) {
- /* Begins with an exact copy of the code from __floatundidf */
+ // Begins with an exact copy of the code from __floatundidf
static const double twop52 = 0x1.0p52;
static const double twop84 = 0x1.0p84;
@@ -20,18 +18,17 @@ long double __floatunditf(uint64_t a) {
doublebits high = {.d = twop84};
doublebits low = {.d = twop52};
- high.x |= a >> 32; /* 0x1.0p84 + high 32 bits of a */
- low.x |= a & UINT64_C(0x00000000ffffffff); /* 0x1.0p52 + low 32 bits of a */
+ high.x |= a >> 32; // 0x1.0p84 + high 32 bits of a
+ low.x |= a & UINT64_C(0x00000000ffffffff); // 0x1.0p52 + low 32 bits of a
const double high_addend = high.d - twop84_plus_twop52;
- /* At this point, we have two double precision numbers
- * high_addend and low.d, and we wish to return their sum
- * as a canonicalized long double:
- */
+ // At this point, we have two double precision numbers
+ // high_addend and low.d, and we wish to return their sum
+ // as a canonicalized long double:
- /* This implementation sets the inexact flag spuriously. */
- /* This could be avoided, but at some substantial cost. */
+ // This implementation sets the inexact flag spuriously.
+ // This could be avoided, but at some substantial cost.
DD result;
diff --git a/compiler-rt/lib/builtins/ppc/gcc_qadd.c b/compiler-rt/lib/builtins/ppc/gcc_qadd.c
index e56962e4e45..6e1e63cb530 100644
--- a/compiler-rt/lib/builtins/ppc/gcc_qadd.c
+++ b/compiler-rt/lib/builtins/ppc/gcc_qadd.c
@@ -1,12 +1,10 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-/* long double __gcc_qadd(long double x, long double y);
- * This file implements the PowerPC 128-bit double-double add operation.
- * This implementation is shamelessly cribbed from Apple's DDRT, circa 1993(!)
- */
+// long double __gcc_qadd(long double x, long double y);
+// This file implements the PowerPC 128-bit double-double add operation.
+// This implementation is shamelessly cribbed from Apple's DDRT, circa 1993(!)
#include "DD.h"
@@ -17,14 +15,14 @@ long double __gcc_qadd(long double x, long double y) {
register double A = dst.s.hi, a = dst.s.lo, B = src.s.hi, b = src.s.lo;
- /* If both operands are zero: */
+ // If both operands are zero:
if ((A == 0.0) && (B == 0.0)) {
dst.s.hi = A + B;
dst.s.lo = 0.0;
return dst.ld;
}
- /* If either operand is NaN or infinity: */
+ // If either operand is NaN or infinity:
const doublebits abits = {.d = A};
const doublebits bbits = {.d = B};
if ((((uint32_t)(abits.x >> 32) & infinityHi) == infinityHi) ||
@@ -34,9 +32,9 @@ long double __gcc_qadd(long double x, long double y) {
return dst.ld;
}
- /* If the computation overflows: */
- /* This may be playing things a little bit fast and loose, but it will do for
- * a start. */
+ // If the computation overflows:
+ // This may be playing things a little bit fast and loose, but it will do for
+ // a start.
const double testForOverflow = A + (B + (a + b));
const doublebits testbits = {.d = testForOverflow};
if (((uint32_t)(testbits.x >> 32) & infinityHi) == infinityHi) {
diff --git a/compiler-rt/lib/builtins/ppc/gcc_qdiv.c b/compiler-rt/lib/builtins/ppc/gcc_qdiv.c
index bbb536833e5..35a3cbc3d3f 100644
--- a/compiler-rt/lib/builtins/ppc/gcc_qdiv.c
+++ b/compiler-rt/lib/builtins/ppc/gcc_qdiv.c
@@ -1,12 +1,10 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-/* long double __gcc_qdiv(long double x, long double y);
- * This file implements the PowerPC 128-bit double-double division operation.
- * This implementation is shamelessly cribbed from Apple's DDRT, circa 1993(!)
- */
+// long double __gcc_qdiv(long double x, long double y);
+// This file implements the PowerPC 128-bit double-double division operation.
+// This implementation is shamelessly cribbed from Apple's DDRT, circa 1993(!)
#include "DD.h"
@@ -21,7 +19,7 @@ long double __gcc_qdiv(long double a, long double b) {
q = x / y;
- /* Detect special cases */
+ // Detect special cases
if (q == 0.0) {
dst.s.hi = q;
dst.s.lo = 0.0;
diff --git a/compiler-rt/lib/builtins/ppc/gcc_qmul.c b/compiler-rt/lib/builtins/ppc/gcc_qmul.c
index efd12d8477f..75f519aad6f 100644
--- a/compiler-rt/lib/builtins/ppc/gcc_qmul.c
+++ b/compiler-rt/lib/builtins/ppc/gcc_qmul.c
@@ -1,12 +1,10 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-/* long double __gcc_qmul(long double x, long double y);
- * This file implements the PowerPC 128-bit double-double multiply operation.
- * This implementation is shamelessly cribbed from Apple's DDRT, circa 1993(!)
- */
+// long double __gcc_qmul(long double x, long double y);
+// This file implements the PowerPC 128-bit double-double multiply operation.
+// This implementation is shamelessly cribbed from Apple's DDRT, circa 1993(!)
#include "DD.h"
@@ -21,7 +19,7 @@ long double __gcc_qmul(long double x, long double y) {
ab = A * B;
- /* Detect special cases */
+ // Detect special cases
if (ab == 0.0) {
dst.s.hi = ab;
dst.s.lo = 0.0;
@@ -35,7 +33,7 @@ long double __gcc_qmul(long double x, long double y) {
return dst.ld;
}
- /* Generic cases handled here. */
+ // Generic cases handled here.
aHi = high26bits(A);
bHi = high26bits(B);
aLo = A - aHi;
diff --git a/compiler-rt/lib/builtins/ppc/gcc_qsub.c b/compiler-rt/lib/builtins/ppc/gcc_qsub.c
index 98d20747bf5..ac08120be0b 100644
--- a/compiler-rt/lib/builtins/ppc/gcc_qsub.c
+++ b/compiler-rt/lib/builtins/ppc/gcc_qsub.c
@@ -1,12 +1,10 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-/* long double __gcc_qsub(long double x, long double y);
- * This file implements the PowerPC 128-bit double-double add operation.
- * This implementation is shamelessly cribbed from Apple's DDRT, circa 1993(!)
- */
+// long double __gcc_qsub(long double x, long double y);
+// This file implements the PowerPC 128-bit double-double add operation.
+// This implementation is shamelessly cribbed from Apple's DDRT, circa 1993(!)
#include "DD.h"
@@ -17,14 +15,14 @@ long double __gcc_qsub(long double x, long double y) {
register double A = dst.s.hi, a = dst.s.lo, B = -src.s.hi, b = -src.s.lo;
- /* If both operands are zero: */
+ // If both operands are zero:
if ((A == 0.0) && (B == 0.0)) {
dst.s.hi = A + B;
dst.s.lo = 0.0;
return dst.ld;
}
- /* If either operand is NaN or infinity: */
+ // If either operand is NaN or infinity:
const doublebits abits = {.d = A};
const doublebits bbits = {.d = B};
if ((((uint32_t)(abits.x >> 32) & infinityHi) == infinityHi) ||
@@ -34,9 +32,9 @@ long double __gcc_qsub(long double x, long double y) {
return dst.ld;
}
- /* If the computation overflows: */
- /* This may be playing things a little bit fast and loose, but it will do for
- * a start. */
+ // If the computation overflows:
+ // This may be playing things a little bit fast and loose, but it will do for
+ // a start.
const double testForOverflow = A + (B + (a + b));
const doublebits testbits = {.d = testForOverflow};
if (((uint32_t)(testbits.x >> 32) & infinityHi) == infinityHi) {
diff --git a/compiler-rt/lib/builtins/ppc/multc3.c b/compiler-rt/lib/builtins/ppc/multc3.c
index 40b0d60e6ad..f1fd6816d6c 100644
--- a/compiler-rt/lib/builtins/ppc/multc3.c
+++ b/compiler-rt/lib/builtins/ppc/multc3.c
@@ -1,7 +1,6 @@
-/* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
- * See https://llvm.org/LICENSE.txt for license information.
- * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- */
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#include "../int_math.h"
#include "DD.h"
OpenPOWER on IntegriCloud