diff options
author | Sverker Eriksson <[email protected]> | 2011-11-18 17:42:28 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2011-11-18 17:42:28 +0100 |
commit | 7d9ef0fdde8119e1be0a47e3e45c9cdb85f926d8 (patch) | |
tree | f9cbbd41ccf67517b8d9c7423ee2b3d64c6bba31 /lib/hipe/rtl/hipe_rtl_arch.erl | |
parent | b130455e73b0bcacee2bfd3dfe6bafa9dd497886 (diff) | |
parent | 327c072661840f671fc0041bc5e88bc69691d5aa (diff) | |
download | otp-7d9ef0fdde8119e1be0a47e3e45c9cdb85f926d8.tar.gz otp-7d9ef0fdde8119e1be0a47e3e45c9cdb85f926d8.tar.bz2 otp-7d9ef0fdde8119e1be0a47e3e45c9cdb85f926d8.zip |
Merge branch 'sverk/hipe-without-fpe/OTP-9724'
* sverk/hipe-without-fpe/OTP-9724:
otp_build: Disable FPE by default on Linux
stdlib: Make sure qlc_SUITE:otp_6964 restores backtrace_depth
erts: Add test for inf/NaN intermediate float results
hipe,erts: Allow hipe without floating point exceptions
hipe: Fix bug in hipe_rtl_lcm:calc_killed_expr_bb
erts: Rename macros used by float instructions without FPE
Diffstat (limited to 'lib/hipe/rtl/hipe_rtl_arch.erl')
-rw-r--r-- | lib/hipe/rtl/hipe_rtl_arch.erl | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/lib/hipe/rtl/hipe_rtl_arch.erl b/lib/hipe/rtl/hipe_rtl_arch.erl index 22cda57a3a..99eb80f3d1 100644 --- a/lib/hipe/rtl/hipe_rtl_arch.erl +++ b/lib/hipe/rtl/hipe_rtl_arch.erl @@ -65,7 +65,8 @@ %% alignment/0, nr_of_return_regs/0, log2_word_size/0, - word_size/0 + word_size/0, + mk_fp_check_result/1 ]). -include("hipe_literals.hrl"). @@ -558,6 +559,12 @@ eval_cond_bits(Cond, N, Z, V, C) -> %%---------------------------------------------------------------------- fwait() -> + case ?ERTS_NO_FPE_SIGNALS of + 1 -> []; + 0 -> fwait_real() + end. + +fwait_real() -> case get(hipe_target_arch) of x86 -> [hipe_rtl:mk_call([], 'fwait', [], [], [], not_remote)]; amd64 -> [hipe_rtl:mk_call([], 'fwait', [], [], [], not_remote)]; @@ -573,6 +580,12 @@ fwait() -> %% Returns RTL code to restore the FPU after a floating-point exception. %% @end handle_fp_exception() -> + case ?ERTS_NO_FPE_SIGNALS of + 1 -> []; + 0 -> handle_real_fp_exception() + end. + +handle_real_fp_exception() -> case get(hipe_target_arch) of x86 -> ContLbl = hipe_rtl:mk_new_label(), @@ -655,3 +668,15 @@ nr_of_return_regs() -> 1 %% hipe_amd64_registers:nr_rets(); end. + + +mk_fp_check_result(Result) -> + case ?ERTS_NO_FPE_SIGNALS of + 0 -> + []; + 1 -> + [hipe_rtl:mk_fstore(proc_pointer(), + hipe_rtl:mk_imm(?P_FLOAT_RESULT), + Result), + hipe_rtl:mk_call([], emulate_fpe, [], [], [], not_remote)] + end. |