s-yata / marisa-trie

MARISA: Matching Algorithm with Recursively Implemented StorAge
Other
506 stars 89 forks source link

select_bit: Extract 32-bit non-SSE2 version #29

Closed jmr closed 4 years ago

jmr commented 4 years ago

Extract the 32-bit non-SSE2 select_bit implementation from BitVector::select0 and select1.

This makes the code more regular, as 32-bit SSE2 and non-SSE2 can now be handled without an ifdef in select0/1.

Having this function will also make #28 cleaner.

I benchmarked select0 and select1 with this commit on x86_64 with MARISA_WORD_SIZE defined to 32, and there is no measurable difference. This is not surprising, as unit_hi and unit_lo are in the same cache line.

s-yata commented 4 years ago

Thank you!