Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(430)

Unified Diff: crosstest/test_arith_main.cpp

Issue 1560933002: Subzero: Enable Non-SFI vector cross tests. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « crosstest/insertelement.h ('k') | crosstest/test_icmp_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: crosstest/test_arith_main.cpp
diff --git a/crosstest/test_arith_main.cpp b/crosstest/test_arith_main.cpp
index db0370947d9999585f0514988ae8b0c862f9558d..076eb2a85f4658c0c4cde29889e0a2855e847dae 100644
--- a/crosstest/test_arith_main.cpp
+++ b/crosstest/test_arith_main.cpp
@@ -28,12 +28,14 @@
// Subzero_ namespace, corresponding to the llc and Subzero translated
// object files, respectively.
#include "test_arith.h"
-#include "xdefs.h"
namespace Subzero_ {
#include "test_arith.h"
}
+#include "insertelement.h"
+#include "xdefs.h"
+
template <class T> bool inputsMayTriggerException(T Value1, T Value2) {
// Avoid HW divide-by-zero exception.
if (Value2 == 0)
@@ -162,7 +164,7 @@ const static size_t MaxTestsPerFunc = 100000;
template <typename TypeUnsignedLabel, typename TypeSignedLabel>
void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
-#if !defined(ARM32) && !defined(NONSFI)
+#if !defined(ARM32)
// TODO(jpp): remove this once vector support is implemented.
typedef typename Vectors<TypeUnsignedLabel>::Ty TypeUnsigned;
typedef typename Vectors<TypeSignedLabel>::Ty TypeSigned;
@@ -212,8 +214,8 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
continue;
if (Funcs[f].MaskShiftOperations)
Element2 &= CHAR_BIT * sizeof(ElementTypeUnsigned) - 1;
- Value1[j] = Element1;
- Value2[j] = Element2;
+ setElement<TypeUnsigned, ElementTypeUnsigned>(Value1, j, Element1);
John 2016/01/06 15:24:26 Do you need the template parameters? I would guess
Jim Stichnoth 2016/01/06 17:34:30 Done.
+ setElement<TypeUnsigned, ElementTypeUnsigned>(Value2, j, Element2);
}
// Perform the test.
TypeUnsigned ResultSz, ResultLlc;
@@ -239,7 +241,7 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) {
}
}
}
-#endif // !ARM32 && !NONSFI
+#endif // !ARM32
}
template <typename Type>
@@ -315,7 +317,7 @@ void testsFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
}
void testsVecFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
-#if !defined(ARM32) && !defined(NONSFI)
+#if !defined(ARM32)
// TODO(jpp): remove this once vector support is implemented.
static const float NegInf = -1.0 / 0.0;
static const float PosInf = 1.0 / 0.0;
@@ -343,8 +345,8 @@ void testsVecFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
// Initialize the test vectors.
v4f32 Value1, Value2;
for (size_t j = 0; j < NumElementsInType; ++j) {
- Value1[j] = Values[Index() % NumValues];
- Value2[j] = Values[Index() % NumValues];
+ setElement<v4f32, float>(Value1, j, Values[Index() % NumValues]);
+ setElement<v4f32, float>(Value2, j, Values[Index() % NumValues]);
}
// Perform the test.
v4f32 ResultSz = Funcs[f].FuncSz(Value1, Value2);
@@ -375,7 +377,7 @@ void testsVecFp(size_t &TotalTests, size_t &Passes, size_t &Failures) {
}
}
}
-#endif // !ARM32 && !NONSFI
+#endif // !ARM32
}
#ifdef X8664_STACK_HACK
« no previous file with comments | « crosstest/insertelement.h ('k') | crosstest/test_icmp_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698