-/**
- * Creates a Store for a Spill
- */
-static ir_node *ia32_lower_spill(void *self, ir_node *spill) {
- ia32_code_gen_t *cg = self;
- dbg_info *dbg = get_irn_dbg_info(spill);
- ir_node *block = get_nodes_block(spill);
- ir_node *ptr = get_irg_frame(cg->irg);
- ir_node *val = be_get_Spill_context(spill);
- ir_node *mem = new_rd_NoMem(cg->irg);
- ir_mode *mode = get_irn_mode(spill);
- ir_node *res;
- entity *ent = be_get_spill_entity(spill);
- unsigned offs = get_entity_offset_bytes(ent);
-
- DB((cg->mod, LEVEL_1, "lower_spill: got offset %d for %+F\n", offs, ent));
-
- res = new_rd_ia32_Store(dbg, cg->irg, block, ptr, val, mem, mode);
- set_ia32_am_offs(res, new_tarval_from_long(offs, mode_Iu));
-
- return res;
-}
-
-/**
- * Create a Load for a Spill
- */
-static ir_node *ia32_lower_reload(void *self, ir_node *reload) {
- ia32_code_gen_t *cg = self;
- dbg_info *dbg = get_irn_dbg_info(reload);
- ir_node *block = get_nodes_block(reload);
- ir_node *ptr = get_irg_frame(cg->irg);
- ir_mode *mode = get_irn_mode(reload);
- ir_node *pred = get_irn_n(reload, 0);
- tarval *tv;
- ir_node *res;
-
- if (be_is_Spill(pred)) {
- entity *ent = be_get_spill_entity(pred);
- unsigned offs = get_entity_offset_bytes(ent);
- DB((cg->mod, LEVEL_1, "lower_reload: got offset %d for %+F\n", offs, ent));
- tv = new_tarval_from_long(offs, mode_Iu);
- }
- else if (is_ia32_Store(pred)) {
- tv = get_ia32_am_offs(pred);
- }
- else {
- assert(0 && "unsupported Reload predecessor");
- }
-
- res = new_rd_ia32_Load(dbg, cg->irg, block, ptr, pred, mode);
- set_ia32_am_offs(res, tv);
-
- return res;
-}
-
-/**
- * Return the stack register for this irg.
- */
-static const arch_register_t *ia32_get_stack_register(void *self) {
- ia32_code_gen_t *cg = self;
-
- if (cg->has_alloca) {
- return &ia32_general_purpose_regs[REG_EBP];
- }
-
- return &ia32_general_purpose_regs[REG_ESP];
-}