Fixed setcc transform:
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 6 Feb 2010 00:09:00 +0000 (00:09 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 6 Feb 2010 00:09:00 +0000 (00:09 +0000)
- test for t ==1 AFTER f == 0: this fixes fehler035.c
- disable sbb creation: reloader might change the cmp instruction yet

[r27078]

ir/be/ia32/ia32_transform.c

index b65d697..415100d 100644 (file)
@@ -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: