X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fppc32%2Fbearch_ppc32.c;h=6268c71e143583f46b9f8cbb22ad63887b5e2e29;hb=11d99dd205c877b0a72a8ed5d3cb601b4ec6615f;hp=be3b2b535dde6548b2854cf2febb771989ced87e;hpb=e1397b01aceb38b6bb62c319007146af3b922f39;p=libfirm diff --git a/ir/be/ppc32/bearch_ppc32.c b/ir/be/ppc32/bearch_ppc32.c index be3b2b535..6268c71e1 100644 --- a/ir/be/ppc32/bearch_ppc32.c +++ b/ir/be/ppc32/bearch_ppc32.c @@ -37,25 +37,26 @@ #include "debug.h" #include "error.h" -#include "../bearch_t.h" /* the general register allocator interface */ -#include "../benode_t.h" +#include "../bearch.h" +#include "../benode.h" #include "../belower.h" -#include "../besched_t.h" +#include "../besched.h" #include "be.h" #include "../beabi.h" #include "../bemachine.h" #include "../bemodule.h" #include "../bespillslots.h" #include "../beblocksched.h" -#include "../beirg_t.h" +#include "../beirg.h" #include "../begnuas.h" +#include "../belistsched.h" #include "pset.h" #include "bearch_ppc32_t.h" -#include "ppc32_new_nodes.h" /* ppc nodes interface */ -#include "gen_ppc32_regalloc_if.h" /* the generated interface (register type and class defenitions) */ +#include "ppc32_new_nodes.h" +#include "gen_ppc32_regalloc_if.h" #include "ppc32_transform.h" #include "ppc32_transform_conv.h" #include "ppc32_emitter.h" @@ -79,72 +80,9 @@ static set *cur_reg_set = NULL; * |___/ **************************************************/ -/** - * Return register requirements for a ppc 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 *ppc32_get_irn_reg_req(const ir_node *irn, - int pos) -{ - long node_pos = pos == -1 ? 0 : pos; - ir_mode *mode = get_irn_mode(irn); - FIRM_DBG_REGISTER(firm_dbg_module_t *mod, DEBUG_MODULE); - - if (is_Block(irn) || mode == mode_X || mode == mode_M) { - DBG((mod, LEVEL_1, "ignoring block, mode_X or mode_M node %+F\n", irn)); - return arch_no_register_req; - } - - if (mode == mode_T && pos < 0) { - DBG((mod, LEVEL_1, "ignoring request for OUT requirements at %+F", irn)); - return arch_no_register_req; - } - - DBG((mod, LEVEL_1, "get requirements at pos %d for %+F ... ", pos, irn)); - - if (is_Proj(irn)) { - /* 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 = ppc32_translate_proj_pos(irn); - } else { - node_pos = pos; - } - - irn = skip_Proj_const(irn); - - DB((mod, LEVEL_1, "skipping Proj, going to %+F at pos %d ... ", irn, node_pos)); - } - - /* get requirements for our own nodes */ - if (is_ppc32_irn(irn)) { - const arch_register_req_t *req; - if (pos >= 0) { - req = get_ppc32_in_req(irn, pos); - } else { - req = get_ppc32_out_req(irn, node_pos); - } - - DB((mod, LEVEL_1, "returning reqs for %+F at pos %d\n", irn, pos)); - return req; - } - - /* unknowns should be transformed by now */ - assert(!is_Unknown(irn)); - - DB((mod, LEVEL_1, "returning NULL for %+F (node not supported)\n", irn)); - return arch_no_register_req; -} - static arch_irn_class_t ppc32_classify(const ir_node *irn) { - irn = skip_Proj_const(irn); - - if (is_cfop(irn)) { - return arch_irn_class_branch; - } - + (void) irn; return 0; } @@ -222,8 +160,8 @@ static ir_type *ppc32_abi_get_between_type(void *self) if(!between_type) { ir_entity *ret_addr_ent; - ir_type *ret_addr_type = new_type_primitive(new_id_from_str("return_addr"), mode_P); - ir_type *old_bp_type = new_type_primitive(new_id_from_str("bp"), mode_P); + ir_type *ret_addr_type = new_type_primitive(mode_P); + ir_type *old_bp_type = new_type_primitive(mode_P); between_type = new_type_class(new_id_from_str("ppc32_between_type")); old_bp_ent = new_entity(between_type, new_id_from_str("old_bp"), old_bp_type); @@ -291,7 +229,7 @@ static const be_abi_callbacks_t ppc32_abi_callbacks = { /* fill register allocator interface */ static const arch_irn_ops_t ppc32_irn_ops = { - ppc32_get_irn_reg_req, + get_ppc32_in_req, ppc32_classify, ppc32_get_frame_entity, ppc32_set_frame_entity, @@ -636,14 +574,13 @@ static void ppc32_done(void *self) { -static unsigned ppc32_get_n_reg_class(const void *self) { - (void) self; +static unsigned ppc32_get_n_reg_class(void) +{ return N_CLASSES; } -static const arch_register_class_t *ppc32_get_reg_class(const void *self, - unsigned i) { - (void) self; +static const arch_register_class_t *ppc32_get_reg_class(unsigned i) +{ assert(i < N_CLASSES && "Invalid ppc register class requested."); return &ppc32_reg_classes[i]; } @@ -656,8 +593,8 @@ static const arch_register_class_t *ppc32_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 *ppc32_get_reg_class_for_mode(const void *self, const ir_mode *mode) { - (void) self; +const arch_register_class_t *ppc32_get_reg_class_for_mode(const ir_mode *mode) +{ if (mode_is_float(mode)) return &ppc32_reg_classes[CLASS_ppc32_fp]; else @@ -783,15 +720,13 @@ static const ilp_sched_selector_t *ppc32_get_ilp_sched_selector(const void *self /** * Returns the necessary byte alignment for storing a register of given class. */ -static int ppc32_get_reg_class_alignment(const void *self, const arch_register_class_t *cls) { +static int ppc32_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 ***ppc32_get_allowed_execution_units(const void *self, const ir_node *irn) { - (void) self; +static const be_execution_unit_t ***ppc32_get_allowed_execution_units(const ir_node *irn) { (void) irn; /* TODO */ panic("Unimplemented ppc32_get_allowed_execution_units()"); @@ -835,18 +770,16 @@ static const backend_params *ppc32_get_libfirm_params(void) { return &p; } -static asm_constraint_flags_t ppc32_parse_asm_constraint(const void *self, const char **c) +static asm_constraint_flags_t ppc32_parse_asm_constraint(const char **c) { /* no asm support yet */ - (void) self; (void) c; return ASM_CONSTRAINT_FLAG_INVALID; } -static int ppc32_is_valid_clobber(const void *self, const char *clobber) +static int ppc32_is_valid_clobber(const char *clobber) { /* no asm support yet */ - (void) self; (void) clobber; return 0; }