Skip to content
Snippets Groups Projects
Commit ae117af4 authored by Richard Biener's avatar Richard Biener
Browse files

[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.
parent 84993d94
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment