mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-23 00:45:40 +00:00
exec.c: Use pow2floor() rather than hand-calculation
Use pow2floor() to round down to the nearest power of 2, rather than an inline calculation. Backports commit 6554f5c03793bb8a3d5dedcebf758a1694fa186c from qemu
This commit is contained in:
parent
9ce672c511
commit
400fd62ba7
|
@ -1653,9 +1653,7 @@ static int memory_access_size(MemoryRegion *mr, unsigned l, hwaddr addr)
|
|||
if (l > access_size_max) {
|
||||
l = access_size_max;
|
||||
}
|
||||
if (l & (l - 1)) {
|
||||
l = 1 << (qemu_fls(l) - 1);
|
||||
}
|
||||
l = pow2floor(l);
|
||||
|
||||
return l;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue