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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gdb-6.8/] [opcodes/] [tic80-opc.c] - Diff between revs 157 and 225

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

Rev 157 Rev 225
Line 1... Line 1...
/* Opcode table for TI TMS320C80 (MVP).
/* Opcode table for TI TMS320C80 (MVP).
   Copyright 1996, 1997, 2000, 2007 Free Software Foundation, Inc.
   Copyright 1996, 1997, 2000, 2005, 2007 Free Software Foundation, Inc.
 
 
   This file is part of the GNU opcodes library.
   This file is part of the GNU opcodes library.
 
 
   This library is free software; you can redistribute it and/or modify
   This library is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   it under the terms of the GNU General Public License as published by
Line 217... Line 217...
 
 
/* This function takes a predefined symbol name in NAME, symbol class
/* This function takes a predefined symbol name in NAME, symbol class
   in CLASS, and translates it to a numeric value, which it returns.
   in CLASS, and translates it to a numeric value, which it returns.
 
 
   If CLASS is zero, any symbol that matches NAME is translated.  If
   If CLASS is zero, any symbol that matches NAME is translated.  If
   CLASS is non-zero, then only a symbol that has class CLASS is
   CLASS is non-zero, then only a symbol that has symbol_class CLASS is
   matched.
   matched.
 
 
   If no translation is possible, it returns -1, a value not used by
   If no translation is possible, it returns -1, a value not used by
   any predefined symbol. Note that the predefined symbol array is
   any predefined symbol. Note that the predefined symbol array is
   presorted case independently by name.
   presorted case independently by name.
Line 231... Line 231...
   true at the moment.
   true at the moment.
 
 
 */
 */
 
 
int
int
tic80_symbol_to_value (name, class)
tic80_symbol_to_value (name, symbol_class)
     char *name;
     char *name;
     int class;
     int symbol_class;
{
{
  const struct predefined_symbol *pdsp;
  const struct predefined_symbol *pdsp;
  int low = 0;
  int low = 0;
  int middle;
  int middle;
  int high = tic80_num_predefined_symbols - 1;
  int high = tic80_num_predefined_symbols - 1;
Line 257... Line 257...
          low = middle + 1;
          low = middle + 1;
        }
        }
      else
      else
        {
        {
          pdsp = &tic80_predefined_symbols[middle];
          pdsp = &tic80_predefined_symbols[middle];
          if ((class == 0) || (class & PDS_VALUE (pdsp)))
          if ((symbol_class == 0) || (symbol_class & PDS_VALUE (pdsp)))
            {
            {
              rtnval = PDS_VALUE (pdsp);
              rtnval = PDS_VALUE (pdsp);
            }
            }
          /* For now we assume that there are no duplicate names */
          /* For now we assume that there are no duplicate names */
          break;
          break;
Line 269... Line 269...
    }
    }
  return (rtnval);
  return (rtnval);
}
}
 
 
/* This function takes a value VAL and finds a matching predefined
/* This function takes a value VAL and finds a matching predefined
   symbol that is in the operand class specified by CLASS.  If CLASS
   symbol that is in the operand symbol_class specified by CLASS.  If CLASS
   is zero, the first matching symbol is returned. */
   is zero, the first matching symbol is returned. */
 
 
const char *
const char *
tic80_value_to_symbol (val, class)
tic80_value_to_symbol (val, symbol_class)
     int val;
     int val;
     int class;
     int symbol_class;
{
{
  const struct predefined_symbol *pdsp;
  const struct predefined_symbol *pdsp;
  int ival;
  int ival;
  char *name;
  char *name;
 
 
Line 289... Line 289...
       pdsp++)
       pdsp++)
    {
    {
      ival = PDS_VALUE (pdsp) & ~TIC80_OPERAND_MASK;
      ival = PDS_VALUE (pdsp) & ~TIC80_OPERAND_MASK;
      if (ival == val)
      if (ival == val)
        {
        {
          if ((class == 0) || (class & PDS_VALUE (pdsp)))
          if ((symbol_class == 0) || (symbol_class & PDS_VALUE (pdsp)))
            {
            {
              /* Found the desired match */
              /* Found the desired match */
              name = PDS_NAME (pdsp);
              name = PDS_NAME (pdsp);
              break;
              break;
            }
            }

powered by: WebSVN 2.1.0

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