summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2021-08-03 09:49:00 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2021-08-03 09:49:00 +0000
commitd4481bfaad6ca4e911cd90a9f97c54962000e200 (patch)
treed3a7d0cc72df99c44b2ffbe3d55957d6ed6c198b
parent3b61e358af4b811df7d43d448144c1c47da782c9 (diff)
downloadmpfr-d4481bfaad6ca4e911cd90a9f97c54962000e200.tar.gz
need -fp-model=strict for icx
git-svn-id: https://scm.gforge.inria.fr/anonscm/svn/mpfr/trunk@14552 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r--INSTALL7
-rw-r--r--tests/tget_flt.c22
2 files changed, 29 insertions, 0 deletions
diff --git a/INSTALL b/INSTALL
index ec2b72e08..07202826e 100644
--- a/INSTALL
+++ b/INSTALL
@@ -716,3 +716,10 @@ wl="" into wl="-Wl," in the libtool file.
All tests (make check) should pass (tget_set_d64, tget_set_d128 and
tset_float128 are skipped, since CompCert does not support _Decimal64,
_Decimal128 nor _Float128).
+
+e. Using the Intel OneApi compiler
+==================================
+
+When using the Intel OneApi compiler (icx), one should add -fp-model=strict
+to CFLAGS so that the conversion routines from/to native floating-point
+types (float, double, ...) work properly. Otherwise some tests will fail.
diff --git a/tests/tget_flt.c b/tests/tget_flt.c
index 04975c004..b85e74b68 100644
--- a/tests/tget_flt.c
+++ b/tests/tget_flt.c
@@ -21,6 +21,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#include <float.h> /* for FLT_MIN */
+#include <math.h> /* for isnan */
#include "mpfr-test.h"
#include "ieee_floats.h"
@@ -47,6 +48,25 @@ equal_flt (float f, float g)
}
}
+/* bug with icx 2021.2.0, when MPFR is not compiled with -fp-model=strict */
+static void
+bug_icx (void)
+{
+ mpfr_t x;
+ float y;
+ mpfr_init2 (x, 24);
+ mpfr_set_flt (x, -0x1p-149f, MPFR_RNDN);
+ mpfr_log (x, x, MPFR_RNDN);
+ y = mpfr_get_flt (x, MPFR_RNDN);
+ if (!isnan (y))
+ {
+ printf ("Error, mpfr_get_flt(NaN) != NaN\n");
+ printf ("got %a\n", y);
+ exit (1);
+ }
+ mpfr_clear (x);
+}
+
int
main (void)
{
@@ -59,6 +79,8 @@ main (void)
tests_start_mpfr ();
+ bug_icx ();
+
#if !defined(MPFR_ERRDIVZERO)
infp = (float) MPFR_DBL_INFP;
if (infp * 0.5 != infp)