aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUros Bizjak <ubizjak@gmail.com>2014-11-16 12:50:29 +0100
committerUros Bizjak <uros@gcc.gnu.org>2014-11-16 12:50:29 +0100
commit6f23a2d08903c793134a3dedf18a34d36ce6c78d (patch)
treef59c9fee672cd745722441e08db0d909086949fd
parent24b5038632010c92013aa66078c207a28fb09f51 (diff)
downloadgcc-6f23a2d08903c793134a3dedf18a34d36ce6c78d.zip
gcc-6f23a2d08903c793134a3dedf18a34d36ce6c78d.tar.gz
gcc-6f23a2d08903c793134a3dedf18a34d36ce6c78d.tar.bz2
sh.c: Do not include algorithm.
* config/sh/sh.c: Do not include algorithm. (sh_emit_scc_to_t): Replace open-coded swap with std::swap to swap values. (sh_emit_compare_and_branch): Ditto. (sh_emit_compare_and_set): Ditto. * config/sh/sh.md (replacement peephole2): Ditto. (cstore4_media): Ditto. (*fmasf4): Ditto. From-SVN: r217626
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/sh/sh.c14
-rw-r--r--gcc/config/sh/sh.md19
3 files changed, 19 insertions, 25 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 758c3ad..747264c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2014-11-16 Uros Bizjak <ubizjak@gmail.com>
+
+ * config/sh/sh.c: Do not include algorithm.
+ (sh_emit_scc_to_t): Replace open-coded swap with std::swap
+ to swap values.
+ (sh_emit_compare_and_branch): Ditto.
+ (sh_emit_compare_and_set): Ditto.
+ * config/sh/sh.md (replacement peephole2): Ditto.
+ (cstore4_media): Ditto.
+ (*fmasf4): Ditto.
+
2014-11-15 Vladimir Makarov <vmakarov@redhat.com>
* lra-remat.c (cand_transf_func): Process regno for
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index be944da..5bac2af 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see
#include <sstream>
#include <vector>
-#include <algorithm>
#include "config.h"
#include "system.h"
@@ -2351,11 +2350,7 @@ sh_emit_scc_to_t (enum rtx_code code, rtx op0, rtx op1)
break;
}
if (code != oldcode)
- {
- rtx tmp = op0;
- op0 = op1;
- op1 = tmp;
- }
+ std::swap (op0, op1);
mode = GET_MODE (op0);
if (mode == VOIDmode)
@@ -2436,7 +2431,7 @@ sh_emit_compare_and_branch (rtx *operands, machine_mode mode)
enum rtx_code branch_code;
rtx op0 = operands[1];
rtx op1 = operands[2];
- rtx insn, tem;
+ rtx insn;
bool need_ccmpeq = false;
if (TARGET_SH2E && GET_MODE_CLASS (mode) == MODE_FLOAT)
@@ -2461,7 +2456,7 @@ sh_emit_compare_and_branch (rtx *operands, machine_mode mode)
|| (code == LE && TARGET_IEEE && TARGET_SH2E)
|| (code == GE && !(TARGET_IEEE && TARGET_SH2E)))
{
- tem = op0, op0 = op1, op1 = tem;
+ std::swap (op0, op1);
code = swap_condition (code);
}
@@ -2520,7 +2515,6 @@ sh_emit_compare_and_set (rtx *operands, machine_mode mode)
rtx op1 = operands[3];
rtx_code_label *lab = NULL;
bool invert = false;
- rtx tem;
op0 = force_reg (mode, op0);
if ((code != EQ && code != NE
@@ -2534,8 +2528,8 @@ sh_emit_compare_and_set (rtx *operands, machine_mode mode)
{
if (code == LT || code == LE)
{
+ std::swap (op0, op1);
code = swap_condition (code);
- tem = op0, op0 = op1, op1 = tem;
}
if (code == GE)
{
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 8246143..7b90295 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -1618,14 +1618,9 @@
extract_insn (insn2);
if (! constrain_operands (1, get_preferred_alternatives (insn2, bb)))
{
- rtx tmp;
failure:
- tmp = replacements[0];
- replacements[0] = replacements[1];
- replacements[1] = tmp;
- tmp = replacements[2];
- replacements[2] = replacements[3];
- replacements[3] = tmp;
+ std::swap (replacements[0], replacements[1]);
+ std::swap (replacements[2], replacements[3]);
replace_n_hard_rtx (SET_DEST (set1), replacements, 2, 1);
replace_n_hard_rtx (SET_DEST (set2), replacements, 2, 1);
replace_n_hard_rtx (SET_SRC (set2), replacements, 2, 1);
@@ -11348,9 +11343,7 @@ label:
if (swap)
{
- rtx tem = operands[2];
- operands[2] = operands[3];
- operands[3] = tem;
+ std::swap (operands[2], operands[3]);
code = swap_condition (code);
}
@@ -12538,11 +12531,7 @@ label:
/* Change 'b * a + a' into 'a * b + a'.
This is better for register allocation. */
if (REGNO (operands[2]) == REGNO (operands[3]))
- {
- rtx tmp = operands[1];
- operands[1] = operands[2];
- operands[2] = tmp;
- }
+ std::swap (operands[1], operands[2]);
}
[(set_attr "type" "fp")
(set_attr "fp_mode" "single")])