Commit 0e206b71 by Bryce McKinlay Committed by Bryce McKinlay

Double.java (doubleToRawLongBits): Now native.

	* 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
parent 30f87f1a
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> 2001-02-09 Alexandre Petit-Bianco <apbianco@redhat.com>
* java/io/File.java (java.net): Imported. * java/io/File.java (java.net): Imported.
......
...@@ -138,13 +138,7 @@ public final class Double extends Number implements Comparable ...@@ -138,13 +138,7 @@ public final class Double extends Number implements Comparable
} }
public static native long doubleToLongBits (double value); public static native long doubleToLongBits (double value);
public static native long doubleToRawLongBits (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 double longBitsToDouble (long bits); public static native double longBitsToDouble (long bits);
public int compareTo (Double d) public int compareTo (Double d)
......
...@@ -145,14 +145,7 @@ public final class Float extends Number implements Comparable ...@@ -145,14 +145,7 @@ public final class Float extends Number implements Comparable
} }
public static native int floatToIntBits (float value); public static native int floatToIntBits (float value);
public static native int floatToRawIntBits (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 float intBitsToFloat (int bits); public static native float intBitsToFloat (int bits);
public int compareTo (Float d) public int compareTo (Float d)
......
// natDouble.cc - Implementation of java.lang.Double native methods. // 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. This file is part of libgcj.
...@@ -48,6 +48,14 @@ java::lang::Double::doubleToLongBits(jdouble value) ...@@ -48,6 +48,14 @@ java::lang::Double::doubleToLongBits(jdouble value)
return u.l; return u.l;
} }
jlong
java::lang::Double::doubleToRawLongBits(jdouble value)
{
union u u;
u.d = value;
return u.l;
}
jdouble jdouble
java::lang::Double::longBitsToDouble(jlong bits) java::lang::Double::longBitsToDouble(jlong bits)
{ {
......
// natFloat.cc - Implementation of java.lang.Float native methods. // 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. This file is part of libgcj.
...@@ -33,6 +33,14 @@ java::lang::Float::floatToIntBits(jfloat value) ...@@ -33,6 +33,14 @@ java::lang::Float::floatToIntBits(jfloat value)
return u.l; return u.l;
} }
jint
java::lang::Float::floatToRawIntBits(jfloat value)
{
union u u;
u.d = value;
return u.l;
}
jfloat jfloat
java::lang::Float::intBitsToFloat(jint bits) java::lang::Float::intBitsToFloat(jint bits)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment