Fix VIEW_CONVERT_EXPRs for VECTOR_BOOLEAN_TYPE_Ps
In r278410 I added code to handle VIEW_CONVERT_EXPRs between
variable-length vectors. This included support for decoding
a VECTOR_BOOLEAN_TYPE_P with subbyte elements.
However, it turns out that we were already mishandling such bool vectors
for fixed-length vectors: we treated each element as a stand-alone byte
instead of putting multiple elements into the same byte. I think in
principle this could have been an issue for AVX512 as well.
This patch adds encoding support for boolean vectors and reuses
a version of the new decode support for fixed-length vectors.
2019-12-04 Richard Sandiford <richard.sandiford@arm.com>
gcc/
* fold-const.c (native_encode_vector_part): Handle
VECTOR_BOOLEAN_TYPE_Ps that have subbyte precision.
(native_decode_vector_tree): Delete, moving the bulk of the code to...
(native_interpret_vector_part): ...this new function. Use a pointer
and length instead of a vec<> and start index.
(native_interpret_vector): Use native_interpret_vector_part.
(fold_view_convert_vector_encoding): Likewise.
gcc/testsuite/
* gcc.target/aarch64/sve/acle/general/whilelt_5.c: New test.
From-SVN: r278964