Displaying 6 results from an estimated 6 matches for "getbitsset".
2008 Feb 11
1
[LLVMdev] APInt::getBitsSet
APInt::getBitsSet's loBit and hiBit arguments describe a range that's
inclusive
on both ends. Would anyone mind if we change it to be a "half-open"
range,
meaning exclusive on the high end?
Currently every caller (including several new ones in some code I'm
writing right
now) does a subt...
2011 Mar 06
0
[LLVMdev] First Patch
...#39;d reuse the old mask variable as suggested
above you'd need this, but see below.
> +
> + // Disregarding the sign bit
> + for (int i = (width - 2); i > power; i--)
> + mask.setBit(i);
I think this is equivalent to
if (power < width-2)
mask = APInt::getBitsSet(width, power+1, width-2);
else
mask.clearAllBits();
(This would mean the clearAllBits() above would again be redundant)
However, a nice way to handle the signbit-only case would be to wrap
that in an extra if as follows:
if (power == width - 1)
mask = APInt::getSignBit(width); // Alter...
2011 Mar 08
0
[LLVMdev] First Patch
...ng width back to int isn't a disaster. (Who needs
integers with over 2 million bits anyway?)
Alternatively, since you know 'power' is non-negative here you can
safely cast it to unsigned for the comparison.
> + mask = APInt::getSignBit(width);
> + else
> + mask = APInt::getBitsSet(width, power + 1, width - 2);
You removed the 'if (power < width-2)' case from the code I mentioned
as equivalent to your loop.
Because of this, if power + 1 > width - 2 (or equivalently in this
case, if power == width - 2) this will create a "wrapped" bit set: the
upper bi...
2011 Mar 08
2
[LLVMdev] First Patch
Hi!
I've attached a patch which takes care of the issues mentioned (and adds
two tests).
--
Sanjoy Das
http://playingwithpointers.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ripple-bucket.diff
Type: text/x-diff
Size: 3318 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110308/0814e3e8/attachment.diff>
2011 Mar 06
1
[LLVMdev] First Patch
Hi all!
I've been tinkering with LLVM's code-base for a few days, hoping to
start on one of the ideas mentioned in the "Open Projects" page (I was
told 'Improving the current system'/'Miscellaneous Improvements'/5 would
be a good start).
While I was at it, I also took a stab at finishing up one of the TODOs.
I've attached the patch for review.
--
2011 Mar 02
3
[LLVMdev] live variable analysis
Hi
As I understand live variable analysis will set the def/kill
properties of operands. In that case, is it still needed to set the
kill flags when possible during lowering?
thanks
dz