Esempio n. 1
0
  void CodeGen(MemoryManager& mm, handlers::CodeHandler& ch)
  {
    size_t mem_id = mm.RequestLocation(id);

    std::stringstream ss;

    ss << "s->Get(" << base_id << ", buff[" << mem_id << "]);";

    ch.AddEntry(ss.str());
    //ss2 << "s.Get_" << base_id << "(buff[" << mem_id << "]);" << std::endl;
  }
Esempio n. 2
0
  void CodeGen(MemoryManager& mm, handlers::CodeHandler& ch)
  {
    size_t ml = mm.RequestLocation(id);

    std::stringstream* ss = new std::stringstream();

    *ss << "buff[" << ml << "] = ";

    auto in_id = in_ids.begin();
    PrintAccess(*in_id, mm, *ss);
    in_id++;

    size_t or_count = 0;

    for(in_id = in_id;in_id != in_ids.end();in_id++)
    {
      if(or_count > or_limit)
      {
        *ss << ";";
        ch.AddEntry(ss->str());
        delete ss;
        ss = new std::stringstream();
        *ss << "buff[" << ml << "] = buff[" << ml << "]";
        or_count = or_count - 1;
      }

      *ss << " || ";
      PrintAccess(*in_id, mm , *ss);
      or_count++;
    }

    *ss << ";";

    ch.AddEntry(ss->str());
    delete ss;
  }