Changeset 6102


Ignore:
Timestamp:
Jun 19, 2018, 11:43:28 AM (3 months ago)
Author:
cameron
Message:

Use CreateZExt instead of AVX-512 for vector zeroextend

File:
1 edited

Legend:

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

    r6101 r6102  
    789789            Idxs[i] = getInt32(i+fieldCount/2); // selects elements from first reg.
    790790        }
    791         Constant * low_indexes = ConstantVector::get({Idxs, fieldCount/2});
    792         Value * a_low = CreateShuffleVector(fwCast(8, a), UndefValue::get(fwVectorType(8)), low_indexes);
    793         Value * b_low = CreateShuffleVector(fwCast(8, b), UndefValue::get(fwVectorType(8)), low_indexes);
    794         Value * zext_func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx512_mask_pmovzxb_w_512);
    795         Constant * mask = ConstantInt::getAllOnesValue(getInt32Ty());
    796         Constant * zeroes = Constant::getNullValue(fwVectorType(16));
    797         Value * a_ext = CreateCall(zext_func, {a_low, zeroes, mask});
    798         Value * b_ext = CreateCall(zext_func, {b_low, zeroes, mask});
     791        Constant * high_indexes = ConstantVector::get({Idxs, fieldCount/2});
     792        Value * a_high = CreateShuffleVector(fwCast(8, a), UndefValue::get(fwVectorType(8)), high_indexes);
     793        Value * b_high = CreateShuffleVector(fwCast(8, b), UndefValue::get(fwVectorType(8)), high_indexes);
     794        Value * a_ext = CreateZExt(a_high, fwVectorType(16));
     795        Value * b_ext = CreateZExt(b_high, fwVectorType(16));
    799796        Value * rslt = simd_or(a_ext, simd_slli(16, b_ext, 8));
    800797        return rslt;
     
    845842        Value * a_low = CreateShuffleVector(fwCast(8, a), UndefValue::get(fwVectorType(8)), low_indexes);
    846843        Value * b_low = CreateShuffleVector(fwCast(8, b), UndefValue::get(fwVectorType(8)), low_indexes);
    847         Value * zext_func = Intrinsic::getDeclaration(getModule(), Intrinsic::x86_avx512_mask_pmovzxb_w_512);
    848         Constant * mask = ConstantInt::getAllOnesValue(getInt32Ty());
    849         Constant * zeroes = Constant::getNullValue(fwVectorType(16));
    850         Value * a_ext = CreateCall(zext_func, {a_low, zeroes, mask});
    851         Value * b_ext = CreateCall(zext_func, {b_low, zeroes, mask});
     844        Value * a_ext = CreateZExt(a_low, fwVectorType(16));
     845        Value * b_ext = CreateZExt(b_low, fwVectorType(16));
    852846        Value * rslt = simd_or(a_ext, simd_slli(16, b_ext, 8));
    853847        return rslt;
Note: See TracChangeset for help on using the changeset viewer.