aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_bif0.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-11-15 12:27:29 +0100
committerSverker Eriksson <[email protected]>2011-11-17 14:16:16 +0100
commitc0b6c30a98c154a1ea190dd930b53dc4f155e67b (patch)
tree10d482fc47d6b9be331c6c0fcf4951b26adc0d22 /erts/emulator/hipe/hipe_bif0.c
parent30f85a8d2f81665626e5a94d10ff9b0ea507caac (diff)
downloadotp-c0b6c30a98c154a1ea190dd930b53dc4f155e67b.tar.gz
otp-c0b6c30a98c154a1ea190dd930b53dc4f155e67b.tar.bz2
otp-c0b6c30a98c154a1ea190dd930b53dc4f155e67b.zip
hipe,erts: Allow hipe without floating point exceptions
Diffstat (limited to 'erts/emulator/hipe/hipe_bif0.c')
-rw-r--r--erts/emulator/hipe/hipe_bif0.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_bif0.c b/erts/emulator/hipe/hipe_bif0.c
index e7fb850530..cec22b3836 100644
--- a/erts/emulator/hipe/hipe_bif0.c
+++ b/erts/emulator/hipe/hipe_bif0.c
@@ -985,6 +985,26 @@ BIF_RETTYPE hipe_conv_big_to_float(BIF_ALIST_1)
BIF_RET(res);
}
+#ifdef NO_FPE_SIGNALS
+
+/*
+ This is the current solution to make hipe run without FPE.
+ The native code is the same except that a call to this primop
+ is made after _every_ float operation to check the result.
+ The native fcheckerror still done later will detect if an
+ "emulated" FPE has occured.
+ We use p->hipe.float_result to avoid passing a 'double' argument,
+ which has its own calling convention (on amd64 at least).
+ Simple and slow...
+*/
+void hipe_emulate_fpe(Process* p)
+{
+ if (!finite(p->hipe.float_result)) {
+ p->fp_exception = 1;
+ }
+}
+#endif
+
#if 0 /* XXX: unused */
/*
* At least parts of this should be inlined in native code.