qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion


From: Jinhao Fan
Subject: Re: [PATCH] hw/nvme: Add helper functions for qid-db conversion
Date: Wed, 3 Aug 2022 09:46:05 +0800

at 4:54 PM, Klaus Jensen <its@irrelevant.dk> wrote:

> I am unsure if the compiler will transform that division into the shift
> if it can infer that the divisor is a power of two (it most likely
> will be able to).
> 
> But I see no reason to have a potential division here when we can do
> without and to me it is just as readable when you know the definition of
> DSTRD is `2 ^ (2 + DSTRD)`.

OK. I will send a new patch with shifts instead of divisions. BTW, why do we
want to avoid divisions?




reply via email to

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