#include "irflag.h"
#include "irgmod.h"
#include "irgopt.h"
-#include "irbitset.h"
#include "irgopt.h"
#include "irdump.h"
#include "pdeq.h"
#include "be.h"
#include "be_t.h"
#include "beirgmod.h"
-#include "be_dbgout.h"
#include "beblocksched.h"
#include "bespillutil.h"
#include "bespillslots.h"
}
}
-/**
- * The IA32 ABI callback object.
- */
-typedef struct {
- be_abi_call_flags_bits_t flags; /**< The call flags. */
- ir_graph *irg; /**< The associated graph. */
-} ia32_abi_env_t;
-
static ir_entity *ia32_get_frame_entity(const ir_node *irn)
{
return is_ia32_irn(irn) ? get_ia32_frame_ent(irn) : NULL;
static void ia32_build_between_type(void)
{
#define IDENT(s) new_id_from_chars(s, sizeof(s)-1)
- if (! between_type) {
+ if (between_type == NULL) {
ir_type *old_bp_type = new_type_primitive(mode_Iu);
ir_type *ret_addr_type = new_type_primitive(mode_Iu);
* virtual with real x87 instructions, creating a block schedule and peephole
* optimisations.
*/
-static void ia32_finish(ir_graph *irg)
+static void ia32_finish_graph(ir_graph *irg)
{
ia32_irg_data_t *irg_data = ia32_get_irg_data(irg);
be_stack_layout_t *stack_layout = be_get_irg_stack_layout(irg);
{
size_t i;
- for (i = get_irp_n_modes(); i > 0;) {
- ir_mode *mode = get_irp_mode(--i);
+ for (i = ir_get_n_modes(); i > 0;) {
+ ir_mode *mode = ir_get_mode(--i);
if (mode_is_int(mode))
set_tarval_mode_output_option(mode, &mo_integer);
*/
static void ia32_init(void)
{
- ir_mode *mode_long_long;
- ir_mode *mode_unsigned_long_long;
- ir_type *type_long_long;
- ir_type *type_unsigned_long_long;
+ ir_mode *mode_long_long;
+ ir_mode *mode_unsigned_long_long;
+ ir_type *type_long_long;
+ ir_type *type_unsigned_long_long;
ia32_setup_cg_config();
init_asm_constraints();
- set_tarval_output_modes();
- ia32_register_init();
- ia32_create_opcodes(&ia32_irn_ops);
-
ia32_mode_fpcw = new_int_mode("Fpcw", irma_twos_complement, 16, 0, 0);
/* note mantissa is 64bit but with explicitely encoded 1 so the really
ia32_backend_params.mode_float_arithmetic = ia32_mode_E;
ia32_backend_params.type_long_double = ia32_type_E;
}
+
+ ia32_register_init();
+ obstack_init(&opcodes_obst);
+ ia32_create_opcodes(&ia32_irn_ops);
+}
+
+static void ia32_finish(void)
+{
+ if (between_type != NULL) {
+ free_type(between_type);
+ between_type = NULL;
+ }
+ ia32_free_opcodes();
+ obstack_free(&opcodes_obst, NULL);
}
/**
{
ia32_isa_t *isa = XMALLOC(ia32_isa_t);
+ set_tarval_output_modes();
+
*isa = ia32_isa_template;
isa->tv_ent = pmap_create();
be_abi_call_flags_t call_flags = be_abi_call_get_flags(abi);
/* set abi flags for calls */
- 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 = 0; /* No call immediate, we handle this by ourselves */
+ call_flags.bits.call_has_imm = false; /* No call immediate, we handle this by ourselves */
/* set parameter passing style */
be_abi_call_set_flags(abi, call_flags, &ia32_abi_callbacks);
&intrinsic_env,
};
- ia32_create_opcodes(&ia32_irn_ops);
-
/* lower compound param handling
* Note: we lower compound arguments ourself, since on ia32 we don't
* have hidden parameters but know where to find the structs on the stack.
const arch_isa_if_t ia32_isa_if = {
ia32_init,
+ ia32_finish,
ia32_get_libfirm_params,
ia32_lower_for_target,
ia32_parse_asm_constraint,
ia32_before_abi, /* before abi introduce hook */
ia32_prepare_graph,
ia32_before_ra, /* before register allocation hook */
- ia32_finish, /* called before codegen */
+ ia32_finish_graph, /* called before codegen */
ia32_emit, /* emit && done */
};