Ignore:
Timestamp:
Sep 1, 2014, 1:11:04 AM (5 years ago)
Author:
linmengl
Message:

auto detect LLVM version in CMakeList.txt; add #ifdef blocks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r4080 r4118  
    7272#endif
    7373
     74//define this indicates that we use llvm.uadd.with.overflow for genAddWithCarry
     75#define USE_UADD_OVERFLOW
     76
    7477BitBlock get_category(Basis_bits &basis_bits, const char* category);
    7578
     
    8487    char * infile_buffer;
    8588#endif
    86    
     89
    8790    int opt_code;
    8891    int count_only_option = 0;
     
    296299    BitStreamScanner<BitBlock, uint64_t, uint64_t, SEGMENT_BLOCKS> LF_scanner;
    297300    BitStreamScanner<BitBlock, uint64_t, uint64_t, SEGMENT_BLOCKS> match_scanner;
    298        
    299    
     301
     302
    300303#ifndef USE_MMAP
    301304    ATTRIBUTE_SIMD_ALIGN char src_buffer[SEGMENT_SIZE];
    302    
     305
    303306    chars_read = fread((void *)&src_buffer[0], 1, SEGMENT_SIZE, infile);
    304307    chars_avail = chars_read;
    305308    if (chars_avail >= SEGMENT_SIZE) chars_avail = SEGMENT_SIZE;
    306309#endif
    307 #ifdef USE_MMAP   
     310#ifdef USE_MMAP
    308311    int segment = 0;
    309312    int segment_base = 0;
    310313    chars_avail = infile_size;
    311    
     314
    312315#endif
    313316//////////////////////////////////////////////////////////////////////////////////////////
     
    315318//////////////////////////////////////////////////////////////////////////////////////////
    316319
    317    
    318    
     320
     321
    319322    while (chars_avail >= SEGMENT_SIZE) {
    320323
     
    332335#ifdef USE_MMAP
    333336            block_base = blk*BLOCK_SIZE + segment_base;
    334             s2p_do_block((BytePack *) &infile_buffer[block_base], basis_bits);   
     337            s2p_do_block((BytePack *) &infile_buffer[block_base], basis_bits);
    335338#endif
    336339            process_block(basis_bits, carry_q, output);
     
    368371#endif
    369372#ifdef USE_MMAP
    370    
     373
    371374#endif
    372375
     
    389392#ifdef USE_MMAP
    390393                fwrite(&infile_buffer[segment_base + line_start], 1, line_end - line_start + 1, outfile);
    391  
     394
    392395#endif
    393396
     
    415418        line_start -= SEGMENT_SIZE;  /* Will be negative offset for use within next segment. */
    416419        chars_avail -= SEGMENT_SIZE;
    417    
     420
    418421#endif
    419422    }
     
    442445#ifdef USE_MMAP
    443446        block_base = block_pos + segment_base;
    444         s2p_do_block((BytePack *) &infile_buffer[block_base], basis_bits);   
     447        s2p_do_block((BytePack *) &infile_buffer[block_base], basis_bits);
    445448#endif
    446449        process_block(basis_bits, carry_q, output);
     
    479482#ifdef USE_MMAP
    480483     block_base = block_pos + segment_base;
    481      s2p_do_final_block((BytePack *) &infile_buffer[block_base], basis_bits, EOF_mask);   
     484     s2p_do_final_block((BytePack *) &infile_buffer[block_base], basis_bits, EOF_mask);
    482485#endif
    483486    process_block(basis_bits, carry_q, output);
     
    520523#ifdef USE_MMAP
    521524            fwrite(&infile_buffer[segment_base + line_start], 1, line_end - line_start + 1, outfile);
    522  
     525
    523526#endif
    524527            line_start = line_end + 1;
Note: See TracChangeset for help on using the changeset viewer.