This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: wide-int, rs6000
- From: Mike Stump <mikestump at comcast dot net>
- To: David Edelsohn <dje dot gcc at gmail dot com>
- Cc: Kenneth Zadeck <zadeck at naturalbridge dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 25 Nov 2013 19:05:38 -0800
- Subject: Re: wide-int, rs6000
- Authentication-results: sourceware.org; auth=none
- References: <42DC4C50-3430-4A2E-914C-FEC7A0DB7DEB at comcast dot net> <CAGWvny=BikM8xtDoRbKqL3sQQt+4-h2ZbL_F0zv+ZJmbAXOs9A at mail dot gmail dot com>
On Nov 25, 2013, at 12:03 PM, David Edelsohn <dje.gcc@gmail.com> wrote:
> 3) altivec_resolve_overloaded_builtin, both hunks should be converted
> the same way, using tree_fits_uhwi_p
>
> - && TREE_CODE (arg2) == INTEGER_CST
> - && TREE_INT_CST_HIGH (arg2) == 0
> - && (TREE_INT_CST_LOW (arg2) == 0 || TREE_INT_CST_LOW (arg2) == 1))
> + && tree_fits_uhwi_p (arg2)
> + && wi::ltu_p (arg2, 2))
Index: gcc/config/rs6000/rs6000-c.c
===================================================================
--- gcc/config/rs6000/rs6000-c.c (revision 205364)
+++ gcc/config/rs6000/rs6000-c.c (working copy)
@@ -4208,7 +4208,7 @@ altivec_resolve_overloaded_builtin (loca
/* If we can use the VSX xxpermdi instruction, use that for extract. */
mode = TYPE_MODE (arg1_type);
if ((mode == V2DFmode || mode == V2DImode) && VECTOR_MEM_VSX_P (mode)
- && TREE_CODE (arg2) == INTEGER_CST
+ && tree_fits_uhwi_p (arg2)
&& wi::ltu_p (arg2, 2))
{
tree call = NULL_TREE;