[PATCH] D65456: [OpenCL] Add generic type handling for builtin functions

Pierre GONDOIS via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 8 03:20:09 PDT 2019


Pierre added a comment.

Just one comment,
Thank you again for making everything clearer :)



================
Comment at: clang/lib/Sema/OpenCLBuiltins.td:116
+// combination of Types and vector sizes.
+//
+// E.g.: If TypeListField = <int, float> and VectorList = <1, 2, 4>, then
----------------
Maybe it would be worth adding more information on how to use GenTypes. I was thinking of something like this : 

When using multiple generic types :
  * The maximal cardinal of the used  GenTypes must be the PGCM of all the cardinals.
  * The generic types combine as if it was an array like GenType[Type][VecSize].
I.e: With GT1 = [half, <1, 2>] and GT2 = [float, int, <1, 2>], they will combine as
<half, float>, <half2, float2>, <half, int>, <half, int2>
The maximal cardinal of GT1 and GT2 is 4 (= 2 types * 2 vector sizes).
4 is the PGCM of GT1 (=2) and GT2 (=4).


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

https://reviews.llvm.org/D65456





More information about the cfe-commits mailing list