Changeset 1659 for trunk/lib/carryQ.hpp


Ignore:
Timestamp:
Nov 5, 2011, 8:10:59 AM (8 years ago)
Author:
ksherdy
Message:

Added advance32, interpose.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/carryQ.hpp

    r1544 r1659  
    1111
    1212#include "bitblock.hpp"
    13 
    14 //#include "../../trunk/lib/bitblock.hpp"
    1513#include "stdio.h"
    1614
     
    2826 */
    2927
     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
     31static IDISA_ALWAYS_INLINE BitBlock interpose32(BitBlock s, BitBlock s32, const uint32_t n);
     32IDISA_ALWAYS_INLINE BitBlock interpose32(BitBlock s, BitBlock s32, const uint32_t n) {
     33        return simd_or(simd::slli_32(s, n), simd_srli_32(s32, 32-n));
     34}
     35
    3036// Abstract Base Class
    3137class ICarryQueue {
     
    4046        IDISA_ALWAYS_INLINE BitBlock BitBlock_scanthru_ci_co(BitBlock markers0, BitBlock charclass, uint16_t carryno);
    4147        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);
    4250        IDISA_ALWAYS_INLINE bool CarryTest(uint16_t carryno, uint16_t carry_count);
    4351        IDISA_ALWAYS_INLINE void CarryDequeueEnqueue(uint16_t carryno, uint16_t carry_count);
     
    6371        CarryArray()
    6472        {
    65                 Carry0 = simd< sizeof(BitBlock)*8 >::constant<0>();
    66                 Carry1 = simd< sizeof(BitBlock)*8 >::constant<1>();
     73                Carry0 = simd::constant<0>();
     74                Carry1 = simd::constant<1>();
    6775
    6876                memset (cq, 0, sizeof(BitBlock) * CarryCount);// size_t num )
     
    138146                return simd_andc(markers1, charclass);
    139147        }
     148
     149        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t & pending32)
     150        {
     151                uint32_t temp = pending32;
     152                pending32 = mvmd<32>::extract<0>((simd::srli<96>(strm)));
     153                return simd_or(simd::slli<32>(strm), mvmd<32>::extract<0>(temp));
     154
     155        }
     156
     157/*
     158        static inline BitBlock BitBlock_advance32_ci_co(BitBlock strm, uint32_t & pending32){
     159                uint32_t temp = pending32;
     160                pending32 = sisd_to_int(sisd_srli(strm,96));
     161                return simd_or(sisd_slli(strm, 32), sisd_from_int(temp));
     162        }
     163 */
     164
     165        IDISA_ALWAYS_INLINE BitBlock BitBlock_advance32_co(BitBlock strm, uint32_t & pending32)
     166        {
     167                pending32 = mvmd<32>::extract<0>((simd::srli<96>(strm)));
     168                return simd::slli<32>(strm);
     169        }
     170
     171/*
     172        static inline BitBlock BitBlock_advance32_co(BitBlock strm, uint32_t & pending32) {
     173                pending32 = sisd_to_int(sisd_srli(strm,96));
     174                return sisd_slli(strm, 32);
     175        }
     176
     177 */
    140178
    141179        IDISA_ALWAYS_INLINE bool CarryTest(uint16_t carryno, uint16_t carry_count)
Note: See TracChangeset for help on using the changeset viewer.