[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Chris Lattner
clattner at apple.com
Sat Mar 24 15:14:20 PDT 2007
>>> Make some codes more efficient.
>>>
>>> @@ -5813,7 +5816,6 @@
>>> case 16 : SExtType = Type::Int16Ty; break;
>>> case 32 : SExtType = Type::Int32Ty; break;
>>> case 64 : SExtType = Type::Int64Ty; break;
>>> - case 128: SExtType = IntegerType::get(128); break;
>>> default: break;
>>> }
>>> if (SExtType) {
>>
>> why did you remove this?
>
> I asked Sheng to remove it because the back ends cannot deal with 128
> bit integers.
There is partial support already in place, and at some point, it
should be extended. See, for example:
CodeGen/Generic/i128-arith.ll
which works on all targets with the native codegen.
>>> @@ -5833,7 +5835,7 @@
>>> BinaryOperator::createShl(X, ConstantInt::get(Ty,
>>> ShiftDiff));
>>> InsertNewInstBefore(Shift, I);
>>>
>>> - APInt Mask(APInt::getAllOnesValue(TypeBits).shl
>>> (ShiftAmt2));
>>> + APInt Mask(Ty->getMask().shl(ShiftAmt2));
>>
>> You touched many instances of this. Please make a new
>> APInt::getHighBits method.
>
> The method getHiBits already exists and is used to extrat the N hi
> bits
> from an existing APInt, not construct a new value. I have just
> committed
> a re-organization of the APInt interface (mostly for documentation
> purposes) but while I was at it I added three new functions that
> should
> address this need:
Nice.
-Chris
>
> /// Constructs an APInt value that has a contiguous range of bits
> set.
> The
> /// bits from loBit to hiBit will be set. All other bits will be
> zero.
> For
> /// example, with parameters(32, 15, 0) you would get 0x0000FFFF. If
> hiBit is
> /// less than loBit then the set bits "wrap". For example, with
> /// parameters (32, 3, 28), you would get 0xF000000F.
> /// @param numBits the intended bit width of the result
> /// @param hiBit the index of the highest bit set.
> /// @param loBit the index of the lowest bit set.
> /// @returns An APInt value with the requested bits set.
> /// @brief Get a value with a block of bits set.
> static APInt getBitsSet(uint32_t numBits, uint32_t hiBit, uint32_t
> loBit = 0);
>
> /// Constructs an APInt value that has the top hiBitsSet bits set.
> /// @param numBits the bitwidth of the result
> /// @param hiBitsSet the number of high-order bits set in the
> result.
> /// @brief Get a value with high bits set
> static APInt getHighBitsSet(uint32_t numBits, uint32_t hiBitsSet);
>
> /// Constructs an APInt value that has the bottom loBitsSet bits
> set.
> /// @param numBits the bitwidth of the result
> /// @param loBitsSet the number of low-order bits set in the result.
> /// @brief Get a value with low bits set
> static APInt getLowBitsSet(uint32_t numBits, uint32_t loBitsSet);
>
> Reid.
>
>>
>> -Chris
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list