aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTejas Belagod <tejas.belagod@arm.com>2014-04-24 10:08:48 +0100
committerTejas Belagod <belagod@gcc.gnu.org>2014-04-24 10:08:48 +0100
commitbbcc9c00015be1f7c186990f5cd35ea935452912 (patch)
tree0fe4a19d2c0884c185f5ee523fcc008c2564492f
parentd2d11532af9f96937ea48b2a8b3481ffc722a53c (diff)
downloadgcc-bbcc9c00015be1f7c186990f5cd35ea935452912.zip
gcc-bbcc9c00015be1f7c186990f5cd35ea935452912.tar.gz
gcc-bbcc9c00015be1f7c186990f5cd35ea935452912.tar.bz2
[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
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/aarch64/aarch64.c10
2 files changed, 14 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 591179a..9c13da0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 496d1b8..d644f79 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -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);