Ignore:
Timestamp:
Jan 13, 2018, 11:57:43 AM (15 months ago)
Author:
nmedfort
Message:

Pablo support for byte comparisions; LineFeed? kernel processes byte streams directly. Some clean up of PabloBuilder? functionality.

File:
1 edited

Legend:

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

    r5705 r5828  
    1818#include <pablo/pe_matchstar.h>
    1919#include <pablo/pe_ones.h>
    20 #include <pablo/pe_phi.h>
     20#include <pablo/pe_repeat.h>
    2121#include <pablo/pe_scanthru.h>
    2222#include <pablo/pe_string.h>
     
    2424#include <pablo/pe_zeroes.h>
    2525#include <pablo/ps_assign.h>
     26#include <llvm/IR/Type.h>
    2627#include <llvm/Support/raw_os_ostream.h>
    2728
     
    5859        print(cast<PabloAST>(stmt), out);
    5960
    60         if (const Extract * extract = dyn_cast<Extract>(stmt)) {
    61             out << " = Extract ";
    62             print(extract->getArray(), out);
    63             out << ", ";
    64             print(extract->getIndex(), out);
    65         } else if (const And * andNode = dyn_cast<And>(stmt)) {
     61        if (const And * andNode = dyn_cast<And>(stmt)) {
    6662            out << " = (";
    6763            for (unsigned i = 0; i != andNode->getNumOperands(); ++i) {
     
    144140            print(count->getExpr(), out);
    145141            out << ")";
     142        } else if (const Repeat * splat = dyn_cast<Repeat>(stmt)) {
     143            out << " = pablo.Repeat(";
     144            print(splat->getFieldWidth(), out);
     145            out << ", ";
     146            print(splat->getValue(), out);
     147            out << ")";
    146148        } else if (const InFile * e = dyn_cast<InFile>(stmt)) {
    147149            out << " = pablo.InFile(";
     
    165167    } else if (isa<Ones>(expr)) {
    166168        out << "1";
     169    } else if (const Extract * extract = dyn_cast<Extract>(expr)) {
     170        print(extract->getArray(), out);
     171        out << "[";
     172        print(extract->getIndex(), out);
     173        out << "]";
    167174    } else if (const Var * var = dyn_cast<Var>(expr)) {
    168175        out << var->getName();
    169     } else if (const Phi * const phi = dyn_cast<Phi>(expr)) {
    170         out << "phi(";
    171         for (unsigned i = 0; i != phi->getNumIncomingValues(); ++i) {
    172             if (i) out << ", ";
    173             print(phi->getIncomingValue(i), out);
    174         }
    175         out << ")";
    176176    } else if (const If * ifstmt = dyn_cast<If>(expr)) {
    177177        out << "If ";
Note: See TracChangeset for help on using the changeset viewer.