All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: rth@twiddle.net
Subject: [Qemu-devel] [PATCH 06/10] cutils: Remove ppc buffer zero checking
Date: Tue, 13 Sep 2016 18:10:01 +0200	[thread overview]
Message-ID: <1473783005-113609-7-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1473783005-113609-1-git-send-email-pbonzini@redhat.com>

From: Richard Henderson <rth@twiddle.net>

For ppc64le, gcc6 does extremely poorly with the Altivec code.
Moreover, on POWER7 and POWER8, a hand-optimized Altivec version
turns out to be no faster than the revised integer version, and
therefore not worth the effort.

Signed-off-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 util/bufferiszero.c | 26 +-------------------------
 1 file changed, 1 insertion(+), 25 deletions(-)

diff --git a/util/bufferiszero.c b/util/bufferiszero.c
index 107b0e9..de35408 100644
--- a/util/bufferiszero.c
+++ b/util/bufferiszero.c
@@ -94,31 +94,7 @@ buffer_zero_int(const void *buf, size_t len)
     }
 }
 
-#if defined(__ALTIVEC__)
-#include <altivec.h>
-/* The altivec.h header says we're allowed to undef these for
- * C++ compatibility.  Here we don't care about C++, but we
- * undef them anyway to avoid namespace pollution.
- * altivec.h may redefine the bool macro as vector type.
- * Reset it to POSIX semantics.
- */
-#undef vector
-#undef pixel
-#undef bool
-#define bool _Bool
-#define DO_NONZERO(X)  vec_any_ne(X, (__vector unsigned char){ 0 })
-ACCEL_BUFFER_ZERO(buffer_zero_ppc, 128, __vector unsigned char, DO_NONZERO)
-
-static bool select_accel_fn(const void *buf, size_t len)
-{
-    uintptr_t ibuf = (uintptr_t)buf;
-    if (len % 128 == 0 && ibuf % sizeof(__vector unsigned char) == 0) {
-        return buffer_zero_ppc(buf, len);
-    }
-    return buffer_zero_int(buf, len);
-}
-
-#elif defined(CONFIG_AVX2_OPT) || (defined(CONFIG_CPUID_H) && defined(__SSE2__))
+#if defined(CONFIG_AVX2_OPT) || (defined(CONFIG_CPUID_H) && defined(__SSE2__))
 #include <cpuid.h>
 
 #pragma GCC push_options
-- 
1.8.3.1

  parent reply	other threads:[~2016-09-13 16:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-13 16:09 [Qemu-devel] [PATCH v4 00/10] Improve buffer_is_zero Paolo Bonzini
2016-09-13 16:09 ` [Qemu-devel] [PATCH 01/10] cutils: Move buffer_is_zero and subroutines to a new file Paolo Bonzini
2016-09-13 16:09 ` [Qemu-devel] [PATCH 02/10] cutils: Remove SPLAT macro Paolo Bonzini
2016-09-13 16:09 ` [Qemu-devel] [PATCH 03/10] cutils: Export only buffer_is_zero Paolo Bonzini
2016-09-13 16:09 ` [Qemu-devel] [PATCH 04/10] cutils: Rearrange buffer_is_zero acceleration Paolo Bonzini
2016-09-13 16:10 ` [Qemu-devel] [PATCH 05/10] cutils: Remove aarch64 buffer zero checking Paolo Bonzini
2016-09-13 16:10 ` Paolo Bonzini [this message]
2016-09-13 16:10 ` [Qemu-devel] [PATCH 07/10] cutils: Add test for buffer_is_zero Paolo Bonzini
2016-09-13 16:10 ` [Qemu-devel] [PATCH 08/10] cutils: Add SSE4 version Paolo Bonzini
2016-09-13 16:10 ` [Qemu-devel] [PATCH 09/10] cutils: Add generic prefetch Paolo Bonzini
2016-09-13 16:10 ` [Qemu-devel] [PATCH 10/10] cutils: Rewrite x86 buffer zero checking Paolo Bonzini
2016-09-13 16:27   ` Richard Henderson
2016-09-13 16:33     ` Paolo Bonzini

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=1473783005-113609-7-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.