head	1.2;
access;
symbols
	perseant-exfatfs-base-20250801:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.16
	perseant-exfatfs-base:1.2
	cjep_sun2x:1.2.0.14
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	cjep_staticlib_x:1.2.0.12
	cjep_staticlib_x-base:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	phil-wifi-20200406:1.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	netbsd-7-2-RELEASE:1.1.1.1
	pgoyette-compat-0728:1.2
	pgoyette-compat-0625:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	netbsd-7-1-2-RELEASE:1.1.1.1
	pgoyette-compat:1.2.0.10
	pgoyette-compat-base:1.2
	netbsd-7-1-1-RELEASE:1.1.1.1
	perseant-stdc-iso10646:1.2.0.8
	perseant-stdc-iso10646-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.6
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	pgoyette-localcount-20170320:1.2
	netbsd-7-1:1.1.1.1.0.14
	netbsd-7-1-RELEASE:1.1.1.1
	netbsd-7-1-RC2:1.1.1.1
	netbsd-7-nhusb-base-20170116:1.1.1.1
	bouyer-socketcan:1.2.0.4
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	netbsd-7-1-RC1:1.1.1.1
	pgoyette-localcount-20161104:1.2
	netbsd-7-0-2-RELEASE:1.1.1.1
	localcount-20160914:1.2
	netbsd-7-nhusb:1.1.1.1.0.12
	netbsd-7-nhusb-base:1.1.1.1
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.2
	pgoyette-localcount-base:1.2
	netbsd-7-0-1-RELEASE:1.1.1.1
	netbsd-7-0:1.1.1.1.0.10
	netbsd-7-0-RELEASE:1.1.1.1
	netbsd-7-0-RC3:1.1.1.1
	netbsd-7-0-RC2:1.1.1.1
	netbsd-7-0-RC1:1.1.1.1
	tls-maxphys-base:1.1.1.1
	tls-maxphys:1.1.1.1.0.8
	netbsd-7:1.1.1.1.0.6
	netbsd-7-base:1.1.1.1
	yamt-pagecache:1.1.1.1.0.4
	yamt-pagecache-base9:1.1.1.1
	tls-earlyentropy:1.1.1.1.0.2
	tls-earlyentropy-base:1.1.1.1
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.1.1.1
	riastradh-drm2-base3:1.1.1.1
	binutils-2-23-2:1.1.1.1
	FSF:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2014.09.03.19.01.15;	author matt;	state dead;
branches;
next	1.1;
commitid	hP3IkZkjKc2XQVOx;

1.1
date	2013.09.29.13.40.53;	author christos;	state Exp;
branches
	1.1.1.1;
next	;
commitid	TyuuzSx830x3Yk7x;

1.1.1.1
date	2013.09.29.13.40.53;	author christos;	state Exp;
branches
	1.1.1.1.4.1
	1.1.1.1.8.1;
next	;
commitid	TyuuzSx830x3Yk7x;

1.1.1.1.4.1
date	2013.09.29.13.40.53;	author yamt;	state dead;
branches;
next	1.1.1.1.4.2;
commitid	LcfsdHQ4HK08ayBx;

1.1.1.1.4.2
date	2014.05.22.15.54.15;	author yamt;	state Exp;
branches;
next	;
commitid	LcfsdHQ4HK08ayBx;

1.1.1.1.8.1
date	2013.09.29.13.40.53;	author tls;	state dead;
branches;
next	1.1.1.1.8.2;
commitid	jTnpym9Qu0o4R1Nx;

1.1.1.1.8.2
date	2014.08.19.23.52.30;	author tls;	state Exp;
branches;
next	;
commitid	jTnpym9Qu0o4R1Nx;


desc
@@


1.2
log
@Merge in OR1K support from top of binutils-gdb GIT repository.  This replaces
the existing support and most imporantly adds support for shared libraries.
@
text
@/* OpenRISC opcode support.  -*- C -*-
   Copyright 2000, 2001, 2003, 2005, 2011 Free Software Foundation, Inc.

   Contributed by Red Hat Inc;

   This file is part of the GNU Binutils.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */

/* This file is an addendum to or32.cpu.  Heavy use of C code isn't
   appropriate in .cpu files, so it resides here.  This especially applies
   to assembly/disassembly where parsing/printing can be quite involved.
   Such things aren't really part of the specification of the cpu, per se,
   so .cpu files provide the general framework and .opc files handle the
   nitty-gritty details as necessary.

   Each section is delimited with start and end markers.

   <arch>-opc.h additions use: "-- opc.h"
   <arch>-opc.c additions use: "-- opc.c"
   <arch>-asm.c additions use: "-- asm.c"
   <arch>-dis.c additions use: "-- dis.c"
   <arch>-ibd.h additions use: "-- ibd.h"  */

/* -- opc.h */
#undef  CGEN_DIS_HASH_SIZE
#define CGEN_DIS_HASH_SIZE 64
#undef  CGEN_DIS_HASH
#define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2)

extern long openrisc_sign_extend_16bit (long);
/* -- */

/* -- opc.c */
/* -- */

/* -- asm.c */

static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'");

#define CGEN_VERBOSE_ASSEMBLER_ERRORS

long
openrisc_sign_extend_16bit (long value)
{
  return ((value & 0xffff) ^ 0x8000) - 0x8000;
}

/* Handle hi().  */

static const char *
parse_hi16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep)
{
  const char *errmsg;
  enum cgen_parse_operand_result result_type;
  unsigned long ret;

  if (**strp == '#')
    ++*strp;

  if (strncasecmp (*strp, "hi(", 3) == 0)
    {
      bfd_vma value;

      *strp += 3;
      errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16,
				   & result_type, & value);
      if (**strp != ')')
        return MISSING_CLOSING_PARENTHESIS;

      ++*strp;
      if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
        value >>= 16;
      ret = value;
    }
  else
    {
      if (**strp == '-')
	{
	  long value;

	  errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value);
	  ret = value;
	}
      else
	{
	  unsigned long value;

	  errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value);
	  ret = value;
	}
    }

  *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000;
  return errmsg;
}

/* Handle lo().  */

static const char *
parse_lo16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep)
{
  const char *errmsg;
  enum cgen_parse_operand_result result_type;
  unsigned long ret;

  if (**strp == '#')
    ++*strp;

  if (strncasecmp (*strp, "lo(", 3) == 0)
    {
      bfd_vma value;

      *strp += 3;
      errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16,
				   & result_type, & value);
      if (**strp != ')')
        return MISSING_CLOSING_PARENTHESIS;

      ++*strp;
      ret = value;
    }
  else
    {
      if (**strp == '-')
	{
	  long value;

	  errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value);
	  ret = value;
	}
      else
	{
	  unsigned long value;

	  errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value);
	  ret = value;
	}
    }

  *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000;
  return errmsg;
}

/* -- */

/* -- ibd.h */
extern long openrisc_sign_extend_16bit (long);

/* -- */
@


1.1
log
@Initial revision
@
text
@@


1.1.1.1
log
@from ftp.gnu.org
@
text
@@


1.1.1.1.8.1
log
@file openrisc.opc was added on branch tls-maxphys on 2014-08-19 23:52:30 +0000
@
text
@d1 164
@


1.1.1.1.8.2
log
@Rebase to HEAD as of a few days ago.
@
text
@a0 164
/* OpenRISC opcode support.  -*- C -*-
   Copyright 2000, 2001, 2003, 2005, 2011 Free Software Foundation, Inc.

   Contributed by Red Hat Inc;

   This file is part of the GNU Binutils.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */

/* This file is an addendum to or32.cpu.  Heavy use of C code isn't
   appropriate in .cpu files, so it resides here.  This especially applies
   to assembly/disassembly where parsing/printing can be quite involved.
   Such things aren't really part of the specification of the cpu, per se,
   so .cpu files provide the general framework and .opc files handle the
   nitty-gritty details as necessary.

   Each section is delimited with start and end markers.

   <arch>-opc.h additions use: "-- opc.h"
   <arch>-opc.c additions use: "-- opc.c"
   <arch>-asm.c additions use: "-- asm.c"
   <arch>-dis.c additions use: "-- dis.c"
   <arch>-ibd.h additions use: "-- ibd.h"  */

/* -- opc.h */
#undef  CGEN_DIS_HASH_SIZE
#define CGEN_DIS_HASH_SIZE 64
#undef  CGEN_DIS_HASH
#define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2)

extern long openrisc_sign_extend_16bit (long);
/* -- */

/* -- opc.c */
/* -- */

/* -- asm.c */

static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'");

#define CGEN_VERBOSE_ASSEMBLER_ERRORS

long
openrisc_sign_extend_16bit (long value)
{
  return ((value & 0xffff) ^ 0x8000) - 0x8000;
}

/* Handle hi().  */

static const char *
parse_hi16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep)
{
  const char *errmsg;
  enum cgen_parse_operand_result result_type;
  unsigned long ret;

  if (**strp == '#')
    ++*strp;

  if (strncasecmp (*strp, "hi(", 3) == 0)
    {
      bfd_vma value;

      *strp += 3;
      errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16,
				   & result_type, & value);
      if (**strp != ')')
        return MISSING_CLOSING_PARENTHESIS;

      ++*strp;
      if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
        value >>= 16;
      ret = value;
    }
  else
    {
      if (**strp == '-')
	{
	  long value;

	  errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value);
	  ret = value;
	}
      else
	{
	  unsigned long value;

	  errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value);
	  ret = value;
	}
    }

  *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000;
  return errmsg;
}

/* Handle lo().  */

static const char *
parse_lo16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep)
{
  const char *errmsg;
  enum cgen_parse_operand_result result_type;
  unsigned long ret;

  if (**strp == '#')
    ++*strp;

  if (strncasecmp (*strp, "lo(", 3) == 0)
    {
      bfd_vma value;

      *strp += 3;
      errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16,
				   & result_type, & value);
      if (**strp != ')')
        return MISSING_CLOSING_PARENTHESIS;

      ++*strp;
      ret = value;
    }
  else
    {
      if (**strp == '-')
	{
	  long value;

	  errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value);
	  ret = value;
	}
      else
	{
	  unsigned long value;

	  errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value);
	  ret = value;
	}
    }

  *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000;
  return errmsg;
}

/* -- */

/* -- ibd.h */
extern long openrisc_sign_extend_16bit (long);

/* -- */
@


1.1.1.1.4.1
log
@file openrisc.opc was added on branch yamt-pagecache on 2014-05-22 15:54:15 +0000
@
text
@d1 164
@


1.1.1.1.4.2
log
@sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")
@
text
@a0 164
/* OpenRISC opcode support.  -*- C -*-
   Copyright 2000, 2001, 2003, 2005, 2011 Free Software Foundation, Inc.

   Contributed by Red Hat Inc;

   This file is part of the GNU Binutils.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */

/* This file is an addendum to or32.cpu.  Heavy use of C code isn't
   appropriate in .cpu files, so it resides here.  This especially applies
   to assembly/disassembly where parsing/printing can be quite involved.
   Such things aren't really part of the specification of the cpu, per se,
   so .cpu files provide the general framework and .opc files handle the
   nitty-gritty details as necessary.

   Each section is delimited with start and end markers.

   <arch>-opc.h additions use: "-- opc.h"
   <arch>-opc.c additions use: "-- opc.c"
   <arch>-asm.c additions use: "-- asm.c"
   <arch>-dis.c additions use: "-- dis.c"
   <arch>-ibd.h additions use: "-- ibd.h"  */

/* -- opc.h */
#undef  CGEN_DIS_HASH_SIZE
#define CGEN_DIS_HASH_SIZE 64
#undef  CGEN_DIS_HASH
#define CGEN_DIS_HASH(buffer, value) (((unsigned char *) (buffer))[0] >> 2)

extern long openrisc_sign_extend_16bit (long);
/* -- */

/* -- opc.c */
/* -- */

/* -- asm.c */

static const char * MISSING_CLOSING_PARENTHESIS = N_("missing `)'");

#define CGEN_VERBOSE_ASSEMBLER_ERRORS

long
openrisc_sign_extend_16bit (long value)
{
  return ((value & 0xffff) ^ 0x8000) - 0x8000;
}

/* Handle hi().  */

static const char *
parse_hi16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep)
{
  const char *errmsg;
  enum cgen_parse_operand_result result_type;
  unsigned long ret;

  if (**strp == '#')
    ++*strp;

  if (strncasecmp (*strp, "hi(", 3) == 0)
    {
      bfd_vma value;

      *strp += 3;
      errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_HI16,
				   & result_type, & value);
      if (**strp != ')')
        return MISSING_CLOSING_PARENTHESIS;

      ++*strp;
      if (errmsg == NULL
          && result_type == CGEN_PARSE_OPERAND_RESULT_NUMBER)
        value >>= 16;
      ret = value;
    }
  else
    {
      if (**strp == '-')
	{
	  long value;

	  errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value);
	  ret = value;
	}
      else
	{
	  unsigned long value;

	  errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value);
	  ret = value;
	}
    }

  *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000;
  return errmsg;
}

/* Handle lo().  */

static const char *
parse_lo16 (CGEN_CPU_DESC cd, const char ** strp, int opindex, long * valuep)
{
  const char *errmsg;
  enum cgen_parse_operand_result result_type;
  unsigned long ret;

  if (**strp == '#')
    ++*strp;

  if (strncasecmp (*strp, "lo(", 3) == 0)
    {
      bfd_vma value;

      *strp += 3;
      errmsg = cgen_parse_address (cd, strp, opindex, BFD_RELOC_LO16,
				   & result_type, & value);
      if (**strp != ')')
        return MISSING_CLOSING_PARENTHESIS;

      ++*strp;
      ret = value;
    }
  else
    {
      if (**strp == '-')
	{
	  long value;

	  errmsg = cgen_parse_signed_integer (cd, strp, opindex, &value);
	  ret = value;
	}
      else
	{
	  unsigned long value;

	  errmsg = cgen_parse_unsigned_integer (cd, strp, opindex, &value);
	  ret = value;
	}
    }

  *valuep = ((ret & 0xffff) ^ 0x8000) - 0x8000;
  return errmsg;
}

/* -- */

/* -- ibd.h */
extern long openrisc_sign_extend_16bit (long);

/* -- */
@


