OLD | NEW |
1 //===- subzero/crosstest/test_icmp_main.cpp - Driver for tests. -----------===// | 1 //===- subzero/crosstest/test_icmp_main.cpp - Driver for tests. -----------===// |
2 // | 2 // |
3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // Driver for cross testing the icmp bitcode instruction | 10 // Driver for cross testing the icmp bitcode instruction |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 } | 190 } |
191 } | 191 } |
192 } | 192 } |
193 } | 193 } |
194 } | 194 } |
195 | 195 |
196 const static size_t MaxTestsPerFunc = 100000; | 196 const static size_t MaxTestsPerFunc = 100000; |
197 | 197 |
198 template <typename TypeUnsignedLabel, typename TypeSignedLabel> | 198 template <typename TypeUnsignedLabel, typename TypeSignedLabel> |
199 void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) { | 199 void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
200 #ifndef ARM32 | 200 #if !defined(ARM32) && !defined(NONSFI) |
201 // TODO(jpp): remove this once vector support is implemented. | 201 // TODO(jpp): remove this once vector support is implemented. |
202 typedef typename Vectors<TypeUnsignedLabel>::Ty TypeUnsigned; | 202 typedef typename Vectors<TypeUnsignedLabel>::Ty TypeUnsigned; |
203 typedef typename Vectors<TypeSignedLabel>::Ty TypeSigned; | 203 typedef typename Vectors<TypeSignedLabel>::Ty TypeSigned; |
204 typedef TypeUnsigned (*FuncTypeUnsigned)(TypeUnsigned, TypeUnsigned); | 204 typedef TypeUnsigned (*FuncTypeUnsigned)(TypeUnsigned, TypeUnsigned); |
205 typedef TypeSigned (*FuncTypeSigned)(TypeSigned, TypeSigned); | 205 typedef TypeSigned (*FuncTypeSigned)(TypeSigned, TypeSigned); |
206 static struct { | 206 static struct { |
207 const char *Name; | 207 const char *Name; |
208 FuncTypeUnsigned FuncLlc; | 208 FuncTypeUnsigned FuncLlc; |
209 FuncTypeUnsigned FuncSz; | 209 FuncTypeUnsigned FuncSz; |
210 } Funcs[] = { | 210 } Funcs[] = { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 Vect[Pos] = 1; | 267 Vect[Pos] = 1; |
268 break; | 268 break; |
269 } | 269 } |
270 Vect[Pos] = 0; | 270 Vect[Pos] = 0; |
271 } | 271 } |
272 return (Pos == NumElements); | 272 return (Pos == NumElements); |
273 } | 273 } |
274 | 274 |
275 template <typename T> | 275 template <typename T> |
276 void testsVecI1(size_t &TotalTests, size_t &Passes, size_t &Failures) { | 276 void testsVecI1(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
277 #ifndef ARM32 | 277 #if !defined(ARM32) && !defined(NONSFI) |
278 // TODO(jpp): remove this once vector support is implemented. | 278 // TODO(jpp): remove this once vector support is implemented. |
279 typedef typename Vectors<T>::Ty Ty; | 279 typedef typename Vectors<T>::Ty Ty; |
280 typedef Ty (*FuncType)(Ty, Ty); | 280 typedef Ty (*FuncType)(Ty, Ty); |
281 static struct { | 281 static struct { |
282 const char *Name; | 282 const char *Name; |
283 FuncType FuncLlc; | 283 FuncType FuncLlc; |
284 FuncType FuncSz; | 284 FuncType FuncSz; |
285 } Funcs[] = { | 285 } Funcs[] = { |
286 #define X(cmp, op) \ | 286 #define X(cmp, op) \ |
287 { STR(cmp), (FuncType)icmpi1##cmp, (FuncType)Subzero_::icmpi1##cmp } \ | 287 { STR(cmp), (FuncType)icmpi1##cmp, (FuncType)Subzero_::icmpi1##cmp } \ |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 testsVecInt<v8ui16, v8si16>(TotalTests, Passes, Failures); | 367 testsVecInt<v8ui16, v8si16>(TotalTests, Passes, Failures); |
368 testsVecInt<v16ui8, v16si8>(TotalTests, Passes, Failures); | 368 testsVecInt<v16ui8, v16si8>(TotalTests, Passes, Failures); |
369 testsVecI1<v4i1>(TotalTests, Passes, Failures); | 369 testsVecI1<v4i1>(TotalTests, Passes, Failures); |
370 testsVecI1<v8i1>(TotalTests, Passes, Failures); | 370 testsVecI1<v8i1>(TotalTests, Passes, Failures); |
371 testsVecI1<v16i1>(TotalTests, Passes, Failures); | 371 testsVecI1<v16i1>(TotalTests, Passes, Failures); |
372 | 372 |
373 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes | 373 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes |
374 << " Failures=" << Failures << "\n"; | 374 << " Failures=" << Failures << "\n"; |
375 return Failures; | 375 return Failures; |
376 } | 376 } |
OLD | NEW |