summaryrefslogtreecommitdiff
path: root/util/bufferiszero.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2016-08-29 11:46:20 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2016-09-13 19:13:32 +0200
commit43ff5e01ecba41628f68eb3c62fd49e0405fcca9 (patch)
tree27eddde0d7c4c93bd92517ee0894231421511927 /util/bufferiszero.c
parent2250d3a293d36ed9d8143d4c3d3e94086c429af4 (diff)
downloadqemu-43ff5e01ecba41628f68eb3c62fd49e0405fcca9.tar.gz
cutils: Remove ppc buffer zero checking
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>
Diffstat (limited to 'util/bufferiszero.c')
-rw-r--r--util/bufferiszero.c26
1 files changed, 1 insertions, 25 deletions
diff --git a/util/bufferiszero.c b/util/bufferiszero.c
index e6679b3eea..a3a842f9fd 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>
/* Do not use push_options pragmas unnecessarily, because clang