Ignore:
Timestamp:
Oct 26, 2017, 8:31:35 AM (21 months ago)
Author:
cameron
Message:

createIndexedAdvance

File:
1 edited

Legend:

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

    r5329 r5709  
    133133}
    134134
     135PabloAST * PabloBuilder::createIndexedAdvance(PabloAST * expr, PabloAST * indexStream, PabloAST * shiftAmount) {
     136    if (isa<Zeroes>(expr) || cast<Integer>(shiftAmount)->value() == 0) {
     137        return expr;
     138    }
     139    else if (isa<Ones>(expr)) {
     140        return createAdvance(expr, shiftAmount);
     141    }
     142    else if (cast<Integer>(shiftAmount)->value() == 1) {
     143        return createAdvanceThenScanTo(expr, indexStream);
     144    }
     145    MAKE_TERNARY(createIndexedAdvance, TypeId::IndexedAdvance, expr, indexStream, shiftAmount);
     146    return result;
     147}
     148
     149PabloAST * PabloBuilder::createIndexedAdvance(PabloAST * expr, PabloAST * indexStream, PabloAST * shiftAmount, const llvm::StringRef & prefix) {
     150    if (isa<Zeroes>(expr) || cast<Integer>(shiftAmount)->value() == 0) {
     151        return expr;
     152    }
     153    else if (isa<Ones>(expr)) {
     154        return createAdvance(expr, shiftAmount, prefix);
     155    }
     156    else if (cast<Integer>(shiftAmount)->value() == 1) {
     157        return createAdvanceThenScanTo(expr, indexStream, prefix);
     158    }
     159    MAKE_NAMED_TERNARY(createIndexedAdvance, TypeId::IndexedAdvance, prefix, expr, indexStream, shiftAmount);
     160    return result;
     161}
     162   
    135163Extract * PabloBuilder::createExtract(PabloAST * value, not_null<PabloAST *> index) {
    136164    MAKE_BINARY(createExtract, TypeId::Extract, value, index);
Note: See TracChangeset for help on using the changeset viewer.