Blame jdk8210425-rh1632174-01-compile_with_o2_and_ffp_contract_off_as_for_fdlibm.patch

Severin Gehwolf c295b90
diff --git openjdk.orig/hotspot/make/linux/makefiles/amd64.make openjdk/hotspot/make/linux/makefiles/amd64.make
Severin Gehwolf c295b90
--- openjdk.orig/hotspot/make/linux/makefiles/amd64.make
Severin Gehwolf c295b90
+++ openjdk/hotspot/make/linux/makefiles/amd64.make
Severin Gehwolf c295b90
@@ -22,10 +22,13 @@
Severin Gehwolf c295b90
 #  
Severin Gehwolf c295b90
 #
Severin Gehwolf c295b90
 
Severin Gehwolf c295b90
-# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
Severin Gehwolf c295b90
-OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
-# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
Severin Gehwolf c295b90
-OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
+ifeq ($(OPT_CFLAGS_NO_FMA),)
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
+else
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(OPT_CFLAGS_NO_FMA)
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(OPT_CFLAGS_NO_FMA)
Severin Gehwolf c295b90
+endif
Severin Gehwolf c295b90
 # Must also specify if CPU is little endian
Severin Gehwolf c295b90
 CFLAGS += -DVM_LITTLE_ENDIAN
Severin Gehwolf c295b90
 
Severin Gehwolf c295b90
diff --git openjdk.orig/hotspot/make/linux/makefiles/gcc.make openjdk/hotspot/make/linux/makefiles/gcc.make
Severin Gehwolf c295b90
--- openjdk.orig/hotspot/make/linux/makefiles/gcc.make
Severin Gehwolf c295b90
+++ openjdk/hotspot/make/linux/makefiles/gcc.make
Severin Gehwolf c295b90
@@ -225,6 +225,16 @@
Severin Gehwolf c295b90
 OPT_CFLAGS/SIZE=-Os
Severin Gehwolf c295b90
 OPT_CFLAGS/SPEED=-O3
Severin Gehwolf c295b90
 
Severin Gehwolf c295b90
+ifeq ($(USE_CLANG),)
Severin Gehwolf c295b90
+  # Only GCC 4.6 and better have machine independent -ffp-contract=off.
Severin Gehwolf c295b90
+  # For other versions we need to explicitly set arch specific machine
Severin Gehwolf c295b90
+  # flags or keep optimization off for them.
Severin Gehwolf c295b90
+  ifeq "$(shell expr \( $(CC_VER_MAJOR) \> 4 \) \| \( \( $(CC_VER_MAJOR) = 4 \) \& \( $(CC_VER_MINOR) \>= 6 \) \))" "1"
Severin Gehwolf c295b90
+    OPT_CFLAGS_NO_FMA = -ffp-contract=off
Severin Gehwolf c295b90
+  endif
Severin Gehwolf c295b90
+endif
Severin Gehwolf c295b90
+
Severin Gehwolf c295b90
+
Severin Gehwolf c295b90
 # Hotspot uses very unstrict aliasing turn this optimization off
Severin Gehwolf c295b90
 # This option is added to CFLAGS rather than OPT_CFLAGS
Severin Gehwolf c295b90
 # so that OPT_CFLAGS overrides get this option too.
Severin Gehwolf c295b90
diff --git openjdk.orig/hotspot/make/linux/makefiles/i486.make openjdk/hotspot/make/linux/makefiles/i486.make
Severin Gehwolf c295b90
--- openjdk.orig/hotspot/make/linux/makefiles/i486.make
Severin Gehwolf c295b90
+++ openjdk/hotspot/make/linux/makefiles/i486.make
Severin Gehwolf c295b90
@@ -24,10 +24,13 @@
Severin Gehwolf c295b90
 
Severin Gehwolf c295b90
 # TLS helper, assembled from .s file
Severin Gehwolf c295b90
 
Severin Gehwolf c295b90
-# The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
Severin Gehwolf c295b90
-OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
-# The copied fdlibm routines in sharedRuntimeTrans.o must not be optimized
Severin Gehwolf c295b90
-OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
+ifeq ($(OPT_CFLAGS_NO_FMA),)
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
+else
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(OPT_CFLAGS_NO_FMA)
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(OPT_CFLAGS_NO_FMA)
Severin Gehwolf c295b90
+endif
Severin Gehwolf c295b90
 # Must also specify if CPU is little endian
Severin Gehwolf c295b90
 CFLAGS += -DVM_LITTLE_ENDIAN
Severin Gehwolf c295b90
 
Severin Gehwolf c295b90
diff --git openjdk.orig/hotspot/make/linux/makefiles/ppc64.make openjdk/hotspot/make/linux/makefiles/ppc64.make
Severin Gehwolf c295b90
--- openjdk.orig/hotspot/make/linux/makefiles/ppc64.make
Severin Gehwolf c295b90
+++ openjdk/hotspot/make/linux/makefiles/ppc64.make
Severin Gehwolf c295b90
@@ -49,3 +49,17 @@
Severin Gehwolf c295b90
   # Use Power8, this is the first CPU to support PPC64 LE with ELFv2 ABI.
Severin Gehwolf c295b90
   CFLAGS += -mcpu=power7 -mtune=power8 -minsert-sched-nops=regroup_exact -mno-multiple -mno-string
Severin Gehwolf c295b90
 endif
Severin Gehwolf c295b90
+
Severin Gehwolf c295b90
+ifeq ($(OPT_CFLAGS_NO_FMA),)
Severin Gehwolf c295b90
+  ifeq ($(OPENJDK_TARGET_CPU_ENDIAN),big)
Severin Gehwolf c295b90
+    OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) -mno-fused-madd -fno-strict-aliasing
Severin Gehwolf c295b90
+    OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) -mno-fused-madd -fno-strict-aliasing
Severin Gehwolf c295b90
+  else
Severin Gehwolf c295b90
+    OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
+    OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/NOOPT)
Severin Gehwolf c295b90
+  endif
Severin Gehwolf c295b90
+else
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/SPEED) $(OPT_CFLAGS_NO_FMA)
Severin Gehwolf c295b90
+  OPT_CFLAGS/sharedRuntimeTrans.o = $(OPT_CFLAGS/SPEED) $(OPT_CFLAGS_NO_FMA)
Severin Gehwolf c295b90
+endif
Severin Gehwolf c295b90
+