qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 01/12] cacheinfo: add i/d cache_linesize_log


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v2 01/12] cacheinfo: add i/d cache_linesize_log
Date: Tue, 11 Sep 2018 05:16:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 09/10/2018 04:27 PM, Emilio G. Cota wrote:
> @@ -173,5 +176,7 @@ static void __attribute__((constructor)) 
> init_cache_info(void)
>      fallback_cache_info(&isize, &dsize);
>  
>      qemu_icache_linesize = isize;
> +    qemu_icache_linesize_log = 31 - clz32(isize);
>      qemu_dcache_linesize = dsize;
> +    qemu_dcache_linesize_log = 31 - clz32(dsize);

Either pow2ceil or realize that linesize is already a power of 2 and use ctz32.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]