Changeset 1753


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

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

Location:
trunk/lib
Files:
2 added
1 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/lib/bitblock.hpp

    r1658 r1753  
    2424#if (BLOCK_SIZE == 128)
    2525#include "bitblock128.hpp"
     26#include "s2p128.hpp"
     27#include "p2s128.hpp"
    2628#endif
    2729
     
    2931#if (BLOCK_SIZE == 256)
    3032#include "bitblock256.hpp"
     33#include "s2p256.hpp"
     34#include "p2s256.hpp"
    3135#endif
    3236
    33 // Template specialization is slightly slower, but is required to differentiate on integer types unsigned long and unsigned long long.
    3437template<class block_t> IDISA_ALWAYS_INLINE uint32_t count_forward_zeroes(block_t s);
    3538template<class block_t> IDISA_ALWAYS_INLINE uint32_t count_reverse_zeroes(block_t s);
  • trunk/lib/p2s128.hpp

    r1750 r1753  
    1 /*  p2s - Serial to Parallel Bit Stream Transposition
     1/*  p2s128 - Serial to Parallel Bit Stream Transposition
    22    Copyright (c) 2007, 2008, 2010, Robert D. Cameron.
    33    Licensed to the public under the Open Software License 3.0.
     4    Licensed to International Characters Inc.
     5       under the Academic Free License version 3.0.
     6
    47*/
    58
    6 #ifndef P2S_HPP
    7 #define P2S_HPP
     9#ifndef P2S128_HPP
     10#define P2S128_HPP
    811
    9 #include "idisa.hpp"
     12#include "idisa128.hpp"
    1013
    1114#define BytePack BitBlock
    12 
    1315
    1416/*
     
    3537#endif
    3638
    37 
    38 
    3939/*  p2s_ideal is an ideal parallel to serial transposition
    4040    algorithm given an architecture with native support for
     
    4343    operations.
    4444*/
    45 
    4645
    4746#define p2s_ideal(p0,p1,p2,p3,p4,p5,p6,p7,s0,s1,s2,s3,s4,s5,s6,s7)  \
     
    111110  } while(0)
    112111
    113 #if (BYTE_ORDER == BIG_ENDIAN)
    114 #define p2s(p0, p1, p2, p3, p4, p5, p6, p7, s0, s1, s2, s3, s4, s5, s6, s7)\
    115   P2S_ALGORITHM(p0, p1, p2, p3, p4, p5, p6, p7, s0, s1, s2, s3, s4, s5, s6, s7)
    116 #endif
    117 #if (BYTE_ORDER == LITTLE_ENDIAN)
    118112#define p2s(p0, p1, p2, p3, p4, p5, p6, p7, s0, s1, s2, s3, s4, s5, s6, s7)\
    119113  P2S_ALGORITHM(p0, p1, p2, p3, p4, p5, p6, p7, s7, s6, s5, s4, s3, s2, s1, s0)
    120 #endif
    121114
    122 #endif
     115#endif // P2S128_HPP
    123116
  • 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.