[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] 64-bit dtoa - strtod fix

From: Christian Thalinger
Subject: [PATCH] 64-bit dtoa - strtod fix
Date: Sun, 11 Jan 2004 17:28:23 +0100

We are building a java jit called cacao
( which now uses the gnu
classpath. On our 64-bit ports we had problems with dtoa and strtod
functions. After a long night of debugging, i found the problem: it
seems that in mprec.h

#define MAX_BIGNUM_WDS 32

is too small for some floats. The amount can grow up to 48, as my
debugging showed. On i386 systems where Pack_32 is defined, it seems to
be ok. But Pack_32 does not work on 64-bit systems.

This bug is hit, when you try to execute this small code

class test {
    public static void main(String[] argv) {

with gij (gcc-3.3.2) on x86_64. Defining

#define MAX_BIGNUM_WDS 64

shows the expected result with our jit. I don't know if 64 is a
reasonable number, but when not packing 32-bit in a long but 16-bit,
twice as much should be ok.

This is also cross-posted to address@hidden


--- classpath-0.07/native/fdlibm/mprec.h        2001-11-05
03:56:47.000000000 +0100
+++ cacaodev/gnuclasspath/native/fdlibm/mprec.h 2004-01-11
17:17:55.000000000 +0100
@@ -295,7 +298,12 @@

#define MAX_BIGNUMS 16
+#ifndef Pack_32
+#define MAX_BIGNUM_WDS 64
#define MAX_BIGNUM_WDS 32

struct _Jv_Bigint

reply via email to

[Prev in Thread] Current Thread [Next in Thread]