Ignore:
Timestamp:
May 8, 2018, 9:26:02 AM (12 months ago)
Author:
cameron
Message:

mvmd_compress for SSE2, StreamCompress? bug fix

File:
1 edited

Legend:

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

    r5832 r6024  
    153153}
    154154
     155Value * IDISA_SSE_Builder::mvmd_compress(unsigned fw, Value * a, Value * selector) {
     156    if ((mBitBlockWidth == 128) && (fw == 64)) {
     157        Constant * keep[2] = {ConstantInt::get(getInt64Ty(), 1), ConstantInt::get(getInt64Ty(), 3)};
     158        Constant * keep_mask = ConstantVector::get({keep, 2});
     159        Constant * shift[2] = {ConstantInt::get(getInt64Ty(), 2), ConstantInt::get(getInt64Ty(), 0)};
     160        Constant * shifted_mask = ConstantVector::get({shift, 2});
     161        Value * a_srli1 = mvmd_srli(64, a, 1);
     162        Value * bdcst = simd_fill(64, CreateZExt(selector, getInt64Ty()));
     163        Value * kept = simd_and(simd_eq(64, simd_and(keep_mask, bdcst), keep_mask), a);
     164        Value * shifted = simd_and(a_srli1, simd_eq(64, shifted_mask, bdcst));
     165        return simd_or(kept, shifted);
     166    }
     167    return IDISA_Builder::mvmd_compress(fw, a, selector);
    155168}
     169
     170
     171}
Note: See TracChangeset for help on using the changeset viewer.