3 * Backend ABI implementation.
10 #include "firm_types.h"
16 struct _be_abi_call_flags_bits_t {
17 unsigned left_to_right : 1; /**< Arguments are from left to right. */
18 unsigned store_args_sequential : 1; /**< Use sequential stores for arguments. */
19 unsigned try_omit_fp : 1; /**< Try to omit the frame pointer. */
20 unsigned fp_free : 1; /**< The function can use any register as frame pointer. */
21 unsigned call_has_imm : 1; /**< A call can take the callee's address as an immediate. */
24 union _be_abi_call_flags_t {
25 be_abi_call_flags_bits_t bits;
29 struct _be_abi_callbacks_t {
30 void *(*init)(const be_abi_call_t *call, const arch_isa_t *isa, ir_graph *irg);
32 void (*done)(void *self);
34 ir_type *(*get_between_type)(void *self);
36 void (*regs_saved_by_me)(void *self, pset *regs);
38 const arch_register_t *(*prologue)(void *self, pmap *reg_map);
40 void (*epilogue)(void *self, ir_node *bl, ir_node **mem, pmap *reg_map);
43 void be_abi_call_set_flags(be_abi_call_t *call, be_abi_call_flags_t flags, const be_abi_callbacks_t *cb);
44 void be_abi_call_param_stack(be_abi_call_t *call, int pos);
45 void be_abi_call_param_reg(be_abi_call_t *call, int pos, const arch_register_t *reg);
46 void be_abi_call_res_reg(be_abi_call_t *call, int pos, const arch_register_t *reg);
48 be_abi_call_flags_t be_abi_call_get_flags(const be_abi_call_t *call);
50 be_abi_irg_t *be_abi_introduce(be_irg_t *bi);
51 void be_abi_fix_stack_bias(be_abi_irg_t *env);
52 void be_abi_fix_stack_nodes(be_abi_irg_t *env);
53 void be_abi_free(be_abi_irg_t *abi);
55 ir_node *be_abi_get_callee_save_irn(be_abi_irg_t *abi, const arch_register_t *reg);