Ignore:
Timestamp:
Nov 7, 2016, 12:08:13 PM (3 years ago)
Author:
nmedfort
Message:

More 32-bit fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.cpp

    r5202 r5204  
    4040
    4141       
    42 void scanMatchKernel::generateDoBlockMethod() {
     42void ScanMatchKernel::generateDoBlockMethod() {
    4343    auto savePoint = iBuilder->saveIP();
    4444    Module * m = iBuilder->getModule();
    4545    Function * scanWordFunction = generateScanWordRoutine(m);
    46     const unsigned fieldCount = iBuilder->getBitBlockWidth() / mScanwordBitWidth;
    47     Type * T = iBuilder->getIntNTy(mScanwordBitWidth);
     46    IntegerType * T = iBuilder->getSizeTy();
     47    const unsigned fieldCount = iBuilder->getBitBlockWidth() / T->getBitWidth();
     48
    4849    Type * scanwordVectorType =  VectorType::get(T, fieldCount);
    4950
     
    6667        Value * recordBreaksWord = iBuilder->CreateExtractElement(breakWordVector, ConstantInt::get(T, i));
    6768        Value * wordResult = iBuilder->CreateCall(scanWordFunction, {kernelStuctParam, matchWord, recordBreaksWord, scanwordPos, recordStart, recordNum});
    68         scanwordPos = iBuilder->CreateAdd(scanwordPos, ConstantInt::get(T, mScanwordBitWidth));
     69        scanwordPos = iBuilder->CreateAdd(scanwordPos, ConstantInt::get(T, T->getBitWidth()));
    6970        recordStart = iBuilder->CreateExtractValue(wordResult, std::vector<unsigned>({0}));
    7071        recordNum = iBuilder->CreateExtractValue(wordResult, std::vector<unsigned>({1}));
     
    7778
    7879   
    79 Function * scanMatchKernel::generateScanWordRoutine(Module * m) {
     80Function * ScanMatchKernel::generateScanWordRoutine(Module * m) {
    8081    Function * function = m->getFunction("scan_matches_in_scanword");
    8182    if (LLVM_UNLIKELY(function != nullptr)) {
     
    8485   
    8586    LLVMContext & ctxt = m->getContext();
    86     Type * T = iBuilder->getIntNTy(mScanwordBitWidth);
     87
     88    IntegerType * T = iBuilder->getSizeTy();
    8789    Type * S = PointerType::get(iBuilder->getIntNTy(8), 0);
    8890    Type * returnType = StructType::get(ctxt, std::vector<Type *>({T, T}));
     
    174176    Value * matchRecordNum = iBuilder->CreateAdd(generatePopcount(iBuilder, prior_breaks), recordNum_phi);
    175177    Value * reverseDistance = generateCountReverseZeroes(iBuilder, prior_breaks);
    176     Value * width = ConstantInt::get(T, mScanwordBitWidth);
     178    Value * width = ConstantInt::get(T, T->getBitWidth());
    177179    Value * matchRecordStart = iBuilder->CreateAdd(scanwordPos, iBuilder->CreateSub(width, reverseDistance));
    178180    iBuilder->CreateBr(loop_final_block);
Note: See TracChangeset for help on using the changeset viewer.