Source-Changes archive

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

Re: CVS commit: src/sys/arch/arm/ep93xx



On Fri, Dec 19, 2008 at 08:27:30AM -0500, Ken Hornstein wrote:
> >Would something like (untested!):
> >
> >-       remaining = n * TIMER_FREQ / 1000000;
> >+       remaining = (uint64_t)n * TIMER_FREQ / 1000000;
> >
> >do instead, forcing 64-bit arithmetic?
> 
> I admit to being lame and always forgetting the rules when it comes to
> forcing different precision for arithmetic in C.  My thinking was that
> since there was something that I knew worked before and was faster, I
> should go with that.  I don't have an objection to this (or what Itzumi
> posted), but is there a reason to not use the original code?

It hard-wires a separate constant, it is impossible to read and it might
not even be faster than the above if the compiler is smart.
Additionally, avoiding inline assembly means less GCC dependency.

Joerg


Home | Main Index | Thread Index | Old Index