aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/unix/sys_float.c
AgeCommit message (Collapse)Author
2016-04-29Merge branch 'mikpe/fp-exceptions-cleanups/PR-1019/OTP-13531'Lukas Larsson
* mikpe/fp-exceptions-cleanups/PR-1019/OTP-13531: clean up FP exception code in sys_float.c
2016-04-26matherr() must not fake an FP exceptionMikael Pettersson
When FP exceptions are used, matherr() forces a fake FP exception, which is interpreted as an error by the checking code after a math routine call. This is wrong for several reasons: - it's not necessary for error checking: when FP exceptions aren't used, matherr() is a stub and no information is derived from it being called - it's not necessary for FPU maintenance: the FPU only needs to be reprogrammed after an actual FP exception - it causes false negatives: matherr() may be called even though Erlang doesn't consider the case to be an error (exp() and pow() underflows on Solaris for instance); with FP exceptions enabled they are incorrectly considered errors The fix is to remove all FP exception related code from matherr().
2016-04-17clean up FP exception code in sys_float.cMikael Pettersson
This performs a number of cleanups in the FP exception code: - inline the body of unmask_fpe_conditional() in its only caller, then delete the duplicated and identical definitions of it - start the big processor-specific block with a comment describing the two functions that must be defined, then delete redundant comments at all the mask_*() functions - add a comment before fpe_sig_action() explaining exactly what processor-specific action is required of it - flatten #ifdef nesting in fpe_sig_action() - move common code in the x86 unmask_fpe() and erts_restore_fpu() function into a subroutine - minor tweaks: drop a redundant L suffix on a 0, add a comment after an #else, bump the size of a debug buffer, There should be no change in behaviour from these changes.
2016-04-13Merge branch 'henrik/update-copyrightyear'Henrik Nord
* henrik/update-copyrightyear: update copyright-year
2016-03-16Take out (parts of) broken fp exception support for MacOS XBjörn Gustavsson
Floating-point exception support on MacOS X has never been especially reliable, and has therefore been disabled by default for a long time. The fpe support is now broken. Therefore, take out the unnecessary test for modern mcontext in configure (whatever that means) and the associated code in sys_float.c. Add #error directives to sys_float.c to make it clear that fpe is not supported. It seems to risky to mess with the mess of #ifdef's, so we will not attempt to remove all fpe support code for MacOS X.
2016-03-15update copyright-yearHenrik Nord
2016-02-24erts: Change erl_exit into erts_exitSverker Eriksson
This is mostly a pure refactoring. Except for the buggy cases when calling erlang:halt() with a positive integer in the range -(INT_MIN+2) to -INT_MIN that got confused with ERTS_ABORT_EXIT, ERTS_DUMP_EXIT and ERTS_INTR_EXIT. Outcome OLD erl_exit(n, ) NEW erts_exit(n, ) ------- ------------------- ------------------------------------------- exit(Status) n = -Status <= 0 n = Status >= 0 crashdump+abort n > 0, ignore n n = ERTS_ERROR_EXIT < 0 The outcome of the old ERTS_ABORT_EXIT, ERTS_INTR_EXIT and ERTS_DUMP_EXIT are the same as before (even though their values have changed).
2015-06-18Change license text to APLv2Bruce Yinhe
2015-05-06erts: Increase buffer in erts_fp_check_init_errorMikael Pettersson
The current size is too small for 64-bit machines, causing messages to be truncated and making debugging more difficult.
2014-12-19erts: Rename sys_sigset to sys_signalLukas Larsson
Also removed old legacy fallback that is no longer used
2014-02-24ose,erts: Specify name for tsd keysLukas Larsson
This simplified debugging on OSE and also limits the number of ppdata keys that are created when beam is restarted.
2013-04-30Define matherr only on platforms where it is usedAnthony Ramine
2013-03-04erts: gcc ansi does not allow 'inline'Björn-Egil Dahlberg
2013-01-25Update copyright yearsBjörn-Egil Dahlberg
2013-01-21Text representation of a float formatted using given options.Serge Aleynikov
This BIF solves a problem of float_to_list/1 that doesn't allow specifying the number of digits after the decimal point when formatting floats. float_to_list(Float, Options) -> string() Float = float() Options = [Option] Option = {decimals, Decimals::0..249} | {scientific, Decimals::0..249} | compact Returns a string which corresponds to the text representation of a `Float` formatted using given options. When decimals option is specified the returned value will contain at most `Decimals` number of digits past the decimal point. When `compact` option is provided the trailing zeros at the end of the list are truncated (this option is only meaningful together with the `decimals` option). When `scientific` option is provided, the float will be formatted using scientific notation with `Decimals` digits of precision. If `Options` is `[]` the function behaves like `float_to_list/1`. When using `decimals` option and the number doesn't fit in the static internal buffer of 256 bytes the function throws `badarg`.
2012-09-07Replace sprintf with erts_snprintf in beamBjörn-Egil Dahlberg
2011-02-18HALFWORD ETS Fix copyright year in some source filesSverker Eriksson
2011-02-03HALFWORD ETS relative termsSverker Eriksson
In halfword emulator, make ETS use a variant of the internal term format that uses relative offsets instead of absolute pointers. This will allow storage in high memory (>4G). Preprocessor macros (like list_val_rel(TERM,BASE)) are used to make normal (fullword) emulator almost completely unchanged while still reusing most of the code.
2010-09-07Merge branch 'mk/net-dragonfly-bsd-patches' into devBjörn Gustavsson
* mk/net-dragonfly-bsd-patches: Remove unused variables Use proper install method Add support for DragonFly BSD Add support for NetBSD
2010-08-30Merge branch 'pan/list_to_float/OTP-7178' into devPatrik Nyblom
* pan/list_to_float/OTP-7178: Teach Unix sys_float.c to ignore underflow in list_to_float and return 0.0
2010-08-17Solaris/x86: Handle floating point exceptions properly in driver threadsBjörn Gustavsson
On Solaris/x86, the floating point exceptions bits seems to be propagated to child threads, so if scheduler threads use floating points exceptions, also driver threads will have floating points exception enabled. The problem is that erts_thread_init_float() has not been called for driver threads, and because of that matherr() will crash when called. Fix matherr() so that it will work even if erts_thread_init_float() has not been called. This fix was suggested by Mikael Pettersson.
2010-08-13Add support for NetBSDMartti Kuparinen
These are the current NetBSD pkgsrc patches.
2010-06-23Teach Unix sys_float.c to ignore underflow in list_to_float and return 0.0Patrik Nyblom
OTP-7178
2010-02-08OTP-8412 Fixed numerous compiler warnings generated by gcc 4.4.1 andRickard Green
tile-cc 2.0.1.78377 when compiling the runtime system.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP