From: Per Bothner <per@bothner.com>
To: "Boehm, Hans" <hans_boehm@hp.com>
Cc: "'java@gcc.gnu.org'" <java@gcc.gnu.org>
Subject: Re: Problem with interpreted double operations on IA64
Date: Tue, 09 Apr 2002 10:30:00 -0000 [thread overview]
Message-ID: <3CB31E57.8000606@bothner.com> (raw)
In-Reply-To: <40700B4C02ABD5119F000090278766443BF19E@hplex1.hpl.hp.com>
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/
next prev parent reply other threads:[~2002-04-09 17:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-09 9:43 Boehm, Hans
2002-04-09 10:01 ` Andrew Haley
2002-04-09 10:30 ` Per Bothner [this message]
2002-04-09 11:15 ` C++: __java_double expressions promote to float Andrew Haley
2002-04-10 1:20 ` Mark Mitchell
2002-04-10 6:13 ` Jason Merrill
2002-04-10 9:45 ` Andrew Haley
2002-04-10 9:47 ` Jason Merrill
2002-04-10 10:14 ` Andrew Haley
-- strict thread matches above, loose matches on Subject: below --
2002-04-09 9:37 Problem with interpreted double operations on IA64 Boehm, Hans
2002-04-09 9:43 ` Andrew Haley
2002-04-09 10:51 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3CB31E57.8000606@bothner.com \
--to=per@bothner.com \
--cc=hans_boehm@hp.com \
--cc=java@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).