projects
/
libfirm
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8cd28ec
)
Allow safe x/y = x * (1.0/y) for exact 1.0/y even if floating point constant folding...
author
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Sun, 18 May 2008 14:39:10 +0000
(14:39 +0000)
committer
Michael Beck
<beck@ipd.info.uni-karlsruhe.de>
Sun, 18 May 2008 14:39:10 +0000
(14:39 +0000)
[r19653]
ir/ir/iropt.c
patch
|
blob
|
history
diff --git
a/ir/ir/iropt.c
b/ir/ir/iropt.c
index
75b7fe1
..
286b540
100644
(file)
--- a/
ir/ir/iropt.c
+++ b/
ir/ir/iropt.c
@@
-2804,8
+2804,17
@@
static ir_node *transform_node_Quot(ir_node *n) {
if (is_Const(b)) {
tarval *tv = get_Const_tarval(b);
+ int rem;
+ /*
+ * Floating point constant folding might be disabled here to
+ * prevent rounding.
+ * However, as we check for exact result, doing it is safe.
+ * Switch it on.
+ */
+ rem = tarval_enable_fp_ops(1);
tv = tarval_quo(get_mode_one(mode), tv);
+ (void)tarval_enable_fp_ops(rem);
/* Do the transformation if the result is either exact or we are not
using strict rules. */