RISC-V: Replace __builtin_popcount with ctpop8 in PLIC
The mode variable only uses the lower 4-bits (M,H,S,U) so replace the GCC specific __builtin_popcount with ctpop8. Cc: Palmer Dabbelt <palmer@sifive.com> Cc: Sagar Karandikar <sagark@eecs.berkeley.edu> Cc: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Cc: Alistair Francis <Alistair.Francis@wdc.com> Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
This commit is contained in:
parent
aad5ac2311
commit
244df42133
@ -383,7 +383,7 @@ static void parse_hart_config(SiFivePLICState *plic)
|
||||
p = plic->hart_config;
|
||||
while ((c = *p++)) {
|
||||
if (c == ',') {
|
||||
addrid += __builtin_popcount(modes);
|
||||
addrid += ctpop8(modes);
|
||||
modes = 0;
|
||||
hartid++;
|
||||
} else {
|
||||
@ -397,7 +397,7 @@ static void parse_hart_config(SiFivePLICState *plic)
|
||||
}
|
||||
}
|
||||
if (modes) {
|
||||
addrid += __builtin_popcount(modes);
|
||||
addrid += ctpop8(modes);
|
||||
}
|
||||
hartid++;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user