From: Robert Hoo <robert.hu@linux.intel.com>
To: qemu-devel@nongnu.org, pbonzini@redhat.com, richard.henderson@linaro.org
Cc: robert.hu@intel.com, Robert Hoo <robert.hu@linux.intel.com>
Subject: [PATCH 1/2] util/bufferiszero: assign length_to_accel value for each accelerator case
Date: Wed, 25 Mar 2020 14:50:20 +0800 [thread overview]
Message-ID: <1585119021-46593-1-git-send-email-robert.hu@linux.intel.com> (raw)
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
next reply other threads:[~2020-03-25 6:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 6:50 Robert Hoo [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1585119021-46593-1-git-send-email-robert.hu@linux.intel.com \
--to=robert.hu@linux.intel.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=robert.hu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).