[PATCH, i386]: Use GENERAL_REGNO_P some more

Uros Bizjak ubizjak@gmail.com
Thu Dec 8 19:17:00 GMT 2016


No functional changes.

2016-12-08  Uros Bizjak  <ubizjak@gmail.com>

    * gcc.target/i386/i386.h (HARD_REGNO_NREGS): Use GENERAL_REGNO_P.
    (HARD_REGNO_NREGS_HAS_PADDING): Ditto.  Simplify macro.

Bootstrapped and regression tested on x86_64-linux-gnu {,-m32}.

Committed to mainline SVN.

Uros.
-------------- next part --------------
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 83ffd4e..8bc31f9 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -1080,22 +1080,19 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
    applied to them.  */
 
 #define HARD_REGNO_NREGS(REGNO, MODE)					\
-  (STACK_REGNO_P (REGNO) || SSE_REGNO_P (REGNO) || MMX_REGNO_P (REGNO)	\
-   || MASK_REGNO_P (REGNO) || BND_REGNO_P (REGNO)			\
-   ? (COMPLEX_MODE_P (MODE) ? 2 :					\
-      (((MODE == V64SFmode) || (MODE == V64SImode)) ? 4 : 1))		\
-   : ((MODE) == XFmode							\
+  (GENERAL_REGNO_P (REGNO)						\
+   ? ((MODE) == XFmode							\
       ? (TARGET_64BIT ? 2 : 3)						\
       : ((MODE) == XCmode						\
 	 ? (TARGET_64BIT ? 4 : 6)					\
-	 : CEIL (GET_MODE_SIZE (MODE), UNITS_PER_WORD))))
+	 : CEIL (GET_MODE_SIZE (MODE), UNITS_PER_WORD)))		\
+   : (COMPLEX_MODE_P (MODE) ? 2 :					\
+      (((MODE == V64SFmode) || (MODE == V64SImode)) ? 4 : 1)))
 
 #define HARD_REGNO_NREGS_HAS_PADDING(REGNO, MODE)			\
-  ((TARGET_128BIT_LONG_DOUBLE && !TARGET_64BIT)				\
-   ? (STACK_REGNO_P (REGNO) || SSE_REGNO_P (REGNO) || MMX_REGNO_P (REGNO) \
-      ? 0								\
-      : ((MODE) == XFmode || (MODE) == XCmode))				\
-   : 0)
+  (TARGET_128BIT_LONG_DOUBLE && !TARGET_64BIT				\
+   && GENERAL_REGNO_P (REGNO)						\
+   && ((MODE) == XFmode || (MODE) == XCmode))
 
 #define HARD_REGNO_NREGS_WITH_PADDING(REGNO, MODE) ((MODE) == XFmode ? 4 : 8)
 


More information about the Gcc-patches mailing list