Skip to content
Snippets Groups Projects
Commit b87c99d0 authored by Robert Hoo's avatar Robert Hoo Committed by Paolo Bonzini
Browse files

util/bufferiszero: assign length_to_accel value for each accelerator case


Because in unit test, init_accel() will be called several times, each with
different accelerator type.

Signed-off-by: default avatarRobert Hoo <robert.hu@linux.intel.com>
Message-Id: <1585119021-46593-1-git-send-email-robert.hu@linux.intel.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 674fc21f
No related branches found
No related tags found
No related merge requests found
......@@ -254,13 +254,16 @@ static void init_accel(unsigned cache)
bool (*fn)(const void *, size_t) = buffer_zero_int;
if (cache & CACHE_SSE2) {
fn = buffer_zero_sse2;
length_to_accel = 64;
}
#ifdef CONFIG_AVX2_OPT
if (cache & CACHE_SSE4) {
fn = buffer_zero_sse4;
length_to_accel = 64;
}
if (cache & CACHE_AVX2) {
fn = buffer_zero_avx2;
length_to_accel = 64;
}
#endif
#ifdef CONFIG_AVX512F_OPT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment