Changeset 618 for trunk


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

use s2p macro

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/s2p.h

    r612 r618  
    1010#define BitBlock SIMD_type
    1111
     12/* Given a block of bytes in 8 consecutive registers s0, s1, ..., s7,
     13   s2p transposes the block into 8 parallel bitstream blocks p0, p1, ..., p7.
     14
     15   The following header shows the intent, although a macro is used for
     16   speed.
    1217static inline void s2p(BytePack s0, BytePack s1, BytePack s2, BytePack s3,
    1318                       BytePack s5, BytePack s6, BytePack s7, BytePack s8,
    1419                       BitBlock& p0, BitBlock& p1, BitBlock& p2, BitBlock& p3,
    1520                       BitBlock& p4, BitBlock& p5, BitBlock& p6, BitBlock& p7);
    16 
     21*/
    1722
    1823/* Different algorithms may be selected. */
     
    105110  } while(0)
    106111
    107 
    108 
    109 inline void s2p(BytePack s0, BytePack s1, BytePack s2, BytePack s3,
    110                        BytePack s4, BytePack s5, BytePack s6, BytePack s7,
    111                        BitBlock& p0, BitBlock& p1, BitBlock& p2, BitBlock& p3,
    112                        BitBlock& p4, BitBlock& p5, BitBlock& p6, BitBlock& p7) {
    113 
    114112#if (BYTE_ORDER == BIG_ENDIAN)
    115   S2P_ALGORITHM(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7);
     113#define s2p(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7)\
     114  S2P_ALGORITHM(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7)
    116115#endif
    117116#if (BYTE_ORDER == LITTLE_ENDIAN)
    118   S2P_ALGORITHM(s7, s6, s5, s4, s3, s2, s1, s0, p0, p1, p2, p3, p4, p5, p6, p7);
     117#define s2p(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7)\
     118  S2P_ALGORITHM(s7, s6, s5, s4, s3, s2, s1, s0, p0, p1, p2, p3, p4, p5, p6, p7)
    119119#endif
    120120}
Note: See TracChangeset for help on using the changeset viewer.