Skip to content

Commit 8f7f946

Browse files
authored
Reapply "[libspirv] Define schar overloads via remangling; not source
This reapplies commit 23584c1. It also includes changes from #18807 which attempt to address the issues that led to the original revert. We were previously achieving the signed char builtin definitions in libspirv via one of two ways. The first was explicitly definining schar overloads of builtins in the source. The second was by remangling 'char' builtins to one of schar or uchar, depending on the host platform. Since we are defining our builtins in OpenCL C, the plain 'char' type is already a signed type. This presents us with the opportunity to achieve our desired schar builtins solely through remangling. The primary idea is to reduce our libclc/libspirv diff with upstream. We also have the option to introduce signed char builtins upstream. As it stands the schar problem isn't far from the 'half' mangling problem that we also now deal with purely in the remangler.
1 parent 8b2cf52 commit 8f7f946

File tree

45 files changed

+335
-497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+335
-497
lines changed

clang/lib/Sema/SPIRVBuiltins.td

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,7 @@ class ConstOCLSPVBuiltin<string _Name, list<Type> _Signature> :
321321

322322
// OpenCL v1.0/1.2/2.0 s6.1.1: Built-in Scalar Data Types.
323323
def Bool : IntType<"bool", QualType<"Context.BoolTy">, 1>;
324-
def TrueChar : IntType<"_char", QualType<"Context.CharTy", 0, 1>, 8>;
325-
def Char : IntType<"char", QualType<"Context.SignedCharTy", 0, 1>, 8>;
324+
def Char : IntType<"char", QualType<"Context.CharTy", 0, 1>, 8>;
326325
def SChar : IntType<"schar", QualType<"Context.SignedCharTy", 0, 1>, 8>;
327326
def UChar : UIntType<"uchar", QualType<"Context.UnsignedCharTy">, 8>;
328327
def Short : IntType<"short", QualType<"Context.ShortTy", 0, 1>, 16>;
@@ -356,19 +355,20 @@ def Vec16 : IntList<"Vec16", [16]>;
356355
def Vec1234 : IntList<"Vec1234", [1, 2, 3, 4]>;
357356

358357
// Type lists.
359-
def TLAll : TypeList<[Char, UChar, Short, UShort, Int, UInt, Long, ULong, Float, Double, Half]>;
360-
def TLAllUnsigned : TypeList<[UChar, UChar, UShort, UShort, UInt, UInt, ULong, ULong, UInt, ULong, UShort]>;
361-
def TLAllWithBool : TypeList<[Bool, Char, UChar, Short, UShort, Int, UInt, Long,
358+
def TLAll : TypeList<[Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong, Float, Double, Half]>;
359+
def TLAllUnsigned : TypeList<[UChar, UChar, UChar, UShort, UShort, UInt, UInt, ULong, ULong, UInt, ULong, UShort]>;
360+
def TLAllWithBool : TypeList<[Bool, Char, SChar, UChar, Short, UShort, Int, UInt, Long,
362361
ULong, Float, Double, Half]>;
363362
def TLFloat : TypeList<[Float, Double, Half]>;
364363
// FIXME: handle properly char (signed or unsigned depending on host)
365-
def TLSignedInts : TypeList<[Char, Short, Int, Long]>;
366-
def TLUnsignedInts : TypeList<[UChar, UShort, UInt, ULong]>;
364+
def TLSignedInts : TypeList<[Char, SChar, Short, Int, Long]>;
365+
def TLUIToSIInts : TypeList<[UChar, UChar, UShort, UInt, ULong]>;
366+
def TLUnsignedInts : TypeList<[UChar, UShort, UInt, ULong]>;
367367

368368
// Signed to Unsigned conversion
369369
// FIXME: handle properly char (signed or unsigned depending on host)
370-
def TLSToUSignedInts : TypeList<[Char, Short, Int, Long]>;
371-
def TLSToUUnsignedInts : TypeList<[UChar, UShort, UInt, ULong]>;
370+
def TLSToUSignedInts : TypeList<[Char, SChar, Short, Int, Long]>;
371+
def TLSToUUnsignedInts : TypeList<[UChar, UChar, UShort, UInt, ULong]>;
372372

373373
def TLIntLongFloats : TypeList<[Int, UInt, Long, ULong, Float, Double, Half]>;
374374

@@ -377,7 +377,7 @@ def TLIntLongFloats : TypeList<[Int, UInt, Long, ULong, Float, Double, Half]>;
377377
// uchar abs(uchar).
378378
def TLAllUIntsTwice : TypeList<[UChar, UChar, UChar, UShort, UShort, UInt, UInt, ULong, ULong]>;
379379

380-
def TLAllInts : TypeList<[Char, UChar, Short, UShort, Int, UInt, Long, ULong]>;
380+
def TLAllInts : TypeList<[Char, SChar, UChar, Short, UShort, Int, UInt, Long, ULong]>;
381381

382382
// GenType definitions for multiple base types (e.g. all floating point types,
383383
// or all integer types).
@@ -394,6 +394,8 @@ def AIGenType1 : GenericType<"AIGenType1", TLAllInts, Vec1>;
394394
def AIGenTypeN : GenericType<"AIGenTypeN", TLAllInts, VecAndScalar>;
395395
def AUIGenTypeN : GenericType<"AUIGenTypeN", TLUnsignedInts, VecAndScalar>;
396396
def ASIGenTypeN : GenericType<"ASIGenTypeN", TLSignedInts, VecAndScalar>;
397+
// unsigned integers matching 1:1 with signed ints
398+
def AUIToSIGenTypeN : GenericType<"AUIToSIGenTypeN", TLUIToSIInts, VecAndScalar>;
397399
def AIGenTypeNNoScalar : GenericType<"AIGenTypeNNoScalar", TLAllInts, VecNoScalar>;
398400
// All integer to unsigned
399401
def AI2UGenTypeN : GenericType<"AI2UGenTypeN", TLAllUIntsTwice, VecAndScalar>;
@@ -403,6 +405,7 @@ def SGenTypeN : GenericType<"SGenTypeN", TLSignedInts, VecAndScalar
403405
// Unsigned integer
404406
def UGenType1 : GenericType<"UGenType1", TLUnsignedInts, Vec1>;
405407
def UGenTypeN : GenericType<"UGenTypeN", TLUnsignedInts, VecAndScalar>;
408+
def UToSGenTypeN : GenericType<"UToSGenTypeN", TLUIToSIInts, VecAndScalar>;
406409
def UInt4 : GenericType<"UInt4", TypeList<[UInt]>, Vec4>;
407410
// Float
408411
def FGenType1 : GenericType<"FGenType1", TLFloat, Vec1>;
@@ -412,7 +415,7 @@ def IntLongFloatGenType1 : GenericType<"IntLongFloatGenType1", TLIntLongFloats
412415

413416
// GenType definitions for every single base type (e.g. fp32 only).
414417
// Names are like: GenTypeFloatVecAndScalar.
415-
foreach Type = [Char, UChar, SChar, Short, UShort,
418+
foreach Type = [Char, SChar, UChar, Short, UShort,
416419
Int, UInt, Long, ULong,
417420
Float, Double, Half] in {
418421
foreach VecSizes = [VecAndScalar, VecNoScalar] in {
@@ -550,9 +553,9 @@ foreach name = ["clz", "ctz", "popcount"] in {
550553

551554
def : ConstOCLSPVBuiltin<"rotate", [AIGenTypeN, AIGenTypeN, AIGenTypeN]>;
552555

553-
def : ConstOCLSPVBuiltin<"s_abs", [AUIGenTypeN, ASIGenTypeN]>;
556+
def : ConstOCLSPVBuiltin<"s_abs", [AUIToSIGenTypeN, ASIGenTypeN]>;
554557

555-
def : ConstOCLSPVBuiltin<"s_abs_diff", [AUIGenTypeN, ASIGenTypeN, ASIGenTypeN]>;
558+
def : ConstOCLSPVBuiltin<"s_abs_diff", [AUIToSIGenTypeN, ASIGenTypeN, ASIGenTypeN]>;
556559

557560
foreach name = ["s_add_sat",
558561
"s_hadd", "s_rhadd",
@@ -652,9 +655,9 @@ def : ConstOCLSPVBuiltin<"bitselect", [AGenTypeN, AGenTypeN, AGenTypeN, AGenType
652655

653656
foreach name = ["select"] in {
654657
def : ConstOCLSPVBuiltin<name, [SGenTypeN, SGenTypeN, SGenTypeN, SGenTypeN]>;
655-
def : ConstOCLSPVBuiltin<name, [SGenTypeN, SGenTypeN, SGenTypeN, UGenTypeN]>;
658+
def : ConstOCLSPVBuiltin<name, [SGenTypeN, SGenTypeN, SGenTypeN, UToSGenTypeN]>;
656659
def : ConstOCLSPVBuiltin<name, [UGenTypeN, UGenTypeN, UGenTypeN, UGenTypeN]>;
657-
def : ConstOCLSPVBuiltin<name, [UGenTypeN, UGenTypeN, UGenTypeN, SGenTypeN]>;
660+
def : ConstOCLSPVBuiltin<name, [UToSGenTypeN, UToSGenTypeN, UToSGenTypeN, SGenTypeN]>;
658661
def : ConstOCLSPVBuiltin<name, [GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeFloatVecAndScalar, GenTypeUIntVecAndScalar]>;
659662
def : ConstOCLSPVBuiltin<name, [GenTypeDoubleVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeDoubleVecAndScalar, GenTypeULongVecAndScalar]>;
660663
def : ConstOCLSPVBuiltin<name, [GenTypeHalfVecAndScalar, GenTypeHalfVecAndScalar, GenTypeHalfVecAndScalar, GenTypeUShortVecAndScalar]>;
@@ -872,16 +875,16 @@ foreach name = ["Dot"] in {
872875
}
873876

874877
foreach name = ["Any", "All"] in {
875-
def : SPVBuiltin<name, [Bool, GenTypeSCharVecNoScalar], Attr.Const>;
878+
def : SPVBuiltin<name, [Bool, GenTypeCharVecNoScalar], Attr.Const>;
876879
}
877880

878881
foreach name = ["IsNan", "IsInf", "IsFinite", "IsNormal", "SignBitSet"] in {
879882
def : SPVBuiltin<name, [Bool, Float], Attr.Const>;
880883
def : SPVBuiltin<name, [Bool, Double], Attr.Const>;
881884
def : SPVBuiltin<name, [Bool, Half], Attr.Const>;
882-
def : SPVBuiltin<name, [GenTypeSCharVecNoScalar, GenTypeFloatVecNoScalar], Attr.Const>;
883-
def : SPVBuiltin<name, [GenTypeSCharVecNoScalar, GenTypeDoubleVecNoScalar], Attr.Const>;
884-
def : SPVBuiltin<name, [GenTypeSCharVecNoScalar, GenTypeHalfVecNoScalar], Attr.Const>;
885+
def : SPVBuiltin<name, [GenTypeCharVecNoScalar, GenTypeFloatVecNoScalar], Attr.Const>;
886+
def : SPVBuiltin<name, [GenTypeCharVecNoScalar, GenTypeDoubleVecNoScalar], Attr.Const>;
887+
def : SPVBuiltin<name, [GenTypeCharVecNoScalar, GenTypeHalfVecNoScalar], Attr.Const>;
885888
}
886889

887890
foreach name = ["LessOrGreater",
@@ -895,9 +898,9 @@ foreach name = ["LessOrGreater",
895898
def : SPVBuiltin<name, [Bool, Float, Float], Attr.Const>;
896899
def : SPVBuiltin<name, [Bool, Double, Double], Attr.Const>;
897900
def : SPVBuiltin<name, [Bool, Half, Half], Attr.Const>;
898-
def : SPVBuiltin<name, [GenTypeSCharVecNoScalar, GenTypeFloatVecNoScalar, GenTypeFloatVecNoScalar], Attr.Const>;
899-
def : SPVBuiltin<name, [GenTypeSCharVecNoScalar, GenTypeDoubleVecNoScalar, GenTypeDoubleVecNoScalar], Attr.Const>;
900-
def : SPVBuiltin<name, [GenTypeSCharVecNoScalar, GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar], Attr.Const>;
901+
def : SPVBuiltin<name, [GenTypeCharVecNoScalar, GenTypeFloatVecNoScalar, GenTypeFloatVecNoScalar], Attr.Const>;
902+
def : SPVBuiltin<name, [GenTypeCharVecNoScalar, GenTypeDoubleVecNoScalar, GenTypeDoubleVecNoScalar], Attr.Const>;
903+
def : SPVBuiltin<name, [GenTypeCharVecNoScalar, GenTypeHalfVecNoScalar, GenTypeHalfVecNoScalar], Attr.Const>;
901904
}
902905

903906
foreach name = ["BitCount"] in {
@@ -989,7 +992,7 @@ foreach name = ["GroupLogicalAndKHR", "GroupLogicalOrKHR"] in {
989992

990993
def SubgroupShuffleINTELVecType
991994
: GenericType<"SubgroupShuffleINTELVecType",
992-
TypeList<[Char, UChar, Short, UShort, Int, UInt, Float]>,
995+
TypeList<[Char, SChar, UChar, Short, UShort, Int, UInt, Float]>,
993996
VecNoScalar>;
994997

995998
foreach name = ["SubgroupShuffleINTEL", "SubgroupShuffleXorINTEL"] in {

clang/test/CodeGenSPIRV/spirv-builtin-lookup-group-non-uniform.cpp

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ template <class T> void test_logical() {
189189
void test() {
190190
test_with_bool<bool>();
191191
test_with_bool<char>();
192+
test_with_bool<signed char>();
192193
test_with_bool<unsigned char>();
193194
test_with_bool<short>();
194195
test_with_bool<unsigned short>();
@@ -199,13 +200,15 @@ void test() {
199200
test_with_bool<double>();
200201

201202
test_integer<char>();
203+
test_integer<signed char>();
202204
test_integer<unsigned char>();
203205
test_integer<short>();
204206
test_integer<unsigned short>();
205207
test_integer<int>();
206208
test_integer<unsigned int>();
207209

208210
test_signed<char>();
211+
test_signed<signed char>();
209212
test_signed<short>();
210213
test_signed<int>();
211214

@@ -232,13 +235,20 @@ void test() {
232235
// CHECK: call noundef zeroext i1 @_Z33__spirv_GroupNonUniformShuffleXoribj
233236
// CHECK: call noundef zeroext i1 @_Z32__spirv_GroupNonUniformShuffleUpibj
234237
// CHECK: call noundef zeroext i1 @_Z34__spirv_GroupNonUniformShuffleDownibj
235-
// CHECK: call noundef zeroext i1 @_Z31__spirv_GroupNonUniformAllEqualii
236-
// CHECK: call noundef i32 @_Z32__spirv_GroupNonUniformBroadcastiij
237-
// CHECK: call noundef i32 @_Z37__spirv_GroupNonUniformBroadcastFirstii
238-
// CHECK: call noundef i32 @_Z30__spirv_GroupNonUniformShuffleiij
239-
// CHECK: call noundef i32 @_Z33__spirv_GroupNonUniformShuffleXoriij
240-
// CHECK: call noundef i32 @_Z32__spirv_GroupNonUniformShuffleUpiij
241-
// CHECK: call noundef i32 @_Z34__spirv_GroupNonUniformShuffleDowniij
238+
// CHECK: call noundef zeroext i1 @_Z31__spirv_GroupNonUniformAllEqualic
239+
// CHECK: call noundef signext i8 @_Z32__spirv_GroupNonUniformBroadcasticj
240+
// CHECK: call noundef signext i8 @_Z37__spirv_GroupNonUniformBroadcastFirstic
241+
// CHECK: call noundef signext i8 @_Z30__spirv_GroupNonUniformShuffleicj
242+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformShuffleXoricj
243+
// CHECK: call noundef signext i8 @_Z32__spirv_GroupNonUniformShuffleUpicj
244+
// CHECK: call noundef signext i8 @_Z34__spirv_GroupNonUniformShuffleDownicj
245+
// CHECK: call noundef zeroext i1 @_Z31__spirv_GroupNonUniformAllEqualia
246+
// CHECK: call noundef signext i8 @_Z32__spirv_GroupNonUniformBroadcastiaj
247+
// CHECK: call noundef signext i8 @_Z37__spirv_GroupNonUniformBroadcastFirstia
248+
// CHECK: call noundef signext i8 @_Z30__spirv_GroupNonUniformShuffleiaj
249+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformShuffleXoriaj
250+
// CHECK: call noundef signext i8 @_Z32__spirv_GroupNonUniformShuffleUpiaj
251+
// CHECK: call noundef signext i8 @_Z34__spirv_GroupNonUniformShuffleDowniaj
242252
// CHECK: call noundef zeroext i1 @_Z31__spirv_GroupNonUniformAllEqualih
243253
// CHECK: call noundef zeroext i8 @_Z32__spirv_GroupNonUniformBroadcastihj
244254
// CHECK: call noundef zeroext i8 @_Z37__spirv_GroupNonUniformBroadcastFirstih
@@ -295,16 +305,26 @@ void test() {
295305
// CHECK: call noundef double @_Z33__spirv_GroupNonUniformShuffleXoridj
296306
// CHECK: call noundef double @_Z32__spirv_GroupNonUniformShuffleUpidj
297307
// CHECK: call noundef double @_Z34__spirv_GroupNonUniformShuffleDownidj
298-
// CHECK: call noundef i32 @_Z27__spirv_GroupNonUniformIAddiii
299-
// CHECK: call noundef i32 @_Z27__spirv_GroupNonUniformIAddiiij
300-
// CHECK: call noundef i32 @_Z27__spirv_GroupNonUniformIMuliii
301-
// CHECK: call noundef i32 @_Z27__spirv_GroupNonUniformIMuliiij
302-
// CHECK: call noundef i32 @_Z33__spirv_GroupNonUniformBitwiseAndiii
303-
// CHECK: call noundef i32 @_Z33__spirv_GroupNonUniformBitwiseAndiiij
304-
// CHECK: call noundef i32 @_Z32__spirv_GroupNonUniformBitwiseOriii
305-
// CHECK: call noundef i32 @_Z32__spirv_GroupNonUniformBitwiseOriiij
306-
// CHECK: call noundef i32 @_Z33__spirv_GroupNonUniformBitwiseXoriii
307-
// CHECK: call noundef i32 @_Z33__spirv_GroupNonUniformBitwiseXoriiij
308+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformIAddiic
309+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformIAddiicj
310+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformIMuliic
311+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformIMuliicj
312+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformBitwiseAndiic
313+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformBitwiseAndiicj
314+
// CHECK: call noundef signext i8 @_Z32__spirv_GroupNonUniformBitwiseOriic
315+
// CHECK: call noundef signext i8 @_Z32__spirv_GroupNonUniformBitwiseOriicj
316+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformBitwiseXoriic
317+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformBitwiseXoriicj
318+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformIAddiia
319+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformIAddiiaj
320+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformIMuliia
321+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformIMuliiaj
322+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformBitwiseAndiia
323+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformBitwiseAndiiaj
324+
// CHECK: call noundef signext i8 @_Z32__spirv_GroupNonUniformBitwiseOriia
325+
// CHECK: call noundef signext i8 @_Z32__spirv_GroupNonUniformBitwiseOriiaj
326+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformBitwiseXoriia
327+
// CHECK: call noundef signext i8 @_Z33__spirv_GroupNonUniformBitwiseXoriiaj
308328
// CHECK: call noundef zeroext i8 @_Z27__spirv_GroupNonUniformIAddiih
309329
// CHECK: call noundef zeroext i8 @_Z27__spirv_GroupNonUniformIAddiihj
310330
// CHECK: call noundef zeroext i8 @_Z27__spirv_GroupNonUniformIMuliih
@@ -355,10 +375,14 @@ void test() {
355375
// CHECK: call noundef i32 @_Z32__spirv_GroupNonUniformBitwiseOriijj
356376
// CHECK: call noundef i32 @_Z33__spirv_GroupNonUniformBitwiseXoriij
357377
// CHECK: call noundef i32 @_Z33__spirv_GroupNonUniformBitwiseXoriijj
358-
// CHECK: call noundef i32 @_Z27__spirv_GroupNonUniformSMiniii
359-
// CHECK: call noundef i32 @_Z27__spirv_GroupNonUniformSMiniiij
360-
// CHECK: call noundef i32 @_Z27__spirv_GroupNonUniformSMaxiii
361-
// CHECK: call noundef i32 @_Z27__spirv_GroupNonUniformSMaxiiij
378+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformSMiniic
379+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformSMiniicj
380+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformSMaxiic
381+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformSMaxiicj
382+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformSMiniia
383+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformSMiniiaj
384+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformSMaxiia
385+
// CHECK: call noundef signext i8 @_Z27__spirv_GroupNonUniformSMaxiiaj
362386
// CHECK: call noundef signext i16 @_Z27__spirv_GroupNonUniformSMiniis
363387
// CHECK: call noundef signext i16 @_Z27__spirv_GroupNonUniformSMiniisj
364388
// CHECK: call noundef signext i16 @_Z27__spirv_GroupNonUniformSMaxiis

clang/test/CodeGenSPIRV/spirv-builtin-lookup-group.cl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ bool group_any(bool predicate) {
2727

2828
char group_broad_cast(char a) {
2929
// CHECK-LABEL: @group_broad_cast(
30-
// CHECK: call spir_func i32 @_Z22__spirv_GroupBroadcastiij(
30+
// CHECK: call spir_func signext i8 @_Z22__spirv_GroupBroadcasticj(
3131
return __spirv_GroupBroadcast(2, a, 0u);
3232
}
3333

@@ -87,7 +87,7 @@ unsigned long group_umax(unsigned long a) {
8787

8888
char group_smin(char a) {
8989
// CHECK-LABEL: @group_smin(
90-
// CHECK: call spir_func i32 @_Z17__spirv_GroupSMiniii(
90+
// CHECK: call spir_func signext i8 @_Z17__spirv_GroupSMiniic(
9191
return __spirv_GroupSMin(2, 0, a);
9292
}
9393

libclc/clc/include/clc/clc_as_type.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#define __CLC_CLC_AS_TYPE_H__
1111

1212
#define __clc_as_char(x) __builtin_astype(x, char)
13-
#define __clc_as_schar(x) __builtin_astype(x, schar)
1413
#define __clc_as_uchar(x) __builtin_astype(x, uchar)
1514
#define __clc_as_short(x) __builtin_astype(x, short)
1615
#define __clc_as_ushort(x) __builtin_astype(x, ushort)
@@ -21,7 +20,6 @@
2120
#define __clc_as_float(x) __builtin_astype(x, float)
2221

2322
#define __clc_as_char2(x) __builtin_astype(x, char2)
24-
#define __clc_as_schar2(x) __builtin_astype(x, schar2)
2523
#define __clc_as_uchar2(x) __builtin_astype(x, uchar2)
2624
#define __clc_as_short2(x) __builtin_astype(x, short2)
2725
#define __clc_as_ushort2(x) __builtin_astype(x, ushort2)
@@ -32,7 +30,6 @@
3230
#define __clc_as_float2(x) __builtin_astype(x, float2)
3331

3432
#define __clc_as_char3(x) __builtin_astype(x, char3)
35-
#define __clc_as_schar3(x) __builtin_astype(x, schar3)
3633
#define __clc_as_uchar3(x) __builtin_astype(x, uchar3)
3734
#define __clc_as_short3(x) __builtin_astype(x, short3)
3835
#define __clc_as_ushort3(x) __builtin_astype(x, ushort3)
@@ -43,7 +40,6 @@
4340
#define __clc_as_float3(x) __builtin_astype(x, float3)
4441

4542
#define __clc_as_char4(x) __builtin_astype(x, char4)
46-
#define __clc_as_schar4(x) __builtin_astype(x, schar4)
4743
#define __clc_as_uchar4(x) __builtin_astype(x, uchar4)
4844
#define __clc_as_short4(x) __builtin_astype(x, short4)
4945
#define __clc_as_ushort4(x) __builtin_astype(x, ushort4)
@@ -54,9 +50,7 @@
5450
#define __clc_as_float4(x) __builtin_astype(x, float4)
5551

5652
#define __clc_as_char8(x) __builtin_astype(x, char8)
57-
#define __clc_as_schar8(x) __builtin_astype(x, schar8)
5853
#define __clc_as_uchar8(x) __builtin_astype(x, uchar8)
59-
#define __clc_as_schar8(x) __builtin_astype(x, schar8)
6054
#define __clc_as_short8(x) __builtin_astype(x, short8)
6155
#define __clc_as_ushort8(x) __builtin_astype(x, ushort8)
6256
#define __clc_as_int8(x) __builtin_astype(x, int8)
@@ -66,7 +60,6 @@
6660
#define __clc_as_float8(x) __builtin_astype(x, float8)
6761

6862
#define __clc_as_char16(x) __builtin_astype(x, char16)
69-
#define __clc_as_schar16(x) __builtin_astype(x, schar16)
7063
#define __clc_as_uchar16(x) __builtin_astype(x, uchar16)
7164
#define __clc_as_short16(x) __builtin_astype(x, short16)
7265
#define __clc_as_ushort16(x) __builtin_astype(x, ushort16)

libclc/clc/include/clc/clc_convert.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
#define _CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX) \
2626
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, char, SUFFIX) \
27-
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, schar, SUFFIX) \
2827
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, uchar, SUFFIX) \
2928
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, int, SUFFIX) \
3029
_CLC_VECTOR_CONVERT_DECL(FROM_TYPE, uint, SUFFIX) \
@@ -58,7 +57,6 @@
5857

5958
#define _CLC_VECTOR_CONVERT_TO1(SUFFIX) \
6059
_CLC_VECTOR_CONVERT_FROM(char, SUFFIX) \
61-
_CLC_VECTOR_CONVERT_FROM(schar, SUFFIX) \
6260
_CLC_VECTOR_CONVERT_FROM(uchar, SUFFIX) \
6361
_CLC_VECTOR_CONVERT_FROM(int, SUFFIX) \
6462
_CLC_VECTOR_CONVERT_FROM(uint, SUFFIX) \

libclc/clc/include/clc/clctypes.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
/* 6.1.1 Built-in Scalar Data Types */
1313

14-
typedef signed char schar;
1514
typedef unsigned char uchar;
1615
typedef unsigned short ushort;
1716
typedef unsigned int uint;
@@ -40,12 +39,6 @@ typedef __attribute__((ext_vector_type(4))) char char4;
4039
typedef __attribute__((ext_vector_type(8))) char char8;
4140
typedef __attribute__((ext_vector_type(16))) char char16;
4241

43-
typedef __attribute__((ext_vector_type(2))) schar schar2;
44-
typedef __attribute__((ext_vector_type(3))) schar schar3;
45-
typedef __attribute__((ext_vector_type(4))) schar schar4;
46-
typedef __attribute__((ext_vector_type(8))) schar schar8;
47-
typedef __attribute__((ext_vector_type(16))) schar schar16;
48-
4942
typedef __attribute__((ext_vector_type(2))) uchar uchar2;
5043
typedef __attribute__((ext_vector_type(3))) uchar uchar3;
5144
typedef __attribute__((ext_vector_type(4))) uchar uchar4;

0 commit comments

Comments
 (0)