| OLD | NEW |
| 1 //===- subzero/crosstest/test_arith_main.cpp - Driver for tests -----------===// | 1 //===- subzero/crosstest/test_arith_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 crosstesting arithmetic operations | 10 // Driver for crosstesting arithmetic operations |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #define X(inst, op, isdiv, isshift) \ | 66 #define X(inst, op, isdiv, isshift) \ |
| 67 { STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv } \ | 67 { STR(inst), test##inst, Subzero_::test##inst, NULL, NULL, isdiv } \ |
| 68 , | 68 , |
| 69 UINTOP_TABLE | 69 UINTOP_TABLE |
| 70 #undef X | 70 #undef X |
| 71 #define X(inst, op, isdiv, isshift) \ | 71 #define X(inst, op, isdiv, isshift) \ |
| 72 { STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv } \ | 72 { STR(inst), NULL, NULL, test##inst, Subzero_::test##inst, isdiv } \ |
| 73 , | 73 , |
| 74 SINTOP_TABLE | 74 SINTOP_TABLE |
| 75 #undef X | 75 #undef X |
| 76 }; | 76 #define X(mult_by) \ |
| 77 { \ |
| 78 "Mult-By-" STR(mult_by), testMultiplyBy##mult_by, \ |
| 79 Subzero_::testMultiplyBy##mult_by, NULL, NULL, false \ |
| 80 } \ |
| 81 , {"Mult-By-Neg-" STR(mult_by), testMultiplyByNeg##mult_by, \ |
| 82 Subzero_::testMultiplyByNeg##mult_by, NULL, NULL, false}, |
| 83 MULIMM_TABLE}; |
| 84 #undef X |
| 77 const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs); | 85 const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs); |
| 78 | 86 |
| 79 if (sizeof(TypeUnsigned) <= sizeof(uint32_t)) { | 87 if (sizeof(TypeUnsigned) <= sizeof(uint32_t)) { |
| 80 // This is the "normal" version of the loop nest, for 32-bit or | 88 // This is the "normal" version of the loop nest, for 32-bit or |
| 81 // narrower types. | 89 // narrower types. |
| 82 for (size_t f = 0; f < NumFuncs; ++f) { | 90 for (size_t f = 0; f < NumFuncs; ++f) { |
| 83 for (size_t i = 0; i < NumValues; ++i) { | 91 for (size_t i = 0; i < NumValues; ++i) { |
| 84 for (size_t j = 0; j < NumValues; ++j) { | 92 for (size_t j = 0; j < NumValues; ++j) { |
| 85 TypeUnsigned Value1 = Values[i]; | 93 TypeUnsigned Value1 = Values[i]; |
| 86 TypeUnsigned Value2 = Values[j]; | 94 TypeUnsigned Value2 = Values[j]; |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 testsVecInt<v8ui16, v8si16>(TotalTests, Passes, Failures); | 397 testsVecInt<v8ui16, v8si16>(TotalTests, Passes, Failures); |
| 390 testsVecInt<v16ui8, v16si8>(TotalTests, Passes, Failures); | 398 testsVecInt<v16ui8, v16si8>(TotalTests, Passes, Failures); |
| 391 testsFp<float>(TotalTests, Passes, Failures); | 399 testsFp<float>(TotalTests, Passes, Failures); |
| 392 testsFp<double>(TotalTests, Passes, Failures); | 400 testsFp<double>(TotalTests, Passes, Failures); |
| 393 testsVecFp(TotalTests, Passes, Failures); | 401 testsVecFp(TotalTests, Passes, Failures); |
| 394 | 402 |
| 395 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes | 403 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes |
| 396 << " Failures=" << Failures << "\n"; | 404 << " Failures=" << Failures << "\n"; |
| 397 return Failures; | 405 return Failures; |
| 398 } | 406 } |
| OLD | NEW |