[PATCH v3] Add support for SoftFloat library on ARM (original) (raw)
Jakub Vaněk linuxtardis at gmail.com
Mon Dec 10 17🔞46 UTC 2018
- Previous message (by thread): [PATCH v3] Add support for SoftFloat library on ARM
- Next message (by thread): [PATCH v3] Add support for SoftFloat library on ARM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Magnus,
Thanks for your review!
Jakub
On 2018-12-10 at 15:16 +0100, Magnus Ihse Bursie wrote:
On 2018-12-08 14:34, Jakub Vaněk wrote: > Hi, > > I'm sending an updated patch. Changes: > > * I have changed NEEDSLIBSOFTFLOAT to USESLIBSOFTFLOAT. > * I have added a --enable-softfloat option for enabling/disabling > the > library. I have also added a --with-softfloat option for linking > from a > prefix. > * I have updated the documentation. I prefer using --with- > softfloat- > include and --with-softfloat-lib here, because SoftFloat itself has > no > install rules and the library is built into the build/???/ > directory. > * I have added a test to check if the library works. > * I have added a SoftFloat license + exclusion code, because it is > linked statically. > > I have sent a jdk author request to Mark Reinhold, but I haven't > got a > reply yet. > > However the patch can be found also here: > https://github.com/ev3dev-lang-java/openjdk-ev3/blob/9eab3db7c865d763bf518fe0110bc81c14fd42e6/upstream/softfloat.patch The build changes all look good to me. I can't comment on the Hotspot ARM code. /Magnus > > The patch was successfully built here: > https://ci.adoptopenjdk.net/view/ev3dev/job/openjdk12buildev3linux/56/ > > Thanks, > > Jakub > > # HG changeset patch > # User Jakub Vaněk <linuxtardis at gmail.com> > # Date 1544273385 -3600 > # Sat Dec 08 13:49:45 2018 +0100 > # Node ID 2dda78cf712d402b53df779325e8b8f23b487be2 > # Parent 583fd71c47d60dea883b1f03d9f1b2c267c0a891 > Add support for compiling with SoftFloat-3e on arm sflt builds > > diff --git a/doc/building.html b/doc/building.html > --- a/doc/building.html > +++ b/doc/building.html > @@ -53,6 +53,7 @@ >
> + > +X11 >ALSA >libffi > +SoftFloat > >Build Tools > Requirements>
Autoconf > @@ -415,6 +416,14 @@ >To install on an rpm-based Linux, try running > install libffi-devel. > >sudo yum
Use
>--with-libffi=
ifconfigure
does not properly locate your libffi > files.SoftFloat
> + > SoftFloat-3 can be used on ARM processors without FPU to slightly enhance the arithmetic precision of some floating point operations. It is not required, system softfp routines can be used without any problems. The precision loss is extremely small, but the JCK detects it. > +> +
To build the library, you will have to download its source and > build it for the target platform. To do so, take a look in its >build/Linux-ARM-VFPv2-GCC
subdirectory. > + > +Use
> library. You can then use--enable-softfloat
to enable the use of this--with-softfloat-
> lib=and > include=--with-softfloat-
to specify the path to the >softfloat.a
archive and the >source/include
directory. Alternatively, if you > install the library and its headers to a prefix, you can pass its > path to--with-softfloat=
. > +If you do not enable this library, standard system libraries
> will be used instead. >Build Tools Requirements
>Autoconf
>The JDK requires Autoconf;; on all
> platforms. At least version 2.69 is required. > @@ -486,6 +495,8 @@ >> --with-x=
- Set the path to href="#x11">X11> --with-alsa=
- Set the path to href="#alsa">ALSA> + --with-libffi=
- Set the path to href="#libffi">libffi> SoftFloat library on sflt builds. > + --enable-softfloat
- Enable the use of external> softfloat-lib= --with-softfloat=
or--with-
, > include=--with-softfloat-
- Set the path to href="#softfloat">SoftFloat library and include directory. >> JTReg. See Running Tests > > --with-jtreg=
- Set the path toCertain third-party libraries used by the JDK (libjpeg,
> giflib, libpng, lcms and zlib) are included in the JDK repository. > The default behavior of the JDK build is to use this version of > these libraries, but they might be replaced by an external version. > To do so, specifysystem
as the >option in these arguments. (The default > is
bundled
). > diff --git a/doc/building.md b/doc/building.md > --- a/doc/building.md > +++ b/doc/building.md > @@ -527,6 +527,28 @@ > Use--with-libffi=<path>
ifconfigure
does not properly > locate your libffi > files. > > +### SoftFloat > + > +[Berkeley SoftFloat-3](_ _> http://www.jhauser.us/arithmetic/SoftFloat.html) > +can be used on ARM processors without FPU to slightly enhance > +the arithmetic precision of some floating point operations. It is > not > +required, system softfp routines can be used without any problems. > +The precision loss is extremely small, but [the JCK detects it](_ _> +_ _> http://mail.openjdk.java.net/pipermail/aarch32-port-dev/2016-November/000611.html > ). > + > + * To build the library, you will have to download its source and > build it > + for the target platform. To do so, take a look in its > +build/Linux-ARM-VFPv2-GCC
subdirectory. > + > +Use--enable-softfloat
to enable the use of this library. You > can then > +use--with-softfloat-lib=<path>
and--with-softfloat-_ _> include=<path>
> +to specify the path to thesoftfloat.a
archive and the >source/include
> +directory. Alternatively, if you install the library and its > headers to > +a prefix, you can pass its path to--with-softfloat=<path>
. > + > +If you do not enable this library, standard system libraries > +will be used instead. > + > ## Build Tools Requirements > > ### Autoconf > @@ -694,6 +716,10 @@ > *--with-x=<path>
- Set the path to X11 > *--with-alsa=<path>
- Set the path to ALSA > *--with-libffi=<path>
- Set the path to libffi > + *--enable-softfloat
- Enable the use of external > SoftFloat > + library on sflt builds. > + *--with-softfloat=<path>
or--with-softfloat-lib=<path>
,-_ _> -with-softfloat-include=<path>
- > + Set the path to SoftFloat library and include > directory. > *--with-jtreg=<path>
- Set the path to JTReg. See [Running_ _> Tests](_ _> #running-tests) > > diff --git a/make/autoconf/lib-softfloat.m4 b/make/autoconf/lib- > softfloat.m4 > new file mode 100644 > --- /dev/null > +++ b/make/autoconf/lib-softfloat.m4 > @@ -0,0 +1,149 @@ > +# > +# Copyright (c) 2018, Oracle and/or its affiliates. All rights > reserved. > +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > +# > +# This code is free software; you can redistribute it and/or > modify it > +# under the terms of the GNU General Public License version 2 > only, as > +# published by the Free Software Foundation. Oracle designates > this > +# particular file as subject to the "Classpath" exception as > provided > +# by Oracle in the LICENSE file that accompanied this code. > +# > +# This code is distributed in the hope that it will be useful, but > WITHOUT > +# ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or > +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public > License > +# version 2 for more details (a copy is included in the LICENSE > file that > +# accompanied this code). > +# > +# You should have received a copy of the GNU General Public > License version > +# 2 along with this work; if not, write to the Free Software > Foundation, > +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > +# > +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA > 94065 USA > +# or visit www.oracle.com if you need additional information or > have any > +# questions. > +# > + > +################################################################## > ############## > +# Setup softfloat library > +################################################################## > ############## > +ACDEFUNONCE([LIBSETUPSOFTFLOAT], > +[ > + # define options > + ACARGENABLE(softfloat, [ASHELPSTRING([--enable-softfloat], > + [enable use of SoftFloat-3 on softfp builds])]) > + > + ACARGWITH(softfloat, [ASHELPSTRING([--with-softfloat], > + [specify prefix directory for the softfloat package > + (expecting softfloat.a under PATH/lib and softfloat.h under > PATH/include)])]) > + > + ACARGWITH(softfloat-lib, [ASHELPSTRING([--with-softfloat- > lib], > + [specify the path to SoftFloat-3 static library])]) > + > + ACARGWITH(softfloat-include, [ASHELPSTRING([--with- > softfloat-include], > + [specify the path to SoftFloat-3 include directory])]) > + > + # check if softfloat can be used and if the user enabled it > + ACMSGCHECKING([if softfloat library should be used]) > + if test "x$USESLIBSOFTFLOAT" = "xtrue"; then > + > + if test "x$enablesoftfloat" = "x" || test > "x$enablesoftfloat" = "xno"; then > + ACMSGRESULT([no, system softfp used]) > + ACMSGNOTICE([Floating point operations may be less precise > by a very small amount]) > + SOFTFLOATENABLED=no > + > + elif test "x$enablesoftfloat" = "xyes"; then > + ACMSGRESULT([yes]) > + SOFTFLOATENABLED=yes > + else > + ACMSGERROR([Invalid value for --enable-softfloat]) > + fi > + > + else > + ACMSGRESULT([no, not needed]) > + if test "x${enablesoftfloat}" != x && test > "x${enablesoftfloat}" != xno; then > + ACMSGWARN([[not building for sflt, so --enable-softfloat > is ignored]]) > + fi > + if test "x${withsoftfloat}" != x && test "x${withsoftfloat}" > != xno; then > + ACMSGWARN([[not building for sflt, so --with-softfloat is > ignored]]) > + fi > + if test "x${withsoftfloatlib}" != x && test > "x${withsoftfloatlib}" != xno; then > + ACMSGWARN([[not building for sflt, so --with-softfloat-lib > is ignored]]) > + fi > + if test "x${withsoftfloatinclude}" != x && test > "x${withsoftfloatinclude}" != xno; then > + ACMSGWARN([[not building for sflt, so --with-softfloat- > include is ignored]]) > + fi > + SOFTFLOATENABLED=no > + fi > + > + # if the library can be used and the user wants it, find it and > test it > + if test "x$SOFTFLOATENABLED" = "xyes"; then > + SOFTFLOATFOUND=no > + > + if test "x${withsoftfloat}" = xno || test > "x${withsoftfloatlib}" = xno || test "x${withsoftfloatinclude}" > = xno; then > + ACMSGERROR([Please do not combine --enable-softfloat and > --without-softfloat* options.]) > + fi > + > + if test "x${withsoftfloat}" != x; then > + SOFTFLOATCFLAGS="-I${withsoftfloat}/include > -DSOFTFLOATEXTERNAL" > + SOFTFLOATLIBS="${withsoftfloat}/lib/softfloat.a" > + SOFTFLOATFOUND=yes > + fi > + if test "x${withsoftfloatinclude}" != x; then > + SOFTFLOATCFLAGS="-I${withsoftfloatinclude} > -DSOFTFLOATEXTERNAL" > + SOFTFLOATFOUND=yes > + fi > + if test "x${withsoftfloatlib}" != x; then > + SOFTFLOATLIBS="${withsoftfloatlib}" > + SOFTFLOATFOUND=yes > + fi > + if test "x$SOFTFLOATFOUND" = xno; then > + ACCHECKHEADERS([softfloat.h], > + [ > + SOFTFLOATFOUND=yes > + SOFTFLOATCFLAGS="-DSOFTFLOATEXTERNAL" > + SOFTFLOATLIBS="-l:softfloat.a" > + ], > + [SOFTFLOATFOUND=no] > + ) > + fi > + if test "x$SOFTFLOATFOUND" = xno; then > + HELPMSGMISSINGDEPENDENCY([softfloat]) > + ACMSGERROR([Could not find softfloat! $HELPMSG]) > + else > + ACMSGCHECKING([for softfloat library]) > + ACMSGRESULT([$SOFTFLOATLIBS]) > + > + ACMSGCHECKING([for softfloat compiler flags]) > + ACMSGRESULT([$SOFTFLOATCFLAGS]) > + fi > + > + ACMSGCHECKING([if softfloat works]) > + ACLANGPUSH(C) > + OLDCFLAGS="$CFLAGS" > + CFLAGS="$CFLAGS $SOFTFLOATCFLAGS" > + OLDLIBS="$LIBS" > + LIBS="$LIBS $SOFTFLOATLIBS" > + ACLINKIFELSE([ACLANGPROGRAM([#include <softfloat.h>], > + [ > + return f32toi32(f32sub(i32tof32(1), i32tof32(1)), > softfloatroundneareven, false); > + ])], > + [SOFTFLOATWORKS=yes], > + [SOFTFLOATWORKS=no] > + ) > + CFLAGS="$OLDCFLAGS" > + LIBS="$OLDLIBS" > + ACLANGPOP(C) > + ACMSGRESULT([$SOFTFLOATWORKS]) > + > + if test "x$SOFTFLOATWORKS" = xno; then > + HELPMSGMISSINGDEPENDENCY([softfloat]) > + ACMSGERROR([Found softfloat but could not link and compile > with it. $HELPMSG]) > + fi > + else > + SOFTFLOATCFLAGS= > + SOFTFLOATLIBS= > + fi > + > + ACSUBST(SOFTFLOATLIBS) > + ACSUBST(SOFTFLOATCFLAGS) > +]) > diff --git a/make/autoconf/libraries.m4 > b/make/autoconf/libraries.m4 > --- a/make/autoconf/libraries.m4 > +++ b/make/autoconf/libraries.m4 > @@ -33,6 +33,7 @@ > m4include([lib-x11.m4]) > m4include([lib-fontconfig.m4]) > m4include([lib-tests.m4]) > +m4include([lib-softfloat.m4]) > > > ################################################################### > ############# > # Determine which libraries are needed for this configuration > @@ -79,6 +80,13 @@ > NEEDSLIBALSA=false > fi > > + if (test "x$OPENJDKTARGETCPU" == xarm && > + (test "x$ARMFLOATTYPE" = "xsflt" || test > "x$ARMFLOATTYPE" = "xvfp-sflt" )); then > + USESLIBSOFTFLOAT=true > + else > + USESLIBSOFTFLOAT=false > + fi > + > # Check if ffi is needed > if HOTSPOTCHECKJVMVARIANT(zero); then > NEEDSLIBFFI=true > @@ -98,6 +106,7 @@ > LIBSETUPFONTCONFIG > LIBSETUPFREETYPE > LIBSETUPALSA > + LIBSETUPSOFTFLOAT > LIBSETUPLIBFFI > LIBSETUPBUNDLEDLIBS > LIBSETUPMISCLIBS > diff --git a/make/autoconf/spec.gmk.in b/make/autoconf/spec.gmk.in > --- a/make/autoconf/spec.gmk.in > +++ b/make/autoconf/spec.gmk.in > @@ -353,6 +353,8 @@ > CUPSCFLAGS:=@CUPSCFLAGS@ > ALSALIBS:=@ALSALIBS@ > ALSACFLAGS:=@ALSACFLAGS@ > +SOFTFLOATLIBS:=@SOFTFLOATLIBS@ > +SOFTFLOATCFLAGS:=@SOFTFLOATCFLAGS@ > LIBFFILIBS:=@LIBFFILIBS@ > LIBFFICFLAGS:=@LIBFFICFLAGS@ > ENABLELIBFFIBUNDLING:=@ENABLELIBFFIBUNDLING@ > diff --git a/make/copy/Copy-java.base.gmk b/make/copy/Copy- > java.base.gmk > --- a/make/copy/Copy-java.base.gmk > +++ b/make/copy/Copy-java.base.gmk > @@ -219,6 +219,10 @@ > LEGALEXCLUDES += zlib.md > endif > > +ifeq ($(SOFTFLOATLIBS), ) > + LEGALEXCLUDES += softfloat.md > +endif > + _> (eval(eval (eval(call SetupCopyLegalFiles, COPYLEGAL, _ _> EXCLUDES := $(LEGALEXCLUDES), _ > )) > diff --git a/make/hotspot/lib/CompileJvm.gmk > b/make/hotspot/lib/CompileJvm.gmk > --- a/make/hotspot/lib/CompileJvm.gmk > +++ b/make/hotspot/lib/CompileJvm.gmk > @@ -49,6 +49,7 @@ > _> JVMLIBS += _ _> $(JVMLIBSFEATURES) _ _> + $(SOFTFLOATLIBS) _ > # > > # These files and directories are always excluded > diff --git a/make/hotspot/lib/JvmFlags.gmk > b/make/hotspot/lib/JvmFlags.gmk > --- a/make/hotspot/lib/JvmFlags.gmk > +++ b/make/hotspot/lib/JvmFlags.gmk > @@ -88,6 +88,7 @@ _> $(JVMCFLAGSTARGETDEFINES) _ _> $(JVMCFLAGSFEATURES) _ _> $(JVMCFLAGSINCLUDES) _ _> + $(SOFTFLOATCFLAGS) _ _> $(EXTRACFLAGS) _ > # > > diff --git a/src/hotspot/cpu/arm/assemblerarm32.hpp > b/src/hotspot/cpu/arm/assemblerarm32.hpp > --- a/src/hotspot/cpu/arm/assemblerarm32.hpp > +++ b/src/hotspot/cpu/arm/assemblerarm32.hpp > @@ -1242,10 +1242,10 @@ > > // Imported code from glibc soft-fp bundle for > // calculation accuracy improvement. See CR 6757269. _> -extern double aeabifaddglibc(float, float); _> -extern double aeabifsubglibc(float, float); _> -extern double aeabidaddglibc(double, double); _> -extern double aeabidsubglibc(double, double); _> +extern float aeabifaddextlib(float, float); _> +extern float aeabifsubextlib(float, float); _> +extern double aeabidaddextlib(double, double); _> +extern double aeabidsubextlib(double, double); > }; > #endif // SOFTFP > > diff --git a/src/hotspot/cpu/arm/c1LIRGeneratorarm.cpp > b/src/hotspot/cpu/arm/c1LIRGeneratorarm.cpp > --- a/src/hotspot/cpu/arm/c1LIRGeneratorarm.cpp > +++ b/src/hotspot/cpu/arm/c1LIRGeneratorarm.cpp > @@ -490,27 +490,28 @@ > // Call function compiled with -msoft-float. > _> // aeabiXXXXglibc: Imported code from glibc soft-fp > bundle for calculation accuracy improvement. See CR 6757269. > + // > http://mail.openjdk.java.net/pipermail/aarch32-port-dev/2016-November/000611.html > > case Bytecodes::fadd: > - runtimefunc = CASTFROMFNPTR(address, _> aeabifaddglibc); > + runtimefunc = CASTFROMFNPTR(address, _> aeabifaddextlib); > break; > case Bytecodes::fmul: _> runtimefunc = CASTFROMFNPTR(address, aeabifmul); > break; > case Bytecodes::fsub: > - runtimefunc = CASTFROMFNPTR(address, _> aeabifsubglibc); > + runtimefunc = CASTFROMFNPTR(address, _> aeabifsubextlib); > break; > case Bytecodes::fdiv: _> runtimefunc = CASTFROMFNPTR(address, aeabifdiv); > break; > case Bytecodes::dadd: > - runtimefunc = CASTFROMFNPTR(address, _> aeabidaddglibc); > + runtimefunc = CASTFROMFNPTR(address, _> aeabidaddextlib); > break; > case Bytecodes::dmul: _> runtimefunc = CASTFROMFNPTR(address, aeabidmul); > break; > case Bytecodes::dsub: > - runtimefunc = CASTFROMFNPTR(address, _> aeabidsubglibc); > + runtimefunc = CASTFROMFNPTR(address, _> aeabidsubextlib); > break; > case Bytecodes::ddiv: _> runtimefunc = CASTFROMFNPTR(address, aeabiddiv); > diff --git a/src/hotspot/cpu/arm/c1Runtime1arm.cpp > b/src/hotspot/cpu/arm/c1Runtime1arm.cpp > --- a/src/hotspot/cpu/arm/c1Runtime1arm.cpp > +++ b/src/hotspot/cpu/arm/c1Runtime1arm.cpp > @@ -804,15 +804,16 @@ _> #define FUNCTIONCASE(a, f) _ > if ((intptrt)a == CASTFROMFNPTR(intptrt, f)) return #f > _> - FUNCTIONCASE(entry, aeabifaddglibc); _> + // aeabiXXXXglibc: Imported code from glibc soft-fp bundle > for calculation accuracy improvement. See CR 6757269. > + // > http://mail.openjdk.java.net/pipermail/aarch32-port-dev/2016-November/000611.html _> + FUNCTIONCASE(entry, aeabifaddextlib); _> FUNCTIONCASE(entry, aeabifmul); _> - FUNCTIONCASE(entry, aeabifsubglibc); _> + FUNCTIONCASE(entry, aeabifsubextlib); _> FUNCTIONCASE(entry, aeabifdiv); > _> - // aeabiXXXXglibc: Imported code from glibc soft-fp bundle > for calculation accuracy improvement. See CR 6757269. _> - FUNCTIONCASE(entry, aeabidaddglibc); _> + FUNCTIONCASE(entry, aeabidaddextlib); _> FUNCTIONCASE(entry, aeabidmul); _> - FUNCTIONCASE(entry, aeabidsubglibc); _> + FUNCTIONCASE(entry, aeabidsubextlib); _> FUNCTIONCASE(entry, aeabiddiv); > _> FUNCTIONCASE(entry, aeabif2d); > diff --git a/src/hotspot/cpu/arm/softfloatarm.cpp > b/src/hotspot/cpu/arm/softfloatarm.cpp > new file mode 100644 > --- /dev/null > +++ b/src/hotspot/cpu/arm/softfloatarm.cpp > @@ -0,0 +1,112 @@ > +/* > + * Copyright (c) 2018, Oracle and/or its affiliates. All rights > reserved. > + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. > + * > + * This code is free software; you can redistribute it and/or > modify it > + * under the terms of the GNU General Public License version 2 > only, as > + * published by the Free Software Foundation. > + * > + * This code is distributed in the hope that it will be useful, > but WITHOUT > + * ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or > + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public > License > + * version 2 for more details (a copy is included in the LICENSE > file that > + * accompanied this code). > + * > + * You should have received a copy of the GNU General Public > License version > + * 2 along with this work; if not, write to the Free Software > Foundation, > + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. > + * > + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA > 94065 USA > + * or visit www.oracle.com if you need additional information or > have any > + * questions. > + * > + */ > + > +#ifdef SOFTFP > + > +// Soft float function declarations > +extern "C" { _> + extern float aeabifadd(float, float); _> + extern float aeabifsub(float, float); _> + extern double aeabidadd(double, double); _> + extern double aeabidsub(double, double); > + _> + extern float aeabifaddextlib(float, float); _> + extern float aeabifsubextlib(float, float); _> + extern double aeabidaddextlib(double, double); _> + extern double aeabidsubextlib(double, double); > +}; > + > +#ifdef SOFTFLOATEXTERNAL > + > +extern "C" { > +#include "softfloat.h" > +} > + > +#include > + _> +static float aeabifloathandling(float natA, float natB, bool > add) { > + float32t libA; > + float32t libB; > + float32t libC; > + float natC; > + > + memcpy(&libA, &natA, sizeof(libA)); > + memcpy(&libB, &natB, sizeof(libB)); > + libC = add ? f32add(libA, libB) : f32sub(libA, libB); > + memcpy(&natC, &libC, sizeof(libC)); > + > + return natC; > +} > + _> +static double aeabidoublehandling(double natA, double natB, > bool add) { > + float64t libA; > + float64t libB; > + float64t libC; > + double natC; > + > + memcpy(&libA, &natA, sizeof(libA)); > + memcpy(&libB, &natB, sizeof(libB)); > + libC = add ? f64add(libA, libB) : f64sub(libA, libB); > + memcpy(&natC, &libC, sizeof(libC)); > + > + return natC; > +} > + _> +float aeabifaddextlib(float a, float b) { _> + return aeabifloathandling(a, b, true); > +} > + _> +float aeabifsubextlib(float a, float b) { _> + return aeabifloathandling(a, b, false); > +} > + _> +double aeabidaddextlib(double a, double b) { _> + return aeabidoublehandling(a, b, true); > +} > + _> +double aeabidsubextlib(double a, double b) { _> + return aeabidoublehandling(a, b, false); > +} > + > +#else > + _> +float aeabifaddextlib(float a, float b) { _> + return aeabifadd(a, b); > +} > + _> +float aeabifsubextlib(float a, float b) { _> + return aeabifsub(a, b); > +} > + _> +double aeabidaddextlib(double a, double b) { _> + return aeabidadd(a, b); > +} > + _> +double aeabidsubextlib(double a, double b) { _> + return aeabidsub(a, b); > +} > + > +#endif > + > +#endif // SOFTFP > diff --git a/src/hotspot/cpu/arm/templateTablearm.cpp > b/src/hotspot/cpu/arm/templateTablearm.cpp > --- a/src/hotspot/cpu/arm/templateTablearm.cpp > +++ b/src/hotspot/cpu/arm/templateTablearm.cpp > @@ -1610,8 +1610,10 @@ > _ mov(R1, R0tos); > _ popi(R0); > switch (op) { > - case add: _ callVMleaf(CASTFROMFNPTR(address, _> aeabifaddglibc), R0, R1); break; > - case sub: _ callVMleaf(CASTFROMFNPTR(address, _> aeabifsubglibc), R0, R1); break; _> + // aeabiXXXXglibc: Imported code from glibc soft-fp bundle > for calculation accuracy improvement. See CR 6757269. > + // > http://mail.openjdk.java.net/pipermail/aarch32-port-dev/2016-November/000611.html > + case add: _ callVMleaf(CASTFROMFNPTR(address, _> aeabifaddextlib), R0, R1); break; > + case sub: _ callVMleaf(CASTFROMFNPTR(address, _> aeabifsubextlib), R0, R1); break; > case mul: _ callVMleaf(CASTFROMFNPTR(address, _> aeabifmul), R0, R1); break; > case div: _ callVMleaf(CASTFROMFNPTR(address, _> aeabifdiv), R0, R1); break; > case rem: _ callVMleaf(CASTFROMFNPTR(address, > SharedRuntime::frem), R0, R1); break; > @@ -1653,8 +1655,9 @@ > _ popl(R0, R1); > switch (op) { _> // aeabiXXXXglibc: Imported code from glibc soft-fp > bundle for calculation accuracy improvement. See CR 6757269. > - case add: _ callVMleaf(CASTFROMFNPTR(address, _> aeabidaddglibc), R0, R1, R2, R3); break; > - case sub: _ callVMleaf(CASTFROMFNPTR(address, _> aeabidsubglibc), R0, R1, R2, R3); break; > + // > http://mail.openjdk.java.net/pipermail/aarch32-port-dev/2016-November/000611.html > + case add: _ callVMleaf(CASTFROMFNPTR(address, _> aeabidaddextlib), R0, R1, R2, R3); break; > + case sub: _ callVMleaf(CASTFROMFNPTR(address, _> aeabidsubextlib), R0, R1, R2, R3); break; > case mul: _ callVMleaf(CASTFROMFNPTR(address, _> aeabidmul), R0, R1, R2, R3); break; > case div: _ callVMleaf(CASTFROMFNPTR(address, _> aeabiddiv), R0, R1, R2, R3); break; > case rem: _ callVMleaf(CASTFROMFNPTR(address, > SharedRuntime::drem), R0, R1, R2, R3); break; > diff --git a/src/java.base/share/legal/softfloat.md > b/src/java.base/share/legal/softfloat.md > new file mode 100644 > --- /dev/null > +++ b/src/java.base/share/legal/softfloat.md > @@ -0,0 +1,40 @@ > +## SoftFloat-3e > + > +### SoftFloat license > +_ _> +License for Berkeley SoftFloat Release 3e_ _> +_ _> +John R. Hauser_ _> +2018 January 20_ _> +_ _> +The following applies to the whole of SoftFloat Release 3e as well_ _> as to_ _> +each source file individually._ _> +_ _> +Copyright 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 The_ _> Regents of the_ _> +University of California. All rights reserved._ _> +_ _> +Redistribution and use in source and binary forms, with or without_ _> +modification, are permitted provided that the following conditions_ _> are met:_ _> +_ _> + 1. Redistributions of source code must retain the above copyright_ _> notice,_ _> + this list of conditions, and the following disclaimer._ _> +_ _> + 2. Redistributions in binary form must reproduce the above_ _> copyright_ _> + notice, this list of conditions, and the following disclaimer_ _> in the_ _> + documentation and/or other materials provided with the_ _> distribution._ _> +_ _> + 3. Neither the name of the University nor the names of its_ _> contributors_ _> + may be used to endorse or promote products derived from this_ _> software_ _> + without specific prior written permission._ _> +_ _> +THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS "AS IS",_ _> AND ANY_ _> +EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE_ _> IMPLIED_ _> +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR_ _> PURPOSE, ARE_ _> +DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE_ _> LIABLE FOR ANY_ _> +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL_ _> DAMAGES_ _> +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR_ _> SERVICES;_ _> +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER_ _> CAUSED AND_ _> +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,_ _> OR TORT_ _> +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE_ _> USE OF_ _> +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE._ _> +
>
- Previous message (by thread): [PATCH v3] Add support for SoftFloat library on ARM
- Next message (by thread): [PATCH v3] Add support for SoftFloat library on ARM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]