@@ -376,18 +376,18 @@ inline double fneg(double value) noexcept
376
376
}
377
377
378
378
template <typename T>
379
- T fcopysign (T a, T b) noexcept = delete;
379
+ T copysign (T a, T b) noexcept = delete;
380
380
381
381
template <>
382
- inline float fcopysign (float a, float b) noexcept
382
+ inline float copysign (float a, float b) noexcept
383
383
{
384
384
const auto a_u = bit_cast<uint32_t >(a);
385
385
const auto b_u = bit_cast<uint32_t >(b);
386
386
return bit_cast<float >((a_u & F32AbsMask) | (b_u & F32SignMask));
387
387
}
388
388
389
389
template <>
390
- inline double fcopysign (double a, double b) noexcept
390
+ inline double copysign (double a, double b) noexcept
391
391
{
392
392
const auto a_u = bit_cast<uint64_t >(a);
393
393
const auto b_u = bit_cast<uint64_t >(b);
@@ -421,7 +421,7 @@ inline T ffloor(T value) noexcept
421
421
// the __builtin_floor() outputs -0 where it should +0.
422
422
// The following workarounds the issue by using the fact that the sign of
423
423
// the output must always match the sign of the input value.
424
- return fcopysign (result, value);
424
+ return copysign (result, value);
425
425
}
426
426
427
427
template <typename T>
@@ -452,7 +452,7 @@ T fnearest(T value) noexcept
452
452
// This implementation is based on adjusting the result produced by trunc() by +-1 when needed.
453
453
const auto t = std::trunc (value);
454
454
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);
456
456
else
457
457
return t;
458
458
}
@@ -1361,7 +1361,7 @@ ExecutionResult execute(
1361
1361
}
1362
1362
case Instr::f32_copysign:
1363
1363
{
1364
- binary_op (stack, fcopysign <float >);
1364
+ binary_op (stack, copysign <float >);
1365
1365
break ;
1366
1366
}
1367
1367
@@ -1433,7 +1433,7 @@ ExecutionResult execute(
1433
1433
}
1434
1434
case Instr::f64_copysign:
1435
1435
{
1436
- binary_op (stack, fcopysign <double >);
1436
+ binary_op (stack, copysign <double >);
1437
1437
break ;
1438
1438
}
1439
1439
0 commit comments