From: Matthias Braun Date: Tue, 2 Oct 2007 15:04:49 +0000 (+0000) Subject: fix cmov emitter X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=9a286b70664f51a9e4ff512464799ee4714c01e0;p=libfirm fix cmov emitter [r16036] --- diff --git a/ir/be/ia32/ia32_emitter.c b/ir/be/ia32/ia32_emitter.c index 98dfdfdff..04eed6db7 100644 --- a/ir/be/ia32/ia32_emitter.c +++ b/ir/be/ia32/ia32_emitter.c @@ -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");