This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Squelch HOST_FLOAT_WORDS_BIG_ENDIAN


Tom Tromey <tromey at redhat dot com> writes:

>>>>>> "Zack" == Zack Weinberg <zack at codesourcery dot com> writes:
>
> FYI there's a java-patches list.

Oops, sorry.

> gjavah is tested when building libgcj from scratch.  All the required
> headers are built and then a fair number of them are used for other
> parts of the build.  You could try `make header-check' in the target
> build directory, but I haven't run that target in a long time and I
> really have no idea if it works at all.

I get floods of errors, starting with:

In file included from htest.cc:215:
java/util/WeakHashMap.h:24: error: using-declaration for non-member at class 
   scope
java/util/WeakHashMap.h:24: error: expected function-definition
In file included from htest.cc:216:
java/util/prefs/NodeChangeListener.h:10: error: `java::util::prefs' is not a 
   class-name or namespace-name
java/util/prefs/NodeChangeListener.h:13: error: `java::util::prefs' is not a 
   class-name or namespace-name
java/util/prefs/NodeChangeListener.h:13: error: variable or field `childAdded' 
   declared void
java/util/prefs/NodeChangeListener.h:13: error: `childAdded' declared as a 
   `virtual' field

Nothing that looks specifically relevant to my change, though.

> I doubt the libgcj build (or test suite for that matter) would notice
> if the generated values were incorrect.  That's because it would
> require CNI code to be using these values, and as far as I know there
> is none in the library (and there aren't any CNI tests aside from the
> library itself).
>
> Take a look at Double.h in the build tree (.../libjava/java/lang/Double.h).
> That should have some jdouble constants in it.  The code in question
> should only be exercised when generating CNI headers for classes that
> have float or double constants ("static final float foo = 0.234234").

Yes, it does.

Before:

  static const jdouble MAX_VALUE = 1.7976931348623157e+308;
  static const jdouble MIN_VALUE = 4.9406564584124654e-324;
  static const jdouble NEGATIVE_INFINITY;
  static const jdouble POSITIVE_INFINITY;
  static const jdouble NaN;

After:

  static const jdouble MAX_VALUE;
  static const jdouble MIN_VALUE;
  static const jdouble NEGATIVE_INFINITY = -0x1.000000000p+2047;
  static const jdouble POSITIVE_INFINITY =  0x1.000000000p+2047;
  static const jdouble NaN =  0x1.8000000000000p+2047;
  static ::java::lang::Class *TYPE;

It looks like I have my is-it-finite check backward.  Will revise and
resubmit.

> Is there no way to get jcf-dump to print a non-hex value?  This
> program is used for inspecting class files.  Having hex output is less
> useful than printing the constant the way one would expect.

I believe I can do that by using ldexp().  That may mean we have to
link jcf-dump against libm, though.  (Not necessary on Linux, NetBSD,
or Solaris, but all these are relatively boring systems with respect
to weird portability issues.)

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]