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: Problem with interpreted double operations on IA64


Boehm, Hans wrote:
> It's attached, but probably not very informative; __java_double is
> understood by the front end.  But it's a bit hard for me to follow what it
> does with it, or why it exists as a type distinct from double.

For a similar reason that __java_long is different from long:  To
specify that we want the Java version of the type, rather than the
less-specified C/C++ version.  After all 'long' may be 32 or 64 bits
or for that matter anything bigger than (I think) 32 bits'; 'int' may
be 16 bits or 32 bits or whatever, depending on the API.  One could
imagine an API that defines 'double' to be 80 bits, for example.
Thus we need some way to specify 'jint' and 'jfloat' are exactly 32
bits; 'jlong' and 'double' are exactly 64 bits.

Now within in the gcc world this types have to soem extent been
standardized.  But it is still useful to use 'jint' and 'jdouble'
(which are aliases for '__java_int' and '__java_double') to catch
programming mistakes:  The compiler complains if you try to specify
that a Java method takes an 'int' or 'double' parameter; you must
specify 'jint' or 'jdouble' instead.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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