Skip to content

Commit 75f19e4

Browse files
author
Greg Roth
committed
Purge short and long from tests
Future uncertain. Better to test with native HLSL types anyway
1 parent eeb3165 commit 75f19e4

File tree

4 files changed

+56
-56
lines changed

4 files changed

+56
-56
lines changed

clang/test/CodeGenHLSL/Types/BuiltinMatrix/matrix-cast-template.hlsl

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ void CastCharMatrixToUnsignedIntCStyle() {
3838
// CHECK-NEXT: ret void
3939

4040
matrix_4_4<int16_t> c;
41-
matrix_4_4<unsigned int> u;
42-
u = (matrix_4_4<unsigned int>)c;
41+
matrix_4_4<uint> u;
42+
u = (matrix_4_4<uint>)c;
4343
}
4444

4545
// CHECK-LABEL: define {{.*}}CastCharMatrixToUnsignedIntStaticCast
@@ -50,8 +50,8 @@ void CastCharMatrixToUnsignedIntStaticCast() {
5050
// CHECK-NEXT: ret void
5151

5252
matrix_4_4<int16_t> c;
53-
matrix_4_4<unsigned int> u;
54-
u = static_cast<matrix_4_4<unsigned int>>(c);
53+
matrix_4_4<uint> u;
54+
u = static_cast<matrix_4_4<uint>>(c);
5555
}
5656

5757
// CHECK-LABEL: define {{.*}}CastUnsignedLongIntMatrixToShortCStyle
@@ -61,9 +61,9 @@ void CastUnsignedLongIntMatrixToShortCStyle() {
6161
// CHECK-NEXT: store <16 x i16> [[CONV]], ptr {{.*}}, align 2
6262
// CHECK-NEXT: ret void
6363

64-
matrix_4_4<unsigned long int> u;
65-
matrix_4_4<short int> s;
66-
s = (matrix_4_4<short int>)u;
64+
matrix_4_4<uint64_t> u;
65+
matrix_4_4<int16_t> s;
66+
s = (matrix_4_4<int16_t>)u;
6767
}
6868

6969
// CHECK-LABEL: define {{.*}}CastUnsignedLongIntMatrixToShortStaticCast
@@ -73,9 +73,9 @@ void CastUnsignedLongIntMatrixToShortStaticCast() {
7373
// CHECK-NEXT: store <16 x i16> [[CONV]], ptr {{.*}}, align 2
7474
// CHECK-NEXT: ret void
7575

76-
matrix_4_4<unsigned long int> u;
77-
matrix_4_4<short int> s;
78-
s = static_cast<matrix_4_4<short int>>(u);
76+
matrix_4_4<uint64_t> u;
77+
matrix_4_4<int16_t> s;
78+
s = static_cast<matrix_4_4<int16_t>>(u);
7979
}
8080

8181
// CHECK-LABEL: define {{.*}}CastIntMatrixToShortCStyle
@@ -86,8 +86,8 @@ void CastIntMatrixToShortCStyle() {
8686
// CHECK-NEXT: ret void
8787

8888
matrix_4_4<int> i;
89-
matrix_4_4<short int> s;
90-
s = (matrix_4_4<short int>)i;
89+
matrix_4_4<int16_t> s;
90+
s = (matrix_4_4<int16_t>)i;
9191
}
9292

9393
// CHECK-LABEL: define {{.*}}CastIntMatrixToShortStaticCast
@@ -98,8 +98,8 @@ void CastIntMatrixToShortStaticCast() {
9898
// CHECK-NEXT: ret void
9999

100100
matrix_4_4<int> i;
101-
matrix_4_4<short int> s;
102-
s = static_cast<matrix_4_4<short int>>(i);
101+
matrix_4_4<int16_t> s;
102+
s = static_cast<matrix_4_4<int16_t>>(i);
103103
}
104104

105105
// CHECK-LABEL: define {{.*}}CastIntMatrixToFloatCStyle
@@ -133,7 +133,7 @@ void CastUnsignedIntMatrixToFloatCStyle() {
133133
// CHECK-NEXT: store <16 x float> [[CONV]], ptr {{.*}}, align 4
134134
// CHECK-NEXT: ret void
135135

136-
matrix_4_4<unsigned short int> u;
136+
matrix_4_4<uint16_t> u;
137137
matrix_4_4<float> f;
138138
f = (matrix_4_4<float>)u;
139139
}
@@ -145,7 +145,7 @@ void CastUnsignedIntMatrixToFloatStaticCast() {
145145
// CHECK-NEXT: store <16 x float> [[CONV]], ptr {{.*}}, align 4
146146
// CHECK-NEXT: ret void
147147

148-
matrix_4_4<unsigned short int> u;
148+
matrix_4_4<uint16_t> u;
149149
matrix_4_4<float> f;
150150
f = static_cast<matrix_4_4<float>>(u);
151151
}
@@ -182,8 +182,8 @@ void CastFloatMatrixToUnsignedShortIntCStyle() {
182182
// CHECK-NEXT: ret void
183183

184184
matrix_4_4<float> f;
185-
matrix_4_4<unsigned short int> i;
186-
i = (matrix_4_4<unsigned short int>)f;
185+
matrix_4_4<uint16_t> i;
186+
i = (matrix_4_4<uint16_t>)f;
187187
}
188188

189189
// CHECK-LABEL: define {{.*}}CastFloatMatrixToUnsignedShortIntStaticCast
@@ -194,8 +194,8 @@ void CastFloatMatrixToUnsignedShortIntStaticCast() {
194194
// CHECK-NEXT: ret void
195195

196196
matrix_4_4<float> f;
197-
matrix_4_4<unsigned short int> i;
198-
i = static_cast<matrix_4_4<unsigned short int>>(f);
197+
matrix_4_4<uint16_t> i;
198+
i = static_cast<matrix_4_4<uint16_t>>(f);
199199
}
200200

201201
// CHECK-LABEL: define {{.*}}CastDoubleMatrixToFloatCStyle
@@ -229,9 +229,9 @@ void CastUnsignedShortIntToUnsignedIntCStyle() {
229229
// CHECK-NEXT: store <16 x i32> [[CONV]], ptr {{.*}}, align 4
230230
// CHECK-NEXT: ret void
231231

232-
matrix_4_4<unsigned short int> s;
233-
matrix_4_4<unsigned int> i;
234-
i = (matrix_4_4<unsigned int>)s;
232+
matrix_4_4<uint16_t> s;
233+
matrix_4_4<uint> i;
234+
i = (matrix_4_4<uint>)s;
235235
}
236236

237237
// CHECK-LABEL: define {{.*}}CastUnsignedShortIntToUnsignedIntStaticCast
@@ -241,9 +241,9 @@ void CastUnsignedShortIntToUnsignedIntStaticCast() {
241241
// CHECK-NEXT: store <16 x i32> [[CONV]], ptr {{.*}}, align 4
242242
// CHECK-NEXT: ret void
243243

244-
matrix_4_4<unsigned short int> s;
245-
matrix_4_4<unsigned int> i;
246-
i = static_cast<matrix_4_4<unsigned int>>(s);
244+
matrix_4_4<uint16_t> s;
245+
matrix_4_4<uint> i;
246+
i = static_cast<matrix_4_4<uint>>(s);
247247
}
248248

249249
// CHECK-LABEL: define {{.*}}CastUnsignedLongIntToUnsignedShortIntCStyle
@@ -253,9 +253,9 @@ void CastUnsignedLongIntToUnsignedShortIntCStyle() {
253253
// CHECK-NEXT: store <16 x i16> [[CONV]], ptr {{.*}}, align 2
254254
// CHECK-NEXT: ret void
255255

256-
matrix_4_4<unsigned long int> l;
257-
matrix_4_4<unsigned short int> s;
258-
s = (matrix_4_4<unsigned short int>)l;
256+
matrix_4_4<uint64_t> l;
257+
matrix_4_4<uint16_t> s;
258+
s = (matrix_4_4<uint16_t>)l;
259259
}
260260

261261
// CHECK-LABEL: define {{.*}}CastUnsignedLongIntToUnsignedShortIntStaticCast
@@ -265,9 +265,9 @@ void CastUnsignedLongIntToUnsignedShortIntStaticCast() {
265265
// CHECK-NEXT: store <16 x i16> [[CONV]], ptr {{.*}}, align 2
266266
// CHECK-NEXT: ret void
267267

268-
matrix_4_4<unsigned long int> l;
269-
matrix_4_4<unsigned short int> s;
270-
s = static_cast<matrix_4_4<unsigned short int>>(l);
268+
matrix_4_4<uint64_t> l;
269+
matrix_4_4<uint16_t> s;
270+
s = static_cast<matrix_4_4<uint16_t>>(l);
271271
}
272272

273273
// CHECK-LABEL: define {{.*}}CastUnsignedShortIntToIntCStyle
@@ -277,7 +277,7 @@ void CastUnsignedShortIntToIntCStyle() {
277277
// CHECK-NEXT: store <16 x i32> [[CONV]], ptr {{.*}}, align 4
278278
// CHECK-NEXT: ret void
279279

280-
matrix_4_4<unsigned short int> u;
280+
matrix_4_4<uint16_t> u;
281281
matrix_4_4<int> i;
282282
i = (matrix_4_4<int>)u;
283283
}
@@ -289,7 +289,7 @@ void CastUnsignedShortIntToIntStaticCast() {
289289
// CHECK-NEXT: store <16 x i32> [[CONV]], ptr {{.*}}, align 4
290290
// CHECK-NEXT: ret void
291291

292-
matrix_4_4<unsigned short int> u;
292+
matrix_4_4<uint16_t> u;
293293
matrix_4_4<int> i;
294294
i = static_cast<matrix_4_4<int>>(u);
295295
}
@@ -302,8 +302,8 @@ void CastIntToUnsignedLongIntCStyle() {
302302
// CHECK-NEXT: ret void
303303

304304
matrix_4_4<int> i;
305-
matrix_4_4<unsigned long int> u;
306-
u = (matrix_4_4<unsigned long int>)i;
305+
matrix_4_4<uint64_t> u;
306+
u = (matrix_4_4<uint64_t>)i;
307307
}
308308

309309
// CHECK-LABEL: define {{.*}}CastIntToUnsignedLongIntStaticCast
@@ -314,8 +314,8 @@ void CastIntToUnsignedLongIntStaticCast() {
314314
// CHECK-NEXT: ret void
315315

316316
matrix_4_4<int> i;
317-
matrix_4_4<unsigned long int> u;
318-
u = static_cast<matrix_4_4<unsigned long int>>(i);
317+
matrix_4_4<uint64_t> u;
318+
u = static_cast<matrix_4_4<uint64_t>>(i);
319319
}
320320

321321
class Foo {

clang/test/CodeGenHLSL/Types/BuiltinMatrix/matrix-type-operators.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ uint64_t vulli;
528528
// CHECK-LABEL: define {{.*}}add_matrix_scalar_uint64_short
529529
void add_matrix_scalar_uint64_short() {
530530
uint64_t4x2 b;
531-
short vs;
531+
int16_t vs;
532532
// NOOPT: [[SCALAR:%.*]] = load i16, ptr %vs, align 2{{$}}
533533
// OPT: [[SCALAR:%.*]] = load i16, ptr %vs, align 2, !tbaa !{{[0-9]+}}{{$}}
534534
// CHECK-NEXT: [[SCALAR_EXT:%.*]] = sext i16 [[SCALAR]] to i64
@@ -545,7 +545,7 @@ short vs;
545545
// CHECK-LABEL: define {{.*}}add_compound_matrix_scalar_uint64_short
546546
void add_compound_matrix_scalar_uint64_short() {
547547
uint64_t4x2 b;
548-
short vs;
548+
int16_t vs;
549549
// NOOPT: [[SCALAR:%.*]] = load i16, ptr %vs, align 2{{$}}
550550
// OPT: [[SCALAR:%.*]] = load i16, ptr %vs, align 2, !tbaa !{{[0-9]+}}{{$}}
551551
// CHECK-NEXT: [[SCALAR_EXT:%.*]] = sext i16 [[SCALAR]] to i64
@@ -562,7 +562,7 @@ short vs;
562562
// CHECK-LABEL: define {{.*}}subtract_compound_matrix_scalar_uint64_short
563563
void subtract_compound_matrix_scalar_uint64_short() {
564564
uint64_t4x2 b;
565-
short vs;
565+
int16_t vs;
566566
// NOOPT: [[SCALAR:%.*]] = load i16, ptr %vs, align 2{{$}}
567567
// OPT: [[SCALAR:%.*]] = load i16, ptr %vs, align 2, !tbaa !{{[0-9]+}}{{$}}
568568
// CHECK-NEXT: [[SCALAR_EXT:%.*]] = sext i16 [[SCALAR]] to i64

clang/test/CodeGenHLSL/Types/BuiltinMatrix/matrix-type.hlsl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ float3x3 return_matrix(inout float3x3 a) {
139139
class MatrixClass {
140140
int Tmp1;
141141
float3x4 Data;
142-
long Tmp2;
142+
int64_t Tmp2;
143143
};
144144

145145
// SPIRV-LABEL: define {{.*}}matrix_class_reference
@@ -165,7 +165,7 @@ class MatrixClassTemplate {
165165
using MatrixTy = matrix<Ty, Rows, Cols>;
166166
int Tmp1;
167167
MatrixTy Data;
168-
long Tmp2;
168+
int64_t Tmp2;
169169
};
170170

171171
template <typename Ty, unsigned Rows, unsigned Cols>

clang/test/SemaHLSL/Types/BuiltinMatrix/matrix-cast.hlsl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -106,33 +106,33 @@ void f5() {
106106
matrix_3_3<float> f32_3x3;
107107
matrix_3_3<double> f64_3x3;
108108
matrix_4_4<double> f64_4x4;
109-
matrix_4_4<signed int> i32_4x4;
110-
matrix_3_3<unsigned int> u32_3x3;
111-
matrix_4_4<unsigned int> u32_4x4;
109+
matrix_4_4<int> i32_4x4;
110+
matrix_3_3<uint> u32_3x3;
111+
matrix_4_4<uint> u32_4x4;
112112
float f;
113113

114114
f64_3x3 = (matrix_3_3<double>)f32_3x3;
115115
f64_4x4 = (matrix_4_4<double>)f32_3x3; // expected-error {{conversion between matrix types 'matrix_4_4<double>' (aka 'matrix<double, 4, 4>') and 'matrix<float, 3, 3>' of different size is not allowed}}
116-
i32_4x4 = (matrix_4_4<signed int>)f64_4x4;
117-
u32_3x3 = (matrix_4_4<unsigned int>)i32_4x4; // expected-error {{assigning to 'matrix<[...], 3, 3>' from incompatible type 'matrix<[...], 4, 4>'}}
118-
u32_4x4 = (matrix_4_4<unsigned int>)i32_4x4;
119-
i32_4x4 = (matrix_4_4<signed int>)u32_4x4;
116+
i32_4x4 = (matrix_4_4<int>)f64_4x4;
117+
u32_3x3 = (matrix_4_4<uint>)i32_4x4; // expected-error {{assigning to 'matrix<[...], 3, 3>' from incompatible type 'matrix<[...], 4, 4>'}}
118+
u32_4x4 = (matrix_4_4<uint>)i32_4x4;
119+
i32_4x4 = (matrix_4_4<int>)u32_4x4;
120120
}
121121

122122
void f6() {
123123
matrix_3_3<float> f32_3x3;
124124
matrix_3_3<double> f64_3x3;
125125
matrix_4_4<double> f64_4x4;
126-
matrix_4_4<signed int> i32_4x4;
127-
matrix_3_3<unsigned int> u32_3x3;
128-
matrix_4_4<unsigned int> u32_4x4;
126+
matrix_4_4<int> i32_4x4;
127+
matrix_3_3<uint> u32_3x3;
128+
matrix_4_4<uint> u32_4x4;
129129
float f;
130130

131131
f64_3x3 = static_cast<matrix_3_3<double>>(f32_3x3);
132132
f64_4x4 = static_cast<matrix_4_4<double>>(f32_3x3); // expected-error {{conversion between matrix types 'matrix_4_4<double>' (aka 'matrix<double, 4, 4>') and 'matrix<float, 3, 3>' of different size is not allowed}}
133133

134-
i32_4x4 = static_cast<matrix_4_4<signed int>>(f64_4x4);
135-
u32_3x3 = static_cast<matrix_4_4<unsigned int>>(i32_4x4); // expected-error {{assigning to 'matrix<[...], 3, 3>' from incompatible type 'matrix<[...], 4, 4>'}}
136-
u32_4x4 = static_cast<matrix_4_4<unsigned int>>(i32_4x4);
134+
i32_4x4 = static_cast<matrix_4_4<int>>(f64_4x4);
135+
u32_3x3 = static_cast<matrix_4_4<uint>>(i32_4x4); // expected-error {{assigning to 'matrix<[...], 3, 3>' from incompatible type 'matrix<[...], 4, 4>'}}
136+
u32_4x4 = static_cast<matrix_4_4<uint>>(i32_4x4);
137137
i32_4x4 = static_cast<matrix_4_4<signed int>>(u32_4x4);
138138
}

0 commit comments

Comments
 (0)