From 11fe85f129201c912c454f46b62f84475fde1f20 Mon Sep 17 00:00:00 2001
From: Subv <subv2112@gmail.com>
Date: Tue, 9 May 2017 00:22:53 -0500
Subject: [PATCH] Dyncom/VFP: Strip the VFP_NAN_FLAG sentinel value when
 setting vfp exceptions.

---
 src/core/arm/skyeye_common/vfp/vfpdouble.cpp | 2 +-
 src/core/arm/skyeye_common/vfp/vfpsingle.cpp | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
index 4b35455f6..7b035f56a 100644
--- a/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpdouble.cpp
@@ -1216,7 +1216,7 @@ u32 vfp_double_cpdo(ARMul_State* state, u32 inst, u32 fpscr) {
         except = fop->fn(state, dest, dn, dm, fpscr);
         LOG_TRACE(Core_ARM11, "VFP: itr%d: exceptions=%08x", vecitr >> FPSCR_LENGTH_BIT, except);
 
-        exceptions |= except;
+        exceptions |= except & ~VFP_NAN_FLAG;
 
         /*
          * CHECK: It appears to be undefined whether we stop when
diff --git a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
index 2609d0714..ae5b325f0 100644
--- a/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
+++ b/src/core/arm/skyeye_common/vfp/vfpsingle.cpp
@@ -1231,7 +1231,7 @@ u32 vfp_single_cpdo(ARMul_State* state, u32 inst, u32 fpscr) {
         except = fop->fn(state, dest, sn, m, fpscr);
         LOG_TRACE(Core_ARM11, "itr%d: exceptions=%08x", vecitr >> FPSCR_LENGTH_BIT, except);
 
-        exceptions |= except;
+        exceptions |= except & ~VFP_NAN_FLAG;
 
         /*
          * CHECK: It appears to be undefined whether we stop when