This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: config/i386/i386.c(ix86_expand_int_movcc): Don't add when ct == 0: Withdrawn


I withdraw this patch. A better varient that reverses the condition if cf
== 0 is
currently bootstrapping.

The original patch will avoid an add instruction in the following case :-
((condition) ? -9999 : 0)
The new patch also finds it in the next case.
((condition) ? 9999 : 0)



2002-0705  Rodney Brown  <rbrown64@csc.com.au>

      * config/i386/i386.c (ix86_expand_int_movcc): In the general case
      suppress addition when ct is zero.

--- config/i386/i386.c.bu     Sun Jun 23 20:00:09 2002
+++ config/i386/i386.c  Thu Jul  4 20:59:38 2002
@@ -8912,24 +8912,6 @@ ix86_expand_int_movcc (operands)

       if (!optimize_size && !TARGET_CMOVE)
      {
-       if (ct == 0)
-         {
-           ct = cf;
-           cf = 0;
-           if (FLOAT_MODE_P (GET_MODE (ix86_compare_op0)))
-           /* We may be reversing unordered compare to normal compare,
-              that is not valid in general (we may convert non-trapping
-              condition to trapping one), however on i386 we currently
-              emit all comparisons unordered.  */
-           code = reverse_condition_maybe_unordered (code);
-           else
-           {
-             code = reverse_condition (code);
-             if (compare_code != NIL)
-               compare_code = reverse_condition (compare_code);
-           }
-         }
-
        if (compare_code != NIL)
          {
            /* notl op1 (if needed)
@@ -8973,9 +8955,10 @@ ix86_expand_int_movcc (operands)
                             out,
                             gen_int_mode (cf - ct, mode),
                             out, 1, OPTAB_DIRECT);
-       out = expand_simple_binop (mode, PLUS,
-                            out, GEN_INT (ct),
-                            out, 1, OPTAB_DIRECT);
+       if (ct)
+         out = expand_simple_binop (mode, PLUS,
+                              out, GEN_INT (ct),
+                              out, 1, OPTAB_DIRECT);
        if (out != operands[0])
          emit_move_insn (operands[0], out);





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]