OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_47/] [or1ksim/] [cuc/] [adv.c] - Diff between revs 1244 and 1308

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1244 Rev 1308
Line 46... Line 46...
}
}
 
 
/* Calculates facts, that are determined by conditionals */
/* Calculates facts, that are determined by conditionals */
void insert_conditional_facts (cuc_func *f)
void insert_conditional_facts (cuc_func *f)
{
{
  int b, i, j;
  int b, j;
  int b1, i1, j1;
  int b1, i1, j1;
  cuc_insn n[2];
  cuc_insn n[2];
  for (b = 0; b < f->num_bb; b++) if (f->bb[b].ninsn > 0) {
  for (b = 0; b < f->num_bb; b++) if (f->bb[b].ninsn > 0) {
    cuc_insn *ii = &f->bb[b].insn[f->bb[b].ninsn - 1];
    cuc_insn *ii = &f->bb[b].insn[f->bb[b].ninsn - 1];
    /* We have following situation
    /* We have following situation
Line 135... Line 135...
        cucdebug (1, "%x rref %x cnt %i\n", b, rref, cnt);
        cucdebug (1, "%x rref %x cnt %i\n", b, rref, cnt);
        fflush (stdout);
        fflush (stdout);
        for (j = 0; j < 2; j++) {
        for (j = 0; j < 2; j++) {
          int nb = f->num_bb++;
          int nb = f->num_bb++;
          int sb;
          int sb;
          int k;
 
          assert (nb < MAX_BB);
          assert (nb < MAX_BB);
          f->bb[nb].type = 0;
          f->bb[nb].type = 0;
          f->bb[nb].first = -1; f->bb[nb].last = -1;
          f->bb[nb].first = -1; f->bb[nb].last = -1;
          f->bb[nb].prev[0] = b; f->bb[nb].prev[1] = -1;
          f->bb[nb].prev[0] = b; f->bb[nb].prev[1] = -1;
          sb = f->bb[nb].next[0] = f->bb[b].next[j]; f->bb[nb].next[1] = -1;
          sb = f->bb[nb].next[0] = f->bb[b].next[j]; f->bb[nb].next[1] = -1;
Line 241... Line 240...
   approaching final solution. This algorithm is surely finite,
   approaching final solution. This algorithm is surely finite,
   but can be very slow; so we stop after some iterations;
   but can be very slow; so we stop after some iterations;
   normal loops should be in this range */
   normal loops should be in this range */
void detect_max_values (cuc_func *f)
void detect_max_values (cuc_func *f)
{
{
  int b, i, j;
  int b, i;
  int modified = 0;
  int modified = 0;
  int iteration = 0;
  int iteration = 0;
 
 
  for (b = 0; b < f->num_bb; b++) {
  for (b = 0; b < f->num_bb; b++) {
    for (i = 0; i < f->bb[b].ninsn; i++) f->bb[b].insn[i].max = 0;
    for (i = 0; i < f->bb[b].ninsn; i++) f->bb[b].insn[i].max = 0;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.