[AArch64] Reverse TBL indices for big-endian.

2014-04-24  Tejas Belagod  <tejas.belagod@arm.com>

       * config/aarch64/aarch64.c (aarch64_evpc_tbl): Reverse order of elements
       for big-endian.

From-SVN: r209742
This commit is contained in:
Tejas Belagod 2014-04-24 10:08:48 +01:00 committed by Tejas Belagod
parent d2d11532af
commit bbcc9c0001
2 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2014-04-24 Tejas Belagod <tejas.belagod@arm.com>
* config/aarch64/aarch64.c (aarch64_evpc_tbl): Reverse order of elements
for big-endian.
2014-04-24 Richard Biener <rguenther@suse.de>
* expr.c (expand_expr_real_1): Avoid gimple_assign_rhs_to_tree

View File

@ -8158,7 +8158,15 @@ aarch64_evpc_tbl (struct expand_vec_perm_d *d)
return false;
for (i = 0; i < nelt; ++i)
rperm[i] = GEN_INT (d->perm[i]);
{
int nunits = GET_MODE_NUNITS (vmode);
/* If big-endian and two vectors we end up with a weird mixed-endian
mode on NEON. Reverse the index within each word but not the word
itself. */
rperm[i] = GEN_INT (BYTES_BIG_ENDIAN ? d->perm[i] ^ (nunits - 1)
: d->perm[i]);
}
sel = gen_rtx_CONST_VECTOR (vmode, gen_rtvec_v (nelt, rperm));
sel = force_reg (vmode, sel);