diff options
author | Lukas Larsson <[email protected]> | 2014-11-24 16:37:02 +0100 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2014-11-24 16:37:02 +0100 |
commit | ee11116c547c4559ed899ecadef9cf2038b2b336 (patch) | |
tree | 8fdfe55a308451a5c2a2fa1a7f18c1c5cc261eb6 | |
parent | 09725c52dfbdcce5ebcf4e52f856f732c738b0d8 (diff) | |
parent | e3f4cd83939f28e17addac889208985196d22f22 (diff) | |
download | otp-ee11116c547c4559ed899ecadef9cf2038b2b336.tar.gz otp-ee11116c547c4559ed899ecadef9cf2038b2b336.tar.bz2 otp-ee11116c547c4559ed899ecadef9cf2038b2b336.zip |
Merge branch 'lukas/erts/isfinite-fix/OTP-12268' into maint
* lukas/erts/isfinite-fix/OTP-12268:
erts: Use finite instead of isfinite with gcc
-rw-r--r-- | erts/emulator/sys/unix/erl_unix_sys.h | 11 | ||||
-rw-r--r-- | lib/erl_interface/src/decode/decode_big.c | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/erts/emulator/sys/unix/erl_unix_sys.h b/erts/emulator/sys/unix/erl_unix_sys.h index c3dba69acb..f7a6298d5b 100644 --- a/erts/emulator/sys/unix/erl_unix_sys.h +++ b/erts/emulator/sys/unix/erl_unix_sys.h @@ -229,6 +229,17 @@ extern void sys_stop_cat(void); #ifdef USE_ISINF_ISNAN /* simulate finite() */ # define isfinite(f) (!isinf(f) && !isnan(f)) # define HAVE_ISFINITE +#elif defined(__GNUC__) && defined(HAVE_FINITE) +/* We use finite in gcc as it emits assembler instead of + the function call that isfinite emits. The assembler is + significantly faster. */ +# ifdef isfinite +# undef isfinite +# endif +# define isfinite finite +# ifndef HAVE_ISFINITE +# define HAVE_ISFINITE +# endif #elif defined(isfinite) && !defined(HAVE_ISFINITE) # define HAVE_ISFINITE #elif !defined(HAVE_ISFINITE) && defined(HAVE_FINITE) diff --git a/lib/erl_interface/src/decode/decode_big.c b/lib/erl_interface/src/decode/decode_big.c index b87d97d634..477880b331 100644 --- a/lib/erl_interface/src/decode/decode_big.c +++ b/lib/erl_interface/src/decode/decode_big.c @@ -153,6 +153,17 @@ int ei_big_comp(erlang_big *x, erlang_big *y) #ifdef USE_ISINF_ISNAN /* simulate finite() */ # define isfinite(f) (!isinf(f) && !isnan(f)) # define HAVE_ISFINITE +#elif defined(__GNUC__) && defined(HAVE_FINITE) +/* We use finite in gcc as it emits assembler instead of + the function call that isfinite emits. The assembler is + significantly faster. */ +# ifdef isfinite +# undef isfinite +# endif +# define isfinite finite +# ifndef HAVE_ISFINITE +# define HAVE_ISFINITE +# endif #elif defined(isfinite) && !defined(HAVE_ISFINITE) # define HAVE_ISFINITE #elif !defined(HAVE_ISFINITE) && defined(HAVE_FINITE) |