[gimplefe] Add vector_mask attribute to get access to vector bools
The following adds __attribute__((vector_mask)) to get access to
the corresponding mask type for a vector type. The implementation
simply uses truth_type_for so creating a mask type that's not
what the target would choose as canonical, say a AVX2 style one
when AVX512VL is enabled, is not possible. It might be possible
to provide access to that with an optional argument specifying
the precision of the bool element. The syntax is as simple as
typedef vector_type mask_type __attribute__((vector_mask));
In theory this allows to create unit testcases for vector
lowering and ISEL.
2022-02-11 Richard Biener <rguenther@suse.de>
gcc/c-family/
* c-attribs.cc (c_common_attribute_table): Add entry for
vector_mask.
(handle_vector_mask_attribute): New.
gcc/c/
* gimple-parser.cc (c_parser_gimple_statement): Properly parse
VEC_COND_EXPRs.
gcc/testsuite/
* gcc.dg/gimplefe-48.c: New testcase.