[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 08/12] migration/xbzrle: Use __attribute__((target)) for avx512
|
From: |
Richard Henderson |
|
Subject: |
[PULL v2 08/12] migration/xbzrle: Use __attribute__((target)) for avx512 |
|
Date: |
Wed, 3 May 2023 08:21:01 +0100 |
Use the attribute, which is supported by clang, instead of
the #pragma, which is not supported and, for some reason,
also not detected by the meson probe, so we fail by -Werror.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Juan Quintela <quintela@redhat.com>
Message-Id: <20230501210555.289806-1-richard.henderson@linaro.org>
---
meson.build | 5 +----
migration/xbzrle.c | 9 ++++-----
2 files changed, 5 insertions(+), 9 deletions(-)
diff --git a/meson.build b/meson.build
index c44d05a13f..77d42898c8 100644
--- a/meson.build
+++ b/meson.build
@@ -2370,12 +2370,9 @@ config_host_data.set('CONFIG_AVX512F_OPT',
get_option('avx512f') \
config_host_data.set('CONFIG_AVX512BW_OPT', get_option('avx512bw') \
.require(have_cpuid_h, error_message: 'cpuid.h not available, cannot enable
AVX512BW') \
.require(cc.links('''
- #pragma GCC push_options
- #pragma GCC target("avx512bw")
#include <cpuid.h>
#include <immintrin.h>
- static int bar(void *a) {
-
+ static int __attribute__((target("avx512bw"))) bar(void *a) {
__m512i *x = a;
__m512i res= _mm512_abs_epi8(*x);
return res[1];
diff --git a/migration/xbzrle.c b/migration/xbzrle.c
index c6f8b20917..258e4959c9 100644
--- a/migration/xbzrle.c
+++ b/migration/xbzrle.c
@@ -177,11 +177,11 @@ int xbzrle_decode_buffer(uint8_t *src, int slen, uint8_t
*dst, int dlen)
}
#if defined(CONFIG_AVX512BW_OPT)
-#pragma GCC push_options
-#pragma GCC target("avx512bw")
#include <immintrin.h>
-int xbzrle_encode_buffer_avx512(uint8_t *old_buf, uint8_t *new_buf, int slen,
- uint8_t *dst, int dlen)
+
+int __attribute__((target("avx512bw")))
+xbzrle_encode_buffer_avx512(uint8_t *old_buf, uint8_t *new_buf, int slen,
+ uint8_t *dst, int dlen)
{
uint32_t zrun_len = 0, nzrun_len = 0;
int d = 0, i = 0, num = 0;
@@ -296,5 +296,4 @@ int xbzrle_encode_buffer_avx512(uint8_t *old_buf, uint8_t
*new_buf, int slen,
}
return d;
}
-#pragma GCC pop_options
#endif
--
2.34.1
- [PATCH 01/84] tcg: Split out memory ops to tcg-op-ldst.c, (continued)
- [PATCH 01/84] tcg: Split out memory ops to tcg-op-ldst.c, Richard Henderson, 2023/05/03
- [PATCH 09/84] tcg: Reduce copies for plugin_gen_mem_callbacks, Richard Henderson, 2023/05/03
- [PULL v2 06/12] tcg: Add tcg_gen_gvec_rotrs, Richard Henderson, 2023/05/03
- [PULL v2 07/12] qemu/int128: Re-shuffle Int128Alias members, Richard Henderson, 2023/05/03
- [PATCH 10/84] accel/tcg: Widen plugin_gen_empty_mem_callback to i64, Richard Henderson, 2023/05/03
- [PULL v2 04/12] qemu/host-utils.h: Add clz and ctz functions for lower-bit integers, Richard Henderson, 2023/05/03
- [PULL v2 03/12] qemu/bitops.h: Limit rotate amounts, Richard Henderson, 2023/05/03
- [PATCH 05/84] tcg: Widen helper_atomic_* addresses to uint64_t, Richard Henderson, 2023/05/03
- [PATCH 07/84] accel/tcg: Merge gen_mem_wrapped with plugin_gen_empty_mem_callback, Richard Henderson, 2023/05/03
- [PULL v2 09/12] accel/tcg: Add cpu_ld*_code_mmu, Richard Henderson, 2023/05/03
- [PULL v2 08/12] migration/xbzrle: Use __attribute__((target)) for avx512,
Richard Henderson <=
- [PULL v2 10/12] tcg/loongarch64: Conditionalize tcg_out_exts_i32_i64, Richard Henderson, 2023/05/03