Lines Matching +full:half +full:- +full:bit

1 //==--- OpenCLBuiltins.td - OpenCL builtin declarations -------------------===//
7 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9 //===----------------------------------------------------------------------===//
13 // check for a function described in this file when -fdeclare-opencl-builtins
16 //===----------------------------------------------------------------------===//
18 //===----------------------------------------------------------------------===//
20 //===----------------------------------------------------------------------===//
60 // Concatenate zero or more space-separated extensions in NewExts to Base and
143 class QualType<string _TypeExpr, bit _IsAbstract=0> {
150 bit IsAbstract = _IsAbstract;
159 //===----------------------------------------------------------------------===//
161 //===----------------------------------------------------------------------===//
173 bit IsPointer = 0;
175 bit IsConst = 0;
177 bit IsVolatile = 0;
282 // GenT1 = GenericType<half, [1, 2]> and
285 // f(half, float), f(half2, float2), f(half, int), f(half2, int2) .
289 // GenT = GenericType<half, int, [1, 2]> and
290 // SGenT = GenericType<half, int, [1]>
292 // f(half, half), f(half2, half), f(int, int), f(int2, int) .
305 list<bit> None = [0, 0, 0];
306 list<bit> Pure = [1, 0, 0];
307 list<bit> Const = [0, 1, 0];
308 list<bit> Convergent = [0, 0, 1];
311 //===----------------------------------------------------------------------===//
313 //===----------------------------------------------------------------------===//
314 class Builtin<string _Name, list<Type> _Signature, list<bit> _Attributes = Attr.None> {
322 bit IsPure = _Attributes[0];
324 bit IsConst = _Attributes[1];
326 bit IsConv = _Attributes[2];
338 //===----------------------------------------------------------------------===//
340 //===----------------------------------------------------------------------===//
342 // OpenCL v1.0/1.2/2.0 s6.1.1: Built-in Scalar Data Types.
357 // The half type for builtins that require the cl_khr_fp16 extension.
359 def Half : Type<"half", QualType<"Context.HalfTy">>;
362 // Without the cl_khr_fp16 extension, the half type can only be used to declare
363 // a pointer. Define const and non-const pointer types in all address spaces.
365 // (extensionless) pointee type of these pointer-to-half types from the "half"
378 // OpenCL v1.0/1.2/2.0 s6.1.2: Built-in Vector Data Types.
379 // Built-in vector data types are created by TableGen's OpenCLBuiltinEmitter.
381 // OpenCL v1.0/1.2/2.0 s6.1.3: Other Built-in Data Types.
406 // OpenCL v2.0 s6.13.11: Atomic integer and floating-point types.
427 //===----------------------------------------------------------------------===//
429 //===----------------------------------------------------------------------===//
444 … : TypeList<[Char, UChar, Short, UShort, Int, UInt, Long, ULong, Float, Double, Half]>;
445 def TLFloat : TypeList<[Float, Double, Half]>;
449 def TLIntLongFloats : TypeList<[Int, UInt, Long, ULong, Float, Double, Half]>;
486 Float, Double, Half] in {
495 foreach Type = [Float, Double, Half] in {
502 //===----------------------------------------------------------------------===//
504 //===----------------------------------------------------------------------===//
505 //--------------------------------------------------------------------
506 // OpenCL v1.1/1.2/2.0 s6.2.3 - Explicit conversions.
507 // OpenCL v2.0 Extensions s5.1.1 and s6.1.1 - Conversions.
510 foreach RType = [Float, Double, Half, Char, UChar, Short,
512 foreach IType = [Float, Double, Half, Char, UChar, Short,
514 // Conversions to integer type have a sat and non-sat variant.
517 !eq(RType.Name, "half") : [""],
532 //--------------------------------------------------------------------
533 // OpenCL v1.1 s6.11.1, v1.2 s6.12.1, v2.0 s6.13.1 - Work-item Functions
534 // --- Table 7 ---
550 //--------------------------------------------------------------------
551 // OpenCL v1.1 s6.11.2, v1.2 s6.12.2, v2.0 s6.13.2 - Math functions
552 // OpenCL Extension v2.0 s5.1.2 and s6.1.2 - Math Functions
553 // --- Table 8 ---
554 // --- 1 argument ---
578 // --- 2 arguments ---
588 def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Half], Attr.Const>;
609 // --- 3 arguments ---
641 // --- Table 9 ---
659 //--------------------------------------------------------------------
660 // OpenCL v1.1 s6.11.3, v1.2 s6.12.3, v2.0 s6.13.3 - Integer Functions
661 // --- Table 10 ---
662 // --- 1 argument ---
676 // --- 2 arguments ---
696 // --- 3 arguments ---
705 // --- Table 11 ---
715 //--------------------------------------------------------------------
716 // OpenCL v1.1 s6.11.4, v1.2 s6.12.4, v2.0 s6.13.4 - Common Functions
717 // OpenCL Extension v2.0 s5.1.3 and s6.1.3 - Common Functions
718 // --- Table 12 ---
719 // --- 1 argument ---
724 // --- 2 arguments ---
729 def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Half], Attr.Const>;
735 def : Builtin<name, [GenTypeHalfVecNoScalar, Half, GenTypeHalfVecNoScalar], Attr.Const>;
738 // --- 3 arguments ---
743 def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Half, Half], Attr.Const>;
749 …def : Builtin<name, [GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar, Half]…
755 def : Builtin<name, [GenTypeHalfVecNoScalar, Half, Half, GenTypeHalfVecNoScalar], Attr.Const>;
759 //--------------------------------------------------------------------
760 // OpenCL v1.1 s6.11.5, v1.2 s6.12.5, v2.0 s6.13.5 - Geometric Functions
761 // OpenCL Extension v2.0 s5.1.4 and s6.1.4 - Geometric Functions
762 // --- Table 13 ---
763 // --- 1 argument ---
767 def : Builtin<name, [Half, GenTypeHalfVec1234], Attr.Const>;
781 // --- 2 arguments ---
786 …def : Builtin<name, [VectorType<Half, VSize>, VectorType<Half, VSize>, VectorType<Half, VSize>], A…
792 def : Builtin<name, [Half, GenTypeHalfVec1234, GenTypeHalfVec1234], Attr.Const>;
799 //--------------------------------------------------------------------
800 // OpenCL v1.1 s6.11.6, v1.2 s6.12.6, v2.0 s6.13.6 - Relational Functions
801 // OpenCL Extension v2.0 s5.1.5 and s6.1.5 - Relational Functions
802 // --- Table 14 ---
803 // --- 1 argument ---
808 def : Builtin<name, [Int, Half], Attr.Const>;
815 // --- 2 arguments ---
822 def : Builtin<name, [Int, Half, Half], Attr.Const>;
826 // --- 3 arguments ---
844 //--------------------------------------------------------------------
845 // OpenCL v1.1 s6.11.7, v1.2 s6.12.7, v2.0 s6.13.7 - Vector Data Load and Store Functions
846 // 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 …
847 // --- Table 15 ---
848 multiclass VloadVstore<list<AddressSpace> addrspaces, bit defStores> {
862 … def : Builtin<name, [VectorType<Half, VSize>, Size, PointerType<ConstType<Half>, AS>], Attr.Pure>;
876 def : Builtin<name, [Void, VectorType<Half, VSize>, Size, PointerType<Half, AS>]>;
892 multiclass VloadVstoreHalf<list<AddressSpace> addrspaces, bit defStores> {
926 // OpenCL v3.0 s6.15.8 - Synchronization Functions.
933 // OpenCL v3.0 s6.15.9 - Legacy Explicit Memory Fence Functions.
938 // OpenCL v3.0 s6.15.10 - Address Space Qualifier Functions.
943 // type or user-defined type, which cannot be represented currently. Hence we slightly diverge
949 //--------------------------------------------------------------------
952 // --- Table 18 ---
968 //--------------------------------------------------------------------
969 // OpenCL v2.0 s6.13.11 - Atomics Functions.
973 // OpenCL v1.0 s9.5, s9.6, s9.7 - Atomic Functions for 32-bit integers
974 // --- Table 9.1 ---
988 // --- Table 9.3 ---
1002 // --- Table 9.5 ---
1018 // --- Table 9.2 ---
1027 // --- Table 9.4 ---
1036 // --- Table 9.6 ---
1047 // OpenCL v1.1 s6.11.1, v1.2 s6.12.11 - Atomic Functions
1081 // OpenCL v2.0 s6.13.11 - Atomic Functions.
1179 [Half, PointerType<VolatileType<AtomicHalf>, addrspace>], extension_fp16>;
1181 [Half, PointerType<VolatileType<AtomicHalf>, addrspace>, Half], extension_fp16>;
1189 [Half, PointerType<VolatileType<AtomicHalf>, addrspace>, Half], extension_fp16>;
1202 [Half, PointerType<VolatileType<AtomicHalf>, addrspace>, Half], extension_fp16>;
1211 //--------------------------------------------------------------------
1212 // OpenCL v1.1 s6.11.12, v1.2 s6.12.12, v2.0 s6.13.12 - Miscellaneous Vector Functions
1213 // --- Table 19 ---
1220 [Float, UInt], [Double, ULong], [Half, UShort]] in {
1234 [Float, UInt], [Double, ULong], [Half, UShort]] in {
1244 //--------------------------------------------------------------------
1247 // --- Table 22: Image Read Functions with Samplers ---
1274 // --- Table 23: Sampler-less Read Functions ---
1302 // --- Table 24: Image Write Functions ---
1338 // --- Table 25: Image Query Functions ---
1369 // OpenCL extension v2.0 s5.1.9: Built-in Image Read Functions
1370 // --- Table 8 ---
1375 …def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<coordTy, 2>…
1378 …def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Sampler, VectorType<coordTy, 4>…
1381 … def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Sampler, coordTy], Attr.Pure>;
1386 // OpenCL extension v2.0 s5.1.10: Built-in Image Sampler-less Read Functions
1387 // --- Table 9 ---
1392 …def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, VectorType<Int, 2>], Attr.Pure>;
1395 …def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, VectorType<Int, 4>], Attr.Pure>;
1398 def : Builtin<name, [VectorType<Half, 4>, ImageType<imgTy, aQual>, Int], Attr.Pure>;
1407 // OpenCL extension v2.0 s5.1.11: Built-in Image Write Functions
1408 // --- Table 10 ---
1411 def : Builtin<name, [Void, ImageType<Image2d, aQual>, VectorType<Int, 2>, VectorType<Half, 4>]>;
1412 …def : Builtin<name, [Void, ImageType<Image2dArray, aQual>, VectorType<Int, 4>, VectorType<Half, 4>…
1413 def : Builtin<name, [Void, ImageType<Image1d, aQual>, Int, VectorType<Half, 4>]>;
1414 def : Builtin<name, [Void, ImageType<Image1dBuffer, aQual>, Int, VectorType<Half, 4>]>;
1415 …def : Builtin<name, [Void, ImageType<Image1dArray, aQual>, VectorType<Int, 2>, VectorType<Half, 4>…
1416 def : Builtin<name, [Void, ImageType<Image3d, aQual>, VectorType<Int, 4>, VectorType<Half, 4>]>;
1427 //--------------------------------------------------------------------
1428 // OpenCL v2.0 s6.13.15 - Work-group Functions
1429 // --- Table 26 ---
1448 //--------------------------------------------------------------------
1450 // --- Table 27 ---
1453 // --- Table 28 ---
1459 // --- Table 29 ---
1463 //--------------------------------------------------------------------
1465 // --- Table 30 ---
1468 // --- Table 32 ---
1471 // --- Table 33 ---
1476 // --- Table 34 ---
1485 // --- Table 35 ---
1506 //--------------------------------------------------------------------
1509 //--------------------------------------------------------------------
1512 // OpenCL Extension v2.0 s9.18 - Mipmaps
1648 //--------------------------------------------------------------------
1649 // OpenCL Extension v2.0 s18.3 - Creating OpenCL Memory Objects from OpenGL MSAA Textures
1650 // --- Table 6.13.14.3 ---
1668 // --- Table 6.13.14.5 ---
1691 //--------------------------------------------------------------------
1692 // OpenCL Extension v2.0 s28 - Subgroups
1693 // --- Table 28.2.1 ---
1707 // --- Table 28.2.2 ---
1715 // --- Table 28.2.4 ---
1731 // OpenCL Extension v3.0 s38 - Extended Subgroup Functions
1733 // Section 38.4.1 - cl_khr_subgroup_extended_types
1737 // gentype may additionally be one of the supported built-in vector data types.
1748 // Section 38.5.1 - cl_khr_subgroup_non_uniform_vote
1756 // Section 38.6.1 - cl_khr_subgroup_ballot
1774 // Section 38.7.1 - cl_khr_subgroup_non_uniform_arithmetic
1789 // Section 38.8.1 - cl_khr_subgroup_shuffle
1795 // Section 38.9.1 - cl_khr_subgroup_shuffle_relative
1801 // Section 38.10.1 - cl_khr_subgroup_clustered_reduce
1814 // Section 40.3.1 - cl_khr_extended_bit_ops
1824 // Section 42.3 - cl_khr_integer_dot_product
1849 // Section 48.3 - cl_khr_subgroup_rotate
1869 //--------------------------------------------------------------------