diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2024-05-31 10:52:42 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2024-10-31 18:28:33 +0100 |
commit | 24899cdcd238f885e9b7c0c708f624aa29090c21 (patch) | |
tree | 0bbcf392c9e66b7cb41124cc939637573db70fb8 /include | |
parent | 46c04e4bcfc0e3afc24c40f89a16475e564f0b10 (diff) |
target/i386: use compiler builtin to compute PF
This removes the 256 byte parity table from the executable.
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/host-utils.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 |