diff --git a/clang/lib/Sema/OpenCLBuiltins.td b/clang/lib/Sema/OpenCLBuiltins.td index 03235985ab42f..1f9a7390cd148 100644 --- a/clang/lib/Sema/OpenCLBuiltins.td +++ b/clang/lib/Sema/OpenCLBuiltins.td @@ -343,15 +343,10 @@ def MemoryScope : EnumType<"memory_scope">; 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]>; @@ -1141,21 +1136,33 @@ let MinVersion = CL20 in { //-------------------------------------------------------------------- // 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, + VectorType, + VectorType], + 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, + VectorType, + VectorType, + VectorType], + Attr.Const>; + } } }