xref: /netbsd-src/external/gpl3/gdb/dist/cpu/sh.opc (revision 4e98e3e176b5b8ca424663e164635936964c902b)
1*4e98e3e1Schristos/* SHmedia opcode support.  -*- C -*-
2*4e98e3e1Schristos
3*4e98e3e1Schristos   Copyright 2000, 2005, 2007, 2009 Free Software Foundation, Inc.
4*4e98e3e1Schristos
5*4e98e3e1Schristos   Contributed by Red Hat Inc; developed under contract from Hitachi
6*4e98e3e1Schristos   Semiconductor (America) Inc.
7*4e98e3e1Schristos
8*4e98e3e1Schristos   This file is part of the GNU Binutils.
9*4e98e3e1Schristos
10*4e98e3e1Schristos   This program is free software; you can redistribute it and/or modify
11*4e98e3e1Schristos   it under the terms of the GNU General Public License as published by
12*4e98e3e1Schristos   the Free Software Foundation; either version 3 of the License, or
13*4e98e3e1Schristos   (at your option) any later version.
14*4e98e3e1Schristos
15*4e98e3e1Schristos   This program is distributed in the hope that it will be useful,
16*4e98e3e1Schristos   but WITHOUT ANY WARRANTY; without even the implied warranty of
17*4e98e3e1Schristos   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*4e98e3e1Schristos   GNU General Public License for more details.
19*4e98e3e1Schristos
20*4e98e3e1Schristos   You should have received a copy of the GNU General Public License
21*4e98e3e1Schristos   along with this program; if not, write to the Free Software
22*4e98e3e1Schristos   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
23*4e98e3e1Schristos   MA 02110-1301, USA.  */
24*4e98e3e1Schristos
25*4e98e3e1Schristos
26*4e98e3e1Schristos/* This file is an addendum to sh-media.cpu.  Heavy use of C code isn't
27*4e98e3e1Schristos   appropriate in .cpu files, so it resides here.  This especially applies
28*4e98e3e1Schristos   to assembly/disassembly where parsing/printing can be quite involved.
29*4e98e3e1Schristos   Such things aren't really part of the specification of the cpu, per se,
30*4e98e3e1Schristos   so .cpu files provide the general framework and .opc files handle the
31*4e98e3e1Schristos   nitty-gritty details as necessary.
32*4e98e3e1Schristos
33*4e98e3e1Schristos   Each section is delimited with start and end markers.
34*4e98e3e1Schristos
35*4e98e3e1Schristos   <arch>-opc.h additions use: "-- opc.h"
36*4e98e3e1Schristos   <arch>-opc.c additions use: "-- opc.c"
37*4e98e3e1Schristos   <arch>-asm.c additions use: "-- asm.c"
38*4e98e3e1Schristos   <arch>-dis.c additions use: "-- dis.c"
39*4e98e3e1Schristos   <arch>-ibd.h additions use: "-- ibd.h"  */
40*4e98e3e1Schristos
41*4e98e3e1Schristos/* -- opc.h */
42*4e98e3e1Schristos
43*4e98e3e1Schristos/* Allows reason codes to be output when assembler errors occur.  */
44*4e98e3e1Schristos#define CGEN_VERBOSE_ASSEMBLER_ERRORS
45*4e98e3e1Schristos
46*4e98e3e1Schristos/* Override disassembly hashing - there are variable bits in the top
47*4e98e3e1Schristos   byte of these instructions.  */
48*4e98e3e1Schristos#define CGEN_DIS_HASH_SIZE 8
49*4e98e3e1Schristos#define CGEN_DIS_HASH(buf,value) (((* (unsigned char*) (buf)) >> 6) % CGEN_DIS_HASH_SIZE)
50*4e98e3e1Schristos
51*4e98e3e1Schristos/* -- asm.c */
52*4e98e3e1Schristos
53*4e98e3e1Schristosstatic const char *
54*4e98e3e1Schristosparse_fsd (CGEN_CPU_DESC cd,
55*4e98e3e1Schristos	   const char ** strp,
56*4e98e3e1Schristos	   int opindex,
57*4e98e3e1Schristos	   long * valuep)
58*4e98e3e1Schristos{
59*4e98e3e1Schristos  abort ();
60*4e98e3e1Schristos}
61*4e98e3e1Schristos
62*4e98e3e1Schristos/* -- dis.c */
63*4e98e3e1Schristos
64*4e98e3e1Schristosstatic void
65*4e98e3e1Schristosprint_likely (CGEN_CPU_DESC cd,
66*4e98e3e1Schristos	      void * dis_info,
67*4e98e3e1Schristos	      long value,
68*4e98e3e1Schristos	      unsigned int attrs,
69*4e98e3e1Schristos	      bfd_vma pc,
70*4e98e3e1Schristos	      int length)
71*4e98e3e1Schristos{
72*4e98e3e1Schristos  disassemble_info *info = (disassemble_info *) dis_info;
73*4e98e3e1Schristos
74*4e98e3e1Schristos  (*info->fprintf_func) (info->stream, (value) ? "/l" : "/u");
75*4e98e3e1Schristos}
76*4e98e3e1Schristos
77*4e98e3e1Schristos/* -- */
78