Re: svn commit: r280407 - head/sys/kern

2015-03-25 Thread Bruce Evans
On Wed, 25 Mar 2015, Mateusz Guzik wrote: On Tue, Mar 24, 2015 at 03:58:14PM +1100, Bruce Evans wrote: On Tue, 24 Mar 2015, Mateusz Guzik wrote: Log: filedesc: microoptimize fget_unlocked by getting rid of fd < 0 branch This has no effect. Compilers optimize to the equivalent of the the un

Re: svn commit: r280407 - head/sys/kern

2015-03-25 Thread Mateusz Guzik
On Tue, Mar 24, 2015 at 03:58:14PM +1100, Bruce Evans wrote: > On Tue, 24 Mar 2015, Mateusz Guzik wrote: > > >Log: > > filedesc: microoptimize fget_unlocked by getting rid of fd < 0 branch > > This has no effect. Compilers optimize to the equivalent of the the > unsigned cast hack if this is goo

Re: svn commit: r280407 - head/sys/kern

2015-03-23 Thread Bruce Evans
On Tue, 24 Mar 2015, Mateusz Guzik wrote: Log: filedesc: microoptimize fget_unlocked by getting rid of fd < 0 branch This has no effect. Compilers optimize to the equivalent of the the unsigned cast hack if this is good. On x86, it is good since no instructions are needed for the conversion

svn commit: r280407 - head/sys/kern

2015-03-23 Thread Mateusz Guzik
Author: mjg Date: Tue Mar 24 00:10:11 2015 New Revision: 280407 URL: https://svnweb.freebsd.org/changeset/base/280407 Log: filedesc: microoptimize fget_unlocked by getting rid of fd < 0 branch Casting fd to an unsigned type simplifies fd range coparison to mere checking if the result is b