Vectorized BitSet operations

Jerven Bolleman me at
Fri Nov 14 16:38:52 UTC 2014

Hi All,

My apologies in advance if I am a rather clueless.

I am interested in seeing the use of SSE/AVX instructions use for some
methods in java.util.Bitset. e.g. the "or" and "and" methods.

For example I believe that this loop
can be vectorized.

My first thought was that an intrinsic/MethodSubstitution would be a good
However, it would be even nicer if this type of code can be auto vectorized.
I was wondering if anyone has worked on this or if this is already the case?

Because working auto vectorization could accelerate this loop
used in Lucene
a lot. While the intrinsic has a smaller use case.

In my specific case a bitset of 20mb or larger is not uncommon. So in these
cases doing more work per tick is interesting.

If I wanted to have a go at implementing the intrinsic are there any
pitfalls I need to be aware of?


Jerven Bolleman
me at

More information about the graal-dev mailing list