Alan Hayward <alan.hayward@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
value_mode arguments. Use scalar_int_mode internally.
(store_bit_field_1): Rename the new integer mode from imode
static void do_tablejump (rtx, machine_mode, rtx, rtx, rtx,
profile_probability);
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 HOST_WIDE_INT int_expr_size (tree);
if (is_int_mode (mode, &int_mode))
{
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
{
tree type_for_mode
return gen_rtx_CONST_VECTOR (mode, v);
}
-/* Return a CONST_INT rtx representing vector mask for
- a VECTOR_CST of booleans. */
+/* EXP is a VECTOR_CST in which each element is either all-zeros or all-ones.
+ Return a constant scalar rtx of mode MODE in which bit X is set if element
+ X of EXP is nonzero. */
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));
tree elt;
unsigned i;