aboutsummaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-09-16 19:02:08 -0700
committerRichard Henderson <rth@gcc.gnu.org>2002-09-16 19:02:08 -0700
commit94313f351a9d53ae192d425c82b023b895827009 (patch)
treedf5b1eab0ed6952e5bf3b44a3f604f1b97de876f /gcc/simplify-rtx.c
parentad17a52a21392e7832aa96b950b02e970b6a390e (diff)
downloadgcc-94313f351a9d53ae192d425c82b023b895827009.zip
gcc-94313f351a9d53ae192d425c82b023b895827009.tar.gz
gcc-94313f351a9d53ae192d425c82b023b895827009.tar.bz2
real.c (do_fix_trunc): New.
* real.c (do_fix_trunc): New. (real_arithmetic): Call it. * simplify-rtx.c (simplify_unary_operation): Handle FIX with a floating-point result mode. From-SVN: r57223
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 555646c..3566d10 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -599,10 +599,22 @@ simplify_unary_operation (code, mode, op, op_mode)
/* We don't attempt to optimize this. */
return 0;
- case ABS: d = REAL_VALUE_ABS (d); break;
- case NEG: d = REAL_VALUE_NEGATE (d); break;
- case FLOAT_TRUNCATE: d = real_value_truncate (mode, d); break;
- case FLOAT_EXTEND: /* All this does is change the mode. */ break;
+ case ABS:
+ d = REAL_VALUE_ABS (d);
+ break;
+ case NEG:
+ d = REAL_VALUE_NEGATE (d);
+ break;
+ case FLOAT_TRUNCATE:
+ d = real_value_truncate (mode, d);
+ break;
+ case FLOAT_EXTEND:
+ /* All this does is change the mode. */
+ break;
+ case FIX:
+ real_arithmetic (&d, FIX_TRUNC_EXPR, &d, NULL);
+ break;
+
default:
abort ();
}