*
* $Id$
*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
#include <assert.h>
#include "irnode_t.h"
#include "irprintf.h"
#include "debug.h"
-#include "..\belive_t.h"
-#include "..\besched.h"
-#include "..\benode_t.h"
+#include "../belive_t.h"
+#include "../besched.h"
+#include "../benode_t.h"
#include "ia32_new_nodes.h"
#include "gen_ia32_new_nodes.h"
#include "gen_ia32_regalloc_if.h"
#include "ia32_x87.h"
+#ifndef NDEBUG
+#define DEBUG_ONLY(x) x
+#else /* NDEBUG */
+#define DEBUG_ONLY(x)
+#endif /* NDEBUG */
+
#define N_x87_REGS 8
/* first and second binop index */
attr->x87[0] = &ia32_st_regs[pos];
attr->x87[2] = &ia32_st_regs[0];
- DB((dbg, LEVEL_2, "%+F replaced input %d of %+F\n", fxch, node_idx, user));
-
- if (user)
+ if (user) {
+ DB((dbg, LEVEL_2, "%+F replaced input %d of %+F\n", fxch, node_idx, user));
set_irn_n(user, node_idx, fxch);
+ }
else {
- /* This is a node from another block. Changing it's user might be wrong,
- sp just keep it alive.
- The "right" solution would require a new Phi, but we don't care here.
+ /*
+ * This is a node from a dominator block. Changing it's user might be wrong,
+ * so just keep it alive.
+ * The "right" solution would require a new Phi, but we don't care here.
*/
keep_alive(fxch);
}
/**
* dump liveness info.
*/
-static vfp_dump_live(unsigned live) {
+static void vfp_dump_live(unsigned live) {
int i;
DB((dbg, LEVEL_2, "Live registers here: \n"));
/**
* Create a new x87 simulator.
*/
-static void x87_init_simulator(x87_simulator *sim, const arch_env_t *env) {
+static void x87_init_simulator(x87_simulator *sim, ir_graph *irg, const arch_env_t *env) {
obstack_init(&sim->obst);
sim->blk_states = pmap_create();
sim->env = env;
FIRM_DBG_REGISTER(dbg, "firm.be.ia32.x87");
firm_dbg_set_mask(dbg, SET_LEVEL_2);
- DB((dbg, LEVEL_1, "x87 Simulator started\n"));
+ DB((dbg, LEVEL_1, "--------------------------------\n"
+ "x87 Simulator started for %+F\n", irg));
/* set the generic function pointer of instruction we must simulate */
clear_irp_opcodes_generic_func();
static void x87_destroy_simulator(x87_simulator *sim) {
pmap_destroy(sim->blk_states);
obstack_free(&sim->obst, NULL);
- DB((dbg, LEVEL_1, "x87 Simulator stopped\n"));
+ DB((dbg, LEVEL_1, "x87 Simulator stopped\n\n"));
}
/**
be_liveness(irg);
/* create the simulator */
- x87_init_simulator(&sim, env);
+ x87_init_simulator(&sim, irg, env);
start_block = get_irg_start_block(irg);
bl_state = x87_get_bl_state(&sim, start_block);