diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-12-20 12:54:01 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-12-20 12:54:01 +0000 |
commit | 8c59e5e735fcc19f170b4b7d72b55400da99e7b4 (patch) | |
tree | 970495d1af2f273a8cc5044cb312cb2cd6f24fa2 /gcc/machmode.h | |
parent | fc60a41612bad379060969b6ed3a78eb160aae8a (diff) | |
download | gcc-8c59e5e735fcc19f170b4b7d72b55400da99e7b4.zip gcc-8c59e5e735fcc19f170b4b7d72b55400da99e7b4.tar.gz gcc-8c59e5e735fcc19f170b4b7d72b55400da99e7b4.tar.bz2 |
poly_int: C++ bitfield regions
This patch changes C++ bitregion_start/end values from constants to
poly_ints. Although it's unlikely that the size needs to be polynomial
in practice, the offset could be with future language extensions.
2017-12-20 Richard Sandiford <richard.sandiford@linaro.org>
Alan Hayward <alan.hayward@arm.com>
David Sherwood <david.sherwood@arm.com>
gcc/
* expmed.h (store_bit_field): Change bitregion_start and
bitregion_end from unsigned HOST_WIDE_INT to poly_uint64.
* expmed.c (adjust_bit_field_mem_for_reg, strict_volatile_bitfield_p)
(store_bit_field_1, store_integral_bit_field, store_bit_field)
(store_fixed_bit_field, store_split_bit_field): Likewise.
* expr.c (store_constructor_field, store_field): Likewise.
(optimize_bitfield_assignment_op): Likewise. Make the same change
to bitsize and bitpos.
* machmode.h (bit_field_mode_iterator): Change m_bitregion_start
and m_bitregion_end from HOST_WIDE_INT to poly_int64. Make the
same change in the constructor arguments.
(get_best_mode): Change bitregion_start and bitregion_end from
unsigned HOST_WIDE_INT to poly_uint64.
* stor-layout.c (bit_field_mode_iterator::bit_field_mode_iterator):
Change bitregion_start and bitregion_end from HOST_WIDE_INT to
poly_int64.
(bit_field_mode_iterator::next_mode): Update for new types
of m_bitregion_start and m_bitregion_end.
(get_best_mode): Change bitregion_start and bitregion_end from
unsigned HOST_WIDE_INT to poly_uint64.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255879
Diffstat (limited to 'gcc/machmode.h')
-rw-r--r-- | gcc/machmode.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/machmode.h b/gcc/machmode.h index 02a41b2..963fbb6c 100644 --- a/gcc/machmode.h +++ b/gcc/machmode.h @@ -760,7 +760,7 @@ class bit_field_mode_iterator { public: bit_field_mode_iterator (HOST_WIDE_INT, HOST_WIDE_INT, - HOST_WIDE_INT, HOST_WIDE_INT, + poly_int64, poly_int64, unsigned int, bool); bool next_mode (scalar_int_mode *); bool prefer_smaller_modes (); @@ -771,8 +771,8 @@ private: for invalid input such as gcc.dg/pr48335-8.c. */ HOST_WIDE_INT m_bitsize; HOST_WIDE_INT m_bitpos; - HOST_WIDE_INT m_bitregion_start; - HOST_WIDE_INT m_bitregion_end; + poly_int64 m_bitregion_start; + poly_int64 m_bitregion_end; unsigned int m_align; bool m_volatilep; int m_count; @@ -780,8 +780,7 @@ private: /* Find the best mode to use to access a bit field. */ -extern bool get_best_mode (int, int, unsigned HOST_WIDE_INT, - unsigned HOST_WIDE_INT, unsigned int, +extern bool get_best_mode (int, int, poly_uint64, poly_uint64, unsigned int, unsigned HOST_WIDE_INT, bool, scalar_int_mode *); /* Determine alignment, 1<=result<=BIGGEST_ALIGNMENT. */ |