]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
util/bufferiszero: assign length_to_accel value for each accelerator case
authorRobert Hoo <robert.hu@linux.intel.com>
Wed, 25 Mar 2020 06:50:20 +0000 (14:50 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 1 Apr 2020 18:24:03 +0000 (14:24 -0400)
Because in unit test, init_accel() will be called several times, each with
different accelerator type.

Signed-off-by: Robert Hoo <robert.hu@linux.intel.com>
Message-Id: <1585119021-46593-1-git-send-email-robert.hu@linux.intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
util/bufferiszero.c

index 663903553ac5121c75e8afcfc4cd79df9ea17c99..b8012532e465679a98b3ff61bd757e72fa6e70ab 100644 (file)
@@ -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