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>
This commit is contained in:
Paolo Bonzini 2024-05-31 10:52:42 +02:00
parent 46c04e4bcf
commit 24899cdcd2
5 changed files with 26 additions and 48 deletions

View file

@ -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