diff options
author | Takayuki 'January June' Suwa <jjsuwa_sys3175@yahoo.co.jp> | 2024-07-14 20:03:13 +0900 |
---|---|---|
committer | Max Filippov <jcmvbkbc@gmail.com> | 2024-07-29 17:06:33 -0700 |
commit | 56c4979dd8be40681f2724861fc41ae6135e1e78 (patch) | |
tree | 716c4e60eba297e1e7695ce8c0e537802b49ca9e /gcc | |
parent | 5ab9a351247a551c47b0ab9d8e8b907223e7faf6 (diff) | |
download | gcc-56c4979dd8be40681f2724861fc41ae6135e1e78.zip gcc-56c4979dd8be40681f2724861fc41ae6135e1e78.tar.gz gcc-56c4979dd8be40681f2724861fc41ae6135e1e78.tar.bz2 |
xtensa: Make use of std::swap where appropriate
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.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/config/xtensa/xtensa.cc | 12 | ||||
-rw-r--r-- | 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 10d964b..772150c 100644 --- a/gcc/config/xtensa/xtensa.cc +++ b/gcc/config/xtensa/xtensa.cc @@ -794,11 +794,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, @@ -842,11 +838,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 8709ef6..0fcbb0b 100644 --- a/gcc/config/xtensa/xtensa.md +++ b/gcc/config/xtensa/xtensa.md @@ -1215,9 +1215,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]); } }) @@ -1562,9 +1561,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]); } }) |