X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2FTEMPLATE%2Fbearch_TEMPLATE.c;h=8e8991d292b13eb2b84bd2d03d9474396cebc58c;hb=0860cafaff791b93c568c77739bd7d9c7240ee2f;hp=381c029468b5862200abd6e9bafd639783d83329;hpb=7190d1637364be73925e273eeebe10ac1d4ba72d;p=libfirm diff --git a/ir/be/TEMPLATE/bearch_TEMPLATE.c b/ir/be/TEMPLATE/bearch_TEMPLATE.c index 381c02946..8e8991d29 100644 --- a/ir/be/TEMPLATE/bearch_TEMPLATE.c +++ b/ir/be/TEMPLATE/bearch_TEMPLATE.c @@ -34,14 +34,15 @@ #include "bitset.h" #include "debug.h" -#include "../bearch_t.h" +#include "be.h" +#include "../bearch.h" #include "../benode_t.h" #include "../belower.h" -#include "../besched_t.h" -#include "be.h" +#include "../besched.h" #include "../beabi.h" #include "../bemodule.h" #include "../begnuas.h" +#include "../belistsched.h" #include "bearch_TEMPLATE_t.h" @@ -65,61 +66,9 @@ static set *cur_reg_set = NULL; * |___/ **************************************************/ -/** - * Return register requirements for a TEMPLATE 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 *TEMPLATE_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 (mode == mode_T || mode == mode_M) { - 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 = TEMPLATE_translate_proj_pos(node); - } else { - node_pos = pos; - } - - node = skip_Proj_const(node); - } - - /* get requirements for our own nodes */ - if (is_TEMPLATE_irn(node)) { - const arch_register_req_t *req; - if (pos >= 0) { - req = get_TEMPLATE_in_req(node, pos); - } else { - req = get_TEMPLATE_out_req(node, node_pos); - } - - assert(req != NULL); - - return req; - } - - /* unknowns should be transformed already */ - assert(!is_Unknown(node)); - - return arch_no_register_req; -} - static arch_irn_class_t TEMPLATE_classify(const ir_node *irn) { - irn = skip_Proj_const(irn); - - if (is_cfop(irn)) { - return arch_irn_class_branch; - } - + (void) irn; return 0; } @@ -157,7 +106,8 @@ static int TEMPLATE_get_sp_bias(const ir_node *irn) /* fill register allocator interface */ static const arch_irn_ops_t TEMPLATE_irn_ops = { - TEMPLATE_get_irn_reg_req, + get_TEMPLATE_in_req, + get_TEMPLATE_out_req, TEMPLATE_classify, TEMPLATE_get_frame_entity, TEMPLATE_set_frame_entity, @@ -283,6 +233,7 @@ static TEMPLATE_isa_t TEMPLATE_isa_template = { &TEMPLATE_isa_if, /* isa interface implementation */ &TEMPLATE_general_purpose_regs[REG_SP], /* stack pointer register */ &TEMPLATE_general_purpose_regs[REG_BP], /* base pointer register */ + &TEMPLATE_reg_classes[CLASS_TEMPLATE_general_purpose], /* link pointer register class */ -1, /* stack direction */ 2, /* power of two stack alignment for calls, 2^2 == 4 */ NULL, /* main environment */ @@ -556,7 +507,8 @@ static const backend_params *TEMPLATE_get_backend_params(void) { NULL, /* float arithmetic mode */ 0, /* no trampoline support: size 0 */ 0, /* no trampoline support: align 0 */ - NULL /* no trampoline support: no trampoline builder */ + NULL, /* no trampoline support: no trampoline builder */ + 4 /* alignment of stack parameter: typically 4 (32bit) or 8 (64bit) */ }; return &p; }