summaryrefslogtreecommitdiff
path: root/sysdeps/mips/mips32/sfp-machine.h
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:01:57 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-12-27 19:01:57 +0000
commitcab56836b146bc129f1ad43f0393d95a9deca63a (patch)
tree4f4e655319bbac78fca170da05275c127429b460 /sysdeps/mips/mips32/sfp-machine.h
parent04ac1241a4cd004872282c2c82ec37fa33925292 (diff)
parent82dd75a7f436a19047325d62182590c9f9e23a78 (diff)
Merge branch 't/tls' into refs/top-bases/t/tls-threadvar
Diffstat (limited to 'sysdeps/mips/mips32/sfp-machine.h')
-rw-r--r--sysdeps/mips/mips32/sfp-machine.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/sysdeps/mips/mips32/sfp-machine.h b/sysdeps/mips/mips32/sfp-machine.h
index 4e23aa8b26..5215655029 100644
--- a/sysdeps/mips/mips32/sfp-machine.h
+++ b/sysdeps/mips/mips32/sfp-machine.h
@@ -41,9 +41,20 @@
# define _FP_QNANNEGATEDP 1
#endif
+#ifdef __mips_nan2008
+/* NaN payloads should be preserved for NAN2008. */
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+ do \
+ { \
+ R##_s = X##_s; \
+ _FP_FRAC_COPY_##wc (R, X); \
+ R##_c = FP_CLS_NAN; \
+ } \
+ while (0)
+#else
/* From my experiments it seems X is chosen unless one of the
NaNs is sNaN, in which case the result is NANSIGN/NANFRAC. */
-#define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
+# define _FP_CHOOSENAN(fs, wc, R, X, Y, OP) \
do { \
if ((_FP_FRAC_HIGH_RAW_##fs(X) | \
_FP_FRAC_HIGH_RAW_##fs(Y)) & _FP_QNANBIT_##fs) \
@@ -58,6 +69,7 @@
} \
R##_c = FP_CLS_NAN; \
} while (0)
+#endif
#define FP_EX_INVALID (1 << 4)
#define FP_EX_DIVZERO (1 << 3)