[PATCH] D81083: [Clang] Allow "vector_size" applied to Booleans

Kazushi Marukawa via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 19 17:54:22 PDT 2020


kaz7 added a comment.

Thank you preparing this i1 patch and doing it on clang side only.  We were testing this patch and sending problem reports.  Now, we can use this patch without modifying llvm code.  We can define vector mask types like below.  Then, we can define intrinsic functions using this type.  Those are converted to mask type, e.g v256i1, in the back end without adding bitcasts in ISelLowering.cpp.  It helps developers very much.  I hope this extension is accepted.

  typedef double __vr __attribute__((__vector_size__(2048)));
  #if __STDC_VERSION__ >= 199901L
  // For C99
  typedef _Bool __vm    __attribute__((__vector_size__(32)));
  typedef _Bool __vm256 __attribute__((__vector_size__(32)));
  typedef _Bool __vm512 __attribute__((__vector_size__(64)));
  #else
  #ifdef __cplusplus
  // For C++
  typedef bool __vm    __attribute__((__vector_size__(32)));
  typedef bool __vm256 __attribute__((__vector_size__(32)));
  typedef bool __vm512 __attribute__((__vector_size__(64)));
  #else
  #error need C++ or C99 to use vector intrinsics for VE
  #endif
  #endif


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D81083/new/

https://reviews.llvm.org/D81083



More information about the cfe-commits mailing list