Changeset 1943 for proto


Ignore:
Timestamp:
Feb 19, 2012, 4:42:38 PM (7 years ago)
Author:
cameron
Message:

Remove unused Advance_buffer() method; optimize simd constants.

Location:
proto/parabix2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • proto/parabix2/pablo_template.cpp

    r1825 r1943  
    403403      matcher.StreamScan(chars_avail);
    404404      matcher.Advance_buffer();
    405       tracker.Advance_buffer();
    406405      PERF_SEC_END(parser_timer, chars_avail);
    407406
     
    440439    matcher.StreamScan(chars_avail);
    441440    matcher.Advance_buffer();
    442     tracker.Advance_buffer();
    443441
    444442
  • proto/parabix2/src/LineColTracker.hpp

    r1865 r1943  
    2020}
    2121
    22 #define BITWISE_NEWLINE_COUNTER_BITS 4
     22#define BITWISE_NEWLINE_COUNTER_BITS 3
    2323
    2424class LineColTracker{
     
    2727    inline void AdvanceBlock();
    2828    inline void StoreNewlines(BitBlock newline);
    29     inline void Advance_buffer();
    3029    void get_Line_and_Column(int pos_in_block, int & line, int & column);
    3130  private:
     
    4039LineColTracker::LineColTracker(){
    4140  blocks_after_last_newline_block = 0;
    42   last_block_with_newline = mvmd<1>::fill(1);
     41  last_block_with_newline = simd<1>::constant<1>();
    4342  newline_counts = 0;
    44   for (int i = 0; i < BITWISE_NEWLINE_COUNTER_BITS; i++) bitwise_counts[i] = mvmd<1>::fill(0);
     43  for (int i = 0; i < BITWISE_NEWLINE_COUNTER_BITS; i++) bitwise_counts[i] = simd<1>::constant<0>();
    4544}
    4645
     
    6160      for (int i = 0; i < BITWISE_NEWLINE_COUNTER_BITS; i++) {
    6261        newline_counts += bitblock::popcount(bitwise_counts[i]) << i;
    63         bitwise_counts[i]  = mvmd<1>::fill(0);
     62        bitwise_counts[i]  = simd<1>::constant<0>();
    6463      }
    6564      newline_counts += bitblock::popcount(carry) << BITWISE_NEWLINE_COUNTER_BITS;
     
    7372void LineColTracker::get_Line_and_Column(int pos_in_block, int & line, int & column) {
    7473
    75   cur_newline = simd_andc(cur_newline, bitblock::sll(mvmd<1>::fill(1), mvmd<BLOCK_SIZE>::fill(pos_in_block)));
     74  cur_newline = simd_andc(cur_newline, bitblock::sll(simd<1>::constant<1>(), mvmd<BLOCK_SIZE>::fill(pos_in_block)));
    7675  if (bitblock::any(cur_newline))
    7776    column = pos_in_block - (BLOCK_SIZE-count_reverse_zeroes(cur_newline))+1;
     
    8887}
    8988
    90 void LineColTracker::Advance_buffer() {
    91 }
    92 
    93 
Note: See TracChangeset for help on using the changeset viewer.