Changeset 3920 for trunk/lib_ir/s2p.h


Ignore:
Timestamp:
Jul 21, 2014, 7:00:26 PM (5 years ago)
Author:
linmengl
Message:

s2p_bytepack pure ir library works for sse2 now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib_ir/s2p.h

    r3919 r3920  
    33
    44#include "idisa.hpp"
    5 // use s2p(s0, s1, ..., s7, *p0, *p1, ..., *p7)
    6 // choose from s2p_bytepack and s2p_ideal
    7 #define s2p s2p_bytepack
    85
    96extern "C" {
    10   void s2p_ideal(BitBlock s0, BitBlock s1, BitBlock s2, BitBlock s3, BitBlock s4, BitBlock s5, BitBlock s6, BitBlock s7, BitBlock *p0, BitBlock *p1, BitBlock *p2, BitBlock *p3, BitBlock *p4, BitBlock *p5, BitBlock *p6, BitBlock *p7);
    11 
    12   void s2p_bytepack(BitBlock s0, BitBlock s1, BitBlock s2, BitBlock s3, BitBlock s4, BitBlock s5, BitBlock s6, BitBlock s7, BitBlock *p0, BitBlock *p1, BitBlock *p2, BitBlock *p3, BitBlock *p4, BitBlock *p5, BitBlock *p6, BitBlock *p7);
     7  //void s2p_ideal(BitBlock s0, BitBlock s1, BitBlock s2, BitBlock s3, BitBlock s4, BitBlock s5, BitBlock s6, BitBlock s7, BitBlock *p0, BitBlock *p1, BitBlock *p2, BitBlock *p3, BitBlock *p4, BitBlock *p5, BitBlock *p6, BitBlock *p7);
    138
    149  BitBlock packh_16(BitBlock a, BitBlock b);
     
    2419  BitBlock srli_16(BitBlock a, BitBlock shift_mask);
    2520  BitBlock slli_16(BitBlock a, BitBlock shift_mask);
     21
     22  BitBlock s2p_step_ir(BitBlock s0, BitBlock s1, BitBlock hi_mask, BitBlock shift_mask, BitBlock *p0, BitBlock *p1);
     23
     24  BitBlock const16_1();
     25  BitBlock const16_2();
     26  BitBlock const16_4();
     27
     28  BitBlock himask_2();
     29  BitBlock himask_4();
     30  BitBlock himask_8();
    2631}
    2732
     33#define s2p_bytepack(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7) \
     34  do {\
     35        BitBlock bit00224466_0,bit00224466_1,bit00224466_2,bit00224466_3;\
     36        BitBlock bit11335577_0,bit11335577_1,bit11335577_2,bit11335577_3;\
     37        BitBlock bit00004444_0,bit22226666_0,bit00004444_1,bit22226666_1;\
     38        BitBlock bit11115555_0,bit33337777_0,bit11115555_1,bit33337777_1;\
     39        s2p_step_ir(s0,s1,himask_2(),const16_1(),&bit00224466_0,&bit11335577_0);\
     40        s2p_step_ir(s2,s3,himask_2(),const16_1(),&bit00224466_1,&bit11335577_1);\
     41        s2p_step_ir(s4,s5,himask_2(),const16_1(),&bit00224466_2,&bit11335577_2);\
     42        s2p_step_ir(s6,s7,himask_2(),const16_1(),&bit00224466_3,&bit11335577_3);\
     43        s2p_step_ir(bit00224466_0,bit00224466_1,himask_4(),const16_2(),&bit00004444_0,&bit22226666_0);\
     44        s2p_step_ir(bit00224466_2,bit00224466_3,himask_4(),const16_2(),&bit00004444_1,&bit22226666_1);\
     45        s2p_step_ir(bit11335577_0,bit11335577_1,himask_4(),const16_2(),&bit11115555_0,&bit33337777_0);\
     46        s2p_step_ir(bit11335577_2,bit11335577_3,himask_4(),const16_2(),&bit11115555_1,&bit33337777_1);\
     47        s2p_step_ir(bit00004444_0,bit00004444_1,himask_8(),const16_4(),&p0,&p4);\
     48        s2p_step_ir(bit11115555_0,bit11115555_1,himask_8(),const16_4(),&p1,&p5);\
     49        s2p_step_ir(bit22226666_0,bit22226666_1,himask_8(),const16_4(),&p2,&p6);\
     50        s2p_step_ir(bit33337777_0,bit33337777_1,himask_8(),const16_4(),&p3,&p7);\
     51  } while(0)
     52
    2853#endif
Note: See TracChangeset for help on using the changeset viewer.