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