1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
5 This file is part of the GNU opcodes library.
7 This library 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, or (at your option)
12 It is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
15 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,
20 MA 02110-1301, USA. */
23 /* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
25 modified by John Hassey (hassey@dg-rtp.dg.com)
26 x86-64 support added by Jan Hubicka (jh@suse.cz)
27 VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */
29 /* The main tables describing the instructions is essentially a copy
30 of the "Opcode Map" chapter (Appendix A) of the Intel 80386
31 Programmers Manual. Usually, there is a capital letter, followed
32 by a small letter. The capital letter tell the addressing mode,
33 and the small letter tells about the operand size. Refer to
34 the Intel manual for details. */
39 #include "opcode/i386.h"
40 #include "libiberty.h"
44 static int fetch_data (struct disassemble_info *, bfd_byte *);
45 static void ckprefix (void);
46 static const char *prefix_name (int, int);
47 static int print_insn (bfd_vma, disassemble_info *);
48 static void dofloat (int);
49 static void OP_ST (int, int);
50 static void OP_STi (int, int);
51 static int putop (const char *, int);
52 static void oappend (const char *);
53 static void append_seg (void);
54 static void OP_indirE (int, int);
55 static void print_operand_value (char *, int, bfd_vma);
56 static void OP_E_extended (int, int, int);
57 static void print_displacement (char *, bfd_vma);
58 static void OP_E (int, int);
59 static void OP_G (int, int);
60 static bfd_vma get64 (void);
61 static bfd_signed_vma get32 (void);
62 static bfd_signed_vma get32s (void);
63 static int get16 (void);
64 static void set_op (bfd_vma, int);
65 static void OP_Skip_MODRM (int, int);
66 static void OP_REG (int, int);
67 static void OP_IMREG (int, int);
68 static void OP_I (int, int);
69 static void OP_I64 (int, int);
70 static void OP_sI (int, int);
71 static void OP_J (int, int);
72 static void OP_SEG (int, int);
73 static void OP_DIR (int, int);
74 static void OP_OFF (int, int);
75 static void OP_OFF64 (int, int);
76 static void ptr_reg (int, int);
77 static void OP_ESreg (int, int);
78 static void OP_DSreg (int, int);
79 static void OP_C (int, int);
80 static void OP_D (int, int);
81 static void OP_T (int, int);
82 static void OP_R (int, int);
83 static void OP_MMX (int, int);
84 static void OP_XMM (int, int);
85 static void OP_EM (int, int);
86 static void OP_EX (int, int);
87 static void OP_EMC (int,int);
88 static void OP_MXC (int,int);
89 static void OP_MS (int, int);
90 static void OP_XS (int, int);
91 static void OP_M (int, int);
92 static void OP_0f07 (int, int);
93 static void OP_Monitor (int, int);
94 static void OP_Mwait (int, int);
95 static void NOP_Fixup1 (int, int);
96 static void NOP_Fixup2 (int, int);
97 static void OP_3DNowSuffix (int, int);
98 static void CMP_Fixup (int, int);
99 static void BadOp (void);
100 static void REP_Fixup (int, int);
101 static void CMPXCHG8B_Fixup (int, int);
102 static void XMM_Fixup (int, int);
103 static void CRC32_Fixup (int, int);
104 static void print_drex_arg (unsigned int, int, int);
105 static void OP_DREX4 (int, int);
106 static void OP_DREX3 (int, int);
107 static void OP_DREX_ICMP (int, int);
108 static void OP_DREX_FCMP (int, int);
111 /* Points to first byte not fetched. */
112 bfd_byte *max_fetched;
113 bfd_byte the_buffer[MAX_MNEM_SIZE];
126 enum address_mode address_mode;
128 /* Flags for the prefixes for the current instruction. See below. */
131 /* REX prefix the current instruction. See below. */
133 /* Bits of REX we've already used. */
135 /* Mark parts used in the REX prefix. When we are testing for
136 empty prefix (for 8bit register REX extension), just mask it
137 out. Otherwise test for REX bit is excuse for existence of REX
138 only in case value is nonzero. */
139 #define USED_REX(value) \
144 rex_used |= (value) | REX_OPCODE; \
147 rex_used |= REX_OPCODE; \
150 /* Special 'registers' for DREX handling */
151 #define DREX_REG_UNKNOWN 1000 /* not initialized */
152 #define DREX_REG_MEMORY 1001 /* use MODRM/SIB/OFFSET memory */
154 /* The DREX byte has the following fields:
155 Bits 7-4 -- DREX.Dest, xmm destination register
156 Bit 3 -- DREX.OC0, operand config bit defines operand order
157 Bit 2 -- DREX.R, equivalent to REX_R bit, to extend ModRM register
158 Bit 1 -- DREX.X, equivalent to REX_X bit, to extend SIB index field
159 Bit 0 -- DREX.W, equivalent to REX_B bit, to extend ModRM r/m field,
160 SIB base field, or opcode reg field. */
161 #define DREX_XMM(drex) ((drex >> 4) & 0xf)
162 #define DREX_OC0(drex) ((drex >> 3) & 0x1)
164 /* Flags for prefixes which we somehow handled when printing the
165 current instruction. */
166 static int used_prefixes;
168 /* Flags stored in PREFIXES. */
169 #define PREFIX_REPZ 1
170 #define PREFIX_REPNZ 2
171 #define PREFIX_LOCK 4
173 #define PREFIX_SS 0x10
174 #define PREFIX_DS 0x20
175 #define PREFIX_ES 0x40
176 #define PREFIX_FS 0x80
177 #define PREFIX_GS 0x100
178 #define PREFIX_DATA 0x200
179 #define PREFIX_ADDR 0x400
180 #define PREFIX_FWAIT 0x800
182 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
183 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
185 #define FETCH_DATA(info, addr) \
186 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
187 ? 1 : fetch_data ((info), (addr)))
190 fetch_data (struct disassemble_info *info, bfd_byte *addr)
193 struct dis_private *priv = (struct dis_private *) info->private_data;
194 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
196 if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
197 status = (*info->read_memory_func) (start,
199 addr - priv->max_fetched,
205 /* If we did manage to read at least one byte, then
206 print_insn_i386 will do something sensible. Otherwise, print
207 an error. We do that here because this is where we know
209 if (priv->max_fetched == priv->the_buffer)
210 (*info->memory_error_func) (status, start, info);
211 longjmp (priv->bailout, 1);
214 priv->max_fetched = addr;
218 #define XX { NULL, 0 }
220 #define Eb { OP_E, b_mode }
221 #define Ev { OP_E, v_mode }
222 #define Ed { OP_E, d_mode }
223 #define Edq { OP_E, dq_mode }
224 #define Edqw { OP_E, dqw_mode }
225 #define Edqb { OP_E, dqb_mode }
226 #define Edqd { OP_E, dqd_mode }
227 #define Eq { OP_E, q_mode }
228 #define indirEv { OP_indirE, stack_v_mode }
229 #define indirEp { OP_indirE, f_mode }
230 #define stackEv { OP_E, stack_v_mode }
231 #define Em { OP_E, m_mode }
232 #define Ew { OP_E, w_mode }
233 #define M { OP_M, 0 } /* lea, lgdt, etc. */
234 #define Ma { OP_M, v_mode }
235 #define Mb { OP_M, b_mode }
236 #define Md { OP_M, d_mode }
237 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
238 #define Mq { OP_M, q_mode }
239 #define Gb { OP_G, b_mode }
240 #define Gv { OP_G, v_mode }
241 #define Gd { OP_G, d_mode }
242 #define Gdq { OP_G, dq_mode }
243 #define Gm { OP_G, m_mode }
244 #define Gw { OP_G, w_mode }
245 #define Rd { OP_R, d_mode }
246 #define Rm { OP_R, m_mode }
247 #define Ib { OP_I, b_mode }
248 #define sIb { OP_sI, b_mode } /* sign extened byte */
249 #define Iv { OP_I, v_mode }
250 #define Iq { OP_I, q_mode }
251 #define Iv64 { OP_I64, v_mode }
252 #define Iw { OP_I, w_mode }
253 #define I1 { OP_I, const_1_mode }
254 #define Jb { OP_J, b_mode }
255 #define Jv { OP_J, v_mode }
256 #define Cm { OP_C, m_mode }
257 #define Dm { OP_D, m_mode }
258 #define Td { OP_T, d_mode }
259 #define Skip_MODRM { OP_Skip_MODRM, 0 }
261 #define RMeAX { OP_REG, eAX_reg }
262 #define RMeBX { OP_REG, eBX_reg }
263 #define RMeCX { OP_REG, eCX_reg }
264 #define RMeDX { OP_REG, eDX_reg }
265 #define RMeSP { OP_REG, eSP_reg }
266 #define RMeBP { OP_REG, eBP_reg }
267 #define RMeSI { OP_REG, eSI_reg }
268 #define RMeDI { OP_REG, eDI_reg }
269 #define RMrAX { OP_REG, rAX_reg }
270 #define RMrBX { OP_REG, rBX_reg }
271 #define RMrCX { OP_REG, rCX_reg }
272 #define RMrDX { OP_REG, rDX_reg }
273 #define RMrSP { OP_REG, rSP_reg }
274 #define RMrBP { OP_REG, rBP_reg }
275 #define RMrSI { OP_REG, rSI_reg }
276 #define RMrDI { OP_REG, rDI_reg }
277 #define RMAL { OP_REG, al_reg }
278 #define RMAL { OP_REG, al_reg }
279 #define RMCL { OP_REG, cl_reg }
280 #define RMDL { OP_REG, dl_reg }
281 #define RMBL { OP_REG, bl_reg }
282 #define RMAH { OP_REG, ah_reg }
283 #define RMCH { OP_REG, ch_reg }
284 #define RMDH { OP_REG, dh_reg }
285 #define RMBH { OP_REG, bh_reg }
286 #define RMAX { OP_REG, ax_reg }
287 #define RMDX { OP_REG, dx_reg }
289 #define eAX { OP_IMREG, eAX_reg }
290 #define eBX { OP_IMREG, eBX_reg }
291 #define eCX { OP_IMREG, eCX_reg }
292 #define eDX { OP_IMREG, eDX_reg }
293 #define eSP { OP_IMREG, eSP_reg }
294 #define eBP { OP_IMREG, eBP_reg }
295 #define eSI { OP_IMREG, eSI_reg }
296 #define eDI { OP_IMREG, eDI_reg }
297 #define AL { OP_IMREG, al_reg }
298 #define CL { OP_IMREG, cl_reg }
299 #define DL { OP_IMREG, dl_reg }
300 #define BL { OP_IMREG, bl_reg }
301 #define AH { OP_IMREG, ah_reg }
302 #define CH { OP_IMREG, ch_reg }
303 #define DH { OP_IMREG, dh_reg }
304 #define BH { OP_IMREG, bh_reg }
305 #define AX { OP_IMREG, ax_reg }
306 #define DX { OP_IMREG, dx_reg }
307 #define zAX { OP_IMREG, z_mode_ax_reg }
308 #define indirDX { OP_IMREG, indir_dx_reg }
310 #define Sw { OP_SEG, w_mode }
311 #define Sv { OP_SEG, v_mode }
312 #define Ap { OP_DIR, 0 }
313 #define Ob { OP_OFF64, b_mode }
314 #define Ov { OP_OFF64, v_mode }
315 #define Xb { OP_DSreg, eSI_reg }
316 #define Xv { OP_DSreg, eSI_reg }
317 #define Xz { OP_DSreg, eSI_reg }
318 #define Yb { OP_ESreg, eDI_reg }
319 #define Yv { OP_ESreg, eDI_reg }
320 #define DSBX { OP_DSreg, eBX_reg }
322 #define es { OP_REG, es_reg }
323 #define ss { OP_REG, ss_reg }
324 #define cs { OP_REG, cs_reg }
325 #define ds { OP_REG, ds_reg }
326 #define fs { OP_REG, fs_reg }
327 #define gs { OP_REG, gs_reg }
329 #define MX { OP_MMX, 0 }
330 #define XM { OP_XMM, 0 }
331 #define EM { OP_EM, v_mode }
332 #define EMd { OP_EM, d_mode }
333 #define EMx { OP_EM, x_mode }
334 #define EXw { OP_EX, w_mode }
335 #define EXd { OP_EX, d_mode }
336 #define EXq { OP_EX, q_mode }
337 #define EXx { OP_EX, x_mode }
338 #define MS { OP_MS, v_mode }
339 #define XS { OP_XS, v_mode }
340 #define EMCq { OP_EMC, q_mode }
341 #define MXC { OP_MXC, 0 }
342 #define OPSUF { OP_3DNowSuffix, 0 }
343 #define CMP { CMP_Fixup, 0 }
344 #define XMM0 { XMM_Fixup, 0 }
346 /* Used handle "rep" prefix for string instructions. */
347 #define Xbr { REP_Fixup, eSI_reg }
348 #define Xvr { REP_Fixup, eSI_reg }
349 #define Ybr { REP_Fixup, eDI_reg }
350 #define Yvr { REP_Fixup, eDI_reg }
351 #define Yzr { REP_Fixup, eDI_reg }
352 #define indirDXr { REP_Fixup, indir_dx_reg }
353 #define ALr { REP_Fixup, al_reg }
354 #define eAXr { REP_Fixup, eAX_reg }
356 #define cond_jump_flag { NULL, cond_jump_mode }
357 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
359 /* bits in sizeflag */
360 #define SUFFIX_ALWAYS 4
366 /* operand size depends on prefixes */
367 #define v_mode (b_mode + 1)
369 #define w_mode (v_mode + 1)
370 /* double word operand */
371 #define d_mode (w_mode + 1)
372 /* quad word operand */
373 #define q_mode (d_mode + 1)
374 /* ten-byte operand */
375 #define t_mode (q_mode + 1)
376 /* 16-byte XMM operand */
377 #define x_mode (t_mode + 1)
378 /* d_mode in 32bit, q_mode in 64bit mode. */
379 #define m_mode (x_mode + 1)
380 #define cond_jump_mode (m_mode + 1)
381 #define loop_jcxz_mode (cond_jump_mode + 1)
382 /* operand size depends on REX prefixes. */
383 #define dq_mode (loop_jcxz_mode + 1)
384 /* registers like dq_mode, memory like w_mode. */
385 #define dqw_mode (dq_mode + 1)
386 /* 4- or 6-byte pointer operand */
387 #define f_mode (dqw_mode + 1)
388 #define const_1_mode (f_mode + 1)
389 /* v_mode for stack-related opcodes. */
390 #define stack_v_mode (const_1_mode + 1)
391 /* non-quad operand size depends on prefixes */
392 #define z_mode (stack_v_mode + 1)
393 /* 16-byte operand */
394 #define o_mode (z_mode + 1)
395 /* registers like dq_mode, memory like b_mode. */
396 #define dqb_mode (o_mode + 1)
397 /* registers like dq_mode, memory like d_mode. */
398 #define dqd_mode (dqb_mode + 1)
400 #define es_reg (dqd_mode + 1)
401 #define cs_reg (es_reg + 1)
402 #define ss_reg (cs_reg + 1)
403 #define ds_reg (ss_reg + 1)
404 #define fs_reg (ds_reg + 1)
405 #define gs_reg (fs_reg + 1)
407 #define eAX_reg (gs_reg + 1)
408 #define eCX_reg (eAX_reg + 1)
409 #define eDX_reg (eCX_reg + 1)
410 #define eBX_reg (eDX_reg + 1)
411 #define eSP_reg (eBX_reg + 1)
412 #define eBP_reg (eSP_reg + 1)
413 #define eSI_reg (eBP_reg + 1)
414 #define eDI_reg (eSI_reg + 1)
416 #define al_reg (eDI_reg + 1)
417 #define cl_reg (al_reg + 1)
418 #define dl_reg (cl_reg + 1)
419 #define bl_reg (dl_reg + 1)
420 #define ah_reg (bl_reg + 1)
421 #define ch_reg (ah_reg + 1)
422 #define dh_reg (ch_reg + 1)
423 #define bh_reg (dh_reg + 1)
425 #define ax_reg (bh_reg + 1)
426 #define cx_reg (ax_reg + 1)
427 #define dx_reg (cx_reg + 1)
428 #define bx_reg (dx_reg + 1)
429 #define sp_reg (bx_reg + 1)
430 #define bp_reg (sp_reg + 1)
431 #define si_reg (bp_reg + 1)
432 #define di_reg (si_reg + 1)
434 #define rAX_reg (di_reg + 1)
435 #define rCX_reg (rAX_reg + 1)
436 #define rDX_reg (rCX_reg + 1)
437 #define rBX_reg (rDX_reg + 1)
438 #define rSP_reg (rBX_reg + 1)
439 #define rBP_reg (rSP_reg + 1)
440 #define rSI_reg (rBP_reg + 1)
441 #define rDI_reg (rSI_reg + 1)
443 #define z_mode_ax_reg (rDI_reg + 1)
444 #define indir_dx_reg (z_mode_ax_reg + 1)
446 #define MAX_BYTEMODE indir_dx_reg
448 /* Flags that are OR'ed into the bytemode field to pass extra
450 #define DREX_OC1 0x10000 /* OC1 bit set */
451 #define DREX_NO_OC0 0x20000 /* OC0 bit not used */
452 #define DREX_MASK 0x40000 /* mask to delete */
454 #if MAX_BYTEMODE >= DREX_OC1
455 #error MAX_BYTEMODE must be less than DREX_OC1
459 #define USE_REG_TABLE (FLOATCODE + 1)
460 #define USE_MOD_TABLE (USE_REG_TABLE + 1)
461 #define USE_RM_TABLE (USE_MOD_TABLE + 1)
462 #define USE_PREFIX_TABLE (USE_RM_TABLE + 1)
463 #define USE_X86_64_TABLE (USE_PREFIX_TABLE + 1)
464 #define USE_3BYTE_TABLE (USE_X86_64_TABLE + 1)
466 #define FLOAT NULL, { { NULL, FLOATCODE } }
468 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }
469 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
470 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
471 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
472 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
473 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
474 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
477 #define REG_81 (REG_80 + 1)
478 #define REG_82 (REG_81 + 1)
479 #define REG_8F (REG_82 + 1)
480 #define REG_C0 (REG_8F + 1)
481 #define REG_C1 (REG_C0 + 1)
482 #define REG_C6 (REG_C1 + 1)
483 #define REG_C7 (REG_C6 + 1)
484 #define REG_D0 (REG_C7 + 1)
485 #define REG_D1 (REG_D0 + 1)
486 #define REG_D2 (REG_D1 + 1)
487 #define REG_D3 (REG_D2 + 1)
488 #define REG_F6 (REG_D3 + 1)
489 #define REG_F7 (REG_F6 + 1)
490 #define REG_FE (REG_F7 + 1)
491 #define REG_FF (REG_FE + 1)
492 #define REG_0F00 (REG_FF + 1)
493 #define REG_0F01 (REG_0F00 + 1)
494 #define REG_0F0E (REG_0F01 + 1)
495 #define REG_0F18 (REG_0F0E + 1)
496 #define REG_0F71 (REG_0F18 + 1)
497 #define REG_0F72 (REG_0F71 + 1)
498 #define REG_0F73 (REG_0F72 + 1)
499 #define REG_0FA6 (REG_0F73 + 1)
500 #define REG_0FA7 (REG_0FA6 + 1)
501 #define REG_0FAE (REG_0FA7 + 1)
502 #define REG_0FBA (REG_0FAE + 1)
503 #define REG_0FC7 (REG_0FBA + 1)
506 #define MOD_0F01_REG_0 (MOD_8D + 1)
507 #define MOD_0F01_REG_1 (MOD_0F01_REG_0 + 1)
508 #define MOD_0F01_REG_2 (MOD_0F01_REG_1 + 1)
509 #define MOD_0F01_REG_3 (MOD_0F01_REG_2 + 1)
510 #define MOD_0F01_REG_7 (MOD_0F01_REG_3 + 1)
511 #define MOD_0F12_PREFIX_0 (MOD_0F01_REG_7 + 1)
512 #define MOD_0F13 (MOD_0F12_PREFIX_0 + 1)
513 #define MOD_0F16_PREFIX_0 (MOD_0F13 + 1)
514 #define MOD_0F17 (MOD_0F16_PREFIX_0 + 1)
515 #define MOD_0F18_REG_0 (MOD_0F17 + 1)
516 #define MOD_0F18_REG_1 (MOD_0F18_REG_0 + 1)
517 #define MOD_0F18_REG_2 (MOD_0F18_REG_1 + 1)
518 #define MOD_0F18_REG_3 (MOD_0F18_REG_2 + 1)
519 #define MOD_0F20 (MOD_0F18_REG_3 + 1)
520 #define MOD_0F21 (MOD_0F20 + 1)
521 #define MOD_0F22 (MOD_0F21 + 1)
522 #define MOD_0F23 (MOD_0F22 + 1)
523 #define MOD_0F24 (MOD_0F23 + 1)
524 #define MOD_0F26 (MOD_0F24 + 1)
525 #define MOD_0F2B_PREFIX_0 (MOD_0F26 + 1)
526 #define MOD_0F2B_PREFIX_1 (MOD_0F2B_PREFIX_0 + 1)
527 #define MOD_0F2B_PREFIX_2 (MOD_0F2B_PREFIX_1 + 1)
528 #define MOD_0F2B_PREFIX_3 (MOD_0F2B_PREFIX_2 + 1)
529 #define MOD_0F51 (MOD_0F2B_PREFIX_3 + 1)
530 #define MOD_0F71_REG_2 (MOD_0F51 + 1)
531 #define MOD_0F71_REG_4 (MOD_0F71_REG_2 + 1)
532 #define MOD_0F71_REG_6 (MOD_0F71_REG_4 + 1)
533 #define MOD_0F72_REG_2 (MOD_0F71_REG_6 + 1)
534 #define MOD_0F72_REG_4 (MOD_0F72_REG_2 + 1)
535 #define MOD_0F72_REG_6 (MOD_0F72_REG_4 + 1)
536 #define MOD_0F73_REG_2 (MOD_0F72_REG_6 + 1)
537 #define MOD_0F73_REG_3 (MOD_0F73_REG_2 + 1)
538 #define MOD_0F73_REG_6 (MOD_0F73_REG_3 + 1)
539 #define MOD_0F73_REG_7 (MOD_0F73_REG_6 + 1)
540 #define MOD_0FAE_REG_0 (MOD_0F73_REG_7 + 1)
541 #define MOD_0FAE_REG_1 (MOD_0FAE_REG_0 + 1)
542 #define MOD_0FAE_REG_2 (MOD_0FAE_REG_1 + 1)
543 #define MOD_0FAE_REG_3 (MOD_0FAE_REG_2 + 1)
544 #define MOD_0FAE_REG_5 (MOD_0FAE_REG_3 + 1)
545 #define MOD_0FAE_REG_6 (MOD_0FAE_REG_5 + 1)
546 #define MOD_0FAE_REG_7 (MOD_0FAE_REG_6 + 1)
547 #define MOD_0FB2 (MOD_0FAE_REG_7 + 1)
548 #define MOD_0FB4 (MOD_0FB2 + 1)
549 #define MOD_0FB5 (MOD_0FB4 + 1)
550 #define MOD_0FC7_REG_6 (MOD_0FB5 + 1)
551 #define MOD_0FC7_REG_7 (MOD_0FC7_REG_6 + 1)
552 #define MOD_0FD7 (MOD_0FC7_REG_7 + 1)
553 #define MOD_0FE7_PREFIX_2 (MOD_0FD7 + 1)
554 #define MOD_0FF0_PREFIX_3 (MOD_0FE7_PREFIX_2 + 1)
555 #define MOD_0F382A_PREFIX_2 (MOD_0FF0_PREFIX_3 + 1)
556 #define MOD_62_32BIT (MOD_0F382A_PREFIX_2 + 1)
557 #define MOD_C4_32BIT (MOD_62_32BIT + 1)
558 #define MOD_C5_32BIT (MOD_C4_32BIT + 1)
560 #define RM_0F01_REG_0 0
561 #define RM_0F01_REG_1 (RM_0F01_REG_0 + 1)
562 #define RM_0F01_REG_3 (RM_0F01_REG_1 + 1)
563 #define RM_0F01_REG_7 (RM_0F01_REG_3 + 1)
564 #define RM_0FAE_REG_5 (RM_0F01_REG_7 + 1)
565 #define RM_0FAE_REG_6 (RM_0FAE_REG_5 + 1)
566 #define RM_0FAE_REG_7 (RM_0FAE_REG_6 + 1)
569 #define PREFIX_0F10 (PREFIX_90 + 1)
570 #define PREFIX_0F11 (PREFIX_0F10 + 1)
571 #define PREFIX_0F12 (PREFIX_0F11 + 1)
572 #define PREFIX_0F16 (PREFIX_0F12 + 1)
573 #define PREFIX_0F2A (PREFIX_0F16 + 1)
574 #define PREFIX_0F2B (PREFIX_0F2A + 1)
575 #define PREFIX_0F2C (PREFIX_0F2B + 1)
576 #define PREFIX_0F2D (PREFIX_0F2C + 1)
577 #define PREFIX_0F2E (PREFIX_0F2D + 1)
578 #define PREFIX_0F2F (PREFIX_0F2E + 1)
579 #define PREFIX_0F51 (PREFIX_0F2F + 1)
580 #define PREFIX_0F52 (PREFIX_0F51 + 1)
581 #define PREFIX_0F53 (PREFIX_0F52 + 1)
582 #define PREFIX_0F58 (PREFIX_0F53 + 1)
583 #define PREFIX_0F59 (PREFIX_0F58 + 1)
584 #define PREFIX_0F5A (PREFIX_0F59 + 1)
585 #define PREFIX_0F5B (PREFIX_0F5A + 1)
586 #define PREFIX_0F5C (PREFIX_0F5B + 1)
587 #define PREFIX_0F5D (PREFIX_0F5C + 1)
588 #define PREFIX_0F5E (PREFIX_0F5D + 1)
589 #define PREFIX_0F5F (PREFIX_0F5E + 1)
590 #define PREFIX_0F60 (PREFIX_0F5F + 1)
591 #define PREFIX_0F61 (PREFIX_0F60 + 1)
592 #define PREFIX_0F62 (PREFIX_0F61 + 1)
593 #define PREFIX_0F6C (PREFIX_0F62 + 1)
594 #define PREFIX_0F6D (PREFIX_0F6C + 1)
595 #define PREFIX_0F6F (PREFIX_0F6D + 1)
596 #define PREFIX_0F70 (PREFIX_0F6F + 1)
597 #define PREFIX_0F73_REG_3 (PREFIX_0F70 + 1)
598 #define PREFIX_0F73_REG_7 (PREFIX_0F73_REG_3 + 1)
599 #define PREFIX_0F78 (PREFIX_0F73_REG_7 + 1)
600 #define PREFIX_0F79 (PREFIX_0F78 + 1)
601 #define PREFIX_0F7C (PREFIX_0F79 + 1)
602 #define PREFIX_0F7D (PREFIX_0F7C + 1)
603 #define PREFIX_0F7E (PREFIX_0F7D + 1)
604 #define PREFIX_0F7F (PREFIX_0F7E + 1)
605 #define PREFIX_0FB8 (PREFIX_0F7F + 1)
606 #define PREFIX_0FBD (PREFIX_0FB8 + 1)
607 #define PREFIX_0FC2 (PREFIX_0FBD + 1)
608 #define PREFIX_0FC7_REG_6 (PREFIX_0FC2 + 1)
609 #define PREFIX_0FD0 (PREFIX_0FC7_REG_6 + 1)
610 #define PREFIX_0FD6 (PREFIX_0FD0 + 1)
611 #define PREFIX_0FE6 (PREFIX_0FD6 + 1)
612 #define PREFIX_0FE7 (PREFIX_0FE6 + 1)
613 #define PREFIX_0FF0 (PREFIX_0FE7 + 1)
614 #define PREFIX_0FF7 (PREFIX_0FF0 + 1)
615 #define PREFIX_0F3810 (PREFIX_0FF7 + 1)
616 #define PREFIX_0F3814 (PREFIX_0F3810 + 1)
617 #define PREFIX_0F3815 (PREFIX_0F3814 + 1)
618 #define PREFIX_0F3817 (PREFIX_0F3815 + 1)
619 #define PREFIX_0F3820 (PREFIX_0F3817 + 1)
620 #define PREFIX_0F3821 (PREFIX_0F3820 + 1)
621 #define PREFIX_0F3822 (PREFIX_0F3821 + 1)
622 #define PREFIX_0F3823 (PREFIX_0F3822 + 1)
623 #define PREFIX_0F3824 (PREFIX_0F3823 + 1)
624 #define PREFIX_0F3825 (PREFIX_0F3824 + 1)
625 #define PREFIX_0F3828 (PREFIX_0F3825 + 1)
626 #define PREFIX_0F3829 (PREFIX_0F3828 + 1)
627 #define PREFIX_0F382A (PREFIX_0F3829 + 1)
628 #define PREFIX_0F382B (PREFIX_0F382A + 1)
629 #define PREFIX_0F3830 (PREFIX_0F382B + 1)
630 #define PREFIX_0F3831 (PREFIX_0F3830 + 1)
631 #define PREFIX_0F3832 (PREFIX_0F3831 + 1)
632 #define PREFIX_0F3833 (PREFIX_0F3832 + 1)
633 #define PREFIX_0F3834 (PREFIX_0F3833 + 1)
634 #define PREFIX_0F3835 (PREFIX_0F3834 + 1)
635 #define PREFIX_0F3837 (PREFIX_0F3835 + 1)
636 #define PREFIX_0F3838 (PREFIX_0F3837 + 1)
637 #define PREFIX_0F3839 (PREFIX_0F3838 + 1)
638 #define PREFIX_0F383A (PREFIX_0F3839 + 1)
639 #define PREFIX_0F383B (PREFIX_0F383A + 1)
640 #define PREFIX_0F383C (PREFIX_0F383B + 1)
641 #define PREFIX_0F383D (PREFIX_0F383C + 1)
642 #define PREFIX_0F383E (PREFIX_0F383D + 1)
643 #define PREFIX_0F383F (PREFIX_0F383E + 1)
644 #define PREFIX_0F3840 (PREFIX_0F383F + 1)
645 #define PREFIX_0F3841 (PREFIX_0F3840 + 1)
646 #define PREFIX_0F38F0 (PREFIX_0F3841 + 1)
647 #define PREFIX_0F38F1 (PREFIX_0F38F0 + 1)
648 #define PREFIX_0F3A08 (PREFIX_0F38F1 + 1)
649 #define PREFIX_0F3A09 (PREFIX_0F3A08 + 1)
650 #define PREFIX_0F3A0A (PREFIX_0F3A09 + 1)
651 #define PREFIX_0F3A0B (PREFIX_0F3A0A + 1)
652 #define PREFIX_0F3A0C (PREFIX_0F3A0B + 1)
653 #define PREFIX_0F3A0D (PREFIX_0F3A0C + 1)
654 #define PREFIX_0F3A0E (PREFIX_0F3A0D + 1)
655 #define PREFIX_0F3A14 (PREFIX_0F3A0E + 1)
656 #define PREFIX_0F3A15 (PREFIX_0F3A14 + 1)
657 #define PREFIX_0F3A16 (PREFIX_0F3A15 + 1)
658 #define PREFIX_0F3A17 (PREFIX_0F3A16 + 1)
659 #define PREFIX_0F3A20 (PREFIX_0F3A17 + 1)
660 #define PREFIX_0F3A21 (PREFIX_0F3A20 + 1)
661 #define PREFIX_0F3A22 (PREFIX_0F3A21 + 1)
662 #define PREFIX_0F3A40 (PREFIX_0F3A22 + 1)
663 #define PREFIX_0F3A41 (PREFIX_0F3A40 + 1)
664 #define PREFIX_0F3A42 (PREFIX_0F3A41 + 1)
665 #define PREFIX_0F3A60 (PREFIX_0F3A42 + 1)
666 #define PREFIX_0F3A61 (PREFIX_0F3A60 + 1)
667 #define PREFIX_0F3A62 (PREFIX_0F3A61 + 1)
668 #define PREFIX_0F3A63 (PREFIX_0F3A62 + 1)
671 #define X86_64_07 (X86_64_06 + 1)
672 #define X86_64_0D (X86_64_07 + 1)
673 #define X86_64_16 (X86_64_0D + 1)
674 #define X86_64_17 (X86_64_16 + 1)
675 #define X86_64_1E (X86_64_17 + 1)
676 #define X86_64_1F (X86_64_1E + 1)
677 #define X86_64_27 (X86_64_1F + 1)
678 #define X86_64_2F (X86_64_27 + 1)
679 #define X86_64_37 (X86_64_2F + 1)
680 #define X86_64_3F (X86_64_37 + 1)
681 #define X86_64_60 (X86_64_3F + 1)
682 #define X86_64_61 (X86_64_60 + 1)
683 #define X86_64_62 (X86_64_61 + 1)
684 #define X86_64_63 (X86_64_62 + 1)
685 #define X86_64_6D (X86_64_63 + 1)
686 #define X86_64_6F (X86_64_6D + 1)
687 #define X86_64_9A (X86_64_6F + 1)
688 #define X86_64_C4 (X86_64_9A + 1)
689 #define X86_64_C5 (X86_64_C4 + 1)
690 #define X86_64_CE (X86_64_C5 + 1)
691 #define X86_64_D4 (X86_64_CE + 1)
692 #define X86_64_D5 (X86_64_D4 + 1)
693 #define X86_64_EA (X86_64_D5 + 1)
694 #define X86_64_0F01_REG_0 (X86_64_EA + 1)
695 #define X86_64_0F01_REG_1 (X86_64_0F01_REG_0 + 1)
696 #define X86_64_0F01_REG_2 (X86_64_0F01_REG_1 + 1)
697 #define X86_64_0F01_REG_3 (X86_64_0F01_REG_2 + 1)
699 #define THREE_BYTE_0F24 0
700 #define THREE_BYTE_0F25 (THREE_BYTE_0F24 + 1)
701 #define THREE_BYTE_0F38 (THREE_BYTE_0F25 + 1)
702 #define THREE_BYTE_0F3A (THREE_BYTE_0F38 + 1)
703 #define THREE_BYTE_0F7A (THREE_BYTE_0F3A + 1)
704 #define THREE_BYTE_0F7B (THREE_BYTE_0F7A + 1)
706 typedef void (*op_rtn) (int bytemode, int sizeflag);
717 /* Upper case letters in the instruction names here are macros.
718 'A' => print 'b' if no register operands or suffix_always is true
719 'B' => print 'b' if suffix_always is true
720 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
722 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
723 . suffix_always is true
724 'E' => print 'e' if 32-bit form of jcxz
725 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
726 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
727 'H' => print ",pt" or ",pn" branch hint
728 'I' => honor following macro letter even in Intel mode (implemented only
729 . for some of the macro letters)
731 'K' => print 'd' or 'q' if rex prefix is present.
732 'L' => print 'l' if suffix_always is true
733 'M' => print 'r' if intel_mnemonic is false.
734 'N' => print 'n' if instruction has no wait "prefix"
735 'O' => print 'd' or 'o' (or 'q' in Intel mode)
736 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
737 . or suffix_always is true. print 'q' if rex prefix is present.
738 'Q' => print 'w', 'l' or 'q' if no register operands or suffix_always
740 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
741 'S' => print 'w', 'l' or 'q' if suffix_always is true
742 'T' => print 'q' in 64bit mode and behave as 'P' otherwise
743 'U' => print 'q' in 64bit mode and behave as 'Q' otherwise
744 'V' => print 'q' in 64bit mode and behave as 'S' otherwise
745 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
746 'X' => print 's', 'd' depending on data16 prefix (for XMM)
747 'Y' => 'q' if instruction has an REX 64bit overwrite prefix and
748 suffix_always is true.
749 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
750 '!' => change condition from true to false or from false to true.
752 Many of the above letters print nothing in Intel mode. See "putop"
755 Braces '{' and '}', and vertical bars '|', indicate alternative
756 mnemonic strings for AT&T and Intel. */
758 static const struct dis386 dis386[] = {
760 { "addB", { Eb, Gb } },
761 { "addS", { Ev, Gv } },
762 { "addB", { Gb, Eb } },
763 { "addS", { Gv, Ev } },
764 { "addB", { AL, Ib } },
765 { "addS", { eAX, Iv } },
766 { X86_64_TABLE (X86_64_06) },
767 { X86_64_TABLE (X86_64_07) },
769 { "orB", { Eb, Gb } },
770 { "orS", { Ev, Gv } },
771 { "orB", { Gb, Eb } },
772 { "orS", { Gv, Ev } },
773 { "orB", { AL, Ib } },
774 { "orS", { eAX, Iv } },
775 { X86_64_TABLE (X86_64_0D) },
776 { "(bad)", { XX } }, /* 0x0f extended opcode escape */
778 { "adcB", { Eb, Gb } },
779 { "adcS", { Ev, Gv } },
780 { "adcB", { Gb, Eb } },
781 { "adcS", { Gv, Ev } },
782 { "adcB", { AL, Ib } },
783 { "adcS", { eAX, Iv } },
784 { X86_64_TABLE (X86_64_16) },
785 { X86_64_TABLE (X86_64_17) },
787 { "sbbB", { Eb, Gb } },
788 { "sbbS", { Ev, Gv } },
789 { "sbbB", { Gb, Eb } },
790 { "sbbS", { Gv, Ev } },
791 { "sbbB", { AL, Ib } },
792 { "sbbS", { eAX, Iv } },
793 { X86_64_TABLE (X86_64_1E) },
794 { X86_64_TABLE (X86_64_1F) },
796 { "andB", { Eb, Gb } },
797 { "andS", { Ev, Gv } },
798 { "andB", { Gb, Eb } },
799 { "andS", { Gv, Ev } },
800 { "andB", { AL, Ib } },
801 { "andS", { eAX, Iv } },
802 { "(bad)", { XX } }, /* SEG ES prefix */
803 { X86_64_TABLE (X86_64_27) },
805 { "subB", { Eb, Gb } },
806 { "subS", { Ev, Gv } },
807 { "subB", { Gb, Eb } },
808 { "subS", { Gv, Ev } },
809 { "subB", { AL, Ib } },
810 { "subS", { eAX, Iv } },
811 { "(bad)", { XX } }, /* SEG CS prefix */
812 { X86_64_TABLE (X86_64_2F) },
814 { "xorB", { Eb, Gb } },
815 { "xorS", { Ev, Gv } },
816 { "xorB", { Gb, Eb } },
817 { "xorS", { Gv, Ev } },
818 { "xorB", { AL, Ib } },
819 { "xorS", { eAX, Iv } },
820 { "(bad)", { XX } }, /* SEG SS prefix */
821 { X86_64_TABLE (X86_64_37) },
823 { "cmpB", { Eb, Gb } },
824 { "cmpS", { Ev, Gv } },
825 { "cmpB", { Gb, Eb } },
826 { "cmpS", { Gv, Ev } },
827 { "cmpB", { AL, Ib } },
828 { "cmpS", { eAX, Iv } },
829 { "(bad)", { XX } }, /* SEG DS prefix */
830 { X86_64_TABLE (X86_64_3F) },
832 { "inc{S|}", { RMeAX } },
833 { "inc{S|}", { RMeCX } },
834 { "inc{S|}", { RMeDX } },
835 { "inc{S|}", { RMeBX } },
836 { "inc{S|}", { RMeSP } },
837 { "inc{S|}", { RMeBP } },
838 { "inc{S|}", { RMeSI } },
839 { "inc{S|}", { RMeDI } },
841 { "dec{S|}", { RMeAX } },
842 { "dec{S|}", { RMeCX } },
843 { "dec{S|}", { RMeDX } },
844 { "dec{S|}", { RMeBX } },
845 { "dec{S|}", { RMeSP } },
846 { "dec{S|}", { RMeBP } },
847 { "dec{S|}", { RMeSI } },
848 { "dec{S|}", { RMeDI } },
850 { "pushV", { RMrAX } },
851 { "pushV", { RMrCX } },
852 { "pushV", { RMrDX } },
853 { "pushV", { RMrBX } },
854 { "pushV", { RMrSP } },
855 { "pushV", { RMrBP } },
856 { "pushV", { RMrSI } },
857 { "pushV", { RMrDI } },
859 { "popV", { RMrAX } },
860 { "popV", { RMrCX } },
861 { "popV", { RMrDX } },
862 { "popV", { RMrBX } },
863 { "popV", { RMrSP } },
864 { "popV", { RMrBP } },
865 { "popV", { RMrSI } },
866 { "popV", { RMrDI } },
868 { X86_64_TABLE (X86_64_60) },
869 { X86_64_TABLE (X86_64_61) },
870 { X86_64_TABLE (X86_64_62) },
871 { X86_64_TABLE (X86_64_63) },
872 { "(bad)", { XX } }, /* seg fs */
873 { "(bad)", { XX } }, /* seg gs */
874 { "(bad)", { XX } }, /* op size prefix */
875 { "(bad)", { XX } }, /* adr size prefix */
878 { "imulS", { Gv, Ev, Iv } },
879 { "pushT", { sIb } },
880 { "imulS", { Gv, Ev, sIb } },
881 { "ins{b|}", { Ybr, indirDX } },
882 { X86_64_TABLE (X86_64_6D) },
883 { "outs{b|}", { indirDXr, Xb } },
884 { X86_64_TABLE (X86_64_6F) },
886 { "joH", { Jb, XX, cond_jump_flag } },
887 { "jnoH", { Jb, XX, cond_jump_flag } },
888 { "jbH", { Jb, XX, cond_jump_flag } },
889 { "jaeH", { Jb, XX, cond_jump_flag } },
890 { "jeH", { Jb, XX, cond_jump_flag } },
891 { "jneH", { Jb, XX, cond_jump_flag } },
892 { "jbeH", { Jb, XX, cond_jump_flag } },
893 { "jaH", { Jb, XX, cond_jump_flag } },
895 { "jsH", { Jb, XX, cond_jump_flag } },
896 { "jnsH", { Jb, XX, cond_jump_flag } },
897 { "jpH", { Jb, XX, cond_jump_flag } },
898 { "jnpH", { Jb, XX, cond_jump_flag } },
899 { "jlH", { Jb, XX, cond_jump_flag } },
900 { "jgeH", { Jb, XX, cond_jump_flag } },
901 { "jleH", { Jb, XX, cond_jump_flag } },
902 { "jgH", { Jb, XX, cond_jump_flag } },
904 { REG_TABLE (REG_80) },
905 { REG_TABLE (REG_81) },
907 { REG_TABLE (REG_82) },
908 { "testB", { Eb, Gb } },
909 { "testS", { Ev, Gv } },
910 { "xchgB", { Eb, Gb } },
911 { "xchgS", { Ev, Gv } },
913 { "movB", { Eb, Gb } },
914 { "movS", { Ev, Gv } },
915 { "movB", { Gb, Eb } },
916 { "movS", { Gv, Ev } },
917 { "movD", { Sv, Sw } },
918 { MOD_TABLE (MOD_8D) },
919 { "movD", { Sw, Sv } },
920 { REG_TABLE (REG_8F) },
922 { PREFIX_TABLE (PREFIX_90) },
923 { "xchgS", { RMeCX, eAX } },
924 { "xchgS", { RMeDX, eAX } },
925 { "xchgS", { RMeBX, eAX } },
926 { "xchgS", { RMeSP, eAX } },
927 { "xchgS", { RMeBP, eAX } },
928 { "xchgS", { RMeSI, eAX } },
929 { "xchgS", { RMeDI, eAX } },
931 { "cW{t|}R", { XX } },
932 { "cR{t|}O", { XX } },
933 { X86_64_TABLE (X86_64_9A) },
934 { "(bad)", { XX } }, /* fwait */
935 { "pushfT", { XX } },
940 { "movB", { AL, Ob } },
941 { "movS", { eAX, Ov } },
942 { "movB", { Ob, AL } },
943 { "movS", { Ov, eAX } },
944 { "movs{b|}", { Ybr, Xb } },
945 { "movs{R|}", { Yvr, Xv } },
946 { "cmps{b|}", { Xb, Yb } },
947 { "cmps{R|}", { Xv, Yv } },
949 { "testB", { AL, Ib } },
950 { "testS", { eAX, Iv } },
951 { "stosB", { Ybr, AL } },
952 { "stosS", { Yvr, eAX } },
953 { "lodsB", { ALr, Xb } },
954 { "lodsS", { eAXr, Xv } },
955 { "scasB", { AL, Yb } },
956 { "scasS", { eAX, Yv } },
958 { "movB", { RMAL, Ib } },
959 { "movB", { RMCL, Ib } },
960 { "movB", { RMDL, Ib } },
961 { "movB", { RMBL, Ib } },
962 { "movB", { RMAH, Ib } },
963 { "movB", { RMCH, Ib } },
964 { "movB", { RMDH, Ib } },
965 { "movB", { RMBH, Ib } },
967 { "movS", { RMeAX, Iv64 } },
968 { "movS", { RMeCX, Iv64 } },
969 { "movS", { RMeDX, Iv64 } },
970 { "movS", { RMeBX, Iv64 } },
971 { "movS", { RMeSP, Iv64 } },
972 { "movS", { RMeBP, Iv64 } },
973 { "movS", { RMeSI, Iv64 } },
974 { "movS", { RMeDI, Iv64 } },
976 { REG_TABLE (REG_C0) },
977 { REG_TABLE (REG_C1) },
980 { X86_64_TABLE (X86_64_C4) },
981 { X86_64_TABLE (X86_64_C5) },
982 { REG_TABLE (REG_C6) },
983 { REG_TABLE (REG_C7) },
985 { "enterT", { Iw, Ib } },
986 { "leaveT", { XX } },
991 { X86_64_TABLE (X86_64_CE) },
994 { REG_TABLE (REG_D0) },
995 { REG_TABLE (REG_D1) },
996 { REG_TABLE (REG_D2) },
997 { REG_TABLE (REG_D3) },
998 { X86_64_TABLE (X86_64_D4) },
999 { X86_64_TABLE (X86_64_D5) },
1000 { "(bad)", { XX } },
1001 { "xlat", { DSBX } },
1012 { "loopneFH", { Jb, XX, loop_jcxz_flag } },
1013 { "loopeFH", { Jb, XX, loop_jcxz_flag } },
1014 { "loopFH", { Jb, XX, loop_jcxz_flag } },
1015 { "jEcxzH", { Jb, XX, loop_jcxz_flag } },
1016 { "inB", { AL, Ib } },
1017 { "inG", { zAX, Ib } },
1018 { "outB", { Ib, AL } },
1019 { "outG", { Ib, zAX } },
1021 { "callT", { Jv } },
1023 { X86_64_TABLE (X86_64_EA) },
1025 { "inB", { AL, indirDX } },
1026 { "inG", { zAX, indirDX } },
1027 { "outB", { indirDX, AL } },
1028 { "outG", { indirDX, zAX } },
1030 { "(bad)", { XX } }, /* lock prefix */
1031 { "icebp", { XX } },
1032 { "(bad)", { XX } }, /* repne */
1033 { "(bad)", { XX } }, /* repz */
1036 { REG_TABLE (REG_F6) },
1037 { REG_TABLE (REG_F7) },
1045 { REG_TABLE (REG_FE) },
1046 { REG_TABLE (REG_FF) },
1049 static const struct dis386 dis386_twobyte[] = {
1051 { REG_TABLE (REG_0F00 ) },
1052 { REG_TABLE (REG_0F01 ) },
1053 { "larS", { Gv, Ew } },
1054 { "lslS", { Gv, Ew } },
1055 { "(bad)", { XX } },
1056 { "syscall", { XX } },
1058 { "sysretP", { XX } },
1061 { "wbinvd", { XX } },
1062 { "(bad)", { XX } },
1064 { "(bad)", { XX } },
1065 { REG_TABLE (REG_0F0E) },
1066 { "femms", { XX } },
1067 { "", { MX, EM, OPSUF } }, /* See OP_3DNowSuffix. */
1069 { PREFIX_TABLE (PREFIX_0F10) },
1070 { PREFIX_TABLE (PREFIX_0F11) },
1071 { PREFIX_TABLE (PREFIX_0F12) },
1072 { MOD_TABLE (MOD_0F13) },
1073 { "unpcklpX", { XM, EXx } },
1074 { "unpckhpX", { XM, EXx } },
1075 { PREFIX_TABLE (PREFIX_0F16) },
1076 { MOD_TABLE (MOD_0F17) },
1078 { REG_TABLE (REG_0F18) },
1079 { "(bad)", { XX } },
1080 { "(bad)", { XX } },
1081 { "(bad)", { XX } },
1082 { "(bad)", { XX } },
1083 { "(bad)", { XX } },
1084 { "(bad)", { XX } },
1087 { MOD_TABLE (MOD_0F20) },
1088 { MOD_TABLE (MOD_0F21) },
1089 { MOD_TABLE (MOD_0F22) },
1090 { MOD_TABLE (MOD_0F23) },
1091 { MOD_TABLE (MOD_0F24) },
1092 { THREE_BYTE_TABLE (THREE_BYTE_0F25) },
1093 { MOD_TABLE (MOD_0F26) },
1094 { "(bad)", { XX } },
1096 { "movapX", { XM, EXx } },
1097 { "movapX", { EXx, XM } },
1098 { PREFIX_TABLE (PREFIX_0F2A) },
1099 { PREFIX_TABLE (PREFIX_0F2B) },
1100 { PREFIX_TABLE (PREFIX_0F2C) },
1101 { PREFIX_TABLE (PREFIX_0F2D) },
1102 { PREFIX_TABLE (PREFIX_0F2E) },
1103 { PREFIX_TABLE (PREFIX_0F2F) },
1105 { "wrmsr", { XX } },
1106 { "rdtsc", { XX } },
1107 { "rdmsr", { XX } },
1108 { "rdpmc", { XX } },
1109 { "sysenter", { XX } },
1110 { "sysexit", { XX } },
1111 { "(bad)", { XX } },
1112 { "getsec", { XX } },
1114 { THREE_BYTE_TABLE (THREE_BYTE_0F38) },
1115 { "(bad)", { XX } },
1116 { THREE_BYTE_TABLE (THREE_BYTE_0F3A) },
1117 { "(bad)", { XX } },
1118 { "(bad)", { XX } },
1119 { "(bad)", { XX } },
1120 { "(bad)", { XX } },
1121 { "(bad)", { XX } },
1123 { "cmovo", { Gv, Ev } },
1124 { "cmovno", { Gv, Ev } },
1125 { "cmovb", { Gv, Ev } },
1126 { "cmovae", { Gv, Ev } },
1127 { "cmove", { Gv, Ev } },
1128 { "cmovne", { Gv, Ev } },
1129 { "cmovbe", { Gv, Ev } },
1130 { "cmova", { Gv, Ev } },
1132 { "cmovs", { Gv, Ev } },
1133 { "cmovns", { Gv, Ev } },
1134 { "cmovp", { Gv, Ev } },
1135 { "cmovnp", { Gv, Ev } },
1136 { "cmovl", { Gv, Ev } },
1137 { "cmovge", { Gv, Ev } },
1138 { "cmovle", { Gv, Ev } },
1139 { "cmovg", { Gv, Ev } },
1141 { MOD_TABLE (MOD_0F51) },
1142 { PREFIX_TABLE (PREFIX_0F51) },
1143 { PREFIX_TABLE (PREFIX_0F52) },
1144 { PREFIX_TABLE (PREFIX_0F53) },
1145 { "andpX", { XM, EXx } },
1146 { "andnpX", { XM, EXx } },
1147 { "orpX", { XM, EXx } },
1148 { "xorpX", { XM, EXx } },
1150 { PREFIX_TABLE (PREFIX_0F58) },
1151 { PREFIX_TABLE (PREFIX_0F59) },
1152 { PREFIX_TABLE (PREFIX_0F5A) },
1153 { PREFIX_TABLE (PREFIX_0F5B) },
1154 { PREFIX_TABLE (PREFIX_0F5C) },
1155 { PREFIX_TABLE (PREFIX_0F5D) },
1156 { PREFIX_TABLE (PREFIX_0F5E) },
1157 { PREFIX_TABLE (PREFIX_0F5F) },
1159 { PREFIX_TABLE (PREFIX_0F60) },
1160 { PREFIX_TABLE (PREFIX_0F61) },
1161 { PREFIX_TABLE (PREFIX_0F62) },
1162 { "packsswb", { MX, EM } },
1163 { "pcmpgtb", { MX, EM } },
1164 { "pcmpgtw", { MX, EM } },
1165 { "pcmpgtd", { MX, EM } },
1166 { "packuswb", { MX, EM } },
1168 { "punpckhbw", { MX, EM } },
1169 { "punpckhwd", { MX, EM } },
1170 { "punpckhdq", { MX, EM } },
1171 { "packssdw", { MX, EM } },
1172 { PREFIX_TABLE (PREFIX_0F6C) },
1173 { PREFIX_TABLE (PREFIX_0F6D) },
1174 { "movK", { MX, Edq } },
1175 { PREFIX_TABLE (PREFIX_0F6F) },
1177 { PREFIX_TABLE (PREFIX_0F70) },
1178 { REG_TABLE (REG_0F71) },
1179 { REG_TABLE (REG_0F72) },
1180 { REG_TABLE (REG_0F73) },
1181 { "pcmpeqb", { MX, EM } },
1182 { "pcmpeqw", { MX, EM } },
1183 { "pcmpeqd", { MX, EM } },
1186 { PREFIX_TABLE (PREFIX_0F78) },
1187 { PREFIX_TABLE (PREFIX_0F79) },
1188 { THREE_BYTE_TABLE (THREE_BYTE_0F7A) },
1189 { THREE_BYTE_TABLE (THREE_BYTE_0F7B) },
1190 { PREFIX_TABLE (PREFIX_0F7C) },
1191 { PREFIX_TABLE (PREFIX_0F7D) },
1192 { PREFIX_TABLE (PREFIX_0F7E) },
1193 { PREFIX_TABLE (PREFIX_0F7F) },
1195 { "joH", { Jv, XX, cond_jump_flag } },
1196 { "jnoH", { Jv, XX, cond_jump_flag } },
1197 { "jbH", { Jv, XX, cond_jump_flag } },
1198 { "jaeH", { Jv, XX, cond_jump_flag } },
1199 { "jeH", { Jv, XX, cond_jump_flag } },
1200 { "jneH", { Jv, XX, cond_jump_flag } },
1201 { "jbeH", { Jv, XX, cond_jump_flag } },
1202 { "jaH", { Jv, XX, cond_jump_flag } },
1204 { "jsH", { Jv, XX, cond_jump_flag } },
1205 { "jnsH", { Jv, XX, cond_jump_flag } },
1206 { "jpH", { Jv, XX, cond_jump_flag } },
1207 { "jnpH", { Jv, XX, cond_jump_flag } },
1208 { "jlH", { Jv, XX, cond_jump_flag } },
1209 { "jgeH", { Jv, XX, cond_jump_flag } },
1210 { "jleH", { Jv, XX, cond_jump_flag } },
1211 { "jgH", { Jv, XX, cond_jump_flag } },
1214 { "setno", { Eb } },
1216 { "setae", { Eb } },
1218 { "setne", { Eb } },
1219 { "setbe", { Eb } },
1223 { "setns", { Eb } },
1225 { "setnp", { Eb } },
1227 { "setge", { Eb } },
1228 { "setle", { Eb } },
1231 { "pushT", { fs } },
1233 { "cpuid", { XX } },
1234 { "btS", { Ev, Gv } },
1235 { "shldS", { Ev, Gv, Ib } },
1236 { "shldS", { Ev, Gv, CL } },
1237 { REG_TABLE (REG_0FA6) },
1238 { REG_TABLE (REG_0FA7) },
1240 { "pushT", { gs } },
1243 { "btsS", { Ev, Gv } },
1244 { "shrdS", { Ev, Gv, Ib } },
1245 { "shrdS", { Ev, Gv, CL } },
1246 { REG_TABLE (REG_0FAE) },
1247 { "imulS", { Gv, Ev } },
1249 { "cmpxchgB", { Eb, Gb } },
1250 { "cmpxchgS", { Ev, Gv } },
1251 { MOD_TABLE (MOD_0FB2) },
1252 { "btrS", { Ev, Gv } },
1253 { MOD_TABLE (MOD_0FB4) },
1254 { MOD_TABLE (MOD_0FB5) },
1255 { "movz{bR|x}", { Gv, Eb } },
1256 { "movz{wR|x}", { Gv, Ew } }, /* yes, there really is movzww ! */
1258 { PREFIX_TABLE (PREFIX_0FB8) },
1260 { REG_TABLE (REG_0FBA) },
1261 { "btcS", { Ev, Gv } },
1262 { "bsfS", { Gv, Ev } },
1263 { PREFIX_TABLE (PREFIX_0FBD) },
1264 { "movs{bR|x}", { Gv, Eb } },
1265 { "movs{wR|x}", { Gv, Ew } }, /* yes, there really is movsww ! */
1267 { "xaddB", { Eb, Gb } },
1268 { "xaddS", { Ev, Gv } },
1269 { PREFIX_TABLE (PREFIX_0FC2) },
1270 { "movntiS", { Ev, Gv } },
1271 { "pinsrw", { MX, Edqw, Ib } },
1272 { "pextrw", { Gdq, MS, Ib } },
1273 { "shufpX", { XM, EXx, Ib } },
1274 { REG_TABLE (REG_0FC7) },
1276 { "bswap", { RMeAX } },
1277 { "bswap", { RMeCX } },
1278 { "bswap", { RMeDX } },
1279 { "bswap", { RMeBX } },
1280 { "bswap", { RMeSP } },
1281 { "bswap", { RMeBP } },
1282 { "bswap", { RMeSI } },
1283 { "bswap", { RMeDI } },
1285 { PREFIX_TABLE (PREFIX_0FD0) },
1286 { "psrlw", { MX, EM } },
1287 { "psrld", { MX, EM } },
1288 { "psrlq", { MX, EM } },
1289 { "paddq", { MX, EM } },
1290 { "pmullw", { MX, EM } },
1291 { PREFIX_TABLE (PREFIX_0FD6) },
1292 { MOD_TABLE (MOD_0FD7) },
1294 { "psubusb", { MX, EM } },
1295 { "psubusw", { MX, EM } },
1296 { "pminub", { MX, EM } },
1297 { "pand", { MX, EM } },
1298 { "paddusb", { MX, EM } },
1299 { "paddusw", { MX, EM } },
1300 { "pmaxub", { MX, EM } },
1301 { "pandn", { MX, EM } },
1303 { "pavgb", { MX, EM } },
1304 { "psraw", { MX, EM } },
1305 { "psrad", { MX, EM } },
1306 { "pavgw", { MX, EM } },
1307 { "pmulhuw", { MX, EM } },
1308 { "pmulhw", { MX, EM } },
1309 { PREFIX_TABLE (PREFIX_0FE6) },
1310 { PREFIX_TABLE (PREFIX_0FE7) },
1312 { "psubsb", { MX, EM } },
1313 { "psubsw", { MX, EM } },
1314 { "pminsw", { MX, EM } },
1315 { "por", { MX, EM } },
1316 { "paddsb", { MX, EM } },
1317 { "paddsw", { MX, EM } },
1318 { "pmaxsw", { MX, EM } },
1319 { "pxor", { MX, EM } },
1321 { PREFIX_TABLE (PREFIX_0FF0) },
1322 { "psllw", { MX, EM } },
1323 { "pslld", { MX, EM } },
1324 { "psllq", { MX, EM } },
1325 { "pmuludq", { MX, EM } },
1326 { "pmaddwd", { MX, EM } },
1327 { "psadbw", { MX, EM } },
1328 { PREFIX_TABLE (PREFIX_0FF7) },
1330 { "psubb", { MX, EM } },
1331 { "psubw", { MX, EM } },
1332 { "psubd", { MX, EM } },
1333 { "psubq", { MX, EM } },
1334 { "paddb", { MX, EM } },
1335 { "paddw", { MX, EM } },
1336 { "paddd", { MX, EM } },
1337 { "(bad)", { XX } },
1340 static const unsigned char onebyte_has_modrm[256] = {
1341 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1342 /* ------------------------------- */
1343 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
1344 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
1345 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
1346 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
1347 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
1348 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
1349 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
1350 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
1351 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
1352 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
1353 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
1354 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
1355 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
1356 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
1357 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
1358 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
1359 /* ------------------------------- */
1360 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1363 static const unsigned char twobyte_has_modrm[256] = {
1364 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1365 /* ------------------------------- */
1366 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
1367 /* 10 */ 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1, /* 1f */
1368 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
1369 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
1370 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
1371 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
1372 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
1373 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
1374 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
1375 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
1376 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
1377 /* b0 */ 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, /* bf */
1378 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
1379 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
1380 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
1381 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */
1382 /* ------------------------------- */
1383 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1386 static char obuf[100];
1388 static char scratchbuf[100];
1389 static unsigned char *start_codep;
1390 static unsigned char *insn_codep;
1391 static unsigned char *codep;
1392 static const char *lock_prefix;
1393 static const char *data_prefix;
1394 static const char *addr_prefix;
1395 static const char *repz_prefix;
1396 static const char *repnz_prefix;
1397 static disassemble_info *the_info;
1405 static unsigned char need_modrm;
1407 /* If we are accessing mod/rm/reg without need_modrm set, then the
1408 values are stale. Hitting this abort likely indicates that you
1409 need to update onebyte_has_modrm or twobyte_has_modrm. */
1410 #define MODRM_CHECK if (!need_modrm) abort ()
1412 static const char **names64;
1413 static const char **names32;
1414 static const char **names16;
1415 static const char **names8;
1416 static const char **names8rex;
1417 static const char **names_seg;
1418 static const char *index64;
1419 static const char *index32;
1420 static const char **index16;
1422 static const char *intel_names64[] = {
1423 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
1424 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
1426 static const char *intel_names32[] = {
1427 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
1428 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
1430 static const char *intel_names16[] = {
1431 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
1432 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
1434 static const char *intel_names8[] = {
1435 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
1437 static const char *intel_names8rex[] = {
1438 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
1439 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
1441 static const char *intel_names_seg[] = {
1442 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
1444 static const char *intel_index64 = "riz";
1445 static const char *intel_index32 = "eiz";
1446 static const char *intel_index16[] = {
1447 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
1450 static const char *att_names64[] = {
1451 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
1452 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
1454 static const char *att_names32[] = {
1455 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
1456 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
1458 static const char *att_names16[] = {
1459 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
1460 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
1462 static const char *att_names8[] = {
1463 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
1465 static const char *att_names8rex[] = {
1466 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
1467 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
1469 static const char *att_names_seg[] = {
1470 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
1472 static const char *att_index64 = "%riz";
1473 static const char *att_index32 = "%eiz";
1474 static const char *att_index16[] = {
1475 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
1478 static const struct dis386 reg_table[][8] = {
1481 { "addA", { Eb, Ib } },
1482 { "orA", { Eb, Ib } },
1483 { "adcA", { Eb, Ib } },
1484 { "sbbA", { Eb, Ib } },
1485 { "andA", { Eb, Ib } },
1486 { "subA", { Eb, Ib } },
1487 { "xorA", { Eb, Ib } },
1488 { "cmpA", { Eb, Ib } },
1492 { "addQ", { Ev, Iv } },
1493 { "orQ", { Ev, Iv } },
1494 { "adcQ", { Ev, Iv } },
1495 { "sbbQ", { Ev, Iv } },
1496 { "andQ", { Ev, Iv } },
1497 { "subQ", { Ev, Iv } },
1498 { "xorQ", { Ev, Iv } },
1499 { "cmpQ", { Ev, Iv } },
1503 { "addQ", { Ev, sIb } },
1504 { "orQ", { Ev, sIb } },
1505 { "adcQ", { Ev, sIb } },
1506 { "sbbQ", { Ev, sIb } },
1507 { "andQ", { Ev, sIb } },
1508 { "subQ", { Ev, sIb } },
1509 { "xorQ", { Ev, sIb } },
1510 { "cmpQ", { Ev, sIb } },
1514 { "popU", { stackEv } },
1515 { "(bad)", { XX } },
1516 { "(bad)", { XX } },
1517 { "(bad)", { XX } },
1518 { "(bad)", { XX } },
1519 { "(bad)", { XX } },
1520 { "(bad)", { XX } },
1521 { "(bad)", { XX } },
1525 { "rolA", { Eb, Ib } },
1526 { "rorA", { Eb, Ib } },
1527 { "rclA", { Eb, Ib } },
1528 { "rcrA", { Eb, Ib } },
1529 { "shlA", { Eb, Ib } },
1530 { "shrA", { Eb, Ib } },
1531 { "(bad)", { XX } },
1532 { "sarA", { Eb, Ib } },
1536 { "rolQ", { Ev, Ib } },
1537 { "rorQ", { Ev, Ib } },
1538 { "rclQ", { Ev, Ib } },
1539 { "rcrQ", { Ev, Ib } },
1540 { "shlQ", { Ev, Ib } },
1541 { "shrQ", { Ev, Ib } },
1542 { "(bad)", { XX } },
1543 { "sarQ", { Ev, Ib } },
1547 { "movA", { Eb, Ib } },
1548 { "(bad)", { XX } },
1549 { "(bad)", { XX } },
1550 { "(bad)", { XX } },
1551 { "(bad)", { XX } },
1552 { "(bad)", { XX } },
1553 { "(bad)", { XX } },
1554 { "(bad)", { XX } },
1558 { "movQ", { Ev, Iv } },
1559 { "(bad)", { XX } },
1560 { "(bad)", { XX } },
1561 { "(bad)", { XX } },
1562 { "(bad)", { XX } },
1563 { "(bad)", { XX } },
1564 { "(bad)", { XX } },
1565 { "(bad)", { XX } },
1569 { "rolA", { Eb, I1 } },
1570 { "rorA", { Eb, I1 } },
1571 { "rclA", { Eb, I1 } },
1572 { "rcrA", { Eb, I1 } },
1573 { "shlA", { Eb, I1 } },
1574 { "shrA", { Eb, I1 } },
1575 { "(bad)", { XX } },
1576 { "sarA", { Eb, I1 } },
1580 { "rolQ", { Ev, I1 } },
1581 { "rorQ", { Ev, I1 } },
1582 { "rclQ", { Ev, I1 } },
1583 { "rcrQ", { Ev, I1 } },
1584 { "shlQ", { Ev, I1 } },
1585 { "shrQ", { Ev, I1 } },
1586 { "(bad)", { XX } },
1587 { "sarQ", { Ev, I1 } },
1591 { "rolA", { Eb, CL } },
1592 { "rorA", { Eb, CL } },
1593 { "rclA", { Eb, CL } },
1594 { "rcrA", { Eb, CL } },
1595 { "shlA", { Eb, CL } },
1596 { "shrA", { Eb, CL } },
1597 { "(bad)", { XX } },
1598 { "sarA", { Eb, CL } },
1602 { "rolQ", { Ev, CL } },
1603 { "rorQ", { Ev, CL } },
1604 { "rclQ", { Ev, CL } },
1605 { "rcrQ", { Ev, CL } },
1606 { "shlQ", { Ev, CL } },
1607 { "shrQ", { Ev, CL } },
1608 { "(bad)", { XX } },
1609 { "sarQ", { Ev, CL } },
1613 { "testA", { Eb, Ib } },
1614 { "(bad)", { XX } },
1617 { "mulA", { Eb } }, /* Don't print the implicit %al register, */
1618 { "imulA", { Eb } }, /* to distinguish these opcodes from other */
1619 { "divA", { Eb } }, /* mul/imul opcodes. Do the same for div */
1620 { "idivA", { Eb } }, /* and idiv for consistency. */
1624 { "testQ", { Ev, Iv } },
1625 { "(bad)", { XX } },
1628 { "mulQ", { Ev } }, /* Don't print the implicit register. */
1629 { "imulQ", { Ev } },
1631 { "idivQ", { Ev } },
1637 { "(bad)", { XX } },
1638 { "(bad)", { XX } },
1639 { "(bad)", { XX } },
1640 { "(bad)", { XX } },
1641 { "(bad)", { XX } },
1642 { "(bad)", { XX } },
1648 { "callT", { indirEv } },
1649 { "JcallT", { indirEp } },
1650 { "jmpT", { indirEv } },
1651 { "JjmpT", { indirEp } },
1652 { "pushU", { stackEv } },
1653 { "(bad)", { XX } },
1657 { "sldtD", { Sv } },
1663 { "(bad)", { XX } },
1664 { "(bad)", { XX } },
1668 { MOD_TABLE (MOD_0F01_REG_0) },
1669 { MOD_TABLE (MOD_0F01_REG_1) },
1670 { MOD_TABLE (MOD_0F01_REG_2) },
1671 { MOD_TABLE (MOD_0F01_REG_3) },
1672 { "smswD", { Sv } },
1673 { "(bad)", { XX } },
1675 { MOD_TABLE (MOD_0F01_REG_7) },
1679 { "prefetch", { Eb } },
1680 { "prefetchw", { Eb } },
1681 { "(bad)", { XX } },
1682 { "(bad)", { XX } },
1683 { "(bad)", { XX } },
1684 { "(bad)", { XX } },
1685 { "(bad)", { XX } },
1686 { "(bad)", { XX } },
1690 { MOD_TABLE (MOD_0F18_REG_0) },
1691 { MOD_TABLE (MOD_0F18_REG_1) },
1692 { MOD_TABLE (MOD_0F18_REG_2) },
1693 { MOD_TABLE (MOD_0F18_REG_3) },
1694 { "(bad)", { XX } },
1695 { "(bad)", { XX } },
1696 { "(bad)", { XX } },
1697 { "(bad)", { XX } },
1701 { "(bad)", { XX } },
1702 { "(bad)", { XX } },
1703 { MOD_TABLE (MOD_0F71_REG_2) },
1704 { "(bad)", { XX } },
1705 { MOD_TABLE (MOD_0F71_REG_4) },
1706 { "(bad)", { XX } },
1707 { MOD_TABLE (MOD_0F71_REG_6) },
1708 { "(bad)", { XX } },
1712 { "(bad)", { XX } },
1713 { "(bad)", { XX } },
1714 { MOD_TABLE (MOD_0F72_REG_2) },
1715 { "(bad)", { XX } },
1716 { MOD_TABLE (MOD_0F72_REG_4) },
1717 { "(bad)", { XX } },
1718 { MOD_TABLE (MOD_0F72_REG_6) },
1719 { "(bad)", { XX } },
1723 { "(bad)", { XX } },
1724 { "(bad)", { XX } },
1725 { MOD_TABLE (MOD_0F73_REG_2) },
1726 { MOD_TABLE (MOD_0F73_REG_3) },
1727 { "(bad)", { XX } },
1728 { "(bad)", { XX } },
1729 { MOD_TABLE (MOD_0F73_REG_6) },
1730 { MOD_TABLE (MOD_0F73_REG_7) },
1734 { "montmul", { { OP_0f07, 0 } } },
1735 { "xsha1", { { OP_0f07, 0 } } },
1736 { "xsha256", { { OP_0f07, 0 } } },
1737 { "(bad)", { { OP_0f07, 0 } } },
1738 { "(bad)", { { OP_0f07, 0 } } },
1739 { "(bad)", { { OP_0f07, 0 } } },
1740 { "(bad)", { { OP_0f07, 0 } } },
1741 { "(bad)", { { OP_0f07, 0 } } },
1745 { "xstore-rng", { { OP_0f07, 0 } } },
1746 { "xcrypt-ecb", { { OP_0f07, 0 } } },
1747 { "xcrypt-cbc", { { OP_0f07, 0 } } },
1748 { "xcrypt-ctr", { { OP_0f07, 0 } } },
1749 { "xcrypt-cfb", { { OP_0f07, 0 } } },
1750 { "xcrypt-ofb", { { OP_0f07, 0 } } },
1751 { "(bad)", { { OP_0f07, 0 } } },
1752 { "(bad)", { { OP_0f07, 0 } } },
1756 { MOD_TABLE (MOD_0FAE_REG_0) },
1757 { MOD_TABLE (MOD_0FAE_REG_1) },
1758 { MOD_TABLE (MOD_0FAE_REG_2) },
1759 { MOD_TABLE (MOD_0FAE_REG_3) },
1760 { "(bad)", { XX } },
1761 { MOD_TABLE (MOD_0FAE_REG_5) },
1762 { MOD_TABLE (MOD_0FAE_REG_6) },
1763 { MOD_TABLE (MOD_0FAE_REG_7) },
1767 { "(bad)", { XX } },
1768 { "(bad)", { XX } },
1769 { "(bad)", { XX } },
1770 { "(bad)", { XX } },
1771 { "btQ", { Ev, Ib } },
1772 { "btsQ", { Ev, Ib } },
1773 { "btrQ", { Ev, Ib } },
1774 { "btcQ", { Ev, Ib } },
1778 { "(bad)", { XX } },
1779 { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } } },
1780 { "(bad)", { XX } },
1781 { "(bad)", { XX } },
1782 { "(bad)", { XX } },
1783 { "(bad)", { XX } },
1784 { MOD_TABLE (MOD_0FC7_REG_6) },
1785 { MOD_TABLE (MOD_0FC7_REG_7) },
1789 static const struct dis386 prefix_table[][4] = {
1792 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
1793 { "pause", { XX } },
1794 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
1795 { "(bad)", { XX } },
1800 { "movups", { XM, EXx } },
1801 { "movss", { XM, EXd } },
1802 { "movupd", { XM, EXx } },
1803 { "movsd", { XM, EXq } },
1808 { "movups", { EXx, XM } },
1809 { "movss", { EXd, XM } },
1810 { "movupd", { EXx, XM } },
1811 { "movsd", { EXq, XM } },
1816 { MOD_TABLE (MOD_0F12_PREFIX_0) },
1817 { "movsldup", { XM, EXx } },
1818 { "movlpd", { XM, EXq } },
1819 { "movddup", { XM, EXq } },
1824 { MOD_TABLE (MOD_0F16_PREFIX_0) },
1825 { "movshdup", { XM, EXx } },
1826 { "movhpd", { XM, EXq } },
1827 { "(bad)", { XX } },
1832 { "cvtpi2ps", { XM, EMCq } },
1833 { "cvtsi2ssY", { XM, Ev } },
1834 { "cvtpi2pd", { XM, EMCq } },
1835 { "cvtsi2sdY", { XM, Ev } },
1840 { MOD_TABLE (MOD_0F2B_PREFIX_0) },
1841 { MOD_TABLE (MOD_0F2B_PREFIX_1) },
1842 { MOD_TABLE (MOD_0F2B_PREFIX_2) },
1843 { MOD_TABLE (MOD_0F2B_PREFIX_3) },
1848 { "cvttps2pi", { MXC, EXq } },
1849 { "cvttss2siY", { Gv, EXd } },
1850 { "cvttpd2pi", { MXC, EXx } },
1851 { "cvttsd2siY", { Gv, EXq } },
1856 { "cvtps2pi", { MXC, EXq } },
1857 { "cvtss2siY", { Gv, EXd } },
1858 { "cvtpd2pi", { MXC, EXx } },
1859 { "cvtsd2siY", { Gv, EXq } },
1864 { "ucomiss",{ XM, EXd } },
1865 { "(bad)", { XX } },
1866 { "ucomisd",{ XM, EXq } },
1867 { "(bad)", { XX } },
1872 { "comiss", { XM, EXd } },
1873 { "(bad)", { XX } },
1874 { "comisd", { XM, EXq } },
1875 { "(bad)", { XX } },
1880 { "sqrtps", { XM, EXx } },
1881 { "sqrtss", { XM, EXd } },
1882 { "sqrtpd", { XM, EXx } },
1883 { "sqrtsd", { XM, EXq } },
1888 { "rsqrtps",{ XM, EXx } },
1889 { "rsqrtss",{ XM, EXd } },
1890 { "(bad)", { XX } },
1891 { "(bad)", { XX } },
1896 { "rcpps", { XM, EXx } },
1897 { "rcpss", { XM, EXd } },
1898 { "(bad)", { XX } },
1899 { "(bad)", { XX } },
1904 { "addps", { XM, EXx } },
1905 { "addss", { XM, EXd } },
1906 { "addpd", { XM, EXx } },
1907 { "addsd", { XM, EXq } },
1912 { "mulps", { XM, EXx } },
1913 { "mulss", { XM, EXd } },
1914 { "mulpd", { XM, EXx } },
1915 { "mulsd", { XM, EXq } },
1920 { "cvtps2pd", { XM, EXq } },
1921 { "cvtss2sd", { XM, EXd } },
1922 { "cvtpd2ps", { XM, EXx } },
1923 { "cvtsd2ss", { XM, EXq } },
1928 { "cvtdq2ps", { XM, EXx } },
1929 { "cvttps2dq", { XM, EXx } },
1930 { "cvtps2dq", { XM, EXx } },
1931 { "(bad)", { XX } },
1936 { "subps", { XM, EXx } },
1937 { "subss", { XM, EXd } },
1938 { "subpd", { XM, EXx } },
1939 { "subsd", { XM, EXq } },
1944 { "minps", { XM, EXx } },
1945 { "minss", { XM, EXd } },
1946 { "minpd", { XM, EXx } },
1947 { "minsd", { XM, EXq } },
1952 { "divps", { XM, EXx } },
1953 { "divss", { XM, EXd } },
1954 { "divpd", { XM, EXx } },
1955 { "divsd", { XM, EXq } },
1960 { "maxps", { XM, EXx } },
1961 { "maxss", { XM, EXd } },
1962 { "maxpd", { XM, EXx } },
1963 { "maxsd", { XM, EXq } },
1968 { "punpcklbw",{ MX, EMd } },
1969 { "(bad)", { XX } },
1970 { "punpcklbw",{ MX, EMx } },
1971 { "(bad)", { XX } },
1976 { "punpcklwd",{ MX, EMd } },
1977 { "(bad)", { XX } },
1978 { "punpcklwd",{ MX, EMx } },
1979 { "(bad)", { XX } },
1984 { "punpckldq",{ MX, EMd } },
1985 { "(bad)", { XX } },
1986 { "punpckldq",{ MX, EMx } },
1987 { "(bad)", { XX } },
1992 { "(bad)", { XX } },
1993 { "(bad)", { XX } },
1994 { "punpcklqdq", { XM, EXx } },
1995 { "(bad)", { XX } },
2000 { "(bad)", { XX } },
2001 { "(bad)", { XX } },
2002 { "punpckhqdq", { XM, EXx } },
2003 { "(bad)", { XX } },
2008 { "movq", { MX, EM } },
2009 { "movdqu", { XM, EXx } },
2010 { "movdqa", { XM, EXx } },
2011 { "(bad)", { XX } },
2016 { "pshufw", { MX, EM, Ib } },
2017 { "pshufhw",{ XM, EXx, Ib } },
2018 { "pshufd", { XM, EXx, Ib } },
2019 { "pshuflw",{ XM, EXx, Ib } },
2022 /* PREFIX_0F73_REG_3 */
2024 { "(bad)", { XX } },
2025 { "(bad)", { XX } },
2026 { "psrldq", { XS, Ib } },
2027 { "(bad)", { XX } },
2030 /* PREFIX_0F73_REG_7 */
2032 { "(bad)", { XX } },
2033 { "(bad)", { XX } },
2034 { "pslldq", { XS, Ib } },
2035 { "(bad)", { XX } },
2040 {"vmread", { Em, Gm } },
2042 {"extrq", { XS, Ib, Ib } },
2043 {"insertq", { XM, XS, Ib, Ib } },
2048 {"vmwrite", { Gm, Em } },
2050 {"extrq", { XM, XS } },
2051 {"insertq", { XM, XS } },
2056 { "(bad)", { XX } },
2057 { "(bad)", { XX } },
2058 { "haddpd", { XM, EXx } },
2059 { "haddps", { XM, EXx } },
2064 { "(bad)", { XX } },
2065 { "(bad)", { XX } },
2066 { "hsubpd", { XM, EXx } },
2067 { "hsubps", { XM, EXx } },
2072 { "movK", { Edq, MX } },
2073 { "movq", { XM, EXq } },
2074 { "movK", { Edq, XM } },
2075 { "(bad)", { XX } },
2080 { "movq", { EM, MX } },
2081 { "movdqu", { EXx, XM } },
2082 { "movdqa", { EXx, XM } },
2083 { "(bad)", { XX } },
2088 { "(bad)", { XX } },
2089 { "popcntS", { Gv, Ev } },
2090 { "(bad)", { XX } },
2091 { "(bad)", { XX } },
2096 { "bsrS", { Gv, Ev } },
2097 { "lzcntS", { Gv, Ev } },
2098 { "bsrS", { Gv, Ev } },
2099 { "(bad)", { XX } },
2104 { "cmpps", { XM, EXx, CMP } },
2105 { "cmpss", { XM, EXd, CMP } },
2106 { "cmppd", { XM, EXx, CMP } },
2107 { "cmpsd", { XM, EXq, CMP } },
2110 /* PREFIX_0FC7_REG_6 */
2112 { "vmptrld",{ Mq } },
2113 { "vmxon", { Mq } },
2114 { "vmclear",{ Mq } },
2115 { "(bad)", { XX } },
2120 { "(bad)", { XX } },
2121 { "(bad)", { XX } },
2122 { "addsubpd", { XM, EXx } },
2123 { "addsubps", { XM, EXx } },
2128 { "(bad)", { XX } },
2129 { "movq2dq",{ XM, MS } },
2130 { "movq", { EXq, XM } },
2131 { "movdq2q",{ MX, XS } },
2136 { "(bad)", { XX } },
2137 { "cvtdq2pd", { XM, EXq } },
2138 { "cvttpd2dq", { XM, EXx } },
2139 { "cvtpd2dq", { XM, EXx } },
2144 { "movntq", { EM, MX } },
2145 { "(bad)", { XX } },
2146 { MOD_TABLE (MOD_0FE7_PREFIX_2) },
2147 { "(bad)", { XX } },
2152 { "(bad)", { XX } },
2153 { "(bad)", { XX } },
2154 { "(bad)", { XX } },
2155 { MOD_TABLE (MOD_0FF0_PREFIX_3) },
2160 { "maskmovq", { MX, MS } },
2161 { "(bad)", { XX } },
2162 { "maskmovdqu", { XM, XS } },
2163 { "(bad)", { XX } },
2168 { "(bad)", { XX } },
2169 { "(bad)", { XX } },
2170 { "pblendvb", { XM, EXx, XMM0 } },
2171 { "(bad)", { XX } },
2176 { "(bad)", { XX } },
2177 { "(bad)", { XX } },
2178 { "blendvps", { XM, EXx, XMM0 } },
2179 { "(bad)", { XX } },
2184 { "(bad)", { XX } },
2185 { "(bad)", { XX } },
2186 { "blendvpd", { XM, EXx, XMM0 } },
2187 { "(bad)", { XX } },
2192 { "(bad)", { XX } },
2193 { "(bad)", { XX } },
2194 { "ptest", { XM, EXx } },
2195 { "(bad)", { XX } },
2200 { "(bad)", { XX } },
2201 { "(bad)", { XX } },
2202 { "pmovsxbw", { XM, EXq } },
2203 { "(bad)", { XX } },
2208 { "(bad)", { XX } },
2209 { "(bad)", { XX } },
2210 { "pmovsxbd", { XM, EXd } },
2211 { "(bad)", { XX } },
2216 { "(bad)", { XX } },
2217 { "(bad)", { XX } },
2218 { "pmovsxbq", { XM, EXw } },
2219 { "(bad)", { XX } },
2224 { "(bad)", { XX } },
2225 { "(bad)", { XX } },
2226 { "pmovsxwd", { XM, EXq } },
2227 { "(bad)", { XX } },
2232 { "(bad)", { XX } },
2233 { "(bad)", { XX } },
2234 { "pmovsxwq", { XM, EXd } },
2235 { "(bad)", { XX } },
2240 { "(bad)", { XX } },
2241 { "(bad)", { XX } },
2242 { "pmovsxdq", { XM, EXq } },
2243 { "(bad)", { XX } },
2248 { "(bad)", { XX } },
2249 { "(bad)", { XX } },
2250 { "pmuldq", { XM, EXx } },
2251 { "(bad)", { XX } },
2256 { "(bad)", { XX } },
2257 { "(bad)", { XX } },
2258 { "pcmpeqq", { XM, EXx } },
2259 { "(bad)", { XX } },
2264 { "(bad)", { XX } },
2265 { "(bad)", { XX } },
2266 { MOD_TABLE (MOD_0F382A_PREFIX_2) },
2267 { "(bad)", { XX } },
2272 { "(bad)", { XX } },
2273 { "(bad)", { XX } },
2274 { "packusdw", { XM, EXx } },
2275 { "(bad)", { XX } },
2280 { "(bad)", { XX } },
2281 { "(bad)", { XX } },
2282 { "pmovzxbw", { XM, EXq } },
2283 { "(bad)", { XX } },
2288 { "(bad)", { XX } },
2289 { "(bad)", { XX } },
2290 { "pmovzxbd", { XM, EXd } },
2291 { "(bad)", { XX } },
2296 { "(bad)", { XX } },
2297 { "(bad)", { XX } },
2298 { "pmovzxbq", { XM, EXw } },
2299 { "(bad)", { XX } },
2304 { "(bad)", { XX } },
2305 { "(bad)", { XX } },
2306 { "pmovzxwd", { XM, EXq } },
2307 { "(bad)", { XX } },
2312 { "(bad)", { XX } },
2313 { "(bad)", { XX } },
2314 { "pmovzxwq", { XM, EXd } },
2315 { "(bad)", { XX } },
2320 { "(bad)", { XX } },
2321 { "(bad)", { XX } },
2322 { "pmovzxdq", { XM, EXq } },
2323 { "(bad)", { XX } },
2328 { "(bad)", { XX } },
2329 { "(bad)", { XX } },
2330 { "pcmpgtq", { XM, EXx } },
2331 { "(bad)", { XX } },
2336 { "(bad)", { XX } },
2337 { "(bad)", { XX } },
2338 { "pminsb", { XM, EXx } },
2339 { "(bad)", { XX } },
2344 { "(bad)", { XX } },
2345 { "(bad)", { XX } },
2346 { "pminsd", { XM, EXx } },
2347 { "(bad)", { XX } },
2352 { "(bad)", { XX } },
2353 { "(bad)", { XX } },
2354 { "pminuw", { XM, EXx } },
2355 { "(bad)", { XX } },
2360 { "(bad)", { XX } },
2361 { "(bad)", { XX } },
2362 { "pminud", { XM, EXx } },
2363 { "(bad)", { XX } },
2368 { "(bad)", { XX } },
2369 { "(bad)", { XX } },
2370 { "pmaxsb", { XM, EXx } },
2371 { "(bad)", { XX } },
2376 { "(bad)", { XX } },
2377 { "(bad)", { XX } },
2378 { "pmaxsd", { XM, EXx } },
2379 { "(bad)", { XX } },
2384 { "(bad)", { XX } },
2385 { "(bad)", { XX } },
2386 { "pmaxuw", { XM, EXx } },
2387 { "(bad)", { XX } },
2392 { "(bad)", { XX } },
2393 { "(bad)", { XX } },
2394 { "pmaxud", { XM, EXx } },
2395 { "(bad)", { XX } },
2400 { "(bad)", { XX } },
2401 { "(bad)", { XX } },
2402 { "pmulld", { XM, EXx } },
2403 { "(bad)", { XX } },
2408 { "(bad)", { XX } },
2409 { "(bad)", { XX } },
2410 { "phminposuw", { XM, EXx } },
2411 { "(bad)", { XX } },
2416 { "(bad)", { XX } },
2417 { "(bad)", { XX } },
2418 { "(bad)", { XX } },
2419 { "crc32", { Gdq, { CRC32_Fixup, b_mode } } },
2424 { "(bad)", { XX } },
2425 { "(bad)", { XX } },
2426 { "(bad)", { XX } },
2427 { "crc32", { Gdq, { CRC32_Fixup, v_mode } } },
2432 { "(bad)", { XX } },
2433 { "(bad)", { XX } },
2434 { "roundps", { XM, EXx, Ib } },
2435 { "(bad)", { XX } },
2440 { "(bad)", { XX } },
2441 { "(bad)", { XX } },
2442 { "roundpd", { XM, EXx, Ib } },
2443 { "(bad)", { XX } },
2448 { "(bad)", { XX } },
2449 { "(bad)", { XX } },
2450 { "roundss", { XM, EXd, Ib } },
2451 { "(bad)", { XX } },
2456 { "(bad)", { XX } },
2457 { "(bad)", { XX } },
2458 { "roundsd", { XM, EXq, Ib } },
2459 { "(bad)", { XX } },
2464 { "(bad)", { XX } },
2465 { "(bad)", { XX } },
2466 { "blendps", { XM, EXx, Ib } },
2467 { "(bad)", { XX } },
2472 { "(bad)", { XX } },
2473 { "(bad)", { XX } },
2474 { "blendpd", { XM, EXx, Ib } },
2475 { "(bad)", { XX } },
2480 { "(bad)", { XX } },
2481 { "(bad)", { XX } },
2482 { "pblendw", { XM, EXx, Ib } },
2483 { "(bad)", { XX } },
2488 { "(bad)", { XX } },
2489 { "(bad)", { XX } },
2490 { "pextrb", { Edqb, XM, Ib } },
2491 { "(bad)", { XX } },
2496 { "(bad)", { XX } },
2497 { "(bad)", { XX } },
2498 { "pextrw", { Edqw, XM, Ib } },
2499 { "(bad)", { XX } },
2504 { "(bad)", { XX } },
2505 { "(bad)", { XX } },
2506 { "pextrK", { Edq, XM, Ib } },
2507 { "(bad)", { XX } },
2512 { "(bad)", { XX } },
2513 { "(bad)", { XX } },
2514 { "extractps", { Edqd, XM, Ib } },
2515 { "(bad)", { XX } },
2520 { "(bad)", { XX } },
2521 { "(bad)", { XX } },
2522 { "pinsrb", { XM, Edqb, Ib } },
2523 { "(bad)", { XX } },
2528 { "(bad)", { XX } },
2529 { "(bad)", { XX } },
2530 { "insertps", { XM, EXd, Ib } },
2531 { "(bad)", { XX } },
2536 { "(bad)", { XX } },
2537 { "(bad)", { XX } },
2538 { "pinsrK", { XM, Edq, Ib } },
2539 { "(bad)", { XX } },
2544 { "(bad)", { XX } },
2545 { "(bad)", { XX } },
2546 { "dpps", { XM, EXx, Ib } },
2547 { "(bad)", { XX } },
2552 { "(bad)", { XX } },
2553 { "(bad)", { XX } },
2554 { "dppd", { XM, EXx, Ib } },
2555 { "(bad)", { XX } },
2560 { "(bad)", { XX } },
2561 { "(bad)", { XX } },
2562 { "mpsadbw", { XM, EXx, Ib } },
2563 { "(bad)", { XX } },
2568 { "(bad)", { XX } },
2569 { "(bad)", { XX } },
2570 { "pcmpestrm", { XM, EXx, Ib } },
2571 { "(bad)", { XX } },
2576 { "(bad)", { XX } },
2577 { "(bad)", { XX } },
2578 { "pcmpestri", { XM, EXx, Ib } },
2579 { "(bad)", { XX } },
2584 { "(bad)", { XX } },
2585 { "(bad)", { XX } },
2586 { "pcmpistrm", { XM, EXx, Ib } },
2587 { "(bad)", { XX } },
2592 { "(bad)", { XX } },
2593 { "(bad)", { XX } },
2594 { "pcmpistri", { XM, EXx, Ib } },
2595 { "(bad)", { XX } },
2599 static const struct dis386 x86_64_table[][2] = {
2602 { "push{T|}", { es } },
2603 { "(bad)", { XX } },
2608 { "pop{T|}", { es } },
2609 { "(bad)", { XX } },
2614 { "push{T|}", { cs } },
2615 { "(bad)", { XX } },
2620 { "push{T|}", { ss } },
2621 { "(bad)", { XX } },
2626 { "pop{T|}", { ss } },
2627 { "(bad)", { XX } },
2632 { "push{T|}", { ds } },
2633 { "(bad)", { XX } },
2638 { "pop{T|}", { ds } },
2639 { "(bad)", { XX } },
2645 { "(bad)", { XX } },
2651 { "(bad)", { XX } },
2657 { "(bad)", { XX } },
2663 { "(bad)", { XX } },
2668 { "pusha{P|}", { XX } },
2669 { "(bad)", { XX } },
2674 { "popa{P|}", { XX } },
2675 { "(bad)", { XX } },
2680 { MOD_TABLE (MOD_62_32BIT) },
2681 { "(bad)", { XX } },
2686 { "arpl", { Ew, Gw } },
2687 { "movs{lq|xd}", { Gv, Ed } },
2692 { "ins{R|}", { Yzr, indirDX } },
2693 { "ins{G|}", { Yzr, indirDX } },
2698 { "outs{R|}", { indirDXr, Xz } },
2699 { "outs{G|}", { indirDXr, Xz } },
2704 { "Jcall{T|}", { Ap } },
2705 { "(bad)", { XX } },
2710 { MOD_TABLE (MOD_C4_32BIT) },
2711 { "(bad)", { XX } },
2716 { MOD_TABLE (MOD_C5_32BIT) },
2717 { "(bad)", { XX } },
2723 { "(bad)", { XX } },
2729 { "(bad)", { XX } },
2735 { "(bad)", { XX } },
2740 { "Jjmp{T|}", { Ap } },
2741 { "(bad)", { XX } },
2744 /* X86_64_0F01_REG_0 */
2746 { "sgdt{Q|IQ}", { M } },
2750 /* X86_64_0F01_REG_1 */
2752 { "sidt{Q|IQ}", { M } },
2756 /* X86_64_0F01_REG_2 */
2758 { "lgdt{Q|Q}", { M } },
2762 /* X86_64_0F01_REG_3 */
2764 { "lidt{Q|Q}", { M } },
2769 static const struct dis386 three_byte_table[][256] = {
2770 /* THREE_BYTE_0F24 */
2773 { "fmaddps", { { OP_DREX4, q_mode } } },
2774 { "fmaddpd", { { OP_DREX4, q_mode } } },
2775 { "fmaddss", { { OP_DREX4, w_mode } } },
2776 { "fmaddsd", { { OP_DREX4, d_mode } } },
2777 { "fmaddps", { { OP_DREX4, DREX_OC1 + q_mode } } },
2778 { "fmaddpd", { { OP_DREX4, DREX_OC1 + q_mode } } },
2779 { "fmaddss", { { OP_DREX4, DREX_OC1 + w_mode } } },
2780 { "fmaddsd", { { OP_DREX4, DREX_OC1 + d_mode } } },
2782 { "fmsubps", { { OP_DREX4, q_mode } } },
2783 { "fmsubpd", { { OP_DREX4, q_mode } } },
2784 { "fmsubss", { { OP_DREX4, w_mode } } },
2785 { "fmsubsd", { { OP_DREX4, d_mode } } },
2786 { "fmsubps", { { OP_DREX4, DREX_OC1 + q_mode } } },
2787 { "fmsubpd", { { OP_DREX4, DREX_OC1 + q_mode } } },
2788 { "fmsubss", { { OP_DREX4, DREX_OC1 + w_mode } } },
2789 { "fmsubsd", { { OP_DREX4, DREX_OC1 + d_mode } } },
2791 { "fnmaddps", { { OP_DREX4, q_mode } } },
2792 { "fnmaddpd", { { OP_DREX4, q_mode } } },
2793 { "fnmaddss", { { OP_DREX4, w_mode } } },
2794 { "fnmaddsd", { { OP_DREX4, d_mode } } },
2795 { "fnmaddps", { { OP_DREX4, DREX_OC1 + q_mode } } },
2796 { "fnmaddpd", { { OP_DREX4, DREX_OC1 + q_mode } } },
2797 { "fnmaddss", { { OP_DREX4, DREX_OC1 + w_mode } } },
2798 { "fnmaddsd", { { OP_DREX4, DREX_OC1 + d_mode } } },
2800 { "fnmsubps", { { OP_DREX4, q_mode } } },
2801 { "fnmsubpd", { { OP_DREX4, q_mode } } },
2802 { "fnmsubss", { { OP_DREX4, w_mode } } },
2803 { "fnmsubsd", { { OP_DREX4, d_mode } } },
2804 { "fnmsubps", { { OP_DREX4, DREX_OC1 + q_mode } } },
2805 { "fnmsubpd", { { OP_DREX4, DREX_OC1 + q_mode } } },
2806 { "fnmsubss", { { OP_DREX4, DREX_OC1 + w_mode } } },
2807 { "fnmsubsd", { { OP_DREX4, DREX_OC1 + d_mode } } },
2809 { "permps", { { OP_DREX4, q_mode } } },
2810 { "permpd", { { OP_DREX4, q_mode } } },
2811 { "pcmov", { { OP_DREX4, q_mode } } },
2812 { "pperm", { { OP_DREX4, q_mode } } },
2813 { "permps", { { OP_DREX4, DREX_OC1 + q_mode } } },
2814 { "permpd", { { OP_DREX4, DREX_OC1 + q_mode } } },
2815 { "pcmov", { { OP_DREX4, DREX_OC1 + w_mode } } },
2816 { "pperm", { { OP_DREX4, DREX_OC1 + d_mode } } },
2818 { "(bad)", { XX } },
2819 { "(bad)", { XX } },
2820 { "(bad)", { XX } },
2821 { "(bad)", { XX } },
2822 { "(bad)", { XX } },
2823 { "(bad)", { XX } },
2824 { "(bad)", { XX } },
2825 { "(bad)", { XX } },
2827 { "(bad)", { XX } },
2828 { "(bad)", { XX } },
2829 { "(bad)", { XX } },
2830 { "(bad)", { XX } },
2831 { "(bad)", { XX } },
2832 { "(bad)", { XX } },
2833 { "(bad)", { XX } },
2834 { "(bad)", { XX } },
2836 { "(bad)", { XX } },
2837 { "(bad)", { XX } },
2838 { "(bad)", { XX } },
2839 { "(bad)", { XX } },
2840 { "(bad)", { XX } },
2841 { "(bad)", { XX } },
2842 { "(bad)", { XX } },
2843 { "(bad)", { XX } },
2845 { "protb", { { OP_DREX3, q_mode } } },
2846 { "protw", { { OP_DREX3, q_mode } } },
2847 { "protd", { { OP_DREX3, q_mode } } },
2848 { "protq", { { OP_DREX3, q_mode } } },
2849 { "pshlb", { { OP_DREX3, q_mode } } },
2850 { "pshlw", { { OP_DREX3, q_mode } } },
2851 { "pshld", { { OP_DREX3, q_mode } } },
2852 { "pshlq", { { OP_DREX3, q_mode } } },
2854 { "pshab", { { OP_DREX3, q_mode } } },
2855 { "pshaw", { { OP_DREX3, q_mode } } },
2856 { "pshad", { { OP_DREX3, q_mode } } },
2857 { "pshaq", { { OP_DREX3, q_mode } } },
2858 { "(bad)", { XX } },
2859 { "(bad)", { XX } },
2860 { "(bad)", { XX } },
2861 { "(bad)", { XX } },
2863 { "(bad)", { XX } },
2864 { "(bad)", { XX } },
2865 { "(bad)", { XX } },
2866 { "(bad)", { XX } },
2867 { "(bad)", { XX } },
2868 { "(bad)", { XX } },
2869 { "(bad)", { XX } },
2870 { "(bad)", { XX } },
2872 { "(bad)", { XX } },
2873 { "(bad)", { XX } },
2874 { "(bad)", { XX } },
2875 { "(bad)", { XX } },
2876 { "(bad)", { XX } },
2877 { "(bad)", { XX } },
2878 { "(bad)", { XX } },
2879 { "(bad)", { XX } },
2881 { "(bad)", { XX } },
2882 { "(bad)", { XX } },
2883 { "(bad)", { XX } },
2884 { "(bad)", { XX } },
2885 { "(bad)", { XX } },
2886 { "(bad)", { XX } },
2887 { "(bad)", { XX } },
2888 { "(bad)", { XX } },
2890 { "(bad)", { XX } },
2891 { "(bad)", { XX } },
2892 { "(bad)", { XX } },
2893 { "(bad)", { XX } },
2894 { "(bad)", { XX } },
2895 { "(bad)", { XX } },
2896 { "(bad)", { XX } },
2897 { "(bad)", { XX } },
2899 { "(bad)", { XX } },
2900 { "(bad)", { XX } },
2901 { "(bad)", { XX } },
2902 { "(bad)", { XX } },
2903 { "(bad)", { XX } },
2904 { "(bad)", { XX } },
2905 { "(bad)", { XX } },
2906 { "(bad)", { XX } },
2908 { "(bad)", { XX } },
2909 { "(bad)", { XX } },
2910 { "(bad)", { XX } },
2911 { "(bad)", { XX } },
2912 { "(bad)", { XX } },
2913 { "(bad)", { XX } },
2914 { "(bad)", { XX } },
2915 { "(bad)", { XX } },
2917 { "(bad)", { XX } },
2918 { "(bad)", { XX } },
2919 { "(bad)", { XX } },
2920 { "(bad)", { XX } },
2921 { "(bad)", { XX } },
2922 { "pmacssww", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2923 { "pmacsswd", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2924 { "pmacssdql", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2926 { "(bad)", { XX } },
2927 { "(bad)", { XX } },
2928 { "(bad)", { XX } },
2929 { "(bad)", { XX } },
2930 { "(bad)", { XX } },
2931 { "(bad)", { XX } },
2932 { "pmacssdd", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2933 { "pmacssdqh", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2935 { "(bad)", { XX } },
2936 { "(bad)", { XX } },
2937 { "(bad)", { XX } },
2938 { "(bad)", { XX } },
2939 { "(bad)", { XX } },
2940 { "pmacsww", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2941 { "pmacswd", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2942 { "pmacsdql", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2944 { "(bad)", { XX } },
2945 { "(bad)", { XX } },
2946 { "(bad)", { XX } },
2947 { "(bad)", { XX } },
2948 { "(bad)", { XX } },
2949 { "(bad)", { XX } },
2950 { "pmacsdd", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2951 { "pmacsdqh", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2953 { "(bad)", { XX } },
2954 { "(bad)", { XX } },
2955 { "(bad)", { XX } },
2956 { "(bad)", { XX } },
2957 { "(bad)", { XX } },
2958 { "(bad)", { XX } },
2959 { "pmadcsswd", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2960 { "(bad)", { XX } },
2962 { "(bad)", { XX } },
2963 { "(bad)", { XX } },
2964 { "(bad)", { XX } },
2965 { "(bad)", { XX } },
2966 { "(bad)", { XX } },
2967 { "(bad)", { XX } },
2968 { "(bad)", { XX } },
2969 { "(bad)", { XX } },
2971 { "(bad)", { XX } },
2972 { "(bad)", { XX } },
2973 { "(bad)", { XX } },
2974 { "(bad)", { XX } },
2975 { "(bad)", { XX } },
2976 { "(bad)", { XX } },
2977 { "pmadcswd", { { OP_DREX4, DREX_OC1 + DREX_NO_OC0 + q_mode } } },
2978 { "(bad)", { XX } },
2980 { "(bad)", { XX } },
2981 { "(bad)", { XX } },
2982 { "(bad)", { XX } },
2983 { "(bad)", { XX } },
2984 { "(bad)", { XX } },
2985 { "(bad)", { XX } },
2986 { "(bad)", { XX } },
2987 { "(bad)", { XX } },
2989 { "(bad)", { XX } },
2990 { "(bad)", { XX } },
2991 { "(bad)", { XX } },
2992 { "(bad)", { XX } },
2993 { "(bad)", { XX } },
2994 { "(bad)", { XX } },
2995 { "(bad)", { XX } },
2996 { "(bad)", { XX } },
2998 { "(bad)", { XX } },
2999 { "(bad)", { XX } },
3000 { "(bad)", { XX } },
3001 { "(bad)", { XX } },
3002 { "(bad)", { XX } },
3003 { "(bad)", { XX } },
3004 { "(bad)", { XX } },
3005 { "(bad)", { XX } },
3007 { "(bad)", { XX } },
3008 { "(bad)", { XX } },
3009 { "(bad)", { XX } },
3010 { "(bad)", { XX } },
3011 { "(bad)", { XX } },
3012 { "(bad)", { XX } },
3013 { "(bad)", { XX } },
3014 { "(bad)", { XX } },
3016 { "(bad)", { XX } },
3017 { "(bad)", { XX } },
3018 { "(bad)", { XX } },
3019 { "(bad)", { XX } },
3020 { "(bad)", { XX } },
3021 { "(bad)", { XX } },
3022 { "(bad)", { XX } },
3023 { "(bad)", { XX } },
3025 { "(bad)", { XX } },
3026 { "(bad)", { XX } },
3027 { "(bad)", { XX } },
3028 { "(bad)", { XX } },
3029 { "(bad)", { XX } },
3030 { "(bad)", { XX } },
3031 { "(bad)", { XX } },
3032 { "(bad)", { XX } },
3034 { "(bad)", { XX } },
3035 { "(bad)", { XX } },
3036 { "(bad)", { XX } },
3037 { "(bad)", { XX } },
3038 { "(bad)", { XX } },
3039 { "(bad)", { XX } },
3040 { "(bad)", { XX } },
3041 { "(bad)", { XX } },
3043 { "(bad)", { XX } },
3044 { "(bad)", { XX } },
3045 { "(bad)", { XX } },
3046 { "(bad)", { XX } },
3047 { "(bad)", { XX } },
3048 { "(bad)", { XX } },
3049 { "(bad)", { XX } },
3050 { "(bad)", { XX } },
3052 { "(bad)", { XX } },
3053 { "(bad)", { XX } },
3054 { "(bad)", { XX } },
3055 { "(bad)", { XX } },
3056 { "(bad)", { XX } },
3057 { "(bad)", { XX } },
3058 { "(bad)", { XX } },
3059 { "(bad)", { XX } },
3061 /* THREE_BYTE_0F25 */
3064 { "(bad)", { XX } },
3065 { "(bad)", { XX } },
3066 { "(bad)", { XX } },
3067 { "(bad)", { XX } },
3068 { "(bad)", { XX } },
3069 { "(bad)", { XX } },
3070 { "(bad)", { XX } },
3071 { "(bad)", { XX } },
3073 { "(bad)", { XX } },
3074 { "(bad)", { XX } },
3075 { "(bad)", { XX } },
3076 { "(bad)", { XX } },
3077 { "(bad)", { XX } },
3078 { "(bad)", { XX } },
3079 { "(bad)", { XX } },
3080 { "(bad)", { XX } },
3082 { "(bad)", { XX } },
3083 { "(bad)", { XX } },
3084 { "(bad)", { XX } },
3085 { "(bad)", { XX } },
3086 { "(bad)", { XX } },
3087 { "(bad)", { XX } },
3088 { "(bad)", { XX } },
3089 { "(bad)", { XX } },
3091 { "(bad)", { XX } },
3092 { "(bad)", { XX } },
3093 { "(bad)", { XX } },
3094 { "(bad)", { XX } },
3095 { "(bad)", { XX } },
3096 { "(bad)", { XX } },
3097 { "(bad)", { XX } },
3098 { "(bad)", { XX } },
3100 { "(bad)", { XX } },
3101 { "(bad)", { XX } },
3102 { "(bad)", { XX } },
3103 { "(bad)", { XX } },
3104 { "(bad)", { XX } },
3105 { "(bad)", { XX } },
3106 { "(bad)", { XX } },
3107 { "(bad)", { XX } },
3109 { "(bad)", { XX } },
3110 { "(bad)", { XX } },
3111 { "(bad)", { XX } },
3112 { "(bad)", { XX } },
3113 { "comps", { { OP_DREX3, q_mode }, { OP_DREX_FCMP, b_mode } } },
3114 { "compd", { { OP_DREX3, q_mode }, { OP_DREX_FCMP, b_mode } } },
3115 { "comss", { { OP_DREX3, w_mode }, { OP_DREX_FCMP, b_mode } } },
3116 { "comsd", { { OP_DREX3, d_mode }, { OP_DREX_FCMP, b_mode } } },
3118 { "(bad)", { XX } },
3119 { "(bad)", { XX } },
3120 { "(bad)", { XX } },
3121 { "(bad)", { XX } },
3122 { "(bad)", { XX } },
3123 { "(bad)", { XX } },
3124 { "(bad)", { XX } },
3125 { "(bad)", { XX } },
3127 { "(bad)", { XX } },
3128 { "(bad)", { XX } },
3129 { "(bad)", { XX } },
3130 { "(bad)", { XX } },
3131 { "(bad)", { XX } },
3132 { "(bad)", { XX } },
3133 { "(bad)", { XX } },
3134 { "(bad)", { XX } },
3136 { "(bad)", { XX } },
3137 { "(bad)", { XX } },
3138 { "(bad)", { XX } },
3139 { "(bad)", { XX } },
3140 { "(bad)", { XX } },
3141 { "(bad)", { XX } },
3142 { "(bad)", { XX } },
3143 { "(bad)", { XX } },
3145 { "(bad)", { XX } },
3146 { "(bad)", { XX } },
3147 { "(bad)", { XX } },
3148 { "(bad)", { XX } },
3149 { "pcomb", { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
3150 { "pcomw", { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
3151 { "pcomd", { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
3152 { "pcomq", { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
3154 { "(bad)", { XX } },
3155 { "(bad)", { XX } },
3156 { "(bad)", { XX } },
3157 { "(bad)", { XX } },
3158 { "(bad)", { XX } },
3159 { "(bad)", { XX } },
3160 { "(bad)", { XX } },
3161 { "(bad)", { XX } },
3163 { "(bad)", { XX } },
3164 { "(bad)", { XX } },
3165 { "(bad)", { XX } },
3166 { "(bad)", { XX } },
3167 { "(bad)", { XX } },
3168 { "(bad)", { XX } },
3169 { "(bad)", { XX } },
3170 { "(bad)", { XX } },
3172 { "(bad)", { XX } },
3173 { "(bad)", { XX } },
3174 { "(bad)", { XX } },
3175 { "(bad)", { XX } },
3176 { "(bad)", { XX } },
3177 { "(bad)", { XX } },
3178 { "(bad)", { XX } },
3179 { "(bad)", { XX } },
3181 { "(bad)", { XX } },
3182 { "(bad)", { XX } },
3183 { "(bad)", { XX } },
3184 { "(bad)", { XX } },
3185 { "pcomub", { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
3186 { "pcomuw", { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
3187 { "pcomud", { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
3188 { "pcomuq", { { OP_DREX3, q_mode }, { OP_DREX_ICMP, b_mode } } },
3190 { "(bad)", { XX } },
3191 { "(bad)", { XX } },
3192 { "(bad)", { XX } },
3193 { "(bad)", { XX } },
3194 { "(bad)", { XX } },
3195 { "(bad)", { XX } },
3196 { "(bad)", { XX } },
3197 { "(bad)", { XX } },
3199 { "(bad)", { XX } },
3200 { "(bad)", { XX } },
3201 { "(bad)", { XX } },
3202 { "(bad)", { XX } },
3203 { "(bad)", { XX } },
3204 { "(bad)", { XX } },
3205 { "(bad)", { XX } },
3206 { "(bad)", { XX } },
3208 { "(bad)", { XX } },
3209 { "(bad)", { XX } },
3210 { "(bad)", { XX } },
3211 { "(bad)", { XX } },
3212 { "(bad)", { XX } },
3213 { "(bad)", { XX } },
3214 { "(bad)", { XX } },
3215 { "(bad)", { XX } },
3217 { "(bad)", { XX } },
3218 { "(bad)", { XX } },
3219 { "(bad)", { XX } },
3220 { "(bad)", { XX } },
3221 { "(bad)", { XX } },
3222 { "(bad)", { XX } },
3223 { "(bad)", { XX } },
3224 { "(bad)", { XX } },
3226 { "(bad)", { XX } },
3227 { "(bad)", { XX } },
3228 { "(bad)", { XX } },
3229 { "(bad)", { XX } },
3230 { "(bad)", { XX } },
3231 { "(bad)", { XX } },
3232 { "(bad)", { XX } },
3233 { "(bad)", { XX } },
3235 { "(bad)", { XX } },
3236 { "(bad)", { XX } },
3237 { "(bad)", { XX } },
3238 { "(bad)", { XX } },
3239 { "(bad)", { XX } },
3240 { "(bad)", { XX } },
3241 { "(bad)", { XX } },
3242 { "(bad)", { XX } },
3244 { "(bad)", { XX } },
3245 { "(bad)", { XX } },
3246 { "(bad)", { XX } },
3247 { "(bad)", { XX } },
3248 { "(bad)", { XX } },
3249 { "(bad)", { XX } },
3250 { "(bad)", { XX } },
3251 { "(bad)", { XX } },
3253 { "(bad)", { XX } },
3254 { "(bad)", { XX } },
3255 { "(bad)", { XX } },
3256 { "(bad)", { XX } },
3257 { "(bad)", { XX } },
3258 { "(bad)", { XX } },
3259 { "(bad)", { XX } },
3260 { "(bad)", { XX } },
3262 { "(bad)", { XX } },
3263 { "(bad)", { XX } },
3264 { "(bad)", { XX } },
3265 { "(bad)", { XX } },
3266 { "(bad)", { XX } },
3267 { "(bad)", { XX } },
3268 { "(bad)", { XX } },
3269 { "(bad)", { XX } },
3271 { "(bad)", { XX } },
3272 { "(bad)", { XX } },
3273 { "(bad)", { XX } },
3274 { "(bad)", { XX } },
3275 { "(bad)", { XX } },
3276 { "(bad)", { XX } },
3277 { "(bad)", { XX } },
3278 { "(bad)", { XX } },
3280 { "(bad)", { XX } },
3281 { "(bad)", { XX } },
3282 { "(bad)", { XX } },
3283 { "(bad)", { XX } },
3284 { "(bad)", { XX } },
3285 { "(bad)", { XX } },
3286 { "(bad)", { XX } },
3287 { "(bad)", { XX } },
3289 { "(bad)", { XX } },
3290 { "(bad)", { XX } },
3291 { "(bad)", { XX } },
3292 { "(bad)", { XX } },
3293 { "(bad)", { XX } },
3294 { "(bad)", { XX } },
3295 { "(bad)", { XX } },
3296 { "(bad)", { XX } },
3298 { "(bad)", { XX } },
3299 { "(bad)", { XX } },
3300 { "(bad)", { XX } },
3301 { "(bad)", { XX } },
3302 { "(bad)", { XX } },
3303 { "(bad)", { XX } },
3304 { "(bad)", { XX } },
3305 { "(bad)", { XX } },
3307 { "(bad)", { XX } },
3308 { "(bad)", { XX } },
3309 { "(bad)", { XX } },
3310 { "(bad)", { XX } },
3311 { "(bad)", { XX } },
3312 { "(bad)", { XX } },
3313 { "(bad)", { XX } },
3314 { "(bad)", { XX } },
3316 { "(bad)", { XX } },
3317 { "(bad)", { XX } },
3318 { "(bad)", { XX } },
3319 { "(bad)", { XX } },
3320 { "(bad)", { XX } },
3321 { "(bad)", { XX } },
3322 { "(bad)", { XX } },
3323 { "(bad)", { XX } },
3325 { "(bad)", { XX } },
3326 { "(bad)", { XX } },
3327 { "(bad)", { XX } },
3328 { "(bad)", { XX } },
3329 { "(bad)", { XX } },
3330 { "(bad)", { XX } },
3331 { "(bad)", { XX } },
3332 { "(bad)", { XX } },
3334 { "(bad)", { XX } },
3335 { "(bad)", { XX } },
3336 { "(bad)", { XX } },
3337 { "(bad)", { XX } },
3338 { "(bad)", { XX } },
3339 { "(bad)", { XX } },
3340 { "(bad)", { XX } },
3341 { "(bad)", { XX } },
3343 { "(bad)", { XX } },
3344 { "(bad)", { XX } },
3345 { "(bad)", { XX } },
3346 { "(bad)", { XX } },
3347 { "(bad)", { XX } },
3348 { "(bad)", { XX } },
3349 { "(bad)", { XX } },
3350 { "(bad)", { XX } },
3352 /* THREE_BYTE_0F38 */
3355 { "pshufb", { MX, EM } },
3356 { "phaddw", { MX, EM } },
3357 { "phaddd", { MX, EM } },
3358 { "phaddsw", { MX, EM } },
3359 { "pmaddubsw", { MX, EM } },
3360 { "phsubw", { MX, EM } },
3361 { "phsubd", { MX, EM } },
3362 { "phsubsw", { MX, EM } },
3364 { "psignb", { MX, EM } },
3365 { "psignw", { MX, EM } },
3366 { "psignd", { MX, EM } },
3367 { "pmulhrsw", { MX, EM } },
3368 { "(bad)", { XX } },
3369 { "(bad)", { XX } },
3370 { "(bad)", { XX } },
3371 { "(bad)", { XX } },
3373 { PREFIX_TABLE (PREFIX_0F3810) },
3374 { "(bad)", { XX } },
3375 { "(bad)", { XX } },
3376 { "(bad)", { XX } },
3377 { PREFIX_TABLE (PREFIX_0F3814) },
3378 { PREFIX_TABLE (PREFIX_0F3815) },
3379 { "(bad)", { XX } },
3380 { PREFIX_TABLE (PREFIX_0F3817) },
3382 { "(bad)", { XX } },
3383 { "(bad)", { XX } },
3384 { "(bad)", { XX } },
3385 { "(bad)", { XX } },
3386 { "pabsb", { MX, EM } },
3387 { "pabsw", { MX, EM } },
3388 { "pabsd", { MX, EM } },
3389 { "(bad)", { XX } },
3391 { PREFIX_TABLE (PREFIX_0F3820) },
3392 { PREFIX_TABLE (PREFIX_0F3821) },
3393 { PREFIX_TABLE (PREFIX_0F3822) },
3394 { PREFIX_TABLE (PREFIX_0F3823) },
3395 { PREFIX_TABLE (PREFIX_0F3824) },
3396 { PREFIX_TABLE (PREFIX_0F3825) },
3397 { "(bad)", { XX } },
3398 { "(bad)", { XX } },
3400 { PREFIX_TABLE (PREFIX_0F3828) },
3401 { PREFIX_TABLE (PREFIX_0F3829) },
3402 { PREFIX_TABLE (PREFIX_0F382A) },
3403 { PREFIX_TABLE (PREFIX_0F382B) },
3404 { "(bad)", { XX } },
3405 { "(bad)", { XX } },
3406 { "(bad)", { XX } },
3407 { "(bad)", { XX } },
3409 { PREFIX_TABLE (PREFIX_0F3830) },
3410 { PREFIX_TABLE (PREFIX_0F3831) },
3411 { PREFIX_TABLE (PREFIX_0F3832) },
3412 { PREFIX_TABLE (PREFIX_0F3833) },
3413 { PREFIX_TABLE (PREFIX_0F3834) },
3414 { PREFIX_TABLE (PREFIX_0F3835) },
3415 { "(bad)", { XX } },
3416 { PREFIX_TABLE (PREFIX_0F3837) },
3418 { PREFIX_TABLE (PREFIX_0F3838) },
3419 { PREFIX_TABLE (PREFIX_0F3839) },
3420 { PREFIX_TABLE (PREFIX_0F383A) },
3421 { PREFIX_TABLE (PREFIX_0F383B) },
3422 { PREFIX_TABLE (PREFIX_0F383C) },
3423 { PREFIX_TABLE (PREFIX_0F383D) },
3424 { PREFIX_TABLE (PREFIX_0F383E) },
3425 { PREFIX_TABLE (PREFIX_0F383F) },
3427 { PREFIX_TABLE (PREFIX_0F3840) },
3428 { PREFIX_TABLE (PREFIX_0F3841) },
3429 { "(bad)", { XX } },
3430 { "(bad)", { XX } },
3431 { "(bad)", { XX } },
3432 { "(bad)", { XX } },
3433 { "(bad)", { XX } },
3434 { "(bad)", { XX } },
3436 { "(bad)", { XX } },
3437 { "(bad)", { XX } },
3438 { "(bad)", { XX } },
3439 { "(bad)", { XX } },
3440 { "(bad)", { XX } },
3441 { "(bad)", { XX } },
3442 { "(bad)", { XX } },
3443 { "(bad)", { XX } },
3445 { "(bad)", { XX } },
3446 { "(bad)", { XX } },
3447 { "(bad)", { XX } },
3448 { "(bad)", { XX } },
3449 { "(bad)", { XX } },
3450 { "(bad)", { XX } },
3451 { "(bad)", { XX } },
3452 { "(bad)", { XX } },
3454 { "(bad)", { XX } },
3455 { "(bad)", { XX } },
3456 { "(bad)", { XX } },
3457 { "(bad)", { XX } },
3458 { "(bad)", { XX } },
3459 { "(bad)", { XX } },
3460 { "(bad)", { XX } },
3461 { "(bad)", { XX } },
3463 { "(bad)", { XX } },
3464 { "(bad)", { XX } },
3465 { "(bad)", { XX } },
3466 { "(bad)", { XX } },
3467 { "(bad)", { XX } },
3468 { "(bad)", { XX } },
3469 { "(bad)", { XX } },
3470 { "(bad)", { XX } },
3472 { "(bad)", { XX } },
3473 { "(bad)", { XX } },
3474 { "(bad)", { XX } },
3475 { "(bad)", { XX } },
3476 { "(bad)", { XX } },
3477 { "(bad)", { XX } },
3478 { "(bad)", { XX } },
3479 { "(bad)", { XX } },
3481 { "(bad)", { XX } },
3482 { "(bad)", { XX } },
3483 { "(bad)", { XX } },
3484 { "(bad)", { XX } },
3485 { "(bad)", { XX } },
3486 { "(bad)", { XX } },
3487 { "(bad)", { XX } },
3488 { "(bad)", { XX } },
3490 { "(bad)", { XX } },
3491 { "(bad)", { XX } },
3492 { "(bad)", { XX } },
3493 { "(bad)", { XX } },
3494 { "(bad)", { XX } },
3495 { "(bad)", { XX } },
3496 { "(bad)", { XX } },
3497 { "(bad)", { XX } },
3499 { "(bad)", { XX } },
3500 { "(bad)", { XX } },
3501 { "(bad)", { XX } },
3502 { "(bad)", { XX } },
3503 { "(bad)", { XX } },
3504 { "(bad)", { XX } },
3505 { "(bad)", { XX } },
3506 { "(bad)", { XX } },
3508 { "(bad)", { XX } },
3509 { "(bad)", { XX } },
3510 { "(bad)", { XX } },
3511 { "(bad)", { XX } },
3512 { "(bad)", { XX } },
3513 { "(bad)", { XX } },
3514 { "(bad)", { XX } },
3515 { "(bad)", { XX } },
3517 { "(bad)", { XX } },
3518 { "(bad)", { XX } },
3519 { "(bad)", { XX } },
3520 { "(bad)", { XX } },
3521 { "(bad)", { XX } },
3522 { "(bad)", { XX } },
3523 { "(bad)", { XX } },
3524 { "(bad)", { XX } },
3526 { "(bad)", { XX } },
3527 { "(bad)", { XX } },
3528 { "(bad)", { XX } },
3529 { "(bad)", { XX } },
3530 { "(bad)", { XX } },
3531 { "(bad)", { XX } },
3532 { "(bad)", { XX } },
3533 { "(bad)", { XX } },
3535 { "(bad)", { XX } },
3536 { "(bad)", { XX } },
3537 { "(bad)", { XX } },
3538 { "(bad)", { XX } },
3539 { "(bad)", { XX } },
3540 { "(bad)", { XX } },
3541 { "(bad)", { XX } },
3542 { "(bad)", { XX } },
3544 { "(bad)", { XX } },
3545 { "(bad)", { XX } },
3546 { "(bad)", { XX } },
3547 { "(bad)", { XX } },
3548 { "(bad)", { XX } },
3549 { "(bad)", { XX } },
3550 { "(bad)", { XX } },
3551 { "(bad)", { XX } },
3553 { "(bad)", { XX } },
3554 { "(bad)", { XX } },
3555 { "(bad)", { XX } },
3556 { "(bad)", { XX } },
3557 { "(bad)", { XX } },
3558 { "(bad)", { XX } },
3559 { "(bad)", { XX } },
3560 { "(bad)", { XX } },
3562 { "(bad)", { XX } },
3563 { "(bad)", { XX } },
3564 { "(bad)", { XX } },
3565 { "(bad)", { XX } },
3566 { "(bad)", { XX } },
3567 { "(bad)", { XX } },
3568 { "(bad)", { XX } },
3569 { "(bad)", { XX } },
3571 { "(bad)", { XX } },
3572 { "(bad)", { XX } },
3573 { "(bad)", { XX } },
3574 { "(bad)", { XX } },
3575 { "(bad)", { XX } },
3576 { "(bad)", { XX } },
3577 { "(bad)", { XX } },
3578 { "(bad)", { XX } },
3580 { "(bad)", { XX } },
3581 { "(bad)", { XX } },
3582 { "(bad)", { XX } },
3583 { "(bad)", { XX } },
3584 { "(bad)", { XX } },
3585 { "(bad)", { XX } },
3586 { "(bad)", { XX } },
3587 { "(bad)", { XX } },
3589 { "(bad)", { XX } },
3590 { "(bad)", { XX } },
3591 { "(bad)", { XX } },
3592 { "(bad)", { XX } },
3593 { "(bad)", { XX } },
3594 { "(bad)", { XX } },
3595 { "(bad)", { XX } },
3596 { "(bad)", { XX } },
3598 { "(bad)", { XX } },
3599 { "(bad)", { XX } },
3600 { "(bad)", { XX } },
3601 { "(bad)", { XX } },
3602 { "(bad)", { XX } },
3603 { "(bad)", { XX } },
3604 { "(bad)", { XX } },
3605 { "(bad)", { XX } },
3607 { "(bad)", { XX } },
3608 { "(bad)", { XX } },
3609 { "(bad)", { XX } },
3610 { "(bad)", { XX } },
3611 { "(bad)", { XX } },
3612 { "(bad)", { XX } },
3613 { "(bad)", { XX } },
3614 { "(bad)", { XX } },
3616 { "(bad)", { XX } },
3617 { "(bad)", { XX } },
3618 { "(bad)", { XX } },
3619 { "(bad)", { XX } },
3620 { "(bad)", { XX } },
3621 { "(bad)", { XX } },
3622 { "(bad)", { XX } },
3623 { "(bad)", { XX } },
3625 { PREFIX_TABLE (PREFIX_0F38F0) },
3626 { PREFIX_TABLE (PREFIX_0F38F1) },
3627 { "(bad)", { XX } },
3628 { "(bad)", { XX } },
3629 { "(bad)", { XX } },
3630 { "(bad)", { XX } },
3631 { "(bad)", { XX } },
3632 { "(bad)", { XX } },
3634 { "(bad)", { XX } },
3635 { "(bad)", { XX } },
3636 { "(bad)", { XX } },
3637 { "(bad)", { XX } },
3638 { "(bad)", { XX } },
3639 { "(bad)", { XX } },
3640 { "(bad)", { XX } },
3641 { "(bad)", { XX } },
3643 /* THREE_BYTE_0F3A */
3646 { "(bad)", { XX } },
3647 { "(bad)", { XX } },
3648 { "(bad)", { XX } },
3649 { "(bad)", { XX } },
3650 { "(bad)", { XX } },
3651 { "(bad)", { XX } },
3652 { "(bad)", { XX } },
3653 { "(bad)", { XX } },
3655 { PREFIX_TABLE (PREFIX_0F3A08) },
3656 { PREFIX_TABLE (PREFIX_0F3A09) },
3657 { PREFIX_TABLE (PREFIX_0F3A0A) },
3658 { PREFIX_TABLE (PREFIX_0F3A0B) },
3659 { PREFIX_TABLE (PREFIX_0F3A0C) },
3660 { PREFIX_TABLE (PREFIX_0F3A0D) },
3661 { PREFIX_TABLE (PREFIX_0F3A0E) },
3662 { "palignr", { MX, EM, Ib } },
3664 { "(bad)", { XX } },
3665 { "(bad)", { XX } },
3666 { "(bad)", { XX } },
3667 { "(bad)", { XX } },
3668 { PREFIX_TABLE (PREFIX_0F3A14) },
3669 { PREFIX_TABLE (PREFIX_0F3A15) },
3670 { PREFIX_TABLE (PREFIX_0F3A16) },
3671 { PREFIX_TABLE (PREFIX_0F3A17) },
3673 { "(bad)", { XX } },
3674 { "(bad)", { XX } },
3675 { "(bad)", { XX } },
3676 { "(bad)", { XX } },
3677 { "(bad)", { XX } },
3678 { "(bad)", { XX } },
3679 { "(bad)", { XX } },
3680 { "(bad)", { XX } },
3682 { PREFIX_TABLE (PREFIX_0F3A20) },
3683 { PREFIX_TABLE (PREFIX_0F3A21) },
3684 { PREFIX_TABLE (PREFIX_0F3A22) },
3685 { "(bad)", { XX } },
3686 { "(bad)", { XX } },
3687 { "(bad)", { XX } },
3688 { "(bad)", { XX } },
3689 { "(bad)", { XX } },
3691 { "(bad)", { XX } },
3692 { "(bad)", { XX } },
3693 { "(bad)", { XX } },
3694 { "(bad)", { XX } },
3695 { "(bad)", { XX } },
3696 { "(bad)", { XX } },
3697 { "(bad)", { XX } },
3698 { "(bad)", { XX } },
3700 { "(bad)", { XX } },
3701 { "(bad)", { XX } },
3702 { "(bad)", { XX } },
3703 { "(bad)", { XX } },
3704 { "(bad)", { XX } },
3705 { "(bad)", { XX } },
3706 { "(bad)", { XX } },
3707 { "(bad)", { XX } },
3709 { "(bad)", { XX } },
3710 { "(bad)", { XX } },
3711 { "(bad)", { XX } },
3712 { "(bad)", { XX } },
3713 { "(bad)", { XX } },
3714 { "(bad)", { XX } },
3715 { "(bad)", { XX } },
3716 { "(bad)", { XX } },
3718 { PREFIX_TABLE (PREFIX_0F3A40) },
3719 { PREFIX_TABLE (PREFIX_0F3A41) },
3720 { PREFIX_TABLE (PREFIX_0F3A42) },
3721 { "(bad)", { XX } },
3722 { "(bad)", { XX } },
3723 { "(bad)", { XX } },
3724 { "(bad)", { XX } },
3725 { "(bad)", { XX } },
3727 { "(bad)", { XX } },
3728 { "(bad)", { XX } },
3729 { "(bad)", { XX } },
3730 { "(bad)", { XX } },
3731 { "(bad)", { XX } },
3732 { "(bad)", { XX } },
3733 { "(bad)", { XX } },
3734 { "(bad)", { XX } },
3736 { "(bad)", { XX } },
3737 { "(bad)", { XX } },
3738 { "(bad)", { XX } },
3739 { "(bad)", { XX } },
3740 { "(bad)", { XX } },
3741 { "(bad)", { XX } },
3742 { "(bad)", { XX } },
3743 { "(bad)", { XX } },
3745 { "(bad)", { XX } },
3746 { "(bad)", { XX } },
3747 { "(bad)", { XX } },
3748 { "(bad)", { XX } },
3749 { "(bad)", { XX } },
3750 { "(bad)", { XX } },
3751 { "(bad)", { XX } },
3752 { "(bad)", { XX } },
3754 { PREFIX_TABLE (PREFIX_0F3A60) },
3755 { PREFIX_TABLE (PREFIX_0F3A61) },
3756 { PREFIX_TABLE (PREFIX_0F3A62) },
3757 { PREFIX_TABLE (PREFIX_0F3A63) },
3758 { "(bad)", { XX } },
3759 { "(bad)", { XX } },
3760 { "(bad)", { XX } },
3761 { "(bad)", { XX } },
3763 { "(bad)", { XX } },
3764 { "(bad)", { XX } },
3765 { "(bad)", { XX } },
3766 { "(bad)", { XX } },
3767 { "(bad)", { XX } },
3768 { "(bad)", { XX } },
3769 { "(bad)", { XX } },
3770 { "(bad)", { XX } },
3772 { "(bad)", { XX } },
3773 { "(bad)", { XX } },
3774 { "(bad)", { XX } },
3775 { "(bad)", { XX } },
3776 { "(bad)", { XX } },
3777 { "(bad)", { XX } },
3778 { "(bad)", { XX } },
3779 { "(bad)", { XX } },
3781 { "(bad)", { XX } },
3782 { "(bad)", { XX } },
3783 { "(bad)", { XX } },
3784 { "(bad)", { XX } },
3785 { "(bad)", { XX } },
3786 { "(bad)", { XX } },
3787 { "(bad)", { XX } },
3788 { "(bad)", { XX } },
3790 { "(bad)", { XX } },
3791 { "(bad)", { XX } },
3792 { "(bad)", { XX } },
3793 { "(bad)", { XX } },
3794 { "(bad)", { XX } },
3795 { "(bad)", { XX } },
3796 { "(bad)", { XX } },
3797 { "(bad)", { XX } },
3799 { "(bad)", { XX } },
3800 { "(bad)", { XX } },
3801 { "(bad)", { XX } },
3802 { "(bad)", { XX } },
3803 { "(bad)", { XX } },
3804 { "(bad)", { XX } },
3805 { "(bad)", { XX } },
3806 { "(bad)", { XX } },
3808 { "(bad)", { XX } },
3809 { "(bad)", { XX } },
3810 { "(bad)", { XX } },
3811 { "(bad)", { XX } },
3812 { "(bad)", { XX } },
3813 { "(bad)", { XX } },
3814 { "(bad)", { XX } },
3815 { "(bad)", { XX } },
3817 { "(bad)", { XX } },
3818 { "(bad)", { XX } },
3819 { "(bad)", { XX } },
3820 { "(bad)", { XX } },
3821 { "(bad)", { XX } },
3822 { "(bad)", { XX } },
3823 { "(bad)", { XX } },
3824 { "(bad)", { XX } },
3826 { "(bad)", { XX } },
3827 { "(bad)", { XX } },
3828 { "(bad)", { XX } },
3829 { "(bad)", { XX } },
3830 { "(bad)", { XX } },
3831 { "(bad)", { XX } },
3832 { "(bad)", { XX } },
3833 { "(bad)", { XX } },
3835 { "(bad)", { XX } },
3836 { "(bad)", { XX } },
3837 { "(bad)", { XX } },
3838 { "(bad)", { XX } },
3839 { "(bad)", { XX } },
3840 { "(bad)", { XX } },
3841 { "(bad)", { XX } },
3842 { "(bad)", { XX } },
3844 { "(bad)", { XX } },
3845 { "(bad)", { XX } },
3846 { "(bad)", { XX } },
3847 { "(bad)", { XX } },
3848 { "(bad)", { XX } },
3849 { "(bad)", { XX } },
3850 { "(bad)", { XX } },
3851 { "(bad)", { XX } },
3853 { "(bad)", { XX } },
3854 { "(bad)", { XX } },
3855 { "(bad)", { XX } },
3856 { "(bad)", { XX } },
3857 { "(bad)", { XX } },
3858 { "(bad)", { XX } },
3859 { "(bad)", { XX } },
3860 { "(bad)", { XX } },
3862 { "(bad)", { XX } },
3863 { "(bad)", { XX } },
3864 { "(bad)", { XX } },
3865 { "(bad)", { XX } },
3866 { "(bad)", { XX } },
3867 { "(bad)", { XX } },
3868 { "(bad)", { XX } },
3869 { "(bad)", { XX } },
3871 { "(bad)", { XX } },
3872 { "(bad)", { XX } },
3873 { "(bad)", { XX } },
3874 { "(bad)", { XX } },
3875 { "(bad)", { XX } },
3876 { "(bad)", { XX } },
3877 { "(bad)", { XX } },
3878 { "(bad)", { XX } },
3880 { "(bad)", { XX } },
3881 { "(bad)", { XX } },
3882 { "(bad)", { XX } },
3883 { "(bad)", { XX } },
3884 { "(bad)", { XX } },
3885 { "(bad)", { XX } },
3886 { "(bad)", { XX } },
3887 { "(bad)", { XX } },
3889 { "(bad)", { XX } },
3890 { "(bad)", { XX } },
3891 { "(bad)", { XX } },
3892 { "(bad)", { XX } },
3893 { "(bad)", { XX } },
3894 { "(bad)", { XX } },
3895 { "(bad)", { XX } },
3896 { "(bad)", { XX } },
3898 { "(bad)", { XX } },
3899 { "(bad)", { XX } },
3900 { "(bad)", { XX } },
3901 { "(bad)", { XX } },
3902 { "(bad)", { XX } },
3903 { "(bad)", { XX } },
3904 { "(bad)", { XX } },
3905 { "(bad)", { XX } },
3907 { "(bad)", { XX } },
3908 { "(bad)", { XX } },
3909 { "(bad)", { XX } },
3910 { "(bad)", { XX } },
3911 { "(bad)", { XX } },
3912 { "(bad)", { XX } },
3913 { "(bad)", { XX } },
3914 { "(bad)", { XX } },
3916 { "(bad)", { XX } },
3917 { "(bad)", { XX } },
3918 { "(bad)", { XX } },
3919 { "(bad)", { XX } },
3920 { "(bad)", { XX } },
3921 { "(bad)", { XX } },
3922 { "(bad)", { XX } },
3923 { "(bad)", { XX } },
3925 { "(bad)", { XX } },
3926 { "(bad)", { XX } },
3927 { "(bad)", { XX } },
3928 { "(bad)", { XX } },
3929 { "(bad)", { XX } },
3930 { "(bad)", { XX } },
3931 { "(bad)", { XX } },
3932 { "(bad)", { XX } },
3934 /* THREE_BYTE_0F7A */
3937 { "(bad)", { XX } },
3938 { "(bad)", { XX } },
3939 { "(bad)", { XX } },
3940 { "(bad)", { XX } },
3941 { "(bad)", { XX } },
3942 { "(bad)", { XX } },
3943 { "(bad)", { XX } },
3944 { "(bad)", { XX } },
3946 { "(bad)", { XX } },
3947 { "(bad)", { XX } },
3948 { "(bad)", { XX } },
3949 { "(bad)", { XX } },
3950 { "(bad)", { XX } },
3951 { "(bad)", { XX } },
3952 { "(bad)", { XX } },
3953 { "(bad)", { XX } },
3955 { "frczps", { XM, EXq } },
3956 { "frczpd", { XM, EXq } },
3957 { "frczss", { XM, EXq } },
3958 { "frczsd", { XM, EXq } },
3959 { "(bad)", { XX } },
3960 { "(bad)", { XX } },
3961 { "(bad)", { XX } },
3962 { "(bad)", { XX } },
3964 { "(bad)", { XX } },
3965 { "(bad)", { XX } },
3966 { "(bad)", { XX } },
3967 { "(bad)", { XX } },
3968 { "(bad)", { XX } },
3969 { "(bad)", { XX } },
3970 { "(bad)", { XX } },
3971 { "(bad)", { XX } },
3973 { "ptest", { XX } },
3974 { "(bad)", { XX } },
3975 { "(bad)", { XX } },
3976 { "(bad)", { XX } },
3977 { "(bad)", { XX } },
3978 { "(bad)", { XX } },
3979 { "(bad)", { XX } },
3980 { "(bad)", { XX } },
3982 { "(bad)", { XX } },
3983 { "(bad)", { XX } },
3984 { "(bad)", { XX } },
3985 { "(bad)", { XX } },
3986 { "(bad)", { XX } },
3987 { "(bad)", { XX } },
3988 { "(bad)", { XX } },
3989 { "(bad)", { XX } },
3991 { "cvtph2ps", { XM, EXd } },
3992 { "cvtps2ph", { EXd, XM } },
3993 { "(bad)", { XX } },
3994 { "(bad)", { XX } },
3995 { "(bad)", { XX } },
3996 { "(bad)", { XX } },
3997 { "(bad)", { XX } },
3998 { "(bad)", { XX } },
4000 { "(bad)", { XX } },
4001 { "(bad)", { XX } },
4002 { "(bad)", { XX } },
4003 { "(bad)", { XX } },
4004 { "(bad)", { XX } },
4005 { "(bad)", { XX } },
4006 { "(bad)", { XX } },
4007 { "(bad)", { XX } },
4009 { "(bad)", { XX } },
4010 { "phaddbw", { XM, EXq } },
4011 { "phaddbd", { XM, EXq } },
4012 { "phaddbq", { XM, EXq } },
4013 { "(bad)", { XX } },
4014 { "(bad)", { XX } },
4015 { "phaddwd", { XM, EXq } },
4016 { "phaddwq", { XM, EXq } },
4018 { "(bad)", { XX } },
4019 { "(bad)", { XX } },
4020 { "(bad)", { XX } },
4021 { "phadddq", { XM, EXq } },
4022 { "(bad)", { XX } },
4023 { "(bad)", { XX } },
4024 { "(bad)", { XX } },
4025 { "(bad)", { XX } },
4027 { "(bad)", { XX } },
4028 { "phaddubw", { XM, EXq } },
4029 { "phaddubd", { XM, EXq } },
4030 { "phaddubq", { XM, EXq } },
4031 { "(bad)", { XX } },
4032 { "(bad)", { XX } },
4033 { "phadduwd", { XM, EXq } },
4034 { "phadduwq", { XM, EXq } },
4036 { "(bad)", { XX } },
4037 { "(bad)", { XX } },
4038 { "(bad)", { XX } },
4039 { "phaddudq", { XM, EXq } },
4040 { "(bad)", { XX } },
4041 { "(bad)", { XX } },
4042 { "(bad)", { XX } },
4043 { "(bad)", { XX } },
4045 { "(bad)", { XX } },
4046 { "phsubbw", { XM, EXq } },
4047 { "phsubbd", { XM, EXq } },
4048 { "phsubbq", { XM, EXq } },
4049 { "(bad)", { XX } },
4050 { "(bad)", { XX } },
4051 { "(bad)", { XX } },
4052 { "(bad)", { XX } },
4054 { "(bad)", { XX } },
4055 { "(bad)", { XX } },
4056 { "(bad)", { XX } },
4057 { "(bad)", { XX } },
4058 { "(bad)", { XX } },
4059 { "(bad)", { XX } },
4060 { "(bad)", { XX } },
4061 { "(bad)", { XX } },
4063 { "(bad)", { XX } },
4064 { "(bad)", { XX } },
4065 { "(bad)", { XX } },
4066 { "(bad)", { XX } },
4067 { "(bad)", { XX } },
4068 { "(bad)", { XX } },
4069 { "(bad)", { XX } },
4070 { "(bad)", { XX } },
4072 { "(bad)", { XX } },
4073 { "(bad)", { XX } },
4074 { "(bad)", { XX } },
4075 { "(bad)", { XX } },
4076 { "(bad)", { XX } },
4077 { "(bad)", { XX } },
4078 { "(bad)", { XX } },
4079 { "(bad)", { XX } },
4081 { "(bad)", { XX } },
4082 { "(bad)", { XX } },
4083 { "(bad)", { XX } },
4084 { "(bad)", { XX } },
4085 { "(bad)", { XX } },
4086 { "(bad)", { XX } },
4087 { "(bad)", { XX } },
4088 { "(bad)", { XX } },
4090 { "(bad)", { XX } },
4091 { "(bad)", { XX } },
4092 { "(bad)", { XX } },
4093 { "(bad)", { XX } },
4094 { "(bad)", { XX } },
4095 { "(bad)", { XX } },
4096 { "(bad)", { XX } },
4097 { "(bad)", { XX } },
4099 { "(bad)", { XX } },
4100 { "(bad)", { XX } },
4101 { "(bad)", { XX } },
4102 { "(bad)", { XX } },
4103 { "(bad)", { XX } },
4104 { "(bad)", { XX } },
4105 { "(bad)", { XX } },
4106 { "(bad)", { XX } },
4108 { "(bad)", { XX } },
4109 { "(bad)", { XX } },
4110 { "(bad)", { XX } },
4111 { "(bad)", { XX } },
4112 { "(bad)", { XX } },
4113 { "(bad)", { XX } },
4114 { "(bad)", { XX } },
4115 { "(bad)", { XX } },
4117 { "(bad)", { XX } },
4118 { "(bad)", { XX } },
4119 { "(bad)", { XX } },
4120 { "(bad)", { XX } },
4121 { "(bad)", { XX } },
4122 { "(bad)", { XX } },
4123 { "(bad)", { XX } },
4124 { "(bad)", { XX } },
4126 { "(bad)", { XX } },
4127 { "(bad)", { XX } },
4128 { "(bad)", { XX } },
4129 { "(bad)", { XX } },
4130 { "(bad)", { XX } },
4131 { "(bad)", { XX } },
4132 { "(bad)", { XX } },
4133 { "(bad)", { XX } },
4135 { "(bad)", { XX } },
4136 { "(bad)", { XX } },
4137 { "(bad)", { XX } },
4138 { "(bad)", { XX } },
4139 { "(bad)", { XX } },
4140 { "(bad)", { XX } },
4141 { "(bad)", { XX } },
4142 { "(bad)", { XX } },
4144 { "(bad)", { XX } },
4145 { "(bad)", { XX } },
4146 { "(bad)", { XX } },
4147 { "(bad)", { XX } },
4148 { "(bad)", { XX } },
4149 { "(bad)", { XX } },
4150 { "(bad)", { XX } },
4151 { "(bad)", { XX } },
4153 { "(bad)", { XX } },
4154 { "(bad)", { XX } },
4155 { "(bad)", { XX } },
4156 { "(bad)", { XX } },
4157 { "(bad)", { XX } },
4158 { "(bad)", { XX } },
4159 { "(bad)", { XX } },
4160 { "(bad)", { XX } },
4162 { "(bad)", { XX } },
4163 { "(bad)", { XX } },
4164 { "(bad)", { XX } },
4165 { "(bad)", { XX } },
4166 { "(bad)", { XX } },
4167 { "(bad)", { XX } },
4168 { "(bad)", { XX } },
4169 { "(bad)", { XX } },
4171 { "(bad)", { XX } },
4172 { "(bad)", { XX } },
4173 { "(bad)", { XX } },
4174 { "(bad)", { XX } },
4175 { "(bad)", { XX } },
4176 { "(bad)", { XX } },
4177 { "(bad)", { XX } },
4178 { "(bad)", { XX } },
4180 { "(bad)", { XX } },
4181 { "(bad)", { XX } },
4182 { "(bad)", { XX } },
4183 { "(bad)", { XX } },
4184 { "(bad)", { XX } },
4185 { "(bad)", { XX } },
4186 { "(bad)", { XX } },
4187 { "(bad)", { XX } },
4189 { "(bad)", { XX } },
4190 { "(bad)", { XX } },
4191 { "(bad)", { XX } },
4192 { "(bad)", { XX } },
4193 { "(bad)", { XX } },
4194 { "(bad)", { XX } },
4195 { "(bad)", { XX } },
4196 { "(bad)", { XX } },
4198 { "(bad)", { XX } },
4199 { "(bad)", { XX } },
4200 { "(bad)", { XX } },
4201 { "(bad)", { XX } },
4202 { "(bad)", { XX } },
4203 { "(bad)", { XX } },
4204 { "(bad)", { XX } },
4205 { "(bad)", { XX } },
4207 { "(bad)", { XX } },
4208 { "(bad)", { XX } },
4209 { "(bad)", { XX } },
4210 { "(bad)", { XX } },
4211 { "(bad)", { XX } },
4212 { "(bad)", { XX } },
4213 { "(bad)", { XX } },
4214 { "(bad)", { XX } },
4216 { "(bad)", { XX } },
4217 { "(bad)", { XX } },
4218 { "(bad)", { XX } },
4219 { "(bad)", { XX } },
4220 { "(bad)", { XX } },
4221 { "(bad)", { XX } },
4222 { "(bad)", { XX } },
4223 { "(bad)", { XX } },
4225 /* THREE_BYTE_0F7B */
4228 { "(bad)", { XX } },
4229 { "(bad)", { XX } },
4230 { "(bad)", { XX } },
4231 { "(bad)", { XX } },
4232 { "(bad)", { XX } },
4233 { "(bad)", { XX } },
4234 { "(bad)", { XX } },
4235 { "(bad)", { XX } },
4237 { "(bad)", { XX } },
4238 { "(bad)", { XX } },
4239 { "(bad)", { XX } },
4240 { "(bad)", { XX } },
4241 { "(bad)", { XX } },
4242 { "(bad)", { XX } },
4243 { "(bad)", { XX } },
4244 { "(bad)", { XX } },
4246 { "(bad)", { XX } },
4247 { "(bad)", { XX } },
4248 { "(bad)", { XX } },
4249 { "(bad)", { XX } },
4250 { "(bad)", { XX } },
4251 { "(bad)", { XX } },
4252 { "(bad)", { XX } },
4253 { "(bad)", { XX } },
4255 { "(bad)", { XX } },
4256 { "(bad)", { XX } },
4257 { "(bad)", { XX } },
4258 { "(bad)", { XX } },
4259 { "(bad)", { XX } },
4260 { "(bad)", { XX } },
4261 { "(bad)", { XX } },
4262 { "(bad)", { XX } },
4264 { "(bad)", { XX } },
4265 { "(bad)", { XX } },
4266 { "(bad)", { XX } },
4267 { "(bad)", { XX } },
4268 { "(bad)", { XX } },
4269 { "(bad)", { XX } },
4270 { "(bad)", { XX } },
4271 { "(bad)", { XX } },
4273 { "(bad)", { XX } },
4274 { "(bad)", { XX } },
4275 { "(bad)", { XX } },
4276 { "(bad)", { XX } },
4277 { "(bad)", { XX } },
4278 { "(bad)", { XX } },
4279 { "(bad)", { XX } },
4280 { "(bad)", { XX } },
4282 { "(bad)", { XX } },
4283 { "(bad)", { XX } },
4284 { "(bad)", { XX } },
4285 { "(bad)", { XX } },
4286 { "(bad)", { XX } },
4287 { "(bad)", { XX } },
4288 { "(bad)", { XX } },
4289 { "(bad)", { XX } },
4291 { "(bad)", { XX } },
4292 { "(bad)", { XX } },
4293 { "(bad)", { XX } },
4294 { "(bad)", { XX } },
4295 { "(bad)", { XX } },
4296 { "(bad)", { XX } },
4297 { "(bad)", { XX } },
4298 { "(bad)", { XX } },
4300 { "protb", { XM, EXq, Ib } },
4301 { "protw", { XM, EXq, Ib } },
4302 { "protd", { XM, EXq, Ib } },
4303 { "protq", { XM, EXq, Ib } },
4304 { "pshlb", { XM, EXq, Ib } },
4305 { "pshlw", { XM, EXq, Ib } },
4306 { "pshld", { XM, EXq, Ib } },
4307 { "pshlq", { XM, EXq, Ib } },
4309 { "pshab", { XM, EXq, Ib } },
4310 { "pshaw", { XM, EXq, Ib } },
4311 { "pshad", { XM, EXq, Ib } },
4312 { "pshaq", { XM, EXq, Ib } },
4313 { "(bad)", { XX } },
4314 { "(bad)", { XX } },
4315 { "(bad)", { XX } },
4316 { "(bad)", { XX } },
4318 { "(bad)", { XX } },
4319 { "(bad)", { XX } },
4320 { "(bad)", { XX } },
4321 { "(bad)", { XX } },
4322 { "(bad)", { XX } },
4323 { "(bad)", { XX } },
4324 { "(bad)", { XX } },
4325 { "(bad)", { XX } },
4327 { "(bad)", { XX } },
4328 { "(bad)", { XX } },
4329 { "(bad)", { XX } },
4330 { "(bad)", { XX } },
4331 { "(bad)", { XX } },
4332 { "(bad)", { XX } },
4333 { "(bad)", { XX } },
4334 { "(bad)", { XX } },
4336 { "(bad)", { XX } },
4337 { "(bad)", { XX } },
4338 { "(bad)", { XX } },
4339 { "(bad)", { XX } },
4340 { "(bad)", { XX } },
4341 { "(bad)", { XX } },
4342 { "(bad)", { XX } },
4343 { "(bad)", { XX } },
4345 { "(bad)", { XX } },
4346 { "(bad)", { XX } },
4347 { "(bad)", { XX } },
4348 { "(bad)", { XX } },
4349 { "(bad)", { XX } },
4350 { "(bad)", { XX } },
4351 { "(bad)", { XX } },
4352 { "(bad)", { XX } },
4354 { "(bad)", { XX } },
4355 { "(bad)", { XX } },
4356 { "(bad)", { XX } },
4357 { "(bad)", { XX } },
4358 { "(bad)", { XX } },
4359 { "(bad)", { XX } },
4360 { "(bad)", { XX } },
4361 { "(bad)", { XX } },
4363 { "(bad)", { XX } },
4364 { "(bad)", { XX } },
4365 { "(bad)", { XX } },
4366 { "(bad)", { XX } },
4367 { "(bad)", { XX } },
4368 { "(bad)", { XX } },
4369 { "(bad)", { XX } },
4370 { "(bad)", { XX } },
4372 { "(bad)", { XX } },
4373 { "(bad)", { XX } },
4374 { "(bad)", { XX } },
4375 { "(bad)", { XX } },
4376 { "(bad)", { XX } },
4377 { "(bad)", { XX } },
4378 { "(bad)", { XX } },
4379 { "(bad)", { XX } },
4381 { "(bad)", { XX } },
4382 { "(bad)", { XX } },
4383 { "(bad)", { XX } },
4384 { "(bad)", { XX } },
4385 { "(bad)", { XX } },
4386 { "(bad)", { XX } },
4387 { "(bad)", { XX } },
4388 { "(bad)", { XX } },
4390 { "(bad)", { XX } },
4391 { "(bad)", { XX } },
4392 { "(bad)", { XX } },
4393 { "(bad)", { XX } },
4394 { "(bad)", { XX } },
4395 { "(bad)", { XX } },
4396 { "(bad)", { XX } },
4397 { "(bad)", { XX } },
4399 { "(bad)", { XX } },
4400 { "(bad)", { XX } },
4401 { "(bad)", { XX } },
4402 { "(bad)", { XX } },
4403 { "(bad)", { XX } },
4404 { "(bad)", { XX } },
4405 { "(bad)", { XX } },
4406 { "(bad)", { XX } },
4408 { "(bad)", { XX } },
4409 { "(bad)", { XX } },
4410 { "(bad)", { XX } },
4411 { "(bad)", { XX } },
4412 { "(bad)", { XX } },
4413 { "(bad)", { XX } },
4414 { "(bad)", { XX } },
4415 { "(bad)", { XX } },
4417 { "(bad)", { XX } },
4418 { "(bad)", { XX } },
4419 { "(bad)", { XX } },
4420 { "(bad)", { XX } },
4421 { "(bad)", { XX } },
4422 { "(bad)", { XX } },
4423 { "(bad)", { XX } },
4424 { "(bad)", { XX } },
4426 { "(bad)", { XX } },
4427 { "(bad)", { XX } },
4428 { "(bad)", { XX } },
4429 { "(bad)", { XX } },
4430 { "(bad)", { XX } },
4431 { "(bad)", { XX } },
4432 { "(bad)", { XX } },
4433 { "(bad)", { XX } },
4435 { "(bad)", { XX } },
4436 { "(bad)", { XX } },
4437 { "(bad)", { XX } },
4438 { "(bad)", { XX } },
4439 { "(bad)", { XX } },
4440 { "(bad)", { XX } },
4441 { "(bad)", { XX } },
4442 { "(bad)", { XX } },
4444 { "(bad)", { XX } },
4445 { "(bad)", { XX } },
4446 { "(bad)", { XX } },
4447 { "(bad)", { XX } },
4448 { "(bad)", { XX } },
4449 { "(bad)", { XX } },
4450 { "(bad)", { XX } },
4451 { "(bad)", { XX } },
4453 { "(bad)", { XX } },
4454 { "(bad)", { XX } },
4455 { "(bad)", { XX } },
4456 { "(bad)", { XX } },
4457 { "(bad)", { XX } },
4458 { "(bad)", { XX } },
4459 { "(bad)", { XX } },
4460 { "(bad)", { XX } },
4462 { "(bad)", { XX } },
4463 { "(bad)", { XX } },
4464 { "(bad)", { XX } },
4465 { "(bad)", { XX } },
4466 { "(bad)", { XX } },
4467 { "(bad)", { XX } },
4468 { "(bad)", { XX } },
4469 { "(bad)", { XX } },
4471 { "(bad)", { XX } },
4472 { "(bad)", { XX } },
4473 { "(bad)", { XX } },
4474 { "(bad)", { XX } },
4475 { "(bad)", { XX } },
4476 { "(bad)", { XX } },
4477 { "(bad)", { XX } },
4478 { "(bad)", { XX } },
4480 { "(bad)", { XX } },
4481 { "(bad)", { XX } },
4482 { "(bad)", { XX } },
4483 { "(bad)", { XX } },
4484 { "(bad)", { XX } },
4485 { "(bad)", { XX } },
4486 { "(bad)", { XX } },
4487 { "(bad)", { XX } },
4489 { "(bad)", { XX } },
4490 { "(bad)", { XX } },
4491 { "(bad)", { XX } },
4492 { "(bad)", { XX } },
4493 { "(bad)", { XX } },
4494 { "(bad)", { XX } },
4495 { "(bad)", { XX } },
4496 { "(bad)", { XX } },
4498 { "(bad)", { XX } },
4499 { "(bad)", { XX } },
4500 { "(bad)", { XX } },
4501 { "(bad)", { XX } },
4502 { "(bad)", { XX } },
4503 { "(bad)", { XX } },
4504 { "(bad)", { XX } },
4505 { "(bad)", { XX } },
4507 { "(bad)", { XX } },
4508 { "(bad)", { XX } },
4509 { "(bad)", { XX } },
4510 { "(bad)", { XX } },
4511 { "(bad)", { XX } },
4512 { "(bad)", { XX } },
4513 { "(bad)", { XX } },
4514 { "(bad)", { XX } },
4518 static const struct dis386 mod_table[][2] = {
4521 { "leaS", { Gv, M } },
4522 { "(bad)", { XX } },
4525 /* MOD_0F01_REG_0 */
4526 { X86_64_TABLE (X86_64_0F01_REG_0) },
4527 { RM_TABLE (RM_0F01_REG_0) },
4530 /* MOD_0F01_REG_1 */
4531 { X86_64_TABLE (X86_64_0F01_REG_1) },
4532 { RM_TABLE (RM_0F01_REG_1) },
4535 /* MOD_0F01_REG_2 */
4536 { X86_64_TABLE (X86_64_0F01_REG_2) },
4537 { "(bad)", { XX } },
4540 /* MOD_0F01_REG_3 */
4541 { X86_64_TABLE (X86_64_0F01_REG_3) },
4542 { RM_TABLE (RM_0F01_REG_3) },
4545 /* MOD_0F01_REG_7 */
4546 { "invlpg", { Mb } },
4547 { RM_TABLE (RM_0F01_REG_7) },
4550 /* MOD_0F12_PREFIX_0 */
4551 { "movlps", { XM, EXq } },
4552 { "movhlps", { XM, EXq } },
4556 { "movlpX", { EXq, XM } },
4557 { "(bad)", { XX } },
4560 /* MOD_0F16_PREFIX_0 */
4561 { "movhps", { XM, EXq } },
4562 { "movlhps", { XM, EXq } },
4566 { "movhpX", { EXq, XM } },
4567 { "(bad)", { XX } },
4570 /* MOD_0F18_REG_0 */
4571 { "prefetchnta", { Mb } },
4572 { "(bad)", { XX } },
4575 /* MOD_0F18_REG_1 */
4576 { "prefetcht0", { Mb } },
4577 { "(bad)", { XX } },
4580 /* MOD_0F18_REG_2 */
4581 { "prefetcht1", { Mb } },
4582 { "(bad)", { XX } },
4585 /* MOD_0F18_REG_3 */
4586 { "prefetcht2", { Mb } },
4587 { "(bad)", { XX } },
4591 { "(bad)", { XX } },
4592 { "movZ", { Rm, Cm } },
4596 { "(bad)", { XX } },
4597 { "movZ", { Rm, Dm } },
4601 { "(bad)", { XX } },
4602 { "movZ", { Cm, Rm } },
4606 { "(bad)", { XX } },
4607 { "movZ", { Dm, Rm } },
4611 { THREE_BYTE_TABLE (THREE_BYTE_0F24) },
4612 { "movL", { Rd, Td } },
4616 { "(bad)", { XX } },
4617 { "movL", { Td, Rd } },
4620 /* MOD_0F2B_PREFIX_0 */
4621 {"movntps", { Ev, XM } },
4622 { "(bad)", { XX } },
4625 /* MOD_0F2B_PREFIX_1 */
4626 {"movntss", { Ed, XM } },
4627 { "(bad)", { XX } },
4630 /* MOD_0F2B_PREFIX_2 */
4631 {"movntpd", { Ev, XM } },
4632 { "(bad)", { XX } },
4635 /* MOD_0F2B_PREFIX_3 */
4636 {"movntsd", { Eq, XM } },
4637 { "(bad)", { XX } },
4641 { "(bad)", { XX } },
4642 { "movmskpX", { Gdq, XS } },
4645 /* MOD_0F71_REG_2 */
4646 { "(bad)", { XX } },
4647 { "psrlw", { MS, Ib } },
4650 /* MOD_0F71_REG_4 */
4651 { "(bad)", { XX } },
4652 { "psraw", { MS, Ib } },
4655 /* MOD_0F71_REG_6 */
4656 { "(bad)", { XX } },
4657 { "psllw", { MS, Ib } },
4660 /* MOD_0F72_REG_2 */
4661 { "(bad)", { XX } },
4662 { "psrld", { MS, Ib } },
4665 /* MOD_0F72_REG_4 */
4666 { "(bad)", { XX } },
4667 { "psrad", { MS, Ib } },
4670 /* MOD_0F72_REG_6 */
4671 { "(bad)", { XX } },
4672 { "pslld", { MS, Ib } },
4675 /* MOD_0F73_REG_2 */
4676 { "(bad)", { XX } },
4677 { "psrlq", { MS, Ib } },
4680 /* MOD_0F73_REG_3 */
4681 { "(bad)", { XX } },
4682 { PREFIX_TABLE (PREFIX_0F73_REG_3) },
4685 /* MOD_0F73_REG_6 */
4686 { "(bad)", { XX } },
4687 { "psllq", { MS, Ib } },
4690 /* MOD_0F73_REG_7 */
4691 { "(bad)", { XX } },
4692 { PREFIX_TABLE (PREFIX_0F73_REG_7) },
4695 /* MOD_0FAE_REG_0 */
4696 { "fxsave", { M } },
4697 { "(bad)", { XX } },
4700 /* MOD_0FAE_REG_1 */
4701 { "fxrstor", { M } },
4702 { "(bad)", { XX } },
4705 /* MOD_0FAE_REG_2 */
4706 { "ldmxcsr", { Md } },
4707 { "(bad)", { XX } },
4710 /* MOD_0FAE_REG_3 */
4711 { "stmxcsr", { Md } },
4712 { "(bad)", { XX } },
4715 /* MOD_0FAE_REG_5 */
4716 { "(bad)", { XX } },
4717 { RM_TABLE (RM_0FAE_REG_5) },
4720 /* MOD_0FAE_REG_6 */
4721 { "(bad)", { XX } },
4722 { RM_TABLE (RM_0FAE_REG_6) },
4725 /* MOD_0FAE_REG_7 */
4726 { "clflush", { Mb } },
4727 { RM_TABLE (RM_0FAE_REG_7) },
4731 { "lssS", { Gv, Mp } },
4732 { "(bad)", { XX } },
4736 { "lfsS", { Gv, Mp } },
4737 { "(bad)", { XX } },
4741 { "lgsS", { Gv, Mp } },
4742 { "(bad)", { XX } },
4745 /* MOD_0FC7_REG_6 */
4746 { PREFIX_TABLE (PREFIX_0FC7_REG_6) },
4747 { "(bad)", { XX } },
4750 /* MOD_0FC7_REG_7 */
4751 { "vmptrst", { Mq } },
4752 { "(bad)", { XX } },
4756 { "(bad)", { XX } },
4757 { "pmovmskb", { Gdq, MS } },
4760 /* MOD_0FE7_PREFIX_2 */
4761 { "movntdq", { EM, XM } },
4762 { "(bad)", { XX } },
4765 /* MOD_0FF0_PREFIX_3 */
4766 { "lddqu", { XM, M } },
4767 { "(bad)", { XX } },
4770 /* MOD_0F382A_PREFIX_2 */
4771 { "movntdqa", { XM, EM } },
4772 { "(bad)", { XX } },
4776 { "bound{S|}", { Gv, Ma } },
4777 { "(bad)", { XX } },
4781 { "lesS", { Gv, Mp } },
4782 { "(bad)", { XX } },
4786 { "ldsS", { Gv, Mp } },
4787 { "(bad)", { XX } },
4791 static const struct dis386 rm_table[][8] = {
4794 { "(bad)", { XX } },
4795 { "vmcall", { Skip_MODRM } },
4796 { "vmlaunch", { Skip_MODRM } },
4797 { "vmresume", { Skip_MODRM } },
4798 { "vmxoff", { Skip_MODRM } },
4799 { "(bad)", { XX } },
4800 { "(bad)", { XX } },
4801 { "(bad)", { XX } },
4805 { "monitor", { { OP_Monitor, 0 } } },
4806 { "mwait", { { OP_Mwait, 0 } } },
4807 { "(bad)", { XX } },
4808 { "(bad)", { XX } },
4809 { "(bad)", { XX } },
4810 { "(bad)", { XX } },
4811 { "(bad)", { XX } },
4812 { "(bad)", { XX } },
4816 { "vmrun", { Skip_MODRM } },
4817 { "vmmcall", { Skip_MODRM } },
4818 { "vmload", { Skip_MODRM } },
4819 { "vmsave", { Skip_MODRM } },
4820 { "stgi", { Skip_MODRM } },
4821 { "clgi", { Skip_MODRM } },
4822 { "skinit", { Skip_MODRM } },
4823 { "invlpga", { Skip_MODRM } },
4827 { "swapgs", { Skip_MODRM } },
4828 { "rdtscp", { Skip_MODRM } },
4829 { "(bad)", { XX } },
4830 { "(bad)", { XX } },
4831 { "(bad)", { XX } },
4832 { "(bad)", { XX } },
4833 { "(bad)", { XX } },
4834 { "(bad)", { XX } },
4838 { "lfence", { Skip_MODRM } },
4839 { "(bad)", { XX } },
4840 { "(bad)", { XX } },
4841 { "(bad)", { XX } },
4842 { "(bad)", { XX } },
4843 { "(bad)", { XX } },
4844 { "(bad)", { XX } },
4845 { "(bad)", { XX } },
4849 { "mfence", { Skip_MODRM } },
4850 { "(bad)", { XX } },
4851 { "(bad)", { XX } },
4852 { "(bad)", { XX } },
4853 { "(bad)", { XX } },
4854 { "(bad)", { XX } },
4855 { "(bad)", { XX } },
4856 { "(bad)", { XX } },
4860 { "sfence", { Skip_MODRM } },
4861 { "(bad)", { XX } },
4862 { "(bad)", { XX } },
4863 { "(bad)", { XX } },
4864 { "(bad)", { XX } },
4865 { "(bad)", { XX } },
4866 { "(bad)", { XX } },
4867 { "(bad)", { XX } },
4871 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
4883 FETCH_DATA (the_info, codep + 1);
4887 /* REX prefixes family. */
4904 if (address_mode == mode_64bit)
4910 prefixes |= PREFIX_REPZ;
4913 prefixes |= PREFIX_REPNZ;
4916 prefixes |= PREFIX_LOCK;
4919 prefixes |= PREFIX_CS;
4922 prefixes |= PREFIX_SS;
4925 prefixes |= PREFIX_DS;
4928 prefixes |= PREFIX_ES;
4931 prefixes |= PREFIX_FS;
4934 prefixes |= PREFIX_GS;
4937 prefixes |= PREFIX_DATA;
4940 prefixes |= PREFIX_ADDR;
4943 /* fwait is really an instruction. If there are prefixes
4944 before the fwait, they belong to the fwait, *not* to the
4945 following instruction. */
4946 if (prefixes || rex)
4948 prefixes |= PREFIX_FWAIT;
4952 prefixes = PREFIX_FWAIT;
4957 /* Rex is ignored when followed by another prefix. */
4968 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
4972 prefix_name (int pref, int sizeflag)
4974 static const char *rexes [16] =
4979 "rex.XB", /* 0x43 */
4981 "rex.RB", /* 0x45 */
4982 "rex.RX", /* 0x46 */
4983 "rex.RXB", /* 0x47 */
4985 "rex.WB", /* 0x49 */
4986 "rex.WX", /* 0x4a */
4987 "rex.WXB", /* 0x4b */
4988 "rex.WR", /* 0x4c */
4989 "rex.WRB", /* 0x4d */
4990 "rex.WRX", /* 0x4e */
4991 "rex.WRXB", /* 0x4f */
4996 /* REX prefixes family. */
5013 return rexes [pref - 0x40];
5033 return (sizeflag & DFLAG) ? "data16" : "data32";
5035 if (address_mode == mode_64bit)
5036 return (sizeflag & AFLAG) ? "addr32" : "addr64";
5038 return (sizeflag & AFLAG) ? "addr16" : "addr32";
5046 static char op_out[MAX_OPERANDS][100];
5047 static int op_ad, op_index[MAX_OPERANDS];
5048 static int two_source_ops;
5049 static bfd_vma op_address[MAX_OPERANDS];
5050 static bfd_vma op_riprel[MAX_OPERANDS];
5051 static bfd_vma start_pc;
5054 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
5055 * (see topic "Redundant prefixes" in the "Differences from 8086"
5056 * section of the "Virtual 8086 Mode" chapter.)
5057 * 'pc' should be the address of this instruction, it will
5058 * be used to print the target address if this is a relative jump or call
5059 * The function returns the length of this instruction in bytes.
5062 static char intel_syntax;
5063 static char intel_mnemonic = !SYSV386_COMPAT;
5064 static char open_char;
5065 static char close_char;
5066 static char separator_char;
5067 static char scale_char;
5069 /* Here for backwards compatibility. When gdb stops using
5070 print_insn_i386_att and print_insn_i386_intel these functions can
5071 disappear, and print_insn_i386 be merged into print_insn. */
5073 print_insn_i386_att (bfd_vma pc, disassemble_info *info)
5077 return print_insn (pc, info);
5081 print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
5085 return print_insn (pc, info);
5089 print_insn_i386 (bfd_vma pc, disassemble_info *info)
5093 return print_insn (pc, info);
5097 print_i386_disassembler_options (FILE *stream)
5099 fprintf (stream, _("\n\
5100 The following i386/x86-64 specific disassembler options are supported for use\n\
5101 with the -M switch (multiple options should be separated by commas):\n"));
5103 fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n"));
5104 fprintf (stream, _(" i386 Disassemble in 32bit mode\n"));
5105 fprintf (stream, _(" i8086 Disassemble in 16bit mode\n"));
5106 fprintf (stream, _(" att Display instruction in AT&T syntax\n"));
5107 fprintf (stream, _(" intel Display instruction in Intel syntax\n"));
5108 fprintf (stream, _(" att-mnemonic\n"
5109 " Display instruction in AT&T mnemonic\n"));
5110 fprintf (stream, _(" intel-mnemonic\n"
5111 " Display instruction in Intel mnemonic\n"));
5112 fprintf (stream, _(" addr64 Assume 64bit address size\n"));
5113 fprintf (stream, _(" addr32 Assume 32bit address size\n"));
5114 fprintf (stream, _(" addr16 Assume 16bit address size\n"));
5115 fprintf (stream, _(" data32 Assume 32bit data size\n"));
5116 fprintf (stream, _(" data16 Assume 16bit data size\n"));
5117 fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n"));
5120 /* Get a pointer to struct dis386 with a valid name. */
5122 static const struct dis386 *
5123 get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
5127 if (dp->name != NULL)
5130 switch (dp->op[0].bytemode)
5133 dp = ®_table[dp->op[1].bytemode][modrm.reg];
5137 index = modrm.mod == 0x3 ? 1 : 0;
5138 dp = &mod_table[dp->op[1].bytemode][index];
5142 dp = &rm_table[dp->op[1].bytemode][modrm.rm];
5145 case USE_PREFIX_TABLE:
5147 used_prefixes |= (prefixes & PREFIX_REPZ);
5148 if (prefixes & PREFIX_REPZ)
5155 /* We should check PREFIX_REPNZ and PREFIX_REPZ before
5157 used_prefixes |= (prefixes & PREFIX_REPNZ);
5158 if (prefixes & PREFIX_REPNZ)
5161 repnz_prefix = NULL;
5165 used_prefixes |= (prefixes & PREFIX_DATA);
5166 if (prefixes & PREFIX_DATA)
5173 dp = &prefix_table[dp->op[1].bytemode][index];
5176 case USE_X86_64_TABLE:
5177 index = address_mode == mode_64bit ? 1 : 0;
5178 dp = &x86_64_table[dp->op[1].bytemode][index];
5181 case USE_3BYTE_TABLE:
5182 FETCH_DATA (info, codep + 2);
5184 dp = &three_byte_table[dp->op[1].bytemode][index];
5185 modrm.mod = (*codep >> 6) & 3;
5186 modrm.reg = (*codep >> 3) & 7;
5187 modrm.rm = *codep & 7;
5191 oappend (INTERNAL_DISASSEMBLER_ERROR);
5195 if (dp->name != NULL)
5198 return get_valid_dis386 (dp, info);
5202 print_insn (bfd_vma pc, disassemble_info *info)
5204 const struct dis386 *dp;
5206 char *op_txt[MAX_OPERANDS];
5210 struct dis_private priv;
5212 char prefix_obuf[32];
5215 if (info->mach == bfd_mach_x86_64_intel_syntax
5216 || info->mach == bfd_mach_x86_64)
5217 address_mode = mode_64bit;
5219 address_mode = mode_32bit;
5221 if (intel_syntax == (char) -1)
5222 intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax
5223 || info->mach == bfd_mach_x86_64_intel_syntax);
5225 if (info->mach == bfd_mach_i386_i386
5226 || info->mach == bfd_mach_x86_64
5227 || info->mach == bfd_mach_i386_i386_intel_syntax
5228 || info->mach == bfd_mach_x86_64_intel_syntax)
5229 priv.orig_sizeflag = AFLAG | DFLAG;
5230 else if (info->mach == bfd_mach_i386_i8086)
5231 priv.orig_sizeflag = 0;
5235 for (p = info->disassembler_options; p != NULL; )
5237 if (CONST_STRNEQ (p, "x86-64"))
5239 address_mode = mode_64bit;
5240 priv.orig_sizeflag = AFLAG | DFLAG;
5242 else if (CONST_STRNEQ (p, "i386"))
5244 address_mode = mode_32bit;
5245 priv.orig_sizeflag = AFLAG | DFLAG;
5247 else if (CONST_STRNEQ (p, "i8086"))
5249 address_mode = mode_16bit;
5250 priv.orig_sizeflag = 0;
5252 else if (CONST_STRNEQ (p, "intel"))
5255 if (CONST_STRNEQ (p + 5, "-mnemonic"))
5258 else if (CONST_STRNEQ (p, "att"))
5261 if (CONST_STRNEQ (p + 3, "-mnemonic"))
5264 else if (CONST_STRNEQ (p, "addr"))
5266 if (address_mode == mode_64bit)
5268 if (p[4] == '3' && p[5] == '2')
5269 priv.orig_sizeflag &= ~AFLAG;
5270 else if (p[4] == '6' && p[5] == '4')
5271 priv.orig_sizeflag |= AFLAG;
5275 if (p[4] == '1' && p[5] == '6')
5276 priv.orig_sizeflag &= ~AFLAG;
5277 else if (p[4] == '3' && p[5] == '2')
5278 priv.orig_sizeflag |= AFLAG;
5281 else if (CONST_STRNEQ (p, "data"))
5283 if (p[4] == '1' && p[5] == '6')
5284 priv.orig_sizeflag &= ~DFLAG;
5285 else if (p[4] == '3' && p[5] == '2')
5286 priv.orig_sizeflag |= DFLAG;
5288 else if (CONST_STRNEQ (p, "suffix"))
5289 priv.orig_sizeflag |= SUFFIX_ALWAYS;
5291 p = strchr (p, ',');
5298 names64 = intel_names64;
5299 names32 = intel_names32;
5300 names16 = intel_names16;
5301 names8 = intel_names8;
5302 names8rex = intel_names8rex;
5303 names_seg = intel_names_seg;
5304 index64 = intel_index64;
5305 index32 = intel_index32;
5306 index16 = intel_index16;
5309 separator_char = '+';
5314 names64 = att_names64;
5315 names32 = att_names32;
5316 names16 = att_names16;
5317 names8 = att_names8;
5318 names8rex = att_names8rex;
5319 names_seg = att_names_seg;
5320 index64 = att_index64;
5321 index32 = att_index32;
5322 index16 = att_index16;
5325 separator_char = ',';
5329 /* The output looks better if we put 7 bytes on a line, since that
5330 puts most long word instructions on a single line. */
5331 info->bytes_per_line = 7;
5333 info->private_data = &priv;
5334 priv.max_fetched = priv.the_buffer;
5335 priv.insn_start = pc;
5338 for (i = 0; i < MAX_OPERANDS; ++i)
5346 start_codep = priv.the_buffer;
5347 codep = priv.the_buffer;
5349 if (setjmp (priv.bailout) != 0)
5353 /* Getting here means we tried for data but didn't get it. That
5354 means we have an incomplete instruction of some sort. Just
5355 print the first byte as a prefix or a .byte pseudo-op. */
5356 if (codep > priv.the_buffer)
5358 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
5360 (*info->fprintf_func) (info->stream, "%s", name);
5363 /* Just print the first byte as a .byte instruction. */
5364 (*info->fprintf_func) (info->stream, ".byte 0x%x",
5365 (unsigned int) priv.the_buffer[0]);
5378 sizeflag = priv.orig_sizeflag;
5380 FETCH_DATA (info, codep + 1);
5381 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
5383 if (((prefixes & PREFIX_FWAIT)
5384 && ((*codep < 0xd8) || (*codep > 0xdf)))
5385 || (rex && rex_used))
5389 /* fwait not followed by floating point instruction, or rex followed
5390 by other prefixes. Print the first prefix. */
5391 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
5393 name = INTERNAL_DISASSEMBLER_ERROR;
5394 (*info->fprintf_func) (info->stream, "%s", name);
5401 unsigned char threebyte;
5402 FETCH_DATA (info, codep + 2);
5403 threebyte = *++codep;
5404 dp = &dis386_twobyte[threebyte];
5405 need_modrm = twobyte_has_modrm[*codep];
5410 dp = &dis386[*codep];
5411 need_modrm = onebyte_has_modrm[*codep];
5415 if ((prefixes & PREFIX_REPZ))
5417 repz_prefix = "repz ";
5418 used_prefixes |= PREFIX_REPZ;
5423 if ((prefixes & PREFIX_REPNZ))
5425 repnz_prefix = "repnz ";
5426 used_prefixes |= PREFIX_REPNZ;
5429 repnz_prefix = NULL;
5431 if ((prefixes & PREFIX_LOCK))
5433 lock_prefix = "lock ";
5434 used_prefixes |= PREFIX_LOCK;
5440 if (prefixes & PREFIX_ADDR)
5443 if (dp->op[2].bytemode != loop_jcxz_mode || intel_syntax)
5445 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
5446 addr_prefix = "addr32 ";
5448 addr_prefix = "addr16 ";
5449 used_prefixes |= PREFIX_ADDR;
5454 if ((prefixes & PREFIX_DATA))
5457 if (dp->op[2].bytemode == cond_jump_mode
5458 && dp->op[0].bytemode == v_mode
5461 if (sizeflag & DFLAG)
5462 data_prefix = "data32 ";
5464 data_prefix = "data16 ";
5465 used_prefixes |= PREFIX_DATA;
5471 FETCH_DATA (info, codep + 1);
5472 modrm.mod = (*codep >> 6) & 3;
5473 modrm.reg = (*codep >> 3) & 7;
5474 modrm.rm = *codep & 7;
5477 if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
5483 dp = get_valid_dis386 (dp, info);
5484 if (dp != NULL && putop (dp->name, sizeflag) == 0)
5486 for (i = 0; i < MAX_OPERANDS; ++i)
5489 op_ad = MAX_OPERANDS - 1 - i;
5491 (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
5496 /* See if any prefixes were not used. If so, print the first one
5497 separately. If we don't do this, we'll wind up printing an
5498 instruction stream which does not precisely correspond to the
5499 bytes we are disassembling. */
5500 if ((prefixes & ~used_prefixes) != 0)
5504 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
5506 name = INTERNAL_DISASSEMBLER_ERROR;
5507 (*info->fprintf_func) (info->stream, "%s", name);
5510 if (rex & ~rex_used)
5513 name = prefix_name (rex | 0x40, priv.orig_sizeflag);
5515 name = INTERNAL_DISASSEMBLER_ERROR;
5516 (*info->fprintf_func) (info->stream, "%s ", name);
5520 prefix_obufp = prefix_obuf;
5522 prefix_obufp = stpcpy (prefix_obufp, lock_prefix);
5524 prefix_obufp = stpcpy (prefix_obufp, repz_prefix);
5526 prefix_obufp = stpcpy (prefix_obufp, repnz_prefix);
5528 prefix_obufp = stpcpy (prefix_obufp, addr_prefix);
5530 prefix_obufp = stpcpy (prefix_obufp, data_prefix);
5532 if (prefix_obuf[0] != 0)
5533 (*info->fprintf_func) (info->stream, "%s", prefix_obuf);
5535 obufp = obuf + strlen (obuf);
5536 for (i = strlen (obuf) + strlen (prefix_obuf); i < 6; i++)
5539 (*info->fprintf_func) (info->stream, "%s", obuf);
5541 /* The enter and bound instructions are printed with operands in the same
5542 order as the intel book; everything else is printed in reverse order. */
5543 if (intel_syntax || two_source_ops)
5547 for (i = 0; i < MAX_OPERANDS; ++i)
5548 op_txt[i] = op_out[i];
5550 for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
5552 op_ad = op_index[i];
5553 op_index[i] = op_index[MAX_OPERANDS - 1 - i];
5554 op_index[MAX_OPERANDS - 1 - i] = op_ad;
5555 riprel = op_riprel[i];
5556 op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
5557 op_riprel[MAX_OPERANDS - 1 - i] = riprel;
5562 for (i = 0; i < MAX_OPERANDS; ++i)
5563 op_txt[MAX_OPERANDS - 1 - i] = op_out[i];
5567 for (i = 0; i < MAX_OPERANDS; ++i)
5571 (*info->fprintf_func) (info->stream, ",");
5572 if (op_index[i] != -1 && !op_riprel[i])
5573 (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info);
5575 (*info->fprintf_func) (info->stream, "%s", op_txt[i]);
5579 for (i = 0; i < MAX_OPERANDS; i++)
5580 if (op_index[i] != -1 && op_riprel[i])
5582 (*info->fprintf_func) (info->stream, " # ");
5583 (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep
5584 + op_address[op_index[i]]), info);
5587 return codep - priv.the_buffer;
5590 static const char *float_mem[] = {
5665 static const unsigned char float_mem_mode[] = {
5740 #define ST { OP_ST, 0 }
5741 #define STi { OP_STi, 0 }
5743 #define FGRPd9_2 NULL, { { NULL, 0 } }
5744 #define FGRPd9_4 NULL, { { NULL, 1 } }
5745 #define FGRPd9_5 NULL, { { NULL, 2 } }
5746 #define FGRPd9_6 NULL, { { NULL, 3 } }
5747 #define FGRPd9_7 NULL, { { NULL, 4 } }
5748 #define FGRPda_5 NULL, { { NULL, 5 } }
5749 #define FGRPdb_4 NULL, { { NULL, 6 } }
5750 #define FGRPde_3 NULL, { { NULL, 7 } }
5751 #define FGRPdf_4 NULL, { { NULL, 8 } }
5753 static const struct dis386 float_reg[][8] = {
5756 { "fadd", { ST, STi } },
5757 { "fmul", { ST, STi } },
5758 { "fcom", { STi } },
5759 { "fcomp", { STi } },
5760 { "fsub", { ST, STi } },
5761 { "fsubr", { ST, STi } },
5762 { "fdiv", { ST, STi } },
5763 { "fdivr", { ST, STi } },
5768 { "fxch", { STi } },
5770 { "(bad)", { XX } },
5778 { "fcmovb", { ST, STi } },
5779 { "fcmove", { ST, STi } },
5780 { "fcmovbe",{ ST, STi } },
5781 { "fcmovu", { ST, STi } },
5782 { "(bad)", { XX } },
5784 { "(bad)", { XX } },
5785 { "(bad)", { XX } },
5789 { "fcmovnb",{ ST, STi } },
5790 { "fcmovne",{ ST, STi } },
5791 { "fcmovnbe",{ ST, STi } },
5792 { "fcmovnu",{ ST, STi } },
5794 { "fucomi", { ST, STi } },
5795 { "fcomi", { ST, STi } },
5796 { "(bad)", { XX } },
5800 { "fadd", { STi, ST } },
5801 { "fmul", { STi, ST } },
5802 { "(bad)", { XX } },
5803 { "(bad)", { XX } },
5804 { "fsub!M", { STi, ST } },
5805 { "fsubM", { STi, ST } },
5806 { "fdiv!M", { STi, ST } },
5807 { "fdivM", { STi, ST } },
5811 { "ffree", { STi } },
5812 { "(bad)", { XX } },
5814 { "fstp", { STi } },
5815 { "fucom", { STi } },
5816 { "fucomp", { STi } },
5817 { "(bad)", { XX } },
5818 { "(bad)", { XX } },
5822 { "faddp", { STi, ST } },
5823 { "fmulp", { STi, ST } },
5824 { "(bad)", { XX } },
5826 { "fsub!Mp", { STi, ST } },
5827 { "fsubMp", { STi, ST } },
5828 { "fdiv!Mp", { STi, ST } },
5829 { "fdivMp", { STi, ST } },
5833 { "ffreep", { STi } },
5834 { "(bad)", { XX } },
5835 { "(bad)", { XX } },
5836 { "(bad)", { XX } },
5838 { "fucomip", { ST, STi } },
5839 { "fcomip", { ST, STi } },
5840 { "(bad)", { XX } },
5844 static char *fgrps[][8] = {
5847 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5852 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
5857 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
5862 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
5867 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
5872 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5877 "feni(287 only)","fdisi(287 only)","fNclex","fNinit",
5878 "fNsetpm(287 only)","(bad)","(bad)","(bad)",
5883 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5888 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5893 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
5894 int sizeflag ATTRIBUTE_UNUSED)
5896 /* Skip mod/rm byte. */
5902 dofloat (int sizeflag)
5904 const struct dis386 *dp;
5905 unsigned char floatop;
5907 floatop = codep[-1];
5911 int fp_indx = (floatop - 0xd8) * 8 + modrm.reg;
5913 putop (float_mem[fp_indx], sizeflag);
5916 OP_E (float_mem_mode[fp_indx], sizeflag);
5919 /* Skip mod/rm byte. */
5923 dp = &float_reg[floatop - 0xd8][modrm.reg];
5924 if (dp->name == NULL)
5926 putop (fgrps[dp->op[0].bytemode][modrm.rm], sizeflag);
5928 /* Instruction fnstsw is only one with strange arg. */
5929 if (floatop == 0xdf && codep[-1] == 0xe0)
5930 strcpy (op_out[0], names16[0]);
5934 putop (dp->name, sizeflag);
5939 (*dp->op[0].rtn) (dp->op[0].bytemode, sizeflag);
5944 (*dp->op[1].rtn) (dp->op[1].bytemode, sizeflag);
5949 OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
5951 oappend ("%st" + intel_syntax);
5955 OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
5957 sprintf (scratchbuf, "%%st(%d)", modrm.rm);
5958 oappend (scratchbuf + intel_syntax);
5961 /* Capital letters in template are macros. */
5963 putop (const char *template, int sizeflag)
5969 for (p = template; *p; p++)
5984 if (*p == '}' || *p == '\0')
6003 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
6009 if (sizeflag & SUFFIX_ALWAYS)
6013 if (intel_syntax && !alt)
6015 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
6017 if (sizeflag & DFLAG)
6018 *obufp++ = intel_syntax ? 'd' : 'l';
6020 *obufp++ = intel_syntax ? 'w' : 's';
6021 used_prefixes |= (prefixes & PREFIX_DATA);
6025 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
6032 else if (sizeflag & DFLAG)
6033 *obufp++ = intel_syntax ? 'd' : 'l';
6036 used_prefixes |= (prefixes & PREFIX_DATA);
6041 case 'E': /* For jcxz/jecxz */
6042 if (address_mode == mode_64bit)
6044 if (sizeflag & AFLAG)
6050 if (sizeflag & AFLAG)
6052 used_prefixes |= (prefixes & PREFIX_ADDR);
6057 if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))
6059 if (sizeflag & AFLAG)
6060 *obufp++ = address_mode == mode_64bit ? 'q' : 'l';
6062 *obufp++ = address_mode == mode_64bit ? 'l' : 'w';
6063 used_prefixes |= (prefixes & PREFIX_ADDR);
6067 if (intel_syntax || (obufp[-1] != 's' && !(sizeflag & SUFFIX_ALWAYS)))
6069 if ((rex & REX_W) || (sizeflag & DFLAG))
6074 used_prefixes |= (prefixes & PREFIX_DATA);
6079 if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS
6080 || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)
6082 used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);
6085 if (prefixes & PREFIX_DS)
6106 if (address_mode == mode_64bit && (sizeflag & SUFFIX_ALWAYS))
6115 if (sizeflag & SUFFIX_ALWAYS)
6119 if (intel_mnemonic != cond)
6123 if ((prefixes & PREFIX_FWAIT) == 0)
6126 used_prefixes |= PREFIX_FWAIT;
6132 else if (intel_syntax && (sizeflag & DFLAG))
6137 used_prefixes |= (prefixes & PREFIX_DATA);
6142 if (address_mode == mode_64bit && (sizeflag & DFLAG))
6151 if ((prefixes & PREFIX_DATA)
6153 || (sizeflag & SUFFIX_ALWAYS))
6160 if (sizeflag & DFLAG)
6165 used_prefixes |= (prefixes & PREFIX_DATA);
6171 if (address_mode == mode_64bit && (sizeflag & DFLAG))
6173 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
6179 if (intel_syntax && !alt)
6182 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
6188 if (sizeflag & DFLAG)
6189 *obufp++ = intel_syntax ? 'd' : 'l';
6193 used_prefixes |= (prefixes & PREFIX_DATA);
6200 else if (sizeflag & DFLAG)
6209 if (intel_syntax && !p[1]
6210 && ((rex & REX_W) || (sizeflag & DFLAG)))
6213 used_prefixes |= (prefixes & PREFIX_DATA);
6218 if (address_mode == mode_64bit && (sizeflag & DFLAG))
6220 if (sizeflag & SUFFIX_ALWAYS)
6228 if (sizeflag & SUFFIX_ALWAYS)
6234 if (sizeflag & DFLAG)
6238 used_prefixes |= (prefixes & PREFIX_DATA);
6243 if (prefixes & PREFIX_DATA)
6247 used_prefixes |= (prefixes & PREFIX_DATA);
6250 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
6258 /* implicit operand size 'l' for i386 or 'q' for x86-64 */
6260 /* operand size flag for cwtl, cbtw */
6269 else if (sizeflag & DFLAG)
6274 used_prefixes |= (prefixes & PREFIX_DATA);
6284 oappend (const char *s)
6287 obufp += strlen (s);
6293 if (prefixes & PREFIX_CS)
6295 used_prefixes |= PREFIX_CS;
6296 oappend ("%cs:" + intel_syntax);
6298 if (prefixes & PREFIX_DS)
6300 used_prefixes |= PREFIX_DS;
6301 oappend ("%ds:" + intel_syntax);
6303 if (prefixes & PREFIX_SS)
6305 used_prefixes |= PREFIX_SS;
6306 oappend ("%ss:" + intel_syntax);
6308 if (prefixes & PREFIX_ES)
6310 used_prefixes |= PREFIX_ES;
6311 oappend ("%es:" + intel_syntax);
6313 if (prefixes & PREFIX_FS)
6315 used_prefixes |= PREFIX_FS;
6316 oappend ("%fs:" + intel_syntax);
6318 if (prefixes & PREFIX_GS)
6320 used_prefixes |= PREFIX_GS;
6321 oappend ("%gs:" + intel_syntax);
6326 OP_indirE (int bytemode, int sizeflag)
6330 OP_E (bytemode, sizeflag);
6334 print_operand_value (char *buf, int hex, bfd_vma disp)
6336 if (address_mode == mode_64bit)
6344 sprintf_vma (tmp, disp);
6345 for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
6346 strcpy (buf + 2, tmp + i);
6350 bfd_signed_vma v = disp;
6357 /* Check for possible overflow on 0x8000000000000000. */
6360 strcpy (buf, "9223372036854775808");
6374 tmp[28 - i] = (v % 10) + '0';
6378 strcpy (buf, tmp + 29 - i);
6384 sprintf (buf, "0x%x", (unsigned int) disp);
6386 sprintf (buf, "%d", (int) disp);
6390 /* Put DISP in BUF as signed hex number. */
6393 print_displacement (char *buf, bfd_vma disp)
6395 bfd_signed_vma val = disp;
6404 /* Check for possible overflow. */
6407 switch (address_mode)
6410 strcpy (buf + j, "0x8000000000000000");
6413 strcpy (buf + j, "0x80000000");
6416 strcpy (buf + j, "0x8000");
6426 sprintf_vma (tmp, val);
6427 for (i = 0; tmp[i] == '0'; i++)
6431 strcpy (buf + j, tmp + i);
6435 intel_operand_size (int bytemode, int sizeflag)
6441 oappend ("BYTE PTR ");
6445 oappend ("WORD PTR ");
6448 if (address_mode == mode_64bit && (sizeflag & DFLAG))
6450 oappend ("QWORD PTR ");
6451 used_prefixes |= (prefixes & PREFIX_DATA);
6459 oappend ("QWORD PTR ");
6460 else if ((sizeflag & DFLAG) || bytemode == dq_mode)
6461 oappend ("DWORD PTR ");
6463 oappend ("WORD PTR ");
6464 used_prefixes |= (prefixes & PREFIX_DATA);
6467 if ((rex & REX_W) || (sizeflag & DFLAG))
6469 oappend ("WORD PTR ");
6471 used_prefixes |= (prefixes & PREFIX_DATA);
6475 oappend ("DWORD PTR ");
6478 oappend ("QWORD PTR ");
6481 if (address_mode == mode_64bit)
6482 oappend ("QWORD PTR ");
6484 oappend ("DWORD PTR ");
6487 if (sizeflag & DFLAG)
6488 oappend ("FWORD PTR ");
6490 oappend ("DWORD PTR ");
6491 used_prefixes |= (prefixes & PREFIX_DATA);
6494 oappend ("TBYTE PTR ");
6497 oappend ("XMMWORD PTR ");
6500 oappend ("OWORD PTR ");
6508 OP_E_extended (int bytemode, int sizeflag, int has_drex)
6517 /* Skip mod/rm byte. */
6528 oappend (names8rex[modrm.rm + add]);
6530 oappend (names8[modrm.rm + add]);
6533 oappend (names16[modrm.rm + add]);
6536 oappend (names32[modrm.rm + add]);
6539 oappend (names64[modrm.rm + add]);
6542 if (address_mode == mode_64bit)
6543 oappend (names64[modrm.rm + add]);
6545 oappend (names32[modrm.rm + add]);
6548 if (address_mode == mode_64bit && (sizeflag & DFLAG))
6550 oappend (names64[modrm.rm + add]);
6551 used_prefixes |= (prefixes & PREFIX_DATA);
6563 oappend (names64[modrm.rm + add]);
6564 else if ((sizeflag & DFLAG) || bytemode != v_mode)
6565 oappend (names32[modrm.rm + add]);
6567 oappend (names16[modrm.rm + add]);
6568 used_prefixes |= (prefixes & PREFIX_DATA);
6573 oappend (INTERNAL_DISASSEMBLER_ERROR);
6581 intel_operand_size (bytemode, sizeflag);
6584 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
6586 /* 32/64 bit address mode */
6604 FETCH_DATA (the_info, codep + 1);
6605 index = (*codep >> 3) & 7;
6606 scale = (*codep >> 6) & 3;
6611 haveindex = index != 4;
6616 /* If we have a DREX byte, skip it now
6617 (it has already been handled) */
6620 FETCH_DATA (the_info, codep + 1);
6627 if ((base & 7) == 5)
6630 if (address_mode == mode_64bit && !havesib)
6636 FETCH_DATA (the_info, codep + 1);
6638 if ((disp & 0x80) != 0)
6646 /* In 32bit mode, we need index register to tell [offset] from
6647 [eiz*1 + offset]. */
6648 needindex = (havesib
6651 && address_mode == mode_32bit);
6652 havedisp = (havebase
6654 || (havesib && (haveindex || scale != 0)));
6657 if (modrm.mod != 0 || (base & 7) == 5)
6659 if (havedisp || riprel)
6660 print_displacement (scratchbuf, disp);
6662 print_operand_value (scratchbuf, 1, disp);
6663 oappend (scratchbuf);
6667 oappend (sizeflag & AFLAG ? "(%rip)" : "(%eip)");
6671 if (havebase || haveindex || riprel)
6672 used_prefixes |= PREFIX_ADDR;
6674 if (havedisp || (intel_syntax && riprel))
6676 *obufp++ = open_char;
6677 if (intel_syntax && riprel)
6680 oappend (sizeflag & AFLAG ? "rip" : "eip");
6684 oappend (address_mode == mode_64bit && (sizeflag & AFLAG)
6685 ? names64[base] : names32[base]);
6688 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
6689 print index to tell base + index from base. */
6693 || (havebase && base != ESP_REG_NUM))
6695 if (!intel_syntax || havebase)
6697 *obufp++ = separator_char;
6701 oappend (address_mode == mode_64bit
6702 && (sizeflag & AFLAG)
6703 ? names64[index] : names32[index]);
6705 oappend (address_mode == mode_64bit
6706 && (sizeflag & AFLAG)
6707 ? index64 : index32);
6709 *obufp++ = scale_char;
6711 sprintf (scratchbuf, "%d", 1 << scale);
6712 oappend (scratchbuf);
6716 && (disp || modrm.mod != 0 || (base & 7) == 5))
6718 if (!havedisp || (bfd_signed_vma) disp >= 0)
6723 else if (modrm.mod != 1)
6727 disp = - (bfd_signed_vma) disp;
6731 print_displacement (scratchbuf, disp);
6733 print_operand_value (scratchbuf, 1, disp);
6734 oappend (scratchbuf);
6737 *obufp++ = close_char;
6740 else if (intel_syntax)
6742 if (modrm.mod != 0 || (base & 7) == 5)
6744 if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
6745 | PREFIX_ES | PREFIX_FS | PREFIX_GS))
6749 oappend (names_seg[ds_reg - es_reg]);
6752 print_operand_value (scratchbuf, 1, disp);
6753 oappend (scratchbuf);
6758 { /* 16 bit address mode */
6765 if ((disp & 0x8000) != 0)
6770 FETCH_DATA (the_info, codep + 1);
6772 if ((disp & 0x80) != 0)
6777 if ((disp & 0x8000) != 0)
6783 if (modrm.mod != 0 || modrm.rm == 6)
6785 print_displacement (scratchbuf, disp);
6786 oappend (scratchbuf);
6789 if (modrm.mod != 0 || modrm.rm != 6)
6791 *obufp++ = open_char;
6793 oappend (index16[modrm.rm]);
6795 && (disp || modrm.mod != 0 || modrm.rm == 6))
6797 if ((bfd_signed_vma) disp >= 0)
6802 else if (modrm.mod != 1)
6806 disp = - (bfd_signed_vma) disp;
6809 print_displacement (scratchbuf, disp);
6810 oappend (scratchbuf);
6813 *obufp++ = close_char;
6816 else if (intel_syntax)
6818 if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
6819 | PREFIX_ES | PREFIX_FS | PREFIX_GS))
6823 oappend (names_seg[ds_reg - es_reg]);
6826 print_operand_value (scratchbuf, 1, disp & 0xffff);
6827 oappend (scratchbuf);
6833 OP_E (int bytemode, int sizeflag)
6835 OP_E_extended (bytemode, sizeflag, 0);
6840 OP_G (int bytemode, int sizeflag)
6851 oappend (names8rex[modrm.reg + add]);
6853 oappend (names8[modrm.reg + add]);
6856 oappend (names16[modrm.reg + add]);
6859 oappend (names32[modrm.reg + add]);
6862 oappend (names64[modrm.reg + add]);
6871 oappend (names64[modrm.reg + add]);
6872 else if ((sizeflag & DFLAG) || bytemode != v_mode)
6873 oappend (names32[modrm.reg + add]);
6875 oappend (names16[modrm.reg + add]);
6876 used_prefixes |= (prefixes & PREFIX_DATA);
6879 if (address_mode == mode_64bit)
6880 oappend (names64[modrm.reg + add]);
6882 oappend (names32[modrm.reg + add]);
6885 oappend (INTERNAL_DISASSEMBLER_ERROR);
6898 FETCH_DATA (the_info, codep + 8);
6899 a = *codep++ & 0xff;
6900 a |= (*codep++ & 0xff) << 8;
6901 a |= (*codep++ & 0xff) << 16;
6902 a |= (*codep++ & 0xff) << 24;
6903 b = *codep++ & 0xff;
6904 b |= (*codep++ & 0xff) << 8;
6905 b |= (*codep++ & 0xff) << 16;
6906 b |= (*codep++ & 0xff) << 24;
6907 x = a + ((bfd_vma) b << 32);
6915 static bfd_signed_vma
6918 bfd_signed_vma x = 0;
6920 FETCH_DATA (the_info, codep + 4);
6921 x = *codep++ & (bfd_signed_vma) 0xff;
6922 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
6923 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
6924 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
6928 static bfd_signed_vma
6931 bfd_signed_vma x = 0;
6933 FETCH_DATA (the_info, codep + 4);
6934 x = *codep++ & (bfd_signed_vma) 0xff;
6935 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
6936 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
6937 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
6939 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
6949 FETCH_DATA (the_info, codep + 2);
6950 x = *codep++ & 0xff;
6951 x |= (*codep++ & 0xff) << 8;
6956 set_op (bfd_vma op, int riprel)
6958 op_index[op_ad] = op_ad;
6959 if (address_mode == mode_64bit)
6961 op_address[op_ad] = op;
6962 op_riprel[op_ad] = riprel;
6966 /* Mask to get a 32-bit address. */
6967 op_address[op_ad] = op & 0xffffffff;
6968 op_riprel[op_ad] = riprel & 0xffffffff;
6973 OP_REG (int code, int sizeflag)
6985 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
6986 case sp_reg: case bp_reg: case si_reg: case di_reg:
6987 s = names16[code - ax_reg + add];
6989 case es_reg: case ss_reg: case cs_reg:
6990 case ds_reg: case fs_reg: case gs_reg:
6991 s = names_seg[code - es_reg + add];
6993 case al_reg: case ah_reg: case cl_reg: case ch_reg:
6994 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
6997 s = names8rex[code - al_reg + add];
6999 s = names8[code - al_reg];
7001 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
7002 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
7003 if (address_mode == mode_64bit && (sizeflag & DFLAG))
7005 s = names64[code - rAX_reg + add];
7008 code += eAX_reg - rAX_reg;
7010 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
7011 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
7014 s = names64[code - eAX_reg + add];
7015 else if (sizeflag & DFLAG)
7016 s = names32[code - eAX_reg + add];
7018 s = names16[code - eAX_reg + add];
7019 used_prefixes |= (prefixes & PREFIX_DATA);
7022 s = INTERNAL_DISASSEMBLER_ERROR;
7029 OP_IMREG (int code, int sizeflag)
7041 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
7042 case sp_reg: case bp_reg: case si_reg: case di_reg:
7043 s = names16[code - ax_reg];
7045 case es_reg: case ss_reg: case cs_reg:
7046 case ds_reg: case fs_reg: case gs_reg:
7047 s = names_seg[code - es_reg];
7049 case al_reg: case ah_reg: case cl_reg: case ch_reg:
7050 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
7053 s = names8rex[code - al_reg];
7055 s = names8[code - al_reg];
7057 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
7058 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
7061 s = names64[code - eAX_reg];
7062 else if (sizeflag & DFLAG)
7063 s = names32[code - eAX_reg];
7065 s = names16[code - eAX_reg];
7066 used_prefixes |= (prefixes & PREFIX_DATA);
7069 if ((rex & REX_W) || (sizeflag & DFLAG))
7074 used_prefixes |= (prefixes & PREFIX_DATA);
7077 s = INTERNAL_DISASSEMBLER_ERROR;
7084 OP_I (int bytemode, int sizeflag)
7087 bfd_signed_vma mask = -1;
7092 FETCH_DATA (the_info, codep + 1);
7097 if (address_mode == mode_64bit)
7107 else if (sizeflag & DFLAG)
7117 used_prefixes |= (prefixes & PREFIX_DATA);
7128 oappend (INTERNAL_DISASSEMBLER_ERROR);
7133 scratchbuf[0] = '$';
7134 print_operand_value (scratchbuf + 1, 1, op);
7135 oappend (scratchbuf + intel_syntax);
7136 scratchbuf[0] = '\0';
7140 OP_I64 (int bytemode, int sizeflag)
7143 bfd_signed_vma mask = -1;
7145 if (address_mode != mode_64bit)
7147 OP_I (bytemode, sizeflag);
7154 FETCH_DATA (the_info, codep + 1);
7162 else if (sizeflag & DFLAG)
7172 used_prefixes |= (prefixes & PREFIX_DATA);
7179 oappend (INTERNAL_DISASSEMBLER_ERROR);
7184 scratchbuf[0] = '$';
7185 print_operand_value (scratchbuf + 1, 1, op);
7186 oappend (scratchbuf + intel_syntax);
7187 scratchbuf[0] = '\0';
7191 OP_sI (int bytemode, int sizeflag)
7194 bfd_signed_vma mask = -1;
7199 FETCH_DATA (the_info, codep + 1);
7201 if ((op & 0x80) != 0)
7209 else if (sizeflag & DFLAG)
7218 if ((op & 0x8000) != 0)
7221 used_prefixes |= (prefixes & PREFIX_DATA);
7226 if ((op & 0x8000) != 0)
7230 oappend (INTERNAL_DISASSEMBLER_ERROR);
7234 scratchbuf[0] = '$';
7235 print_operand_value (scratchbuf + 1, 1, op);
7236 oappend (scratchbuf + intel_syntax);
7240 OP_J (int bytemode, int sizeflag)
7244 bfd_vma segment = 0;
7249 FETCH_DATA (the_info, codep + 1);
7251 if ((disp & 0x80) != 0)
7255 if ((sizeflag & DFLAG) || (rex & REX_W))
7260 if ((disp & 0x8000) != 0)
7262 /* In 16bit mode, address is wrapped around at 64k within
7263 the same segment. Otherwise, a data16 prefix on a jump
7264 instruction means that the pc is masked to 16 bits after
7265 the displacement is added! */
7267 if ((prefixes & PREFIX_DATA) == 0)
7268 segment = ((start_pc + codep - start_codep)
7269 & ~((bfd_vma) 0xffff));
7271 used_prefixes |= (prefixes & PREFIX_DATA);
7274 oappend (INTERNAL_DISASSEMBLER_ERROR);
7277 disp = ((start_pc + codep - start_codep + disp) & mask) | segment;
7279 print_operand_value (scratchbuf, 1, disp);
7280 oappend (scratchbuf);
7284 OP_SEG (int bytemode, int sizeflag)
7286 if (bytemode == w_mode)
7287 oappend (names_seg[modrm.reg]);
7289 OP_E (modrm.mod == 3 ? bytemode : w_mode, sizeflag);
7293 OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
7297 if (sizeflag & DFLAG)
7307 used_prefixes |= (prefixes & PREFIX_DATA);
7309 sprintf (scratchbuf, "0x%x:0x%x", seg, offset);
7311 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
7312 oappend (scratchbuf);
7316 OP_OFF (int bytemode, int sizeflag)
7320 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
7321 intel_operand_size (bytemode, sizeflag);
7324 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
7331 if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
7332 | PREFIX_ES | PREFIX_FS | PREFIX_GS)))
7334 oappend (names_seg[ds_reg - es_reg]);
7338 print_operand_value (scratchbuf, 1, off);
7339 oappend (scratchbuf);
7343 OP_OFF64 (int bytemode, int sizeflag)
7347 if (address_mode != mode_64bit
7348 || (prefixes & PREFIX_ADDR))
7350 OP_OFF (bytemode, sizeflag);
7354 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
7355 intel_operand_size (bytemode, sizeflag);
7362 if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
7363 | PREFIX_ES | PREFIX_FS | PREFIX_GS)))
7365 oappend (names_seg[ds_reg - es_reg]);
7369 print_operand_value (scratchbuf, 1, off);
7370 oappend (scratchbuf);
7374 ptr_reg (int code, int sizeflag)
7378 *obufp++ = open_char;
7379 used_prefixes |= (prefixes & PREFIX_ADDR);
7380 if (address_mode == mode_64bit)
7382 if (!(sizeflag & AFLAG))
7383 s = names32[code - eAX_reg];
7385 s = names64[code - eAX_reg];
7387 else if (sizeflag & AFLAG)
7388 s = names32[code - eAX_reg];
7390 s = names16[code - eAX_reg];
7392 *obufp++ = close_char;
7397 OP_ESreg (int code, int sizeflag)
7403 case 0x6d: /* insw/insl */
7404 intel_operand_size (z_mode, sizeflag);
7406 case 0xa5: /* movsw/movsl/movsq */
7407 case 0xa7: /* cmpsw/cmpsl/cmpsq */
7408 case 0xab: /* stosw/stosl */
7409 case 0xaf: /* scasw/scasl */
7410 intel_operand_size (v_mode, sizeflag);
7413 intel_operand_size (b_mode, sizeflag);
7416 oappend ("%es:" + intel_syntax);
7417 ptr_reg (code, sizeflag);
7421 OP_DSreg (int code, int sizeflag)
7427 case 0x6f: /* outsw/outsl */
7428 intel_operand_size (z_mode, sizeflag);
7430 case 0xa5: /* movsw/movsl/movsq */
7431 case 0xa7: /* cmpsw/cmpsl/cmpsq */
7432 case 0xad: /* lodsw/lodsl/lodsq */
7433 intel_operand_size (v_mode, sizeflag);
7436 intel_operand_size (b_mode, sizeflag);
7446 prefixes |= PREFIX_DS;
7448 ptr_reg (code, sizeflag);
7452 OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
7460 else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
7463 used_prefixes |= PREFIX_LOCK;
7468 sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
7469 oappend (scratchbuf + intel_syntax);
7473 OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
7482 sprintf (scratchbuf, "db%d", modrm.reg + add);
7484 sprintf (scratchbuf, "%%db%d", modrm.reg + add);
7485 oappend (scratchbuf);
7489 OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
7491 sprintf (scratchbuf, "%%tr%d", modrm.reg);
7492 oappend (scratchbuf + intel_syntax);
7496 OP_R (int bytemode, int sizeflag)
7499 OP_E (bytemode, sizeflag);
7505 OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
7507 used_prefixes |= (prefixes & PREFIX_DATA);
7508 if (prefixes & PREFIX_DATA)
7516 sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
7519 sprintf (scratchbuf, "%%mm%d", modrm.reg);
7520 oappend (scratchbuf + intel_syntax);
7524 OP_XMM (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
7532 sprintf (scratchbuf, "%%xmm%d", modrm.reg + add);
7533 oappend (scratchbuf + intel_syntax);
7537 OP_EM (int bytemode, int sizeflag)
7541 if (intel_syntax && bytemode == v_mode)
7543 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
7544 used_prefixes |= (prefixes & PREFIX_DATA);
7546 OP_E (bytemode, sizeflag);
7550 /* Skip mod/rm byte. */
7553 used_prefixes |= (prefixes & PREFIX_DATA);
7554 if (prefixes & PREFIX_DATA)
7563 sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
7566 sprintf (scratchbuf, "%%mm%d", modrm.rm);
7567 oappend (scratchbuf + intel_syntax);
7570 /* cvt* are the only instructions in sse2 which have
7571 both SSE and MMX operands and also have 0x66 prefix
7572 in their opcode. 0x66 was originally used to differentiate
7573 between SSE and MMX instruction(operands). So we have to handle the
7574 cvt* separately using OP_EMC and OP_MXC */
7576 OP_EMC (int bytemode, int sizeflag)
7580 if (intel_syntax && bytemode == v_mode)
7582 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
7583 used_prefixes |= (prefixes & PREFIX_DATA);
7585 OP_E (bytemode, sizeflag);
7589 /* Skip mod/rm byte. */
7592 used_prefixes |= (prefixes & PREFIX_DATA);
7593 sprintf (scratchbuf, "%%mm%d", modrm.rm);
7594 oappend (scratchbuf + intel_syntax);
7598 OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
7600 used_prefixes |= (prefixes & PREFIX_DATA);
7601 sprintf (scratchbuf, "%%mm%d", modrm.reg);
7602 oappend (scratchbuf + intel_syntax);
7606 OP_EX (int bytemode, int sizeflag)
7611 OP_E (bytemode, sizeflag);
7620 /* Skip mod/rm byte. */
7623 sprintf (scratchbuf, "%%xmm%d", modrm.rm + add);
7624 oappend (scratchbuf + intel_syntax);
7628 OP_MS (int bytemode, int sizeflag)
7631 OP_EM (bytemode, sizeflag);
7637 OP_XS (int bytemode, int sizeflag)
7640 OP_EX (bytemode, sizeflag);
7646 OP_M (int bytemode, int sizeflag)
7649 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
7652 OP_E (bytemode, sizeflag);
7656 OP_0f07 (int bytemode, int sizeflag)
7658 if (modrm.mod != 3 || modrm.rm != 0)
7661 OP_E (bytemode, sizeflag);
7664 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
7665 32bit mode and "xchg %rax,%rax" in 64bit mode. */
7668 NOP_Fixup1 (int bytemode, int sizeflag)
7670 if ((prefixes & PREFIX_DATA) != 0
7673 && address_mode == mode_64bit))
7674 OP_REG (bytemode, sizeflag);
7676 strcpy (obuf, "nop");
7680 NOP_Fixup2 (int bytemode, int sizeflag)
7682 if ((prefixes & PREFIX_DATA) != 0
7685 && address_mode == mode_64bit))
7686 OP_IMREG (bytemode, sizeflag);
7689 static const char *const Suffix3DNow[] = {
7690 /* 00 */ NULL, NULL, NULL, NULL,
7691 /* 04 */ NULL, NULL, NULL, NULL,
7692 /* 08 */ NULL, NULL, NULL, NULL,
7693 /* 0C */ "pi2fw", "pi2fd", NULL, NULL,
7694 /* 10 */ NULL, NULL, NULL, NULL,
7695 /* 14 */ NULL, NULL, NULL, NULL,
7696 /* 18 */ NULL, NULL, NULL, NULL,
7697 /* 1C */ "pf2iw", "pf2id", NULL, NULL,
7698 /* 20 */ NULL, NULL, NULL, NULL,
7699 /* 24 */ NULL, NULL, NULL, NULL,
7700 /* 28 */ NULL, NULL, NULL, NULL,
7701 /* 2C */ NULL, NULL, NULL, NULL,
7702 /* 30 */ NULL, NULL, NULL, NULL,
7703 /* 34 */ NULL, NULL, NULL, NULL,
7704 /* 38 */ NULL, NULL, NULL, NULL,
7705 /* 3C */ NULL, NULL, NULL, NULL,
7706 /* 40 */ NULL, NULL, NULL, NULL,
7707 /* 44 */ NULL, NULL, NULL, NULL,
7708 /* 48 */ NULL, NULL, NULL, NULL,
7709 /* 4C */ NULL, NULL, NULL, NULL,
7710 /* 50 */ NULL, NULL, NULL, NULL,
7711 /* 54 */ NULL, NULL, NULL, NULL,
7712 /* 58 */ NULL, NULL, NULL, NULL,
7713 /* 5C */ NULL, NULL, NULL, NULL,
7714 /* 60 */ NULL, NULL, NULL, NULL,
7715 /* 64 */ NULL, NULL, NULL, NULL,
7716 /* 68 */ NULL, NULL, NULL, NULL,
7717 /* 6C */ NULL, NULL, NULL, NULL,
7718 /* 70 */ NULL, NULL, NULL, NULL,
7719 /* 74 */ NULL, NULL, NULL, NULL,
7720 /* 78 */ NULL, NULL, NULL, NULL,
7721 /* 7C */ NULL, NULL, NULL, NULL,
7722 /* 80 */ NULL, NULL, NULL, NULL,
7723 /* 84 */ NULL, NULL, NULL, NULL,
7724 /* 88 */ NULL, NULL, "pfnacc", NULL,
7725 /* 8C */ NULL, NULL, "pfpnacc", NULL,
7726 /* 90 */ "pfcmpge", NULL, NULL, NULL,
7727 /* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",
7728 /* 98 */ NULL, NULL, "pfsub", NULL,
7729 /* 9C */ NULL, NULL, "pfadd", NULL,
7730 /* A0 */ "pfcmpgt", NULL, NULL, NULL,
7731 /* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",
7732 /* A8 */ NULL, NULL, "pfsubr", NULL,
7733 /* AC */ NULL, NULL, "pfacc", NULL,
7734 /* B0 */ "pfcmpeq", NULL, NULL, NULL,
7735 /* B4 */ "pfmul", NULL, "pfrcpit2", "pmulhrw",
7736 /* B8 */ NULL, NULL, NULL, "pswapd",
7737 /* BC */ NULL, NULL, NULL, "pavgusb",
7738 /* C0 */ NULL, NULL, NULL, NULL,
7739 /* C4 */ NULL, NULL, NULL, NULL,
7740 /* C8 */ NULL, NULL, NULL, NULL,
7741 /* CC */ NULL, NULL, NULL, NULL,
7742 /* D0 */ NULL, NULL, NULL, NULL,
7743 /* D4 */ NULL, NULL, NULL, NULL,
7744 /* D8 */ NULL, NULL, NULL, NULL,
7745 /* DC */ NULL, NULL, NULL, NULL,
7746 /* E0 */ NULL, NULL, NULL, NULL,
7747 /* E4 */ NULL, NULL, NULL, NULL,
7748 /* E8 */ NULL, NULL, NULL, NULL,
7749 /* EC */ NULL, NULL, NULL, NULL,
7750 /* F0 */ NULL, NULL, NULL, NULL,
7751 /* F4 */ NULL, NULL, NULL, NULL,
7752 /* F8 */ NULL, NULL, NULL, NULL,
7753 /* FC */ NULL, NULL, NULL, NULL,
7757 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
7759 const char *mnemonic;
7761 FETCH_DATA (the_info, codep + 1);
7762 /* AMD 3DNow! instructions are specified by an opcode suffix in the
7763 place where an 8-bit immediate would normally go. ie. the last
7764 byte of the instruction. */
7765 obufp = obuf + strlen (obuf);
7766 mnemonic = Suffix3DNow[*codep++ & 0xff];
7771 /* Since a variable sized modrm/sib chunk is between the start
7772 of the opcode (0x0f0f) and the opcode suffix, we need to do
7773 all the modrm processing first, and don't know until now that
7774 we have a bad opcode. This necessitates some cleaning up. */
7775 op_out[0][0] = '\0';
7776 op_out[1][0] = '\0';
7781 static const char *simd_cmp_op[] = {
7793 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
7795 unsigned int cmp_type;
7797 FETCH_DATA (the_info, codep + 1);
7798 cmp_type = *codep++ & 0xff;
7802 char *p = obuf + strlen (obuf) - 2;
7806 sprintf (p, "%s%s", simd_cmp_op[cmp_type], suffix);
7810 /* We have a reserved extension byte. Output it directly. */
7811 scratchbuf[0] = '$';
7812 print_operand_value (scratchbuf + 1, 1, cmp_type);
7813 oappend (scratchbuf + intel_syntax);
7814 scratchbuf[0] = '\0';
7819 OP_Mwait (int bytemode ATTRIBUTE_UNUSED,
7820 int sizeflag ATTRIBUTE_UNUSED)
7822 /* mwait %eax,%ecx */
7825 const char **names = (address_mode == mode_64bit
7826 ? names64 : names32);
7827 strcpy (op_out[0], names[0]);
7828 strcpy (op_out[1], names[1]);
7831 /* Skip mod/rm byte. */
7837 OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
7838 int sizeflag ATTRIBUTE_UNUSED)
7840 /* monitor %eax,%ecx,%edx" */
7843 const char **op1_names;
7844 const char **names = (address_mode == mode_64bit
7845 ? names64 : names32);
7847 if (!(prefixes & PREFIX_ADDR))
7848 op1_names = (address_mode == mode_16bit
7852 /* Remove "addr16/addr32". */
7854 op1_names = (address_mode != mode_32bit
7855 ? names32 : names16);
7856 used_prefixes |= PREFIX_ADDR;
7858 strcpy (op_out[0], op1_names[0]);
7859 strcpy (op_out[1], names[1]);
7860 strcpy (op_out[2], names[2]);
7863 /* Skip mod/rm byte. */
7871 /* Throw away prefixes and 1st. opcode byte. */
7872 codep = insn_codep + 1;
7877 REP_Fixup (int bytemode, int sizeflag)
7879 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
7881 if (prefixes & PREFIX_REPZ)
7882 repz_prefix = "rep ";
7889 OP_IMREG (bytemode, sizeflag);
7892 OP_ESreg (bytemode, sizeflag);
7895 OP_DSreg (bytemode, sizeflag);
7904 CMPXCHG8B_Fixup (int bytemode, int sizeflag)
7909 /* Change cmpxchg8b to cmpxchg16b. */
7910 char *p = obuf + strlen (obuf) - 2;
7914 OP_M (bytemode, sizeflag);
7918 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
7920 sprintf (scratchbuf, "%%xmm%d", reg);
7921 oappend (scratchbuf + intel_syntax);
7925 CRC32_Fixup (int bytemode, int sizeflag)
7927 /* Add proper suffix to "crc32". */
7928 char *p = obuf + strlen (obuf);
7945 else if (sizeflag & DFLAG)
7949 used_prefixes |= (prefixes & PREFIX_DATA);
7952 oappend (INTERNAL_DISASSEMBLER_ERROR);
7961 /* Skip mod/rm byte. */
7966 add = (rex & REX_B) ? 8 : 0;
7967 if (bytemode == b_mode)
7971 oappend (names8rex[modrm.rm + add]);
7973 oappend (names8[modrm.rm + add]);
7979 oappend (names64[modrm.rm + add]);
7980 else if ((prefixes & PREFIX_DATA))
7981 oappend (names16[modrm.rm + add]);
7983 oappend (names32[modrm.rm + add]);
7987 OP_E (bytemode, sizeflag);
7990 /* Print a DREX argument as either a register or memory operation. */
7992 print_drex_arg (unsigned int reg, int bytemode, int sizeflag)
7994 if (reg == DREX_REG_UNKNOWN)
7997 else if (reg != DREX_REG_MEMORY)
7999 sprintf (scratchbuf, "%%xmm%d", reg);
8000 oappend (scratchbuf + intel_syntax);
8004 OP_E_extended (bytemode, sizeflag, 1);
8007 /* SSE5 instructions that have 4 arguments are encoded as:
8008 0f 24 <sub-opcode> <modrm> <optional-sib> <drex> <offset>.
8010 The <sub-opcode> byte has 1 bit (0x4) that is combined with 1 bit in
8011 the DREX field (0x8) to determine how the arguments are laid out.
8012 The destination register must be the same register as one of the
8013 inputs, and it is encoded in the DREX byte. No REX prefix is used
8014 for these instructions, since the DREX field contains the 3 extension
8015 bits provided by the REX prefix.
8017 The bytemode argument adds 2 extra bits for passing extra information:
8018 DREX_OC1 -- Set the OC1 bit to indicate dest == 1st arg
8019 DREX_NO_OC0 -- OC0 in DREX is invalid
8020 (but pretend it is set). */
8023 OP_DREX4 (int flag_bytemode, int sizeflag)
8025 unsigned int drex_byte;
8026 unsigned int regs[4];
8027 unsigned int modrm_regmem;
8028 unsigned int modrm_reg;
8029 unsigned int drex_reg;
8032 int rex_used_save = rex_used;
8034 int oc1 = (flag_bytemode & DREX_OC1) ? 2 : 0;
8038 bytemode = flag_bytemode & ~ DREX_MASK;
8040 for (i = 0; i < 4; i++)
8041 regs[i] = DREX_REG_UNKNOWN;
8043 /* Determine if we have a SIB byte in addition to MODRM before the
8045 if (((sizeflag & AFLAG) || address_mode == mode_64bit)
8050 /* Get the DREX byte. */
8051 FETCH_DATA (the_info, codep + 2 + has_sib);
8052 drex_byte = codep[has_sib+1];
8053 drex_reg = DREX_XMM (drex_byte);
8054 modrm_reg = modrm.reg + ((drex_byte & REX_R) ? 8 : 0);
8056 /* Is OC0 legal? If not, hardwire oc0 == 1. */
8057 if (flag_bytemode & DREX_NO_OC0)
8060 if (DREX_OC0 (drex_byte))
8064 oc0 = DREX_OC0 (drex_byte);
8068 /* regmem == register */
8069 modrm_regmem = modrm.rm + ((drex_byte & REX_B) ? 8 : 0);
8071 /* skip modrm/drex since we don't call OP_E_extended */
8076 /* regmem == memory, fill in appropriate REX bits */
8077 modrm_regmem = DREX_REG_MEMORY;
8078 rex = drex_byte & (REX_B | REX_X | REX_R);
8084 /* Based on the OC1/OC0 bits, lay out the arguments in the correct
8093 regs[0] = modrm_regmem;
8094 regs[1] = modrm_reg;
8100 regs[0] = modrm_reg;
8101 regs[1] = modrm_regmem;
8108 regs[1] = modrm_regmem;
8109 regs[2] = modrm_reg;
8115 regs[1] = modrm_reg;
8116 regs[2] = modrm_regmem;
8121 /* Print out the arguments. */
8122 for (i = 0; i < 4; i++)
8124 int j = (intel_syntax) ? 3 - i : i;
8131 print_drex_arg (regs[j], bytemode, sizeflag);
8135 rex_used = rex_used_save;
8138 /* SSE5 instructions that have 3 arguments, and are encoded as:
8139 0f 24 <sub-opcode> <modrm> <optional-sib> <drex> <offset> (or)
8140 0f 25 <sub-opcode> <modrm> <optional-sib> <drex> <offset> <cmp-byte>
8142 The DREX field has 1 bit (0x8) to determine how the arguments are
8143 laid out. The destination register is encoded in the DREX byte.
8144 No REX prefix is used for these instructions, since the DREX field
8145 contains the 3 extension bits provided by the REX prefix. */
8148 OP_DREX3 (int flag_bytemode, int sizeflag)
8150 unsigned int drex_byte;
8151 unsigned int regs[3];
8152 unsigned int modrm_regmem;
8153 unsigned int modrm_reg;
8154 unsigned int drex_reg;
8157 int rex_used_save = rex_used;
8162 bytemode = flag_bytemode & ~ DREX_MASK;
8164 for (i = 0; i < 3; i++)
8165 regs[i] = DREX_REG_UNKNOWN;
8167 /* Determine if we have a SIB byte in addition to MODRM before the
8169 if (((sizeflag & AFLAG) || address_mode == mode_64bit)
8174 /* Get the DREX byte. */
8175 FETCH_DATA (the_info, codep + 2 + has_sib);
8176 drex_byte = codep[has_sib+1];
8177 drex_reg = DREX_XMM (drex_byte);
8178 modrm_reg = modrm.reg + ((drex_byte & REX_R) ? 8 : 0);
8180 /* Is OC0 legal? If not, hardwire oc0 == 0 */
8181 oc0 = DREX_OC0 (drex_byte);
8182 if ((flag_bytemode & DREX_NO_OC0) && oc0)
8187 /* regmem == register */
8188 modrm_regmem = modrm.rm + ((drex_byte & REX_B) ? 8 : 0);
8190 /* skip modrm/drex since we don't call OP_E_extended. */
8195 /* regmem == memory, fill in appropriate REX bits. */
8196 modrm_regmem = DREX_REG_MEMORY;
8197 rex = drex_byte & (REX_B | REX_X | REX_R);
8203 /* Based on the OC1/OC0 bits, lay out the arguments in the correct
8212 regs[0] = modrm_regmem;
8213 regs[1] = modrm_reg;
8218 regs[0] = modrm_reg;
8219 regs[1] = modrm_regmem;
8224 /* Print out the arguments. */
8225 for (i = 0; i < 3; i++)
8227 int j = (intel_syntax) ? 2 - i : i;
8234 print_drex_arg (regs[j], bytemode, sizeflag);
8238 rex_used = rex_used_save;
8241 /* Emit a floating point comparison for comp<xx> instructions. */
8244 OP_DREX_FCMP (int bytemode ATTRIBUTE_UNUSED,
8245 int sizeflag ATTRIBUTE_UNUSED)
8249 static const char *const cmp_test[] = {
8268 FETCH_DATA (the_info, codep + 1);
8269 byte = *codep & 0xff;
8271 if (byte >= ARRAY_SIZE (cmp_test)
8276 /* The instruction isn't one we know about, so just append the
8277 extension byte as a numeric value. */
8283 sprintf (scratchbuf, "com%s%s", cmp_test[byte], obuf+3);
8284 strcpy (obuf, scratchbuf);
8289 /* Emit an integer point comparison for pcom<xx> instructions,
8290 rewriting the instruction to have the test inside of it. */
8293 OP_DREX_ICMP (int bytemode ATTRIBUTE_UNUSED,
8294 int sizeflag ATTRIBUTE_UNUSED)
8298 static const char *const cmp_test[] = {
8309 FETCH_DATA (the_info, codep + 1);
8310 byte = *codep & 0xff;
8312 if (byte >= ARRAY_SIZE (cmp_test)
8318 /* The instruction isn't one we know about, so just print the
8319 comparison test byte as a numeric value. */
8325 sprintf (scratchbuf, "pcom%s%s", cmp_test[byte], obuf+4);
8326 strcpy (obuf, scratchbuf);