X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fbe%2Fppc32%2Fbearch_ppc32.c;h=3765d26c71d37bbf64efa083e61c6f2394131977;hb=1872920c09708b361d06c0dc9f4c1fd0a03544f5;hp=573e6f86f82021e62be263651de417079751e614;hpb=c23b55879df97f49fc6f1e95651f9f28a980b620;p=libfirm diff --git a/ir/be/ppc32/bearch_ppc32.c b/ir/be/ppc32/bearch_ppc32.c index 573e6f86f..3765d26c7 100644 --- a/ir/be/ppc32/bearch_ppc32.c +++ b/ir/be/ppc32/bearch_ppc32.c @@ -322,22 +322,25 @@ static void ppc32_abi_regs_saved_by_me(void *self, pset *regs) /** * Generate the prologue. - * @param self The callback object. - * @param mem A pointer to the mem node. Update this if you define new memory. - * @param reg_map A mapping mapping all callee_save/ignore/parameter registers to their defining nodes. + * @param self The callback object. + * @param mem A pointer to the mem node. Update this if you define new memory. + * @param reg_map A mapping mapping all callee_save/ignore/parameter registers to their defining nodes. + * @param stack_bias Points to the current stack bias, can be modified if needed. + * * @return The register which shall be used as a stack frame base. * * All nodes which define registers in @p reg_map must keep @p reg_map current. */ -static const arch_register_t *ppc32_abi_prologue(void *self, ir_node **mem, pmap *reg_map) +static const arch_register_t *ppc32_abi_prologue(void *self, ir_node **mem, pmap *reg_map, int *stack_bias) { ppc32_abi_env *env = (ppc32_abi_env *) self; be_abi_call_flags_t flags = be_abi_call_get_flags(env->call); (void) mem; (void) reg_map; + (void) stack_bias; isleaf = flags.bits.irg_is_leaf; - if(flags.bits.try_omit_fp) + if (flags.bits.try_omit_fp) return &ppc32_gp_regs[REG_R1]; else return &ppc32_gp_regs[REG_R31]; @@ -602,13 +605,13 @@ static const arch_code_generator_if_t ppc32_code_gen_if = { * Initializes the code generator. */ static void *ppc32_cg_init(be_irg_t *birg) { - ppc32_isa_t *isa = (ppc32_isa_t *)birg->main_env->arch_env.isa; + ppc32_isa_t *isa = (ppc32_isa_t *)birg->main_env->arch_env; ppc32_code_gen_t *cg = xmalloc(sizeof(*cg)); cg->impl = &ppc32_code_gen_if; cg->irg = birg->irg; cg->reg_set = new_set(ppc32_cmp_irn_reg_assoc, 1024); - cg->arch_env = &birg->main_env->arch_env; + cg->arch_env = birg->main_env->arch_env; cg->isa = isa; cg->birg = birg; cg->area_size = 0; @@ -640,7 +643,7 @@ static ppc32_isa_t ppc32_isa_template = { &ppc32_gp_regs[REG_R1], /* stack pointer */ &ppc32_gp_regs[REG_R31], /* base pointer */ -1, /* stack is decreasing */ - 1, /* call stack alignment */ + 2, /* power of two stack alignment for calls, 2^2 == 4 */ NULL, /* main environment */ 7, /* spill costs */ 5, /* reload costs */ @@ -668,7 +671,7 @@ static void ppc32_collect_symconsts_walk(ir_node *node, void *env) { /** * Initializes the backend ISA and opens the output file. */ -static void *ppc32_init(FILE *file_handle) { +static arch_env_t *ppc32_init(FILE *file_handle) { static int inited = 0; ppc32_isa_t *isa; int i; @@ -698,7 +701,7 @@ static void *ppc32_init(FILE *file_handle) { */ inc_master_type_visited(); - return isa; + return &isa->arch_env; } static void ppc32_dump_indirect_symbols(ppc32_isa_t *isa) { @@ -717,7 +720,7 @@ static void ppc32_dump_indirect_symbols(ppc32_isa_t *isa) { static void ppc32_done(void *self) { ppc32_isa_t *isa = self; - be_gas_emit_decls(isa->arch_isa.main_env, 1); + be_gas_emit_decls(isa->arch_env.main_env, 1); be_gas_emit_switch_section(GAS_SECTION_DATA); ppc32_dump_indirect_symbols(isa); @@ -913,17 +916,35 @@ static ir_graph **ppc32_get_irg_list(const void *self, ir_graph ***irg_list) { static const backend_params *ppc32_get_libfirm_params(void) { static backend_params p = { 1, /* need dword lowering */ - 0, /* don't support inlien assembler yet */ + 0, /* don't support inline assembler yet */ + 0, /* no immediate floating point mode. */ NULL, /* no additional opcodes */ NULL, /* will be set later */ NULL, /* but yet no creator function */ NULL, /* context for create_intrinsic_fkt */ NULL, /* no if conversion settings */ + NULL /* no immediate fp mode */ }; return &p; } +static asm_constraint_flags_t ppc32_parse_asm_constraint(const void *self, 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) +{ + /* no asm support yet */ + (void) self; + (void) clobber; + return 0; +} + const arch_isa_if_t ppc32_isa_if = { ppc32_init, ppc32_done, @@ -939,6 +960,8 @@ const arch_isa_if_t ppc32_isa_if = { ppc32_get_allowed_execution_units, ppc32_get_machine, ppc32_get_irg_list, + ppc32_parse_asm_constraint, + ppc32_is_valid_clobber }; void be_init_arch_ppc32(void)