if (env->flags.try_omit_fp) {
/* simply remove the stack frame here */
curr_sp = be_new_IncSP(arch_env->sp, irg, bl, curr_sp, BE_STACK_FRAME_SIZE_SHRINK, 0);
- add_irn_dep(curr_sp, *mem);
} else {
ir_mode *mode_bp = arch_env->bp->reg_class->mode;
(we assume they are in cache), other memory operations cost 20
cycles.
*/
- if(is_ia32_use_frame(irn) ||
- (is_ia32_NoReg_GP(get_irn_n(irn, 0)) &&
- is_ia32_NoReg_GP(get_irn_n(irn, 1)))) {
+ if (is_ia32_use_frame(irn) || (
+ is_ia32_NoReg_GP(get_irn_n(irn, n_ia32_base)) &&
+ is_ia32_NoReg_GP(get_irn_n(irn, n_ia32_index))
+ )) {
cost += 5;
} else {
cost += 20;
}
}
-typedef enum transformer_t {
- TRANSFORMER_DEFAULT,
-#ifdef FIRM_GRGEN_BE
- TRANSFORMER_PBQP
-#endif
-} transformer_t;
-
-static transformer_t be_transformer = TRANSFORMER_DEFAULT;
+transformer_t be_transformer = TRANSFORMER_DEFAULT;
/**
* Transforms the standard firm graph into
break;
#endif
- default: panic("Invalid transformer");
+ default: panic("invalid transformer");
}
/* do local optimizations (mainly CSE) */
call_flags.bits.store_args_sequential = 0;
/* call_flags.bits.try_omit_fp not changed: can handle both settings */
call_flags.bits.fp_free = 0; /* the frame pointer is fixed in IA32 */
- call_flags.bits.call_has_imm = 1; /* IA32 calls can have immediate address */
+ call_flags.bits.call_has_imm = 1; /* No call immediates, we handle this by ourselves */
/* set parameter passing style */
be_abi_call_set_flags(abi, call_flags, &ia32_abi_callbacks);
cc = cc_cdecl_set;
} else {
cc = get_method_calling_convention(method_type);
- if (!(cc & cc_fixed) &&
- get_method_additional_properties(method_type) & mtp_property_private &&
+ if (get_method_additional_properties(method_type) & mtp_property_private &&
ia32_cg_config.optimize_cc) {
/* set the calling conventions to register parameter */
cc = (cc & ~cc_bits) | cc_reg_param;
} else {
/* Micro optimisation: if the mode is shorter than 4 bytes, load 4 bytes.
* movl has a shorter opcode than mov[sz][bw]l */
- ir_mode *load_mode = mode;
- unsigned size = get_mode_size_bytes(mode);
+ ir_mode *load_mode = mode;
- if (cc & cc_callee_clear_stk) {
- pop_amount += (size + 3U) & ~3U;
- }
+ if (mode != NULL) {
+ unsigned size = get_mode_size_bytes(mode);
- if (mode != NULL && size < 4) load_mode = mode_Iu;
+ if (cc & cc_callee_clear_stk) {
+ pop_amount += (size + 3U) & ~3U;
+ }
+
+ if (size < 4) load_mode = mode_Iu;
+ }
be_abi_call_param_stack(abi, i, load_mode, 4, 0, 0);
}