Commit 7026a4b5 authored by Matthias Braun's avatar Matthias Braun
Browse files

arm: support different architecture versions

parent 178cefa3
......@@ -851,7 +851,14 @@ void arm_emit_function(ir_graph *irg)
void arm_emit_file_prologue(void)
{
be_emit_cstring("\t.arch armv5t\n");
unsigned version = arm_cg_config.version;
if (version == 5) {
be_emit_cstring("\t.arch armv5t\n");
} else if (version == 6) {
be_emit_cstring("\t.arch armv6\n");
} else {
panic("no arch string for version %u known", version);
}
be_emit_write_line();
be_emit_cstring("\t.fpu softvfp\n");
be_emit_write_line();
......
......@@ -182,6 +182,13 @@ Add => {
},
Mul => {
irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "gp" ] },
emit => 'mul %D0, %S0, %S1',
mode => $mode_gp,
},
Mulv5 => {
irn_flags => [ "rematerializable" ],
reg_req => { in => [ "gp", "gp" ], out => [ "!in_r1" ] },
emit => 'mul %D0, %S0, %S1',
......
......@@ -627,7 +627,11 @@ static ir_node *gen_Mul(ir_node *node)
}
}
assert(mode_is_data(mode));
return new_bd_arm_Mul(dbg, block, new_op1, new_op2);
if (arm_cg_config.version < 6) {
return new_bd_arm_Mulv5(dbg, block, new_op1, new_op2);
} else {
return new_bd_arm_Mul(dbg, block, new_op1, new_op2);
}
}
static ir_node *gen_Div(ir_node *node)
......
......@@ -261,6 +261,7 @@ static void arm_setup_cg_config(void)
}
arm_cg_config.use_fpa = arm_fpu & ARM_FPU_FPA_EXT_V1;
arm_cg_config.use_vfp = arm_fpu & ARM_FPU_VFP_EXT_V1xD;
arm_cg_config.version = 6;
}
static void arm_init(void)
......
......@@ -115,9 +115,10 @@ struct arm_isa_t {
};
typedef struct arm_codegen_config_t {
bool use_softfloat;
bool use_fpa;
bool use_vfp;
unsigned version; /**< arm architecture version (5,6,7) */
bool use_softfloat;
bool use_fpa;
bool use_vfp;
} arm_codegen_config_t;
extern arm_codegen_config_t arm_cg_config;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment