2 * Disassemble s390 instructions.
4 * Copyright IBM Corp. 2007
5 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com),
8 #include <linux/sched.h>
9 #include <linux/kernel.h>
10 #include <linux/string.h>
11 #include <linux/errno.h>
12 #include <linux/ptrace.h>
13 #include <linux/timer.h>
15 #include <linux/smp.h>
16 #include <linux/init.h>
17 #include <linux/interrupt.h>
18 #include <linux/delay.h>
19 #include <linux/module.h>
20 #include <linux/kallsyms.h>
21 #include <linux/reboot.h>
22 #include <linux/kprobes.h>
23 #include <linux/kdebug.h>
25 #include <asm/uaccess.h>
27 #include <linux/atomic.h>
28 #include <asm/mathemu.h>
29 #include <asm/cpcmd.h>
30 #include <asm/lowcore.h>
31 #include <asm/debug.h>
35 #define ONELONG "%08lx: "
36 #else /* CONFIG_64BIT */
37 #define ONELONG "%016lx: "
38 #endif /* CONFIG_64BIT */
40 #define OPERAND_GPR 0x1 /* Operand printed as %rx */
41 #define OPERAND_FPR 0x2 /* Operand printed as %fx */
42 #define OPERAND_AR 0x4 /* Operand printed as %ax */
43 #define OPERAND_CR 0x8 /* Operand printed as %cx */
44 #define OPERAND_DISP 0x10 /* Operand printed as displacement */
45 #define OPERAND_BASE 0x20 /* Operand printed as base register */
46 #define OPERAND_INDEX 0x40 /* Operand printed as index register */
47 #define OPERAND_PCREL 0x80 /* Operand printed as pc-relative symbol */
48 #define OPERAND_SIGNED 0x100 /* Operand printed as signed value */
49 #define OPERAND_LENGTH 0x200 /* Operand printed as length (+1) */
52 UNUSED, /* Indicates the end of the operand list */
53 R_8, /* GPR starting at position 8 */
54 R_12, /* GPR starting at position 12 */
55 R_16, /* GPR starting at position 16 */
56 R_20, /* GPR starting at position 20 */
57 R_24, /* GPR starting at position 24 */
58 R_28, /* GPR starting at position 28 */
59 R_32, /* GPR starting at position 32 */
60 F_8, /* FPR starting at position 8 */
61 F_12, /* FPR starting at position 12 */
62 F_16, /* FPR starting at position 16 */
63 F_20, /* FPR starting at position 16 */
64 F_24, /* FPR starting at position 24 */
65 F_28, /* FPR starting at position 28 */
66 F_32, /* FPR starting at position 32 */
67 A_8, /* Access reg. starting at position 8 */
68 A_12, /* Access reg. starting at position 12 */
69 A_24, /* Access reg. starting at position 24 */
70 A_28, /* Access reg. starting at position 28 */
71 C_8, /* Control reg. starting at position 8 */
72 C_12, /* Control reg. starting at position 12 */
73 B_16, /* Base register starting at position 16 */
74 B_32, /* Base register starting at position 32 */
75 X_12, /* Index register starting at position 12 */
76 D_20, /* Displacement starting at position 20 */
77 D_36, /* Displacement starting at position 36 */
78 D20_20, /* 20 bit displacement starting at 20 */
79 L4_8, /* 4 bit length starting at position 8 */
80 L4_12, /* 4 bit length starting at position 12 */
81 L8_8, /* 8 bit length starting at position 8 */
82 U4_8, /* 4 bit unsigned value starting at 8 */
83 U4_12, /* 4 bit unsigned value starting at 12 */
84 U4_16, /* 4 bit unsigned value starting at 16 */
85 U4_20, /* 4 bit unsigned value starting at 20 */
86 U4_32, /* 4 bit unsigned value starting at 32 */
87 U8_8, /* 8 bit unsigned value starting at 8 */
88 U8_16, /* 8 bit unsigned value starting at 16 */
89 U8_24, /* 8 bit unsigned value starting at 24 */
90 U8_32, /* 8 bit unsigned value starting at 32 */
91 I8_8, /* 8 bit signed value starting at 8 */
92 I8_32, /* 8 bit signed value starting at 32 */
93 I16_16, /* 16 bit signed value starting at 16 */
94 I16_32, /* 32 bit signed value starting at 16 */
95 U16_16, /* 16 bit unsigned value starting at 16 */
96 U16_32, /* 32 bit unsigned value starting at 16 */
97 J16_16, /* PC relative jump offset at 16 */
98 J32_16, /* PC relative long offset at 16 */
99 I32_16, /* 32 bit signed value starting at 16 */
100 U32_16, /* 32 bit unsigned value starting at 16 */
101 M_16, /* 4 bit optional mask starting at 16 */
102 RO_28, /* optional GPR starting at position 28 */
106 * Enumeration of the different instruction formats.
107 * For details consult the principles of operation.
112 INSTR_RIE_R0IU, INSTR_RIE_R0UU, INSTR_RIE_RRP, INSTR_RIE_RRPU,
113 INSTR_RIE_RRUUU, INSTR_RIE_RUPI, INSTR_RIE_RUPU, INSTR_RIE_RRI0,
114 INSTR_RIL_RI, INSTR_RIL_RP, INSTR_RIL_RU, INSTR_RIL_UP,
115 INSTR_RIS_R0RDU, INSTR_RIS_R0UU, INSTR_RIS_RURDI, INSTR_RIS_RURDU,
116 INSTR_RI_RI, INSTR_RI_RP, INSTR_RI_RU, INSTR_RI_UP,
117 INSTR_RRE_00, INSTR_RRE_0R, INSTR_RRE_AA, INSTR_RRE_AR, INSTR_RRE_F0,
118 INSTR_RRE_FF, INSTR_RRE_FR, INSTR_RRE_R0, INSTR_RRE_RA, INSTR_RRE_RF,
119 INSTR_RRE_RR, INSTR_RRE_RR_OPT,
120 INSTR_RRF_0UFF, INSTR_RRF_F0FF, INSTR_RRF_F0FF2, INSTR_RRF_F0FR,
121 INSTR_RRF_FFRU, INSTR_RRF_FUFF, INSTR_RRF_M0RR, INSTR_RRF_R0RR,
122 INSTR_RRF_R0RR2, INSTR_RRF_RURR, INSTR_RRF_U0FF, INSTR_RRF_U0RF,
123 INSTR_RRF_U0RR, INSTR_RRF_UUFF, INSTR_RRR_F0FF, INSTR_RRS_RRRDU,
124 INSTR_RR_FF, INSTR_RR_R0, INSTR_RR_RR, INSTR_RR_U0, INSTR_RR_UR,
125 INSTR_RSE_CCRD, INSTR_RSE_RRRD, INSTR_RSE_RURD,
128 INSTR_RSY_AARD, INSTR_RSY_CCRD, INSTR_RSY_RRRD, INSTR_RSY_RURD,
130 INSTR_RS_AARD, INSTR_RS_CCRD, INSTR_RS_R0RD, INSTR_RS_RRRD,
132 INSTR_RXE_FRRD, INSTR_RXE_RRRD,
134 INSTR_RXY_FRRD, INSTR_RXY_RRRD, INSTR_RXY_URRD,
135 INSTR_RX_FRRD, INSTR_RX_RRRD, INSTR_RX_URRD,
136 INSTR_SIL_RDI, INSTR_SIL_RDU,
137 INSTR_SIY_IRD, INSTR_SIY_URD,
140 INSTR_SSF_RRDRD, INSTR_SSF_RRDRD2,
141 INSTR_SS_L0RDRD, INSTR_SS_LIRDRD, INSTR_SS_LLRDRD, INSTR_SS_RRRDRD,
142 INSTR_SS_RRRDRD2, INSTR_SS_RRRDRD3,
143 INSTR_S_00, INSTR_S_RD,
147 int bits; /* The number of bits in the operand. */
148 int shift; /* The number of bits to shift. */
149 int flags; /* One bit syntax flags. */
154 unsigned char opfrag;
155 unsigned char format;
158 static const struct operand operands[] =
160 [UNUSED] = { 0, 0, 0 },
161 [R_8] = { 4, 8, OPERAND_GPR },
162 [R_12] = { 4, 12, OPERAND_GPR },
163 [R_16] = { 4, 16, OPERAND_GPR },
164 [R_20] = { 4, 20, OPERAND_GPR },
165 [R_24] = { 4, 24, OPERAND_GPR },
166 [R_28] = { 4, 28, OPERAND_GPR },
167 [R_32] = { 4, 32, OPERAND_GPR },
168 [F_8] = { 4, 8, OPERAND_FPR },
169 [F_12] = { 4, 12, OPERAND_FPR },
170 [F_16] = { 4, 16, OPERAND_FPR },
171 [F_20] = { 4, 16, OPERAND_FPR },
172 [F_24] = { 4, 24, OPERAND_FPR },
173 [F_28] = { 4, 28, OPERAND_FPR },
174 [F_32] = { 4, 32, OPERAND_FPR },
175 [A_8] = { 4, 8, OPERAND_AR },
176 [A_12] = { 4, 12, OPERAND_AR },
177 [A_24] = { 4, 24, OPERAND_AR },
178 [A_28] = { 4, 28, OPERAND_AR },
179 [C_8] = { 4, 8, OPERAND_CR },
180 [C_12] = { 4, 12, OPERAND_CR },
181 [B_16] = { 4, 16, OPERAND_BASE | OPERAND_GPR },
182 [B_32] = { 4, 32, OPERAND_BASE | OPERAND_GPR },
183 [X_12] = { 4, 12, OPERAND_INDEX | OPERAND_GPR },
184 [D_20] = { 12, 20, OPERAND_DISP },
185 [D_36] = { 12, 36, OPERAND_DISP },
186 [D20_20] = { 20, 20, OPERAND_DISP | OPERAND_SIGNED },
187 [L4_8] = { 4, 8, OPERAND_LENGTH },
188 [L4_12] = { 4, 12, OPERAND_LENGTH },
189 [L8_8] = { 8, 8, OPERAND_LENGTH },
190 [U4_8] = { 4, 8, 0 },
191 [U4_12] = { 4, 12, 0 },
192 [U4_16] = { 4, 16, 0 },
193 [U4_20] = { 4, 20, 0 },
194 [U4_32] = { 4, 32, 0 },
195 [U8_8] = { 8, 8, 0 },
196 [U8_16] = { 8, 16, 0 },
197 [U8_24] = { 8, 24, 0 },
198 [U8_32] = { 8, 32, 0 },
199 [I16_16] = { 16, 16, OPERAND_SIGNED },
200 [U16_16] = { 16, 16, 0 },
201 [U16_32] = { 16, 32, 0 },
202 [J16_16] = { 16, 16, OPERAND_PCREL },
203 [I16_32] = { 16, 32, OPERAND_SIGNED },
204 [J32_16] = { 32, 16, OPERAND_PCREL },
205 [I32_16] = { 32, 16, OPERAND_SIGNED },
206 [U32_16] = { 32, 16, 0 },
207 [M_16] = { 4, 16, 0 },
208 [RO_28] = { 4, 28, OPERAND_GPR }
211 static const unsigned char formats[][7] = {
212 [INSTR_E] = { 0xff, 0,0,0,0,0,0 },
213 [INSTR_RIE_R0UU] = { 0xff, R_8,U16_16,U4_32,0,0,0 },
214 [INSTR_RIE_RRPU] = { 0xff, R_8,R_12,U4_32,J16_16,0,0 },
215 [INSTR_RIE_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 },
216 [INSTR_RIE_RRUUU] = { 0xff, R_8,R_12,U8_16,U8_24,U8_32,0 },
217 [INSTR_RIE_RUPI] = { 0xff, R_8,I8_32,U4_12,J16_16,0,0 },
218 [INSTR_RIE_RRI0] = { 0xff, R_8,R_12,I16_16,0,0,0 },
219 [INSTR_RIL_RI] = { 0x0f, R_8,I32_16,0,0,0,0 },
220 [INSTR_RIL_RP] = { 0x0f, R_8,J32_16,0,0,0,0 },
221 [INSTR_RIL_RU] = { 0x0f, R_8,U32_16,0,0,0,0 },
222 [INSTR_RIL_UP] = { 0x0f, U4_8,J32_16,0,0,0,0 },
223 [INSTR_RIS_R0RDU] = { 0xff, R_8,U8_32,D_20,B_16,0,0 },
224 [INSTR_RIS_RURDI] = { 0xff, R_8,I8_32,U4_12,D_20,B_16,0 },
225 [INSTR_RIS_RURDU] = { 0xff, R_8,U8_32,U4_12,D_20,B_16,0 },
226 [INSTR_RI_RI] = { 0x0f, R_8,I16_16,0,0,0,0 },
227 [INSTR_RI_RP] = { 0x0f, R_8,J16_16,0,0,0,0 },
228 [INSTR_RI_RU] = { 0x0f, R_8,U16_16,0,0,0,0 },
229 [INSTR_RI_UP] = { 0x0f, U4_8,J16_16,0,0,0,0 },
230 [INSTR_RRE_00] = { 0xff, 0,0,0,0,0,0 },
231 [INSTR_RRE_0R] = { 0xff, R_28,0,0,0,0,0 },
232 [INSTR_RRE_AA] = { 0xff, A_24,A_28,0,0,0,0 },
233 [INSTR_RRE_AR] = { 0xff, A_24,R_28,0,0,0,0 },
234 [INSTR_RRE_F0] = { 0xff, F_24,0,0,0,0,0 },
235 [INSTR_RRE_FF] = { 0xff, F_24,F_28,0,0,0,0 },
236 [INSTR_RRE_FR] = { 0xff, F_24,R_28,0,0,0,0 },
237 [INSTR_RRE_R0] = { 0xff, R_24,0,0,0,0,0 },
238 [INSTR_RRE_RA] = { 0xff, R_24,A_28,0,0,0,0 },
239 [INSTR_RRE_RF] = { 0xff, R_24,F_28,0,0,0,0 },
240 [INSTR_RRE_RR] = { 0xff, R_24,R_28,0,0,0,0 },
241 [INSTR_RRE_RR_OPT]= { 0xff, R_24,RO_28,0,0,0,0 },
242 [INSTR_RRF_0UFF] = { 0xff, F_24,F_28,U4_20,0,0,0 },
243 [INSTR_RRF_F0FF2] = { 0xff, F_24,F_16,F_28,0,0,0 },
244 [INSTR_RRF_F0FF] = { 0xff, F_16,F_24,F_28,0,0,0 },
245 [INSTR_RRF_F0FR] = { 0xff, F_24,F_16,R_28,0,0,0 },
246 [INSTR_RRF_FFRU] = { 0xff, F_24,F_16,R_28,U4_20,0,0 },
247 [INSTR_RRF_FUFF] = { 0xff, F_24,F_16,F_28,U4_20,0,0 },
248 [INSTR_RRF_M0RR] = { 0xff, R_24,R_28,M_16,0,0,0 },
249 [INSTR_RRF_R0RR] = { 0xff, R_24,R_16,R_28,0,0,0 },
250 [INSTR_RRF_R0RR2] = { 0xff, R_24,R_28,R_16,0,0,0 },
251 [INSTR_RRF_RURR] = { 0xff, R_24,R_28,R_16,U4_20,0,0 },
252 [INSTR_RRF_U0FF] = { 0xff, F_24,U4_16,F_28,0,0,0 },
253 [INSTR_RRF_U0RF] = { 0xff, R_24,U4_16,F_28,0,0,0 },
254 [INSTR_RRF_U0RR] = { 0xff, R_24,R_28,U4_16,0,0,0 },
255 [INSTR_RRF_UUFF] = { 0xff, F_24,U4_16,F_28,U4_20,0,0 },
256 [INSTR_RRR_F0FF] = { 0xff, F_24,F_28,F_16,0,0,0 },
257 [INSTR_RRS_RRRDU] = { 0xff, R_8,R_12,U4_32,D_20,B_16,0 },
258 [INSTR_RR_FF] = { 0xff, F_8,F_12,0,0,0,0 },
259 [INSTR_RR_R0] = { 0xff, R_8, 0,0,0,0,0 },
260 [INSTR_RR_RR] = { 0xff, R_8,R_12,0,0,0,0 },
261 [INSTR_RR_U0] = { 0xff, U8_8, 0,0,0,0,0 },
262 [INSTR_RR_UR] = { 0xff, U4_8,R_12,0,0,0,0 },
263 [INSTR_RSE_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 },
264 [INSTR_RSE_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 },
265 [INSTR_RSE_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 },
266 [INSTR_RSI_RRP] = { 0xff, R_8,R_12,J16_16,0,0,0 },
267 [INSTR_RSL_R0RD] = { 0xff, D_20,L4_8,B_16,0,0,0 },
268 [INSTR_RSY_AARD] = { 0xff, A_8,A_12,D20_20,B_16,0,0 },
269 [INSTR_RSY_CCRD] = { 0xff, C_8,C_12,D20_20,B_16,0,0 },
270 [INSTR_RSY_RRRD] = { 0xff, R_8,R_12,D20_20,B_16,0,0 },
271 [INSTR_RSY_RURD] = { 0xff, R_8,U4_12,D20_20,B_16,0,0 },
272 [INSTR_RSY_RDRM] = { 0xff, R_8,D20_20,B_16,U4_12,0,0 },
273 [INSTR_RS_AARD] = { 0xff, A_8,A_12,D_20,B_16,0,0 },
274 [INSTR_RS_CCRD] = { 0xff, C_8,C_12,D_20,B_16,0,0 },
275 [INSTR_RS_R0RD] = { 0xff, R_8,D_20,B_16,0,0,0 },
276 [INSTR_RS_RRRD] = { 0xff, R_8,R_12,D_20,B_16,0,0 },
277 [INSTR_RS_RURD] = { 0xff, R_8,U4_12,D_20,B_16,0,0 },
278 [INSTR_RXE_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 },
279 [INSTR_RXE_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 },
280 [INSTR_RXF_FRRDF] = { 0xff, F_32,F_8,D_20,X_12,B_16,0 },
281 [INSTR_RXY_FRRD] = { 0xff, F_8,D20_20,X_12,B_16,0,0 },
282 [INSTR_RXY_RRRD] = { 0xff, R_8,D20_20,X_12,B_16,0,0 },
283 [INSTR_RXY_URRD] = { 0xff, U4_8,D20_20,X_12,B_16,0,0 },
284 [INSTR_RX_FRRD] = { 0xff, F_8,D_20,X_12,B_16,0,0 },
285 [INSTR_RX_RRRD] = { 0xff, R_8,D_20,X_12,B_16,0,0 },
286 [INSTR_RX_URRD] = { 0xff, U4_8,D_20,X_12,B_16,0,0 },
287 [INSTR_SIL_RDI] = { 0xff, D_20,B_16,I16_32,0,0,0 },
288 [INSTR_SIL_RDU] = { 0xff, D_20,B_16,U16_32,0,0,0 },
289 [INSTR_SIY_IRD] = { 0xff, D20_20,B_16,I8_8,0,0,0 },
290 [INSTR_SIY_URD] = { 0xff, D20_20,B_16,U8_8,0,0,0 },
291 [INSTR_SI_URD] = { 0xff, D_20,B_16,U8_8,0,0,0 },
292 [INSTR_SSE_RDRD] = { 0xff, D_20,B_16,D_36,B_32,0,0 },
293 [INSTR_SSF_RRDRD] = { 0x00, D_20,B_16,D_36,B_32,R_8,0 },
294 [INSTR_SSF_RRDRD2]= { 0x00, R_8,D_20,B_16,D_36,B_32,0 },
295 [INSTR_SS_L0RDRD] = { 0xff, D_20,L8_8,B_16,D_36,B_32,0 },
296 [INSTR_SS_LIRDRD] = { 0xff, D_20,L4_8,B_16,D_36,B_32,U4_12 },
297 [INSTR_SS_LLRDRD] = { 0xff, D_20,L4_8,B_16,D_36,L4_12,B_32 },
298 [INSTR_SS_RRRDRD2]= { 0xff, R_8,D_20,B_16,R_12,D_36,B_32 },
299 [INSTR_SS_RRRDRD3]= { 0xff, R_8,R_12,D_20,B_16,D_36,B_32 },
300 [INSTR_SS_RRRDRD] = { 0xff, D_20,R_8,B_16,D_36,B_32,R_12 },
301 [INSTR_S_00] = { 0xff, 0,0,0,0,0,0 },
302 [INSTR_S_RD] = { 0xff, D_20,B_16,0,0,0,0 },
320 static char *long_insn_name[] = {
321 [LONG_INSN_ALGHSIK] = "alghsik",
322 [LONG_INSN_ALHSIK] = "alhsik",
323 [LONG_INSN_CLFHSI] = "clfhsi",
324 [LONG_INSN_CLGFRL] = "clgfrl",
325 [LONG_INSN_CLGHRL] = "clghrl",
326 [LONG_INSN_CLGHSI] = "clghsi",
327 [LONG_INSN_CLHHSI] = "clhhsi",
328 [LONG_INSN_LLGFRL] = "llgfrl",
329 [LONG_INSN_LLGHRL] = "llghrl",
330 [LONG_INSN_POPCNT] = "popcnt",
331 [LONG_INSN_RISBHG] = "risbhg",
332 [LONG_INSN_RISBLG] = "risblk",
335 static struct insn opcode[] = {
337 { "lmd", 0xef, INSTR_SS_RRRDRD3 },
339 { "spm", 0x04, INSTR_RR_R0 },
340 { "balr", 0x05, INSTR_RR_RR },
341 { "bctr", 0x06, INSTR_RR_RR },
342 { "bcr", 0x07, INSTR_RR_UR },
343 { "svc", 0x0a, INSTR_RR_U0 },
344 { "bsm", 0x0b, INSTR_RR_RR },
345 { "bassm", 0x0c, INSTR_RR_RR },
346 { "basr", 0x0d, INSTR_RR_RR },
347 { "mvcl", 0x0e, INSTR_RR_RR },
348 { "clcl", 0x0f, INSTR_RR_RR },
349 { "lpr", 0x10, INSTR_RR_RR },
350 { "lnr", 0x11, INSTR_RR_RR },
351 { "ltr", 0x12, INSTR_RR_RR },
352 { "lcr", 0x13, INSTR_RR_RR },
353 { "nr", 0x14, INSTR_RR_RR },
354 { "clr", 0x15, INSTR_RR_RR },
355 { "or", 0x16, INSTR_RR_RR },
356 { "xr", 0x17, INSTR_RR_RR },
357 { "lr", 0x18, INSTR_RR_RR },
358 { "cr", 0x19, INSTR_RR_RR },
359 { "ar", 0x1a, INSTR_RR_RR },
360 { "sr", 0x1b, INSTR_RR_RR },
361 { "mr", 0x1c, INSTR_RR_RR },
362 { "dr", 0x1d, INSTR_RR_RR },
363 { "alr", 0x1e, INSTR_RR_RR },
364 { "slr", 0x1f, INSTR_RR_RR },
365 { "lpdr", 0x20, INSTR_RR_FF },
366 { "lndr", 0x21, INSTR_RR_FF },
367 { "ltdr", 0x22, INSTR_RR_FF },
368 { "lcdr", 0x23, INSTR_RR_FF },
369 { "hdr", 0x24, INSTR_RR_FF },
370 { "ldxr", 0x25, INSTR_RR_FF },
371 { "lrdr", 0x25, INSTR_RR_FF },
372 { "mxr", 0x26, INSTR_RR_FF },
373 { "mxdr", 0x27, INSTR_RR_FF },
374 { "ldr", 0x28, INSTR_RR_FF },
375 { "cdr", 0x29, INSTR_RR_FF },
376 { "adr", 0x2a, INSTR_RR_FF },
377 { "sdr", 0x2b, INSTR_RR_FF },
378 { "mdr", 0x2c, INSTR_RR_FF },
379 { "ddr", 0x2d, INSTR_RR_FF },
380 { "awr", 0x2e, INSTR_RR_FF },
381 { "swr", 0x2f, INSTR_RR_FF },
382 { "lper", 0x30, INSTR_RR_FF },
383 { "lner", 0x31, INSTR_RR_FF },
384 { "lter", 0x32, INSTR_RR_FF },
385 { "lcer", 0x33, INSTR_RR_FF },
386 { "her", 0x34, INSTR_RR_FF },
387 { "ledr", 0x35, INSTR_RR_FF },
388 { "lrer", 0x35, INSTR_RR_FF },
389 { "axr", 0x36, INSTR_RR_FF },
390 { "sxr", 0x37, INSTR_RR_FF },
391 { "ler", 0x38, INSTR_RR_FF },
392 { "cer", 0x39, INSTR_RR_FF },
393 { "aer", 0x3a, INSTR_RR_FF },
394 { "ser", 0x3b, INSTR_RR_FF },
395 { "mder", 0x3c, INSTR_RR_FF },
396 { "mer", 0x3c, INSTR_RR_FF },
397 { "der", 0x3d, INSTR_RR_FF },
398 { "aur", 0x3e, INSTR_RR_FF },
399 { "sur", 0x3f, INSTR_RR_FF },
400 { "sth", 0x40, INSTR_RX_RRRD },
401 { "la", 0x41, INSTR_RX_RRRD },
402 { "stc", 0x42, INSTR_RX_RRRD },
403 { "ic", 0x43, INSTR_RX_RRRD },
404 { "ex", 0x44, INSTR_RX_RRRD },
405 { "bal", 0x45, INSTR_RX_RRRD },
406 { "bct", 0x46, INSTR_RX_RRRD },
407 { "bc", 0x47, INSTR_RX_URRD },
408 { "lh", 0x48, INSTR_RX_RRRD },
409 { "ch", 0x49, INSTR_RX_RRRD },
410 { "ah", 0x4a, INSTR_RX_RRRD },
411 { "sh", 0x4b, INSTR_RX_RRRD },
412 { "mh", 0x4c, INSTR_RX_RRRD },
413 { "bas", 0x4d, INSTR_RX_RRRD },
414 { "cvd", 0x4e, INSTR_RX_RRRD },
415 { "cvb", 0x4f, INSTR_RX_RRRD },
416 { "st", 0x50, INSTR_RX_RRRD },
417 { "lae", 0x51, INSTR_RX_RRRD },
418 { "n", 0x54, INSTR_RX_RRRD },
419 { "cl", 0x55, INSTR_RX_RRRD },
420 { "o", 0x56, INSTR_RX_RRRD },
421 { "x", 0x57, INSTR_RX_RRRD },
422 { "l", 0x58, INSTR_RX_RRRD },
423 { "c", 0x59, INSTR_RX_RRRD },
424 { "a", 0x5a, INSTR_RX_RRRD },
425 { "s", 0x5b, INSTR_RX_RRRD },
426 { "m", 0x5c, INSTR_RX_RRRD },
427 { "d", 0x5d, INSTR_RX_RRRD },
428 { "al", 0x5e, INSTR_RX_RRRD },
429 { "sl", 0x5f, INSTR_RX_RRRD },
430 { "std", 0x60, INSTR_RX_FRRD },
431 { "mxd", 0x67, INSTR_RX_FRRD },
432 { "ld", 0x68, INSTR_RX_FRRD },
433 { "cd", 0x69, INSTR_RX_FRRD },
434 { "ad", 0x6a, INSTR_RX_FRRD },
435 { "sd", 0x6b, INSTR_RX_FRRD },
436 { "md", 0x6c, INSTR_RX_FRRD },
437 { "dd", 0x6d, INSTR_RX_FRRD },
438 { "aw", 0x6e, INSTR_RX_FRRD },
439 { "sw", 0x6f, INSTR_RX_FRRD },
440 { "ste", 0x70, INSTR_RX_FRRD },
441 { "ms", 0x71, INSTR_RX_RRRD },
442 { "le", 0x78, INSTR_RX_FRRD },
443 { "ce", 0x79, INSTR_RX_FRRD },
444 { "ae", 0x7a, INSTR_RX_FRRD },
445 { "se", 0x7b, INSTR_RX_FRRD },
446 { "mde", 0x7c, INSTR_RX_FRRD },
447 { "me", 0x7c, INSTR_RX_FRRD },
448 { "de", 0x7d, INSTR_RX_FRRD },
449 { "au", 0x7e, INSTR_RX_FRRD },
450 { "su", 0x7f, INSTR_RX_FRRD },
451 { "ssm", 0x80, INSTR_S_RD },
452 { "lpsw", 0x82, INSTR_S_RD },
453 { "diag", 0x83, INSTR_RS_RRRD },
454 { "brxh", 0x84, INSTR_RSI_RRP },
455 { "brxle", 0x85, INSTR_RSI_RRP },
456 { "bxh", 0x86, INSTR_RS_RRRD },
457 { "bxle", 0x87, INSTR_RS_RRRD },
458 { "srl", 0x88, INSTR_RS_R0RD },
459 { "sll", 0x89, INSTR_RS_R0RD },
460 { "sra", 0x8a, INSTR_RS_R0RD },
461 { "sla", 0x8b, INSTR_RS_R0RD },
462 { "srdl", 0x8c, INSTR_RS_R0RD },
463 { "sldl", 0x8d, INSTR_RS_R0RD },
464 { "srda", 0x8e, INSTR_RS_R0RD },
465 { "slda", 0x8f, INSTR_RS_R0RD },
466 { "stm", 0x90, INSTR_RS_RRRD },
467 { "tm", 0x91, INSTR_SI_URD },
468 { "mvi", 0x92, INSTR_SI_URD },
469 { "ts", 0x93, INSTR_S_RD },
470 { "ni", 0x94, INSTR_SI_URD },
471 { "cli", 0x95, INSTR_SI_URD },
472 { "oi", 0x96, INSTR_SI_URD },
473 { "xi", 0x97, INSTR_SI_URD },
474 { "lm", 0x98, INSTR_RS_RRRD },
475 { "trace", 0x99, INSTR_RS_RRRD },
476 { "lam", 0x9a, INSTR_RS_AARD },
477 { "stam", 0x9b, INSTR_RS_AARD },
478 { "mvcle", 0xa8, INSTR_RS_RRRD },
479 { "clcle", 0xa9, INSTR_RS_RRRD },
480 { "stnsm", 0xac, INSTR_SI_URD },
481 { "stosm", 0xad, INSTR_SI_URD },
482 { "sigp", 0xae, INSTR_RS_RRRD },
483 { "mc", 0xaf, INSTR_SI_URD },
484 { "lra", 0xb1, INSTR_RX_RRRD },
485 { "stctl", 0xb6, INSTR_RS_CCRD },
486 { "lctl", 0xb7, INSTR_RS_CCRD },
487 { "cs", 0xba, INSTR_RS_RRRD },
488 { "cds", 0xbb, INSTR_RS_RRRD },
489 { "clm", 0xbd, INSTR_RS_RURD },
490 { "stcm", 0xbe, INSTR_RS_RURD },
491 { "icm", 0xbf, INSTR_RS_RURD },
492 { "mvn", 0xd1, INSTR_SS_L0RDRD },
493 { "mvc", 0xd2, INSTR_SS_L0RDRD },
494 { "mvz", 0xd3, INSTR_SS_L0RDRD },
495 { "nc", 0xd4, INSTR_SS_L0RDRD },
496 { "clc", 0xd5, INSTR_SS_L0RDRD },
497 { "oc", 0xd6, INSTR_SS_L0RDRD },
498 { "xc", 0xd7, INSTR_SS_L0RDRD },
499 { "mvck", 0xd9, INSTR_SS_RRRDRD },
500 { "mvcp", 0xda, INSTR_SS_RRRDRD },
501 { "mvcs", 0xdb, INSTR_SS_RRRDRD },
502 { "tr", 0xdc, INSTR_SS_L0RDRD },
503 { "trt", 0xdd, INSTR_SS_L0RDRD },
504 { "ed", 0xde, INSTR_SS_L0RDRD },
505 { "edmk", 0xdf, INSTR_SS_L0RDRD },
506 { "pku", 0xe1, INSTR_SS_L0RDRD },
507 { "unpku", 0xe2, INSTR_SS_L0RDRD },
508 { "mvcin", 0xe8, INSTR_SS_L0RDRD },
509 { "pka", 0xe9, INSTR_SS_L0RDRD },
510 { "unpka", 0xea, INSTR_SS_L0RDRD },
511 { "plo", 0xee, INSTR_SS_RRRDRD2 },
512 { "srp", 0xf0, INSTR_SS_LIRDRD },
513 { "mvo", 0xf1, INSTR_SS_LLRDRD },
514 { "pack", 0xf2, INSTR_SS_LLRDRD },
515 { "unpk", 0xf3, INSTR_SS_LLRDRD },
516 { "zap", 0xf8, INSTR_SS_LLRDRD },
517 { "cp", 0xf9, INSTR_SS_LLRDRD },
518 { "ap", 0xfa, INSTR_SS_LLRDRD },
519 { "sp", 0xfb, INSTR_SS_LLRDRD },
520 { "mp", 0xfc, INSTR_SS_LLRDRD },
521 { "dp", 0xfd, INSTR_SS_LLRDRD },
522 { "", 0, INSTR_INVALID }
525 static struct insn opcode_01[] = {
527 { "sam64", 0x0e, INSTR_E },
528 { "pfpo", 0x0a, INSTR_E },
529 { "ptff", 0x04, INSTR_E },
531 { "pr", 0x01, INSTR_E },
532 { "upt", 0x02, INSTR_E },
533 { "sckpf", 0x07, INSTR_E },
534 { "tam", 0x0b, INSTR_E },
535 { "sam24", 0x0c, INSTR_E },
536 { "sam31", 0x0d, INSTR_E },
537 { "trap2", 0xff, INSTR_E },
538 { "", 0, INSTR_INVALID }
541 static struct insn opcode_a5[] = {
543 { "iihh", 0x00, INSTR_RI_RU },
544 { "iihl", 0x01, INSTR_RI_RU },
545 { "iilh", 0x02, INSTR_RI_RU },
546 { "iill", 0x03, INSTR_RI_RU },
547 { "nihh", 0x04, INSTR_RI_RU },
548 { "nihl", 0x05, INSTR_RI_RU },
549 { "nilh", 0x06, INSTR_RI_RU },
550 { "nill", 0x07, INSTR_RI_RU },
551 { "oihh", 0x08, INSTR_RI_RU },
552 { "oihl", 0x09, INSTR_RI_RU },
553 { "oilh", 0x0a, INSTR_RI_RU },
554 { "oill", 0x0b, INSTR_RI_RU },
555 { "llihh", 0x0c, INSTR_RI_RU },
556 { "llihl", 0x0d, INSTR_RI_RU },
557 { "llilh", 0x0e, INSTR_RI_RU },
558 { "llill", 0x0f, INSTR_RI_RU },
560 { "", 0, INSTR_INVALID }
563 static struct insn opcode_a7[] = {
565 { "tmhh", 0x02, INSTR_RI_RU },
566 { "tmhl", 0x03, INSTR_RI_RU },
567 { "brctg", 0x07, INSTR_RI_RP },
568 { "lghi", 0x09, INSTR_RI_RI },
569 { "aghi", 0x0b, INSTR_RI_RI },
570 { "mghi", 0x0d, INSTR_RI_RI },
571 { "cghi", 0x0f, INSTR_RI_RI },
573 { "tmlh", 0x00, INSTR_RI_RU },
574 { "tmll", 0x01, INSTR_RI_RU },
575 { "brc", 0x04, INSTR_RI_UP },
576 { "bras", 0x05, INSTR_RI_RP },
577 { "brct", 0x06, INSTR_RI_RP },
578 { "lhi", 0x08, INSTR_RI_RI },
579 { "ahi", 0x0a, INSTR_RI_RI },
580 { "mhi", 0x0c, INSTR_RI_RI },
581 { "chi", 0x0e, INSTR_RI_RI },
582 { "", 0, INSTR_INVALID }
585 static struct insn opcode_b2[] = {
587 { "sske", 0x2b, INSTR_RRF_M0RR },
588 { "stckf", 0x7c, INSTR_S_RD },
589 { "cu21", 0xa6, INSTR_RRF_M0RR },
590 { "cuutf", 0xa6, INSTR_RRF_M0RR },
591 { "cu12", 0xa7, INSTR_RRF_M0RR },
592 { "cutfu", 0xa7, INSTR_RRF_M0RR },
593 { "stfle", 0xb0, INSTR_S_RD },
594 { "lpswe", 0xb2, INSTR_S_RD },
595 { "srnmt", 0xb9, INSTR_S_RD },
596 { "lfas", 0xbd, INSTR_S_RD },
598 { "stidp", 0x02, INSTR_S_RD },
599 { "sck", 0x04, INSTR_S_RD },
600 { "stck", 0x05, INSTR_S_RD },
601 { "sckc", 0x06, INSTR_S_RD },
602 { "stckc", 0x07, INSTR_S_RD },
603 { "spt", 0x08, INSTR_S_RD },
604 { "stpt", 0x09, INSTR_S_RD },
605 { "spka", 0x0a, INSTR_S_RD },
606 { "ipk", 0x0b, INSTR_S_00 },
607 { "ptlb", 0x0d, INSTR_S_00 },
608 { "spx", 0x10, INSTR_S_RD },
609 { "stpx", 0x11, INSTR_S_RD },
610 { "stap", 0x12, INSTR_S_RD },
611 { "sie", 0x14, INSTR_S_RD },
612 { "pc", 0x18, INSTR_S_RD },
613 { "sac", 0x19, INSTR_S_RD },
614 { "servc", 0x20, INSTR_RRE_RR },
615 { "cfc", 0x1a, INSTR_S_RD },
616 { "ipte", 0x21, INSTR_RRE_RR },
617 { "ipm", 0x22, INSTR_RRE_R0 },
618 { "ivsk", 0x23, INSTR_RRE_RR },
619 { "iac", 0x24, INSTR_RRE_R0 },
620 { "ssar", 0x25, INSTR_RRE_R0 },
621 { "epar", 0x26, INSTR_RRE_R0 },
622 { "esar", 0x27, INSTR_RRE_R0 },
623 { "pt", 0x28, INSTR_RRE_RR },
624 { "iske", 0x29, INSTR_RRE_RR },
625 { "rrbe", 0x2a, INSTR_RRE_RR },
626 { "sske", 0x2b, INSTR_RRE_RR },
627 { "tb", 0x2c, INSTR_RRE_0R },
628 { "dxr", 0x2d, INSTR_RRE_F0 },
629 { "pgin", 0x2e, INSTR_RRE_RR },
630 { "pgout", 0x2f, INSTR_RRE_RR },
631 { "csch", 0x30, INSTR_S_00 },
632 { "hsch", 0x31, INSTR_S_00 },
633 { "msch", 0x32, INSTR_S_RD },
634 { "ssch", 0x33, INSTR_S_RD },
635 { "stsch", 0x34, INSTR_S_RD },
636 { "tsch", 0x35, INSTR_S_RD },
637 { "tpi", 0x36, INSTR_S_RD },
638 { "sal", 0x37, INSTR_S_00 },
639 { "rsch", 0x38, INSTR_S_00 },
640 { "stcrw", 0x39, INSTR_S_RD },
641 { "stcps", 0x3a, INSTR_S_RD },
642 { "rchp", 0x3b, INSTR_S_00 },
643 { "schm", 0x3c, INSTR_S_00 },
644 { "bakr", 0x40, INSTR_RRE_RR },
645 { "cksm", 0x41, INSTR_RRE_RR },
646 { "sqdr", 0x44, INSTR_RRE_F0 },
647 { "sqer", 0x45, INSTR_RRE_F0 },
648 { "stura", 0x46, INSTR_RRE_RR },
649 { "msta", 0x47, INSTR_RRE_R0 },
650 { "palb", 0x48, INSTR_RRE_00 },
651 { "ereg", 0x49, INSTR_RRE_RR },
652 { "esta", 0x4a, INSTR_RRE_RR },
653 { "lura", 0x4b, INSTR_RRE_RR },
654 { "tar", 0x4c, INSTR_RRE_AR },
655 { "cpya", 0x4d, INSTR_RRE_AA },
656 { "sar", 0x4e, INSTR_RRE_AR },
657 { "ear", 0x4f, INSTR_RRE_RA },
658 { "csp", 0x50, INSTR_RRE_RR },
659 { "msr", 0x52, INSTR_RRE_RR },
660 { "mvpg", 0x54, INSTR_RRE_RR },
661 { "mvst", 0x55, INSTR_RRE_RR },
662 { "cuse", 0x57, INSTR_RRE_RR },
663 { "bsg", 0x58, INSTR_RRE_RR },
664 { "bsa", 0x5a, INSTR_RRE_RR },
665 { "clst", 0x5d, INSTR_RRE_RR },
666 { "srst", 0x5e, INSTR_RRE_RR },
667 { "cmpsc", 0x63, INSTR_RRE_RR },
668 { "siga", 0x74, INSTR_S_RD },
669 { "xsch", 0x76, INSTR_S_00 },
670 { "rp", 0x77, INSTR_S_RD },
671 { "stcke", 0x78, INSTR_S_RD },
672 { "sacf", 0x79, INSTR_S_RD },
673 { "spp", 0x80, INSTR_S_RD },
674 { "stsi", 0x7d, INSTR_S_RD },
675 { "srnm", 0x99, INSTR_S_RD },
676 { "stfpc", 0x9c, INSTR_S_RD },
677 { "lfpc", 0x9d, INSTR_S_RD },
678 { "tre", 0xa5, INSTR_RRE_RR },
679 { "cuutf", 0xa6, INSTR_RRE_RR },
680 { "cutfu", 0xa7, INSTR_RRE_RR },
681 { "stfl", 0xb1, INSTR_S_RD },
682 { "trap4", 0xff, INSTR_S_RD },
683 { "", 0, INSTR_INVALID }
686 static struct insn opcode_b3[] = {
688 { "maylr", 0x38, INSTR_RRF_F0FF },
689 { "mylr", 0x39, INSTR_RRF_F0FF },
690 { "mayr", 0x3a, INSTR_RRF_F0FF },
691 { "myr", 0x3b, INSTR_RRF_F0FF },
692 { "mayhr", 0x3c, INSTR_RRF_F0FF },
693 { "myhr", 0x3d, INSTR_RRF_F0FF },
694 { "cegbr", 0xa4, INSTR_RRE_RR },
695 { "cdgbr", 0xa5, INSTR_RRE_RR },
696 { "cxgbr", 0xa6, INSTR_RRE_RR },
697 { "cgebr", 0xa8, INSTR_RRF_U0RF },
698 { "cgdbr", 0xa9, INSTR_RRF_U0RF },
699 { "cgxbr", 0xaa, INSTR_RRF_U0RF },
700 { "cfer", 0xb8, INSTR_RRF_U0RF },
701 { "cfdr", 0xb9, INSTR_RRF_U0RF },
702 { "cfxr", 0xba, INSTR_RRF_U0RF },
703 { "cegr", 0xc4, INSTR_RRE_RR },
704 { "cdgr", 0xc5, INSTR_RRE_RR },
705 { "cxgr", 0xc6, INSTR_RRE_RR },
706 { "cger", 0xc8, INSTR_RRF_U0RF },
707 { "cgdr", 0xc9, INSTR_RRF_U0RF },
708 { "cgxr", 0xca, INSTR_RRF_U0RF },
709 { "lpdfr", 0x70, INSTR_RRE_FF },
710 { "lndfr", 0x71, INSTR_RRE_FF },
711 { "cpsdr", 0x72, INSTR_RRF_F0FF2 },
712 { "lcdfr", 0x73, INSTR_RRE_FF },
713 { "ldgr", 0xc1, INSTR_RRE_FR },
714 { "lgdr", 0xcd, INSTR_RRE_RF },
715 { "adtr", 0xd2, INSTR_RRR_F0FF },
716 { "axtr", 0xda, INSTR_RRR_F0FF },
717 { "cdtr", 0xe4, INSTR_RRE_FF },
718 { "cxtr", 0xec, INSTR_RRE_FF },
719 { "kdtr", 0xe0, INSTR_RRE_FF },
720 { "kxtr", 0xe8, INSTR_RRE_FF },
721 { "cedtr", 0xf4, INSTR_RRE_FF },
722 { "cextr", 0xfc, INSTR_RRE_FF },
723 { "cdgtr", 0xf1, INSTR_RRE_FR },
724 { "cxgtr", 0xf9, INSTR_RRE_FR },
725 { "cdstr", 0xf3, INSTR_RRE_FR },
726 { "cxstr", 0xfb, INSTR_RRE_FR },
727 { "cdutr", 0xf2, INSTR_RRE_FR },
728 { "cxutr", 0xfa, INSTR_RRE_FR },
729 { "cgdtr", 0xe1, INSTR_RRF_U0RF },
730 { "cgxtr", 0xe9, INSTR_RRF_U0RF },
731 { "csdtr", 0xe3, INSTR_RRE_RF },
732 { "csxtr", 0xeb, INSTR_RRE_RF },
733 { "cudtr", 0xe2, INSTR_RRE_RF },
734 { "cuxtr", 0xea, INSTR_RRE_RF },
735 { "ddtr", 0xd1, INSTR_RRR_F0FF },
736 { "dxtr", 0xd9, INSTR_RRR_F0FF },
737 { "eedtr", 0xe5, INSTR_RRE_RF },
738 { "eextr", 0xed, INSTR_RRE_RF },
739 { "esdtr", 0xe7, INSTR_RRE_RF },
740 { "esxtr", 0xef, INSTR_RRE_RF },
741 { "iedtr", 0xf6, INSTR_RRF_F0FR },
742 { "iextr", 0xfe, INSTR_RRF_F0FR },
743 { "ltdtr", 0xd6, INSTR_RRE_FF },
744 { "ltxtr", 0xde, INSTR_RRE_FF },
745 { "fidtr", 0xd7, INSTR_RRF_UUFF },
746 { "fixtr", 0xdf, INSTR_RRF_UUFF },
747 { "ldetr", 0xd4, INSTR_RRF_0UFF },
748 { "lxdtr", 0xdc, INSTR_RRF_0UFF },
749 { "ledtr", 0xd5, INSTR_RRF_UUFF },
750 { "ldxtr", 0xdd, INSTR_RRF_UUFF },
751 { "mdtr", 0xd0, INSTR_RRR_F0FF },
752 { "mxtr", 0xd8, INSTR_RRR_F0FF },
753 { "qadtr", 0xf5, INSTR_RRF_FUFF },
754 { "qaxtr", 0xfd, INSTR_RRF_FUFF },
755 { "rrdtr", 0xf7, INSTR_RRF_FFRU },
756 { "rrxtr", 0xff, INSTR_RRF_FFRU },
757 { "sfasr", 0x85, INSTR_RRE_R0 },
758 { "sdtr", 0xd3, INSTR_RRR_F0FF },
759 { "sxtr", 0xdb, INSTR_RRR_F0FF },
761 { "lpebr", 0x00, INSTR_RRE_FF },
762 { "lnebr", 0x01, INSTR_RRE_FF },
763 { "ltebr", 0x02, INSTR_RRE_FF },
764 { "lcebr", 0x03, INSTR_RRE_FF },
765 { "ldebr", 0x04, INSTR_RRE_FF },
766 { "lxdbr", 0x05, INSTR_RRE_FF },
767 { "lxebr", 0x06, INSTR_RRE_FF },
768 { "mxdbr", 0x07, INSTR_RRE_FF },
769 { "kebr", 0x08, INSTR_RRE_FF },
770 { "cebr", 0x09, INSTR_RRE_FF },
771 { "aebr", 0x0a, INSTR_RRE_FF },
772 { "sebr", 0x0b, INSTR_RRE_FF },
773 { "mdebr", 0x0c, INSTR_RRE_FF },
774 { "debr", 0x0d, INSTR_RRE_FF },
775 { "maebr", 0x0e, INSTR_RRF_F0FF },
776 { "msebr", 0x0f, INSTR_RRF_F0FF },
777 { "lpdbr", 0x10, INSTR_RRE_FF },
778 { "lndbr", 0x11, INSTR_RRE_FF },
779 { "ltdbr", 0x12, INSTR_RRE_FF },
780 { "lcdbr", 0x13, INSTR_RRE_FF },
781 { "sqebr", 0x14, INSTR_RRE_FF },
782 { "sqdbr", 0x15, INSTR_RRE_FF },
783 { "sqxbr", 0x16, INSTR_RRE_FF },
784 { "meebr", 0x17, INSTR_RRE_FF },
785 { "kdbr", 0x18, INSTR_RRE_FF },
786 { "cdbr", 0x19, INSTR_RRE_FF },
787 { "adbr", 0x1a, INSTR_RRE_FF },
788 { "sdbr", 0x1b, INSTR_RRE_FF },
789 { "mdbr", 0x1c, INSTR_RRE_FF },
790 { "ddbr", 0x1d, INSTR_RRE_FF },
791 { "madbr", 0x1e, INSTR_RRF_F0FF },
792 { "msdbr", 0x1f, INSTR_RRF_F0FF },
793 { "lder", 0x24, INSTR_RRE_FF },
794 { "lxdr", 0x25, INSTR_RRE_FF },
795 { "lxer", 0x26, INSTR_RRE_FF },
796 { "maer", 0x2e, INSTR_RRF_F0FF },
797 { "mser", 0x2f, INSTR_RRF_F0FF },
798 { "sqxr", 0x36, INSTR_RRE_FF },
799 { "meer", 0x37, INSTR_RRE_FF },
800 { "madr", 0x3e, INSTR_RRF_F0FF },
801 { "msdr", 0x3f, INSTR_RRF_F0FF },
802 { "lpxbr", 0x40, INSTR_RRE_FF },
803 { "lnxbr", 0x41, INSTR_RRE_FF },
804 { "ltxbr", 0x42, INSTR_RRE_FF },
805 { "lcxbr", 0x43, INSTR_RRE_FF },
806 { "ledbr", 0x44, INSTR_RRE_FF },
807 { "ldxbr", 0x45, INSTR_RRE_FF },
808 { "lexbr", 0x46, INSTR_RRE_FF },
809 { "fixbr", 0x47, INSTR_RRF_U0FF },
810 { "kxbr", 0x48, INSTR_RRE_FF },
811 { "cxbr", 0x49, INSTR_RRE_FF },
812 { "axbr", 0x4a, INSTR_RRE_FF },
813 { "sxbr", 0x4b, INSTR_RRE_FF },
814 { "mxbr", 0x4c, INSTR_RRE_FF },
815 { "dxbr", 0x4d, INSTR_RRE_FF },
816 { "tbedr", 0x50, INSTR_RRF_U0FF },
817 { "tbdr", 0x51, INSTR_RRF_U0FF },
818 { "diebr", 0x53, INSTR_RRF_FUFF },
819 { "fiebr", 0x57, INSTR_RRF_U0FF },
820 { "thder", 0x58, INSTR_RRE_RR },
821 { "thdr", 0x59, INSTR_RRE_RR },
822 { "didbr", 0x5b, INSTR_RRF_FUFF },
823 { "fidbr", 0x5f, INSTR_RRF_U0FF },
824 { "lpxr", 0x60, INSTR_RRE_FF },
825 { "lnxr", 0x61, INSTR_RRE_FF },
826 { "ltxr", 0x62, INSTR_RRE_FF },
827 { "lcxr", 0x63, INSTR_RRE_FF },
828 { "lxr", 0x65, INSTR_RRE_RR },
829 { "lexr", 0x66, INSTR_RRE_FF },
830 { "fixr", 0x67, INSTR_RRF_U0FF },
831 { "cxr", 0x69, INSTR_RRE_FF },
832 { "lzer", 0x74, INSTR_RRE_R0 },
833 { "lzdr", 0x75, INSTR_RRE_R0 },
834 { "lzxr", 0x76, INSTR_RRE_R0 },
835 { "fier", 0x77, INSTR_RRF_U0FF },
836 { "fidr", 0x7f, INSTR_RRF_U0FF },
837 { "sfpc", 0x84, INSTR_RRE_RR_OPT },
838 { "efpc", 0x8c, INSTR_RRE_RR_OPT },
839 { "cefbr", 0x94, INSTR_RRE_RF },
840 { "cdfbr", 0x95, INSTR_RRE_RF },
841 { "cxfbr", 0x96, INSTR_RRE_RF },
842 { "cfebr", 0x98, INSTR_RRF_U0RF },
843 { "cfdbr", 0x99, INSTR_RRF_U0RF },
844 { "cfxbr", 0x9a, INSTR_RRF_U0RF },
845 { "cefr", 0xb4, INSTR_RRE_RF },
846 { "cdfr", 0xb5, INSTR_RRE_RF },
847 { "cxfr", 0xb6, INSTR_RRE_RF },
848 { "", 0, INSTR_INVALID }
851 static struct insn opcode_b9[] = {
853 { "lpgr", 0x00, INSTR_RRE_RR },
854 { "lngr", 0x01, INSTR_RRE_RR },
855 { "ltgr", 0x02, INSTR_RRE_RR },
856 { "lcgr", 0x03, INSTR_RRE_RR },
857 { "lgr", 0x04, INSTR_RRE_RR },
858 { "lurag", 0x05, INSTR_RRE_RR },
859 { "lgbr", 0x06, INSTR_RRE_RR },
860 { "lghr", 0x07, INSTR_RRE_RR },
861 { "agr", 0x08, INSTR_RRE_RR },
862 { "sgr", 0x09, INSTR_RRE_RR },
863 { "algr", 0x0a, INSTR_RRE_RR },
864 { "slgr", 0x0b, INSTR_RRE_RR },
865 { "msgr", 0x0c, INSTR_RRE_RR },
866 { "dsgr", 0x0d, INSTR_RRE_RR },
867 { "eregg", 0x0e, INSTR_RRE_RR },
868 { "lrvgr", 0x0f, INSTR_RRE_RR },
869 { "lpgfr", 0x10, INSTR_RRE_RR },
870 { "lngfr", 0x11, INSTR_RRE_RR },
871 { "ltgfr", 0x12, INSTR_RRE_RR },
872 { "lcgfr", 0x13, INSTR_RRE_RR },
873 { "lgfr", 0x14, INSTR_RRE_RR },
874 { "llgfr", 0x16, INSTR_RRE_RR },
875 { "llgtr", 0x17, INSTR_RRE_RR },
876 { "agfr", 0x18, INSTR_RRE_RR },
877 { "sgfr", 0x19, INSTR_RRE_RR },
878 { "algfr", 0x1a, INSTR_RRE_RR },
879 { "slgfr", 0x1b, INSTR_RRE_RR },
880 { "msgfr", 0x1c, INSTR_RRE_RR },
881 { "dsgfr", 0x1d, INSTR_RRE_RR },
882 { "cgr", 0x20, INSTR_RRE_RR },
883 { "clgr", 0x21, INSTR_RRE_RR },
884 { "sturg", 0x25, INSTR_RRE_RR },
885 { "lbr", 0x26, INSTR_RRE_RR },
886 { "lhr", 0x27, INSTR_RRE_RR },
887 { "cgfr", 0x30, INSTR_RRE_RR },
888 { "clgfr", 0x31, INSTR_RRE_RR },
889 { "bctgr", 0x46, INSTR_RRE_RR },
890 { "ngr", 0x80, INSTR_RRE_RR },
891 { "ogr", 0x81, INSTR_RRE_RR },
892 { "xgr", 0x82, INSTR_RRE_RR },
893 { "flogr", 0x83, INSTR_RRE_RR },
894 { "llgcr", 0x84, INSTR_RRE_RR },
895 { "llghr", 0x85, INSTR_RRE_RR },
896 { "mlgr", 0x86, INSTR_RRE_RR },
897 { "dlgr", 0x87, INSTR_RRE_RR },
898 { "alcgr", 0x88, INSTR_RRE_RR },
899 { "slbgr", 0x89, INSTR_RRE_RR },
900 { "cspg", 0x8a, INSTR_RRE_RR },
901 { "idte", 0x8e, INSTR_RRF_R0RR },
902 { "llcr", 0x94, INSTR_RRE_RR },
903 { "llhr", 0x95, INSTR_RRE_RR },
904 { "esea", 0x9d, INSTR_RRE_R0 },
905 { "lptea", 0xaa, INSTR_RRF_RURR },
906 { "cu14", 0xb0, INSTR_RRF_M0RR },
907 { "cu24", 0xb1, INSTR_RRF_M0RR },
908 { "cu41", 0xb2, INSTR_RRF_M0RR },
909 { "cu42", 0xb3, INSTR_RRF_M0RR },
910 { "crt", 0x72, INSTR_RRF_U0RR },
911 { "cgrt", 0x60, INSTR_RRF_U0RR },
912 { "clrt", 0x73, INSTR_RRF_U0RR },
913 { "clgrt", 0x61, INSTR_RRF_U0RR },
914 { "ptf", 0xa2, INSTR_RRE_R0 },
915 { "pfmf", 0xaf, INSTR_RRE_RR },
916 { "trte", 0xbf, INSTR_RRF_M0RR },
917 { "trtre", 0xbd, INSTR_RRF_M0RR },
918 { "ahhhr", 0xc8, INSTR_RRF_R0RR2 },
919 { "shhhr", 0xc9, INSTR_RRF_R0RR2 },
920 { "alhhh", 0xca, INSTR_RRF_R0RR2 },
921 { "alhhl", 0xca, INSTR_RRF_R0RR2 },
922 { "slhhh", 0xcb, INSTR_RRF_R0RR2 },
923 { "chhr ", 0xcd, INSTR_RRE_RR },
924 { "clhhr", 0xcf, INSTR_RRE_RR },
925 { "ahhlr", 0xd8, INSTR_RRF_R0RR2 },
926 { "shhlr", 0xd9, INSTR_RRF_R0RR2 },
927 { "slhhl", 0xdb, INSTR_RRF_R0RR2 },
928 { "chlr", 0xdd, INSTR_RRE_RR },
929 { "clhlr", 0xdf, INSTR_RRE_RR },
930 { { 0, LONG_INSN_POPCNT }, 0xe1, INSTR_RRE_RR },
931 { "locgr", 0xe2, INSTR_RRF_M0RR },
932 { "ngrk", 0xe4, INSTR_RRF_R0RR2 },
933 { "ogrk", 0xe6, INSTR_RRF_R0RR2 },
934 { "xgrk", 0xe7, INSTR_RRF_R0RR2 },
935 { "agrk", 0xe8, INSTR_RRF_R0RR2 },
936 { "sgrk", 0xe9, INSTR_RRF_R0RR2 },
937 { "algrk", 0xea, INSTR_RRF_R0RR2 },
938 { "slgrk", 0xeb, INSTR_RRF_R0RR2 },
939 { "locr", 0xf2, INSTR_RRF_M0RR },
940 { "nrk", 0xf4, INSTR_RRF_R0RR2 },
941 { "ork", 0xf6, INSTR_RRF_R0RR2 },
942 { "xrk", 0xf7, INSTR_RRF_R0RR2 },
943 { "ark", 0xf8, INSTR_RRF_R0RR2 },
944 { "srk", 0xf9, INSTR_RRF_R0RR2 },
945 { "alrk", 0xfa, INSTR_RRF_R0RR2 },
946 { "slrk", 0xfb, INSTR_RRF_R0RR2 },
948 { "kmac", 0x1e, INSTR_RRE_RR },
949 { "lrvr", 0x1f, INSTR_RRE_RR },
950 { "km", 0x2e, INSTR_RRE_RR },
951 { "kmc", 0x2f, INSTR_RRE_RR },
952 { "kimd", 0x3e, INSTR_RRE_RR },
953 { "klmd", 0x3f, INSTR_RRE_RR },
954 { "epsw", 0x8d, INSTR_RRE_RR },
955 { "trtt", 0x90, INSTR_RRE_RR },
956 { "trtt", 0x90, INSTR_RRF_M0RR },
957 { "trto", 0x91, INSTR_RRE_RR },
958 { "trto", 0x91, INSTR_RRF_M0RR },
959 { "trot", 0x92, INSTR_RRE_RR },
960 { "trot", 0x92, INSTR_RRF_M0RR },
961 { "troo", 0x93, INSTR_RRE_RR },
962 { "troo", 0x93, INSTR_RRF_M0RR },
963 { "mlr", 0x96, INSTR_RRE_RR },
964 { "dlr", 0x97, INSTR_RRE_RR },
965 { "alcr", 0x98, INSTR_RRE_RR },
966 { "slbr", 0x99, INSTR_RRE_RR },
967 { "", 0, INSTR_INVALID }
970 static struct insn opcode_c0[] = {
972 { "lgfi", 0x01, INSTR_RIL_RI },
973 { "xihf", 0x06, INSTR_RIL_RU },
974 { "xilf", 0x07, INSTR_RIL_RU },
975 { "iihf", 0x08, INSTR_RIL_RU },
976 { "iilf", 0x09, INSTR_RIL_RU },
977 { "nihf", 0x0a, INSTR_RIL_RU },
978 { "nilf", 0x0b, INSTR_RIL_RU },
979 { "oihf", 0x0c, INSTR_RIL_RU },
980 { "oilf", 0x0d, INSTR_RIL_RU },
981 { "llihf", 0x0e, INSTR_RIL_RU },
982 { "llilf", 0x0f, INSTR_RIL_RU },
984 { "larl", 0x00, INSTR_RIL_RP },
985 { "brcl", 0x04, INSTR_RIL_UP },
986 { "brasl", 0x05, INSTR_RIL_RP },
987 { "", 0, INSTR_INVALID }
990 static struct insn opcode_c2[] = {
992 { "slgfi", 0x04, INSTR_RIL_RU },
993 { "slfi", 0x05, INSTR_RIL_RU },
994 { "agfi", 0x08, INSTR_RIL_RI },
995 { "afi", 0x09, INSTR_RIL_RI },
996 { "algfi", 0x0a, INSTR_RIL_RU },
997 { "alfi", 0x0b, INSTR_RIL_RU },
998 { "cgfi", 0x0c, INSTR_RIL_RI },
999 { "cfi", 0x0d, INSTR_RIL_RI },
1000 { "clgfi", 0x0e, INSTR_RIL_RU },
1001 { "clfi", 0x0f, INSTR_RIL_RU },
1002 { "msfi", 0x01, INSTR_RIL_RI },
1003 { "msgfi", 0x00, INSTR_RIL_RI },
1005 { "", 0, INSTR_INVALID }
1008 static struct insn opcode_c4[] = {
1010 { "lrl", 0x0d, INSTR_RIL_RP },
1011 { "lgrl", 0x08, INSTR_RIL_RP },
1012 { "lgfrl", 0x0c, INSTR_RIL_RP },
1013 { "lhrl", 0x05, INSTR_RIL_RP },
1014 { "lghrl", 0x04, INSTR_RIL_RP },
1015 { { 0, LONG_INSN_LLGFRL }, 0x0e, INSTR_RIL_RP },
1016 { "llhrl", 0x02, INSTR_RIL_RP },
1017 { { 0, LONG_INSN_LLGHRL }, 0x06, INSTR_RIL_RP },
1018 { "strl", 0x0f, INSTR_RIL_RP },
1019 { "stgrl", 0x0b, INSTR_RIL_RP },
1020 { "sthrl", 0x07, INSTR_RIL_RP },
1022 { "", 0, INSTR_INVALID }
1025 static struct insn opcode_c6[] = {
1027 { "crl", 0x0d, INSTR_RIL_RP },
1028 { "cgrl", 0x08, INSTR_RIL_RP },
1029 { "cgfrl", 0x0c, INSTR_RIL_RP },
1030 { "chrl", 0x05, INSTR_RIL_RP },
1031 { "cghrl", 0x04, INSTR_RIL_RP },
1032 { "clrl", 0x0f, INSTR_RIL_RP },
1033 { "clgrl", 0x0a, INSTR_RIL_RP },
1034 { { 0, LONG_INSN_CLGFRL }, 0x0e, INSTR_RIL_RP },
1035 { "clhrl", 0x07, INSTR_RIL_RP },
1036 { { 0, LONG_INSN_CLGHRL }, 0x06, INSTR_RIL_RP },
1037 { "pfdrl", 0x02, INSTR_RIL_UP },
1038 { "exrl", 0x00, INSTR_RIL_RP },
1040 { "", 0, INSTR_INVALID }
1043 static struct insn opcode_c8[] = {
1045 { "mvcos", 0x00, INSTR_SSF_RRDRD },
1046 { "ectg", 0x01, INSTR_SSF_RRDRD },
1047 { "csst", 0x02, INSTR_SSF_RRDRD },
1048 { "lpd", 0x04, INSTR_SSF_RRDRD2 },
1049 { "lpdg ", 0x05, INSTR_SSF_RRDRD2 },
1051 { "", 0, INSTR_INVALID }
1054 static struct insn opcode_cc[] = {
1056 { "brcth", 0x06, INSTR_RIL_RP },
1057 { "aih", 0x08, INSTR_RIL_RI },
1058 { "alsih", 0x0a, INSTR_RIL_RI },
1059 { "alsih", 0x0b, INSTR_RIL_RI },
1060 { "cih", 0x0d, INSTR_RIL_RI },
1061 { "clih ", 0x0f, INSTR_RIL_RI },
1063 { "", 0, INSTR_INVALID }
1066 static struct insn opcode_e3[] = {
1068 { "ltg", 0x02, INSTR_RXY_RRRD },
1069 { "lrag", 0x03, INSTR_RXY_RRRD },
1070 { "lg", 0x04, INSTR_RXY_RRRD },
1071 { "cvby", 0x06, INSTR_RXY_RRRD },
1072 { "ag", 0x08, INSTR_RXY_RRRD },
1073 { "sg", 0x09, INSTR_RXY_RRRD },
1074 { "alg", 0x0a, INSTR_RXY_RRRD },
1075 { "slg", 0x0b, INSTR_RXY_RRRD },
1076 { "msg", 0x0c, INSTR_RXY_RRRD },
1077 { "dsg", 0x0d, INSTR_RXY_RRRD },
1078 { "cvbg", 0x0e, INSTR_RXY_RRRD },
1079 { "lrvg", 0x0f, INSTR_RXY_RRRD },
1080 { "lt", 0x12, INSTR_RXY_RRRD },
1081 { "lray", 0x13, INSTR_RXY_RRRD },
1082 { "lgf", 0x14, INSTR_RXY_RRRD },
1083 { "lgh", 0x15, INSTR_RXY_RRRD },
1084 { "llgf", 0x16, INSTR_RXY_RRRD },
1085 { "llgt", 0x17, INSTR_RXY_RRRD },
1086 { "agf", 0x18, INSTR_RXY_RRRD },
1087 { "sgf", 0x19, INSTR_RXY_RRRD },
1088 { "algf", 0x1a, INSTR_RXY_RRRD },
1089 { "slgf", 0x1b, INSTR_RXY_RRRD },
1090 { "msgf", 0x1c, INSTR_RXY_RRRD },
1091 { "dsgf", 0x1d, INSTR_RXY_RRRD },
1092 { "cg", 0x20, INSTR_RXY_RRRD },
1093 { "clg", 0x21, INSTR_RXY_RRRD },
1094 { "stg", 0x24, INSTR_RXY_RRRD },
1095 { "cvdy", 0x26, INSTR_RXY_RRRD },
1096 { "cvdg", 0x2e, INSTR_RXY_RRRD },
1097 { "strvg", 0x2f, INSTR_RXY_RRRD },
1098 { "cgf", 0x30, INSTR_RXY_RRRD },
1099 { "clgf", 0x31, INSTR_RXY_RRRD },
1100 { "strvh", 0x3f, INSTR_RXY_RRRD },
1101 { "bctg", 0x46, INSTR_RXY_RRRD },
1102 { "sty", 0x50, INSTR_RXY_RRRD },
1103 { "msy", 0x51, INSTR_RXY_RRRD },
1104 { "ny", 0x54, INSTR_RXY_RRRD },
1105 { "cly", 0x55, INSTR_RXY_RRRD },
1106 { "oy", 0x56, INSTR_RXY_RRRD },
1107 { "xy", 0x57, INSTR_RXY_RRRD },
1108 { "ly", 0x58, INSTR_RXY_RRRD },
1109 { "cy", 0x59, INSTR_RXY_RRRD },
1110 { "ay", 0x5a, INSTR_RXY_RRRD },
1111 { "sy", 0x5b, INSTR_RXY_RRRD },
1112 { "aly", 0x5e, INSTR_RXY_RRRD },
1113 { "sly", 0x5f, INSTR_RXY_RRRD },
1114 { "sthy", 0x70, INSTR_RXY_RRRD },
1115 { "lay", 0x71, INSTR_RXY_RRRD },
1116 { "stcy", 0x72, INSTR_RXY_RRRD },
1117 { "icy", 0x73, INSTR_RXY_RRRD },
1118 { "lb", 0x76, INSTR_RXY_RRRD },
1119 { "lgb", 0x77, INSTR_RXY_RRRD },
1120 { "lhy", 0x78, INSTR_RXY_RRRD },
1121 { "chy", 0x79, INSTR_RXY_RRRD },
1122 { "ahy", 0x7a, INSTR_RXY_RRRD },
1123 { "shy", 0x7b, INSTR_RXY_RRRD },
1124 { "ng", 0x80, INSTR_RXY_RRRD },
1125 { "og", 0x81, INSTR_RXY_RRRD },
1126 { "xg", 0x82, INSTR_RXY_RRRD },
1127 { "mlg", 0x86, INSTR_RXY_RRRD },
1128 { "dlg", 0x87, INSTR_RXY_RRRD },
1129 { "alcg", 0x88, INSTR_RXY_RRRD },
1130 { "slbg", 0x89, INSTR_RXY_RRRD },
1131 { "stpq", 0x8e, INSTR_RXY_RRRD },
1132 { "lpq", 0x8f, INSTR_RXY_RRRD },
1133 { "llgc", 0x90, INSTR_RXY_RRRD },
1134 { "llgh", 0x91, INSTR_RXY_RRRD },
1135 { "llc", 0x94, INSTR_RXY_RRRD },
1136 { "llh", 0x95, INSTR_RXY_RRRD },
1137 { "cgh", 0x34, INSTR_RXY_RRRD },
1138 { "laey", 0x75, INSTR_RXY_RRRD },
1139 { "ltgf", 0x32, INSTR_RXY_RRRD },
1140 { "mfy", 0x5c, INSTR_RXY_RRRD },
1141 { "mhy", 0x7c, INSTR_RXY_RRRD },
1142 { "pfd", 0x36, INSTR_RXY_URRD },
1143 { "lbh", 0xc0, INSTR_RXY_RRRD },
1144 { "llch", 0xc2, INSTR_RXY_RRRD },
1145 { "stch", 0xc3, INSTR_RXY_RRRD },
1146 { "lhh", 0xc4, INSTR_RXY_RRRD },
1147 { "llhh", 0xc6, INSTR_RXY_RRRD },
1148 { "sthh", 0xc7, INSTR_RXY_RRRD },
1149 { "lfh", 0xca, INSTR_RXY_RRRD },
1150 { "stfh", 0xcb, INSTR_RXY_RRRD },
1151 { "chf", 0xcd, INSTR_RXY_RRRD },
1152 { "clhf", 0xcf, INSTR_RXY_RRRD },
1154 { "lrv", 0x1e, INSTR_RXY_RRRD },
1155 { "lrvh", 0x1f, INSTR_RXY_RRRD },
1156 { "strv", 0x3e, INSTR_RXY_RRRD },
1157 { "ml", 0x96, INSTR_RXY_RRRD },
1158 { "dl", 0x97, INSTR_RXY_RRRD },
1159 { "alc", 0x98, INSTR_RXY_RRRD },
1160 { "slb", 0x99, INSTR_RXY_RRRD },
1161 { "", 0, INSTR_INVALID }
1164 static struct insn opcode_e5[] = {
1166 { "strag", 0x02, INSTR_SSE_RDRD },
1167 { "chhsi", 0x54, INSTR_SIL_RDI },
1168 { "chsi", 0x5c, INSTR_SIL_RDI },
1169 { "cghsi", 0x58, INSTR_SIL_RDI },
1170 { { 0, LONG_INSN_CLHHSI }, 0x55, INSTR_SIL_RDU },
1171 { { 0, LONG_INSN_CLFHSI }, 0x5d, INSTR_SIL_RDU },
1172 { { 0, LONG_INSN_CLGHSI }, 0x59, INSTR_SIL_RDU },
1173 { "mvhhi", 0x44, INSTR_SIL_RDI },
1174 { "mvhi", 0x4c, INSTR_SIL_RDI },
1175 { "mvghi", 0x48, INSTR_SIL_RDI },
1177 { "lasp", 0x00, INSTR_SSE_RDRD },
1178 { "tprot", 0x01, INSTR_SSE_RDRD },
1179 { "mvcsk", 0x0e, INSTR_SSE_RDRD },
1180 { "mvcdk", 0x0f, INSTR_SSE_RDRD },
1181 { "", 0, INSTR_INVALID }
1184 static struct insn opcode_eb[] = {
1186 { "lmg", 0x04, INSTR_RSY_RRRD },
1187 { "srag", 0x0a, INSTR_RSY_RRRD },
1188 { "slag", 0x0b, INSTR_RSY_RRRD },
1189 { "srlg", 0x0c, INSTR_RSY_RRRD },
1190 { "sllg", 0x0d, INSTR_RSY_RRRD },
1191 { "tracg", 0x0f, INSTR_RSY_RRRD },
1192 { "csy", 0x14, INSTR_RSY_RRRD },
1193 { "rllg", 0x1c, INSTR_RSY_RRRD },
1194 { "clmh", 0x20, INSTR_RSY_RURD },
1195 { "clmy", 0x21, INSTR_RSY_RURD },
1196 { "stmg", 0x24, INSTR_RSY_RRRD },
1197 { "stctg", 0x25, INSTR_RSY_CCRD },
1198 { "stmh", 0x26, INSTR_RSY_RRRD },
1199 { "stcmh", 0x2c, INSTR_RSY_RURD },
1200 { "stcmy", 0x2d, INSTR_RSY_RURD },
1201 { "lctlg", 0x2f, INSTR_RSY_CCRD },
1202 { "csg", 0x30, INSTR_RSY_RRRD },
1203 { "cdsy", 0x31, INSTR_RSY_RRRD },
1204 { "cdsg", 0x3e, INSTR_RSY_RRRD },
1205 { "bxhg", 0x44, INSTR_RSY_RRRD },
1206 { "bxleg", 0x45, INSTR_RSY_RRRD },
1207 { "tmy", 0x51, INSTR_SIY_URD },
1208 { "mviy", 0x52, INSTR_SIY_URD },
1209 { "niy", 0x54, INSTR_SIY_URD },
1210 { "cliy", 0x55, INSTR_SIY_URD },
1211 { "oiy", 0x56, INSTR_SIY_URD },
1212 { "xiy", 0x57, INSTR_SIY_URD },
1213 { "icmh", 0x80, INSTR_RSE_RURD },
1214 { "icmh", 0x80, INSTR_RSY_RURD },
1215 { "icmy", 0x81, INSTR_RSY_RURD },
1216 { "clclu", 0x8f, INSTR_RSY_RRRD },
1217 { "stmy", 0x90, INSTR_RSY_RRRD },
1218 { "lmh", 0x96, INSTR_RSY_RRRD },
1219 { "lmy", 0x98, INSTR_RSY_RRRD },
1220 { "lamy", 0x9a, INSTR_RSY_AARD },
1221 { "stamy", 0x9b, INSTR_RSY_AARD },
1222 { "asi", 0x6a, INSTR_SIY_IRD },
1223 { "agsi", 0x7a, INSTR_SIY_IRD },
1224 { "alsi", 0x6e, INSTR_SIY_IRD },
1225 { "algsi", 0x7e, INSTR_SIY_IRD },
1226 { "ecag", 0x4c, INSTR_RSY_RRRD },
1227 { "srak", 0xdc, INSTR_RSY_RRRD },
1228 { "slak", 0xdd, INSTR_RSY_RRRD },
1229 { "srlk", 0xde, INSTR_RSY_RRRD },
1230 { "sllk", 0xdf, INSTR_RSY_RRRD },
1231 { "locg", 0xe2, INSTR_RSY_RDRM },
1232 { "stocg", 0xe3, INSTR_RSY_RDRM },
1233 { "lang", 0xe4, INSTR_RSY_RRRD },
1234 { "laog", 0xe6, INSTR_RSY_RRRD },
1235 { "laxg", 0xe7, INSTR_RSY_RRRD },
1236 { "laag", 0xe8, INSTR_RSY_RRRD },
1237 { "laalg", 0xea, INSTR_RSY_RRRD },
1238 { "loc", 0xf2, INSTR_RSY_RDRM },
1239 { "stoc", 0xf3, INSTR_RSY_RDRM },
1240 { "lan", 0xf4, INSTR_RSY_RRRD },
1241 { "lao", 0xf6, INSTR_RSY_RRRD },
1242 { "lax", 0xf7, INSTR_RSY_RRRD },
1243 { "laa", 0xf8, INSTR_RSY_RRRD },
1244 { "laal", 0xfa, INSTR_RSY_RRRD },
1246 { "rll", 0x1d, INSTR_RSY_RRRD },
1247 { "mvclu", 0x8e, INSTR_RSY_RRRD },
1248 { "tp", 0xc0, INSTR_RSL_R0RD },
1249 { "", 0, INSTR_INVALID }
1252 static struct insn opcode_ec[] = {
1254 { "brxhg", 0x44, INSTR_RIE_RRP },
1255 { "brxlg", 0x45, INSTR_RIE_RRP },
1256 { "crb", 0xf6, INSTR_RRS_RRRDU },
1257 { "cgrb", 0xe4, INSTR_RRS_RRRDU },
1258 { "crj", 0x76, INSTR_RIE_RRPU },
1259 { "cgrj", 0x64, INSTR_RIE_RRPU },
1260 { "cib", 0xfe, INSTR_RIS_RURDI },
1261 { "cgib", 0xfc, INSTR_RIS_RURDI },
1262 { "cij", 0x7e, INSTR_RIE_RUPI },
1263 { "cgij", 0x7c, INSTR_RIE_RUPI },
1264 { "cit", 0x72, INSTR_RIE_R0IU },
1265 { "cgit", 0x70, INSTR_RIE_R0IU },
1266 { "clrb", 0xf7, INSTR_RRS_RRRDU },
1267 { "clgrb", 0xe5, INSTR_RRS_RRRDU },
1268 { "clrj", 0x77, INSTR_RIE_RRPU },
1269 { "clgrj", 0x65, INSTR_RIE_RRPU },
1270 { "clib", 0xff, INSTR_RIS_RURDU },
1271 { "clgib", 0xfd, INSTR_RIS_RURDU },
1272 { "clij", 0x7f, INSTR_RIE_RUPU },
1273 { "clgij", 0x7d, INSTR_RIE_RUPU },
1274 { "clfit", 0x73, INSTR_RIE_R0UU },
1275 { "clgit", 0x71, INSTR_RIE_R0UU },
1276 { "rnsbg", 0x54, INSTR_RIE_RRUUU },
1277 { "rxsbg", 0x57, INSTR_RIE_RRUUU },
1278 { "rosbg", 0x56, INSTR_RIE_RRUUU },
1279 { "risbg", 0x55, INSTR_RIE_RRUUU },
1280 { { 0, LONG_INSN_RISBLG }, 0x51, INSTR_RIE_RRUUU },
1281 { { 0, LONG_INSN_RISBHG }, 0x5D, INSTR_RIE_RRUUU },
1282 { "ahik", 0xd8, INSTR_RIE_RRI0 },
1283 { "aghik", 0xd9, INSTR_RIE_RRI0 },
1284 { { 0, LONG_INSN_ALHSIK }, 0xda, INSTR_RIE_RRI0 },
1285 { { 0, LONG_INSN_ALGHSIK }, 0xdb, INSTR_RIE_RRI0 },
1287 { "", 0, INSTR_INVALID }
1290 static struct insn opcode_ed[] = {
1292 { "mayl", 0x38, INSTR_RXF_FRRDF },
1293 { "myl", 0x39, INSTR_RXF_FRRDF },
1294 { "may", 0x3a, INSTR_RXF_FRRDF },
1295 { "my", 0x3b, INSTR_RXF_FRRDF },
1296 { "mayh", 0x3c, INSTR_RXF_FRRDF },
1297 { "myh", 0x3d, INSTR_RXF_FRRDF },
1298 { "ley", 0x64, INSTR_RXY_FRRD },
1299 { "ldy", 0x65, INSTR_RXY_FRRD },
1300 { "stey", 0x66, INSTR_RXY_FRRD },
1301 { "stdy", 0x67, INSTR_RXY_FRRD },
1302 { "sldt", 0x40, INSTR_RXF_FRRDF },
1303 { "slxt", 0x48, INSTR_RXF_FRRDF },
1304 { "srdt", 0x41, INSTR_RXF_FRRDF },
1305 { "srxt", 0x49, INSTR_RXF_FRRDF },
1306 { "tdcet", 0x50, INSTR_RXE_FRRD },
1307 { "tdcdt", 0x54, INSTR_RXE_FRRD },
1308 { "tdcxt", 0x58, INSTR_RXE_FRRD },
1309 { "tdget", 0x51, INSTR_RXE_FRRD },
1310 { "tdgdt", 0x55, INSTR_RXE_FRRD },
1311 { "tdgxt", 0x59, INSTR_RXE_FRRD },
1313 { "ldeb", 0x04, INSTR_RXE_FRRD },
1314 { "lxdb", 0x05, INSTR_RXE_FRRD },
1315 { "lxeb", 0x06, INSTR_RXE_FRRD },
1316 { "mxdb", 0x07, INSTR_RXE_FRRD },
1317 { "keb", 0x08, INSTR_RXE_FRRD },
1318 { "ceb", 0x09, INSTR_RXE_FRRD },
1319 { "aeb", 0x0a, INSTR_RXE_FRRD },
1320 { "seb", 0x0b, INSTR_RXE_FRRD },
1321 { "mdeb", 0x0c, INSTR_RXE_FRRD },
1322 { "deb", 0x0d, INSTR_RXE_FRRD },
1323 { "maeb", 0x0e, INSTR_RXF_FRRDF },
1324 { "mseb", 0x0f, INSTR_RXF_FRRDF },
1325 { "tceb", 0x10, INSTR_RXE_FRRD },
1326 { "tcdb", 0x11, INSTR_RXE_FRRD },
1327 { "tcxb", 0x12, INSTR_RXE_FRRD },
1328 { "sqeb", 0x14, INSTR_RXE_FRRD },
1329 { "sqdb", 0x15, INSTR_RXE_FRRD },
1330 { "meeb", 0x17, INSTR_RXE_FRRD },
1331 { "kdb", 0x18, INSTR_RXE_FRRD },
1332 { "cdb", 0x19, INSTR_RXE_FRRD },
1333 { "adb", 0x1a, INSTR_RXE_FRRD },
1334 { "sdb", 0x1b, INSTR_RXE_FRRD },
1335 { "mdb", 0x1c, INSTR_RXE_FRRD },
1336 { "ddb", 0x1d, INSTR_RXE_FRRD },
1337 { "madb", 0x1e, INSTR_RXF_FRRDF },
1338 { "msdb", 0x1f, INSTR_RXF_FRRDF },
1339 { "lde", 0x24, INSTR_RXE_FRRD },
1340 { "lxd", 0x25, INSTR_RXE_FRRD },
1341 { "lxe", 0x26, INSTR_RXE_FRRD },
1342 { "mae", 0x2e, INSTR_RXF_FRRDF },
1343 { "mse", 0x2f, INSTR_RXF_FRRDF },
1344 { "sqe", 0x34, INSTR_RXE_FRRD },
1345 { "sqd", 0x35, INSTR_RXE_FRRD },
1346 { "mee", 0x37, INSTR_RXE_FRRD },
1347 { "mad", 0x3e, INSTR_RXF_FRRDF },
1348 { "msd", 0x3f, INSTR_RXF_FRRDF },
1349 { "", 0, INSTR_INVALID }
1352 /* Extracts an operand value from an instruction. */
1353 static unsigned int extract_operand(unsigned char *code,
1354 const struct operand *operand)
1359 /* Extract fragments of the operand byte for byte. */
1360 code += operand->shift / 8;
1361 bits = (operand->shift & 7) + operand->bits;
1365 val |= (unsigned int) *code++;
1369 val &= ((1U << (operand->bits - 1)) << 1) - 1;
1371 /* Check for special long displacement case. */
1372 if (operand->bits == 20 && operand->shift == 20)
1373 val = (val & 0xff) << 12 | (val & 0xfff00) >> 8;
1375 /* Sign extend value if the operand is signed or pc relative. */
1376 if ((operand->flags & (OPERAND_SIGNED | OPERAND_PCREL)) &&
1377 (val & (1U << (operand->bits - 1))))
1378 val |= (-1U << (operand->bits - 1)) << 1;
1380 /* Double value if the operand is pc relative. */
1381 if (operand->flags & OPERAND_PCREL)
1384 /* Length x in an instructions has real length x + 1. */
1385 if (operand->flags & OPERAND_LENGTH)
1390 static inline int insn_length(unsigned char code)
1392 return ((((int) code + 64) >> 7) + 1) << 1;
1395 static struct insn *find_insn(unsigned char *code)
1397 unsigned char opfrag = code[1];
1398 unsigned char opmask;
1462 while (table->format != INSTR_INVALID) {
1463 opmask = formats[table->format][0];
1464 if (table->opfrag == (opfrag & opmask))
1471 static int print_insn(char *buffer, unsigned char *code, unsigned long addr)
1474 const unsigned char *ops;
1475 const struct operand *operand;
1482 insn = find_insn(code);
1484 if (insn->name[0] == '\0')
1485 ptr += sprintf(ptr, "%s\t",
1486 long_insn_name[(int) insn->name[1]]);
1488 ptr += sprintf(ptr, "%.5s\t", insn->name);
1489 /* Extract the operands. */
1491 for (ops = formats[insn->format] + 1, i = 0;
1492 *ops != 0 && i < 6; ops++, i++) {
1493 operand = operands + *ops;
1494 value = extract_operand(code, operand);
1495 if ((operand->flags & OPERAND_INDEX) && value == 0)
1497 if ((operand->flags & OPERAND_BASE) &&
1498 value == 0 && separator == '(') {
1503 ptr += sprintf(ptr, "%c", separator);
1504 if (operand->flags & OPERAND_GPR)
1505 ptr += sprintf(ptr, "%%r%i", value);
1506 else if (operand->flags & OPERAND_FPR)
1507 ptr += sprintf(ptr, "%%f%i", value);
1508 else if (operand->flags & OPERAND_AR)
1509 ptr += sprintf(ptr, "%%a%i", value);
1510 else if (operand->flags & OPERAND_CR)
1511 ptr += sprintf(ptr, "%%c%i", value);
1512 else if (operand->flags & OPERAND_PCREL)
1513 ptr += sprintf(ptr, "%lx", (signed int) value
1515 else if (operand->flags & OPERAND_SIGNED)
1516 ptr += sprintf(ptr, "%i", value);
1518 ptr += sprintf(ptr, "%u", value);
1519 if (operand->flags & OPERAND_DISP)
1521 else if (operand->flags & OPERAND_BASE) {
1522 ptr += sprintf(ptr, ")");
1528 ptr += sprintf(ptr, "unknown");
1529 return (int) (ptr - buffer);
1532 void show_code(struct pt_regs *regs)
1534 char *mode = user_mode(regs) ? "User" : "Krnl";
1535 unsigned char code[64];
1536 char buffer[64], *ptr;
1537 mm_segment_t old_fs;
1539 int start, end, opsize, hops, i;
1541 /* Get a snapshot of the 64 bytes surrounding the fault address. */
1543 set_fs(user_mode(regs) ? USER_DS : KERNEL_DS);
1544 for (start = 32; start && regs->psw.addr >= 34 - start; start -= 2) {
1545 addr = regs->psw.addr - 34 + start;
1546 if (__copy_from_user(code + start - 2,
1547 (char __user *) addr, 2))
1550 for (end = 32; end < 64; end += 2) {
1551 addr = regs->psw.addr + end - 32;
1552 if (__copy_from_user(code + end,
1553 (char __user *) addr, 2))
1557 /* Code snapshot useable ? */
1558 if ((regs->psw.addr & 1) || start >= end) {
1559 printk("%s Code: Bad PSW.\n", mode);
1562 /* Find a starting point for the disassembly. */
1563 while (start < 32) {
1564 for (i = 0, hops = 0; start + i < 32 && hops < 3; hops++) {
1565 if (!find_insn(code + start + i))
1567 i += insn_length(code[start + i]);
1569 if (start + i == 32)
1570 /* Looks good, sequence ends at PSW. */
1574 /* Decode the instructions. */
1576 ptr += sprintf(ptr, "%s Code:", mode);
1578 while (start < end && hops < 8) {
1579 opsize = insn_length(code[start]);
1580 if (start + opsize == 32)
1582 else if (start == 32)
1586 addr = regs->psw.addr + start - 32;
1587 ptr += sprintf(ptr, ONELONG, addr);
1588 if (start + opsize >= end)
1590 for (i = 0; i < opsize; i++)
1591 ptr += sprintf(ptr, "%02x", code[start + i]);
1595 ptr += print_insn(ptr, code + start, addr);
1599 ptr += sprintf(ptr, "\n ");