1 /* s390.h -- Header file for S390 opcode table
2 Copyright 2000, 2001, 2003, 2010 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
25 /* List of instruction sets variations. */
27 enum s390_opcode_mode_val
33 enum s390_opcode_cpu_val
46 /* The opcode table is an array of struct s390_opcode. */
50 /* The opcode name. */
53 /* The opcode itself. Those bits which will be filled in with
54 operands are zeroes. */
55 unsigned char opcode
[6];
57 /* The opcode mask. This is used by the disassembler. This is a
58 mask containing ones indicating those bits which must match the
59 opcode field, and zeroes indicating those bits which need not
60 match (and are presumably filled in by operands). */
61 unsigned char mask
[6];
63 /* The opcode length in bytes. */
66 /* An array of operand codes. Each code is an index into the
67 operand table. They appear in the order which the operands must
68 appear in assembly code, and are terminated by a zero. */
69 unsigned char operands
[6];
71 /* Bitmask of execution modes this opcode is available for. */
74 /* First cpu this opcode is available for. */
75 enum s390_opcode_cpu_val min_cpu
;
78 /* The table itself is sorted by major opcode number, and is otherwise
79 in the order in which the disassembler should consider
81 extern const struct s390_opcode s390_opcodes
[];
82 extern const int s390_num_opcodes
;
84 /* A opcode format table for the .insn pseudo mnemonic. */
85 extern const struct s390_opcode s390_opformats
[];
86 extern const int s390_num_opformats
;
88 /* Values defined for the flags field of a struct powerpc_opcode. */
90 /* The operands table is an array of struct s390_operand. */
94 /* The number of bits in the operand. */
97 /* How far the operand is left shifted in the instruction. */
100 /* One bit syntax flags. */
104 /* Elements in the table are retrieved by indexing with values from
105 the operands field of the powerpc_opcodes table. */
107 extern const struct s390_operand s390_operands
[];
109 /* Values defined for the flags field of a struct s390_operand. */
111 /* This operand names a register. The disassembler uses this to print
112 register names with a leading 'r'. */
113 #define S390_OPERAND_GPR 0x1
115 /* This operand names a floating point register. The disassembler
116 prints these with a leading 'f'. */
117 #define S390_OPERAND_FPR 0x2
119 /* This operand names an access register. The disassembler
120 prints these with a leading 'a'. */
121 #define S390_OPERAND_AR 0x4
123 /* This operand names a control register. The disassembler
124 prints these with a leading 'c'. */
125 #define S390_OPERAND_CR 0x8
127 /* This operand is a displacement. */
128 #define S390_OPERAND_DISP 0x10
130 /* This operand names a base register. */
131 #define S390_OPERAND_BASE 0x20
133 /* This operand names an index register, it can be skipped. */
134 #define S390_OPERAND_INDEX 0x40
136 /* This operand is a relative branch displacement. The disassembler
137 prints these symbolically if possible. */
138 #define S390_OPERAND_PCREL 0x80
140 /* This operand takes signed values. */
141 #define S390_OPERAND_SIGNED 0x100
143 /* This operand is a length. */
144 #define S390_OPERAND_LENGTH 0x200
146 /* This operand is optional. Only a single operand at the end of
147 the instruction may be optional. */
148 #define S390_OPERAND_OPTIONAL 0x400
150 /* The operand needs to be a valid GP or FP register pair. */
151 #define S390_OPERAND_REG_PAIR 0x800