changeset 13528:3f75ecf2feed

8210416: [linux] Poor StrictMath performance due to non-optimized compilation Summary: Compile fdlibm with -O3 and relevant C flags on gcc arches. Reviewed-by: mbaesken, andrew
author sgehwolf
date Thu, 25 Apr 2019 15:19:52 +0200
parents 9db1950723f1
children 78d1f9f2fec2
files make/lib/CoreLibraries.gmk
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/make/lib/CoreLibraries.gmk	Wed May 01 06:16:37 2019 +0100
+++ b/make/lib/CoreLibraries.gmk	Thu Apr 25 15:19:52 2019 +0200
@@ -36,12 +36,13 @@
   BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
 endif
 
-ifeq ($(OPENJDK_TARGET_OS), linux)
-  ifeq ($(OPENJDK_TARGET_CPU), ppc64)
-    BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
-  else ifeq ($(OPENJDK_TARGET_CPU), ppc64le)
-    BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
-  endif
+
+# If FDLIBM_CFLAGS is non-empty we know that we can optimize
+# fdlibm when adding those extra C flags. Currently GCC only.
+LIBFDLIBM_CFLAGS :=
+ifneq ($(FDLIBM_CFLAGS), )
+  BUILD_LIBFDLIBM_OPTIMIZATION := HIGH
+  LIBFDLIBM_CFLAGS := $(FDLIBM_CFLAGS)
 endif
 
 ifneq ($(OPENJDK_TARGET_OS), macosx)
@@ -60,8 +61,7 @@
           -I$(JDK_TOPDIR)/src/share/native/java/lang/fdlibm/include, \
       CFLAGS_windows_debug := -DLOGGING, \
       CFLAGS_aix := -qfloat=nomaf, \
-      CFLAGS_linux_ppc64 := -mno-fused-madd -fno-strict-aliasing, \
-      CFLAGS_linux_ppc64le := -ffp-contract=off, \
+      CFLAGS_linux := $(LIBFDLIBM_CFLAGS), \
       ARFLAGS := $(ARFLAGS), \
       OBJECT_DIR := $(JDK_OUTPUTDIR)/objs/libfdlibm, \
       DEBUG_SYMBOLS := $(DEBUG_ALL_BINARIES)))