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

Chris Lattner clattner at apple.com
Mon Jan 16 20:32:22 PST 2012


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.

-Chris



More information about the llvm-commits mailing list