Ignore:
Timestamp:
Nov 18, 2016, 1:46:55 PM (2 years ago)
Author:
nmedfort
Message:

Merged PabloFunction? and PabloKernel? classes. Updated projects where necessary.

File:
1 edited

Legend:

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

    r5175 r5217  
    1212namespace IDISA {
    1313   
    14 
    15 
    1614IDISA_Builder * GetIDISA_Builder(Module * mod) {
    17     bool hasAVX2 = AVX2_available();
    18     unsigned theBlockSize = codegen::BlockSize;  // from command line
    19    
    20     if (theBlockSize == 0) {  // No BlockSize override: use processor SIMD width
    21         theBlockSize = hasAVX2 ? 256 : 128;
     15    const bool hasAVX2 = AVX2_available();
     16    const bool isArch32Bit = Triple(llvm::sys::getProcessTriple()).isArch32Bit();
     17    if (LLVM_LIKELY(codegen::BlockSize == 0)) {  // No BlockSize override: use processor SIMD width
     18        codegen::BlockSize = hasAVX2 ? 256 : 128;
    2219    }
    23     Type * bitBlockType = VectorType::get(IntegerType::get(mod->getContext(), 64), theBlockSize/64);
    24    
    25     int blockSize = bitBlockType->isIntegerTy() ? cast<IntegerType>(bitBlockType)->getIntegerBitWidth() : cast<VectorType>(bitBlockType)->getBitWidth();
    26     if (blockSize >= 256) {
     20    if (codegen::BlockSize >= 256) {
    2721        if (hasAVX2) {
    28             return new IDISA_AVX2_Builder(mod, bitBlockType);
     22            return new IDISA_AVX2_Builder(mod, isArch32Bit ? 32 : 64, codegen::BlockSize);
    2923        }
    30         else{
    31             return new IDISA_SSE2_Builder(mod, bitBlockType);
    32         }
     24    } else if (codegen::BlockSize == 64) {
     25        return new IDISA_I64_Builder(mod, isArch32Bit ? 32 : 64);
    3326    }
    34     else if (blockSize == 64)
    35         return new IDISA_I64_Builder(mod, bitBlockType);
    36     return new IDISA_SSE2_Builder(mod, bitBlockType);
     27    return new IDISA_SSE2_Builder(mod, isArch32Bit ? 32 : 64, codegen::BlockSize);
    3728}
    3829
Note: See TracChangeset for help on using the changeset viewer.