Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82608 - trunk/boost/math/special_functions
From: john_at_[hidden]
Date: 2013-01-25 11:53:36


Author: johnmaddock
Date: 2013-01-25 11:53:36 EST (Fri, 25 Jan 2013)
New Revision: 82608
URL: http://svn.boost.org/trac/boost/changeset/82608

Log:
Fix for SSE2 systems on Linux
Text files modified:
   trunk/boost/math/special_functions/next.hpp | 14 +++++++-------
   1 files changed, 7 insertions(+), 7 deletions(-)

Modified: trunk/boost/math/special_functions/next.hpp
==============================================================================
--- trunk/boost/math/special_functions/next.hpp (original)
+++ trunk/boost/math/special_functions/next.hpp 2013-01-25 11:53:36 EST (Fri, 25 Jan 2013)
@@ -32,7 +32,7 @@
    // when using the SSE2 registers in DAZ or FTZ mode.
    //
    static const T m = std::numeric_limits<T>::denorm_min();
- return (0 == m) ? tools::min_value<T>() : m;
+ return ((tools::min_value<T>() - m) == tools::min_value<T>()) ? tools::min_value<T>() : m;
 }
 
 template <class T>
@@ -52,7 +52,7 @@
 }
 
 //
-// Returns the smallest value that won't generate denorms when
+// Returns the smallest value that won't generate denorms when
 // we calculate the value of the least-significant-bit:
 //
 template <class T>
@@ -123,7 +123,7 @@
    if((fpclass != FP_SUBNORMAL) && (fpclass != FP_ZERO) && (fabs(val) < detail::get_min_shift_value<T>()) && (val != -tools::min_value<T>()))
    {
       //
- // Special case: if the value of the least significant bit is a denorm, and the result
+ // Special case: if the value of the least significant bit is a denorm, and the result
       // would not be a denorm, then shift the input, increment, and shift back.
       // This avoids issues with the Intel SSE2 registers when the FTZ or DAZ flags are set.
       //
@@ -194,7 +194,7 @@
    if((fpclass != FP_SUBNORMAL) && (fpclass != FP_ZERO) && (fabs(val) < detail::get_min_shift_value<T>()) && (val != tools::min_value<T>()))
    {
       //
- // Special case: if the value of the least significant bit is a denorm, and the result
+ // Special case: if the value of the least significant bit is a denorm, and the result
       // would not be a denorm, then shift the input, increment, and shift back.
       // This avoids issues with the Intel SSE2 registers when the FTZ or DAZ flags are set.
       //
@@ -310,7 +310,7 @@
       result = float_distance(upper, b);
    }
    //
- // Use compensated double-double addition to avoid rounding
+ // Use compensated double-double addition to avoid rounding
    // errors in the subtraction:
    //
    T mb, x, y, z;
@@ -384,7 +384,7 @@
    if(fabs(val) < detail::get_min_shift_value<T>())
    {
       //
- // Special case: if the value of the least significant bit is a denorm,
+ // Special case: if the value of the least significant bit is a denorm,
       // implement in terms of float_next/float_prior.
       // This avoids issues with the Intel SSE2 registers when the FTZ or DAZ flags are set.
       //
@@ -411,7 +411,7 @@
    {
       distance -= itrunc(limit_distance);
       val = limit;
- if(distance < 0)
+ if(distance < 0)
       {
          limit /= 2;
          expon--;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk