Changeset 622 for trunk


Ignore:
Timestamp:
Sep 14, 2010, 6:49:29 AM (9 years ago)
Author:
cameron
Message:

use p2s macro; fix arg order

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/p2s.h

    r613 r622  
    1010#define BitBlock SIMD_type
    1111
    12 static inline void p2s(BytePack s0, BytePack s1, BytePack s2, BytePack s3,
    13                        BytePack s5, BytePack s6, BytePack s7, BytePack s8,
    14                        BitBlock& p0, BitBlock& p1, BitBlock& p2, BitBlock& p3,
    15                        BitBlock& p4, BitBlock& p5, BitBlock& p6, BitBlock& p7);
    1612
     13/*
     14/* Given 8 parallel bitstream blocks p0, p1, ..., p7, inverse transpose
     15   the data into a block of bytes in 8 consecutive registers s0, s1, ..., s7.
     16
     17   The following header shows the intent, although a macro is used for
     18   speed.
     19static inline void p2s(BitBlock p0, BitBlock p1, BitBlock p2, BitBlock p3,
     20                       BitBlock p4, BitBlock p5, BitBlock p6, BitBlock p7,
     21                       BytePack& s0, BytePack& s1, BytePack& s2, BytePack& s3,
     22                       BytePack& s5, BytePack& s6, BytePack& s7, BytePack& s8,
     23                       );
     24
     25*/
    1726
    1827/* Different algorithms may be selected. */
    1928#ifdef USE_P2S_IDEAL
    2029#define P2S_ALGORITHM p2s_ideal
    21 #endif
    22 
    23 #ifdef USE_P2S_MOVEMASK
    24 #define P2S_ALGORITHM p2s_movemask  /* Not yet implemented. */
    2530#endif
    2631
     
    105110  } while(0)
    106111
    107 
    108 inline void p2s(BytePack s0, BytePack s1, BytePack s2, BytePack s3,
    109                        BytePack s4, BytePack s5, BytePack s6, BytePack s7,
    110                        BitBlock& p0, BitBlock& p1, BitBlock& p2, BitBlock& p3,
    111                        BitBlock& p4, BitBlock& p5, BitBlock& p6, BitBlock& p7) {
    112 
    113112#if (BYTE_ORDER == BIG_ENDIAN)
    114   P2S_ALGORITHM(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7);
     113#define s2p(p0, p1, p2, p3, p4, p5, p6, p7, s0, s1, s2, s3, s4, s5, s6, s7)\
     114  P2S_ALGORITHM(p0, p1, p2, p3, p4, p5, p6, p7, s0, s1, s2, s3, s4, s5, s6, s7)
    115115#endif
    116116#if (BYTE_ORDER == LITTLE_ENDIAN)
    117   P2S_ALGORITHM(s7, s6, s5, s4, s3, s2, s1, s0, p0, p1, p2, p3, p4, p5, p6, p7);
     117#define s2p(p0, p1, p2, p3, p4, p5, p6, p7, s0, s1, s2, s3, s4, s5, s6, s7)\
     118  P2S_ALGORITHM(p0, p1, p2, p3, p4, p5, p6, p7, s7, s6, s5, s4, s3, s2, s1, s0)
    118119#endif
    119 }
    120120
    121121#endif
Note: See TracChangeset for help on using the changeset viewer.