Ignore:
Timestamp:
May 10, 2017, 4:26:11 PM (2 years ago)
Author:
nmedfort
Message:

Large refactoring step. Removed IR generation code from Kernel (formally KernelBuilder?) and moved it into the new KernelBuilder? class.

File:
1 edited

Legend:

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

    r5436 r5440  
    1717    if (mBitBlockWidth == 256) {
    1818        if (fw == 64) {
    19             Value * signmask_f64func = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx_movmsk_pd_256);
     19            Value * signmask_f64func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx_movmsk_pd_256);
    2020            Type * bitBlock_f64type = VectorType::get(getDoubleTy(), mBitBlockWidth/64);
    2121            Value * a_as_pd = CreateBitCast(a, bitBlock_f64type);
    2222            return CreateCall(signmask_f64func, a_as_pd);
    2323        } else if (fw == 32) {
    24             Value * signmask_f32func = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx_movmsk_ps_256);
     24            Value * signmask_f32func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx_movmsk_ps_256);
    2525            Type * bitBlock_f32type = VectorType::get(getFloatTy(), mBitBlockWidth/32);
    2626            Value * a_as_ps = CreateBitCast(a, bitBlock_f32type);
     
    3838            Type * halfBlock_f32type = VectorType::get(getFloatTy(), mBitBlockWidth/64);
    3939            Value * pack_as_ps = CreateBitCast(packh, halfBlock_f32type);
    40             Value * signmask_f32func = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx_movmsk_ps_256);
     40            Value * signmask_f32func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx_movmsk_ps_256);
    4141            return CreateCall(signmask_f32func, pack_as_ps);
    4242        }
     
    9696Value * IDISA_AVX2_Builder::esimd_mergeh(unsigned fw, Value * a, Value * b) {
    9797    if ((fw == 128) && (mBitBlockWidth == 256)) {
    98         Value * vperm2i128func = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx2_vperm2i128);
     98        Value * vperm2i128func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx2_vperm2i128);
    9999        return CreateCall(vperm2i128func, {fwCast(64, a), fwCast(64, b), getInt8(0x31)});
    100100    }
     
    105105Value * IDISA_AVX2_Builder::esimd_mergel(unsigned fw, Value * a, Value * b) {
    106106    if ((fw == 128) && (mBitBlockWidth == 256)) {
    107         Value * vperm2i128func = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx2_vperm2i128);
     107        Value * vperm2i128func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx2_vperm2i128);
    108108        return CreateCall(vperm2i128func, {fwCast(64, a), fwCast(64, b), getInt8(0x20)});
    109109    }
     
    114114Value * IDISA_AVX2_Builder::hsimd_packl_in_lanes(unsigned lanes, unsigned fw, Value * a, Value * b) {
    115115    if ((fw == 16)  && (lanes == 2)) {
    116         Value * vpackuswbfunc = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx2_packuswb);
     116        Value * vpackuswbfunc = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx2_packuswb);
    117117        Value * a_low = fwCast(16, simd_and(a, simd_lomask(fw)));
    118118        Value * b_low = fwCast(16, simd_and(b, simd_lomask(fw)));
     
    125125Value * IDISA_AVX2_Builder::hsimd_packh_in_lanes(unsigned lanes, unsigned fw, Value * a, Value * b) {
    126126    if ((fw == 16)  && (lanes == 2)) {
    127         Value * vpackuswbfunc = Intrinsic::getDeclaration(mMod, Intrinsic::x86_avx2_packuswb);
     127        Value * vpackuswbfunc = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx2_packuswb);
    128128        Value * a_low = simd_srli(fw, a, fw/2);
    129129        Value * b_low = simd_srli(fw, b, fw/2);
Note: See TracChangeset for help on using the changeset viewer.