Index: crosstest/test_icmp_main.cpp |
diff --git a/crosstest/test_icmp_main.cpp b/crosstest/test_icmp_main.cpp |
index 4378a6d3ba155ad4e81e90cb27e37845d72fe357..b013b1269ea53395f3ea1e66104952b059012933 100644 |
--- a/crosstest/test_icmp_main.cpp |
+++ b/crosstest/test_icmp_main.cpp |
@@ -28,6 +28,7 @@ namespace Subzero_ { |
#include "test_icmp.h" |
} |
+#include "insertelement.h" |
#include "xdefs.h" |
volatile unsigned Values[] = { |
@@ -197,10 +198,12 @@ 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; |
+ typedef typename Vectors<TypeUnsignedLabel>::ElementTy ElementTypeUnsigned; |
+ typedef typename Vectors<TypeSignedLabel>::ElementTy ElementTypeSigned; |
typedef TypeUnsigned (*FuncTypeUnsigned)(TypeUnsigned, TypeUnsigned); |
typedef TypeSigned (*FuncTypeSigned)(TypeSigned, TypeSigned); |
static struct { |
@@ -232,10 +235,11 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
for (size_t i = 0; i < MaxTestsPerFunc; ++i) { |
// Initialize the test vectors. |
TypeUnsigned Value1, Value2; |
- for (size_t j = 0; j < NumElementsInType;) { |
- Value1[j] = Values[Index() % NumValues]; |
- Value2[j] = Values[Index() % NumValues]; |
- ++j; |
+ for (size_t j = 0; j < NumElementsInType; ++j) { |
+ setElement<TypeUnsigned, ElementTypeUnsigned>( |
+ Value1, j, Values[Index() % NumValues]); |
+ setElement<TypeUnsigned, ElementTypeUnsigned>( |
+ Value2, j, Values[Index() % NumValues]); |
} |
// Perform the test. |
TypeUnsigned ResultSz = Funcs[f].FuncSz(Value1, Value2); |
@@ -255,11 +259,13 @@ void testsVecInt(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
} |
} |
} |
-#endif // !ARM32 && !NONSFI |
+#endif // !ARM32 |
} |
// Return true on wraparound |
-template <typename T> bool incrementI1Vector(typename Vectors<T>::Ty &Vect) { |
+template <typename T> |
+bool __attribute__((noinline)) |
+incrementI1Vector(typename Vectors<T>::Ty &Vect) { |
size_t Pos = 0; |
const static size_t NumElements = Vectors<T>::NumElements; |
for (Pos = 0; Pos < NumElements; ++Pos) { |
@@ -274,7 +280,7 @@ template <typename T> bool incrementI1Vector(typename Vectors<T>::Ty &Vect) { |
template <typename T> |
void testsVecI1(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<T>::Ty Ty; |
typedef Ty (*FuncType)(Ty, Ty); |
@@ -324,8 +330,8 @@ void testsVecI1(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
Ty Value1, Value2; |
// Initialize the test vectors. |
for (size_t j = 0; j < NumElements; ++j) { |
- Value1[j] = Index() % 2; |
- Value2[j] = Index() % 2; |
+ setElement<Ty, bool>(Value1, j, Index() % 2); |
+ setElement<Ty, bool>(Value2, j, Index() % 2); |
} |
// Perform the test. |
Ty ResultSz = Funcs[f].FuncSz(Value1, Value2); |
@@ -343,7 +349,7 @@ void testsVecI1(size_t &TotalTests, size_t &Passes, size_t &Failures) { |
} |
} |
} |
-#endif // !ARM32 && !NONSFI |
+#endif // !ARM32 |
} |
#ifdef X8664_STACK_HACK |