aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/sys/unix
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2014-11-24 16:37:12 +0100
committerLukas Larsson <[email protected]>2014-11-24 16:37:12 +0100
commitb36de499775d6dfcdb61ce1df079911a4ed3f2d5 (patch)
treec55fd85d8eafb437f10cafad034010ead206c5e4 /erts/emulator/sys/unix
parent2b13135cc0e23ec01f5a74c371b60ef0ec02775e (diff)
parentee11116c547c4559ed899ecadef9cf2038b2b336 (diff)
downloadotp-b36de499775d6dfcdb61ce1df079911a4ed3f2d5.tar.gz
otp-b36de499775d6dfcdb61ce1df079911a4ed3f2d5.tar.bz2
otp-b36de499775d6dfcdb61ce1df079911a4ed3f2d5.zip
Merge branch 'maint'
* maint: erts: Use finite instead of isfinite with gcc
Diffstat (limited to 'erts/emulator/sys/unix')
-rw-r--r--erts/emulator/sys/unix/erl_unix_sys.h11
1 files changed, 11 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)