Changeset 4952


Ignore:
Timestamp:
Mar 3, 2016, 9:42:23 AM (3 years ago)
Author:
cameron
Message:

Removing compile-time BLOCK_SIZE from toolchain, grep_engine, enable BlockSize? command-line parameter

Location:
icGREP/icgrep-devel/icgrep
Files:
3 edited

Legend:

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

    r4949 r4952  
    163163    Module * M = new Module("moduleName", getGlobalContext());
    164164   
    165     IDISA::IDISA_Builder * idb = GetNativeIDISA_Builder(M, VectorType::get(IntegerType::get(getGlobalContext(), 64), BLOCK_SIZE/64));
     165    IDISA::IDISA_Builder * idb = GetIDISA_Builder(M);
    166166
    167167    PipelineBuilder pipelineBuilder(M, idb);
  • icGREP/icgrep-devel/icgrep/toolchain.cpp

    r4950 r4952  
    206206
    207207
    208 IDISA::IDISA_Builder * GetNativeIDISA_Builder(Module * mod, Type * bitBlockType) {
    209 
     208IDISA::IDISA_Builder * GetIDISA_Builder(Module * mod) {
     209    bool hasAVX2 = (strncmp(lGetSystemISA(), "avx2", 4) == 0);
     210   
     211    unsigned theBlockSize = BlockSize;  // from command line
     212   
     213    if (theBlockSize == 0) {  // No BlockSize override: use processor SIMD width
     214        theBlockSize = hasAVX2 ? 256 : 128;
     215    }
     216    Type * bitBlockType = VectorType::get(IntegerType::get(getGlobalContext(), 64), theBlockSize/64);
     217   
    210218    int blockSize = bitBlockType->isIntegerTy() ? cast<IntegerType>(bitBlockType)->getIntegerBitWidth() : cast<VectorType>(bitBlockType)->getBitWidth();
    211219    if (blockSize == 256) {
    212         if ((strncmp(lGetSystemISA(), "avx2", 4) == 0)) {
     220        if (hasAVX2) {
    213221            return new IDISA::IDISA_AVX2_Builder(mod, bitBlockType);
    214222        }
  • icGREP/icgrep-devel/icgrep/toolchain.h

    r4939 r4952  
    1818#include <IDISA/idisa_builder.h>
    1919
    20 IDISA::IDISA_Builder * GetNativeIDISA_Builder(Module * m, Type * bitBlockType);
     20IDISA::IDISA_Builder * GetIDISA_Builder(Module * m);
    2121
    2222re::RE * regular_expression_passes(const Encoding encoding, re::RE * re_ast);
Note: See TracChangeset for help on using the changeset viewer.