[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [commit-cp] [bugs #9895] double to int conversion problem
From: |
Robert Lougher |
Subject: |
Re: [commit-cp] [bugs #9895] double to int conversion problem |
Date: |
Thu, 5 Aug 2004 18:14:01 +0100 |
Hi,
Yes, I do have a fix for this and a couple of other minor issues.
I've been delaying a 1.1.5 release because of an impending (i.e. for
the last 2 weeks) test 1.2.0 release which includes a rewritten
interpreter. I've got the last couple of bugs out and it's giving a
speed increase of between 30-50% (on PIII). On some very unrealistic
microbenchmarks it's 2.5 times faster!
The reason for the delay is that I wanted two streams : a stable 1.1.5
and a test 1.2.0. However if I release 1.1.5 before 1.2.0 I didn't
want people thinking it supercedes 1.1.5...
Mark, are you interested in testing 1.2.0? I've only got access to a
PIII (via sourceforge compile-farm). So it'll be useful if it can be
tried on a larger range of IA32 chips (e.g. AMD/PIV).
Anyway, baring disasters 1.1.5 and 1.2.0-test will be out Fri/Saturday :)
Rob.
On Thu, 05 Aug 2004 18:42:21 +0200, Mark Wielaard <address@hidden> wrote:
> Hi,
>
> On Thu, 2004-08-05 at 17:05, Archie Cobbs wrote:
> > David Gilbert wrote:
> > > public class DoubleToIntTest {
> > > public static void main(String args[]) {
> > > double v = Integer.MAX_VALUE + 100000.0;
> > > System.out.println((int) v);
> > > Double d = new Double(v);
> > > System.out.println(d.intValue());
> > > }
> > > }
> > >
> > > With Classpath (fairly recent CVS) running on JamVM 1.1.4 (on SuSE 9.1),
> > > I see the following output:
> > >
> > > -2147483648
> > > -2147483648
> > >
> > > Using Sun's JDK 1.4, the output is:
> > >
> > > 2147483647
> > > 2147483647
> >
> > I think this is a VM bug rather than a Classpath bug (JC has the same
> > bug). It results from doing the jdouble -> jint conversion in C via
> > a `(jint)d' cast.
> >
> > JC generates this code (edited)...
> >
> > jdouble d2;
> > jint i1;
> >
> > d2 = _JC_DCONST(0x41, 0xe0, 0x0, 0x30, 0xd3, 0xe0, 0x0, 0x0);
> > ...
> > i1 = (jint)d2;
> > ...
> >
> > I'm still curious what the solution is though :-)
>
> I reported a similar issue against jamvm and Robert created a patch for
> it. But I see there is no new jamvm (1.1.5) yet.
>
> Cheers,
>
> Mark
>
>
>