QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/2] util/bufferiszero: assign length_to_accel value for each accelerator case
@ 2020-03-25  6:50 Robert Hoo
  2020-03-25  6:50 ` [PATCH 2/2] util/bufferiszero: improve avx2 accelerator Robert Hoo
  0 siblings, 1 reply; 7+ messages in thread
From: Robert Hoo @ 2020-03-25  6:50 UTC (permalink / raw)
  To: qemu-devel, pbonzini, richard.henderson; +Cc: robert.hu, Robert Hoo

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>
---
 util/bufferiszero.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/util/bufferiszero.c b/util/bufferiszero.c
index 6639035..b801253 100644
--- a/util/bufferiszero.c
+++ b/util/bufferiszero.c
@@ -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
-- 
1.8.3.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, back to index

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25  6:50 [PATCH 1/2] util/bufferiszero: assign length_to_accel value for each accelerator case Robert Hoo
2020-03-25  6:50 ` [PATCH 2/2] util/bufferiszero: improve avx2 accelerator Robert Hoo
2020-03-25 12:54   ` Eric Blake
2020-03-26  2:09     ` Hu, Robert
2020-03-26  9:43       ` Paolo Bonzini
2020-03-26 13:26       ` Eric Blake
2020-03-26 13:51         ` Robert Hoo

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
		qemu-devel@nongnu.org
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.nongnu.qemu-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git