Skip to content

Commit 8c051a7

Browse files
committed
Address comments.
1 parent 420bcff commit 8c051a7

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

libc/src/__support/FPUtil/double_double.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ template <> struct DefaultSplit<float> {
2525
static constexpr size_t VALUE = 12;
2626
};
2727
template <> struct DefaultSplit<double> {
28-
static constexpr size_t VALUE = 27;
28+
static constexpr size_t VALUE = DEFAULT_DOUBLE_SPLIT;
2929
};
3030

3131
using DoubleDouble = NumberPair<double>;

libc/src/math/generic/atan2f_float.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ LLVM_LIBC_FUNCTION(float, atan2f, (float y, float x)) {
148148
bool recip = x_abs < y_abs;
149149
uint32_t min_abs = recip ? x_abs : y_abs;
150150
uint32_t max_abs = !recip ? x_abs : y_abs;
151-
unsigned min_exp = static_cast<unsigned>(min_abs >> FPBits::FRACTION_LEN);
152-
unsigned max_exp = static_cast<unsigned>(max_abs >> FPBits::FRACTION_LEN);
151+
auto min_exp = static_cast<unsigned>(min_abs >> FPBits::FRACTION_LEN);
152+
auto max_exp = static_cast<unsigned>(max_abs >> FPBits::FRACTION_LEN);
153153

154154
float num = FPBits(min_abs).get_val();
155155
float den = FPBits(max_abs).get_val();
@@ -205,10 +205,9 @@ LLVM_LIBC_FUNCTION(float, atan2f, (float y, float x)) {
205205
unsigned exp_diff = max_exp - min_exp;
206206
// We have the following bound for normalized n and d:
207207
// 2^(-exp_diff - 1) < n/d < 2^(-exp_diff + 1).
208-
if (LIBC_UNLIKELY(exp_diff > 25)) {
208+
if (LIBC_UNLIKELY(exp_diff > 25))
209209
return fputil::multiply_add(final_sign, const_term.hi,
210210
final_sign * (const_term.lo + num / den));
211-
}
212211

213212
float k = fputil::nearest_integer(16.0f * num / den);
214213
unsigned idx = static_cast<unsigned>(k);

libc/src/math/generic/pow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ LLVM_LIBC_FUNCTION(double, pow, (double x, double y)) {
400400
#else
401401
double c = FPBits(m_x.uintval() & 0x3fff'e000'0000'0000).get_val();
402402
dx = fputil::multiply_add(RD[idx_x], m_x.get_val() - c, CD[idx_x]); // Exact
403-
dx_c0 = fputil::exact_mult<28>(dx, COEFFS[0]); // Exact
403+
dx_c0 = fputil::exact_mult<double, 28>(dx, COEFFS[0]); // Exact
404404
#endif // LIBC_TARGET_CPU_HAS_FMA
405405

406406
double dx2 = dx * dx;

0 commit comments

Comments
 (0)