This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Java floating-point mess
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Robert Dewar <dewar at gnat dot com>, gcc at gcc dot gnu dot org, java at gcc dot gnu dot org
- Date: Fri, 5 Apr 2002 10:15:37 +0100 (BST)
- Subject: Re: Java floating-point mess
- References: <20020404115615.04DBBF28C0@nile.gnat.com><20020404205724.GB14253@codesourcery.com>
Zack Weinberg writes:
> On Thu, Apr 04, 2002 at 06:56:15AM -0500, Robert Dewar wrote:
> > <<The Java front end has a number of places that assume not only that
> > the host and target floating point formats are identical, but that
> > both are IEEE. I've tried to get rid of them, but run afoul of its
> > not being possible to link real.o into gcjh -- it wants to drag in
> > most of the back end.
> > >>
> >
> > Presumably the complaint is about assuming that the host fpt
> > format is IEEE, the target fpt format presumably MUST be IEEE,
> > since this is required by Java, no?
>
> Well, the Java front end doesn't appear to take any special care to
> ensure that SFmode is IEEE single and DFmode double. (We'd have to
> have a floating point emulator library built into libjava that
> implemented IEEE fp, to get it right for non-IEEE targets.) But yes,
> the code I'm looking at right now is only for the host side.
>
> Thinking out loud... The major problem is with gjavah, which wants to
> read in a .class file and print out things like
>
> const jdouble pi = 3.1415926... ;
>
> which are then going to be interpreted by the C++ compiler -- come to
> think of it, there is no way to win here on a non-IEEE target.
Right -- Java requires that the target FP format be IEEE. We don't
support Java on non-IEEE targets. We can solve any build problems by
not building Java on hosts that are non-IEEE.
The only issue here is that we won't be able to cross-compile Java on
a VAX or somesuch, isn't it? Or am I missing something here?
Andrew.