Commit 838a297f authored by Michael Beck's avatar Michael Beck
Browse files

BugFixes:

 - replace the pnc code by its R^-1 one
 - fixed CJmpAM optmization
parent d70460c9
......@@ -591,9 +591,8 @@ insert_copy:
/* to change it, as CMP doesn't support immediate as */
/* left operands. */
if (is_ia32_CondJmp(irn) && (is_ia32_ImmConst(irn) || is_ia32_ImmSymConst(irn)) && op_tp == ia32_AddrModeS) {
long pnc = get_negated_pnc(get_ia32_pncode(irn), get_ia32_res_mode(irn));
set_ia32_op_type(irn, ia32_AddrModeD);
set_ia32_pncode(irn, pnc);
set_ia32_pncode(irn, get_inversed_pnc(get_ia32_pncode(irn)));
}
/* check if there is a sub which need to be transformed */
......
......@@ -371,7 +371,7 @@ static int is_CondJmp_replacement(ir_node *cand, ir_node *irn) {
int same_args = 1;
for (i = 0; i < n; i++) {
if (get_irn_n(cand, i) == get_irn_n(irn, i)) {
if (get_irn_n(cand, i) != get_irn_n(irn, i)) {
same_args = 0;
break;
}
......@@ -397,7 +397,7 @@ static void ia32_optimize_CondJmp(ir_node *irn, ia32_code_gen_t *cg) {
DBG((cg->mod, LEVEL_1, "replacing %+F by ", irn));
DBG_OPT_CJMP(irn);
set_irn_op(irn, op_ia32_CJmp);
set_irn_op(irn, op_ia32_CJmpAM);
DB((cg->mod, LEVEL_1, "%+F\n", irn));
}
......@@ -1298,6 +1298,10 @@ void ia32_optimize_am(ir_node *irn, void *env) {
temp = left;
left = right;
right = temp;
/* this is only needed for Compares, but currently ALL nodes
* have this attribute :-) */
set_ia32_pncode(irn, get_inversed_pnc(get_ia32_pncode(irn)));
}
}
......@@ -1351,6 +1355,10 @@ void ia32_optimize_am(ir_node *irn, void *env) {
temp = left;
left = right;
right = temp;
/* this is only needed for Compares, but currently ALL nodes
* have this attribute :-) */
set_ia32_pncode(irn, get_inversed_pnc(get_ia32_pncode(irn)));
}
}
......@@ -1427,6 +1435,10 @@ void ia32_optimize_am(ir_node *irn, void *env) {
temp = left;
left = right;
right = temp;
/* this is only needed for Compares, but currently ALL nodes
* have this attribute :-) */
set_ia32_pncode(irn, get_inversed_pnc(get_ia32_pncode(irn)));
}
}
......@@ -1466,6 +1478,10 @@ void ia32_optimize_am(ir_node *irn, void *env) {
/* binary AMop */
set_irn_n(irn, 4, get_irn_n(left, 2));
/* this is only needed for Compares, but currently ALL nodes
* have this attribute :-) */
set_ia32_pncode(irn, get_inversed_pnc(get_ia32_pncode(irn)));
/* disconnect from Load */
/* (make second op -> first, set second in to noreg) */
set_irn_n(irn, 2, get_irn_n(irn, 3));
......
......@@ -1466,6 +1466,7 @@ static ir_node *gen_Cond(ia32_transform_env_t *env) {
}
else {
res = new_rd_ia32_CondJmp(dbg, irg, block, noreg, noreg, cmp_a, cmp_b, nomem);
set_ia32_commutative(res);
}
set_ia32_res_mode(res, get_irn_mode(cmp_a));
}
......
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