Skip to content

Commit 1b01ddd

Browse files
committed
ARCH/X86: Use UCS function to count leading zeros
1 parent 58368cb commit 1b01ddd

File tree

3 files changed

+19
-9
lines changed

3 files changed

+19
-9
lines changed

contrib/test_jenkins.sh

+3-6
Original file line numberDiff line numberDiff line change
@@ -1128,12 +1128,9 @@ run_release_mode_tests() {
11281128
# Run nt_buffer_transfer tests
11291129
#
11301130
run_nt_buffer_transfer_tests() {
1131-
if lscpu | grep -q 'AuthenticAMD'
1132-
then
1133-
build release --enable-gtest --enable-optimizations
1134-
echo "==== Running nt_buffer_transfer tests ===="
1135-
./test/gtest/gtest --gtest_filter="test_arch.nt_buffer_transfer_*"
1136-
fi
1131+
build release --enable-gtest --enable-optimizations
1132+
echo "==== Running test_arch tests with optimizations ===="
1133+
./test/gtest/gtest --gtest_filter="test_arch.*"
11371134
}
11381135

11391136
set_ucx_common_test_env() {

src/ucs/arch/x86_64/cpu.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1061,7 +1061,7 @@ size_t ucs_x86_nt_src_buffer_transfer(void *dst, const void *src, size_t len)
10611061
}
10621062

10631063
static UCS_F_ALWAYS_INLINE
1064-
void ucs_x86_copy_bytes_le_128(void *dst, const void *src, size_t len)
1064+
void ucs_x86_copy_bytes_le_128(void *dst, const void *src, uint32_t len)
10651065
{
10661066
__m256i y0, y1, y2, y3;
10671067
/* Handle lengths that fall usually within eager short range */

test/gtest/ucs/arch/test_x86_64.cc

+15-2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ class test_arch : public ucs::test {
7676
test_window_size = 8 * 1024;
7777
hole_size = 2 * align;
7878

79+
auto msg = [&]() {
80+
std::stringstream ss;
81+
ss << "using length=" << len << " src_align=" << i << " dst_align=" << j;
82+
return ss.str();
83+
};
84+
7985
/*
8086
* Allocate a hole above and below the test_window_size
8187
* to check for writes beyond the designated area.
@@ -113,14 +119,20 @@ class test_arch : public ucs::test {
113119
/* Perform the transfer */
114120
ucs_x86_nt_buffer_transfer(dst + i, src + j, len, hint, len);
115121
result = memcmp(src + j, dst + i, len);
116-
EXPECT_EQ(0, result);
122+
EXPECT_EQ(0, result) << msg();
123+
if (result) {
124+
goto terminate;
125+
}
117126

118127
/* reset the copied region back to zero */
119128
memset(dst + i, 0x0, len);
120129

121130
/* check for any modifications in the holes */
122131
result = memcmp(test_window_dst, dup, total_size);
123-
EXPECT_EQ(0, result);
132+
EXPECT_EQ(0, result) << msg();
133+
if (result) {
134+
goto terminate;
135+
}
124136
}
125137
}
126138
/* Check for each len for less than 1k sizes
@@ -133,6 +145,7 @@ class test_arch : public ucs::test {
133145
}
134146
}
135147

148+
terminate:
136149
free(dup);
137150

138151
dup_fail:

0 commit comments

Comments
 (0)