aboutsummaryrefslogtreecommitdiff
path: root/migration/xbzrle.c
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2023-05-01 22:05:55 +0100
committerRichard Henderson <richard.henderson@linaro.org>2023-05-02 13:05:45 -0700
commitdc165fcd4effb9e005a4514ab7d666322648e971 (patch)
tree2184c5f9c81038ab35aaf671b9293eb9a82ee8a6 /migration/xbzrle.c
parentc4075353854ed320cf9225ebd5605836ae236640 (diff)
downloadqemu-dc165fcd4effb9e005a4514ab7d666322648e971.zip
qemu-dc165fcd4effb9e005a4514ab7d666322648e971.tar.gz
qemu-dc165fcd4effb9e005a4514ab7d666322648e971.tar.bz2
migration/xbzrle: Use __attribute__((target)) for avx512
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>
Diffstat (limited to 'migration/xbzrle.c')
-rw-r--r--migration/xbzrle.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/migration/xbzrle.c b/migration/xbzrle.c
index c6f8b20..258e495 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