diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2015-02-04 13:52:55 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2015-02-04 13:52:55 +0000 |
commit | cb5c6c29bd43d21f7ab86d53605bc728c5fb5374 (patch) | |
tree | b11f662cac955c9186605100a9cb74987098835c | |
parent | bd95e65526b16e3b1441f3a9e60a523b810e3e8a (diff) | |
download | gcc-cb5c6c29bd43d21f7ab86d53605bc728c5fb5374.zip gcc-cb5c6c29bd43d21f7ab86d53605bc728c5fb5374.tar.gz gcc-cb5c6c29bd43d21f7ab86d53605bc728c5fb5374.tar.bz2 |
[AArch64] Use std::swap instead of manually swapping
* config/aarch64/aarch64.c (aarch64_evpc_ext): Use std::swap instead
of manual swapping implementation.
(aarch64_expand_vec_perm_const_1): Likewise.
From-SVN: r220402
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 9 |
2 files changed, 8 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 116e20f..165f521 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-04 Kyrylo Tkachov <kyrylo.tkachov@arm.com> + + * config/aarch64/aarch64.c (aarch64_evpc_ext): Use std::swap instead + of manual swapping implementation. + (aarch64_expand_vec_perm_const_1): Likewise. + 2015-02-04 James Greenhalgh <james.greenhalgh@arm.com> * config/aarch64/aarch64.c (NAMED_PARAM): Delete it. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index f082e05..c8e22d5 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -9832,9 +9832,7 @@ aarch64_evpc_ext (struct expand_vec_perm_d *d) /* After setup, we want the high elements of the first vector (stored at the LSB end of the register), and the low elements of the second vector (stored at the MSB end of the register). So swap. */ - rtx temp = d->op0; - d->op0 = d->op1; - d->op1 = temp; + std::swap (d->op0, d->op1); /* location != 0 (above), so safe to assume (nelt - location) < nelt. */ location = nelt - location; } @@ -10005,15 +10003,12 @@ aarch64_expand_vec_perm_const_1 (struct expand_vec_perm_d *d) if (d->perm[0] >= d->nelt) { unsigned i, nelt = d->nelt; - rtx x; gcc_assert (nelt == (nelt & -nelt)); for (i = 0; i < nelt; ++i) d->perm[i] ^= nelt; /* Keep the same index, but in the other vector. */ - x = d->op0; - d->op0 = d->op1; - d->op1 = x; + std::swap (d->op0, d->op1); } if (TARGET_SIMD) |