Changeset 2223


Ignore:
Timestamp:
Jun 26, 2012, 5:31:07 PM (7 years ago)
Author:
ksherdy
Message:

Update README.

Location:
proto/RE2PBS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/RE2PBS/README

    r2222 r2223  
    1 How to use AnTLR3 for Python Development
     1Ken Herdy
     2June 26, 2012
    23
    3 import antlr3
     4----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
     5How to Set up for AnTLR3 Python Development
     6----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
     7
     81. Install Python Runtime
     9
     10cd antlr
     11tar -xvf antlr_python_runtime-3.1.3.tar.gz
     12cd antlr_python_runtime-3.1.3/
     13sudo python setup.py install
     14
     152. Copy Python RE2PBS Library Files to Bin
     16
     17cp res *.py bin
     18
     193. Build RE2PBS
     20
     21make help
     22make clean
     23make pablo
     24make proto
     25
     26----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
     27Additional Notes - Fix for setuptools*.egg AnTLR Python runtime issue
     28----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
    429
    530http://www.antlr.org/download/Python
    631antlr_python_runtime-3.*.*.tar.gz
    732cd antlr_python_runtime-3.*.*
    8 http://pypi.python.org/simple/setuptools/setuptools-0.6c10-py2.6.egg
    9 mv setuptools-0.6c10-py2.6 setuptools-0.6c5-py2.6
    1033sudo python setup.py install
    1134
     35Download setuptools*.egg from http://pypi.python.org/simple/setuptools/
     36Overwrite previous version with downloaded setuptools*.egg
     37
     38
  • proto/RE2PBS/src/demo.cpp

    r1906 r2223  
    8181  struct Classify_bytes {
    8282 
    83   void do_block(Basis_bits & basis_bits, Lex & lex) {
     83  IDISA_INLINE void do_block(Basis_bits & basis_bits, Lex & lex) {
    8484                BitBlock temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8, temp9, temp10;
    8585                BitBlock temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18;
     
    145145        return lex;
    146146  }
    147   void do_segment(Basis_bits basis_bits[], Lex lex[]) {
    148   for (int i = 0; i < SEGMENT_BLOCKS; i++)
     147  void do_segment(Basis_bits basis_bits[], Lex lex[], int segment_blocks) {
     148  int i;
     149  for (i = 0; i < segment_blocks; i++)
    149150    do_block(basis_bits[i], lex[i]);
    150151  }
     
    153154
    154155  struct Demo {
    155   Demo() { CarryInit(carryQ, 7); }
    156   void do_block(U8data & u8data, Lex & lex) {
     156 
     157  IDISA_INLINE void do_block(U8data & u8data, Lex & lex) {
    157158                BitBlock error_1_0, cursor_1_0, error_1_1, cursor_1_1, cursor_1_2, error_1_2;
    158159                BitBlock cursor_1_3, cursor_1_4, error_1_3, cursor_1_5, cursor_1_6, error_1_4;
     
    161162
    162163
    163         error_1_0 = simd_const_1(0);
    164         cursor_1_0 = simd_andc(lex.s38, BitBlock_advance_ci_co(lex.s38, carryQ, 0));
     164        error_1_0 = simd<1>::constant<0>();
     165        cursor_1_0 = simd_andc(lex.s38, bitutil.Advance(lex.s38));
    165166        error_1_1 = simd_andc(cursor_1_0, lex.s38);
    166167        cursor_1_1 = simd_andc(cursor_1_0, error_1_1);
    167         cursor_1_2 = BitBlock_advance_ci_co(cursor_1_1, carryQ, 1);
     168        cursor_1_2 = bitutil.Advance(cursor_1_1);
    168169        error_1_2 = simd_andc(cursor_1_2, lex.s35);
    169170        cursor_1_3 = simd_andc(cursor_1_2, error_1_2);
    170         cursor_1_4 = BitBlock_advance_ci_co(cursor_1_3, carryQ, 2);
     171        cursor_1_4 = bitutil.Advance(cursor_1_3);
    171172        error_1_3 = simd_andc(cursor_1_4, lex.s120);
    172173        cursor_1_5 = simd_andc(cursor_1_4, error_1_3);
    173         cursor_1_6 = BitBlock_advance_ci_co(cursor_1_5, carryQ, 3);
     174        cursor_1_6 = bitutil.Advance(cursor_1_5);
    174175        error_1_4 = simd_andc(cursor_1_6, lex.s48__57);
    175176        cursor_1_7 = simd_andc(cursor_1_6, error_1_4);
    176         cursor_1_8 = BitBlock_advance_ci_co(cursor_1_7, carryQ, 4);
    177         cursor_1_9 = BitBlock_scanthru_ci_co(cursor_1_8, lex.s48__57, carryQ, 5);
     177        cursor_1_8 = bitutil.Advance(cursor_1_7);
     178        cursor_1_9 = bitutil.ScanThru(cursor_1_8, lex.s48__57);
    178179        error_1_5 = simd_andc(cursor_1_9, lex.s59);
    179180        cursor_1_10 = simd_andc(cursor_1_9, error_1_5);
    180         cursor_1_11 = BitBlock_advance_ci_co(cursor_1_10, carryQ, 6);
     181        cursor_1_11 = bitutil.Advance(cursor_1_10);
    181182        error_1_6 = error_1_0;
    182183        error_1_6 = simd_or(error_1_6, error_1_1);
     
    186187        error_1_6 = simd_or(error_1_6, error_1_5);
    187188        return;
    188         CarryQ_Adjust(carryQ, 7);
    189189  }
    190190  void do_final_block(U8data & u8data, Lex & lex, BitBlock EOF_mask) {
     
    195195
    196196
    197         error_1_0 = simd_const_1(0);
    198         cursor_1_0 = simd_andc(lex.s38, BitBlock_advance_ci(lex.s38, carryQ, 0));
     197        error_1_0 = simd<1>::constant<0>();
     198        cursor_1_0 = simd_andc(lex.s38, bitutil.Advance(lex.s38));
    199199        error_1_1 = simd_andc(cursor_1_0, lex.s38);
    200200        cursor_1_1 = simd_andc(cursor_1_0, error_1_1);
    201         cursor_1_2 = BitBlock_advance_ci(cursor_1_1, carryQ, 1);
     201        cursor_1_2 = bitutil.Advance(cursor_1_1);
    202202        error_1_2 = simd_andc(cursor_1_2, lex.s35);
    203203        cursor_1_3 = simd_andc(cursor_1_2, error_1_2);
    204         cursor_1_4 = BitBlock_advance_ci(cursor_1_3, carryQ, 2);
     204        cursor_1_4 = bitutil.Advance(cursor_1_3);
    205205        error_1_3 = simd_andc(cursor_1_4, lex.s120);
    206206        cursor_1_5 = simd_andc(cursor_1_4, error_1_3);
    207         cursor_1_6 = BitBlock_advance_ci(cursor_1_5, carryQ, 3);
     207        cursor_1_6 = bitutil.Advance(cursor_1_5);
    208208        error_1_4 = simd_andc(cursor_1_6, lex.s48__57);
    209209        cursor_1_7 = simd_andc(cursor_1_6, error_1_4);
    210         cursor_1_8 = BitBlock_advance_ci(cursor_1_7, carryQ, 4);
    211         cursor_1_9 = BitBlock_scanthru_ci(cursor_1_8, lex.s48__57, carryQ, 5);
     210        cursor_1_8 = bitutil.Advance(cursor_1_7);
     211        cursor_1_9 = bitutil.ScanThru(cursor_1_8, lex.s48__57);
    212212        error_1_5 = simd_andc(cursor_1_9, lex.s59);
    213213        cursor_1_10 = simd_andc(cursor_1_9, error_1_5);
    214         cursor_1_11 = BitBlock_advance_ci(cursor_1_10, carryQ, 6);
     214        cursor_1_11 = bitutil.Advance(cursor_1_10);
    215215        error_1_6 = error_1_0;
    216216        error_1_6 = simd_or(error_1_6, error_1_1);
     
    221221        return;
    222222  }
    223   void do_segment(U8data u8data[], Lex lex[]) {
    224   for (int i = 0; i < SEGMENT_BLOCKS; i++)
     223  void do_segment(U8data u8data[], Lex lex[], int segment_blocks) {
     224  int i;
     225  for (i = 0; i < segment_blocks; i++)
    225226    do_block(u8data[i], lex[i]);
    226227  }
    227   CarryDeclare(carryQ, 7);
     228 
    228229  };
    229230
     
    315316    }
    316317    block_base = block_pos;
    317     if (remaining > 0 || CarryTest(demo.carryQ, 0, 7)) {
     318    if (remaining > 0 || 1) {
    318319          EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
    319320          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
Note: See TracChangeset for help on using the changeset viewer.