From 05b330906e5645432ef895400798d3e1bcc3a0cf Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 4 May 2019 21:20:39 -0400 Subject: [PATCH] common/fp/util: Make ProcessNaN utility functions constexpr Nothing in particular prevents these from being constexpr. Do so to make them consistent with the bulk of other functions in this header that are constexpr. --- src/common/fp/util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/common/fp/util.h b/src/common/fp/util.h index 48ce5874..3d682c22 100644 --- a/src/common/fp/util.h +++ b/src/common/fp/util.h @@ -53,7 +53,7 @@ constexpr bool IsNaN(FPT value) { /// Given a single argument, return the NaN value which would be returned by an ARM processor. /// If the argument isn't a NaN, returns std::nullopt. template -inline std::optional ProcessNaNs(FPT a) { +constexpr std::optional ProcessNaNs(FPT a) { if (IsSNaN(a)) { return a | FPInfo::mantissa_msb; } else if (IsQNaN(a)) { @@ -65,7 +65,7 @@ inline std::optional ProcessNaNs(FPT a) { /// Given a pair of arguments, return the NaN value which would be returned by an ARM processor. /// If neither argument is a NaN, returns std::nullopt. template -inline std::optional ProcessNaNs(FPT a, FPT b) { +constexpr std::optional ProcessNaNs(FPT a, FPT b) { if (IsSNaN(a)) { return a | FPInfo::mantissa_msb; } else if (IsSNaN(b)) { @@ -81,7 +81,7 @@ inline std::optional ProcessNaNs(FPT a, FPT b) { /// Given three arguments, return the NaN value which would be returned by an ARM processor. /// If none of the arguments is a NaN, returns std::nullopt. template -inline std::optional ProcessNaNs(FPT a, FPT b, FPT c) { +constexpr std::optional ProcessNaNs(FPT a, FPT b, FPT c) { if (IsSNaN(a)) { return a | FPInfo::mantissa_msb; } else if (IsSNaN(b)) {