aboutsummaryrefslogtreecommitdiff
path: root/gcc/defaults.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-09-19 09:04:28 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-09-19 09:04:28 +0000
commitf24f4c15884bf1ee65a10e2f959842eec4198876 (patch)
tree36f90ba89bf92546561ae999a4a48cd9c5a4704f /gcc/defaults.h
parent4736041b5aa5681c44cbb9c183b11bbb781492fc (diff)
downloadgcc-f24f4c15884bf1ee65a10e2f959842eec4198876.zip
gcc-f24f4c15884bf1ee65a10e2f959842eec4198876.tar.gz
gcc-f24f4c15884bf1ee65a10e2f959842eec4198876.tar.bz2
Rework constant subreg folds and handle more variable-length cases
This patch rewrites the way simplify_subreg handles constants. It uses similar native_encode/native_decode routines to the tree-level handling of VIEW_CONVERT_EXPR, meaning that we can move between rtx constants and the target memory image of them. The main point of this patch is to support subregs of constant-length vectors for VLA vectors, beyond the very simple cases that were already handled. Many of the new tests failed before the patch for variable- length vectors. The boolean side is tested more by the upcoming SVE ACLE work. 2019-09-19 Richard Sandiford <richard.sandiford@arm.com> gcc/ * defaults.h (TARGET_UNIT): New macro. (target_unit): New type. * rtl.h (native_encode_rtx, native_decode_rtx) (native_decode_vector_rtx, subreg_size_lsb): Declare. (subreg_lsb_1): Turn into an inline wrapper around subreg_size_lsb. * rtlanal.c (subreg_lsb_1): Delete. (subreg_size_lsb): New function. * simplify-rtx.c: Include rtx-vector-builder.h (simplify_immed_subreg): Delete. (native_encode_rtx, native_decode_vector_rtx, native_decode_rtx) (simplify_const_vector_byte_offset, simplify_const_vector_subreg): New functions. (simplify_subreg): Use them. (test_vector_subregs_modes, test_vector_subregs_repeating) (test_vector_subregs_fore_back, test_vector_subregs_stepped) (test_vector_subregs): New functions. (test_vector_ops): Call test_vector_subregs for integer vector modes with at least 2 elements. From-SVN: r275959
Diffstat (limited to 'gcc/defaults.h')
-rw-r--r--gcc/defaults.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/defaults.h b/gcc/defaults.h
index af7ea18..72d4fba 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1459,4 +1459,18 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_GDB
#endif
+#ifndef USED_FOR_TARGET
+/* Done this way to keep gengtype happy. */
+#if BITS_PER_UNIT == 8
+#define TARGET_UNIT uint8_t
+#elif BITS_PER_UNIT == 16
+#define TARGET_UNIT uint16_t
+#elif BITS_PER_UNIT == 32
+#define TARGET_UNIT uint32_t
+#else
+#error Unknown BITS_PER_UNIT
+#endif
+typedef TARGET_UNIT target_unit;
+#endif
+
#endif /* ! GCC_DEFAULTS_H */