Changeset 191 for trunk/lib


Ignore:
Timestamp:
Jul 31, 2008, 1:38:58 PM (11 years ago)
Author:
lindanl
Message:

Templated library: error fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/sse_simd_t.h

    r183 r191  
    371371/* fw: 2, 4, 8 */
    372372template<int fw>
    373 inline SIMD_type pack(SIMD_type r1, SIMD_type r2){
     373inline SIMD_type simd<fw>::pack(SIMD_type r1, SIMD_type r2){
    374374        return simd<fw*2>::pack(simd_if(simd<fw>::himask(),simd<128>::srli<fw/2>(r1),r1),
    375375                                simd_if(simd<fw>::himask(),simd<128>::srli<fw/2>(r2),r2));
     
    409409
    410410
    411 #define simd_all_eq_8(v1, v2) simd_all_true_8(_mm_cmpeq_epi8(v1, v2))
     411#define simd_all_eq_8(v1, v2) simd_all_true<8>(_mm_cmpeq_epi8(v1, v2))
    412412#define simd_all_le_8(v1, v2) simd_all_eq_8(simd_max_8(v1, v2), v2)
    413413
     
    509509template<int fw> template <HOM_t m1, HOM_t m2>
    510510inline SIMD_type simd<fw>::add(SIMD_type r1, SIMD_type r2){
    511         return simd<fw>::add(SIMD<fw,m1>::hom(r1),SIMD<fw,m1>::hom(r2));
     511        return simd<fw>::add(SIMD<fw,m1>::hom(r1),SIMD<fw,m2>::hom(r2));
    512512}
    513513
    514514template<int fw> template <HOM_t m1, HOM_t m2>
    515515inline SIMD_type simd<fw>::sub(SIMD_type r1, SIMD_type r2){
    516         return simd<fw>::sub(SIMD<fw,m1>::hom(r1),SIMD<fw,m1>::hom(r2));
     516        return simd<fw>::sub(SIMD<fw,m1>::hom(r1),SIMD<fw,m2>::hom(r2));
    517517}
    518518
    519519template<int fw> template <HOM_t m1, HOM_t m2>
    520520inline SIMD_type simd<fw>::pack(SIMD_type r1, SIMD_type r2){
    521         return simd<fw>::pack(SIMD<fw,m1>::l2x(r1),SIMD<fw,m1>::l2x(r2));
     521        return simd<fw>::pack(SIMD<fw,m1>::l2x(r1),SIMD<fw,m2>::l2x(r2));
    522522}
    523523
    524524template<int fw> template <HOM_t m1, HOM_t m2>
    525525inline SIMD_type simd<fw>::mergeh(SIMD_type r1, SIMD_type r2){
    526         return simd<fw>::mergeh(SIMD<fw,m1>::hom(r1),SIMD<fw,m1>::hom(r2));
     526        return simd<fw>::mergeh(SIMD<fw,m1>::hom(r1),SIMD<fw,m2>::hom(r2));
    527527}
    528528
    529529template<int fw> template <HOM_t m1, HOM_t m2>
    530530inline SIMD_type simd<fw>::mergel(SIMD_type r1, SIMD_type r2){
    531         return simd<fw>::mergel(SIMD<fw,m1>::hom(r1),SIMD<fw,m1>::hom(r2));
     531        return simd<fw>::mergel(SIMD<fw,m1>::hom(r1),SIMD<fw,m2>::hom(r2));
    532532}
    533533
     
    610610
    611611
     612#if (BYTE_ORDER == BIG_ENDIAN)
    612613void print_bit_block(char * var_name, SIMD_type v) {
    613614  union {SIMD_type vec; unsigned char elems[8];} x;
     
    622623  printf("\n");
    623624}
    624 
    625 
     625#endif
     626
     627#if (BYTE_ORDER == LITTLE_ENDIAN)
     628void print_bit_block(char * var_name, SIMD_type v) {
     629  union {SIMD_type vec; unsigned char elems[8];} x;
     630  x.vec = v;
     631  unsigned char c, bit_reversed;
     632  int i;
     633  printf("%20s = ", var_name);
     634  for (i = sizeof(SIMD_type)-1; i >= 0; i--) {
     635    c = x.elems[i];
     636     printf("%02X ", c);
     637  }
     638  printf("\n");
     639}
     640#endif
    626641
    627642
Note: See TracChangeset for help on using the changeset viewer.