Changeset 4907


Ignore:
Timestamp:
Jan 6, 2016, 2:12:17 PM (3 years ago)
Author:
cameron
Message:

Kernels in icgrep: initial check-in

Location:
icGREP/icgrep-devel/icgrep
Files:
3 added
4 edited
2 moved

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r4900 r4907  
    6262
    6363SET(PABLO_SRC pablo/pabloAST.cpp pablo/ps_if.cpp pablo/ps_while.cpp pablo/function.cpp pablo/codegenstate.cpp pablo/builder.cpp pablo/symbol_generator.cpp pablo/printer_pablos.cpp)
    64 SET(PABLO_SRC ${PABLO_SRC} pablo/pablo_compiler.cpp pablo/carry_manager.cpp pablo/carry_data.cpp IDISA/idisa_builder.cpp IDISA/idisa_avx_builder.cpp IDISA/idisa_sse_builder.cpp IDISA/s2p_gen.cpp)
     64SET(PABLO_SRC ${PABLO_SRC} pablo/pablo_compiler.cpp pablo/carry_manager.cpp pablo/carry_data.cpp IDISA/idisa_builder.cpp IDISA/idisa_avx_builder.cpp IDISA/idisa_sse_builder.cpp kernels/s2p_gen.cpp kernels/scanmatchgen.cpp)
    6565SET(PABLO_SRC ${PABLO_SRC} pablo/analysis/pabloverifier.cpp)
    6666SET(PABLO_SRC ${PABLO_SRC} pablo/optimizers/pablo_simplifier.cpp pablo/optimizers/codemotionpass.cpp pablo/optimizers/distributivepass.cpp pablo/passes/flattenassociativedfg.cpp pablo/passes/factorizedfg.cpp)
  • icGREP/icgrep-devel/icgrep/icgrep.cpp

    r4900 r4907  
    2626#include <llvm/IR/Verifier.h>
    2727
    28 #include <IDISA/s2p_gen.h>
     28#include <kernels/s2p_gen.h>
     29#include <kernels/scanmatchgen.h>
    2930
    3031#include <re/re_re.h>
     
    145146   
    146147    gen_s2p_function(M, idb);
    147 
     148   
     149   
     150    generateScanBitBlockRoutine(M, idb, 64);
    148151   
    149152    if (IRFileName == "") {       
     
    177180    }
    178181    llvm::Function * s2p_IR = M->getFunction("s2p_block");
    179 
     182   
     183    llvm::Function * scanRoutine = M->getFunction("scan_matches_in_bitblock");
     184   
    180185    if (s2p_IR == nullptr) {
    181186        std::cerr << "No s2p_IR!\n";
     
    195200    void * icgrep_MCptr = engine->getPointerToFunction(icgrep_IR);
    196201    void * s2p_MCptr = engine->getPointerToFunction(s2p_IR);
     202    void * scan_MCptr = engine->getPointerToFunction(scanRoutine);
    197203    if (s2p_MCptr == nullptr) {
    198204        std::cerr << "No s2p_MCptr!\n";
     
    202208    if (icgrep_MCptr) {
    203209        GrepExecutor grepEngine(s2p_MCptr, icgrep_init_carry_ptr, icgrep_MCptr);
     210        //GrepExecutor grepEngine(s2p_MCptr, icgrep_init_carry_ptr, icgrep_MCptr, scan_MCptr);
    204211        grepEngine.setCountOnlyOption(CountOnly);
    205212        grepEngine.setNormalizeLineBreaksOption(NormalizeLineBreaks);
  • icGREP/icgrep-devel/icgrep/re/re_parser.cpp

    r4904 r4907  
    2222#include "utf_encoding.h"
    2323#include <llvm/IR/Type.h>
    24 #include <IDISA/s2p_gen.h>
     24#include <kernels/s2p_gen.h>
    2525#include <pablo/pablo_compiler.h>
    2626#include <do_grep.h>
  • icGREP/icgrep-devel/icgrep/toolchain.cpp

    r4900 r4907  
    247247        throw std::runtime_error("Could not create ExecutionEngine: " + errMessage);
    248248    }
    249     //engine->addGlobalMapping(cast<GlobalValue>(mPrintRegisterFunction), (void *)&wrapped_print_register);
    250     // engine->addGlobalMapping(externalFunction, proto->getFunctionPtr());
    251249
    252250    return engine;
     251}
     252
     253extern "C" {
     254    void wrapped_report_match(uint64_t recordNum, uint64_t recordStart, uint64_t recordEnd) {
     255        printf("line %llu: (%llu, %llu)\n", recordNum, recordStart, recordEnd);
     256    }
    253257}
    254258
     
    267271        if (fnName == "process_block") continue;
    268272        if (fnName == "process_block_initialize_carries") continue;
     273       
    269274        if (fnName == "wrapped_print_register") {
    270275            e->addGlobalMapping(cast<GlobalValue>(it), (void *)&wrapped_print_register);
     276        }
     277        if (fnName == "wrapped_report_match") {
     278            e->addGlobalMapping(cast<GlobalValue>(it), (void *)&wrapped_report_match);
    271279        }
    272280#ifndef DISABLE_PREGENERATED_UCD_FUNCTIONS
Note: See TracChangeset for help on using the changeset viewer.