Commit 5b7cbf36 authored by Christoph Mallon's avatar Christoph Mallon
Browse files

Implement binary emitters for AddMem8Bit, AndMem8Bit, OrMem8Bit, SubMem8Bit and XorMem8Bit.

[r26609]
parent 6abcc020
......@@ -2749,6 +2749,19 @@ static void bemit_##op(const ir_node *node) \
bemit8(ext << 3 | 1); \
bemit_mod_am(reg_gp_map[get_out_reg(val, 0)->index], node); \
} \
} \
\
static void bemit_##op##8bit(const ir_node *node) \
{ \
ir_node *val = get_irn_n(node, n_ia32_unary_op); \
if (is_ia32_Immediate(val)) { \
bemit8(0x80); \
bemit_mod_am(ext, node); \
bemit8(get_ia32_immediate_attr_const(val)->offset); \
} else { \
bemit8(ext << 3); \
bemit_mod_am(reg_gp_map[get_out_reg(val, 0)->index], node); \
} \
}
BINOPMEM(addmem, 0)
......@@ -3271,8 +3284,10 @@ static void ia32_register_binary_emitters(void)
register_emitter(op_be_Return, bemit_return);
register_emitter(op_ia32_Adc, bemit_adc);
register_emitter(op_ia32_Add, bemit_add);
register_emitter(op_ia32_AddMem8Bit, bemit_addmem8bit);
register_emitter(op_ia32_AddMem, bemit_addmem);
register_emitter(op_ia32_And, bemit_and);
register_emitter(op_ia32_AndMem8Bit, bemit_andmem8bit);
register_emitter(op_ia32_AndMem, bemit_andmem);
register_emitter(op_ia32_Breakpoint, bemit_int3);
register_emitter(op_ia32_Call, bemit_call);
......@@ -3303,6 +3318,7 @@ static void ia32_register_binary_emitters(void)
register_emitter(op_ia32_Not, bemit_not);
register_emitter(op_ia32_NotMem, bemit_notmem);
register_emitter(op_ia32_Or, bemit_or);
register_emitter(op_ia32_OrMem8Bit, bemit_ormem8bit);
register_emitter(op_ia32_OrMem, bemit_ormem);
register_emitter(op_ia32_Pop, bemit_pop);
register_emitter(op_ia32_PopEbp, bemit_pop);
......@@ -3321,10 +3337,12 @@ static void ia32_register_binary_emitters(void)
register_emitter(op_ia32_Store8Bit, bemit_store);
register_emitter(op_ia32_Store, bemit_store);
register_emitter(op_ia32_Sub, bemit_sub);
register_emitter(op_ia32_SubMem8Bit, bemit_submem8bit);
register_emitter(op_ia32_SubMem, bemit_submem);
register_emitter(op_ia32_Test, bemit_test);
register_emitter(op_ia32_Xor0, bemit_xor0);
register_emitter(op_ia32_Xor, bemit_xor);
register_emitter(op_ia32_XorMem8Bit, bemit_xormem8bit);
register_emitter(op_ia32_XorMem, bemit_xormem);
/* ignore the following nodes */
......
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