[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
This commit is contained in:
Bilyan Borisov 2015-09-21 10:07:44 +00:00 committed by Kyrylo Tkachov
parent 84fe5e5c41
commit 6ad9ac8838
2 changed files with 25 additions and 20 deletions

View File

@ -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

View File

@ -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)