Ignore:
Timestamp:
Dec 23, 2015, 11:47:47 AM (3 years ago)
Author:
cameron
Message:

Add IRBuilder functionality to IDISA_Builder; eliminate separate mBuilder

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_avx_builder.cpp

    r4892 r4898  
    1616    if (fw == 64) {
    1717        Value * signmask_f64func = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx_movmsk_pd_256);
    18         Type * bitBlock_f64type = VectorType::get(mLLVMBuilder->getDoubleTy(), mBitBlockWidth/64);
    19         Value * a_as_pd = mLLVMBuilder->CreateBitCast(a, bitBlock_f64type);
    20         Value * mask = mLLVMBuilder->CreateCall(signmask_f64func, std::vector<Value *>({a_as_pd}));
     18        Type * bitBlock_f64type = VectorType::get(getDoubleTy(), mBitBlockWidth/64);
     19        Value * a_as_pd = CreateBitCast(a, bitBlock_f64type);
     20        Value * mask = CreateCall(signmask_f64func, std::vector<Value *>({a_as_pd}));
    2121        return mask;
    2222    }
    2323    else if (fw == 32) {
    2424        Value * signmask_f32func = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx_movmsk_ps_256);
    25         Type * bitBlock_f32type = VectorType::get(mLLVMBuilder->getFloatTy(), mBitBlockWidth/32);
    26         Value * a_as_ps = mLLVMBuilder->CreateBitCast(a, bitBlock_f32type);
    27         Value * mask = mLLVMBuilder->CreateCall(signmask_f32func, std::vector<Value *>({a_as_ps}));
     25        Type * bitBlock_f32type = VectorType::get(getFloatTy(), mBitBlockWidth/32);
     26        Value * a_as_ps = CreateBitCast(a, bitBlock_f32type);
     27        Value * mask = CreateCall(signmask_f32func, std::vector<Value *>({a_as_ps}));
    2828        return mask;
    2929    }
    30     Value * mask = mLLVMBuilder->CreateICmpSLT(fwCast(fw, a), ConstantAggregateZero::get(fwVectorType(fw)));
    31     return mLLVMBuilder->CreateBitCast(mask, mLLVMBuilder->getIntNTy(mBitBlockWidth/fw));
     30    Value * mask = CreateICmpSLT(fwCast(fw, a), ConstantAggregateZero::get(fwVectorType(fw)));
     31    return CreateBitCast(mask, getIntNTy(mBitBlockWidth/fw));
    3232}
    3333   
Note: See TracChangeset for help on using the changeset viewer.