Changeset 2207 for trunk


Ignore:
Timestamp:
Jun 4, 2012, 7:06:25 PM (7 years ago)
Author:
cameron
Message:

Library support for pablo.Advance(strm, n)

Location:
trunk/lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/carryQ.hpp

    r2128 r2207  
    3535}
    3636
     37template<uint32_t n>
     38IDISA_ALWAYS_INLINE BitBlock interpose64_(BitBlock s, BitBlock s64) {
     39        return simd_or(simd<64>::slli<n>(s), simd<64>::srli<64-n>(s64));
     40}
     41
    3742// Abstract Base Class
    3843class ICarryQueue {
     
    4550        IDISA_ALWAYS_INLINE BitBlock BitBlock_scanthru_ci_co(BitBlock markers0, BitBlock charclass, BitBlock carryin, uint16_t carryno);
    4651        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t pending_in, uint32_t & pending_out);
     52        template <int n> IDISA_ALWAYS_INLINE BitBlock BitBlock_advance_n_(BitBlock strm, BitBlock pending_in, uint16_t pendingno);
    4753
    4854        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance_then_scanthru(BitBlock markers0, BitBlock charclass, BitBlock carryin, uint16_t carryno);
     
    6975
    7076// Array of BitBlock implementation.
    71 template <uint16_t CarryCount>
     77template <uint16_t CarryCount, uint16_t AdvanceNCount>
    7278class CarryArray: public ICarryQueue{
    7379
     
    7783    #define Carry1 simd<BLOCK_SIZE>::constant<1>()
    7884 
     85        BitBlock cq[CarryCount];
     86        BitBlock pending64[AdvanceNCount];
    7987        CarryArray()
    8088        {
    8189            memset (cq, 0, sizeof(BitBlock) * CarryCount);// size_t num )
     90            memset(pending64, 0, sizeof(BitBlock) * AdvanceNCount);
    8291        }
    8392        ~CarryArray() {}
     
    123132        {
    124133                BitBlock markers1;
    125                 assert(!bitblock::any(simd_and(markers0, charclass)));
     134                //assert(!bitblock::any(simd_and(markers0, charclass)));
    126135                adc(markers0, simd_or(charclass, markers0), carryin, cq[carryno], markers1);
    127136                return simd_andc(markers1, charclass);
     
    156165        }
    157166
     167        template <int n> IDISA_ALWAYS_INLINE BitBlock BitBlock_advance_n_(BitBlock strm, BitBlock pending_in, uint16_t pendingno)
     168        {
     169                BitBlock half_block_shifted = esimd<BLOCK_SIZE/2>::mergel(strm, pending_in);
     170                pending64[pendingno] = bitblock::srli<BLOCK_SIZE/2>(strm);
     171                BitBlock result = simd_or(simd<BLOCK_SIZE/2>::srli<(BLOCK_SIZE/2)-n>(half_block_shifted),
     172                               simd<BLOCK_SIZE/2>::slli<n>(strm));
     173                return result;
     174        }
     175
    158176        IDISA_ALWAYS_INLINE bool CarryTest(uint16_t carryno, uint16_t carry_count)
     177
     178
    159179        {
    160180                  BitBlock c1 = cq[carryno];
     
    190210
    191211private:
    192         BitBlock cq[CarryCount];
    193 
    194212        // helpers
    195213        IDISA_ALWAYS_INLINE BitBlock carry_flip(BitBlock carry) const
  • trunk/lib/perflib/BOM_Profiler.h

    r2188 r2207  
    179179#ifdef PERF_SCRIPT
    180180    if (cum_count>total_count*0.9){
    181       fprintf(stderr,"%lli ",cum_avg);
     181      fprintf(stderr,"%lu ",cum_avg);
    182182      break;
    183183    }
Note: See TracChangeset for help on using the changeset viewer.