[llvm-commits] [llvm] r125393 - in /llvm/trunk: lib/VMCore/ConstantFold.cpp test/Transforms/InstCombine/bitcast-vec-uniform.ll test/Transforms/InstCombine/fold-vector-select.ll

Frits van Bommel fvbommel at gmail.com
Thu Feb 17 01:41:19 PST 2011


On Thu, Feb 17, 2011 at 9:16 AM, Duncan Sands <baldrick at free.fr> wrote:
>> +  if (Ty->isFloatingPointTy()) {
>> +    APFloat FL(0.0f);
>> +    switch (Ty->getTypeID()) {
>
> You can get the bitwidth using Ty->getPrimitiveSizeInBits().  Thus you only
> have to worry about setting the IEEE flag right.  So the switch etc can be
> turned into something like this:
>  APFloat FL = APFloat::getAllOnesValue(Ty->getPrimitiveSizeInBits(),
> Ty->isPPC_FP128Ty());

I think you meant '!Ty->isPPC_FP128Ty()' there. Nadav's patch got this
wrong too.




More information about the llvm-commits mailing list