[cfe-dev] [RFC] Opt-in vector of bool type

Keane, Erich via cfe-dev cfe-dev at lists.llvm.org
Thu May 14 06:57:21 PDT 2020


There is a temptation when doing this to try to represent these as a vector of i1 in IR.  Don't do this, it still has to be i8s, otherwise it causes a number of problems.	

I'll leave it to the rest of the mailing list to judge whether the GCC incompatibility is justified.  However, I'm curious as to why this would be opt-in on a target basis?  Are there some targets that wouldn't be able to legalize this?

-----Original Message-----
From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of Simon Moll via cfe-dev
Sent: Thursday, May 14, 2020 6:39 AM
To: cfe-dev at lists.llvm.org
Cc: MARUKAWA KAZUSHI <marukawa at nec.com>; ISHIZAKA KAZUHISA <ishizaka at nec.com>; Erich Focht <Erich.Focht at EMEA.NEC.COM>
Subject: [cfe-dev] [RFC] Opt-in vector of bool type

Hi,

We would like to extend Clang to allow 'bool' as a valid vector element type in C/C++ code for select targets.

This is the natural type for SIMD masks and would facilitate clean SIMD intrinsic declarations in C/C++ code.
Vectors of i1 are supported on IR level and below down to many SIMD ISAs, such as AVX512 or the VE target (NEC SX-Aurora TSUBASA).
We understand the historical reasons for not supporting this (gcc complicance).
However, this would be an opt-in feature and toolchains/targets that do not want this will be unaffected by the change.

Looking forward to your feedback.

- Simon
_______________________________________________
cfe-dev mailing list
cfe-dev at lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


More information about the cfe-dev mailing list