Changeset 318 for trunk/lib/sse_simd_t.h


Ignore:
Timestamp:
Oct 12, 2009, 1:57:15 PM (10 years ago)
Author:
ksherdy
Message:

Define simd_mask_true function for SSE.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/sse_simd_t.h

    r317 r318  
    410410
    411411#define simd_all_eq_8(v1, v2) simd_all_true<8>(_mm_cmpeq_epi8(v1, v2))
     412#define simd_mask_eq_8(v1, v2, hex_mask) simd_mask_true<8>(_mm_cmpeq_epi8(v1, v2), hex_mask)
    412413#define simd_all_le_8(v1, v2) simd_all_eq_8(simd_max_8(v1, v2), v2)
    413414
     
    434435inline int simd_any_true<8>(SIMD_type r) {
    435436        return _mm_movemask_epi8(r) != 0;
     437}
     438
     439/* simd_mask_true
     440 * fw: 8*/
     441template<int fw>
     442static inline int simd_mask_true(SIMD_type v, int mask_16_bit) {
     443        return (_mm_movemask_epi8(v) & mask_16_bit) == mask_16_bit;
    436444}
    437445
Note: See TracChangeset for help on using the changeset viewer.