Changeset 379


Ignore:
Timestamp:
Mar 19, 2010, 5:59:03 PM (9 years ago)
Author:
ksherdy
Message:

Added high mask and comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/sse_simd_t.h

    r343 r379  
    108108         * followed by fw/2 0 bits. */
    109109        static inline SIMD_type himask();
     110
     111        /* The himask selector in which each field is fw/2 0 bits,
     112         * followed by fw/2 1 bits. */ 
     113        static inline SIMD_type lomask();
    110114       
    111115        /* Splat constant generator with compile-time constant. */
     
    180184template<> inline SIMD_type simd<128>::himask() {return _mm_set_epi32(-1,-1,0,0);}
    181185
     186template<> inline SIMD_type simd<16>::lomask() {return _mm_set1_epi16(0x00FF);}
     187
     188template<> inline SIMD_type simd<32>::lomask() {return _mm_set1_epi32(0x0000FFFF);}
     189
     190template<> inline SIMD_type simd<64>::lomask() {return _mm_set_epi32(0,-1,0,-1);}
     191
     192template<> inline SIMD_type simd<128>::lomask() {return _mm_set_epi32(0,0,-1,-1);}
     193
    182194template<> template <int n> inline SIMD_type simd<4>::constant() {return _mm_set1_epi8((n)<<4|(n));}
    183195
     
    221233// Shuffle 8-bit
    222234template <> inline SIMD_type simd<8>::shuffle(SIMD_type r, SIMD_type s) {
    223   return _mm_shuffle_epi8(r,s);
     235  return _mm_shuffle_epi8(r,s); // SSSE3 dependency
    224236}
    225237
     
    468480  #endif
    469481
    470   // Fall back
     482  // Fall back, SSSE3 dependency
    471483  return  simd_or (_mm_shuffle_epi8(simd_andc(r1, simd<32>::himask()), _mm_set_epi8(0,1,4,5,8,9,12,13,2,3,6,7,10,11,14,15)),
    472484                     _mm_shuffle_epi8(simd_andc(r2, simd<32>::himask()), _mm_set_epi8(2,3,6,7,10,11,14,15,0,1,4,5,8,9,12,13)));
Note: See TracChangeset for help on using the changeset viewer.