2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 16:32:10 +00:00

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]
This commit is contained in:
John Maddock
2012-07-17 16:54:41 +00:00
parent c2e90167f7
commit 513d4aedfc

View File

@@ -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;