projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Michael found a nice trick to implement sets for float compares
[libfirm]
/
ir
/
be
/
ia32
/
ia32_x87.c
diff --git
a/ir/be/ia32/ia32_x87.c
b/ir/be/ia32/ia32_x87.c
index
ba97016
..
6e806fb
100644
(file)
--- a/
ir/be/ia32/ia32_x87.c
+++ b/
ir/be/ia32/ia32_x87.c
@@
-44,8
+44,8
@@
#include "error.h"
#include "../belive_t.h"
#include "error.h"
#include "../belive_t.h"
-#include "../besched
_t
.h"
-#include "../benode
_t
.h"
+#include "../besched.h"
+#include "../benode.h"
#include "bearch_ia32_t.h"
#include "ia32_new_nodes.h"
#include "gen_ia32_new_nodes.h"
#include "bearch_ia32_t.h"
#include "ia32_new_nodes.h"
#include "gen_ia32_new_nodes.h"
@@
-1473,9
+1473,9
@@
static int sim_Fucom(x87_state *state, ir_node *n)
int reg_index_1 = arch_register_get_index(op1);
int reg_index_2 = arch_register_get_index(op2);
unsigned live = vfp_live_args_after(sim, n, 0);
int reg_index_1 = arch_register_get_index(op1);
int reg_index_2 = arch_register_get_index(op2);
unsigned live = vfp_live_args_after(sim, n, 0);
-
int
permuted = attr->attr.data.ins_permuted;
-
int xchg = 0
;
- int
pops
= 0;
+
bool
permuted = attr->attr.data.ins_permuted;
+
bool xchg = false
;
+ int
pops
= 0;
DB((dbg, LEVEL_1, ">>> %+F %s, %s\n", n,
arch_register_get_name(op1), arch_register_get_name(op2)));
DB((dbg, LEVEL_1, ">>> %+F %s, %s\n", n,
arch_register_get_name(op1), arch_register_get_name(op2)));
@@
-1503,7
+1503,7
@@
static int sim_Fucom(x87_state *state, ir_node *n)
} else if (op2_idx == 0) {
/* res = op X tos */
permuted = !permuted;
} else if (op2_idx == 0) {
/* res = op X tos */
permuted = !permuted;
- xchg
= 1
;
+ xchg
= true
;
} else {
/* bring the first one to tos */
x87_create_fxch(state, n, op1_idx);
} else {
/* bring the first one to tos */
x87_create_fxch(state, n, op1_idx);
@@
-1538,9
+1538,9
@@
static int sim_Fucom(x87_state *state, ir_node *n)
op2_idx = 0;
}
/* res = op X tos, pop */
op2_idx = 0;
}
/* res = op X tos, pop */
- pops = 1;
+ pops
= 1;
permuted = !permuted;
permuted = !permuted;
- xchg
= 1
;
+ xchg
= true
;
} else {
/* both operands are dead here, check first for identity. */
if (op1_idx == op2_idx) {
} else {
/* both operands are dead here, check first for identity. */
if (op1_idx == op2_idx) {
@@
-1575,8
+1575,8
@@
static int sim_Fucom(x87_state *state, ir_node *n)
}
/* res = op X tos, pop, pop */
permuted = !permuted;
}
/* res = op X tos, pop, pop */
permuted = !permuted;
- xchg
= 1
;
- pops = 2;
+ xchg
= true
;
+ pops
= 2;
} else {
/* if one is already the TOS, we need two fxch */
if (op1_idx == 0) {
} else {
/* if one is already the TOS, we need two fxch */
if (op1_idx == 0) {
@@
-1587,9
+1587,9
@@
static int sim_Fucom(x87_state *state, ir_node *n)
x87_create_fxch(state, n, op2_idx);
op2_idx = 0;
/* res = op X tos, pop, pop */
x87_create_fxch(state, n, op2_idx);
op2_idx = 0;
/* res = op X tos, pop, pop */
- pops = 2;
+ pops
= 2;
permuted = !permuted;
permuted = !permuted;
- xchg
= 1
;
+ xchg
= true
;
} else if (op2_idx == 0) {
/* second one is TOS, move to st(1) */
x87_create_fxch(state, n, 1);
} else if (op2_idx == 0) {
/* second one is TOS, move to st(1) */
x87_create_fxch(state, n, 1);
@@
-1734,15
+1734,12
@@
static int sim_Keep(x87_state *state, ir_node *node)
*/
static void keep_float_node_alive(ir_node *node)
{
*/
static void keep_float_node_alive(ir_node *node)
{
- ir_node *block = get_nodes_block(node);
- const arch_register_class_t *cls = arch_get_irn_reg_class_out(node);
- ir_node *keep;
-
- keep = be_new_Keep(cls, block, 1, &node);
+ ir_node *block = get_nodes_block(node);
+ ir_node *keep = be_new_Keep(block, 1, &node);
assert(sched_is_scheduled(node));
sched_add_after(node, keep);
assert(sched_is_scheduled(node));
sched_add_after(node, keep);
-}
/* keep_float_node_alive */
+}
/**
* Create a copy of a node. Recreate the node if it's a constant.
/**
* Create a copy of a node. Recreate the node if it's a constant.