Ignore:
Timestamp:
Jan 13, 2018, 11:57:43 AM (14 months ago)
Author:
nmedfort
Message:

Pablo support for byte comparisions; LineFeed? kernel processes byte streams directly. Some clean up of PabloBuilder? functionality.

File:
1 edited

Legend:

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

    r5774 r5828  
    7575Value * IDISA_Builder::simd_fill(unsigned fw, Value * a) {
    7676    if (fw < 8) report_fatal_error("Unsupported field width: simd_fill " + std::to_string(fw));
    77    unsigned field_count = mBitBlockWidth/fw;
     77    const unsigned field_count = mBitBlockWidth/fw;
    7878    Type * singleFieldVecTy = VectorType::get(getIntNTy(fw), 1);
    7979    Value * aVec = CreateBitCast(a, singleFieldVecTy);
     
    8282
    8383Value * IDISA_Builder::simd_add(unsigned fw, Value * a, Value * b) {
    84     if (fw == 1) return simd_xor(a, b);
    85     if (fw < 8) {
     84    if (fw == 1) {
     85        return simd_xor(a, b);
     86    } else if (fw < 8) {
    8687        Constant * hi_bit_mask = Constant::getIntegerValue(getIntNTy(mBitBlockWidth),
    8788                                                           APInt::getSplat(mBitBlockWidth, APInt::getHighBitsSet(fw, 1)));
     
    271272}
    272273
    273 Value * IDISA_Builder::simd_cttz(unsigned fw, Value * a) {
    274     if (fw < 8) report_fatal_error("Unsupported field width: cttz " + std::to_string(fw));
    275     Value * cttzFunc = Intrinsic::getDeclaration(getModule(), Intrinsic::cttz, fwVectorType(fw));
    276     return CreateCall(cttzFunc, {fwCast(fw, a), ConstantInt::get(getInt1Ty(), 0)});
    277 }
    278 
    279 Value * IDISA_Builder::simd_popcount(unsigned fw, Value * a) {
    280     if (fw < 8) report_fatal_error("Unsupported field width: popcount " + std::to_string(fw));
    281     Value * ctpopFunc = Intrinsic::getDeclaration(getModule(), Intrinsic::ctpop, fwVectorType(fw));
    282     return CreateCall(ctpopFunc, fwCast(fw, a));
    283 }
    284 
    285274Value * IDISA_Builder::simd_bitreverse(unsigned fw, Value * a) {
    286275    /*  Pure sequential solution too slow!
Note: See TracChangeset for help on using the changeset viewer.