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]

Re: [wide-int] Tweak an rs6000 test


looks fine to me.

kenny

On 11/20/2013 09:00 AM, Richard Sandiford wrote:
This test changes from TREE_INT_CST_LOW to TREE_INT_CST_ELT.  I was going
to change it back as part of the previous patch, but using wi:: seemed
more robust.

Only compile-tested so far because of problems with gcc110.  OK for wide-int?

Richard


Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	2013-11-20 11:26:05.996351099 +0000
+++ gcc/config/rs6000/rs6000.c	2013-11-20 11:43:37.896818266 +0000
@@ -12131,16 +12131,14 @@ rs6000_expand_ternop_builtin (enum insn_
        /* Check whether the 2nd and 3rd arguments are integer constants and in
  	 range and prepare arguments.  */
        STRIP_NOPS (arg1);
-      if (TREE_CODE (arg1) != INTEGER_CST
-	  || !IN_RANGE (TREE_INT_CST_ELT (arg1, 0), 0, 1))
+      if (TREE_CODE (arg1) != INTEGER_CST || wi::geu_p (arg1, 2))
  	{
  	  error ("argument 2 must be 0 or 1");
  	  return const0_rtx;
  	}
STRIP_NOPS (arg2);
-      if (TREE_CODE (arg2) != INTEGER_CST
-	  || !IN_RANGE (TREE_INT_CST_ELT (arg2, 0), 0, 15))
+      if (TREE_CODE (arg2) != INTEGER_CST || wi::geu_p (arg1, 16))
  	{
  	  error ("argument 3 must be in the range 0..15");
  	  return const0_rtx;



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