]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i386.c (ix86_expand_int_movcc): In the general case suppress addition when either...
authorRodney Brown <rbrown64@csc.com.au>
Wed, 17 Jul 2002 18:09:56 +0000 (18:09 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 17 Jul 2002 18:09:56 +0000 (11:09 -0700)
        * config/i386/i386.c (ix86_expand_int_movcc): In the general case
        suppress addition when either ct or cf are zero.

From-SVN: r55540

gcc/ChangeLog
gcc/config/i386/i386.c

index da5ebc2ba2c110091e1e9fb7278323e45bb054bd..9e10f29d9a8b95f5fdcf40a492fd91117bf30643 100644 (file)
@@ -1,3 +1,8 @@
+2002-07-17  Rodney Brown  <rbrown64@csc.com.au>
+
+       * config/i386/i386.c (ix86_expand_int_movcc): In the general case
+       suppress addition when either ct or cf are zero.
+
 2002-06-17  Eric Botcazou <ebotcazou@multimania.com>
             Glen Nakamura <glen@imodulo.com>
 
index 6c2a2b5c77e433781a06d72efcd493d6dffa40e7..68b3d4a95f5abddc854cd9960fb7f3463b132172 100644 (file)
@@ -8866,8 +8866,8 @@ ix86_expand_int_movcc (operands)
                                 ix86_compare_op1, VOIDmode, 0, 1);
 
          nops = 0;
-         /* On x86_64 the lea instruction operates on Pmode, so we need to get arithmetics
-            done in proper mode to match.  */
+         /* On x86_64 the lea instruction operates on Pmode, so we need
+            to get arithmetics done in proper mode to match.  */
          if (diff == 1)
            tmp = out;
          else
@@ -8931,10 +8931,10 @@ ix86_expand_int_movcc (operands)
 
       if (!optimize_size && !TARGET_CMOVE)
        {
-         if (ct == 0)
+         if (cf == 0)
            {
-             ct = cf;
-             cf = 0;
+             cf = ct;
+             ct = 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
@@ -8983,18 +8983,16 @@ ix86_expand_int_movcc (operands)
              out = emit_store_flag (out, code, ix86_compare_op0,
                                     ix86_compare_op1, VOIDmode, 0, 1);
 
-             out = expand_simple_binop (mode, PLUS,
-                                        out, constm1_rtx,
+             out = expand_simple_binop (mode, PLUS, out, constm1_rtx,
                                         out, 1, OPTAB_DIRECT);
            }
 
-         out = expand_simple_binop (mode, AND,
-                                    out,
+         out = expand_simple_binop (mode, AND, 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);