* [PATCH 2/2] xtensa: Make use of std::swap where appropriate
[not found] <76d21669-e23e-45a4-a5cc-dd08ecd71ad5.ref@yahoo.co.jp>
@ 2024-03-26 14:45 ` Takayuki 'January June' Suwa
0 siblings, 0 replies; only message in thread
From: Takayuki 'January June' Suwa @ 2024-03-26 14:45 UTC (permalink / raw)
To: GCC Patches; +Cc: Max Filippov
No functional changes.
gcc/ChangeLog:
* config/xtensa/xtensa.cc
(gen_int_relational, gen_float_relational): Replace tempvar-based
value-swapping codes with std::swap.
* config/xtensa/xtensa.md (movdi_internal, movdf_internal):
Ditto.
---
gcc/config/xtensa/xtensa.cc | 12 ++----------
gcc/config/xtensa/xtensa.md | 10 ++++------
2 files changed, 6 insertions(+), 16 deletions(-)
diff --git a/gcc/config/xtensa/xtensa.cc b/gcc/config/xtensa/xtensa.cc
index df888294556..38c6966cc31 100644
--- a/gcc/config/xtensa/xtensa.cc
+++ b/gcc/config/xtensa/xtensa.cc
@@ -799,11 +799,7 @@ gen_int_relational (enum rtx_code test_code, /* relational test (EQ, etc) */
}
else if (p_info->reverse_regs)
- {
- rtx temp = cmp0;
- cmp0 = cmp1;
- cmp1 = temp;
- }
+ std::swap (cmp0, cmp1);
return gen_rtx_fmt_ee (invert ? reverse_condition (p_info->test_code)
: p_info->test_code,
@@ -847,11 +843,7 @@ gen_float_relational (enum rtx_code test_code, /* relational test (EQ, etc) */
}
if (reverse_regs)
- {
- rtx temp = cmp0;
- cmp0 = cmp1;
- cmp1 = temp;
- }
+ std::swap (cmp0, cmp1);
brtmp = gen_rtx_REG (CCmode, FPCC_REGNUM);
emit_insn (gen_fn (brtmp, cmp0, cmp1));
diff --git a/gcc/config/xtensa/xtensa.md b/gcc/config/xtensa/xtensa.md
index fbe40ec671a..93c3ee78a01 100644
--- a/gcc/config/xtensa/xtensa.md
+++ b/gcc/config/xtensa/xtensa.md
@@ -1253,9 +1253,8 @@
xtensa_split_operand_pair (operands, SImode);
if (reg_overlap_mentioned_p (operands[0], operands[3]))
{
- rtx tmp;
- tmp = operands[0], operands[0] = operands[1], operands[1] = tmp;
- tmp = operands[2], operands[2] = operands[3], operands[3] = tmp;
+ std::swap (operands[0], operands[1]);
+ std::swap (operands[2], operands[3]);
}
})
@@ -1588,9 +1587,8 @@
xtensa_split_operand_pair (operands, SFmode);
if (reg_overlap_mentioned_p (operands[0], operands[3]))
{
- rtx tmp;
- tmp = operands[0], operands[0] = operands[1], operands[1] = tmp;
- tmp = operands[2], operands[2] = operands[3], operands[3] = tmp;
+ std::swap (operands[0], operands[1]);
+ std::swap (operands[2], operands[3]);
}
})
--
2.39.2
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-26 14:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <76d21669-e23e-45a4-a5cc-dd08ecd71ad5.ref@yahoo.co.jp>
2024-03-26 14:45 ` [PATCH 2/2] xtensa: Make use of std::swap where appropriate Takayuki 'January June' Suwa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).