Ignore:
Timestamp:
May 5, 2018, 1:25:24 PM (12 months ago)
Author:
cameron
Message:

Stream deletion bug fixes

File:
1 edited

Legend:

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

    r6012 r6014  
    292292        Type * v8xi32Ty = VectorType::get(getInt32Ty(), 8);
    293293        Type * v8xi1Ty = VectorType::get(getInt1Ty(), 8);
     294        Constant * mask0000000Fsplaat = ConstantVector::getSplat(8, ConstantInt::get(getInt32Ty(), 0xF));
    294295        Value * shuf32Func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx2_permd);
    295296        Value * PEXT_func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_bmi_pext_32);
     
    311312            Shifts[i] = getInt32(i*4);
    312313        }
    313         Value * compress = CreateCall(shuf32Func, {a, CreateLShr(bdcst, ConstantVector::get({Shifts, 8}))});
    314         Value * selectf = CreateBitCast(CreateTrunc(CreateSub(CreateShl(getInt32(1), field_count), getInt32(1)), getInt8Ty()), v8xi1Ty);
    315         return CreateSelect(selectf, ConstantVector::getNullValue(v8xi32Ty), compress);
     314        Value * shuf = CreateAnd(CreateLShr(bdcst, ConstantVector::get({Shifts, 8})), mask0000000Fsplaat);
     315        Value * compress = CreateCall(shuf32Func, {a, shuf});
     316        Value * field_mask = CreateTrunc(CreateSub(CreateShl(getInt32(1), field_count), getInt32(1)), getInt8Ty());
     317        Value * selectf = CreateBitCast(field_mask, v8xi1Ty);
     318        Value * result = CreateSelect(selectf, compress, ConstantVector::getNullValue(v8xi32Ty));
     319        return result;
    316320    }
    317321    return IDISA_Builder::mvmd_compress(fw, a, select_mask);
Note: See TracChangeset for help on using the changeset viewer.