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/carrypack_manager.cpp

    r5630 r5705  
    625625}
    626626
     627
     628Value * CarryManager::indexedAdvanceCarryInCarryOut(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, const IndexedAdvance * const advance, Value * const value, Value * const index_strm) {
     629    report_fatal_error("IndexedAdvance not yet supported.");
     630}
     631
     632
     633
    627634/** ------------------------------------------------------------------------------------------------------------- *
    628635 * @brief longAdvanceCarryInCarryOut
     
    10321039            bool canPack = true;
    10331040            if (LLVM_LIKELY(isa<Advance>(stmt))) {
     1041                amount = cast<Advance>(stmt)->getAmount();
     1042                canPack = (amount < mElementWidth);
     1043            }
     1044            else if (isa<IndexedAdvance>(stmt)) {
    10341045                amount = cast<Advance>(stmt)->getAmount();
    10351046                canPack = (amount < mElementWidth);
     
    10921103            if (carryGroup.groupSize == 0) {
    10931104                Type * packTy = carryPackTy;
    1094                 if (LLVM_LIKELY(isa<Advance>(stmt))) {
     1105                if (LLVM_UNLIKELY(isa<Advance>(stmt))) {
    10951106                    const auto amount = cast<Advance>(stmt)->getAmount();
    10961107                    if (LLVM_UNLIKELY(amount >= mElementWidth)) {
     
    11031114                        packTy = ArrayType::get(carryTy, nearest_pow2(blocks + ((loopDepth != 0) ? 1 : 0)));
    11041115                    }
     1116                }
     1117                if (LLVM_UNLIKELY(isa<IndexedAdvance>(stmt))) {
     1118                    // The carry data for the indexed advance stores N bits of carry data,
     1119                    // organized in packs that can be processed with GR instructions (such as PEXT, PDEP, popcount).
     1120                    // A circular buffer is used.  Because the number of bits to be dequeued
     1121                    // and enqueued is variable (based on the popcount of the index), an extra
     1122                    // pack stores the offset position in the circular buffer.
     1123                    const auto amount = cast<IndexedAdvance>(stmt)->getAmount();
     1124                    const auto packWidth = sizeof(size_t) * 8;
     1125                    const auto packs = ceil_udiv(amount, packWidth);
     1126                    packTy = ArrayType::get(iBuilder->getSizeTy(), nearest_pow2(packs) + 1);
    11051127                }
    11061128                state.push_back(packTy);
Note: See TracChangeset for help on using the changeset viewer.