Patchwork [i386] : Use INTEGER_CLASS_P and MAYBE_NON_Q_REGS_P in ix86_secondary_reload

login
register
mail settings
Submitter Uros Bizjak
Date Aug. 1, 2013, 7:51 p.m.
Message ID <CAFULd4aQMBRBd5L6M3JyB-xMbre=CSTBmTX-4L4L1Sq-RcvMoA@mail.gmail.com>
Download mbox | patch
Permalink /patch/264107/
State New
Headers show

Comments

Uros Bizjak - Aug. 1, 2013, 7:51 p.m.
Hello!

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

2013-08-01  Uros Bizjak  <ubizjak@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.

Patch

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 \