Ignore:
Timestamp:
Dec 26, 2015, 12:09:11 PM (3 years ago)
Author:
cameron
Message:

Dynamic generation of s2p code

File:
1 edited

Legend:

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

    r4899 r4900  
    2323#include <llvm/Support/Host.h>
    2424
     25#include <IDISA/idisa_avx_builder.h>
     26#include <IDISA/idisa_sse_builder.h>
    2527#ifndef DISABLE_PREGENERATED_UCD_FUNCTIONS
    2628#include <UCD/precompiled_properties.h>
     
    202204
    203205
    204 ExecutionEngine * JIT_to_ExecutionEngine (llvm::Function * f) {
     206IDISA::IDISA_Builder * GetNativeIDISA_Builder(Module * mod, Type * bitBlockType) {
     207
     208#if (BLOCK_SIZE == 256)
     209    if ((strncmp(lGetSystemISA(), "avx2", 4) == 0)) {
     210        return new IDISA::IDISA_AVX2_Builder(mod, bitBlockType);
     211        //std::cerr << "IDISA_AVX2_Builder selected\n";
     212    }
     213    else{
     214        return new IDISA::IDISA_SSE2_Builder(mod, bitBlockType);
     215        //std::cerr << "Generic IDISA_Builder selected\n";
     216    }
     217#else   
     218    return new IDISA::IDISA_SSE2_Builder(mod, bitBlockType);
     219#endif
     220}
     221
     222
     223
     224ExecutionEngine * JIT_to_ExecutionEngine (Module * m) {
    205225
    206226    InitializeNativeTarget();
     
    209229
    210230    std::string errMessage;
    211     EngineBuilder builder(std::move(std::unique_ptr<Module>(f->getParent())));
     231    EngineBuilder builder(std::move(std::unique_ptr<Module>(m)));
    212232    builder.setErrorStr(&errMessage);
    213233    builder.setMCPU(sys::getHostCPUName());
     
    244264    for (Module::FunctionListType::iterator it = fns.begin(), it_end = fns.end(); it != it_end; ++it) {
    245265        std::string fnName = it->getName().str();
     266        if (fnName == "s2p_block") continue;
    246267        if (fnName == "process_block") continue;
    247268        if (fnName == "process_block_initialize_carries") continue;
Note: See TracChangeset for help on using the changeset viewer.