One-line tidy of bit-twiddle expression in aarch64.c
authoralalaw01 <alalaw01@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 May 2014 15:11:04 +0000 (15:11 +0000)
committeralalaw01 <alalaw01@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 2 May 2014 15:11:04 +0000 (15:11 +0000)
* config/aarch64/aarch64.c (aarch64_expand_vec_perm_1): Tidy bit-flip
expression.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210005 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/aarch64/aarch64.c

index 817fb26..69342eb 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-02  Alan Lawrence  <alan.lawrence@arm.com>
+
+       * config/aarch64/aarch64.c (aarch64_expand_vec_perm_1): Tidy bit-flip
+       expression.
+
 2014-05-02  Marek Polacek  <polacek@redhat.com>
 
        * doc/invoke.texi: Describe -fsanitize=float-divide-by-zero.
index 94e05bb..8655f04 100644 (file)
@@ -8180,8 +8180,9 @@ aarch64_expand_vec_perm_const_1 (struct expand_vec_perm_d *d)
       unsigned i, nelt = d->nelt;
       rtx x;
 
+      gcc_assert (nelt == (nelt & -nelt));
       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;