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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [or1ksim/] [cpu/] [or32/] [or32.c] - Diff between revs 552 and 673

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

Rev 552 Rev 673
Line 667... Line 667...
      {
      {
        if (*enc == '0' || *enc == '1' || *enc == '-' || isalpha ((int)*enc))
        if (*enc == '0' || *enc == '1' || *enc == '-' || isalpha ((int)*enc))
          {
          {
            opc_pos--;
            opc_pos--;
            if (param_ch == *enc)
            if (param_ch == *enc)
              ret |= 1 << opc_pos;
              ret |= 1UL << opc_pos;
          }
          }
        enc++;
        enc++;
      }
      }
  return ret;
  return ret;
}
}
Line 715... Line 715...
 
 
/* Recursive utility function used to find best match and to build automata.  */
/* Recursive utility function used to find best match and to build automata.  */
static unsigned long *
static unsigned long *
cover_insn (unsigned long *cur, int pass, unsigned int mask)
cover_insn (unsigned long *cur, int pass, unsigned int mask)
{
{
  int best_first = 0, best_len = 0, i, last_match = -1, ninstr = 0;
  int best_first = 0, last_match = -1, ninstr = 0;
 
  unsigned int best_len = 0;
 
  unsigned int i;
  unsigned long cur_mask = mask;
  unsigned long cur_mask = mask;
  unsigned long *next;
  unsigned long *next;
 
 
  for (i = 0; i < NUM_OPCODES; i++)
  for (i = 0; i < NUM_OPCODES; i++)
    if (or1ksim_ti[i].in_pass == pass)
    if (or1ksim_ti[i].in_pass == pass)
Line 777... Line 779...
        }
        }
      or32_debug (8, "%i> #### %i << %i (%i) ####\n", cur - or1ksim_automata, best_len,
      or32_debug (8, "%i> #### %i << %i (%i) ####\n", cur - or1ksim_automata, best_len,
             best_first, ninstr);
             best_first, ninstr);
      *cur = best_first;
      *cur = best_first;
      cur++;
      cur++;
      *cur = (1 << best_len) - 1;
      *cur = (1UL << best_len) - 1;
      cur++;
      cur++;
      next = cur;
      next = cur;
      /* Allocate space for pointers.  */
      /* Allocate space for pointers.  */
      cur += 1 << best_len;
      cur += 1UL << best_len;
      cur_mask = (1 << (unsigned long) best_len) - 1;
      cur_mask = (1UL << (unsigned long) best_len) - 1;
 
 
      for (i = 0; i < (1 << (unsigned long) best_len); i++)
      for (i = 0; i < (1UL << (unsigned long) best_len); i++)
        {
        {
          int j;
          int j;
          unsigned long *c;
          unsigned long *c;
          curpass++;
          curpass++;
          for (j = 0; j < NUM_OPCODES; j++)
          for (j = 0; j < NUM_OPCODES; j++)
Line 890... Line 892...
                  mask++;
                  mask++;
                  tmp >>= 1;
                  tmp >>= 1;
                }
                }
              cur->type = type | shr;
              cur->type = type | shr;
              cur->data = mask;
              cur->data = mask;
              arg &= ~(((1 << mask) - 1) << shr);
              arg &= ~(((1UL << mask) - 1) << shr);
              or32_debug (6, "|%08lX %08lX\n", cur->type, cur->data);
              or32_debug (6, "|%08lX %08lX\n", cur->type, cur->data);
              cur++;
              cur++;
              num_cur_op++;
              num_cur_op++;
            }
            }
          args++;
          args++;
Line 1099... Line 1101...
  int letter_bits;
  int letter_bits;
 
 
  /* First truncate all bits above valid range for this letter
  /* First truncate all bits above valid range for this letter
     in case it is zero extend. */
     in case it is zero extend. */
  letter_bits = letter_range (l);
  letter_bits = letter_range (l);
  mask = (1 << letter_bits) - 1;
  mask = (1UL << letter_bits) - 1;
  imm &= mask;
  imm &= mask;
 
 
  /* Do sign extend if this is the right one. */
  /* Do sign extend if this is the right one. */
  if (letter_signed (l) && (imm >> (letter_bits - 1)))
  if (letter_signed (l) && (imm >> (letter_bits - 1)))
    imm |= (~mask);
    imm |= (~mask);
Line 1154... Line 1156...
      }
      }
    else if ((*enc == '0') || (*enc == '1'))
    else if ((*enc == '0') || (*enc == '1'))
      {
      {
        opc_pos--;
        opc_pos--;
        if (param_ch == *enc)
        if (param_ch == *enc)
          ret |= 1 << opc_pos;
          ret |= 1UL << opc_pos;
        enc++;
        enc++;
      }
      }
    else if (*enc == param_ch)
    else if (*enc == param_ch)
      {
      {
        opc_pos--;
        opc_pos--;

powered by: WebSVN 2.1.0

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