This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][reload.c] Convert conditional compilation of WORD_REGISTER_OPERATIONS


Hi all,

This converts the preprocessor checks for WORD_REGISTER_OPERATIONS into runtime checks
in reload.c.

Since this one is used to guard part of a large condition, I'd appreciate it if someone
double-checks that the logic is still equivalent.

Bootstrapped and tested on arm, aarch64, x86_64.

Ok for trunk?

Thanks,
Kyrill

2015-12-15  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>

    * reload.c (push_reload): Convert preprocessor checks
    for WORD_REGISTER_OPERATIONS to runtime checks.
diff --git a/gcc/reload.c b/gcc/reload.c
index 1e96dfc99c48e2aeb76ed7a0b5280cbe7c9cf34c..4ceb64312d777d730908cf7d9de0c8fd6c82b9dc 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -1074,14 +1074,12 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
 		      && INTEGRAL_MODE_P (GET_MODE (SUBREG_REG (in)))
 		      && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (in))) != UNKNOWN)
 #endif
-#if WORD_REGISTER_OPERATIONS
-		  || ((GET_MODE_PRECISION (inmode)
-		       < GET_MODE_PRECISION (GET_MODE (SUBREG_REG (in))))
-		      && ((GET_MODE_SIZE (inmode) - 1) / UNITS_PER_WORD ==
-			  ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))) - 1)
-			   / UNITS_PER_WORD)))
-#endif
-		  ))
+		  || (WORD_REGISTER_OPERATIONS
+			&& ((GET_MODE_PRECISION (inmode)
+			     < GET_MODE_PRECISION (GET_MODE (SUBREG_REG (in))))
+			&& ((GET_MODE_SIZE (inmode) - 1) / UNITS_PER_WORD ==
+			     ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (in))) - 1)
+			       / UNITS_PER_WORD))))))
 	  || (REG_P (SUBREG_REG (in))
 	      && REGNO (SUBREG_REG (in)) < FIRST_PSEUDO_REGISTER
 	      /* The case where out is nonzero
@@ -1175,13 +1173,13 @@ push_reload (rtx in, rtx out, rtx *inloc, rtx *outloc,
 	       || MEM_P (SUBREG_REG (out)))
 	      && ((GET_MODE_PRECISION (outmode)
 		   > GET_MODE_PRECISION (GET_MODE (SUBREG_REG (out))))
-#if WORD_REGISTER_OPERATIONS
-		  || ((GET_MODE_PRECISION (outmode)
-		       < GET_MODE_PRECISION (GET_MODE (SUBREG_REG (out))))
-		      && ((GET_MODE_SIZE (outmode) - 1) / UNITS_PER_WORD ==
-			  ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (out))) - 1)
-			   / UNITS_PER_WORD)))
-#endif
+		  || (WORD_REGISTER_OPERATIONS
+		      && ((GET_MODE_PRECISION (outmode)
+			    < GET_MODE_PRECISION (GET_MODE (SUBREG_REG (out))))
+			  && ((GET_MODE_SIZE (outmode) - 1) / UNITS_PER_WORD
+			       == ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (out)))
+				      - 1)
+				    / UNITS_PER_WORD))))
 		  ))
 	  || (REG_P (SUBREG_REG (out))
 	      && REGNO (SUBREG_REG (out)) < FIRST_PSEUDO_REGISTER

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]