cvs commit: src/sys/kern vfs_vnops.c

Bruce Evans bde at optusnet.com.au
Fri May 18 14:11:32 UTC 2007


On Fri, 18 May 2007, Dmitry Marakasov wrote:

> * Bruce Evans (bde at optusnet.com.au) wrote:
>>> peter       2007-05-17 15:31:14 UTC
>>>
>>>  FreeBSD src repository
>>>
>>>  Modified files:
>>>    sys/kern             vfs_vnops.c
>>>  Log:
>>>  Eliminate a micro-optimization that hasn't had any effect for 15+ years.
>>>
>>>  Revision  Changes    Path
>>>  1.249     +0 -5      src/sys/kern/vfs_vnops.c
>>  Since it was only implemented 11.5 years ago (in rev.1.18), it certainly
>>  had no effect 15+ years ago, but it probably had an effect later than 11.5
>>  years ago.
> I think it refers more to gcc capability to compile var/CONST expression
> where CONST is 2^n into bit shift instruction instead of division. Which
> is more important, has this capability been confirmed?

gcc did this 15+ years ago, except probably for 64-bit types (IIRC,
gcc didn't support 64-bit types on 32-bit machines 15+ years ago).
The micro-optimization was for a 64-bit type.  gcc apparently started
optimizing the 64 on 32--bit case some time in the last 11.5 years.
I only checked that the gcc in -current did this.  I didn't do the
binary search to find exactly when gcc started doing this.

Bruce


More information about the cvs-src mailing list