Re: svn commit: r340450 - head/sys/sys

2018-11-20 Thread Bruce Evans
On Mon, 19 Nov 2018, Warner Losh wrote: On Mon, Nov 19, 2018 at 9:05 AM Bruce Evans wrote: On Tue, 20 Nov 2018, Bruce Evans wrote: On Tue, 20 Nov 2018, Bruce Evans wrote: On Mon, 19 Nov 2018, Warner Losh wrote: ... I found my test program. But I think I understand the problem now. mst

Re: svn commit: r340450 - head/sys/sys

2018-11-19 Thread Warner Losh
On Mon, Nov 19, 2018 at 9:05 AM Bruce Evans wrote: > On Tue, 20 Nov 2018, Bruce Evans wrote: > > > On Tue, 20 Nov 2018, Bruce Evans wrote: > > > >> On Mon, 19 Nov 2018, Warner Losh wrote: > >> > >>> On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > > ... > > I found my test program. > > > >

Re: svn commit: r340450 - head/sys/sys

2018-11-19 Thread Bruce Evans
On Tue, 20 Nov 2018, Bruce Evans wrote: On Tue, 20 Nov 2018, Bruce Evans wrote: On Mon, 19 Nov 2018, Warner Losh wrote: On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: ... I found my test program. But I think I understand the problem now. mstosbt(1000) is overflowing with my change

Re: svn commit: r340450 - head/sys/sys

2018-11-19 Thread Bruce Evans
On Tue, 20 Nov 2018, Bruce Evans wrote: On Mon, 19 Nov 2018, Warner Losh wrote: On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: As a side note, I wonder if those functions are ever used on negative values, given the type of the argument, and if anyone checked their correctness in that

Re: svn commit: r340450 - head/sys/sys

2018-11-19 Thread Bruce Evans
On Mon, 19 Nov 2018, Warner Losh wrote: On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: On 19/11/2018 03:38, Warner Losh wrote: I'll talk to Allan to see if he can test that. the bare 1 should be handled properly because of C's promotion rules. 1ull << 32 is an unsigned long long. W

Re: svn commit: r340450 - head/sys/sys

2018-11-18 Thread Warner Losh
On Mon, Nov 19, 2018 at 12:31 AM Andriy Gapon wrote: > On 19/11/2018 03:38, Warner Losh wrote: > > I'll talk to Allan to see if he can test that. the bare 1 should be > handled > > properly because of C's promotion rules. 1ull << 32 is an unsigned long > long. > > What I really wanted was "~(uint

Re: svn commit: r340450 - head/sys/sys

2018-11-18 Thread Andriy Gapon
On 19/11/2018 03:38, Warner Losh wrote: > I'll talk to Allan to see if he can test that. the bare 1 should be handled > properly because of C's promotion rules. 1ull << 32 is an unsigned long long. > What I really wanted was "~(uint32_t)0" but that construct has bit me in the > past. I think that

Re: svn commit: r340450 - head/sys/sys

2018-11-18 Thread Warner Losh
On Sun, Nov 18, 2018 at 6:04 PM Rodney W. Grimes < free...@pdx.rh.cn85.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > I don't see how this could possibly have changed things. The changes will > > change the least significant bit by one for fractional results. I've > looked >

Re: svn commit: r340450 - head/sys/sys

2018-11-18 Thread Rodney W. Grimes
[ Charset UTF-8 unsupported, converting... ] > I don't see how this could possibly have changed things. The changes will > change the least significant bit by one for fractional results. I've looked > at all the functions that use it and get called by the mlx driver and have > trouble seeing where

Re: svn commit: r340450 - head/sys/sys

2018-11-18 Thread Warner Losh
I don't see how this could possibly have changed things. The changes will change the least significant bit by one for fractional results. I've looked at all the functions that use it and get called by the mlx driver and have trouble seeing where it could be relevant... Can you do an experiment to

Re: svn commit: r340450 - head/sys/sys

2018-11-18 Thread Allan Jude
On 2018-11-15 11:02, Warner Losh wrote: > Author: imp > Date: Thu Nov 15 16:02:13 2018 > New Revision: 340450 > URL: https://svnweb.freebsd.org/changeset/base/340450 > > Log: > When converting ns,us,ms to sbt, return the ceil() of the result > rather than the floor(). Returning the floor means

svn commit: r340450 - head/sys/sys

2018-11-15 Thread Warner Losh
Author: imp Date: Thu Nov 15 16:02:13 2018 New Revision: 340450 URL: https://svnweb.freebsd.org/changeset/base/340450 Log: When converting ns,us,ms to sbt, return the ceil() of the result rather than the floor(). Returning the floor means that sbttoX(Xtosbt(y)) != y for almost all values of