Changeset 1753 for trunk/lib/s2p128.hpp


Ignore:
Timestamp:
Dec 8, 2011, 6:57:20 PM (8 years ago)
Author:
ksherdy
Message:

Added 128 bit specific p2s, s2p. Added 256 bit headers as placeholders.

File:
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/lib/s2p128.hpp

    r1750 r1753  
    1 /*  s2p - Serial to Parallel Bit Stream Transposition
     1/*  s2p128 - Serial to Parallel Bit Stream Transposition
    22    Copyright (c) 2007, 2008, 2010, 2011  Robert D. Cameron.
    33    Licensed to the public under the Open Software License 3.0.
    4 */
    5 
    6 #ifndef S2P_HPP
    7 #define S2P_HPP
    8 
    9 #include "idisa.hpp"
     4    Licensed to International Characters Inc.
     5       under the Academic Free License version 3.0.
     6*/
     7
     8#ifndef S2P128_HPP
     9#define S2P128_HPP
     10
     11#include "idisa128.hpp"
    1012
    1113#define BytePack BitBlock
     
    4042#endif
    4143
    42 
    43 
    44 #if (BYTE_ORDER == BIG_ENDIAN)
    45 #define s2p(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7)\
    46   S2P_ALGORITHM(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7)
    47 #endif
    48 #if (BYTE_ORDER == LITTLE_ENDIAN)
    4944#define s2p(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7)\
    5045  S2P_ALGORITHM(s7, s6, s5, s4, s3, s2, s1, s0, p0, p1, p2, p3, p4, p5, p6, p7)
    51 #endif
    52 
    5346
    5447/*  s2p_ideal is an ideal serial to parallel transposition
     
    145138#endif
    146139
    147 
    148 
    149140#define s2p_bytepack(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7) \
    150141  do {\
     
    167158  } while(0)
    168159
    169 
    170 
    171 
    172 
    173160/* For sizeof(BitBlock) = 16 */
    174161typedef uint16_t BitPack;
    175162
    176 #if (BYTE_ORDER == BIG_ENDIAN)
    177 #define movemask_step(s0, s1, s2, s3, s4, s5, s6, s7, p) \
    178   do { \
    179         union { BitPack bit_pack[8];\
    180                 BitBlock bit_block;\
    181               } b;\
    182         b.bit_pack[0] = hsimd<8>::signmask(s0);\
    183         b.bit_pack[1] = hsimd<8>::signmask(s1);\
    184         b.bit_pack[2] = hsimd<8>::signmask(s2);\
    185         b.bit_pack[3] = hsimd<8>::signmask(s3);\
    186         b.bit_pack[4] = hsimd<8>::signmask(s4);\
    187         b.bit_pack[5] = hsimd<8>::signmask(s5);\
    188         b.bit_pack[6] = hsimd<8>::signmask(s6);\
    189         b.bit_pack[7] = hsimd<8>::signmask(s7);\
    190         p = b.bit_block;\
    191    } while (0)
    192 #endif
    193 #if (BYTE_ORDER == LITTLE_ENDIAN)
    194163#define movemask_step(s7, s6, s5, s4, s3, s2, s1, s0, p) \
    195164  do { \
     
    207176        p = b.bit_block;\
    208177   } while (0)
    209 #endif
    210 
    211178
    212179#define bitshift_step(s0, s1, s2, s3, s4, s5, s6, s7, t0, t1, t2, t3, t4, t5, t6, t7) \
     
    244211
    245212
    246 #endif
    247 
     213#endif // S2P128_HPP
     214
Note: See TracChangeset for help on using the changeset viewer.