Skip to content

Commit 6f23a2d

Browse files
ubizjakUros Bizjak
authored and
Uros Bizjak
committed
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
1 parent 24b5038 commit 6f23a2d

File tree

3 files changed

+19
-25
lines changed

3 files changed

+19
-25
lines changed

gcc/ChangeLog

+11
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
2014-11-16 Uros Bizjak <[email protected]>
2+
3+
* config/sh/sh.c: Do not include algorithm.
4+
(sh_emit_scc_to_t): Replace open-coded swap with std::swap
5+
to swap values.
6+
(sh_emit_compare_and_branch): Ditto.
7+
(sh_emit_compare_and_set): Ditto.
8+
* config/sh/sh.md (replacement peephole2): Ditto.
9+
(cstore4_media): Ditto.
10+
(*fmasf4): Ditto.
11+
112
2014-11-15 Vladimir Makarov <[email protected]>
213

314
* lra-remat.c (cand_transf_func): Process regno for

gcc/config/sh/sh.c

+4-10
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ along with GCC; see the file COPYING3. If not see
2121

2222
#include <sstream>
2323
#include <vector>
24-
#include <algorithm>
2524

2625
#include "config.h"
2726
#include "system.h"
@@ -2351,11 +2350,7 @@ sh_emit_scc_to_t (enum rtx_code code, rtx op0, rtx op1)
23512350
break;
23522351
}
23532352
if (code != oldcode)
2354-
{
2355-
rtx tmp = op0;
2356-
op0 = op1;
2357-
op1 = tmp;
2358-
}
2353+
std::swap (op0, op1);
23592354

23602355
mode = GET_MODE (op0);
23612356
if (mode == VOIDmode)
@@ -2436,7 +2431,7 @@ sh_emit_compare_and_branch (rtx *operands, machine_mode mode)
24362431
enum rtx_code branch_code;
24372432
rtx op0 = operands[1];
24382433
rtx op1 = operands[2];
2439-
rtx insn, tem;
2434+
rtx insn;
24402435
bool need_ccmpeq = false;
24412436

24422437
if (TARGET_SH2E && GET_MODE_CLASS (mode) == MODE_FLOAT)
@@ -2461,7 +2456,7 @@ sh_emit_compare_and_branch (rtx *operands, machine_mode mode)
24612456
|| (code == LE && TARGET_IEEE && TARGET_SH2E)
24622457
|| (code == GE && !(TARGET_IEEE && TARGET_SH2E)))
24632458
{
2464-
tem = op0, op0 = op1, op1 = tem;
2459+
std::swap (op0, op1);
24652460
code = swap_condition (code);
24662461
}
24672462

@@ -2520,7 +2515,6 @@ sh_emit_compare_and_set (rtx *operands, machine_mode mode)
25202515
rtx op1 = operands[3];
25212516
rtx_code_label *lab = NULL;
25222517
bool invert = false;
2523-
rtx tem;
25242518

25252519
op0 = force_reg (mode, op0);
25262520
if ((code != EQ && code != NE
@@ -2534,8 +2528,8 @@ sh_emit_compare_and_set (rtx *operands, machine_mode mode)
25342528
{
25352529
if (code == LT || code == LE)
25362530
{
2531+
std::swap (op0, op1);
25372532
code = swap_condition (code);
2538-
tem = op0, op0 = op1, op1 = tem;
25392533
}
25402534
if (code == GE)
25412535
{

gcc/config/sh/sh.md

+4-15
Original file line numberDiff line numberDiff line change
@@ -1618,14 +1618,9 @@
16181618
extract_insn (insn2);
16191619
if (! constrain_operands (1, get_preferred_alternatives (insn2, bb)))
16201620
{
1621-
rtx tmp;
16221621
failure:
1623-
tmp = replacements[0];
1624-
replacements[0] = replacements[1];
1625-
replacements[1] = tmp;
1626-
tmp = replacements[2];
1627-
replacements[2] = replacements[3];
1628-
replacements[3] = tmp;
1622+
std::swap (replacements[0], replacements[1]);
1623+
std::swap (replacements[2], replacements[3]);
16291624
replace_n_hard_rtx (SET_DEST (set1), replacements, 2, 1);
16301625
replace_n_hard_rtx (SET_DEST (set2), replacements, 2, 1);
16311626
replace_n_hard_rtx (SET_SRC (set2), replacements, 2, 1);
@@ -11348,9 +11343,7 @@ label:
1134811343

1134911344
if (swap)
1135011345
{
11351-
rtx tem = operands[2];
11352-
operands[2] = operands[3];
11353-
operands[3] = tem;
11346+
std::swap (operands[2], operands[3]);
1135411347
code = swap_condition (code);
1135511348
}
1135611349

@@ -12538,11 +12531,7 @@ label:
1253812531
/* Change 'b * a + a' into 'a * b + a'.
1253912532
This is better for register allocation. */
1254012533
if (REGNO (operands[2]) == REGNO (operands[3]))
12541-
{
12542-
rtx tmp = operands[1];
12543-
operands[1] = operands[2];
12544-
operands[2] = tmp;
12545-
}
12534+
std::swap (operands[1], operands[2]);
1254612535
}
1254712536
[(set_attr "type" "fp")
1254812537
(set_attr "fp_mode" "single")])

0 commit comments

Comments
 (0)