aboutsummaryrefslogtreecommitdiff
path: root/gcc/genmodes.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2018-01-03 21:42:20 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2018-01-03 21:42:20 +0000
commitbb94ec7613a4fd30c278b236eb8783d985a1b6ee (patch)
tree4107ec912099af2ee77d6199890da00ee700d935 /gcc/genmodes.c
parent928686b1c6d0a8b791ec08b2588a5fb8118d191c (diff)
downloadgcc-bb94ec7613a4fd30c278b236eb8783d985a1b6ee.zip
gcc-bb94ec7613a4fd30c278b236eb8783d985a1b6ee.tar.gz
gcc-bb94ec7613a4fd30c278b236eb8783d985a1b6ee.tar.bz2
poly_int: GET_MODE_PRECISION
This patch changes GET_MODE_PRECISION from an unsigned short to a poly_uint16. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * machmode.h (mode_precision): Change from unsigned short to poly_uint16_pod. (mode_to_precision): Return a poly_uint16 rather than an unsigned short. (GET_MODE_PRECISION): Return a constant if ONLY_FIXED_SIZE_MODES, or if measurement_type is not polynomial. (HWI_COMPUTABLE_MODE_P): Turn into a function. Optimize the case in which the mode is already known to be a scalar_int_mode. * genmodes.c (emit_mode_precision): Change the type of mode_precision from unsigned short to poly_uint16_pod. Use ZERO_COEFFS for the initializer. * lto-streamer-in.c (lto_input_mode_table): Use bp_unpack_poly_value for GET_MODE_PRECISION. * lto-streamer-out.c (lto_write_mode_table): Use bp_pack_poly_value for GET_MODE_PRECISION. * combine.c (update_rsp_from_reg_equal): Treat GET_MODE_PRECISION as polynomial. (try_combine, find_split_point, combine_simplify_rtx): Likewise. (expand_field_assignment, make_extraction): Likewise. (make_compound_operation_int, record_dead_and_set_regs_1): Likewise. (get_last_value): Likewise. * convert.c (convert_to_integer_1): Likewise. * cse.c (cse_insn): Likewise. * expr.c (expand_expr_real_1): Likewise. * lra-constraints.c (simplify_operand_subreg): Likewise. * optabs-query.c (can_atomic_load_p): Likewise. * optabs.c (expand_atomic_load): Likewise. (expand_atomic_store): Likewise. * ree.c (combine_reaching_defs): Likewise. * rtl.h (partial_subreg_p, paradoxical_subreg_p): Likewise. * rtlanal.c (nonzero_bits1, lsb_bitfield_op_p): Likewise. * tree.h (type_has_mode_precision_p): Likewise. * ubsan.c (instrument_si_overflow): Likewise. gcc/ada/ * gcc-interface/misc.c (enumerate_modes): Treat GET_MODE_PRECISION as polynomial. Co-Authored-By: Alan Hayward <alan.hayward@arm.com> Co-Authored-By: David Sherwood <david.sherwood@arm.com> From-SVN: r256198
Diffstat (limited to 'gcc/genmodes.c')
-rw-r--r--gcc/genmodes.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index efcceb3..6230270 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -1358,13 +1358,14 @@ emit_mode_precision (void)
int c;
struct mode_data *m;
- print_decl ("unsigned short", "mode_precision", "NUM_MACHINE_MODES");
+ print_decl ("poly_uint16_pod", "mode_precision", "NUM_MACHINE_MODES");
for_all_modes (c, m)
if (m->precision != (unsigned int)-1)
- tagged_printf ("%u", m->precision, m->name);
+ tagged_printf ("{ %u" ZERO_COEFFS " }", m->precision, m->name);
else
- tagged_printf ("%u*BITS_PER_UNIT", m->bytesize, m->name);
+ tagged_printf ("{ %u * BITS_PER_UNIT" ZERO_COEFFS " }",
+ m->bytesize, m->name);
print_closer ();
}