Changeset 1648 for proto/SymbolTable


Ignore:
Timestamp:
Nov 2, 2011, 8:16:21 PM (8 years ago)
Author:
vla24
Message:

SymbolTable?: Integrated symbol table with the new IDISA architecture

Location:
proto/SymbolTable
Files:
1 added
3 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • proto/SymbolTable/automate-build_idisa.sh

    r1442 r1648  
    1 make symtab_pbgs_id
     1make symtab_stl
    22cd src
    3 make idisa
    4 ./xmlwf ../../../trunk/QA/TD/roads-2.gml
     3make all
     4./xmlwf ../test/test_files/soap.xml
    55cd ..
    66
  • proto/SymbolTable/perf-build_idisa.sh

    r1427 r1648  
    1 cd src && make buffer_profiling_perf_idisa && python perf_script.py && cd ..
     1cd src && make buffer_profiling_perf && python perf_script.py && cd ..
    22
  • proto/SymbolTable/src/Makefile

    r1426 r1648  
    1 SRCFILE=xmlwf.cpp
     1SRCFILE=xmlwf.cpp $(SYMTAB_LIB)/bitstream_hash_table.cpp $(SYMTAB_LIB)/hash_symbol_table.cpp $(SYMTAB_LIB)/ls_symbol_table.cxx $(SYMTAB_LIB)/symtab.cxx
    22OUTFILE=xmlwf
    33TEST= run_all.py
     
    66CFLAGS= $(SSE) -O3 #-g
    77SSE=-msse2 #-msse4.1 -DUSE_PTEST #-mssse3 -msse4.1 -msse4.2
    8 INCLUDES = -I../lib/symtab/ -I../../parabix2/src
    9 INCLUDES_IDISA = -I../lib/symtab/ -I../../../trunk/libgen/idisa_lib -I../../parabix2/src
    10 LFLAGS=-L../lib/symtab/
    11 LIBS=-lsymtab
    12 
     8SYMTAB_LIB=../symtab
     9INCLUDES = -I$(SYMTAB_LIB) -I../lib/ -I../../parabix2/src
    1310PAPI_DIR=/usr/local/papi
    1411
     
    2825        g++ -O1 -o $(OUTFILE) $(SRCFILE) -march=nocona -m64 -msse2 -DBUFFER_PROFILING  -DPERF_SCRIPT
    2926
    30 all:    depend $(SRCFILE)
    31         $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -static $(LFLAGS) $(LIBS)
     27all:
     28        $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS)
    3229
    3330avx:    $(SRCFILE)
     
    3835
    3936code_clocker:   $(SRCFILE)
    40         $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) $(CODE_CLOCKER) -static $(LFLAGS) $(LIBS)
     37        $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) $(CODE_CLOCKER)
    4138
    42 buffer_profiling: depend $(SRCFILE)
    43         $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -DBUFFER_PROFILING -static $(LFLAGS) $(LIBS)
     39buffer_profiling: $(SRCFILE)
     40        $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -DBUFFER_PROFILING
    4441
    45 buffer_profiling_perf: depend $(SRCFILE)
    46         $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -DBUFFER_PROFILING  -DPERF_SCRIPT -static $(LFLAGS) $(LIBS)
    47 
    48 buffer_profiling_perf_idisa: depend_idisa $(SRCFILE)
    49         python make_idisa.py
    50         $(CC) $(INCLUDES_IDISA) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -DBUFFER_PROFILING  -DPERF_SCRIPT -static $(LFLAGS) $(LIBS) -DUSE_IDISA
     42buffer_profiling_perf: $(SRCFILE)
     43        $(CC) $(INCLUDES) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -DBUFFER_PROFILING  -DPERF_SCRIPT
    5144
    5245asm:  $(SRCFILE)
     
    6255        python $(TEST)
    6356
    64 idisa:  depend_idisa $(SRCFILE)
    65         python make_idisa.py
    66         $(CC) $(INCLUDES_IDISA) -o $(OUTFILE) $(SRCFILE) $(AFLAGS) -static $(LFLAGS) $(LIBS) -DUSE_IDISA
    67 
    6857clean:
    6958        rm -f $(OUTFILE) $(OUTFILE).s $(OUTFILE).o
    7059
    71 depend_idisa:
    72         cd ../lib/symtab/ && make lib_idisa
    73 
    74 depend:
    75 # This is a hack. I wanted to use makedepend but makefile complains that it doesn't recognize makedepend
    76         cd ../lib/symtab/ && make lib
    77         #makedepend $(LIBDIR) $^
    78 
    79 # DO NOT DELETE THIS LINE -- make depend needs it
    80 
  • proto/SymbolTable/symtab_hash_template.cpp

    r1491 r1648  
    1 #define TEMPLATED_SIMD_LIB
    2 
    3 #include <stdio.h>
    4 #include <stdlib.h>
    5 #include <errno.h>
    6 #include <sys/types.h>
    7 #include <sys/stat.h>
    8 #include <../lib_simd.h>
     1#include "../symtab_global.h"
    92#include <hash_symbol_table.h>
    10 #include <queue>
    11 #include <string>
    12 using namespace std;
    13 
    14 #define DEBUG 0
    15 #define BLOCK_SIZE (sizeof(SIMD_type) * 8)
    16 #define SEGMENT_BLOCKS 12
    17 #define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    18 #define OVERLAP_BUFSIZE 2*(sizeof(SIMD_type))
    19 
    20 #include <../carryQ.h>
    21 #include <xmldecl.h>
    22 #include <namechars.h>
    23 #include <../perflib/perfsec.h>
    24 #include <../s2p.h>
    25 
    26 #include <TagMatcher.h>
    27 #include <LineColTracker.h>
    28 #include <ErrorUtil.h>
    29 #include <ErrorTracker.h>
    30 #include <XMLTestSuiteError.h>
    313
    324#ifdef BUFFER_PROFILING
     
    5123TagMatcher matcher;
    5224ErrorTracker error_tracker;
    53 BitBlock EOF_mask = simd_const_1(1);
     25BitBlock EOF_mask = simd<1>::constant<1>();
    5426
    5527queue <size_t> elem_starts_buf;
     
    525497    block_base = block_pos;
    526498    if (remaining > 0 || @any_carry) {
    527           EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
    528           s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
     499          EOF_mask = bitblock::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-remaining));
     500          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
    529501          @final_block_stmts
    530502          postprocess_do_block(lex, ctCDPI_Callouts, ref_Callouts, check_streams, tag_Callouts, chars_avail);
  • proto/SymbolTable/symtab_identity_template.cpp

    r1499 r1648  
    1 #define TEMPLATED_SIMD_LIB
    2 
    3 #include <stdio.h>
    4 #include <stdlib.h>
    5 #include <errno.h>
    6 #include <sys/types.h>
    7 #include <sys/stat.h>
    8 #include <../lib_simd.h>
     1#include "../symtab_global.h"
    92#include <pbgs_identity_symbol_table.h>
    10 #include <queue>
    11 #include <string>
    12 using namespace std;
    13 
    14 #define DEBUG 0
    15 #define BLOCK_SIZE (sizeof(SIMD_type) * 8)
    16 #define SEGMENT_BLOCKS 12
    17 #define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    18 #define OVERLAP_BUFSIZE 2*(sizeof(SIMD_type))
    19 
    20 #include <../carryQ.h>
    21 #include <xmldecl.h>
    22 #include <namechars.h>
    23 #include <../perflib/perfsec.h>
    24 #include <../s2p.h>
    25 
    26 #include <TagMatcher.h>
    27 #include <LineColTracker.h>
    28 #include <ErrorUtil.h>
    29 #include <ErrorTracker.h>
    30 #include <XMLTestSuiteError.h>
    313
    324#ifdef BUFFER_PROFILING
     
    5123TagMatcher matcher;
    5224ErrorTracker error_tracker;
    53 BitBlock EOF_mask = simd_const_1(1);
     25BitBlock EOF_mask = simd<1>::constant<1>();
    5426
    5527BitBlock elem_ends;
     
    150122{
    151123    BitBlock s = block[0];
    152     BitBlock temp = simd_and(s, simd<128>::sll(simd<2>::constant<3>(), sisd_from_int(pos)));
     124    BitBlock temp = simd_and(s, simd<128>::sll(simd<2>::constant<3>(), convert(pos)));
    153125
    154126    if (bitblock_has_bit(temp))
     
    613585    block_base = block_pos;
    614586    if (remaining > 0 || @any_carry) {
    615           EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
    616           s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
     587          EOF_mask = bitblock::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-remaining));
     588          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
    617589          @final_block_stmts
    618590          postprocess_do_block(lex, ctCDPI_Callouts, ref_Callouts, check_streams, tag_Callouts, hash_data, chars_avail);
  • proto/SymbolTable/symtab_ls_template.cpp

    r1491 r1648  
    1 #define TEMPLATED_SIMD_LIB
    2 
    3 #include <stdio.h>
    4 #include <stdlib.h>
    5 #include <errno.h>
    6 #include <sys/types.h>
    7 #include <sys/stat.h>
    8 #include <../lib_simd.h>
     1#include "../symtab_global.h"
    92#include <ls_symbol_table.h>
    10 #include <queue>
    11 #include <string>
    12 using namespace std;
    13 
    14 #define DEBUG 0
    15 #define BLOCK_SIZE (sizeof(SIMD_type) * 8)
    16 #define SEGMENT_BLOCKS 12
    17 #define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    18 #define OVERLAP_BUFSIZE 2*(sizeof(SIMD_type))
    19 
    20 #include <../carryQ.h>
    21 #include <xmldecl.h>
    22 #include <namechars.h>
    23 #include <../perflib/perfsec.h>
    24 #include <../s2p.h>
    25 
    26 #include <TagMatcher.h>
    27 #include <LineColTracker.h>
    28 #include <ErrorUtil.h>
    29 #include <ErrorTracker.h>
    30 #include <XMLTestSuiteError.h>
    313
    324#ifdef BUFFER_PROFILING
     
    5123TagMatcher matcher;
    5224ErrorTracker error_tracker;
    53 BitBlock EOF_mask = simd_const_1(1);
     25BitBlock EOF_mask = simd<1>::constant<1>();
    5426
    5527queue <size_t> elem_starts_buf;
     
    519491    block_base = block_pos;
    520492    if (remaining > 0 || @any_carry) {
    521           EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
    522           s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
     493          EOF_mask = bitblock::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-remaining));
     494          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
    523495          @final_block_stmts
    524496          postprocess_do_block(lex, ctCDPI_Callouts, ref_Callouts, check_streams, tag_Callouts, chars_avail);
  • proto/SymbolTable/symtab_pbgs_div_template.cpp

    r1499 r1648  
    1 #define TEMPLATED_SIMD_LIB
    2 
    3 #include <stdio.h>
    4 #include <stdlib.h>
    5 #include <errno.h>
    6 #include <sys/types.h>
    7 #include <sys/stat.h>
    8 #include <../lib_simd.h>
     1#include "../symtab_global.h"
    92#include <pbgs_div_symbol_table.h>
    10 #include <queue>
    11 #include <string>
    12 using namespace std;
    13 
    14 #define DEBUG 0
    15 #define BLOCK_SIZE (sizeof(SIMD_type) * 8)
    16 #define SEGMENT_BLOCKS 12
    17 #define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    18 #define OVERLAP_BUFSIZE 2*(sizeof(SIMD_type))
    19 
    20 #include <../carryQ.h>
    21 #include <xmldecl.h>
    22 #include <namechars.h>
    23 #include <../perflib/perfsec.h>
    24 #include <../s2p.h>
    25 
    26 #include <TagMatcher.h>
    27 #include <LineColTracker.h>
    28 #include <ErrorUtil.h>
    29 #include <ErrorTracker.h>
    30 #include <XMLTestSuiteError.h>
    313
    324#ifdef BUFFER_PROFILING
     
    5123LineColTracker tracker;
    5224TagMatcher matcher;
    53 BitBlock EOF_mask = simd_const_1(1);
     25BitBlock EOF_mask = simd<1>::constant<1>();
    5426ErrorTracker error_tracker;
    5527
     
    152124{
    153125    BitBlock s = block[0];
    154     BitBlock temp = simd_and(s, simd<128>::sll(simd<2>::constant<3>(), sisd_from_int(pos)));
     126    BitBlock temp = simd_and(s, simd<128>::sll(simd<2>::constant<3>(), convert(pos)));
    155127
    156128    if (bitblock_has_bit(temp))
     
    668640    block_base = block_pos;
    669641    if (remaining > 0 || @any_carry) {
    670           EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
     642          EOF_mask = bitblock::srl(simd<1>::constant<1>(),convert(BLOCK_SIZE-remaining));
    671643          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
    672644          @final_block_stmts
  • proto/SymbolTable/symtab_pbgs_identity_template.cpp

    r1499 r1648  
    1 #define TEMPLATED_SIMD_LIB
    2 
    3 #define USE_MASK_COMPARE    //Comparison using masking technique.
    4 
    5 #include <stdio.h>
    6 #include <stdlib.h>
    7 #include <errno.h>
    8 #include <sys/types.h>
    9 #include <sys/stat.h>
    10 #include <../lib_simd.h>
     1#include "../symtab_global.h"
    112#include <pbgs_identity_symbol_table.h>
    12 #include <queue>
    13 #include <string>
    14 using namespace std;
    15 
    16 #define DEBUG 0
    17 #define BLOCK_SIZE (sizeof(SIMD_type) * 8)
    18 #define SEGMENT_BLOCKS 12
    19 #define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    20 #define OVERLAP_BUFSIZE 2*(sizeof(SIMD_type))
    21 
    22 #include <../carryQ.h>
    23 #include <xmldecl.h>
    24 #include <namechars.h>
    25 #include <../perflib/perfsec.h>
    26 #include <../s2p.h>
    27 
    28 #include <TagMatcher.h>
    29 #include <LineColTracker.h>
    30 #include <ErrorUtil.h>
    31 #include <ErrorTracker.h>
    32 #include <XMLTestSuiteError.h>
    333
    344#ifdef BUFFER_PROFILING
     
    5222LineColTracker tracker;
    5323TagMatcher matcher;
    54 BitBlock EOF_mask = simd_const_1(1);
     24BitBlock EOF_mask = simd<1>::constant<1>();
    5525ErrorTracker error_tracker;
    5626
     
    151121{
    152122    BitBlock s = block[0];
    153     BitBlock temp = simd_and( s, simd_not(simd<128>::sll(simd<2>::constant<3>(), sisd_from_int(pos))) );
     123    BitBlock temp = simd_and( s, simd_not(simd<128>::sll(simd<2>::constant<3>(), convert(pos))) );
    154124
    155125    if (bitblock_has_bit(temp))
    156126    {
    157127        // sizeof (BitBlock)*8 - cbzl( s & ~(~0 << pos)) - 1;
    158         return BLOCK_SIZE - count_backward_zeroes (temp) - 1;
     128        return BLOCK_SIZE - count_reverse_zeroes (temp) - 1;
    159129    }
    160130    else
     
    461431
    462432    // Store the last starting position in case we hit boundary case
    463     previous_block_last_elem_start = - count_backward_zeroes (elem_starts);
     433    previous_block_last_elem_start = - count_reverse_zeroes (elem_starts);
    464434
    465435    //copy current hash value data as previous one.
     
    662632    block_base = block_pos;
    663633    if (remaining > 0 || @any_carry) {
    664           EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
     634          EOF_mask = bitblock::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-remaining));
    665635          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
    666636          @final_block_stmts
  • proto/SymbolTable/symtab_pbgs_log_template.cpp

    r1491 r1648  
    1 #define TEMPLATED_SIMD_LIB
    2 
    31#define USE_MASK_COMPARE    //Comparison using masking technique.
    42
    5 #include <stdio.h>
    6 #include <stdlib.h>
    7 #include <errno.h>
    8 #include <sys/types.h>
    9 #include <sys/stat.h>
    10 #include <../lib_simd.h>
     3#include "../symtab_global.h"
    114#include <pbgs_log_symbol_table.h>
    12 #include <queue>
    13 #include <string>
    14 using namespace std;
    15 
    16 #define DEBUG 0
    17 #define BLOCK_SIZE (sizeof(SIMD_type) * 8)
    18 #define SEGMENT_BLOCKS 12
    19 #define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    20 #define OVERLAP_BUFSIZE 2*(sizeof(SIMD_type))
    21 
    22 #include <../carryQ.h>
    23 #include <xmldecl.h>
    24 #include <namechars.h>
    25 #include <../perflib/perfsec.h>
    26 #include <../s2p.h>
    27 
    28 #include <TagMatcher.h>
    29 #include <LineColTracker.h>
    30 #include <ErrorUtil.h>
    31 #include <ErrorTracker.h>
    32 #include <XMLTestSuiteError.h>
    335
    346#ifdef BUFFER_PROFILING
     
    5224LineColTracker tracker;
    5325TagMatcher matcher;
    54 BitBlock EOF_mask = simd_const_1(1);
     26BitBlock EOF_mask = simd<1>::constant<1>();
    5527ErrorTracker error_tracker;
    5628
     
    174146{
    175147    BitBlock s = block[0];
    176     BitBlock temp = simd_and( s, simd_not(simd<128>::sll(simd<2>::constant<3>(), sisd_from_int(pos))) );
     148    BitBlock temp = simd_and( s, simd_not(simd<128>::sll(simd<2>::constant<3>(), convert(pos))) );
    177149
    178150    if (bitblock_has_bit(temp))
    179151    {
    180152        // sizeof (BitBlock)*8 - cbzl( s & ~(~0 << pos)) - 1;
    181         return sizeof(BitBlock)*8 - count_backward_zeroes (temp) - 1;
     153        return sizeof(BitBlock)*8 - count_reverse_zeroes (temp) - 1;
    182154    }
    183155    else
     
    529501
    530502    // Store the last starting position in case we hit boundary case
    531     previous_block_last_elem_start = - count_backward_zeroes (elem_starts);
     503    previous_block_last_elem_start = - count_reverse_zeroes (elem_starts);
    532504
    533505    //copy current hash value data as previous one.
     
    726698    block_base = block_pos;
    727699    if (remaining > 0 || @any_carry) {
    728           EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
    729           s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
     700          EOF_mask = bitblock::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-remaining));
     701          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
    730702          @final_block_stmts
    731703          postprocess_do_block(lex, ctCDPI_Callouts, ref_Callouts, check_streams, tag_Callouts, hash_data, chars_avail);
  • proto/SymbolTable/symtab_stl_template.cpp

    r1491 r1648  
    1 #define TEMPLATED_SIMD_LIB
    2 
    3 #include <stdio.h>
    4 #include <stdlib.h>
    5 #include <errno.h>
    6 #include <sys/types.h>
    7 #include <sys/stat.h>
    8 #include <../lib_simd.h>
     1#include "../symtab_global.h"
    92#include <symtab.h>
    10 #include <queue>
    11 #include <string>
    12 using namespace std;
    13 
    14 #define DEBUG 0
    15 #define BLOCK_SIZE (sizeof(SIMD_type) * 8)
    16 #define SEGMENT_BLOCKS 12
    17 #define BUFFER_SIZE (BLOCK_SIZE * SEGMENT_BLOCKS)
    18 #define OVERLAP_BUFSIZE 2*(sizeof(SIMD_type))
    19 
    20 #include <../carryQ.h>
    21 #include <xmldecl.h>
    22 #include <namechars.h>
    23 #include <../perflib/perfsec.h>
    24 #include <../s2p.h>
    25 
    26 #include <TagMatcher.h>
    27 #include <LineColTracker.h>
    28 #include <ErrorUtil.h>
    29 #include <ErrorTracker.h>
    30 #include <XMLTestSuiteError.h>
    313
    324#ifdef BUFFER_PROFILING
     
    5022TagMatcher matcher;
    5123ErrorTracker error_tracker;
    52 BitBlock EOF_mask = simd_const_1(1);
     24BitBlock EOF_mask = simd<1>::constant<1>();
    5325
    5426queue <size_t> elem_starts_buf;
     
    525497    block_base = block_pos;
    526498    if (remaining > 0 || @any_carry) {
    527           EOF_mask = sisd_srl(simd_const_1(1),sisd_from_int(BLOCK_SIZE-remaining));
    528           s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
     499          EOF_mask = bitblock::srl(simd<1>::constant<1>(), convert(BLOCK_SIZE-remaining));
     500          s2p_do_final_block((BytePack *) &srcbuf[block_pos], basis_bits, EOF_mask);
    529501          @final_block_stmts
    530502          postprocess_do_block(lex, ctCDPI_Callouts, ref_Callouts, check_streams, tag_Callouts, chars_avail);
Note: See TracChangeset for help on using the changeset viewer.