From: Christoph Mallon Date: Sat, 8 Nov 2008 06:51:32 +0000 (+0000) Subject: Remove pointless assert, (x & 7) == (int){0,1,2,3,4,5,6,7}[x & 7] is always true. X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=4d7ff7390a3db1ec53ed28076d187df97d6f844e;p=libfirm Remove pointless assert, (x & 7) == (int){0,1,2,3,4,5,6,7}[x & 7] is always true. [r23529] --- diff --git a/ir/be/ia32/ia32_emitter.c b/ir/be/ia32/ia32_emitter.c index 81c58e55d..131f44118 100644 --- a/ir/be/ia32/ia32_emitter.c +++ b/ir/be/ia32/ia32_emitter.c @@ -462,54 +462,42 @@ static void ia32_emit_cfop_target(const ir_node *node) ia32_emit_block_name(block); } -/* - * coding of conditions - */ -struct cmp2conditon_t { - const char *name; - int num; -}; - /* * positive conditions for signed compares */ -static const struct cmp2conditon_t cmp2condition_s[] = { - { NULL, pn_Cmp_False }, /* always false */ - { "e", pn_Cmp_Eq }, /* == */ - { "l", pn_Cmp_Lt }, /* < */ - { "le", pn_Cmp_Le }, /* <= */ - { "g", pn_Cmp_Gt }, /* > */ - { "ge", pn_Cmp_Ge }, /* >= */ - { "ne", pn_Cmp_Lg }, /* != */ - { NULL, pn_Cmp_Leg}, /* always true */ +static const char *const cmp2condition_s[] = { + NULL, /* always false */ + "e", /* == */ + "l", /* < */ + "le", /* <= */ + "g", /* > */ + "ge", /* >= */ + "ne", /* != */ + NULL /* always true */ }; /* * positive conditions for unsigned compares */ -static const struct cmp2conditon_t cmp2condition_u[] = { - { NULL, pn_Cmp_False }, /* always false */ - { "e", pn_Cmp_Eq }, /* == */ - { "b", pn_Cmp_Lt }, /* < */ - { "be", pn_Cmp_Le }, /* <= */ - { "a", pn_Cmp_Gt }, /* > */ - { "ae", pn_Cmp_Ge }, /* >= */ - { "ne", pn_Cmp_Lg }, /* != */ - { NULL, pn_Cmp_Leg }, /* always true */ +static const char *const cmp2condition_u[] = { + NULL, /* always false */ + "e", /* == */ + "b", /* < */ + "be", /* <= */ + "a", /* > */ + "ae", /* >= */ + "ne", /* != */ + NULL /* always true */ }; static void ia32_emit_cmp_suffix(int pnc) { const char *str; - if ((pnc & ia32_pn_Cmp_float) || (pnc & ia32_pn_Cmp_unsigned)) { - pnc = pnc & 7; - assert(cmp2condition_u[pnc].num == pnc); - str = cmp2condition_u[pnc].name; + if (pnc & ia32_pn_Cmp_float || pnc & ia32_pn_Cmp_unsigned) { + str = cmp2condition_u[pnc & 7]; } else { - pnc = pnc & 7; - assert(cmp2condition_s[pnc].num == pnc); - str = cmp2condition_s[pnc].name; + str = cmp2condition_s[pnc & 7]; } be_emit_string(str);