Changeset 5976


Ignore:
Timestamp:
Apr 18, 2018, 6:47:26 AM (12 months ago)
Author:
cameron
Message:

Incorporating Avery's improved esimd-bitspread: 5% speedup of icgrep

Location:
icGREP/icgrep-devel/icgrep/IR_Gen
Files:
2 edited

Legend:

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

    r5975 r5976  
    313313}
    314314
    315 
    316 }
     315llvm::Value * IDISA_AVX512F_Builder::esimd_bitspread(unsigned fw, llvm::Value * bitmask) {
     316   
     317    if (mBitBlockWidth == 512 && fw == 64) {
     318        Value * broadcastFunc = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx512_mask_broadcasti64x4_512);
     319        Value * broadcastMask = CreateZExtOrTrunc(bitmask, getInt8Ty());
     320       
     321        const unsigned int srcFieldCount = 8;
     322        Constant * srcArr[srcFieldCount];
     323        for (unsigned int i = 0; i < srcFieldCount; i++) {
     324            srcArr[i] = getInt64(0);
     325        }
     326        Constant * src = ConstantVector::get({srcArr, srcFieldCount});
     327       
     328        const unsigned int aFieldCount = 4;
     329        Constant * aArr[aFieldCount];
     330        for (unsigned int i = 0; i < aFieldCount; i++) {
     331            aArr[i] = getInt64(1);
     332        }
     333        Constant * a = ConstantVector::get({aArr, aFieldCount});
     334       
     335        return CreateCall(broadcastFunc, {a, src, broadcastMask});
     336    }
     337   
     338    return IDISA_Builder::esimd_bitspread(fw, bitmask);
     339}
     340
     341
     342
     343}
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_avx_builder.h

    r5975 r5976  
    6363    llvm::Value * hsimd_packh(unsigned fw, llvm::Value * a, llvm::Value * b) override;
    6464    llvm::Value * hsimd_packl(unsigned fw, llvm::Value * a, llvm::Value * b) override;
    65    
     65    llvm::Value * esimd_bitspread(unsigned fw, llvm::Value * bitmask);
     66
    6667    ~IDISA_AVX512F_Builder() {}
    6768};
Note: See TracChangeset for help on using the changeset viewer.