Commit aa2046c4 by Richard Henderson Committed by Richard Henderson

jcf-parse.c (get_constant): Decode from IEEE no matter what the target format.

        * jcf-parse.c (get_constant): Decode from IEEE no matter
        what the target format.

From-SVN: r57389
parent 3dc85dfb
2002-09-21 Richard Henderson <rth@redhat.com>
* jcf-parse.c (get_constant): Decode from IEEE no matter
what the target format.
2002-09-20 Kazu Hirata <kazu@cs.umass.edu> 2002-09-20 Kazu Hirata <kazu@cs.umass.edu>
* ChangeLog: Follow spelling conventions. * ChangeLog: Follow spelling conventions.
......
...@@ -292,41 +292,33 @@ get_constant (jcf, index) ...@@ -292,41 +292,33 @@ get_constant (jcf, index)
} }
case CONSTANT_Float: case CONSTANT_Float:
/* ??? Even more ideal would be to import the number using the {
IEEE decode routines, then use whatever format the target jint num = JPOOL_INT(jcf, index);
actually uses. This would enable Java on VAX to kind work. */ long buf = num;
if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT) REAL_VALUE_TYPE d;
{
jint num = JPOOL_INT(jcf, index); real_from_target_fmt (&d, &buf, &ieee_single_format);
long buf = num; value = build_real (float_type_node, d);
REAL_VALUE_TYPE d; break;
real_from_target (&d, &buf, SFmode); }
value = build_real (float_type_node, d);
break;
}
else
goto bad;
case CONSTANT_Double: case CONSTANT_Double:
if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT) {
{ long buf[2], lo, hi;
long buf[2], lo, hi; REAL_VALUE_TYPE d;
REAL_VALUE_TYPE d;
hi = JPOOL_UINT (jcf, index); hi = JPOOL_UINT (jcf, index);
lo = JPOOL_UINT (jcf, index+1); lo = JPOOL_UINT (jcf, index+1);
if (FLOAT_WORDS_BIG_ENDIAN) if (FLOAT_WORDS_BIG_ENDIAN)
buf[0] = hi, buf[1] = lo; buf[0] = hi, buf[1] = lo;
else else
buf[0] = lo, buf[1] = hi; buf[0] = lo, buf[1] = hi;
real_from_target (&d, buf, DFmode); real_from_target_fmt (&d, &buf, &ieee_double_format);
value = build_real (double_type_node, d); value = build_real (double_type_node, d);
break; break;
} }
else
goto bad;
case CONSTANT_String: case CONSTANT_String:
{ {
......
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