Changeset 2221


Ignore:
Timestamp:
Jun 25, 2012, 2:19:26 PM (7 years ago)
Author:
cameron
Message:

Merge cq, pending64

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/Compiler/pablo.py

    r2218 r2221  
    317317    #carry_args = [ast.Num(self.current_carry)]
    318318    #adv_n_args = [ast.Subscript(ast.Name(self.carryvar.id + '.pending64', ast.Load()), ast.Num(self.current_adv_n), ast.Load())]
    319     adv_n_pending = ast.Subscript(ast.Name(self.carryvar.id + '.pending64', ast.Load()), ast.Num(self.current_adv_n), ast.Load())
     319    #adv_n_pending = ast.Subscript(ast.Name(self.carryvar.id + '.pending64', ast.Load()), ast.Num(self.current_adv_n), ast.Load())
    320320    if self.carryin == "_ci":
    321321        carry_args = [mkCall(self.carryvar.id + "." + 'get_carry_in', [ast.Num(self.current_carry)]), ast.Num(self.current_carry)]
    322         adv_n_args = [adv_n_pending, ast.Num(self.current_adv_n)]
     322        adv_n_args = [mkCall(self.carryvar.id + "." + 'get_pending64', [ast.Num(self.current_adv_n)]), ast.Num(self.current_adv_n)]
    323323    else:
    324324        carry_args = [mkCall('simd<1>::constant<0>', []), ast.Num(self.current_carry)]
  • trunk/lib/carryQ.hpp

    r2213 r2221  
    4343#include <string.h>
    4444
     45
    4546// Array of BitBlock implementation.
    4647template <uint16_t CarryCount, uint16_t AdvanceNCount>
     
    5253    #define Carry1 simd<BLOCK_SIZE>::constant<1>()
    5354 
    54         BitBlock cq[CarryCount];
    55         BitBlock pending64[AdvanceNCount];
     55        BitBlock cq[CarryCount + AdvanceNCount];
     56        //BitBlock pending64[AdvanceNCount];
    5657        CarryArray()
    5758        {
    58             memset (cq, 0, sizeof(BitBlock) * CarryCount);// size_t num )
    59             memset(pending64, 0, sizeof(BitBlock) * AdvanceNCount);
     59            memset (cq, 0, sizeof(BitBlock) * (CarryCount + AdvanceNCount));
     60            //memset(pending64, 0, sizeof(BitBlock) * AdvanceNCount);
    6061        }
    6162        ~CarryArray() {}
     
    137138        {
    138139                BitBlock half_block_shifted = esimd<BLOCK_SIZE/2>::mergel(strm, pending_in);
    139                 pending64[pendingno] = bitblock::srli<BLOCK_SIZE/2>(strm);
     140                cq[CarryCount + pendingno] = bitblock::srli<BLOCK_SIZE/2>(strm);
     141                //pending64[pendingno] = bitblock::srli<BLOCK_SIZE/2>(strm);
    140142                BitBlock result = simd_or(simd<BLOCK_SIZE/2>::srli<(BLOCK_SIZE/2)-n>(half_block_shifted),
    141143                               simd<BLOCK_SIZE/2>::slli<n>(strm));
     
    177179        }
    178180
     181//      IDISA_ALWAYS_INLINE BitBlock get_pending64(uint16_t advance_n_blkno) const
     182//      {
     183//              return pending64[advance_n_blkno];
     184//      }
     185
     186        IDISA_ALWAYS_INLINE BitBlock get_pending64(uint16_t advance_n_blkno) const
     187        {
     188                return cq[CarryCount + advance_n_blkno];
     189        }
     190
    179191private:
    180192        // helpers
Note: See TracChangeset for help on using the changeset viewer.