Hello!

This patch generalizes register class check, no other functional changes.

2013-08-01  Uros Bizjak  <ubiz...@gmail.com>

    * config/i386/i386.h (MAYBE_NON_Q_CLASS_P): New.
    * config/i386/i386.c (ix86_secondary_reload): Use INTEGER_CLASS_P and
    MAYBE_NON_Q_CLASS_P where appropriate.

Tested on x86_64-pc-linux-gnu {,-m32} and committed to mainline SVN.

Uros.
Index: config/i386/i386.c
===================================================================
--- config/i386/i386.c  (revision 201413)
+++ config/i386/i386.c  (working copy)
@@ -33822,7 +33822,7 @@
   if (TARGET_64BIT
       && MEM_P (x)
       && GET_MODE_SIZE (mode) > UNITS_PER_WORD
-      && rclass == GENERAL_REGS
+      && INTEGER_CLASS_P (rclass)
       && !offsettable_memref_p (x))
     {
       sri->icode = (in_p
@@ -33838,12 +33838,8 @@
      intermediate register on 32bit targets.  */
   if (!TARGET_64BIT
       && !in_p && mode == QImode
-      && (rclass == GENERAL_REGS
-         || rclass == LEGACY_REGS
-         || rclass == NON_Q_REGS
-         || rclass == SIREG
-         || rclass == DIREG
-         || rclass == INDEX_REGS))
+      && INTEGER_CLASS_P (rclass)
+      && MAYBE_NON_Q_CLASS_P (rclass))
     {
       int regno;
 
Index: config/i386/i386.h
===================================================================
--- config/i386/i386.h  (revision 201413)
+++ config/i386/i386.h  (working copy)
@@ -1288,13 +1288,16 @@
 #define MAYBE_FLOAT_CLASS_P(CLASS) \
   reg_classes_intersect_p ((CLASS), FLOAT_REGS)
 #define MAYBE_SSE_CLASS_P(CLASS) \
-  reg_classes_intersect_p (SSE_REGS, (CLASS))
+  reg_classes_intersect_p ((CLASS), SSE_REGS)
 #define MAYBE_MMX_CLASS_P(CLASS) \
-  reg_classes_intersect_p (MMX_REGS, (CLASS))
+  reg_classes_intersect_p ((CLASS), MMX_REGS)
 
 #define Q_CLASS_P(CLASS) \
   reg_class_subset_p ((CLASS), Q_REGS)
 
+#define MAYBE_NON_Q_CLASS_P(CLASS) \
+  reg_classes_intersect_p ((CLASS), NON_Q_REGS)
+
 /* Give names of register classes as strings for dump file.  */
 
 #define REG_CLASS_NAMES \

Reply via email to