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

mvmd_compress for SSE2, StreamCompress? bug fix

Location:
icGREP/icgrep-devel/icgrep/IR_Gen
Files:
2 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}
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_sse_builder.h

    r5979 r6024  
    33
    44/*
    5  *  Copyright (c) 2015 International Characters.
     5 *  Copyright (c) 2018 International Characters.
    66 *  This software is licensed to the public under the Open Software License 3.0.
    77 *  icgrep is a trademark of International Characters.
     
    2222    virtual std::string getBuilderUniqueName() override;
    2323    llvm::Value * hsimd_signmask(unsigned fw, llvm::Value * a) override;
     24    llvm::Value * mvmd_compress(unsigned fw, llvm::Value * a, llvm::Value * select_mask) override;
    2425    ~IDISA_SSE_Builder() {}
    2526};
Note: See TracChangeset for help on using the changeset viewer.