Changeset 469 for trunk


Ignore:
Timestamp:
Jul 12, 2010, 10:06:37 AM (9 years ago)
Author:
cameron
Message:

simd_packus_16, simd_pack_16_hh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/sse_simd.h

    r414 r469  
    7171#define simd_sll_64(r, shft_reg) _mm_sll_epi64(r, shft_reg)
    7272#define simd_srl_64(r, shft_reg) _mm_srl_epi64(r, shft_reg)
     73#define simd_packus_16(a, b) _mm_packus_epi16(b, a)
    7374#define simd_pack_16(a, b) \
    7475  _mm_packus_epi16(simd_andc(b, simd_himask_16), simd_andc(a, simd_himask_16))
     
    133134#define simd_const_1(n) \
    134135  (n==0 ? simd_const_8(0): simd_const_8(-1))
    135 
    136 #define simd_pack_16_ll(a, b) simd_pack_16(a, b)
    137 #define simd_pack_16_hh(a, b) \
    138   simd_pack_16(simd_srli_16(a, 8), simd_srli_16(b, 8))
    139136
    140137
     
    625622
    626623#ifndef simd_pack_16_hh
    627 #define simd_pack_16_hh(v1, v2) simd_pack_16(simd_srli_16(v1, 8), simd_srli_16(v2, 8))
    628 #endif
    629 
     624//#define simd_pack_16_hh(v1, v2) simd_pack_16(simd_srli_16(v1, 8), simd_srli_16(v2, 8))
     625//Masking performned by simd_pack_16 is unnecessary.
     626#define simd_pack_16_hh(v1, v2) simd_packus_16(simd_srli_16(v1, 8), simd_srli_16(v2, 8))
     627#endif
    630628
    631629// Splat the first 16-bit int into all positions.
Note: See TracChangeset for help on using the changeset viewer.