lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 69b862e 5/5: Call fesetround() with the new e


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 69b862e 5/5: Call fesetround() with the new enumerators just committed
Date: Thu, 29 Dec 2016 00:19:51 +0000 (UTC)

branch: master
commit 69b862e84ea1ba16d82f9bbb51cb58597e4397b2
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Call fesetround() with the new enumerators just committed
    
    * round_to_test.cpp: simplify call to fesetround()
    * round_test.cpp: set rounding mode as in round_to_test.cpp
---
 round_test.cpp    |    5 +++++
 round_to_test.cpp |    7 +------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/round_test.cpp b/round_test.cpp
index 2a2c902..b5315ad 100644
--- a/round_test.cpp
+++ b/round_test.cpp
@@ -114,6 +114,11 @@ void set_hardware_rounding_mode(e_ieee754_rounding mode, 
bool synchronize)
 {
 #if defined LMI_IEC_559
     fesetround(mode);
+#elif defined LMI_X86_64
+    // See the parallel section of 'round_to_test.cpp'.
+    // For the nonce, set both i87 and SSE rounding modes here.
+    fesetround(mode);
+    fenv_rounding(mode);
 #elif defined LMI_X86
     fenv_rounding(mode);
 #else // No known way to set hardware rounding mode.
diff --git a/round_to_test.cpp b/round_to_test.cpp
index 8b1d4c6..1cb47e9 100644
--- a/round_to_test.cpp
+++ b/round_to_test.cpp
@@ -122,12 +122,7 @@ void set_hardware_rounding_mode(e_ieee754_rounding mode, 
bool synchronize)
 #elif defined LMI_X86_64
     // See comments above on the <cfenv> series of conditionals.
     // For the nonce, set both i87 and SSE rounding modes here.
-    fesetround(  (fe_tonearest  == mode) ? FE_TONEAREST
-               : (fe_downward   == mode) ? FE_DOWNWARD
-               : (fe_upward     == mode) ? FE_UPWARD
-               : (fe_towardzero == mode) ? FE_TOWARDZERO
-               : throw std::runtime_error("Failed to set rounding mode.")
-              );
+    fesetround(mode);
     fenv_rounding(mode);
 #elif defined LMI_X86
     fenv_rounding(mode);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]