Double.java (doubleToRawLongBits): Now native.
authorBryce McKinlay <bryce@albatross.co.nz>
Fri, 9 Feb 2001 22:13:33 +0000 (22:13 +0000)
committerBryce McKinlay <bryce@gcc.gnu.org>
Fri, 9 Feb 2001 22:13:33 +0000 (22:13 +0000)
* java/lang/Double.java (doubleToRawLongBits): Now native.
* java/lang/Float.java (floatToRawIntBits): Likewise.
* java/lang/natDouble.cc (doubleToRawLongBits): New method.
* java/lang/natFloat.cc (floatToRawIntBits): Likewise.

From-SVN: r39572

libjava/ChangeLog
libjava/java/lang/Double.java
libjava/java/lang/Float.java
libjava/java/lang/natDouble.cc
libjava/java/lang/natFloat.cc

index e1fdd1f103b1a2c396fe197347135c8cef667bf8..e1002bffdfcba0b5b3774bb6ed1e35a9675e5a67 100644 (file)
@@ -1,3 +1,10 @@
+2001-02-09  Bryce McKinlay  <bryce@albatross.co.nz>
+
+       * java/lang/Double.java (doubleToRawLongBits): Now native.
+       * java/lang/Float.java (floatToRawIntBits): Likewise.
+       * java/lang/natDouble.cc (doubleToRawLongBits): New method.
+       * java/lang/natFloat.cc (floatToRawIntBits): Likewise.
+
 2001-02-09  Alexandre Petit-Bianco  <apbianco@redhat.com>
 
        * java/io/File.java (java.net): Imported.
index a656b510e062b4e69212ddca87e7083ace0988df..3c2a745e06f26440ee4beb050e5cf53c53e3803d 100644 (file)
@@ -138,13 +138,7 @@ public final class Double extends Number implements Comparable
   }
 
   public static native long doubleToLongBits (double value);
-
-  public static long doubleToRawLongBits (double value)
-  {
-    // FIXME: Check that this is correct with respect to NaN values.
-    return doubleToLongBits (value);
-  }
-
+  public static native long doubleToRawLongBits (double value);
   public static native double longBitsToDouble (long bits);
 
   public int compareTo (Double d)
index f15b06d2157d3cdc04b482cf303fa7f9fbec1cf2..efce214a5eacc8c8606d2bc8189880b70d8b046a 100644 (file)
@@ -145,14 +145,7 @@ public final class Float extends Number implements Comparable
   }
 
   public static native int floatToIntBits (float value);
-  
-  public static int floatToRawIntBits (float value)
-  {
-    // FIXME: Is this supposed to be different? NaN values seem to be handled
-    // the same in the JDK.
-    return floatToIntBits (value);
-  }
-
+  public static native int floatToRawIntBits (float value);
   public static native float intBitsToFloat (int bits);
 
   public int compareTo (Float d)
index c2be506472389ed8d4eefe03be940ee807305483..bc60ddaec28f6ad611d1f7d02ad6569d070a0c6b 100644 (file)
@@ -1,6 +1,6 @@
 // natDouble.cc - Implementation of java.lang.Double native methods.
 
-/* Copyright (C) 1998, 1999, 2000  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -48,6 +48,14 @@ java::lang::Double::doubleToLongBits(jdouble value)
   return u.l;
 }
 
+jlong 
+java::lang::Double::doubleToRawLongBits(jdouble value)
+{
+  union u u;
+  u.d = value;
+  return u.l;
+}
+
 jdouble 
 java::lang::Double::longBitsToDouble(jlong bits)
 {
index f19a1d597d17ef941e6e424fd66d163623b05fa7..f035dd58cf87fee2db0d04f7f1072bcfba98eca5 100644 (file)
@@ -1,6 +1,6 @@
 // natFloat.cc - Implementation of java.lang.Float native methods.
 
-/* Copyright (C) 1998, 1999  Free Software Foundation
+/* Copyright (C) 1998, 1999, 2001  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -33,6 +33,14 @@ java::lang::Float::floatToIntBits(jfloat value)
   return u.l;
 }
 
+jint 
+java::lang::Float::floatToRawIntBits(jfloat value)
+{
+  union u u;
+  u.d = value;  
+  return u.l;
+}
+
 jfloat 
 java::lang::Float::intBitsToFloat(jint bits)
 {