Changeset 711 for trunk


Ignore:
Timestamp:
Nov 14, 2010, 6:42:42 PM (9 years ago)
Author:
cameron
Message:

s2p_movemask

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/s2p.h

    r626 r711  
    3232
    3333#ifdef USE_S2P_MOVEMASK
    34 #define S2P_ALGORITHM s2p_movemask  /* Not yet implemented. */
     34#define S2P_ALGORITHM s2p_movemask
    3535#endif
    3636
     
    128128typedef uint16_t BitPack;
    129129
     130#if (BYTE_ORDER == BIG_ENDIAN)
    130131#define movemask_step(s0, s1, s2, s3, s4, s5, s6, s7, p) \
    131132  do { \
     
    133134                SIMD_type bit_block;\
    134135              } b;\
    135         b.bit_pack[0] = simd_movemask_8(s7);\
    136         b.bit_pack[1] = simd_movemask_8(s6);\
    137         b.bit_pack[2] = simd_movemask_8(s5);\
    138         b.bit_pack[3] = simd_movemask_8(s4);\
    139         b.bit_pack[4] = simd_movemask_8(s3);\
    140         b.bit_pack[5] = simd_movemask_8(s2);\
    141         b.bit_pack[6] = simd_movemask_8(s1);\
    142         b.bit_pack[7] = simd_movemask_8(s0);\
     136        b.bit_pack[0] = simd_movemask_8(s0);\
     137        b.bit_pack[1] = simd_movemask_8(s1);\
     138        b.bit_pack[2] = simd_movemask_8(s2);\
     139        b.bit_pack[3] = simd_movemask_8(s3);\
     140        b.bit_pack[4] = simd_movemask_8(s4);\
     141        b.bit_pack[5] = simd_movemask_8(s5);\
     142        b.bit_pack[6] = simd_movemask_8(s6);\
     143        b.bit_pack[7] = simd_movemask_8(s7);\
    143144        p = b.bit_block;\
    144145   } while (0)
     146#endif
     147#if (BYTE_ORDER == LITTLE_ENDIAN)
     148#define movemask_step(s7, s6, s5, s4, s3, s2, s1, s0, p) \
     149  do { \
     150        union { BitPack bit_pack[8];\
     151                SIMD_type bit_block;\
     152              } b;\
     153        b.bit_pack[0] = simd_movemask_8(s0);\
     154        b.bit_pack[1] = simd_movemask_8(s1);\
     155        b.bit_pack[2] = simd_movemask_8(s2);\
     156        b.bit_pack[3] = simd_movemask_8(s3);\
     157        b.bit_pack[4] = simd_movemask_8(s4);\
     158        b.bit_pack[5] = simd_movemask_8(s5);\
     159        b.bit_pack[6] = simd_movemask_8(s6);\
     160        b.bit_pack[7] = simd_movemask_8(s7);\
     161        p = b.bit_block;\
     162   } while (0)
     163#endif
     164
    145165
    146166#define bitshift_step(s0, s1, s2, s3, s4, s5, s6, s7) \
Note: See TracChangeset for help on using the changeset viewer.