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.
This commit is contained in:
parent
6b9a40bdc4
commit
05b330906e
1 changed files with 3 additions and 3 deletions
|
@ -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<typename FPT>
|
||||
inline std::optional<FPT> ProcessNaNs(FPT a) {
|
||||
constexpr std::optional<FPT> ProcessNaNs(FPT a) {
|
||||
if (IsSNaN(a)) {
|
||||
return a | FPInfo<FPT>::mantissa_msb;
|
||||
} else if (IsQNaN(a)) {
|
||||
|
@ -65,7 +65,7 @@ inline std::optional<FPT> 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<typename FPT>
|
||||
inline std::optional<FPT> ProcessNaNs(FPT a, FPT b) {
|
||||
constexpr std::optional<FPT> ProcessNaNs(FPT a, FPT b) {
|
||||
if (IsSNaN(a)) {
|
||||
return a | FPInfo<FPT>::mantissa_msb;
|
||||
} else if (IsSNaN(b)) {
|
||||
|
@ -81,7 +81,7 @@ inline std::optional<FPT> 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<typename FPT>
|
||||
inline std::optional<FPT> ProcessNaNs(FPT a, FPT b, FPT c) {
|
||||
constexpr std::optional<FPT> ProcessNaNs(FPT a, FPT b, FPT c) {
|
||||
if (IsSNaN(a)) {
|
||||
return a | FPInfo<FPT>::mantissa_msb;
|
||||
} else if (IsSNaN(b)) {
|
||||
|
|
Loading…
Reference in a new issue