aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-05-12 10:09:24 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-05-12 10:09:24 -0700
commit51286de6508da7bd50ccbf6680a9ebb307a13beb (patch)
treee7f07bf40bf4b1b2030898085fdd52bd0243b374 /gcc/real.c
parent6412341ec950b23d76e52b89f052aab8efeee039 (diff)
downloadgcc-51286de6508da7bd50ccbf6680a9ebb307a13beb.zip
gcc-51286de6508da7bd50ccbf6680a9ebb307a13beb.tar.gz
gcc-51286de6508da7bd50ccbf6680a9ebb307a13beb.tar.bz2
expr.c (compress_float_constant): New.
* expr.c (compress_float_constant): New. (emit_move_insn): Use it. (float_extend_from_mem): New. (init_expr_once): Initialize it. * real.c (exact_real_truncate): New. * config/i386/i386.h (CONST_COSTS): Assume CONST_DOUBLE gets dropped into memory; penalize for size. (RTX_COSTS): FLOAT_EXTEND is free. * config/i386/i386.md (extendsfdf2, extendsfxf2, extendsftf2, extenddfxf2, extenddftf2): Accept constants and drop them to memory. From-SVN: r53401
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/real.c b/gcc/real.c
index 9129862..a419698 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -1066,6 +1066,22 @@ real_value_truncate (mode, arg)
return (r);
}
+/* Return true if ARG can be represented exactly in MODE. */
+
+bool
+exact_real_truncate (mode, arg)
+ enum machine_mode mode;
+ REAL_VALUE_TYPE *arg;
+{
+ REAL_VALUE_TYPE trunc;
+
+ if (target_isnan (*arg))
+ return false;
+
+ trunc = real_value_truncate (mode, *arg);
+ return ereal_cmp (*arg, trunc) == 0;
+}
+
/* Try to change R into its exact multiplicative inverse in machine mode
MODE. Return nonzero function value if successful. */