Committed to trunk as r233252
On 9 February 2016 at 17:07, Charles Baylis <charles.bay...@linaro.org> wrote: > On 8 February 2016 at 11:42, Kyrill Tkachov <kyrylo.tkac...@foss.arm.com> > wrote: > >> On 03/02/16 18:59, charles.bay...@linaro.org wrote: >>> --- a/gcc/config/arm/arm.c >>> +++ b/gcc/config/arm/arm.c >>> @@ -28318,15 +28318,21 @@ arm_evpc_neon_vzip (struct expand_vec_perm_d *d) >>> unsigned int i, high, mask, nelt = d->nelt; >>> rtx out0, out1, in0, in1; >>> rtx (*gen)(rtx, rtx, rtx, rtx); >>> + int first_elem; >>> + bool is_swapped; >>> if (GET_MODE_UNIT_SIZE (d->vmode) >= 8) >>> return false; >>> + is_swapped = BYTES_BIG_ENDIAN ? true : false; >> >> >> This is just "is_swapped = BYTES_BIG_ENDIAN;" > > Done. > >>> + >>> /* Note that these are little-endian tests. Adjust for big-endian >>> later. */ >> >> >> I think you can remove this comment now, like in patch 1/2 > > Done. > >>> + first_elem = d->perm[neon_endian_lane_map (d->vmode, 0) ^ is_swapped]; >>> + >>> high = nelt / 2; >>> - if (d->perm[0] == high) >>> + if (first_elem == neon_endian_lane_map (d->vmode, high)) >>> ; >>> - else if (d->perm[0] == 0) >>> + else if (first_elem == neon_endian_lane_map (d->vmode, 0)) >>> high = 0; >>> else >>> return false; >>> @@ -28334,11 +28340,16 @@ arm_evpc_neon_vzip (struct expand_vec_perm_d *d) >>> for (i = 0; i < nelt / 2; i++) >>> { >>> - unsigned elt = (i + high) & mask; >>> - if (d->perm[i * 2] != elt) >>> + unsigned elt = >>> + neon_pair_endian_lane_map (d->vmode, i + high) & mask; >>> + if (d->perm[neon_pair_endian_lane_map (d->vmode, 2 * i + >>> is_swapped)] >>> + != elt) >>> return false; >>> - elt = (elt + nelt) & mask; >>> - if (d->perm[i * 2 + 1] != elt) >>> + elt = >>> + neon_pair_endian_lane_map (d->vmode, i + nelt + high) >>> + & mask; >> >> >> The "& mask" can go on the previous line. > > Done > >>> + if (d->perm[neon_pair_endian_lane_map (d->vmode, 2 * i + >>> !is_swapped)] >>> + != elt) >>> return false; >>> } >>> @@ -28362,10 +28373,9 @@ arm_evpc_neon_vzip (struct expand_vec_perm_d >>> *d) >>> in0 = d->op0; >>> in1 = d->op1; >>> - if (BYTES_BIG_ENDIAN) >>> + if (is_swapped) >>> { >>> std::swap (in0, in1); >>> - high = !high; >>> } >> >> >> remove the braces around the std::swap. > > Done. > >> Ok with these changes. >> I've tried out both patch and they do fix execution failures on big-endian >> and don't break any NEON intrinsics tests that I threw at them. > > Attached for completeness, will commit once the VUZP patch is OKd.