if (mode_is_float(mode)) {
new_op = new_rd_ia32_fStore(env->dbg, env->irg, env->block, ptr, noreg, val, nomem, mode_T);
}
+ else if (get_mode_size_bits(mode) == 8) {
+ new_op = new_rd_ia32_Store8Bit(env->dbg, env->irg, env->block, ptr, noreg, val, nomem, mode_T);
+ }
else {
new_op = new_rd_ia32_Store(env->dbg, env->irg, env->block, ptr, noreg, val, nomem, mode_T);
}
}
/* set register parameters */
-// if (cc & cc_reg_param) {
- if (1) {
+ if (cc & cc_reg_param) {
+// if (1) {
/* determine the number of parameters passed via registers */
biggest_n = ia32_get_n_regparam_class(n, modes, &ignore_1, &ignore_2);
/* verify that this function is never called on non-AM supporting operations */
assert(get_ia32_am_support(n) != ia32_am_None && "emit binop expects addressmode support");
-#define PRODUCES_RESULT(n) !(is_ia32_St(n) || is_ia32_CondJmp(n) || is_ia32_fCondJmp(n) || is_ia32_SwitchJmp(n))
+#define PRODUCES_RESULT(n) \
+ (!(is_ia32_St(n) || \
+ is_ia32_Store8Bit(n) || \
+ is_ia32_CondJmp(n) || \
+ is_ia32_fCondJmp(n) || \
+ is_ia32_SwitchJmp(n)))
if (! buf) {
buf = xcalloc(1, SNPRINTF_BUF_LEN);
entity *irg_ent = get_irg_entity(irg);
const char *irg_name = get_entity_name(irg_ent);
-// fprintf(F, "\t.text\n");
+ fprintf(F, "\tsection .text\n");
if (get_entity_visibility(irg_ent) == visibility_external_visible) {
fprintf(F, "global %s\n", irg_name);
}
static void ia32_emit_func_epilog(FILE *F, ir_graph *irg) {
const char *irg_name = get_entity_name(get_irg_entity(irg));
- fprintf(F, "\tret\n");
+ fprintf(F, "\tret\n\n");
//printf(F, "\t.size\t%s, .-%s\n\n", irg_name, irg_name);
}
"emit" => '. mov %ia32_emit_binop ; Store(%A3) -> (%A1) '
},
+"Store8Bit" => {
+ "op_flags" => "L|F",
+ "state" => "exc_pinned",
+ "comment" => "construct 8Bit Store: Store(ptr, val, mem) = ST ptr,val",
+ "cmp_attr" => " return ia32_compare_immop_attr(attr_a, attr_b);\n",
+ "reg_req" => { "in" => [ "gp", "gp", "eax ebx ecx edx", "none" ] },
+ "emit" => '. mov %ia32_emit_binop ; Store(%A3) -> (%A1)'
+},
+
"Lea" => {
"irn_flags" => "R",
"comment" => "construct Lea: Lea(a,b) = lea [a+b*const+offs] | res = a + b * const + offs with const = 0,1,2,4,8",
if (mode_is_float(env->mode)) {
new_op = new_rd_ia32_fStore(env->dbg, env->irg, env->block, ptr, noreg, sval, mem, env->mode);
}
+ else if (get_mode_size_bits(env->mode) == 8) {
+ new_op = new_rd_ia32_Store8Bit(env->dbg, env->irg, env->block, ptr, noreg, sval, mem, env->mode);
+ }
else {
new_op = new_rd_ia32_Store(env->dbg, env->irg, env->block, ptr, noreg, sval, mem, env->mode);
}
if (mode_is_float(mode)) {
new_op = new_rd_ia32_fStore(env->dbg, env->irg, env->block, ptr, noreg, val, mem, mode_T);
}
+ else if (get_mode_size_bits(mode) == 8) {
+ new_op = new_rd_ia32_Store8Bit(env->dbg, env->irg, env->block, ptr, noreg, val, mem, mode_T);
+ }
else {
new_op = new_rd_ia32_Store(env->dbg, env->irg, env->block, ptr, noreg, val, mem, mode_T);
}