aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-08-30 11:18:45 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-08-30 11:18:45 +0000
commitd787ba568aa9bfa00c71f55b86ddb95a3d153db0 (patch)
tree79ff3c8099cb3359a27b27f61119e03a1d59be7f /gcc
parentd305ca88fc9b180a1790e02b144e921d17b393f0 (diff)
downloadgcc-d787ba568aa9bfa00c71f55b86ddb95a3d153db0.zip
gcc-d787ba568aa9bfa00c71f55b86ddb95a3d153db0.tar.gz
gcc-d787ba568aa9bfa00c71f55b86ddb95a3d153db0.tar.bz2
[60/77] Pass scalar_int_modes to do_jump_by_parts_*
The callers of do_jump_by_parts_* had already established that the modes were MODE_INTs, so this patch passes the modes down as scalar_int_modes. 2017-08-30 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * dojump.c (do_jump_by_parts_greater_rtx): Change the type of the mode argument to scalar_int_mode. (do_jump_by_parts_zero_rtx): Likewise. (do_jump_by_parts_equality_rtx): Likewise. (do_jump_by_parts_greater): Take a mode argument. (do_jump_by_parts_equality): Likewise. (do_jump_1): Update calls accordingly. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r251512
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog12
-rw-r--r--gcc/dojump.c46
2 files changed, 35 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 612bd69..8c829dc 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -2,6 +2,18 @@
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
+ * dojump.c (do_jump_by_parts_greater_rtx): Change the type of
+ the mode argument to scalar_int_mode.
+ (do_jump_by_parts_zero_rtx): Likewise.
+ (do_jump_by_parts_equality_rtx): Likewise.
+ (do_jump_by_parts_greater): Take a mode argument.
+ (do_jump_by_parts_equality): Likewise.
+ (do_jump_1): Update calls accordingly.
+
+2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
+
* is-a.h (safe_dyn_cast): New function.
* rtl.h (rtx_jump_table_data::get_data_mode): New function.
(jump_table_for_label): Likewise.
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 151d2cb..cda6f48 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -38,11 +38,12 @@ along with GCC; see the file COPYING3. If not see
#include "langhooks.h"
static bool prefer_and_bit_test (machine_mode, int);
-static void do_jump_by_parts_greater (tree, tree, int,
+static void do_jump_by_parts_greater (scalar_int_mode, tree, tree, int,
rtx_code_label *, rtx_code_label *,
profile_probability);
-static void do_jump_by_parts_equality (tree, tree, rtx_code_label *,
- rtx_code_label *, profile_probability);
+static void do_jump_by_parts_equality (scalar_int_mode, tree, tree,
+ rtx_code_label *, rtx_code_label *,
+ profile_probability);
static void do_compare_and_jump (tree, tree, enum rtx_code, enum rtx_code,
rtx_code_label *, rtx_code_label *,
profile_probability);
@@ -221,8 +222,8 @@ do_jump_1 (enum tree_code code, tree op0, tree op1,
prob.invert ());
else if (is_int_mode (TYPE_MODE (inner_type), &int_mode)
&& !can_compare_p (EQ, int_mode, ccp_jump))
- do_jump_by_parts_equality (op0, op1, if_false_label, if_true_label,
- prob);
+ do_jump_by_parts_equality (int_mode, op0, op1, if_false_label,
+ if_true_label, prob);
else
do_compare_and_jump (op0, op1, EQ, EQ, if_false_label, if_true_label,
prob);
@@ -242,8 +243,8 @@ do_jump_1 (enum tree_code code, tree op0, tree op1,
do_jump (op0, if_false_label, if_true_label, prob);
else if (is_int_mode (TYPE_MODE (inner_type), &int_mode)
&& !can_compare_p (NE, int_mode, ccp_jump))
- do_jump_by_parts_equality (op0, op1, if_true_label, if_false_label,
- prob.invert ());
+ do_jump_by_parts_equality (int_mode, op0, op1, if_true_label,
+ if_false_label, prob.invert ());
else
do_compare_and_jump (op0, op1, NE, NE, if_false_label, if_true_label,
prob);
@@ -254,7 +255,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1,
mode = TYPE_MODE (TREE_TYPE (op0));
if (is_int_mode (mode, &int_mode)
&& ! can_compare_p (LT, int_mode, ccp_jump))
- do_jump_by_parts_greater (op0, op1, 1, if_false_label,
+ do_jump_by_parts_greater (int_mode, op0, op1, 1, if_false_label,
if_true_label, prob);
else
do_compare_and_jump (op0, op1, LT, LTU, if_false_label, if_true_label,
@@ -265,8 +266,8 @@ do_jump_1 (enum tree_code code, tree op0, tree op1,
mode = TYPE_MODE (TREE_TYPE (op0));
if (is_int_mode (mode, &int_mode)
&& ! can_compare_p (LE, int_mode, ccp_jump))
- do_jump_by_parts_greater (op0, op1, 0, if_true_label, if_false_label,
- prob.invert ());
+ do_jump_by_parts_greater (int_mode, op0, op1, 0, if_true_label,
+ if_false_label, prob.invert ());
else
do_compare_and_jump (op0, op1, LE, LEU, if_false_label, if_true_label,
prob);
@@ -276,7 +277,7 @@ do_jump_1 (enum tree_code code, tree op0, tree op1,
mode = TYPE_MODE (TREE_TYPE (op0));
if (is_int_mode (mode, &int_mode)
&& ! can_compare_p (GT, int_mode, ccp_jump))
- do_jump_by_parts_greater (op0, op1, 0, if_false_label,
+ do_jump_by_parts_greater (int_mode, op0, op1, 0, if_false_label,
if_true_label, prob);
else
do_compare_and_jump (op0, op1, GT, GTU, if_false_label, if_true_label,
@@ -287,8 +288,8 @@ do_jump_1 (enum tree_code code, tree op0, tree op1,
mode = TYPE_MODE (TREE_TYPE (op0));
if (is_int_mode (mode, &int_mode)
&& ! can_compare_p (GE, int_mode, ccp_jump))
- do_jump_by_parts_greater (op0, op1, 1, if_true_label, if_false_label,
- prob.invert ());
+ do_jump_by_parts_greater (int_mode, op0, op1, 1, if_true_label,
+ if_false_label, prob.invert ());
else
do_compare_and_jump (op0, op1, GE, GEU, if_false_label, if_true_label,
prob);
@@ -667,7 +668,7 @@ do_jump (tree exp, rtx_code_label *if_false_label,
Jump to IF_TRUE_LABEL if OP0 is greater, IF_FALSE_LABEL otherwise. */
static void
-do_jump_by_parts_greater_rtx (machine_mode mode, int unsignedp, rtx op0,
+do_jump_by_parts_greater_rtx (scalar_int_mode mode, int unsignedp, rtx op0,
rtx op1, rtx_code_label *if_false_label,
rtx_code_label *if_true_label,
profile_probability prob)
@@ -743,17 +744,16 @@ do_jump_by_parts_greater_rtx (machine_mode mode, int unsignedp, rtx op0,
/* Given a comparison expression EXP for values too wide to be compared
with one insn, test the comparison and jump to the appropriate label.
The code of EXP is ignored; we always test GT if SWAP is 0,
- and LT if SWAP is 1. */
+ and LT if SWAP is 1. MODE is the mode of the two operands. */
static void
-do_jump_by_parts_greater (tree treeop0, tree treeop1, int swap,
- rtx_code_label *if_false_label,
+do_jump_by_parts_greater (scalar_int_mode mode, tree treeop0, tree treeop1,
+ int swap, rtx_code_label *if_false_label,
rtx_code_label *if_true_label,
profile_probability prob)
{
rtx op0 = expand_normal (swap ? treeop1 : treeop0);
rtx op1 = expand_normal (swap ? treeop0 : treeop1);
- machine_mode mode = TYPE_MODE (TREE_TYPE (treeop0));
int unsignedp = TYPE_UNSIGNED (TREE_TYPE (treeop0));
do_jump_by_parts_greater_rtx (mode, unsignedp, op0, op1, if_false_label,
@@ -766,7 +766,7 @@ do_jump_by_parts_greater (tree treeop0, tree treeop1, int swap,
to indicate drop through. */
static void
-do_jump_by_parts_zero_rtx (machine_mode mode, rtx op0,
+do_jump_by_parts_zero_rtx (scalar_int_mode mode, rtx op0,
rtx_code_label *if_false_label,
rtx_code_label *if_true_label,
profile_probability prob)
@@ -817,7 +817,7 @@ do_jump_by_parts_zero_rtx (machine_mode mode, rtx op0,
to indicate drop through. */
static void
-do_jump_by_parts_equality_rtx (machine_mode mode, rtx op0, rtx op1,
+do_jump_by_parts_equality_rtx (scalar_int_mode mode, rtx op0, rtx op1,
rtx_code_label *if_false_label,
rtx_code_label *if_true_label,
profile_probability prob)
@@ -855,17 +855,17 @@ do_jump_by_parts_equality_rtx (machine_mode mode, rtx op0, rtx op1,
}
/* Given an EQ_EXPR expression EXP for values too wide to be compared
- with one insn, test the comparison and jump to the appropriate label. */
+ with one insn, test the comparison and jump to the appropriate label.
+ MODE is the mode of the two operands. */
static void
-do_jump_by_parts_equality (tree treeop0, tree treeop1,
+do_jump_by_parts_equality (scalar_int_mode mode, tree treeop0, tree treeop1,
rtx_code_label *if_false_label,
rtx_code_label *if_true_label,
profile_probability prob)
{
rtx op0 = expand_normal (treeop0);
rtx op1 = expand_normal (treeop1);
- machine_mode mode = TYPE_MODE (TREE_TYPE (treeop0));
do_jump_by_parts_equality_rtx (mode, op0, op1, if_false_label,
if_true_label, prob);
}