Changeset 5625


Ignore:
Timestamp:
Aug 31, 2017, 11:29:59 PM (3 months ago)
Author:
xuedongx
Message:

add ExpandStream? kernel and small fix.

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

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/alignedprint.cpp

    r5440 r5625  
    9494}
    9595
     96void ExpandStream::generateDoBlockMethod(const std::unique_ptr<KernelBuilder> &iBuilder) {
     97    if (mSizeOutputStreamSet <= mSizeInputStreamSet)
     98        llvm::report_fatal_error("Stream Expanding fails.\n");
     99
     100    for (unsigned i = 0; i < mSizeOutputStreamSet; i++) {
     101        if (i < mSizeInputStreamSet) {
     102            Value * bitStrmVal = iBuilder->loadInputStreamBlock("bitStreams", iBuilder->getInt32(i));
     103            iBuilder->storeOutputStreamBlock("outputbitStreams", iBuilder->getInt32(i), bitStrmVal);
     104        } else {
     105            iBuilder->storeOutputStreamBlock("outputbitStreams", iBuilder->getInt32(i), iBuilder->bitCast(Constant::getNullValue(iBuilder->getBitBlockType())));
     106        }
     107    }
     108   
     109}
     110
    96111void PrintStreamSet::generateDoBlockMethod(const std::unique_ptr<KernelBuilder> &iBuilder) {
    97112
     
    266281}
    267282
     283ExpandStream::ExpandStream(const std::unique_ptr<kernel::KernelBuilder> & builder, unsigned sizeInputStreamSet, unsigned sizeOutputStreamSet)
     284: BlockOrientedKernel("ExpandStream", {Binding{builder->getStreamSetTy(sizeInputStreamSet), "bitStreams"}}, {Binding{builder->getStreamSetTy(sizeOutputStreamSet), "outputbitStreams"}}, {}, {}, {}), mSizeInputStreamSet(sizeInputStreamSet), mSizeOutputStreamSet(sizeOutputStreamSet) {
     285    setNoTerminateAttribute(true);
     286
     287}
     288
    268289PrintStreamSet::PrintStreamSet(const std::unique_ptr<kernel::KernelBuilder> & builder, std::vector<std::string> && names, const unsigned minWidth)
    269290: BlockOrientedKernel("PrintableStreamSet", {}, {}, {}, {}, {})
  • icGREP/icgrep-devel/icgrep/kernels/alignedprint.h

    r5440 r5625  
    2828};
    2929
     30class ExpandStream final : public BlockOrientedKernel {
     31public:
     32    ExpandStream(const std::unique_ptr<kernel::KernelBuilder> & builder, unsigned sizeInputStreamSet, unsigned sizeOutputStreamSet);
     33private:
     34    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
     35    unsigned mSizeInputStreamSet;
     36    unsigned mSizeOutputStreamSet;
     37};
     38
    3039class PrintStreamSet final : public BlockOrientedKernel {
    3140public:
  • icGREP/icgrep-devel/icgrep/kernels/delmask_kernel.cpp

    r5589 r5625  
    9898    it.createAssign(error_mask, u8invalid);
    9999   
    100     it.createAssign(delmask, it.createOr(it.createOr(del3, del4), ccc.compileCC(re::makeCC(0xC0, 0xFF), it)));
    101     it.createAssign(neg_delmask, it.createNot(delmask));
     100    it.createAssign(delmask, it.createInFile(it.createOr(it.createOr(del3, del4), ccc.compileCC(re::makeCC(0xC0, 0xFF), it))));
     101    it.createAssign(neg_delmask, it.createInFile(it.createNot(delmask)));
    102102   
    103103    Var * delmask_out = this->getOutputStreamVar("delMask");
Note: See TracChangeset for help on using the changeset viewer.