Lib/Target/instr/Instr.cpp
/**
 * Debug function for displaying the used accumulators in the instruction list
 */
Debug function for displaying the used accumulators in the instruction list
Debug function for displaying the used accumulators in the instruction list
std::string Instr::List::check_acc_usage(int first, int last) const {
  if (first == -1) first = 0;
  if (last  == -1) last = size() -1;
  assert(first <= last);
  std::string ret;
  for (int index = first; index <= last; ++index) {
    uint32_t accs = (*this)[index].get_acc_usage();
    assert(accs < 64);
    if (accs == 0) continue;
    ret << index << ": ";
    if (accs &  1) ret << "0, ";
    if (accs &  2) ret << "1, ";
    if (accs &  4) ret << "2, ";
    if (accs &  8) ret << "3, ";
    if (accs & 16) ret << "4, ";
    if (accs & 32) ret << "5, ";
    if ((*this)[index].isRot()) {
      ret << " - Rot instruction";
    }
    ret << "\n";
  }
  return ret;
}
std :: string Instr :: List :: check_acc_usage ( int first , int last ) const { if ( first == -1 ) first = 0 ; if ( last == -1 ) last = size ( ) - 1 ; assert ( first <= last ) ; std :: string ret ; for ( int index = first ; index <= last ; ++ index ) { uint32_t accs = ( * this ) [ index ] . get_acc_usage ( ) ; assert ( accs < 64 ) ; if ( accs == 0 ) continue ; ret << index << " " ; if ( accs & 1 ) ret << " " ; if ( accs & 2 ) ret << " " ; if ( accs & 4 ) ret << " " ; if ( accs & 8 ) ret << " " ; if ( accs & 16 ) ret << " " ; if ( accs & 32 ) ret << " " ; if ( ( * this ) [ index ] . isRot ( ) ) { ret << " " ; } ret << " \n " ; } return ret ; }
Debug function for displaying the used accumulators in the instruction list
Debug function for displaying the used accumulators in the instruction list