From 513d4aedfcde352f50d0b258997eaac20258ee47 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Tue, 17 Jul 2012 16:54:41 +0000 Subject: [PATCH] Fix up Linux x64 tests a little better - note that the test with the FPU in FTZ mode still fail pretty badly, especially with Intel-12.1 [SVN r79576] --- test/test_next.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/test_next.cpp b/test/test_next.cpp index 3e0661a93..a4dc84551 100644 --- a/test/test_next.cpp +++ b/test/test_next.cpp @@ -36,10 +36,10 @@ void test_value(const T& val, const char* name) BOOST_CHECK(float_next(val) > val); BOOST_CHECK_EQUAL(float_distance(float_prior(val), val), 1); BOOST_CHECK(float_prior(val) < val); - BOOST_CHECK_EQUAL(float_distance(nextafter(val, upper), val), -1); - BOOST_CHECK(nextafter(val, upper) > val); - BOOST_CHECK_EQUAL(float_distance(nextafter(val, lower), val), 1); - BOOST_CHECK(nextafter(val, lower) < val); + BOOST_CHECK_EQUAL(float_distance((boost::math::nextafter)(val, upper), val), -1); + BOOST_CHECK((boost::math::nextafter)(val, upper) > val); + BOOST_CHECK_EQUAL(float_distance((boost::math::nextafter)(val, lower), val), 1); + BOOST_CHECK((boost::math::nextafter)(val, lower) < val); BOOST_CHECK_EQUAL(float_distance(float_next(float_next(val)), val), -2); BOOST_CHECK_EQUAL(float_distance(float_prior(float_prior(val)), val), 2); BOOST_CHECK_EQUAL(float_distance(float_prior(float_prior(val)), float_next(float_next(val))), 4); @@ -157,13 +157,15 @@ int test_main(int, char* []) test_values(boost::math::concepts::real_concept(0), "real_concept"); #endif #if defined(TEST_SSE2) +#ifdef _WIN32 + // These tests fail pretty badly on Linux x64, especially with Intel-12.1 _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_ON); std::cout << "Testing again with Flush-To-Zero set" << std::endl; std::cout << "SSE2 control word is: " << std::hex << _mm_getcsr() << std::endl; test_values(1.0f, "float"); test_values(1.0, "double"); _MM_SET_FLUSH_ZERO_MODE(_MM_FLUSH_ZERO_OFF); - +#endif BOOST_ASSERT((_mm_getcsr() & 0x40) == 0); _mm_setcsr(_mm_getcsr() | 0x40); std::cout << "Testing again with Denormals-Are-Zero set" << std::endl;