#include "lower_calls.h"
#include "lower_mode_b.h"
#include "lower_softfloat.h"
+#include "firmstat_t.h"
#include "beabi.h"
#include "benode.h"
* The environment for the intrinsic mapping.
*/
static ia32_intrinsic_env_t intrinsic_env = {
- NULL, /* the isa */
- NULL, /* the irg, these entities belong to */
NULL, /* entity for __divdi3 library call */
NULL, /* entity for __moddi3 library call */
NULL, /* entity for __udivdi3 library call */
case ia32_am_binary:
switch (i) {
case n_ia32_binary_left: {
- const arch_register_req_t *req;
if (!is_ia32_commutative(irn))
return 0;
/* we can't swap left/right for limited registers
- * (As this (currently) breaks constraint handling copies)
- */
- req = arch_get_irn_register_req_in(irn, n_ia32_binary_left);
- if (req->type & arch_register_req_type_limited)
+ * (As this (currently) breaks constraint handling copies) */
+ arch_register_req_t const *const req = arch_get_irn_register_req_in(irn, n_ia32_binary_left);
+ if (arch_register_req_is(req, limited))
return 0;
break;
}
ia32_perform_memory_operand,
};
-static ir_entity *mcount = NULL;
static int gprof = 0;
static void ia32_before_abi(ir_graph *irg)
{
if (gprof) {
+ static ir_entity *mcount = NULL;
if (mcount == NULL) {
ir_type *tp = new_type_method(0, 0);
ident *id = new_id_from_str("mcount");
&ia32_registers[REG_ESP], /* stack pointer register */
&ia32_registers[REG_EBP], /* base pointer register */
2, /* power of two stack alignment, 2^2 == 4 */
- NULL, /* main environment */
7, /* costs for a spill instruction */
5, /* costs for a reload instruction */
false, /* no custom abi handling */
IA32_FPU_ARCH_X87, /* FPU architecture */
};
-static arch_env_t *ia32_begin_codegeneration(const be_main_env_t *env)
+static arch_env_t *ia32_begin_codegeneration(void)
{
ia32_isa_t *isa = XMALLOC(ia32_isa_t);
*isa = ia32_isa_template;
isa->tv_ent = pmap_create();
- /* enter the ISA object into the intrinsic environment */
- intrinsic_env.isa = isa;
-
- be_emit_init(env->file_handle);
- be_gas_begin_compilation_unit(env);
-
return &isa->base;
}
static void ia32_end_codegeneration(void *self)
{
ia32_isa_t *isa = (ia32_isa_t*)self;
-
- /* emit now all global declarations */
- be_gas_end_compilation_unit(isa->base.main_env);
-
- be_emit_exit();
-
pmap_destroy(isa->tv_ent);
free(self);
}