From 73a699ae37a7fe98ad0b8c50ac95f5a882fd97da Mon Sep 17 00:00:00 2001 From: Richard Sandiford Date: Wed, 3 Jan 2018 21:42:42 +0000 Subject: poly_int: GET_MODE_BITSIZE This patch changes GET_MODE_BITSIZE from an unsigned short to a poly_uint16. 2018-01-03 Richard Sandiford Alan Hayward David Sherwood gcc/ * machmode.h (mode_to_bits): Return a poly_uint16 rather than an unsigned short. (GET_MODE_BITSIZE): Return a constant if ONLY_FIXED_SIZE_MODES, or if measurement_type is polynomial. * calls.c (shift_return_value): Treat GET_MODE_BITSIZE as polynomial. * combine.c (make_extraction): Likewise. * dse.c (find_shift_sequence): Likewise. * dwarf2out.c (mem_loc_descriptor): Likewise. * expmed.c (store_integral_bit_field, extract_bit_field_1): Likewise. (extract_bit_field, extract_low_bits): Likewise. * expr.c (convert_move, convert_modes, emit_move_insn_1): Likewise. (optimize_bitfield_assignment_op, expand_assignment): Likewise. (store_expr_with_bounds, store_field, expand_expr_real_1): Likewise. * fold-const.c (optimize_bit_field_compare, merge_ranges): Likewise. * gimple-fold.c (optimize_atomic_compare_exchange_p): Likewise. * reload.c (find_reloads): Likewise. * reload1.c (alter_reg): Likewise. * stor-layout.c (bitwise_mode_for_mode, compute_record_mode): Likewise. * targhooks.c (default_secondary_memory_needed_mode): Likewise. * tree-if-conv.c (predicate_mem_writes): Likewise. * tree-ssa-strlen.c (handle_builtin_memcmp): Likewise. * tree-vect-patterns.c (adjust_bool_pattern): Likewise. * tree-vect-stmts.c (vectorizable_simd_clone_call): Likewise. * valtrack.c (dead_debug_insert_temp): Likewise. * varasm.c (mergeable_constant_section): Likewise. * config/sh/sh.h (LOCAL_ALIGNMENT): Use as_a . gcc/ada/ * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_BITSIZE as polynomial. gcc/c-family/ * c-ubsan.c (ubsan_instrument_shift): Treat GET_MODE_BITSIZE as polynomial. Co-Authored-By: Alan Hayward Co-Authored-By: David Sherwood From-SVN: r256200 --- gcc/tree-vect-stmts.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'gcc/tree-vect-stmts.c') diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index 14ffdd4..341d772 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -3595,7 +3595,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, if (simd_clone_subparts (atype) < simd_clone_subparts (arginfo[i].vectype)) { - unsigned int prec = GET_MODE_BITSIZE (TYPE_MODE (atype)); + poly_uint64 prec = GET_MODE_BITSIZE (TYPE_MODE (atype)); k = (simd_clone_subparts (arginfo[i].vectype) / simd_clone_subparts (atype)); gcc_assert ((k & (k - 1)) == 0); @@ -3759,7 +3759,8 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, if (simd_clone_subparts (vectype) < nunits) { unsigned int k, l; - unsigned int prec = GET_MODE_BITSIZE (TYPE_MODE (vectype)); + poly_uint64 prec = GET_MODE_BITSIZE (TYPE_MODE (vectype)); + poly_uint64 bytes = GET_MODE_SIZE (TYPE_MODE (vectype)); k = nunits / simd_clone_subparts (vectype); gcc_assert ((k & (k - 1)) == 0); for (l = 0; l < k; l++) @@ -3769,8 +3770,7 @@ vectorizable_simd_clone_call (gimple *stmt, gimple_stmt_iterator *gsi, { t = build_fold_addr_expr (new_temp); t = build2 (MEM_REF, vectype, t, - build_int_cst (TREE_TYPE (t), - l * prec / BITS_PER_UNIT)); + build_int_cst (TREE_TYPE (t), l * bytes)); } else t = build3 (BIT_FIELD_REF, vectype, new_temp, -- cgit v1.1