Changeset 6094


Ignore:
Timestamp:
Jun 15, 2018, 9:21:34 AM (3 months ago)
Author:
cameron
Message:

mvmd_compress 32 for SSE2

Location:
icGREP/icgrep-devel/icgrep
Files:
3 edited

Legend:

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

    r6092 r6094  
    703703}
    704704
    705 
    706705Value * IDISA_Builder::bitblock_mask_from(Value * pos) {
    707706    Value * p = CreateZExtOrTrunc(pos, getSizeTy());
  • icGREP/icgrep-devel/icgrep/IR_Gen/idisa_sse_builder.cpp

    r6087 r6094  
    77#include "idisa_sse_builder.h"
    88#include <llvm/IR/Intrinsics.h>
     9#include <llvm/IR/Module.h>
    910
    1011using namespace llvm;
     
    185186        return simd_or(kept, shifted);
    186187    }
     188    if ((mBitBlockWidth == 128) && (fw == 32)) {
     189        Value * bdcst = simd_fill(32, CreateZExtOrTrunc(selector, getInt32Ty()));
     190        Constant * fieldBit[4] =
     191        {ConstantInt::get(getInt32Ty(), 1), ConstantInt::get(getInt32Ty(), 2),
     192            ConstantInt::get(getInt32Ty(), 4), ConstantInt::get(getInt32Ty(), 8)};
     193        Constant * fieldMask = ConstantVector::get({fieldBit, 4});
     194        Value * a_selected = simd_and(simd_eq(32, fieldMask, simd_and(fieldMask, bdcst)), a);
     195        Constant * rotateInwards[4] =
     196        {ConstantInt::get(getInt32Ty(), 1), ConstantInt::get(getInt32Ty(), 0),
     197            ConstantInt::get(getInt32Ty(), 3), ConstantInt::get(getInt32Ty(), 2)};
     198        Constant * rotateVector = ConstantVector::get({rotateInwards, 4});
     199        Value * rotated = CreateShuffleVector(fwCast(32, a_selected), UndefValue::get(fwVectorType(fw)), rotateVector);
     200        Constant * rotate_bit[2] = {ConstantInt::get(getInt64Ty(), 2), ConstantInt::get(getInt64Ty(), 4)};
     201        Constant * rotate_mask = ConstantVector::get({rotate_bit, 2});
     202        Value * rotateControl = simd_eq(64, fwCast(64, simd_and(bdcst, rotate_mask)), allZeroes());
     203        Value * centralResult = simd_if(1, rotateControl, rotated, a_selected);
     204        Value * delete_marks_lo = CreateAnd(CreateNot(selector), ConstantInt::get(selector->getType(), 3));
     205        Value * delCount_lo = CreateSub(delete_marks_lo, CreateLShr(delete_marks_lo, 1));
     206        return mvmd_srl(32, centralResult, delCount_lo);
     207    }
    187208    return IDISA_Builder::mvmd_compress(fw, a, selector);
    188209}
  • icGREP/icgrep-devel/icgrep/kernels/deletion.cpp

    r6085 r6094  
    339339    Value * shftBack = b->CreateSub(numFieldConst, pendingFieldIdx);
    340340    for (unsigned i = 0; i < mStreamCount; i++) {
    341         Value * outputFwd = b->mvmd_sll(fw, outputFields[i], pendingFieldIdx);
     341        Value * outputFwd = b->fwCast(fw, b->mvmd_sll(fw, outputFields[i], pendingFieldIdx));
    342342        outputFwd = b->CreateSelect(pendingSpaceFilled, zeroSplat, outputFwd);
    343343        pendingOutput[i] = b->simd_or(pendingOutput[i], outputFwd);
Note: See TracChangeset for help on using the changeset viewer.