On 10/13/19 6:01 PM, Wei Yang wrote:
>> No, please.
>>
>> (1) The compiler does not know that qemu_*host_page_size is a power of 2, and
>> will generate a real division at runtime. The same is true for
>> TARGET_PAGE_SIZE when TARGET_PAGE_BITS_VARY.
>>
>
> Confused
>
> The definition of ROUND_UP is:
>
> #define ROUND_UP(n, d) (((n) + (d) - 1) & -(0 ? (n) : (d)))
Ah, my bad, I did confuse this with QEMU_ALIGN_UP.
Hmm.
lea -1(n, size), t
neg size
and size, t
vs
mov mask, t
not t
add n, t
and mask, t
which is what I proposed here
>> https://lists.gnu.org/archive/html/qemu-devel/2019-09/msg04526.html
I'm ok with your version.
Reviewed-by: Richard Henderson <[email protected]>
r~