Commit 9b4a08f9 by Scott Bambrough Committed by Tom Tromey

gjavah.c (D_NAN_MASK): Alternate definition required when…

gjavah.c (D_NAN_MASK): Alternate definition required when HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.

2000-01-31  Scott Bambrough  <scottb@netwinder.org>

	* gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
	HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
	(java_float_finite): Convert to use union Word from javaop.h.
	(java_double_finite): Convert to use union DWord from javaop.h.

From-SVN: r31768
parent de380723
2000-01-31 Scott Bambrough <scottb@netwinder.org>
* gcc/java/gjavah.c (D_NAN_MASK): Alternate definition required when
HOST_FLOAT_WORDS_BIG_ENDIAN is defined to be 1.
(java_float_finite): Convert to use union Word from javaop.h.
(java_double_finite): Convert to use union DWord from javaop.h.
2000-02-02 Tom Tromey <tromey@cygnus.com> 2000-02-02 Tom Tromey <tromey@cygnus.com>
* gjavah.c (options): Added `jni' entry. * gjavah.c (options): Added `jni' entry.
......
...@@ -30,6 +30,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ ...@@ -30,6 +30,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "jcf.h" #include "jcf.h"
#include "tree.h" #include "tree.h"
#include "javaop.h"
#include "java-tree.h" #include "java-tree.h"
#include "java-opcodes.h" #include "java-opcodes.h"
...@@ -204,17 +205,18 @@ static int decompiled = 0; ...@@ -204,17 +205,18 @@ static int decompiled = 0;
/* Some useful constants. */ /* Some useful constants. */
#define F_NAN_MASK 0x7f800000 #define F_NAN_MASK 0x7f800000
#if (1 == HOST_FLOAT_WORDS_BIG_ENDIAN)
#define D_NAN_MASK 0x000000007ff00000LL
#else
#define D_NAN_MASK 0x7ff0000000000000LL #define D_NAN_MASK 0x7ff0000000000000LL
#endif
/* Return 1 if F is not Inf or NaN. */ /* Return 1 if F is not Inf or NaN. */
static int static int
java_float_finite (f) java_float_finite (f)
jfloat f; jfloat f;
{ {
union { union Word u;
jfloat f;
int32 i;
} u;
u.f = f; u.f = f;
/* We happen to know that F_NAN_MASK will match all NaN values, and /* We happen to know that F_NAN_MASK will match all NaN values, and
...@@ -228,14 +230,11 @@ static int ...@@ -228,14 +230,11 @@ static int
java_double_finite (d) java_double_finite (d)
jdouble d; jdouble d;
{ {
union { union DWord u;
jdouble d;
int64 i;
} u;
u.d = d; u.d = d;
/* Now check for all NaNs. */ /* Now check for all NaNs. */
return (u.i & D_NAN_MASK) != D_NAN_MASK; return (u.l & D_NAN_MASK) != D_NAN_MASK;
} }
static void static void
......
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