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);
>
On Tue, 8 Dec 2020 at 23:39, Richard Henderson
wrote:
>
> On 12/8/20 12:15 PM, Peter Maydell wrote:
> > +static inline uint64_t clock_ticks_to_ns(const Clock *clk, uint64_t ticks)
> > +{
> > +uint64_t ns_low, ns_high;
> > +
> > +/*
> > + * clk->period is the period in units of 2^-32 ns
On 12/9/20 8:26 AM, Peter Maydell wrote:
> (print "Welcome to the end of the universe" and exit?)
Sounds appropriately Hitchhiker's Guide. ;-)
r~
On Wed, 9 Dec 2020 at 14:11, Richard Henderson
wrote:
> This function is truncating back to 64.0, dropping the 32 high bits and 32 low
> bits. We lose bits at 2^64 ns ~= 584 years. Which is still unreasonably
> long,
> but could still be had from a timer setting ~= never.
>
> An alternate to an
On 12/9/20 2:49 AM, Luc Michel wrote:
> On 12/9/20 12:39 AM, Richard Henderson wrote:
>> On 12/8/20 12:15 PM, Peter Maydell wrote:
>>> The clock_get_ns() API claims to return the period of a clock in
>>> nanoseconds. Unfortunately since it returns an integer and a
>>> clock's period is represented
On 12/9/20 12:39 AM, Richard Henderson wrote:
On 12/8/20 12:15 PM, Peter Maydell wrote:
The clock_get_ns() API claims to return the period of a clock in
nanoseconds. Unfortunately since it returns an integer and a
clock's period is represented in units of 2^-32 nanoseconds,
the result is often a
On 12/8/20 12:15 PM, Peter Maydell wrote:
> The clock_get_ns() API claims to return the period of a clock in
> nanoseconds. Unfortunately since it returns an integer and a
> clock's period is represented in units of 2^-32 nanoseconds,
> the result is often an approximation, and calculating a clock
The clock_get_ns() API claims to return the period of a clock in
nanoseconds. Unfortunately since it returns an integer and a
clock's period is represented in units of 2^-32 nanoseconds,
the result is often an approximation, and calculating a clock
expiry deadline by multiplying clock_get_ns() by a