Ignore:
Timestamp:
Oct 24, 2017, 1:10:49 PM (21 months ago)
Author:
cameron
Message:

Drop linebreak normalization; add1 attribute for grep kernel; pablo indexed advance initial check-in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r5586 r5705  
    6868
    6969inline static bool isNonAdvanceCarryGeneratingStatement(const Statement * const stmt) {
    70     return isa<CarryProducingStatement>(stmt) && !isa<Advance>(stmt);
     70    return isa<CarryProducingStatement>(stmt) && !isa<Advance>(stmt) && !isa<IndexedAdvance>(stmt);
    7171}
    7272
     
    610610}
    611611
     612Value * CarryManager::indexedAdvanceCarryInCarryOut(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, const IndexedAdvance * const advance, Value * const value, Value * const index_strm) {
     613    llvm::report_fatal_error("IndexedAdvance not yet supported.");
     614}
     615
    612616/** ------------------------------------------------------------------------------------------------------------- *
    613617 * @brief longAdvanceCarryInCarryOut
     
    922926    Type * const carryPackType = (loopDepth == 0) ? carryTy : ArrayType::get(carryTy, 2);
    923927    std::vector<Type *> state;
    924 
    925928    for (const Statement * stmt : *scope) {
    926929        if (LLVM_UNLIKELY(isa<Advance>(stmt))) {
     
    939942            }
    940943            state.push_back(type);
     944        } else if (LLVM_UNLIKELY(isa<IndexedAdvance>(stmt))) {
     945            // The carry data for the indexed advance stores N bits of carry data,
     946            // organized in packs that can be processed with GR instructions (such as PEXT, PDEP, popcount).
     947            // A circular buffer is used.  Because the number of bits to be dequeued
     948            // and enqueued is variable (based on the popcount of the index), an extra
     949            // pack stores the offset position in the circular buffer.
     950            const auto amount = cast<IndexedAdvance>(stmt)->getAmount();
     951            const auto packWidth = sizeof(size_t) * 8;
     952            const auto packs = ceil_udiv(amount, packWidth);
     953            state.push_back(ArrayType::get(iBuilder->getSizeTy(), nearest_pow2(packs) + 1));
    941954        } else if (LLVM_UNLIKELY(isNonAdvanceCarryGeneratingStatement(stmt))) {
    942955            state.push_back(carryPackType);
Note: See TracChangeset for help on using the changeset viewer.