Changeset 5884 for icGREP/icgrep-devel


Ignore:
Timestamp:
Feb 28, 2018, 3:58:31 PM (13 months ago)
Author:
cameron
Message:

Fix so that AVX builder does not use an AVX2 pmovmskb

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

Legend:

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

    r5871 r5884  
    2929            Value * a_as_ps = CreateBitCast(a, bitBlock_f32type);
    3030            return CreateCall(signmask_f32func, a_as_ps);
    31         } else if (fw == 8) {
    32             Value * signmask_f8func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx2_pmovmskb);
    33             Type * bitBlock_i8type = VectorType::get(getInt8Ty(), mBitBlockWidth/8);
    34             Value * a_as_ps = CreateBitCast(a, bitBlock_i8type);
    35             return CreateCall(signmask_f8func, a_as_ps);
    3631        }
    3732    } else if (mBitBlockWidth == 512) {
     
    246241    }
    247242}
     243   
     244Value * IDISA_AVX2_Builder::hsimd_signmask(unsigned fw, Value * a) {
     245    // AVX2 special cases
     246    if (mBitBlockWidth == 256) {
     247        if (fw == 8) {
     248            Value * signmask_f8func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx2_pmovmskb);
     249            Type * bitBlock_i8type = VectorType::get(getInt8Ty(), mBitBlockWidth/8);
     250            Value * a_as_ps = CreateBitCast(a, bitBlock_i8type);
     251            return CreateCall(signmask_f8func, a_as_ps);
     252        }
     253    }
     254    // Otherwise use default SSE logic.
     255    return IDISA_AVX_Builder::hsimd_signmask(fw, a);
     256}
    248257
    249258std::string IDISA_AVX512BW_Builder::getBuilderUniqueName() {
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_avx_builder.h

    r5871 r5884  
    4747    std::pair<llvm::Value *, llvm::Value *> bitblock_add_with_carry(llvm::Value * a, llvm::Value * b, llvm::Value * carryin) override;
    4848    std::pair<llvm::Value *, llvm::Value *> bitblock_indexed_advance(llvm::Value * a, llvm::Value * index_strm, llvm::Value * shiftin, unsigned shift) override;
     49    llvm::Value * hsimd_signmask(unsigned fw, llvm::Value * a) override;
    4950
    5051    ~IDISA_AVX2_Builder() {}
Note: See TracChangeset for help on using the changeset viewer.