From 24899cdcd238f885e9b7c0c708f624aa29090c21 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 31 May 2024 10:52:42 +0200 Subject: target/i386: use compiler builtin to compute PF This removes the 256 byte parity table from the executable. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- include/qemu/host-utils.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include/qemu/host-utils.h') diff --git a/include/qemu/host-utils.h b/include/qemu/host-utils.h index ead97d354d..4d28fa22cf 100644 --- a/include/qemu/host-utils.h +++ b/include/qemu/host-utils.h @@ -313,6 +313,15 @@ static inline int ctpop8(uint8_t val) return __builtin_popcount(val); } +/* + * parity8 - return the parity (1 = odd) of an 8-bit value. + * @val: The value to search + */ +static inline int parity8(uint8_t val) +{ + return __builtin_parity(val); +} + /** * ctpop16 - count the population of one bits in a 16-bit value. * @val: The value to search -- cgit 1.4.1