+2015-08-17 David Sherwood <david.sherwood@arm.com>
+
+ * config/arm/arm.c (neon_element_bits): Replace call to
+ GET_MODE_BITSIZE (GET_MODE_INNER (m)) with GET_MODE_UNIT_BITSIZE (m).
+ * config/arm/neon.md (neon_vget_lane<mode>): Likewise.
+ (neon_vget_laneu<mode>, neon_vset_lane<mode>): Likewise
+ (neon_vdup_lane<mode>): Likewise.
+ * config/i386/i386.c (ix86_expand_int_vcond): Likewise.
+ (ix86_expand_multi_arg_builtin, ix86_expand_reduc): Likewise.
+ (expand_vec_perm_palignr, ix86_expand_sse2_abs): Likewise.
+ * config/rs6000/rs6000.c (rs6000_do_expand_vec_perm): Likewise.
+ * config/spu/spu.c (arith_immediate_p): Likewise.
+ * expmed.c (store_bit_field_1, extract_bit_field_1): Likewise.
+ * expr.c (expand_expr_real_2): Likewise.
+ * optabs.c (shift_amt_for_vec_perm_mask): Likewise.
+ * simplify-rtx.c (simplify_immed_subreg): Likewise.
+ * tree-cfg.c (verify_gimple_assign_ternary): Likewise.
+ * tree-vect-patterns.c (vect_recog_mixed_size_cond_pattern): Likewise.
+ New variable.
+ * fold-const.c (fold_binary_loc): Replace call to
+ GET_MODE_PRECISION (GET_MODE_INNER (m)) with
+ GET_MODE_UNIT_PRECISION (m).
+
2015-08-17 Mike Stump <mikestump@comcast.net>
* config/arm/arm.c (arm_block_move_unaligned_straight):
HOST_WIDE_INT
neon_element_bits (machine_mode mode)
{
- return GET_MODE_BITSIZE (GET_MODE_INNER (mode));
+ return GET_MODE_UNIT_BITSIZE (mode);
}
\f
to this model. */
unsigned int elt = INTVAL (operands[2]);
unsigned int reg_nelts
- = 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode));
+ = 64 / GET_MODE_UNIT_BITSIZE (<MODE>mode);
elt ^= reg_nelts - 1;
operands[2] = GEN_INT (elt);
}
- if (GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode)) == 32)
+ if (GET_MODE_UNIT_BITSIZE (<MODE>mode) == 32)
emit_insn (gen_vec_extract<mode> (operands[0], operands[1], operands[2]));
else
emit_insn (gen_neon_vget_lane<mode>_sext_internal (operands[0],
to this model. */
unsigned int elt = INTVAL (operands[2]);
unsigned int reg_nelts
- = 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode));
+ = 64 / GET_MODE_UNIT_BITSIZE (<MODE>mode);
elt ^= reg_nelts - 1;
operands[2] = GEN_INT (elt);
}
- if (GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode)) == 32)
+ if (GET_MODE_UNIT_BITSIZE (<MODE>mode) == 32)
emit_insn (gen_vec_extract<mode> (operands[0], operands[1], operands[2]));
else
emit_insn (gen_neon_vget_lane<mode>_zext_internal (operands[0],
if (BYTES_BIG_ENDIAN)
{
unsigned int reg_nelts
- = 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<MODE>mode));
+ = 64 / GET_MODE_UNIT_BITSIZE (<MODE>mode);
elt ^= reg_nelts - 1;
}
{
unsigned int elt = INTVAL (operands[2]);
unsigned int reg_nelts
- = 64 / GET_MODE_BITSIZE (GET_MODE_INNER (<V_double_vector_mode>mode));
+ = 64 / GET_MODE_UNIT_BITSIZE (<V_double_vector_mode>mode);
elt ^= reg_nelts - 1;
operands[2] = GEN_INT (elt);
}
|| (TARGET_AVX2 && GET_MODE_SIZE (data_mode) == 32)))
{
rtx negop = operands[2 - (code == LT)];
- int shift = GET_MODE_BITSIZE (GET_MODE_INNER (data_mode)) - 1;
+ int shift = GET_MODE_UNIT_BITSIZE (data_mode) - 1;
if (negop == CONST1_RTX (data_mode))
{
rtx res = expand_simple_binop (mode, LSHIFTRT, cop0, GEN_INT (shift),
xop_rotl:
if (CONST_INT_P (op))
{
- int mask = GET_MODE_BITSIZE (GET_MODE_INNER (tmode)) - 1;
+ int mask = GET_MODE_UNIT_BITSIZE (tmode) - 1;
op = GEN_INT (INTVAL (op) & mask);
gcc_checking_assert
(insn_data[icode].operand[i + 1].predicate (op, mode));
}
for (i = GET_MODE_BITSIZE (mode);
- i > GET_MODE_BITSIZE (GET_MODE_INNER (mode));
+ i > GET_MODE_UNIT_BITSIZE (mode);
i >>= 1)
{
half = gen_reg_rtx (mode);
emit_reduc_half (half, vec, i);
- if (i == GET_MODE_BITSIZE (GET_MODE_INNER (mode)) * 2)
+ if (i == GET_MODE_UNIT_BITSIZE (mode) * 2)
dst = dest;
else
dst = gen_reg_rtx (mode);
return expand_vec_perm_1 (&dcopy);
}
- shift = GEN_INT (min * GET_MODE_BITSIZE (GET_MODE_INNER (d->vmode)));
+ shift = GEN_INT (min * GET_MODE_UNIT_BITSIZE (d->vmode));
if (GET_MODE_SIZE (d->vmode) == 16)
{
target = gen_reg_rtx (TImode);
value of X is (((signed) X >> (W-1)) ^ X) - ((signed) X >> (W-1)). */
case V4SImode:
tmp0 = expand_simple_binop (mode, ASHIFTRT, input,
- GEN_INT (GET_MODE_BITSIZE
- (GET_MODE_INNER (mode)) - 1),
+ GEN_INT (GET_MODE_UNIT_BITSIZE (mode) - 1),
NULL, 0, OPTAB_DIRECT);
tmp1 = expand_simple_binop (mode, XOR, tmp0, input,
NULL, 0, OPTAB_DIRECT);
imode = vmode;
if (GET_MODE_CLASS (vmode) != MODE_VECTOR_INT)
{
- imode = GET_MODE_INNER (vmode);
- imode = mode_for_size (GET_MODE_BITSIZE (imode), MODE_INT, 0);
+ imode = mode_for_size (GET_MODE_UNIT_BITSIZE (vmode), MODE_INT, 0);
imode = mode_for_vector (imode, nelt);
}
constant_to_array (mode, op, arr);
bytes = GET_MODE_UNIT_SIZE (mode);
- mode = mode_for_size (GET_MODE_BITSIZE (GET_MODE_INNER (mode)), MODE_INT, 0);
+ mode = mode_for_size (GET_MODE_UNIT_BITSIZE (mode), MODE_INT, 0);
/* Check that bytes are repeated. */
for (i = bytes; i < 16; i += bytes)
&& !MEM_P (op0)
&& optab_handler (vec_set_optab, GET_MODE (op0)) != CODE_FOR_nothing
&& fieldmode == GET_MODE_INNER (GET_MODE (op0))
- && bitsize == GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))
- && !(bitnum % GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))))
+ && bitsize == GET_MODE_UNIT_BITSIZE (GET_MODE (op0))
+ && !(bitnum % GET_MODE_UNIT_BITSIZE (GET_MODE (op0))))
{
struct expand_operand ops[3];
machine_mode outermode = GET_MODE (op0);
if (VECTOR_MODE_P (GET_MODE (op0))
&& !MEM_P (op0)
&& optab_handler (vec_extract_optab, GET_MODE (op0)) != CODE_FOR_nothing
- && ((bitnum + bitsize - 1) / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))
- == bitnum / GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (op0)))))
+ && ((bitnum + bitsize - 1) / GET_MODE_UNIT_BITSIZE (GET_MODE (op0))
+ == bitnum / GET_MODE_UNIT_BITSIZE (GET_MODE (op0))))
{
struct expand_operand ops[3];
machine_mode outermode = GET_MODE (op0);
little-endian, or element N-1 if big-endian. So pull the scalar
result out of that element. */
int index = BYTES_BIG_ENDIAN ? GET_MODE_NUNITS (vec_mode) - 1 : 0;
- int bitsize = GET_MODE_BITSIZE (GET_MODE_INNER (vec_mode));
+ int bitsize = GET_MODE_UNIT_BITSIZE (vec_mode);
temp = extract_bit_field (temp, bitsize, bitsize * index, unsignedp,
target, mode, mode);
gcc_assert (temp);
/* Only create rotates in complete modes. Other cases are not
expanded properly. */
&& (element_precision (rtype)
- == GET_MODE_PRECISION (GET_MODE_INNER (TYPE_MODE (rtype)))))
+ == GET_MODE_UNIT_PRECISION (TYPE_MODE (rtype))))
{
tree tree01, tree11;
enum tree_code code01, code11;
shift_amt_for_vec_perm_mask (rtx sel)
{
unsigned int i, first, nelt = GET_MODE_NUNITS (GET_MODE (sel));
- unsigned int bitsize = GET_MODE_BITSIZE (GET_MODE_INNER (GET_MODE (sel)));
+ unsigned int bitsize = GET_MODE_UNIT_BITSIZE (GET_MODE (sel));
if (GET_CODE (sel) != CONST_VECTOR)
return NULL_RTX;
{
num_elem = CONST_VECTOR_NUNITS (op);
elems = &CONST_VECTOR_ELT (op, 0);
- elem_bitsize = GET_MODE_BITSIZE (GET_MODE_INNER (innermode));
+ elem_bitsize = GET_MODE_UNIT_BITSIZE (innermode);
}
else
{
case SAD_EXPR:
if (!useless_type_conversion_p (rhs1_type, rhs2_type)
|| !useless_type_conversion_p (lhs_type, rhs3_type)
- || 2 * GET_MODE_BITSIZE (GET_MODE_INNER
- (TYPE_MODE (TREE_TYPE (rhs1_type))))
- > GET_MODE_BITSIZE (GET_MODE_INNER
- (TYPE_MODE (TREE_TYPE (lhs_type)))))
+ || 2 * GET_MODE_UNIT_BITSIZE (TYPE_MODE (TREE_TYPE (rhs1_type)))
+ > GET_MODE_UNIT_BITSIZE (TYPE_MODE (TREE_TYPE (lhs_type))))
{
error ("type mismatch in sad expression");
debug_generic_expr (lhs_type);
tree cond_expr, then_clause, else_clause;
stmt_vec_info stmt_vinfo = vinfo_for_stmt (last_stmt), def_stmt_info;
tree type, vectype, comp_vectype, itype = NULL_TREE, vecitype;
- machine_mode cmpmode;
gimple pattern_stmt, def_stmt;
loop_vec_info loop_vinfo = STMT_VINFO_LOOP_VINFO (stmt_vinfo);
bb_vec_info bb_vinfo = STMT_VINFO_BB_VINFO (stmt_vinfo);
itype = orig_type1;
}
- cmpmode = GET_MODE_INNER (TYPE_MODE (comp_vectype));
- if (GET_MODE_BITSIZE (TYPE_MODE (type)) == GET_MODE_BITSIZE (cmpmode))
+ HOST_WIDE_INT cmp_mode_size
+ = GET_MODE_UNIT_BITSIZE (TYPE_MODE (comp_vectype));
+
+ if (GET_MODE_BITSIZE (TYPE_MODE (type)) == cmp_mode_size)
return NULL;
vectype = get_vectype_for_scalar_type (type);
return NULL;
if (itype == NULL_TREE)
- itype = build_nonstandard_integer_type (GET_MODE_BITSIZE (cmpmode),
+ itype = build_nonstandard_integer_type (cmp_mode_size,
TYPE_UNSIGNED (type));
if (itype == NULL_TREE
- || GET_MODE_BITSIZE (TYPE_MODE (itype)) != GET_MODE_BITSIZE (cmpmode))
+ || GET_MODE_BITSIZE (TYPE_MODE (itype)) != cmp_mode_size)
return NULL;
vecitype = get_vectype_for_scalar_type (itype);
if (!expand_vec_cond_expr_p (vecitype, comp_vectype))
return NULL;
- if (GET_MODE_BITSIZE (TYPE_MODE (type)) > GET_MODE_BITSIZE (cmpmode))
+ if (GET_MODE_BITSIZE (TYPE_MODE (type)) > cmp_mode_size)
{
if ((TREE_CODE (then_clause) == INTEGER_CST
&& !int_fits_type_p (then_clause, itype))