12a6b7db3Sskrll/* SHmedia opcode support. -*- C -*- 22a6b7db3Sskrll 3*be12b8bcSchristos Copyright 2000, 2005, 2007, 2009 Free Software Foundation, Inc. 42a6b7db3Sskrll 52a6b7db3Sskrll Contributed by Red Hat Inc; developed under contract from Hitachi 62a6b7db3Sskrll Semiconductor (America) Inc. 72a6b7db3Sskrll 82a6b7db3Sskrll This file is part of the GNU Binutils. 92a6b7db3Sskrll 102a6b7db3Sskrll This program is free software; you can redistribute it and/or modify 112a6b7db3Sskrll it under the terms of the GNU General Public License as published by 122a6b7db3Sskrll the Free Software Foundation; either version 3 of the License, or 132a6b7db3Sskrll (at your option) any later version. 142a6b7db3Sskrll 152a6b7db3Sskrll This program is distributed in the hope that it will be useful, 162a6b7db3Sskrll but WITHOUT ANY WARRANTY; without even the implied warranty of 172a6b7db3Sskrll MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 182a6b7db3Sskrll GNU General Public License for more details. 192a6b7db3Sskrll 202a6b7db3Sskrll You should have received a copy of the GNU General Public License 212a6b7db3Sskrll along with this program; if not, write to the Free Software 222a6b7db3Sskrll Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, 232a6b7db3Sskrll MA 02110-1301, USA. */ 242a6b7db3Sskrll 252a6b7db3Sskrll 262a6b7db3Sskrll/* This file is an addendum to sh-media.cpu. Heavy use of C code isn't 272a6b7db3Sskrll appropriate in .cpu files, so it resides here. This especially applies 282a6b7db3Sskrll to assembly/disassembly where parsing/printing can be quite involved. 292a6b7db3Sskrll Such things aren't really part of the specification of the cpu, per se, 302a6b7db3Sskrll so .cpu files provide the general framework and .opc files handle the 312a6b7db3Sskrll nitty-gritty details as necessary. 322a6b7db3Sskrll 332a6b7db3Sskrll Each section is delimited with start and end markers. 342a6b7db3Sskrll 352a6b7db3Sskrll <arch>-opc.h additions use: "-- opc.h" 362a6b7db3Sskrll <arch>-opc.c additions use: "-- opc.c" 372a6b7db3Sskrll <arch>-asm.c additions use: "-- asm.c" 382a6b7db3Sskrll <arch>-dis.c additions use: "-- dis.c" 392a6b7db3Sskrll <arch>-ibd.h additions use: "-- ibd.h" */ 402a6b7db3Sskrll 412a6b7db3Sskrll/* -- opc.h */ 422a6b7db3Sskrll 432a6b7db3Sskrll/* Allows reason codes to be output when assembler errors occur. */ 442a6b7db3Sskrll#define CGEN_VERBOSE_ASSEMBLER_ERRORS 452a6b7db3Sskrll 462a6b7db3Sskrll/* Override disassembly hashing - there are variable bits in the top 472a6b7db3Sskrll byte of these instructions. */ 482a6b7db3Sskrll#define CGEN_DIS_HASH_SIZE 8 492a6b7db3Sskrll#define CGEN_DIS_HASH(buf,value) (((* (unsigned char*) (buf)) >> 6) % CGEN_DIS_HASH_SIZE) 502a6b7db3Sskrll 512a6b7db3Sskrll/* -- asm.c */ 522a6b7db3Sskrll 532a6b7db3Sskrllstatic const char * 542a6b7db3Sskrllparse_fsd (CGEN_CPU_DESC cd, 552a6b7db3Sskrll const char ** strp, 562a6b7db3Sskrll int opindex, 572a6b7db3Sskrll long * valuep) 582a6b7db3Sskrll{ 592a6b7db3Sskrll abort (); 602a6b7db3Sskrll} 612a6b7db3Sskrll 622a6b7db3Sskrll/* -- dis.c */ 632a6b7db3Sskrll 642a6b7db3Sskrllstatic void 652a6b7db3Sskrllprint_likely (CGEN_CPU_DESC cd, 662a6b7db3Sskrll void * dis_info, 672a6b7db3Sskrll long value, 682a6b7db3Sskrll unsigned int attrs, 692a6b7db3Sskrll bfd_vma pc, 702a6b7db3Sskrll int length) 712a6b7db3Sskrll{ 722a6b7db3Sskrll disassemble_info *info = (disassemble_info *) dis_info; 732a6b7db3Sskrll 742a6b7db3Sskrll (*info->fprintf_func) (info->stream, (value) ? "/l" : "/u"); 752a6b7db3Sskrll} 762a6b7db3Sskrll 772a6b7db3Sskrll/* -- */ 78