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 Mx { OP_M, x_mode }
240 #define Gb { OP_G, b_mode }
241 #define Gv { OP_G, v_mode }
242 #define Gd { OP_G, d_mode }
243 #define Gdq { OP_G, dq_mode }
244 #define Gm { OP_G, m_mode }
245 #define Gw { OP_G, w_mode }
246 #define Rd { OP_R, d_mode }
247 #define Rm { OP_R, m_mode }
248 #define Ib { OP_I, b_mode }
249 #define sIb { OP_sI, b_mode } /* sign extened byte */
250 #define Iv { OP_I, v_mode }
251 #define Iq { OP_I, q_mode }
252 #define Iv64 { OP_I64, v_mode }
253 #define Iw { OP_I, w_mode }
254 #define I1 { OP_I, const_1_mode }
255 #define Jb { OP_J, b_mode }
256 #define Jv { OP_J, v_mode }
257 #define Cm { OP_C, m_mode }
258 #define Dm { OP_D, m_mode }
259 #define Td { OP_T, d_mode }
260 #define Skip_MODRM { OP_Skip_MODRM, 0 }
262 #define RMeAX { OP_REG, eAX_reg }
263 #define RMeBX { OP_REG, eBX_reg }
264 #define RMeCX { OP_REG, eCX_reg }
265 #define RMeDX { OP_REG, eDX_reg }
266 #define RMeSP { OP_REG, eSP_reg }
267 #define RMeBP { OP_REG, eBP_reg }
268 #define RMeSI { OP_REG, eSI_reg }
269 #define RMeDI { OP_REG, eDI_reg }
270 #define RMrAX { OP_REG, rAX_reg }
271 #define RMrBX { OP_REG, rBX_reg }
272 #define RMrCX { OP_REG, rCX_reg }
273 #define RMrDX { OP_REG, rDX_reg }
274 #define RMrSP { OP_REG, rSP_reg }
275 #define RMrBP { OP_REG, rBP_reg }
276 #define RMrSI { OP_REG, rSI_reg }
277 #define RMrDI { OP_REG, rDI_reg }
278 #define RMAL { OP_REG, al_reg }
279 #define RMAL { OP_REG, al_reg }
280 #define RMCL { OP_REG, cl_reg }
281 #define RMDL { OP_REG, dl_reg }
282 #define RMBL { OP_REG, bl_reg }
283 #define RMAH { OP_REG, ah_reg }
284 #define RMCH { OP_REG, ch_reg }
285 #define RMDH { OP_REG, dh_reg }
286 #define RMBH { OP_REG, bh_reg }
287 #define RMAX { OP_REG, ax_reg }
288 #define RMDX { OP_REG, dx_reg }
290 #define eAX { OP_IMREG, eAX_reg }
291 #define eBX { OP_IMREG, eBX_reg }
292 #define eCX { OP_IMREG, eCX_reg }
293 #define eDX { OP_IMREG, eDX_reg }
294 #define eSP { OP_IMREG, eSP_reg }
295 #define eBP { OP_IMREG, eBP_reg }
296 #define eSI { OP_IMREG, eSI_reg }
297 #define eDI { OP_IMREG, eDI_reg }
298 #define AL { OP_IMREG, al_reg }
299 #define CL { OP_IMREG, cl_reg }
300 #define DL { OP_IMREG, dl_reg }
301 #define BL { OP_IMREG, bl_reg }
302 #define AH { OP_IMREG, ah_reg }
303 #define CH { OP_IMREG, ch_reg }
304 #define DH { OP_IMREG, dh_reg }
305 #define BH { OP_IMREG, bh_reg }
306 #define AX { OP_IMREG, ax_reg }
307 #define DX { OP_IMREG, dx_reg }
308 #define zAX { OP_IMREG, z_mode_ax_reg }
309 #define indirDX { OP_IMREG, indir_dx_reg }
311 #define Sw { OP_SEG, w_mode }
312 #define Sv { OP_SEG, v_mode }
313 #define Ap { OP_DIR, 0 }
314 #define Ob { OP_OFF64, b_mode }
315 #define Ov { OP_OFF64, v_mode }
316 #define Xb { OP_DSreg, eSI_reg }
317 #define Xv { OP_DSreg, eSI_reg }
318 #define Xz { OP_DSreg, eSI_reg }
319 #define Yb { OP_ESreg, eDI_reg }
320 #define Yv { OP_ESreg, eDI_reg }
321 #define DSBX { OP_DSreg, eBX_reg }
323 #define es { OP_REG, es_reg }
324 #define ss { OP_REG, ss_reg }
325 #define cs { OP_REG, cs_reg }
326 #define ds { OP_REG, ds_reg }
327 #define fs { OP_REG, fs_reg }
328 #define gs { OP_REG, gs_reg }
330 #define MX { OP_MMX, 0 }
331 #define XM { OP_XMM, 0 }
332 #define EM { OP_EM, v_mode }
333 #define EMd { OP_EM, d_mode }
334 #define EMx { OP_EM, x_mode }
335 #define EXw { OP_EX, w_mode }
336 #define EXd { OP_EX, d_mode }
337 #define EXq { OP_EX, q_mode }
338 #define EXx { OP_EX, x_mode }
339 #define MS { OP_MS, v_mode }
340 #define XS { OP_XS, v_mode }
341 #define EMCq { OP_EMC, q_mode }
342 #define MXC { OP_MXC, 0 }
343 #define OPSUF { OP_3DNowSuffix, 0 }
344 #define CMP { CMP_Fixup, 0 }
345 #define XMM0 { XMM_Fixup, 0 }
347 /* Used handle "rep" prefix for string instructions. */
348 #define Xbr { REP_Fixup, eSI_reg }
349 #define Xvr { REP_Fixup, eSI_reg }
350 #define Ybr { REP_Fixup, eDI_reg }
351 #define Yvr { REP_Fixup, eDI_reg }
352 #define Yzr { REP_Fixup, eDI_reg }
353 #define indirDXr { REP_Fixup, indir_dx_reg }
354 #define ALr { REP_Fixup, al_reg }
355 #define eAXr { REP_Fixup, eAX_reg }
357 #define cond_jump_flag { NULL, cond_jump_mode }
358 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
360 /* bits in sizeflag */
361 #define SUFFIX_ALWAYS 4
367 /* operand size depends on prefixes */
368 #define v_mode (b_mode + 1)
370 #define w_mode (v_mode + 1)
371 /* double word operand */
372 #define d_mode (w_mode + 1)
373 /* quad word operand */
374 #define q_mode (d_mode + 1)
375 /* ten-byte operand */
376 #define t_mode (q_mode + 1)
377 /* 16-byte XMM operand */
378 #define x_mode (t_mode + 1)
379 /* d_mode in 32bit, q_mode in 64bit mode. */
380 #define m_mode (x_mode + 1)
381 #define cond_jump_mode (m_mode + 1)
382 #define loop_jcxz_mode (cond_jump_mode + 1)
383 /* operand size depends on REX prefixes. */
384 #define dq_mode (loop_jcxz_mode + 1)
385 /* registers like dq_mode, memory like w_mode. */
386 #define dqw_mode (dq_mode + 1)
387 /* 4- or 6-byte pointer operand */
388 #define f_mode (dqw_mode + 1)
389 #define const_1_mode (f_mode + 1)
390 /* v_mode for stack-related opcodes. */
391 #define stack_v_mode (const_1_mode + 1)
392 /* non-quad operand size depends on prefixes */
393 #define z_mode (stack_v_mode + 1)
394 /* 16-byte operand */
395 #define o_mode (z_mode + 1)
396 /* registers like dq_mode, memory like b_mode. */
397 #define dqb_mode (o_mode + 1)
398 /* registers like dq_mode, memory like d_mode. */
399 #define dqd_mode (dqb_mode + 1)
401 #define es_reg (dqd_mode + 1)
402 #define cs_reg (es_reg + 1)
403 #define ss_reg (cs_reg + 1)
404 #define ds_reg (ss_reg + 1)
405 #define fs_reg (ds_reg + 1)
406 #define gs_reg (fs_reg + 1)
408 #define eAX_reg (gs_reg + 1)
409 #define eCX_reg (eAX_reg + 1)
410 #define eDX_reg (eCX_reg + 1)
411 #define eBX_reg (eDX_reg + 1)
412 #define eSP_reg (eBX_reg + 1)
413 #define eBP_reg (eSP_reg + 1)
414 #define eSI_reg (eBP_reg + 1)
415 #define eDI_reg (eSI_reg + 1)
417 #define al_reg (eDI_reg + 1)
418 #define cl_reg (al_reg + 1)
419 #define dl_reg (cl_reg + 1)
420 #define bl_reg (dl_reg + 1)
421 #define ah_reg (bl_reg + 1)
422 #define ch_reg (ah_reg + 1)
423 #define dh_reg (ch_reg + 1)
424 #define bh_reg (dh_reg + 1)
426 #define ax_reg (bh_reg + 1)
427 #define cx_reg (ax_reg + 1)
428 #define dx_reg (cx_reg + 1)
429 #define bx_reg (dx_reg + 1)
430 #define sp_reg (bx_reg + 1)
431 #define bp_reg (sp_reg + 1)
432 #define si_reg (bp_reg + 1)
433 #define di_reg (si_reg + 1)
435 #define rAX_reg (di_reg + 1)
436 #define rCX_reg (rAX_reg + 1)
437 #define rDX_reg (rCX_reg + 1)
438 #define rBX_reg (rDX_reg + 1)
439 #define rSP_reg (rBX_reg + 1)
440 #define rBP_reg (rSP_reg + 1)
441 #define rSI_reg (rBP_reg + 1)
442 #define rDI_reg (rSI_reg + 1)
444 #define z_mode_ax_reg (rDI_reg + 1)
445 #define indir_dx_reg (z_mode_ax_reg + 1)
447 #define MAX_BYTEMODE indir_dx_reg
449 /* Flags that are OR'ed into the bytemode field to pass extra
451 #define DREX_OC1 0x10000 /* OC1 bit set */
452 #define DREX_NO_OC0 0x20000 /* OC0 bit not used */
453 #define DREX_MASK 0x40000 /* mask to delete */
455 #if MAX_BYTEMODE >= DREX_OC1
456 #error MAX_BYTEMODE must be less than DREX_OC1
460 #define USE_REG_TABLE (FLOATCODE + 1)
461 #define USE_MOD_TABLE (USE_REG_TABLE + 1)
462 #define USE_RM_TABLE (USE_MOD_TABLE + 1)
463 #define USE_PREFIX_TABLE (USE_RM_TABLE + 1)
464 #define USE_X86_64_TABLE (USE_PREFIX_TABLE + 1)
465 #define USE_3BYTE_TABLE (USE_X86_64_TABLE + 1)
467 #define FLOAT NULL, { { NULL, FLOATCODE } }
469 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }
470 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
471 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
472 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
473 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
474 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
475 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
478 #define REG_81 (REG_80 + 1)
479 #define REG_82 (REG_81 + 1)
480 #define REG_8F (REG_82 + 1)
481 #define REG_C0 (REG_8F + 1)
482 #define REG_C1 (REG_C0 + 1)
483 #define REG_C6 (REG_C1 + 1)
484 #define REG_C7 (REG_C6 + 1)
485 #define REG_D0 (REG_C7 + 1)
486 #define REG_D1 (REG_D0 + 1)
487 #define REG_D2 (REG_D1 + 1)
488 #define REG_D3 (REG_D2 + 1)
489 #define REG_F6 (REG_D3 + 1)
490 #define REG_F7 (REG_F6 + 1)
491 #define REG_FE (REG_F7 + 1)
492 #define REG_FF (REG_FE + 1)
493 #define REG_0F00 (REG_FF + 1)
494 #define REG_0F01 (REG_0F00 + 1)
495 #define REG_0F0D (REG_0F01 + 1)
496 #define REG_0F18 (REG_0F0D + 1)
497 #define REG_0F71 (REG_0F18 + 1)
498 #define REG_0F72 (REG_0F71 + 1)
499 #define REG_0F73 (REG_0F72 + 1)
500 #define REG_0FA6 (REG_0F73 + 1)
501 #define REG_0FA7 (REG_0FA6 + 1)
502 #define REG_0FAE (REG_0FA7 + 1)
503 #define REG_0FBA (REG_0FAE + 1)
504 #define REG_0FC7 (REG_0FBA + 1)
507 #define MOD_0F01_REG_0 (MOD_8D + 1)
508 #define MOD_0F01_REG_1 (MOD_0F01_REG_0 + 1)
509 #define MOD_0F01_REG_2 (MOD_0F01_REG_1 + 1)
510 #define MOD_0F01_REG_3 (MOD_0F01_REG_2 + 1)
511 #define MOD_0F01_REG_7 (MOD_0F01_REG_3 + 1)
512 #define MOD_0F12_PREFIX_0 (MOD_0F01_REG_7 + 1)
513 #define MOD_0F13 (MOD_0F12_PREFIX_0 + 1)
514 #define MOD_0F16_PREFIX_0 (MOD_0F13 + 1)
515 #define MOD_0F17 (MOD_0F16_PREFIX_0 + 1)
516 #define MOD_0F18_REG_0 (MOD_0F17 + 1)
517 #define MOD_0F18_REG_1 (MOD_0F18_REG_0 + 1)
518 #define MOD_0F18_REG_2 (MOD_0F18_REG_1 + 1)
519 #define MOD_0F18_REG_3 (MOD_0F18_REG_2 + 1)
520 #define MOD_0F20 (MOD_0F18_REG_3 + 1)
521 #define MOD_0F21 (MOD_0F20 + 1)
522 #define MOD_0F22 (MOD_0F21 + 1)
523 #define MOD_0F23 (MOD_0F22 + 1)
524 #define MOD_0F24 (MOD_0F23 + 1)
525 #define MOD_0F26 (MOD_0F24 + 1)
526 #define MOD_0F2B_PREFIX_0 (MOD_0F26 + 1)
527 #define MOD_0F2B_PREFIX_1 (MOD_0F2B_PREFIX_0 + 1)
528 #define MOD_0F2B_PREFIX_2 (MOD_0F2B_PREFIX_1 + 1)
529 #define MOD_0F2B_PREFIX_3 (MOD_0F2B_PREFIX_2 + 1)
530 #define MOD_0F51 (MOD_0F2B_PREFIX_3 + 1)
531 #define MOD_0F71_REG_2 (MOD_0F51 + 1)
532 #define MOD_0F71_REG_4 (MOD_0F71_REG_2 + 1)
533 #define MOD_0F71_REG_6 (MOD_0F71_REG_4 + 1)
534 #define MOD_0F72_REG_2 (MOD_0F71_REG_6 + 1)
535 #define MOD_0F72_REG_4 (MOD_0F72_REG_2 + 1)
536 #define MOD_0F72_REG_6 (MOD_0F72_REG_4 + 1)
537 #define MOD_0F73_REG_2 (MOD_0F72_REG_6 + 1)
538 #define MOD_0F73_REG_3 (MOD_0F73_REG_2 + 1)
539 #define MOD_0F73_REG_6 (MOD_0F73_REG_3 + 1)
540 #define MOD_0F73_REG_7 (MOD_0F73_REG_6 + 1)
541 #define MOD_0FAE_REG_0 (MOD_0F73_REG_7 + 1)
542 #define MOD_0FAE_REG_1 (MOD_0FAE_REG_0 + 1)
543 #define MOD_0FAE_REG_2 (MOD_0FAE_REG_1 + 1)
544 #define MOD_0FAE_REG_3 (MOD_0FAE_REG_2 + 1)
545 #define MOD_0FAE_REG_5 (MOD_0FAE_REG_3 + 1)
546 #define MOD_0FAE_REG_6 (MOD_0FAE_REG_5 + 1)
547 #define MOD_0FAE_REG_7 (MOD_0FAE_REG_6 + 1)
548 #define MOD_0FB2 (MOD_0FAE_REG_7 + 1)
549 #define MOD_0FB4 (MOD_0FB2 + 1)
550 #define MOD_0FB5 (MOD_0FB4 + 1)
551 #define MOD_0FC7_REG_6 (MOD_0FB5 + 1)
552 #define MOD_0FC7_REG_7 (MOD_0FC7_REG_6 + 1)
553 #define MOD_0FD7 (MOD_0FC7_REG_7 + 1)
554 #define MOD_0FE7_PREFIX_2 (MOD_0FD7 + 1)
555 #define MOD_0FF0_PREFIX_3 (MOD_0FE7_PREFIX_2 + 1)
556 #define MOD_0F382A_PREFIX_2 (MOD_0FF0_PREFIX_3 + 1)
557 #define MOD_62_32BIT (MOD_0F382A_PREFIX_2 + 1)
558 #define MOD_C4_32BIT (MOD_62_32BIT + 1)
559 #define MOD_C5_32BIT (MOD_C4_32BIT + 1)
561 #define RM_0F01_REG_0 0
562 #define RM_0F01_REG_1 (RM_0F01_REG_0 + 1)
563 #define RM_0F01_REG_3 (RM_0F01_REG_1 + 1)
564 #define RM_0F01_REG_7 (RM_0F01_REG_3 + 1)
565 #define RM_0FAE_REG_5 (RM_0F01_REG_7 + 1)
566 #define RM_0FAE_REG_6 (RM_0FAE_REG_5 + 1)
567 #define RM_0FAE_REG_7 (RM_0FAE_REG_6 + 1)
570 #define PREFIX_0F10 (PREFIX_90 + 1)
571 #define PREFIX_0F11 (PREFIX_0F10 + 1)
572 #define PREFIX_0F12 (PREFIX_0F11 + 1)
573 #define PREFIX_0F16 (PREFIX_0F12 + 1)
574 #define PREFIX_0F2A (PREFIX_0F16 + 1)
575 #define PREFIX_0F2B (PREFIX_0F2A + 1)
576 #define PREFIX_0F2C (PREFIX_0F2B + 1)
577 #define PREFIX_0F2D (PREFIX_0F2C + 1)
578 #define PREFIX_0F2E (PREFIX_0F2D + 1)
579 #define PREFIX_0F2F (PREFIX_0F2E + 1)
580 #define PREFIX_0F51 (PREFIX_0F2F + 1)
581 #define PREFIX_0F52 (PREFIX_0F51 + 1)
582 #define PREFIX_0F53 (PREFIX_0F52 + 1)
583 #define PREFIX_0F58 (PREFIX_0F53 + 1)
584 #define PREFIX_0F59 (PREFIX_0F58 + 1)
585 #define PREFIX_0F5A (PREFIX_0F59 + 1)
586 #define PREFIX_0F5B (PREFIX_0F5A + 1)
587 #define PREFIX_0F5C (PREFIX_0F5B + 1)
588 #define PREFIX_0F5D (PREFIX_0F5C + 1)
589 #define PREFIX_0F5E (PREFIX_0F5D + 1)
590 #define PREFIX_0F5F (PREFIX_0F5E + 1)
591 #define PREFIX_0F60 (PREFIX_0F5F + 1)
592 #define PREFIX_0F61 (PREFIX_0F60 + 1)
593 #define PREFIX_0F62 (PREFIX_0F61 + 1)
594 #define PREFIX_0F6C (PREFIX_0F62 + 1)
595 #define PREFIX_0F6D (PREFIX_0F6C + 1)
596 #define PREFIX_0F6F (PREFIX_0F6D + 1)
597 #define PREFIX_0F70 (PREFIX_0F6F + 1)
598 #define PREFIX_0F73_REG_3 (PREFIX_0F70 + 1)
599 #define PREFIX_0F73_REG_7 (PREFIX_0F73_REG_3 + 1)
600 #define PREFIX_0F78 (PREFIX_0F73_REG_7 + 1)
601 #define PREFIX_0F79 (PREFIX_0F78 + 1)
602 #define PREFIX_0F7C (PREFIX_0F79 + 1)
603 #define PREFIX_0F7D (PREFIX_0F7C + 1)
604 #define PREFIX_0F7E (PREFIX_0F7D + 1)
605 #define PREFIX_0F7F (PREFIX_0F7E + 1)
606 #define PREFIX_0FB8 (PREFIX_0F7F + 1)
607 #define PREFIX_0FBD (PREFIX_0FB8 + 1)
608 #define PREFIX_0FC2 (PREFIX_0FBD + 1)
609 #define PREFIX_0FC3 (PREFIX_0FC2 + 1)
610 #define PREFIX_0FC7_REG_6 (PREFIX_0FC3 + 1)
611 #define PREFIX_0FD0 (PREFIX_0FC7_REG_6 + 1)
612 #define PREFIX_0FD6 (PREFIX_0FD0 + 1)
613 #define PREFIX_0FE6 (PREFIX_0FD6 + 1)
614 #define PREFIX_0FE7 (PREFIX_0FE6 + 1)
615 #define PREFIX_0FF0 (PREFIX_0FE7 + 1)
616 #define PREFIX_0FF7 (PREFIX_0FF0 + 1)
617 #define PREFIX_0F3810 (PREFIX_0FF7 + 1)
618 #define PREFIX_0F3814 (PREFIX_0F3810 + 1)
619 #define PREFIX_0F3815 (PREFIX_0F3814 + 1)
620 #define PREFIX_0F3817 (PREFIX_0F3815 + 1)
621 #define PREFIX_0F3820 (PREFIX_0F3817 + 1)
622 #define PREFIX_0F3821 (PREFIX_0F3820 + 1)
623 #define PREFIX_0F3822 (PREFIX_0F3821 + 1)
624 #define PREFIX_0F3823 (PREFIX_0F3822 + 1)
625 #define PREFIX_0F3824 (PREFIX_0F3823 + 1)
626 #define PREFIX_0F3825 (PREFIX_0F3824 + 1)
627 #define PREFIX_0F3828 (PREFIX_0F3825 + 1)
628 #define PREFIX_0F3829 (PREFIX_0F3828 + 1)
629 #define PREFIX_0F382A (PREFIX_0F3829 + 1)
630 #define PREFIX_0F382B (PREFIX_0F382A + 1)
631 #define PREFIX_0F3830 (PREFIX_0F382B + 1)
632 #define PREFIX_0F3831 (PREFIX_0F3830 + 1)
633 #define PREFIX_0F3832 (PREFIX_0F3831 + 1)
634 #define PREFIX_0F3833 (PREFIX_0F3832 + 1)
635 #define PREFIX_0F3834 (PREFIX_0F3833 + 1)
636 #define PREFIX_0F3835 (PREFIX_0F3834 + 1)
637 #define PREFIX_0F3837 (PREFIX_0F3835 + 1)
638 #define PREFIX_0F3838 (PREFIX_0F3837 + 1)
639 #define PREFIX_0F3839 (PREFIX_0F3838 + 1)
640 #define PREFIX_0F383A (PREFIX_0F3839 + 1)
641 #define PREFIX_0F383B (PREFIX_0F383A + 1)
642 #define PREFIX_0F383C (PREFIX_0F383B + 1)
643 #define PREFIX_0F383D (PREFIX_0F383C + 1)
644 #define PREFIX_0F383E (PREFIX_0F383D + 1)
645 #define PREFIX_0F383F (PREFIX_0F383E + 1)
646 #define PREFIX_0F3840 (PREFIX_0F383F + 1)
647 #define PREFIX_0F3841 (PREFIX_0F3840 + 1)
648 #define PREFIX_0F38F0 (PREFIX_0F3841 + 1)
649 #define PREFIX_0F38F1 (PREFIX_0F38F0 + 1)
650 #define PREFIX_0F3A08 (PREFIX_0F38F1 + 1)
651 #define PREFIX_0F3A09 (PREFIX_0F3A08 + 1)
652 #define PREFIX_0F3A0A (PREFIX_0F3A09 + 1)
653 #define PREFIX_0F3A0B (PREFIX_0F3A0A + 1)
654 #define PREFIX_0F3A0C (PREFIX_0F3A0B + 1)
655 #define PREFIX_0F3A0D (PREFIX_0F3A0C + 1)
656 #define PREFIX_0F3A0E (PREFIX_0F3A0D + 1)
657 #define PREFIX_0F3A14 (PREFIX_0F3A0E + 1)
658 #define PREFIX_0F3A15 (PREFIX_0F3A14 + 1)
659 #define PREFIX_0F3A16 (PREFIX_0F3A15 + 1)
660 #define PREFIX_0F3A17 (PREFIX_0F3A16 + 1)
661 #define PREFIX_0F3A20 (PREFIX_0F3A17 + 1)
662 #define PREFIX_0F3A21 (PREFIX_0F3A20 + 1)
663 #define PREFIX_0F3A22 (PREFIX_0F3A21 + 1)
664 #define PREFIX_0F3A40 (PREFIX_0F3A22 + 1)
665 #define PREFIX_0F3A41 (PREFIX_0F3A40 + 1)
666 #define PREFIX_0F3A42 (PREFIX_0F3A41 + 1)
667 #define PREFIX_0F3A60 (PREFIX_0F3A42 + 1)
668 #define PREFIX_0F3A61 (PREFIX_0F3A60 + 1)
669 #define PREFIX_0F3A62 (PREFIX_0F3A61 + 1)
670 #define PREFIX_0F3A63 (PREFIX_0F3A62 + 1)
673 #define X86_64_07 (X86_64_06 + 1)
674 #define X86_64_0D (X86_64_07 + 1)
675 #define X86_64_16 (X86_64_0D + 1)
676 #define X86_64_17 (X86_64_16 + 1)
677 #define X86_64_1E (X86_64_17 + 1)
678 #define X86_64_1F (X86_64_1E + 1)
679 #define X86_64_27 (X86_64_1F + 1)
680 #define X86_64_2F (X86_64_27 + 1)
681 #define X86_64_37 (X86_64_2F + 1)
682 #define X86_64_3F (X86_64_37 + 1)
683 #define X86_64_60 (X86_64_3F + 1)
684 #define X86_64_61 (X86_64_60 + 1)
685 #define X86_64_62 (X86_64_61 + 1)
686 #define X86_64_63 (X86_64_62 + 1)
687 #define X86_64_6D (X86_64_63 + 1)
688 #define X86_64_6F (X86_64_6D + 1)
689 #define X86_64_9A (X86_64_6F + 1)
690 #define X86_64_C4 (X86_64_9A + 1)
691 #define X86_64_C5 (X86_64_C4 + 1)
692 #define X86_64_CE (X86_64_C5 + 1)
693 #define X86_64_D4 (X86_64_CE + 1)
694 #define X86_64_D5 (X86_64_D4 + 1)
695 #define X86_64_EA (X86_64_D5 + 1)
696 #define X86_64_0F01_REG_0 (X86_64_EA + 1)
697 #define X86_64_0F01_REG_1 (X86_64_0F01_REG_0 + 1)
698 #define X86_64_0F01_REG_2 (X86_64_0F01_REG_1 + 1)
699 #define X86_64_0F01_REG_3 (X86_64_0F01_REG_2 + 1)
701 #define THREE_BYTE_0F24 0
702 #define THREE_BYTE_0F25 (THREE_BYTE_0F24 + 1)
703 #define THREE_BYTE_0F38 (THREE_BYTE_0F25 + 1)
704 #define THREE_BYTE_0F3A (THREE_BYTE_0F38 + 1)
705 #define THREE_BYTE_0F7A (THREE_BYTE_0F3A + 1)
706 #define THREE_BYTE_0F7B (THREE_BYTE_0F7A + 1)
708 typedef void (*op_rtn
) (int bytemode
, int sizeflag
);
719 /* Upper case letters in the instruction names here are macros.
720 'A' => print 'b' if no register operands or suffix_always is true
721 'B' => print 'b' if suffix_always is true
722 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
724 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
725 suffix_always is true
726 'E' => print 'e' if 32-bit form of jcxz
727 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
728 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
729 'H' => print ",pt" or ",pn" branch hint
730 'I' => honor following macro letter even in Intel mode (implemented only
731 for some of the macro letters)
733 'K' => print 'd' or 'q' if rex prefix is present.
734 'L' => print 'l' if suffix_always is true
735 'M' => print 'r' if intel_mnemonic is false.
736 'N' => print 'n' if instruction has no wait "prefix"
737 'O' => print 'd' or 'o' (or 'q' in Intel mode)
738 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
739 or suffix_always is true. print 'q' if rex prefix is present.
740 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
742 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
743 'S' => print 'w', 'l' or 'q' if suffix_always is true
744 'T' => print 'q' in 64bit mode and behave as 'P' otherwise
745 'U' => print 'q' in 64bit mode and behave as 'Q' otherwise
746 'V' => print 'q' in 64bit mode and behave as 'S' otherwise
747 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
748 'X' => print 's', 'd' depending on data16 prefix (for XMM)
749 'Y' => 'q' if instruction has an REX 64bit overwrite prefix and
750 suffix_always is true.
751 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
752 '!' => change condition from true to false or from false to true.
753 '%' => add 1 upper case letter to the macro.
755 2 upper case letter macros:
756 'LQ' => print 'l' ('d' in Intel mode) or 'q' for memory operand
757 or suffix_always is true
759 Many of the above letters print nothing in Intel mode. See "putop"
762 Braces '{' and '}', and vertical bars '|', indicate alternative
763 mnemonic strings for AT&T and Intel. */
765 static const struct dis386 dis386
[] = {
767 { "addB", { Eb
, Gb
} },
768 { "addS", { Ev
, Gv
} },
769 { "addB", { Gb
, Eb
} },
770 { "addS", { Gv
, Ev
} },
771 { "addB", { AL
, Ib
} },
772 { "addS", { eAX
, Iv
} },
773 { X86_64_TABLE (X86_64_06
) },
774 { X86_64_TABLE (X86_64_07
) },
776 { "orB", { Eb
, Gb
} },
777 { "orS", { Ev
, Gv
} },
778 { "orB", { Gb
, Eb
} },
779 { "orS", { Gv
, Ev
} },
780 { "orB", { AL
, Ib
} },
781 { "orS", { eAX
, Iv
} },
782 { X86_64_TABLE (X86_64_0D
) },
783 { "(bad)", { XX
} }, /* 0x0f extended opcode escape */
785 { "adcB", { Eb
, Gb
} },
786 { "adcS", { Ev
, Gv
} },
787 { "adcB", { Gb
, Eb
} },
788 { "adcS", { Gv
, Ev
} },
789 { "adcB", { AL
, Ib
} },
790 { "adcS", { eAX
, Iv
} },
791 { X86_64_TABLE (X86_64_16
) },
792 { X86_64_TABLE (X86_64_17
) },
794 { "sbbB", { Eb
, Gb
} },
795 { "sbbS", { Ev
, Gv
} },
796 { "sbbB", { Gb
, Eb
} },
797 { "sbbS", { Gv
, Ev
} },
798 { "sbbB", { AL
, Ib
} },
799 { "sbbS", { eAX
, Iv
} },
800 { X86_64_TABLE (X86_64_1E
) },
801 { X86_64_TABLE (X86_64_1F
) },
803 { "andB", { Eb
, Gb
} },
804 { "andS", { Ev
, Gv
} },
805 { "andB", { Gb
, Eb
} },
806 { "andS", { Gv
, Ev
} },
807 { "andB", { AL
, Ib
} },
808 { "andS", { eAX
, Iv
} },
809 { "(bad)", { XX
} }, /* SEG ES prefix */
810 { X86_64_TABLE (X86_64_27
) },
812 { "subB", { Eb
, Gb
} },
813 { "subS", { Ev
, Gv
} },
814 { "subB", { Gb
, Eb
} },
815 { "subS", { Gv
, Ev
} },
816 { "subB", { AL
, Ib
} },
817 { "subS", { eAX
, Iv
} },
818 { "(bad)", { XX
} }, /* SEG CS prefix */
819 { X86_64_TABLE (X86_64_2F
) },
821 { "xorB", { Eb
, Gb
} },
822 { "xorS", { Ev
, Gv
} },
823 { "xorB", { Gb
, Eb
} },
824 { "xorS", { Gv
, Ev
} },
825 { "xorB", { AL
, Ib
} },
826 { "xorS", { eAX
, Iv
} },
827 { "(bad)", { XX
} }, /* SEG SS prefix */
828 { X86_64_TABLE (X86_64_37
) },
830 { "cmpB", { Eb
, Gb
} },
831 { "cmpS", { Ev
, Gv
} },
832 { "cmpB", { Gb
, Eb
} },
833 { "cmpS", { Gv
, Ev
} },
834 { "cmpB", { AL
, Ib
} },
835 { "cmpS", { eAX
, Iv
} },
836 { "(bad)", { XX
} }, /* SEG DS prefix */
837 { X86_64_TABLE (X86_64_3F
) },
839 { "inc{S|}", { RMeAX
} },
840 { "inc{S|}", { RMeCX
} },
841 { "inc{S|}", { RMeDX
} },
842 { "inc{S|}", { RMeBX
} },
843 { "inc{S|}", { RMeSP
} },
844 { "inc{S|}", { RMeBP
} },
845 { "inc{S|}", { RMeSI
} },
846 { "inc{S|}", { RMeDI
} },
848 { "dec{S|}", { RMeAX
} },
849 { "dec{S|}", { RMeCX
} },
850 { "dec{S|}", { RMeDX
} },
851 { "dec{S|}", { RMeBX
} },
852 { "dec{S|}", { RMeSP
} },
853 { "dec{S|}", { RMeBP
} },
854 { "dec{S|}", { RMeSI
} },
855 { "dec{S|}", { RMeDI
} },
857 { "pushV", { RMrAX
} },
858 { "pushV", { RMrCX
} },
859 { "pushV", { RMrDX
} },
860 { "pushV", { RMrBX
} },
861 { "pushV", { RMrSP
} },
862 { "pushV", { RMrBP
} },
863 { "pushV", { RMrSI
} },
864 { "pushV", { RMrDI
} },
866 { "popV", { RMrAX
} },
867 { "popV", { RMrCX
} },
868 { "popV", { RMrDX
} },
869 { "popV", { RMrBX
} },
870 { "popV", { RMrSP
} },
871 { "popV", { RMrBP
} },
872 { "popV", { RMrSI
} },
873 { "popV", { RMrDI
} },
875 { X86_64_TABLE (X86_64_60
) },
876 { X86_64_TABLE (X86_64_61
) },
877 { X86_64_TABLE (X86_64_62
) },
878 { X86_64_TABLE (X86_64_63
) },
879 { "(bad)", { XX
} }, /* seg fs */
880 { "(bad)", { XX
} }, /* seg gs */
881 { "(bad)", { XX
} }, /* op size prefix */
882 { "(bad)", { XX
} }, /* adr size prefix */
885 { "imulS", { Gv
, Ev
, Iv
} },
886 { "pushT", { sIb
} },
887 { "imulS", { Gv
, Ev
, sIb
} },
888 { "ins{b|}", { Ybr
, indirDX
} },
889 { X86_64_TABLE (X86_64_6D
) },
890 { "outs{b|}", { indirDXr
, Xb
} },
891 { X86_64_TABLE (X86_64_6F
) },
893 { "joH", { Jb
, XX
, cond_jump_flag
} },
894 { "jnoH", { Jb
, XX
, cond_jump_flag
} },
895 { "jbH", { Jb
, XX
, cond_jump_flag
} },
896 { "jaeH", { Jb
, XX
, cond_jump_flag
} },
897 { "jeH", { Jb
, XX
, cond_jump_flag
} },
898 { "jneH", { Jb
, XX
, cond_jump_flag
} },
899 { "jbeH", { Jb
, XX
, cond_jump_flag
} },
900 { "jaH", { Jb
, XX
, cond_jump_flag
} },
902 { "jsH", { Jb
, XX
, cond_jump_flag
} },
903 { "jnsH", { Jb
, XX
, cond_jump_flag
} },
904 { "jpH", { Jb
, XX
, cond_jump_flag
} },
905 { "jnpH", { Jb
, XX
, cond_jump_flag
} },
906 { "jlH", { Jb
, XX
, cond_jump_flag
} },
907 { "jgeH", { Jb
, XX
, cond_jump_flag
} },
908 { "jleH", { Jb
, XX
, cond_jump_flag
} },
909 { "jgH", { Jb
, XX
, cond_jump_flag
} },
911 { REG_TABLE (REG_80
) },
912 { REG_TABLE (REG_81
) },
914 { REG_TABLE (REG_82
) },
915 { "testB", { Eb
, Gb
} },
916 { "testS", { Ev
, Gv
} },
917 { "xchgB", { Eb
, Gb
} },
918 { "xchgS", { Ev
, Gv
} },
920 { "movB", { Eb
, Gb
} },
921 { "movS", { Ev
, Gv
} },
922 { "movB", { Gb
, Eb
} },
923 { "movS", { Gv
, Ev
} },
924 { "movD", { Sv
, Sw
} },
925 { MOD_TABLE (MOD_8D
) },
926 { "movD", { Sw
, Sv
} },
927 { REG_TABLE (REG_8F
) },
929 { PREFIX_TABLE (PREFIX_90
) },
930 { "xchgS", { RMeCX
, eAX
} },
931 { "xchgS", { RMeDX
, eAX
} },
932 { "xchgS", { RMeBX
, eAX
} },
933 { "xchgS", { RMeSP
, eAX
} },
934 { "xchgS", { RMeBP
, eAX
} },
935 { "xchgS", { RMeSI
, eAX
} },
936 { "xchgS", { RMeDI
, eAX
} },
938 { "cW{t|}R", { XX
} },
939 { "cR{t|}O", { XX
} },
940 { X86_64_TABLE (X86_64_9A
) },
941 { "(bad)", { XX
} }, /* fwait */
942 { "pushfT", { XX
} },
947 { "movB", { AL
, Ob
} },
948 { "movS", { eAX
, Ov
} },
949 { "movB", { Ob
, AL
} },
950 { "movS", { Ov
, eAX
} },
951 { "movs{b|}", { Ybr
, Xb
} },
952 { "movs{R|}", { Yvr
, Xv
} },
953 { "cmps{b|}", { Xb
, Yb
} },
954 { "cmps{R|}", { Xv
, Yv
} },
956 { "testB", { AL
, Ib
} },
957 { "testS", { eAX
, Iv
} },
958 { "stosB", { Ybr
, AL
} },
959 { "stosS", { Yvr
, eAX
} },
960 { "lodsB", { ALr
, Xb
} },
961 { "lodsS", { eAXr
, Xv
} },
962 { "scasB", { AL
, Yb
} },
963 { "scasS", { eAX
, Yv
} },
965 { "movB", { RMAL
, Ib
} },
966 { "movB", { RMCL
, Ib
} },
967 { "movB", { RMDL
, Ib
} },
968 { "movB", { RMBL
, Ib
} },
969 { "movB", { RMAH
, Ib
} },
970 { "movB", { RMCH
, Ib
} },
971 { "movB", { RMDH
, Ib
} },
972 { "movB", { RMBH
, Ib
} },
974 { "movS", { RMeAX
, Iv64
} },
975 { "movS", { RMeCX
, Iv64
} },
976 { "movS", { RMeDX
, Iv64
} },
977 { "movS", { RMeBX
, Iv64
} },
978 { "movS", { RMeSP
, Iv64
} },
979 { "movS", { RMeBP
, Iv64
} },
980 { "movS", { RMeSI
, Iv64
} },
981 { "movS", { RMeDI
, Iv64
} },
983 { REG_TABLE (REG_C0
) },
984 { REG_TABLE (REG_C1
) },
987 { X86_64_TABLE (X86_64_C4
) },
988 { X86_64_TABLE (X86_64_C5
) },
989 { REG_TABLE (REG_C6
) },
990 { REG_TABLE (REG_C7
) },
992 { "enterT", { Iw
, Ib
} },
993 { "leaveT", { XX
} },
998 { X86_64_TABLE (X86_64_CE
) },
1001 { REG_TABLE (REG_D0
) },
1002 { REG_TABLE (REG_D1
) },
1003 { REG_TABLE (REG_D2
) },
1004 { REG_TABLE (REG_D3
) },
1005 { X86_64_TABLE (X86_64_D4
) },
1006 { X86_64_TABLE (X86_64_D5
) },
1007 { "(bad)", { XX
} },
1008 { "xlat", { DSBX
} },
1019 { "loopneFH", { Jb
, XX
, loop_jcxz_flag
} },
1020 { "loopeFH", { Jb
, XX
, loop_jcxz_flag
} },
1021 { "loopFH", { Jb
, XX
, loop_jcxz_flag
} },
1022 { "jEcxzH", { Jb
, XX
, loop_jcxz_flag
} },
1023 { "inB", { AL
, Ib
} },
1024 { "inG", { zAX
, Ib
} },
1025 { "outB", { Ib
, AL
} },
1026 { "outG", { Ib
, zAX
} },
1028 { "callT", { Jv
} },
1030 { X86_64_TABLE (X86_64_EA
) },
1032 { "inB", { AL
, indirDX
} },
1033 { "inG", { zAX
, indirDX
} },
1034 { "outB", { indirDX
, AL
} },
1035 { "outG", { indirDX
, zAX
} },
1037 { "(bad)", { XX
} }, /* lock prefix */
1038 { "icebp", { XX
} },
1039 { "(bad)", { XX
} }, /* repne */
1040 { "(bad)", { XX
} }, /* repz */
1043 { REG_TABLE (REG_F6
) },
1044 { REG_TABLE (REG_F7
) },
1052 { REG_TABLE (REG_FE
) },
1053 { REG_TABLE (REG_FF
) },
1056 static const struct dis386 dis386_twobyte
[] = {
1058 { REG_TABLE (REG_0F00
) },
1059 { REG_TABLE (REG_0F01
) },
1060 { "larS", { Gv
, Ew
} },
1061 { "lslS", { Gv
, Ew
} },
1062 { "(bad)", { XX
} },
1063 { "syscall", { XX
} },
1065 { "sysretP", { XX
} },
1068 { "wbinvd", { XX
} },
1069 { "(bad)", { XX
} },
1071 { "(bad)", { XX
} },
1072 { REG_TABLE (REG_0F0D
) },
1073 { "femms", { XX
} },
1074 { "", { MX
, EM
, OPSUF
} }, /* See OP_3DNowSuffix. */
1076 { PREFIX_TABLE (PREFIX_0F10
) },
1077 { PREFIX_TABLE (PREFIX_0F11
) },
1078 { PREFIX_TABLE (PREFIX_0F12
) },
1079 { MOD_TABLE (MOD_0F13
) },
1080 { "unpcklpX", { XM
, EXx
} },
1081 { "unpckhpX", { XM
, EXx
} },
1082 { PREFIX_TABLE (PREFIX_0F16
) },
1083 { MOD_TABLE (MOD_0F17
) },
1085 { REG_TABLE (REG_0F18
) },
1094 { MOD_TABLE (MOD_0F20
) },
1095 { MOD_TABLE (MOD_0F21
) },
1096 { MOD_TABLE (MOD_0F22
) },
1097 { MOD_TABLE (MOD_0F23
) },
1098 { MOD_TABLE (MOD_0F24
) },
1099 { THREE_BYTE_TABLE (THREE_BYTE_0F25
) },
1100 { MOD_TABLE (MOD_0F26
) },
1101 { "(bad)", { XX
} },
1103 { "movapX", { XM
, EXx
} },
1104 { "movapX", { EXx
, XM
} },
1105 { PREFIX_TABLE (PREFIX_0F2A
) },
1106 { PREFIX_TABLE (PREFIX_0F2B
) },
1107 { PREFIX_TABLE (PREFIX_0F2C
) },
1108 { PREFIX_TABLE (PREFIX_0F2D
) },
1109 { PREFIX_TABLE (PREFIX_0F2E
) },
1110 { PREFIX_TABLE (PREFIX_0F2F
) },
1112 { "wrmsr", { XX
} },
1113 { "rdtsc", { XX
} },
1114 { "rdmsr", { XX
} },
1115 { "rdpmc", { XX
} },
1116 { "sysenter", { XX
} },
1117 { "sysexit", { XX
} },
1118 { "(bad)", { XX
} },
1119 { "getsec", { XX
} },
1121 { THREE_BYTE_TABLE (THREE_BYTE_0F38
) },
1122 { "(bad)", { XX
} },
1123 { THREE_BYTE_TABLE (THREE_BYTE_0F3A
) },
1124 { "(bad)", { XX
} },
1125 { "(bad)", { XX
} },
1126 { "(bad)", { XX
} },
1127 { "(bad)", { XX
} },
1128 { "(bad)", { XX
} },
1130 { "cmovo", { Gv
, Ev
} },
1131 { "cmovno", { Gv
, Ev
} },
1132 { "cmovb", { Gv
, Ev
} },
1133 { "cmovae", { Gv
, Ev
} },
1134 { "cmove", { Gv
, Ev
} },
1135 { "cmovne", { Gv
, Ev
} },
1136 { "cmovbe", { Gv
, Ev
} },
1137 { "cmova", { Gv
, Ev
} },
1139 { "cmovs", { Gv
, Ev
} },
1140 { "cmovns", { Gv
, Ev
} },
1141 { "cmovp", { Gv
, Ev
} },
1142 { "cmovnp", { Gv
, Ev
} },
1143 { "cmovl", { Gv
, Ev
} },
1144 { "cmovge", { Gv
, Ev
} },
1145 { "cmovle", { Gv
, Ev
} },
1146 { "cmovg", { Gv
, Ev
} },
1148 { MOD_TABLE (MOD_0F51
) },
1149 { PREFIX_TABLE (PREFIX_0F51
) },
1150 { PREFIX_TABLE (PREFIX_0F52
) },
1151 { PREFIX_TABLE (PREFIX_0F53
) },
1152 { "andpX", { XM
, EXx
} },
1153 { "andnpX", { XM
, EXx
} },
1154 { "orpX", { XM
, EXx
} },
1155 { "xorpX", { XM
, EXx
} },
1157 { PREFIX_TABLE (PREFIX_0F58
) },
1158 { PREFIX_TABLE (PREFIX_0F59
) },
1159 { PREFIX_TABLE (PREFIX_0F5A
) },
1160 { PREFIX_TABLE (PREFIX_0F5B
) },
1161 { PREFIX_TABLE (PREFIX_0F5C
) },
1162 { PREFIX_TABLE (PREFIX_0F5D
) },
1163 { PREFIX_TABLE (PREFIX_0F5E
) },
1164 { PREFIX_TABLE (PREFIX_0F5F
) },
1166 { PREFIX_TABLE (PREFIX_0F60
) },
1167 { PREFIX_TABLE (PREFIX_0F61
) },
1168 { PREFIX_TABLE (PREFIX_0F62
) },
1169 { "packsswb", { MX
, EM
} },
1170 { "pcmpgtb", { MX
, EM
} },
1171 { "pcmpgtw", { MX
, EM
} },
1172 { "pcmpgtd", { MX
, EM
} },
1173 { "packuswb", { MX
, EM
} },
1175 { "punpckhbw", { MX
, EM
} },
1176 { "punpckhwd", { MX
, EM
} },
1177 { "punpckhdq", { MX
, EM
} },
1178 { "packssdw", { MX
, EM
} },
1179 { PREFIX_TABLE (PREFIX_0F6C
) },
1180 { PREFIX_TABLE (PREFIX_0F6D
) },
1181 { "movK", { MX
, Edq
} },
1182 { PREFIX_TABLE (PREFIX_0F6F
) },
1184 { PREFIX_TABLE (PREFIX_0F70
) },
1185 { REG_TABLE (REG_0F71
) },
1186 { REG_TABLE (REG_0F72
) },
1187 { REG_TABLE (REG_0F73
) },
1188 { "pcmpeqb", { MX
, EM
} },
1189 { "pcmpeqw", { MX
, EM
} },
1190 { "pcmpeqd", { MX
, EM
} },
1193 { PREFIX_TABLE (PREFIX_0F78
) },
1194 { PREFIX_TABLE (PREFIX_0F79
) },
1195 { THREE_BYTE_TABLE (THREE_BYTE_0F7A
) },
1196 { THREE_BYTE_TABLE (THREE_BYTE_0F7B
) },
1197 { PREFIX_TABLE (PREFIX_0F7C
) },
1198 { PREFIX_TABLE (PREFIX_0F7D
) },
1199 { PREFIX_TABLE (PREFIX_0F7E
) },
1200 { PREFIX_TABLE (PREFIX_0F7F
) },
1202 { "joH", { Jv
, XX
, cond_jump_flag
} },
1203 { "jnoH", { Jv
, XX
, cond_jump_flag
} },
1204 { "jbH", { Jv
, XX
, cond_jump_flag
} },
1205 { "jaeH", { Jv
, XX
, cond_jump_flag
} },
1206 { "jeH", { Jv
, XX
, cond_jump_flag
} },
1207 { "jneH", { Jv
, XX
, cond_jump_flag
} },
1208 { "jbeH", { Jv
, XX
, cond_jump_flag
} },
1209 { "jaH", { Jv
, XX
, cond_jump_flag
} },
1211 { "jsH", { Jv
, XX
, cond_jump_flag
} },
1212 { "jnsH", { Jv
, XX
, cond_jump_flag
} },
1213 { "jpH", { Jv
, XX
, cond_jump_flag
} },
1214 { "jnpH", { Jv
, XX
, cond_jump_flag
} },
1215 { "jlH", { Jv
, XX
, cond_jump_flag
} },
1216 { "jgeH", { Jv
, XX
, cond_jump_flag
} },
1217 { "jleH", { Jv
, XX
, cond_jump_flag
} },
1218 { "jgH", { Jv
, XX
, cond_jump_flag
} },
1221 { "setno", { Eb
} },
1223 { "setae", { Eb
} },
1225 { "setne", { Eb
} },
1226 { "setbe", { Eb
} },
1230 { "setns", { Eb
} },
1232 { "setnp", { Eb
} },
1234 { "setge", { Eb
} },
1235 { "setle", { Eb
} },
1238 { "pushT", { fs
} },
1240 { "cpuid", { XX
} },
1241 { "btS", { Ev
, Gv
} },
1242 { "shldS", { Ev
, Gv
, Ib
} },
1243 { "shldS", { Ev
, Gv
, CL
} },
1244 { REG_TABLE (REG_0FA6
) },
1245 { REG_TABLE (REG_0FA7
) },
1247 { "pushT", { gs
} },
1250 { "btsS", { Ev
, Gv
} },
1251 { "shrdS", { Ev
, Gv
, Ib
} },
1252 { "shrdS", { Ev
, Gv
, CL
} },
1253 { REG_TABLE (REG_0FAE
) },
1254 { "imulS", { Gv
, Ev
} },
1256 { "cmpxchgB", { Eb
, Gb
} },
1257 { "cmpxchgS", { Ev
, Gv
} },
1258 { MOD_TABLE (MOD_0FB2
) },
1259 { "btrS", { Ev
, Gv
} },
1260 { MOD_TABLE (MOD_0FB4
) },
1261 { MOD_TABLE (MOD_0FB5
) },
1262 { "movz{bR|x}", { Gv
, Eb
} },
1263 { "movz{wR|x}", { Gv
, Ew
} }, /* yes, there really is movzww ! */
1265 { PREFIX_TABLE (PREFIX_0FB8
) },
1267 { REG_TABLE (REG_0FBA
) },
1268 { "btcS", { Ev
, Gv
} },
1269 { "bsfS", { Gv
, Ev
} },
1270 { PREFIX_TABLE (PREFIX_0FBD
) },
1271 { "movs{bR|x}", { Gv
, Eb
} },
1272 { "movs{wR|x}", { Gv
, Ew
} }, /* yes, there really is movsww ! */
1274 { "xaddB", { Eb
, Gb
} },
1275 { "xaddS", { Ev
, Gv
} },
1276 { PREFIX_TABLE (PREFIX_0FC2
) },
1277 { PREFIX_TABLE (PREFIX_0FC3
) },
1278 { "pinsrw", { MX
, Edqw
, Ib
} },
1279 { "pextrw", { Gdq
, MS
, Ib
} },
1280 { "shufpX", { XM
, EXx
, Ib
} },
1281 { REG_TABLE (REG_0FC7
) },
1283 { "bswap", { RMeAX
} },
1284 { "bswap", { RMeCX
} },
1285 { "bswap", { RMeDX
} },
1286 { "bswap", { RMeBX
} },
1287 { "bswap", { RMeSP
} },
1288 { "bswap", { RMeBP
} },
1289 { "bswap", { RMeSI
} },
1290 { "bswap", { RMeDI
} },
1292 { PREFIX_TABLE (PREFIX_0FD0
) },
1293 { "psrlw", { MX
, EM
} },
1294 { "psrld", { MX
, EM
} },
1295 { "psrlq", { MX
, EM
} },
1296 { "paddq", { MX
, EM
} },
1297 { "pmullw", { MX
, EM
} },
1298 { PREFIX_TABLE (PREFIX_0FD6
) },
1299 { MOD_TABLE (MOD_0FD7
) },
1301 { "psubusb", { MX
, EM
} },
1302 { "psubusw", { MX
, EM
} },
1303 { "pminub", { MX
, EM
} },
1304 { "pand", { MX
, EM
} },
1305 { "paddusb", { MX
, EM
} },
1306 { "paddusw", { MX
, EM
} },
1307 { "pmaxub", { MX
, EM
} },
1308 { "pandn", { MX
, EM
} },
1310 { "pavgb", { MX
, EM
} },
1311 { "psraw", { MX
, EM
} },
1312 { "psrad", { MX
, EM
} },
1313 { "pavgw", { MX
, EM
} },
1314 { "pmulhuw", { MX
, EM
} },
1315 { "pmulhw", { MX
, EM
} },
1316 { PREFIX_TABLE (PREFIX_0FE6
) },
1317 { PREFIX_TABLE (PREFIX_0FE7
) },
1319 { "psubsb", { MX
, EM
} },
1320 { "psubsw", { MX
, EM
} },
1321 { "pminsw", { MX
, EM
} },
1322 { "por", { MX
, EM
} },
1323 { "paddsb", { MX
, EM
} },
1324 { "paddsw", { MX
, EM
} },
1325 { "pmaxsw", { MX
, EM
} },
1326 { "pxor", { MX
, EM
} },
1328 { PREFIX_TABLE (PREFIX_0FF0
) },
1329 { "psllw", { MX
, EM
} },
1330 { "pslld", { MX
, EM
} },
1331 { "psllq", { MX
, EM
} },
1332 { "pmuludq", { MX
, EM
} },
1333 { "pmaddwd", { MX
, EM
} },
1334 { "psadbw", { MX
, EM
} },
1335 { PREFIX_TABLE (PREFIX_0FF7
) },
1337 { "psubb", { MX
, EM
} },
1338 { "psubw", { MX
, EM
} },
1339 { "psubd", { MX
, EM
} },
1340 { "psubq", { MX
, EM
} },
1341 { "paddb", { MX
, EM
} },
1342 { "paddw", { MX
, EM
} },
1343 { "paddd", { MX
, EM
} },
1344 { "(bad)", { XX
} },
1347 static const unsigned char onebyte_has_modrm
[256] = {
1348 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1349 /* ------------------------------- */
1350 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
1351 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
1352 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
1353 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
1354 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
1355 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
1356 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
1357 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
1358 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
1359 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
1360 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
1361 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
1362 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
1363 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
1364 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
1365 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
1366 /* ------------------------------- */
1367 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1370 static const unsigned char twobyte_has_modrm
[256] = {
1371 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1372 /* ------------------------------- */
1373 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
1374 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
1375 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
1376 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
1377 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
1378 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
1379 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
1380 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
1381 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
1382 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
1383 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
1384 /* b0 */ 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, /* bf */
1385 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
1386 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
1387 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
1388 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */
1389 /* ------------------------------- */
1390 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1393 static char obuf
[100];
1395 static char scratchbuf
[100];
1396 static unsigned char *start_codep
;
1397 static unsigned char *insn_codep
;
1398 static unsigned char *codep
;
1399 static const char *lock_prefix
;
1400 static const char *data_prefix
;
1401 static const char *addr_prefix
;
1402 static const char *repz_prefix
;
1403 static const char *repnz_prefix
;
1404 static disassemble_info
*the_info
;
1412 static unsigned char need_modrm
;
1414 /* If we are accessing mod/rm/reg without need_modrm set, then the
1415 values are stale. Hitting this abort likely indicates that you
1416 need to update onebyte_has_modrm or twobyte_has_modrm. */
1417 #define MODRM_CHECK if (!need_modrm) abort ()
1419 static const char **names64
;
1420 static const char **names32
;
1421 static const char **names16
;
1422 static const char **names8
;
1423 static const char **names8rex
;
1424 static const char **names_seg
;
1425 static const char *index64
;
1426 static const char *index32
;
1427 static const char **index16
;
1429 static const char *intel_names64
[] = {
1430 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
1431 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
1433 static const char *intel_names32
[] = {
1434 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
1435 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
1437 static const char *intel_names16
[] = {
1438 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
1439 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
1441 static const char *intel_names8
[] = {
1442 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
1444 static const char *intel_names8rex
[] = {
1445 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
1446 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
1448 static const char *intel_names_seg
[] = {
1449 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
1451 static const char *intel_index64
= "riz";
1452 static const char *intel_index32
= "eiz";
1453 static const char *intel_index16
[] = {
1454 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
1457 static const char *att_names64
[] = {
1458 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
1459 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
1461 static const char *att_names32
[] = {
1462 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
1463 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
1465 static const char *att_names16
[] = {
1466 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
1467 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
1469 static const char *att_names8
[] = {
1470 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
1472 static const char *att_names8rex
[] = {
1473 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
1474 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
1476 static const char *att_names_seg
[] = {
1477 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
1479 static const char *att_index64
= "%riz";
1480 static const char *att_index32
= "%eiz";
1481 static const char *att_index16
[] = {
1482 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
1485 static const struct dis386 reg_table
[][8] = {
1488 { "addA", { Eb
, Ib
} },
1489 { "orA", { Eb
, Ib
} },
1490 { "adcA", { Eb
, Ib
} },
1491 { "sbbA", { Eb
, Ib
} },
1492 { "andA", { Eb
, Ib
} },
1493 { "subA", { Eb
, Ib
} },
1494 { "xorA", { Eb
, Ib
} },
1495 { "cmpA", { Eb
, Ib
} },
1499 { "addQ", { Ev
, Iv
} },
1500 { "orQ", { Ev
, Iv
} },
1501 { "adcQ", { Ev
, Iv
} },
1502 { "sbbQ", { Ev
, Iv
} },
1503 { "andQ", { Ev
, Iv
} },
1504 { "subQ", { Ev
, Iv
} },
1505 { "xorQ", { Ev
, Iv
} },
1506 { "cmpQ", { Ev
, Iv
} },
1510 { "addQ", { Ev
, sIb
} },
1511 { "orQ", { Ev
, sIb
} },
1512 { "adcQ", { Ev
, sIb
} },
1513 { "sbbQ", { Ev
, sIb
} },
1514 { "andQ", { Ev
, sIb
} },
1515 { "subQ", { Ev
, sIb
} },
1516 { "xorQ", { Ev
, sIb
} },
1517 { "cmpQ", { Ev
, sIb
} },
1521 { "popU", { stackEv
} },
1522 { "(bad)", { XX
} },
1523 { "(bad)", { XX
} },
1524 { "(bad)", { XX
} },
1525 { "(bad)", { XX
} },
1526 { "(bad)", { XX
} },
1527 { "(bad)", { XX
} },
1528 { "(bad)", { XX
} },
1532 { "rolA", { Eb
, Ib
} },
1533 { "rorA", { Eb
, Ib
} },
1534 { "rclA", { Eb
, Ib
} },
1535 { "rcrA", { Eb
, Ib
} },
1536 { "shlA", { Eb
, Ib
} },
1537 { "shrA", { Eb
, Ib
} },
1538 { "(bad)", { XX
} },
1539 { "sarA", { Eb
, Ib
} },
1543 { "rolQ", { Ev
, Ib
} },
1544 { "rorQ", { Ev
, Ib
} },
1545 { "rclQ", { Ev
, Ib
} },
1546 { "rcrQ", { Ev
, Ib
} },
1547 { "shlQ", { Ev
, Ib
} },
1548 { "shrQ", { Ev
, Ib
} },
1549 { "(bad)", { XX
} },
1550 { "sarQ", { Ev
, Ib
} },
1554 { "movA", { Eb
, Ib
} },
1555 { "(bad)", { XX
} },
1556 { "(bad)", { XX
} },
1557 { "(bad)", { XX
} },
1558 { "(bad)", { XX
} },
1559 { "(bad)", { XX
} },
1560 { "(bad)", { XX
} },
1561 { "(bad)", { XX
} },
1565 { "movQ", { Ev
, Iv
} },
1566 { "(bad)", { XX
} },
1567 { "(bad)", { XX
} },
1568 { "(bad)", { XX
} },
1569 { "(bad)", { XX
} },
1570 { "(bad)", { XX
} },
1571 { "(bad)", { XX
} },
1572 { "(bad)", { XX
} },
1576 { "rolA", { Eb
, I1
} },
1577 { "rorA", { Eb
, I1
} },
1578 { "rclA", { Eb
, I1
} },
1579 { "rcrA", { Eb
, I1
} },
1580 { "shlA", { Eb
, I1
} },
1581 { "shrA", { Eb
, I1
} },
1582 { "(bad)", { XX
} },
1583 { "sarA", { Eb
, I1
} },
1587 { "rolQ", { Ev
, I1
} },
1588 { "rorQ", { Ev
, I1
} },
1589 { "rclQ", { Ev
, I1
} },
1590 { "rcrQ", { Ev
, I1
} },
1591 { "shlQ", { Ev
, I1
} },
1592 { "shrQ", { Ev
, I1
} },
1593 { "(bad)", { XX
} },
1594 { "sarQ", { Ev
, I1
} },
1598 { "rolA", { Eb
, CL
} },
1599 { "rorA", { Eb
, CL
} },
1600 { "rclA", { Eb
, CL
} },
1601 { "rcrA", { Eb
, CL
} },
1602 { "shlA", { Eb
, CL
} },
1603 { "shrA", { Eb
, CL
} },
1604 { "(bad)", { XX
} },
1605 { "sarA", { Eb
, CL
} },
1609 { "rolQ", { Ev
, CL
} },
1610 { "rorQ", { Ev
, CL
} },
1611 { "rclQ", { Ev
, CL
} },
1612 { "rcrQ", { Ev
, CL
} },
1613 { "shlQ", { Ev
, CL
} },
1614 { "shrQ", { Ev
, CL
} },
1615 { "(bad)", { XX
} },
1616 { "sarQ", { Ev
, CL
} },
1620 { "testA", { Eb
, Ib
} },
1621 { "(bad)", { XX
} },
1624 { "mulA", { Eb
} }, /* Don't print the implicit %al register, */
1625 { "imulA", { Eb
} }, /* to distinguish these opcodes from other */
1626 { "divA", { Eb
} }, /* mul/imul opcodes. Do the same for div */
1627 { "idivA", { Eb
} }, /* and idiv for consistency. */
1631 { "testQ", { Ev
, Iv
} },
1632 { "(bad)", { XX
} },
1635 { "mulQ", { Ev
} }, /* Don't print the implicit register. */
1636 { "imulQ", { Ev
} },
1638 { "idivQ", { Ev
} },
1644 { "(bad)", { XX
} },
1645 { "(bad)", { XX
} },
1646 { "(bad)", { XX
} },
1647 { "(bad)", { XX
} },
1648 { "(bad)", { XX
} },
1649 { "(bad)", { XX
} },
1655 { "callT", { indirEv
} },
1656 { "JcallT", { indirEp
} },
1657 { "jmpT", { indirEv
} },
1658 { "JjmpT", { indirEp
} },
1659 { "pushU", { stackEv
} },
1660 { "(bad)", { XX
} },
1664 { "sldtD", { Sv
} },
1670 { "(bad)", { XX
} },
1671 { "(bad)", { XX
} },
1675 { MOD_TABLE (MOD_0F01_REG_0
) },
1676 { MOD_TABLE (MOD_0F01_REG_1
) },
1677 { MOD_TABLE (MOD_0F01_REG_2
) },
1678 { MOD_TABLE (MOD_0F01_REG_3
) },
1679 { "smswD", { Sv
} },
1680 { "(bad)", { XX
} },
1682 { MOD_TABLE (MOD_0F01_REG_7
) },
1686 { "prefetch", { Eb
} },
1687 { "prefetchw", { Eb
} },
1688 { "(bad)", { XX
} },
1689 { "(bad)", { XX
} },
1690 { "(bad)", { XX
} },
1691 { "(bad)", { XX
} },
1692 { "(bad)", { XX
} },
1693 { "(bad)", { XX
} },
1697 { MOD_TABLE (MOD_0F18_REG_0
) },
1698 { MOD_TABLE (MOD_0F18_REG_1
) },
1699 { MOD_TABLE (MOD_0F18_REG_2
) },
1700 { MOD_TABLE (MOD_0F18_REG_3
) },
1701 { "(bad)", { XX
} },
1702 { "(bad)", { XX
} },
1703 { "(bad)", { XX
} },
1704 { "(bad)", { XX
} },
1708 { "(bad)", { XX
} },
1709 { "(bad)", { XX
} },
1710 { MOD_TABLE (MOD_0F71_REG_2
) },
1711 { "(bad)", { XX
} },
1712 { MOD_TABLE (MOD_0F71_REG_4
) },
1713 { "(bad)", { XX
} },
1714 { MOD_TABLE (MOD_0F71_REG_6
) },
1715 { "(bad)", { XX
} },
1719 { "(bad)", { XX
} },
1720 { "(bad)", { XX
} },
1721 { MOD_TABLE (MOD_0F72_REG_2
) },
1722 { "(bad)", { XX
} },
1723 { MOD_TABLE (MOD_0F72_REG_4
) },
1724 { "(bad)", { XX
} },
1725 { MOD_TABLE (MOD_0F72_REG_6
) },
1726 { "(bad)", { XX
} },
1730 { "(bad)", { XX
} },
1731 { "(bad)", { XX
} },
1732 { MOD_TABLE (MOD_0F73_REG_2
) },
1733 { MOD_TABLE (MOD_0F73_REG_3
) },
1734 { "(bad)", { XX
} },
1735 { "(bad)", { XX
} },
1736 { MOD_TABLE (MOD_0F73_REG_6
) },
1737 { MOD_TABLE (MOD_0F73_REG_7
) },
1741 { "montmul", { { OP_0f07
, 0 } } },
1742 { "xsha1", { { OP_0f07
, 0 } } },
1743 { "xsha256", { { OP_0f07
, 0 } } },
1744 { "(bad)", { { OP_0f07
, 0 } } },
1745 { "(bad)", { { OP_0f07
, 0 } } },
1746 { "(bad)", { { OP_0f07
, 0 } } },
1747 { "(bad)", { { OP_0f07
, 0 } } },
1748 { "(bad)", { { OP_0f07
, 0 } } },
1752 { "xstore-rng", { { OP_0f07
, 0 } } },
1753 { "xcrypt-ecb", { { OP_0f07
, 0 } } },
1754 { "xcrypt-cbc", { { OP_0f07
, 0 } } },
1755 { "xcrypt-ctr", { { OP_0f07
, 0 } } },
1756 { "xcrypt-cfb", { { OP_0f07
, 0 } } },
1757 { "xcrypt-ofb", { { OP_0f07
, 0 } } },
1758 { "(bad)", { { OP_0f07
, 0 } } },
1759 { "(bad)", { { OP_0f07
, 0 } } },
1763 { MOD_TABLE (MOD_0FAE_REG_0
) },
1764 { MOD_TABLE (MOD_0FAE_REG_1
) },
1765 { MOD_TABLE (MOD_0FAE_REG_2
) },
1766 { MOD_TABLE (MOD_0FAE_REG_3
) },
1767 { "(bad)", { XX
} },
1768 { MOD_TABLE (MOD_0FAE_REG_5
) },
1769 { MOD_TABLE (MOD_0FAE_REG_6
) },
1770 { MOD_TABLE (MOD_0FAE_REG_7
) },
1774 { "(bad)", { XX
} },
1775 { "(bad)", { XX
} },
1776 { "(bad)", { XX
} },
1777 { "(bad)", { XX
} },
1778 { "btQ", { Ev
, Ib
} },
1779 { "btsQ", { Ev
, Ib
} },
1780 { "btrQ", { Ev
, Ib
} },
1781 { "btcQ", { Ev
, Ib
} },
1785 { "(bad)", { XX
} },
1786 { "cmpxchg8b", { { CMPXCHG8B_Fixup
, q_mode
} } },
1787 { "(bad)", { XX
} },
1788 { "(bad)", { XX
} },
1789 { "(bad)", { XX
} },
1790 { "(bad)", { XX
} },
1791 { MOD_TABLE (MOD_0FC7_REG_6
) },
1792 { MOD_TABLE (MOD_0FC7_REG_7
) },
1796 static const struct dis386 prefix_table
[][4] = {
1799 { "xchgS", { { NOP_Fixup1
, eAX_reg
}, { NOP_Fixup2
, eAX_reg
} } },
1800 { "pause", { XX
} },
1801 { "xchgS", { { NOP_Fixup1
, eAX_reg
}, { NOP_Fixup2
, eAX_reg
} } },
1802 { "(bad)", { XX
} },
1807 { "movups", { XM
, EXx
} },
1808 { "movss", { XM
, EXd
} },
1809 { "movupd", { XM
, EXx
} },
1810 { "movsd", { XM
, EXq
} },
1815 { "movups", { EXx
, XM
} },
1816 { "movss", { EXd
, XM
} },
1817 { "movupd", { EXx
, XM
} },
1818 { "movsd", { EXq
, XM
} },
1823 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
1824 { "movsldup", { XM
, EXx
} },
1825 { "movlpd", { XM
, EXq
} },
1826 { "movddup", { XM
, EXq
} },
1831 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
1832 { "movshdup", { XM
, EXx
} },
1833 { "movhpd", { XM
, EXq
} },
1834 { "(bad)", { XX
} },
1839 { "cvtpi2ps", { XM
, EMCq
} },
1840 { "cvtsi2ss%LQ", { XM
, Ev
} },
1841 { "cvtpi2pd", { XM
, EMCq
} },
1842 { "cvtsi2sd%LQ", { XM
, Ev
} },
1847 { MOD_TABLE (MOD_0F2B_PREFIX_0
) },
1848 { MOD_TABLE (MOD_0F2B_PREFIX_1
) },
1849 { MOD_TABLE (MOD_0F2B_PREFIX_2
) },
1850 { MOD_TABLE (MOD_0F2B_PREFIX_3
) },
1855 { "cvttps2pi", { MXC
, EXq
} },
1856 { "cvttss2siY", { Gv
, EXd
} },
1857 { "cvttpd2pi", { MXC
, EXx
} },
1858 { "cvttsd2siY", { Gv
, EXq
} },
1863 { "cvtps2pi", { MXC
, EXq
} },
1864 { "cvtss2siY", { Gv
, EXd
} },
1865 { "cvtpd2pi", { MXC
, EXx
} },
1866 { "cvtsd2siY", { Gv
, EXq
} },
1871 { "ucomiss",{ XM
, EXd
} },
1872 { "(bad)", { XX
} },
1873 { "ucomisd",{ XM
, EXq
} },
1874 { "(bad)", { XX
} },
1879 { "comiss", { XM
, EXd
} },
1880 { "(bad)", { XX
} },
1881 { "comisd", { XM
, EXq
} },
1882 { "(bad)", { XX
} },
1887 { "sqrtps", { XM
, EXx
} },
1888 { "sqrtss", { XM
, EXd
} },
1889 { "sqrtpd", { XM
, EXx
} },
1890 { "sqrtsd", { XM
, EXq
} },
1895 { "rsqrtps",{ XM
, EXx
} },
1896 { "rsqrtss",{ XM
, EXd
} },
1897 { "(bad)", { XX
} },
1898 { "(bad)", { XX
} },
1903 { "rcpps", { XM
, EXx
} },
1904 { "rcpss", { XM
, EXd
} },
1905 { "(bad)", { XX
} },
1906 { "(bad)", { XX
} },
1911 { "addps", { XM
, EXx
} },
1912 { "addss", { XM
, EXd
} },
1913 { "addpd", { XM
, EXx
} },
1914 { "addsd", { XM
, EXq
} },
1919 { "mulps", { XM
, EXx
} },
1920 { "mulss", { XM
, EXd
} },
1921 { "mulpd", { XM
, EXx
} },
1922 { "mulsd", { XM
, EXq
} },
1927 { "cvtps2pd", { XM
, EXq
} },
1928 { "cvtss2sd", { XM
, EXd
} },
1929 { "cvtpd2ps", { XM
, EXx
} },
1930 { "cvtsd2ss", { XM
, EXq
} },
1935 { "cvtdq2ps", { XM
, EXx
} },
1936 { "cvttps2dq", { XM
, EXx
} },
1937 { "cvtps2dq", { XM
, EXx
} },
1938 { "(bad)", { XX
} },
1943 { "subps", { XM
, EXx
} },
1944 { "subss", { XM
, EXd
} },
1945 { "subpd", { XM
, EXx
} },
1946 { "subsd", { XM
, EXq
} },
1951 { "minps", { XM
, EXx
} },
1952 { "minss", { XM
, EXd
} },
1953 { "minpd", { XM
, EXx
} },
1954 { "minsd", { XM
, EXq
} },
1959 { "divps", { XM
, EXx
} },
1960 { "divss", { XM
, EXd
} },
1961 { "divpd", { XM
, EXx
} },
1962 { "divsd", { XM
, EXq
} },
1967 { "maxps", { XM
, EXx
} },
1968 { "maxss", { XM
, EXd
} },
1969 { "maxpd", { XM
, EXx
} },
1970 { "maxsd", { XM
, EXq
} },
1975 { "punpcklbw",{ MX
, EMd
} },
1976 { "(bad)", { XX
} },
1977 { "punpcklbw",{ MX
, EMx
} },
1978 { "(bad)", { XX
} },
1983 { "punpcklwd",{ MX
, EMd
} },
1984 { "(bad)", { XX
} },
1985 { "punpcklwd",{ MX
, EMx
} },
1986 { "(bad)", { XX
} },
1991 { "punpckldq",{ MX
, EMd
} },
1992 { "(bad)", { XX
} },
1993 { "punpckldq",{ MX
, EMx
} },
1994 { "(bad)", { XX
} },
1999 { "(bad)", { XX
} },
2000 { "(bad)", { XX
} },
2001 { "punpcklqdq", { XM
, EXx
} },
2002 { "(bad)", { XX
} },
2007 { "(bad)", { XX
} },
2008 { "(bad)", { XX
} },
2009 { "punpckhqdq", { XM
, EXx
} },
2010 { "(bad)", { XX
} },
2015 { "movq", { MX
, EM
} },
2016 { "movdqu", { XM
, EXx
} },
2017 { "movdqa", { XM
, EXx
} },
2018 { "(bad)", { XX
} },
2023 { "pshufw", { MX
, EM
, Ib
} },
2024 { "pshufhw",{ XM
, EXx
, Ib
} },
2025 { "pshufd", { XM
, EXx
, Ib
} },
2026 { "pshuflw",{ XM
, EXx
, Ib
} },
2029 /* PREFIX_0F73_REG_3 */
2031 { "(bad)", { XX
} },
2032 { "(bad)", { XX
} },
2033 { "psrldq", { XS
, Ib
} },
2034 { "(bad)", { XX
} },
2037 /* PREFIX_0F73_REG_7 */
2039 { "(bad)", { XX
} },
2040 { "(bad)", { XX
} },
2041 { "pslldq", { XS
, Ib
} },
2042 { "(bad)", { XX
} },
2047 {"vmread", { Em
, Gm
} },
2049 {"extrq", { XS
, Ib
, Ib
} },
2050 {"insertq", { XM
, XS
, Ib
, Ib
} },
2055 {"vmwrite", { Gm
, Em
} },
2057 {"extrq", { XM
, XS
} },
2058 {"insertq", { XM
, XS
} },
2063 { "(bad)", { XX
} },
2064 { "(bad)", { XX
} },
2065 { "haddpd", { XM
, EXx
} },
2066 { "haddps", { XM
, EXx
} },
2071 { "(bad)", { XX
} },
2072 { "(bad)", { XX
} },
2073 { "hsubpd", { XM
, EXx
} },
2074 { "hsubps", { XM
, EXx
} },
2079 { "movK", { Edq
, MX
} },
2080 { "movq", { XM
, EXq
} },
2081 { "movK", { Edq
, XM
} },
2082 { "(bad)", { XX
} },
2087 { "movq", { EM
, MX
} },
2088 { "movdqu", { EXx
, XM
} },
2089 { "movdqa", { EXx
, XM
} },
2090 { "(bad)", { XX
} },
2095 { "(bad)", { XX
} },
2096 { "popcntS", { Gv
, Ev
} },
2097 { "(bad)", { XX
} },
2098 { "(bad)", { XX
} },
2103 { "bsrS", { Gv
, Ev
} },
2104 { "lzcntS", { Gv
, Ev
} },
2105 { "bsrS", { Gv
, Ev
} },
2106 { "(bad)", { XX
} },
2111 { "cmpps", { XM
, EXx
, CMP
} },
2112 { "cmpss", { XM
, EXd
, CMP
} },
2113 { "cmppd", { XM
, EXx
, CMP
} },
2114 { "cmpsd", { XM
, EXq
, CMP
} },
2119 { "movntiS", { Ma
, Gv
} },
2120 { "(bad)", { XX
} },
2121 { "(bad)", { XX
} },
2122 { "(bad)", { XX
} },
2125 /* PREFIX_0FC7_REG_6 */
2127 { "vmptrld",{ Mq
} },
2128 { "vmxon", { Mq
} },
2129 { "vmclear",{ Mq
} },
2130 { "(bad)", { XX
} },
2135 { "(bad)", { XX
} },
2136 { "(bad)", { XX
} },
2137 { "addsubpd", { XM
, EXx
} },
2138 { "addsubps", { XM
, EXx
} },
2143 { "(bad)", { XX
} },
2144 { "movq2dq",{ XM
, MS
} },
2145 { "movq", { EXq
, XM
} },
2146 { "movdq2q",{ MX
, XS
} },
2151 { "(bad)", { XX
} },
2152 { "cvtdq2pd", { XM
, EXq
} },
2153 { "cvttpd2dq", { XM
, EXx
} },
2154 { "cvtpd2dq", { XM
, EXx
} },
2159 { "movntq", { Mq
, MX
} },
2160 { "(bad)", { XX
} },
2161 { MOD_TABLE (MOD_0FE7_PREFIX_2
) },
2162 { "(bad)", { XX
} },
2167 { "(bad)", { XX
} },
2168 { "(bad)", { XX
} },
2169 { "(bad)", { XX
} },
2170 { MOD_TABLE (MOD_0FF0_PREFIX_3
) },
2175 { "maskmovq", { MX
, MS
} },
2176 { "(bad)", { XX
} },
2177 { "maskmovdqu", { XM
, XS
} },
2178 { "(bad)", { XX
} },
2183 { "(bad)", { XX
} },
2184 { "(bad)", { XX
} },
2185 { "pblendvb", { XM
, EXx
, XMM0
} },
2186 { "(bad)", { XX
} },
2191 { "(bad)", { XX
} },
2192 { "(bad)", { XX
} },
2193 { "blendvps", { XM
, EXx
, XMM0
} },
2194 { "(bad)", { XX
} },
2199 { "(bad)", { XX
} },
2200 { "(bad)", { XX
} },
2201 { "blendvpd", { XM
, EXx
, XMM0
} },
2202 { "(bad)", { XX
} },
2207 { "(bad)", { XX
} },
2208 { "(bad)", { XX
} },
2209 { "ptest", { XM
, EXx
} },
2210 { "(bad)", { XX
} },
2215 { "(bad)", { XX
} },
2216 { "(bad)", { XX
} },
2217 { "pmovsxbw", { XM
, EXq
} },
2218 { "(bad)", { XX
} },
2223 { "(bad)", { XX
} },
2224 { "(bad)", { XX
} },
2225 { "pmovsxbd", { XM
, EXd
} },
2226 { "(bad)", { XX
} },
2231 { "(bad)", { XX
} },
2232 { "(bad)", { XX
} },
2233 { "pmovsxbq", { XM
, EXw
} },
2234 { "(bad)", { XX
} },
2239 { "(bad)", { XX
} },
2240 { "(bad)", { XX
} },
2241 { "pmovsxwd", { XM
, EXq
} },
2242 { "(bad)", { XX
} },
2247 { "(bad)", { XX
} },
2248 { "(bad)", { XX
} },
2249 { "pmovsxwq", { XM
, EXd
} },
2250 { "(bad)", { XX
} },
2255 { "(bad)", { XX
} },
2256 { "(bad)", { XX
} },
2257 { "pmovsxdq", { XM
, EXq
} },
2258 { "(bad)", { XX
} },
2263 { "(bad)", { XX
} },
2264 { "(bad)", { XX
} },
2265 { "pmuldq", { XM
, EXx
} },
2266 { "(bad)", { XX
} },
2271 { "(bad)", { XX
} },
2272 { "(bad)", { XX
} },
2273 { "pcmpeqq", { XM
, EXx
} },
2274 { "(bad)", { XX
} },
2279 { "(bad)", { XX
} },
2280 { "(bad)", { XX
} },
2281 { MOD_TABLE (MOD_0F382A_PREFIX_2
) },
2282 { "(bad)", { XX
} },
2287 { "(bad)", { XX
} },
2288 { "(bad)", { XX
} },
2289 { "packusdw", { XM
, EXx
} },
2290 { "(bad)", { XX
} },
2295 { "(bad)", { XX
} },
2296 { "(bad)", { XX
} },
2297 { "pmovzxbw", { XM
, EXq
} },
2298 { "(bad)", { XX
} },
2303 { "(bad)", { XX
} },
2304 { "(bad)", { XX
} },
2305 { "pmovzxbd", { XM
, EXd
} },
2306 { "(bad)", { XX
} },
2311 { "(bad)", { XX
} },
2312 { "(bad)", { XX
} },
2313 { "pmovzxbq", { XM
, EXw
} },
2314 { "(bad)", { XX
} },
2319 { "(bad)", { XX
} },
2320 { "(bad)", { XX
} },
2321 { "pmovzxwd", { XM
, EXq
} },
2322 { "(bad)", { XX
} },
2327 { "(bad)", { XX
} },
2328 { "(bad)", { XX
} },
2329 { "pmovzxwq", { XM
, EXd
} },
2330 { "(bad)", { XX
} },
2335 { "(bad)", { XX
} },
2336 { "(bad)", { XX
} },
2337 { "pmovzxdq", { XM
, EXq
} },
2338 { "(bad)", { XX
} },
2343 { "(bad)", { XX
} },
2344 { "(bad)", { XX
} },
2345 { "pcmpgtq", { XM
, EXx
} },
2346 { "(bad)", { XX
} },
2351 { "(bad)", { XX
} },
2352 { "(bad)", { XX
} },
2353 { "pminsb", { XM
, EXx
} },
2354 { "(bad)", { XX
} },
2359 { "(bad)", { XX
} },
2360 { "(bad)", { XX
} },
2361 { "pminsd", { XM
, EXx
} },
2362 { "(bad)", { XX
} },
2367 { "(bad)", { XX
} },
2368 { "(bad)", { XX
} },
2369 { "pminuw", { XM
, EXx
} },
2370 { "(bad)", { XX
} },
2375 { "(bad)", { XX
} },
2376 { "(bad)", { XX
} },
2377 { "pminud", { XM
, EXx
} },
2378 { "(bad)", { XX
} },
2383 { "(bad)", { XX
} },
2384 { "(bad)", { XX
} },
2385 { "pmaxsb", { XM
, EXx
} },
2386 { "(bad)", { XX
} },
2391 { "(bad)", { XX
} },
2392 { "(bad)", { XX
} },
2393 { "pmaxsd", { XM
, EXx
} },
2394 { "(bad)", { XX
} },
2399 { "(bad)", { XX
} },
2400 { "(bad)", { XX
} },
2401 { "pmaxuw", { XM
, EXx
} },
2402 { "(bad)", { XX
} },
2407 { "(bad)", { XX
} },
2408 { "(bad)", { XX
} },
2409 { "pmaxud", { XM
, EXx
} },
2410 { "(bad)", { XX
} },
2415 { "(bad)", { XX
} },
2416 { "(bad)", { XX
} },
2417 { "pmulld", { XM
, EXx
} },
2418 { "(bad)", { XX
} },
2423 { "(bad)", { XX
} },
2424 { "(bad)", { XX
} },
2425 { "phminposuw", { XM
, EXx
} },
2426 { "(bad)", { XX
} },
2431 { "(bad)", { XX
} },
2432 { "(bad)", { XX
} },
2433 { "(bad)", { XX
} },
2434 { "crc32", { Gdq
, { CRC32_Fixup
, b_mode
} } },
2439 { "(bad)", { XX
} },
2440 { "(bad)", { XX
} },
2441 { "(bad)", { XX
} },
2442 { "crc32", { Gdq
, { CRC32_Fixup
, v_mode
} } },
2447 { "(bad)", { XX
} },
2448 { "(bad)", { XX
} },
2449 { "roundps", { XM
, EXx
, Ib
} },
2450 { "(bad)", { XX
} },
2455 { "(bad)", { XX
} },
2456 { "(bad)", { XX
} },
2457 { "roundpd", { XM
, EXx
, Ib
} },
2458 { "(bad)", { XX
} },
2463 { "(bad)", { XX
} },
2464 { "(bad)", { XX
} },
2465 { "roundss", { XM
, EXd
, Ib
} },
2466 { "(bad)", { XX
} },
2471 { "(bad)", { XX
} },
2472 { "(bad)", { XX
} },
2473 { "roundsd", { XM
, EXq
, Ib
} },
2474 { "(bad)", { XX
} },
2479 { "(bad)", { XX
} },
2480 { "(bad)", { XX
} },
2481 { "blendps", { XM
, EXx
, Ib
} },
2482 { "(bad)", { XX
} },
2487 { "(bad)", { XX
} },
2488 { "(bad)", { XX
} },
2489 { "blendpd", { XM
, EXx
, Ib
} },
2490 { "(bad)", { XX
} },
2495 { "(bad)", { XX
} },
2496 { "(bad)", { XX
} },
2497 { "pblendw", { XM
, EXx
, Ib
} },
2498 { "(bad)", { XX
} },
2503 { "(bad)", { XX
} },
2504 { "(bad)", { XX
} },
2505 { "pextrb", { Edqb
, XM
, Ib
} },
2506 { "(bad)", { XX
} },
2511 { "(bad)", { XX
} },
2512 { "(bad)", { XX
} },
2513 { "pextrw", { Edqw
, XM
, Ib
} },
2514 { "(bad)", { XX
} },
2519 { "(bad)", { XX
} },
2520 { "(bad)", { XX
} },
2521 { "pextrK", { Edq
, XM
, Ib
} },
2522 { "(bad)", { XX
} },
2527 { "(bad)", { XX
} },
2528 { "(bad)", { XX
} },
2529 { "extractps", { Edqd
, XM
, Ib
} },
2530 { "(bad)", { XX
} },
2535 { "(bad)", { XX
} },
2536 { "(bad)", { XX
} },
2537 { "pinsrb", { XM
, Edqb
, Ib
} },
2538 { "(bad)", { XX
} },
2543 { "(bad)", { XX
} },
2544 { "(bad)", { XX
} },
2545 { "insertps", { XM
, EXd
, Ib
} },
2546 { "(bad)", { XX
} },
2551 { "(bad)", { XX
} },
2552 { "(bad)", { XX
} },
2553 { "pinsrK", { XM
, Edq
, Ib
} },
2554 { "(bad)", { XX
} },
2559 { "(bad)", { XX
} },
2560 { "(bad)", { XX
} },
2561 { "dpps", { XM
, EXx
, Ib
} },
2562 { "(bad)", { XX
} },
2567 { "(bad)", { XX
} },
2568 { "(bad)", { XX
} },
2569 { "dppd", { XM
, EXx
, Ib
} },
2570 { "(bad)", { XX
} },
2575 { "(bad)", { XX
} },
2576 { "(bad)", { XX
} },
2577 { "mpsadbw", { XM
, EXx
, Ib
} },
2578 { "(bad)", { XX
} },
2583 { "(bad)", { XX
} },
2584 { "(bad)", { XX
} },
2585 { "pcmpestrm", { XM
, EXx
, Ib
} },
2586 { "(bad)", { XX
} },
2591 { "(bad)", { XX
} },
2592 { "(bad)", { XX
} },
2593 { "pcmpestri", { XM
, EXx
, Ib
} },
2594 { "(bad)", { XX
} },
2599 { "(bad)", { XX
} },
2600 { "(bad)", { XX
} },
2601 { "pcmpistrm", { XM
, EXx
, Ib
} },
2602 { "(bad)", { XX
} },
2607 { "(bad)", { XX
} },
2608 { "(bad)", { XX
} },
2609 { "pcmpistri", { XM
, EXx
, Ib
} },
2610 { "(bad)", { XX
} },
2614 static const struct dis386 x86_64_table
[][2] = {
2617 { "push{T|}", { es
} },
2618 { "(bad)", { XX
} },
2623 { "pop{T|}", { es
} },
2624 { "(bad)", { XX
} },
2629 { "push{T|}", { cs
} },
2630 { "(bad)", { XX
} },
2635 { "push{T|}", { ss
} },
2636 { "(bad)", { XX
} },
2641 { "pop{T|}", { ss
} },
2642 { "(bad)", { XX
} },
2647 { "push{T|}", { ds
} },
2648 { "(bad)", { XX
} },
2653 { "pop{T|}", { ds
} },
2654 { "(bad)", { XX
} },
2660 { "(bad)", { XX
} },
2666 { "(bad)", { XX
} },
2672 { "(bad)", { XX
} },
2678 { "(bad)", { XX
} },
2683 { "pusha{P|}", { XX
} },
2684 { "(bad)", { XX
} },
2689 { "popa{P|}", { XX
} },
2690 { "(bad)", { XX
} },
2695 { MOD_TABLE (MOD_62_32BIT
) },
2696 { "(bad)", { XX
} },
2701 { "arpl", { Ew
, Gw
} },
2702 { "movs{lq|xd}", { Gv
, Ed
} },
2707 { "ins{R|}", { Yzr
, indirDX
} },
2708 { "ins{G|}", { Yzr
, indirDX
} },
2713 { "outs{R|}", { indirDXr
, Xz
} },
2714 { "outs{G|}", { indirDXr
, Xz
} },
2719 { "Jcall{T|}", { Ap
} },
2720 { "(bad)", { XX
} },
2725 { MOD_TABLE (MOD_C4_32BIT
) },
2726 { "(bad)", { XX
} },
2731 { MOD_TABLE (MOD_C5_32BIT
) },
2732 { "(bad)", { XX
} },
2738 { "(bad)", { XX
} },
2744 { "(bad)", { XX
} },
2750 { "(bad)", { XX
} },
2755 { "Jjmp{T|}", { Ap
} },
2756 { "(bad)", { XX
} },
2759 /* X86_64_0F01_REG_0 */
2761 { "sgdt{Q|IQ}", { M
} },
2765 /* X86_64_0F01_REG_1 */
2767 { "sidt{Q|IQ}", { M
} },
2771 /* X86_64_0F01_REG_2 */
2773 { "lgdt{Q|Q}", { M
} },
2777 /* X86_64_0F01_REG_3 */
2779 { "lidt{Q|Q}", { M
} },
2784 static const struct dis386 three_byte_table
[][256] = {
2785 /* THREE_BYTE_0F24 */
2788 { "fmaddps", { { OP_DREX4
, q_mode
} } },
2789 { "fmaddpd", { { OP_DREX4
, q_mode
} } },
2790 { "fmaddss", { { OP_DREX4
, w_mode
} } },
2791 { "fmaddsd", { { OP_DREX4
, d_mode
} } },
2792 { "fmaddps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2793 { "fmaddpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2794 { "fmaddss", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2795 { "fmaddsd", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2797 { "fmsubps", { { OP_DREX4
, q_mode
} } },
2798 { "fmsubpd", { { OP_DREX4
, q_mode
} } },
2799 { "fmsubss", { { OP_DREX4
, w_mode
} } },
2800 { "fmsubsd", { { OP_DREX4
, d_mode
} } },
2801 { "fmsubps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2802 { "fmsubpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2803 { "fmsubss", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2804 { "fmsubsd", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2806 { "fnmaddps", { { OP_DREX4
, q_mode
} } },
2807 { "fnmaddpd", { { OP_DREX4
, q_mode
} } },
2808 { "fnmaddss", { { OP_DREX4
, w_mode
} } },
2809 { "fnmaddsd", { { OP_DREX4
, d_mode
} } },
2810 { "fnmaddps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2811 { "fnmaddpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2812 { "fnmaddss", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2813 { "fnmaddsd", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2815 { "fnmsubps", { { OP_DREX4
, q_mode
} } },
2816 { "fnmsubpd", { { OP_DREX4
, q_mode
} } },
2817 { "fnmsubss", { { OP_DREX4
, w_mode
} } },
2818 { "fnmsubsd", { { OP_DREX4
, d_mode
} } },
2819 { "fnmsubps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2820 { "fnmsubpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2821 { "fnmsubss", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2822 { "fnmsubsd", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2824 { "permps", { { OP_DREX4
, q_mode
} } },
2825 { "permpd", { { OP_DREX4
, q_mode
} } },
2826 { "pcmov", { { OP_DREX4
, q_mode
} } },
2827 { "pperm", { { OP_DREX4
, q_mode
} } },
2828 { "permps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2829 { "permpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2830 { "pcmov", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2831 { "pperm", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2833 { "(bad)", { XX
} },
2834 { "(bad)", { XX
} },
2835 { "(bad)", { XX
} },
2836 { "(bad)", { XX
} },
2837 { "(bad)", { XX
} },
2838 { "(bad)", { XX
} },
2839 { "(bad)", { XX
} },
2840 { "(bad)", { XX
} },
2842 { "(bad)", { XX
} },
2843 { "(bad)", { XX
} },
2844 { "(bad)", { XX
} },
2845 { "(bad)", { XX
} },
2846 { "(bad)", { XX
} },
2847 { "(bad)", { XX
} },
2848 { "(bad)", { XX
} },
2849 { "(bad)", { XX
} },
2851 { "(bad)", { XX
} },
2852 { "(bad)", { XX
} },
2853 { "(bad)", { XX
} },
2854 { "(bad)", { XX
} },
2855 { "(bad)", { XX
} },
2856 { "(bad)", { XX
} },
2857 { "(bad)", { XX
} },
2858 { "(bad)", { XX
} },
2860 { "protb", { { OP_DREX3
, q_mode
} } },
2861 { "protw", { { OP_DREX3
, q_mode
} } },
2862 { "protd", { { OP_DREX3
, q_mode
} } },
2863 { "protq", { { OP_DREX3
, q_mode
} } },
2864 { "pshlb", { { OP_DREX3
, q_mode
} } },
2865 { "pshlw", { { OP_DREX3
, q_mode
} } },
2866 { "pshld", { { OP_DREX3
, q_mode
} } },
2867 { "pshlq", { { OP_DREX3
, q_mode
} } },
2869 { "pshab", { { OP_DREX3
, q_mode
} } },
2870 { "pshaw", { { OP_DREX3
, q_mode
} } },
2871 { "pshad", { { OP_DREX3
, q_mode
} } },
2872 { "pshaq", { { OP_DREX3
, q_mode
} } },
2873 { "(bad)", { XX
} },
2874 { "(bad)", { XX
} },
2875 { "(bad)", { XX
} },
2876 { "(bad)", { XX
} },
2878 { "(bad)", { XX
} },
2879 { "(bad)", { XX
} },
2880 { "(bad)", { XX
} },
2881 { "(bad)", { XX
} },
2882 { "(bad)", { XX
} },
2883 { "(bad)", { XX
} },
2884 { "(bad)", { XX
} },
2885 { "(bad)", { XX
} },
2887 { "(bad)", { XX
} },
2888 { "(bad)", { XX
} },
2889 { "(bad)", { XX
} },
2890 { "(bad)", { XX
} },
2891 { "(bad)", { XX
} },
2892 { "(bad)", { XX
} },
2893 { "(bad)", { XX
} },
2894 { "(bad)", { XX
} },
2896 { "(bad)", { XX
} },
2897 { "(bad)", { XX
} },
2898 { "(bad)", { XX
} },
2899 { "(bad)", { XX
} },
2900 { "(bad)", { XX
} },
2901 { "(bad)", { XX
} },
2902 { "(bad)", { XX
} },
2903 { "(bad)", { XX
} },
2905 { "(bad)", { XX
} },
2906 { "(bad)", { XX
} },
2907 { "(bad)", { XX
} },
2908 { "(bad)", { XX
} },
2909 { "(bad)", { XX
} },
2910 { "(bad)", { XX
} },
2911 { "(bad)", { XX
} },
2912 { "(bad)", { XX
} },
2914 { "(bad)", { XX
} },
2915 { "(bad)", { XX
} },
2916 { "(bad)", { XX
} },
2917 { "(bad)", { XX
} },
2918 { "(bad)", { XX
} },
2919 { "(bad)", { XX
} },
2920 { "(bad)", { XX
} },
2921 { "(bad)", { XX
} },
2923 { "(bad)", { XX
} },
2924 { "(bad)", { XX
} },
2925 { "(bad)", { XX
} },
2926 { "(bad)", { XX
} },
2927 { "(bad)", { XX
} },
2928 { "(bad)", { XX
} },
2929 { "(bad)", { XX
} },
2930 { "(bad)", { XX
} },
2932 { "(bad)", { XX
} },
2933 { "(bad)", { XX
} },
2934 { "(bad)", { XX
} },
2935 { "(bad)", { XX
} },
2936 { "(bad)", { XX
} },
2937 { "pmacssww", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2938 { "pmacsswd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2939 { "pmacssdql", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2941 { "(bad)", { XX
} },
2942 { "(bad)", { XX
} },
2943 { "(bad)", { XX
} },
2944 { "(bad)", { XX
} },
2945 { "(bad)", { XX
} },
2946 { "(bad)", { XX
} },
2947 { "pmacssdd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2948 { "pmacssdqh", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2950 { "(bad)", { XX
} },
2951 { "(bad)", { XX
} },
2952 { "(bad)", { XX
} },
2953 { "(bad)", { XX
} },
2954 { "(bad)", { XX
} },
2955 { "pmacsww", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2956 { "pmacswd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2957 { "pmacsdql", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2959 { "(bad)", { XX
} },
2960 { "(bad)", { XX
} },
2961 { "(bad)", { XX
} },
2962 { "(bad)", { XX
} },
2963 { "(bad)", { XX
} },
2964 { "(bad)", { XX
} },
2965 { "pmacsdd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2966 { "pmacsdqh", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2968 { "(bad)", { XX
} },
2969 { "(bad)", { XX
} },
2970 { "(bad)", { XX
} },
2971 { "(bad)", { XX
} },
2972 { "(bad)", { XX
} },
2973 { "(bad)", { XX
} },
2974 { "pmadcsswd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2975 { "(bad)", { XX
} },
2977 { "(bad)", { XX
} },
2978 { "(bad)", { XX
} },
2979 { "(bad)", { XX
} },
2980 { "(bad)", { XX
} },
2981 { "(bad)", { XX
} },
2982 { "(bad)", { XX
} },
2983 { "(bad)", { XX
} },
2984 { "(bad)", { XX
} },
2986 { "(bad)", { XX
} },
2987 { "(bad)", { XX
} },
2988 { "(bad)", { XX
} },
2989 { "(bad)", { XX
} },
2990 { "(bad)", { XX
} },
2991 { "(bad)", { XX
} },
2992 { "pmadcswd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2993 { "(bad)", { XX
} },
2995 { "(bad)", { XX
} },
2996 { "(bad)", { XX
} },
2997 { "(bad)", { XX
} },
2998 { "(bad)", { XX
} },
2999 { "(bad)", { XX
} },
3000 { "(bad)", { XX
} },
3001 { "(bad)", { XX
} },
3002 { "(bad)", { XX
} },
3004 { "(bad)", { XX
} },
3005 { "(bad)", { XX
} },
3006 { "(bad)", { XX
} },
3007 { "(bad)", { XX
} },
3008 { "(bad)", { XX
} },
3009 { "(bad)", { XX
} },
3010 { "(bad)", { XX
} },
3011 { "(bad)", { XX
} },
3013 { "(bad)", { XX
} },
3014 { "(bad)", { XX
} },
3015 { "(bad)", { XX
} },
3016 { "(bad)", { XX
} },
3017 { "(bad)", { XX
} },
3018 { "(bad)", { XX
} },
3019 { "(bad)", { XX
} },
3020 { "(bad)", { XX
} },
3022 { "(bad)", { XX
} },
3023 { "(bad)", { XX
} },
3024 { "(bad)", { XX
} },
3025 { "(bad)", { XX
} },
3026 { "(bad)", { XX
} },
3027 { "(bad)", { XX
} },
3028 { "(bad)", { XX
} },
3029 { "(bad)", { XX
} },
3031 { "(bad)", { XX
} },
3032 { "(bad)", { XX
} },
3033 { "(bad)", { XX
} },
3034 { "(bad)", { XX
} },
3035 { "(bad)", { XX
} },
3036 { "(bad)", { XX
} },
3037 { "(bad)", { XX
} },
3038 { "(bad)", { XX
} },
3040 { "(bad)", { XX
} },
3041 { "(bad)", { XX
} },
3042 { "(bad)", { XX
} },
3043 { "(bad)", { XX
} },
3044 { "(bad)", { XX
} },
3045 { "(bad)", { XX
} },
3046 { "(bad)", { XX
} },
3047 { "(bad)", { XX
} },
3049 { "(bad)", { XX
} },
3050 { "(bad)", { XX
} },
3051 { "(bad)", { XX
} },
3052 { "(bad)", { XX
} },
3053 { "(bad)", { XX
} },
3054 { "(bad)", { XX
} },
3055 { "(bad)", { XX
} },
3056 { "(bad)", { XX
} },
3058 { "(bad)", { XX
} },
3059 { "(bad)", { XX
} },
3060 { "(bad)", { XX
} },
3061 { "(bad)", { XX
} },
3062 { "(bad)", { XX
} },
3063 { "(bad)", { XX
} },
3064 { "(bad)", { XX
} },
3065 { "(bad)", { XX
} },
3067 { "(bad)", { XX
} },
3068 { "(bad)", { XX
} },
3069 { "(bad)", { XX
} },
3070 { "(bad)", { XX
} },
3071 { "(bad)", { XX
} },
3072 { "(bad)", { XX
} },
3073 { "(bad)", { XX
} },
3074 { "(bad)", { XX
} },
3076 /* THREE_BYTE_0F25 */
3079 { "(bad)", { XX
} },
3080 { "(bad)", { XX
} },
3081 { "(bad)", { XX
} },
3082 { "(bad)", { XX
} },
3083 { "(bad)", { XX
} },
3084 { "(bad)", { XX
} },
3085 { "(bad)", { XX
} },
3086 { "(bad)", { XX
} },
3088 { "(bad)", { XX
} },
3089 { "(bad)", { XX
} },
3090 { "(bad)", { XX
} },
3091 { "(bad)", { XX
} },
3092 { "(bad)", { XX
} },
3093 { "(bad)", { XX
} },
3094 { "(bad)", { XX
} },
3095 { "(bad)", { XX
} },
3097 { "(bad)", { XX
} },
3098 { "(bad)", { XX
} },
3099 { "(bad)", { XX
} },
3100 { "(bad)", { XX
} },
3101 { "(bad)", { XX
} },
3102 { "(bad)", { XX
} },
3103 { "(bad)", { XX
} },
3104 { "(bad)", { XX
} },
3106 { "(bad)", { XX
} },
3107 { "(bad)", { XX
} },
3108 { "(bad)", { XX
} },
3109 { "(bad)", { XX
} },
3110 { "(bad)", { XX
} },
3111 { "(bad)", { XX
} },
3112 { "(bad)", { XX
} },
3113 { "(bad)", { XX
} },
3115 { "(bad)", { XX
} },
3116 { "(bad)", { XX
} },
3117 { "(bad)", { XX
} },
3118 { "(bad)", { XX
} },
3119 { "(bad)", { XX
} },
3120 { "(bad)", { XX
} },
3121 { "(bad)", { XX
} },
3122 { "(bad)", { XX
} },
3124 { "(bad)", { XX
} },
3125 { "(bad)", { XX
} },
3126 { "(bad)", { XX
} },
3127 { "(bad)", { XX
} },
3128 { "comps", { { OP_DREX3
, q_mode
}, { OP_DREX_FCMP
, b_mode
} } },
3129 { "compd", { { OP_DREX3
, q_mode
}, { OP_DREX_FCMP
, b_mode
} } },
3130 { "comss", { { OP_DREX3
, w_mode
}, { OP_DREX_FCMP
, b_mode
} } },
3131 { "comsd", { { OP_DREX3
, d_mode
}, { OP_DREX_FCMP
, b_mode
} } },
3133 { "(bad)", { XX
} },
3134 { "(bad)", { XX
} },
3135 { "(bad)", { XX
} },
3136 { "(bad)", { XX
} },
3137 { "(bad)", { XX
} },
3138 { "(bad)", { XX
} },
3139 { "(bad)", { XX
} },
3140 { "(bad)", { XX
} },
3142 { "(bad)", { XX
} },
3143 { "(bad)", { XX
} },
3144 { "(bad)", { XX
} },
3145 { "(bad)", { XX
} },
3146 { "(bad)", { XX
} },
3147 { "(bad)", { XX
} },
3148 { "(bad)", { XX
} },
3149 { "(bad)", { XX
} },
3151 { "(bad)", { XX
} },
3152 { "(bad)", { XX
} },
3153 { "(bad)", { XX
} },
3154 { "(bad)", { XX
} },
3155 { "(bad)", { XX
} },
3156 { "(bad)", { XX
} },
3157 { "(bad)", { XX
} },
3158 { "(bad)", { XX
} },
3160 { "(bad)", { XX
} },
3161 { "(bad)", { XX
} },
3162 { "(bad)", { XX
} },
3163 { "(bad)", { XX
} },
3164 { "pcomb", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3165 { "pcomw", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3166 { "pcomd", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3167 { "pcomq", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3169 { "(bad)", { XX
} },
3170 { "(bad)", { XX
} },
3171 { "(bad)", { XX
} },
3172 { "(bad)", { XX
} },
3173 { "(bad)", { XX
} },
3174 { "(bad)", { XX
} },
3175 { "(bad)", { XX
} },
3176 { "(bad)", { XX
} },
3178 { "(bad)", { XX
} },
3179 { "(bad)", { XX
} },
3180 { "(bad)", { XX
} },
3181 { "(bad)", { XX
} },
3182 { "(bad)", { XX
} },
3183 { "(bad)", { XX
} },
3184 { "(bad)", { XX
} },
3185 { "(bad)", { XX
} },
3187 { "(bad)", { XX
} },
3188 { "(bad)", { XX
} },
3189 { "(bad)", { XX
} },
3190 { "(bad)", { XX
} },
3191 { "(bad)", { XX
} },
3192 { "(bad)", { XX
} },
3193 { "(bad)", { XX
} },
3194 { "(bad)", { XX
} },
3196 { "(bad)", { XX
} },
3197 { "(bad)", { XX
} },
3198 { "(bad)", { XX
} },
3199 { "(bad)", { XX
} },
3200 { "pcomub", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3201 { "pcomuw", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3202 { "pcomud", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3203 { "pcomuq", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3205 { "(bad)", { XX
} },
3206 { "(bad)", { XX
} },
3207 { "(bad)", { XX
} },
3208 { "(bad)", { XX
} },
3209 { "(bad)", { XX
} },
3210 { "(bad)", { XX
} },
3211 { "(bad)", { XX
} },
3212 { "(bad)", { XX
} },
3214 { "(bad)", { XX
} },
3215 { "(bad)", { XX
} },
3216 { "(bad)", { XX
} },
3217 { "(bad)", { XX
} },
3218 { "(bad)", { XX
} },
3219 { "(bad)", { XX
} },
3220 { "(bad)", { XX
} },
3221 { "(bad)", { XX
} },
3223 { "(bad)", { XX
} },
3224 { "(bad)", { XX
} },
3225 { "(bad)", { XX
} },
3226 { "(bad)", { XX
} },
3227 { "(bad)", { XX
} },
3228 { "(bad)", { XX
} },
3229 { "(bad)", { XX
} },
3230 { "(bad)", { XX
} },
3232 { "(bad)", { XX
} },
3233 { "(bad)", { XX
} },
3234 { "(bad)", { XX
} },
3235 { "(bad)", { XX
} },
3236 { "(bad)", { XX
} },
3237 { "(bad)", { XX
} },
3238 { "(bad)", { XX
} },
3239 { "(bad)", { XX
} },
3241 { "(bad)", { XX
} },
3242 { "(bad)", { XX
} },
3243 { "(bad)", { XX
} },
3244 { "(bad)", { XX
} },
3245 { "(bad)", { XX
} },
3246 { "(bad)", { XX
} },
3247 { "(bad)", { XX
} },
3248 { "(bad)", { XX
} },
3250 { "(bad)", { XX
} },
3251 { "(bad)", { XX
} },
3252 { "(bad)", { XX
} },
3253 { "(bad)", { XX
} },
3254 { "(bad)", { XX
} },
3255 { "(bad)", { XX
} },
3256 { "(bad)", { XX
} },
3257 { "(bad)", { XX
} },
3259 { "(bad)", { XX
} },
3260 { "(bad)", { XX
} },
3261 { "(bad)", { XX
} },
3262 { "(bad)", { XX
} },
3263 { "(bad)", { XX
} },
3264 { "(bad)", { XX
} },
3265 { "(bad)", { XX
} },
3266 { "(bad)", { XX
} },
3268 { "(bad)", { XX
} },
3269 { "(bad)", { XX
} },
3270 { "(bad)", { XX
} },
3271 { "(bad)", { XX
} },
3272 { "(bad)", { XX
} },
3273 { "(bad)", { XX
} },
3274 { "(bad)", { XX
} },
3275 { "(bad)", { XX
} },
3277 { "(bad)", { XX
} },
3278 { "(bad)", { XX
} },
3279 { "(bad)", { XX
} },
3280 { "(bad)", { XX
} },
3281 { "(bad)", { XX
} },
3282 { "(bad)", { XX
} },
3283 { "(bad)", { XX
} },
3284 { "(bad)", { XX
} },
3286 { "(bad)", { XX
} },
3287 { "(bad)", { XX
} },
3288 { "(bad)", { XX
} },
3289 { "(bad)", { XX
} },
3290 { "(bad)", { XX
} },
3291 { "(bad)", { XX
} },
3292 { "(bad)", { XX
} },
3293 { "(bad)", { XX
} },
3295 { "(bad)", { XX
} },
3296 { "(bad)", { XX
} },
3297 { "(bad)", { XX
} },
3298 { "(bad)", { XX
} },
3299 { "(bad)", { XX
} },
3300 { "(bad)", { XX
} },
3301 { "(bad)", { XX
} },
3302 { "(bad)", { XX
} },
3304 { "(bad)", { XX
} },
3305 { "(bad)", { XX
} },
3306 { "(bad)", { XX
} },
3307 { "(bad)", { XX
} },
3308 { "(bad)", { XX
} },
3309 { "(bad)", { XX
} },
3310 { "(bad)", { XX
} },
3311 { "(bad)", { XX
} },
3313 { "(bad)", { XX
} },
3314 { "(bad)", { XX
} },
3315 { "(bad)", { XX
} },
3316 { "(bad)", { XX
} },
3317 { "(bad)", { XX
} },
3318 { "(bad)", { XX
} },
3319 { "(bad)", { XX
} },
3320 { "(bad)", { XX
} },
3322 { "(bad)", { XX
} },
3323 { "(bad)", { XX
} },
3324 { "(bad)", { XX
} },
3325 { "(bad)", { XX
} },
3326 { "(bad)", { XX
} },
3327 { "(bad)", { XX
} },
3328 { "(bad)", { XX
} },
3329 { "(bad)", { XX
} },
3331 { "(bad)", { XX
} },
3332 { "(bad)", { XX
} },
3333 { "(bad)", { XX
} },
3334 { "(bad)", { XX
} },
3335 { "(bad)", { XX
} },
3336 { "(bad)", { XX
} },
3337 { "(bad)", { XX
} },
3338 { "(bad)", { XX
} },
3340 { "(bad)", { XX
} },
3341 { "(bad)", { XX
} },
3342 { "(bad)", { XX
} },
3343 { "(bad)", { XX
} },
3344 { "(bad)", { XX
} },
3345 { "(bad)", { XX
} },
3346 { "(bad)", { XX
} },
3347 { "(bad)", { XX
} },
3349 { "(bad)", { XX
} },
3350 { "(bad)", { XX
} },
3351 { "(bad)", { XX
} },
3352 { "(bad)", { XX
} },
3353 { "(bad)", { XX
} },
3354 { "(bad)", { XX
} },
3355 { "(bad)", { XX
} },
3356 { "(bad)", { XX
} },
3358 { "(bad)", { XX
} },
3359 { "(bad)", { XX
} },
3360 { "(bad)", { XX
} },
3361 { "(bad)", { XX
} },
3362 { "(bad)", { XX
} },
3363 { "(bad)", { XX
} },
3364 { "(bad)", { XX
} },
3365 { "(bad)", { XX
} },
3367 /* THREE_BYTE_0F38 */
3370 { "pshufb", { MX
, EM
} },
3371 { "phaddw", { MX
, EM
} },
3372 { "phaddd", { MX
, EM
} },
3373 { "phaddsw", { MX
, EM
} },
3374 { "pmaddubsw", { MX
, EM
} },
3375 { "phsubw", { MX
, EM
} },
3376 { "phsubd", { MX
, EM
} },
3377 { "phsubsw", { MX
, EM
} },
3379 { "psignb", { MX
, EM
} },
3380 { "psignw", { MX
, EM
} },
3381 { "psignd", { MX
, EM
} },
3382 { "pmulhrsw", { MX
, EM
} },
3383 { "(bad)", { XX
} },
3384 { "(bad)", { XX
} },
3385 { "(bad)", { XX
} },
3386 { "(bad)", { XX
} },
3388 { PREFIX_TABLE (PREFIX_0F3810
) },
3389 { "(bad)", { XX
} },
3390 { "(bad)", { XX
} },
3391 { "(bad)", { XX
} },
3392 { PREFIX_TABLE (PREFIX_0F3814
) },
3393 { PREFIX_TABLE (PREFIX_0F3815
) },
3394 { "(bad)", { XX
} },
3395 { PREFIX_TABLE (PREFIX_0F3817
) },
3397 { "(bad)", { XX
} },
3398 { "(bad)", { XX
} },
3399 { "(bad)", { XX
} },
3400 { "(bad)", { XX
} },
3401 { "pabsb", { MX
, EM
} },
3402 { "pabsw", { MX
, EM
} },
3403 { "pabsd", { MX
, EM
} },
3404 { "(bad)", { XX
} },
3406 { PREFIX_TABLE (PREFIX_0F3820
) },
3407 { PREFIX_TABLE (PREFIX_0F3821
) },
3408 { PREFIX_TABLE (PREFIX_0F3822
) },
3409 { PREFIX_TABLE (PREFIX_0F3823
) },
3410 { PREFIX_TABLE (PREFIX_0F3824
) },
3411 { PREFIX_TABLE (PREFIX_0F3825
) },
3412 { "(bad)", { XX
} },
3413 { "(bad)", { XX
} },
3415 { PREFIX_TABLE (PREFIX_0F3828
) },
3416 { PREFIX_TABLE (PREFIX_0F3829
) },
3417 { PREFIX_TABLE (PREFIX_0F382A
) },
3418 { PREFIX_TABLE (PREFIX_0F382B
) },
3419 { "(bad)", { XX
} },
3420 { "(bad)", { XX
} },
3421 { "(bad)", { XX
} },
3422 { "(bad)", { XX
} },
3424 { PREFIX_TABLE (PREFIX_0F3830
) },
3425 { PREFIX_TABLE (PREFIX_0F3831
) },
3426 { PREFIX_TABLE (PREFIX_0F3832
) },
3427 { PREFIX_TABLE (PREFIX_0F3833
) },
3428 { PREFIX_TABLE (PREFIX_0F3834
) },
3429 { PREFIX_TABLE (PREFIX_0F3835
) },
3430 { "(bad)", { XX
} },
3431 { PREFIX_TABLE (PREFIX_0F3837
) },
3433 { PREFIX_TABLE (PREFIX_0F3838
) },
3434 { PREFIX_TABLE (PREFIX_0F3839
) },
3435 { PREFIX_TABLE (PREFIX_0F383A
) },
3436 { PREFIX_TABLE (PREFIX_0F383B
) },
3437 { PREFIX_TABLE (PREFIX_0F383C
) },
3438 { PREFIX_TABLE (PREFIX_0F383D
) },
3439 { PREFIX_TABLE (PREFIX_0F383E
) },
3440 { PREFIX_TABLE (PREFIX_0F383F
) },
3442 { PREFIX_TABLE (PREFIX_0F3840
) },
3443 { PREFIX_TABLE (PREFIX_0F3841
) },
3444 { "(bad)", { XX
} },
3445 { "(bad)", { XX
} },
3446 { "(bad)", { XX
} },
3447 { "(bad)", { XX
} },
3448 { "(bad)", { XX
} },
3449 { "(bad)", { XX
} },
3451 { "(bad)", { XX
} },
3452 { "(bad)", { XX
} },
3453 { "(bad)", { XX
} },
3454 { "(bad)", { XX
} },
3455 { "(bad)", { XX
} },
3456 { "(bad)", { XX
} },
3457 { "(bad)", { XX
} },
3458 { "(bad)", { XX
} },
3460 { "(bad)", { XX
} },
3461 { "(bad)", { XX
} },
3462 { "(bad)", { XX
} },
3463 { "(bad)", { XX
} },
3464 { "(bad)", { XX
} },
3465 { "(bad)", { XX
} },
3466 { "(bad)", { XX
} },
3467 { "(bad)", { XX
} },
3469 { "(bad)", { XX
} },
3470 { "(bad)", { XX
} },
3471 { "(bad)", { XX
} },
3472 { "(bad)", { XX
} },
3473 { "(bad)", { XX
} },
3474 { "(bad)", { XX
} },
3475 { "(bad)", { XX
} },
3476 { "(bad)", { XX
} },
3478 { "(bad)", { XX
} },
3479 { "(bad)", { XX
} },
3480 { "(bad)", { XX
} },
3481 { "(bad)", { XX
} },
3482 { "(bad)", { XX
} },
3483 { "(bad)", { XX
} },
3484 { "(bad)", { XX
} },
3485 { "(bad)", { XX
} },
3487 { "(bad)", { XX
} },
3488 { "(bad)", { XX
} },
3489 { "(bad)", { XX
} },
3490 { "(bad)", { XX
} },
3491 { "(bad)", { XX
} },
3492 { "(bad)", { XX
} },
3493 { "(bad)", { XX
} },
3494 { "(bad)", { XX
} },
3496 { "(bad)", { XX
} },
3497 { "(bad)", { XX
} },
3498 { "(bad)", { XX
} },
3499 { "(bad)", { XX
} },
3500 { "(bad)", { XX
} },
3501 { "(bad)", { XX
} },
3502 { "(bad)", { XX
} },
3503 { "(bad)", { XX
} },
3505 { "(bad)", { XX
} },
3506 { "(bad)", { XX
} },
3507 { "(bad)", { XX
} },
3508 { "(bad)", { XX
} },
3509 { "(bad)", { XX
} },
3510 { "(bad)", { XX
} },
3511 { "(bad)", { XX
} },
3512 { "(bad)", { XX
} },
3514 { "(bad)", { XX
} },
3515 { "(bad)", { XX
} },
3516 { "(bad)", { XX
} },
3517 { "(bad)", { XX
} },
3518 { "(bad)", { XX
} },
3519 { "(bad)", { XX
} },
3520 { "(bad)", { XX
} },
3521 { "(bad)", { XX
} },
3523 { "(bad)", { XX
} },
3524 { "(bad)", { XX
} },
3525 { "(bad)", { XX
} },
3526 { "(bad)", { XX
} },
3527 { "(bad)", { XX
} },
3528 { "(bad)", { XX
} },
3529 { "(bad)", { XX
} },
3530 { "(bad)", { XX
} },
3532 { "(bad)", { XX
} },
3533 { "(bad)", { XX
} },
3534 { "(bad)", { XX
} },
3535 { "(bad)", { XX
} },
3536 { "(bad)", { XX
} },
3537 { "(bad)", { XX
} },
3538 { "(bad)", { XX
} },
3539 { "(bad)", { XX
} },
3541 { "(bad)", { XX
} },
3542 { "(bad)", { XX
} },
3543 { "(bad)", { XX
} },
3544 { "(bad)", { XX
} },
3545 { "(bad)", { XX
} },
3546 { "(bad)", { XX
} },
3547 { "(bad)", { XX
} },
3548 { "(bad)", { XX
} },
3550 { "(bad)", { XX
} },
3551 { "(bad)", { XX
} },
3552 { "(bad)", { XX
} },
3553 { "(bad)", { XX
} },
3554 { "(bad)", { XX
} },
3555 { "(bad)", { XX
} },
3556 { "(bad)", { XX
} },
3557 { "(bad)", { XX
} },
3559 { "(bad)", { XX
} },
3560 { "(bad)", { XX
} },
3561 { "(bad)", { XX
} },
3562 { "(bad)", { XX
} },
3563 { "(bad)", { XX
} },
3564 { "(bad)", { XX
} },
3565 { "(bad)", { XX
} },
3566 { "(bad)", { XX
} },
3568 { "(bad)", { XX
} },
3569 { "(bad)", { XX
} },
3570 { "(bad)", { XX
} },
3571 { "(bad)", { XX
} },
3572 { "(bad)", { XX
} },
3573 { "(bad)", { XX
} },
3574 { "(bad)", { XX
} },
3575 { "(bad)", { XX
} },
3577 { "(bad)", { XX
} },
3578 { "(bad)", { XX
} },
3579 { "(bad)", { XX
} },
3580 { "(bad)", { XX
} },
3581 { "(bad)", { XX
} },
3582 { "(bad)", { XX
} },
3583 { "(bad)", { XX
} },
3584 { "(bad)", { XX
} },
3586 { "(bad)", { XX
} },
3587 { "(bad)", { XX
} },
3588 { "(bad)", { XX
} },
3589 { "(bad)", { XX
} },
3590 { "(bad)", { XX
} },
3591 { "(bad)", { XX
} },
3592 { "(bad)", { XX
} },
3593 { "(bad)", { XX
} },
3595 { "(bad)", { XX
} },
3596 { "(bad)", { XX
} },
3597 { "(bad)", { XX
} },
3598 { "(bad)", { XX
} },
3599 { "(bad)", { XX
} },
3600 { "(bad)", { XX
} },
3601 { "(bad)", { XX
} },
3602 { "(bad)", { XX
} },
3604 { "(bad)", { XX
} },
3605 { "(bad)", { XX
} },
3606 { "(bad)", { XX
} },
3607 { "(bad)", { XX
} },
3608 { "(bad)", { XX
} },
3609 { "(bad)", { XX
} },
3610 { "(bad)", { XX
} },
3611 { "(bad)", { XX
} },
3613 { "(bad)", { XX
} },
3614 { "(bad)", { XX
} },
3615 { "(bad)", { XX
} },
3616 { "(bad)", { XX
} },
3617 { "(bad)", { XX
} },
3618 { "(bad)", { XX
} },
3619 { "(bad)", { XX
} },
3620 { "(bad)", { XX
} },
3622 { "(bad)", { XX
} },
3623 { "(bad)", { XX
} },
3624 { "(bad)", { XX
} },
3625 { "(bad)", { XX
} },
3626 { "(bad)", { XX
} },
3627 { "(bad)", { XX
} },
3628 { "(bad)", { XX
} },
3629 { "(bad)", { XX
} },
3631 { "(bad)", { XX
} },
3632 { "(bad)", { XX
} },
3633 { "(bad)", { XX
} },
3634 { "(bad)", { XX
} },
3635 { "(bad)", { XX
} },
3636 { "(bad)", { XX
} },
3637 { "(bad)", { XX
} },
3638 { "(bad)", { XX
} },
3640 { PREFIX_TABLE (PREFIX_0F38F0
) },
3641 { PREFIX_TABLE (PREFIX_0F38F1
) },
3642 { "(bad)", { XX
} },
3643 { "(bad)", { XX
} },
3644 { "(bad)", { XX
} },
3645 { "(bad)", { XX
} },
3646 { "(bad)", { XX
} },
3647 { "(bad)", { XX
} },
3649 { "(bad)", { XX
} },
3650 { "(bad)", { XX
} },
3651 { "(bad)", { XX
} },
3652 { "(bad)", { XX
} },
3653 { "(bad)", { XX
} },
3654 { "(bad)", { XX
} },
3655 { "(bad)", { XX
} },
3656 { "(bad)", { XX
} },
3658 /* THREE_BYTE_0F3A */
3661 { "(bad)", { XX
} },
3662 { "(bad)", { XX
} },
3663 { "(bad)", { XX
} },
3664 { "(bad)", { XX
} },
3665 { "(bad)", { XX
} },
3666 { "(bad)", { XX
} },
3667 { "(bad)", { XX
} },
3668 { "(bad)", { XX
} },
3670 { PREFIX_TABLE (PREFIX_0F3A08
) },
3671 { PREFIX_TABLE (PREFIX_0F3A09
) },
3672 { PREFIX_TABLE (PREFIX_0F3A0A
) },
3673 { PREFIX_TABLE (PREFIX_0F3A0B
) },
3674 { PREFIX_TABLE (PREFIX_0F3A0C
) },
3675 { PREFIX_TABLE (PREFIX_0F3A0D
) },
3676 { PREFIX_TABLE (PREFIX_0F3A0E
) },
3677 { "palignr", { MX
, EM
, Ib
} },
3679 { "(bad)", { XX
} },
3680 { "(bad)", { XX
} },
3681 { "(bad)", { XX
} },
3682 { "(bad)", { XX
} },
3683 { PREFIX_TABLE (PREFIX_0F3A14
) },
3684 { PREFIX_TABLE (PREFIX_0F3A15
) },
3685 { PREFIX_TABLE (PREFIX_0F3A16
) },
3686 { PREFIX_TABLE (PREFIX_0F3A17
) },
3688 { "(bad)", { XX
} },
3689 { "(bad)", { XX
} },
3690 { "(bad)", { XX
} },
3691 { "(bad)", { XX
} },
3692 { "(bad)", { XX
} },
3693 { "(bad)", { XX
} },
3694 { "(bad)", { XX
} },
3695 { "(bad)", { XX
} },
3697 { PREFIX_TABLE (PREFIX_0F3A20
) },
3698 { PREFIX_TABLE (PREFIX_0F3A21
) },
3699 { PREFIX_TABLE (PREFIX_0F3A22
) },
3700 { "(bad)", { XX
} },
3701 { "(bad)", { XX
} },
3702 { "(bad)", { XX
} },
3703 { "(bad)", { XX
} },
3704 { "(bad)", { XX
} },
3706 { "(bad)", { XX
} },
3707 { "(bad)", { XX
} },
3708 { "(bad)", { XX
} },
3709 { "(bad)", { XX
} },
3710 { "(bad)", { XX
} },
3711 { "(bad)", { XX
} },
3712 { "(bad)", { XX
} },
3713 { "(bad)", { XX
} },
3715 { "(bad)", { XX
} },
3716 { "(bad)", { XX
} },
3717 { "(bad)", { XX
} },
3718 { "(bad)", { XX
} },
3719 { "(bad)", { XX
} },
3720 { "(bad)", { XX
} },
3721 { "(bad)", { XX
} },
3722 { "(bad)", { XX
} },
3724 { "(bad)", { XX
} },
3725 { "(bad)", { XX
} },
3726 { "(bad)", { XX
} },
3727 { "(bad)", { XX
} },
3728 { "(bad)", { XX
} },
3729 { "(bad)", { XX
} },
3730 { "(bad)", { XX
} },
3731 { "(bad)", { XX
} },
3733 { PREFIX_TABLE (PREFIX_0F3A40
) },
3734 { PREFIX_TABLE (PREFIX_0F3A41
) },
3735 { PREFIX_TABLE (PREFIX_0F3A42
) },
3736 { "(bad)", { XX
} },
3737 { "(bad)", { XX
} },
3738 { "(bad)", { XX
} },
3739 { "(bad)", { XX
} },
3740 { "(bad)", { XX
} },
3742 { "(bad)", { XX
} },
3743 { "(bad)", { XX
} },
3744 { "(bad)", { XX
} },
3745 { "(bad)", { XX
} },
3746 { "(bad)", { XX
} },
3747 { "(bad)", { XX
} },
3748 { "(bad)", { XX
} },
3749 { "(bad)", { XX
} },
3751 { "(bad)", { XX
} },
3752 { "(bad)", { XX
} },
3753 { "(bad)", { XX
} },
3754 { "(bad)", { XX
} },
3755 { "(bad)", { XX
} },
3756 { "(bad)", { XX
} },
3757 { "(bad)", { XX
} },
3758 { "(bad)", { XX
} },
3760 { "(bad)", { XX
} },
3761 { "(bad)", { XX
} },
3762 { "(bad)", { XX
} },
3763 { "(bad)", { XX
} },
3764 { "(bad)", { XX
} },
3765 { "(bad)", { XX
} },
3766 { "(bad)", { XX
} },
3767 { "(bad)", { XX
} },
3769 { PREFIX_TABLE (PREFIX_0F3A60
) },
3770 { PREFIX_TABLE (PREFIX_0F3A61
) },
3771 { PREFIX_TABLE (PREFIX_0F3A62
) },
3772 { PREFIX_TABLE (PREFIX_0F3A63
) },
3773 { "(bad)", { XX
} },
3774 { "(bad)", { XX
} },
3775 { "(bad)", { XX
} },
3776 { "(bad)", { XX
} },
3778 { "(bad)", { XX
} },
3779 { "(bad)", { XX
} },
3780 { "(bad)", { XX
} },
3781 { "(bad)", { XX
} },
3782 { "(bad)", { XX
} },
3783 { "(bad)", { XX
} },
3784 { "(bad)", { XX
} },
3785 { "(bad)", { XX
} },
3787 { "(bad)", { XX
} },
3788 { "(bad)", { XX
} },
3789 { "(bad)", { XX
} },
3790 { "(bad)", { XX
} },
3791 { "(bad)", { XX
} },
3792 { "(bad)", { XX
} },
3793 { "(bad)", { XX
} },
3794 { "(bad)", { XX
} },
3796 { "(bad)", { XX
} },
3797 { "(bad)", { XX
} },
3798 { "(bad)", { XX
} },
3799 { "(bad)", { XX
} },
3800 { "(bad)", { XX
} },
3801 { "(bad)", { XX
} },
3802 { "(bad)", { XX
} },
3803 { "(bad)", { XX
} },
3805 { "(bad)", { XX
} },
3806 { "(bad)", { XX
} },
3807 { "(bad)", { XX
} },
3808 { "(bad)", { XX
} },
3809 { "(bad)", { XX
} },
3810 { "(bad)", { XX
} },
3811 { "(bad)", { XX
} },
3812 { "(bad)", { XX
} },
3814 { "(bad)", { XX
} },
3815 { "(bad)", { XX
} },
3816 { "(bad)", { XX
} },
3817 { "(bad)", { XX
} },
3818 { "(bad)", { XX
} },
3819 { "(bad)", { XX
} },
3820 { "(bad)", { XX
} },
3821 { "(bad)", { XX
} },
3823 { "(bad)", { XX
} },
3824 { "(bad)", { XX
} },
3825 { "(bad)", { XX
} },
3826 { "(bad)", { XX
} },
3827 { "(bad)", { XX
} },
3828 { "(bad)", { XX
} },
3829 { "(bad)", { XX
} },
3830 { "(bad)", { XX
} },
3832 { "(bad)", { XX
} },
3833 { "(bad)", { XX
} },
3834 { "(bad)", { XX
} },
3835 { "(bad)", { XX
} },
3836 { "(bad)", { XX
} },
3837 { "(bad)", { XX
} },
3838 { "(bad)", { XX
} },
3839 { "(bad)", { XX
} },
3841 { "(bad)", { XX
} },
3842 { "(bad)", { XX
} },
3843 { "(bad)", { XX
} },
3844 { "(bad)", { XX
} },
3845 { "(bad)", { XX
} },
3846 { "(bad)", { XX
} },
3847 { "(bad)", { XX
} },
3848 { "(bad)", { XX
} },
3850 { "(bad)", { XX
} },
3851 { "(bad)", { XX
} },
3852 { "(bad)", { XX
} },
3853 { "(bad)", { XX
} },
3854 { "(bad)", { XX
} },
3855 { "(bad)", { XX
} },
3856 { "(bad)", { XX
} },
3857 { "(bad)", { XX
} },
3859 { "(bad)", { XX
} },
3860 { "(bad)", { XX
} },
3861 { "(bad)", { XX
} },
3862 { "(bad)", { XX
} },
3863 { "(bad)", { XX
} },
3864 { "(bad)", { XX
} },
3865 { "(bad)", { XX
} },
3866 { "(bad)", { XX
} },
3868 { "(bad)", { XX
} },
3869 { "(bad)", { XX
} },
3870 { "(bad)", { XX
} },
3871 { "(bad)", { XX
} },
3872 { "(bad)", { XX
} },
3873 { "(bad)", { XX
} },
3874 { "(bad)", { XX
} },
3875 { "(bad)", { XX
} },
3877 { "(bad)", { XX
} },
3878 { "(bad)", { XX
} },
3879 { "(bad)", { XX
} },
3880 { "(bad)", { XX
} },
3881 { "(bad)", { XX
} },
3882 { "(bad)", { XX
} },
3883 { "(bad)", { XX
} },
3884 { "(bad)", { XX
} },
3886 { "(bad)", { XX
} },
3887 { "(bad)", { XX
} },
3888 { "(bad)", { XX
} },
3889 { "(bad)", { XX
} },
3890 { "(bad)", { XX
} },
3891 { "(bad)", { XX
} },
3892 { "(bad)", { XX
} },
3893 { "(bad)", { XX
} },
3895 { "(bad)", { XX
} },
3896 { "(bad)", { XX
} },
3897 { "(bad)", { XX
} },
3898 { "(bad)", { XX
} },
3899 { "(bad)", { XX
} },
3900 { "(bad)", { XX
} },
3901 { "(bad)", { XX
} },
3902 { "(bad)", { XX
} },
3904 { "(bad)", { XX
} },
3905 { "(bad)", { XX
} },
3906 { "(bad)", { XX
} },
3907 { "(bad)", { XX
} },
3908 { "(bad)", { XX
} },
3909 { "(bad)", { XX
} },
3910 { "(bad)", { XX
} },
3911 { "(bad)", { XX
} },
3913 { "(bad)", { XX
} },
3914 { "(bad)", { XX
} },
3915 { "(bad)", { XX
} },
3916 { "(bad)", { XX
} },
3917 { "(bad)", { XX
} },
3918 { "(bad)", { XX
} },
3919 { "(bad)", { XX
} },
3920 { "(bad)", { XX
} },
3922 { "(bad)", { XX
} },
3923 { "(bad)", { XX
} },
3924 { "(bad)", { XX
} },
3925 { "(bad)", { XX
} },
3926 { "(bad)", { XX
} },
3927 { "(bad)", { XX
} },
3928 { "(bad)", { XX
} },
3929 { "(bad)", { XX
} },
3931 { "(bad)", { XX
} },
3932 { "(bad)", { XX
} },
3933 { "(bad)", { XX
} },
3934 { "(bad)", { XX
} },
3935 { "(bad)", { XX
} },
3936 { "(bad)", { XX
} },
3937 { "(bad)", { XX
} },
3938 { "(bad)", { XX
} },
3940 { "(bad)", { XX
} },
3941 { "(bad)", { XX
} },
3942 { "(bad)", { XX
} },
3943 { "(bad)", { XX
} },
3944 { "(bad)", { XX
} },
3945 { "(bad)", { XX
} },
3946 { "(bad)", { XX
} },
3947 { "(bad)", { XX
} },
3949 /* THREE_BYTE_0F7A */
3952 { "(bad)", { XX
} },
3953 { "(bad)", { XX
} },
3954 { "(bad)", { XX
} },
3955 { "(bad)", { XX
} },
3956 { "(bad)", { XX
} },
3957 { "(bad)", { XX
} },
3958 { "(bad)", { XX
} },
3959 { "(bad)", { XX
} },
3961 { "(bad)", { XX
} },
3962 { "(bad)", { XX
} },
3963 { "(bad)", { XX
} },
3964 { "(bad)", { XX
} },
3965 { "(bad)", { XX
} },
3966 { "(bad)", { XX
} },
3967 { "(bad)", { XX
} },
3968 { "(bad)", { XX
} },
3970 { "frczps", { XM
, EXq
} },
3971 { "frczpd", { XM
, EXq
} },
3972 { "frczss", { XM
, EXq
} },
3973 { "frczsd", { XM
, EXq
} },
3974 { "(bad)", { XX
} },
3975 { "(bad)", { XX
} },
3976 { "(bad)", { XX
} },
3977 { "(bad)", { XX
} },
3979 { "(bad)", { XX
} },
3980 { "(bad)", { XX
} },
3981 { "(bad)", { XX
} },
3982 { "(bad)", { XX
} },
3983 { "(bad)", { XX
} },
3984 { "(bad)", { XX
} },
3985 { "(bad)", { XX
} },
3986 { "(bad)", { XX
} },
3988 { "ptest", { XX
} },
3989 { "(bad)", { XX
} },
3990 { "(bad)", { XX
} },
3991 { "(bad)", { XX
} },
3992 { "(bad)", { XX
} },
3993 { "(bad)", { XX
} },
3994 { "(bad)", { XX
} },
3995 { "(bad)", { XX
} },
3997 { "(bad)", { XX
} },
3998 { "(bad)", { XX
} },
3999 { "(bad)", { XX
} },
4000 { "(bad)", { XX
} },
4001 { "(bad)", { XX
} },
4002 { "(bad)", { XX
} },
4003 { "(bad)", { XX
} },
4004 { "(bad)", { XX
} },
4006 { "cvtph2ps", { XM
, EXd
} },
4007 { "cvtps2ph", { EXd
, XM
} },
4008 { "(bad)", { XX
} },
4009 { "(bad)", { XX
} },
4010 { "(bad)", { XX
} },
4011 { "(bad)", { XX
} },
4012 { "(bad)", { XX
} },
4013 { "(bad)", { XX
} },
4015 { "(bad)", { XX
} },
4016 { "(bad)", { XX
} },
4017 { "(bad)", { XX
} },
4018 { "(bad)", { XX
} },
4019 { "(bad)", { XX
} },
4020 { "(bad)", { XX
} },
4021 { "(bad)", { XX
} },
4022 { "(bad)", { XX
} },
4024 { "(bad)", { XX
} },
4025 { "phaddbw", { XM
, EXq
} },
4026 { "phaddbd", { XM
, EXq
} },
4027 { "phaddbq", { XM
, EXq
} },
4028 { "(bad)", { XX
} },
4029 { "(bad)", { XX
} },
4030 { "phaddwd", { XM
, EXq
} },
4031 { "phaddwq", { XM
, EXq
} },
4033 { "(bad)", { XX
} },
4034 { "(bad)", { XX
} },
4035 { "(bad)", { XX
} },
4036 { "phadddq", { XM
, EXq
} },
4037 { "(bad)", { XX
} },
4038 { "(bad)", { XX
} },
4039 { "(bad)", { XX
} },
4040 { "(bad)", { XX
} },
4042 { "(bad)", { XX
} },
4043 { "phaddubw", { XM
, EXq
} },
4044 { "phaddubd", { XM
, EXq
} },
4045 { "phaddubq", { XM
, EXq
} },
4046 { "(bad)", { XX
} },
4047 { "(bad)", { XX
} },
4048 { "phadduwd", { XM
, EXq
} },
4049 { "phadduwq", { XM
, EXq
} },
4051 { "(bad)", { XX
} },
4052 { "(bad)", { XX
} },
4053 { "(bad)", { XX
} },
4054 { "phaddudq", { XM
, EXq
} },
4055 { "(bad)", { XX
} },
4056 { "(bad)", { XX
} },
4057 { "(bad)", { XX
} },
4058 { "(bad)", { XX
} },
4060 { "(bad)", { XX
} },
4061 { "phsubbw", { XM
, EXq
} },
4062 { "phsubbd", { XM
, EXq
} },
4063 { "phsubbq", { XM
, EXq
} },
4064 { "(bad)", { XX
} },
4065 { "(bad)", { XX
} },
4066 { "(bad)", { XX
} },
4067 { "(bad)", { XX
} },
4069 { "(bad)", { XX
} },
4070 { "(bad)", { XX
} },
4071 { "(bad)", { XX
} },
4072 { "(bad)", { XX
} },
4073 { "(bad)", { XX
} },
4074 { "(bad)", { XX
} },
4075 { "(bad)", { XX
} },
4076 { "(bad)", { XX
} },
4078 { "(bad)", { XX
} },
4079 { "(bad)", { XX
} },
4080 { "(bad)", { XX
} },
4081 { "(bad)", { XX
} },
4082 { "(bad)", { XX
} },
4083 { "(bad)", { XX
} },
4084 { "(bad)", { XX
} },
4085 { "(bad)", { XX
} },
4087 { "(bad)", { XX
} },
4088 { "(bad)", { XX
} },
4089 { "(bad)", { XX
} },
4090 { "(bad)", { XX
} },
4091 { "(bad)", { XX
} },
4092 { "(bad)", { XX
} },
4093 { "(bad)", { XX
} },
4094 { "(bad)", { XX
} },
4096 { "(bad)", { XX
} },
4097 { "(bad)", { XX
} },
4098 { "(bad)", { XX
} },
4099 { "(bad)", { XX
} },
4100 { "(bad)", { XX
} },
4101 { "(bad)", { XX
} },
4102 { "(bad)", { XX
} },
4103 { "(bad)", { XX
} },
4105 { "(bad)", { XX
} },
4106 { "(bad)", { XX
} },
4107 { "(bad)", { XX
} },
4108 { "(bad)", { XX
} },
4109 { "(bad)", { XX
} },
4110 { "(bad)", { XX
} },
4111 { "(bad)", { XX
} },
4112 { "(bad)", { XX
} },
4114 { "(bad)", { XX
} },
4115 { "(bad)", { XX
} },
4116 { "(bad)", { XX
} },
4117 { "(bad)", { XX
} },
4118 { "(bad)", { XX
} },
4119 { "(bad)", { XX
} },
4120 { "(bad)", { XX
} },
4121 { "(bad)", { XX
} },
4123 { "(bad)", { XX
} },
4124 { "(bad)", { XX
} },
4125 { "(bad)", { XX
} },
4126 { "(bad)", { XX
} },
4127 { "(bad)", { XX
} },
4128 { "(bad)", { XX
} },
4129 { "(bad)", { XX
} },
4130 { "(bad)", { XX
} },
4132 { "(bad)", { XX
} },
4133 { "(bad)", { XX
} },
4134 { "(bad)", { XX
} },
4135 { "(bad)", { XX
} },
4136 { "(bad)", { XX
} },
4137 { "(bad)", { XX
} },
4138 { "(bad)", { XX
} },
4139 { "(bad)", { XX
} },
4141 { "(bad)", { XX
} },
4142 { "(bad)", { XX
} },
4143 { "(bad)", { XX
} },
4144 { "(bad)", { XX
} },
4145 { "(bad)", { XX
} },
4146 { "(bad)", { XX
} },
4147 { "(bad)", { XX
} },
4148 { "(bad)", { XX
} },
4150 { "(bad)", { XX
} },
4151 { "(bad)", { XX
} },
4152 { "(bad)", { XX
} },
4153 { "(bad)", { XX
} },
4154 { "(bad)", { XX
} },
4155 { "(bad)", { XX
} },
4156 { "(bad)", { XX
} },
4157 { "(bad)", { XX
} },
4159 { "(bad)", { XX
} },
4160 { "(bad)", { XX
} },
4161 { "(bad)", { XX
} },
4162 { "(bad)", { XX
} },
4163 { "(bad)", { XX
} },
4164 { "(bad)", { XX
} },
4165 { "(bad)", { XX
} },
4166 { "(bad)", { XX
} },
4168 { "(bad)", { XX
} },
4169 { "(bad)", { XX
} },
4170 { "(bad)", { XX
} },
4171 { "(bad)", { XX
} },
4172 { "(bad)", { XX
} },
4173 { "(bad)", { XX
} },
4174 { "(bad)", { XX
} },
4175 { "(bad)", { XX
} },
4177 { "(bad)", { XX
} },
4178 { "(bad)", { XX
} },
4179 { "(bad)", { XX
} },
4180 { "(bad)", { XX
} },
4181 { "(bad)", { XX
} },
4182 { "(bad)", { XX
} },
4183 { "(bad)", { XX
} },
4184 { "(bad)", { XX
} },
4186 { "(bad)", { XX
} },
4187 { "(bad)", { XX
} },
4188 { "(bad)", { XX
} },
4189 { "(bad)", { XX
} },
4190 { "(bad)", { XX
} },
4191 { "(bad)", { XX
} },
4192 { "(bad)", { XX
} },
4193 { "(bad)", { XX
} },
4195 { "(bad)", { XX
} },
4196 { "(bad)", { XX
} },
4197 { "(bad)", { XX
} },
4198 { "(bad)", { XX
} },
4199 { "(bad)", { XX
} },
4200 { "(bad)", { XX
} },
4201 { "(bad)", { XX
} },
4202 { "(bad)", { XX
} },
4204 { "(bad)", { XX
} },
4205 { "(bad)", { XX
} },
4206 { "(bad)", { XX
} },
4207 { "(bad)", { XX
} },
4208 { "(bad)", { XX
} },
4209 { "(bad)", { XX
} },
4210 { "(bad)", { XX
} },
4211 { "(bad)", { XX
} },
4213 { "(bad)", { XX
} },
4214 { "(bad)", { XX
} },
4215 { "(bad)", { XX
} },
4216 { "(bad)", { XX
} },
4217 { "(bad)", { XX
} },
4218 { "(bad)", { XX
} },
4219 { "(bad)", { XX
} },
4220 { "(bad)", { XX
} },
4222 { "(bad)", { XX
} },
4223 { "(bad)", { XX
} },
4224 { "(bad)", { XX
} },
4225 { "(bad)", { XX
} },
4226 { "(bad)", { XX
} },
4227 { "(bad)", { XX
} },
4228 { "(bad)", { XX
} },
4229 { "(bad)", { XX
} },
4231 { "(bad)", { XX
} },
4232 { "(bad)", { XX
} },
4233 { "(bad)", { XX
} },
4234 { "(bad)", { XX
} },
4235 { "(bad)", { XX
} },
4236 { "(bad)", { XX
} },
4237 { "(bad)", { XX
} },
4238 { "(bad)", { XX
} },
4240 /* THREE_BYTE_0F7B */
4243 { "(bad)", { XX
} },
4244 { "(bad)", { XX
} },
4245 { "(bad)", { XX
} },
4246 { "(bad)", { XX
} },
4247 { "(bad)", { XX
} },
4248 { "(bad)", { XX
} },
4249 { "(bad)", { XX
} },
4250 { "(bad)", { XX
} },
4252 { "(bad)", { XX
} },
4253 { "(bad)", { XX
} },
4254 { "(bad)", { XX
} },
4255 { "(bad)", { XX
} },
4256 { "(bad)", { XX
} },
4257 { "(bad)", { XX
} },
4258 { "(bad)", { XX
} },
4259 { "(bad)", { XX
} },
4261 { "(bad)", { XX
} },
4262 { "(bad)", { XX
} },
4263 { "(bad)", { XX
} },
4264 { "(bad)", { XX
} },
4265 { "(bad)", { XX
} },
4266 { "(bad)", { XX
} },
4267 { "(bad)", { XX
} },
4268 { "(bad)", { XX
} },
4270 { "(bad)", { XX
} },
4271 { "(bad)", { XX
} },
4272 { "(bad)", { XX
} },
4273 { "(bad)", { XX
} },
4274 { "(bad)", { XX
} },
4275 { "(bad)", { XX
} },
4276 { "(bad)", { XX
} },
4277 { "(bad)", { XX
} },
4279 { "(bad)", { XX
} },
4280 { "(bad)", { XX
} },
4281 { "(bad)", { XX
} },
4282 { "(bad)", { XX
} },
4283 { "(bad)", { XX
} },
4284 { "(bad)", { XX
} },
4285 { "(bad)", { XX
} },
4286 { "(bad)", { XX
} },
4288 { "(bad)", { XX
} },
4289 { "(bad)", { XX
} },
4290 { "(bad)", { XX
} },
4291 { "(bad)", { XX
} },
4292 { "(bad)", { XX
} },
4293 { "(bad)", { XX
} },
4294 { "(bad)", { XX
} },
4295 { "(bad)", { XX
} },
4297 { "(bad)", { XX
} },
4298 { "(bad)", { XX
} },
4299 { "(bad)", { XX
} },
4300 { "(bad)", { XX
} },
4301 { "(bad)", { XX
} },
4302 { "(bad)", { XX
} },
4303 { "(bad)", { XX
} },
4304 { "(bad)", { XX
} },
4306 { "(bad)", { XX
} },
4307 { "(bad)", { XX
} },
4308 { "(bad)", { XX
} },
4309 { "(bad)", { XX
} },
4310 { "(bad)", { XX
} },
4311 { "(bad)", { XX
} },
4312 { "(bad)", { XX
} },
4313 { "(bad)", { XX
} },
4315 { "protb", { XM
, EXq
, Ib
} },
4316 { "protw", { XM
, EXq
, Ib
} },
4317 { "protd", { XM
, EXq
, Ib
} },
4318 { "protq", { XM
, EXq
, Ib
} },
4319 { "pshlb", { XM
, EXq
, Ib
} },
4320 { "pshlw", { XM
, EXq
, Ib
} },
4321 { "pshld", { XM
, EXq
, Ib
} },
4322 { "pshlq", { XM
, EXq
, Ib
} },
4324 { "pshab", { XM
, EXq
, Ib
} },
4325 { "pshaw", { XM
, EXq
, Ib
} },
4326 { "pshad", { XM
, EXq
, Ib
} },
4327 { "pshaq", { XM
, EXq
, Ib
} },
4328 { "(bad)", { XX
} },
4329 { "(bad)", { XX
} },
4330 { "(bad)", { XX
} },
4331 { "(bad)", { XX
} },
4333 { "(bad)", { XX
} },
4334 { "(bad)", { XX
} },
4335 { "(bad)", { XX
} },
4336 { "(bad)", { XX
} },
4337 { "(bad)", { XX
} },
4338 { "(bad)", { XX
} },
4339 { "(bad)", { XX
} },
4340 { "(bad)", { XX
} },
4342 { "(bad)", { XX
} },
4343 { "(bad)", { XX
} },
4344 { "(bad)", { XX
} },
4345 { "(bad)", { XX
} },
4346 { "(bad)", { XX
} },
4347 { "(bad)", { XX
} },
4348 { "(bad)", { XX
} },
4349 { "(bad)", { XX
} },
4351 { "(bad)", { XX
} },
4352 { "(bad)", { XX
} },
4353 { "(bad)", { XX
} },
4354 { "(bad)", { XX
} },
4355 { "(bad)", { XX
} },
4356 { "(bad)", { XX
} },
4357 { "(bad)", { XX
} },
4358 { "(bad)", { XX
} },
4360 { "(bad)", { XX
} },
4361 { "(bad)", { XX
} },
4362 { "(bad)", { XX
} },
4363 { "(bad)", { XX
} },
4364 { "(bad)", { XX
} },
4365 { "(bad)", { XX
} },
4366 { "(bad)", { XX
} },
4367 { "(bad)", { XX
} },
4369 { "(bad)", { XX
} },
4370 { "(bad)", { XX
} },
4371 { "(bad)", { XX
} },
4372 { "(bad)", { XX
} },
4373 { "(bad)", { XX
} },
4374 { "(bad)", { XX
} },
4375 { "(bad)", { XX
} },
4376 { "(bad)", { XX
} },
4378 { "(bad)", { XX
} },
4379 { "(bad)", { XX
} },
4380 { "(bad)", { XX
} },
4381 { "(bad)", { XX
} },
4382 { "(bad)", { XX
} },
4383 { "(bad)", { XX
} },
4384 { "(bad)", { XX
} },
4385 { "(bad)", { XX
} },
4387 { "(bad)", { XX
} },
4388 { "(bad)", { XX
} },
4389 { "(bad)", { XX
} },
4390 { "(bad)", { XX
} },
4391 { "(bad)", { XX
} },
4392 { "(bad)", { XX
} },
4393 { "(bad)", { XX
} },
4394 { "(bad)", { XX
} },
4396 { "(bad)", { XX
} },
4397 { "(bad)", { XX
} },
4398 { "(bad)", { XX
} },
4399 { "(bad)", { XX
} },
4400 { "(bad)", { XX
} },
4401 { "(bad)", { XX
} },
4402 { "(bad)", { XX
} },
4403 { "(bad)", { XX
} },
4405 { "(bad)", { XX
} },
4406 { "(bad)", { XX
} },
4407 { "(bad)", { XX
} },
4408 { "(bad)", { XX
} },
4409 { "(bad)", { XX
} },
4410 { "(bad)", { XX
} },
4411 { "(bad)", { XX
} },
4412 { "(bad)", { XX
} },
4414 { "(bad)", { XX
} },
4415 { "(bad)", { XX
} },
4416 { "(bad)", { XX
} },
4417 { "(bad)", { XX
} },
4418 { "(bad)", { XX
} },
4419 { "(bad)", { XX
} },
4420 { "(bad)", { XX
} },
4421 { "(bad)", { XX
} },
4423 { "(bad)", { XX
} },
4424 { "(bad)", { XX
} },
4425 { "(bad)", { XX
} },
4426 { "(bad)", { XX
} },
4427 { "(bad)", { XX
} },
4428 { "(bad)", { XX
} },
4429 { "(bad)", { XX
} },
4430 { "(bad)", { XX
} },
4432 { "(bad)", { XX
} },
4433 { "(bad)", { XX
} },
4434 { "(bad)", { XX
} },
4435 { "(bad)", { XX
} },
4436 { "(bad)", { XX
} },
4437 { "(bad)", { XX
} },
4438 { "(bad)", { XX
} },
4439 { "(bad)", { XX
} },
4441 { "(bad)", { XX
} },
4442 { "(bad)", { XX
} },
4443 { "(bad)", { XX
} },
4444 { "(bad)", { XX
} },
4445 { "(bad)", { XX
} },
4446 { "(bad)", { XX
} },
4447 { "(bad)", { XX
} },
4448 { "(bad)", { XX
} },
4450 { "(bad)", { XX
} },
4451 { "(bad)", { XX
} },
4452 { "(bad)", { XX
} },
4453 { "(bad)", { XX
} },
4454 { "(bad)", { XX
} },
4455 { "(bad)", { XX
} },
4456 { "(bad)", { XX
} },
4457 { "(bad)", { XX
} },
4459 { "(bad)", { XX
} },
4460 { "(bad)", { XX
} },
4461 { "(bad)", { XX
} },
4462 { "(bad)", { XX
} },
4463 { "(bad)", { XX
} },
4464 { "(bad)", { XX
} },
4465 { "(bad)", { XX
} },
4466 { "(bad)", { XX
} },
4468 { "(bad)", { XX
} },
4469 { "(bad)", { XX
} },
4470 { "(bad)", { XX
} },
4471 { "(bad)", { XX
} },
4472 { "(bad)", { XX
} },
4473 { "(bad)", { XX
} },
4474 { "(bad)", { XX
} },
4475 { "(bad)", { XX
} },
4477 { "(bad)", { XX
} },
4478 { "(bad)", { XX
} },
4479 { "(bad)", { XX
} },
4480 { "(bad)", { XX
} },
4481 { "(bad)", { XX
} },
4482 { "(bad)", { XX
} },
4483 { "(bad)", { XX
} },
4484 { "(bad)", { XX
} },
4486 { "(bad)", { XX
} },
4487 { "(bad)", { XX
} },
4488 { "(bad)", { XX
} },
4489 { "(bad)", { XX
} },
4490 { "(bad)", { XX
} },
4491 { "(bad)", { XX
} },
4492 { "(bad)", { XX
} },
4493 { "(bad)", { XX
} },
4495 { "(bad)", { XX
} },
4496 { "(bad)", { XX
} },
4497 { "(bad)", { XX
} },
4498 { "(bad)", { XX
} },
4499 { "(bad)", { XX
} },
4500 { "(bad)", { XX
} },
4501 { "(bad)", { XX
} },
4502 { "(bad)", { XX
} },
4504 { "(bad)", { XX
} },
4505 { "(bad)", { XX
} },
4506 { "(bad)", { XX
} },
4507 { "(bad)", { XX
} },
4508 { "(bad)", { XX
} },
4509 { "(bad)", { XX
} },
4510 { "(bad)", { XX
} },
4511 { "(bad)", { XX
} },
4513 { "(bad)", { XX
} },
4514 { "(bad)", { XX
} },
4515 { "(bad)", { XX
} },
4516 { "(bad)", { XX
} },
4517 { "(bad)", { XX
} },
4518 { "(bad)", { XX
} },
4519 { "(bad)", { XX
} },
4520 { "(bad)", { XX
} },
4522 { "(bad)", { XX
} },
4523 { "(bad)", { XX
} },
4524 { "(bad)", { XX
} },
4525 { "(bad)", { XX
} },
4526 { "(bad)", { XX
} },
4527 { "(bad)", { XX
} },
4528 { "(bad)", { XX
} },
4529 { "(bad)", { XX
} },
4533 static const struct dis386 mod_table
[][2] = {
4536 { "leaS", { Gv
, M
} },
4537 { "(bad)", { XX
} },
4540 /* MOD_0F01_REG_0 */
4541 { X86_64_TABLE (X86_64_0F01_REG_0
) },
4542 { RM_TABLE (RM_0F01_REG_0
) },
4545 /* MOD_0F01_REG_1 */
4546 { X86_64_TABLE (X86_64_0F01_REG_1
) },
4547 { RM_TABLE (RM_0F01_REG_1
) },
4550 /* MOD_0F01_REG_2 */
4551 { X86_64_TABLE (X86_64_0F01_REG_2
) },
4552 { "(bad)", { XX
} },
4555 /* MOD_0F01_REG_3 */
4556 { X86_64_TABLE (X86_64_0F01_REG_3
) },
4557 { RM_TABLE (RM_0F01_REG_3
) },
4560 /* MOD_0F01_REG_7 */
4561 { "invlpg", { Mb
} },
4562 { RM_TABLE (RM_0F01_REG_7
) },
4565 /* MOD_0F12_PREFIX_0 */
4566 { "movlps", { XM
, EXq
} },
4567 { "movhlps", { XM
, EXq
} },
4571 { "movlpX", { EXq
, XM
} },
4572 { "(bad)", { XX
} },
4575 /* MOD_0F16_PREFIX_0 */
4576 { "movhps", { XM
, EXq
} },
4577 { "movlhps", { XM
, EXq
} },
4581 { "movhpX", { EXq
, XM
} },
4582 { "(bad)", { XX
} },
4585 /* MOD_0F18_REG_0 */
4586 { "prefetchnta", { Mb
} },
4587 { "(bad)", { XX
} },
4590 /* MOD_0F18_REG_1 */
4591 { "prefetcht0", { Mb
} },
4592 { "(bad)", { XX
} },
4595 /* MOD_0F18_REG_2 */
4596 { "prefetcht1", { Mb
} },
4597 { "(bad)", { XX
} },
4600 /* MOD_0F18_REG_3 */
4601 { "prefetcht2", { Mb
} },
4602 { "(bad)", { XX
} },
4606 { "(bad)", { XX
} },
4607 { "movZ", { Rm
, Cm
} },
4611 { "(bad)", { XX
} },
4612 { "movZ", { Rm
, Dm
} },
4616 { "(bad)", { XX
} },
4617 { "movZ", { Cm
, Rm
} },
4621 { "(bad)", { XX
} },
4622 { "movZ", { Dm
, Rm
} },
4626 { THREE_BYTE_TABLE (THREE_BYTE_0F24
) },
4627 { "movL", { Rd
, Td
} },
4631 { "(bad)", { XX
} },
4632 { "movL", { Td
, Rd
} },
4635 /* MOD_0F2B_PREFIX_0 */
4636 {"movntps", { Mx
, XM
} },
4637 { "(bad)", { XX
} },
4640 /* MOD_0F2B_PREFIX_1 */
4641 {"movntss", { Md
, XM
} },
4642 { "(bad)", { XX
} },
4645 /* MOD_0F2B_PREFIX_2 */
4646 {"movntpd", { Mx
, XM
} },
4647 { "(bad)", { XX
} },
4650 /* MOD_0F2B_PREFIX_3 */
4651 {"movntsd", { Mq
, XM
} },
4652 { "(bad)", { XX
} },
4656 { "(bad)", { XX
} },
4657 { "movmskpX", { Gdq
, XS
} },
4660 /* MOD_0F71_REG_2 */
4661 { "(bad)", { XX
} },
4662 { "psrlw", { MS
, Ib
} },
4665 /* MOD_0F71_REG_4 */
4666 { "(bad)", { XX
} },
4667 { "psraw", { MS
, Ib
} },
4670 /* MOD_0F71_REG_6 */
4671 { "(bad)", { XX
} },
4672 { "psllw", { MS
, Ib
} },
4675 /* MOD_0F72_REG_2 */
4676 { "(bad)", { XX
} },
4677 { "psrld", { MS
, Ib
} },
4680 /* MOD_0F72_REG_4 */
4681 { "(bad)", { XX
} },
4682 { "psrad", { MS
, Ib
} },
4685 /* MOD_0F72_REG_6 */
4686 { "(bad)", { XX
} },
4687 { "pslld", { MS
, Ib
} },
4690 /* MOD_0F73_REG_2 */
4691 { "(bad)", { XX
} },
4692 { "psrlq", { MS
, Ib
} },
4695 /* MOD_0F73_REG_3 */
4696 { "(bad)", { XX
} },
4697 { PREFIX_TABLE (PREFIX_0F73_REG_3
) },
4700 /* MOD_0F73_REG_6 */
4701 { "(bad)", { XX
} },
4702 { "psllq", { MS
, Ib
} },
4705 /* MOD_0F73_REG_7 */
4706 { "(bad)", { XX
} },
4707 { PREFIX_TABLE (PREFIX_0F73_REG_7
) },
4710 /* MOD_0FAE_REG_0 */
4711 { "fxsave", { M
} },
4712 { "(bad)", { XX
} },
4715 /* MOD_0FAE_REG_1 */
4716 { "fxrstor", { M
} },
4717 { "(bad)", { XX
} },
4720 /* MOD_0FAE_REG_2 */
4721 { "ldmxcsr", { Md
} },
4722 { "(bad)", { XX
} },
4725 /* MOD_0FAE_REG_3 */
4726 { "stmxcsr", { Md
} },
4727 { "(bad)", { XX
} },
4730 /* MOD_0FAE_REG_5 */
4731 { "(bad)", { XX
} },
4732 { RM_TABLE (RM_0FAE_REG_5
) },
4735 /* MOD_0FAE_REG_6 */
4736 { "(bad)", { XX
} },
4737 { RM_TABLE (RM_0FAE_REG_6
) },
4740 /* MOD_0FAE_REG_7 */
4741 { "clflush", { Mb
} },
4742 { RM_TABLE (RM_0FAE_REG_7
) },
4746 { "lssS", { Gv
, Mp
} },
4747 { "(bad)", { XX
} },
4751 { "lfsS", { Gv
, Mp
} },
4752 { "(bad)", { XX
} },
4756 { "lgsS", { Gv
, Mp
} },
4757 { "(bad)", { XX
} },
4760 /* MOD_0FC7_REG_6 */
4761 { PREFIX_TABLE (PREFIX_0FC7_REG_6
) },
4762 { "(bad)", { XX
} },
4765 /* MOD_0FC7_REG_7 */
4766 { "vmptrst", { Mq
} },
4767 { "(bad)", { XX
} },
4771 { "(bad)", { XX
} },
4772 { "pmovmskb", { Gdq
, MS
} },
4775 /* MOD_0FE7_PREFIX_2 */
4776 { "movntdq", { Mx
, XM
} },
4777 { "(bad)", { XX
} },
4780 /* MOD_0FF0_PREFIX_3 */
4781 { "lddqu", { XM
, M
} },
4782 { "(bad)", { XX
} },
4785 /* MOD_0F382A_PREFIX_2 */
4786 { "movntdqa", { XM
, Mx
} },
4787 { "(bad)", { XX
} },
4791 { "bound{S|}", { Gv
, Ma
} },
4792 { "(bad)", { XX
} },
4796 { "lesS", { Gv
, Mp
} },
4797 { "(bad)", { XX
} },
4801 { "ldsS", { Gv
, Mp
} },
4802 { "(bad)", { XX
} },
4806 static const struct dis386 rm_table
[][8] = {
4809 { "(bad)", { XX
} },
4810 { "vmcall", { Skip_MODRM
} },
4811 { "vmlaunch", { Skip_MODRM
} },
4812 { "vmresume", { Skip_MODRM
} },
4813 { "vmxoff", { Skip_MODRM
} },
4814 { "(bad)", { XX
} },
4815 { "(bad)", { XX
} },
4816 { "(bad)", { XX
} },
4820 { "monitor", { { OP_Monitor
, 0 } } },
4821 { "mwait", { { OP_Mwait
, 0 } } },
4822 { "(bad)", { XX
} },
4823 { "(bad)", { XX
} },
4824 { "(bad)", { XX
} },
4825 { "(bad)", { XX
} },
4826 { "(bad)", { XX
} },
4827 { "(bad)", { XX
} },
4831 { "vmrun", { Skip_MODRM
} },
4832 { "vmmcall", { Skip_MODRM
} },
4833 { "vmload", { Skip_MODRM
} },
4834 { "vmsave", { Skip_MODRM
} },
4835 { "stgi", { Skip_MODRM
} },
4836 { "clgi", { Skip_MODRM
} },
4837 { "skinit", { Skip_MODRM
} },
4838 { "invlpga", { Skip_MODRM
} },
4842 { "swapgs", { Skip_MODRM
} },
4843 { "rdtscp", { Skip_MODRM
} },
4844 { "(bad)", { XX
} },
4845 { "(bad)", { XX
} },
4846 { "(bad)", { XX
} },
4847 { "(bad)", { XX
} },
4848 { "(bad)", { XX
} },
4849 { "(bad)", { XX
} },
4853 { "lfence", { Skip_MODRM
} },
4854 { "(bad)", { XX
} },
4855 { "(bad)", { XX
} },
4856 { "(bad)", { XX
} },
4857 { "(bad)", { XX
} },
4858 { "(bad)", { XX
} },
4859 { "(bad)", { XX
} },
4860 { "(bad)", { XX
} },
4864 { "mfence", { Skip_MODRM
} },
4865 { "(bad)", { XX
} },
4866 { "(bad)", { XX
} },
4867 { "(bad)", { XX
} },
4868 { "(bad)", { XX
} },
4869 { "(bad)", { XX
} },
4870 { "(bad)", { XX
} },
4871 { "(bad)", { XX
} },
4875 { "sfence", { Skip_MODRM
} },
4876 { "(bad)", { XX
} },
4877 { "(bad)", { XX
} },
4878 { "(bad)", { XX
} },
4879 { "(bad)", { XX
} },
4880 { "(bad)", { XX
} },
4881 { "(bad)", { XX
} },
4882 { "(bad)", { XX
} },
4886 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
4898 FETCH_DATA (the_info
, codep
+ 1);
4902 /* REX prefixes family. */
4919 if (address_mode
== mode_64bit
)
4925 prefixes
|= PREFIX_REPZ
;
4928 prefixes
|= PREFIX_REPNZ
;
4931 prefixes
|= PREFIX_LOCK
;
4934 prefixes
|= PREFIX_CS
;
4937 prefixes
|= PREFIX_SS
;
4940 prefixes
|= PREFIX_DS
;
4943 prefixes
|= PREFIX_ES
;
4946 prefixes
|= PREFIX_FS
;
4949 prefixes
|= PREFIX_GS
;
4952 prefixes
|= PREFIX_DATA
;
4955 prefixes
|= PREFIX_ADDR
;
4958 /* fwait is really an instruction. If there are prefixes
4959 before the fwait, they belong to the fwait, *not* to the
4960 following instruction. */
4961 if (prefixes
|| rex
)
4963 prefixes
|= PREFIX_FWAIT
;
4967 prefixes
= PREFIX_FWAIT
;
4972 /* Rex is ignored when followed by another prefix. */
4983 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
4987 prefix_name (int pref
, int sizeflag
)
4989 static const char *rexes
[16] =
4994 "rex.XB", /* 0x43 */
4996 "rex.RB", /* 0x45 */
4997 "rex.RX", /* 0x46 */
4998 "rex.RXB", /* 0x47 */
5000 "rex.WB", /* 0x49 */
5001 "rex.WX", /* 0x4a */
5002 "rex.WXB", /* 0x4b */
5003 "rex.WR", /* 0x4c */
5004 "rex.WRB", /* 0x4d */
5005 "rex.WRX", /* 0x4e */
5006 "rex.WRXB", /* 0x4f */
5011 /* REX prefixes family. */
5028 return rexes
[pref
- 0x40];
5048 return (sizeflag
& DFLAG
) ? "data16" : "data32";
5050 if (address_mode
== mode_64bit
)
5051 return (sizeflag
& AFLAG
) ? "addr32" : "addr64";
5053 return (sizeflag
& AFLAG
) ? "addr16" : "addr32";
5061 static char op_out
[MAX_OPERANDS
][100];
5062 static int op_ad
, op_index
[MAX_OPERANDS
];
5063 static int two_source_ops
;
5064 static bfd_vma op_address
[MAX_OPERANDS
];
5065 static bfd_vma op_riprel
[MAX_OPERANDS
];
5066 static bfd_vma start_pc
;
5069 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
5070 * (see topic "Redundant prefixes" in the "Differences from 8086"
5071 * section of the "Virtual 8086 Mode" chapter.)
5072 * 'pc' should be the address of this instruction, it will
5073 * be used to print the target address if this is a relative jump or call
5074 * The function returns the length of this instruction in bytes.
5077 static char intel_syntax
;
5078 static char intel_mnemonic
= !SYSV386_COMPAT
;
5079 static char open_char
;
5080 static char close_char
;
5081 static char separator_char
;
5082 static char scale_char
;
5084 /* Here for backwards compatibility. When gdb stops using
5085 print_insn_i386_att and print_insn_i386_intel these functions can
5086 disappear, and print_insn_i386 be merged into print_insn. */
5088 print_insn_i386_att (bfd_vma pc
, disassemble_info
*info
)
5092 return print_insn (pc
, info
);
5096 print_insn_i386_intel (bfd_vma pc
, disassemble_info
*info
)
5100 return print_insn (pc
, info
);
5104 print_insn_i386 (bfd_vma pc
, disassemble_info
*info
)
5108 return print_insn (pc
, info
);
5112 print_i386_disassembler_options (FILE *stream
)
5114 fprintf (stream
, _("\n\
5115 The following i386/x86-64 specific disassembler options are supported for use\n\
5116 with the -M switch (multiple options should be separated by commas):\n"));
5118 fprintf (stream
, _(" x86-64 Disassemble in 64bit mode\n"));
5119 fprintf (stream
, _(" i386 Disassemble in 32bit mode\n"));
5120 fprintf (stream
, _(" i8086 Disassemble in 16bit mode\n"));
5121 fprintf (stream
, _(" att Display instruction in AT&T syntax\n"));
5122 fprintf (stream
, _(" intel Display instruction in Intel syntax\n"));
5123 fprintf (stream
, _(" att-mnemonic\n"
5124 " Display instruction in AT&T mnemonic\n"));
5125 fprintf (stream
, _(" intel-mnemonic\n"
5126 " Display instruction in Intel mnemonic\n"));
5127 fprintf (stream
, _(" addr64 Assume 64bit address size\n"));
5128 fprintf (stream
, _(" addr32 Assume 32bit address size\n"));
5129 fprintf (stream
, _(" addr16 Assume 16bit address size\n"));
5130 fprintf (stream
, _(" data32 Assume 32bit data size\n"));
5131 fprintf (stream
, _(" data16 Assume 16bit data size\n"));
5132 fprintf (stream
, _(" suffix Always display instruction suffix in AT&T syntax\n"));
5135 /* Get a pointer to struct dis386 with a valid name. */
5137 static const struct dis386
*
5138 get_valid_dis386 (const struct dis386
*dp
, disassemble_info
*info
)
5142 if (dp
->name
!= NULL
)
5145 switch (dp
->op
[0].bytemode
)
5148 dp
= ®_table
[dp
->op
[1].bytemode
][modrm
.reg
];
5152 index
= modrm
.mod
== 0x3 ? 1 : 0;
5153 dp
= &mod_table
[dp
->op
[1].bytemode
][index
];
5157 dp
= &rm_table
[dp
->op
[1].bytemode
][modrm
.rm
];
5160 case USE_PREFIX_TABLE
:
5162 used_prefixes
|= (prefixes
& PREFIX_REPZ
);
5163 if (prefixes
& PREFIX_REPZ
)
5170 /* We should check PREFIX_REPNZ and PREFIX_REPZ before
5172 used_prefixes
|= (prefixes
& PREFIX_REPNZ
);
5173 if (prefixes
& PREFIX_REPNZ
)
5176 repnz_prefix
= NULL
;
5180 used_prefixes
|= (prefixes
& PREFIX_DATA
);
5181 if (prefixes
& PREFIX_DATA
)
5188 dp
= &prefix_table
[dp
->op
[1].bytemode
][index
];
5191 case USE_X86_64_TABLE
:
5192 index
= address_mode
== mode_64bit
? 1 : 0;
5193 dp
= &x86_64_table
[dp
->op
[1].bytemode
][index
];
5196 case USE_3BYTE_TABLE
:
5197 FETCH_DATA (info
, codep
+ 2);
5199 dp
= &three_byte_table
[dp
->op
[1].bytemode
][index
];
5200 modrm
.mod
= (*codep
>> 6) & 3;
5201 modrm
.reg
= (*codep
>> 3) & 7;
5202 modrm
.rm
= *codep
& 7;
5206 oappend (INTERNAL_DISASSEMBLER_ERROR
);
5210 if (dp
->name
!= NULL
)
5213 return get_valid_dis386 (dp
, info
);
5217 print_insn (bfd_vma pc
, disassemble_info
*info
)
5219 const struct dis386
*dp
;
5221 char *op_txt
[MAX_OPERANDS
];
5225 struct dis_private priv
;
5227 char prefix_obuf
[32];
5230 if (info
->mach
== bfd_mach_x86_64_intel_syntax
5231 || info
->mach
== bfd_mach_x86_64
)
5232 address_mode
= mode_64bit
;
5234 address_mode
= mode_32bit
;
5236 if (intel_syntax
== (char) -1)
5237 intel_syntax
= (info
->mach
== bfd_mach_i386_i386_intel_syntax
5238 || info
->mach
== bfd_mach_x86_64_intel_syntax
);
5240 if (info
->mach
== bfd_mach_i386_i386
5241 || info
->mach
== bfd_mach_x86_64
5242 || info
->mach
== bfd_mach_i386_i386_intel_syntax
5243 || info
->mach
== bfd_mach_x86_64_intel_syntax
)
5244 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
5245 else if (info
->mach
== bfd_mach_i386_i8086
)
5246 priv
.orig_sizeflag
= 0;
5250 for (p
= info
->disassembler_options
; p
!= NULL
; )
5252 if (CONST_STRNEQ (p
, "x86-64"))
5254 address_mode
= mode_64bit
;
5255 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
5257 else if (CONST_STRNEQ (p
, "i386"))
5259 address_mode
= mode_32bit
;
5260 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
5262 else if (CONST_STRNEQ (p
, "i8086"))
5264 address_mode
= mode_16bit
;
5265 priv
.orig_sizeflag
= 0;
5267 else if (CONST_STRNEQ (p
, "intel"))
5270 if (CONST_STRNEQ (p
+ 5, "-mnemonic"))
5273 else if (CONST_STRNEQ (p
, "att"))
5276 if (CONST_STRNEQ (p
+ 3, "-mnemonic"))
5279 else if (CONST_STRNEQ (p
, "addr"))
5281 if (address_mode
== mode_64bit
)
5283 if (p
[4] == '3' && p
[5] == '2')
5284 priv
.orig_sizeflag
&= ~AFLAG
;
5285 else if (p
[4] == '6' && p
[5] == '4')
5286 priv
.orig_sizeflag
|= AFLAG
;
5290 if (p
[4] == '1' && p
[5] == '6')
5291 priv
.orig_sizeflag
&= ~AFLAG
;
5292 else if (p
[4] == '3' && p
[5] == '2')
5293 priv
.orig_sizeflag
|= AFLAG
;
5296 else if (CONST_STRNEQ (p
, "data"))
5298 if (p
[4] == '1' && p
[5] == '6')
5299 priv
.orig_sizeflag
&= ~DFLAG
;
5300 else if (p
[4] == '3' && p
[5] == '2')
5301 priv
.orig_sizeflag
|= DFLAG
;
5303 else if (CONST_STRNEQ (p
, "suffix"))
5304 priv
.orig_sizeflag
|= SUFFIX_ALWAYS
;
5306 p
= strchr (p
, ',');
5313 names64
= intel_names64
;
5314 names32
= intel_names32
;
5315 names16
= intel_names16
;
5316 names8
= intel_names8
;
5317 names8rex
= intel_names8rex
;
5318 names_seg
= intel_names_seg
;
5319 index64
= intel_index64
;
5320 index32
= intel_index32
;
5321 index16
= intel_index16
;
5324 separator_char
= '+';
5329 names64
= att_names64
;
5330 names32
= att_names32
;
5331 names16
= att_names16
;
5332 names8
= att_names8
;
5333 names8rex
= att_names8rex
;
5334 names_seg
= att_names_seg
;
5335 index64
= att_index64
;
5336 index32
= att_index32
;
5337 index16
= att_index16
;
5340 separator_char
= ',';
5344 /* The output looks better if we put 7 bytes on a line, since that
5345 puts most long word instructions on a single line. */
5346 info
->bytes_per_line
= 7;
5348 info
->private_data
= &priv
;
5349 priv
.max_fetched
= priv
.the_buffer
;
5350 priv
.insn_start
= pc
;
5353 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5361 start_codep
= priv
.the_buffer
;
5362 codep
= priv
.the_buffer
;
5364 if (setjmp (priv
.bailout
) != 0)
5368 /* Getting here means we tried for data but didn't get it. That
5369 means we have an incomplete instruction of some sort. Just
5370 print the first byte as a prefix or a .byte pseudo-op. */
5371 if (codep
> priv
.the_buffer
)
5373 name
= prefix_name (priv
.the_buffer
[0], priv
.orig_sizeflag
);
5375 (*info
->fprintf_func
) (info
->stream
, "%s", name
);
5378 /* Just print the first byte as a .byte instruction. */
5379 (*info
->fprintf_func
) (info
->stream
, ".byte 0x%x",
5380 (unsigned int) priv
.the_buffer
[0]);
5393 sizeflag
= priv
.orig_sizeflag
;
5395 FETCH_DATA (info
, codep
+ 1);
5396 two_source_ops
= (*codep
== 0x62) || (*codep
== 0xc8);
5398 if (((prefixes
& PREFIX_FWAIT
)
5399 && ((*codep
< 0xd8) || (*codep
> 0xdf)))
5400 || (rex
&& rex_used
))
5404 /* fwait not followed by floating point instruction, or rex followed
5405 by other prefixes. Print the first prefix. */
5406 name
= prefix_name (priv
.the_buffer
[0], priv
.orig_sizeflag
);
5408 name
= INTERNAL_DISASSEMBLER_ERROR
;
5409 (*info
->fprintf_func
) (info
->stream
, "%s", name
);
5416 unsigned char threebyte
;
5417 FETCH_DATA (info
, codep
+ 2);
5418 threebyte
= *++codep
;
5419 dp
= &dis386_twobyte
[threebyte
];
5420 need_modrm
= twobyte_has_modrm
[*codep
];
5425 dp
= &dis386
[*codep
];
5426 need_modrm
= onebyte_has_modrm
[*codep
];
5430 if ((prefixes
& PREFIX_REPZ
))
5432 repz_prefix
= "repz ";
5433 used_prefixes
|= PREFIX_REPZ
;
5438 if ((prefixes
& PREFIX_REPNZ
))
5440 repnz_prefix
= "repnz ";
5441 used_prefixes
|= PREFIX_REPNZ
;
5444 repnz_prefix
= NULL
;
5446 if ((prefixes
& PREFIX_LOCK
))
5448 lock_prefix
= "lock ";
5449 used_prefixes
|= PREFIX_LOCK
;
5455 if (prefixes
& PREFIX_ADDR
)
5458 if (dp
->op
[2].bytemode
!= loop_jcxz_mode
|| intel_syntax
)
5460 if ((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
5461 addr_prefix
= "addr32 ";
5463 addr_prefix
= "addr16 ";
5464 used_prefixes
|= PREFIX_ADDR
;
5469 if ((prefixes
& PREFIX_DATA
))
5472 if (dp
->op
[2].bytemode
== cond_jump_mode
5473 && dp
->op
[0].bytemode
== v_mode
5476 if (sizeflag
& DFLAG
)
5477 data_prefix
= "data32 ";
5479 data_prefix
= "data16 ";
5480 used_prefixes
|= PREFIX_DATA
;
5486 FETCH_DATA (info
, codep
+ 1);
5487 modrm
.mod
= (*codep
>> 6) & 3;
5488 modrm
.reg
= (*codep
>> 3) & 7;
5489 modrm
.rm
= *codep
& 7;
5492 if (dp
->name
== NULL
&& dp
->op
[0].bytemode
== FLOATCODE
)
5498 dp
= get_valid_dis386 (dp
, info
);
5499 if (dp
!= NULL
&& putop (dp
->name
, sizeflag
) == 0)
5501 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5504 op_ad
= MAX_OPERANDS
- 1 - i
;
5506 (*dp
->op
[i
].rtn
) (dp
->op
[i
].bytemode
, sizeflag
);
5511 /* See if any prefixes were not used. If so, print the first one
5512 separately. If we don't do this, we'll wind up printing an
5513 instruction stream which does not precisely correspond to the
5514 bytes we are disassembling. */
5515 if ((prefixes
& ~used_prefixes
) != 0)
5519 name
= prefix_name (priv
.the_buffer
[0], priv
.orig_sizeflag
);
5521 name
= INTERNAL_DISASSEMBLER_ERROR
;
5522 (*info
->fprintf_func
) (info
->stream
, "%s", name
);
5525 if (rex
& ~rex_used
)
5528 name
= prefix_name (rex
| 0x40, priv
.orig_sizeflag
);
5530 name
= INTERNAL_DISASSEMBLER_ERROR
;
5531 (*info
->fprintf_func
) (info
->stream
, "%s ", name
);
5535 prefix_obufp
= prefix_obuf
;
5537 prefix_obufp
= stpcpy (prefix_obufp
, lock_prefix
);
5539 prefix_obufp
= stpcpy (prefix_obufp
, repz_prefix
);
5541 prefix_obufp
= stpcpy (prefix_obufp
, repnz_prefix
);
5543 prefix_obufp
= stpcpy (prefix_obufp
, addr_prefix
);
5545 prefix_obufp
= stpcpy (prefix_obufp
, data_prefix
);
5547 if (prefix_obuf
[0] != 0)
5548 (*info
->fprintf_func
) (info
->stream
, "%s", prefix_obuf
);
5550 obufp
= obuf
+ strlen (obuf
);
5551 for (i
= strlen (obuf
) + strlen (prefix_obuf
); i
< 6; i
++)
5554 (*info
->fprintf_func
) (info
->stream
, "%s", obuf
);
5556 /* The enter and bound instructions are printed with operands in the same
5557 order as the intel book; everything else is printed in reverse order. */
5558 if (intel_syntax
|| two_source_ops
)
5562 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5563 op_txt
[i
] = op_out
[i
];
5565 for (i
= 0; i
< (MAX_OPERANDS
>> 1); ++i
)
5567 op_ad
= op_index
[i
];
5568 op_index
[i
] = op_index
[MAX_OPERANDS
- 1 - i
];
5569 op_index
[MAX_OPERANDS
- 1 - i
] = op_ad
;
5570 riprel
= op_riprel
[i
];
5571 op_riprel
[i
] = op_riprel
[MAX_OPERANDS
- 1 - i
];
5572 op_riprel
[MAX_OPERANDS
- 1 - i
] = riprel
;
5577 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5578 op_txt
[MAX_OPERANDS
- 1 - i
] = op_out
[i
];
5582 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5586 (*info
->fprintf_func
) (info
->stream
, ",");
5587 if (op_index
[i
] != -1 && !op_riprel
[i
])
5588 (*info
->print_address_func
) ((bfd_vma
) op_address
[op_index
[i
]], info
);
5590 (*info
->fprintf_func
) (info
->stream
, "%s", op_txt
[i
]);
5594 for (i
= 0; i
< MAX_OPERANDS
; i
++)
5595 if (op_index
[i
] != -1 && op_riprel
[i
])
5597 (*info
->fprintf_func
) (info
->stream
, " # ");
5598 (*info
->print_address_func
) ((bfd_vma
) (start_pc
+ codep
- start_codep
5599 + op_address
[op_index
[i
]]), info
);
5602 return codep
- priv
.the_buffer
;
5605 static const char *float_mem
[] = {
5680 static const unsigned char float_mem_mode
[] = {
5755 #define ST { OP_ST, 0 }
5756 #define STi { OP_STi, 0 }
5758 #define FGRPd9_2 NULL, { { NULL, 0 } }
5759 #define FGRPd9_4 NULL, { { NULL, 1 } }
5760 #define FGRPd9_5 NULL, { { NULL, 2 } }
5761 #define FGRPd9_6 NULL, { { NULL, 3 } }
5762 #define FGRPd9_7 NULL, { { NULL, 4 } }
5763 #define FGRPda_5 NULL, { { NULL, 5 } }
5764 #define FGRPdb_4 NULL, { { NULL, 6 } }
5765 #define FGRPde_3 NULL, { { NULL, 7 } }
5766 #define FGRPdf_4 NULL, { { NULL, 8 } }
5768 static const struct dis386 float_reg
[][8] = {
5771 { "fadd", { ST
, STi
} },
5772 { "fmul", { ST
, STi
} },
5773 { "fcom", { STi
} },
5774 { "fcomp", { STi
} },
5775 { "fsub", { ST
, STi
} },
5776 { "fsubr", { ST
, STi
} },
5777 { "fdiv", { ST
, STi
} },
5778 { "fdivr", { ST
, STi
} },
5783 { "fxch", { STi
} },
5785 { "(bad)", { XX
} },
5793 { "fcmovb", { ST
, STi
} },
5794 { "fcmove", { ST
, STi
} },
5795 { "fcmovbe",{ ST
, STi
} },
5796 { "fcmovu", { ST
, STi
} },
5797 { "(bad)", { XX
} },
5799 { "(bad)", { XX
} },
5800 { "(bad)", { XX
} },
5804 { "fcmovnb",{ ST
, STi
} },
5805 { "fcmovne",{ ST
, STi
} },
5806 { "fcmovnbe",{ ST
, STi
} },
5807 { "fcmovnu",{ ST
, STi
} },
5809 { "fucomi", { ST
, STi
} },
5810 { "fcomi", { ST
, STi
} },
5811 { "(bad)", { XX
} },
5815 { "fadd", { STi
, ST
} },
5816 { "fmul", { STi
, ST
} },
5817 { "(bad)", { XX
} },
5818 { "(bad)", { XX
} },
5819 { "fsub!M", { STi
, ST
} },
5820 { "fsubM", { STi
, ST
} },
5821 { "fdiv!M", { STi
, ST
} },
5822 { "fdivM", { STi
, ST
} },
5826 { "ffree", { STi
} },
5827 { "(bad)", { XX
} },
5829 { "fstp", { STi
} },
5830 { "fucom", { STi
} },
5831 { "fucomp", { STi
} },
5832 { "(bad)", { XX
} },
5833 { "(bad)", { XX
} },
5837 { "faddp", { STi
, ST
} },
5838 { "fmulp", { STi
, ST
} },
5839 { "(bad)", { XX
} },
5841 { "fsub!Mp", { STi
, ST
} },
5842 { "fsubMp", { STi
, ST
} },
5843 { "fdiv!Mp", { STi
, ST
} },
5844 { "fdivMp", { STi
, ST
} },
5848 { "ffreep", { STi
} },
5849 { "(bad)", { XX
} },
5850 { "(bad)", { XX
} },
5851 { "(bad)", { XX
} },
5853 { "fucomip", { ST
, STi
} },
5854 { "fcomip", { ST
, STi
} },
5855 { "(bad)", { XX
} },
5859 static char *fgrps
[][8] = {
5862 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5867 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
5872 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
5877 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
5882 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
5887 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5892 "feni(287 only)","fdisi(287 only)","fNclex","fNinit",
5893 "fNsetpm(287 only)","(bad)","(bad)","(bad)",
5898 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5903 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5908 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED
,
5909 int sizeflag ATTRIBUTE_UNUSED
)
5911 /* Skip mod/rm byte. */
5917 dofloat (int sizeflag
)
5919 const struct dis386
*dp
;
5920 unsigned char floatop
;
5922 floatop
= codep
[-1];
5926 int fp_indx
= (floatop
- 0xd8) * 8 + modrm
.reg
;
5928 putop (float_mem
[fp_indx
], sizeflag
);
5931 OP_E (float_mem_mode
[fp_indx
], sizeflag
);
5934 /* Skip mod/rm byte. */
5938 dp
= &float_reg
[floatop
- 0xd8][modrm
.reg
];
5939 if (dp
->name
== NULL
)
5941 putop (fgrps
[dp
->op
[0].bytemode
][modrm
.rm
], sizeflag
);
5943 /* Instruction fnstsw is only one with strange arg. */
5944 if (floatop
== 0xdf && codep
[-1] == 0xe0)
5945 strcpy (op_out
[0], names16
[0]);
5949 putop (dp
->name
, sizeflag
);
5954 (*dp
->op
[0].rtn
) (dp
->op
[0].bytemode
, sizeflag
);
5959 (*dp
->op
[1].rtn
) (dp
->op
[1].bytemode
, sizeflag
);
5964 OP_ST (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
5966 oappend ("%st" + intel_syntax
);
5970 OP_STi (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
5972 sprintf (scratchbuf
, "%%st(%d)", modrm
.rm
);
5973 oappend (scratchbuf
+ intel_syntax
);
5976 /* Capital letters in template are macros. */
5978 putop (const char *template, int sizeflag
)
5983 unsigned int l
= 0, len
= 1;
5986 #define SAVE_LAST(c) \
5987 if (l < len && l < sizeof (last)) \
5992 for (p
= template; *p
; p
++)
6010 if (*p
== '}' || *p
== '\0')
6029 if (modrm
.mod
!= 3 || (sizeflag
& SUFFIX_ALWAYS
))
6035 if (sizeflag
& SUFFIX_ALWAYS
)
6039 if (intel_syntax
&& !alt
)
6041 if ((prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
6043 if (sizeflag
& DFLAG
)
6044 *obufp
++ = intel_syntax
? 'd' : 'l';
6046 *obufp
++ = intel_syntax
? 'w' : 's';
6047 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6051 if (intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
6058 else if (sizeflag
& DFLAG
)
6059 *obufp
++ = intel_syntax
? 'd' : 'l';
6062 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6067 case 'E': /* For jcxz/jecxz */
6068 if (address_mode
== mode_64bit
)
6070 if (sizeflag
& AFLAG
)
6076 if (sizeflag
& AFLAG
)
6078 used_prefixes
|= (prefixes
& PREFIX_ADDR
);
6083 if ((prefixes
& PREFIX_ADDR
) || (sizeflag
& SUFFIX_ALWAYS
))
6085 if (sizeflag
& AFLAG
)
6086 *obufp
++ = address_mode
== mode_64bit
? 'q' : 'l';
6088 *obufp
++ = address_mode
== mode_64bit
? 'l' : 'w';
6089 used_prefixes
|= (prefixes
& PREFIX_ADDR
);
6093 if (intel_syntax
|| (obufp
[-1] != 's' && !(sizeflag
& SUFFIX_ALWAYS
)))
6095 if ((rex
& REX_W
) || (sizeflag
& DFLAG
))
6100 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6105 if ((prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_CS
6106 || (prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_DS
)
6108 used_prefixes
|= prefixes
& (PREFIX_CS
| PREFIX_DS
);
6111 if (prefixes
& PREFIX_DS
)
6132 if (address_mode
== mode_64bit
&& (sizeflag
& SUFFIX_ALWAYS
))
6140 if (l
!= 0 || len
!= 1)
6148 if (sizeflag
& SUFFIX_ALWAYS
)
6152 if (intel_mnemonic
!= cond
)
6156 if ((prefixes
& PREFIX_FWAIT
) == 0)
6159 used_prefixes
|= PREFIX_FWAIT
;
6165 else if (intel_syntax
&& (sizeflag
& DFLAG
))
6170 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6175 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6184 if ((prefixes
& PREFIX_DATA
)
6186 || (sizeflag
& SUFFIX_ALWAYS
))
6193 if (sizeflag
& DFLAG
)
6198 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6204 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6206 if (modrm
.mod
!= 3 || (sizeflag
& SUFFIX_ALWAYS
))
6213 if (l
== 0 && len
== 1)
6216 if (intel_syntax
&& !alt
)
6219 if (modrm
.mod
!= 3 || (sizeflag
& SUFFIX_ALWAYS
))
6225 if (sizeflag
& DFLAG
)
6226 *obufp
++ = intel_syntax
? 'd' : 'l';
6230 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6235 if (l
!= 1 || len
!= 2 || last
[0] != 'L')
6241 || (modrm
.mod
== 3 && !(sizeflag
& SUFFIX_ALWAYS
)))
6256 else if (sizeflag
& DFLAG
)
6265 if (intel_syntax
&& !p
[1]
6266 && ((rex
& REX_W
) || (sizeflag
& DFLAG
)))
6269 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6274 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6276 if (sizeflag
& SUFFIX_ALWAYS
)
6284 if (sizeflag
& SUFFIX_ALWAYS
)
6290 if (sizeflag
& DFLAG
)
6294 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6299 if (prefixes
& PREFIX_DATA
)
6303 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6306 if (intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
6314 /* implicit operand size 'l' for i386 or 'q' for x86-64 */
6316 /* operand size flag for cwtl, cbtw */
6325 else if (sizeflag
& DFLAG
)
6330 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6340 oappend (const char *s
)
6343 obufp
+= strlen (s
);
6349 if (prefixes
& PREFIX_CS
)
6351 used_prefixes
|= PREFIX_CS
;
6352 oappend ("%cs:" + intel_syntax
);
6354 if (prefixes
& PREFIX_DS
)
6356 used_prefixes
|= PREFIX_DS
;
6357 oappend ("%ds:" + intel_syntax
);
6359 if (prefixes
& PREFIX_SS
)
6361 used_prefixes
|= PREFIX_SS
;
6362 oappend ("%ss:" + intel_syntax
);
6364 if (prefixes
& PREFIX_ES
)
6366 used_prefixes
|= PREFIX_ES
;
6367 oappend ("%es:" + intel_syntax
);
6369 if (prefixes
& PREFIX_FS
)
6371 used_prefixes
|= PREFIX_FS
;
6372 oappend ("%fs:" + intel_syntax
);
6374 if (prefixes
& PREFIX_GS
)
6376 used_prefixes
|= PREFIX_GS
;
6377 oappend ("%gs:" + intel_syntax
);
6382 OP_indirE (int bytemode
, int sizeflag
)
6386 OP_E (bytemode
, sizeflag
);
6390 print_operand_value (char *buf
, int hex
, bfd_vma disp
)
6392 if (address_mode
== mode_64bit
)
6400 sprintf_vma (tmp
, disp
);
6401 for (i
= 0; tmp
[i
] == '0' && tmp
[i
+ 1]; i
++);
6402 strcpy (buf
+ 2, tmp
+ i
);
6406 bfd_signed_vma v
= disp
;
6413 /* Check for possible overflow on 0x8000000000000000. */
6416 strcpy (buf
, "9223372036854775808");
6430 tmp
[28 - i
] = (v
% 10) + '0';
6434 strcpy (buf
, tmp
+ 29 - i
);
6440 sprintf (buf
, "0x%x", (unsigned int) disp
);
6442 sprintf (buf
, "%d", (int) disp
);
6446 /* Put DISP in BUF as signed hex number. */
6449 print_displacement (char *buf
, bfd_vma disp
)
6451 bfd_signed_vma val
= disp
;
6460 /* Check for possible overflow. */
6463 switch (address_mode
)
6466 strcpy (buf
+ j
, "0x8000000000000000");
6469 strcpy (buf
+ j
, "0x80000000");
6472 strcpy (buf
+ j
, "0x8000");
6482 sprintf_vma (tmp
, val
);
6483 for (i
= 0; tmp
[i
] == '0'; i
++)
6487 strcpy (buf
+ j
, tmp
+ i
);
6491 intel_operand_size (int bytemode
, int sizeflag
)
6497 oappend ("BYTE PTR ");
6501 oappend ("WORD PTR ");
6504 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6506 oappend ("QWORD PTR ");
6507 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6515 oappend ("QWORD PTR ");
6516 else if ((sizeflag
& DFLAG
) || bytemode
== dq_mode
)
6517 oappend ("DWORD PTR ");
6519 oappend ("WORD PTR ");
6520 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6523 if ((rex
& REX_W
) || (sizeflag
& DFLAG
))
6525 oappend ("WORD PTR ");
6527 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6531 oappend ("DWORD PTR ");
6534 oappend ("QWORD PTR ");
6537 if (address_mode
== mode_64bit
)
6538 oappend ("QWORD PTR ");
6540 oappend ("DWORD PTR ");
6543 if (sizeflag
& DFLAG
)
6544 oappend ("FWORD PTR ");
6546 oappend ("DWORD PTR ");
6547 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6550 oappend ("TBYTE PTR ");
6553 oappend ("XMMWORD PTR ");
6556 oappend ("OWORD PTR ");
6564 OP_E_extended (int bytemode
, int sizeflag
, int has_drex
)
6573 /* Skip mod/rm byte. */
6584 oappend (names8rex
[modrm
.rm
+ add
]);
6586 oappend (names8
[modrm
.rm
+ add
]);
6589 oappend (names16
[modrm
.rm
+ add
]);
6592 oappend (names32
[modrm
.rm
+ add
]);
6595 oappend (names64
[modrm
.rm
+ add
]);
6598 if (address_mode
== mode_64bit
)
6599 oappend (names64
[modrm
.rm
+ add
]);
6601 oappend (names32
[modrm
.rm
+ add
]);
6604 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6606 oappend (names64
[modrm
.rm
+ add
]);
6607 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6619 oappend (names64
[modrm
.rm
+ add
]);
6620 else if ((sizeflag
& DFLAG
) || bytemode
!= v_mode
)
6621 oappend (names32
[modrm
.rm
+ add
]);
6623 oappend (names16
[modrm
.rm
+ add
]);
6624 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6629 oappend (INTERNAL_DISASSEMBLER_ERROR
);
6637 intel_operand_size (bytemode
, sizeflag
);
6640 if ((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
6642 /* 32/64 bit address mode */
6660 FETCH_DATA (the_info
, codep
+ 1);
6661 index
= (*codep
>> 3) & 7;
6662 scale
= (*codep
>> 6) & 3;
6667 haveindex
= index
!= 4;
6672 /* If we have a DREX byte, skip it now
6673 (it has already been handled) */
6676 FETCH_DATA (the_info
, codep
+ 1);
6683 if ((base
& 7) == 5)
6686 if (address_mode
== mode_64bit
&& !havesib
)
6692 FETCH_DATA (the_info
, codep
+ 1);
6694 if ((disp
& 0x80) != 0)
6702 /* In 32bit mode, we need index register to tell [offset] from
6703 [eiz*1 + offset]. */
6704 needindex
= (havesib
6707 && address_mode
== mode_32bit
);
6708 havedisp
= (havebase
6710 || (havesib
&& (haveindex
|| scale
!= 0)));
6713 if (modrm
.mod
!= 0 || (base
& 7) == 5)
6715 if (havedisp
|| riprel
)
6716 print_displacement (scratchbuf
, disp
);
6718 print_operand_value (scratchbuf
, 1, disp
);
6719 oappend (scratchbuf
);
6723 oappend (sizeflag
& AFLAG
? "(%rip)" : "(%eip)");
6727 if (havebase
|| haveindex
|| riprel
)
6728 used_prefixes
|= PREFIX_ADDR
;
6730 if (havedisp
|| (intel_syntax
&& riprel
))
6732 *obufp
++ = open_char
;
6733 if (intel_syntax
&& riprel
)
6736 oappend (sizeflag
& AFLAG
? "rip" : "eip");
6740 oappend (address_mode
== mode_64bit
&& (sizeflag
& AFLAG
)
6741 ? names64
[base
] : names32
[base
]);
6744 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
6745 print index to tell base + index from base. */
6749 || (havebase
&& base
!= ESP_REG_NUM
))
6751 if (!intel_syntax
|| havebase
)
6753 *obufp
++ = separator_char
;
6757 oappend (address_mode
== mode_64bit
6758 && (sizeflag
& AFLAG
)
6759 ? names64
[index
] : names32
[index
]);
6761 oappend (address_mode
== mode_64bit
6762 && (sizeflag
& AFLAG
)
6763 ? index64
: index32
);
6765 *obufp
++ = scale_char
;
6767 sprintf (scratchbuf
, "%d", 1 << scale
);
6768 oappend (scratchbuf
);
6772 && (disp
|| modrm
.mod
!= 0 || (base
& 7) == 5))
6774 if (!havedisp
|| (bfd_signed_vma
) disp
>= 0)
6779 else if (modrm
.mod
!= 1)
6783 disp
= - (bfd_signed_vma
) disp
;
6787 print_displacement (scratchbuf
, disp
);
6789 print_operand_value (scratchbuf
, 1, disp
);
6790 oappend (scratchbuf
);
6793 *obufp
++ = close_char
;
6796 else if (intel_syntax
)
6798 if (modrm
.mod
!= 0 || (base
& 7) == 5)
6800 if (prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
6801 | PREFIX_ES
| PREFIX_FS
| PREFIX_GS
))
6805 oappend (names_seg
[ds_reg
- es_reg
]);
6808 print_operand_value (scratchbuf
, 1, disp
);
6809 oappend (scratchbuf
);
6814 { /* 16 bit address mode */
6821 if ((disp
& 0x8000) != 0)
6826 FETCH_DATA (the_info
, codep
+ 1);
6828 if ((disp
& 0x80) != 0)
6833 if ((disp
& 0x8000) != 0)
6839 if (modrm
.mod
!= 0 || modrm
.rm
== 6)
6841 print_displacement (scratchbuf
, disp
);
6842 oappend (scratchbuf
);
6845 if (modrm
.mod
!= 0 || modrm
.rm
!= 6)
6847 *obufp
++ = open_char
;
6849 oappend (index16
[modrm
.rm
]);
6851 && (disp
|| modrm
.mod
!= 0 || modrm
.rm
== 6))
6853 if ((bfd_signed_vma
) disp
>= 0)
6858 else if (modrm
.mod
!= 1)
6862 disp
= - (bfd_signed_vma
) disp
;
6865 print_displacement (scratchbuf
, disp
);
6866 oappend (scratchbuf
);
6869 *obufp
++ = close_char
;
6872 else if (intel_syntax
)
6874 if (prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
6875 | PREFIX_ES
| PREFIX_FS
| PREFIX_GS
))
6879 oappend (names_seg
[ds_reg
- es_reg
]);
6882 print_operand_value (scratchbuf
, 1, disp
& 0xffff);
6883 oappend (scratchbuf
);
6889 OP_E (int bytemode
, int sizeflag
)
6891 OP_E_extended (bytemode
, sizeflag
, 0);
6896 OP_G (int bytemode
, int sizeflag
)
6907 oappend (names8rex
[modrm
.reg
+ add
]);
6909 oappend (names8
[modrm
.reg
+ add
]);
6912 oappend (names16
[modrm
.reg
+ add
]);
6915 oappend (names32
[modrm
.reg
+ add
]);
6918 oappend (names64
[modrm
.reg
+ add
]);
6927 oappend (names64
[modrm
.reg
+ add
]);
6928 else if ((sizeflag
& DFLAG
) || bytemode
!= v_mode
)
6929 oappend (names32
[modrm
.reg
+ add
]);
6931 oappend (names16
[modrm
.reg
+ add
]);
6932 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6935 if (address_mode
== mode_64bit
)
6936 oappend (names64
[modrm
.reg
+ add
]);
6938 oappend (names32
[modrm
.reg
+ add
]);
6941 oappend (INTERNAL_DISASSEMBLER_ERROR
);
6954 FETCH_DATA (the_info
, codep
+ 8);
6955 a
= *codep
++ & 0xff;
6956 a
|= (*codep
++ & 0xff) << 8;
6957 a
|= (*codep
++ & 0xff) << 16;
6958 a
|= (*codep
++ & 0xff) << 24;
6959 b
= *codep
++ & 0xff;
6960 b
|= (*codep
++ & 0xff) << 8;
6961 b
|= (*codep
++ & 0xff) << 16;
6962 b
|= (*codep
++ & 0xff) << 24;
6963 x
= a
+ ((bfd_vma
) b
<< 32);
6971 static bfd_signed_vma
6974 bfd_signed_vma x
= 0;
6976 FETCH_DATA (the_info
, codep
+ 4);
6977 x
= *codep
++ & (bfd_signed_vma
) 0xff;
6978 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 8;
6979 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 16;
6980 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 24;
6984 static bfd_signed_vma
6987 bfd_signed_vma x
= 0;
6989 FETCH_DATA (the_info
, codep
+ 4);
6990 x
= *codep
++ & (bfd_signed_vma
) 0xff;
6991 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 8;
6992 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 16;
6993 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 24;
6995 x
= (x
^ ((bfd_signed_vma
) 1 << 31)) - ((bfd_signed_vma
) 1 << 31);
7005 FETCH_DATA (the_info
, codep
+ 2);
7006 x
= *codep
++ & 0xff;
7007 x
|= (*codep
++ & 0xff) << 8;
7012 set_op (bfd_vma op
, int riprel
)
7014 op_index
[op_ad
] = op_ad
;
7015 if (address_mode
== mode_64bit
)
7017 op_address
[op_ad
] = op
;
7018 op_riprel
[op_ad
] = riprel
;
7022 /* Mask to get a 32-bit address. */
7023 op_address
[op_ad
] = op
& 0xffffffff;
7024 op_riprel
[op_ad
] = riprel
& 0xffffffff;
7029 OP_REG (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
+ add
];
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
+ add
];
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
+ add
];
7055 s
= names8
[code
- al_reg
];
7057 case rAX_reg
: case rCX_reg
: case rDX_reg
: case rBX_reg
:
7058 case rSP_reg
: case rBP_reg
: case rSI_reg
: case rDI_reg
:
7059 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
7061 s
= names64
[code
- rAX_reg
+ add
];
7064 code
+= eAX_reg
- rAX_reg
;
7066 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
7067 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
7070 s
= names64
[code
- eAX_reg
+ add
];
7071 else if (sizeflag
& DFLAG
)
7072 s
= names32
[code
- eAX_reg
+ add
];
7074 s
= names16
[code
- eAX_reg
+ add
];
7075 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7078 s
= INTERNAL_DISASSEMBLER_ERROR
;
7085 OP_IMREG (int code
, int sizeflag
)
7097 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
7098 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
7099 s
= names16
[code
- ax_reg
];
7101 case es_reg
: case ss_reg
: case cs_reg
:
7102 case ds_reg
: case fs_reg
: case gs_reg
:
7103 s
= names_seg
[code
- es_reg
];
7105 case al_reg
: case ah_reg
: case cl_reg
: case ch_reg
:
7106 case dl_reg
: case dh_reg
: case bl_reg
: case bh_reg
:
7109 s
= names8rex
[code
- al_reg
];
7111 s
= names8
[code
- al_reg
];
7113 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
7114 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
7117 s
= names64
[code
- eAX_reg
];
7118 else if (sizeflag
& DFLAG
)
7119 s
= names32
[code
- eAX_reg
];
7121 s
= names16
[code
- eAX_reg
];
7122 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7125 if ((rex
& REX_W
) || (sizeflag
& DFLAG
))
7130 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7133 s
= INTERNAL_DISASSEMBLER_ERROR
;
7140 OP_I (int bytemode
, int sizeflag
)
7143 bfd_signed_vma mask
= -1;
7148 FETCH_DATA (the_info
, codep
+ 1);
7153 if (address_mode
== mode_64bit
)
7163 else if (sizeflag
& DFLAG
)
7173 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7184 oappend (INTERNAL_DISASSEMBLER_ERROR
);
7189 scratchbuf
[0] = '$';
7190 print_operand_value (scratchbuf
+ 1, 1, op
);
7191 oappend (scratchbuf
+ intel_syntax
);
7192 scratchbuf
[0] = '\0';
7196 OP_I64 (int bytemode
, int sizeflag
)
7199 bfd_signed_vma mask
= -1;
7201 if (address_mode
!= mode_64bit
)
7203 OP_I (bytemode
, sizeflag
);
7210 FETCH_DATA (the_info
, codep
+ 1);
7218 else if (sizeflag
& DFLAG
)
7228 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7235 oappend (INTERNAL_DISASSEMBLER_ERROR
);
7240 scratchbuf
[0] = '$';
7241 print_operand_value (scratchbuf
+ 1, 1, op
);
7242 oappend (scratchbuf
+ intel_syntax
);
7243 scratchbuf
[0] = '\0';
7247 OP_sI (int bytemode
, int sizeflag
)
7250 bfd_signed_vma mask
= -1;
7255 FETCH_DATA (the_info
, codep
+ 1);
7257 if ((op
& 0x80) != 0)
7265 else if (sizeflag
& DFLAG
)
7274 if ((op
& 0x8000) != 0)
7277 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7282 if ((op
& 0x8000) != 0)
7286 oappend (INTERNAL_DISASSEMBLER_ERROR
);
7290 scratchbuf
[0] = '$';
7291 print_operand_value (scratchbuf
+ 1, 1, op
);
7292 oappend (scratchbuf
+ intel_syntax
);
7296 OP_J (int bytemode
, int sizeflag
)
7300 bfd_vma segment
= 0;
7305 FETCH_DATA (the_info
, codep
+ 1);
7307 if ((disp
& 0x80) != 0)
7311 if ((sizeflag
& DFLAG
) || (rex
& REX_W
))
7316 if ((disp
& 0x8000) != 0)
7318 /* In 16bit mode, address is wrapped around at 64k within
7319 the same segment. Otherwise, a data16 prefix on a jump
7320 instruction means that the pc is masked to 16 bits after
7321 the displacement is added! */
7323 if ((prefixes
& PREFIX_DATA
) == 0)
7324 segment
= ((start_pc
+ codep
- start_codep
)
7325 & ~((bfd_vma
) 0xffff));
7327 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7330 oappend (INTERNAL_DISASSEMBLER_ERROR
);
7333 disp
= ((start_pc
+ codep
- start_codep
+ disp
) & mask
) | segment
;
7335 print_operand_value (scratchbuf
, 1, disp
);
7336 oappend (scratchbuf
);
7340 OP_SEG (int bytemode
, int sizeflag
)
7342 if (bytemode
== w_mode
)
7343 oappend (names_seg
[modrm
.reg
]);
7345 OP_E (modrm
.mod
== 3 ? bytemode
: w_mode
, sizeflag
);
7349 OP_DIR (int dummy ATTRIBUTE_UNUSED
, int sizeflag
)
7353 if (sizeflag
& DFLAG
)
7363 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7365 sprintf (scratchbuf
, "0x%x:0x%x", seg
, offset
);
7367 sprintf (scratchbuf
, "$0x%x,$0x%x", seg
, offset
);
7368 oappend (scratchbuf
);
7372 OP_OFF (int bytemode
, int sizeflag
)
7376 if (intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
7377 intel_operand_size (bytemode
, sizeflag
);
7380 if ((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
7387 if (!(prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
7388 | PREFIX_ES
| PREFIX_FS
| PREFIX_GS
)))
7390 oappend (names_seg
[ds_reg
- es_reg
]);
7394 print_operand_value (scratchbuf
, 1, off
);
7395 oappend (scratchbuf
);
7399 OP_OFF64 (int bytemode
, int sizeflag
)
7403 if (address_mode
!= mode_64bit
7404 || (prefixes
& PREFIX_ADDR
))
7406 OP_OFF (bytemode
, sizeflag
);
7410 if (intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
7411 intel_operand_size (bytemode
, sizeflag
);
7418 if (!(prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
7419 | PREFIX_ES
| PREFIX_FS
| PREFIX_GS
)))
7421 oappend (names_seg
[ds_reg
- es_reg
]);
7425 print_operand_value (scratchbuf
, 1, off
);
7426 oappend (scratchbuf
);
7430 ptr_reg (int code
, int sizeflag
)
7434 *obufp
++ = open_char
;
7435 used_prefixes
|= (prefixes
& PREFIX_ADDR
);
7436 if (address_mode
== mode_64bit
)
7438 if (!(sizeflag
& AFLAG
))
7439 s
= names32
[code
- eAX_reg
];
7441 s
= names64
[code
- eAX_reg
];
7443 else if (sizeflag
& AFLAG
)
7444 s
= names32
[code
- eAX_reg
];
7446 s
= names16
[code
- eAX_reg
];
7448 *obufp
++ = close_char
;
7453 OP_ESreg (int code
, int sizeflag
)
7459 case 0x6d: /* insw/insl */
7460 intel_operand_size (z_mode
, sizeflag
);
7462 case 0xa5: /* movsw/movsl/movsq */
7463 case 0xa7: /* cmpsw/cmpsl/cmpsq */
7464 case 0xab: /* stosw/stosl */
7465 case 0xaf: /* scasw/scasl */
7466 intel_operand_size (v_mode
, sizeflag
);
7469 intel_operand_size (b_mode
, sizeflag
);
7472 oappend ("%es:" + intel_syntax
);
7473 ptr_reg (code
, sizeflag
);
7477 OP_DSreg (int code
, int sizeflag
)
7483 case 0x6f: /* outsw/outsl */
7484 intel_operand_size (z_mode
, sizeflag
);
7486 case 0xa5: /* movsw/movsl/movsq */
7487 case 0xa7: /* cmpsw/cmpsl/cmpsq */
7488 case 0xad: /* lodsw/lodsl/lodsq */
7489 intel_operand_size (v_mode
, sizeflag
);
7492 intel_operand_size (b_mode
, sizeflag
);
7502 prefixes
|= PREFIX_DS
;
7504 ptr_reg (code
, sizeflag
);
7508 OP_C (int dummy ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7516 else if (address_mode
!= mode_64bit
&& (prefixes
& PREFIX_LOCK
))
7519 used_prefixes
|= PREFIX_LOCK
;
7524 sprintf (scratchbuf
, "%%cr%d", modrm
.reg
+ add
);
7525 oappend (scratchbuf
+ intel_syntax
);
7529 OP_D (int dummy ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7538 sprintf (scratchbuf
, "db%d", modrm
.reg
+ add
);
7540 sprintf (scratchbuf
, "%%db%d", modrm
.reg
+ add
);
7541 oappend (scratchbuf
);
7545 OP_T (int dummy ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7547 sprintf (scratchbuf
, "%%tr%d", modrm
.reg
);
7548 oappend (scratchbuf
+ intel_syntax
);
7552 OP_R (int bytemode
, int sizeflag
)
7555 OP_E (bytemode
, sizeflag
);
7561 OP_MMX (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7563 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7564 if (prefixes
& PREFIX_DATA
)
7572 sprintf (scratchbuf
, "%%xmm%d", modrm
.reg
+ add
);
7575 sprintf (scratchbuf
, "%%mm%d", modrm
.reg
);
7576 oappend (scratchbuf
+ intel_syntax
);
7580 OP_XMM (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7588 sprintf (scratchbuf
, "%%xmm%d", modrm
.reg
+ add
);
7589 oappend (scratchbuf
+ intel_syntax
);
7593 OP_EM (int bytemode
, int sizeflag
)
7597 if (intel_syntax
&& bytemode
== v_mode
)
7599 bytemode
= (prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
7600 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7602 OP_E (bytemode
, sizeflag
);
7606 /* Skip mod/rm byte. */
7609 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7610 if (prefixes
& PREFIX_DATA
)
7619 sprintf (scratchbuf
, "%%xmm%d", modrm
.rm
+ add
);
7622 sprintf (scratchbuf
, "%%mm%d", modrm
.rm
);
7623 oappend (scratchbuf
+ intel_syntax
);
7626 /* cvt* are the only instructions in sse2 which have
7627 both SSE and MMX operands and also have 0x66 prefix
7628 in their opcode. 0x66 was originally used to differentiate
7629 between SSE and MMX instruction(operands). So we have to handle the
7630 cvt* separately using OP_EMC and OP_MXC */
7632 OP_EMC (int bytemode
, int sizeflag
)
7636 if (intel_syntax
&& bytemode
== v_mode
)
7638 bytemode
= (prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
7639 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7641 OP_E (bytemode
, sizeflag
);
7645 /* Skip mod/rm byte. */
7648 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7649 sprintf (scratchbuf
, "%%mm%d", modrm
.rm
);
7650 oappend (scratchbuf
+ intel_syntax
);
7654 OP_MXC (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7656 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7657 sprintf (scratchbuf
, "%%mm%d", modrm
.reg
);
7658 oappend (scratchbuf
+ intel_syntax
);
7662 OP_EX (int bytemode
, int sizeflag
)
7667 OP_E (bytemode
, sizeflag
);
7676 /* Skip mod/rm byte. */
7679 sprintf (scratchbuf
, "%%xmm%d", modrm
.rm
+ add
);
7680 oappend (scratchbuf
+ intel_syntax
);
7684 OP_MS (int bytemode
, int sizeflag
)
7687 OP_EM (bytemode
, sizeflag
);
7693 OP_XS (int bytemode
, int sizeflag
)
7696 OP_EX (bytemode
, sizeflag
);
7702 OP_M (int bytemode
, int sizeflag
)
7705 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
7708 OP_E (bytemode
, sizeflag
);
7712 OP_0f07 (int bytemode
, int sizeflag
)
7714 if (modrm
.mod
!= 3 || modrm
.rm
!= 0)
7717 OP_E (bytemode
, sizeflag
);
7720 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
7721 32bit mode and "xchg %rax,%rax" in 64bit mode. */
7724 NOP_Fixup1 (int bytemode
, int sizeflag
)
7726 if ((prefixes
& PREFIX_DATA
) != 0
7729 && address_mode
== mode_64bit
))
7730 OP_REG (bytemode
, sizeflag
);
7732 strcpy (obuf
, "nop");
7736 NOP_Fixup2 (int bytemode
, int sizeflag
)
7738 if ((prefixes
& PREFIX_DATA
) != 0
7741 && address_mode
== mode_64bit
))
7742 OP_IMREG (bytemode
, sizeflag
);
7745 static const char *const Suffix3DNow
[] = {
7746 /* 00 */ NULL
, NULL
, NULL
, NULL
,
7747 /* 04 */ NULL
, NULL
, NULL
, NULL
,
7748 /* 08 */ NULL
, NULL
, NULL
, NULL
,
7749 /* 0C */ "pi2fw", "pi2fd", NULL
, NULL
,
7750 /* 10 */ NULL
, NULL
, NULL
, NULL
,
7751 /* 14 */ NULL
, NULL
, NULL
, NULL
,
7752 /* 18 */ NULL
, NULL
, NULL
, NULL
,
7753 /* 1C */ "pf2iw", "pf2id", NULL
, NULL
,
7754 /* 20 */ NULL
, NULL
, NULL
, NULL
,
7755 /* 24 */ NULL
, NULL
, NULL
, NULL
,
7756 /* 28 */ NULL
, NULL
, NULL
, NULL
,
7757 /* 2C */ NULL
, NULL
, NULL
, NULL
,
7758 /* 30 */ NULL
, NULL
, NULL
, NULL
,
7759 /* 34 */ NULL
, NULL
, NULL
, NULL
,
7760 /* 38 */ NULL
, NULL
, NULL
, NULL
,
7761 /* 3C */ NULL
, NULL
, NULL
, NULL
,
7762 /* 40 */ NULL
, NULL
, NULL
, NULL
,
7763 /* 44 */ NULL
, NULL
, NULL
, NULL
,
7764 /* 48 */ NULL
, NULL
, NULL
, NULL
,
7765 /* 4C */ NULL
, NULL
, NULL
, NULL
,
7766 /* 50 */ NULL
, NULL
, NULL
, NULL
,
7767 /* 54 */ NULL
, NULL
, NULL
, NULL
,
7768 /* 58 */ NULL
, NULL
, NULL
, NULL
,
7769 /* 5C */ NULL
, NULL
, NULL
, NULL
,
7770 /* 60 */ NULL
, NULL
, NULL
, NULL
,
7771 /* 64 */ NULL
, NULL
, NULL
, NULL
,
7772 /* 68 */ NULL
, NULL
, NULL
, NULL
,
7773 /* 6C */ NULL
, NULL
, NULL
, NULL
,
7774 /* 70 */ NULL
, NULL
, NULL
, NULL
,
7775 /* 74 */ NULL
, NULL
, NULL
, NULL
,
7776 /* 78 */ NULL
, NULL
, NULL
, NULL
,
7777 /* 7C */ NULL
, NULL
, NULL
, NULL
,
7778 /* 80 */ NULL
, NULL
, NULL
, NULL
,
7779 /* 84 */ NULL
, NULL
, NULL
, NULL
,
7780 /* 88 */ NULL
, NULL
, "pfnacc", NULL
,
7781 /* 8C */ NULL
, NULL
, "pfpnacc", NULL
,
7782 /* 90 */ "pfcmpge", NULL
, NULL
, NULL
,
7783 /* 94 */ "pfmin", NULL
, "pfrcp", "pfrsqrt",
7784 /* 98 */ NULL
, NULL
, "pfsub", NULL
,
7785 /* 9C */ NULL
, NULL
, "pfadd", NULL
,
7786 /* A0 */ "pfcmpgt", NULL
, NULL
, NULL
,
7787 /* A4 */ "pfmax", NULL
, "pfrcpit1", "pfrsqit1",
7788 /* A8 */ NULL
, NULL
, "pfsubr", NULL
,
7789 /* AC */ NULL
, NULL
, "pfacc", NULL
,
7790 /* B0 */ "pfcmpeq", NULL
, NULL
, NULL
,
7791 /* B4 */ "pfmul", NULL
, "pfrcpit2", "pmulhrw",
7792 /* B8 */ NULL
, NULL
, NULL
, "pswapd",
7793 /* BC */ NULL
, NULL
, NULL
, "pavgusb",
7794 /* C0 */ NULL
, NULL
, NULL
, NULL
,
7795 /* C4 */ NULL
, NULL
, NULL
, NULL
,
7796 /* C8 */ NULL
, NULL
, NULL
, NULL
,
7797 /* CC */ NULL
, NULL
, NULL
, NULL
,
7798 /* D0 */ NULL
, NULL
, NULL
, NULL
,
7799 /* D4 */ NULL
, NULL
, NULL
, NULL
,
7800 /* D8 */ NULL
, NULL
, NULL
, NULL
,
7801 /* DC */ NULL
, NULL
, NULL
, NULL
,
7802 /* E0 */ NULL
, NULL
, NULL
, NULL
,
7803 /* E4 */ NULL
, NULL
, NULL
, NULL
,
7804 /* E8 */ NULL
, NULL
, NULL
, NULL
,
7805 /* EC */ NULL
, NULL
, NULL
, NULL
,
7806 /* F0 */ NULL
, NULL
, NULL
, NULL
,
7807 /* F4 */ NULL
, NULL
, NULL
, NULL
,
7808 /* F8 */ NULL
, NULL
, NULL
, NULL
,
7809 /* FC */ NULL
, NULL
, NULL
, NULL
,
7813 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7815 const char *mnemonic
;
7817 FETCH_DATA (the_info
, codep
+ 1);
7818 /* AMD 3DNow! instructions are specified by an opcode suffix in the
7819 place where an 8-bit immediate would normally go. ie. the last
7820 byte of the instruction. */
7821 obufp
= obuf
+ strlen (obuf
);
7822 mnemonic
= Suffix3DNow
[*codep
++ & 0xff];
7827 /* Since a variable sized modrm/sib chunk is between the start
7828 of the opcode (0x0f0f) and the opcode suffix, we need to do
7829 all the modrm processing first, and don't know until now that
7830 we have a bad opcode. This necessitates some cleaning up. */
7831 op_out
[0][0] = '\0';
7832 op_out
[1][0] = '\0';
7837 static const char *simd_cmp_op
[] = {
7849 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7851 unsigned int cmp_type
;
7853 FETCH_DATA (the_info
, codep
+ 1);
7854 cmp_type
= *codep
++ & 0xff;
7858 char *p
= obuf
+ strlen (obuf
) - 2;
7862 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
], suffix
);
7866 /* We have a reserved extension byte. Output it directly. */
7867 scratchbuf
[0] = '$';
7868 print_operand_value (scratchbuf
+ 1, 1, cmp_type
);
7869 oappend (scratchbuf
+ intel_syntax
);
7870 scratchbuf
[0] = '\0';
7875 OP_Mwait (int bytemode ATTRIBUTE_UNUSED
,
7876 int sizeflag ATTRIBUTE_UNUSED
)
7878 /* mwait %eax,%ecx */
7881 const char **names
= (address_mode
== mode_64bit
7882 ? names64
: names32
);
7883 strcpy (op_out
[0], names
[0]);
7884 strcpy (op_out
[1], names
[1]);
7887 /* Skip mod/rm byte. */
7893 OP_Monitor (int bytemode ATTRIBUTE_UNUSED
,
7894 int sizeflag ATTRIBUTE_UNUSED
)
7896 /* monitor %eax,%ecx,%edx" */
7899 const char **op1_names
;
7900 const char **names
= (address_mode
== mode_64bit
7901 ? names64
: names32
);
7903 if (!(prefixes
& PREFIX_ADDR
))
7904 op1_names
= (address_mode
== mode_16bit
7908 /* Remove "addr16/addr32". */
7910 op1_names
= (address_mode
!= mode_32bit
7911 ? names32
: names16
);
7912 used_prefixes
|= PREFIX_ADDR
;
7914 strcpy (op_out
[0], op1_names
[0]);
7915 strcpy (op_out
[1], names
[1]);
7916 strcpy (op_out
[2], names
[2]);
7919 /* Skip mod/rm byte. */
7927 /* Throw away prefixes and 1st. opcode byte. */
7928 codep
= insn_codep
+ 1;
7933 REP_Fixup (int bytemode
, int sizeflag
)
7935 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
7937 if (prefixes
& PREFIX_REPZ
)
7938 repz_prefix
= "rep ";
7945 OP_IMREG (bytemode
, sizeflag
);
7948 OP_ESreg (bytemode
, sizeflag
);
7951 OP_DSreg (bytemode
, sizeflag
);
7960 CMPXCHG8B_Fixup (int bytemode
, int sizeflag
)
7965 /* Change cmpxchg8b to cmpxchg16b. */
7966 char *p
= obuf
+ strlen (obuf
) - 2;
7970 OP_M (bytemode
, sizeflag
);
7974 XMM_Fixup (int reg
, int sizeflag ATTRIBUTE_UNUSED
)
7976 sprintf (scratchbuf
, "%%xmm%d", reg
);
7977 oappend (scratchbuf
+ intel_syntax
);
7981 CRC32_Fixup (int bytemode
, int sizeflag
)
7983 /* Add proper suffix to "crc32". */
7984 char *p
= obuf
+ strlen (obuf
);
8001 else if (sizeflag
& DFLAG
)
8005 used_prefixes
|= (prefixes
& PREFIX_DATA
);
8008 oappend (INTERNAL_DISASSEMBLER_ERROR
);
8017 /* Skip mod/rm byte. */
8022 add
= (rex
& REX_B
) ? 8 : 0;
8023 if (bytemode
== b_mode
)
8027 oappend (names8rex
[modrm
.rm
+ add
]);
8029 oappend (names8
[modrm
.rm
+ add
]);
8035 oappend (names64
[modrm
.rm
+ add
]);
8036 else if ((prefixes
& PREFIX_DATA
))
8037 oappend (names16
[modrm
.rm
+ add
]);
8039 oappend (names32
[modrm
.rm
+ add
]);
8043 OP_E (bytemode
, sizeflag
);
8046 /* Print a DREX argument as either a register or memory operation. */
8048 print_drex_arg (unsigned int reg
, int bytemode
, int sizeflag
)
8050 if (reg
== DREX_REG_UNKNOWN
)
8053 else if (reg
!= DREX_REG_MEMORY
)
8055 sprintf (scratchbuf
, "%%xmm%d", reg
);
8056 oappend (scratchbuf
+ intel_syntax
);
8060 OP_E_extended (bytemode
, sizeflag
, 1);
8063 /* SSE5 instructions that have 4 arguments are encoded as:
8064 0f 24 <sub-opcode> <modrm> <optional-sib> <drex> <offset>.
8066 The <sub-opcode> byte has 1 bit (0x4) that is combined with 1 bit in
8067 the DREX field (0x8) to determine how the arguments are laid out.
8068 The destination register must be the same register as one of the
8069 inputs, and it is encoded in the DREX byte. No REX prefix is used
8070 for these instructions, since the DREX field contains the 3 extension
8071 bits provided by the REX prefix.
8073 The bytemode argument adds 2 extra bits for passing extra information:
8074 DREX_OC1 -- Set the OC1 bit to indicate dest == 1st arg
8075 DREX_NO_OC0 -- OC0 in DREX is invalid
8076 (but pretend it is set). */
8079 OP_DREX4 (int flag_bytemode
, int sizeflag
)
8081 unsigned int drex_byte
;
8082 unsigned int regs
[4];
8083 unsigned int modrm_regmem
;
8084 unsigned int modrm_reg
;
8085 unsigned int drex_reg
;
8088 int rex_used_save
= rex_used
;
8090 int oc1
= (flag_bytemode
& DREX_OC1
) ? 2 : 0;
8094 bytemode
= flag_bytemode
& ~ DREX_MASK
;
8096 for (i
= 0; i
< 4; i
++)
8097 regs
[i
] = DREX_REG_UNKNOWN
;
8099 /* Determine if we have a SIB byte in addition to MODRM before the
8101 if (((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
8106 /* Get the DREX byte. */
8107 FETCH_DATA (the_info
, codep
+ 2 + has_sib
);
8108 drex_byte
= codep
[has_sib
+1];
8109 drex_reg
= DREX_XMM (drex_byte
);
8110 modrm_reg
= modrm
.reg
+ ((drex_byte
& REX_R
) ? 8 : 0);
8112 /* Is OC0 legal? If not, hardwire oc0 == 1. */
8113 if (flag_bytemode
& DREX_NO_OC0
)
8116 if (DREX_OC0 (drex_byte
))
8120 oc0
= DREX_OC0 (drex_byte
);
8124 /* regmem == register */
8125 modrm_regmem
= modrm
.rm
+ ((drex_byte
& REX_B
) ? 8 : 0);
8127 /* skip modrm/drex since we don't call OP_E_extended */
8132 /* regmem == memory, fill in appropriate REX bits */
8133 modrm_regmem
= DREX_REG_MEMORY
;
8134 rex
= drex_byte
& (REX_B
| REX_X
| REX_R
);
8140 /* Based on the OC1/OC0 bits, lay out the arguments in the correct
8149 regs
[0] = modrm_regmem
;
8150 regs
[1] = modrm_reg
;
8156 regs
[0] = modrm_reg
;
8157 regs
[1] = modrm_regmem
;
8164 regs
[1] = modrm_regmem
;
8165 regs
[2] = modrm_reg
;
8171 regs
[1] = modrm_reg
;
8172 regs
[2] = modrm_regmem
;
8177 /* Print out the arguments. */
8178 for (i
= 0; i
< 4; i
++)
8180 int j
= (intel_syntax
) ? 3 - i
: i
;
8187 print_drex_arg (regs
[j
], bytemode
, sizeflag
);
8191 rex_used
= rex_used_save
;
8194 /* SSE5 instructions that have 3 arguments, and are encoded as:
8195 0f 24 <sub-opcode> <modrm> <optional-sib> <drex> <offset> (or)
8196 0f 25 <sub-opcode> <modrm> <optional-sib> <drex> <offset> <cmp-byte>
8198 The DREX field has 1 bit (0x8) to determine how the arguments are
8199 laid out. The destination register is encoded in the DREX byte.
8200 No REX prefix is used for these instructions, since the DREX field
8201 contains the 3 extension bits provided by the REX prefix. */
8204 OP_DREX3 (int flag_bytemode
, int sizeflag
)
8206 unsigned int drex_byte
;
8207 unsigned int regs
[3];
8208 unsigned int modrm_regmem
;
8209 unsigned int modrm_reg
;
8210 unsigned int drex_reg
;
8213 int rex_used_save
= rex_used
;
8218 bytemode
= flag_bytemode
& ~ DREX_MASK
;
8220 for (i
= 0; i
< 3; i
++)
8221 regs
[i
] = DREX_REG_UNKNOWN
;
8223 /* Determine if we have a SIB byte in addition to MODRM before the
8225 if (((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
8230 /* Get the DREX byte. */
8231 FETCH_DATA (the_info
, codep
+ 2 + has_sib
);
8232 drex_byte
= codep
[has_sib
+1];
8233 drex_reg
= DREX_XMM (drex_byte
);
8234 modrm_reg
= modrm
.reg
+ ((drex_byte
& REX_R
) ? 8 : 0);
8236 /* Is OC0 legal? If not, hardwire oc0 == 0 */
8237 oc0
= DREX_OC0 (drex_byte
);
8238 if ((flag_bytemode
& DREX_NO_OC0
) && oc0
)
8243 /* regmem == register */
8244 modrm_regmem
= modrm
.rm
+ ((drex_byte
& REX_B
) ? 8 : 0);
8246 /* skip modrm/drex since we don't call OP_E_extended. */
8251 /* regmem == memory, fill in appropriate REX bits. */
8252 modrm_regmem
= DREX_REG_MEMORY
;
8253 rex
= drex_byte
& (REX_B
| REX_X
| REX_R
);
8259 /* Based on the OC1/OC0 bits, lay out the arguments in the correct
8268 regs
[0] = modrm_regmem
;
8269 regs
[1] = modrm_reg
;
8274 regs
[0] = modrm_reg
;
8275 regs
[1] = modrm_regmem
;
8280 /* Print out the arguments. */
8281 for (i
= 0; i
< 3; i
++)
8283 int j
= (intel_syntax
) ? 2 - i
: i
;
8290 print_drex_arg (regs
[j
], bytemode
, sizeflag
);
8294 rex_used
= rex_used_save
;
8297 /* Emit a floating point comparison for comp<xx> instructions. */
8300 OP_DREX_FCMP (int bytemode ATTRIBUTE_UNUSED
,
8301 int sizeflag ATTRIBUTE_UNUSED
)
8305 static const char *const cmp_test
[] = {
8324 FETCH_DATA (the_info
, codep
+ 1);
8325 byte
= *codep
& 0xff;
8327 if (byte
>= ARRAY_SIZE (cmp_test
)
8332 /* The instruction isn't one we know about, so just append the
8333 extension byte as a numeric value. */
8339 sprintf (scratchbuf
, "com%s%s", cmp_test
[byte
], obuf
+3);
8340 strcpy (obuf
, scratchbuf
);
8345 /* Emit an integer point comparison for pcom<xx> instructions,
8346 rewriting the instruction to have the test inside of it. */
8349 OP_DREX_ICMP (int bytemode ATTRIBUTE_UNUSED
,
8350 int sizeflag ATTRIBUTE_UNUSED
)
8354 static const char *const cmp_test
[] = {
8365 FETCH_DATA (the_info
, codep
+ 1);
8366 byte
= *codep
& 0xff;
8368 if (byte
>= ARRAY_SIZE (cmp_test
)
8374 /* The instruction isn't one we know about, so just print the
8375 comparison test byte as a numeric value. */
8381 sprintf (scratchbuf
, "pcom%s%s", cmp_test
[byte
], obuf
+4);
8382 strcpy (obuf
, scratchbuf
);