Changeset 6075


Ignore:
Timestamp:
Jun 8, 2018, 2:50:10 PM (4 months ago)
Author:
cameron
Message:

Final block processing for u32u8 mask calculation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/u32u8.cpp

    r6071 r6075  
    8787private:
    8888    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b) override;
     89    void generateFinalBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & b, llvm::Value * const remainingBytes) override;
    8990    const unsigned mDepositFieldWidth;
    9091};
     
    9596            {Binding{b->getStreamSetTy(1, 1), "fieldDepositMask", FixedRate(4)},
    9697                Binding{b->getStreamSetTy(1, 1), "codeUnitCounts", FixedRate(4), RoundUpTo(b->getBitBlockWidth())}},
    97             {}, {}, {}), mDepositFieldWidth(depositFieldWidth) {
     98            {}, {}, {Binding{b->getBitBlockType(), "EOFmask"}}), mDepositFieldWidth(depositFieldWidth) {
    9899}
    99100
     
    124125    //  interleave u8len3|u8len4, allOnes() for bits 1, 3:  x..., ..x.
    125126    //  interleave prefix4, u8len2|u8len3|u8len4 for bits 0, 2:  .x.., ...x
    126     Value * maskA_lo = b->esimd_mergel(1, u8len34, b->allOnes());
    127     Value * maskA_hi = b->esimd_mergeh(1, u8len34, b->allOnes());
     127    Value * fileExtentMask = b->CreateNot(b->getScalarField("EOFmask"));
     128   
     129    Value * maskA_lo = b->esimd_mergel(1, u8len34, fileExtentMask);
     130    Value * maskA_hi = b->esimd_mergeh(1, u8len34, fileExtentMask);
    128131    Value * maskB_lo = b->esimd_mergel(1, u8len4, nonASCII);
    129132    Value * maskB_hi = b->esimd_mergeh(1, u8len4, nonASCII);
     
    142145    }
    143146}
     147void UTF8fieldDepositMask::generateFinalBlockMethod(const std::unique_ptr<KernelBuilder> & b, Value * const remainingBytes) {
     148    // Standard Pablo convention for final block processing: set a bit marking
     149    // the position just past EOF, as well as a mask marking all positions past EOF.
     150    b->setScalarField("EOFmask", b->bitblock_mask_from(remainingBytes));
     151    CreateDoBlockMethodCall(b);
     152}
     153
    144154
    145155//
Note: See TracChangeset for help on using the changeset viewer.