Changeset 616 for proto/u16u8


Ignore:
Timestamp:
Sep 13, 2010, 10:48:25 AM (9 years ago)
Author:
lindanl
Message:

use p2s and s2p function from the lib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • proto/u16u8/template.c

    r609 r616  
    1717
    1818#include "../lib/perflib/perfsec.h"
     19#include "../lib/s2p.h"
     20#include "../lib/p2s.h"
     21
    1922
    2023#ifdef BUFFER_PROFILING
     
    4548
    4649typedef  uint16_t UChar;
    47 
    48 #define s2p_step(s0,s1,hi_mask,shift,p0,p1)  \
    49 { \
    50 BitBlock t0,t1; \
    51 t0= simd_pack_16_hh(s0,s1) ; \
    52 t1= simd_pack_16_ll(s0,s1) ; \
    53 p0= simd_if(hi_mask,t0,simd_srli_16(t1,shift) ) ; \
    54 p1= simd_if(hi_mask,simd_slli_16(t0,shift) ,t1) ; \
    55 } \
    56 
    57 #define s2p_bytepack(s0,s1,s2,s3,s4,s5,s6,s7,p0,p1,p2,p3,p4,p5,p6,p7)  \
    58 {BitBlock bit00224466_0,bit00224466_1,bit00224466_2,bit00224466_3; \
    59 BitBlock bit11335577_0,bit11335577_1,bit11335577_2,bit11335577_3; \
    60 BitBlock bit00004444_0,bit22226666_0,bit00004444_1,bit22226666_1; \
    61 BitBlock bit11115555_0,bit33337777_0,bit11115555_1,bit33337777_1; \
    62 s2p_step(s0,s1,simd_himask_2,1,bit00224466_0,bit11335577_0)  \
    63 s2p_step(s2,s3,simd_himask_2,1,bit00224466_1,bit11335577_1)  \
    64 s2p_step(s4,s5,simd_himask_2,1,bit00224466_2,bit11335577_2)  \
    65 s2p_step(s6,s7,simd_himask_2,1,bit00224466_3,bit11335577_3)  \
    66 s2p_step(bit00224466_0,bit00224466_1,simd_himask_4,2,bit00004444_0,bit22226666_0)  \
    67 s2p_step(bit00224466_2,bit00224466_3,simd_himask_4,2,bit00004444_1,bit22226666_1)  \
    68 s2p_step(bit11335577_0,bit11335577_1,simd_himask_4,2,bit11115555_0,bit33337777_0)  \
    69 s2p_step(bit11335577_2,bit11335577_3,simd_himask_4,2,bit11115555_1,bit33337777_1)  \
    70 s2p_step(bit00004444_0,bit00004444_1,simd_himask_8,4,p0,p4)  \
    71 s2p_step(bit11115555_0,bit11115555_1,simd_himask_8,4,p1,p5)  \
    72 s2p_step(bit22226666_0,bit22226666_1,simd_himask_8,4,p2,p6)  \
    73 s2p_step(bit33337777_0,bit33337777_1,simd_himask_8,4,p3,p7)  \
    74 } \
    75 
    76 #define p2s_step(p0,p1,hi_mask,shift,s0,s1)  \
    77 { \
    78 BitBlock t0,t1; \
    79 t0= simd_if(hi_mask,p0,simd_srli_16(p1,shift) ) ; \
    80 t1= simd_if(hi_mask,simd_slli_16(p0,shift) ,p1) ; \
    81 s0= simd_mergeh_8(t0,t1) ; \
    82 s1= simd_mergel_8(t0,t1) ; \
    83 } \
    84 
    85 #define p2s_bytemerge(p0,p1,p2,p3,p4,p5,p6,p7,s0,s1,s2,s3,s4,s5,s6,s7)  \
    86 { \
    87 BitBlock bit00004444_0,bit22226666_0,bit00004444_1,bit22226666_1; \
    88 BitBlock bit11115555_0,bit33337777_0,bit11115555_1,bit33337777_1; \
    89 BitBlock bit00224466_0,bit00224466_1,bit00224466_2,bit00224466_3; \
    90 BitBlock bit11335577_0,bit11335577_1,bit11335577_2,bit11335577_3; \
    91 p2s_step(p0,p4,simd_himask_8,4,bit00004444_0,bit00004444_1)  \
    92 p2s_step(p1,p5,simd_himask_8,4,bit11115555_0,bit11115555_1)  \
    93 p2s_step(p2,p6,simd_himask_8,4,bit22226666_0,bit22226666_1)  \
    94 p2s_step(p3,p7,simd_himask_8,4,bit33337777_0,bit33337777_1)  \
    95 p2s_step(bit00004444_0,bit22226666_0,simd_himask_4,2,bit00224466_0,bit00224466_1)  \
    96 p2s_step(bit11115555_0,bit33337777_0,simd_himask_4,2,bit11335577_0,bit11335577_1)  \
    97 p2s_step(bit00004444_1,bit22226666_1,simd_himask_4,2,bit00224466_2,bit00224466_3)  \
    98 p2s_step(bit11115555_1,bit33337777_1,simd_himask_4,2,bit11335577_2,bit11335577_3)  \
    99 p2s_step(bit00224466_0,bit11335577_0,simd_himask_2,1,s0,s1)  \
    100 p2s_step(bit00224466_1,bit11335577_1,simd_himask_2,1,s2,s3)  \
    101 p2s_step(bit00224466_2,bit11335577_2,simd_himask_2,1,s4,s5)  \
    102 p2s_step(bit00224466_3,bit11335577_3,simd_himask_2,1,s6,s7)  \
    103 } \
    104 
    10550
    10651static inline void interleave4(BitBlock p0, BitBlock p1, BitBlock p2, BitBlock p3,
Note: See TracChangeset for help on using the changeset viewer.