Changeset 1694


Ignore:
Timestamp:
Nov 18, 2011, 7:44:21 PM (6 years ago)
Author:
ksherdy
Message:

Fixed BitBlock_advance32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/carryQ.hpp

    r1663 r1694  
    2626 */
    2727
    28 #define simd_slli_32(r, shft) _mm_slli_epi32(r, shft)
    29 #define simd_srli_32(r, shft) _mm_srli_epi32(r, shft)
    30 #define interpose32(x,y,pos) interpose<pos>(x,y)
     28#define interpose32(x,y,pos) interpose32_<pos>(x,y)     
    3129template<uint32_t n>
    32 IDISA_ALWAYS_INLINE BitBlock interpose(BitBlock s, BitBlock s32) {
     30IDISA_ALWAYS_INLINE BitBlock interpose32_(BitBlock s, BitBlock s32) {
    3331        return simd_or(simd<32>::slli<n>(s), simd<32>::srli<32-n>(s32));
    3432}
     
    4644        IDISA_ALWAYS_INLINE BitBlock BitBlock_scanthru_ci_co(BitBlock markers0, BitBlock charclass, uint16_t carryno);
    4745        IDISA_ALWAYS_INLINE BitBlock BitBlock_scanthru_co(BitBlock markers0, BitBlock charclass, uint16_t carryno);
    48         IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t & pending32);
    49         IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_co(BitBlock strm, uint32_t & pending32);
     46        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t & pending);
     47        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_co(BitBlock strm, uint32_t & pending);
    5048        IDISA_ALWAYS_INLINE bool CarryTest(uint16_t carryno, uint16_t carry_count);
    5149        IDISA_ALWAYS_INLINE void CarryDequeueEnqueue(uint16_t carryno, uint16_t carry_count);
     
    127125                BitBlock marker;
    128126                BitBlock c = carry_flip(cq[carryno]);
    129             adc(simd<128>::constant<0>(), simd_not(charclass), c, marker);
    130             cq[carryno] = carry_flip(c);
    131             return simd_and(marker, charclass);
     127                adc(simd<BLOCK_SIZE>::constant<0>(), simd_not(charclass), c, marker);
     128                cq[carryno] = carry_flip(c);
     129                return simd_and(marker, charclass);
    132130        }
    133131
     
    147145        }
    148146
    149         IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t & pending32)
    150         {
    151                 uint32_t temp = pending32;
    152                 pending32 = (uint32_t) mvmd<32>::extract<3>(strm);
    153                 return mvmd<32>::dslli<1>(strm, mvmd128<BLOCK_SIZE>::fill((uint32_t)temp));
    154         }
    155 
    156 /*
    157         static inline BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t & pending32){
    158                 uint32_t temp = pending32;
    159                 pending32 = sisd_to_int(sisd_srli(strm,96));
     147        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t & pending)
     148        {
     149                uint32_t temp = pending;
     150                pending = (uint32_t) mvmd<32>::extract< (sizeof(BitBlock)/sizeof(pending))-1 >(strm);
     151                return simd_or(simd<BLOCK_SIZE>::slli<32>(strm), mvmd<BLOCK_SIZE>::fill((uint64_t)temp));
     152        }
     153
     154        /*
     155        static inline BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t & pending){
     156                uint32_t temp = pending;
     157                pending = sisd_to_int(sisd_srli(strm,96));
    160158                return simd_or(sisd_slli(strm, 32), sisd_from_int(temp));
    161159        }
    162  */
    163 
    164         IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_co(BitBlock strm, uint32_t & pending32)
    165         {
    166                 pending32 = (uint32_t) mvmd<32>::extract<3>(strm);
     160        */
     161
     162        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_co(BitBlock strm, uint32_t & pending)
     163        {
     164                pending = (uint32_t) mvmd<32>::extract<(sizeof(BitBlock)/sizeof(pending))-1>(strm);
    167165                return mvmd<32>::slli<1>(strm);
    168166        }
    169167
    170 /*
    171         static inline BitBlock BitBlock_advance32_co(BitBlock strm, uint32_t & pending32) {
    172                 pending32 = sisd_to_int(sisd_srli(strm,96));
     168        /*
     169        static inline BitBlock BitBlock_advance32_co(BitBlock strm, uint32_t & pending) {
     170                pending = sisd_to_int(sisd_srli(strm,96));
    173171                return sisd_slli(strm, 32);
    174172        }
    175 
    176  */
     173        */
    177174
    178175        IDISA_ALWAYS_INLINE bool CarryTest(uint16_t carryno, uint16_t carry_count)
Note: See TracChangeset for help on using the changeset viewer.