Commit 9a286b70 authored by Matthias Braun's avatar Matthias Braun
Browse files

fix cmov emitter

[r16036]
parent c143d5e6
......@@ -883,10 +883,8 @@ emit_jcc:
static void emit_ia32_CMov(const ir_node *node)
{
const ia32_attr_t *attr = get_ia32_attr_const(node);
const arch_register_t *out = arch_get_irn_register(arch_env, node);
pn_Cmp pnc = get_ia32_pncode(node);
int flipped = attr->data.cmp_flipped;
const arch_register_t *in_true;
const arch_register_t *in_false;
......@@ -903,7 +901,11 @@ static void emit_ia32_CMov(const ir_node *node)
} else if(out == in_true) {
const arch_register_t *tmp;
flipped = !flipped;
if(pnc & ia32_pn_Cmp_float) {
pnc = get_negated_pnc(pnc, mode_F);
} else {
pnc = get_negated_pnc(pnc, mode_Iu);
}
tmp = in_true;
in_true = in_false;
......@@ -917,14 +919,6 @@ static void emit_ia32_CMov(const ir_node *node)
be_emit_finish_line_gas(node);
}
if(flipped) {
if(pnc & ia32_pn_Cmp_float) {
pnc = get_negated_pnc(pnc, mode_F);
} else {
pnc = get_negated_pnc(pnc, mode_Iu);
}
}
/* TODO: handling of Nans isn't correct yet */
be_emit_cstring("\tcmov");
......
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