aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-parse.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-09-16 09:36:39 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-09-16 09:36:39 -0700
commitefdc7e19ca67331ae7f0061c76964299db27242d (patch)
treee6577420306f750f19abf6c590eb0d8987ca7485 /gcc/java/jcf-parse.c
parent1f73c622253e00cd295fe09e07d6acee7c943e4e (diff)
downloadgcc-efdc7e19ca67331ae7f0061c76964299db27242d.zip
gcc-efdc7e19ca67331ae7f0061c76964299db27242d.tar.gz
gcc-efdc7e19ca67331ae7f0061c76964299db27242d.tar.bz2
real.c, real.h: Rewrite from scratch.
gcc/ * real.c, real.h: Rewrite from scratch. * Makefile.in (simplify-rtx.o): Depend on TREE_H. (paranoia): New target. * builtins.c (fold_builtin_inf): Use new real.h interface. * c-common.c (builtin_define_with_hex_fp_value): Likewise. * c-lex.c (interpret_float): Likewise. * emit-rtl.c (gen_lowpart_common): Likewise. * optabs.c (expand_float): Use real_2expN. * config/ia64/ia64.md (divsi3, udivsi3): Likewise. * defaults.h (INTEL_EXTENDED_IEEE_FORMAT): New. (FLOAT_WORDS_BIG_ENDIAN): New. * cse.c (find_comparison_args): Don't pass FLOAT_STORE_FLAG_VALUE directly to REAL_VALUE_NEGATIVE. * loop.c (canonicalize_condition): Likewise. * simplify-rtx.c: Include tree.h. (simplify_unary_operation): Don't handle FIX and UNSIGNED_FIX with floating-point result modes. * toplev.c (backend_init): Call init_real_once. * fold-const.c (force_fit_type): Don't call CHECK_FLOAT_VALUE. * tree.c (build_real): Likewise. * config/alpha/alpha.c, config/vax/vax.c (float_strings, float_values, inited_float_values, check_float_value): Remove. * config/alpha/alpha.h, config/m68hc11/m68hc11.h, config/m88k/m88k.h, config/vax/vax.h (CHECK_FLOAT_VALUE): Remove. * doc/tm.texi (CHECK_FLOAT_VALUE): Remove. gcc/f/ * target.c (ffetarget_real1): Don't pass FFETARGET_ATOF_ directly to ffetarget_make_real1. (ffetarget_real2): Similarly. * target.h (ffetarget_cvt_r1_to_rv_, ffetarget_cvt_rv_to_r2_, ffetarget_cvt_r2_to_rv_): Use new real.h interface and simplify. gcc/java/ * jcf-parse.c (get_constant): Runtime check for IEEE format; use new real.h interface. * jcf-write.c (find_constant_index): Use new real.h interface. * lex.c (IS_ZERO): Use REAL_VALUES_EQUAL. contrib/ * paranoia.cc: New file. From-SVN: r57198
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r--gcc/java/jcf-parse.c75
1 files changed, 36 insertions, 39 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index fc755f0..29ccf63 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -290,47 +290,44 @@ get_constant (jcf, index)
force_fit_type (value, 0);
break;
}
-#if TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT
+
case CONSTANT_Float:
- {
- jint num = JPOOL_INT(jcf, index);
- REAL_VALUE_TYPE d;
- d = REAL_VALUE_FROM_TARGET_SINGLE (num);
- value = build_real (float_type_node, d);
- break;
- }
+ /* ??? Even more ideal would be to import the number using the
+ IEEE decode routines, then use whatever format the target
+ actually uses. This would enable Java on VAX to kind work. */
+ if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
+ {
+ jint num = JPOOL_INT(jcf, index);
+ long buf = num;
+ REAL_VALUE_TYPE d;
+ real_from_target (&d, &buf, SFmode);
+ value = build_real (float_type_node, d);
+ break;
+ }
+ else
+ goto bad;
+
case CONSTANT_Double:
- {
- HOST_WIDE_INT num[2];
- REAL_VALUE_TYPE d;
- HOST_WIDE_INT lo, hi;
- num[0] = JPOOL_UINT (jcf, index);
- lshift_double (num[0], 0, 32, 64, &lo, &hi, 0);
- num[0] = JPOOL_UINT (jcf, index+1);
- add_double (lo, hi, num[0], 0, &lo, &hi);
-
- /* Since ereal_from_double expects an array of HOST_WIDE_INT
- in the target's format, we swap the elements for big endian
- targets, unless HOST_WIDE_INT is sufficiently large to
- contain a target double, in which case the 2nd element
- is ignored.
-
- FIXME: Is this always right for cross targets? */
- if (FLOAT_WORDS_BIG_ENDIAN && sizeof(num[0]) < 8)
- {
- num[0] = hi;
- num[1] = lo;
- }
- else
- {
- num[0] = lo;
- num[1] = hi;
- }
- d = REAL_VALUE_FROM_TARGET_DOUBLE (num);
- value = build_real (double_type_node, d);
- break;
- }
-#endif /* TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT */
+ if (TARGET_FLOAT_FORMAT == IEEE_FLOAT_FORMAT)
+ {
+ long buf[2], lo, hi;
+ REAL_VALUE_TYPE d;
+
+ hi = JPOOL_UINT (jcf, index);
+ lo = JPOOL_UINT (jcf, index+1);
+
+ if (FLOAT_WORDS_BIG_ENDIAN)
+ buf[0] = hi, buf[1] = lo;
+ else
+ buf[0] = lo, buf[1] = hi;
+
+ real_from_target (&d, buf, DFmode);
+ value = build_real (double_type_node, d);
+ break;
+ }
+ else
+ goto bad;
+
case CONSTANT_String:
{
tree name = get_name_constant (jcf, JPOOL_USHORT1 (jcf, index));