Commit 04d6ea36 by Richard Sandiford Committed by Richard Sandiford

[53/77] Pass a mode to const_scalar_mask_from_tree

The caller of const_scalar_mask_from_tree has proven that
the mode is a MODE_INT, so this patch passes it down as a
scalar_int_mode.  It also expands the comment a little.

2017-08-30  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/
	* expr.c (const_scalar_mask_from_tree): Add a mode argument.
	Expand commentary.
	(expand_expr_real_1): Update call accordingly.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r251505
parent 1a527092
...@@ -2,6 +2,14 @@ ...@@ -2,6 +2,14 @@
Alan Hayward <alan.hayward@arm.com> Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com> David Sherwood <david.sherwood@arm.com>
* expr.c (const_scalar_mask_from_tree): Add a mode argument.
Expand commentary.
(expand_expr_real_1): Update call accordingly.
2017-08-30 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
* expmed.c (store_bit_field_using_insv): Add op0_mode and * expmed.c (store_bit_field_using_insv): Add op0_mode and
value_mode arguments. Use scalar_int_mode internally. value_mode arguments. Use scalar_int_mode internally.
(store_bit_field_1): Rename the new integer mode from imode (store_bit_field_1): Rename the new integer mode from imode
......
...@@ -99,7 +99,7 @@ static void emit_single_push_insn (machine_mode, rtx, tree); ...@@ -99,7 +99,7 @@ static void emit_single_push_insn (machine_mode, rtx, tree);
static void do_tablejump (rtx, machine_mode, rtx, rtx, rtx, static void do_tablejump (rtx, machine_mode, rtx, rtx, rtx,
profile_probability); profile_probability);
static rtx const_vector_from_tree (tree); static rtx const_vector_from_tree (tree);
static rtx const_scalar_mask_from_tree (tree); static rtx const_scalar_mask_from_tree (scalar_int_mode, tree);
static tree tree_expr_size (const_tree); static tree tree_expr_size (const_tree);
static HOST_WIDE_INT int_expr_size (tree); static HOST_WIDE_INT int_expr_size (tree);
...@@ -9969,7 +9969,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode, ...@@ -9969,7 +9969,7 @@ expand_expr_real_1 (tree exp, rtx target, machine_mode tmode,
if (is_int_mode (mode, &int_mode)) if (is_int_mode (mode, &int_mode))
{ {
if (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (exp))) if (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (exp)))
return const_scalar_mask_from_tree (exp); return const_scalar_mask_from_tree (int_mode, exp);
else else
{ {
tree type_for_mode tree type_for_mode
...@@ -11724,12 +11724,12 @@ const_vector_mask_from_tree (tree exp) ...@@ -11724,12 +11724,12 @@ const_vector_mask_from_tree (tree exp)
return gen_rtx_CONST_VECTOR (mode, v); return gen_rtx_CONST_VECTOR (mode, v);
} }
/* Return a CONST_INT rtx representing vector mask for /* EXP is a VECTOR_CST in which each element is either all-zeros or all-ones.
a VECTOR_CST of booleans. */ Return a constant scalar rtx of mode MODE in which bit X is set if element
X of EXP is nonzero. */
static rtx static rtx
const_scalar_mask_from_tree (tree exp) const_scalar_mask_from_tree (scalar_int_mode mode, tree exp)
{ {
machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
wide_int res = wi::zero (GET_MODE_PRECISION (mode)); wide_int res = wi::zero (GET_MODE_PRECISION (mode));
tree elt; tree elt;
unsigned i; unsigned i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment