| OLD | NEW |
| 1 //===- subzero/crosstest/test_fcmp_main.cpp - Driver for tests ------------===// | 1 //===- subzero/crosstest/test_fcmp_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 fcmp bitcode instruction | 10 // Driver for cross testing the fcmp bitcode instruction |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 FuncTypeFloat FuncFloatLlc; | 65 FuncTypeFloat FuncFloatLlc; |
| 66 FuncTypeDouble FuncDoubleSz; | 66 FuncTypeDouble FuncDoubleSz; |
| 67 FuncTypeDouble FuncDoubleLlc; | 67 FuncTypeDouble FuncDoubleLlc; |
| 68 } Funcs[] = { | 68 } Funcs[] = { |
| 69 #define X(cmp) \ | 69 #define X(cmp) \ |
| 70 { \ | 70 { \ |
| 71 "fcmp" STR(cmp), Subzero_fcmp##cmp##Float, fcmp##cmp##Float, \ | 71 "fcmp" STR(cmp), Subzero_fcmp##cmp##Float, fcmp##cmp##Float, \ |
| 72 Subzero_fcmp##cmp##Double, fcmp##cmp##Double \ | 72 Subzero_fcmp##cmp##Double, fcmp##cmp##Double \ |
| 73 } \ | 73 } \ |
| 74 , | 74 , |
| 75 FCMP_TABLE | 75 FCMP_TABLE |
| 76 #undef X | 76 #undef X |
| 77 }; | 77 }; |
| 78 const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs); | 78 const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs); |
| 79 | 79 |
| 80 bool ResultSz, ResultLlc; | 80 bool ResultSz, ResultLlc; |
| 81 | 81 |
| 82 assert(Values && NumValues); | 82 assert(Values && NumValues); |
| 83 | 83 |
| 84 for (size_t f = 0; f < NumFuncs; ++f) { | 84 for (size_t f = 0; f < NumFuncs; ++f) { |
| 85 for (size_t i = 0; i < NumValues; ++i) { | 85 for (size_t i = 0; i < NumValues; ++i) { |
| 86 for (size_t j = 0; j < NumValues; ++j) { | 86 for (size_t j = 0; j < NumValues; ++j) { |
| 87 ++TotalTests; | 87 ++TotalTests; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 118 void testsVector(size_t &TotalTests, size_t &Passes, size_t &Failures) { | 118 void testsVector(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
| 119 typedef v4si32 (*FuncTypeVector)(v4f32, v4f32); | 119 typedef v4si32 (*FuncTypeVector)(v4f32, v4f32); |
| 120 static struct { | 120 static struct { |
| 121 const char *Name; | 121 const char *Name; |
| 122 FuncTypeVector FuncVectorSz; | 122 FuncTypeVector FuncVectorSz; |
| 123 FuncTypeVector FuncVectorLlc; | 123 FuncTypeVector FuncVectorLlc; |
| 124 } Funcs[] = { | 124 } Funcs[] = { |
| 125 #define X(cmp) \ | 125 #define X(cmp) \ |
| 126 { "fcmp" STR(cmp), Subzero_fcmp##cmp##Vector, fcmp##cmp##Vector } \ | 126 { "fcmp" STR(cmp), Subzero_fcmp##cmp##Vector, fcmp##cmp##Vector } \ |
| 127 , | 127 , |
| 128 FCMP_TABLE | 128 FCMP_TABLE |
| 129 #undef X | 129 #undef X |
| 130 }; | 130 }; |
| 131 const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs); | 131 const static size_t NumFuncs = sizeof(Funcs) / sizeof(*Funcs); |
| 132 const static size_t NumElementsInType = 4; | 132 const static size_t NumElementsInType = 4; |
| 133 const static size_t MaxTestsPerFunc = 100000; | 133 const static size_t MaxTestsPerFunc = 100000; |
| 134 | 134 |
| 135 assert(Values && NumValues); | 135 assert(Values && NumValues); |
| 136 | 136 |
| 137 for (size_t f = 0; f < NumFuncs; ++f) { | 137 for (size_t f = 0; f < NumFuncs; ++f) { |
| 138 PRNG Index; | 138 PRNG Index; |
| 139 for (size_t i = 0; i < MaxTestsPerFunc; ++i) { | 139 for (size_t i = 0; i < MaxTestsPerFunc; ++i) { |
| 140 v4f32 Value1, Value2; | 140 v4f32 Value1, Value2; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 166 | 166 |
| 167 initializeValues(); | 167 initializeValues(); |
| 168 | 168 |
| 169 testsScalar(TotalTests, Passes, Failures); | 169 testsScalar(TotalTests, Passes, Failures); |
| 170 testsVector(TotalTests, Passes, Failures); | 170 testsVector(TotalTests, Passes, Failures); |
| 171 | 171 |
| 172 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes | 172 std::cout << "TotalTests=" << TotalTests << " Passes=" << Passes |
| 173 << " Failures=" << Failures << "\n"; | 173 << " Failures=" << Failures << "\n"; |
| 174 return Failures; | 174 return Failures; |
| 175 } | 175 } |
| OLD | NEW |