summaryrefslogtreecommitdiff
path: root/lang/openjdk7
diff options
context:
space:
mode:
authortnn <tnn>2015-03-05 13:02:38 +0000
committertnn <tnn>2015-03-05 13:02:38 +0000
commit8811ceaeadf8d65804381cad3942d25cc10c8845 (patch)
tree8a46531d0c7f5141f0c0a1a37b62d8f99f36d645 /lang/openjdk7
parent0a5f97b4315c24e04e76008360a96f6d5958f58d (diff)
downloadpkgsrc-8811ceaeadf8d65804381cad3942d25cc10c8845.tar.gz
adjust ARM float hacks: use binary IEEE encoding of subnormal literals
Diffstat (limited to 'lang/openjdk7')
-rw-r--r--lang/openjdk7/hacks.mk17
1 files changed, 13 insertions, 4 deletions
diff --git a/lang/openjdk7/hacks.mk b/lang/openjdk7/hacks.mk
index 9520e745b9b..27b44eca8df 100644
--- a/lang/openjdk7/hacks.mk
+++ b/lang/openjdk7/hacks.mk
@@ -1,4 +1,4 @@
-# $NetBSD: hacks.mk,v 1.2 2015/02/28 14:30:56 tnn Exp $
+# $NetBSD: hacks.mk,v 1.3 2015/03/05 13:02:38 tnn Exp $
.if !defined(OPENJDK7_HACKS_MK)
OPENJDK7_HACKS_MK= # empty
@@ -29,9 +29,18 @@ SUBST_FILES.fpu= langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java
SUBST_FILES.fpu+= langtools/src/share/classes/com/sun/tools/javac/parser/JavacParser.java
SUBST_FILES.fpu+= jdk/src/share/classes/sun/misc/DoubleConsts.java
SUBST_FILES.fpu+= jdk/src/share/classes/sun/misc/FloatConsts.java
-# {Double,Float}Consts.java: Replace problematic MIN_NORMAL literals with alternative representation
-SUBST_SED.fpu= -e 's|2.2250738585072014E-308|0x1.0p-1022|g'
-SUBST_SED.fpu+= -e 's|1.17549435E-38f|0x1.0p-126f|g'
+SUBST_FILES.fpu+= jdk/src/share/classes/java/lang/Double.java
+SUBST_FILES.fpu+= jdk/src/share/classes/java/lang/Float.java
+# Double{,Consts}.java: Replace problematic literals with binary representation
+SUBST_SED.fpu= -e 's|2.2250738585072014e-308d*|Double.longBitsToDouble(0x10000000000000L)|ig' # MIN_NORMAL
+SUBST_SED.fpu+= -e 's|0x1.0p-1022d*|Double.longBitsToDouble(0x10000000000000L)|ig' # MIN_NORMAL
+SUBST_SED.fpu+= -e 's|4.9e-324d*|Double.longBitsToDouble(0x1L)|ig' # MIN_VALUE
+SUBST_SED.fpu+= -e 's|0x0.0000000000001p-1022d*|Double.longBitsToDouble(0x1L)|ig' # MIN_VALUE
+# Float{,Consts}.java: Replace problematic literals with binary representation
+SUBST_SED.fpu+= -e 's|1.17549435e-38f*|Float.intBitsToFloat(0x800000)|ig' # MIN_NORMAL
+SUBST_SED.fpu+= -e 's|0x1.0p-126f*|Float.intBitsToFloat(0x800000)|ig' # MIN_NORMAL
+SUBST_SED.fpu+= -e 's|1.4e-45f*|Float.intBitsToFloat(0x1)|ig' # MIN_VALUE
+SUBST_SED.fpu+= -e 's|0x0.000002P-126f*|Float.intBitsToFloat(0x1)|ig' # MIN_VALUE
# JavacParser.java: avoid bogus "fp.number.too.small" error parsing literals representing Double.MIN_VALUE
SUBST_SED.fpu+= -e 's|n.floatValue() == 0.0f && !isZero(proper)|& \&\& Float.floatToIntBits(n) != 0x1|'
SUBST_SED.fpu+= -e 's|n.doubleValue() == 0.0d && !isZero(proper)|& \&\& Double.doubleToLongBits(n) != 0x1L|'