Changeset 179 for trunk/src/bitplex.c


Ignore:
Timestamp:
Jul 9, 2008, 12:17:19 PM (11 years ago)
Author:
lindanl
Message:

Templated SIMD Library - initial version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bitplex.c

    r113 r179  
    2020*/
    2121#endif
    22 
    23 
    24 
     22#ifdef TEMPLATED_SIMD_LIB
     23#define s2p_step(s0, s1, hi_mask, shift, p0, p1) \
     24{\
     25  BitBlock t0, t1;\
     26  t0 = simd_pack<16,h,h>(s0, s1);\
     27  t1 = simd_pack<16,l,l>(s0, s1);\
     28  p0 = simd_if(hi_mask, t0, simd_srli<16>(t1, shift));\
     29  p1 = simd_if(hi_mask, simd_slli<16>(t0, shift), t1);\
     30}
     31#endif
     32#ifndef TEMPLATED_SIMD_LIB
    2533#define s2p_step(s0, s1, hi_mask, shift, p0, p1) \
    2634{\
     
    3139  p1 = simd_if(hi_mask, simd_slli_16(t0, shift), t1);\
    3240}
     41#endif
    3342
    3443static inline void s2p_bytepack(BytePack s[], BitBlock p[]) {
     44#ifdef TEMPLATED_SIMD_LIB
     45    BitBlock mask_2 = simd_himask<2>();
     46    BitBlock mask_4 = simd_himask<4>();
     47    BitBlock mask_8 = simd_himask<8>();
     48#endif
     49#ifndef TEMPLATED_SIMD_LIB
    3550    BitBlock mask_2 = simd_himask_2;
    3651    BitBlock mask_4 = simd_himask_4;
    3752    BitBlock mask_8 = simd_himask_8;
     53#endif
    3854    BitBlock bit00224466_0, bit00224466_1, bit00224466_2, bit00224466_3;
    3955    BitBlock bit11335577_0, bit11335577_1, bit11335577_2, bit11335577_3;
     
    6177    s2p_step(bit33337777_0, bit33337777_1, mask_8, 4, p[3], p[7]);
    6278}
    63 
    64 
    6579Bitplex::Bitplex () {
    6680        x8basis = (BitBlockBasis *) simd_new(BUFFER_SIZE/PACKSIZE);
Note: See TracChangeset for help on using the changeset viewer.