emit_x64_floating_point: Fixup special NaN case in FMA FPMulAdd implementation

This commit is contained in:
MerryMage 2018-07-23 21:10:27 +01:00
parent 070637e0f6
commit 66bb05fc0a
2 changed files with 42 additions and 14 deletions

View file

@ -11,6 +11,16 @@
namespace Dynarmic::FP {
/// Is 32-bit floating point value a zero?
constexpr bool IsZero(u32 value) {
return (value & 0x7fffffff) == 0;
}
/// Is 32-bit floating point value an infinity?
constexpr bool IsInf(u32 value) {
return (value & 0x7fffffff) == 0x7f800000;
}
/// Is 32-bit floating point value a QNaN?
constexpr bool IsQNaN(u32 value) {
return (value & 0x7fc00000) == 0x7fc00000;
@ -60,6 +70,16 @@ inline boost::optional<u32> ProcessNaNs(u32 a, u32 b, u32 c) {
return boost::none;
}
/// Is 64-bit floating point value a zero?
constexpr bool IsZero(u64 value) {
return (value & 0x7FFF'FFFF'FFFF'FFFF) == 0;
}
/// Is 64-bit floating point value an infinity?
constexpr bool IsInf(u64 value) {
return (value & 0x7FFF'FFFF'FFFF'FFFF) == 0x7FF0'0000'0000'000;
}
/// Is 64-bit floating point value a QNaN?
constexpr bool IsQNaN(u64 value) {
return (value & 0x7FF8'0000'0000'0000) == 0x7FF8'0000'0000'0000;