lfpinit() signed or unsigned?

Gary E. Miller gem at rellim.com
Sat Mar 11 18:38:03 UTC 2017


Yo Eric!

On Sat, 11 Mar 2017 06:20:46 -0500
"Eric S. Raymond" <esr at thyrsus.com> wrote:

> Achim Gratz <Stromeko at nexgo.de>:
> > No, most certainly not.  What you're looking at really is a simple
> > 64bit integer type that needs to be scaled by 2^-32 in order to be
> > interpreted in seconds.  It's not a separate number format or
> > anything like that and I suspect most of the uses of the integer
> > and fractional half were initially inserted in order to more
> > effectively deal with that type on machines with only 32bit
> > arithmetic.  I don't think that's still a valid concern, but those
> > half-word accesses may be hard to excise from the code.  
> 
> I confirm that Achim is correct.  I had to grok all this stuff while
> turning the type into a scalar.

True, but a lot of the code still uses l_fp as a two part object, hi
and lo.

And that will remain a useful mental abstraction for conversions
from and to timespec, timeval, etc.  When the NTP Epoch gets ready to
roll over it will become a three part object.

I'll bet a lot of the machine code handles l_fp as if it were a
structure instead of doing all the 32 bit shifts.  When the C compiler
optimizes it is using the same mental abstraction to see optimizations.

I have no objections to the changed comments. They just keep getting
better and better.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170311/d5d75b33/attachment.bin>


More information about the devel mailing list