source: trunk/lib_ir/s2p.h @ 3923

Last change on this file since 3923 was 3922, checked in by linmengl, 5 years ago

copy xmlwf in and compile it with ir lib

File size: 2.5 KB
Line 
1#ifndef S2P_H
2#define S2P_H
3
4#include "idisa.hpp"
5
6extern "C" {
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);
8
9  BitBlock packh_16(BitBlock a, BitBlock b);
10  BitBlock packl_16(BitBlock a, BitBlock b);
11
12  BitBlock packh_8(BitBlock a, BitBlock b);
13  BitBlock packl_8(BitBlock a, BitBlock b);
14
15  BitBlock packh_4(BitBlock a, BitBlock b);
16  BitBlock packl_4(BitBlock a, BitBlock b);
17
18  BitBlock ifh_1(BitBlock a, BitBlock b, BitBlock c);
19  BitBlock srli_16(BitBlock a, BitBlock shift_mask);
20  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();
31}
32
33#define S2P_ALGORITHM s2p_bytepack
34
35#define s2p_bytepack(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7) \
36  do {\
37        BitBlock bit00224466_0,bit00224466_1,bit00224466_2,bit00224466_3;\
38        BitBlock bit11335577_0,bit11335577_1,bit11335577_2,bit11335577_3;\
39        BitBlock bit00004444_0,bit22226666_0,bit00004444_1,bit22226666_1;\
40        BitBlock bit11115555_0,bit33337777_0,bit11115555_1,bit33337777_1;\
41        s2p_step_ir(s0,s1,himask_2(),const16_1(),&bit00224466_0,&bit11335577_0);\
42        s2p_step_ir(s2,s3,himask_2(),const16_1(),&bit00224466_1,&bit11335577_1);\
43        s2p_step_ir(s4,s5,himask_2(),const16_1(),&bit00224466_2,&bit11335577_2);\
44        s2p_step_ir(s6,s7,himask_2(),const16_1(),&bit00224466_3,&bit11335577_3);\
45        s2p_step_ir(bit00224466_0,bit00224466_1,himask_4(),const16_2(),&bit00004444_0,&bit22226666_0);\
46        s2p_step_ir(bit00224466_2,bit00224466_3,himask_4(),const16_2(),&bit00004444_1,&bit22226666_1);\
47        s2p_step_ir(bit11335577_0,bit11335577_1,himask_4(),const16_2(),&bit11115555_0,&bit33337777_0);\
48        s2p_step_ir(bit11335577_2,bit11335577_3,himask_4(),const16_2(),&bit11115555_1,&bit33337777_1);\
49        s2p_step_ir(bit00004444_0,bit00004444_1,himask_8(),const16_4(),&p0,&p4);\
50        s2p_step_ir(bit11115555_0,bit11115555_1,himask_8(),const16_4(),&p1,&p5);\
51        s2p_step_ir(bit22226666_0,bit22226666_1,himask_8(),const16_4(),&p2,&p6);\
52        s2p_step_ir(bit33337777_0,bit33337777_1,himask_8(),const16_4(),&p3,&p7);\
53  } while(0)
54
55#define s2p(s0, s1, s2, s3, s4, s5, s6, s7, p0, p1, p2, p3, p4, p5, p6, p7)\
56  S2P_ALGORITHM(s7, s6, s5, s4, s3, s2, s1, s0, p0, p1, p2, p3, p4, p5, p6, p7)
57
58#endif
Note: See TracBrowser for help on using the repository browser.