diff options
author | Bilyan Borisov <bilyan.borisov@arm.com> | 2015-09-21 10:07:44 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2015-09-21 10:07:44 +0000 |
commit | 6ad9ac88388d049d48364b59a58d1cb72c50c7c6 (patch) | |
tree | 23c940822167094e236f7b01b1056d1e18b411c6 /gcc | |
parent | 84fe5e5c412dccda48c87c775672433d5034b160 (diff) | |
download | gcc-6ad9ac88388d049d48364b59a58d1cb72c50c7c6.zip gcc-6ad9ac88388d049d48364b59a58d1cb72c50c7c6.tar.gz gcc-6ad9ac88388d049d48364b59a58d1cb72c50c7c6.tar.bz2 |
[ARM] Replacing variable swaps that use a temporary variable with a call to std::swap in gcc/config/arm/arm.c
On behalf of <bilyan.borisov@arm.com>
2015-09-21 Bilyan Borisov <bilyan.borisov@arm.com>
* config/arm/arm.c (thumb_output_move_mem_multiple): Replaced
operands[4] operands[5] swap with std::swap, removed tmp variable.
(arm_evpc_neon_vzip): Replaced in0/in1 and
out0/out1 swaps with std::swap, removed x variable.
(arm_evpc_neon_vtrn): Replaced in0/int1 and
out0/out1 swaos with std::swap, removed x variable.
(arm_expand_vec_perm_const_1): Replaced
d->op0/d->op1 swap with std::swap, removed x variable.
(arm_evpc_neon_vuzp): Replaced in0/in1 and
out0/out1 swaps with std::swap, removed x variable.
From-SVN: r227963
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 13 | ||||
-rw-r--r-- | gcc/config/arm/arm.c | 32 |
2 files changed, 25 insertions, 20 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6c79ba8..93df84b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,16 @@ +2015-09-21 Bilyan Borisov <bilyan.borisov@arm.com> + + * config/arm/arm.c (thumb_output_move_mem_multiple): Replaced + operands[4] operands[5] swap with std::swap, removed tmp variable. + (arm_evpc_neon_vzip): Replaced in0/in1 and + out0/out1 swaps with std::swap, removed x variable. + (arm_evpc_neon_vtrn): Replaced in0/int1 and + out0/out1 swaos with std::swap, removed x variable. + (arm_expand_vec_perm_const_1): Replaced + d->op0/d->op1 swap with std::swap, removed x variable. + (arm_evpc_neon_vuzp): Replaced in0/in1 and + out0/out1 swaps with std::swap, removed x variable. + 2015-09-21 Jonathan Yong <10walls@gmail.com> * config/i386/cygwin.h (STARTFILE_SPEC): Explicitly search diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index b023977..02f5dc3 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -25656,17 +25656,12 @@ thumb_load_double_from_address (rtx *operands) const char * thumb_output_move_mem_multiple (int n, rtx *operands) { - rtx tmp; - switch (n) { case 2: if (REGNO (operands[4]) > REGNO (operands[5])) - { - tmp = operands[4]; - operands[4] = operands[5]; - operands[5] = tmp; - } + std::swap (operands[4], operands[5]); + output_asm_insn ("ldmia\t%1!, {%4, %5}", operands); output_asm_insn ("stmia\t%0!, {%4, %5}", operands); break; @@ -28216,7 +28211,7 @@ static bool arm_evpc_neon_vuzp (struct expand_vec_perm_d *d) { unsigned int i, odd, mask, nelt = d->nelt; - rtx out0, out1, in0, in1, x; + rtx out0, out1, in0, in1; rtx (*gen)(rtx, rtx, rtx, rtx); if (GET_MODE_UNIT_SIZE (d->vmode) >= 8) @@ -28260,14 +28255,14 @@ arm_evpc_neon_vuzp (struct expand_vec_perm_d *d) in1 = d->op1; if (BYTES_BIG_ENDIAN) { - x = in0, in0 = in1, in1 = x; + std::swap (in0, in1); odd = !odd; } out0 = d->target; out1 = gen_reg_rtx (d->vmode); if (odd) - x = out0, out0 = out1, out1 = x; + std::swap (out0, out1); emit_insn (gen (out0, in0, in1, out1)); return true; @@ -28279,7 +28274,7 @@ static bool arm_evpc_neon_vzip (struct expand_vec_perm_d *d) { unsigned int i, high, mask, nelt = d->nelt; - rtx out0, out1, in0, in1, x; + rtx out0, out1, in0, in1; rtx (*gen)(rtx, rtx, rtx, rtx); if (GET_MODE_UNIT_SIZE (d->vmode) >= 8) @@ -28327,14 +28322,14 @@ arm_evpc_neon_vzip (struct expand_vec_perm_d *d) in1 = d->op1; if (BYTES_BIG_ENDIAN) { - x = in0, in0 = in1, in1 = x; + std::swap (in0, in1); high = !high; } out0 = d->target; out1 = gen_reg_rtx (d->vmode); if (high) - x = out0, out0 = out1, out1 = x; + std::swap (out0, out1); emit_insn (gen (out0, in0, in1, out1)); return true; @@ -28420,7 +28415,7 @@ static bool arm_evpc_neon_vtrn (struct expand_vec_perm_d *d) { unsigned int i, odd, mask, nelt = d->nelt; - rtx out0, out1, in0, in1, x; + rtx out0, out1, in0, in1; rtx (*gen)(rtx, rtx, rtx, rtx); if (GET_MODE_UNIT_SIZE (d->vmode) >= 8) @@ -28465,14 +28460,14 @@ arm_evpc_neon_vtrn (struct expand_vec_perm_d *d) in1 = d->op1; if (BYTES_BIG_ENDIAN) { - x = in0, in0 = in1, in1 = x; + std::swap (in0, in1); odd = !odd; } out0 = d->target; out1 = gen_reg_rtx (d->vmode); if (odd) - x = out0, out0 = out1, out1 = x; + std::swap (out0, out1); emit_insn (gen (out0, in0, in1, out1)); return true; @@ -28595,14 +28590,11 @@ arm_expand_vec_perm_const_1 (struct expand_vec_perm_d *d) if (d->perm[0] >= d->nelt) { unsigned i, nelt = d->nelt; - rtx x; for (i = 0; i < nelt; ++i) d->perm[i] = (d->perm[i] + nelt) & (2 * nelt - 1); - x = d->op0; - d->op0 = d->op1; - d->op1 = x; + std::swap (d->op0, d->op1); } if (TARGET_NEON) |