summaryrefslogtreecommitdiff
path: root/gcc/machmode.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2018-01-03 21:43:02 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2018-01-03 21:43:02 +0000
commit8464736baadf3c4a106758d2598fc3d2cf438496 (patch)
tree99f960801c55a722346016899054db7e08ba7b13 /gcc/machmode.h
parent52acb7aee19f4bb33e76819907eff343bf4f42e8 (diff)
downloadgcc-8464736baadf3c4a106758d2598fc3d2cf438496.tar.gz
Add support for MODE_VECTOR_BOOL
This patch adds a new mode class to represent vectors of booleans. GET_MODE_BITSIZE (m) / GET_MODE_NUNITS (m) determines the number of bits that are used to represent each boolean; this can be 1 for a fully-packed representation or greater than 1 for an unpacked representation. In the latter case, the value of bits other than the lowest is not significant. These are used by the SVE port to represent predicates. 2018-01-03 Richard Sandiford <richard.sandiford@linaro.org> Alan Hayward <alan.hayward@arm.com> David Sherwood <david.sherwood@arm.com> gcc/ * mode-classes.def (MODE_VECTOR_BOOL): New mode class. * machmode.h (INTEGRAL_MODE_P, VECTOR_MODE_P): Return true for MODE_VECTOR_BOOL. * machmode.def (VECTOR_BOOL_MODE): Document. * genmodes.c (VECTOR_BOOL_MODE): New macro. (make_vector_bool_mode): New function. (complete_mode, emit_mode_wider, emit_mode_adjustments): Handle MODE_VECTOR_BOOL. * lto-streamer-in.c (lto_input_mode_table): Likewise. * rtx-vector-builder.c (rtx_vector_builder::find_cached_value): Likewise. * stor-layout.c (int_mode_for_mode): Likewise. * tree.c (build_vector_type_for_mode): Likewise. * varasm.c (output_constant_pool_2): Likewise. * emit-rtl.c (init_emit_once): Make sure that CONST1_RTX (BImode) and CONSTM1_RTX (BImode) are the same thing. Initialize const_tiny_rtx for MODE_VECTOR_BOOL. * expr.c (expand_expr_real_1): Use VECTOR_MODE_P instead of a list of mode class checks. * tree-vect-generic.c (expand_vector_operation): Use VECTOR_MODE_P instead of a list of mode class checks. (expand_vector_scalar_condition): Likewise. (type_for_widest_vector_mode): Handle BImode as an inner mode. gcc/c-family/ * c-common.c (c_common_type_for_mode): Handle MODE_VECTOR_BOOL. gcc/fortran/ * trans-types.c (gfc_type_for_mode): Handle MODE_VECTOR_BOOL. gcc/go/ * go-lang.c (go_langhook_type_for_mode): Handle MODE_VECTOR_BOOL. gcc/lto/ * lto-lang.c (lto_type_for_mode): Handle MODE_VECTOR_BOOL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@256202 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/machmode.h')
-rw-r--r--gcc/machmode.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/machmode.h b/gcc/machmode.h
index 8e918d6dd31..5eaa868527d 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -108,6 +108,7 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES];
(GET_MODE_CLASS (MODE) == MODE_INT \
|| GET_MODE_CLASS (MODE) == MODE_PARTIAL_INT \
|| GET_MODE_CLASS (MODE) == MODE_COMPLEX_INT \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_BOOL \
|| GET_MODE_CLASS (MODE) == MODE_VECTOR_INT)
/* Nonzero if MODE is a floating-point mode. */
@@ -123,8 +124,9 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES];
|| GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT)
/* Nonzero if MODE is a vector mode. */
-#define VECTOR_MODE_P(MODE) \
- (GET_MODE_CLASS (MODE) == MODE_VECTOR_INT \
+#define VECTOR_MODE_P(MODE) \
+ (GET_MODE_CLASS (MODE) == MODE_VECTOR_BOOL \
+ || GET_MODE_CLASS (MODE) == MODE_VECTOR_INT \
|| GET_MODE_CLASS (MODE) == MODE_VECTOR_FLOAT \
|| GET_MODE_CLASS (MODE) == MODE_VECTOR_FRACT \
|| GET_MODE_CLASS (MODE) == MODE_VECTOR_UFRACT \