Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 1 | //==--- OpenCLBuiltins.td - OpenCL builtin declarations -------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 6 | // See https://llvm.org/LICENSE.txt for license information. |
| 7 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 8 | // |
| 9 | //===----------------------------------------------------------------------===// |
| 10 | // |
| 11 | // This file contains TableGen definitions for OpenCL builtin function |
| 12 | // declarations. In case of an unresolved function name in OpenCL, Clang will |
| 13 | // check for a function described in this file when -fdeclare-opencl-builtins |
| 14 | // is specified. |
| 15 | // |
| 16 | //===----------------------------------------------------------------------===// |
| 17 | |
| 18 | //===----------------------------------------------------------------------===// |
| 19 | // Definitions of miscellaneous basic entities. |
| 20 | //===----------------------------------------------------------------------===// |
| 21 | // Versions of OpenCL |
| 22 | class Version<int _Version> { |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 23 | int ID = _Version; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 24 | } |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 25 | def CLAll : Version< 0>; |
| 26 | def CL10 : Version<100>; |
| 27 | def CL11 : Version<110>; |
| 28 | def CL12 : Version<120>; |
| 29 | def CL20 : Version<200>; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 30 | |
| 31 | // Address spaces |
| 32 | // Pointer types need to be assigned an address space. |
| 33 | class AddressSpace<string _AS> { |
Sven van Haastregt | 89fb9e8 | 2019-07-29 14:55:29 +0000 | [diff] [blame] | 34 | string Name = _AS; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 35 | } |
Sven van Haastregt | 89fb9e8 | 2019-07-29 14:55:29 +0000 | [diff] [blame] | 36 | def DefaultAS : AddressSpace<"clang::LangAS::Default">; |
| 37 | def PrivateAS : AddressSpace<"clang::LangAS::opencl_private">; |
| 38 | def GlobalAS : AddressSpace<"clang::LangAS::opencl_global">; |
| 39 | def ConstantAS : AddressSpace<"clang::LangAS::opencl_constant">; |
| 40 | def LocalAS : AddressSpace<"clang::LangAS::opencl_local">; |
| 41 | def GenericAS : AddressSpace<"clang::LangAS::opencl_generic">; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 42 | |
Sven van Haastregt | 308b8b7 | 2019-12-18 10:13:51 +0000 | [diff] [blame^] | 43 | // OpenCL language extension. |
| 44 | class AbstractExtension<string _Ext> { |
| 45 | // One or more OpenCL extensions, space separated. Each extension must be |
| 46 | // a valid extension name for the opencl extension pragma. |
| 47 | string ExtName = _Ext; |
| 48 | } |
| 49 | |
| 50 | // Extension associated to a builtin function. |
| 51 | class FunctionExtension<string _Ext> : AbstractExtension<_Ext>; |
| 52 | |
| 53 | // FunctionExtension definitions. |
| 54 | def FuncExtNone : FunctionExtension<"">; |
| 55 | def FuncExtKhrSubgroups : FunctionExtension<"cl_khr_subgroups">; |
| 56 | def FuncExtKhrGlobalInt32BaseAtomics : FunctionExtension<"cl_khr_global_int32_base_atomics">; |
| 57 | def FuncExtKhrGlobalInt32ExtendedAtomics : FunctionExtension<"cl_khr_global_int32_extended_atomics">; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 58 | |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 59 | // Qualified Type. These map to ASTContext::QualType. |
| 60 | class QualType<string _Name, bit _IsAbstract=0> { |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 61 | // Name of the field or function in a clang::ASTContext |
| 62 | // E.g. Name="IntTy" for the int type, and "getIntPtrType()" for an intptr_t |
| 63 | string Name = _Name; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 64 | // Some QualTypes in this file represent an abstract type for which there is |
| 65 | // no corresponding AST QualType, e.g. a GenType or an `image2d_t` type |
| 66 | // without access qualifiers. |
| 67 | bit IsAbstract = _IsAbstract; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 68 | } |
| 69 | |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 70 | // List of integers. |
| 71 | class IntList<string _Name, list<int> _List> { |
| 72 | string Name = _Name; |
| 73 | list<int> List = _List; |
| 74 | } |
| 75 | |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 76 | //===----------------------------------------------------------------------===// |
| 77 | // OpenCL C classes for types |
| 78 | //===----------------------------------------------------------------------===// |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 79 | // OpenCL C basic data types (int, float, image2d_t, ...). |
Sven van Haastregt | 47e95ff | 2019-09-17 13:32:56 +0000 | [diff] [blame] | 80 | // Its child classes can represent concrete types (e.g. VectorType) or |
| 81 | // abstract types (e.g. GenType). |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 82 | class Type<string _Name, QualType _QTName> { |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 83 | // Name of the Type. |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 84 | string Name = _Name; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 85 | // QualType associated with this type. |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 86 | QualType QTName = _QTName; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 87 | // Size of the vector (if applicable). |
| 88 | int VecWidth = 1; |
| 89 | // Is a pointer. |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 90 | bit IsPointer = 0; |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 91 | // "const" qualifier. |
| 92 | bit IsConst = 0; |
| 93 | // "volatile" qualifier. |
| 94 | bit IsVolatile = 0; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 95 | // Access qualifier. Must be one of ("RO", "WO", "RW"). |
| 96 | string AccessQualifier = ""; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 97 | // Address space. |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 98 | string AddrSpace = DefaultAS.Name; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 99 | } |
| 100 | |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 101 | // OpenCL vector types (e.g. int2, int3, int16, float8, ...). |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 102 | class VectorType<Type _Ty, int _VecWidth> : Type<_Ty.Name, _Ty.QTName> { |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 103 | let VecWidth = _VecWidth; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 104 | let AccessQualifier = ""; |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 105 | // Inherited fields |
| 106 | let IsPointer = _Ty.IsPointer; |
| 107 | let IsConst = _Ty.IsConst; |
| 108 | let IsVolatile = _Ty.IsVolatile; |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 109 | let AddrSpace = _Ty.AddrSpace; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 110 | } |
| 111 | |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 112 | // OpenCL pointer types (e.g. int*, float*, ...). |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 113 | class PointerType<Type _Ty, AddressSpace _AS = DefaultAS> : |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 114 | Type<_Ty.Name, _Ty.QTName> { |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 115 | let AddrSpace = _AS.Name; |
| 116 | // Inherited fields |
| 117 | let VecWidth = _Ty.VecWidth; |
| 118 | let IsPointer = 1; |
| 119 | let IsConst = _Ty.IsConst; |
| 120 | let IsVolatile = _Ty.IsVolatile; |
| 121 | let AccessQualifier = _Ty.AccessQualifier; |
| 122 | } |
| 123 | |
| 124 | // OpenCL const types (e.g. const int). |
| 125 | class ConstType<Type _Ty> : Type<_Ty.Name, _Ty.QTName> { |
| 126 | let IsConst = 1; |
| 127 | // Inherited fields |
| 128 | let VecWidth = _Ty.VecWidth; |
| 129 | let IsPointer = _Ty.IsPointer; |
| 130 | let IsVolatile = _Ty.IsVolatile; |
| 131 | let AccessQualifier = _Ty.AccessQualifier; |
| 132 | let AddrSpace = _Ty.AddrSpace; |
| 133 | } |
| 134 | |
| 135 | // OpenCL volatile types (e.g. volatile int). |
| 136 | class VolatileType<Type _Ty> : Type<_Ty.Name, _Ty.QTName> { |
| 137 | let IsVolatile = 1; |
| 138 | // Inherited fields |
| 139 | let VecWidth = _Ty.VecWidth; |
| 140 | let IsPointer = _Ty.IsPointer; |
| 141 | let IsConst = _Ty.IsConst; |
| 142 | let AccessQualifier = _Ty.AccessQualifier; |
| 143 | let AddrSpace = _Ty.AddrSpace; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 144 | } |
| 145 | |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 146 | // OpenCL image types (e.g. image2d). |
| 147 | class ImageType<Type _Ty, string _AccessQualifier> : |
| 148 | Type<_Ty.Name, QualType<_Ty.QTName.Name#_AccessQualifier#"Ty", 0>> { |
| 149 | let VecWidth = 0; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 150 | let AccessQualifier = _AccessQualifier; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 151 | // Inherited fields |
| 152 | let IsPointer = _Ty.IsPointer; |
| 153 | let IsConst = _Ty.IsConst; |
| 154 | let IsVolatile = _Ty.IsVolatile; |
| 155 | let AddrSpace = _Ty.AddrSpace; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 156 | } |
| 157 | |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 158 | // List of Types. |
| 159 | class TypeList<string _Name, list<Type> _Type> { |
| 160 | string Name = _Name; |
| 161 | list<Type> List = _Type; |
| 162 | } |
| 163 | |
| 164 | // A GenericType is an abstract type that defines a set of types as a |
| 165 | // combination of Types and vector sizes. |
| 166 | // |
Sven van Haastregt | 47e95ff | 2019-09-17 13:32:56 +0000 | [diff] [blame] | 167 | // For example, if TypeList = <int, float> and VectorList = <1, 2, 4>, then it |
| 168 | // represents <int, int2, int4, float, float2, float4>. |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 169 | // |
| 170 | // Some rules apply when using multiple GenericType arguments in a declaration: |
| 171 | // 1. The number of vector sizes must be equal or 1 for all gentypes in a |
| 172 | // declaration. |
| 173 | // 2. The number of Types must be equal or 1 for all gentypes in a |
| 174 | // declaration. |
| 175 | // 3. Generic types are combined by iterating over all generic types at once. |
| 176 | // For example, for the following GenericTypes |
| 177 | // GenT1 = GenericType<half, [1, 2]> and |
| 178 | // GenT2 = GenericType<float, int, [1, 2]> |
| 179 | // A declaration f(GenT1, GenT2) results in the combinations |
| 180 | // f(half, float), f(half2, float2), f(half, int), f(half2, int2) . |
| 181 | // 4. "sgentype" from the OpenCL specification is supported by specifying |
| 182 | // a single vector size. |
| 183 | // For example, for the following GenericTypes |
| 184 | // GenT = GenericType<half, int, [1, 2]> and |
| 185 | // SGenT = GenericType<half, int, [1]> |
| 186 | // A declaration f(GenT, SGenT) results in the combinations |
| 187 | // f(half, half), f(half2, half), f(int, int), f(int2, int) . |
| 188 | class GenericType<string _Ty, TypeList _TypeList, IntList _VectorList> : |
| 189 | Type<_Ty, QualType<"null", 1>> { |
| 190 | // Possible element types of the generic type. |
| 191 | TypeList TypeList = _TypeList; |
| 192 | // Possible vector sizes of the types in the TypeList. |
| 193 | IntList VectorList = _VectorList; |
| 194 | // The VecWidth field is ignored for GenericTypes. Use VectorList instead. |
| 195 | let VecWidth = 0; |
| 196 | } |
| 197 | |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 198 | // Builtin function attributes. |
| 199 | def Attr { |
| 200 | list<bit> None = [0, 0, 0]; |
| 201 | list<bit> Pure = [1, 0, 0]; |
| 202 | list<bit> Const = [0, 1, 0]; |
| 203 | list<bit> Convergent = [0, 0, 1]; |
| 204 | } |
| 205 | |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 206 | //===----------------------------------------------------------------------===// |
| 207 | // OpenCL C class for builtin functions |
| 208 | //===----------------------------------------------------------------------===// |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 209 | class Builtin<string _Name, list<Type> _Signature, list<bit> _Attributes = Attr.None> { |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 210 | // Name of the builtin function |
| 211 | string Name = _Name; |
| 212 | // List of types used by the function. The first one is the return type and |
| 213 | // the following are the arguments. The list must have at least one element |
| 214 | // (the return type). |
| 215 | list<Type> Signature = _Signature; |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 216 | // Function attribute __attribute__((pure)) |
| 217 | bit IsPure = _Attributes[0]; |
| 218 | // Function attribute __attribute__((const)) |
| 219 | bit IsConst = _Attributes[1]; |
| 220 | // Function attribute __attribute__((convergent)) |
| 221 | bit IsConv = _Attributes[2]; |
Sven van Haastregt | 308b8b7 | 2019-12-18 10:13:51 +0000 | [diff] [blame^] | 222 | // OpenCL extensions to which the function belongs. |
| 223 | FunctionExtension Extension = FuncExtNone; |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 224 | // Version of OpenCL from which the function is available (e.g.: CL10). |
| 225 | // MinVersion is inclusive. |
| 226 | Version MinVersion = CL10; |
| 227 | // Version of OpenCL from which the function is not supported anymore. |
| 228 | // MaxVersion is exclusive. |
| 229 | // CLAll makes the function available for all versions. |
| 230 | Version MaxVersion = CLAll; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 231 | } |
| 232 | |
| 233 | //===----------------------------------------------------------------------===// |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 234 | // Definitions of OpenCL C types |
| 235 | //===----------------------------------------------------------------------===// |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 236 | |
| 237 | // OpenCL v1.0/1.2/2.0 s6.1.1: Built-in Scalar Data Types. |
Sven van Haastregt | 89fb9e8 | 2019-07-29 14:55:29 +0000 | [diff] [blame] | 238 | def Bool : Type<"bool", QualType<"BoolTy">>; |
| 239 | def Char : Type<"char", QualType<"CharTy">>; |
| 240 | def UChar : Type<"uchar", QualType<"UnsignedCharTy">>; |
| 241 | def Short : Type<"short", QualType<"ShortTy">>; |
| 242 | def UShort : Type<"ushort", QualType<"UnsignedShortTy">>; |
| 243 | def Int : Type<"int", QualType<"IntTy">>; |
| 244 | def UInt : Type<"uint", QualType<"UnsignedIntTy">>; |
| 245 | def Long : Type<"long", QualType<"LongTy">>; |
| 246 | def ULong : Type<"ulong", QualType<"UnsignedLongTy">>; |
| 247 | def Float : Type<"float", QualType<"FloatTy">>; |
| 248 | def Double : Type<"double", QualType<"DoubleTy">>; |
| 249 | def Half : Type<"half", QualType<"HalfTy">>; |
| 250 | def Size : Type<"size_t", QualType<"getSizeType()">>; |
| 251 | def PtrDiff : Type<"ptrdiff_t", QualType<"getPointerDiffType()">>; |
| 252 | def IntPtr : Type<"intptr_t", QualType<"getIntPtrType()">>; |
| 253 | def UIntPtr : Type<"uintPtr_t", QualType<"getUIntPtrType()">>; |
| 254 | def Void : Type<"void_t", QualType<"VoidTy">>; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 255 | |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 256 | // OpenCL v1.0/1.2/2.0 s6.1.2: Built-in Vector Data Types. |
| 257 | // Built-in vector data types are created by TableGen's OpenCLBuiltinEmitter. |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 258 | |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 259 | // OpenCL v1.0/1.2/2.0 s6.1.3: Other Built-in Data Types. |
| 260 | // The image definitions are "abstract". They should not be used without |
| 261 | // specifying an access qualifier (RO/WO/RW). |
| 262 | def Image1d : Type<"Image1d", QualType<"OCLImage1d", 1>>; |
| 263 | def Image2d : Type<"Image2d", QualType<"OCLImage2d", 1>>; |
| 264 | def Image3d : Type<"Image3d", QualType<"OCLImage3d", 1>>; |
| 265 | def Image1dArray : Type<"Image1dArray", QualType<"OCLImage1dArray", 1>>; |
| 266 | def Image1dBuffer : Type<"Image1dBuffer", QualType<"OCLImage1dBuffer", 1>>; |
| 267 | def Image2dArray : Type<"Image2dArray", QualType<"OCLImage2dArray", 1>>; |
| 268 | def Image2dDepth : Type<"Image2dDepth", QualType<"OCLImage2dDepth", 1>>; |
| 269 | def Image2dArrayDepth : Type<"Image2dArrayDepth", QualType<"OCLImage2dArrayDepth", 1>>; |
| 270 | def Image2dMsaa : Type<"Image2dMsaa", QualType<"OCLImage2dMSAA", 1>>; |
| 271 | def Image2dArrayMsaa : Type<"Image2dArrayMsaa", QualType<"OCLImage2dArrayMSAA", 1>>; |
| 272 | def Image2dMsaaDepth : Type<"Image2dMsaaDepth", QualType<"OCLImage2dMSAADepth", 1>>; |
| 273 | def Image2dArrayMsaaDepth : Type<"Image2dArrayMsaaDepth", QualType<"OCLImage2dArrayMSAADepth", 1>>; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 274 | |
Sven van Haastregt | 89fb9e8 | 2019-07-29 14:55:29 +0000 | [diff] [blame] | 275 | def Sampler : Type<"Sampler", QualType<"OCLSamplerTy">>; |
| 276 | def Event : Type<"Event", QualType<"OCLEventTy">>; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 277 | |
| 278 | //===----------------------------------------------------------------------===// |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 279 | // Definitions of OpenCL gentype variants |
| 280 | //===----------------------------------------------------------------------===// |
| 281 | // The OpenCL specification often uses "gentype" in builtin function |
| 282 | // declarations to indicate that a builtin function is available with various |
| 283 | // argument and return types. The types represented by "gentype" vary between |
| 284 | // different parts of the specification. The following definitions capture |
| 285 | // the different type lists for gentypes in different parts of the |
| 286 | // specification. |
| 287 | |
| 288 | // Vector width lists. |
| 289 | def VecAndScalar: IntList<"VecAndScalar", [1, 2, 3, 4, 8, 16]>; |
| 290 | def VecNoScalar : IntList<"VecNoScalar", [2, 3, 4, 8, 16]>; |
| 291 | def Vec1 : IntList<"Vec1", [1]>; |
Sven van Haastregt | e54c83e | 2019-11-26 10:44:49 +0000 | [diff] [blame] | 292 | def Vec2 : IntList<"Vec2", [2]>; |
| 293 | def Vec4 : IntList<"Vec4", [4]>; |
| 294 | def Vec8 : IntList<"Vec8", [8]>; |
| 295 | def Vec16 : IntList<"Vec16", [16]>; |
Sven van Haastregt | 3d30f2c | 2019-11-07 15:00:19 +0000 | [diff] [blame] | 296 | def Vec1234 : IntList<"Vec1234", [1, 2, 3, 4]>; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 297 | |
| 298 | // Type lists. |
Sven van Haastregt | e54c83e | 2019-11-26 10:44:49 +0000 | [diff] [blame] | 299 | def TLAll : TypeList<"TLAll", [Char, UChar, Short, UShort, Int, UInt, Long, ULong, Float, Double, Half]>; |
| 300 | def TLAllUnsigned : TypeList<"TLAllUnsigned", [UChar, UChar, UShort, UShort, UInt, UInt, ULong, ULong, UInt, ULong, UShort]>; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 301 | def TLFloat : TypeList<"TLFloat", [Float, Double, Half]>; |
Sven van Haastregt | 3d30f2c | 2019-11-07 15:00:19 +0000 | [diff] [blame] | 302 | def TLSignedInts : TypeList<"TLSignedInts", [Char, Short, Int, Long]>; |
| 303 | def TLUnsignedInts : TypeList<"TLUnsignedInts", [UChar, UShort, UInt, ULong]>; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 304 | |
Sven van Haastregt | e54c83e | 2019-11-26 10:44:49 +0000 | [diff] [blame] | 305 | def TLIntLongFloats : TypeList<"TLIntLongFloats", [Int, UInt, Long, ULong, Float, Double, Half]>; |
| 306 | |
Sven van Haastregt | 0e70c35 | 2019-11-06 11:53:19 +0000 | [diff] [blame] | 307 | // All unsigned integer types twice, to facilitate unsigned return types for e.g. |
| 308 | // uchar abs(char) and |
| 309 | // uchar abs(uchar). |
| 310 | def TLAllUIntsTwice : TypeList<"TLAllUIntsTwice", [UChar, UChar, UShort, UShort, UInt, UInt, ULong, ULong]>; |
| 311 | |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 312 | def TLAllInts : TypeList<"TLAllInts", [Char, UChar, Short, UShort, Int, UInt, Long, ULong]>; |
| 313 | |
| 314 | // GenType definitions for multiple base types (e.g. all floating point types, |
| 315 | // or all integer types). |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 316 | // All types |
| 317 | def AGenTypeN : GenericType<"AGenTypeN", TLAll, VecAndScalar>; |
| 318 | def AGenTypeNNoScalar : GenericType<"AGenTypeNNoScalar", TLAll, VecNoScalar>; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 319 | // All integer |
| 320 | def AIGenType1 : GenericType<"AIGenType1", TLAllInts, Vec1>; |
| 321 | def AIGenTypeN : GenericType<"AIGenTypeN", TLAllInts, VecAndScalar>; |
| 322 | def AIGenTypeNNoScalar : GenericType<"AIGenTypeNNoScalar", TLAllInts, VecNoScalar>; |
Sven van Haastregt | 0e70c35 | 2019-11-06 11:53:19 +0000 | [diff] [blame] | 323 | // All integer to unsigned |
| 324 | def AI2UGenTypeN : GenericType<"AI2UGenTypeN", TLAllUIntsTwice, VecAndScalar>; |
Sven van Haastregt | 3d30f2c | 2019-11-07 15:00:19 +0000 | [diff] [blame] | 325 | // Signed integer |
| 326 | def SGenTypeN : GenericType<"SGenTypeN", TLSignedInts, VecAndScalar>; |
| 327 | // Unsigned integer |
| 328 | def UGenTypeN : GenericType<"UGenTypeN", TLUnsignedInts, VecAndScalar>; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 329 | // Float |
| 330 | def FGenTypeN : GenericType<"FGenTypeN", TLFloat, VecAndScalar>; |
Sven van Haastregt | e54c83e | 2019-11-26 10:44:49 +0000 | [diff] [blame] | 331 | // (u)int, (u)long, and all floats |
| 332 | def IntLongFloatGenType1 : GenericType<"IntLongFloatGenType1", TLIntLongFloats, Vec1>; |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 333 | |
| 334 | // GenType definitions for every single base type (e.g. fp32 only). |
| 335 | // Names are like: GenTypeFloatVecAndScalar. |
| 336 | foreach Type = [Char, UChar, Short, UShort, |
| 337 | Int, UInt, Long, ULong, |
| 338 | Float, Double, Half] in { |
| 339 | foreach VecSizes = [VecAndScalar, VecNoScalar] in { |
| 340 | def "GenType" # Type # VecSizes : |
| 341 | GenericType<"GenType" # Type # VecSizes, |
| 342 | TypeList<"GL" # Type.Name, [Type]>, |
| 343 | VecSizes>; |
| 344 | } |
| 345 | } |
| 346 | |
Sven van Haastregt | 3d30f2c | 2019-11-07 15:00:19 +0000 | [diff] [blame] | 347 | // GenType definitions for vec1234. |
| 348 | foreach Type = [Float, Double, Half] in { |
| 349 | def "GenType" # Type # Vec1234 : |
| 350 | GenericType<"GenType" # Type # Vec1234, |
| 351 | TypeList<"GL" # Type.Name, [Type]>, |
| 352 | Vec1234>; |
| 353 | } |
| 354 | |
Sven van Haastregt | b21a365 | 2019-08-19 11:56:03 +0000 | [diff] [blame] | 355 | |
| 356 | //===----------------------------------------------------------------------===// |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 357 | // Definitions of OpenCL builtin functions |
| 358 | //===----------------------------------------------------------------------===// |
Sven van Haastregt | 89fb9e8 | 2019-07-29 14:55:29 +0000 | [diff] [blame] | 359 | //-------------------------------------------------------------------- |
| 360 | // OpenCL v1.1/1.2/2.0 s6.2.3 - Explicit conversions. |
| 361 | // OpenCL v2.0 Extensions s5.1.1 and s6.1.1 - Conversions. |
| 362 | |
| 363 | // Generate the convert_* builtins functions. |
| 364 | foreach RType = [Float, Double, Half, Char, UChar, Short, |
| 365 | UShort, Int, UInt, Long, ULong] in { |
| 366 | foreach IType = [Float, Double, Half, Char, UChar, Short, |
| 367 | UShort, Int, UInt, Long, ULong] in { |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 368 | foreach sat = ["", "_sat"] in { |
Sven van Haastregt | 89fb9e8 | 2019-07-29 14:55:29 +0000 | [diff] [blame] | 369 | foreach rnd = ["", "_rte", "_rtn", "_rtp", "_rtz"] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 370 | def : Builtin<"convert_" # RType.Name # sat # rnd, [RType, IType], |
| 371 | Attr.Const>; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 372 | foreach v = [2, 3, 4, 8, 16] in { |
Sven van Haastregt | 89fb9e8 | 2019-07-29 14:55:29 +0000 | [diff] [blame] | 373 | def : Builtin<"convert_" # RType.Name # v # sat # rnd, |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 374 | [VectorType<RType, v>, VectorType<IType, v>], |
| 375 | Attr.Const>; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 376 | } |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 382 | //-------------------------------------------------------------------- |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 383 | // OpenCL v1.1 s6.11.1, v1.2 s6.12.1, v2.0 s6.13.1 - Work-item Functions |
| 384 | // --- Table 7 --- |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 385 | def : Builtin<"get_work_dim", [UInt], Attr.Const>; |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 386 | foreach name = ["get_global_size", "get_global_id", "get_local_size", |
| 387 | "get_local_id", "get_num_groups", "get_group_id", |
| 388 | "get_global_offset"] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 389 | def : Builtin<name, [Size, UInt], Attr.Const>; |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 390 | } |
| 391 | |
| 392 | let MinVersion = CL20 in { |
| 393 | def : Builtin<"get_enqueued_local_size", [Size, UInt]>; |
| 394 | foreach name = ["get_global_linear_id", "get_local_linear_id"] in { |
| 395 | def : Builtin<name, [Size]>; |
| 396 | } |
| 397 | } |
| 398 | |
Sven van Haastregt | 6fc73f6 | 2019-11-05 19:47:21 +0000 | [diff] [blame] | 399 | |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 400 | //-------------------------------------------------------------------- |
Sven van Haastregt | 6fc73f6 | 2019-11-05 19:47:21 +0000 | [diff] [blame] | 401 | // OpenCL v1.1 s6.11.2, v1.2 s6.12.2, v2.0 s6.13.2 - Math functions |
| 402 | // OpenCL Extension v2.0 s5.1.2 and s6.1.2 - Math Functions |
| 403 | // --- Table 8 --- |
| 404 | // --- 1 argument --- |
| 405 | foreach name = ["acos", "acosh", "acospi", |
| 406 | "asin", "asinh", "asinpi", |
| 407 | "atan", "atanh", "atanpi", |
| 408 | "cbrt", "ceil", |
| 409 | "cos", "cosh", "cospi", |
| 410 | "erfc", "erf", |
| 411 | "exp", "exp2", "exp10", "expm1", |
| 412 | "fabs", "floor", |
| 413 | "log", "log2", "log10", "log1p", "logb", |
| 414 | "rint", "round", "rsqrt", |
| 415 | "sin", "sinh", "sinpi", |
| 416 | "sqrt", |
| 417 | "tan", "tanh", "tanpi", |
| 418 | "tgamma", "trunc", |
| 419 | "lgamma"] in { |
| 420 | def : Builtin<name, [FGenTypeN, FGenTypeN], Attr.Const>; |
| 421 | } |
| 422 | foreach name = ["nan"] in { |
| 423 | def : Builtin<name, [GenTypeFloatVecAndScalar, GenTypeUIntVecAndScalar], Attr.Const>; |
| 424 | def : Builtin<name, [GenTypeDoubleVecAndScalar, GenTypeULongVecAndScalar], Attr.Const>; |
| 425 | def : Builtin<name, [GenTypeHalfVecAndScalar, GenTypeUShortVecAndScalar], Attr.Const>; |
| 426 | } |
| 427 | |
| 428 | // --- 2 arguments --- |
| 429 | foreach name = ["atan2", "atan2pi", "copysign", "fdim", "fmod", "hypot", |
| 430 | "maxmag", "minmag", "nextafter", "pow", "powr", |
| 431 | "remainder"] in { |
| 432 | def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN], Attr.Const>; |
| 433 | } |
| 434 | foreach name = ["fmax", "fmin"] in { |
| 435 | def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN], Attr.Const>; |
| 436 | def : Builtin<name, [GenTypeFloatVecNoScalar, GenTypeFloatVecNoScalar, Float], Attr.Const>; |
| 437 | def : Builtin<name, [GenTypeDoubleVecNoScalar, GenTypeDoubleVecNoScalar, Double], Attr.Const>; |
| 438 | def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Half], Attr.Const>; |
| 439 | } |
| 440 | foreach name = ["ilogb"] in { |
| 441 | def : Builtin<name, [GenTypeIntVecAndScalar, GenTypeFloatVecAndScalar], Attr.Const>; |
| 442 | def : Builtin<name, [GenTypeIntVecAndScalar, GenTypeDoubleVecAndScalar], Attr.Const>; |
| 443 | def : Builtin<name, [GenTypeIntVecAndScalar, GenTypeHalfVecAndScalar], Attr.Const>; |
| 444 | } |
| 445 | foreach name = ["ldexp"] in { |
| 446 | def : Builtin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 447 | def : Builtin<name, [GenTypeFloatVecNoScalar, GenTypeFloatVecNoScalar, Int], Attr.Const>; |
| 448 | def : Builtin<name, [GenTypeDoubleVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 449 | def : Builtin<name, [GenTypeDoubleVecNoScalar, GenTypeDoubleVecNoScalar, Int], Attr.Const>; |
| 450 | def : Builtin<name, [GenTypeHalfVecAndScalar, GenTypeHalfVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 451 | def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Int], Attr.Const>; |
| 452 | } |
| 453 | foreach name = ["pown", "rootn"] in { |
| 454 | def : Builtin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 455 | def : Builtin<name, [GenTypeDoubleVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 456 | def : Builtin<name, [GenTypeHalfVecAndScalar, GenTypeHalfVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 457 | } |
| 458 | |
| 459 | // --- 3 arguments --- |
| 460 | foreach name = ["fma", "mad"] in { |
| 461 | def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN, FGenTypeN], Attr.Const>; |
| 462 | } |
| 463 | |
| 464 | // --- Version dependent --- |
| 465 | let MaxVersion = CL20 in { |
| 466 | foreach AS = [GlobalAS, LocalAS, PrivateAS] in { |
| 467 | foreach name = ["fract", "modf", "sincos"] in { |
| 468 | def : Builtin<name, [FGenTypeN, FGenTypeN, PointerType<FGenTypeN, AS>]>; |
| 469 | } |
| 470 | foreach name = ["frexp", "lgamma_r"] in { |
| 471 | foreach Type = [GenTypeFloatVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeHalfVecAndScalar] in { |
| 472 | def : Builtin<name, [Type, Type, PointerType<GenTypeIntVecAndScalar, AS>]>; |
| 473 | } |
| 474 | } |
| 475 | foreach name = ["remquo"] in { |
| 476 | foreach Type = [GenTypeFloatVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeHalfVecAndScalar] in { |
| 477 | def : Builtin<name, [Type, Type, Type, PointerType<GenTypeIntVecAndScalar, AS>]>; |
| 478 | } |
| 479 | } |
| 480 | } |
| 481 | } |
| 482 | let MinVersion = CL20 in { |
| 483 | foreach name = ["fract", "modf", "sincos"] in { |
| 484 | def : Builtin<name, [FGenTypeN, FGenTypeN, PointerType<FGenTypeN, GenericAS>]>; |
| 485 | } |
| 486 | foreach name = ["frexp", "lgamma_r"] in { |
| 487 | foreach Type = [GenTypeFloatVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeHalfVecAndScalar] in { |
| 488 | def : Builtin<name, [Type, Type, PointerType<GenTypeIntVecAndScalar, GenericAS>]>; |
| 489 | } } |
| 490 | foreach name = ["remquo"] in { |
| 491 | foreach Type = [GenTypeFloatVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeHalfVecAndScalar] in { |
| 492 | def : Builtin<name, [Type, Type, Type, PointerType<GenTypeIntVecAndScalar, GenericAS>]>; |
| 493 | } |
| 494 | } |
| 495 | } |
| 496 | |
| 497 | // --- Table 9 --- |
| 498 | foreach name = ["half_cos", |
| 499 | "half_exp", "half_exp2", "half_exp10", |
| 500 | "half_log", "half_log2", "half_log10", |
| 501 | "half_recip", "half_rsqrt", |
| 502 | "half_sin", "half_sqrt", "half_tan", |
| 503 | "native_cos", |
| 504 | "native_exp", "native_exp2", "native_exp10", |
| 505 | "native_log", "native_log2", "native_log10", |
| 506 | "native_recip", "native_rsqrt", |
| 507 | "native_sin", "native_sqrt", "native_tan"] in { |
| 508 | def : Builtin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar], Attr.Const>; |
| 509 | } |
| 510 | foreach name = ["half_divide", "half_powr", |
| 511 | "native_divide", "native_powr"] in { |
| 512 | def : Builtin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar], Attr.Const>; |
| 513 | } |
| 514 | |
| 515 | //-------------------------------------------------------------------- |
Sven van Haastregt | 0e70c35 | 2019-11-06 11:53:19 +0000 | [diff] [blame] | 516 | // OpenCL v1.1 s6.11.3, v1.2 s6.12.3, v2.0 s6.13.3 - Integer Functions |
| 517 | // --- Table 10 --- |
| 518 | // --- 1 argument --- |
| 519 | foreach name = ["abs"] in { |
| 520 | def : Builtin<name, [AI2UGenTypeN, AIGenTypeN], Attr.Const>; |
| 521 | } |
| 522 | foreach name = ["clz", "popcount"] in { |
| 523 | def : Builtin<name, [AIGenTypeN, AIGenTypeN], Attr.Const>; |
| 524 | } |
| 525 | let MinVersion = CL20 in { |
| 526 | foreach name = ["ctz"] in { |
| 527 | def : Builtin<name, [AIGenTypeN, AIGenTypeN]>; |
| 528 | } |
| 529 | } |
| 530 | |
| 531 | // --- 2 arguments --- |
| 532 | foreach name = ["abs_diff"] in { |
| 533 | def : Builtin<name, [AI2UGenTypeN, AIGenTypeN, AIGenTypeN], Attr.Const>; |
| 534 | } |
| 535 | foreach name = ["add_sat", "hadd", "rhadd", "mul_hi", "rotate", "sub_sat"] in { |
| 536 | def : Builtin<name, [AIGenTypeN, AIGenTypeN, AIGenTypeN], Attr.Const>; |
| 537 | } |
| 538 | foreach name = ["max", "min"] in { |
| 539 | def : Builtin<name, [AIGenTypeN, AIGenTypeN, AIGenTypeN], Attr.Const>; |
| 540 | def : Builtin<name, [AIGenTypeNNoScalar, AIGenTypeNNoScalar, AIGenType1], Attr.Const>; |
| 541 | } |
| 542 | foreach name = ["upsample"] in { |
| 543 | def : Builtin<name, [GenTypeShortVecAndScalar, GenTypeCharVecAndScalar, GenTypeUCharVecAndScalar], Attr.Const>; |
| 544 | def : Builtin<name, [GenTypeUShortVecAndScalar, GenTypeUCharVecAndScalar, GenTypeUCharVecAndScalar], Attr.Const>; |
| 545 | def : Builtin<name, [GenTypeIntVecAndScalar, GenTypeShortVecAndScalar, GenTypeUShortVecAndScalar], Attr.Const>; |
| 546 | def : Builtin<name, [GenTypeUIntVecAndScalar, GenTypeUShortVecAndScalar, GenTypeUShortVecAndScalar], Attr.Const>; |
| 547 | def : Builtin<name, [GenTypeLongVecAndScalar, GenTypeIntVecAndScalar, GenTypeUIntVecAndScalar], Attr.Const>; |
| 548 | def : Builtin<name, [GenTypeULongVecAndScalar, GenTypeUIntVecAndScalar, GenTypeUIntVecAndScalar], Attr.Const>; |
| 549 | } |
| 550 | |
| 551 | // --- 3 arguments --- |
| 552 | foreach name = ["clamp"] in { |
| 553 | def : Builtin<name, [AIGenTypeN, AIGenTypeN, AIGenTypeN, AIGenTypeN], Attr.Const>; |
| 554 | def : Builtin<name, [AIGenTypeNNoScalar, AIGenTypeNNoScalar, AIGenType1, AIGenType1], Attr.Const>; |
| 555 | } |
| 556 | foreach name = ["mad_hi", "mad_sat"] in { |
| 557 | def : Builtin<name, [AIGenTypeN, AIGenTypeN, AIGenTypeN, AIGenTypeN], Attr.Const>; |
| 558 | } |
| 559 | |
| 560 | // --- Table 11 --- |
| 561 | foreach name = ["mad24"] in { |
| 562 | def : Builtin<name, [GenTypeIntVecAndScalar, GenTypeIntVecAndScalar, GenTypeIntVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 563 | def : Builtin<name, [GenTypeUIntVecAndScalar, GenTypeUIntVecAndScalar, GenTypeUIntVecAndScalar, GenTypeUIntVecAndScalar], Attr.Const>; |
| 564 | } |
| 565 | foreach name = ["mul24"] in { |
| 566 | def : Builtin<name, [GenTypeIntVecAndScalar, GenTypeIntVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 567 | def : Builtin<name, [GenTypeUIntVecAndScalar, GenTypeUIntVecAndScalar, GenTypeUIntVecAndScalar], Attr.Const>; |
| 568 | } |
| 569 | |
| 570 | //-------------------------------------------------------------------- |
Sven van Haastregt | 6fc73f6 | 2019-11-05 19:47:21 +0000 | [diff] [blame] | 571 | // OpenCL v1.1 s6.11.4, v1.2 s6.12.4, v2.0 s6.13.4 - Common Functions |
| 572 | // OpenCL Extension v2.0 s5.1.3 and s6.1.3 - Common Functions |
| 573 | // --- Table 12 --- |
| 574 | // --- 1 argument --- |
| 575 | foreach name = ["degrees", "radians", "sign"] in { |
| 576 | def : Builtin<name, [FGenTypeN, FGenTypeN], Attr.Const>; |
| 577 | } |
| 578 | |
| 579 | // --- 2 arguments --- |
| 580 | foreach name = ["max", "min"] in { |
| 581 | def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN], Attr.Const>; |
| 582 | def : Builtin<name, [GenTypeFloatVecNoScalar, GenTypeFloatVecNoScalar, Float], Attr.Const>; |
| 583 | def : Builtin<name, [GenTypeDoubleVecNoScalar, GenTypeDoubleVecNoScalar, Double], Attr.Const>; |
| 584 | def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Half], Attr.Const>; |
| 585 | } |
| 586 | foreach name = ["step"] in { |
| 587 | def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN], Attr.Const>; |
| 588 | def : Builtin<name, [GenTypeFloatVecNoScalar, Float, GenTypeFloatVecNoScalar], Attr.Const>; |
| 589 | def : Builtin<name, [GenTypeDoubleVecNoScalar, Double, GenTypeDoubleVecNoScalar], Attr.Const>; |
| 590 | def : Builtin<name, [GenTypeHalfVecNoScalar, Half, GenTypeHalfVecNoScalar], Attr.Const>; |
| 591 | } |
| 592 | |
| 593 | // --- 3 arguments --- |
| 594 | foreach name = ["clamp", "mix"] in { |
| 595 | def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN, FGenTypeN], Attr.Const>; |
| 596 | def : Builtin<name, [GenTypeFloatVecNoScalar, GenTypeFloatVecNoScalar, Float, Float], Attr.Const>; |
| 597 | def : Builtin<name, [GenTypeDoubleVecNoScalar, GenTypeDoubleVecNoScalar, Double, Double], Attr.Const>; |
| 598 | def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Half, Half], Attr.Const>; |
| 599 | } |
| 600 | foreach name = ["smoothstep"] in { |
| 601 | def : Builtin<name, [FGenTypeN, FGenTypeN, FGenTypeN, FGenTypeN], Attr.Const>; |
| 602 | def : Builtin<name, [GenTypeFloatVecNoScalar, Float, Float, GenTypeFloatVecNoScalar], Attr.Const>; |
| 603 | def : Builtin<name, [GenTypeDoubleVecNoScalar, Double, Double, GenTypeDoubleVecNoScalar], Attr.Const>; |
| 604 | def : Builtin<name, [GenTypeHalfVecNoScalar, Half, Half, GenTypeHalfVecNoScalar], Attr.Const>; |
| 605 | } |
| 606 | |
| 607 | |
Sven van Haastregt | 3d30f2c | 2019-11-07 15:00:19 +0000 | [diff] [blame] | 608 | //-------------------------------------------------------------------- |
| 609 | // OpenCL v1.1 s6.11.5, v1.2 s6.12.5, v2.0 s6.13.5 - Geometric Functions |
| 610 | // OpenCL Extension v2.0 s5.1.4 and s6.1.4 - Geometric Functions |
| 611 | // --- Table 13 --- |
| 612 | // --- 1 argument --- |
| 613 | foreach name = ["length"] in { |
| 614 | def : Builtin<name, [Float, GenTypeFloatVec1234], Attr.Const>; |
| 615 | def : Builtin<name, [Double, GenTypeDoubleVec1234], Attr.Const>; |
| 616 | def : Builtin<name, [Half, GenTypeHalfVec1234], Attr.Const>; |
| 617 | } |
| 618 | foreach name = ["normalize"] in { |
| 619 | def : Builtin<name, [GenTypeFloatVec1234, GenTypeFloatVec1234], Attr.Const>; |
| 620 | def : Builtin<name, [GenTypeDoubleVec1234, GenTypeDoubleVec1234], Attr.Const>; |
| 621 | def : Builtin<name, [GenTypeHalfVec1234, GenTypeHalfVec1234], Attr.Const>; |
| 622 | } |
| 623 | foreach name = ["fast_length"] in { |
| 624 | def : Builtin<name, [Float, GenTypeFloatVec1234], Attr.Const>; |
| 625 | } |
| 626 | foreach name = ["fast_normalize"] in { |
| 627 | def : Builtin<name, [GenTypeFloatVec1234, GenTypeFloatVec1234], Attr.Const>; |
| 628 | } |
| 629 | |
| 630 | // --- 2 arguments --- |
| 631 | foreach name = ["cross"] in { |
| 632 | foreach VSize = [3, 4] in { |
| 633 | def : Builtin<name, [VectorType<Float, VSize>, VectorType<Float, VSize>, VectorType<Float, VSize>], Attr.Const>; |
| 634 | def : Builtin<name, [VectorType<Double, VSize>, VectorType<Double, VSize>, VectorType<Double, VSize>], Attr.Const>; |
| 635 | def : Builtin<name, [VectorType<Half, VSize>, VectorType<Half, VSize>, VectorType<Half, VSize>], Attr.Const>; |
| 636 | } |
| 637 | } |
| 638 | foreach name = ["dot", "distance"] in { |
| 639 | def : Builtin<name, [Float, GenTypeFloatVec1234, GenTypeFloatVec1234], Attr.Const>; |
| 640 | def : Builtin<name, [Double, GenTypeDoubleVec1234, GenTypeDoubleVec1234], Attr.Const>; |
| 641 | def : Builtin<name, [Half, GenTypeHalfVec1234, GenTypeHalfVec1234], Attr.Const>; |
| 642 | } |
| 643 | foreach name = ["fast_distance"] in { |
| 644 | def : Builtin<name, [Float, GenTypeFloatVec1234, GenTypeFloatVec1234], Attr.Const>; |
| 645 | } |
| 646 | |
| 647 | |
| 648 | //-------------------------------------------------------------------- |
| 649 | // OpenCL v1.1 s6.11.6, v1.2 s6.12.6, v2.0 s6.13.6 - Relational Functions |
| 650 | // OpenCL Extension v2.0 s5.1.5 and s6.1.5 - Relational Functions |
| 651 | // --- Table 14 --- |
| 652 | // --- 1 argument --- |
| 653 | foreach name = ["isfinite", "isinf", "isnan", "isnormal", "signbit"] in { |
| 654 | def : Builtin<name, [GenTypeIntVecAndScalar, GenTypeFloatVecAndScalar], Attr.Const>; |
| 655 | def : Builtin<name, [Int, Double], Attr.Const>; |
| 656 | def : Builtin<name, [GenTypeLongVecNoScalar, GenTypeDoubleVecNoScalar], Attr.Const>; |
| 657 | def : Builtin<name, [Int, Half], Attr.Const>; |
| 658 | def : Builtin<name, [GenTypeShortVecNoScalar, GenTypeHalfVecNoScalar], Attr.Const>; |
| 659 | } |
| 660 | foreach name = ["any", "all"] in { |
| 661 | def : Builtin<name, [Int, AIGenTypeN], Attr.Const>; |
| 662 | } |
| 663 | |
| 664 | // --- 2 arguments --- |
| 665 | foreach name = ["isequal", "isnotequal", "isgreater", "isgreaterequal", |
| 666 | "isless", "islessequal", "islessgreater", "isordered", |
| 667 | "isunordered"] in { |
| 668 | def : Builtin<name, [GenTypeIntVecAndScalar, GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar], Attr.Const>; |
| 669 | def : Builtin<name, [Int, Double, Double], Attr.Const>; |
| 670 | def : Builtin<name, [GenTypeLongVecNoScalar, GenTypeDoubleVecNoScalar, GenTypeDoubleVecNoScalar], Attr.Const>; |
| 671 | def : Builtin<name, [Int, Half, Half], Attr.Const>; |
| 672 | def : Builtin<name, [GenTypeShortVecNoScalar, GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar], Attr.Const>; |
| 673 | } |
| 674 | |
| 675 | // --- 3 arguments --- |
| 676 | foreach name = ["bitselect"] in { |
| 677 | def : Builtin<name, [AGenTypeN, AGenTypeN, AGenTypeN, AGenTypeN], Attr.Const>; |
| 678 | } |
| 679 | foreach name = ["select"] in { |
| 680 | def : Builtin<name, [SGenTypeN, SGenTypeN, SGenTypeN, SGenTypeN], Attr.Const>; |
| 681 | def : Builtin<name, [SGenTypeN, SGenTypeN, SGenTypeN, UGenTypeN], Attr.Const>; |
| 682 | def : Builtin<name, [UGenTypeN, UGenTypeN, UGenTypeN, UGenTypeN], Attr.Const>; |
| 683 | def : Builtin<name, [UGenTypeN, UGenTypeN, UGenTypeN, SGenTypeN], Attr.Const>; |
| 684 | def : Builtin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeIntVecAndScalar], Attr.Const>; |
| 685 | def : Builtin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeUIntVecAndScalar], Attr.Const>; |
| 686 | def : Builtin<name, [GenTypeDoubleVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeLongVecAndScalar], Attr.Const>; |
| 687 | def : Builtin<name, [GenTypeDoubleVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeULongVecAndScalar], Attr.Const>; |
| 688 | def : Builtin<name, [GenTypeHalfVecAndScalar, GenTypeHalfVecAndScalar, GenTypeHalfVecAndScalar, GenTypeShortVecAndScalar], Attr.Const>; |
| 689 | def : Builtin<name, [GenTypeHalfVecAndScalar, GenTypeHalfVecAndScalar, GenTypeHalfVecAndScalar, GenTypeUShortVecAndScalar], Attr.Const>; |
| 690 | } |
| 691 | |
| 692 | |
Sven van Haastregt | 2fe674b | 2019-11-13 10:16:33 +0000 | [diff] [blame] | 693 | //-------------------------------------------------------------------- |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 694 | // OpenCL v1.1 s6.11.7, v1.2 s6.12.7, v2.0 s6.13.7 - Vector Data Load and Store Functions |
Sven van Haastregt | 2fe674b | 2019-11-13 10:16:33 +0000 | [diff] [blame] | 695 | // OpenCL Extension v1.1 s9.3.6 and s9.6.6, v1.2 s9.5.6, v2.0 s5.1.6 and s6.1.6 - Vector Data Load and Store Functions |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 696 | // --- Table 15 --- |
| 697 | // Variants for OpenCL versions below 2.0, using pointers to the global, local |
| 698 | // and private address spaces. |
| 699 | let MaxVersion = CL20 in { |
| 700 | foreach AS = [GlobalAS, LocalAS, PrivateAS] in { |
| 701 | foreach VSize = [2, 3, 4, 8, 16] in { |
| 702 | foreach name = ["vload" # VSize] in { |
| 703 | def : Builtin<name, [VectorType<Char, VSize>, Size, PointerType<ConstType<Char>, AS>]>; |
| 704 | def : Builtin<name, [VectorType<UChar, VSize>, Size, PointerType<ConstType<UChar>, AS>]>; |
| 705 | def : Builtin<name, [VectorType<Short, VSize>, Size, PointerType<ConstType<Short>, AS>]>; |
| 706 | def : Builtin<name, [VectorType<UShort, VSize>, Size, PointerType<ConstType<UShort>, AS>]>; |
| 707 | def : Builtin<name, [VectorType<Int, VSize>, Size, PointerType<ConstType<Int>, AS>]>; |
| 708 | def : Builtin<name, [VectorType<UInt, VSize>, Size, PointerType<ConstType<UInt>, AS>]>; |
| 709 | def : Builtin<name, [VectorType<Long, VSize>, Size, PointerType<ConstType<Long>, AS>]>; |
| 710 | def : Builtin<name, [VectorType<ULong, VSize>, Size, PointerType<ConstType<ULong>, AS>]>; |
| 711 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Float>, AS>]>; |
| 712 | def : Builtin<name, [VectorType<Double, VSize>, Size, PointerType<ConstType<Double>, AS>]>; |
| 713 | def : Builtin<name, [VectorType<Half, VSize>, Size, PointerType<ConstType<Half>, AS>]>; |
| 714 | } |
| 715 | foreach name = ["vstore" # VSize] in { |
| 716 | def : Builtin<name, [Void, VectorType<Char, VSize>, Size, PointerType<ConstType<Char>, AS>]>; |
| 717 | def : Builtin<name, [Void, VectorType<UChar, VSize>, Size, PointerType<ConstType<UChar>, AS>]>; |
| 718 | def : Builtin<name, [Void, VectorType<Short, VSize>, Size, PointerType<ConstType<Short>, AS>]>; |
| 719 | def : Builtin<name, [Void, VectorType<UShort, VSize>, Size, PointerType<ConstType<UShort>, AS>]>; |
| 720 | def : Builtin<name, [Void, VectorType<Int, VSize>, Size, PointerType<ConstType<Int>, AS>]>; |
| 721 | def : Builtin<name, [Void, VectorType<UInt, VSize>, Size, PointerType<ConstType<UInt>, AS>]>; |
| 722 | def : Builtin<name, [Void, VectorType<Long, VSize>, Size, PointerType<ConstType<Long>, AS>]>; |
| 723 | def : Builtin<name, [Void, VectorType<ULong, VSize>, Size, PointerType<ConstType<ULong>, AS>]>; |
| 724 | def : Builtin<name, [Void, VectorType<Float, VSize>, Size, PointerType<ConstType<Float>, AS>]>; |
| 725 | def : Builtin<name, [Void, VectorType<Double, VSize>, Size, PointerType<ConstType<Double>, AS>]>; |
| 726 | def : Builtin<name, [Void, VectorType<Half, VSize>, Size, PointerType<ConstType<Half>, AS>]>; |
| 727 | } |
| 728 | foreach name = ["vloada_half" # VSize] in { |
| 729 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, AS>]>; |
| 730 | } |
| 731 | foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in { |
| 732 | foreach name = ["vstorea_half" # VSize # rnd] in { |
| 733 | def : Builtin<name, [Void, VectorType<Float, VSize>, Size, PointerType<Half, AS>]>; |
| 734 | def : Builtin<name, [Void, VectorType<Double, VSize>, Size, PointerType<Half, AS>]>; |
| 735 | } |
| 736 | } |
| 737 | } |
| 738 | } |
| 739 | } |
| 740 | // Variants for OpenCL versions above 2.0, using pointers to the generic |
| 741 | // address space. |
| 742 | let MinVersion = CL20 in { |
| 743 | foreach VSize = [2, 3, 4, 8, 16] in { |
| 744 | foreach name = ["vload" # VSize] in { |
| 745 | def : Builtin<name, [VectorType<Char, VSize>, Size, PointerType<ConstType<Char>, GenericAS>]>; |
| 746 | def : Builtin<name, [VectorType<UChar, VSize>, Size, PointerType<ConstType<UChar>, GenericAS>]>; |
| 747 | def : Builtin<name, [VectorType<Short, VSize>, Size, PointerType<ConstType<Short>, GenericAS>]>; |
| 748 | def : Builtin<name, [VectorType<UShort, VSize>, Size, PointerType<ConstType<UShort>, GenericAS>]>; |
| 749 | def : Builtin<name, [VectorType<Int, VSize>, Size, PointerType<ConstType<Int>, GenericAS>]>; |
| 750 | def : Builtin<name, [VectorType<UInt, VSize>, Size, PointerType<ConstType<UInt>, GenericAS>]>; |
| 751 | def : Builtin<name, [VectorType<Long, VSize>, Size, PointerType<ConstType<Long>, GenericAS>]>; |
| 752 | def : Builtin<name, [VectorType<ULong, VSize>, Size, PointerType<ConstType<ULong>, GenericAS>]>; |
| 753 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Float>, GenericAS>]>; |
| 754 | def : Builtin<name, [VectorType<Double, VSize>, Size, PointerType<ConstType<Double>, GenericAS>]>; |
| 755 | def : Builtin<name, [VectorType<Half, VSize>, Size, PointerType<ConstType<Half>, GenericAS>]>; |
| 756 | } |
| 757 | foreach name = ["vstore" # VSize] in { |
| 758 | def : Builtin<name, [Void, VectorType<Char, VSize>, Size, PointerType<ConstType<Char>, GenericAS>]>; |
| 759 | def : Builtin<name, [Void, VectorType<UChar, VSize>, Size, PointerType<ConstType<UChar>, GenericAS>]>; |
| 760 | def : Builtin<name, [Void, VectorType<Short, VSize>, Size, PointerType<ConstType<Short>, GenericAS>]>; |
| 761 | def : Builtin<name, [Void, VectorType<UShort, VSize>, Size, PointerType<ConstType<UShort>, GenericAS>]>; |
| 762 | def : Builtin<name, [Void, VectorType<Int, VSize>, Size, PointerType<ConstType<Int>, GenericAS>]>; |
| 763 | def : Builtin<name, [Void, VectorType<UInt, VSize>, Size, PointerType<ConstType<UInt>, GenericAS>]>; |
| 764 | def : Builtin<name, [Void, VectorType<Long, VSize>, Size, PointerType<ConstType<Long>, GenericAS>]>; |
| 765 | def : Builtin<name, [Void, VectorType<ULong, VSize>, Size, PointerType<ConstType<ULong>, GenericAS>]>; |
| 766 | def : Builtin<name, [Void, VectorType<Float, VSize>, Size, PointerType<ConstType<Float>, GenericAS>]>; |
| 767 | def : Builtin<name, [Void, VectorType<Double, VSize>, Size, PointerType<ConstType<Double>, GenericAS>]>; |
| 768 | def : Builtin<name, [Void, VectorType<Half, VSize>, Size, PointerType<ConstType<Half>, GenericAS>]>; |
| 769 | } |
| 770 | foreach name = ["vloada_half" # VSize] in { |
| 771 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, GenericAS>]>; |
| 772 | } |
| 773 | foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in { |
| 774 | foreach name = ["vstorea_half" # VSize # rnd] in { |
| 775 | def : Builtin<name, [Void, VectorType<Float, VSize>, Size, PointerType<Half, GenericAS>]>; |
| 776 | def : Builtin<name, [Void, VectorType<Double, VSize>, Size, PointerType<Half, GenericAS>]>; |
| 777 | } |
| 778 | } |
| 779 | } |
| 780 | } |
| 781 | // Variants using pointers to the constant address space. |
| 782 | foreach VSize = [2, 3, 4, 8, 16] in { |
| 783 | foreach name = ["vload" # VSize] in { |
| 784 | def : Builtin<name, [VectorType<Char, VSize>, Size, PointerType<ConstType<Char>, ConstantAS>]>; |
| 785 | def : Builtin<name, [VectorType<UChar, VSize>, Size, PointerType<ConstType<UChar>, ConstantAS>]>; |
| 786 | def : Builtin<name, [VectorType<Short, VSize>, Size, PointerType<ConstType<Short>, ConstantAS>]>; |
| 787 | def : Builtin<name, [VectorType<UShort, VSize>, Size, PointerType<ConstType<UShort>, ConstantAS>]>; |
| 788 | def : Builtin<name, [VectorType<Int, VSize>, Size, PointerType<ConstType<Int>, ConstantAS>]>; |
| 789 | def : Builtin<name, [VectorType<UInt, VSize>, Size, PointerType<ConstType<UInt>, ConstantAS>]>; |
| 790 | def : Builtin<name, [VectorType<Long, VSize>, Size, PointerType<ConstType<Long>, ConstantAS>]>; |
| 791 | def : Builtin<name, [VectorType<ULong, VSize>, Size, PointerType<ConstType<ULong>, ConstantAS>]>; |
| 792 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Float>, ConstantAS>]>; |
| 793 | def : Builtin<name, [VectorType<Double, VSize>, Size, PointerType<ConstType<Double>, ConstantAS>]>; |
| 794 | def : Builtin<name, [VectorType<Half, VSize>, Size, PointerType<ConstType<Half>, ConstantAS>]>; |
| 795 | } |
| 796 | foreach name = ["vloada_half" # VSize] in { |
| 797 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, ConstantAS>]>; |
| 798 | } |
| 799 | foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in { |
| 800 | foreach name = ["vstorea_half" # VSize # rnd] in { |
| 801 | def : Builtin<name, [Void, VectorType<Float, VSize>, Size, PointerType<Half, ConstantAS>]>; |
| 802 | def : Builtin<name, [Void, VectorType<Double, VSize>, Size, PointerType<Half, ConstantAS>]>; |
| 803 | } |
| 804 | } |
| 805 | } |
Sven van Haastregt | 2fe674b | 2019-11-13 10:16:33 +0000 | [diff] [blame] | 806 | let MaxVersion = CL20 in { |
| 807 | foreach AS = [GlobalAS, LocalAS, PrivateAS] in { |
| 808 | def : Builtin<"vload_half", [Float, Size, PointerType<ConstType<Half>, AS>]>; |
| 809 | foreach VSize = [2, 3, 4, 8, 16] in { |
| 810 | foreach name = ["vload_half" # VSize] in { |
| 811 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, AS>]>; |
| 812 | } |
| 813 | } |
| 814 | foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in { |
| 815 | def : Builtin<"vstore_half" # rnd, [Void, Float, Size, PointerType<Half, AS>]>; |
| 816 | def : Builtin<"vstore_half" # rnd, [Void, Double, Size, PointerType<Half, AS>]>; |
| 817 | foreach VSize = [2, 3, 4, 8, 16] in { |
| 818 | foreach name = ["vstore_half" # VSize # rnd] in { |
| 819 | def : Builtin<name, [Void, VectorType<Float, VSize>, Size, PointerType<Half, AS>]>; |
| 820 | def : Builtin<name, [Void, VectorType<Double, VSize>, Size, PointerType<Half, AS>]>; |
| 821 | } |
| 822 | } |
| 823 | } |
| 824 | } |
| 825 | } |
| 826 | let MinVersion = CL20 in { |
| 827 | foreach AS = [GenericAS] in { |
| 828 | def : Builtin<"vload_half", [Float, Size, PointerType<ConstType<Half>, AS>]>; |
| 829 | foreach VSize = [2, 3, 4, 8, 16] in { |
| 830 | foreach name = ["vload_half" # VSize] in { |
| 831 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, AS>]>; |
| 832 | } |
| 833 | } |
| 834 | foreach rnd = ["", "_rte", "_rtz", "_rtp", "_rtn"] in { |
| 835 | def : Builtin<"vstore_half" # rnd, [Void, Float, Size, PointerType<Half, AS>]>; |
| 836 | def : Builtin<"vstore_half" # rnd, [Void, Double, Size, PointerType<Half, AS>]>; |
| 837 | foreach VSize = [2, 3, 4, 8, 16] in { |
| 838 | foreach name = ["vstore_half" # VSize # rnd] in { |
| 839 | def : Builtin<name, [Void, VectorType<Float, VSize>, Size, PointerType<Half, AS>]>; |
| 840 | def : Builtin<name, [Void, VectorType<Double, VSize>, Size, PointerType<Half, AS>]>; |
| 841 | } |
| 842 | } |
| 843 | } |
| 844 | } |
| 845 | } |
| 846 | |
| 847 | foreach AS = [ConstantAS] in { |
| 848 | def : Builtin<"vload_half", [Float, Size, PointerType<ConstType<Half>, AS>]>; |
| 849 | foreach VSize = [2, 3, 4, 8, 16] in { |
| 850 | foreach name = ["vload_half" # VSize] in { |
| 851 | def : Builtin<name, [VectorType<Float, VSize>, Size, PointerType<ConstType<Half>, AS>]>; |
| 852 | } |
| 853 | } |
| 854 | } |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 855 | |
| 856 | //-------------------------------------------------------------------- |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 857 | // OpenCL v1.1 s6.11.10, v1.2 s6.12.10, v2.0 s6.13.10: Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch |
| 858 | // OpenCL Extension v2.0 s5.1.7 and s6.1.7: Async Copies from Global to Local Memory, Local to Global Memory, and Prefetch |
| 859 | // --- Table 18 --- |
| 860 | foreach name = ["async_work_group_copy"] in { |
| 861 | def : Builtin<name, [Event, PointerType<AGenTypeN, LocalAS>, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size, Event]>; |
| 862 | def : Builtin<name, [Event, PointerType<AGenTypeN, GlobalAS>, PointerType<ConstType<AGenTypeN>, LocalAS>, Size, Event]>; |
| 863 | } |
| 864 | foreach name = ["async_work_group_strided_copy"] in { |
| 865 | def : Builtin<name, [Event, PointerType<AGenTypeN, LocalAS>, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size, Size, Event]>; |
| 866 | def : Builtin<name, [Event, PointerType<AGenTypeN, GlobalAS>, PointerType<ConstType<AGenTypeN>, LocalAS>, Size, Size, Event]>; |
| 867 | } |
| 868 | foreach name = ["wait_group_events"] in { |
| 869 | def : Builtin<name, [Void, Int, PointerType<Event, GenericAS>]>; |
| 870 | } |
| 871 | foreach name = ["prefetch"] in { |
| 872 | def : Builtin<name, [Void, PointerType<ConstType<AGenTypeN>, GlobalAS>, Size]>; |
| 873 | } |
| 874 | |
| 875 | //-------------------------------------------------------------------- |
| 876 | // OpenCL v2.0 s6.13.11 - Atomics Functions. |
| 877 | // Functions that use memory_order and cl_mem_fence_flags enums are not |
| 878 | // declared here as the TableGen backend does not handle enums. |
| 879 | |
Sven van Haastregt | 308b8b7 | 2019-12-18 10:13:51 +0000 | [diff] [blame^] | 880 | // OpenCL v1.0 s9.5, s9.6, s9.7 - Atomic Functions for 32-bit integers |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 881 | // --- Table 9.1 --- |
Sven van Haastregt | 308b8b7 | 2019-12-18 10:13:51 +0000 | [diff] [blame^] | 882 | let Extension = FuncExtKhrGlobalInt32BaseAtomics in { |
| 883 | foreach Type = [Int, UInt] in { |
| 884 | foreach name = ["atom_add", "atom_sub", "atom_xchg"] in { |
| 885 | def : Builtin<name, [Type, PointerType<VolatileType<Type>, GlobalAS>, Type]>; |
| 886 | } |
| 887 | foreach name = ["atom_inc", "atom_dec"] in { |
| 888 | def : Builtin<name, [Type, PointerType<VolatileType<Type>, GlobalAS>]>; |
| 889 | } |
| 890 | foreach name = ["atom_cmpxchg"] in { |
| 891 | def : Builtin<name, [Type, PointerType<VolatileType<Type>, GlobalAS>, Type, Type]>; |
| 892 | } |
Sven van Haastregt | cc0ba28 | 2019-08-20 12:21:03 +0000 | [diff] [blame] | 893 | } |
| 894 | } |
| 895 | |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 896 | //-------------------------------------------------------------------- |
Sven van Haastregt | e54c83e | 2019-11-26 10:44:49 +0000 | [diff] [blame] | 897 | // OpenCL v1.1 s6.11.12, v1.2 s6.12.12, v2.0 s6.13.12 - Miscellaneous Vector Functions |
| 898 | // --- Table 19 --- |
| 899 | foreach name = ["shuffle"] in { |
| 900 | foreach VSize1 = [Vec2, Vec4, Vec8, Vec16] in { |
| 901 | foreach VSize2 = [Vec2, Vec4, Vec8, Vec16] in { |
| 902 | def : Builtin<name, [GenericType<"TLAll" # VSize1.Name, TLAll, VSize1>, |
| 903 | GenericType<"TLAll" # VSize2.Name, TLAll, VSize2>, |
| 904 | GenericType<"TLAllUnsigned" # VSize1.Name, TLAllUnsigned, VSize1>], |
| 905 | Attr.Const>; |
| 906 | } |
| 907 | } |
| 908 | } |
| 909 | foreach name = ["shuffle2"] in { |
| 910 | foreach VSize1 = [Vec2, Vec4, Vec8, Vec16] in { |
| 911 | foreach VSize2 = [Vec2, Vec4, Vec8, Vec16] in { |
| 912 | def : Builtin<name, [GenericType<"TLAll" # VSize1.Name, TLAll, VSize1>, |
| 913 | GenericType<"TLAll" # VSize2.Name, TLAll, VSize2>, |
| 914 | GenericType<"TLAll" # VSize2.Name, TLAll, VSize2>, |
| 915 | GenericType<"TLAllUnsigned" # VSize1.Name, TLAllUnsigned, VSize1>], |
| 916 | Attr.Const>; |
| 917 | } |
| 918 | } |
| 919 | } |
| 920 | |
| 921 | //-------------------------------------------------------------------- |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 922 | // OpenCL v1.1 s6.11.3, v1.2 s6.12.14, v2.0 s6.13.14: Image Read and Write Functions |
| 923 | // OpenCL Extension v2.0 s5.1.8 and s6.1.8: Image Read and Write Functions |
| 924 | // --- Table 22: Image Read Functions with Samplers --- |
| 925 | foreach imgTy = [Image1d] in { |
| 926 | foreach coordTy = [Int, Float] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 927 | def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, "RO">, Sampler, coordTy], Attr.Pure>; |
| 928 | def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, "RO">, Sampler, coordTy], Attr.Pure>; |
| 929 | def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, "RO">, Sampler, coordTy], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 930 | } |
| 931 | } |
| 932 | foreach imgTy = [Image2d, Image1dArray] in { |
| 933 | foreach coordTy = [Int, Float] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 934 | def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, "RO">, Sampler, VectorType<coordTy, 2>], Attr.Pure>; |
| 935 | def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, "RO">, Sampler, VectorType<coordTy, 2>], Attr.Pure>; |
| 936 | def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, "RO">, Sampler, VectorType<coordTy, 2>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 937 | } |
| 938 | } |
| 939 | foreach imgTy = [Image3d, Image2dArray] in { |
| 940 | foreach coordTy = [Int, Float] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 941 | def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, "RO">, Sampler, VectorType<coordTy, 4>], Attr.Pure>; |
| 942 | def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, "RO">, Sampler, VectorType<coordTy, 4>], Attr.Pure>; |
| 943 | def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, "RO">, Sampler, VectorType<coordTy, 4>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 944 | } |
| 945 | } |
| 946 | foreach coordTy = [Int, Float] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 947 | def : Builtin<"read_imagef", [Float, ImageType<Image2dDepth, "RO">, Sampler, VectorType<coordTy, 2>], Attr.Pure>; |
| 948 | def : Builtin<"read_imagef", [Float, ImageType<Image2dArrayDepth, "RO">, Sampler, VectorType<coordTy, 4>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 949 | } |
| 950 | |
| 951 | // --- Table 23: Sampler-less Read Functions --- |
| 952 | foreach aQual = ["RO", "RW"] in { |
| 953 | foreach imgTy = [Image2d, Image1dArray] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 954 | def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>; |
| 955 | def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>; |
| 956 | def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 957 | } |
| 958 | foreach imgTy = [Image3d, Image2dArray] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 959 | def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>; |
| 960 | def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>; |
| 961 | def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 962 | } |
| 963 | foreach imgTy = [Image1d, Image1dBuffer] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 964 | def : Builtin<"read_imagef", [VectorType<Float, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>; |
| 965 | def : Builtin<"read_imagei", [VectorType<Int, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>; |
| 966 | def : Builtin<"read_imageui", [VectorType<UInt, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 967 | } |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 968 | def : Builtin<"read_imagef", [Float, ImageType<Image2dDepth, aQual>, VectorType<Int, 2>], Attr.Pure>; |
| 969 | def : Builtin<"read_imagef", [Float, ImageType<Image2dArrayDepth, aQual>, VectorType<Int, 4>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 970 | } |
| 971 | |
| 972 | // --- Table 24: Image Write Functions --- |
| 973 | foreach aQual = ["WO", "RW"] in { |
| 974 | foreach imgTy = [Image2d] in { |
| 975 | def : Builtin<"write_imagef", [Void, ImageType<imgTy, aQual>, VectorType<Int, 2>, VectorType<Float, 4>]>; |
| 976 | def : Builtin<"write_imagei", [Void, ImageType<imgTy, aQual>, VectorType<Int, 2>, VectorType<Int, 4>]>; |
| 977 | def : Builtin<"write_imageui", [Void, ImageType<imgTy, aQual>, VectorType<Int, 2>, VectorType<UInt, 4>]>; |
| 978 | } |
| 979 | foreach imgTy = [Image2dArray] in { |
| 980 | def : Builtin<"write_imagef", [Void, ImageType<imgTy, aQual>, VectorType<Int, 4>, VectorType<Float, 4>]>; |
| 981 | def : Builtin<"write_imagei", [Void, ImageType<imgTy, aQual>, VectorType<Int, 4>, VectorType<Int, 4>]>; |
| 982 | def : Builtin<"write_imageui", [Void, ImageType<imgTy, aQual>, VectorType<Int, 4>, VectorType<UInt, 4>]>; |
| 983 | } |
| 984 | foreach imgTy = [Image1d, Image1dBuffer] in { |
| 985 | def : Builtin<"write_imagef", [Void, ImageType<imgTy, aQual>, Int, VectorType<Float, 4>]>; |
| 986 | def : Builtin<"write_imagei", [Void, ImageType<imgTy, aQual>, Int, VectorType<Int, 4>]>; |
| 987 | def : Builtin<"write_imageui", [Void, ImageType<imgTy, aQual>, Int, VectorType<UInt, 4>]>; |
| 988 | } |
| 989 | foreach imgTy = [Image1dArray] in { |
| 990 | def : Builtin<"write_imagef", [Void, ImageType<imgTy, aQual>, VectorType<Int, 2>, VectorType<Float, 4>]>; |
| 991 | def : Builtin<"write_imagei", [Void, ImageType<imgTy, aQual>, VectorType<Int, 2>, VectorType<Int, 4>]>; |
| 992 | def : Builtin<"write_imageui", [Void, ImageType<imgTy, aQual>, VectorType<Int, 2>, VectorType<UInt, 4>]>; |
| 993 | } |
| 994 | foreach imgTy = [Image3d] in { |
| 995 | def : Builtin<"write_imagef", [Void, ImageType<imgTy, aQual>, VectorType<Int, 4>, VectorType<Float, 4>]>; |
| 996 | def : Builtin<"write_imagei", [Void, ImageType<imgTy, aQual>, VectorType<Int, 4>, VectorType<Int, 4>]>; |
| 997 | def : Builtin<"write_imageui", [Void, ImageType<imgTy, aQual>, VectorType<Int, 4>, VectorType<UInt, 4>]>; |
| 998 | } |
| 999 | def : Builtin<"write_imagef", [Void, ImageType<Image2dDepth, aQual>, VectorType<Int, 2>, Float]>; |
| 1000 | def : Builtin<"write_imagef", [Void, ImageType<Image2dArrayDepth, aQual>, VectorType<Int, 4>, Float]>; |
| 1001 | } |
| 1002 | |
Sven van Haastregt | 2a69ed0 | 2019-09-25 09:12:59 +0000 | [diff] [blame] | 1003 | // --- Table 25: Image Query Functions --- |
| 1004 | foreach aQual = ["RO", "WO", "RW"] in { |
| 1005 | foreach imgTy = [Image1d, Image1dBuffer, Image2d, Image3d, |
| 1006 | Image1dArray, Image2dArray, Image2dDepth, |
| 1007 | Image2dArrayDepth] in { |
| 1008 | foreach name = ["get_image_width", "get_image_channel_data_type", |
| 1009 | "get_image_channel_order"] in { |
| 1010 | def : Builtin<name, [Int, ImageType<imgTy, aQual>]>; |
| 1011 | } |
| 1012 | } |
| 1013 | foreach imgTy = [Image2d, Image3d, Image2dArray, Image2dDepth, |
| 1014 | Image2dArrayDepth] in { |
| 1015 | def : Builtin<"get_image_height", [Int, ImageType<imgTy, aQual>]>; |
| 1016 | } |
| 1017 | def : Builtin<"get_image_depth", [Int, ImageType<Image3d, aQual>]>; |
| 1018 | foreach imgTy = [Image2d, Image2dArray, Image2dDepth, |
| 1019 | Image2dArrayDepth] in { |
| 1020 | def : Builtin<"get_image_dim", [VectorType<Int, 2>, ImageType<imgTy, aQual>]>; |
| 1021 | } |
| 1022 | def : Builtin<"get_image_dim", [VectorType<Int, 4>, ImageType<Image3d, aQual>]>; |
| 1023 | foreach imgTy = [Image1dArray, Image2dArray, Image2dArrayDepth] in { |
| 1024 | def : Builtin<"get_image_array_size", [Size, ImageType<imgTy, aQual>]>; |
| 1025 | } |
| 1026 | } |
| 1027 | |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 1028 | // OpenCL extension v2.0 s5.1.9: Built-in Image Read Functions |
| 1029 | // --- Table 8 --- |
| 1030 | foreach aQual = ["RO"] in { |
| 1031 | foreach name = ["read_imageh"] in { |
| 1032 | foreach coordTy = [Int, Float] in { |
| 1033 | foreach imgTy = [Image2d, Image1dArray] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 1034 | def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<coordTy, 2>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 1035 | } |
| 1036 | foreach imgTy = [Image3d, Image2dArray] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 1037 | def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<coordTy, 4>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 1038 | } |
| 1039 | foreach imgTy = [Image1d] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 1040 | def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Sampler, coordTy], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 1041 | } |
| 1042 | } |
| 1043 | } |
| 1044 | } |
| 1045 | // OpenCL extension v2.0 s5.1.10: Built-in Image Sampler-less Read Functions |
| 1046 | // --- Table 9 --- |
| 1047 | foreach aQual = ["RO", "RW"] in { |
| 1048 | foreach name = ["read_imageh"] in { |
| 1049 | foreach imgTy = [Image2d, Image1dArray] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 1050 | def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 1051 | } |
| 1052 | foreach imgTy = [Image3d, Image2dArray] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 1053 | def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 1054 | } |
| 1055 | foreach imgTy = [Image1d, Image1dBuffer] in { |
Sven van Haastregt | 9a8d477 | 2019-11-05 10:07:43 +0000 | [diff] [blame] | 1056 | def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>; |
Sven van Haastregt | 988f1e3 | 2019-09-05 10:01:24 +0000 | [diff] [blame] | 1057 | } |
| 1058 | } |
| 1059 | } |
| 1060 | // OpenCL extension v2.0 s5.1.11: Built-in Image Write Functions |
| 1061 | // --- Table 10 --- |
| 1062 | foreach aQual = ["WO", "RW"] in { |
| 1063 | foreach name = ["write_imageh"] in { |
| 1064 | def : Builtin<name, [Void, ImageType<Image2d, aQual>, VectorType<Int, 2>, VectorType<Half, 4>]>; |
| 1065 | def : Builtin<name, [Void, ImageType<Image2dArray, aQual>, VectorType<Int, 4>, VectorType<Half, 4>]>; |
| 1066 | def : Builtin<name, [Void, ImageType<Image1d, aQual>, Int, VectorType<Half, 4>]>; |
| 1067 | def : Builtin<name, [Void, ImageType<Image1dBuffer, aQual>, Int, VectorType<Half, 4>]>; |
| 1068 | def : Builtin<name, [Void, ImageType<Image1dArray, aQual>, VectorType<Int, 2>, VectorType<Half, 4>]>; |
| 1069 | def : Builtin<name, [Void, ImageType<Image3d, aQual>, VectorType<Int, 4>, VectorType<Half, 4>]>; |
| 1070 | } |
| 1071 | } |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 1072 | |
| 1073 | |
Sven van Haastregt | e54c83e | 2019-11-26 10:44:49 +0000 | [diff] [blame] | 1074 | //-------------------------------------------------------------------- |
| 1075 | // OpenCL v2.0 s6.13.15 - Work-group Functions |
| 1076 | // --- Table 26 --- |
| 1077 | let MinVersion = CL20 in { |
| 1078 | foreach name = ["work_group_all", "work_group_any"] in { |
| 1079 | def : Builtin<name, [Int, Int], Attr.Convergent>; |
| 1080 | } |
| 1081 | foreach name = ["work_group_broadcast"] in { |
| 1082 | def : Builtin<name, [IntLongFloatGenType1, IntLongFloatGenType1, Size], Attr.Convergent>; |
| 1083 | def : Builtin<name, [IntLongFloatGenType1, IntLongFloatGenType1, Size, Size], Attr.Convergent>; |
| 1084 | def : Builtin<name, [IntLongFloatGenType1, IntLongFloatGenType1, Size, Size, Size], Attr.Convergent>; |
| 1085 | } |
| 1086 | foreach op = ["add", "min", "max"] in { |
| 1087 | foreach name = ["work_group_reduce_", "work_group_scan_exclusive_", |
| 1088 | "work_group_scan_inclusive_"] in { |
| 1089 | def : Builtin<name # op, [IntLongFloatGenType1, IntLongFloatGenType1], Attr.Convergent>; |
| 1090 | } |
| 1091 | } |
| 1092 | } |
| 1093 | |
| 1094 | |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 1095 | // OpenCL v2.0 s9.17.3: Additions to section 6.13.1: Work-Item Functions |
Sven van Haastregt | ed69faa | 2019-09-19 13:41:51 +0000 | [diff] [blame] | 1096 | let MinVersion = CL20 in { |
Sven van Haastregt | 308b8b7 | 2019-12-18 10:13:51 +0000 | [diff] [blame^] | 1097 | let Extension = FuncExtKhrSubgroups in { |
Sven van Haastregt | 89fb9e8 | 2019-07-29 14:55:29 +0000 | [diff] [blame] | 1098 | def get_sub_group_size : Builtin<"get_sub_group_size", [UInt]>; |
| 1099 | def get_max_sub_group_size : Builtin<"get_max_sub_group_size", [UInt]>; |
| 1100 | def get_num_sub_groups : Builtin<"get_num_sub_groups", [UInt]>; |
Sven van Haastregt | 79a222f | 2019-06-03 09:39:11 +0000 | [diff] [blame] | 1101 | } |
| 1102 | } |