Ignore:
Timestamp:
Oct 9, 2015, 10:24:51 AM (4 years ago)
Author:
cameron
Message:

Parameterize carry_manager to inherit BitBlockWidth? from idisa builder

File:
1 edited

Legend:

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

    r4750 r4827  
    1818
    1919VectorType * IDISA_Builder::fwVectorType(unsigned fw) {
    20     int fieldCount = mBitBlockSize/fw;
     20    int fieldCount = mBitBlockWidth/fw;
    2121    return VectorType::get(mLLVMBuilder->getIntNTy(fw), fieldCount);
    2222}
     
    107107
    108108Value * IDISA_Builder::esimd_mergeh(unsigned fw, Value * a, Value * b) {
    109     unsigned field_count = mBitBlockSize/fw;
     109    unsigned field_count = mBitBlockWidth/fw;
    110110    Value * aVec = fwCast(fw, a);
    111111    Value * bVec = fwCast(fw, b);
     
    119119
    120120Value * IDISA_Builder::esimd_mergel(unsigned fw, Value * a, Value * b) {
    121     unsigned field_count = mBitBlockSize/fw;
     121    unsigned field_count = mBitBlockWidth/fw;
    122122    Value * aVec = fwCast(fw, a);
    123123    Value * bVec = fwCast(fw, b);
     
    131131
    132132Value * IDISA_Builder::hsimd_packh(unsigned fw, Value * a, Value * b) {
    133     unsigned field_count = 2 * mBitBlockSize/fw;
     133    unsigned field_count = 2 * mBitBlockWidth/fw;
    134134    Value * aVec = fwCast(fw/2, a);
    135135    Value * bVec = fwCast(fw/2, b);
     
    142142
    143143Value * IDISA_Builder::hsimd_packl(unsigned fw, Value * a, Value * b) {
    144     unsigned field_count = 2 * mBitBlockSize/fw;
     144    unsigned field_count = 2 * mBitBlockWidth/fw;
    145145    Value * aVec = fwCast(fw/2, a);
    146146    Value * bVec = fwCast(fw/2, b);
     
    154154Value * IDISA_Builder::hsimd_signmask(unsigned fw, Value * a) {
    155155    Value * mask = mLLVMBuilder->CreateICmpSLT(fwCast(fw, a), ConstantAggregateZero::get(fwVectorType(fw)));
    156     return mLLVMBuilder->CreateBitCast(mask, mLLVMBuilder->getIntNTy(mBitBlockSize/fw));
     156    return mLLVMBuilder->CreateBitCast(mask, mLLVMBuilder->getIntNTy(mBitBlockWidth/fw));
    157157}
    158158
     
    163163
    164164Value * IDISA_Builder::mvmd_dslli(unsigned fw, Value * a, Value * b, unsigned shift) {
    165     unsigned field_count = mBitBlockSize/fw;
     165    unsigned field_count = mBitBlockWidth/fw;
    166166    Value * aVec = fwCast(fw, a);
    167167    Value * bVec = fwCast(fw, b);
     
    174174
    175175Value * IDISA_Builder::bitblock_any(Value * a) {
    176     Type * iBitBlock = mLLVMBuilder->getIntNTy(mBitBlockSize);
     176    Type * iBitBlock = mLLVMBuilder->getIntNTy(mBitBlockWidth);
    177177    return mLLVMBuilder->CreateICmpNE(mLLVMBuilder->CreateBitCast(a, iBitBlock),  ConstantInt::get(iBitBlock, 0));
    178178}
Note: See TracChangeset for help on using the changeset viewer.