poly_int: extract_bit_field bitrange
commita20d1a58088ea00de2d55edc598523107758ab3b
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Dec 2017 12:53:52 +0000 (20 12:53 +0000)
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 20 Dec 2017 12:53:52 +0000 (20 12:53 +0000)
treec5ad67c91160778f85d53cd9d8e5203871279310
parent82ede1f8efab261519c48ea9bc1988575fa19631
poly_int: extract_bit_field bitrange

Similar to the previous store_bit_field patch, but for extractions
rather than insertions.  The patch splits out the extraction-as-subreg
handling into a new function (extract_bit_field_as_subreg), both for
ease of writing and because a later patch will add another caller.

The simplify_gen_subreg overload is temporary; it goes away
in a later patch.

2017-12-20  Richard Sandiford  <richard.sandiford@linaro.org>
    Alan Hayward  <alan.hayward@arm.com>
    David Sherwood  <david.sherwood@arm.com>

gcc/
* rtl.h (simplify_gen_subreg): Add a temporary overload that
accepts poly_uint64 offsets.
* expmed.h (extract_bit_field): Take bitsize and bitnum as
poly_uint64s rather than unsigned HOST_WIDE_INTs.
* expmed.c (lowpart_bit_field_p): Likewise.
(extract_bit_field_as_subreg): New function, split out from...
(extract_bit_field_1): ...here.  Take bitsize and bitnum as
poly_uint64s rather than unsigned HOST_WIDE_INTs.  For vector
extractions, check that BITSIZE matches the size of the extracted
value and that BITNUM is an exact multiple of that size.
If all else fails, try forcing the value into memory if
BITNUM is variable, and adjusting the address so that the
offset is constant.  Split the part that can only handle constant
bitsize and bitnum out into...
(extract_integral_bit_field): ...this new function.
(extract_bit_field): Take bitsize and bitnum as poly_uint64s
rather than unsigned HOST_WIDE_INTs.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255878 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/expmed.c
gcc/expmed.h
gcc/rtl.h