From cb5c6c29bd43d21f7ab86d53605bc728c5fb5374 Mon Sep 17 00:00:00 2001 From: Kyrylo Tkachov Date: Wed, 4 Feb 2015 13:52:55 +0000 Subject: [PATCH] [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 --- gcc/ChangeLog | 6 ++++++ gcc/config/aarch64/aarch64.c | 9 ++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 116e20f5e5f..165f521f806 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-04 Kyrylo Tkachov + + * 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 * config/aarch64/aarch64.c (NAMED_PARAM): Delete it. diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index f082e05bee9..c8e22d5e2c6 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) -- 2.30.2