X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fmips%2Fbearch_mips.c;h=62b946b8f649b179ef673b33c1453ce8e44c1f1c;hb=39cb52264857d7c21c7141ba82bb55adaa78064d;hp=0604a324f263cf970634fbaad96d1e132bff915c;hpb=49650674902ee8d35388f8cff11568ec98b109ff;p=libfirm diff --git a/ir/be/mips/bearch_mips.c b/ir/be/mips/bearch_mips.c index 0604a324f..62b946b8f 100644 --- a/ir/be/mips/bearch_mips.c +++ b/ir/be/mips/bearch_mips.c @@ -42,12 +42,12 @@ #include "bitset.h" #include "debug.h" -#include "../bearch_t.h" -#include "../benode_t.h" +#include "../bearch.h" +#include "../benode.h" #include "../belower.h" -#include "../besched_t.h" +#include "../besched.h" #include "../beblocksched.h" -#include "../beirg_t.h" +#include "../beirg.h" #include "be.h" #include "../beabi.h" #include "../bemachine.h" @@ -82,64 +82,9 @@ static set *cur_reg_set = NULL; * |___/ **************************************************/ -/** - * Return register requirements for a mips node. - * If the node returns a tuple (mode_T) then the proj's - * will be asked for this information. - */ -static const -arch_register_req_t *mips_get_irn_reg_req(const ir_node *node, int pos) -{ - long node_pos = pos == -1 ? 0 : pos; - ir_mode *mode = get_irn_mode(node); - - if (is_Block(node) || mode == mode_X || mode == mode_M) { - return arch_no_register_req; - } - - if (mode == mode_T && pos < 0) { - return arch_no_register_req; - } - - if (is_Proj(node)) { - /* in case of a proj, we need to get the correct OUT slot */ - /* of the node corresponding to the proj number */ - if (pos == -1) { - node_pos = mips_translate_proj_pos(node); - } - else { - node_pos = pos; - } - - node = skip_Proj_const(node); - } - - /* get requirements for our own nodes */ - if (is_mips_irn(node)) { - const arch_register_req_t *req; - if (pos >= 0) { - req = get_mips_in_req(node, pos); - } else { - req = get_mips_out_req(node, node_pos); - } - - return req; - } - - /* unknown should be translated by now */ - assert(!is_Unknown(node)); - - return arch_no_register_req; -} - static arch_irn_class_t mips_classify(const ir_node *irn) { - irn = skip_Proj_const(irn); - - if (is_cfop(irn)) { - return arch_irn_class_branch; - } - + (void) irn; return 0; } @@ -214,7 +159,8 @@ static int mips_get_sp_bias(const ir_node *irn) /* fill register allocator interface */ static const arch_irn_ops_t mips_irn_ops = { - mips_get_irn_reg_req, + get_mips_in_req, + get_mips_out_req, mips_classify, mips_get_frame_entity, mips_set_frame_entity, @@ -418,16 +364,13 @@ static void mips_done(void *self) free(isa); } -static unsigned mips_get_n_reg_class(const void *self) +static unsigned mips_get_n_reg_class(void) { - (void) self; return N_CLASSES; } -static const arch_register_class_t *mips_get_reg_class(const void *self, - unsigned i) +static const arch_register_class_t *mips_get_reg_class(unsigned i) { - (void) self; assert(i < N_CLASSES); return &mips_reg_classes[i]; } @@ -440,10 +383,8 @@ static const arch_register_class_t *mips_get_reg_class(const void *self, * @param mode The mode in question. * @return A register class which can hold values of the given mode. */ -const arch_register_class_t *mips_get_reg_class_for_mode(const void *self, - const ir_mode *mode) +const arch_register_class_t *mips_get_reg_class_for_mode(const ir_mode *mode) { - (void) self; (void) mode; ASSERT_NO_FLOAT(mode); return &mips_reg_classes[CLASS_mips_gp]; @@ -522,7 +463,7 @@ static const arch_register_t *mips_abi_prologue(void *self, ir_node** mem, pmap /* Note: ideally we would route these mem edges directly towards the * epilogue, but this is currently not supported so we sync all mems * together */ - sync = new_r_Sync(irg, block, 2, mm+4); + sync = new_r_Sync(block, 2, mm+4); *mem = sync; } else { ir_node *reg, *store; @@ -556,7 +497,6 @@ static void mips_abi_epilogue(void *self, ir_node *block, ir_node **mem, pmap *r { mips_abi_env_t *env = self; - ir_graph *irg = env->irg; ir_node *sp = be_abi_reg_map_get(reg_map, &mips_gp_regs[REG_SP]); ir_node *fp = be_abi_reg_map_get(reg_map, &mips_gp_regs[REG_FP]); ir_node *load; @@ -573,8 +513,8 @@ static void mips_abi_epilogue(void *self, ir_node *block, ir_node **mem, pmap *r fp_save_offset - initial_frame_size); panic("FIXME register requirement with ignore"); - fp = new_r_Proj(irg, block, load, mode_Iu, pn_mips_lw_res); - *mem = new_r_Proj(irg, block, load, mode_Iu, pn_mips_lw_M); + fp = new_r_Proj(block, load, mode_Iu, pn_mips_lw_res); + *mem = new_r_Proj(block, load, mode_Iu, pn_mips_lw_M); arch_set_irn_register(fp, &mips_gp_regs[REG_FP]); be_abi_reg_map_set(reg_map, &mips_gp_regs[REG_FP], fp); @@ -712,18 +652,15 @@ static const arch_code_generator_if_t *mips_get_code_generator_if(void *self) /** * Returns the necessary byte alignment for storing a register of given class. */ -static int mips_get_reg_class_alignment(const void *self, - const arch_register_class_t *cls) +static int mips_get_reg_class_alignment(const arch_register_class_t *cls) { ir_mode *mode = arch_register_class_mode(cls); - (void) self; return get_mode_size_bytes(mode); } static const be_execution_unit_t ***mips_get_allowed_execution_units( - const void *self, const ir_node *irn) + const ir_node *irn) { - (void) self; (void) irn; /* TODO */ panic("Unimplemented mips_get_allowed_execution_units()"); @@ -767,17 +704,14 @@ static const backend_params *mips_get_libfirm_params(void) { return &p; } -static asm_constraint_flags_t mips_parse_asm_constraint(const void *self, - const char **c) +static asm_constraint_flags_t mips_parse_asm_constraint(const char **c) { - (void) self; (void) c; return ASM_CONSTRAINT_FLAG_INVALID; } -static int mips_is_valid_clobber(const void *self, const char *clobber) +static int mips_is_valid_clobber(const char *clobber) { - (void) self; (void) clobber; return 0; }