[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/4] clock: Introduce clock_ticks_to_ns()
From: |
Richard Henderson |
Subject: |
Re: [PATCH 1/4] clock: Introduce clock_ticks_to_ns() |
Date: |
Thu, 10 Dec 2020 19:36:44 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 12/10/20 2:47 PM, Peter Maydell wrote:
>> With the shift, you're discarding the high 32 bits of the result. You'll
>> lose
>> those same bits if you shift one of the inputs left by 32, and use only the
>> high part of the result, e.g.
>>
>> mulu(&discard, &ret, clk->period, ticks << 32);
>> return ret;
>>
>> Which on some hosts, e.g. aarch64, only requires umulh and not two multiply
>> instructions.
>
> We can't do this if we want to allow a full 64-bit 'ticks' input, right?
Correct.
> So I think my plan for v2 of this series is just to add in the
> saturation-to-INT64_MAX logic.
Sounds good.
r~
[PATCH 4/4] clock: Define and use new clock_display_freq(), Peter Maydell, 2020/12/08
[PATCH 2/4] target/mips: Don't use clock_get_ns() in clock period calculation, Peter Maydell, 2020/12/08
[PATCH 3/4] clock: Remove clock_get_ns(), Peter Maydell, 2020/12/08
Re: [PATCH 0/4] clock: Get rid of clock_get_ns(), Philippe Mathieu-Daudé, 2020/12/11