backend_x64: Fix FPVectorMulAdd and FPMulAdd NaN handling with denormals

Denormals should be treated as zero in NaN handler
This commit is contained in:
MerryMage 2018-07-31 16:07:46 +01:00
parent 381821eda3
commit 822fd4a875
4 changed files with 36 additions and 11 deletions

View file

@ -9,13 +9,17 @@
#include <boost/optional.hpp>
#include "common/common_types.h"
#include "common/fp/fpcr.h"
#include "common/fp/info.h"
namespace Dynarmic::FP {
/// Is floating point value a zero?
template<typename FPT>
constexpr bool IsZero(FPT value) {
inline bool IsZero(FPT value, FPCR fpcr) {
if (fpcr.FZ()) {
return (value & FPInfo<FPT>::exponent_mask) == 0;
}
return (value & ~FPInfo<FPT>::sign_mask) == 0;
}