bug-classpath
[Top][All Lists]
Advanced

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

[Bug classpath/27142] New: _dtoa routine for floats on ARM requires #def


From: gccbugzilla at themastermind1 dot net
Subject: [Bug classpath/27142] New: _dtoa routine for floats on ARM requires #define Just_16
Date: 13 Apr 2006 09:38:01 -0000

All references to ARM in the bug report refer specifically to the Gumstix SBC
which features a Intel XScaleĀ® PXA255 (32-bit little-endian ARM v5TE
processor).

The following test program is used in the rest of the bug report:

address@hidden:~# cat testfloat.java
class testfloat {
        public static void main (String args[]) {
                double d = 1.0, d2 = 100.0, d3 = 0.5, d4 = 5.0, d5 = 5.2;
                int i = (int) d, i2 = (int) d2, i3 = (int) d3, i4 = (int) d4,
                        i5 = (int) d5;

                System.out.println(d + " " + i);
                System.out.println(d2 + " " + i2);
                System.out.println(d3 + " " + i3);
                System.out.println(d4 + " " + i4);
                System.out.println(d5 + " " + i5);

                test();
        }
        public static void test () {
                System.out.println(0.1);
                double n = 0.1;
                n = n + 0.2;
                int o = (int)(n  *  100);
                System.out.println(o);
        }
}

NOTE: jikes does NOT produce proper bytecode for floats on ARM. All tests were
performed with .class files compiled on an x86 machine.

sun java jre on x86 machine:

localhost tmp # java testfloat
1.0 1
100.0 100
0.5 0
5.0 5
5.2 5
0.1
30

gnuclasspath-0.90 tested with jamvm 1.4.2 without any patches or debugging:

address@hidden:~# jamvm testfloat
1.0 1
100.0 100
0.2 0
5.0 5
6.2:::940568:25677 5
0.00000103455646584
30

gnuclasspath-0.90 compiled with --enable-debug and tested with jamvm 1.4.2
without any patches:

address@hidden:~# jamvm testfloat
java.lang.Double.initIDs() POSITIVE_INFINITY = inf
java.lang.Double.initIDs() NEGATIVE_INFINITY = -inf
java.lang.Double.initIDs() NaN = nan
java.lang.VMDouble.toString (1)
1.0 1
java.lang.VMDouble.toString (100)
100.0 100
java.lang.VMDouble.toString (0.5)
oversize b in quorem

The "oversize b in quorem" bug is triggered in in native/fdlibm/dtoa.c:49 in
the code:

 n = S->_wds;
#ifdef DEBUG
 /*debug*/ if (b->_wds > n)
   /*debug*/ Bug ("oversize b in quorem");
#endif
 if (b->_wds < n)

gnuclasspath-0.90 compiled with --enable-debug and patched with a "#define
Just_16" in native/fdlibm/mprec.h and tested with jamvm 1.4.2:

address@hidden:~# java testfloat
java.lang.Double.initIDs() POSITIVE_INFINITY = inf
java.lang.Double.initIDs() NEGATIVE_INFINITY = -inf
java.lang.Double.initIDs() NaN = nan
java.lang.VMDouble.toString (1)
1.0 1
java.lang.VMDouble.toString (100)
100.0 100
java.lang.VMDouble.toString (0.5)
0.5 0
java.lang.VMDouble.toString (5)
5.0 5
java.lang.VMDouble.toString (5.2)
5.2 5
java.lang.VMDouble.toString (0.1)
0.1
30

NOTE: Again, jikes does not produce proper bytecode for floats on ARM. So far
only classpath-0.90 + jamvm 1.4.2 + eclipse-ecj.jar works for compiling
bytecode on ARM.


-- 
           Summary: _dtoa routine for floats on ARM requires #define Just_16
           Product: classpath
           Version: 0.90
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: classpath
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gccbugzilla at themastermind1 dot net
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: arm-oe-linux-uclibc
GCC target triplet: arm-oe-linux-uclibc


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27142





reply via email to

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