diff options
author | Richard Sandiford <richard.sandiford@linaro.org> | 2017-12-20 12:53:52 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2017-12-20 12:53:52 +0000 |
commit | fc60a41612bad379060969b6ed3a78eb160aae8a (patch) | |
tree | c5ad67c91160778f85d53cd9d8e5203871279310 /gcc/expmed.h | |
parent | 2d7b38df8e50a2c29bbc778a34c6ab6349178994 (diff) | |
download | gcc-fc60a41612bad379060969b6ed3a78eb160aae8a.zip gcc-fc60a41612bad379060969b6ed3a78eb160aae8a.tar.gz gcc-fc60a41612bad379060969b6ed3a78eb160aae8a.tar.bz2 |
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.
Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>
From-SVN: r255878
Diffstat (limited to 'gcc/expmed.h')
-rw-r--r-- | gcc/expmed.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gcc/expmed.h b/gcc/expmed.h index 2148e1b..82383a6 100644 --- a/gcc/expmed.h +++ b/gcc/expmed.h @@ -722,8 +722,7 @@ extern void store_bit_field (rtx, poly_uint64, poly_uint64, unsigned HOST_WIDE_INT, unsigned HOST_WIDE_INT, machine_mode, rtx, bool); -extern rtx extract_bit_field (rtx, unsigned HOST_WIDE_INT, - unsigned HOST_WIDE_INT, int, rtx, +extern rtx extract_bit_field (rtx, poly_uint64, poly_uint64, int, rtx, machine_mode, machine_mode, bool, rtx *); extern rtx extract_low_bits (machine_mode, machine_mode, rtx); extern rtx expand_mult (machine_mode, rtx, rtx, rtx, int, bool = false); |