convert bitfield initializer tarvals before using them
[libfirm] / ir / be / arm / bearch_arm.c
index 6338f67..d746222 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "bitset.h"
 #include "debug.h"
+#include "array_t.h"
 #include "irtools.h"
 
 #include "../bearch_t.h"                /* the general register allocator interface */
@@ -383,10 +384,9 @@ static ir_node *convert_dbl_to_int(ir_node *bl, ir_node *arg, ir_node *mem,
                v = (v << 8) | get_tarval_sub_bits(tv, 1);
                v = (v << 8) | get_tarval_sub_bits(tv, 0);
                *resL = new_Const_long(mode_Is, v);
-       }
-       else if (get_irn_op(skip_Proj(arg)) == op_Load) {
+       } else if (is_Load(skip_Proj(arg))) {
                /* FIXME: handling of low/high depends on LE/BE here */
-               assert(0);
+               panic("Unimplemented convert_dbl_to_int() case");
        }
        else {
                ir_graph *irg = current_ir_graph;
@@ -423,14 +423,12 @@ static ir_node *convert_sng_to_int(ir_node *bl, ir_node *arg)
                v = (v << 8) | get_tarval_sub_bits(tv, 1);
                v = (v << 8) | get_tarval_sub_bits(tv, 0);
                return new_Const_long(mode_Is, v);
-       }
-       else if (get_irn_op(skip_Proj(arg)) == op_Load) {
+       } else if (is_Load(skip_Proj(arg))) {
                ir_node *load;
 
                load = skip_Proj(arg);
        }
-       assert(0);
-       return NULL;
+       panic("Unimplemented convert_sng_to_int() case");
 }
 
 /**
@@ -902,20 +900,19 @@ static void arm_abi_dont_save_regs(void *self, pset *s)
                pset_insert_ptr(s, env->arch_env->bp);
 }
 
-
-
 /**
-* Generate the routine prologue.
+ * Generate the routine prologue.
  *
- * @param self    The callback object.
- * @param mem     A pointer to the mem node. Update this if you define new memory.
- * @param reg_map A map mapping all callee_save/ignore/parameter registers to their defining nodes.
+ * @param self       The callback object.
+ * @param mem        A pointer to the mem node. Update this if you define new memory.
+ * @param reg_map    A map mapping all callee_save/ignore/parameter registers to their defining nodes.
+ * @param stack_bias Points to the current stack bias, can be modified if needed.
  *
  * @return        The register which shall be used as a stack frame base.
  *
  * All nodes which define registers in @p reg_map must keep @p reg_map current.
  */
-static const arch_register_t *arm_abi_prologue(void *self, ir_node **mem, pmap *reg_map) {
+static const arch_register_t *arm_abi_prologue(void *self, ir_node **mem, pmap *reg_map, int *stack_bias) {
        arm_abi_env_t         *env = self;
        ir_node               *keep, *store;
        ir_graph              *irg;
@@ -925,6 +922,8 @@ static const arch_register_t *arm_abi_prologue(void *self, ir_node **mem, pmap *
        ir_node               *fp, *ip, *lr, *pc;
        ir_node               *sp = be_abi_reg_map_get(reg_map, env->arch_env->sp);
 
+       (void) stack_bias;
+
        if (env->flags.try_omit_fp)
                return env->arch_env->sp;
 
@@ -1143,15 +1142,13 @@ static const be_execution_unit_t ***arm_get_allowed_execution_units(const void *
        (void) self;
        (void) irn;
        /* TODO */
-       assert(0);
-       return NULL;
+       panic("Unimplemented arm_get_allowed_execution_units()");
 }
 
 static const be_machine_t *arm_get_machine(const void *self) {
        (void) self;
        /* TODO */
-       assert(0);
-       return NULL;
+       panic("Unimplemented arm_get_machine()");
 }
 
 /**
@@ -1212,11 +1209,11 @@ static asm_constraint_flags_t arm_parse_asm_constraint(const void *self, const c
        return ASM_CONSTRAINT_FLAG_INVALID;
 }
 
-static bool arm_is_valid_clobber(const void *self, const char *clobber)
+static int arm_is_valid_clobber(const void *self, const char *clobber)
 {
        (void) self;
        (void) clobber;
-       return false;
+       return 0;
 }
 
 /**
@@ -1289,6 +1286,7 @@ const arch_isa_if_t arm_isa_if = {
        arm_get_allowed_execution_units,
        arm_get_machine,
        arm_get_irg_list,
+       NULL,               /* mark remat */
        arm_parse_asm_constraint,
        arm_is_valid_clobber
 };