Commit 2c1f3ab7 authored by Christian Würdig's avatar Christian Würdig
Browse files

fixed Mulh/MulS emitter (support AM source)

parent 88e5b00e
......@@ -545,6 +545,14 @@ const char *ia32_emit_unop(const ir_node *n, ia32_emit_env_t *env) {
case ia32_AddrModeD:
snprintf(buf, SNPRINTF_BUF_LEN, "%s", ia32_emit_am(n, env));
case ia32_AddrModeS:
Mulh is emitted via emit_unop
imul [MEM] means EDX:EAX <- EAX * [MEM]
assert(is_ia32_Mulh(n) || is_ia32_MulS(n) && "Only MulS and Mulh can have AM source as unop");
lc_esnprintf(ia32_get_arg_env(), buf, SNPRINTF_BUF_LEN, "%s", ia32_emit_am(n, env));
assert(0 && "unsupported op type");
......@@ -1223,7 +1231,7 @@ static void emit_ia32_SwitchJmp(const ir_node *irn, ia32_emit_env_t *emit_env) {
/* fill the table structure */
tbl.label = xmalloc(SNPRINTF_BUF_LEN);
tbl.label = get_unique_label(tbl.label, SNPRINTF_BUF_LEN, "JMPTBL_");
tbl.label = get_unique_label(tbl.label, SNPRINTF_BUF_LEN, ".TBL_");
tbl.defProj = NULL;
tbl.num_branches = get_irn_n_edges(irn);
tbl.branches = xcalloc(tbl.num_branches, sizeof(tbl.branches[0]));
Markdown is supported
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