[PATCH 4.8 v2, i386]: Make CCZ mode compatible with CCGOC and CCGO modes

Uros Bizjak ubizjak@gmail.com
Tue Feb 7 16:37:00 GMT 2012


On Tue, Feb 7, 2012 at 1:59 PM, Uros Bizjak <ubizjak@gmail.com> wrote:

> Attached patch declares CCZmode compatible with CCGOC, CCGO and CCNO modes.

Actually, CCZ mode is not compatible with CCNO mode, since the later
only declares that overflow flag is not set. CCGOC and CCGO declare
garbage in overflow (and carry in case of CCGOC) flag, so implicitly
declare that CCZ flag is valid. Following this reasoning, CCZ mode
should be compatible with CCGOC and CCGO modes.

2012-02-07  Uros Bizjak  <ubizjak@gmail.com>

       * config/i386/i386.c (ix86_cc_modes_compatible): Declare CCZmode
       compatible with CCGOCmode and CCGCmode.

Attached patch was bootstrapped and regression tested on x86_64-pc-linux-gnu.

Uros.
-------------- next part --------------
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c	(revision 183968)
+++ config/i386/i386.c	(working copy)
@@ -17778,6 +17778,11 @@ ix86_cc_modes_compatible (enum machine_mode m1, en
       || (m1 == CCGOCmode && m2 == CCGCmode))
     return CCGCmode;
 
+  if (m1 == CCZmode && (m2 == CCGCmode || m2 == CCGOCmode))
+    return m2;
+  else if (m2 == CCZmode && (m1 == CCGCmode || m1 == CCGOCmode))
+    return m1;
+
   switch (m1)
     {
     default:


More information about the Gcc-patches mailing list