Do not store the lower bits mask in EliasFanoReader
authorGiuseppe Ottaviano <ott@fb.com>
Wed, 3 May 2017 21:58:39 +0000 (14:58 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Wed, 3 May 2017 22:13:36 +0000 (15:13 -0700)
commit0b988b15791ff86168241e31d27ae091edf35728
tree8c55f00bf0c30d25374053584e507740ce6e478f
parent90c8861ca8d315a3e6bbca84d095b8f8dd2496a7
Do not store the lower bits mask in EliasFanoReader

Summary:
Computing the mask on access has negligible cost as it can be
hoisted out of the linear search loop, and furthermore on Haswell we
can use the the `BZHI` instruction.

I also experimented with `BEXTR` but it ended up being slower because
computing the pattern operand requires a shift and an or (it's
probably meant for when the pattern is precomputed).

Reviewed By: philippv

Differential Revision: D4976657

fbshipit-source-id: e4c4ca5f0a785595587e6d6ad4676f5b216291cf
folly/experimental/EliasFanoCoding.h
folly/experimental/Instructions.h