Re: [PATCH] find_bit: Micro-optimise find_next_*_bit

2016-12-23 Thread Yury Norov
Hi Mattew, On Fri, Dec 23, 2016 at 09:20:03AM -0800, Matthew Wilcox wrote: > From: Matthew Wilcox > > This saves 20 bytes on my x86-64 build, mostly due to alignment > considerations ... I think it actually saves about five bytes of > instructions. There's really two parts to this commit. Firs

Re: [PATCH] find_bit: Micro-optimise find_next_*_bit

2016-12-23 Thread Rasmus Villemoes
On Fri, Dec 23 2016, Matthew Wilcox wrote: > From: Matthew Wilcox > > First, the first half of the test: (!nbits || start >= nbits) is > trivially a subset of the second half, since nbits and start are both > unsigned. Yeah, I filed that as a missed optimization bug with gcc a year ago, but it

[PATCH] find_bit: Micro-optimise find_next_*_bit

2016-12-23 Thread Matthew Wilcox
From: Matthew Wilcox This saves 20 bytes on my x86-64 build, mostly due to alignment considerations ... I think it actually saves about five bytes of instructions. There's really two parts to this commit. First, the first half of the test: (!nbits || start >= nbits) is trivially a subset of the