def VecAndScalar: IntList<"VecAndScalar", [1, 2, 3, 4, 8, 16]>;
def VecNoScalar : IntList<"VecNoScalar", [2, 3, 4, 8, 16]>;
def Vec1 : IntList<"Vec1", [1]>;
-def Vec2 : IntList<"Vec2", [2]>;
-def Vec4 : IntList<"Vec4", [4]>;
-def Vec8 : IntList<"Vec8", [8]>;
-def Vec16 : IntList<"Vec16", [16]>;
def Vec1234 : IntList<"Vec1234", [1, 2, 3, 4]>;
// Type lists.
def TLAll : TypeList<[Char, UChar, Short, UShort, Int, UInt, Long, ULong, Float, Double, Half]>;
-def TLAllUnsigned : TypeList<[UChar, UChar, UShort, UShort, UInt, UInt, ULong, ULong, UInt, ULong, UShort]>;
def TLFloat : TypeList<[Float, Double, Half]>;
def TLSignedInts : TypeList<[Char, Short, Int, Long]>;
def TLUnsignedInts : TypeList<[UChar, UShort, UInt, ULong]>;
//--------------------------------------------------------------------
// OpenCL v1.1 s6.11.12, v1.2 s6.12.12, v2.0 s6.13.12 - Miscellaneous Vector Functions
// --- Table 19 ---
-foreach VSize1 = [Vec2, Vec4, Vec8, Vec16] in {
- foreach VSize2 = [Vec2, Vec4, Vec8, Vec16] in {
- def : Builtin<"shuffle", [GenericType<"TLAll" # VSize1.Name, TLAll, VSize1>,
- GenericType<"TLAll" # VSize2.Name, TLAll, VSize2>,
- GenericType<"TLAllUnsigned" # VSize1.Name, TLAllUnsigned, VSize1>],
- Attr.Const>;
- }
-}
-foreach VSize1 = [Vec2, Vec4, Vec8, Vec16] in {
- foreach VSize2 = [Vec2, Vec4, Vec8, Vec16] in {
- def : Builtin<"shuffle2", [GenericType<"TLAll" # VSize1.Name, TLAll, VSize1>,
- GenericType<"TLAll" # VSize2.Name, TLAll, VSize2>,
- GenericType<"TLAll" # VSize2.Name, TLAll, VSize2>,
- GenericType<"TLAllUnsigned" # VSize1.Name, TLAllUnsigned, VSize1>],
- Attr.Const>;
+foreach VSize1 = [2, 4, 8, 16] in {
+ foreach VSize2 = [2, 4, 8, 16] in {
+ foreach VecAndMaskType = [[Char, UChar], [UChar, UChar],
+ [Short, UShort], [UShort, UShort],
+ [Int, UInt], [UInt, UInt],
+ [Long, ULong], [ULong, ULong],
+ [Float, UInt], [Double, ULong], [Half, UShort]] in {
+ def : Builtin<"shuffle", [VectorType<VecAndMaskType[0], VSize1>,
+ VectorType<VecAndMaskType[0], VSize2>,
+ VectorType<VecAndMaskType[1], VSize1>],
+ Attr.Const>;
+ }
+ }
+}
+foreach VSize1 = [2, 4, 8, 16] in {
+ foreach VSize2 = [2, 4, 8, 16] in {
+ foreach VecAndMaskType = [[Char, UChar], [UChar, UChar],
+ [Short, UShort], [UShort, UShort],
+ [Int, UInt], [UInt, UInt],
+ [Long, ULong], [ULong, ULong],
+ [Float, UInt], [Double, ULong], [Half, UShort]] in {
+ def : Builtin<"shuffle2", [VectorType<VecAndMaskType[0], VSize1>,
+ VectorType<VecAndMaskType[0], VSize2>,
+ VectorType<VecAndMaskType[0], VSize2>,
+ VectorType<VecAndMaskType[1], VSize1>],
+ Attr.Const>;
+ }
}
}