[llvm-commits] [llvm] r148272 - in /llvm/trunk: include/llvm/ADT/BitVector.h unittests/ADT/BitVectorTest.cpp

Chandler Carruth chandlerc at google.com
Mon Jan 16 20:58:30 PST 2012


On Mon, Jan 16, 2012 at 8:32 PM, Chris Lattner <clattner at apple.com> wrote:

>
> On Jan 16, 2012, at 5:24 PM, Jakob Stoklund Olesen wrote:
>
> > Author: stoklund
> > Date: Mon Jan 16 19:24:32 2012
> > New Revision: 148272
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=148272&view=rev
> > Log:
> > Add portable bit mask operations to BitVector.
> >
> > BitVector uses the native word size for its internal representation.
> > That doesn't work well for literal bit masks in source code.
> >
> > This patch adds BitVector operations to efficiently apply literal bit
> > masks specified as arrays of uint32_t.  Since each array entry always
> > holds exactly 32 bits, these portable bit masks can be source code
> > literals, probably produced by TableGen.
>
> Out of curiosity, why not arrays of uint64_t?  It will be faster on 64-bit
> platforms, and shouldn't really be a penalty on 32-bit either.
>

I wondered the same thing. I also wondered about an array of indices rather
than an array of bits.. Specifically, an array of indices would seem easier
to read, and if they're all likely to be literals, I would expect the
optimizer to make them all equivalent...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120116/76c5f064/attachment.html>


More information about the llvm-commits mailing list