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, a_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 /* pair of v_mode operands */
382 #define a_mode (m_mode + 1)
383 #define cond_jump_mode (a_mode + 1)
384 #define loop_jcxz_mode (cond_jump_mode + 1)
385 /* operand size depends on REX prefixes. */
386 #define dq_mode (loop_jcxz_mode + 1)
387 /* registers like dq_mode, memory like w_mode. */
388 #define dqw_mode (dq_mode + 1)
389 /* 4- or 6-byte pointer operand */
390 #define f_mode (dqw_mode + 1)
391 #define const_1_mode (f_mode + 1)
392 /* v_mode for stack-related opcodes. */
393 #define stack_v_mode (const_1_mode + 1)
394 /* non-quad operand size depends on prefixes */
395 #define z_mode (stack_v_mode + 1)
396 /* 16-byte operand */
397 #define o_mode (z_mode + 1)
398 /* registers like dq_mode, memory like b_mode. */
399 #define dqb_mode (o_mode + 1)
400 /* registers like dq_mode, memory like d_mode. */
401 #define dqd_mode (dqb_mode + 1)
403 #define es_reg (dqd_mode + 1)
404 #define cs_reg (es_reg + 1)
405 #define ss_reg (cs_reg + 1)
406 #define ds_reg (ss_reg + 1)
407 #define fs_reg (ds_reg + 1)
408 #define gs_reg (fs_reg + 1)
410 #define eAX_reg (gs_reg + 1)
411 #define eCX_reg (eAX_reg + 1)
412 #define eDX_reg (eCX_reg + 1)
413 #define eBX_reg (eDX_reg + 1)
414 #define eSP_reg (eBX_reg + 1)
415 #define eBP_reg (eSP_reg + 1)
416 #define eSI_reg (eBP_reg + 1)
417 #define eDI_reg (eSI_reg + 1)
419 #define al_reg (eDI_reg + 1)
420 #define cl_reg (al_reg + 1)
421 #define dl_reg (cl_reg + 1)
422 #define bl_reg (dl_reg + 1)
423 #define ah_reg (bl_reg + 1)
424 #define ch_reg (ah_reg + 1)
425 #define dh_reg (ch_reg + 1)
426 #define bh_reg (dh_reg + 1)
428 #define ax_reg (bh_reg + 1)
429 #define cx_reg (ax_reg + 1)
430 #define dx_reg (cx_reg + 1)
431 #define bx_reg (dx_reg + 1)
432 #define sp_reg (bx_reg + 1)
433 #define bp_reg (sp_reg + 1)
434 #define si_reg (bp_reg + 1)
435 #define di_reg (si_reg + 1)
437 #define rAX_reg (di_reg + 1)
438 #define rCX_reg (rAX_reg + 1)
439 #define rDX_reg (rCX_reg + 1)
440 #define rBX_reg (rDX_reg + 1)
441 #define rSP_reg (rBX_reg + 1)
442 #define rBP_reg (rSP_reg + 1)
443 #define rSI_reg (rBP_reg + 1)
444 #define rDI_reg (rSI_reg + 1)
446 #define z_mode_ax_reg (rDI_reg + 1)
447 #define indir_dx_reg (z_mode_ax_reg + 1)
449 #define MAX_BYTEMODE indir_dx_reg
451 /* Flags that are OR'ed into the bytemode field to pass extra
453 #define DREX_OC1 0x10000 /* OC1 bit set */
454 #define DREX_NO_OC0 0x20000 /* OC0 bit not used */
455 #define DREX_MASK 0x40000 /* mask to delete */
457 #if MAX_BYTEMODE >= DREX_OC1
458 #error MAX_BYTEMODE must be less than DREX_OC1
462 #define USE_REG_TABLE (FLOATCODE + 1)
463 #define USE_MOD_TABLE (USE_REG_TABLE + 1)
464 #define USE_RM_TABLE (USE_MOD_TABLE + 1)
465 #define USE_PREFIX_TABLE (USE_RM_TABLE + 1)
466 #define USE_X86_64_TABLE (USE_PREFIX_TABLE + 1)
467 #define USE_3BYTE_TABLE (USE_X86_64_TABLE + 1)
469 #define FLOAT NULL, { { NULL, FLOATCODE } }
471 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }
472 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
473 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
474 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
475 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
476 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
477 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
480 #define REG_81 (REG_80 + 1)
481 #define REG_82 (REG_81 + 1)
482 #define REG_8F (REG_82 + 1)
483 #define REG_C0 (REG_8F + 1)
484 #define REG_C1 (REG_C0 + 1)
485 #define REG_C6 (REG_C1 + 1)
486 #define REG_C7 (REG_C6 + 1)
487 #define REG_D0 (REG_C7 + 1)
488 #define REG_D1 (REG_D0 + 1)
489 #define REG_D2 (REG_D1 + 1)
490 #define REG_D3 (REG_D2 + 1)
491 #define REG_F6 (REG_D3 + 1)
492 #define REG_F7 (REG_F6 + 1)
493 #define REG_FE (REG_F7 + 1)
494 #define REG_FF (REG_FE + 1)
495 #define REG_0F00 (REG_FF + 1)
496 #define REG_0F01 (REG_0F00 + 1)
497 #define REG_0F0D (REG_0F01 + 1)
498 #define REG_0F18 (REG_0F0D + 1)
499 #define REG_0F71 (REG_0F18 + 1)
500 #define REG_0F72 (REG_0F71 + 1)
501 #define REG_0F73 (REG_0F72 + 1)
502 #define REG_0FA6 (REG_0F73 + 1)
503 #define REG_0FA7 (REG_0FA6 + 1)
504 #define REG_0FAE (REG_0FA7 + 1)
505 #define REG_0FBA (REG_0FAE + 1)
506 #define REG_0FC7 (REG_0FBA + 1)
509 #define MOD_0F01_REG_0 (MOD_8D + 1)
510 #define MOD_0F01_REG_1 (MOD_0F01_REG_0 + 1)
511 #define MOD_0F01_REG_2 (MOD_0F01_REG_1 + 1)
512 #define MOD_0F01_REG_3 (MOD_0F01_REG_2 + 1)
513 #define MOD_0F01_REG_7 (MOD_0F01_REG_3 + 1)
514 #define MOD_0F12_PREFIX_0 (MOD_0F01_REG_7 + 1)
515 #define MOD_0F13 (MOD_0F12_PREFIX_0 + 1)
516 #define MOD_0F16_PREFIX_0 (MOD_0F13 + 1)
517 #define MOD_0F17 (MOD_0F16_PREFIX_0 + 1)
518 #define MOD_0F18_REG_0 (MOD_0F17 + 1)
519 #define MOD_0F18_REG_1 (MOD_0F18_REG_0 + 1)
520 #define MOD_0F18_REG_2 (MOD_0F18_REG_1 + 1)
521 #define MOD_0F18_REG_3 (MOD_0F18_REG_2 + 1)
522 #define MOD_0F20 (MOD_0F18_REG_3 + 1)
523 #define MOD_0F21 (MOD_0F20 + 1)
524 #define MOD_0F22 (MOD_0F21 + 1)
525 #define MOD_0F23 (MOD_0F22 + 1)
526 #define MOD_0F24 (MOD_0F23 + 1)
527 #define MOD_0F26 (MOD_0F24 + 1)
528 #define MOD_0F2B_PREFIX_0 (MOD_0F26 + 1)
529 #define MOD_0F2B_PREFIX_1 (MOD_0F2B_PREFIX_0 + 1)
530 #define MOD_0F2B_PREFIX_2 (MOD_0F2B_PREFIX_1 + 1)
531 #define MOD_0F2B_PREFIX_3 (MOD_0F2B_PREFIX_2 + 1)
532 #define MOD_0F51 (MOD_0F2B_PREFIX_3 + 1)
533 #define MOD_0F71_REG_2 (MOD_0F51 + 1)
534 #define MOD_0F71_REG_4 (MOD_0F71_REG_2 + 1)
535 #define MOD_0F71_REG_6 (MOD_0F71_REG_4 + 1)
536 #define MOD_0F72_REG_2 (MOD_0F71_REG_6 + 1)
537 #define MOD_0F72_REG_4 (MOD_0F72_REG_2 + 1)
538 #define MOD_0F72_REG_6 (MOD_0F72_REG_4 + 1)
539 #define MOD_0F73_REG_2 (MOD_0F72_REG_6 + 1)
540 #define MOD_0F73_REG_3 (MOD_0F73_REG_2 + 1)
541 #define MOD_0F73_REG_6 (MOD_0F73_REG_3 + 1)
542 #define MOD_0F73_REG_7 (MOD_0F73_REG_6 + 1)
543 #define MOD_0FAE_REG_0 (MOD_0F73_REG_7 + 1)
544 #define MOD_0FAE_REG_1 (MOD_0FAE_REG_0 + 1)
545 #define MOD_0FAE_REG_2 (MOD_0FAE_REG_1 + 1)
546 #define MOD_0FAE_REG_3 (MOD_0FAE_REG_2 + 1)
547 #define MOD_0FAE_REG_4 (MOD_0FAE_REG_3 + 1)
548 #define MOD_0FAE_REG_5 (MOD_0FAE_REG_4 + 1)
549 #define MOD_0FAE_REG_6 (MOD_0FAE_REG_5 + 1)
550 #define MOD_0FAE_REG_7 (MOD_0FAE_REG_6 + 1)
551 #define MOD_0FB2 (MOD_0FAE_REG_7 + 1)
552 #define MOD_0FB4 (MOD_0FB2 + 1)
553 #define MOD_0FB5 (MOD_0FB4 + 1)
554 #define MOD_0FC7_REG_6 (MOD_0FB5 + 1)
555 #define MOD_0FC7_REG_7 (MOD_0FC7_REG_6 + 1)
556 #define MOD_0FD7 (MOD_0FC7_REG_7 + 1)
557 #define MOD_0FE7_PREFIX_2 (MOD_0FD7 + 1)
558 #define MOD_0FF0_PREFIX_3 (MOD_0FE7_PREFIX_2 + 1)
559 #define MOD_0F382A_PREFIX_2 (MOD_0FF0_PREFIX_3 + 1)
560 #define MOD_62_32BIT (MOD_0F382A_PREFIX_2 + 1)
561 #define MOD_C4_32BIT (MOD_62_32BIT + 1)
562 #define MOD_C5_32BIT (MOD_C4_32BIT + 1)
564 #define RM_0F01_REG_0 0
565 #define RM_0F01_REG_1 (RM_0F01_REG_0 + 1)
566 #define RM_0F01_REG_2 (RM_0F01_REG_1 + 1)
567 #define RM_0F01_REG_3 (RM_0F01_REG_2 + 1)
568 #define RM_0F01_REG_7 (RM_0F01_REG_3 + 1)
569 #define RM_0FAE_REG_5 (RM_0F01_REG_7 + 1)
570 #define RM_0FAE_REG_6 (RM_0FAE_REG_5 + 1)
571 #define RM_0FAE_REG_7 (RM_0FAE_REG_6 + 1)
574 #define PREFIX_0F10 (PREFIX_90 + 1)
575 #define PREFIX_0F11 (PREFIX_0F10 + 1)
576 #define PREFIX_0F12 (PREFIX_0F11 + 1)
577 #define PREFIX_0F16 (PREFIX_0F12 + 1)
578 #define PREFIX_0F2A (PREFIX_0F16 + 1)
579 #define PREFIX_0F2B (PREFIX_0F2A + 1)
580 #define PREFIX_0F2C (PREFIX_0F2B + 1)
581 #define PREFIX_0F2D (PREFIX_0F2C + 1)
582 #define PREFIX_0F2E (PREFIX_0F2D + 1)
583 #define PREFIX_0F2F (PREFIX_0F2E + 1)
584 #define PREFIX_0F51 (PREFIX_0F2F + 1)
585 #define PREFIX_0F52 (PREFIX_0F51 + 1)
586 #define PREFIX_0F53 (PREFIX_0F52 + 1)
587 #define PREFIX_0F58 (PREFIX_0F53 + 1)
588 #define PREFIX_0F59 (PREFIX_0F58 + 1)
589 #define PREFIX_0F5A (PREFIX_0F59 + 1)
590 #define PREFIX_0F5B (PREFIX_0F5A + 1)
591 #define PREFIX_0F5C (PREFIX_0F5B + 1)
592 #define PREFIX_0F5D (PREFIX_0F5C + 1)
593 #define PREFIX_0F5E (PREFIX_0F5D + 1)
594 #define PREFIX_0F5F (PREFIX_0F5E + 1)
595 #define PREFIX_0F60 (PREFIX_0F5F + 1)
596 #define PREFIX_0F61 (PREFIX_0F60 + 1)
597 #define PREFIX_0F62 (PREFIX_0F61 + 1)
598 #define PREFIX_0F6C (PREFIX_0F62 + 1)
599 #define PREFIX_0F6D (PREFIX_0F6C + 1)
600 #define PREFIX_0F6F (PREFIX_0F6D + 1)
601 #define PREFIX_0F70 (PREFIX_0F6F + 1)
602 #define PREFIX_0F73_REG_3 (PREFIX_0F70 + 1)
603 #define PREFIX_0F73_REG_7 (PREFIX_0F73_REG_3 + 1)
604 #define PREFIX_0F78 (PREFIX_0F73_REG_7 + 1)
605 #define PREFIX_0F79 (PREFIX_0F78 + 1)
606 #define PREFIX_0F7C (PREFIX_0F79 + 1)
607 #define PREFIX_0F7D (PREFIX_0F7C + 1)
608 #define PREFIX_0F7E (PREFIX_0F7D + 1)
609 #define PREFIX_0F7F (PREFIX_0F7E + 1)
610 #define PREFIX_0FB8 (PREFIX_0F7F + 1)
611 #define PREFIX_0FBD (PREFIX_0FB8 + 1)
612 #define PREFIX_0FC2 (PREFIX_0FBD + 1)
613 #define PREFIX_0FC3 (PREFIX_0FC2 + 1)
614 #define PREFIX_0FC7_REG_6 (PREFIX_0FC3 + 1)
615 #define PREFIX_0FD0 (PREFIX_0FC7_REG_6 + 1)
616 #define PREFIX_0FD6 (PREFIX_0FD0 + 1)
617 #define PREFIX_0FE6 (PREFIX_0FD6 + 1)
618 #define PREFIX_0FE7 (PREFIX_0FE6 + 1)
619 #define PREFIX_0FF0 (PREFIX_0FE7 + 1)
620 #define PREFIX_0FF7 (PREFIX_0FF0 + 1)
621 #define PREFIX_0F3810 (PREFIX_0FF7 + 1)
622 #define PREFIX_0F3814 (PREFIX_0F3810 + 1)
623 #define PREFIX_0F3815 (PREFIX_0F3814 + 1)
624 #define PREFIX_0F3817 (PREFIX_0F3815 + 1)
625 #define PREFIX_0F3820 (PREFIX_0F3817 + 1)
626 #define PREFIX_0F3821 (PREFIX_0F3820 + 1)
627 #define PREFIX_0F3822 (PREFIX_0F3821 + 1)
628 #define PREFIX_0F3823 (PREFIX_0F3822 + 1)
629 #define PREFIX_0F3824 (PREFIX_0F3823 + 1)
630 #define PREFIX_0F3825 (PREFIX_0F3824 + 1)
631 #define PREFIX_0F3828 (PREFIX_0F3825 + 1)
632 #define PREFIX_0F3829 (PREFIX_0F3828 + 1)
633 #define PREFIX_0F382A (PREFIX_0F3829 + 1)
634 #define PREFIX_0F382B (PREFIX_0F382A + 1)
635 #define PREFIX_0F3830 (PREFIX_0F382B + 1)
636 #define PREFIX_0F3831 (PREFIX_0F3830 + 1)
637 #define PREFIX_0F3832 (PREFIX_0F3831 + 1)
638 #define PREFIX_0F3833 (PREFIX_0F3832 + 1)
639 #define PREFIX_0F3834 (PREFIX_0F3833 + 1)
640 #define PREFIX_0F3835 (PREFIX_0F3834 + 1)
641 #define PREFIX_0F3837 (PREFIX_0F3835 + 1)
642 #define PREFIX_0F3838 (PREFIX_0F3837 + 1)
643 #define PREFIX_0F3839 (PREFIX_0F3838 + 1)
644 #define PREFIX_0F383A (PREFIX_0F3839 + 1)
645 #define PREFIX_0F383B (PREFIX_0F383A + 1)
646 #define PREFIX_0F383C (PREFIX_0F383B + 1)
647 #define PREFIX_0F383D (PREFIX_0F383C + 1)
648 #define PREFIX_0F383E (PREFIX_0F383D + 1)
649 #define PREFIX_0F383F (PREFIX_0F383E + 1)
650 #define PREFIX_0F3840 (PREFIX_0F383F + 1)
651 #define PREFIX_0F3841 (PREFIX_0F3840 + 1)
652 #define PREFIX_0F38F0 (PREFIX_0F3841 + 1)
653 #define PREFIX_0F38F1 (PREFIX_0F38F0 + 1)
654 #define PREFIX_0F3A08 (PREFIX_0F38F1 + 1)
655 #define PREFIX_0F3A09 (PREFIX_0F3A08 + 1)
656 #define PREFIX_0F3A0A (PREFIX_0F3A09 + 1)
657 #define PREFIX_0F3A0B (PREFIX_0F3A0A + 1)
658 #define PREFIX_0F3A0C (PREFIX_0F3A0B + 1)
659 #define PREFIX_0F3A0D (PREFIX_0F3A0C + 1)
660 #define PREFIX_0F3A0E (PREFIX_0F3A0D + 1)
661 #define PREFIX_0F3A14 (PREFIX_0F3A0E + 1)
662 #define PREFIX_0F3A15 (PREFIX_0F3A14 + 1)
663 #define PREFIX_0F3A16 (PREFIX_0F3A15 + 1)
664 #define PREFIX_0F3A17 (PREFIX_0F3A16 + 1)
665 #define PREFIX_0F3A20 (PREFIX_0F3A17 + 1)
666 #define PREFIX_0F3A21 (PREFIX_0F3A20 + 1)
667 #define PREFIX_0F3A22 (PREFIX_0F3A21 + 1)
668 #define PREFIX_0F3A40 (PREFIX_0F3A22 + 1)
669 #define PREFIX_0F3A41 (PREFIX_0F3A40 + 1)
670 #define PREFIX_0F3A42 (PREFIX_0F3A41 + 1)
671 #define PREFIX_0F3A60 (PREFIX_0F3A42 + 1)
672 #define PREFIX_0F3A61 (PREFIX_0F3A60 + 1)
673 #define PREFIX_0F3A62 (PREFIX_0F3A61 + 1)
674 #define PREFIX_0F3A63 (PREFIX_0F3A62 + 1)
677 #define X86_64_07 (X86_64_06 + 1)
678 #define X86_64_0D (X86_64_07 + 1)
679 #define X86_64_16 (X86_64_0D + 1)
680 #define X86_64_17 (X86_64_16 + 1)
681 #define X86_64_1E (X86_64_17 + 1)
682 #define X86_64_1F (X86_64_1E + 1)
683 #define X86_64_27 (X86_64_1F + 1)
684 #define X86_64_2F (X86_64_27 + 1)
685 #define X86_64_37 (X86_64_2F + 1)
686 #define X86_64_3F (X86_64_37 + 1)
687 #define X86_64_60 (X86_64_3F + 1)
688 #define X86_64_61 (X86_64_60 + 1)
689 #define X86_64_62 (X86_64_61 + 1)
690 #define X86_64_63 (X86_64_62 + 1)
691 #define X86_64_6D (X86_64_63 + 1)
692 #define X86_64_6F (X86_64_6D + 1)
693 #define X86_64_9A (X86_64_6F + 1)
694 #define X86_64_C4 (X86_64_9A + 1)
695 #define X86_64_C5 (X86_64_C4 + 1)
696 #define X86_64_CE (X86_64_C5 + 1)
697 #define X86_64_D4 (X86_64_CE + 1)
698 #define X86_64_D5 (X86_64_D4 + 1)
699 #define X86_64_EA (X86_64_D5 + 1)
700 #define X86_64_0F01_REG_0 (X86_64_EA + 1)
701 #define X86_64_0F01_REG_1 (X86_64_0F01_REG_0 + 1)
702 #define X86_64_0F01_REG_2 (X86_64_0F01_REG_1 + 1)
703 #define X86_64_0F01_REG_3 (X86_64_0F01_REG_2 + 1)
705 #define THREE_BYTE_0F24 0
706 #define THREE_BYTE_0F25 (THREE_BYTE_0F24 + 1)
707 #define THREE_BYTE_0F38 (THREE_BYTE_0F25 + 1)
708 #define THREE_BYTE_0F3A (THREE_BYTE_0F38 + 1)
709 #define THREE_BYTE_0F7A (THREE_BYTE_0F3A + 1)
710 #define THREE_BYTE_0F7B (THREE_BYTE_0F7A + 1)
712 typedef void (*op_rtn
) (int bytemode
, int sizeflag
);
723 /* Upper case letters in the instruction names here are macros.
724 'A' => print 'b' if no register operands or suffix_always is true
725 'B' => print 'b' if suffix_always is true
726 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
728 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
729 suffix_always is true
730 'E' => print 'e' if 32-bit form of jcxz
731 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
732 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
733 'H' => print ",pt" or ",pn" branch hint
734 'I' => honor following macro letter even in Intel mode (implemented only
735 for some of the macro letters)
737 'K' => print 'd' or 'q' if rex prefix is present.
738 'L' => print 'l' if suffix_always is true
739 'M' => print 'r' if intel_mnemonic is false.
740 'N' => print 'n' if instruction has no wait "prefix"
741 'O' => print 'd' or 'o' (or 'q' in Intel mode)
742 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
743 or suffix_always is true. print 'q' if rex prefix is present.
744 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
746 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
747 'S' => print 'w', 'l' or 'q' if suffix_always is true
748 'T' => print 'q' in 64bit mode and behave as 'P' otherwise
749 'U' => print 'q' in 64bit mode and behave as 'Q' otherwise
750 'V' => print 'q' in 64bit mode and behave as 'S' otherwise
751 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
752 'X' => print 's', 'd' depending on data16 prefix (for XMM)
753 'Y' => 'q' if instruction has an REX 64bit overwrite prefix and
754 suffix_always is true.
755 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
756 '!' => change condition from true to false or from false to true.
757 '%' => add 1 upper case letter to the macro.
759 2 upper case letter macros:
760 'LQ' => print 'l' ('d' in Intel mode) or 'q' for memory operand
761 or suffix_always is true
763 Many of the above letters print nothing in Intel mode. See "putop"
766 Braces '{' and '}', and vertical bars '|', indicate alternative
767 mnemonic strings for AT&T and Intel. */
769 static const struct dis386 dis386
[] = {
771 { "addB", { Eb
, Gb
} },
772 { "addS", { Ev
, Gv
} },
773 { "addB", { Gb
, Eb
} },
774 { "addS", { Gv
, Ev
} },
775 { "addB", { AL
, Ib
} },
776 { "addS", { eAX
, Iv
} },
777 { X86_64_TABLE (X86_64_06
) },
778 { X86_64_TABLE (X86_64_07
) },
780 { "orB", { Eb
, Gb
} },
781 { "orS", { Ev
, Gv
} },
782 { "orB", { Gb
, Eb
} },
783 { "orS", { Gv
, Ev
} },
784 { "orB", { AL
, Ib
} },
785 { "orS", { eAX
, Iv
} },
786 { X86_64_TABLE (X86_64_0D
) },
787 { "(bad)", { XX
} }, /* 0x0f extended opcode escape */
789 { "adcB", { Eb
, Gb
} },
790 { "adcS", { Ev
, Gv
} },
791 { "adcB", { Gb
, Eb
} },
792 { "adcS", { Gv
, Ev
} },
793 { "adcB", { AL
, Ib
} },
794 { "adcS", { eAX
, Iv
} },
795 { X86_64_TABLE (X86_64_16
) },
796 { X86_64_TABLE (X86_64_17
) },
798 { "sbbB", { Eb
, Gb
} },
799 { "sbbS", { Ev
, Gv
} },
800 { "sbbB", { Gb
, Eb
} },
801 { "sbbS", { Gv
, Ev
} },
802 { "sbbB", { AL
, Ib
} },
803 { "sbbS", { eAX
, Iv
} },
804 { X86_64_TABLE (X86_64_1E
) },
805 { X86_64_TABLE (X86_64_1F
) },
807 { "andB", { Eb
, Gb
} },
808 { "andS", { Ev
, Gv
} },
809 { "andB", { Gb
, Eb
} },
810 { "andS", { Gv
, Ev
} },
811 { "andB", { AL
, Ib
} },
812 { "andS", { eAX
, Iv
} },
813 { "(bad)", { XX
} }, /* SEG ES prefix */
814 { X86_64_TABLE (X86_64_27
) },
816 { "subB", { Eb
, Gb
} },
817 { "subS", { Ev
, Gv
} },
818 { "subB", { Gb
, Eb
} },
819 { "subS", { Gv
, Ev
} },
820 { "subB", { AL
, Ib
} },
821 { "subS", { eAX
, Iv
} },
822 { "(bad)", { XX
} }, /* SEG CS prefix */
823 { X86_64_TABLE (X86_64_2F
) },
825 { "xorB", { Eb
, Gb
} },
826 { "xorS", { Ev
, Gv
} },
827 { "xorB", { Gb
, Eb
} },
828 { "xorS", { Gv
, Ev
} },
829 { "xorB", { AL
, Ib
} },
830 { "xorS", { eAX
, Iv
} },
831 { "(bad)", { XX
} }, /* SEG SS prefix */
832 { X86_64_TABLE (X86_64_37
) },
834 { "cmpB", { Eb
, Gb
} },
835 { "cmpS", { Ev
, Gv
} },
836 { "cmpB", { Gb
, Eb
} },
837 { "cmpS", { Gv
, Ev
} },
838 { "cmpB", { AL
, Ib
} },
839 { "cmpS", { eAX
, Iv
} },
840 { "(bad)", { XX
} }, /* SEG DS prefix */
841 { X86_64_TABLE (X86_64_3F
) },
843 { "inc{S|}", { RMeAX
} },
844 { "inc{S|}", { RMeCX
} },
845 { "inc{S|}", { RMeDX
} },
846 { "inc{S|}", { RMeBX
} },
847 { "inc{S|}", { RMeSP
} },
848 { "inc{S|}", { RMeBP
} },
849 { "inc{S|}", { RMeSI
} },
850 { "inc{S|}", { RMeDI
} },
852 { "dec{S|}", { RMeAX
} },
853 { "dec{S|}", { RMeCX
} },
854 { "dec{S|}", { RMeDX
} },
855 { "dec{S|}", { RMeBX
} },
856 { "dec{S|}", { RMeSP
} },
857 { "dec{S|}", { RMeBP
} },
858 { "dec{S|}", { RMeSI
} },
859 { "dec{S|}", { RMeDI
} },
861 { "pushV", { RMrAX
} },
862 { "pushV", { RMrCX
} },
863 { "pushV", { RMrDX
} },
864 { "pushV", { RMrBX
} },
865 { "pushV", { RMrSP
} },
866 { "pushV", { RMrBP
} },
867 { "pushV", { RMrSI
} },
868 { "pushV", { RMrDI
} },
870 { "popV", { RMrAX
} },
871 { "popV", { RMrCX
} },
872 { "popV", { RMrDX
} },
873 { "popV", { RMrBX
} },
874 { "popV", { RMrSP
} },
875 { "popV", { RMrBP
} },
876 { "popV", { RMrSI
} },
877 { "popV", { RMrDI
} },
879 { X86_64_TABLE (X86_64_60
) },
880 { X86_64_TABLE (X86_64_61
) },
881 { X86_64_TABLE (X86_64_62
) },
882 { X86_64_TABLE (X86_64_63
) },
883 { "(bad)", { XX
} }, /* seg fs */
884 { "(bad)", { XX
} }, /* seg gs */
885 { "(bad)", { XX
} }, /* op size prefix */
886 { "(bad)", { XX
} }, /* adr size prefix */
889 { "imulS", { Gv
, Ev
, Iv
} },
890 { "pushT", { sIb
} },
891 { "imulS", { Gv
, Ev
, sIb
} },
892 { "ins{b|}", { Ybr
, indirDX
} },
893 { X86_64_TABLE (X86_64_6D
) },
894 { "outs{b|}", { indirDXr
, Xb
} },
895 { X86_64_TABLE (X86_64_6F
) },
897 { "joH", { Jb
, XX
, cond_jump_flag
} },
898 { "jnoH", { Jb
, XX
, cond_jump_flag
} },
899 { "jbH", { Jb
, XX
, cond_jump_flag
} },
900 { "jaeH", { Jb
, XX
, cond_jump_flag
} },
901 { "jeH", { Jb
, XX
, cond_jump_flag
} },
902 { "jneH", { Jb
, XX
, cond_jump_flag
} },
903 { "jbeH", { Jb
, XX
, cond_jump_flag
} },
904 { "jaH", { Jb
, XX
, cond_jump_flag
} },
906 { "jsH", { Jb
, XX
, cond_jump_flag
} },
907 { "jnsH", { Jb
, XX
, cond_jump_flag
} },
908 { "jpH", { Jb
, XX
, cond_jump_flag
} },
909 { "jnpH", { Jb
, XX
, cond_jump_flag
} },
910 { "jlH", { Jb
, XX
, cond_jump_flag
} },
911 { "jgeH", { Jb
, XX
, cond_jump_flag
} },
912 { "jleH", { Jb
, XX
, cond_jump_flag
} },
913 { "jgH", { Jb
, XX
, cond_jump_flag
} },
915 { REG_TABLE (REG_80
) },
916 { REG_TABLE (REG_81
) },
918 { REG_TABLE (REG_82
) },
919 { "testB", { Eb
, Gb
} },
920 { "testS", { Ev
, Gv
} },
921 { "xchgB", { Eb
, Gb
} },
922 { "xchgS", { Ev
, Gv
} },
924 { "movB", { Eb
, Gb
} },
925 { "movS", { Ev
, Gv
} },
926 { "movB", { Gb
, Eb
} },
927 { "movS", { Gv
, Ev
} },
928 { "movD", { Sv
, Sw
} },
929 { MOD_TABLE (MOD_8D
) },
930 { "movD", { Sw
, Sv
} },
931 { REG_TABLE (REG_8F
) },
933 { PREFIX_TABLE (PREFIX_90
) },
934 { "xchgS", { RMeCX
, eAX
} },
935 { "xchgS", { RMeDX
, eAX
} },
936 { "xchgS", { RMeBX
, eAX
} },
937 { "xchgS", { RMeSP
, eAX
} },
938 { "xchgS", { RMeBP
, eAX
} },
939 { "xchgS", { RMeSI
, eAX
} },
940 { "xchgS", { RMeDI
, eAX
} },
942 { "cW{t|}R", { XX
} },
943 { "cR{t|}O", { XX
} },
944 { X86_64_TABLE (X86_64_9A
) },
945 { "(bad)", { XX
} }, /* fwait */
946 { "pushfT", { XX
} },
951 { "movB", { AL
, Ob
} },
952 { "movS", { eAX
, Ov
} },
953 { "movB", { Ob
, AL
} },
954 { "movS", { Ov
, eAX
} },
955 { "movs{b|}", { Ybr
, Xb
} },
956 { "movs{R|}", { Yvr
, Xv
} },
957 { "cmps{b|}", { Xb
, Yb
} },
958 { "cmps{R|}", { Xv
, Yv
} },
960 { "testB", { AL
, Ib
} },
961 { "testS", { eAX
, Iv
} },
962 { "stosB", { Ybr
, AL
} },
963 { "stosS", { Yvr
, eAX
} },
964 { "lodsB", { ALr
, Xb
} },
965 { "lodsS", { eAXr
, Xv
} },
966 { "scasB", { AL
, Yb
} },
967 { "scasS", { eAX
, Yv
} },
969 { "movB", { RMAL
, Ib
} },
970 { "movB", { RMCL
, Ib
} },
971 { "movB", { RMDL
, Ib
} },
972 { "movB", { RMBL
, Ib
} },
973 { "movB", { RMAH
, Ib
} },
974 { "movB", { RMCH
, Ib
} },
975 { "movB", { RMDH
, Ib
} },
976 { "movB", { RMBH
, Ib
} },
978 { "movS", { RMeAX
, Iv64
} },
979 { "movS", { RMeCX
, Iv64
} },
980 { "movS", { RMeDX
, Iv64
} },
981 { "movS", { RMeBX
, Iv64
} },
982 { "movS", { RMeSP
, Iv64
} },
983 { "movS", { RMeBP
, Iv64
} },
984 { "movS", { RMeSI
, Iv64
} },
985 { "movS", { RMeDI
, Iv64
} },
987 { REG_TABLE (REG_C0
) },
988 { REG_TABLE (REG_C1
) },
991 { X86_64_TABLE (X86_64_C4
) },
992 { X86_64_TABLE (X86_64_C5
) },
993 { REG_TABLE (REG_C6
) },
994 { REG_TABLE (REG_C7
) },
996 { "enterT", { Iw
, Ib
} },
997 { "leaveT", { XX
} },
1002 { X86_64_TABLE (X86_64_CE
) },
1003 { "iretP", { XX
} },
1005 { REG_TABLE (REG_D0
) },
1006 { REG_TABLE (REG_D1
) },
1007 { REG_TABLE (REG_D2
) },
1008 { REG_TABLE (REG_D3
) },
1009 { X86_64_TABLE (X86_64_D4
) },
1010 { X86_64_TABLE (X86_64_D5
) },
1011 { "(bad)", { XX
} },
1012 { "xlat", { DSBX
} },
1023 { "loopneFH", { Jb
, XX
, loop_jcxz_flag
} },
1024 { "loopeFH", { Jb
, XX
, loop_jcxz_flag
} },
1025 { "loopFH", { Jb
, XX
, loop_jcxz_flag
} },
1026 { "jEcxzH", { Jb
, XX
, loop_jcxz_flag
} },
1027 { "inB", { AL
, Ib
} },
1028 { "inG", { zAX
, Ib
} },
1029 { "outB", { Ib
, AL
} },
1030 { "outG", { Ib
, zAX
} },
1032 { "callT", { Jv
} },
1034 { X86_64_TABLE (X86_64_EA
) },
1036 { "inB", { AL
, indirDX
} },
1037 { "inG", { zAX
, indirDX
} },
1038 { "outB", { indirDX
, AL
} },
1039 { "outG", { indirDX
, zAX
} },
1041 { "(bad)", { XX
} }, /* lock prefix */
1042 { "icebp", { XX
} },
1043 { "(bad)", { XX
} }, /* repne */
1044 { "(bad)", { XX
} }, /* repz */
1047 { REG_TABLE (REG_F6
) },
1048 { REG_TABLE (REG_F7
) },
1056 { REG_TABLE (REG_FE
) },
1057 { REG_TABLE (REG_FF
) },
1060 static const struct dis386 dis386_twobyte
[] = {
1062 { REG_TABLE (REG_0F00
) },
1063 { REG_TABLE (REG_0F01
) },
1064 { "larS", { Gv
, Ew
} },
1065 { "lslS", { Gv
, Ew
} },
1066 { "(bad)", { XX
} },
1067 { "syscall", { XX
} },
1069 { "sysretP", { XX
} },
1072 { "wbinvd", { XX
} },
1073 { "(bad)", { XX
} },
1075 { "(bad)", { XX
} },
1076 { REG_TABLE (REG_0F0D
) },
1077 { "femms", { XX
} },
1078 { "", { MX
, EM
, OPSUF
} }, /* See OP_3DNowSuffix. */
1080 { PREFIX_TABLE (PREFIX_0F10
) },
1081 { PREFIX_TABLE (PREFIX_0F11
) },
1082 { PREFIX_TABLE (PREFIX_0F12
) },
1083 { MOD_TABLE (MOD_0F13
) },
1084 { "unpcklpX", { XM
, EXx
} },
1085 { "unpckhpX", { XM
, EXx
} },
1086 { PREFIX_TABLE (PREFIX_0F16
) },
1087 { MOD_TABLE (MOD_0F17
) },
1089 { REG_TABLE (REG_0F18
) },
1098 { MOD_TABLE (MOD_0F20
) },
1099 { MOD_TABLE (MOD_0F21
) },
1100 { MOD_TABLE (MOD_0F22
) },
1101 { MOD_TABLE (MOD_0F23
) },
1102 { MOD_TABLE (MOD_0F24
) },
1103 { THREE_BYTE_TABLE (THREE_BYTE_0F25
) },
1104 { MOD_TABLE (MOD_0F26
) },
1105 { "(bad)", { XX
} },
1107 { "movapX", { XM
, EXx
} },
1108 { "movapX", { EXx
, XM
} },
1109 { PREFIX_TABLE (PREFIX_0F2A
) },
1110 { PREFIX_TABLE (PREFIX_0F2B
) },
1111 { PREFIX_TABLE (PREFIX_0F2C
) },
1112 { PREFIX_TABLE (PREFIX_0F2D
) },
1113 { PREFIX_TABLE (PREFIX_0F2E
) },
1114 { PREFIX_TABLE (PREFIX_0F2F
) },
1116 { "wrmsr", { XX
} },
1117 { "rdtsc", { XX
} },
1118 { "rdmsr", { XX
} },
1119 { "rdpmc", { XX
} },
1120 { "sysenter", { XX
} },
1121 { "sysexit", { XX
} },
1122 { "(bad)", { XX
} },
1123 { "getsec", { XX
} },
1125 { THREE_BYTE_TABLE (THREE_BYTE_0F38
) },
1126 { "(bad)", { XX
} },
1127 { THREE_BYTE_TABLE (THREE_BYTE_0F3A
) },
1128 { "(bad)", { XX
} },
1129 { "(bad)", { XX
} },
1130 { "(bad)", { XX
} },
1131 { "(bad)", { XX
} },
1132 { "(bad)", { XX
} },
1134 { "cmovo", { Gv
, Ev
} },
1135 { "cmovno", { Gv
, Ev
} },
1136 { "cmovb", { Gv
, Ev
} },
1137 { "cmovae", { Gv
, Ev
} },
1138 { "cmove", { Gv
, Ev
} },
1139 { "cmovne", { Gv
, Ev
} },
1140 { "cmovbe", { Gv
, Ev
} },
1141 { "cmova", { Gv
, Ev
} },
1143 { "cmovs", { Gv
, Ev
} },
1144 { "cmovns", { Gv
, Ev
} },
1145 { "cmovp", { Gv
, Ev
} },
1146 { "cmovnp", { Gv
, Ev
} },
1147 { "cmovl", { Gv
, Ev
} },
1148 { "cmovge", { Gv
, Ev
} },
1149 { "cmovle", { Gv
, Ev
} },
1150 { "cmovg", { Gv
, Ev
} },
1152 { MOD_TABLE (MOD_0F51
) },
1153 { PREFIX_TABLE (PREFIX_0F51
) },
1154 { PREFIX_TABLE (PREFIX_0F52
) },
1155 { PREFIX_TABLE (PREFIX_0F53
) },
1156 { "andpX", { XM
, EXx
} },
1157 { "andnpX", { XM
, EXx
} },
1158 { "orpX", { XM
, EXx
} },
1159 { "xorpX", { XM
, EXx
} },
1161 { PREFIX_TABLE (PREFIX_0F58
) },
1162 { PREFIX_TABLE (PREFIX_0F59
) },
1163 { PREFIX_TABLE (PREFIX_0F5A
) },
1164 { PREFIX_TABLE (PREFIX_0F5B
) },
1165 { PREFIX_TABLE (PREFIX_0F5C
) },
1166 { PREFIX_TABLE (PREFIX_0F5D
) },
1167 { PREFIX_TABLE (PREFIX_0F5E
) },
1168 { PREFIX_TABLE (PREFIX_0F5F
) },
1170 { PREFIX_TABLE (PREFIX_0F60
) },
1171 { PREFIX_TABLE (PREFIX_0F61
) },
1172 { PREFIX_TABLE (PREFIX_0F62
) },
1173 { "packsswb", { MX
, EM
} },
1174 { "pcmpgtb", { MX
, EM
} },
1175 { "pcmpgtw", { MX
, EM
} },
1176 { "pcmpgtd", { MX
, EM
} },
1177 { "packuswb", { MX
, EM
} },
1179 { "punpckhbw", { MX
, EM
} },
1180 { "punpckhwd", { MX
, EM
} },
1181 { "punpckhdq", { MX
, EM
} },
1182 { "packssdw", { MX
, EM
} },
1183 { PREFIX_TABLE (PREFIX_0F6C
) },
1184 { PREFIX_TABLE (PREFIX_0F6D
) },
1185 { "movK", { MX
, Edq
} },
1186 { PREFIX_TABLE (PREFIX_0F6F
) },
1188 { PREFIX_TABLE (PREFIX_0F70
) },
1189 { REG_TABLE (REG_0F71
) },
1190 { REG_TABLE (REG_0F72
) },
1191 { REG_TABLE (REG_0F73
) },
1192 { "pcmpeqb", { MX
, EM
} },
1193 { "pcmpeqw", { MX
, EM
} },
1194 { "pcmpeqd", { MX
, EM
} },
1197 { PREFIX_TABLE (PREFIX_0F78
) },
1198 { PREFIX_TABLE (PREFIX_0F79
) },
1199 { THREE_BYTE_TABLE (THREE_BYTE_0F7A
) },
1200 { THREE_BYTE_TABLE (THREE_BYTE_0F7B
) },
1201 { PREFIX_TABLE (PREFIX_0F7C
) },
1202 { PREFIX_TABLE (PREFIX_0F7D
) },
1203 { PREFIX_TABLE (PREFIX_0F7E
) },
1204 { PREFIX_TABLE (PREFIX_0F7F
) },
1206 { "joH", { Jv
, XX
, cond_jump_flag
} },
1207 { "jnoH", { Jv
, XX
, cond_jump_flag
} },
1208 { "jbH", { Jv
, XX
, cond_jump_flag
} },
1209 { "jaeH", { Jv
, XX
, cond_jump_flag
} },
1210 { "jeH", { Jv
, XX
, cond_jump_flag
} },
1211 { "jneH", { Jv
, XX
, cond_jump_flag
} },
1212 { "jbeH", { Jv
, XX
, cond_jump_flag
} },
1213 { "jaH", { Jv
, XX
, cond_jump_flag
} },
1215 { "jsH", { Jv
, XX
, cond_jump_flag
} },
1216 { "jnsH", { Jv
, XX
, cond_jump_flag
} },
1217 { "jpH", { Jv
, XX
, cond_jump_flag
} },
1218 { "jnpH", { Jv
, XX
, cond_jump_flag
} },
1219 { "jlH", { Jv
, XX
, cond_jump_flag
} },
1220 { "jgeH", { Jv
, XX
, cond_jump_flag
} },
1221 { "jleH", { Jv
, XX
, cond_jump_flag
} },
1222 { "jgH", { Jv
, XX
, cond_jump_flag
} },
1225 { "setno", { Eb
} },
1227 { "setae", { Eb
} },
1229 { "setne", { Eb
} },
1230 { "setbe", { Eb
} },
1234 { "setns", { Eb
} },
1236 { "setnp", { Eb
} },
1238 { "setge", { Eb
} },
1239 { "setle", { Eb
} },
1242 { "pushT", { fs
} },
1244 { "cpuid", { XX
} },
1245 { "btS", { Ev
, Gv
} },
1246 { "shldS", { Ev
, Gv
, Ib
} },
1247 { "shldS", { Ev
, Gv
, CL
} },
1248 { REG_TABLE (REG_0FA6
) },
1249 { REG_TABLE (REG_0FA7
) },
1251 { "pushT", { gs
} },
1254 { "btsS", { Ev
, Gv
} },
1255 { "shrdS", { Ev
, Gv
, Ib
} },
1256 { "shrdS", { Ev
, Gv
, CL
} },
1257 { REG_TABLE (REG_0FAE
) },
1258 { "imulS", { Gv
, Ev
} },
1260 { "cmpxchgB", { Eb
, Gb
} },
1261 { "cmpxchgS", { Ev
, Gv
} },
1262 { MOD_TABLE (MOD_0FB2
) },
1263 { "btrS", { Ev
, Gv
} },
1264 { MOD_TABLE (MOD_0FB4
) },
1265 { MOD_TABLE (MOD_0FB5
) },
1266 { "movz{bR|x}", { Gv
, Eb
} },
1267 { "movz{wR|x}", { Gv
, Ew
} }, /* yes, there really is movzww ! */
1269 { PREFIX_TABLE (PREFIX_0FB8
) },
1271 { REG_TABLE (REG_0FBA
) },
1272 { "btcS", { Ev
, Gv
} },
1273 { "bsfS", { Gv
, Ev
} },
1274 { PREFIX_TABLE (PREFIX_0FBD
) },
1275 { "movs{bR|x}", { Gv
, Eb
} },
1276 { "movs{wR|x}", { Gv
, Ew
} }, /* yes, there really is movsww ! */
1278 { "xaddB", { Eb
, Gb
} },
1279 { "xaddS", { Ev
, Gv
} },
1280 { PREFIX_TABLE (PREFIX_0FC2
) },
1281 { PREFIX_TABLE (PREFIX_0FC3
) },
1282 { "pinsrw", { MX
, Edqw
, Ib
} },
1283 { "pextrw", { Gdq
, MS
, Ib
} },
1284 { "shufpX", { XM
, EXx
, Ib
} },
1285 { REG_TABLE (REG_0FC7
) },
1287 { "bswap", { RMeAX
} },
1288 { "bswap", { RMeCX
} },
1289 { "bswap", { RMeDX
} },
1290 { "bswap", { RMeBX
} },
1291 { "bswap", { RMeSP
} },
1292 { "bswap", { RMeBP
} },
1293 { "bswap", { RMeSI
} },
1294 { "bswap", { RMeDI
} },
1296 { PREFIX_TABLE (PREFIX_0FD0
) },
1297 { "psrlw", { MX
, EM
} },
1298 { "psrld", { MX
, EM
} },
1299 { "psrlq", { MX
, EM
} },
1300 { "paddq", { MX
, EM
} },
1301 { "pmullw", { MX
, EM
} },
1302 { PREFIX_TABLE (PREFIX_0FD6
) },
1303 { MOD_TABLE (MOD_0FD7
) },
1305 { "psubusb", { MX
, EM
} },
1306 { "psubusw", { MX
, EM
} },
1307 { "pminub", { MX
, EM
} },
1308 { "pand", { MX
, EM
} },
1309 { "paddusb", { MX
, EM
} },
1310 { "paddusw", { MX
, EM
} },
1311 { "pmaxub", { MX
, EM
} },
1312 { "pandn", { MX
, EM
} },
1314 { "pavgb", { MX
, EM
} },
1315 { "psraw", { MX
, EM
} },
1316 { "psrad", { MX
, EM
} },
1317 { "pavgw", { MX
, EM
} },
1318 { "pmulhuw", { MX
, EM
} },
1319 { "pmulhw", { MX
, EM
} },
1320 { PREFIX_TABLE (PREFIX_0FE6
) },
1321 { PREFIX_TABLE (PREFIX_0FE7
) },
1323 { "psubsb", { MX
, EM
} },
1324 { "psubsw", { MX
, EM
} },
1325 { "pminsw", { MX
, EM
} },
1326 { "por", { MX
, EM
} },
1327 { "paddsb", { MX
, EM
} },
1328 { "paddsw", { MX
, EM
} },
1329 { "pmaxsw", { MX
, EM
} },
1330 { "pxor", { MX
, EM
} },
1332 { PREFIX_TABLE (PREFIX_0FF0
) },
1333 { "psllw", { MX
, EM
} },
1334 { "pslld", { MX
, EM
} },
1335 { "psllq", { MX
, EM
} },
1336 { "pmuludq", { MX
, EM
} },
1337 { "pmaddwd", { MX
, EM
} },
1338 { "psadbw", { MX
, EM
} },
1339 { PREFIX_TABLE (PREFIX_0FF7
) },
1341 { "psubb", { MX
, EM
} },
1342 { "psubw", { MX
, EM
} },
1343 { "psubd", { MX
, EM
} },
1344 { "psubq", { MX
, EM
} },
1345 { "paddb", { MX
, EM
} },
1346 { "paddw", { MX
, EM
} },
1347 { "paddd", { MX
, EM
} },
1348 { "(bad)", { XX
} },
1351 static const unsigned char onebyte_has_modrm
[256] = {
1352 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1353 /* ------------------------------- */
1354 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
1355 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
1356 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
1357 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
1358 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
1359 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
1360 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
1361 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
1362 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
1363 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
1364 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
1365 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
1366 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
1367 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
1368 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
1369 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
1370 /* ------------------------------- */
1371 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1374 static const unsigned char twobyte_has_modrm
[256] = {
1375 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1376 /* ------------------------------- */
1377 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
1378 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
1379 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
1380 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
1381 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
1382 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
1383 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
1384 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
1385 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
1386 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
1387 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
1388 /* b0 */ 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, /* bf */
1389 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
1390 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
1391 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
1392 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */
1393 /* ------------------------------- */
1394 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
1397 static char obuf
[100];
1399 static char scratchbuf
[100];
1400 static unsigned char *start_codep
;
1401 static unsigned char *insn_codep
;
1402 static unsigned char *codep
;
1403 static const char *lock_prefix
;
1404 static const char *data_prefix
;
1405 static const char *addr_prefix
;
1406 static const char *repz_prefix
;
1407 static const char *repnz_prefix
;
1408 static disassemble_info
*the_info
;
1416 static unsigned char need_modrm
;
1418 /* If we are accessing mod/rm/reg without need_modrm set, then the
1419 values are stale. Hitting this abort likely indicates that you
1420 need to update onebyte_has_modrm or twobyte_has_modrm. */
1421 #define MODRM_CHECK if (!need_modrm) abort ()
1423 static const char **names64
;
1424 static const char **names32
;
1425 static const char **names16
;
1426 static const char **names8
;
1427 static const char **names8rex
;
1428 static const char **names_seg
;
1429 static const char *index64
;
1430 static const char *index32
;
1431 static const char **index16
;
1433 static const char *intel_names64
[] = {
1434 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
1435 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
1437 static const char *intel_names32
[] = {
1438 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
1439 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
1441 static const char *intel_names16
[] = {
1442 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
1443 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
1445 static const char *intel_names8
[] = {
1446 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
1448 static const char *intel_names8rex
[] = {
1449 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
1450 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
1452 static const char *intel_names_seg
[] = {
1453 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
1455 static const char *intel_index64
= "riz";
1456 static const char *intel_index32
= "eiz";
1457 static const char *intel_index16
[] = {
1458 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
1461 static const char *att_names64
[] = {
1462 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
1463 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
1465 static const char *att_names32
[] = {
1466 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
1467 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
1469 static const char *att_names16
[] = {
1470 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
1471 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
1473 static const char *att_names8
[] = {
1474 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
1476 static const char *att_names8rex
[] = {
1477 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
1478 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
1480 static const char *att_names_seg
[] = {
1481 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
1483 static const char *att_index64
= "%riz";
1484 static const char *att_index32
= "%eiz";
1485 static const char *att_index16
[] = {
1486 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
1489 static const struct dis386 reg_table
[][8] = {
1492 { "addA", { Eb
, Ib
} },
1493 { "orA", { Eb
, Ib
} },
1494 { "adcA", { Eb
, Ib
} },
1495 { "sbbA", { Eb
, Ib
} },
1496 { "andA", { Eb
, Ib
} },
1497 { "subA", { Eb
, Ib
} },
1498 { "xorA", { Eb
, Ib
} },
1499 { "cmpA", { Eb
, Ib
} },
1503 { "addQ", { Ev
, Iv
} },
1504 { "orQ", { Ev
, Iv
} },
1505 { "adcQ", { Ev
, Iv
} },
1506 { "sbbQ", { Ev
, Iv
} },
1507 { "andQ", { Ev
, Iv
} },
1508 { "subQ", { Ev
, Iv
} },
1509 { "xorQ", { Ev
, Iv
} },
1510 { "cmpQ", { Ev
, Iv
} },
1514 { "addQ", { Ev
, sIb
} },
1515 { "orQ", { Ev
, sIb
} },
1516 { "adcQ", { Ev
, sIb
} },
1517 { "sbbQ", { Ev
, sIb
} },
1518 { "andQ", { Ev
, sIb
} },
1519 { "subQ", { Ev
, sIb
} },
1520 { "xorQ", { Ev
, sIb
} },
1521 { "cmpQ", { Ev
, sIb
} },
1525 { "popU", { stackEv
} },
1526 { "(bad)", { XX
} },
1527 { "(bad)", { XX
} },
1528 { "(bad)", { XX
} },
1529 { "(bad)", { XX
} },
1530 { "(bad)", { XX
} },
1531 { "(bad)", { XX
} },
1532 { "(bad)", { XX
} },
1536 { "rolA", { Eb
, Ib
} },
1537 { "rorA", { Eb
, Ib
} },
1538 { "rclA", { Eb
, Ib
} },
1539 { "rcrA", { Eb
, Ib
} },
1540 { "shlA", { Eb
, Ib
} },
1541 { "shrA", { Eb
, Ib
} },
1542 { "(bad)", { XX
} },
1543 { "sarA", { Eb
, Ib
} },
1547 { "rolQ", { Ev
, Ib
} },
1548 { "rorQ", { Ev
, Ib
} },
1549 { "rclQ", { Ev
, Ib
} },
1550 { "rcrQ", { Ev
, Ib
} },
1551 { "shlQ", { Ev
, Ib
} },
1552 { "shrQ", { Ev
, Ib
} },
1553 { "(bad)", { XX
} },
1554 { "sarQ", { Ev
, Ib
} },
1558 { "movA", { Eb
, Ib
} },
1559 { "(bad)", { XX
} },
1560 { "(bad)", { XX
} },
1561 { "(bad)", { XX
} },
1562 { "(bad)", { XX
} },
1563 { "(bad)", { XX
} },
1564 { "(bad)", { XX
} },
1565 { "(bad)", { XX
} },
1569 { "movQ", { Ev
, Iv
} },
1570 { "(bad)", { XX
} },
1571 { "(bad)", { XX
} },
1572 { "(bad)", { XX
} },
1573 { "(bad)", { XX
} },
1574 { "(bad)", { XX
} },
1575 { "(bad)", { XX
} },
1576 { "(bad)", { XX
} },
1580 { "rolA", { Eb
, I1
} },
1581 { "rorA", { Eb
, I1
} },
1582 { "rclA", { Eb
, I1
} },
1583 { "rcrA", { Eb
, I1
} },
1584 { "shlA", { Eb
, I1
} },
1585 { "shrA", { Eb
, I1
} },
1586 { "(bad)", { XX
} },
1587 { "sarA", { Eb
, I1
} },
1591 { "rolQ", { Ev
, I1
} },
1592 { "rorQ", { Ev
, I1
} },
1593 { "rclQ", { Ev
, I1
} },
1594 { "rcrQ", { Ev
, I1
} },
1595 { "shlQ", { Ev
, I1
} },
1596 { "shrQ", { Ev
, I1
} },
1597 { "(bad)", { XX
} },
1598 { "sarQ", { Ev
, I1
} },
1602 { "rolA", { Eb
, CL
} },
1603 { "rorA", { Eb
, CL
} },
1604 { "rclA", { Eb
, CL
} },
1605 { "rcrA", { Eb
, CL
} },
1606 { "shlA", { Eb
, CL
} },
1607 { "shrA", { Eb
, CL
} },
1608 { "(bad)", { XX
} },
1609 { "sarA", { Eb
, CL
} },
1613 { "rolQ", { Ev
, CL
} },
1614 { "rorQ", { Ev
, CL
} },
1615 { "rclQ", { Ev
, CL
} },
1616 { "rcrQ", { Ev
, CL
} },
1617 { "shlQ", { Ev
, CL
} },
1618 { "shrQ", { Ev
, CL
} },
1619 { "(bad)", { XX
} },
1620 { "sarQ", { Ev
, CL
} },
1624 { "testA", { Eb
, Ib
} },
1625 { "(bad)", { XX
} },
1628 { "mulA", { Eb
} }, /* Don't print the implicit %al register, */
1629 { "imulA", { Eb
} }, /* to distinguish these opcodes from other */
1630 { "divA", { Eb
} }, /* mul/imul opcodes. Do the same for div */
1631 { "idivA", { Eb
} }, /* and idiv for consistency. */
1635 { "testQ", { Ev
, Iv
} },
1636 { "(bad)", { XX
} },
1639 { "mulQ", { Ev
} }, /* Don't print the implicit register. */
1640 { "imulQ", { Ev
} },
1642 { "idivQ", { Ev
} },
1648 { "(bad)", { XX
} },
1649 { "(bad)", { XX
} },
1650 { "(bad)", { XX
} },
1651 { "(bad)", { XX
} },
1652 { "(bad)", { XX
} },
1653 { "(bad)", { XX
} },
1659 { "callT", { indirEv
} },
1660 { "JcallT", { indirEp
} },
1661 { "jmpT", { indirEv
} },
1662 { "JjmpT", { indirEp
} },
1663 { "pushU", { stackEv
} },
1664 { "(bad)", { XX
} },
1668 { "sldtD", { Sv
} },
1674 { "(bad)", { XX
} },
1675 { "(bad)", { XX
} },
1679 { MOD_TABLE (MOD_0F01_REG_0
) },
1680 { MOD_TABLE (MOD_0F01_REG_1
) },
1681 { MOD_TABLE (MOD_0F01_REG_2
) },
1682 { MOD_TABLE (MOD_0F01_REG_3
) },
1683 { "smswD", { Sv
} },
1684 { "(bad)", { XX
} },
1686 { MOD_TABLE (MOD_0F01_REG_7
) },
1690 { "prefetch", { Eb
} },
1691 { "prefetchw", { Eb
} },
1692 { "(bad)", { XX
} },
1693 { "(bad)", { XX
} },
1694 { "(bad)", { XX
} },
1695 { "(bad)", { XX
} },
1696 { "(bad)", { XX
} },
1697 { "(bad)", { XX
} },
1701 { MOD_TABLE (MOD_0F18_REG_0
) },
1702 { MOD_TABLE (MOD_0F18_REG_1
) },
1703 { MOD_TABLE (MOD_0F18_REG_2
) },
1704 { MOD_TABLE (MOD_0F18_REG_3
) },
1705 { "(bad)", { XX
} },
1706 { "(bad)", { XX
} },
1707 { "(bad)", { XX
} },
1708 { "(bad)", { XX
} },
1712 { "(bad)", { XX
} },
1713 { "(bad)", { XX
} },
1714 { MOD_TABLE (MOD_0F71_REG_2
) },
1715 { "(bad)", { XX
} },
1716 { MOD_TABLE (MOD_0F71_REG_4
) },
1717 { "(bad)", { XX
} },
1718 { MOD_TABLE (MOD_0F71_REG_6
) },
1719 { "(bad)", { XX
} },
1723 { "(bad)", { XX
} },
1724 { "(bad)", { XX
} },
1725 { MOD_TABLE (MOD_0F72_REG_2
) },
1726 { "(bad)", { XX
} },
1727 { MOD_TABLE (MOD_0F72_REG_4
) },
1728 { "(bad)", { XX
} },
1729 { MOD_TABLE (MOD_0F72_REG_6
) },
1730 { "(bad)", { XX
} },
1734 { "(bad)", { XX
} },
1735 { "(bad)", { XX
} },
1736 { MOD_TABLE (MOD_0F73_REG_2
) },
1737 { MOD_TABLE (MOD_0F73_REG_3
) },
1738 { "(bad)", { XX
} },
1739 { "(bad)", { XX
} },
1740 { MOD_TABLE (MOD_0F73_REG_6
) },
1741 { MOD_TABLE (MOD_0F73_REG_7
) },
1745 { "montmul", { { OP_0f07
, 0 } } },
1746 { "xsha1", { { OP_0f07
, 0 } } },
1747 { "xsha256", { { OP_0f07
, 0 } } },
1748 { "(bad)", { { OP_0f07
, 0 } } },
1749 { "(bad)", { { OP_0f07
, 0 } } },
1750 { "(bad)", { { OP_0f07
, 0 } } },
1751 { "(bad)", { { OP_0f07
, 0 } } },
1752 { "(bad)", { { OP_0f07
, 0 } } },
1756 { "xstore-rng", { { OP_0f07
, 0 } } },
1757 { "xcrypt-ecb", { { OP_0f07
, 0 } } },
1758 { "xcrypt-cbc", { { OP_0f07
, 0 } } },
1759 { "xcrypt-ctr", { { OP_0f07
, 0 } } },
1760 { "xcrypt-cfb", { { OP_0f07
, 0 } } },
1761 { "xcrypt-ofb", { { OP_0f07
, 0 } } },
1762 { "(bad)", { { OP_0f07
, 0 } } },
1763 { "(bad)", { { OP_0f07
, 0 } } },
1767 { MOD_TABLE (MOD_0FAE_REG_0
) },
1768 { MOD_TABLE (MOD_0FAE_REG_1
) },
1769 { MOD_TABLE (MOD_0FAE_REG_2
) },
1770 { MOD_TABLE (MOD_0FAE_REG_3
) },
1771 { MOD_TABLE (MOD_0FAE_REG_4
) },
1772 { MOD_TABLE (MOD_0FAE_REG_5
) },
1773 { MOD_TABLE (MOD_0FAE_REG_6
) },
1774 { MOD_TABLE (MOD_0FAE_REG_7
) },
1778 { "(bad)", { XX
} },
1779 { "(bad)", { XX
} },
1780 { "(bad)", { XX
} },
1781 { "(bad)", { XX
} },
1782 { "btQ", { Ev
, Ib
} },
1783 { "btsQ", { Ev
, Ib
} },
1784 { "btrQ", { Ev
, Ib
} },
1785 { "btcQ", { Ev
, Ib
} },
1789 { "(bad)", { XX
} },
1790 { "cmpxchg8b", { { CMPXCHG8B_Fixup
, q_mode
} } },
1791 { "(bad)", { XX
} },
1792 { "(bad)", { XX
} },
1793 { "(bad)", { XX
} },
1794 { "(bad)", { XX
} },
1795 { MOD_TABLE (MOD_0FC7_REG_6
) },
1796 { MOD_TABLE (MOD_0FC7_REG_7
) },
1800 static const struct dis386 prefix_table
[][4] = {
1803 { "xchgS", { { NOP_Fixup1
, eAX_reg
}, { NOP_Fixup2
, eAX_reg
} } },
1804 { "pause", { XX
} },
1805 { "xchgS", { { NOP_Fixup1
, eAX_reg
}, { NOP_Fixup2
, eAX_reg
} } },
1806 { "(bad)", { XX
} },
1811 { "movups", { XM
, EXx
} },
1812 { "movss", { XM
, EXd
} },
1813 { "movupd", { XM
, EXx
} },
1814 { "movsd", { XM
, EXq
} },
1819 { "movups", { EXx
, XM
} },
1820 { "movss", { EXd
, XM
} },
1821 { "movupd", { EXx
, XM
} },
1822 { "movsd", { EXq
, XM
} },
1827 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
1828 { "movsldup", { XM
, EXx
} },
1829 { "movlpd", { XM
, EXq
} },
1830 { "movddup", { XM
, EXq
} },
1835 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
1836 { "movshdup", { XM
, EXx
} },
1837 { "movhpd", { XM
, EXq
} },
1838 { "(bad)", { XX
} },
1843 { "cvtpi2ps", { XM
, EMCq
} },
1844 { "cvtsi2ss%LQ", { XM
, Ev
} },
1845 { "cvtpi2pd", { XM
, EMCq
} },
1846 { "cvtsi2sd%LQ", { XM
, Ev
} },
1851 { MOD_TABLE (MOD_0F2B_PREFIX_0
) },
1852 { MOD_TABLE (MOD_0F2B_PREFIX_1
) },
1853 { MOD_TABLE (MOD_0F2B_PREFIX_2
) },
1854 { MOD_TABLE (MOD_0F2B_PREFIX_3
) },
1859 { "cvttps2pi", { MXC
, EXq
} },
1860 { "cvttss2siY", { Gv
, EXd
} },
1861 { "cvttpd2pi", { MXC
, EXx
} },
1862 { "cvttsd2siY", { Gv
, EXq
} },
1867 { "cvtps2pi", { MXC
, EXq
} },
1868 { "cvtss2siY", { Gv
, EXd
} },
1869 { "cvtpd2pi", { MXC
, EXx
} },
1870 { "cvtsd2siY", { Gv
, EXq
} },
1875 { "ucomiss",{ XM
, EXd
} },
1876 { "(bad)", { XX
} },
1877 { "ucomisd",{ XM
, EXq
} },
1878 { "(bad)", { XX
} },
1883 { "comiss", { XM
, EXd
} },
1884 { "(bad)", { XX
} },
1885 { "comisd", { XM
, EXq
} },
1886 { "(bad)", { XX
} },
1891 { "sqrtps", { XM
, EXx
} },
1892 { "sqrtss", { XM
, EXd
} },
1893 { "sqrtpd", { XM
, EXx
} },
1894 { "sqrtsd", { XM
, EXq
} },
1899 { "rsqrtps",{ XM
, EXx
} },
1900 { "rsqrtss",{ XM
, EXd
} },
1901 { "(bad)", { XX
} },
1902 { "(bad)", { XX
} },
1907 { "rcpps", { XM
, EXx
} },
1908 { "rcpss", { XM
, EXd
} },
1909 { "(bad)", { XX
} },
1910 { "(bad)", { XX
} },
1915 { "addps", { XM
, EXx
} },
1916 { "addss", { XM
, EXd
} },
1917 { "addpd", { XM
, EXx
} },
1918 { "addsd", { XM
, EXq
} },
1923 { "mulps", { XM
, EXx
} },
1924 { "mulss", { XM
, EXd
} },
1925 { "mulpd", { XM
, EXx
} },
1926 { "mulsd", { XM
, EXq
} },
1931 { "cvtps2pd", { XM
, EXq
} },
1932 { "cvtss2sd", { XM
, EXd
} },
1933 { "cvtpd2ps", { XM
, EXx
} },
1934 { "cvtsd2ss", { XM
, EXq
} },
1939 { "cvtdq2ps", { XM
, EXx
} },
1940 { "cvttps2dq", { XM
, EXx
} },
1941 { "cvtps2dq", { XM
, EXx
} },
1942 { "(bad)", { XX
} },
1947 { "subps", { XM
, EXx
} },
1948 { "subss", { XM
, EXd
} },
1949 { "subpd", { XM
, EXx
} },
1950 { "subsd", { XM
, EXq
} },
1955 { "minps", { XM
, EXx
} },
1956 { "minss", { XM
, EXd
} },
1957 { "minpd", { XM
, EXx
} },
1958 { "minsd", { XM
, EXq
} },
1963 { "divps", { XM
, EXx
} },
1964 { "divss", { XM
, EXd
} },
1965 { "divpd", { XM
, EXx
} },
1966 { "divsd", { XM
, EXq
} },
1971 { "maxps", { XM
, EXx
} },
1972 { "maxss", { XM
, EXd
} },
1973 { "maxpd", { XM
, EXx
} },
1974 { "maxsd", { XM
, EXq
} },
1979 { "punpcklbw",{ MX
, EMd
} },
1980 { "(bad)", { XX
} },
1981 { "punpcklbw",{ MX
, EMx
} },
1982 { "(bad)", { XX
} },
1987 { "punpcklwd",{ MX
, EMd
} },
1988 { "(bad)", { XX
} },
1989 { "punpcklwd",{ MX
, EMx
} },
1990 { "(bad)", { XX
} },
1995 { "punpckldq",{ MX
, EMd
} },
1996 { "(bad)", { XX
} },
1997 { "punpckldq",{ MX
, EMx
} },
1998 { "(bad)", { XX
} },
2003 { "(bad)", { XX
} },
2004 { "(bad)", { XX
} },
2005 { "punpcklqdq", { XM
, EXx
} },
2006 { "(bad)", { XX
} },
2011 { "(bad)", { XX
} },
2012 { "(bad)", { XX
} },
2013 { "punpckhqdq", { XM
, EXx
} },
2014 { "(bad)", { XX
} },
2019 { "movq", { MX
, EM
} },
2020 { "movdqu", { XM
, EXx
} },
2021 { "movdqa", { XM
, EXx
} },
2022 { "(bad)", { XX
} },
2027 { "pshufw", { MX
, EM
, Ib
} },
2028 { "pshufhw",{ XM
, EXx
, Ib
} },
2029 { "pshufd", { XM
, EXx
, Ib
} },
2030 { "pshuflw",{ XM
, EXx
, Ib
} },
2033 /* PREFIX_0F73_REG_3 */
2035 { "(bad)", { XX
} },
2036 { "(bad)", { XX
} },
2037 { "psrldq", { XS
, Ib
} },
2038 { "(bad)", { XX
} },
2041 /* PREFIX_0F73_REG_7 */
2043 { "(bad)", { XX
} },
2044 { "(bad)", { XX
} },
2045 { "pslldq", { XS
, Ib
} },
2046 { "(bad)", { XX
} },
2051 {"vmread", { Em
, Gm
} },
2053 {"extrq", { XS
, Ib
, Ib
} },
2054 {"insertq", { XM
, XS
, Ib
, Ib
} },
2059 {"vmwrite", { Gm
, Em
} },
2061 {"extrq", { XM
, XS
} },
2062 {"insertq", { XM
, XS
} },
2067 { "(bad)", { XX
} },
2068 { "(bad)", { XX
} },
2069 { "haddpd", { XM
, EXx
} },
2070 { "haddps", { XM
, EXx
} },
2075 { "(bad)", { XX
} },
2076 { "(bad)", { XX
} },
2077 { "hsubpd", { XM
, EXx
} },
2078 { "hsubps", { XM
, EXx
} },
2083 { "movK", { Edq
, MX
} },
2084 { "movq", { XM
, EXq
} },
2085 { "movK", { Edq
, XM
} },
2086 { "(bad)", { XX
} },
2091 { "movq", { EM
, MX
} },
2092 { "movdqu", { EXx
, XM
} },
2093 { "movdqa", { EXx
, XM
} },
2094 { "(bad)", { XX
} },
2099 { "(bad)", { XX
} },
2100 { "popcntS", { Gv
, Ev
} },
2101 { "(bad)", { XX
} },
2102 { "(bad)", { XX
} },
2107 { "bsrS", { Gv
, Ev
} },
2108 { "lzcntS", { Gv
, Ev
} },
2109 { "bsrS", { Gv
, Ev
} },
2110 { "(bad)", { XX
} },
2115 { "cmpps", { XM
, EXx
, CMP
} },
2116 { "cmpss", { XM
, EXd
, CMP
} },
2117 { "cmppd", { XM
, EXx
, CMP
} },
2118 { "cmpsd", { XM
, EXq
, CMP
} },
2123 { "movntiS", { Ma
, Gv
} },
2124 { "(bad)", { XX
} },
2125 { "(bad)", { XX
} },
2126 { "(bad)", { XX
} },
2129 /* PREFIX_0FC7_REG_6 */
2131 { "vmptrld",{ Mq
} },
2132 { "vmxon", { Mq
} },
2133 { "vmclear",{ Mq
} },
2134 { "(bad)", { XX
} },
2139 { "(bad)", { XX
} },
2140 { "(bad)", { XX
} },
2141 { "addsubpd", { XM
, EXx
} },
2142 { "addsubps", { XM
, EXx
} },
2147 { "(bad)", { XX
} },
2148 { "movq2dq",{ XM
, MS
} },
2149 { "movq", { EXq
, XM
} },
2150 { "movdq2q",{ MX
, XS
} },
2155 { "(bad)", { XX
} },
2156 { "cvtdq2pd", { XM
, EXq
} },
2157 { "cvttpd2dq", { XM
, EXx
} },
2158 { "cvtpd2dq", { XM
, EXx
} },
2163 { "movntq", { Mq
, MX
} },
2164 { "(bad)", { XX
} },
2165 { MOD_TABLE (MOD_0FE7_PREFIX_2
) },
2166 { "(bad)", { XX
} },
2171 { "(bad)", { XX
} },
2172 { "(bad)", { XX
} },
2173 { "(bad)", { XX
} },
2174 { MOD_TABLE (MOD_0FF0_PREFIX_3
) },
2179 { "maskmovq", { MX
, MS
} },
2180 { "(bad)", { XX
} },
2181 { "maskmovdqu", { XM
, XS
} },
2182 { "(bad)", { XX
} },
2187 { "(bad)", { XX
} },
2188 { "(bad)", { XX
} },
2189 { "pblendvb", { XM
, EXx
, XMM0
} },
2190 { "(bad)", { XX
} },
2195 { "(bad)", { XX
} },
2196 { "(bad)", { XX
} },
2197 { "blendvps", { XM
, EXx
, XMM0
} },
2198 { "(bad)", { XX
} },
2203 { "(bad)", { XX
} },
2204 { "(bad)", { XX
} },
2205 { "blendvpd", { XM
, EXx
, XMM0
} },
2206 { "(bad)", { XX
} },
2211 { "(bad)", { XX
} },
2212 { "(bad)", { XX
} },
2213 { "ptest", { XM
, EXx
} },
2214 { "(bad)", { XX
} },
2219 { "(bad)", { XX
} },
2220 { "(bad)", { XX
} },
2221 { "pmovsxbw", { XM
, EXq
} },
2222 { "(bad)", { XX
} },
2227 { "(bad)", { XX
} },
2228 { "(bad)", { XX
} },
2229 { "pmovsxbd", { XM
, EXd
} },
2230 { "(bad)", { XX
} },
2235 { "(bad)", { XX
} },
2236 { "(bad)", { XX
} },
2237 { "pmovsxbq", { XM
, EXw
} },
2238 { "(bad)", { XX
} },
2243 { "(bad)", { XX
} },
2244 { "(bad)", { XX
} },
2245 { "pmovsxwd", { XM
, EXq
} },
2246 { "(bad)", { XX
} },
2251 { "(bad)", { XX
} },
2252 { "(bad)", { XX
} },
2253 { "pmovsxwq", { XM
, EXd
} },
2254 { "(bad)", { XX
} },
2259 { "(bad)", { XX
} },
2260 { "(bad)", { XX
} },
2261 { "pmovsxdq", { XM
, EXq
} },
2262 { "(bad)", { XX
} },
2267 { "(bad)", { XX
} },
2268 { "(bad)", { XX
} },
2269 { "pmuldq", { XM
, EXx
} },
2270 { "(bad)", { XX
} },
2275 { "(bad)", { XX
} },
2276 { "(bad)", { XX
} },
2277 { "pcmpeqq", { XM
, EXx
} },
2278 { "(bad)", { XX
} },
2283 { "(bad)", { XX
} },
2284 { "(bad)", { XX
} },
2285 { MOD_TABLE (MOD_0F382A_PREFIX_2
) },
2286 { "(bad)", { XX
} },
2291 { "(bad)", { XX
} },
2292 { "(bad)", { XX
} },
2293 { "packusdw", { XM
, EXx
} },
2294 { "(bad)", { XX
} },
2299 { "(bad)", { XX
} },
2300 { "(bad)", { XX
} },
2301 { "pmovzxbw", { XM
, EXq
} },
2302 { "(bad)", { XX
} },
2307 { "(bad)", { XX
} },
2308 { "(bad)", { XX
} },
2309 { "pmovzxbd", { XM
, EXd
} },
2310 { "(bad)", { XX
} },
2315 { "(bad)", { XX
} },
2316 { "(bad)", { XX
} },
2317 { "pmovzxbq", { XM
, EXw
} },
2318 { "(bad)", { XX
} },
2323 { "(bad)", { XX
} },
2324 { "(bad)", { XX
} },
2325 { "pmovzxwd", { XM
, EXq
} },
2326 { "(bad)", { XX
} },
2331 { "(bad)", { XX
} },
2332 { "(bad)", { XX
} },
2333 { "pmovzxwq", { XM
, EXd
} },
2334 { "(bad)", { XX
} },
2339 { "(bad)", { XX
} },
2340 { "(bad)", { XX
} },
2341 { "pmovzxdq", { XM
, EXq
} },
2342 { "(bad)", { XX
} },
2347 { "(bad)", { XX
} },
2348 { "(bad)", { XX
} },
2349 { "pcmpgtq", { XM
, EXx
} },
2350 { "(bad)", { XX
} },
2355 { "(bad)", { XX
} },
2356 { "(bad)", { XX
} },
2357 { "pminsb", { XM
, EXx
} },
2358 { "(bad)", { XX
} },
2363 { "(bad)", { XX
} },
2364 { "(bad)", { XX
} },
2365 { "pminsd", { XM
, EXx
} },
2366 { "(bad)", { XX
} },
2371 { "(bad)", { XX
} },
2372 { "(bad)", { XX
} },
2373 { "pminuw", { XM
, EXx
} },
2374 { "(bad)", { XX
} },
2379 { "(bad)", { XX
} },
2380 { "(bad)", { XX
} },
2381 { "pminud", { XM
, EXx
} },
2382 { "(bad)", { XX
} },
2387 { "(bad)", { XX
} },
2388 { "(bad)", { XX
} },
2389 { "pmaxsb", { XM
, EXx
} },
2390 { "(bad)", { XX
} },
2395 { "(bad)", { XX
} },
2396 { "(bad)", { XX
} },
2397 { "pmaxsd", { XM
, EXx
} },
2398 { "(bad)", { XX
} },
2403 { "(bad)", { XX
} },
2404 { "(bad)", { XX
} },
2405 { "pmaxuw", { XM
, EXx
} },
2406 { "(bad)", { XX
} },
2411 { "(bad)", { XX
} },
2412 { "(bad)", { XX
} },
2413 { "pmaxud", { XM
, EXx
} },
2414 { "(bad)", { XX
} },
2419 { "(bad)", { XX
} },
2420 { "(bad)", { XX
} },
2421 { "pmulld", { XM
, EXx
} },
2422 { "(bad)", { XX
} },
2427 { "(bad)", { XX
} },
2428 { "(bad)", { XX
} },
2429 { "phminposuw", { XM
, EXx
} },
2430 { "(bad)", { XX
} },
2435 { "(bad)", { XX
} },
2436 { "(bad)", { XX
} },
2437 { "(bad)", { XX
} },
2438 { "crc32", { Gdq
, { CRC32_Fixup
, b_mode
} } },
2443 { "(bad)", { XX
} },
2444 { "(bad)", { XX
} },
2445 { "(bad)", { XX
} },
2446 { "crc32", { Gdq
, { CRC32_Fixup
, v_mode
} } },
2451 { "(bad)", { XX
} },
2452 { "(bad)", { XX
} },
2453 { "roundps", { XM
, EXx
, Ib
} },
2454 { "(bad)", { XX
} },
2459 { "(bad)", { XX
} },
2460 { "(bad)", { XX
} },
2461 { "roundpd", { XM
, EXx
, Ib
} },
2462 { "(bad)", { XX
} },
2467 { "(bad)", { XX
} },
2468 { "(bad)", { XX
} },
2469 { "roundss", { XM
, EXd
, Ib
} },
2470 { "(bad)", { XX
} },
2475 { "(bad)", { XX
} },
2476 { "(bad)", { XX
} },
2477 { "roundsd", { XM
, EXq
, Ib
} },
2478 { "(bad)", { XX
} },
2483 { "(bad)", { XX
} },
2484 { "(bad)", { XX
} },
2485 { "blendps", { XM
, EXx
, Ib
} },
2486 { "(bad)", { XX
} },
2491 { "(bad)", { XX
} },
2492 { "(bad)", { XX
} },
2493 { "blendpd", { XM
, EXx
, Ib
} },
2494 { "(bad)", { XX
} },
2499 { "(bad)", { XX
} },
2500 { "(bad)", { XX
} },
2501 { "pblendw", { XM
, EXx
, Ib
} },
2502 { "(bad)", { XX
} },
2507 { "(bad)", { XX
} },
2508 { "(bad)", { XX
} },
2509 { "pextrb", { Edqb
, XM
, Ib
} },
2510 { "(bad)", { XX
} },
2515 { "(bad)", { XX
} },
2516 { "(bad)", { XX
} },
2517 { "pextrw", { Edqw
, XM
, Ib
} },
2518 { "(bad)", { XX
} },
2523 { "(bad)", { XX
} },
2524 { "(bad)", { XX
} },
2525 { "pextrK", { Edq
, XM
, Ib
} },
2526 { "(bad)", { XX
} },
2531 { "(bad)", { XX
} },
2532 { "(bad)", { XX
} },
2533 { "extractps", { Edqd
, XM
, Ib
} },
2534 { "(bad)", { XX
} },
2539 { "(bad)", { XX
} },
2540 { "(bad)", { XX
} },
2541 { "pinsrb", { XM
, Edqb
, Ib
} },
2542 { "(bad)", { XX
} },
2547 { "(bad)", { XX
} },
2548 { "(bad)", { XX
} },
2549 { "insertps", { XM
, EXd
, Ib
} },
2550 { "(bad)", { XX
} },
2555 { "(bad)", { XX
} },
2556 { "(bad)", { XX
} },
2557 { "pinsrK", { XM
, Edq
, Ib
} },
2558 { "(bad)", { XX
} },
2563 { "(bad)", { XX
} },
2564 { "(bad)", { XX
} },
2565 { "dpps", { XM
, EXx
, Ib
} },
2566 { "(bad)", { XX
} },
2571 { "(bad)", { XX
} },
2572 { "(bad)", { XX
} },
2573 { "dppd", { XM
, EXx
, Ib
} },
2574 { "(bad)", { XX
} },
2579 { "(bad)", { XX
} },
2580 { "(bad)", { XX
} },
2581 { "mpsadbw", { XM
, EXx
, Ib
} },
2582 { "(bad)", { XX
} },
2587 { "(bad)", { XX
} },
2588 { "(bad)", { XX
} },
2589 { "pcmpestrm", { XM
, EXx
, Ib
} },
2590 { "(bad)", { XX
} },
2595 { "(bad)", { XX
} },
2596 { "(bad)", { XX
} },
2597 { "pcmpestri", { XM
, EXx
, Ib
} },
2598 { "(bad)", { XX
} },
2603 { "(bad)", { XX
} },
2604 { "(bad)", { XX
} },
2605 { "pcmpistrm", { XM
, EXx
, Ib
} },
2606 { "(bad)", { XX
} },
2611 { "(bad)", { XX
} },
2612 { "(bad)", { XX
} },
2613 { "pcmpistri", { XM
, EXx
, Ib
} },
2614 { "(bad)", { XX
} },
2618 static const struct dis386 x86_64_table
[][2] = {
2621 { "push{T|}", { es
} },
2622 { "(bad)", { XX
} },
2627 { "pop{T|}", { es
} },
2628 { "(bad)", { XX
} },
2633 { "push{T|}", { cs
} },
2634 { "(bad)", { XX
} },
2639 { "push{T|}", { ss
} },
2640 { "(bad)", { XX
} },
2645 { "pop{T|}", { ss
} },
2646 { "(bad)", { XX
} },
2651 { "push{T|}", { ds
} },
2652 { "(bad)", { XX
} },
2657 { "pop{T|}", { ds
} },
2658 { "(bad)", { XX
} },
2664 { "(bad)", { XX
} },
2670 { "(bad)", { XX
} },
2676 { "(bad)", { XX
} },
2682 { "(bad)", { XX
} },
2687 { "pusha{P|}", { XX
} },
2688 { "(bad)", { XX
} },
2693 { "popa{P|}", { XX
} },
2694 { "(bad)", { XX
} },
2699 { MOD_TABLE (MOD_62_32BIT
) },
2700 { "(bad)", { XX
} },
2705 { "arpl", { Ew
, Gw
} },
2706 { "movs{lq|xd}", { Gv
, Ed
} },
2711 { "ins{R|}", { Yzr
, indirDX
} },
2712 { "ins{G|}", { Yzr
, indirDX
} },
2717 { "outs{R|}", { indirDXr
, Xz
} },
2718 { "outs{G|}", { indirDXr
, Xz
} },
2723 { "Jcall{T|}", { Ap
} },
2724 { "(bad)", { XX
} },
2729 { MOD_TABLE (MOD_C4_32BIT
) },
2730 { "(bad)", { XX
} },
2735 { MOD_TABLE (MOD_C5_32BIT
) },
2736 { "(bad)", { XX
} },
2742 { "(bad)", { XX
} },
2748 { "(bad)", { XX
} },
2754 { "(bad)", { XX
} },
2759 { "Jjmp{T|}", { Ap
} },
2760 { "(bad)", { XX
} },
2763 /* X86_64_0F01_REG_0 */
2765 { "sgdt{Q|IQ}", { M
} },
2769 /* X86_64_0F01_REG_1 */
2771 { "sidt{Q|IQ}", { M
} },
2775 /* X86_64_0F01_REG_2 */
2777 { "lgdt{Q|Q}", { M
} },
2781 /* X86_64_0F01_REG_3 */
2783 { "lidt{Q|Q}", { M
} },
2788 static const struct dis386 three_byte_table
[][256] = {
2789 /* THREE_BYTE_0F24 */
2792 { "fmaddps", { { OP_DREX4
, q_mode
} } },
2793 { "fmaddpd", { { OP_DREX4
, q_mode
} } },
2794 { "fmaddss", { { OP_DREX4
, w_mode
} } },
2795 { "fmaddsd", { { OP_DREX4
, d_mode
} } },
2796 { "fmaddps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2797 { "fmaddpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2798 { "fmaddss", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2799 { "fmaddsd", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2801 { "fmsubps", { { OP_DREX4
, q_mode
} } },
2802 { "fmsubpd", { { OP_DREX4
, q_mode
} } },
2803 { "fmsubss", { { OP_DREX4
, w_mode
} } },
2804 { "fmsubsd", { { OP_DREX4
, d_mode
} } },
2805 { "fmsubps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2806 { "fmsubpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2807 { "fmsubss", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2808 { "fmsubsd", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2810 { "fnmaddps", { { OP_DREX4
, q_mode
} } },
2811 { "fnmaddpd", { { OP_DREX4
, q_mode
} } },
2812 { "fnmaddss", { { OP_DREX4
, w_mode
} } },
2813 { "fnmaddsd", { { OP_DREX4
, d_mode
} } },
2814 { "fnmaddps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2815 { "fnmaddpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2816 { "fnmaddss", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2817 { "fnmaddsd", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2819 { "fnmsubps", { { OP_DREX4
, q_mode
} } },
2820 { "fnmsubpd", { { OP_DREX4
, q_mode
} } },
2821 { "fnmsubss", { { OP_DREX4
, w_mode
} } },
2822 { "fnmsubsd", { { OP_DREX4
, d_mode
} } },
2823 { "fnmsubps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2824 { "fnmsubpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2825 { "fnmsubss", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2826 { "fnmsubsd", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2828 { "permps", { { OP_DREX4
, q_mode
} } },
2829 { "permpd", { { OP_DREX4
, q_mode
} } },
2830 { "pcmov", { { OP_DREX4
, q_mode
} } },
2831 { "pperm", { { OP_DREX4
, q_mode
} } },
2832 { "permps", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2833 { "permpd", { { OP_DREX4
, DREX_OC1
+ q_mode
} } },
2834 { "pcmov", { { OP_DREX4
, DREX_OC1
+ w_mode
} } },
2835 { "pperm", { { OP_DREX4
, DREX_OC1
+ d_mode
} } },
2837 { "(bad)", { XX
} },
2838 { "(bad)", { XX
} },
2839 { "(bad)", { XX
} },
2840 { "(bad)", { XX
} },
2841 { "(bad)", { XX
} },
2842 { "(bad)", { XX
} },
2843 { "(bad)", { XX
} },
2844 { "(bad)", { XX
} },
2846 { "(bad)", { XX
} },
2847 { "(bad)", { XX
} },
2848 { "(bad)", { XX
} },
2849 { "(bad)", { XX
} },
2850 { "(bad)", { XX
} },
2851 { "(bad)", { XX
} },
2852 { "(bad)", { XX
} },
2853 { "(bad)", { XX
} },
2855 { "(bad)", { XX
} },
2856 { "(bad)", { XX
} },
2857 { "(bad)", { XX
} },
2858 { "(bad)", { XX
} },
2859 { "(bad)", { XX
} },
2860 { "(bad)", { XX
} },
2861 { "(bad)", { XX
} },
2862 { "(bad)", { XX
} },
2864 { "protb", { { OP_DREX3
, q_mode
} } },
2865 { "protw", { { OP_DREX3
, q_mode
} } },
2866 { "protd", { { OP_DREX3
, q_mode
} } },
2867 { "protq", { { OP_DREX3
, q_mode
} } },
2868 { "pshlb", { { OP_DREX3
, q_mode
} } },
2869 { "pshlw", { { OP_DREX3
, q_mode
} } },
2870 { "pshld", { { OP_DREX3
, q_mode
} } },
2871 { "pshlq", { { OP_DREX3
, q_mode
} } },
2873 { "pshab", { { OP_DREX3
, q_mode
} } },
2874 { "pshaw", { { OP_DREX3
, q_mode
} } },
2875 { "pshad", { { OP_DREX3
, q_mode
} } },
2876 { "pshaq", { { OP_DREX3
, q_mode
} } },
2877 { "(bad)", { XX
} },
2878 { "(bad)", { XX
} },
2879 { "(bad)", { XX
} },
2880 { "(bad)", { XX
} },
2882 { "(bad)", { XX
} },
2883 { "(bad)", { XX
} },
2884 { "(bad)", { XX
} },
2885 { "(bad)", { XX
} },
2886 { "(bad)", { XX
} },
2887 { "(bad)", { XX
} },
2888 { "(bad)", { XX
} },
2889 { "(bad)", { XX
} },
2891 { "(bad)", { XX
} },
2892 { "(bad)", { XX
} },
2893 { "(bad)", { XX
} },
2894 { "(bad)", { XX
} },
2895 { "(bad)", { XX
} },
2896 { "(bad)", { XX
} },
2897 { "(bad)", { XX
} },
2898 { "(bad)", { XX
} },
2900 { "(bad)", { XX
} },
2901 { "(bad)", { XX
} },
2902 { "(bad)", { XX
} },
2903 { "(bad)", { XX
} },
2904 { "(bad)", { XX
} },
2905 { "(bad)", { XX
} },
2906 { "(bad)", { XX
} },
2907 { "(bad)", { XX
} },
2909 { "(bad)", { XX
} },
2910 { "(bad)", { XX
} },
2911 { "(bad)", { XX
} },
2912 { "(bad)", { XX
} },
2913 { "(bad)", { XX
} },
2914 { "(bad)", { XX
} },
2915 { "(bad)", { XX
} },
2916 { "(bad)", { XX
} },
2918 { "(bad)", { XX
} },
2919 { "(bad)", { XX
} },
2920 { "(bad)", { XX
} },
2921 { "(bad)", { XX
} },
2922 { "(bad)", { XX
} },
2923 { "(bad)", { XX
} },
2924 { "(bad)", { XX
} },
2925 { "(bad)", { XX
} },
2927 { "(bad)", { XX
} },
2928 { "(bad)", { XX
} },
2929 { "(bad)", { XX
} },
2930 { "(bad)", { XX
} },
2931 { "(bad)", { XX
} },
2932 { "(bad)", { XX
} },
2933 { "(bad)", { XX
} },
2934 { "(bad)", { XX
} },
2936 { "(bad)", { XX
} },
2937 { "(bad)", { XX
} },
2938 { "(bad)", { XX
} },
2939 { "(bad)", { XX
} },
2940 { "(bad)", { XX
} },
2941 { "pmacssww", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2942 { "pmacsswd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2943 { "pmacssdql", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2945 { "(bad)", { XX
} },
2946 { "(bad)", { XX
} },
2947 { "(bad)", { XX
} },
2948 { "(bad)", { XX
} },
2949 { "(bad)", { XX
} },
2950 { "(bad)", { XX
} },
2951 { "pmacssdd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2952 { "pmacssdqh", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2954 { "(bad)", { XX
} },
2955 { "(bad)", { XX
} },
2956 { "(bad)", { XX
} },
2957 { "(bad)", { XX
} },
2958 { "(bad)", { XX
} },
2959 { "pmacsww", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2960 { "pmacswd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2961 { "pmacsdql", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2963 { "(bad)", { XX
} },
2964 { "(bad)", { XX
} },
2965 { "(bad)", { XX
} },
2966 { "(bad)", { XX
} },
2967 { "(bad)", { XX
} },
2968 { "(bad)", { XX
} },
2969 { "pmacsdd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2970 { "pmacsdqh", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2972 { "(bad)", { XX
} },
2973 { "(bad)", { XX
} },
2974 { "(bad)", { XX
} },
2975 { "(bad)", { XX
} },
2976 { "(bad)", { XX
} },
2977 { "(bad)", { XX
} },
2978 { "pmadcsswd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2979 { "(bad)", { XX
} },
2981 { "(bad)", { XX
} },
2982 { "(bad)", { XX
} },
2983 { "(bad)", { XX
} },
2984 { "(bad)", { XX
} },
2985 { "(bad)", { XX
} },
2986 { "(bad)", { XX
} },
2987 { "(bad)", { XX
} },
2988 { "(bad)", { XX
} },
2990 { "(bad)", { XX
} },
2991 { "(bad)", { XX
} },
2992 { "(bad)", { XX
} },
2993 { "(bad)", { XX
} },
2994 { "(bad)", { XX
} },
2995 { "(bad)", { XX
} },
2996 { "pmadcswd", { { OP_DREX4
, DREX_OC1
+ DREX_NO_OC0
+ q_mode
} } },
2997 { "(bad)", { XX
} },
2999 { "(bad)", { XX
} },
3000 { "(bad)", { XX
} },
3001 { "(bad)", { XX
} },
3002 { "(bad)", { XX
} },
3003 { "(bad)", { XX
} },
3004 { "(bad)", { XX
} },
3005 { "(bad)", { XX
} },
3006 { "(bad)", { XX
} },
3008 { "(bad)", { XX
} },
3009 { "(bad)", { XX
} },
3010 { "(bad)", { XX
} },
3011 { "(bad)", { XX
} },
3012 { "(bad)", { XX
} },
3013 { "(bad)", { XX
} },
3014 { "(bad)", { XX
} },
3015 { "(bad)", { XX
} },
3017 { "(bad)", { XX
} },
3018 { "(bad)", { XX
} },
3019 { "(bad)", { XX
} },
3020 { "(bad)", { XX
} },
3021 { "(bad)", { XX
} },
3022 { "(bad)", { XX
} },
3023 { "(bad)", { XX
} },
3024 { "(bad)", { XX
} },
3026 { "(bad)", { XX
} },
3027 { "(bad)", { XX
} },
3028 { "(bad)", { XX
} },
3029 { "(bad)", { XX
} },
3030 { "(bad)", { XX
} },
3031 { "(bad)", { XX
} },
3032 { "(bad)", { XX
} },
3033 { "(bad)", { XX
} },
3035 { "(bad)", { XX
} },
3036 { "(bad)", { XX
} },
3037 { "(bad)", { XX
} },
3038 { "(bad)", { XX
} },
3039 { "(bad)", { XX
} },
3040 { "(bad)", { XX
} },
3041 { "(bad)", { XX
} },
3042 { "(bad)", { XX
} },
3044 { "(bad)", { XX
} },
3045 { "(bad)", { XX
} },
3046 { "(bad)", { XX
} },
3047 { "(bad)", { XX
} },
3048 { "(bad)", { XX
} },
3049 { "(bad)", { XX
} },
3050 { "(bad)", { XX
} },
3051 { "(bad)", { XX
} },
3053 { "(bad)", { XX
} },
3054 { "(bad)", { XX
} },
3055 { "(bad)", { XX
} },
3056 { "(bad)", { XX
} },
3057 { "(bad)", { XX
} },
3058 { "(bad)", { XX
} },
3059 { "(bad)", { XX
} },
3060 { "(bad)", { XX
} },
3062 { "(bad)", { XX
} },
3063 { "(bad)", { XX
} },
3064 { "(bad)", { XX
} },
3065 { "(bad)", { XX
} },
3066 { "(bad)", { XX
} },
3067 { "(bad)", { XX
} },
3068 { "(bad)", { XX
} },
3069 { "(bad)", { XX
} },
3071 { "(bad)", { XX
} },
3072 { "(bad)", { XX
} },
3073 { "(bad)", { XX
} },
3074 { "(bad)", { XX
} },
3075 { "(bad)", { XX
} },
3076 { "(bad)", { XX
} },
3077 { "(bad)", { XX
} },
3078 { "(bad)", { XX
} },
3080 /* THREE_BYTE_0F25 */
3083 { "(bad)", { XX
} },
3084 { "(bad)", { XX
} },
3085 { "(bad)", { XX
} },
3086 { "(bad)", { XX
} },
3087 { "(bad)", { XX
} },
3088 { "(bad)", { XX
} },
3089 { "(bad)", { XX
} },
3090 { "(bad)", { XX
} },
3092 { "(bad)", { XX
} },
3093 { "(bad)", { XX
} },
3094 { "(bad)", { XX
} },
3095 { "(bad)", { XX
} },
3096 { "(bad)", { XX
} },
3097 { "(bad)", { XX
} },
3098 { "(bad)", { XX
} },
3099 { "(bad)", { XX
} },
3101 { "(bad)", { XX
} },
3102 { "(bad)", { XX
} },
3103 { "(bad)", { XX
} },
3104 { "(bad)", { XX
} },
3105 { "(bad)", { XX
} },
3106 { "(bad)", { XX
} },
3107 { "(bad)", { XX
} },
3108 { "(bad)", { XX
} },
3110 { "(bad)", { XX
} },
3111 { "(bad)", { XX
} },
3112 { "(bad)", { XX
} },
3113 { "(bad)", { XX
} },
3114 { "(bad)", { XX
} },
3115 { "(bad)", { XX
} },
3116 { "(bad)", { XX
} },
3117 { "(bad)", { XX
} },
3119 { "(bad)", { XX
} },
3120 { "(bad)", { XX
} },
3121 { "(bad)", { XX
} },
3122 { "(bad)", { XX
} },
3123 { "(bad)", { XX
} },
3124 { "(bad)", { XX
} },
3125 { "(bad)", { XX
} },
3126 { "(bad)", { XX
} },
3128 { "(bad)", { XX
} },
3129 { "(bad)", { XX
} },
3130 { "(bad)", { XX
} },
3131 { "(bad)", { XX
} },
3132 { "comps", { { OP_DREX3
, q_mode
}, { OP_DREX_FCMP
, b_mode
} } },
3133 { "compd", { { OP_DREX3
, q_mode
}, { OP_DREX_FCMP
, b_mode
} } },
3134 { "comss", { { OP_DREX3
, w_mode
}, { OP_DREX_FCMP
, b_mode
} } },
3135 { "comsd", { { OP_DREX3
, d_mode
}, { OP_DREX_FCMP
, b_mode
} } },
3137 { "(bad)", { XX
} },
3138 { "(bad)", { XX
} },
3139 { "(bad)", { XX
} },
3140 { "(bad)", { XX
} },
3141 { "(bad)", { XX
} },
3142 { "(bad)", { XX
} },
3143 { "(bad)", { XX
} },
3144 { "(bad)", { XX
} },
3146 { "(bad)", { XX
} },
3147 { "(bad)", { XX
} },
3148 { "(bad)", { XX
} },
3149 { "(bad)", { XX
} },
3150 { "(bad)", { XX
} },
3151 { "(bad)", { XX
} },
3152 { "(bad)", { XX
} },
3153 { "(bad)", { XX
} },
3155 { "(bad)", { XX
} },
3156 { "(bad)", { XX
} },
3157 { "(bad)", { XX
} },
3158 { "(bad)", { XX
} },
3159 { "(bad)", { XX
} },
3160 { "(bad)", { XX
} },
3161 { "(bad)", { XX
} },
3162 { "(bad)", { XX
} },
3164 { "(bad)", { XX
} },
3165 { "(bad)", { XX
} },
3166 { "(bad)", { XX
} },
3167 { "(bad)", { XX
} },
3168 { "pcomb", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3169 { "pcomw", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3170 { "pcomd", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3171 { "pcomq", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3173 { "(bad)", { XX
} },
3174 { "(bad)", { XX
} },
3175 { "(bad)", { XX
} },
3176 { "(bad)", { XX
} },
3177 { "(bad)", { XX
} },
3178 { "(bad)", { XX
} },
3179 { "(bad)", { XX
} },
3180 { "(bad)", { XX
} },
3182 { "(bad)", { XX
} },
3183 { "(bad)", { XX
} },
3184 { "(bad)", { XX
} },
3185 { "(bad)", { XX
} },
3186 { "(bad)", { XX
} },
3187 { "(bad)", { XX
} },
3188 { "(bad)", { XX
} },
3189 { "(bad)", { XX
} },
3191 { "(bad)", { XX
} },
3192 { "(bad)", { XX
} },
3193 { "(bad)", { XX
} },
3194 { "(bad)", { XX
} },
3195 { "(bad)", { XX
} },
3196 { "(bad)", { XX
} },
3197 { "(bad)", { XX
} },
3198 { "(bad)", { XX
} },
3200 { "(bad)", { XX
} },
3201 { "(bad)", { XX
} },
3202 { "(bad)", { XX
} },
3203 { "(bad)", { XX
} },
3204 { "pcomub", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3205 { "pcomuw", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3206 { "pcomud", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3207 { "pcomuq", { { OP_DREX3
, q_mode
}, { OP_DREX_ICMP
, b_mode
} } },
3209 { "(bad)", { XX
} },
3210 { "(bad)", { XX
} },
3211 { "(bad)", { XX
} },
3212 { "(bad)", { XX
} },
3213 { "(bad)", { XX
} },
3214 { "(bad)", { XX
} },
3215 { "(bad)", { XX
} },
3216 { "(bad)", { XX
} },
3218 { "(bad)", { XX
} },
3219 { "(bad)", { XX
} },
3220 { "(bad)", { XX
} },
3221 { "(bad)", { XX
} },
3222 { "(bad)", { XX
} },
3223 { "(bad)", { XX
} },
3224 { "(bad)", { XX
} },
3225 { "(bad)", { XX
} },
3227 { "(bad)", { XX
} },
3228 { "(bad)", { XX
} },
3229 { "(bad)", { XX
} },
3230 { "(bad)", { XX
} },
3231 { "(bad)", { XX
} },
3232 { "(bad)", { XX
} },
3233 { "(bad)", { XX
} },
3234 { "(bad)", { XX
} },
3236 { "(bad)", { XX
} },
3237 { "(bad)", { XX
} },
3238 { "(bad)", { XX
} },
3239 { "(bad)", { XX
} },
3240 { "(bad)", { XX
} },
3241 { "(bad)", { XX
} },
3242 { "(bad)", { XX
} },
3243 { "(bad)", { XX
} },
3245 { "(bad)", { XX
} },
3246 { "(bad)", { XX
} },
3247 { "(bad)", { XX
} },
3248 { "(bad)", { XX
} },
3249 { "(bad)", { XX
} },
3250 { "(bad)", { XX
} },
3251 { "(bad)", { XX
} },
3252 { "(bad)", { XX
} },
3254 { "(bad)", { XX
} },
3255 { "(bad)", { XX
} },
3256 { "(bad)", { XX
} },
3257 { "(bad)", { XX
} },
3258 { "(bad)", { XX
} },
3259 { "(bad)", { XX
} },
3260 { "(bad)", { XX
} },
3261 { "(bad)", { XX
} },
3263 { "(bad)", { XX
} },
3264 { "(bad)", { XX
} },
3265 { "(bad)", { XX
} },
3266 { "(bad)", { XX
} },
3267 { "(bad)", { XX
} },
3268 { "(bad)", { XX
} },
3269 { "(bad)", { XX
} },
3270 { "(bad)", { XX
} },
3272 { "(bad)", { XX
} },
3273 { "(bad)", { XX
} },
3274 { "(bad)", { XX
} },
3275 { "(bad)", { XX
} },
3276 { "(bad)", { XX
} },
3277 { "(bad)", { XX
} },
3278 { "(bad)", { XX
} },
3279 { "(bad)", { XX
} },
3281 { "(bad)", { XX
} },
3282 { "(bad)", { XX
} },
3283 { "(bad)", { XX
} },
3284 { "(bad)", { XX
} },
3285 { "(bad)", { XX
} },
3286 { "(bad)", { XX
} },
3287 { "(bad)", { XX
} },
3288 { "(bad)", { XX
} },
3290 { "(bad)", { XX
} },
3291 { "(bad)", { XX
} },
3292 { "(bad)", { XX
} },
3293 { "(bad)", { XX
} },
3294 { "(bad)", { XX
} },
3295 { "(bad)", { XX
} },
3296 { "(bad)", { XX
} },
3297 { "(bad)", { XX
} },
3299 { "(bad)", { XX
} },
3300 { "(bad)", { XX
} },
3301 { "(bad)", { XX
} },
3302 { "(bad)", { XX
} },
3303 { "(bad)", { XX
} },
3304 { "(bad)", { XX
} },
3305 { "(bad)", { XX
} },
3306 { "(bad)", { XX
} },
3308 { "(bad)", { XX
} },
3309 { "(bad)", { XX
} },
3310 { "(bad)", { XX
} },
3311 { "(bad)", { XX
} },
3312 { "(bad)", { XX
} },
3313 { "(bad)", { XX
} },
3314 { "(bad)", { XX
} },
3315 { "(bad)", { XX
} },
3317 { "(bad)", { XX
} },
3318 { "(bad)", { XX
} },
3319 { "(bad)", { XX
} },
3320 { "(bad)", { XX
} },
3321 { "(bad)", { XX
} },
3322 { "(bad)", { XX
} },
3323 { "(bad)", { XX
} },
3324 { "(bad)", { XX
} },
3326 { "(bad)", { XX
} },
3327 { "(bad)", { XX
} },
3328 { "(bad)", { XX
} },
3329 { "(bad)", { XX
} },
3330 { "(bad)", { XX
} },
3331 { "(bad)", { XX
} },
3332 { "(bad)", { XX
} },
3333 { "(bad)", { XX
} },
3335 { "(bad)", { XX
} },
3336 { "(bad)", { XX
} },
3337 { "(bad)", { XX
} },
3338 { "(bad)", { XX
} },
3339 { "(bad)", { XX
} },
3340 { "(bad)", { XX
} },
3341 { "(bad)", { XX
} },
3342 { "(bad)", { XX
} },
3344 { "(bad)", { XX
} },
3345 { "(bad)", { XX
} },
3346 { "(bad)", { XX
} },
3347 { "(bad)", { XX
} },
3348 { "(bad)", { XX
} },
3349 { "(bad)", { XX
} },
3350 { "(bad)", { XX
} },
3351 { "(bad)", { XX
} },
3353 { "(bad)", { XX
} },
3354 { "(bad)", { XX
} },
3355 { "(bad)", { XX
} },
3356 { "(bad)", { XX
} },
3357 { "(bad)", { XX
} },
3358 { "(bad)", { XX
} },
3359 { "(bad)", { XX
} },
3360 { "(bad)", { XX
} },
3362 { "(bad)", { XX
} },
3363 { "(bad)", { XX
} },
3364 { "(bad)", { XX
} },
3365 { "(bad)", { XX
} },
3366 { "(bad)", { XX
} },
3367 { "(bad)", { XX
} },
3368 { "(bad)", { XX
} },
3369 { "(bad)", { XX
} },
3371 /* THREE_BYTE_0F38 */
3374 { "pshufb", { MX
, EM
} },
3375 { "phaddw", { MX
, EM
} },
3376 { "phaddd", { MX
, EM
} },
3377 { "phaddsw", { MX
, EM
} },
3378 { "pmaddubsw", { MX
, EM
} },
3379 { "phsubw", { MX
, EM
} },
3380 { "phsubd", { MX
, EM
} },
3381 { "phsubsw", { MX
, EM
} },
3383 { "psignb", { MX
, EM
} },
3384 { "psignw", { MX
, EM
} },
3385 { "psignd", { MX
, EM
} },
3386 { "pmulhrsw", { MX
, EM
} },
3387 { "(bad)", { XX
} },
3388 { "(bad)", { XX
} },
3389 { "(bad)", { XX
} },
3390 { "(bad)", { XX
} },
3392 { PREFIX_TABLE (PREFIX_0F3810
) },
3393 { "(bad)", { XX
} },
3394 { "(bad)", { XX
} },
3395 { "(bad)", { XX
} },
3396 { PREFIX_TABLE (PREFIX_0F3814
) },
3397 { PREFIX_TABLE (PREFIX_0F3815
) },
3398 { "(bad)", { XX
} },
3399 { PREFIX_TABLE (PREFIX_0F3817
) },
3401 { "(bad)", { XX
} },
3402 { "(bad)", { XX
} },
3403 { "(bad)", { XX
} },
3404 { "(bad)", { XX
} },
3405 { "pabsb", { MX
, EM
} },
3406 { "pabsw", { MX
, EM
} },
3407 { "pabsd", { MX
, EM
} },
3408 { "(bad)", { XX
} },
3410 { PREFIX_TABLE (PREFIX_0F3820
) },
3411 { PREFIX_TABLE (PREFIX_0F3821
) },
3412 { PREFIX_TABLE (PREFIX_0F3822
) },
3413 { PREFIX_TABLE (PREFIX_0F3823
) },
3414 { PREFIX_TABLE (PREFIX_0F3824
) },
3415 { PREFIX_TABLE (PREFIX_0F3825
) },
3416 { "(bad)", { XX
} },
3417 { "(bad)", { XX
} },
3419 { PREFIX_TABLE (PREFIX_0F3828
) },
3420 { PREFIX_TABLE (PREFIX_0F3829
) },
3421 { PREFIX_TABLE (PREFIX_0F382A
) },
3422 { PREFIX_TABLE (PREFIX_0F382B
) },
3423 { "(bad)", { XX
} },
3424 { "(bad)", { XX
} },
3425 { "(bad)", { XX
} },
3426 { "(bad)", { XX
} },
3428 { PREFIX_TABLE (PREFIX_0F3830
) },
3429 { PREFIX_TABLE (PREFIX_0F3831
) },
3430 { PREFIX_TABLE (PREFIX_0F3832
) },
3431 { PREFIX_TABLE (PREFIX_0F3833
) },
3432 { PREFIX_TABLE (PREFIX_0F3834
) },
3433 { PREFIX_TABLE (PREFIX_0F3835
) },
3434 { "(bad)", { XX
} },
3435 { PREFIX_TABLE (PREFIX_0F3837
) },
3437 { PREFIX_TABLE (PREFIX_0F3838
) },
3438 { PREFIX_TABLE (PREFIX_0F3839
) },
3439 { PREFIX_TABLE (PREFIX_0F383A
) },
3440 { PREFIX_TABLE (PREFIX_0F383B
) },
3441 { PREFIX_TABLE (PREFIX_0F383C
) },
3442 { PREFIX_TABLE (PREFIX_0F383D
) },
3443 { PREFIX_TABLE (PREFIX_0F383E
) },
3444 { PREFIX_TABLE (PREFIX_0F383F
) },
3446 { PREFIX_TABLE (PREFIX_0F3840
) },
3447 { PREFIX_TABLE (PREFIX_0F3841
) },
3448 { "(bad)", { XX
} },
3449 { "(bad)", { XX
} },
3450 { "(bad)", { XX
} },
3451 { "(bad)", { XX
} },
3452 { "(bad)", { XX
} },
3453 { "(bad)", { XX
} },
3455 { "(bad)", { XX
} },
3456 { "(bad)", { XX
} },
3457 { "(bad)", { XX
} },
3458 { "(bad)", { XX
} },
3459 { "(bad)", { XX
} },
3460 { "(bad)", { XX
} },
3461 { "(bad)", { XX
} },
3462 { "(bad)", { XX
} },
3464 { "(bad)", { XX
} },
3465 { "(bad)", { XX
} },
3466 { "(bad)", { XX
} },
3467 { "(bad)", { XX
} },
3468 { "(bad)", { XX
} },
3469 { "(bad)", { XX
} },
3470 { "(bad)", { XX
} },
3471 { "(bad)", { XX
} },
3473 { "(bad)", { XX
} },
3474 { "(bad)", { XX
} },
3475 { "(bad)", { XX
} },
3476 { "(bad)", { XX
} },
3477 { "(bad)", { XX
} },
3478 { "(bad)", { XX
} },
3479 { "(bad)", { XX
} },
3480 { "(bad)", { XX
} },
3482 { "(bad)", { XX
} },
3483 { "(bad)", { XX
} },
3484 { "(bad)", { XX
} },
3485 { "(bad)", { XX
} },
3486 { "(bad)", { XX
} },
3487 { "(bad)", { XX
} },
3488 { "(bad)", { XX
} },
3489 { "(bad)", { XX
} },
3491 { "(bad)", { XX
} },
3492 { "(bad)", { XX
} },
3493 { "(bad)", { XX
} },
3494 { "(bad)", { XX
} },
3495 { "(bad)", { XX
} },
3496 { "(bad)", { XX
} },
3497 { "(bad)", { XX
} },
3498 { "(bad)", { XX
} },
3500 { "(bad)", { XX
} },
3501 { "(bad)", { XX
} },
3502 { "(bad)", { XX
} },
3503 { "(bad)", { XX
} },
3504 { "(bad)", { XX
} },
3505 { "(bad)", { XX
} },
3506 { "(bad)", { XX
} },
3507 { "(bad)", { XX
} },
3509 { "(bad)", { XX
} },
3510 { "(bad)", { XX
} },
3511 { "(bad)", { XX
} },
3512 { "(bad)", { XX
} },
3513 { "(bad)", { XX
} },
3514 { "(bad)", { XX
} },
3515 { "(bad)", { XX
} },
3516 { "(bad)", { XX
} },
3518 { "(bad)", { XX
} },
3519 { "(bad)", { XX
} },
3520 { "(bad)", { XX
} },
3521 { "(bad)", { XX
} },
3522 { "(bad)", { XX
} },
3523 { "(bad)", { XX
} },
3524 { "(bad)", { XX
} },
3525 { "(bad)", { XX
} },
3527 { "(bad)", { XX
} },
3528 { "(bad)", { XX
} },
3529 { "(bad)", { XX
} },
3530 { "(bad)", { XX
} },
3531 { "(bad)", { XX
} },
3532 { "(bad)", { XX
} },
3533 { "(bad)", { XX
} },
3534 { "(bad)", { XX
} },
3536 { "(bad)", { XX
} },
3537 { "(bad)", { XX
} },
3538 { "(bad)", { XX
} },
3539 { "(bad)", { XX
} },
3540 { "(bad)", { XX
} },
3541 { "(bad)", { XX
} },
3542 { "(bad)", { XX
} },
3543 { "(bad)", { XX
} },
3545 { "(bad)", { XX
} },
3546 { "(bad)", { XX
} },
3547 { "(bad)", { XX
} },
3548 { "(bad)", { XX
} },
3549 { "(bad)", { XX
} },
3550 { "(bad)", { XX
} },
3551 { "(bad)", { XX
} },
3552 { "(bad)", { XX
} },
3554 { "(bad)", { XX
} },
3555 { "(bad)", { XX
} },
3556 { "(bad)", { XX
} },
3557 { "(bad)", { XX
} },
3558 { "(bad)", { XX
} },
3559 { "(bad)", { XX
} },
3560 { "(bad)", { XX
} },
3561 { "(bad)", { XX
} },
3563 { "(bad)", { XX
} },
3564 { "(bad)", { XX
} },
3565 { "(bad)", { XX
} },
3566 { "(bad)", { XX
} },
3567 { "(bad)", { XX
} },
3568 { "(bad)", { XX
} },
3569 { "(bad)", { XX
} },
3570 { "(bad)", { XX
} },
3572 { "(bad)", { XX
} },
3573 { "(bad)", { XX
} },
3574 { "(bad)", { XX
} },
3575 { "(bad)", { XX
} },
3576 { "(bad)", { XX
} },
3577 { "(bad)", { XX
} },
3578 { "(bad)", { XX
} },
3579 { "(bad)", { XX
} },
3581 { "(bad)", { XX
} },
3582 { "(bad)", { XX
} },
3583 { "(bad)", { XX
} },
3584 { "(bad)", { XX
} },
3585 { "(bad)", { XX
} },
3586 { "(bad)", { XX
} },
3587 { "(bad)", { XX
} },
3588 { "(bad)", { XX
} },
3590 { "(bad)", { XX
} },
3591 { "(bad)", { XX
} },
3592 { "(bad)", { XX
} },
3593 { "(bad)", { XX
} },
3594 { "(bad)", { XX
} },
3595 { "(bad)", { XX
} },
3596 { "(bad)", { XX
} },
3597 { "(bad)", { XX
} },
3599 { "(bad)", { XX
} },
3600 { "(bad)", { XX
} },
3601 { "(bad)", { XX
} },
3602 { "(bad)", { XX
} },
3603 { "(bad)", { XX
} },
3604 { "(bad)", { XX
} },
3605 { "(bad)", { XX
} },
3606 { "(bad)", { XX
} },
3608 { "(bad)", { XX
} },
3609 { "(bad)", { XX
} },
3610 { "(bad)", { XX
} },
3611 { "(bad)", { XX
} },
3612 { "(bad)", { XX
} },
3613 { "(bad)", { XX
} },
3614 { "(bad)", { XX
} },
3615 { "(bad)", { XX
} },
3617 { "(bad)", { XX
} },
3618 { "(bad)", { XX
} },
3619 { "(bad)", { XX
} },
3620 { "(bad)", { XX
} },
3621 { "(bad)", { XX
} },
3622 { "(bad)", { XX
} },
3623 { "(bad)", { XX
} },
3624 { "(bad)", { XX
} },
3626 { "(bad)", { XX
} },
3627 { "(bad)", { XX
} },
3628 { "(bad)", { XX
} },
3629 { "(bad)", { XX
} },
3630 { "(bad)", { XX
} },
3631 { "(bad)", { XX
} },
3632 { "(bad)", { XX
} },
3633 { "(bad)", { XX
} },
3635 { "(bad)", { XX
} },
3636 { "(bad)", { XX
} },
3637 { "(bad)", { XX
} },
3638 { "(bad)", { XX
} },
3639 { "(bad)", { XX
} },
3640 { "(bad)", { XX
} },
3641 { "(bad)", { XX
} },
3642 { "(bad)", { XX
} },
3644 { PREFIX_TABLE (PREFIX_0F38F0
) },
3645 { PREFIX_TABLE (PREFIX_0F38F1
) },
3646 { "(bad)", { XX
} },
3647 { "(bad)", { XX
} },
3648 { "(bad)", { XX
} },
3649 { "(bad)", { XX
} },
3650 { "(bad)", { XX
} },
3651 { "(bad)", { XX
} },
3653 { "(bad)", { XX
} },
3654 { "(bad)", { XX
} },
3655 { "(bad)", { XX
} },
3656 { "(bad)", { XX
} },
3657 { "(bad)", { XX
} },
3658 { "(bad)", { XX
} },
3659 { "(bad)", { XX
} },
3660 { "(bad)", { XX
} },
3662 /* THREE_BYTE_0F3A */
3665 { "(bad)", { XX
} },
3666 { "(bad)", { XX
} },
3667 { "(bad)", { XX
} },
3668 { "(bad)", { XX
} },
3669 { "(bad)", { XX
} },
3670 { "(bad)", { XX
} },
3671 { "(bad)", { XX
} },
3672 { "(bad)", { XX
} },
3674 { PREFIX_TABLE (PREFIX_0F3A08
) },
3675 { PREFIX_TABLE (PREFIX_0F3A09
) },
3676 { PREFIX_TABLE (PREFIX_0F3A0A
) },
3677 { PREFIX_TABLE (PREFIX_0F3A0B
) },
3678 { PREFIX_TABLE (PREFIX_0F3A0C
) },
3679 { PREFIX_TABLE (PREFIX_0F3A0D
) },
3680 { PREFIX_TABLE (PREFIX_0F3A0E
) },
3681 { "palignr", { MX
, EM
, Ib
} },
3683 { "(bad)", { XX
} },
3684 { "(bad)", { XX
} },
3685 { "(bad)", { XX
} },
3686 { "(bad)", { XX
} },
3687 { PREFIX_TABLE (PREFIX_0F3A14
) },
3688 { PREFIX_TABLE (PREFIX_0F3A15
) },
3689 { PREFIX_TABLE (PREFIX_0F3A16
) },
3690 { PREFIX_TABLE (PREFIX_0F3A17
) },
3692 { "(bad)", { XX
} },
3693 { "(bad)", { XX
} },
3694 { "(bad)", { XX
} },
3695 { "(bad)", { XX
} },
3696 { "(bad)", { XX
} },
3697 { "(bad)", { XX
} },
3698 { "(bad)", { XX
} },
3699 { "(bad)", { XX
} },
3701 { PREFIX_TABLE (PREFIX_0F3A20
) },
3702 { PREFIX_TABLE (PREFIX_0F3A21
) },
3703 { PREFIX_TABLE (PREFIX_0F3A22
) },
3704 { "(bad)", { XX
} },
3705 { "(bad)", { XX
} },
3706 { "(bad)", { XX
} },
3707 { "(bad)", { XX
} },
3708 { "(bad)", { XX
} },
3710 { "(bad)", { XX
} },
3711 { "(bad)", { XX
} },
3712 { "(bad)", { XX
} },
3713 { "(bad)", { XX
} },
3714 { "(bad)", { XX
} },
3715 { "(bad)", { XX
} },
3716 { "(bad)", { XX
} },
3717 { "(bad)", { XX
} },
3719 { "(bad)", { XX
} },
3720 { "(bad)", { XX
} },
3721 { "(bad)", { XX
} },
3722 { "(bad)", { XX
} },
3723 { "(bad)", { XX
} },
3724 { "(bad)", { XX
} },
3725 { "(bad)", { XX
} },
3726 { "(bad)", { XX
} },
3728 { "(bad)", { XX
} },
3729 { "(bad)", { XX
} },
3730 { "(bad)", { XX
} },
3731 { "(bad)", { XX
} },
3732 { "(bad)", { XX
} },
3733 { "(bad)", { XX
} },
3734 { "(bad)", { XX
} },
3735 { "(bad)", { XX
} },
3737 { PREFIX_TABLE (PREFIX_0F3A40
) },
3738 { PREFIX_TABLE (PREFIX_0F3A41
) },
3739 { PREFIX_TABLE (PREFIX_0F3A42
) },
3740 { "(bad)", { XX
} },
3741 { "(bad)", { XX
} },
3742 { "(bad)", { XX
} },
3743 { "(bad)", { XX
} },
3744 { "(bad)", { XX
} },
3746 { "(bad)", { XX
} },
3747 { "(bad)", { XX
} },
3748 { "(bad)", { XX
} },
3749 { "(bad)", { XX
} },
3750 { "(bad)", { XX
} },
3751 { "(bad)", { XX
} },
3752 { "(bad)", { XX
} },
3753 { "(bad)", { XX
} },
3755 { "(bad)", { XX
} },
3756 { "(bad)", { XX
} },
3757 { "(bad)", { XX
} },
3758 { "(bad)", { XX
} },
3759 { "(bad)", { XX
} },
3760 { "(bad)", { XX
} },
3761 { "(bad)", { XX
} },
3762 { "(bad)", { XX
} },
3764 { "(bad)", { XX
} },
3765 { "(bad)", { XX
} },
3766 { "(bad)", { XX
} },
3767 { "(bad)", { XX
} },
3768 { "(bad)", { XX
} },
3769 { "(bad)", { XX
} },
3770 { "(bad)", { XX
} },
3771 { "(bad)", { XX
} },
3773 { PREFIX_TABLE (PREFIX_0F3A60
) },
3774 { PREFIX_TABLE (PREFIX_0F3A61
) },
3775 { PREFIX_TABLE (PREFIX_0F3A62
) },
3776 { PREFIX_TABLE (PREFIX_0F3A63
) },
3777 { "(bad)", { XX
} },
3778 { "(bad)", { XX
} },
3779 { "(bad)", { XX
} },
3780 { "(bad)", { XX
} },
3782 { "(bad)", { XX
} },
3783 { "(bad)", { XX
} },
3784 { "(bad)", { XX
} },
3785 { "(bad)", { XX
} },
3786 { "(bad)", { XX
} },
3787 { "(bad)", { XX
} },
3788 { "(bad)", { XX
} },
3789 { "(bad)", { XX
} },
3791 { "(bad)", { XX
} },
3792 { "(bad)", { XX
} },
3793 { "(bad)", { XX
} },
3794 { "(bad)", { XX
} },
3795 { "(bad)", { XX
} },
3796 { "(bad)", { XX
} },
3797 { "(bad)", { XX
} },
3798 { "(bad)", { XX
} },
3800 { "(bad)", { XX
} },
3801 { "(bad)", { XX
} },
3802 { "(bad)", { XX
} },
3803 { "(bad)", { XX
} },
3804 { "(bad)", { XX
} },
3805 { "(bad)", { XX
} },
3806 { "(bad)", { XX
} },
3807 { "(bad)", { XX
} },
3809 { "(bad)", { XX
} },
3810 { "(bad)", { XX
} },
3811 { "(bad)", { XX
} },
3812 { "(bad)", { XX
} },
3813 { "(bad)", { XX
} },
3814 { "(bad)", { XX
} },
3815 { "(bad)", { XX
} },
3816 { "(bad)", { XX
} },
3818 { "(bad)", { XX
} },
3819 { "(bad)", { XX
} },
3820 { "(bad)", { XX
} },
3821 { "(bad)", { XX
} },
3822 { "(bad)", { XX
} },
3823 { "(bad)", { XX
} },
3824 { "(bad)", { XX
} },
3825 { "(bad)", { XX
} },
3827 { "(bad)", { XX
} },
3828 { "(bad)", { XX
} },
3829 { "(bad)", { XX
} },
3830 { "(bad)", { XX
} },
3831 { "(bad)", { XX
} },
3832 { "(bad)", { XX
} },
3833 { "(bad)", { XX
} },
3834 { "(bad)", { XX
} },
3836 { "(bad)", { XX
} },
3837 { "(bad)", { XX
} },
3838 { "(bad)", { XX
} },
3839 { "(bad)", { XX
} },
3840 { "(bad)", { XX
} },
3841 { "(bad)", { XX
} },
3842 { "(bad)", { XX
} },
3843 { "(bad)", { XX
} },
3845 { "(bad)", { XX
} },
3846 { "(bad)", { XX
} },
3847 { "(bad)", { XX
} },
3848 { "(bad)", { XX
} },
3849 { "(bad)", { XX
} },
3850 { "(bad)", { XX
} },
3851 { "(bad)", { XX
} },
3852 { "(bad)", { XX
} },
3854 { "(bad)", { XX
} },
3855 { "(bad)", { XX
} },
3856 { "(bad)", { XX
} },
3857 { "(bad)", { XX
} },
3858 { "(bad)", { XX
} },
3859 { "(bad)", { XX
} },
3860 { "(bad)", { XX
} },
3861 { "(bad)", { XX
} },
3863 { "(bad)", { XX
} },
3864 { "(bad)", { XX
} },
3865 { "(bad)", { XX
} },
3866 { "(bad)", { XX
} },
3867 { "(bad)", { XX
} },
3868 { "(bad)", { XX
} },
3869 { "(bad)", { XX
} },
3870 { "(bad)", { XX
} },
3872 { "(bad)", { XX
} },
3873 { "(bad)", { XX
} },
3874 { "(bad)", { XX
} },
3875 { "(bad)", { XX
} },
3876 { "(bad)", { XX
} },
3877 { "(bad)", { XX
} },
3878 { "(bad)", { XX
} },
3879 { "(bad)", { XX
} },
3881 { "(bad)", { XX
} },
3882 { "(bad)", { XX
} },
3883 { "(bad)", { XX
} },
3884 { "(bad)", { XX
} },
3885 { "(bad)", { XX
} },
3886 { "(bad)", { XX
} },
3887 { "(bad)", { XX
} },
3888 { "(bad)", { XX
} },
3890 { "(bad)", { XX
} },
3891 { "(bad)", { XX
} },
3892 { "(bad)", { XX
} },
3893 { "(bad)", { XX
} },
3894 { "(bad)", { XX
} },
3895 { "(bad)", { XX
} },
3896 { "(bad)", { XX
} },
3897 { "(bad)", { XX
} },
3899 { "(bad)", { XX
} },
3900 { "(bad)", { XX
} },
3901 { "(bad)", { XX
} },
3902 { "(bad)", { XX
} },
3903 { "(bad)", { XX
} },
3904 { "(bad)", { XX
} },
3905 { "(bad)", { XX
} },
3906 { "(bad)", { XX
} },
3908 { "(bad)", { XX
} },
3909 { "(bad)", { XX
} },
3910 { "(bad)", { XX
} },
3911 { "(bad)", { XX
} },
3912 { "(bad)", { XX
} },
3913 { "(bad)", { XX
} },
3914 { "(bad)", { XX
} },
3915 { "(bad)", { XX
} },
3917 { "(bad)", { XX
} },
3918 { "(bad)", { XX
} },
3919 { "(bad)", { XX
} },
3920 { "(bad)", { XX
} },
3921 { "(bad)", { XX
} },
3922 { "(bad)", { XX
} },
3923 { "(bad)", { XX
} },
3924 { "(bad)", { XX
} },
3926 { "(bad)", { XX
} },
3927 { "(bad)", { XX
} },
3928 { "(bad)", { XX
} },
3929 { "(bad)", { XX
} },
3930 { "(bad)", { XX
} },
3931 { "(bad)", { XX
} },
3932 { "(bad)", { XX
} },
3933 { "(bad)", { XX
} },
3935 { "(bad)", { XX
} },
3936 { "(bad)", { XX
} },
3937 { "(bad)", { XX
} },
3938 { "(bad)", { XX
} },
3939 { "(bad)", { XX
} },
3940 { "(bad)", { XX
} },
3941 { "(bad)", { XX
} },
3942 { "(bad)", { XX
} },
3944 { "(bad)", { XX
} },
3945 { "(bad)", { XX
} },
3946 { "(bad)", { XX
} },
3947 { "(bad)", { XX
} },
3948 { "(bad)", { XX
} },
3949 { "(bad)", { XX
} },
3950 { "(bad)", { XX
} },
3951 { "(bad)", { XX
} },
3953 /* THREE_BYTE_0F7A */
3956 { "(bad)", { XX
} },
3957 { "(bad)", { XX
} },
3958 { "(bad)", { XX
} },
3959 { "(bad)", { XX
} },
3960 { "(bad)", { XX
} },
3961 { "(bad)", { XX
} },
3962 { "(bad)", { XX
} },
3963 { "(bad)", { XX
} },
3965 { "(bad)", { XX
} },
3966 { "(bad)", { XX
} },
3967 { "(bad)", { XX
} },
3968 { "(bad)", { XX
} },
3969 { "(bad)", { XX
} },
3970 { "(bad)", { XX
} },
3971 { "(bad)", { XX
} },
3972 { "(bad)", { XX
} },
3974 { "frczps", { XM
, EXq
} },
3975 { "frczpd", { XM
, EXq
} },
3976 { "frczss", { XM
, EXq
} },
3977 { "frczsd", { XM
, EXq
} },
3978 { "(bad)", { XX
} },
3979 { "(bad)", { XX
} },
3980 { "(bad)", { XX
} },
3981 { "(bad)", { XX
} },
3983 { "(bad)", { XX
} },
3984 { "(bad)", { XX
} },
3985 { "(bad)", { XX
} },
3986 { "(bad)", { XX
} },
3987 { "(bad)", { XX
} },
3988 { "(bad)", { XX
} },
3989 { "(bad)", { XX
} },
3990 { "(bad)", { XX
} },
3992 { "ptest", { XX
} },
3993 { "(bad)", { XX
} },
3994 { "(bad)", { XX
} },
3995 { "(bad)", { XX
} },
3996 { "(bad)", { XX
} },
3997 { "(bad)", { XX
} },
3998 { "(bad)", { XX
} },
3999 { "(bad)", { XX
} },
4001 { "(bad)", { XX
} },
4002 { "(bad)", { XX
} },
4003 { "(bad)", { XX
} },
4004 { "(bad)", { XX
} },
4005 { "(bad)", { XX
} },
4006 { "(bad)", { XX
} },
4007 { "(bad)", { XX
} },
4008 { "(bad)", { XX
} },
4010 { "cvtph2ps", { XM
, EXd
} },
4011 { "cvtps2ph", { EXd
, XM
} },
4012 { "(bad)", { XX
} },
4013 { "(bad)", { XX
} },
4014 { "(bad)", { XX
} },
4015 { "(bad)", { XX
} },
4016 { "(bad)", { XX
} },
4017 { "(bad)", { XX
} },
4019 { "(bad)", { XX
} },
4020 { "(bad)", { XX
} },
4021 { "(bad)", { XX
} },
4022 { "(bad)", { XX
} },
4023 { "(bad)", { XX
} },
4024 { "(bad)", { XX
} },
4025 { "(bad)", { XX
} },
4026 { "(bad)", { XX
} },
4028 { "(bad)", { XX
} },
4029 { "phaddbw", { XM
, EXq
} },
4030 { "phaddbd", { XM
, EXq
} },
4031 { "phaddbq", { XM
, EXq
} },
4032 { "(bad)", { XX
} },
4033 { "(bad)", { XX
} },
4034 { "phaddwd", { XM
, EXq
} },
4035 { "phaddwq", { XM
, EXq
} },
4037 { "(bad)", { XX
} },
4038 { "(bad)", { XX
} },
4039 { "(bad)", { XX
} },
4040 { "phadddq", { XM
, EXq
} },
4041 { "(bad)", { XX
} },
4042 { "(bad)", { XX
} },
4043 { "(bad)", { XX
} },
4044 { "(bad)", { XX
} },
4046 { "(bad)", { XX
} },
4047 { "phaddubw", { XM
, EXq
} },
4048 { "phaddubd", { XM
, EXq
} },
4049 { "phaddubq", { XM
, EXq
} },
4050 { "(bad)", { XX
} },
4051 { "(bad)", { XX
} },
4052 { "phadduwd", { XM
, EXq
} },
4053 { "phadduwq", { XM
, EXq
} },
4055 { "(bad)", { XX
} },
4056 { "(bad)", { XX
} },
4057 { "(bad)", { XX
} },
4058 { "phaddudq", { XM
, EXq
} },
4059 { "(bad)", { XX
} },
4060 { "(bad)", { XX
} },
4061 { "(bad)", { XX
} },
4062 { "(bad)", { XX
} },
4064 { "(bad)", { XX
} },
4065 { "phsubbw", { XM
, EXq
} },
4066 { "phsubbd", { XM
, EXq
} },
4067 { "phsubbq", { XM
, EXq
} },
4068 { "(bad)", { XX
} },
4069 { "(bad)", { XX
} },
4070 { "(bad)", { XX
} },
4071 { "(bad)", { XX
} },
4073 { "(bad)", { XX
} },
4074 { "(bad)", { XX
} },
4075 { "(bad)", { XX
} },
4076 { "(bad)", { XX
} },
4077 { "(bad)", { XX
} },
4078 { "(bad)", { XX
} },
4079 { "(bad)", { XX
} },
4080 { "(bad)", { XX
} },
4082 { "(bad)", { XX
} },
4083 { "(bad)", { XX
} },
4084 { "(bad)", { XX
} },
4085 { "(bad)", { XX
} },
4086 { "(bad)", { XX
} },
4087 { "(bad)", { XX
} },
4088 { "(bad)", { XX
} },
4089 { "(bad)", { XX
} },
4091 { "(bad)", { XX
} },
4092 { "(bad)", { XX
} },
4093 { "(bad)", { XX
} },
4094 { "(bad)", { XX
} },
4095 { "(bad)", { XX
} },
4096 { "(bad)", { XX
} },
4097 { "(bad)", { XX
} },
4098 { "(bad)", { XX
} },
4100 { "(bad)", { XX
} },
4101 { "(bad)", { XX
} },
4102 { "(bad)", { XX
} },
4103 { "(bad)", { XX
} },
4104 { "(bad)", { XX
} },
4105 { "(bad)", { XX
} },
4106 { "(bad)", { XX
} },
4107 { "(bad)", { XX
} },
4109 { "(bad)", { XX
} },
4110 { "(bad)", { XX
} },
4111 { "(bad)", { XX
} },
4112 { "(bad)", { XX
} },
4113 { "(bad)", { XX
} },
4114 { "(bad)", { XX
} },
4115 { "(bad)", { XX
} },
4116 { "(bad)", { XX
} },
4118 { "(bad)", { XX
} },
4119 { "(bad)", { XX
} },
4120 { "(bad)", { XX
} },
4121 { "(bad)", { XX
} },
4122 { "(bad)", { XX
} },
4123 { "(bad)", { XX
} },
4124 { "(bad)", { XX
} },
4125 { "(bad)", { XX
} },
4127 { "(bad)", { XX
} },
4128 { "(bad)", { XX
} },
4129 { "(bad)", { XX
} },
4130 { "(bad)", { XX
} },
4131 { "(bad)", { XX
} },
4132 { "(bad)", { XX
} },
4133 { "(bad)", { XX
} },
4134 { "(bad)", { XX
} },
4136 { "(bad)", { XX
} },
4137 { "(bad)", { XX
} },
4138 { "(bad)", { XX
} },
4139 { "(bad)", { XX
} },
4140 { "(bad)", { XX
} },
4141 { "(bad)", { XX
} },
4142 { "(bad)", { XX
} },
4143 { "(bad)", { XX
} },
4145 { "(bad)", { XX
} },
4146 { "(bad)", { XX
} },
4147 { "(bad)", { XX
} },
4148 { "(bad)", { XX
} },
4149 { "(bad)", { XX
} },
4150 { "(bad)", { XX
} },
4151 { "(bad)", { XX
} },
4152 { "(bad)", { XX
} },
4154 { "(bad)", { XX
} },
4155 { "(bad)", { XX
} },
4156 { "(bad)", { XX
} },
4157 { "(bad)", { XX
} },
4158 { "(bad)", { XX
} },
4159 { "(bad)", { XX
} },
4160 { "(bad)", { XX
} },
4161 { "(bad)", { XX
} },
4163 { "(bad)", { XX
} },
4164 { "(bad)", { XX
} },
4165 { "(bad)", { XX
} },
4166 { "(bad)", { XX
} },
4167 { "(bad)", { XX
} },
4168 { "(bad)", { XX
} },
4169 { "(bad)", { XX
} },
4170 { "(bad)", { XX
} },
4172 { "(bad)", { XX
} },
4173 { "(bad)", { XX
} },
4174 { "(bad)", { XX
} },
4175 { "(bad)", { XX
} },
4176 { "(bad)", { XX
} },
4177 { "(bad)", { XX
} },
4178 { "(bad)", { XX
} },
4179 { "(bad)", { XX
} },
4181 { "(bad)", { XX
} },
4182 { "(bad)", { XX
} },
4183 { "(bad)", { XX
} },
4184 { "(bad)", { XX
} },
4185 { "(bad)", { XX
} },
4186 { "(bad)", { XX
} },
4187 { "(bad)", { XX
} },
4188 { "(bad)", { XX
} },
4190 { "(bad)", { XX
} },
4191 { "(bad)", { XX
} },
4192 { "(bad)", { XX
} },
4193 { "(bad)", { XX
} },
4194 { "(bad)", { XX
} },
4195 { "(bad)", { XX
} },
4196 { "(bad)", { XX
} },
4197 { "(bad)", { XX
} },
4199 { "(bad)", { XX
} },
4200 { "(bad)", { XX
} },
4201 { "(bad)", { XX
} },
4202 { "(bad)", { XX
} },
4203 { "(bad)", { XX
} },
4204 { "(bad)", { XX
} },
4205 { "(bad)", { XX
} },
4206 { "(bad)", { XX
} },
4208 { "(bad)", { XX
} },
4209 { "(bad)", { XX
} },
4210 { "(bad)", { XX
} },
4211 { "(bad)", { XX
} },
4212 { "(bad)", { XX
} },
4213 { "(bad)", { XX
} },
4214 { "(bad)", { XX
} },
4215 { "(bad)", { XX
} },
4217 { "(bad)", { XX
} },
4218 { "(bad)", { XX
} },
4219 { "(bad)", { XX
} },
4220 { "(bad)", { XX
} },
4221 { "(bad)", { XX
} },
4222 { "(bad)", { XX
} },
4223 { "(bad)", { XX
} },
4224 { "(bad)", { XX
} },
4226 { "(bad)", { XX
} },
4227 { "(bad)", { XX
} },
4228 { "(bad)", { XX
} },
4229 { "(bad)", { XX
} },
4230 { "(bad)", { XX
} },
4231 { "(bad)", { XX
} },
4232 { "(bad)", { XX
} },
4233 { "(bad)", { XX
} },
4235 { "(bad)", { XX
} },
4236 { "(bad)", { XX
} },
4237 { "(bad)", { XX
} },
4238 { "(bad)", { XX
} },
4239 { "(bad)", { XX
} },
4240 { "(bad)", { XX
} },
4241 { "(bad)", { XX
} },
4242 { "(bad)", { XX
} },
4244 /* THREE_BYTE_0F7B */
4247 { "(bad)", { XX
} },
4248 { "(bad)", { XX
} },
4249 { "(bad)", { XX
} },
4250 { "(bad)", { XX
} },
4251 { "(bad)", { XX
} },
4252 { "(bad)", { XX
} },
4253 { "(bad)", { XX
} },
4254 { "(bad)", { XX
} },
4256 { "(bad)", { XX
} },
4257 { "(bad)", { XX
} },
4258 { "(bad)", { XX
} },
4259 { "(bad)", { XX
} },
4260 { "(bad)", { XX
} },
4261 { "(bad)", { XX
} },
4262 { "(bad)", { XX
} },
4263 { "(bad)", { XX
} },
4265 { "(bad)", { XX
} },
4266 { "(bad)", { XX
} },
4267 { "(bad)", { XX
} },
4268 { "(bad)", { XX
} },
4269 { "(bad)", { XX
} },
4270 { "(bad)", { XX
} },
4271 { "(bad)", { XX
} },
4272 { "(bad)", { XX
} },
4274 { "(bad)", { XX
} },
4275 { "(bad)", { XX
} },
4276 { "(bad)", { XX
} },
4277 { "(bad)", { XX
} },
4278 { "(bad)", { XX
} },
4279 { "(bad)", { XX
} },
4280 { "(bad)", { XX
} },
4281 { "(bad)", { XX
} },
4283 { "(bad)", { XX
} },
4284 { "(bad)", { XX
} },
4285 { "(bad)", { XX
} },
4286 { "(bad)", { XX
} },
4287 { "(bad)", { XX
} },
4288 { "(bad)", { XX
} },
4289 { "(bad)", { XX
} },
4290 { "(bad)", { XX
} },
4292 { "(bad)", { XX
} },
4293 { "(bad)", { XX
} },
4294 { "(bad)", { XX
} },
4295 { "(bad)", { XX
} },
4296 { "(bad)", { XX
} },
4297 { "(bad)", { XX
} },
4298 { "(bad)", { XX
} },
4299 { "(bad)", { XX
} },
4301 { "(bad)", { XX
} },
4302 { "(bad)", { XX
} },
4303 { "(bad)", { XX
} },
4304 { "(bad)", { XX
} },
4305 { "(bad)", { XX
} },
4306 { "(bad)", { XX
} },
4307 { "(bad)", { XX
} },
4308 { "(bad)", { XX
} },
4310 { "(bad)", { XX
} },
4311 { "(bad)", { XX
} },
4312 { "(bad)", { XX
} },
4313 { "(bad)", { XX
} },
4314 { "(bad)", { XX
} },
4315 { "(bad)", { XX
} },
4316 { "(bad)", { XX
} },
4317 { "(bad)", { XX
} },
4319 { "protb", { XM
, EXq
, Ib
} },
4320 { "protw", { XM
, EXq
, Ib
} },
4321 { "protd", { XM
, EXq
, Ib
} },
4322 { "protq", { XM
, EXq
, Ib
} },
4323 { "pshlb", { XM
, EXq
, Ib
} },
4324 { "pshlw", { XM
, EXq
, Ib
} },
4325 { "pshld", { XM
, EXq
, Ib
} },
4326 { "pshlq", { XM
, EXq
, Ib
} },
4328 { "pshab", { XM
, EXq
, Ib
} },
4329 { "pshaw", { XM
, EXq
, Ib
} },
4330 { "pshad", { XM
, EXq
, Ib
} },
4331 { "pshaq", { XM
, EXq
, Ib
} },
4332 { "(bad)", { XX
} },
4333 { "(bad)", { XX
} },
4334 { "(bad)", { XX
} },
4335 { "(bad)", { XX
} },
4337 { "(bad)", { XX
} },
4338 { "(bad)", { XX
} },
4339 { "(bad)", { XX
} },
4340 { "(bad)", { XX
} },
4341 { "(bad)", { XX
} },
4342 { "(bad)", { XX
} },
4343 { "(bad)", { XX
} },
4344 { "(bad)", { XX
} },
4346 { "(bad)", { XX
} },
4347 { "(bad)", { XX
} },
4348 { "(bad)", { XX
} },
4349 { "(bad)", { XX
} },
4350 { "(bad)", { XX
} },
4351 { "(bad)", { XX
} },
4352 { "(bad)", { XX
} },
4353 { "(bad)", { XX
} },
4355 { "(bad)", { XX
} },
4356 { "(bad)", { XX
} },
4357 { "(bad)", { XX
} },
4358 { "(bad)", { XX
} },
4359 { "(bad)", { XX
} },
4360 { "(bad)", { XX
} },
4361 { "(bad)", { XX
} },
4362 { "(bad)", { XX
} },
4364 { "(bad)", { XX
} },
4365 { "(bad)", { XX
} },
4366 { "(bad)", { XX
} },
4367 { "(bad)", { XX
} },
4368 { "(bad)", { XX
} },
4369 { "(bad)", { XX
} },
4370 { "(bad)", { XX
} },
4371 { "(bad)", { XX
} },
4373 { "(bad)", { XX
} },
4374 { "(bad)", { XX
} },
4375 { "(bad)", { XX
} },
4376 { "(bad)", { XX
} },
4377 { "(bad)", { XX
} },
4378 { "(bad)", { XX
} },
4379 { "(bad)", { XX
} },
4380 { "(bad)", { XX
} },
4382 { "(bad)", { XX
} },
4383 { "(bad)", { XX
} },
4384 { "(bad)", { XX
} },
4385 { "(bad)", { XX
} },
4386 { "(bad)", { XX
} },
4387 { "(bad)", { XX
} },
4388 { "(bad)", { XX
} },
4389 { "(bad)", { XX
} },
4391 { "(bad)", { XX
} },
4392 { "(bad)", { XX
} },
4393 { "(bad)", { XX
} },
4394 { "(bad)", { XX
} },
4395 { "(bad)", { XX
} },
4396 { "(bad)", { XX
} },
4397 { "(bad)", { XX
} },
4398 { "(bad)", { XX
} },
4400 { "(bad)", { XX
} },
4401 { "(bad)", { XX
} },
4402 { "(bad)", { XX
} },
4403 { "(bad)", { XX
} },
4404 { "(bad)", { XX
} },
4405 { "(bad)", { XX
} },
4406 { "(bad)", { XX
} },
4407 { "(bad)", { XX
} },
4409 { "(bad)", { XX
} },
4410 { "(bad)", { XX
} },
4411 { "(bad)", { XX
} },
4412 { "(bad)", { XX
} },
4413 { "(bad)", { XX
} },
4414 { "(bad)", { XX
} },
4415 { "(bad)", { XX
} },
4416 { "(bad)", { XX
} },
4418 { "(bad)", { XX
} },
4419 { "(bad)", { XX
} },
4420 { "(bad)", { XX
} },
4421 { "(bad)", { XX
} },
4422 { "(bad)", { XX
} },
4423 { "(bad)", { XX
} },
4424 { "(bad)", { XX
} },
4425 { "(bad)", { XX
} },
4427 { "(bad)", { XX
} },
4428 { "(bad)", { XX
} },
4429 { "(bad)", { XX
} },
4430 { "(bad)", { XX
} },
4431 { "(bad)", { XX
} },
4432 { "(bad)", { XX
} },
4433 { "(bad)", { XX
} },
4434 { "(bad)", { XX
} },
4436 { "(bad)", { XX
} },
4437 { "(bad)", { XX
} },
4438 { "(bad)", { XX
} },
4439 { "(bad)", { XX
} },
4440 { "(bad)", { XX
} },
4441 { "(bad)", { XX
} },
4442 { "(bad)", { XX
} },
4443 { "(bad)", { XX
} },
4445 { "(bad)", { XX
} },
4446 { "(bad)", { XX
} },
4447 { "(bad)", { XX
} },
4448 { "(bad)", { XX
} },
4449 { "(bad)", { XX
} },
4450 { "(bad)", { XX
} },
4451 { "(bad)", { XX
} },
4452 { "(bad)", { XX
} },
4454 { "(bad)", { XX
} },
4455 { "(bad)", { XX
} },
4456 { "(bad)", { XX
} },
4457 { "(bad)", { XX
} },
4458 { "(bad)", { XX
} },
4459 { "(bad)", { XX
} },
4460 { "(bad)", { XX
} },
4461 { "(bad)", { XX
} },
4463 { "(bad)", { XX
} },
4464 { "(bad)", { XX
} },
4465 { "(bad)", { XX
} },
4466 { "(bad)", { XX
} },
4467 { "(bad)", { XX
} },
4468 { "(bad)", { XX
} },
4469 { "(bad)", { XX
} },
4470 { "(bad)", { XX
} },
4472 { "(bad)", { XX
} },
4473 { "(bad)", { XX
} },
4474 { "(bad)", { XX
} },
4475 { "(bad)", { XX
} },
4476 { "(bad)", { XX
} },
4477 { "(bad)", { XX
} },
4478 { "(bad)", { XX
} },
4479 { "(bad)", { XX
} },
4481 { "(bad)", { XX
} },
4482 { "(bad)", { XX
} },
4483 { "(bad)", { XX
} },
4484 { "(bad)", { XX
} },
4485 { "(bad)", { XX
} },
4486 { "(bad)", { XX
} },
4487 { "(bad)", { XX
} },
4488 { "(bad)", { XX
} },
4490 { "(bad)", { XX
} },
4491 { "(bad)", { XX
} },
4492 { "(bad)", { XX
} },
4493 { "(bad)", { XX
} },
4494 { "(bad)", { XX
} },
4495 { "(bad)", { XX
} },
4496 { "(bad)", { XX
} },
4497 { "(bad)", { XX
} },
4499 { "(bad)", { XX
} },
4500 { "(bad)", { XX
} },
4501 { "(bad)", { XX
} },
4502 { "(bad)", { XX
} },
4503 { "(bad)", { XX
} },
4504 { "(bad)", { XX
} },
4505 { "(bad)", { XX
} },
4506 { "(bad)", { XX
} },
4508 { "(bad)", { XX
} },
4509 { "(bad)", { XX
} },
4510 { "(bad)", { XX
} },
4511 { "(bad)", { XX
} },
4512 { "(bad)", { XX
} },
4513 { "(bad)", { XX
} },
4514 { "(bad)", { XX
} },
4515 { "(bad)", { XX
} },
4517 { "(bad)", { XX
} },
4518 { "(bad)", { XX
} },
4519 { "(bad)", { XX
} },
4520 { "(bad)", { XX
} },
4521 { "(bad)", { XX
} },
4522 { "(bad)", { XX
} },
4523 { "(bad)", { XX
} },
4524 { "(bad)", { XX
} },
4526 { "(bad)", { XX
} },
4527 { "(bad)", { XX
} },
4528 { "(bad)", { XX
} },
4529 { "(bad)", { XX
} },
4530 { "(bad)", { XX
} },
4531 { "(bad)", { XX
} },
4532 { "(bad)", { XX
} },
4533 { "(bad)", { XX
} },
4537 static const struct dis386 mod_table
[][2] = {
4540 { "leaS", { Gv
, M
} },
4541 { "(bad)", { XX
} },
4544 /* MOD_0F01_REG_0 */
4545 { X86_64_TABLE (X86_64_0F01_REG_0
) },
4546 { RM_TABLE (RM_0F01_REG_0
) },
4549 /* MOD_0F01_REG_1 */
4550 { X86_64_TABLE (X86_64_0F01_REG_1
) },
4551 { RM_TABLE (RM_0F01_REG_1
) },
4554 /* MOD_0F01_REG_2 */
4555 { X86_64_TABLE (X86_64_0F01_REG_2
) },
4556 { RM_TABLE (RM_0F01_REG_2
) },
4559 /* MOD_0F01_REG_3 */
4560 { X86_64_TABLE (X86_64_0F01_REG_3
) },
4561 { RM_TABLE (RM_0F01_REG_3
) },
4564 /* MOD_0F01_REG_7 */
4565 { "invlpg", { Mb
} },
4566 { RM_TABLE (RM_0F01_REG_7
) },
4569 /* MOD_0F12_PREFIX_0 */
4570 { "movlps", { XM
, EXq
} },
4571 { "movhlps", { XM
, EXq
} },
4575 { "movlpX", { EXq
, XM
} },
4576 { "(bad)", { XX
} },
4579 /* MOD_0F16_PREFIX_0 */
4580 { "movhps", { XM
, EXq
} },
4581 { "movlhps", { XM
, EXq
} },
4585 { "movhpX", { EXq
, XM
} },
4586 { "(bad)", { XX
} },
4589 /* MOD_0F18_REG_0 */
4590 { "prefetchnta", { Mb
} },
4591 { "(bad)", { XX
} },
4594 /* MOD_0F18_REG_1 */
4595 { "prefetcht0", { Mb
} },
4596 { "(bad)", { XX
} },
4599 /* MOD_0F18_REG_2 */
4600 { "prefetcht1", { Mb
} },
4601 { "(bad)", { XX
} },
4604 /* MOD_0F18_REG_3 */
4605 { "prefetcht2", { Mb
} },
4606 { "(bad)", { XX
} },
4610 { "(bad)", { XX
} },
4611 { "movZ", { Rm
, Cm
} },
4615 { "(bad)", { XX
} },
4616 { "movZ", { Rm
, Dm
} },
4620 { "(bad)", { XX
} },
4621 { "movZ", { Cm
, Rm
} },
4625 { "(bad)", { XX
} },
4626 { "movZ", { Dm
, Rm
} },
4630 { THREE_BYTE_TABLE (THREE_BYTE_0F24
) },
4631 { "movL", { Rd
, Td
} },
4635 { "(bad)", { XX
} },
4636 { "movL", { Td
, Rd
} },
4639 /* MOD_0F2B_PREFIX_0 */
4640 {"movntps", { Mx
, XM
} },
4641 { "(bad)", { XX
} },
4644 /* MOD_0F2B_PREFIX_1 */
4645 {"movntss", { Md
, XM
} },
4646 { "(bad)", { XX
} },
4649 /* MOD_0F2B_PREFIX_2 */
4650 {"movntpd", { Mx
, XM
} },
4651 { "(bad)", { XX
} },
4654 /* MOD_0F2B_PREFIX_3 */
4655 {"movntsd", { Mq
, XM
} },
4656 { "(bad)", { XX
} },
4660 { "(bad)", { XX
} },
4661 { "movmskpX", { Gdq
, XS
} },
4664 /* MOD_0F71_REG_2 */
4665 { "(bad)", { XX
} },
4666 { "psrlw", { MS
, Ib
} },
4669 /* MOD_0F71_REG_4 */
4670 { "(bad)", { XX
} },
4671 { "psraw", { MS
, Ib
} },
4674 /* MOD_0F71_REG_6 */
4675 { "(bad)", { XX
} },
4676 { "psllw", { MS
, Ib
} },
4679 /* MOD_0F72_REG_2 */
4680 { "(bad)", { XX
} },
4681 { "psrld", { MS
, Ib
} },
4684 /* MOD_0F72_REG_4 */
4685 { "(bad)", { XX
} },
4686 { "psrad", { MS
, Ib
} },
4689 /* MOD_0F72_REG_6 */
4690 { "(bad)", { XX
} },
4691 { "pslld", { MS
, Ib
} },
4694 /* MOD_0F73_REG_2 */
4695 { "(bad)", { XX
} },
4696 { "psrlq", { MS
, Ib
} },
4699 /* MOD_0F73_REG_3 */
4700 { "(bad)", { XX
} },
4701 { PREFIX_TABLE (PREFIX_0F73_REG_3
) },
4704 /* MOD_0F73_REG_6 */
4705 { "(bad)", { XX
} },
4706 { "psllq", { MS
, Ib
} },
4709 /* MOD_0F73_REG_7 */
4710 { "(bad)", { XX
} },
4711 { PREFIX_TABLE (PREFIX_0F73_REG_7
) },
4714 /* MOD_0FAE_REG_0 */
4715 { "fxsave", { M
} },
4716 { "(bad)", { XX
} },
4719 /* MOD_0FAE_REG_1 */
4720 { "fxrstor", { M
} },
4721 { "(bad)", { XX
} },
4724 /* MOD_0FAE_REG_2 */
4725 { "ldmxcsr", { Md
} },
4726 { "(bad)", { XX
} },
4729 /* MOD_0FAE_REG_3 */
4730 { "stmxcsr", { Md
} },
4731 { "(bad)", { XX
} },
4734 /* MOD_0FAE_REG_4 */
4736 { "(bad)", { XX
} },
4739 /* MOD_0FAE_REG_5 */
4740 { "xrstor", { M
} },
4741 { RM_TABLE (RM_0FAE_REG_5
) },
4744 /* MOD_0FAE_REG_6 */
4745 { "(bad)", { XX
} },
4746 { RM_TABLE (RM_0FAE_REG_6
) },
4749 /* MOD_0FAE_REG_7 */
4750 { "clflush", { Mb
} },
4751 { RM_TABLE (RM_0FAE_REG_7
) },
4755 { "lssS", { Gv
, Mp
} },
4756 { "(bad)", { XX
} },
4760 { "lfsS", { Gv
, Mp
} },
4761 { "(bad)", { XX
} },
4765 { "lgsS", { Gv
, Mp
} },
4766 { "(bad)", { XX
} },
4769 /* MOD_0FC7_REG_6 */
4770 { PREFIX_TABLE (PREFIX_0FC7_REG_6
) },
4771 { "(bad)", { XX
} },
4774 /* MOD_0FC7_REG_7 */
4775 { "vmptrst", { Mq
} },
4776 { "(bad)", { XX
} },
4780 { "(bad)", { XX
} },
4781 { "pmovmskb", { Gdq
, MS
} },
4784 /* MOD_0FE7_PREFIX_2 */
4785 { "movntdq", { Mx
, XM
} },
4786 { "(bad)", { XX
} },
4789 /* MOD_0FF0_PREFIX_3 */
4790 { "lddqu", { XM
, M
} },
4791 { "(bad)", { XX
} },
4794 /* MOD_0F382A_PREFIX_2 */
4795 { "movntdqa", { XM
, Mx
} },
4796 { "(bad)", { XX
} },
4800 { "bound{S|}", { Gv
, Ma
} },
4801 { "(bad)", { XX
} },
4805 { "lesS", { Gv
, Mp
} },
4806 { "(bad)", { XX
} },
4810 { "ldsS", { Gv
, Mp
} },
4811 { "(bad)", { XX
} },
4815 static const struct dis386 rm_table
[][8] = {
4818 { "(bad)", { XX
} },
4819 { "vmcall", { Skip_MODRM
} },
4820 { "vmlaunch", { Skip_MODRM
} },
4821 { "vmresume", { Skip_MODRM
} },
4822 { "vmxoff", { Skip_MODRM
} },
4823 { "(bad)", { XX
} },
4824 { "(bad)", { XX
} },
4825 { "(bad)", { XX
} },
4829 { "monitor", { { OP_Monitor
, 0 } } },
4830 { "mwait", { { OP_Mwait
, 0 } } },
4831 { "(bad)", { XX
} },
4832 { "(bad)", { XX
} },
4833 { "(bad)", { XX
} },
4834 { "(bad)", { XX
} },
4835 { "(bad)", { XX
} },
4836 { "(bad)", { XX
} },
4840 { "xgetbv", { Skip_MODRM
} },
4841 { "xsetbv", { Skip_MODRM
} },
4842 { "(bad)", { XX
} },
4843 { "(bad)", { XX
} },
4844 { "(bad)", { XX
} },
4845 { "(bad)", { XX
} },
4846 { "(bad)", { XX
} },
4847 { "(bad)", { XX
} },
4851 { "vmrun", { Skip_MODRM
} },
4852 { "vmmcall", { Skip_MODRM
} },
4853 { "vmload", { Skip_MODRM
} },
4854 { "vmsave", { Skip_MODRM
} },
4855 { "stgi", { Skip_MODRM
} },
4856 { "clgi", { Skip_MODRM
} },
4857 { "skinit", { Skip_MODRM
} },
4858 { "invlpga", { Skip_MODRM
} },
4862 { "swapgs", { Skip_MODRM
} },
4863 { "rdtscp", { Skip_MODRM
} },
4864 { "(bad)", { XX
} },
4865 { "(bad)", { XX
} },
4866 { "(bad)", { XX
} },
4867 { "(bad)", { XX
} },
4868 { "(bad)", { XX
} },
4869 { "(bad)", { XX
} },
4873 { "lfence", { Skip_MODRM
} },
4874 { "(bad)", { XX
} },
4875 { "(bad)", { XX
} },
4876 { "(bad)", { XX
} },
4877 { "(bad)", { XX
} },
4878 { "(bad)", { XX
} },
4879 { "(bad)", { XX
} },
4880 { "(bad)", { XX
} },
4884 { "mfence", { Skip_MODRM
} },
4885 { "(bad)", { XX
} },
4886 { "(bad)", { XX
} },
4887 { "(bad)", { XX
} },
4888 { "(bad)", { XX
} },
4889 { "(bad)", { XX
} },
4890 { "(bad)", { XX
} },
4891 { "(bad)", { XX
} },
4895 { "sfence", { Skip_MODRM
} },
4896 { "(bad)", { XX
} },
4897 { "(bad)", { XX
} },
4898 { "(bad)", { XX
} },
4899 { "(bad)", { XX
} },
4900 { "(bad)", { XX
} },
4901 { "(bad)", { XX
} },
4902 { "(bad)", { XX
} },
4906 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
4918 FETCH_DATA (the_info
, codep
+ 1);
4922 /* REX prefixes family. */
4939 if (address_mode
== mode_64bit
)
4945 prefixes
|= PREFIX_REPZ
;
4948 prefixes
|= PREFIX_REPNZ
;
4951 prefixes
|= PREFIX_LOCK
;
4954 prefixes
|= PREFIX_CS
;
4957 prefixes
|= PREFIX_SS
;
4960 prefixes
|= PREFIX_DS
;
4963 prefixes
|= PREFIX_ES
;
4966 prefixes
|= PREFIX_FS
;
4969 prefixes
|= PREFIX_GS
;
4972 prefixes
|= PREFIX_DATA
;
4975 prefixes
|= PREFIX_ADDR
;
4978 /* fwait is really an instruction. If there are prefixes
4979 before the fwait, they belong to the fwait, *not* to the
4980 following instruction. */
4981 if (prefixes
|| rex
)
4983 prefixes
|= PREFIX_FWAIT
;
4987 prefixes
= PREFIX_FWAIT
;
4992 /* Rex is ignored when followed by another prefix. */
5003 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
5007 prefix_name (int pref
, int sizeflag
)
5009 static const char *rexes
[16] =
5014 "rex.XB", /* 0x43 */
5016 "rex.RB", /* 0x45 */
5017 "rex.RX", /* 0x46 */
5018 "rex.RXB", /* 0x47 */
5020 "rex.WB", /* 0x49 */
5021 "rex.WX", /* 0x4a */
5022 "rex.WXB", /* 0x4b */
5023 "rex.WR", /* 0x4c */
5024 "rex.WRB", /* 0x4d */
5025 "rex.WRX", /* 0x4e */
5026 "rex.WRXB", /* 0x4f */
5031 /* REX prefixes family. */
5048 return rexes
[pref
- 0x40];
5068 return (sizeflag
& DFLAG
) ? "data16" : "data32";
5070 if (address_mode
== mode_64bit
)
5071 return (sizeflag
& AFLAG
) ? "addr32" : "addr64";
5073 return (sizeflag
& AFLAG
) ? "addr16" : "addr32";
5081 static char op_out
[MAX_OPERANDS
][100];
5082 static int op_ad
, op_index
[MAX_OPERANDS
];
5083 static int two_source_ops
;
5084 static bfd_vma op_address
[MAX_OPERANDS
];
5085 static bfd_vma op_riprel
[MAX_OPERANDS
];
5086 static bfd_vma start_pc
;
5089 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
5090 * (see topic "Redundant prefixes" in the "Differences from 8086"
5091 * section of the "Virtual 8086 Mode" chapter.)
5092 * 'pc' should be the address of this instruction, it will
5093 * be used to print the target address if this is a relative jump or call
5094 * The function returns the length of this instruction in bytes.
5097 static char intel_syntax
;
5098 static char intel_mnemonic
= !SYSV386_COMPAT
;
5099 static char open_char
;
5100 static char close_char
;
5101 static char separator_char
;
5102 static char scale_char
;
5104 /* Here for backwards compatibility. When gdb stops using
5105 print_insn_i386_att and print_insn_i386_intel these functions can
5106 disappear, and print_insn_i386 be merged into print_insn. */
5108 print_insn_i386_att (bfd_vma pc
, disassemble_info
*info
)
5112 return print_insn (pc
, info
);
5116 print_insn_i386_intel (bfd_vma pc
, disassemble_info
*info
)
5120 return print_insn (pc
, info
);
5124 print_insn_i386 (bfd_vma pc
, disassemble_info
*info
)
5128 return print_insn (pc
, info
);
5132 print_i386_disassembler_options (FILE *stream
)
5134 fprintf (stream
, _("\n\
5135 The following i386/x86-64 specific disassembler options are supported for use\n\
5136 with the -M switch (multiple options should be separated by commas):\n"));
5138 fprintf (stream
, _(" x86-64 Disassemble in 64bit mode\n"));
5139 fprintf (stream
, _(" i386 Disassemble in 32bit mode\n"));
5140 fprintf (stream
, _(" i8086 Disassemble in 16bit mode\n"));
5141 fprintf (stream
, _(" att Display instruction in AT&T syntax\n"));
5142 fprintf (stream
, _(" intel Display instruction in Intel syntax\n"));
5143 fprintf (stream
, _(" att-mnemonic\n"
5144 " Display instruction in AT&T mnemonic\n"));
5145 fprintf (stream
, _(" intel-mnemonic\n"
5146 " Display instruction in Intel mnemonic\n"));
5147 fprintf (stream
, _(" addr64 Assume 64bit address size\n"));
5148 fprintf (stream
, _(" addr32 Assume 32bit address size\n"));
5149 fprintf (stream
, _(" addr16 Assume 16bit address size\n"));
5150 fprintf (stream
, _(" data32 Assume 32bit data size\n"));
5151 fprintf (stream
, _(" data16 Assume 16bit data size\n"));
5152 fprintf (stream
, _(" suffix Always display instruction suffix in AT&T syntax\n"));
5155 /* Get a pointer to struct dis386 with a valid name. */
5157 static const struct dis386
*
5158 get_valid_dis386 (const struct dis386
*dp
, disassemble_info
*info
)
5162 if (dp
->name
!= NULL
)
5165 switch (dp
->op
[0].bytemode
)
5168 dp
= ®_table
[dp
->op
[1].bytemode
][modrm
.reg
];
5172 index
= modrm
.mod
== 0x3 ? 1 : 0;
5173 dp
= &mod_table
[dp
->op
[1].bytemode
][index
];
5177 dp
= &rm_table
[dp
->op
[1].bytemode
][modrm
.rm
];
5180 case USE_PREFIX_TABLE
:
5182 used_prefixes
|= (prefixes
& PREFIX_REPZ
);
5183 if (prefixes
& PREFIX_REPZ
)
5190 /* We should check PREFIX_REPNZ and PREFIX_REPZ before
5192 used_prefixes
|= (prefixes
& PREFIX_REPNZ
);
5193 if (prefixes
& PREFIX_REPNZ
)
5196 repnz_prefix
= NULL
;
5200 used_prefixes
|= (prefixes
& PREFIX_DATA
);
5201 if (prefixes
& PREFIX_DATA
)
5208 dp
= &prefix_table
[dp
->op
[1].bytemode
][index
];
5211 case USE_X86_64_TABLE
:
5212 index
= address_mode
== mode_64bit
? 1 : 0;
5213 dp
= &x86_64_table
[dp
->op
[1].bytemode
][index
];
5216 case USE_3BYTE_TABLE
:
5217 FETCH_DATA (info
, codep
+ 2);
5219 dp
= &three_byte_table
[dp
->op
[1].bytemode
][index
];
5220 modrm
.mod
= (*codep
>> 6) & 3;
5221 modrm
.reg
= (*codep
>> 3) & 7;
5222 modrm
.rm
= *codep
& 7;
5226 oappend (INTERNAL_DISASSEMBLER_ERROR
);
5230 if (dp
->name
!= NULL
)
5233 return get_valid_dis386 (dp
, info
);
5237 print_insn (bfd_vma pc
, disassemble_info
*info
)
5239 const struct dis386
*dp
;
5241 char *op_txt
[MAX_OPERANDS
];
5245 struct dis_private priv
;
5247 char prefix_obuf
[32];
5250 if (info
->mach
== bfd_mach_x86_64_intel_syntax
5251 || info
->mach
== bfd_mach_x86_64
)
5252 address_mode
= mode_64bit
;
5254 address_mode
= mode_32bit
;
5256 if (intel_syntax
== (char) -1)
5257 intel_syntax
= (info
->mach
== bfd_mach_i386_i386_intel_syntax
5258 || info
->mach
== bfd_mach_x86_64_intel_syntax
);
5260 if (info
->mach
== bfd_mach_i386_i386
5261 || info
->mach
== bfd_mach_x86_64
5262 || info
->mach
== bfd_mach_i386_i386_intel_syntax
5263 || info
->mach
== bfd_mach_x86_64_intel_syntax
)
5264 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
5265 else if (info
->mach
== bfd_mach_i386_i8086
)
5266 priv
.orig_sizeflag
= 0;
5270 for (p
= info
->disassembler_options
; p
!= NULL
; )
5272 if (CONST_STRNEQ (p
, "x86-64"))
5274 address_mode
= mode_64bit
;
5275 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
5277 else if (CONST_STRNEQ (p
, "i386"))
5279 address_mode
= mode_32bit
;
5280 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
5282 else if (CONST_STRNEQ (p
, "i8086"))
5284 address_mode
= mode_16bit
;
5285 priv
.orig_sizeflag
= 0;
5287 else if (CONST_STRNEQ (p
, "intel"))
5290 if (CONST_STRNEQ (p
+ 5, "-mnemonic"))
5293 else if (CONST_STRNEQ (p
, "att"))
5296 if (CONST_STRNEQ (p
+ 3, "-mnemonic"))
5299 else if (CONST_STRNEQ (p
, "addr"))
5301 if (address_mode
== mode_64bit
)
5303 if (p
[4] == '3' && p
[5] == '2')
5304 priv
.orig_sizeflag
&= ~AFLAG
;
5305 else if (p
[4] == '6' && p
[5] == '4')
5306 priv
.orig_sizeflag
|= AFLAG
;
5310 if (p
[4] == '1' && p
[5] == '6')
5311 priv
.orig_sizeflag
&= ~AFLAG
;
5312 else if (p
[4] == '3' && p
[5] == '2')
5313 priv
.orig_sizeflag
|= AFLAG
;
5316 else if (CONST_STRNEQ (p
, "data"))
5318 if (p
[4] == '1' && p
[5] == '6')
5319 priv
.orig_sizeflag
&= ~DFLAG
;
5320 else if (p
[4] == '3' && p
[5] == '2')
5321 priv
.orig_sizeflag
|= DFLAG
;
5323 else if (CONST_STRNEQ (p
, "suffix"))
5324 priv
.orig_sizeflag
|= SUFFIX_ALWAYS
;
5326 p
= strchr (p
, ',');
5333 names64
= intel_names64
;
5334 names32
= intel_names32
;
5335 names16
= intel_names16
;
5336 names8
= intel_names8
;
5337 names8rex
= intel_names8rex
;
5338 names_seg
= intel_names_seg
;
5339 index64
= intel_index64
;
5340 index32
= intel_index32
;
5341 index16
= intel_index16
;
5344 separator_char
= '+';
5349 names64
= att_names64
;
5350 names32
= att_names32
;
5351 names16
= att_names16
;
5352 names8
= att_names8
;
5353 names8rex
= att_names8rex
;
5354 names_seg
= att_names_seg
;
5355 index64
= att_index64
;
5356 index32
= att_index32
;
5357 index16
= att_index16
;
5360 separator_char
= ',';
5364 /* The output looks better if we put 7 bytes on a line, since that
5365 puts most long word instructions on a single line. */
5366 info
->bytes_per_line
= 7;
5368 info
->private_data
= &priv
;
5369 priv
.max_fetched
= priv
.the_buffer
;
5370 priv
.insn_start
= pc
;
5373 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5381 start_codep
= priv
.the_buffer
;
5382 codep
= priv
.the_buffer
;
5384 if (setjmp (priv
.bailout
) != 0)
5388 /* Getting here means we tried for data but didn't get it. That
5389 means we have an incomplete instruction of some sort. Just
5390 print the first byte as a prefix or a .byte pseudo-op. */
5391 if (codep
> priv
.the_buffer
)
5393 name
= prefix_name (priv
.the_buffer
[0], priv
.orig_sizeflag
);
5395 (*info
->fprintf_func
) (info
->stream
, "%s", name
);
5398 /* Just print the first byte as a .byte instruction. */
5399 (*info
->fprintf_func
) (info
->stream
, ".byte 0x%x",
5400 (unsigned int) priv
.the_buffer
[0]);
5413 sizeflag
= priv
.orig_sizeflag
;
5415 FETCH_DATA (info
, codep
+ 1);
5416 two_source_ops
= (*codep
== 0x62) || (*codep
== 0xc8);
5418 if (((prefixes
& PREFIX_FWAIT
)
5419 && ((*codep
< 0xd8) || (*codep
> 0xdf)))
5420 || (rex
&& rex_used
))
5424 /* fwait not followed by floating point instruction, or rex followed
5425 by other prefixes. Print the first prefix. */
5426 name
= prefix_name (priv
.the_buffer
[0], priv
.orig_sizeflag
);
5428 name
= INTERNAL_DISASSEMBLER_ERROR
;
5429 (*info
->fprintf_func
) (info
->stream
, "%s", name
);
5436 unsigned char threebyte
;
5437 FETCH_DATA (info
, codep
+ 2);
5438 threebyte
= *++codep
;
5439 dp
= &dis386_twobyte
[threebyte
];
5440 need_modrm
= twobyte_has_modrm
[*codep
];
5445 dp
= &dis386
[*codep
];
5446 need_modrm
= onebyte_has_modrm
[*codep
];
5450 if ((prefixes
& PREFIX_REPZ
))
5452 repz_prefix
= "repz ";
5453 used_prefixes
|= PREFIX_REPZ
;
5458 if ((prefixes
& PREFIX_REPNZ
))
5460 repnz_prefix
= "repnz ";
5461 used_prefixes
|= PREFIX_REPNZ
;
5464 repnz_prefix
= NULL
;
5466 if ((prefixes
& PREFIX_LOCK
))
5468 lock_prefix
= "lock ";
5469 used_prefixes
|= PREFIX_LOCK
;
5475 if (prefixes
& PREFIX_ADDR
)
5478 if (dp
->op
[2].bytemode
!= loop_jcxz_mode
|| intel_syntax
)
5480 if ((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
5481 addr_prefix
= "addr32 ";
5483 addr_prefix
= "addr16 ";
5484 used_prefixes
|= PREFIX_ADDR
;
5489 if ((prefixes
& PREFIX_DATA
))
5492 if (dp
->op
[2].bytemode
== cond_jump_mode
5493 && dp
->op
[0].bytemode
== v_mode
5496 if (sizeflag
& DFLAG
)
5497 data_prefix
= "data32 ";
5499 data_prefix
= "data16 ";
5500 used_prefixes
|= PREFIX_DATA
;
5506 FETCH_DATA (info
, codep
+ 1);
5507 modrm
.mod
= (*codep
>> 6) & 3;
5508 modrm
.reg
= (*codep
>> 3) & 7;
5509 modrm
.rm
= *codep
& 7;
5512 if (dp
->name
== NULL
&& dp
->op
[0].bytemode
== FLOATCODE
)
5518 dp
= get_valid_dis386 (dp
, info
);
5519 if (dp
!= NULL
&& putop (dp
->name
, sizeflag
) == 0)
5521 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5524 op_ad
= MAX_OPERANDS
- 1 - i
;
5526 (*dp
->op
[i
].rtn
) (dp
->op
[i
].bytemode
, sizeflag
);
5531 /* See if any prefixes were not used. If so, print the first one
5532 separately. If we don't do this, we'll wind up printing an
5533 instruction stream which does not precisely correspond to the
5534 bytes we are disassembling. */
5535 if ((prefixes
& ~used_prefixes
) != 0)
5539 name
= prefix_name (priv
.the_buffer
[0], priv
.orig_sizeflag
);
5541 name
= INTERNAL_DISASSEMBLER_ERROR
;
5542 (*info
->fprintf_func
) (info
->stream
, "%s", name
);
5545 if (rex
& ~rex_used
)
5548 name
= prefix_name (rex
| 0x40, priv
.orig_sizeflag
);
5550 name
= INTERNAL_DISASSEMBLER_ERROR
;
5551 (*info
->fprintf_func
) (info
->stream
, "%s ", name
);
5555 prefix_obufp
= prefix_obuf
;
5557 prefix_obufp
= stpcpy (prefix_obufp
, lock_prefix
);
5559 prefix_obufp
= stpcpy (prefix_obufp
, repz_prefix
);
5561 prefix_obufp
= stpcpy (prefix_obufp
, repnz_prefix
);
5563 prefix_obufp
= stpcpy (prefix_obufp
, addr_prefix
);
5565 prefix_obufp
= stpcpy (prefix_obufp
, data_prefix
);
5567 if (prefix_obuf
[0] != 0)
5568 (*info
->fprintf_func
) (info
->stream
, "%s", prefix_obuf
);
5570 obufp
= obuf
+ strlen (obuf
);
5571 for (i
= strlen (obuf
) + strlen (prefix_obuf
); i
< 6; i
++)
5574 (*info
->fprintf_func
) (info
->stream
, "%s", obuf
);
5576 /* The enter and bound instructions are printed with operands in the same
5577 order as the intel book; everything else is printed in reverse order. */
5578 if (intel_syntax
|| two_source_ops
)
5582 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5583 op_txt
[i
] = op_out
[i
];
5585 for (i
= 0; i
< (MAX_OPERANDS
>> 1); ++i
)
5587 op_ad
= op_index
[i
];
5588 op_index
[i
] = op_index
[MAX_OPERANDS
- 1 - i
];
5589 op_index
[MAX_OPERANDS
- 1 - i
] = op_ad
;
5590 riprel
= op_riprel
[i
];
5591 op_riprel
[i
] = op_riprel
[MAX_OPERANDS
- 1 - i
];
5592 op_riprel
[MAX_OPERANDS
- 1 - i
] = riprel
;
5597 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5598 op_txt
[MAX_OPERANDS
- 1 - i
] = op_out
[i
];
5602 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
5606 (*info
->fprintf_func
) (info
->stream
, ",");
5607 if (op_index
[i
] != -1 && !op_riprel
[i
])
5608 (*info
->print_address_func
) ((bfd_vma
) op_address
[op_index
[i
]], info
);
5610 (*info
->fprintf_func
) (info
->stream
, "%s", op_txt
[i
]);
5614 for (i
= 0; i
< MAX_OPERANDS
; i
++)
5615 if (op_index
[i
] != -1 && op_riprel
[i
])
5617 (*info
->fprintf_func
) (info
->stream
, " # ");
5618 (*info
->print_address_func
) ((bfd_vma
) (start_pc
+ codep
- start_codep
5619 + op_address
[op_index
[i
]]), info
);
5622 return codep
- priv
.the_buffer
;
5625 static const char *float_mem
[] = {
5700 static const unsigned char float_mem_mode
[] = {
5775 #define ST { OP_ST, 0 }
5776 #define STi { OP_STi, 0 }
5778 #define FGRPd9_2 NULL, { { NULL, 0 } }
5779 #define FGRPd9_4 NULL, { { NULL, 1 } }
5780 #define FGRPd9_5 NULL, { { NULL, 2 } }
5781 #define FGRPd9_6 NULL, { { NULL, 3 } }
5782 #define FGRPd9_7 NULL, { { NULL, 4 } }
5783 #define FGRPda_5 NULL, { { NULL, 5 } }
5784 #define FGRPdb_4 NULL, { { NULL, 6 } }
5785 #define FGRPde_3 NULL, { { NULL, 7 } }
5786 #define FGRPdf_4 NULL, { { NULL, 8 } }
5788 static const struct dis386 float_reg
[][8] = {
5791 { "fadd", { ST
, STi
} },
5792 { "fmul", { ST
, STi
} },
5793 { "fcom", { STi
} },
5794 { "fcomp", { STi
} },
5795 { "fsub", { ST
, STi
} },
5796 { "fsubr", { ST
, STi
} },
5797 { "fdiv", { ST
, STi
} },
5798 { "fdivr", { ST
, STi
} },
5803 { "fxch", { STi
} },
5805 { "(bad)", { XX
} },
5813 { "fcmovb", { ST
, STi
} },
5814 { "fcmove", { ST
, STi
} },
5815 { "fcmovbe",{ ST
, STi
} },
5816 { "fcmovu", { ST
, STi
} },
5817 { "(bad)", { XX
} },
5819 { "(bad)", { XX
} },
5820 { "(bad)", { XX
} },
5824 { "fcmovnb",{ ST
, STi
} },
5825 { "fcmovne",{ ST
, STi
} },
5826 { "fcmovnbe",{ ST
, STi
} },
5827 { "fcmovnu",{ ST
, STi
} },
5829 { "fucomi", { ST
, STi
} },
5830 { "fcomi", { ST
, STi
} },
5831 { "(bad)", { XX
} },
5835 { "fadd", { STi
, ST
} },
5836 { "fmul", { STi
, ST
} },
5837 { "(bad)", { XX
} },
5838 { "(bad)", { XX
} },
5839 { "fsub!M", { STi
, ST
} },
5840 { "fsubM", { STi
, ST
} },
5841 { "fdiv!M", { STi
, ST
} },
5842 { "fdivM", { STi
, ST
} },
5846 { "ffree", { STi
} },
5847 { "(bad)", { XX
} },
5849 { "fstp", { STi
} },
5850 { "fucom", { STi
} },
5851 { "fucomp", { STi
} },
5852 { "(bad)", { XX
} },
5853 { "(bad)", { XX
} },
5857 { "faddp", { STi
, ST
} },
5858 { "fmulp", { STi
, ST
} },
5859 { "(bad)", { XX
} },
5861 { "fsub!Mp", { STi
, ST
} },
5862 { "fsubMp", { STi
, ST
} },
5863 { "fdiv!Mp", { STi
, ST
} },
5864 { "fdivMp", { STi
, ST
} },
5868 { "ffreep", { STi
} },
5869 { "(bad)", { XX
} },
5870 { "(bad)", { XX
} },
5871 { "(bad)", { XX
} },
5873 { "fucomip", { ST
, STi
} },
5874 { "fcomip", { ST
, STi
} },
5875 { "(bad)", { XX
} },
5879 static char *fgrps
[][8] = {
5882 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5887 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
5892 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
5897 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
5902 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
5907 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5912 "feni(287 only)","fdisi(287 only)","fNclex","fNinit",
5913 "fNsetpm(287 only)","(bad)","(bad)","(bad)",
5918 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5923 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
5928 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED
,
5929 int sizeflag ATTRIBUTE_UNUSED
)
5931 /* Skip mod/rm byte. */
5937 dofloat (int sizeflag
)
5939 const struct dis386
*dp
;
5940 unsigned char floatop
;
5942 floatop
= codep
[-1];
5946 int fp_indx
= (floatop
- 0xd8) * 8 + modrm
.reg
;
5948 putop (float_mem
[fp_indx
], sizeflag
);
5951 OP_E (float_mem_mode
[fp_indx
], sizeflag
);
5954 /* Skip mod/rm byte. */
5958 dp
= &float_reg
[floatop
- 0xd8][modrm
.reg
];
5959 if (dp
->name
== NULL
)
5961 putop (fgrps
[dp
->op
[0].bytemode
][modrm
.rm
], sizeflag
);
5963 /* Instruction fnstsw is only one with strange arg. */
5964 if (floatop
== 0xdf && codep
[-1] == 0xe0)
5965 strcpy (op_out
[0], names16
[0]);
5969 putop (dp
->name
, sizeflag
);
5974 (*dp
->op
[0].rtn
) (dp
->op
[0].bytemode
, sizeflag
);
5979 (*dp
->op
[1].rtn
) (dp
->op
[1].bytemode
, sizeflag
);
5984 OP_ST (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
5986 oappend ("%st" + intel_syntax
);
5990 OP_STi (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
5992 sprintf (scratchbuf
, "%%st(%d)", modrm
.rm
);
5993 oappend (scratchbuf
+ intel_syntax
);
5996 /* Capital letters in template are macros. */
5998 putop (const char *template, int sizeflag
)
6003 unsigned int l
= 0, len
= 1;
6006 #define SAVE_LAST(c) \
6007 if (l < len && l < sizeof (last)) \
6012 for (p
= template; *p
; p
++)
6030 if (*p
== '}' || *p
== '\0')
6049 if (modrm
.mod
!= 3 || (sizeflag
& SUFFIX_ALWAYS
))
6055 if (sizeflag
& SUFFIX_ALWAYS
)
6059 if (intel_syntax
&& !alt
)
6061 if ((prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
6063 if (sizeflag
& DFLAG
)
6064 *obufp
++ = intel_syntax
? 'd' : 'l';
6066 *obufp
++ = intel_syntax
? 'w' : 's';
6067 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6071 if (intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
6078 else if (sizeflag
& DFLAG
)
6079 *obufp
++ = intel_syntax
? 'd' : 'l';
6082 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6087 case 'E': /* For jcxz/jecxz */
6088 if (address_mode
== mode_64bit
)
6090 if (sizeflag
& AFLAG
)
6096 if (sizeflag
& AFLAG
)
6098 used_prefixes
|= (prefixes
& PREFIX_ADDR
);
6103 if ((prefixes
& PREFIX_ADDR
) || (sizeflag
& SUFFIX_ALWAYS
))
6105 if (sizeflag
& AFLAG
)
6106 *obufp
++ = address_mode
== mode_64bit
? 'q' : 'l';
6108 *obufp
++ = address_mode
== mode_64bit
? 'l' : 'w';
6109 used_prefixes
|= (prefixes
& PREFIX_ADDR
);
6113 if (intel_syntax
|| (obufp
[-1] != 's' && !(sizeflag
& SUFFIX_ALWAYS
)))
6115 if ((rex
& REX_W
) || (sizeflag
& DFLAG
))
6120 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6125 if ((prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_CS
6126 || (prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_DS
)
6128 used_prefixes
|= prefixes
& (PREFIX_CS
| PREFIX_DS
);
6131 if (prefixes
& PREFIX_DS
)
6152 if (address_mode
== mode_64bit
&& (sizeflag
& SUFFIX_ALWAYS
))
6160 if (l
!= 0 || len
!= 1)
6168 if (sizeflag
& SUFFIX_ALWAYS
)
6172 if (intel_mnemonic
!= cond
)
6176 if ((prefixes
& PREFIX_FWAIT
) == 0)
6179 used_prefixes
|= PREFIX_FWAIT
;
6185 else if (intel_syntax
&& (sizeflag
& DFLAG
))
6190 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6195 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6204 if ((prefixes
& PREFIX_DATA
)
6206 || (sizeflag
& SUFFIX_ALWAYS
))
6213 if (sizeflag
& DFLAG
)
6218 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6224 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6226 if (modrm
.mod
!= 3 || (sizeflag
& SUFFIX_ALWAYS
))
6233 if (l
== 0 && len
== 1)
6236 if (intel_syntax
&& !alt
)
6239 if (modrm
.mod
!= 3 || (sizeflag
& SUFFIX_ALWAYS
))
6245 if (sizeflag
& DFLAG
)
6246 *obufp
++ = intel_syntax
? 'd' : 'l';
6250 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6255 if (l
!= 1 || len
!= 2 || last
[0] != 'L')
6261 || (modrm
.mod
== 3 && !(sizeflag
& SUFFIX_ALWAYS
)))
6276 else if (sizeflag
& DFLAG
)
6285 if (intel_syntax
&& !p
[1]
6286 && ((rex
& REX_W
) || (sizeflag
& DFLAG
)))
6289 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6294 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6296 if (sizeflag
& SUFFIX_ALWAYS
)
6304 if (sizeflag
& SUFFIX_ALWAYS
)
6310 if (sizeflag
& DFLAG
)
6314 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6319 if (prefixes
& PREFIX_DATA
)
6323 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6326 if (intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
6334 /* implicit operand size 'l' for i386 or 'q' for x86-64 */
6336 /* operand size flag for cwtl, cbtw */
6345 else if (sizeflag
& DFLAG
)
6350 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6360 oappend (const char *s
)
6363 obufp
+= strlen (s
);
6369 if (prefixes
& PREFIX_CS
)
6371 used_prefixes
|= PREFIX_CS
;
6372 oappend ("%cs:" + intel_syntax
);
6374 if (prefixes
& PREFIX_DS
)
6376 used_prefixes
|= PREFIX_DS
;
6377 oappend ("%ds:" + intel_syntax
);
6379 if (prefixes
& PREFIX_SS
)
6381 used_prefixes
|= PREFIX_SS
;
6382 oappend ("%ss:" + intel_syntax
);
6384 if (prefixes
& PREFIX_ES
)
6386 used_prefixes
|= PREFIX_ES
;
6387 oappend ("%es:" + intel_syntax
);
6389 if (prefixes
& PREFIX_FS
)
6391 used_prefixes
|= PREFIX_FS
;
6392 oappend ("%fs:" + intel_syntax
);
6394 if (prefixes
& PREFIX_GS
)
6396 used_prefixes
|= PREFIX_GS
;
6397 oappend ("%gs:" + intel_syntax
);
6402 OP_indirE (int bytemode
, int sizeflag
)
6406 OP_E (bytemode
, sizeflag
);
6410 print_operand_value (char *buf
, int hex
, bfd_vma disp
)
6412 if (address_mode
== mode_64bit
)
6420 sprintf_vma (tmp
, disp
);
6421 for (i
= 0; tmp
[i
] == '0' && tmp
[i
+ 1]; i
++);
6422 strcpy (buf
+ 2, tmp
+ i
);
6426 bfd_signed_vma v
= disp
;
6433 /* Check for possible overflow on 0x8000000000000000. */
6436 strcpy (buf
, "9223372036854775808");
6450 tmp
[28 - i
] = (v
% 10) + '0';
6454 strcpy (buf
, tmp
+ 29 - i
);
6460 sprintf (buf
, "0x%x", (unsigned int) disp
);
6462 sprintf (buf
, "%d", (int) disp
);
6466 /* Put DISP in BUF as signed hex number. */
6469 print_displacement (char *buf
, bfd_vma disp
)
6471 bfd_signed_vma val
= disp
;
6480 /* Check for possible overflow. */
6483 switch (address_mode
)
6486 strcpy (buf
+ j
, "0x8000000000000000");
6489 strcpy (buf
+ j
, "0x80000000");
6492 strcpy (buf
+ j
, "0x8000");
6502 sprintf_vma (tmp
, val
);
6503 for (i
= 0; tmp
[i
] == '0'; i
++)
6507 strcpy (buf
+ j
, tmp
+ i
);
6511 intel_operand_size (int bytemode
, int sizeflag
)
6517 oappend ("BYTE PTR ");
6521 oappend ("WORD PTR ");
6524 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6526 oappend ("QWORD PTR ");
6527 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6535 oappend ("QWORD PTR ");
6536 else if ((sizeflag
& DFLAG
) || bytemode
== dq_mode
)
6537 oappend ("DWORD PTR ");
6539 oappend ("WORD PTR ");
6540 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6543 if ((rex
& REX_W
) || (sizeflag
& DFLAG
))
6545 oappend ("WORD PTR ");
6547 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6550 if (sizeflag
& DFLAG
)
6551 oappend ("QWORD PTR ");
6553 oappend ("DWORD PTR ");
6554 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6558 oappend ("DWORD PTR ");
6561 oappend ("QWORD PTR ");
6564 if (address_mode
== mode_64bit
)
6565 oappend ("QWORD PTR ");
6567 oappend ("DWORD PTR ");
6570 if (sizeflag
& DFLAG
)
6571 oappend ("FWORD PTR ");
6573 oappend ("DWORD PTR ");
6574 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6577 oappend ("TBYTE PTR ");
6580 oappend ("XMMWORD PTR ");
6583 oappend ("OWORD PTR ");
6591 OP_E_extended (int bytemode
, int sizeflag
, int has_drex
)
6600 /* Skip mod/rm byte. */
6611 oappend (names8rex
[modrm
.rm
+ add
]);
6613 oappend (names8
[modrm
.rm
+ add
]);
6616 oappend (names16
[modrm
.rm
+ add
]);
6619 oappend (names32
[modrm
.rm
+ add
]);
6622 oappend (names64
[modrm
.rm
+ add
]);
6625 if (address_mode
== mode_64bit
)
6626 oappend (names64
[modrm
.rm
+ add
]);
6628 oappend (names32
[modrm
.rm
+ add
]);
6631 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
6633 oappend (names64
[modrm
.rm
+ add
]);
6634 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6646 oappend (names64
[modrm
.rm
+ add
]);
6647 else if ((sizeflag
& DFLAG
) || bytemode
!= v_mode
)
6648 oappend (names32
[modrm
.rm
+ add
]);
6650 oappend (names16
[modrm
.rm
+ add
]);
6651 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6656 oappend (INTERNAL_DISASSEMBLER_ERROR
);
6664 intel_operand_size (bytemode
, sizeflag
);
6667 if ((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
6669 /* 32/64 bit address mode */
6687 FETCH_DATA (the_info
, codep
+ 1);
6688 index
= (*codep
>> 3) & 7;
6689 scale
= (*codep
>> 6) & 3;
6694 haveindex
= index
!= 4;
6699 /* If we have a DREX byte, skip it now
6700 (it has already been handled) */
6703 FETCH_DATA (the_info
, codep
+ 1);
6713 if (address_mode
== mode_64bit
&& !havesib
)
6719 FETCH_DATA (the_info
, codep
+ 1);
6721 if ((disp
& 0x80) != 0)
6729 /* In 32bit mode, we need index register to tell [offset] from
6730 [eiz*1 + offset]. */
6731 needindex
= (havesib
6734 && address_mode
== mode_32bit
);
6735 havedisp
= (havebase
6737 || (havesib
&& (haveindex
|| scale
!= 0)));
6740 if (modrm
.mod
!= 0 || base
== 5)
6742 if (havedisp
|| riprel
)
6743 print_displacement (scratchbuf
, disp
);
6745 print_operand_value (scratchbuf
, 1, disp
);
6746 oappend (scratchbuf
);
6750 oappend (sizeflag
& AFLAG
? "(%rip)" : "(%eip)");
6754 if (havebase
|| haveindex
|| riprel
)
6755 used_prefixes
|= PREFIX_ADDR
;
6757 if (havedisp
|| (intel_syntax
&& riprel
))
6759 *obufp
++ = open_char
;
6760 if (intel_syntax
&& riprel
)
6763 oappend (sizeflag
& AFLAG
? "rip" : "eip");
6767 oappend (address_mode
== mode_64bit
&& (sizeflag
& AFLAG
)
6768 ? names64
[rbase
] : names32
[rbase
]);
6771 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
6772 print index to tell base + index from base. */
6776 || (havebase
&& base
!= ESP_REG_NUM
))
6778 if (!intel_syntax
|| havebase
)
6780 *obufp
++ = separator_char
;
6784 oappend (address_mode
== mode_64bit
6785 && (sizeflag
& AFLAG
)
6786 ? names64
[index
] : names32
[index
]);
6788 oappend (address_mode
== mode_64bit
6789 && (sizeflag
& AFLAG
)
6790 ? index64
: index32
);
6792 *obufp
++ = scale_char
;
6794 sprintf (scratchbuf
, "%d", 1 << scale
);
6795 oappend (scratchbuf
);
6799 && (disp
|| modrm
.mod
!= 0 || base
== 5))
6801 if (!havedisp
|| (bfd_signed_vma
) disp
>= 0)
6806 else if (modrm
.mod
!= 1)
6810 disp
= - (bfd_signed_vma
) disp
;
6814 print_displacement (scratchbuf
, disp
);
6816 print_operand_value (scratchbuf
, 1, disp
);
6817 oappend (scratchbuf
);
6820 *obufp
++ = close_char
;
6823 else if (intel_syntax
)
6825 if (modrm
.mod
!= 0 || base
== 5)
6827 if (prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
6828 | PREFIX_ES
| PREFIX_FS
| PREFIX_GS
))
6832 oappend (names_seg
[ds_reg
- es_reg
]);
6835 print_operand_value (scratchbuf
, 1, disp
);
6836 oappend (scratchbuf
);
6841 { /* 16 bit address mode */
6848 if ((disp
& 0x8000) != 0)
6853 FETCH_DATA (the_info
, codep
+ 1);
6855 if ((disp
& 0x80) != 0)
6860 if ((disp
& 0x8000) != 0)
6866 if (modrm
.mod
!= 0 || modrm
.rm
== 6)
6868 print_displacement (scratchbuf
, disp
);
6869 oappend (scratchbuf
);
6872 if (modrm
.mod
!= 0 || modrm
.rm
!= 6)
6874 *obufp
++ = open_char
;
6876 oappend (index16
[modrm
.rm
]);
6878 && (disp
|| modrm
.mod
!= 0 || modrm
.rm
== 6))
6880 if ((bfd_signed_vma
) disp
>= 0)
6885 else if (modrm
.mod
!= 1)
6889 disp
= - (bfd_signed_vma
) disp
;
6892 print_displacement (scratchbuf
, disp
);
6893 oappend (scratchbuf
);
6896 *obufp
++ = close_char
;
6899 else if (intel_syntax
)
6901 if (prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
6902 | PREFIX_ES
| PREFIX_FS
| PREFIX_GS
))
6906 oappend (names_seg
[ds_reg
- es_reg
]);
6909 print_operand_value (scratchbuf
, 1, disp
& 0xffff);
6910 oappend (scratchbuf
);
6916 OP_E (int bytemode
, int sizeflag
)
6918 OP_E_extended (bytemode
, sizeflag
, 0);
6923 OP_G (int bytemode
, int sizeflag
)
6934 oappend (names8rex
[modrm
.reg
+ add
]);
6936 oappend (names8
[modrm
.reg
+ add
]);
6939 oappend (names16
[modrm
.reg
+ add
]);
6942 oappend (names32
[modrm
.reg
+ add
]);
6945 oappend (names64
[modrm
.reg
+ add
]);
6954 oappend (names64
[modrm
.reg
+ add
]);
6955 else if ((sizeflag
& DFLAG
) || bytemode
!= v_mode
)
6956 oappend (names32
[modrm
.reg
+ add
]);
6958 oappend (names16
[modrm
.reg
+ add
]);
6959 used_prefixes
|= (prefixes
& PREFIX_DATA
);
6962 if (address_mode
== mode_64bit
)
6963 oappend (names64
[modrm
.reg
+ add
]);
6965 oappend (names32
[modrm
.reg
+ add
]);
6968 oappend (INTERNAL_DISASSEMBLER_ERROR
);
6981 FETCH_DATA (the_info
, codep
+ 8);
6982 a
= *codep
++ & 0xff;
6983 a
|= (*codep
++ & 0xff) << 8;
6984 a
|= (*codep
++ & 0xff) << 16;
6985 a
|= (*codep
++ & 0xff) << 24;
6986 b
= *codep
++ & 0xff;
6987 b
|= (*codep
++ & 0xff) << 8;
6988 b
|= (*codep
++ & 0xff) << 16;
6989 b
|= (*codep
++ & 0xff) << 24;
6990 x
= a
+ ((bfd_vma
) b
<< 32);
6998 static bfd_signed_vma
7001 bfd_signed_vma x
= 0;
7003 FETCH_DATA (the_info
, codep
+ 4);
7004 x
= *codep
++ & (bfd_signed_vma
) 0xff;
7005 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 8;
7006 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 16;
7007 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 24;
7011 static bfd_signed_vma
7014 bfd_signed_vma x
= 0;
7016 FETCH_DATA (the_info
, codep
+ 4);
7017 x
= *codep
++ & (bfd_signed_vma
) 0xff;
7018 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 8;
7019 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 16;
7020 x
|= (*codep
++ & (bfd_signed_vma
) 0xff) << 24;
7022 x
= (x
^ ((bfd_signed_vma
) 1 << 31)) - ((bfd_signed_vma
) 1 << 31);
7032 FETCH_DATA (the_info
, codep
+ 2);
7033 x
= *codep
++ & 0xff;
7034 x
|= (*codep
++ & 0xff) << 8;
7039 set_op (bfd_vma op
, int riprel
)
7041 op_index
[op_ad
] = op_ad
;
7042 if (address_mode
== mode_64bit
)
7044 op_address
[op_ad
] = op
;
7045 op_riprel
[op_ad
] = riprel
;
7049 /* Mask to get a 32-bit address. */
7050 op_address
[op_ad
] = op
& 0xffffffff;
7051 op_riprel
[op_ad
] = riprel
& 0xffffffff;
7056 OP_REG (int code
, int sizeflag
)
7068 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
7069 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
7070 s
= names16
[code
- ax_reg
+ add
];
7072 case es_reg
: case ss_reg
: case cs_reg
:
7073 case ds_reg
: case fs_reg
: case gs_reg
:
7074 s
= names_seg
[code
- es_reg
+ add
];
7076 case al_reg
: case ah_reg
: case cl_reg
: case ch_reg
:
7077 case dl_reg
: case dh_reg
: case bl_reg
: case bh_reg
:
7080 s
= names8rex
[code
- al_reg
+ add
];
7082 s
= names8
[code
- al_reg
];
7084 case rAX_reg
: case rCX_reg
: case rDX_reg
: case rBX_reg
:
7085 case rSP_reg
: case rBP_reg
: case rSI_reg
: case rDI_reg
:
7086 if (address_mode
== mode_64bit
&& (sizeflag
& DFLAG
))
7088 s
= names64
[code
- rAX_reg
+ add
];
7091 code
+= eAX_reg
- rAX_reg
;
7093 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
7094 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
7097 s
= names64
[code
- eAX_reg
+ add
];
7098 else if (sizeflag
& DFLAG
)
7099 s
= names32
[code
- eAX_reg
+ add
];
7101 s
= names16
[code
- eAX_reg
+ add
];
7102 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7105 s
= INTERNAL_DISASSEMBLER_ERROR
;
7112 OP_IMREG (int code
, int sizeflag
)
7124 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
7125 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
7126 s
= names16
[code
- ax_reg
];
7128 case es_reg
: case ss_reg
: case cs_reg
:
7129 case ds_reg
: case fs_reg
: case gs_reg
:
7130 s
= names_seg
[code
- es_reg
];
7132 case al_reg
: case ah_reg
: case cl_reg
: case ch_reg
:
7133 case dl_reg
: case dh_reg
: case bl_reg
: case bh_reg
:
7136 s
= names8rex
[code
- al_reg
];
7138 s
= names8
[code
- al_reg
];
7140 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
7141 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
7144 s
= names64
[code
- eAX_reg
];
7145 else if (sizeflag
& DFLAG
)
7146 s
= names32
[code
- eAX_reg
];
7148 s
= names16
[code
- eAX_reg
];
7149 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7152 if ((rex
& REX_W
) || (sizeflag
& DFLAG
))
7157 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7160 s
= INTERNAL_DISASSEMBLER_ERROR
;
7167 OP_I (int bytemode
, int sizeflag
)
7170 bfd_signed_vma mask
= -1;
7175 FETCH_DATA (the_info
, codep
+ 1);
7180 if (address_mode
== mode_64bit
)
7190 else if (sizeflag
& DFLAG
)
7200 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7211 oappend (INTERNAL_DISASSEMBLER_ERROR
);
7216 scratchbuf
[0] = '$';
7217 print_operand_value (scratchbuf
+ 1, 1, op
);
7218 oappend (scratchbuf
+ intel_syntax
);
7219 scratchbuf
[0] = '\0';
7223 OP_I64 (int bytemode
, int sizeflag
)
7226 bfd_signed_vma mask
= -1;
7228 if (address_mode
!= mode_64bit
)
7230 OP_I (bytemode
, sizeflag
);
7237 FETCH_DATA (the_info
, codep
+ 1);
7245 else if (sizeflag
& DFLAG
)
7255 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7262 oappend (INTERNAL_DISASSEMBLER_ERROR
);
7267 scratchbuf
[0] = '$';
7268 print_operand_value (scratchbuf
+ 1, 1, op
);
7269 oappend (scratchbuf
+ intel_syntax
);
7270 scratchbuf
[0] = '\0';
7274 OP_sI (int bytemode
, int sizeflag
)
7277 bfd_signed_vma mask
= -1;
7282 FETCH_DATA (the_info
, codep
+ 1);
7284 if ((op
& 0x80) != 0)
7292 else if (sizeflag
& DFLAG
)
7301 if ((op
& 0x8000) != 0)
7304 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7309 if ((op
& 0x8000) != 0)
7313 oappend (INTERNAL_DISASSEMBLER_ERROR
);
7317 scratchbuf
[0] = '$';
7318 print_operand_value (scratchbuf
+ 1, 1, op
);
7319 oappend (scratchbuf
+ intel_syntax
);
7323 OP_J (int bytemode
, int sizeflag
)
7327 bfd_vma segment
= 0;
7332 FETCH_DATA (the_info
, codep
+ 1);
7334 if ((disp
& 0x80) != 0)
7338 if ((sizeflag
& DFLAG
) || (rex
& REX_W
))
7343 if ((disp
& 0x8000) != 0)
7345 /* In 16bit mode, address is wrapped around at 64k within
7346 the same segment. Otherwise, a data16 prefix on a jump
7347 instruction means that the pc is masked to 16 bits after
7348 the displacement is added! */
7350 if ((prefixes
& PREFIX_DATA
) == 0)
7351 segment
= ((start_pc
+ codep
- start_codep
)
7352 & ~((bfd_vma
) 0xffff));
7354 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7357 oappend (INTERNAL_DISASSEMBLER_ERROR
);
7360 disp
= ((start_pc
+ codep
- start_codep
+ disp
) & mask
) | segment
;
7362 print_operand_value (scratchbuf
, 1, disp
);
7363 oappend (scratchbuf
);
7367 OP_SEG (int bytemode
, int sizeflag
)
7369 if (bytemode
== w_mode
)
7370 oappend (names_seg
[modrm
.reg
]);
7372 OP_E (modrm
.mod
== 3 ? bytemode
: w_mode
, sizeflag
);
7376 OP_DIR (int dummy ATTRIBUTE_UNUSED
, int sizeflag
)
7380 if (sizeflag
& DFLAG
)
7390 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7392 sprintf (scratchbuf
, "0x%x:0x%x", seg
, offset
);
7394 sprintf (scratchbuf
, "$0x%x,$0x%x", seg
, offset
);
7395 oappend (scratchbuf
);
7399 OP_OFF (int bytemode
, int sizeflag
)
7403 if (intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
7404 intel_operand_size (bytemode
, sizeflag
);
7407 if ((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
7414 if (!(prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
7415 | PREFIX_ES
| PREFIX_FS
| PREFIX_GS
)))
7417 oappend (names_seg
[ds_reg
- es_reg
]);
7421 print_operand_value (scratchbuf
, 1, off
);
7422 oappend (scratchbuf
);
7426 OP_OFF64 (int bytemode
, int sizeflag
)
7430 if (address_mode
!= mode_64bit
7431 || (prefixes
& PREFIX_ADDR
))
7433 OP_OFF (bytemode
, sizeflag
);
7437 if (intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
7438 intel_operand_size (bytemode
, sizeflag
);
7445 if (!(prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
7446 | PREFIX_ES
| PREFIX_FS
| PREFIX_GS
)))
7448 oappend (names_seg
[ds_reg
- es_reg
]);
7452 print_operand_value (scratchbuf
, 1, off
);
7453 oappend (scratchbuf
);
7457 ptr_reg (int code
, int sizeflag
)
7461 *obufp
++ = open_char
;
7462 used_prefixes
|= (prefixes
& PREFIX_ADDR
);
7463 if (address_mode
== mode_64bit
)
7465 if (!(sizeflag
& AFLAG
))
7466 s
= names32
[code
- eAX_reg
];
7468 s
= names64
[code
- eAX_reg
];
7470 else if (sizeflag
& AFLAG
)
7471 s
= names32
[code
- eAX_reg
];
7473 s
= names16
[code
- eAX_reg
];
7475 *obufp
++ = close_char
;
7480 OP_ESreg (int code
, int sizeflag
)
7486 case 0x6d: /* insw/insl */
7487 intel_operand_size (z_mode
, sizeflag
);
7489 case 0xa5: /* movsw/movsl/movsq */
7490 case 0xa7: /* cmpsw/cmpsl/cmpsq */
7491 case 0xab: /* stosw/stosl */
7492 case 0xaf: /* scasw/scasl */
7493 intel_operand_size (v_mode
, sizeflag
);
7496 intel_operand_size (b_mode
, sizeflag
);
7499 oappend ("%es:" + intel_syntax
);
7500 ptr_reg (code
, sizeflag
);
7504 OP_DSreg (int code
, int sizeflag
)
7510 case 0x6f: /* outsw/outsl */
7511 intel_operand_size (z_mode
, sizeflag
);
7513 case 0xa5: /* movsw/movsl/movsq */
7514 case 0xa7: /* cmpsw/cmpsl/cmpsq */
7515 case 0xad: /* lodsw/lodsl/lodsq */
7516 intel_operand_size (v_mode
, sizeflag
);
7519 intel_operand_size (b_mode
, sizeflag
);
7529 prefixes
|= PREFIX_DS
;
7531 ptr_reg (code
, sizeflag
);
7535 OP_C (int dummy ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7543 else if (address_mode
!= mode_64bit
&& (prefixes
& PREFIX_LOCK
))
7546 used_prefixes
|= PREFIX_LOCK
;
7551 sprintf (scratchbuf
, "%%cr%d", modrm
.reg
+ add
);
7552 oappend (scratchbuf
+ intel_syntax
);
7556 OP_D (int dummy ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7565 sprintf (scratchbuf
, "db%d", modrm
.reg
+ add
);
7567 sprintf (scratchbuf
, "%%db%d", modrm
.reg
+ add
);
7568 oappend (scratchbuf
);
7572 OP_T (int dummy ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7574 sprintf (scratchbuf
, "%%tr%d", modrm
.reg
);
7575 oappend (scratchbuf
+ intel_syntax
);
7579 OP_R (int bytemode
, int sizeflag
)
7582 OP_E (bytemode
, sizeflag
);
7588 OP_MMX (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7590 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7591 if (prefixes
& PREFIX_DATA
)
7599 sprintf (scratchbuf
, "%%xmm%d", modrm
.reg
+ add
);
7602 sprintf (scratchbuf
, "%%mm%d", modrm
.reg
);
7603 oappend (scratchbuf
+ intel_syntax
);
7607 OP_XMM (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7615 sprintf (scratchbuf
, "%%xmm%d", modrm
.reg
+ add
);
7616 oappend (scratchbuf
+ intel_syntax
);
7620 OP_EM (int bytemode
, int sizeflag
)
7624 if (intel_syntax
&& bytemode
== v_mode
)
7626 bytemode
= (prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
7627 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7629 OP_E (bytemode
, sizeflag
);
7633 /* Skip mod/rm byte. */
7636 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7637 if (prefixes
& PREFIX_DATA
)
7646 sprintf (scratchbuf
, "%%xmm%d", modrm
.rm
+ add
);
7649 sprintf (scratchbuf
, "%%mm%d", modrm
.rm
);
7650 oappend (scratchbuf
+ intel_syntax
);
7653 /* cvt* are the only instructions in sse2 which have
7654 both SSE and MMX operands and also have 0x66 prefix
7655 in their opcode. 0x66 was originally used to differentiate
7656 between SSE and MMX instruction(operands). So we have to handle the
7657 cvt* separately using OP_EMC and OP_MXC */
7659 OP_EMC (int bytemode
, int sizeflag
)
7663 if (intel_syntax
&& bytemode
== v_mode
)
7665 bytemode
= (prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
7666 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7668 OP_E (bytemode
, sizeflag
);
7672 /* Skip mod/rm byte. */
7675 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7676 sprintf (scratchbuf
, "%%mm%d", modrm
.rm
);
7677 oappend (scratchbuf
+ intel_syntax
);
7681 OP_MXC (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7683 used_prefixes
|= (prefixes
& PREFIX_DATA
);
7684 sprintf (scratchbuf
, "%%mm%d", modrm
.reg
);
7685 oappend (scratchbuf
+ intel_syntax
);
7689 OP_EX (int bytemode
, int sizeflag
)
7694 OP_E (bytemode
, sizeflag
);
7703 /* Skip mod/rm byte. */
7706 sprintf (scratchbuf
, "%%xmm%d", modrm
.rm
+ add
);
7707 oappend (scratchbuf
+ intel_syntax
);
7711 OP_MS (int bytemode
, int sizeflag
)
7714 OP_EM (bytemode
, sizeflag
);
7720 OP_XS (int bytemode
, int sizeflag
)
7723 OP_EX (bytemode
, sizeflag
);
7729 OP_M (int bytemode
, int sizeflag
)
7732 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
7735 OP_E (bytemode
, sizeflag
);
7739 OP_0f07 (int bytemode
, int sizeflag
)
7741 if (modrm
.mod
!= 3 || modrm
.rm
!= 0)
7744 OP_E (bytemode
, sizeflag
);
7747 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
7748 32bit mode and "xchg %rax,%rax" in 64bit mode. */
7751 NOP_Fixup1 (int bytemode
, int sizeflag
)
7753 if ((prefixes
& PREFIX_DATA
) != 0
7756 && address_mode
== mode_64bit
))
7757 OP_REG (bytemode
, sizeflag
);
7759 strcpy (obuf
, "nop");
7763 NOP_Fixup2 (int bytemode
, int sizeflag
)
7765 if ((prefixes
& PREFIX_DATA
) != 0
7768 && address_mode
== mode_64bit
))
7769 OP_IMREG (bytemode
, sizeflag
);
7772 static const char *const Suffix3DNow
[] = {
7773 /* 00 */ NULL
, NULL
, NULL
, NULL
,
7774 /* 04 */ NULL
, NULL
, NULL
, NULL
,
7775 /* 08 */ NULL
, NULL
, NULL
, NULL
,
7776 /* 0C */ "pi2fw", "pi2fd", NULL
, NULL
,
7777 /* 10 */ NULL
, NULL
, NULL
, NULL
,
7778 /* 14 */ NULL
, NULL
, NULL
, NULL
,
7779 /* 18 */ NULL
, NULL
, NULL
, NULL
,
7780 /* 1C */ "pf2iw", "pf2id", NULL
, NULL
,
7781 /* 20 */ NULL
, NULL
, NULL
, NULL
,
7782 /* 24 */ NULL
, NULL
, NULL
, NULL
,
7783 /* 28 */ NULL
, NULL
, NULL
, NULL
,
7784 /* 2C */ NULL
, NULL
, NULL
, NULL
,
7785 /* 30 */ NULL
, NULL
, NULL
, NULL
,
7786 /* 34 */ NULL
, NULL
, NULL
, NULL
,
7787 /* 38 */ NULL
, NULL
, NULL
, NULL
,
7788 /* 3C */ NULL
, NULL
, NULL
, NULL
,
7789 /* 40 */ NULL
, NULL
, NULL
, NULL
,
7790 /* 44 */ NULL
, NULL
, NULL
, NULL
,
7791 /* 48 */ NULL
, NULL
, NULL
, NULL
,
7792 /* 4C */ NULL
, NULL
, NULL
, NULL
,
7793 /* 50 */ NULL
, NULL
, NULL
, NULL
,
7794 /* 54 */ NULL
, NULL
, NULL
, NULL
,
7795 /* 58 */ NULL
, NULL
, NULL
, NULL
,
7796 /* 5C */ NULL
, NULL
, NULL
, NULL
,
7797 /* 60 */ NULL
, NULL
, NULL
, NULL
,
7798 /* 64 */ NULL
, NULL
, NULL
, NULL
,
7799 /* 68 */ NULL
, NULL
, NULL
, NULL
,
7800 /* 6C */ NULL
, NULL
, NULL
, NULL
,
7801 /* 70 */ NULL
, NULL
, NULL
, NULL
,
7802 /* 74 */ NULL
, NULL
, NULL
, NULL
,
7803 /* 78 */ NULL
, NULL
, NULL
, NULL
,
7804 /* 7C */ NULL
, NULL
, NULL
, NULL
,
7805 /* 80 */ NULL
, NULL
, NULL
, NULL
,
7806 /* 84 */ NULL
, NULL
, NULL
, NULL
,
7807 /* 88 */ NULL
, NULL
, "pfnacc", NULL
,
7808 /* 8C */ NULL
, NULL
, "pfpnacc", NULL
,
7809 /* 90 */ "pfcmpge", NULL
, NULL
, NULL
,
7810 /* 94 */ "pfmin", NULL
, "pfrcp", "pfrsqrt",
7811 /* 98 */ NULL
, NULL
, "pfsub", NULL
,
7812 /* 9C */ NULL
, NULL
, "pfadd", NULL
,
7813 /* A0 */ "pfcmpgt", NULL
, NULL
, NULL
,
7814 /* A4 */ "pfmax", NULL
, "pfrcpit1", "pfrsqit1",
7815 /* A8 */ NULL
, NULL
, "pfsubr", NULL
,
7816 /* AC */ NULL
, NULL
, "pfacc", NULL
,
7817 /* B0 */ "pfcmpeq", NULL
, NULL
, NULL
,
7818 /* B4 */ "pfmul", NULL
, "pfrcpit2", "pmulhrw",
7819 /* B8 */ NULL
, NULL
, NULL
, "pswapd",
7820 /* BC */ NULL
, NULL
, NULL
, "pavgusb",
7821 /* C0 */ NULL
, NULL
, NULL
, NULL
,
7822 /* C4 */ NULL
, NULL
, NULL
, NULL
,
7823 /* C8 */ NULL
, NULL
, NULL
, NULL
,
7824 /* CC */ NULL
, NULL
, NULL
, NULL
,
7825 /* D0 */ NULL
, NULL
, NULL
, NULL
,
7826 /* D4 */ NULL
, NULL
, NULL
, NULL
,
7827 /* D8 */ NULL
, NULL
, NULL
, NULL
,
7828 /* DC */ NULL
, NULL
, NULL
, NULL
,
7829 /* E0 */ NULL
, NULL
, NULL
, NULL
,
7830 /* E4 */ NULL
, NULL
, NULL
, NULL
,
7831 /* E8 */ NULL
, NULL
, NULL
, NULL
,
7832 /* EC */ NULL
, NULL
, NULL
, NULL
,
7833 /* F0 */ NULL
, NULL
, NULL
, NULL
,
7834 /* F4 */ NULL
, NULL
, NULL
, NULL
,
7835 /* F8 */ NULL
, NULL
, NULL
, NULL
,
7836 /* FC */ NULL
, NULL
, NULL
, NULL
,
7840 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7842 const char *mnemonic
;
7844 FETCH_DATA (the_info
, codep
+ 1);
7845 /* AMD 3DNow! instructions are specified by an opcode suffix in the
7846 place where an 8-bit immediate would normally go. ie. the last
7847 byte of the instruction. */
7848 obufp
= obuf
+ strlen (obuf
);
7849 mnemonic
= Suffix3DNow
[*codep
++ & 0xff];
7854 /* Since a variable sized modrm/sib chunk is between the start
7855 of the opcode (0x0f0f) and the opcode suffix, we need to do
7856 all the modrm processing first, and don't know until now that
7857 we have a bad opcode. This necessitates some cleaning up. */
7858 op_out
[0][0] = '\0';
7859 op_out
[1][0] = '\0';
7864 static const char *simd_cmp_op
[] = {
7876 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED
, int sizeflag ATTRIBUTE_UNUSED
)
7878 unsigned int cmp_type
;
7880 FETCH_DATA (the_info
, codep
+ 1);
7881 cmp_type
= *codep
++ & 0xff;
7885 char *p
= obuf
+ strlen (obuf
) - 2;
7889 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
], suffix
);
7893 /* We have a reserved extension byte. Output it directly. */
7894 scratchbuf
[0] = '$';
7895 print_operand_value (scratchbuf
+ 1, 1, cmp_type
);
7896 oappend (scratchbuf
+ intel_syntax
);
7897 scratchbuf
[0] = '\0';
7902 OP_Mwait (int bytemode ATTRIBUTE_UNUSED
,
7903 int sizeflag ATTRIBUTE_UNUSED
)
7905 /* mwait %eax,%ecx */
7908 const char **names
= (address_mode
== mode_64bit
7909 ? names64
: names32
);
7910 strcpy (op_out
[0], names
[0]);
7911 strcpy (op_out
[1], names
[1]);
7914 /* Skip mod/rm byte. */
7920 OP_Monitor (int bytemode ATTRIBUTE_UNUSED
,
7921 int sizeflag ATTRIBUTE_UNUSED
)
7923 /* monitor %eax,%ecx,%edx" */
7926 const char **op1_names
;
7927 const char **names
= (address_mode
== mode_64bit
7928 ? names64
: names32
);
7930 if (!(prefixes
& PREFIX_ADDR
))
7931 op1_names
= (address_mode
== mode_16bit
7935 /* Remove "addr16/addr32". */
7937 op1_names
= (address_mode
!= mode_32bit
7938 ? names32
: names16
);
7939 used_prefixes
|= PREFIX_ADDR
;
7941 strcpy (op_out
[0], op1_names
[0]);
7942 strcpy (op_out
[1], names
[1]);
7943 strcpy (op_out
[2], names
[2]);
7946 /* Skip mod/rm byte. */
7954 /* Throw away prefixes and 1st. opcode byte. */
7955 codep
= insn_codep
+ 1;
7960 REP_Fixup (int bytemode
, int sizeflag
)
7962 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
7964 if (prefixes
& PREFIX_REPZ
)
7965 repz_prefix
= "rep ";
7972 OP_IMREG (bytemode
, sizeflag
);
7975 OP_ESreg (bytemode
, sizeflag
);
7978 OP_DSreg (bytemode
, sizeflag
);
7987 CMPXCHG8B_Fixup (int bytemode
, int sizeflag
)
7992 /* Change cmpxchg8b to cmpxchg16b. */
7993 char *p
= obuf
+ strlen (obuf
) - 2;
7997 OP_M (bytemode
, sizeflag
);
8001 XMM_Fixup (int reg
, int sizeflag ATTRIBUTE_UNUSED
)
8003 sprintf (scratchbuf
, "%%xmm%d", reg
);
8004 oappend (scratchbuf
+ intel_syntax
);
8008 CRC32_Fixup (int bytemode
, int sizeflag
)
8010 /* Add proper suffix to "crc32". */
8011 char *p
= obuf
+ strlen (obuf
);
8028 else if (sizeflag
& DFLAG
)
8032 used_prefixes
|= (prefixes
& PREFIX_DATA
);
8035 oappend (INTERNAL_DISASSEMBLER_ERROR
);
8044 /* Skip mod/rm byte. */
8049 add
= (rex
& REX_B
) ? 8 : 0;
8050 if (bytemode
== b_mode
)
8054 oappend (names8rex
[modrm
.rm
+ add
]);
8056 oappend (names8
[modrm
.rm
+ add
]);
8062 oappend (names64
[modrm
.rm
+ add
]);
8063 else if ((prefixes
& PREFIX_DATA
))
8064 oappend (names16
[modrm
.rm
+ add
]);
8066 oappend (names32
[modrm
.rm
+ add
]);
8070 OP_E (bytemode
, sizeflag
);
8073 /* Print a DREX argument as either a register or memory operation. */
8075 print_drex_arg (unsigned int reg
, int bytemode
, int sizeflag
)
8077 if (reg
== DREX_REG_UNKNOWN
)
8080 else if (reg
!= DREX_REG_MEMORY
)
8082 sprintf (scratchbuf
, "%%xmm%d", reg
);
8083 oappend (scratchbuf
+ intel_syntax
);
8087 OP_E_extended (bytemode
, sizeflag
, 1);
8090 /* SSE5 instructions that have 4 arguments are encoded as:
8091 0f 24 <sub-opcode> <modrm> <optional-sib> <drex> <offset>.
8093 The <sub-opcode> byte has 1 bit (0x4) that is combined with 1 bit in
8094 the DREX field (0x8) to determine how the arguments are laid out.
8095 The destination register must be the same register as one of the
8096 inputs, and it is encoded in the DREX byte. No REX prefix is used
8097 for these instructions, since the DREX field contains the 3 extension
8098 bits provided by the REX prefix.
8100 The bytemode argument adds 2 extra bits for passing extra information:
8101 DREX_OC1 -- Set the OC1 bit to indicate dest == 1st arg
8102 DREX_NO_OC0 -- OC0 in DREX is invalid
8103 (but pretend it is set). */
8106 OP_DREX4 (int flag_bytemode
, int sizeflag
)
8108 unsigned int drex_byte
;
8109 unsigned int regs
[4];
8110 unsigned int modrm_regmem
;
8111 unsigned int modrm_reg
;
8112 unsigned int drex_reg
;
8115 int rex_used_save
= rex_used
;
8117 int oc1
= (flag_bytemode
& DREX_OC1
) ? 2 : 0;
8121 bytemode
= flag_bytemode
& ~ DREX_MASK
;
8123 for (i
= 0; i
< 4; i
++)
8124 regs
[i
] = DREX_REG_UNKNOWN
;
8126 /* Determine if we have a SIB byte in addition to MODRM before the
8128 if (((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
8133 /* Get the DREX byte. */
8134 FETCH_DATA (the_info
, codep
+ 2 + has_sib
);
8135 drex_byte
= codep
[has_sib
+1];
8136 drex_reg
= DREX_XMM (drex_byte
);
8137 modrm_reg
= modrm
.reg
+ ((drex_byte
& REX_R
) ? 8 : 0);
8139 /* Is OC0 legal? If not, hardwire oc0 == 1. */
8140 if (flag_bytemode
& DREX_NO_OC0
)
8143 if (DREX_OC0 (drex_byte
))
8147 oc0
= DREX_OC0 (drex_byte
);
8151 /* regmem == register */
8152 modrm_regmem
= modrm
.rm
+ ((drex_byte
& REX_B
) ? 8 : 0);
8154 /* skip modrm/drex since we don't call OP_E_extended */
8159 /* regmem == memory, fill in appropriate REX bits */
8160 modrm_regmem
= DREX_REG_MEMORY
;
8161 rex
= drex_byte
& (REX_B
| REX_X
| REX_R
);
8167 /* Based on the OC1/OC0 bits, lay out the arguments in the correct
8176 regs
[0] = modrm_regmem
;
8177 regs
[1] = modrm_reg
;
8183 regs
[0] = modrm_reg
;
8184 regs
[1] = modrm_regmem
;
8191 regs
[1] = modrm_regmem
;
8192 regs
[2] = modrm_reg
;
8198 regs
[1] = modrm_reg
;
8199 regs
[2] = modrm_regmem
;
8204 /* Print out the arguments. */
8205 for (i
= 0; i
< 4; i
++)
8207 int j
= (intel_syntax
) ? 3 - i
: i
;
8214 print_drex_arg (regs
[j
], bytemode
, sizeflag
);
8218 rex_used
= rex_used_save
;
8221 /* SSE5 instructions that have 3 arguments, and are encoded as:
8222 0f 24 <sub-opcode> <modrm> <optional-sib> <drex> <offset> (or)
8223 0f 25 <sub-opcode> <modrm> <optional-sib> <drex> <offset> <cmp-byte>
8225 The DREX field has 1 bit (0x8) to determine how the arguments are
8226 laid out. The destination register is encoded in the DREX byte.
8227 No REX prefix is used for these instructions, since the DREX field
8228 contains the 3 extension bits provided by the REX prefix. */
8231 OP_DREX3 (int flag_bytemode
, int sizeflag
)
8233 unsigned int drex_byte
;
8234 unsigned int regs
[3];
8235 unsigned int modrm_regmem
;
8236 unsigned int modrm_reg
;
8237 unsigned int drex_reg
;
8240 int rex_used_save
= rex_used
;
8245 bytemode
= flag_bytemode
& ~ DREX_MASK
;
8247 for (i
= 0; i
< 3; i
++)
8248 regs
[i
] = DREX_REG_UNKNOWN
;
8250 /* Determine if we have a SIB byte in addition to MODRM before the
8252 if (((sizeflag
& AFLAG
) || address_mode
== mode_64bit
)
8257 /* Get the DREX byte. */
8258 FETCH_DATA (the_info
, codep
+ 2 + has_sib
);
8259 drex_byte
= codep
[has_sib
+1];
8260 drex_reg
= DREX_XMM (drex_byte
);
8261 modrm_reg
= modrm
.reg
+ ((drex_byte
& REX_R
) ? 8 : 0);
8263 /* Is OC0 legal? If not, hardwire oc0 == 0 */
8264 oc0
= DREX_OC0 (drex_byte
);
8265 if ((flag_bytemode
& DREX_NO_OC0
) && oc0
)
8270 /* regmem == register */
8271 modrm_regmem
= modrm
.rm
+ ((drex_byte
& REX_B
) ? 8 : 0);
8273 /* skip modrm/drex since we don't call OP_E_extended. */
8278 /* regmem == memory, fill in appropriate REX bits. */
8279 modrm_regmem
= DREX_REG_MEMORY
;
8280 rex
= drex_byte
& (REX_B
| REX_X
| REX_R
);
8286 /* Based on the OC1/OC0 bits, lay out the arguments in the correct
8295 regs
[0] = modrm_regmem
;
8296 regs
[1] = modrm_reg
;
8301 regs
[0] = modrm_reg
;
8302 regs
[1] = modrm_regmem
;
8307 /* Print out the arguments. */
8308 for (i
= 0; i
< 3; i
++)
8310 int j
= (intel_syntax
) ? 2 - i
: i
;
8317 print_drex_arg (regs
[j
], bytemode
, sizeflag
);
8321 rex_used
= rex_used_save
;
8324 /* Emit a floating point comparison for comp<xx> instructions. */
8327 OP_DREX_FCMP (int bytemode ATTRIBUTE_UNUSED
,
8328 int sizeflag ATTRIBUTE_UNUSED
)
8332 static const char *const cmp_test
[] = {
8351 FETCH_DATA (the_info
, codep
+ 1);
8352 byte
= *codep
& 0xff;
8354 if (byte
>= ARRAY_SIZE (cmp_test
)
8359 /* The instruction isn't one we know about, so just append the
8360 extension byte as a numeric value. */
8366 sprintf (scratchbuf
, "com%s%s", cmp_test
[byte
], obuf
+3);
8367 strcpy (obuf
, scratchbuf
);
8372 /* Emit an integer point comparison for pcom<xx> instructions,
8373 rewriting the instruction to have the test inside of it. */
8376 OP_DREX_ICMP (int bytemode ATTRIBUTE_UNUSED
,
8377 int sizeflag ATTRIBUTE_UNUSED
)
8381 static const char *const cmp_test
[] = {
8392 FETCH_DATA (the_info
, codep
+ 1);
8393 byte
= *codep
& 0xff;
8395 if (byte
>= ARRAY_SIZE (cmp_test
)
8401 /* The instruction isn't one we know about, so just print the
8402 comparison test byte as a numeric value. */
8408 sprintf (scratchbuf
, "pcom%s%s", cmp_test
[byte
], obuf
+4);
8409 strcpy (obuf
, scratchbuf
);