On Nov 25, 2013, at 12:03 PM, David Edelsohn <dje....@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;