target/ppc: more use of the PPC_*() macros

Also introduce utilities to manipulate bitmasks (originaly from OPAL)
which be will be used in the model of the XIVE interrupt controller.

Signed-off-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Cédric Le Goater 2017-12-22 10:55:51 +01:00 committed by David Gibson
parent b168a138a8
commit a6a444a87a
3 changed files with 40 additions and 28 deletions

View file

@ -183,7 +183,7 @@ uint64_t helper_bpermd(uint64_t rs, uint64_t rb)
for (i = 0; i < 8; i++) {
int index = (rs >> (i*8)) & 0xFF;
if (index < 64) {
if (rb & (1ull << (63-index))) {
if (rb & PPC_BIT(index)) {
ra |= 1 << i;
}
}