aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/sse
diff options
context:
space:
mode:
authorVlad Yaroslavlev <vladon@vladon.com>2022-02-10 16:46:23 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:23 +0300
commit706b83ed7de5a473436620367af31fc0ceecde07 (patch)
tree103305d30dec77e8f6367753367f59b3cd68f9f1 /library/cpp/sse
parent918e8a1574070d0ec733f0b76cfad8f8892ad2e5 (diff)
downloadydb-706b83ed7de5a473436620367af31fc0ceecde07.tar.gz
Restoring authorship annotation for Vlad Yaroslavlev <vladon@vladon.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/sse')
-rw-r--r--library/cpp/sse/ut/test.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/library/cpp/sse/ut/test.cpp b/library/cpp/sse/ut/test.cpp
index 33c999d284..1aef06fa7a 100644
--- a/library/cpp/sse/ut/test.cpp
+++ b/library/cpp/sse/ut/test.cpp
@@ -71,29 +71,29 @@ using uint64x2_t = std::array<ui64, 2>;
using float32x4_t = std::array<float, 4>;
using float64x2_t = std::array<double, 2>;
-template <typename TVectorType>
+template <typename TVectorType>
struct TQType {
- static TVectorType As(__m128i param) {
- TVectorType value;
+ static TVectorType As(__m128i param) {
+ TVectorType value;
_mm_storeu_si128((__m128i*)&value, param);
return value;
}
- static TVectorType As(__m128 param) {
- TVectorType value;
+ static TVectorType As(__m128 param) {
+ TVectorType value;
_mm_storeu_ps((float*)&value, param);
return value;
}
- static TVectorType As(__m128d param) {
- TVectorType value;
+ static TVectorType As(__m128d param) {
+ TVectorType value;
_mm_storeu_pd((double*)&value, param);
return value;
}
};
#endif
-template <typename TVectorType>
+template <typename TVectorType>
struct TFuncLoad;
-template <typename TVectorType>
+template <typename TVectorType>
struct TFuncStore;
template <>
@@ -394,12 +394,12 @@ public:
template <typename TElem, unsigned elemCount,
typename TFunc, typename TElemFunc,
- typename TOp, typename TVectorType = __m128i>
+ typename TOp, typename TVectorType = __m128i>
void Test_mm_dualop();
template <typename TElem, unsigned elemCount,
typename TFunc, typename TElemFunc,
- typename TOp, typename TVectorType = __m128i>
+ typename TOp, typename TVectorType = __m128i>
void Test_mm_dualcmp();
void Test_mm_or_si128();
@@ -421,7 +421,7 @@ public:
void Test_mm_cmplt_epi32();
template <typename TElem, int elemCount,
- typename TFunc, typename TOp, typename TVectorType>
+ typename TFunc, typename TOp, typename TVectorType>
void Test_mm_setter_epiXX();
void Test_mm_set1_epi8();
void Test_mm_set1_epi16();
@@ -1068,7 +1068,7 @@ void TSSEEmulTest::Test_mm_unpackhi_epi64() {
template <typename TElem, unsigned elemCount,
typename TFunc, typename TElemFunc,
- typename TOp, typename TVectorType>
+ typename TOp, typename TVectorType>
void TSSEEmulTest::Test_mm_dualop() {
char data1[16] = {
'\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
@@ -1079,14 +1079,14 @@ void TSSEEmulTest::Test_mm_dualop() {
TElem* dataw1 = reinterpret_cast<TElem*>(&data1);
TElem* dataw2 = reinterpret_cast<TElem*>(&data2);
- TVectorType value1 = TFuncLoad<TVectorType>(&data1);
- TVectorType value2 = TFuncLoad<TVectorType>(&data2);
+ TVectorType value1 = TFuncLoad<TVectorType>(&data1);
+ TVectorType value2 = TFuncLoad<TVectorType>(&data2);
TElem procData[elemCount];
for (unsigned i = 0; i < elemCount; ++i) {
procData[i] = TElemFunc::Call(dataw1[i], dataw2[i]);
}
- TVectorType result = TFunc(value1, value2);
+ TVectorType result = TFunc(value1, value2);
for (unsigned i = 0; i < elemCount; ++i) {
UNIT_ASSERT_EQUAL(procData[i], TQType<TOp>::As(result)[i]);
@@ -1097,7 +1097,7 @@ void TSSEEmulTest::Test_mm_dualop() {
but different data1 and data2 */
template <typename TElem, unsigned elemCount,
typename TFunc, typename TElemFunc,
- typename TOp, typename TVectorType>
+ typename TOp, typename TVectorType>
void TSSEEmulTest::Test_mm_dualcmp() {
char data1[16] = {
'\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x66', '\x77', '\xAA',
@@ -1108,14 +1108,14 @@ void TSSEEmulTest::Test_mm_dualcmp() {
TElem* dataw1 = reinterpret_cast<TElem*>(&data1);
TElem* dataw2 = reinterpret_cast<TElem*>(&data2);
- TVectorType value1 = TFuncLoad<TVectorType>(&data1);
- TVectorType value2 = TFuncLoad<TVectorType>(&data2);
+ TVectorType value1 = TFuncLoad<TVectorType>(&data1);
+ TVectorType value2 = TFuncLoad<TVectorType>(&data2);
TElem procData[elemCount];
for (unsigned i = 0; i < elemCount; ++i) {
procData[i] = TElemFunc::Call(dataw1[i], dataw2[i]);
}
- TVectorType result = TFunc(value1, value2);
+ TVectorType result = TFunc(value1, value2);
for (unsigned i = 0; i < elemCount; ++i) {
/* memcmp is for compare to invalid floats in results */
@@ -1255,7 +1255,7 @@ void TSSEEmulTest::Test_mm_cmplt_epi32() {
}
template <typename TElem, int elemCount,
- typename TFunc, typename TOp, typename TVectorType>
+ typename TFunc, typename TOp, typename TVectorType>
void TSSEEmulTest::Test_mm_setter_epiXX() {
char data[64] = {
'\xAA', '\x00', '\xFF', '\xCC', '\x11', '\x22', '\xBB', '\xAA',
@@ -1269,7 +1269,7 @@ void TSSEEmulTest::Test_mm_setter_epiXX() {
TElem* dataw = reinterpret_cast<TElem*>(&data);
for (unsigned dataItem = 0; dataItem < elemCount * 4; ++dataItem) {
- TVectorType value = TFunc(dataw[dataItem]);
+ TVectorType value = TFunc(dataw[dataItem]);
for (unsigned i = 0; i < elemCount; ++i)
UNIT_ASSERT_EQUAL(dataw[dataItem], TQType<TOp>::As(value)[i]);