From 15c2b7663c8f622affa1404dd3a71e28069a6ca8 Mon Sep 17 00:00:00 2001 From: Aleksandar Andrejevic Date: Fri, 22 May 2015 03:40:44 +0000 Subject: [PATCH] [FAST486] Fix comparing NaNs in Fast486FpuCompare. svn path=/trunk/; revision=67844 --- reactos/lib/fast486/fpu.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/reactos/lib/fast486/fpu.c b/reactos/lib/fast486/fpu.c index d94ede16063..335e4e9b26e 100644 --- a/reactos/lib/fast486/fpu.c +++ b/reactos/lib/fast486/fpu.c @@ -767,13 +767,17 @@ Fast486FpuCompare(PFAST486_STATE State, { if (FPU_IS_NAN(FirstOperand) || FPU_IS_NAN(SecondOperand)) { - if (FPU_IS_POS_INF(FirstOperand) && FPU_IS_NEG_INF(SecondOperand)) + if ((FPU_IS_POS_INF(FirstOperand) + && (!FPU_IS_NAN(SecondOperand) || FPU_IS_NEG_INF(SecondOperand))) + || (!FPU_IS_NAN(FirstOperand) && FPU_IS_NEG_INF(SecondOperand))) { State->FpuStatus.Code0 = FALSE; State->FpuStatus.Code2 = FALSE; State->FpuStatus.Code3 = FALSE; } - else if (FPU_IS_NEG_INF(FirstOperand) && FPU_IS_POS_INF(SecondOperand)) + else if ((FPU_IS_POS_INF(SecondOperand) + && (!FPU_IS_NAN(FirstOperand) || FPU_IS_NEG_INF(FirstOperand))) + || (!FPU_IS_NAN(SecondOperand) && FPU_IS_NEG_INF(FirstOperand))) { State->FpuStatus.Code0 = TRUE; State->FpuStatus.Code2 = FALSE;