Changeset 5140 for icGREP/icgrep-devel


Ignore:
Timestamp:
Sep 2, 2016, 6:01:16 PM (3 years ago)
Author:
cameron
Message:

Bitstream and byte space character class kernels - initial check-in

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

Legend:

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

    r5121 r5140  
    121121}
    122122
     123Value * IDISA_Builder::simd_fill(unsigned fw, Value * a) {
     124    unsigned field_count = mBitBlockWidth/fw;
     125    Type * singleFieldVecTy = VectorType::get(getIntNTy(fw), 1);
     126    Value * aVec = CreateBitCast(a, singleFieldVecTy);
     127    return CreateShuffleVector(aVec, UndefValue::get(singleFieldVecTy), Constant::getNullValue(VectorType::get(getInt32Ty(), field_count)));
     128}
     129
    123130Value * IDISA_Builder::simd_add(unsigned fw, Value * a, Value * b) {
    124 return CreateAdd(fwCast(fw, a), fwCast(fw, b));
     131    return CreateAdd(fwCast(fw, a), fwCast(fw, b));
    125132}
    126133
  • icGREP/icgrep-devel/icgrep/IDISA/idisa_builder.h

    r5126 r5140  
    8484    Constant * simd_himask(unsigned fw);
    8585    Constant * simd_lomask(unsigned fw);
     86   
     87    virtual Value * simd_fill(unsigned fw, Value * a);
    8688
    8789    virtual Value * simd_add(unsigned fw, Value * a, Value * b);
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.cpp

    r5137 r5140  
    228228    return mBasisBit[mEncodingBits - i - 1];
    229229}
     230   
     231pablo::PabloFunction * ParabixCharacterClassFunction(std::string ccSetName, std::vector<re::CC *> charClasses, unsigned basisBitsCount) {
     232       
     233    pablo::PabloFunction * cc_function = pablo::PabloFunction::Create(ccSetName + "_fn", basisBitsCount, charClasses.size());
     234    CC_Compiler ccc(* cc_function, basisBitsCount);
     235   
     236    pablo::PabloBuilder pBuilder(ccc.getBuilder().getPabloBlock(), ccc.getBuilder());
     237    const std::vector<pablo::Var *> bits = ccc.getBasisBits();
     238   
     239    for (unsigned i = 0; i < charClasses.size(); i++) {
     240        cc_function->setResult(i, ccc.compileCC(charClasses[i]));
     241    }
     242    return cc_function;
     243}
    230244
    231245} // end of namespace cc
  • icGREP/icgrep-devel/icgrep/cc/cc_compiler.h

    r5137 r5140  
    88#define CC_COMPILER_H
    99
     10
    1011#include <re/re_cc.h>
    1112#include <pablo/builder.hpp>
    1213#include <string>
    13 
    1414
    1515namespace pablo {
     
    8787}
    8888
     89pablo::PabloFunction * ParabixCharacterClassFunction(std::string ccSetName, std::vector<re::CC *> charClasses, unsigned basisBitsCount);
     90
    8991
    9092}
Note: See TracChangeset for help on using the changeset viewer.