mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
Convert (ffs(val) - 1) to ctz32(val)
This commit was generated mechanically by coccinelle from the following semantic patch: @@ expression val; @@ - (ffs(val) - 1) + ctz32(val) The call sites have been audited to ensure the ffs(0) - 1 == -1 case never occurs (due to input validation, asserts, etc). Therefore we don't need to worry about the fact that ctz32(0) == 32. Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Message-id: 1427124571-28598-5-git-send-email-stefanha@redhat.com Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
5863d374a3
commit
786a4ea82e
22 changed files with 50 additions and 50 deletions
|
@ -2251,8 +2251,8 @@ static inline ppcmas_tlb_t *booke206_get_tlbm(CPUPPCState *env, const int tlbn,
|
|||
{
|
||||
int r;
|
||||
uint32_t ways = booke206_tlb_ways(env, tlbn);
|
||||
int ways_bits = ffs(ways) - 1;
|
||||
int tlb_bits = ffs(booke206_tlb_size(env, tlbn)) - 1;
|
||||
int ways_bits = ctz32(ways);
|
||||
int tlb_bits = ctz32(booke206_tlb_size(env, tlbn));
|
||||
int i;
|
||||
|
||||
way &= ways - 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue