Skip to content

Commit 71d4b4a

Browse files
committed
Use bit_cast_constexpr
1 parent c8ec8e4 commit 71d4b4a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/fizzy/execute.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -336,12 +336,12 @@ inline constexpr T popcnt(T value) noexcept
336336
template <typename T>
337337
T signbit(T value) noexcept = delete;
338338

339-
inline bool signbit(float value) noexcept
339+
inline bit_cast_constexpr bool signbit(float value) noexcept
340340
{
341341
return (bit_cast<uint32_t>(value) & F32SignMask) != 0;
342342
}
343343

344-
inline bool signbit(double value) noexcept
344+
inline bit_cast_constexpr bool signbit(double value) noexcept
345345
{
346346
return (bit_cast<uint64_t>(value) & F64SignMask) != 0;
347347
}
@@ -350,13 +350,13 @@ template <typename T>
350350
T fabs(T value) noexcept = delete;
351351

352352
template <>
353-
inline float fabs(float value) noexcept
353+
inline bit_cast_constexpr float fabs(float value) noexcept
354354
{
355355
return bit_cast<float>(bit_cast<uint32_t>(value) & F32AbsMask);
356356
}
357357

358358
template <>
359-
inline double fabs(double value) noexcept
359+
inline bit_cast_constexpr double fabs(double value) noexcept
360360
{
361361
return bit_cast<double>(bit_cast<uint64_t>(value) & F64AbsMask);
362362
}
@@ -365,13 +365,13 @@ template <typename T>
365365
T fneg(T value) noexcept = delete;
366366

367367
template <>
368-
inline float fneg(float value) noexcept
368+
inline bit_cast_constexpr float fneg(float value) noexcept
369369
{
370370
return bit_cast<float>(bit_cast<uint32_t>(value) ^ F32SignMask);
371371
}
372372

373373
template <>
374-
inline double fneg(double value) noexcept
374+
inline bit_cast_constexpr double fneg(double value) noexcept
375375
{
376376
return bit_cast<double>(bit_cast<uint64_t>(value) ^ F64SignMask);
377377
}
@@ -380,15 +380,15 @@ template <typename T>
380380
T copysign(T a, T b) noexcept = delete;
381381

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

390390
template <>
391-
inline double copysign(double a, double b) noexcept
391+
inline bit_cast_constexpr double copysign(double a, double b) noexcept
392392
{
393393
const auto a_u = bit_cast<uint64_t>(a);
394394
const auto b_u = bit_cast<uint64_t>(b);

0 commit comments

Comments
 (0)