xgate.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /* xgate.h -- Freescale XGATE opcode list
  2. Copyright (C) 2010-2015 Free Software Foundation, Inc.
  3. Written by Sean Keys (skeys@ipdatasys.com)
  4. This file is part of the GNU opcodes library.
  5. This library is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 3, or (at your option)
  8. any later version.
  9. It is distributed in the hope that it will be useful, but WITHOUT
  10. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
  11. or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
  12. License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this file; see the file COPYING. If not, write to the
  15. Free Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
  16. MA 02110-1301, USA. */
  17. #ifndef _OPCODE_XGATE_H
  18. #define _OPCODE_XGATE_H
  19. /* XGATE CCR flag definitions. */
  20. #define XGATE_N_BIT 0x08 /* XGN - Sign Flag */
  21. #define XGATE_Z_BIT 0x04 /* XGZ - Zero Flag */
  22. #define XGATE_V_BIT 0x02 /* XGV - Overflow Flag */
  23. #define XGATE_C_BIT 0x01 /* XGC - Carry Flag */
  24. /* Access Detail Notation
  25. V — Vector fetch: always an aligned word read, lasts for at least one RISC core cycle
  26. P — Program word fetch: always an aligned word read, lasts for at least one RISC core cycle
  27. r — 8-bit data read: lasts for at least one RISC core cycle
  28. R — 16-bit data read: lasts for at least one RISC core cycle
  29. w — 8-bit data write: lasts for at least one RISC core cycle
  30. W — 16-bit data write: lasts for at least one RISC core cycle
  31. A — Alignment cycle: no read or write, lasts for zero or one RISC core cycles
  32. f — Free cycle: no read or write, lasts for one RISC core cycles. */
  33. #define XGATE_CYCLE_V 0x01
  34. #define XGATE_CYCLE_P 0x02
  35. #define XGATE_CYCLE_r 0x04
  36. #define XGATE_CYCLE_R 0x08
  37. #define XGATE_CYCLE_w 0x10
  38. #define XGATE_CYCLE_W 0x20
  39. #define XGATE_CYCLE_A 0x40
  40. #define XGATE_CYCLE_f 0x80
  41. /* XGATE operand formats as stored in the XGATE_opcode table.
  42. They are only used by GAS to recognize operands. */
  43. #define XGATE_OP_INH "" /* Inherent. */
  44. #define XGATE_OP_TRI "r,r,r" /* Register followed by two registers. */
  45. #define XGATE_OP_DYA "r,r" /* Register followed by a register. */
  46. #define XGATE_OP_IMM16 "r,if" /* Register followed by 16-bit value. */
  47. #define XGATE_OP_IMM8 "r,i8" /* Register followed by 8-bit value. */
  48. #define XGATE_OP_IMM4 "r,i4" /* Register followed by 4-bit value. */
  49. #define XGATE_OP_IMM3 "i3" /* Register followed by 3-bit value. */
  50. #define XGATE_OP_MON "r" /* Single register. */
  51. #define XGATE_OP_MON_R_C "r,c" /* General register followed by ccr register. */
  52. #define XGATE_OP_MON_C_R "c,r" /* CCR register followed by a general register. */
  53. #define XGATE_OP_MON_R_P "r,p" /* General register followed by pc register. */
  54. #define XGATE_OP_IDR "r,r,+" /* Three registers with the third having a -/+ directive. */
  55. #define XGATE_OP_IDO5 "r,r,i5" /* Two general registers followed by an immediate value. */
  56. #define XGATE_OP_REL9 "b9" /* 9-bit value that is relative to the current pc. */
  57. #define XGATE_OP_REL10 "ba" /* 10-bit value that is relative to the current pc. */
  58. #define XGATE_OP_DYA_MON "=r"
  59. /* Macro definitions. */
  60. #define XGATE_OP_IMM16mADD "r,if; addl addh"
  61. #define XGATE_OP_IMM16mAND "r,if; andl andh"
  62. #define XGATE_OP_IMM16mCPC "r,if; cmpl cpch"
  63. #define XGATE_OP_IMM16mSUB "r,if; subl subh"
  64. #define XGATE_OP_IMM16mLDW "r,if; ldl ldh"
  65. /* CPU variant identification. */
  66. #define XGATE_V1 0x1
  67. #define XGATE_V2 0x2
  68. #define XGATE_V3 0x4
  69. /* The opcode table definitions. */
  70. struct xgate_opcode
  71. {
  72. char * name; /* Op-code name. */
  73. char * constraints; /* Constraint chars. */
  74. char * format; /* Bit definitions. */
  75. unsigned int size; /* Opcode size in bytes. */
  76. unsigned int bin_opcode; /* Binary opcode with operands masked off. */
  77. unsigned char cycles_min; /* Minimum cpu cycles needed. */
  78. unsigned char cycles_max; /* Maximum cpu cycles needed. */
  79. unsigned char set_flags_mask; /* CCR flags set. */
  80. unsigned char clr_flags_mask; /* CCR flags cleared. */
  81. unsigned char chg_flags_mask; /* CCR flags changed. */
  82. unsigned char arch; /* CPU variant. */
  83. };
  84. /* The opcode table. The table contains all the opcodes (all pages).
  85. You can't rely on the order. */
  86. extern const struct xgate_opcode xgate_opcodes[];
  87. extern const int xgate_num_opcodes;
  88. #endif /* _OPCODE_XGATE_H */