Changeset 709 for trunk/lib


Ignore:
Timestamp:
Nov 14, 2010, 2:13:18 PM (9 years ago)
Author:
cameron
Message:

sfl/sbl (templated version) for big endian as well as little

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/lib_simd.h

    r628 r709  
    5757#define unlikely(x) (x)
    5858#endif
     59
     60#ifdef TEMPLATED_SIMD_LIB
     61static inline SIMD_type sisd_sll(SIMD_type blk, SIMD_type n) {
     62        return simd<128>::sll(blk, n);
     63}
     64static inline SIMD_type sisd_srl(SIMD_type blk, SIMD_type n) {
     65        return simd<128>::srl(blk, n);
     66}
     67#define sisd_slli(blk, n) simd<128>::slli<n>(blk)
     68#define sisd_srli(blk, n) simd<128>::srli<n>(blk)
     69#endif
     70
    5971
    6072/* Shift forward and back operations, based on endianness */
     
    6981#define cbzl __builtin_ctzl
    7082#endif
     83
    7184#if BYTE_ORDER == LITTLE_ENDIAN
    72 #ifdef TEMPLATED_SIMD_LIB
    73 static inline SIMD_type sisd_sfl(SIMD_type blk, SIMD_type n) {
    74         return simd<128>::sll(blk, n);
    75 }
    76 
    77 static inline SIMD_type sisd_sbl(SIMD_type blk, SIMD_type n) {
    78         return simd<128>::srl(blk, n);
    79 }
    80 #define sisd_sfli(blk, n) simd<128>::slli<n>(blk)
    81 #define sisd_sbli(blk, n) simd<128>::srli<n>(blk)
    82 #endif
    83 #ifndef TEMPLATED_SIMD_LIB
    84 static inline SIMD_type sisd_sfl(SIMD_type blk, SIMD_type n) {
    85         return sisd_sll(blk, n);
    86 }
    87 static inline SIMD_type sisd_sbl(SIMD_type blk, SIMD_type n) {
    88         return sisd_srl(blk, n);
    89 }
     85#define sisd_sfl(blk, n) sisd_sll(blk, n)
     86#define sisd_sbl(blk, n) sisd_srl(blk, n)
    9087#define sisd_sfli(blk, n) sisd_slli(blk, n)
    9188#define sisd_sbli(blk, n) sisd_srli(blk, n)
    92 #endif
    9389#define sb_op(x, n) ((x)>>(n))
    9490#define sf_op(x, n) ((x)<<(n))
Note: See TracChangeset for help on using the changeset viewer.