bug fix for hp-timing.h (aarch64)
Wilco Dijkstra
Wilco.Dijkstra@arm.com
Wed Jan 11 22:49:08 GMT 2023
Hi Zack,
> - (Diff) = ((End) - (Start)) * (UINT64_C(1000000000) / freq); \
> + (Diff) = (((End) - (Start)) * UINT64_C(1000000000)) / freq; \
>
> This avoids using floating-point arithmetic but should still do the rescale correctly.
> (The multiplier and divisor are both guaranteed to be less than 2**32, so, as long
> as we do the multiplication in 64-bit arithmetic, we cannot lose bits via overflow.)
However this will overflow after about 16 seconds - and that's short even for basic
benchmarking. Since this code is not performance critical, using floating point here
is reasonable.
Cheers,
Wilco
More information about the Libc-alpha
mailing list