sh.opc 2.4 KB

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