diff --git a/CMakeLists.txt b/CMakeLists.txt index d819e59..e6ac7fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,15 +173,23 @@ if (CMAKE_CXX_COMPILER_TARGET) endif() CHECK_CXX_SOURCE_COMPILES(" #include +#include +#include int main(int argc, char **argv) { __fp16 a = (__fp16)(float)atof(argv[1]); +__uint16_t u = std::bit_cast<__uint16_t>(a); +a = std::bit_cast<__fp16>(u); return (float)a; } " TLFLOAT_COMPILER_SUPPORTS_FP16) CHECK_CXX_SOURCE_COMPILES(" #include +#include +#include int main(int argc, char **argv) { __bf16 a = (__bf16)(float)atof(argv[1]); +__uint16_t u = std::bit_cast<__uint16_t>(a); +a = std::bit_cast<__bf16>(u); return (float)a; } " TLFLOAT_COMPILER_SUPPORTS_BF16) diff --git a/src/tester/test_exhaustive_bf16_mpfr.cpp b/src/tester/test_exhaustive_bf16_mpfr.cpp index 6c962bf..d61b2e6 100644 --- a/src/tester/test_exhaustive_bf16_mpfr.cpp +++ b/src/tester/test_exhaustive_bf16_mpfr.cpp @@ -1,6 +1,13 @@ #include #include #include + +#include + +#if defined(TLFLOAT_ENABLE_MPFR_WANT_FLOAT128) +#define MPFR_WANT_FLOAT128 +#endif + #include #include "suppress.hpp"