i386.c (ix86_expand_int_movcc): In the case where the comparison directly gives a...
authorRodney Brown <rbrown64@csc.com.au>
Wed, 17 Jul 2002 01:36:36 +0000 (01:36 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 17 Jul 2002 01:36:36 +0000 (18:36 -0700)
        * config/i386/i386.c (ix86_expand_int_movcc): In the case where
        the comparison directly gives a mask suppress addition when cf is
        zero by complementing the mask.

From-SVN: r55505

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

index 3f6418d160389724a1a456df2281610c27e400c4..a851ef292bef57e1ae0886fe94ac2189cbeca420 100644 (file)
@@ -1,3 +1,9 @@
+2002-07-16  Rodney Brown  <rbrown64@csc.com.au>
+
+       * config/i386/i386.c (ix86_expand_int_movcc): In the case where
+       the comparison directly gives a mask suppress addition when cf is
+       zero by complementing the mask.
+
 2002-07-16  Nathanael Nerode  <neroden@gcc.gnu.org>
 
        * Makefile.in: Delete references to enquire.
index 6e19b5cd887ef0c1638210dcb2161a0e3cb9550b..6c2a2b5c77e433781a06d72efcd493d6dffa40e7 100644 (file)
@@ -8666,7 +8666,6 @@ ix86_expand_int_movcc (operands)
       if ((compare_code == LTU || compare_code == GEU)
          && !second_test && !bypass_test)
        {
-
          /* Detect overlap between destination and compare sources.  */
          rtx tmp = out;
 
@@ -8723,7 +8722,7 @@ ix86_expand_int_movcc (operands)
              /*
               * cmpl op0,op1
               * sbbl dest,dest
-              * xorl $-1, dest
+              * notl dest
               * [addl dest, cf]
               *
               * Size 8 - 11.
@@ -8739,11 +8738,20 @@ ix86_expand_int_movcc (operands)
              /*
               * cmpl op0,op1
               * sbbl dest,dest
+              * [notl dest]
               * andl cf - ct, dest
               * [addl dest, ct]
               *
               * Size 8 - 11.
               */
+
+             if (cf == 0)
+               {
+                 cf = ct;
+                 ct = 0;
+                 tmp = expand_simple_unop (mode, NOT, tmp, tmp, 1);
+               }
+
              tmp = expand_simple_binop (mode, AND,
                                         tmp,
                                         gen_int_mode (cf - ct, mode),