Ignore:
Timestamp:
Feb 18, 2017, 4:13:44 PM (3 years ago)
Author:
nmedfort
Message:

Continued work on parenthesis matching; addition of Pablo ScanTo? and AdvanceThenScanTo/Thru? statements. Bug fix for Pablo Compiler for escaping variables.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp

    r5320 r5329  
    337337
    338338        incomingPhi->addIncoming(outgoingValue, whileExitBlock);
    339         f->second = incomingPhi;
    340339    }
    341340
     
    457456            value = iBuilder->simd_or(iBuilder->simd_xor(sum, cc), marker);
    458457        } else if (const ScanThru * sthru = dyn_cast<ScanThru>(stmt)) {
     458            Value * const from = compileExpression(sthru->getScanFrom());
     459            Value * const thru = compileExpression(sthru->getScanThru());
     460            Value * const sum = mCarryManager->addCarryInCarryOut(sthru, from, thru);
     461            value = iBuilder->simd_and(sum, iBuilder->simd_not(thru));
     462        } else if (const ScanTo * sthru = dyn_cast<ScanTo>(stmt)) {
    459463            Value * const marker_expr = compileExpression(sthru->getScanFrom());
    460             Value * const cc_expr = compileExpression(sthru->getScanThru());
    461             Value * const sum = mCarryManager->addCarryInCarryOut(sthru, marker_expr, cc_expr);
    462             value = iBuilder->simd_and(sum, iBuilder->simd_not(cc_expr));
     464            Value * const to = iBuilder->simd_xor(compileExpression(sthru->getScanTo()), mKernel->getScalarField("EOFmask"));
     465            Value * const sum = mCarryManager->addCarryInCarryOut(sthru, marker_expr, iBuilder->simd_not(to));
     466            value = iBuilder->simd_and(sum, to);
     467        } else if (const AdvanceThenScanThru * sthru = dyn_cast<AdvanceThenScanThru>(stmt)) {
     468            Value * const from = compileExpression(sthru->getScanFrom());
     469            Value * const thru = compileExpression(sthru->getScanThru());
     470            Value * const sum = mCarryManager->addCarryInCarryOut(sthru, from, iBuilder->simd_or(from, thru));
     471            value = iBuilder->simd_and(sum, iBuilder->simd_not(thru));
     472        } else if (const AdvanceThenScanTo * sthru = dyn_cast<AdvanceThenScanTo>(stmt)) {
     473            Value * const from = compileExpression(sthru->getScanFrom());
     474            Value * const to = iBuilder->simd_xor(compileExpression(sthru->getScanTo()), mKernel->getScalarField("EOFmask"));
     475            Value * const sum = mCarryManager->addCarryInCarryOut(sthru, from, iBuilder->simd_or(from, iBuilder->simd_not(to)));
     476            value = iBuilder->simd_and(sum, to);
    463477        } else if (const InFile * e = dyn_cast<InFile>(stmt)) {
    464478            Value * EOFmask = mKernel->getScalarField("EOFmask");
     
    546560        if (DebugOptionIsSet(DumpTrace)) {
    547561            const String & name = isa<Var>(expr) ? cast<Var>(expr)->getName() : cast<Statement>(expr)->getName();
     562            if (value->getType()->isPointerTy()) {
     563                value = iBuilder->CreateLoad(value);
     564            }
    548565            if (value->getType()->isVectorTy()) {
    549566                iBuilder->CallPrintRegister(name.str(), value);
Note: See TracChangeset for help on using the changeset viewer.