Skip to content

Commit c5ae9aa

Browse files
committed
Rename fcopysign to copysign
1 parent da3fa3c commit c5ae9aa

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: lib/fizzy/execute.cpp

+7-7
Original file line numberDiff line numberDiff line change
@@ -376,18 +376,18 @@ inline double fneg(double value) noexcept
376376
}
377377

378378
template <typename T>
379-
T fcopysign(T a, T b) noexcept = delete;
379+
T copysign(T a, T b) noexcept = delete;
380380

381381
template <>
382-
inline float fcopysign(float a, float b) noexcept
382+
inline float copysign(float a, float b) noexcept
383383
{
384384
const auto a_u = bit_cast<uint32_t>(a);
385385
const auto b_u = bit_cast<uint32_t>(b);
386386
return bit_cast<float>((a_u & F32AbsMask) | (b_u & F32SignMask));
387387
}
388388

389389
template <>
390-
inline double fcopysign(double a, double b) noexcept
390+
inline double copysign(double a, double b) noexcept
391391
{
392392
const auto a_u = bit_cast<uint64_t>(a);
393393
const auto b_u = bit_cast<uint64_t>(b);
@@ -421,7 +421,7 @@ inline T ffloor(T value) noexcept
421421
// the __builtin_floor() outputs -0 where it should +0.
422422
// The following workarounds the issue by using the fact that the sign of
423423
// the output must always match the sign of the input value.
424-
return fcopysign(result, value);
424+
return copysign(result, value);
425425
}
426426

427427
template <typename T>
@@ -452,7 +452,7 @@ T fnearest(T value) noexcept
452452
// This implementation is based on adjusting the result produced by trunc() by +-1 when needed.
453453
const auto t = std::trunc(value);
454454
if (const auto diff = fabs(value - t); diff > T{0.5} || (diff == T{0.5} && !is_even(t)))
455-
return t + fcopysign(T{1}, value);
455+
return t + copysign(T{1}, value);
456456
else
457457
return t;
458458
}
@@ -1361,7 +1361,7 @@ ExecutionResult execute(
13611361
}
13621362
case Instr::f32_copysign:
13631363
{
1364-
binary_op(stack, fcopysign<float>);
1364+
binary_op(stack, copysign<float>);
13651365
break;
13661366
}
13671367

@@ -1433,7 +1433,7 @@ ExecutionResult execute(
14331433
}
14341434
case Instr::f64_copysign:
14351435
{
1436-
binary_op(stack, fcopysign<double>);
1436+
binary_op(stack, copysign<double>);
14371437
break;
14381438
}
14391439

0 commit comments

Comments
 (0)