This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH AARCH64] One-line tidy of bit-twiddle expression in aarch64.c
- From: Alan Lawrence <alan dot lawrence at arm dot com>
- To: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 23 Apr 2014 16:20:47 +0100
- Subject: [PATCH AARCH64] One-line tidy of bit-twiddle expression in aarch64.c
- Authentication-results: sourceware.org; auth=none
This patch is a small tidy of a more-complicated expression that just flips a
single bit and can thus be a simple XOR.
No regressions on aarch64-none-elf or aarch64_be-none-elf. (I've verified code
is indeed exercised by dg-torture.exp vshuf-v*.c).
Also ok after applying TBL and testsuite patches in
http://gcc.gnu.org/ml/gcc-patches/2014-04/msg01309.html and
http://gcc.gnu.org/ml/gcc-patches/2014-04/msg00579.html.
gcc/ChangeLog:
2014-04-23 Alan Lawrence <alan.lawrence@arm.com>
* config/aarch64/aarch64.c (aarch64_expand_vec_perm_1): tidy bit-flip expression.
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index a3147ee..b879754 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -8124,7 +8124,7 @@ aarch64_expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
rtx x;
for (i = 0; i < nelt; ++i)
- d->perm[i] = (d->perm[i] + nelt) & (2 * nelt - 1);
+ d->perm[i] ^= nelt; /* Keep the same index, but in the other vector. */
x = d->op0;
d->op0 = d->op1;