From 6e179c66f0bc7225f7ae1d48643a625c782e68f4 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Sat, 28 May 2022 02:35:11 +0200 Subject: [PATCH] Ensure stricter templates for helpers in execution Covers floating point helpers: fabs, fneg, fcopysign --- lib/fizzy/execute.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/fizzy/execute.cpp b/lib/fizzy/execute.cpp index 1992d720d..246268081 100644 --- a/lib/fizzy/execute.cpp +++ b/lib/fizzy/execute.cpp @@ -335,13 +335,11 @@ inline constexpr T popcnt(T value) noexcept template T fabs(T value) noexcept = delete; -template <> inline float fabs(float value) noexcept { return bit_cast(bit_cast(value) & F32AbsMask); } -template <> inline double fabs(double value) noexcept { return bit_cast(bit_cast(value) & F64AbsMask); @@ -350,13 +348,11 @@ inline double fabs(double value) noexcept template T fneg(T value) noexcept = delete; -template <> inline float fneg(float value) noexcept { return bit_cast(bit_cast(value) ^ F32SignMask); } -template <> inline double fneg(double value) noexcept { return bit_cast(bit_cast(value) ^ F64SignMask); @@ -461,10 +457,9 @@ inline T fmax(T a, T b) noexcept return a < b ? b : a; } -template -T fcopysign(T a, T b) noexcept = delete; +template +T fcopysign(T a, U b) noexcept = delete; -template <> inline float fcopysign(float a, float b) noexcept { const auto a_u = bit_cast(a); @@ -472,7 +467,6 @@ inline float fcopysign(float a, float b) noexcept return bit_cast((a_u & F32AbsMask) | (b_u & F32SignMask)); } -template <> inline double fcopysign(double a, double b) noexcept { const auto a_u = bit_cast(a);