-#ifdef DEBUG_libfirm
- ir_fprintf(stderr, "Note: need perm to resolve should_be_same constraint at %+F (this is unsafe and should not happen in theory...)\n", node);
-#endif
- /* the out reg is used as node input: we need to permutate our input
- * and the other (this is allowed, since the other node can't be live
- * after! the operation as we will override the register. */
- in[0] = in_node;
- in[1] = uses_out_reg;
- perm = be_new_Perm(class, irg, block, 2, in);
-
- perm_proj0 = new_r_Proj(irg, block, perm, get_irn_mode(in[0]), 0);
- perm_proj1 = new_r_Proj(irg, block, perm, get_irn_mode(in[1]), 1);
-
- arch_set_irn_register(arch_env, perm_proj0, out_reg);
- arch_set_irn_register(arch_env, perm_proj1, in_reg);
-
- sched_add_before(node, perm);
-
- DBG((dbg, LEVEL_1, "created perm %+F for should be same argument "
- "at input %d of %+F (need permutate with %+F)\n", perm, same_pos,
- node, uses_out_reg));
-
- /* use the perm results */
- for(i2 = 0; i2 < arity; ++i2) {
- ir_node *in = get_irn_n(node, i2);
-
- if(in == in_node) {
- set_irn_n(node, i2, perm_proj0);
- } else if(in == uses_out_reg) {
- set_irn_n(node, i2, perm_proj1);
- }
- }
- }
-
- /* check xCmp: try to avoid unordered cmp */
- if ((is_ia32_xCmp(node) || is_ia32_xCmpCMov(node) || is_ia32_xCmpSet(node)) &&
- op_tp == ia32_Normal)
- {
- long pnc = get_ia32_pncode(node);
-
- if (pnc & pn_Cmp_Uo) {
- ir_node *tmp;
- int idx1 = 2, idx2 = 3;
-
- if (is_ia32_xCmpCMov(node)) {
- idx1 = 0;
- idx2 = 1;
- }
-
- /** Matze: TODO this looks wrong, I assume we should exchange
- * the proj numbers and not the inputs... */
-
- tmp = get_irn_n(node, idx1);
- set_irn_n(node, idx1, get_irn_n(node, idx2));
- set_irn_n(node, idx2, tmp);
-
- set_ia32_pncode(node, get_negated_pnc(pnc, mode_E));
- }