*/
static void *TEMPLATE_cg_init(be_irg_t *birg) {
const arch_env_t *arch_env = be_get_birg_arch_env(birg);
- TEMPLATE_isa_t *isa = (TEMPLATE_isa_t *) arch_env->isa;
+ TEMPLATE_isa_t *isa = (TEMPLATE_isa_t *) arch_env;
TEMPLATE_code_gen_t *cg = xmalloc(sizeof(*cg));
cg->impl = &TEMPLATE_code_gen_if;
&TEMPLATE_general_purpose_regs[REG_SP], /* stack pointer register */
&TEMPLATE_general_purpose_regs[REG_BP], /* base pointer register */
-1, /* stack direction */
- 1, /* stack alignment for calls */
+ 2, /* power of two stack alignment for calls, 2^2 == 4 */
NULL, /* main environment */
7, /* costs for a spill instruction */
5, /* costs for a reload instruction */
/**
* Initializes the backend ISA and opens the output file.
*/
-static void *TEMPLATE_init(FILE *outfile) {
+static arch_env_t *TEMPLATE_init(FILE *outfile) {
static int run_once = 0;
TEMPLATE_isa_t *isa;
TEMPLATE_register_init();
TEMPLATE_create_opcodes(&TEMPLATE_irn_ops);
- return isa;
+ return &isa->arch_env;
}
TEMPLATE_isa_t *isa = self;
/* emit now all global declarations */
- be_gas_emit_decls(isa->arch_isa.main_env, 0);
+ be_gas_emit_decls(isa->arch_env.main_env, 0);
be_emit_exit();
free(self);
typedef struct {
be_abi_call_flags_bits_t flags;
const arch_env_t *arch_env;
- const arch_isa_t *isa;
ir_graph *irg;
} TEMPLATE_abi_env_t;
env->flags = fl.bits;
env->irg = irg;
env->arch_env = arch_env;
- env->isa = arch_env->isa;
return env;
}
TEMPLATE_abi_env_t *env = self;
if (env->flags.try_omit_fp) {
/* insert the BP register into the ignore set */
- pset_insert_ptr(s, env->isa->bp);
+ pset_insert_ptr(s, env->arch_env->bp);
}
}
* Build the prolog, return the BASE POINTER register
*/
static const arch_register_t *TEMPLATE_abi_prologue(void *self, ir_node **mem,
- pmap *reg_map)
+ pmap *reg_map, int *stack_bias)
{
TEMPLATE_abi_env_t *env = self;
(void) reg_map;
(void) mem;
+ (void) stack_bias;
if(env->flags.try_omit_fp)
- return env->isa->sp;
- return env->isa->bp;
+ return env->arch_env->sp;
+ return env->arch_env->bp;
}
/* Build the epilog */
static backend_params p = {
0, /* no dword lowering */
0, /* no inline assembly */
+ 0, /* no immediate floating point mode. */
NULL, /* no additional opcodes */
NULL, /* will be set later */
NULL, /* no creator function */
NULL, /* context for create_intrinsic_fkt */
NULL, /* parameter for if conversion */
+ NULL /* no immediate fp mode */
};
return &p;
}
return NULL;
}
+static asm_constraint_flags_t TEMPLATE_parse_asm_constraint(const void *self,
+ const char **c)
+{
+ (void) self;
+ (void) c;
+ return ASM_CONSTRAINT_FLAG_INVALID;
+}
+
+static int TEMPLATE_is_valid_clobber(const void *self, const char *clobber)
+{
+ (void) self;
+ (void) clobber;
+ return 0;
+}
const arch_isa_if_t TEMPLATE_isa_if = {
TEMPLATE_init,
TEMPLATE_get_backend_params,
TEMPLATE_get_allowed_execution_units,
TEMPLATE_get_machine,
- TEMPLATE_get_backend_irg_list
+ TEMPLATE_get_backend_irg_list,
+ TEMPLATE_parse_asm_constraint,
+ TEMPLATE_is_valid_clobber
};
void be_init_arch_TEMPLATE(void)