From: Michael Beck Date: Sat, 6 Feb 2010 00:09:00 +0000 (+0000) Subject: Fixed setcc transform: X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=cdae0a0782c05d3e64a3bf2c77ed38432342de17;p=libfirm Fixed setcc transform: - test for t ==1 AFTER f == 0: this fixes fehler035.c - disable sbb creation: reloader might change the cmp instruction yet [r27078] --- diff --git a/ir/be/ia32/ia32_transform.c b/ir/be/ia32/ia32_transform.c index b65d69715..415100dc6 100644 --- a/ir/be/ia32/ia32_transform.c +++ b/ir/be/ia32/ia32_transform.c @@ -3187,12 +3187,6 @@ static void find_const_transform(pn_Cmp pnc, tarval *t, tarval *f, setcc_transfo } res->pnc = pnc; - if (tarval_is_one(t)) { - res->steps[step].transform = SETCC_TR_SET; - res->num_steps = ++step; - return; - } - if (! tarval_is_null(f)) { tarval *t_sub = tarval_sub(t, f, NULL); @@ -3210,67 +3204,22 @@ static void find_const_transform(pn_Cmp pnc, tarval *t, tarval *f, setcc_transfo assert(tarval_is_null(f)); } + if (tarval_is_one(t)) { + res->steps[step].transform = SETCC_TR_SET; + res->num_steps = ++step; + return; + } + if (tarval_is_minus_one(t)) { - if (pnc == (pn_Cmp_Lt | ia32_pn_Cmp_unsigned)) { - res->steps[step].transform = SETCC_TR_SBB; - res->num_steps = ++step; - } else { - res->steps[step].transform = SETCC_TR_NEG; - ++step; - res->steps[step].transform = SETCC_TR_SET; - res->num_steps = ++step; - } + res->steps[step].transform = SETCC_TR_NEG; + ++step; + res->steps[step].transform = SETCC_TR_SET; + res->num_steps = ++step; return; } if (tarval_is_long(t)) { long v = get_tarval_long(t); - if (pnc & ia32_pn_Cmp_unsigned) { - if (pnc == (pn_Cmp_Lt | ia32_pn_Cmp_unsigned)) { - res->steps[step].transform = SETCC_TR_AND; - res->steps[step].val = v; - ++step; - - res->steps[step].transform = SETCC_TR_SBB; - res->num_steps = ++step; - return; - } else if (pnc == (pn_Cmp_Ge | ia32_pn_Cmp_unsigned)) { - res->steps[step].transform = SETCC_TR_AND; - res->steps[step].val = v; - ++step; - - res->steps[step].transform = SETCC_TR_NOT; - ++step; - - res->steps[step].transform = SETCC_TR_SBB; - res->num_steps = ++step; - return; - } else if (can_permutate && pnc == (pn_Cmp_Gt | ia32_pn_Cmp_unsigned)) { - res->permutate_cmp_ins ^= 1; - - res->steps[step].transform = SETCC_TR_NOT; - ++step; - - res->steps[step].transform = SETCC_TR_AND; - res->steps[step].val = v; - ++step; - - res->steps[step].transform = SETCC_TR_SBB; - res->num_steps = ++step; - return; - } else if (can_permutate && pnc == (pn_Cmp_Le | ia32_pn_Cmp_unsigned)) { - res->permutate_cmp_ins ^= 1; - - res->steps[step].transform = SETCC_TR_AND; - res->steps[step].val = v; - ++step; - - res->steps[step].transform = SETCC_TR_SBB; - res->num_steps = ++step; - return; - } - } - res->steps[step].val = 0; switch (v) { case 9: