remove ins_permuted from CMovcc and Setcc constructors (again)
[libfirm] / ir / be / mips / mips_scheduler.c
index c8f3ffb..2fa3361 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 1995-2007 University of Karlsruhe.  All right reserved.
+ * Copyright (C) 1995-2008 University of Karlsruhe.  All right reserved.
  *
  * This file is part of libFirm.
  *
  * @author  Matthias Braun, Mehdi
  * @version $Id$
  */
-#ifdef HAVE_CONFIG_H
 #include "config.h"
-#endif
-
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
 
 #include "mips_scheduler.h"
 
-#include "../besched_t.h"
-#include "../be.h"
+#include "../besched.h"
+#include "be.h"
 #include "../beabi.h"
+#include "../belistsched.h"
 #include "iredges.h"
 #include "ircons.h"
 #include "gen_mips_regalloc_if.h"
@@ -45,7 +40,6 @@
 list_sched_selector_t mips_sched_selector;
 
 typedef struct {
-       const arch_env_t* arch_env;
        pset *div_set;
        /**
         * This array holds an entry for each register that specifies how much cycles
@@ -61,12 +55,10 @@ typedef struct {
 /* Matze: deprecated and totally broken */
 #if 0
 
-static void *mips_scheduler_init_graph(const list_sched_selector_t *vtab, const arch_env_t *arch_env, ir_graph *irg)
+static void *mips_scheduler_init_graph(const list_sched_selector_t *vtab, ir_graph *irg)
 {
-       mips_sched_env_t *sched_env = xmalloc(sizeof(sched_env[0]));
-       memset(sched_env, 0, sizeof(sched_env[0]));
+       mips_sched_env_t *sched_env = XMALLOCZ(mips_sched_env_t);
 
-       sched_env->arch_env = arch_env;
        sched_env->div_set = new_pset(pset_default_ptr_cmp, 4);
 
        return sched_env;
@@ -145,7 +137,6 @@ static int mips_scheduler_node_allowed(mips_sched_env_t *sched_env, ir_node* nod
 static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set, nodeset *live_set)
 {
        mips_sched_env_t *sched_env = (mips_sched_env_t*) block_env;
-       const arch_env_t *arch_env = (const arch_env_t*) sched_env->arch_env;
        ir_node *node = NULL;
        ir_node *block = sched_env->block;
        ir_node *condjmp = NULL;
@@ -155,7 +146,7 @@ static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set, nodes
        // test all nodes in the ready set and take the first non-branch that
        // is allowed
        for (node = nodeset_first(ready_set); node != NULL; node = nodeset_next(ready_set)) {
-               if (arch_irn_class_is(arch_env, node, branch)) {
+               if (arch_irn_class_is(node, branch)) {
                        if (is_irn_forking(node))
                                condjmp = node;
                        continue;
@@ -188,7 +179,7 @@ static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set, nodes
                        return condjmp;
                }
                node = nodeset_first(ready_set);
-               assert(arch_irn_class_is(arch_env, node, branch));
+               assert(arch_irn_class_is(node, branch));
                nodeset_break(ready_set);
                return node;
        }
@@ -204,10 +195,11 @@ static ir_node *mips_scheduler_select(void *block_env, nodeset *ready_set, nodes
 static
 int mips_to_appear_in_schedule(void *block_env, const ir_node *node)
 {
+       (void) block_env;
+
        if(!is_mips_irn(node))
                return -1;
-
-       if(is_mips_zero(node))
+       if(is_mips_zero(node) || is_mips_Immediate(node))
                return 0;
 
        return 1;
@@ -218,8 +210,10 @@ list_sched_selector_t  mips_selector;
 /**
  * Returns the reg_pressure scheduler with to_appear_in_schedule() overloaded
  */
-const list_sched_selector_t *mips_get_list_sched_selector(const void *self, list_sched_selector_t *selector)
+const list_sched_selector_t *mips_get_list_sched_selector(const void *self,
+               list_sched_selector_t *selector)
 {
+       (void) self;
 #if 0
        memset(&mips_sched_selector, 0, sizeof(mips_sched_selector));
        mips_sched_selector.init_graph = mips_scheduler_init_graph;
@@ -236,6 +230,8 @@ const list_sched_selector_t *mips_get_list_sched_selector(const void *self, list
        return &mips_selector;
 }
 
-const ilp_sched_selector_t *mips_get_ilp_sched_selector(const void *self) {
+const ilp_sched_selector_t *mips_get_ilp_sched_selector(const void *self)
+{
+       (void) self;
        return NULL;
 }