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