shouldn't be here anymore
[libfirm] / ir / be / mips / bearch_mips.c
index 3fb2506..b525d82 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.
  *
@@ -38,6 +38,7 @@
 #include "iredges.h"
 #include "irdump.h"
 #include "irextbb.h"
+#include "irtools.h"
 #include "error.h"
 
 #include "bitset.h"
@@ -608,7 +609,6 @@ static mips_isa_t mips_isa_template = {
                7,      /* spill costs */
                5,      /* reload costs */
        },
-       NULL_EMITTER,  /* emitter environment */
        NULL,          /* cg */
 };
 
@@ -626,7 +626,7 @@ static void *mips_init(FILE *file_handle) {
        isa = xcalloc(1, sizeof(isa[0]));
        memcpy(isa, &mips_isa_template, sizeof(isa[0]));
 
-       be_emit_init_env(&isa->emit, file_handle);
+       be_emit_init(file_handle);
 
        mips_register_init();
        mips_create_opcodes();
@@ -648,22 +648,23 @@ static void mips_done(void *self)
 {
        mips_isa_t *isa = self;
 
-       be_gas_emit_decls(&isa->emit, isa->arch_isa.main_env, 1);
+       be_gas_emit_decls(isa->arch_isa.main_env, 1);
 
-       be_emit_destroy_env(&isa->emit);
+       be_emit_exit();
        free(isa);
 }
 
-static int mips_get_n_reg_class(const void *self)
+static unsigned mips_get_n_reg_class(const void *self)
 {
        (void) self;
        return N_CLASSES;
 }
 
-static const arch_register_class_t *mips_get_reg_class(const void *self, int i)
+static const arch_register_class_t *mips_get_reg_class(const void *self,
+                                                       unsigned i)
 {
        (void) self;
-       assert(i >= 0 && i < N_CLASSES && "Invalid mips register class requested.");
+       assert(i < N_CLASSES);
        return &mips_reg_classes[i];
 }
 
@@ -679,6 +680,7 @@ const arch_register_class_t *mips_get_reg_class_for_mode(const void *self,
                                                          const ir_mode *mode)
 {
        (void) self;
+       (void) mode;
        ASSERT_NO_FLOAT(mode);
        return &mips_reg_classes[CLASS_mips_gp];
 }
@@ -924,7 +926,7 @@ static void mips_get_call_abi(const void *self, ir_type *method_type,
                        be_abi_call_param_reg(abi, i, reg);
                } else {
                        /* default: all parameters on stack */
-                       be_abi_call_param_stack(abi, i, 4, 0, 0);
+                       be_abi_call_param_stack(abi, i, modes[i], 4, 0, 0);
                }
        }
 
@@ -1013,17 +1015,9 @@ static ir_graph **mips_get_irg_list(const void *self, ir_graph ***irg_list)
  * Returns the libFirm configuration parameter for this backend.
  */
 static const backend_params *mips_get_libfirm_params(void) {
-       static arch_dep_params_t ad = {
-               1,  /* allow subs */
-               0,      /* Muls are fast enough on Mips */
-               31, /* shift would be ok */
-               0,  /* no Mulhs */
-               0,  /* no Mulhu */
-               32, /* Mulhs & Mulhu available for 32 bit */
-       };
        static backend_params p = {
                1,     /* need dword lowering */
-               0,     /* don't support inlien assembler yet */
+               0,     /* don't support inline assembler yet */
                NULL,  /* no additional opcodes */
                NULL,  /* will be set later */
                NULL,  /* but yet no creator function */
@@ -1031,7 +1025,6 @@ static const backend_params *mips_get_libfirm_params(void) {
                NULL,  /* no if conversion settings */
        };
 
-       p.dep_param = &ad;
        return &p;
 }