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