1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2023 Free Software Foundation, Inc.
4 This file is part of the GNU opcodes library.
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 It is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
22 /* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
24 modified by John Hassey (hassey@dg-rtp.dg.com)
25 x86-64 support added by Jan Hubicka (jh@suse.cz)
26 VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */
28 /* The main tables describing the instructions is essentially a copy
29 of the "Opcode Map" chapter (Appendix A) of the Intel 80386
30 Programmers Manual. Usually, there is a capital letter, followed
31 by a small letter. The capital letter tell the addressing mode,
32 and the small letter tells about the operand size. Refer to
33 the Intel manual for details. */
36 #include "disassemble.h"
38 #include "opcode/i386.h"
39 #include "libiberty.h"
40 #include "safe-ctype.h"
43 typedef struct instr_info instr_info
;
45 static void dofloat (instr_info
*, int);
46 static void OP_ST (instr_info
*, int, int);
47 static void OP_STi (instr_info
*, int, int);
48 static int putop (instr_info
*, const char *, int);
49 static void oappend_with_style (instr_info
*, const char *,
50 enum disassembler_style
);
51 static void oappend (instr_info
*, const char *);
52 static void append_seg (instr_info
*);
53 static void OP_indirE (instr_info
*, int, int);
54 static void OP_E_memory (instr_info
*, int, int);
55 static void OP_E (instr_info
*, int, int);
56 static void OP_G (instr_info
*, int, int);
57 static bfd_vma
get64 (instr_info
*);
58 static bfd_signed_vma
get32 (instr_info
*);
59 static bfd_signed_vma
get32s (instr_info
*);
60 static int get16 (instr_info
*);
61 static void set_op (instr_info
*, bfd_vma
, bool);
62 static void OP_Skip_MODRM (instr_info
*, int, int);
63 static void OP_REG (instr_info
*, int, int);
64 static void OP_IMREG (instr_info
*, int, int);
65 static void OP_I (instr_info
*, int, int);
66 static void OP_I64 (instr_info
*, int, int);
67 static void OP_sI (instr_info
*, int, int);
68 static void OP_J (instr_info
*, int, int);
69 static void OP_SEG (instr_info
*, int, int);
70 static void OP_DIR (instr_info
*, int, int);
71 static void OP_OFF (instr_info
*, int, int);
72 static void OP_OFF64 (instr_info
*, int, int);
73 static void ptr_reg (instr_info
*, int, int);
74 static void OP_ESreg (instr_info
*, int, int);
75 static void OP_DSreg (instr_info
*, int, int);
76 static void OP_C (instr_info
*, int, int);
77 static void OP_D (instr_info
*, int, int);
78 static void OP_T (instr_info
*, int, int);
79 static void OP_MMX (instr_info
*, int, int);
80 static void OP_XMM (instr_info
*, int, int);
81 static void OP_EM (instr_info
*, int, int);
82 static void OP_EX (instr_info
*, int, int);
83 static void OP_EMC (instr_info
*, int,int);
84 static void OP_MXC (instr_info
*, int,int);
85 static void OP_MS (instr_info
*, int, int);
86 static void OP_XS (instr_info
*, int, int);
87 static void OP_M (instr_info
*, int, int);
88 static void OP_VEX (instr_info
*, int, int);
89 static void OP_VexR (instr_info
*, int, int);
90 static void OP_VexW (instr_info
*, int, int);
91 static void OP_Rounding (instr_info
*, int, int);
92 static void OP_REG_VexI4 (instr_info
*, int, int);
93 static void OP_VexI4 (instr_info
*, int, int);
94 static void PCLMUL_Fixup (instr_info
*, int, int);
95 static void VPCMP_Fixup (instr_info
*, int, int);
96 static void VPCOM_Fixup (instr_info
*, int, int);
97 static void OP_0f07 (instr_info
*, int, int);
98 static void OP_Monitor (instr_info
*, int, int);
99 static void OP_Mwait (instr_info
*, int, int);
100 static void NOP_Fixup (instr_info
*, int, int);
101 static void OP_3DNowSuffix (instr_info
*, int, int);
102 static void CMP_Fixup (instr_info
*, int, int);
103 static void BadOp (instr_info
*);
104 static void REP_Fixup (instr_info
*, int, int);
105 static void SEP_Fixup (instr_info
*, int, int);
106 static void BND_Fixup (instr_info
*, int, int);
107 static void NOTRACK_Fixup (instr_info
*, int, int);
108 static void HLE_Fixup1 (instr_info
*, int, int);
109 static void HLE_Fixup2 (instr_info
*, int, int);
110 static void HLE_Fixup3 (instr_info
*, int, int);
111 static void CMPXCHG8B_Fixup (instr_info
*, int, int);
112 static void XMM_Fixup (instr_info
*, int, int);
113 static void FXSAVE_Fixup (instr_info
*, int, int);
115 static void MOVSXD_Fixup (instr_info
*, int, int);
116 static void DistinctDest_Fixup (instr_info
*, int, int);
117 static void PREFETCHI_Fixup (instr_info
*, int, int);
119 /* This character is used to encode style information within the output
120 buffers. See oappend_insert_style for more details. */
121 #define STYLE_MARKER_CHAR '\002'
123 /* The maximum operand buffer size. */
124 #define MAX_OPERAND_BUFFER_SIZE 128
127 /* Points to first byte not fetched. */
128 bfd_byte
*max_fetched
;
129 bfd_byte the_buffer
[MAX_MNEM_SIZE
];
132 OPCODES_SIGJMP_BUF bailout
;
150 enum address_mode address_mode
;
152 /* Flags for the prefixes for the current instruction. See below. */
155 /* REX prefix the current instruction. See below. */
157 /* Bits of REX we've already used. */
158 unsigned char rex_used
;
164 /* Flags for ins->prefixes which we somehow handled when printing the
165 current instruction. */
168 /* Flags for EVEX bits which we somehow handled when printing the
169 current instruction. */
172 char obuf
[MAX_OPERAND_BUFFER_SIZE
];
175 unsigned char *start_codep
;
176 unsigned char *insn_codep
;
177 unsigned char *codep
;
178 unsigned char *end_codep
;
179 signed char last_lock_prefix
;
180 signed char last_repz_prefix
;
181 signed char last_repnz_prefix
;
182 signed char last_data_prefix
;
183 signed char last_addr_prefix
;
184 signed char last_rex_prefix
;
185 signed char last_seg_prefix
;
186 signed char fwait_prefix
;
187 /* The active segment register prefix. */
188 unsigned char active_seg_prefix
;
190 #define MAX_CODE_LENGTH 15
191 /* We can up to 14 ins->prefixes since the maximum instruction length is
193 unsigned char all_prefixes
[MAX_CODE_LENGTH
- 1];
194 disassemble_info
*info
;
214 int register_specifier
;
217 int mask_register_specifier
;
229 /* Remember if the current op is a jump instruction. */
235 signed char op_index
[MAX_OPERANDS
];
236 bool op_riprel
[MAX_OPERANDS
];
237 char *op_out
[MAX_OPERANDS
];
238 bfd_vma op_address
[MAX_OPERANDS
];
241 /* On the 386's of 1988, the maximum length of an instruction is 15 bytes.
242 * (see topic "Redundant ins->prefixes" in the "Differences from 8086"
243 * section of the "Virtual 8086 Mode" chapter.)
244 * 'pc' should be the address of this instruction, it will
245 * be used to print the target address if this is a relative jump or call
246 * The function returns the length of this instruction in bytes.
255 enum x86_64_isa isa64
;
258 /* Mark parts used in the REX prefix. When we are testing for
259 empty prefix (for 8bit register REX extension), just mask it
260 out. Otherwise test for REX bit is excuse for existence of REX
261 only in case value is nonzero. */
262 #define USED_REX(value) \
266 if ((ins->rex & value)) \
267 ins->rex_used |= (value) | REX_OPCODE; \
270 ins->rex_used |= REX_OPCODE; \
274 #define EVEX_b_used 1
275 #define EVEX_len_used 2
277 /* Flags stored in PREFIXES. */
278 #define PREFIX_REPZ 1
279 #define PREFIX_REPNZ 2
282 #define PREFIX_DS 0x10
283 #define PREFIX_ES 0x20
284 #define PREFIX_FS 0x40
285 #define PREFIX_GS 0x80
286 #define PREFIX_LOCK 0x100
287 #define PREFIX_DATA 0x200
288 #define PREFIX_ADDR 0x400
289 #define PREFIX_FWAIT 0x800
291 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
292 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
294 #define FETCH_DATA(info, addr) \
295 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
296 ? 1 : fetch_data ((info), (addr)))
299 fetch_data (struct disassemble_info
*info
, bfd_byte
*addr
)
302 struct dis_private
*priv
= (struct dis_private
*) info
->private_data
;
303 bfd_vma start
= priv
->insn_start
+ (priv
->max_fetched
- priv
->the_buffer
);
305 if (addr
<= priv
->the_buffer
+ MAX_MNEM_SIZE
)
306 status
= (*info
->read_memory_func
) (start
,
308 addr
- priv
->max_fetched
,
314 /* If we did manage to read at least one byte, then
315 print_insn_i386 will do something sensible. Otherwise, print
316 an error. We do that here because this is where we know
318 if (priv
->max_fetched
== priv
->the_buffer
)
319 (*info
->memory_error_func
) (status
, start
, info
);
320 OPCODES_SIGLONGJMP (priv
->bailout
, 1);
323 priv
->max_fetched
= addr
;
327 /* Possible values for prefix requirement. */
328 #define PREFIX_IGNORED_SHIFT 16
329 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
330 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
331 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
332 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
333 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
335 /* Opcode prefixes. */
336 #define PREFIX_OPCODE (PREFIX_REPZ \
340 /* Prefixes ignored. */
341 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
342 | PREFIX_IGNORED_REPNZ \
343 | PREFIX_IGNORED_DATA)
345 #define XX { NULL, 0 }
346 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
348 #define Eb { OP_E, b_mode }
349 #define Ebnd { OP_E, bnd_mode }
350 #define EbS { OP_E, b_swap_mode }
351 #define EbndS { OP_E, bnd_swap_mode }
352 #define Ev { OP_E, v_mode }
353 #define Eva { OP_E, va_mode }
354 #define Ev_bnd { OP_E, v_bnd_mode }
355 #define EvS { OP_E, v_swap_mode }
356 #define Ed { OP_E, d_mode }
357 #define Edq { OP_E, dq_mode }
358 #define Edb { OP_E, db_mode }
359 #define Edw { OP_E, dw_mode }
360 #define Eq { OP_E, q_mode }
361 #define indirEv { OP_indirE, indir_v_mode }
362 #define indirEp { OP_indirE, f_mode }
363 #define stackEv { OP_E, stack_v_mode }
364 #define Em { OP_E, m_mode }
365 #define Ew { OP_E, w_mode }
366 #define M { OP_M, 0 } /* lea, lgdt, etc. */
367 #define Ma { OP_M, a_mode }
368 #define Mb { OP_M, b_mode }
369 #define Md { OP_M, d_mode }
370 #define Mdq { OP_M, dq_mode }
371 #define Mo { OP_M, o_mode }
372 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
373 #define Mq { OP_M, q_mode }
374 #define Mv { OP_M, v_mode }
375 #define Mv_bnd { OP_M, v_bndmk_mode }
376 #define Mw { OP_M, w_mode }
377 #define Mx { OP_M, x_mode }
378 #define Mxmm { OP_M, xmm_mode }
379 #define Gb { OP_G, b_mode }
380 #define Gbnd { OP_G, bnd_mode }
381 #define Gv { OP_G, v_mode }
382 #define Gd { OP_G, d_mode }
383 #define Gdq { OP_G, dq_mode }
384 #define Gm { OP_G, m_mode }
385 #define Gva { OP_G, va_mode }
386 #define Gw { OP_G, w_mode }
387 #define Ib { OP_I, b_mode }
388 #define sIb { OP_sI, b_mode } /* sign extened byte */
389 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
390 #define Iv { OP_I, v_mode }
391 #define sIv { OP_sI, v_mode }
392 #define Iv64 { OP_I64, v_mode }
393 #define Id { OP_I, d_mode }
394 #define Iw { OP_I, w_mode }
395 #define I1 { OP_I, const_1_mode }
396 #define Jb { OP_J, b_mode }
397 #define Jv { OP_J, v_mode }
398 #define Jdqw { OP_J, dqw_mode }
399 #define Cm { OP_C, m_mode }
400 #define Dm { OP_D, m_mode }
401 #define Td { OP_T, d_mode }
402 #define Skip_MODRM { OP_Skip_MODRM, 0 }
404 #define RMeAX { OP_REG, eAX_reg }
405 #define RMeBX { OP_REG, eBX_reg }
406 #define RMeCX { OP_REG, eCX_reg }
407 #define RMeDX { OP_REG, eDX_reg }
408 #define RMeSP { OP_REG, eSP_reg }
409 #define RMeBP { OP_REG, eBP_reg }
410 #define RMeSI { OP_REG, eSI_reg }
411 #define RMeDI { OP_REG, eDI_reg }
412 #define RMrAX { OP_REG, rAX_reg }
413 #define RMrBX { OP_REG, rBX_reg }
414 #define RMrCX { OP_REG, rCX_reg }
415 #define RMrDX { OP_REG, rDX_reg }
416 #define RMrSP { OP_REG, rSP_reg }
417 #define RMrBP { OP_REG, rBP_reg }
418 #define RMrSI { OP_REG, rSI_reg }
419 #define RMrDI { OP_REG, rDI_reg }
420 #define RMAL { OP_REG, al_reg }
421 #define RMCL { OP_REG, cl_reg }
422 #define RMDL { OP_REG, dl_reg }
423 #define RMBL { OP_REG, bl_reg }
424 #define RMAH { OP_REG, ah_reg }
425 #define RMCH { OP_REG, ch_reg }
426 #define RMDH { OP_REG, dh_reg }
427 #define RMBH { OP_REG, bh_reg }
428 #define RMAX { OP_REG, ax_reg }
429 #define RMDX { OP_REG, dx_reg }
431 #define eAX { OP_IMREG, eAX_reg }
432 #define AL { OP_IMREG, al_reg }
433 #define CL { OP_IMREG, cl_reg }
434 #define zAX { OP_IMREG, z_mode_ax_reg }
435 #define indirDX { OP_IMREG, indir_dx_reg }
437 #define Sw { OP_SEG, w_mode }
438 #define Sv { OP_SEG, v_mode }
439 #define Ap { OP_DIR, 0 }
440 #define Ob { OP_OFF64, b_mode }
441 #define Ov { OP_OFF64, v_mode }
442 #define Xb { OP_DSreg, eSI_reg }
443 #define Xv { OP_DSreg, eSI_reg }
444 #define Xz { OP_DSreg, eSI_reg }
445 #define Yb { OP_ESreg, eDI_reg }
446 #define Yv { OP_ESreg, eDI_reg }
447 #define DSBX { OP_DSreg, eBX_reg }
449 #define es { OP_REG, es_reg }
450 #define ss { OP_REG, ss_reg }
451 #define cs { OP_REG, cs_reg }
452 #define ds { OP_REG, ds_reg }
453 #define fs { OP_REG, fs_reg }
454 #define gs { OP_REG, gs_reg }
456 #define MX { OP_MMX, 0 }
457 #define XM { OP_XMM, 0 }
458 #define XMScalar { OP_XMM, scalar_mode }
459 #define XMGatherD { OP_XMM, vex_vsib_d_w_dq_mode }
460 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
461 #define XMM { OP_XMM, xmm_mode }
462 #define TMM { OP_XMM, tmm_mode }
463 #define XMxmmq { OP_XMM, xmmq_mode }
464 #define EM { OP_EM, v_mode }
465 #define EMS { OP_EM, v_swap_mode }
466 #define EMd { OP_EM, d_mode }
467 #define EMx { OP_EM, x_mode }
468 #define EXbwUnit { OP_EX, bw_unit_mode }
469 #define EXb { OP_EX, b_mode }
470 #define EXw { OP_EX, w_mode }
471 #define EXd { OP_EX, d_mode }
472 #define EXdS { OP_EX, d_swap_mode }
473 #define EXwS { OP_EX, w_swap_mode }
474 #define EXq { OP_EX, q_mode }
475 #define EXqS { OP_EX, q_swap_mode }
476 #define EXdq { OP_EX, dq_mode }
477 #define EXx { OP_EX, x_mode }
478 #define EXxh { OP_EX, xh_mode }
479 #define EXxS { OP_EX, x_swap_mode }
480 #define EXxmm { OP_EX, xmm_mode }
481 #define EXymm { OP_EX, ymm_mode }
482 #define EXtmm { OP_EX, tmm_mode }
483 #define EXxmmq { OP_EX, xmmq_mode }
484 #define EXxmmqh { OP_EX, evex_half_bcst_xmmqh_mode }
485 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
486 #define EXxmmdw { OP_EX, xmmdw_mode }
487 #define EXxmmqd { OP_EX, xmmqd_mode }
488 #define EXxmmqdh { OP_EX, evex_half_bcst_xmmqdh_mode }
489 #define EXymmq { OP_EX, ymmq_mode }
490 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
491 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
492 #define MS { OP_MS, v_mode }
493 #define XS { OP_XS, v_mode }
494 #define EMCq { OP_EMC, q_mode }
495 #define MXC { OP_MXC, 0 }
496 #define OPSUF { OP_3DNowSuffix, 0 }
497 #define SEP { SEP_Fixup, 0 }
498 #define CMP { CMP_Fixup, 0 }
499 #define XMM0 { XMM_Fixup, 0 }
500 #define FXSAVE { FXSAVE_Fixup, 0 }
502 #define Vex { OP_VEX, x_mode }
503 #define VexW { OP_VexW, x_mode }
504 #define VexScalar { OP_VEX, scalar_mode }
505 #define VexScalarR { OP_VexR, scalar_mode }
506 #define VexGatherD { OP_VEX, vex_vsib_d_w_dq_mode }
507 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
508 #define VexGdq { OP_VEX, dq_mode }
509 #define VexTmm { OP_VEX, tmm_mode }
510 #define XMVexI4 { OP_REG_VexI4, x_mode }
511 #define XMVexScalarI4 { OP_REG_VexI4, scalar_mode }
512 #define VexI4 { OP_VexI4, 0 }
513 #define PCLMUL { PCLMUL_Fixup, 0 }
514 #define VPCMP { VPCMP_Fixup, 0 }
515 #define VPCOM { VPCOM_Fixup, 0 }
517 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
518 #define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
519 #define EXxEVexS { OP_Rounding, evex_sae_mode }
521 #define MaskG { OP_G, mask_mode }
522 #define MaskE { OP_E, mask_mode }
523 #define MaskBDE { OP_E, mask_bd_mode }
524 #define MaskVex { OP_VEX, mask_mode }
526 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
527 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
529 #define MVexSIBMEM { OP_M, vex_sibmem_mode }
531 /* Used handle "rep" prefix for string instructions. */
532 #define Xbr { REP_Fixup, eSI_reg }
533 #define Xvr { REP_Fixup, eSI_reg }
534 #define Ybr { REP_Fixup, eDI_reg }
535 #define Yvr { REP_Fixup, eDI_reg }
536 #define Yzr { REP_Fixup, eDI_reg }
537 #define indirDXr { REP_Fixup, indir_dx_reg }
538 #define ALr { REP_Fixup, al_reg }
539 #define eAXr { REP_Fixup, eAX_reg }
541 /* Used handle HLE prefix for lockable instructions. */
542 #define Ebh1 { HLE_Fixup1, b_mode }
543 #define Evh1 { HLE_Fixup1, v_mode }
544 #define Ebh2 { HLE_Fixup2, b_mode }
545 #define Evh2 { HLE_Fixup2, v_mode }
546 #define Ebh3 { HLE_Fixup3, b_mode }
547 #define Evh3 { HLE_Fixup3, v_mode }
549 #define BND { BND_Fixup, 0 }
550 #define NOTRACK { NOTRACK_Fixup, 0 }
552 #define cond_jump_flag { NULL, cond_jump_mode }
553 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
555 /* bits in sizeflag */
556 #define SUFFIX_ALWAYS 4
564 /* byte operand with operand swapped */
566 /* byte operand, sign extend like 'T' suffix */
568 /* operand size depends on prefixes */
570 /* operand size depends on prefixes with operand swapped */
572 /* operand size depends on address prefix */
576 /* double word operand */
578 /* word operand with operand swapped */
580 /* double word operand with operand swapped */
582 /* quad word operand */
584 /* quad word operand with operand swapped */
586 /* ten-byte operand */
588 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
589 broadcast enabled. */
591 /* Similar to x_mode, but with different EVEX mem shifts. */
593 /* Similar to x_mode, but with yet different EVEX mem shifts. */
595 /* Similar to x_mode, but with disabled broadcast. */
597 /* Similar to x_mode, but with operands swapped and disabled broadcast
600 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
601 broadcast of 16bit enabled. */
603 /* 16-byte XMM operand */
605 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
606 memory operand (depending on vector length). Broadcast isn't
609 /* Same as xmmq_mode, but broadcast is allowed. */
610 evex_half_bcst_xmmq_mode
,
611 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
612 memory operand (depending on vector length). 16bit broadcast. */
613 evex_half_bcst_xmmqh_mode
,
614 /* 16-byte XMM, word, double word or quad word operand. */
616 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
618 /* 16-byte XMM, double word, quad word operand or xmm word operand.
620 evex_half_bcst_xmmqdh_mode
,
621 /* 32-byte YMM operand */
623 /* quad word, ymmword or zmmword memory operand. */
627 /* d_mode in 32bit, q_mode in 64bit mode. */
629 /* pair of v_mode operands */
635 /* like v_bnd_mode in 32bit, no RIP-rel in 64bit mode. */
637 /* operand size depends on REX.W / VEX.W. */
639 /* Displacements like v_mode without considering Intel64 ISA. */
643 /* bounds operand with operand swapped */
645 /* 4- or 6-byte pointer operand */
648 /* v_mode for indirect branch opcodes. */
650 /* v_mode for stack-related opcodes. */
652 /* non-quad operand size depends on prefixes */
654 /* 16-byte operand */
656 /* registers like d_mode, memory like b_mode. */
658 /* registers like d_mode, memory like w_mode. */
661 /* Operand size depends on the VEX.W bit, with VSIB dword indices. */
662 vex_vsib_d_w_dq_mode
,
663 /* Operand size depends on the VEX.W bit, with VSIB qword indices. */
664 vex_vsib_q_w_dq_mode
,
665 /* mandatory non-vector SIB. */
668 /* scalar, ignore vector length. */
671 /* Static rounding. */
673 /* Static rounding, 64-bit mode only. */
674 evex_rounding_64_mode
,
675 /* Supress all exceptions. */
678 /* Mask register operand. */
680 /* Mask register operand. */
748 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
750 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
751 #define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
752 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
753 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
754 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
755 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
756 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
757 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
758 #define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
759 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
760 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
761 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
762 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
763 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
764 #define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
765 #define EVEX_LEN_TABLE(I) DIS386 (USE_EVEX_LEN_TABLE, (I))
792 REG_0F3A0F_PREFIX_1_MOD_3
,
805 REG_VEX_0F3849_X86_64_P_0_W_0_M_1
,
810 REG_XOP_09_12_M_1_L_0
,
816 REG_EVEX_0F38C6_M_0_L_2
,
817 REG_EVEX_0F38C7_M_0_L_2
898 MOD_VEX_0F12_PREFIX_0
,
899 MOD_VEX_0F12_PREFIX_2
,
901 MOD_VEX_0F16_PREFIX_0
,
902 MOD_VEX_0F16_PREFIX_2
,
926 MOD_VEX_0FF0_PREFIX_3
,
933 MOD_VEX_0F3849_X86_64_P_0_W_0
,
934 MOD_VEX_0F3849_X86_64_P_2_W_0
,
935 MOD_VEX_0F3849_X86_64_P_3_W_0
,
936 MOD_VEX_0F384B_X86_64_P_1_W_0
,
937 MOD_VEX_0F384B_X86_64_P_2_W_0
,
938 MOD_VEX_0F384B_X86_64_P_3_W_0
,
940 MOD_VEX_0F385C_X86_64_P_1_W_0
,
941 MOD_VEX_0F385C_X86_64_P_3_W_0
,
942 MOD_VEX_0F385E_X86_64_P_0_W_0
,
943 MOD_VEX_0F385E_X86_64_P_1_W_0
,
944 MOD_VEX_0F385E_X86_64_P_2_W_0
,
945 MOD_VEX_0F385E_X86_64_P_3_W_0
,
958 MOD_EVEX_0F382A_P_1_W_1
,
960 MOD_EVEX_0F383A_P_1_W_0
,
980 RM_0F1E_P_1_MOD_3_REG_7
,
981 RM_0FAE_REG_6_MOD_3_P_0
,
983 RM_0F3A0F_P_1_MOD_3_REG_0
,
985 RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0
991 PREFIX_0F01_REG_0_MOD_3_RM_6
,
992 PREFIX_0F01_REG_1_RM_4
,
993 PREFIX_0F01_REG_1_RM_5
,
994 PREFIX_0F01_REG_1_RM_6
,
995 PREFIX_0F01_REG_1_RM_7
,
996 PREFIX_0F01_REG_3_RM_1
,
997 PREFIX_0F01_REG_5_MOD_0
,
998 PREFIX_0F01_REG_5_MOD_3_RM_0
,
999 PREFIX_0F01_REG_5_MOD_3_RM_1
,
1000 PREFIX_0F01_REG_5_MOD_3_RM_2
,
1001 PREFIX_0F01_REG_5_MOD_3_RM_4
,
1002 PREFIX_0F01_REG_5_MOD_3_RM_5
,
1003 PREFIX_0F01_REG_5_MOD_3_RM_6
,
1004 PREFIX_0F01_REG_5_MOD_3_RM_7
,
1005 PREFIX_0F01_REG_7_MOD_3_RM_2
,
1006 PREFIX_0F01_REG_7_MOD_3_RM_5
,
1007 PREFIX_0F01_REG_7_MOD_3_RM_6
,
1008 PREFIX_0F01_REG_7_MOD_3_RM_7
,
1014 PREFIX_0F18_REG_6_MOD_0_X86_64
,
1015 PREFIX_0F18_REG_7_MOD_0_X86_64
,
1048 PREFIX_0FAE_REG_0_MOD_3
,
1049 PREFIX_0FAE_REG_1_MOD_3
,
1050 PREFIX_0FAE_REG_2_MOD_3
,
1051 PREFIX_0FAE_REG_3_MOD_3
,
1052 PREFIX_0FAE_REG_4_MOD_0
,
1053 PREFIX_0FAE_REG_4_MOD_3
,
1054 PREFIX_0FAE_REG_5_MOD_3
,
1055 PREFIX_0FAE_REG_6_MOD_0
,
1056 PREFIX_0FAE_REG_6_MOD_3
,
1057 PREFIX_0FAE_REG_7_MOD_0
,
1062 PREFIX_0FC7_REG_6_MOD_0
,
1063 PREFIX_0FC7_REG_6_MOD_3
,
1064 PREFIX_0FC7_REG_7_MOD_3
,
1093 PREFIX_VEX_0F41_L_1_M_1_W_0
,
1094 PREFIX_VEX_0F41_L_1_M_1_W_1
,
1095 PREFIX_VEX_0F42_L_1_M_1_W_0
,
1096 PREFIX_VEX_0F42_L_1_M_1_W_1
,
1097 PREFIX_VEX_0F44_L_0_M_1_W_0
,
1098 PREFIX_VEX_0F44_L_0_M_1_W_1
,
1099 PREFIX_VEX_0F45_L_1_M_1_W_0
,
1100 PREFIX_VEX_0F45_L_1_M_1_W_1
,
1101 PREFIX_VEX_0F46_L_1_M_1_W_0
,
1102 PREFIX_VEX_0F46_L_1_M_1_W_1
,
1103 PREFIX_VEX_0F47_L_1_M_1_W_0
,
1104 PREFIX_VEX_0F47_L_1_M_1_W_1
,
1105 PREFIX_VEX_0F4A_L_1_M_1_W_0
,
1106 PREFIX_VEX_0F4A_L_1_M_1_W_1
,
1107 PREFIX_VEX_0F4B_L_1_M_1_W_0
,
1108 PREFIX_VEX_0F4B_L_1_M_1_W_1
,
1126 PREFIX_VEX_0F90_L_0_W_0
,
1127 PREFIX_VEX_0F90_L_0_W_1
,
1128 PREFIX_VEX_0F91_L_0_M_0_W_0
,
1129 PREFIX_VEX_0F91_L_0_M_0_W_1
,
1130 PREFIX_VEX_0F92_L_0_M_1_W_0
,
1131 PREFIX_VEX_0F92_L_0_M_1_W_1
,
1132 PREFIX_VEX_0F93_L_0_M_1_W_0
,
1133 PREFIX_VEX_0F93_L_0_M_1_W_1
,
1134 PREFIX_VEX_0F98_L_0_M_1_W_0
,
1135 PREFIX_VEX_0F98_L_0_M_1_W_1
,
1136 PREFIX_VEX_0F99_L_0_M_1_W_0
,
1137 PREFIX_VEX_0F99_L_0_M_1_W_1
,
1142 PREFIX_VEX_0F3849_X86_64
,
1143 PREFIX_VEX_0F384B_X86_64
,
1144 PREFIX_VEX_0F3850_W_0
,
1145 PREFIX_VEX_0F3851_W_0
,
1146 PREFIX_VEX_0F385C_X86_64
,
1147 PREFIX_VEX_0F385E_X86_64
,
1149 PREFIX_VEX_0F38B0_W_0
,
1150 PREFIX_VEX_0F38B1_W_0
,
1151 PREFIX_VEX_0F38F5_L_0
,
1152 PREFIX_VEX_0F38F6_L_0
,
1153 PREFIX_VEX_0F38F7_L_0
,
1154 PREFIX_VEX_0F3AF0_L_0
,
1212 PREFIX_EVEX_MAP5_10
,
1213 PREFIX_EVEX_MAP5_11
,
1214 PREFIX_EVEX_MAP5_1D
,
1215 PREFIX_EVEX_MAP5_2A
,
1216 PREFIX_EVEX_MAP5_2C
,
1217 PREFIX_EVEX_MAP5_2D
,
1218 PREFIX_EVEX_MAP5_2E
,
1219 PREFIX_EVEX_MAP5_2F
,
1220 PREFIX_EVEX_MAP5_51
,
1221 PREFIX_EVEX_MAP5_58
,
1222 PREFIX_EVEX_MAP5_59
,
1223 PREFIX_EVEX_MAP5_5A
,
1224 PREFIX_EVEX_MAP5_5B
,
1225 PREFIX_EVEX_MAP5_5C
,
1226 PREFIX_EVEX_MAP5_5D
,
1227 PREFIX_EVEX_MAP5_5E
,
1228 PREFIX_EVEX_MAP5_5F
,
1229 PREFIX_EVEX_MAP5_78
,
1230 PREFIX_EVEX_MAP5_79
,
1231 PREFIX_EVEX_MAP5_7A
,
1232 PREFIX_EVEX_MAP5_7B
,
1233 PREFIX_EVEX_MAP5_7C
,
1234 PREFIX_EVEX_MAP5_7D
,
1236 PREFIX_EVEX_MAP6_13
,
1237 PREFIX_EVEX_MAP6_56
,
1238 PREFIX_EVEX_MAP6_57
,
1239 PREFIX_EVEX_MAP6_D6
,
1240 PREFIX_EVEX_MAP6_D7
,
1275 X86_64_0F01_REG_0_MOD_3_RM_6_P_1
,
1276 X86_64_0F01_REG_0_MOD_3_RM_6_P_3
,
1278 X86_64_0F01_REG_1_RM_5_PREFIX_2
,
1279 X86_64_0F01_REG_1_RM_6_PREFIX_2
,
1280 X86_64_0F01_REG_1_RM_7_PREFIX_2
,
1283 X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
,
1284 X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
,
1285 X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
,
1286 X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
,
1287 X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1
,
1288 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
,
1289 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
,
1290 X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
,
1291 X86_64_0F18_REG_6_MOD_0
,
1292 X86_64_0F18_REG_7_MOD_0
,
1295 X86_64_0FC7_REG_6_MOD_3_PREFIX_1
,
1321 THREE_BYTE_0F38
= 0,
1350 VEX_LEN_0F12_P_0_M_0
= 0,
1351 VEX_LEN_0F12_P_0_M_1
,
1352 #define VEX_LEN_0F12_P_2_M_0 VEX_LEN_0F12_P_0_M_0
1354 VEX_LEN_0F16_P_0_M_0
,
1355 VEX_LEN_0F16_P_0_M_1
,
1356 #define VEX_LEN_0F16_P_2_M_0 VEX_LEN_0F16_P_0_M_0
1376 VEX_LEN_0FAE_R_2_M_0
,
1377 VEX_LEN_0FAE_R_3_M_0
,
1387 VEX_LEN_0F3849_X86_64_P_0_W_0_M_0
,
1388 VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0
,
1389 VEX_LEN_0F3849_X86_64_P_2_W_0_M_0
,
1390 VEX_LEN_0F3849_X86_64_P_3_W_0_M_0
,
1391 VEX_LEN_0F384B_X86_64_P_1_W_0_M_0
,
1392 VEX_LEN_0F384B_X86_64_P_2_W_0_M_0
,
1393 VEX_LEN_0F384B_X86_64_P_3_W_0_M_0
,
1395 VEX_LEN_0F385C_X86_64_P_1_W_0_M_0
,
1396 VEX_LEN_0F385C_X86_64_P_3_W_0_M_0
,
1397 VEX_LEN_0F385E_X86_64_P_0_W_0_M_0
,
1398 VEX_LEN_0F385E_X86_64_P_1_W_0_M_0
,
1399 VEX_LEN_0F385E_X86_64_P_2_W_0_M_0
,
1400 VEX_LEN_0F385E_X86_64_P_3_W_0_M_0
,
1433 VEX_LEN_0FXOP_08_85
,
1434 VEX_LEN_0FXOP_08_86
,
1435 VEX_LEN_0FXOP_08_87
,
1436 VEX_LEN_0FXOP_08_8E
,
1437 VEX_LEN_0FXOP_08_8F
,
1438 VEX_LEN_0FXOP_08_95
,
1439 VEX_LEN_0FXOP_08_96
,
1440 VEX_LEN_0FXOP_08_97
,
1441 VEX_LEN_0FXOP_08_9E
,
1442 VEX_LEN_0FXOP_08_9F
,
1443 VEX_LEN_0FXOP_08_A3
,
1444 VEX_LEN_0FXOP_08_A6
,
1445 VEX_LEN_0FXOP_08_B6
,
1446 VEX_LEN_0FXOP_08_C0
,
1447 VEX_LEN_0FXOP_08_C1
,
1448 VEX_LEN_0FXOP_08_C2
,
1449 VEX_LEN_0FXOP_08_C3
,
1450 VEX_LEN_0FXOP_08_CC
,
1451 VEX_LEN_0FXOP_08_CD
,
1452 VEX_LEN_0FXOP_08_CE
,
1453 VEX_LEN_0FXOP_08_CF
,
1454 VEX_LEN_0FXOP_08_EC
,
1455 VEX_LEN_0FXOP_08_ED
,
1456 VEX_LEN_0FXOP_08_EE
,
1457 VEX_LEN_0FXOP_08_EF
,
1458 VEX_LEN_0FXOP_09_01
,
1459 VEX_LEN_0FXOP_09_02
,
1460 VEX_LEN_0FXOP_09_12_M_1
,
1461 VEX_LEN_0FXOP_09_82_W_0
,
1462 VEX_LEN_0FXOP_09_83_W_0
,
1463 VEX_LEN_0FXOP_09_90
,
1464 VEX_LEN_0FXOP_09_91
,
1465 VEX_LEN_0FXOP_09_92
,
1466 VEX_LEN_0FXOP_09_93
,
1467 VEX_LEN_0FXOP_09_94
,
1468 VEX_LEN_0FXOP_09_95
,
1469 VEX_LEN_0FXOP_09_96
,
1470 VEX_LEN_0FXOP_09_97
,
1471 VEX_LEN_0FXOP_09_98
,
1472 VEX_LEN_0FXOP_09_99
,
1473 VEX_LEN_0FXOP_09_9A
,
1474 VEX_LEN_0FXOP_09_9B
,
1475 VEX_LEN_0FXOP_09_C1
,
1476 VEX_LEN_0FXOP_09_C2
,
1477 VEX_LEN_0FXOP_09_C3
,
1478 VEX_LEN_0FXOP_09_C6
,
1479 VEX_LEN_0FXOP_09_C7
,
1480 VEX_LEN_0FXOP_09_CB
,
1481 VEX_LEN_0FXOP_09_D1
,
1482 VEX_LEN_0FXOP_09_D2
,
1483 VEX_LEN_0FXOP_09_D3
,
1484 VEX_LEN_0FXOP_09_D6
,
1485 VEX_LEN_0FXOP_09_D7
,
1486 VEX_LEN_0FXOP_09_DB
,
1487 VEX_LEN_0FXOP_09_E1
,
1488 VEX_LEN_0FXOP_09_E2
,
1489 VEX_LEN_0FXOP_09_E3
,
1490 VEX_LEN_0FXOP_0A_12
,
1495 EVEX_LEN_0F3816
= 0,
1497 EVEX_LEN_0F381A_M_0
,
1498 EVEX_LEN_0F381B_M_0
,
1500 EVEX_LEN_0F385A_M_0
,
1501 EVEX_LEN_0F385B_M_0
,
1502 EVEX_LEN_0F38C6_M_0
,
1503 EVEX_LEN_0F38C7_M_0
,
1520 VEX_W_0F41_L_1_M_1
= 0,
1542 VEX_W_0F381A_M_0_L_1
,
1549 VEX_W_0F3849_X86_64_P_0
,
1550 VEX_W_0F3849_X86_64_P_2
,
1551 VEX_W_0F3849_X86_64_P_3
,
1552 VEX_W_0F384B_X86_64_P_1
,
1553 VEX_W_0F384B_X86_64_P_2
,
1554 VEX_W_0F384B_X86_64_P_3
,
1561 VEX_W_0F385A_M_0_L_0
,
1562 VEX_W_0F385C_X86_64_P_1
,
1563 VEX_W_0F385C_X86_64_P_3
,
1564 VEX_W_0F385E_X86_64_P_0
,
1565 VEX_W_0F385E_X86_64_P_1
,
1566 VEX_W_0F385E_X86_64_P_2
,
1567 VEX_W_0F385E_X86_64_P_3
,
1594 VEX_W_0FXOP_08_85_L_0
,
1595 VEX_W_0FXOP_08_86_L_0
,
1596 VEX_W_0FXOP_08_87_L_0
,
1597 VEX_W_0FXOP_08_8E_L_0
,
1598 VEX_W_0FXOP_08_8F_L_0
,
1599 VEX_W_0FXOP_08_95_L_0
,
1600 VEX_W_0FXOP_08_96_L_0
,
1601 VEX_W_0FXOP_08_97_L_0
,
1602 VEX_W_0FXOP_08_9E_L_0
,
1603 VEX_W_0FXOP_08_9F_L_0
,
1604 VEX_W_0FXOP_08_A6_L_0
,
1605 VEX_W_0FXOP_08_B6_L_0
,
1606 VEX_W_0FXOP_08_C0_L_0
,
1607 VEX_W_0FXOP_08_C1_L_0
,
1608 VEX_W_0FXOP_08_C2_L_0
,
1609 VEX_W_0FXOP_08_C3_L_0
,
1610 VEX_W_0FXOP_08_CC_L_0
,
1611 VEX_W_0FXOP_08_CD_L_0
,
1612 VEX_W_0FXOP_08_CE_L_0
,
1613 VEX_W_0FXOP_08_CF_L_0
,
1614 VEX_W_0FXOP_08_EC_L_0
,
1615 VEX_W_0FXOP_08_ED_L_0
,
1616 VEX_W_0FXOP_08_EE_L_0
,
1617 VEX_W_0FXOP_08_EF_L_0
,
1623 VEX_W_0FXOP_09_C1_L_0
,
1624 VEX_W_0FXOP_09_C2_L_0
,
1625 VEX_W_0FXOP_09_C3_L_0
,
1626 VEX_W_0FXOP_09_C6_L_0
,
1627 VEX_W_0FXOP_09_C7_L_0
,
1628 VEX_W_0FXOP_09_CB_L_0
,
1629 VEX_W_0FXOP_09_D1_L_0
,
1630 VEX_W_0FXOP_09_D2_L_0
,
1631 VEX_W_0FXOP_09_D3_L_0
,
1632 VEX_W_0FXOP_09_D6_L_0
,
1633 VEX_W_0FXOP_09_D7_L_0
,
1634 VEX_W_0FXOP_09_DB_L_0
,
1635 VEX_W_0FXOP_09_E1_L_0
,
1636 VEX_W_0FXOP_09_E2_L_0
,
1637 VEX_W_0FXOP_09_E3_L_0
,
1690 EVEX_W_0F381A_M_0_L_n
,
1691 EVEX_W_0F381B_M_0_L_2
,
1716 EVEX_W_0F385A_M_0_L_n
,
1717 EVEX_W_0F385B_M_0_L_2
,
1743 typedef void (*op_rtn
) (instr_info
*ins
, int bytemode
, int sizeflag
);
1752 unsigned int prefix_requirement
;
1755 /* Upper case letters in the instruction names here are macros.
1756 'A' => print 'b' if no register operands or suffix_always is true
1757 'B' => print 'b' if suffix_always is true
1758 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
1760 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
1761 suffix_always is true
1762 'E' => print 'e' if 32-bit form of jcxz
1763 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
1764 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
1765 'H' => print ",pt" or ",pn" branch hint
1768 'K' => print 'd' or 'q' if rex prefix is present.
1770 'M' => print 'r' if intel_mnemonic is false.
1771 'N' => print 'n' if instruction has no wait "prefix"
1772 'O' => print 'd' or 'o' (or 'q' in Intel mode)
1773 'P' => behave as 'T' except with register operand outside of suffix_always
1775 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
1777 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
1778 'S' => print 'w', 'l' or 'q' if suffix_always is true
1779 'T' => print 'w', 'l'/'d', or 'q' if instruction has an operand size
1780 prefix or if suffix_always is true.
1783 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
1784 'X' => print 's', 'd' depending on data16 prefix (for XMM)
1786 'Z' => print 'q' in 64bit mode and 'l' otherwise, if suffix_always is true.
1787 '!' => change condition from true to false or from false to true.
1788 '%' => add 1 upper case letter to the macro.
1789 '^' => print 'w', 'l', or 'q' (Intel64 ISA only) depending on operand size
1790 prefix or suffix_always is true (lcall/ljmp).
1791 '@' => in 64bit mode for Intel64 ISA or if instruction
1792 has no operand sizing prefix, print 'q' if suffix_always is true or
1793 nothing otherwise; behave as 'P' in all other cases
1795 2 upper case letter macros:
1796 "XY" => print 'x' or 'y' if suffix_always is true or no register
1797 operands and no broadcast.
1798 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
1799 register operands and no broadcast.
1800 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
1801 "XD" => print 'd' if !EVEX or EVEX.W=1, EVEX.W=0 is not a valid encoding
1802 "XH" => print 'h' if EVEX.W=0, EVEX.W=1 is not a valid encoding (for FP16)
1803 "XS" => print 's' if !EVEX or EVEX.W=0, EVEX.W=1 is not a valid encoding
1804 "XV" => print "{vex} " pseudo prefix
1805 "XE" => print "{evex} " pseudo prefix if no EVEX-specific functionality is
1806 is used by an EVEX-encoded (AVX512VL) instruction.
1807 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond
1808 being false, or no operand at all in 64bit mode, or if suffix_always
1810 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
1811 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
1812 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
1813 "DQ" => print 'd' or 'q' depending on the VEX.W bit
1814 "BW" => print 'b' or 'w' depending on the VEX.W bit
1815 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
1816 an operand size prefix, or suffix_always is true. print
1817 'q' if rex prefix is present.
1819 Many of the above letters print nothing in Intel mode. See "putop"
1822 Braces '{' and '}', and vertical bars '|', indicate alternative
1823 mnemonic strings for AT&T and Intel. */
1825 static const struct dis386 dis386
[] = {
1827 { "addB", { Ebh1
, Gb
}, 0 },
1828 { "addS", { Evh1
, Gv
}, 0 },
1829 { "addB", { Gb
, EbS
}, 0 },
1830 { "addS", { Gv
, EvS
}, 0 },
1831 { "addB", { AL
, Ib
}, 0 },
1832 { "addS", { eAX
, Iv
}, 0 },
1833 { X86_64_TABLE (X86_64_06
) },
1834 { X86_64_TABLE (X86_64_07
) },
1836 { "orB", { Ebh1
, Gb
}, 0 },
1837 { "orS", { Evh1
, Gv
}, 0 },
1838 { "orB", { Gb
, EbS
}, 0 },
1839 { "orS", { Gv
, EvS
}, 0 },
1840 { "orB", { AL
, Ib
}, 0 },
1841 { "orS", { eAX
, Iv
}, 0 },
1842 { X86_64_TABLE (X86_64_0E
) },
1843 { Bad_Opcode
}, /* 0x0f extended opcode escape */
1845 { "adcB", { Ebh1
, Gb
}, 0 },
1846 { "adcS", { Evh1
, Gv
}, 0 },
1847 { "adcB", { Gb
, EbS
}, 0 },
1848 { "adcS", { Gv
, EvS
}, 0 },
1849 { "adcB", { AL
, Ib
}, 0 },
1850 { "adcS", { eAX
, Iv
}, 0 },
1851 { X86_64_TABLE (X86_64_16
) },
1852 { X86_64_TABLE (X86_64_17
) },
1854 { "sbbB", { Ebh1
, Gb
}, 0 },
1855 { "sbbS", { Evh1
, Gv
}, 0 },
1856 { "sbbB", { Gb
, EbS
}, 0 },
1857 { "sbbS", { Gv
, EvS
}, 0 },
1858 { "sbbB", { AL
, Ib
}, 0 },
1859 { "sbbS", { eAX
, Iv
}, 0 },
1860 { X86_64_TABLE (X86_64_1E
) },
1861 { X86_64_TABLE (X86_64_1F
) },
1863 { "andB", { Ebh1
, Gb
}, 0 },
1864 { "andS", { Evh1
, Gv
}, 0 },
1865 { "andB", { Gb
, EbS
}, 0 },
1866 { "andS", { Gv
, EvS
}, 0 },
1867 { "andB", { AL
, Ib
}, 0 },
1868 { "andS", { eAX
, Iv
}, 0 },
1869 { Bad_Opcode
}, /* SEG ES prefix */
1870 { X86_64_TABLE (X86_64_27
) },
1872 { "subB", { Ebh1
, Gb
}, 0 },
1873 { "subS", { Evh1
, Gv
}, 0 },
1874 { "subB", { Gb
, EbS
}, 0 },
1875 { "subS", { Gv
, EvS
}, 0 },
1876 { "subB", { AL
, Ib
}, 0 },
1877 { "subS", { eAX
, Iv
}, 0 },
1878 { Bad_Opcode
}, /* SEG CS prefix */
1879 { X86_64_TABLE (X86_64_2F
) },
1881 { "xorB", { Ebh1
, Gb
}, 0 },
1882 { "xorS", { Evh1
, Gv
}, 0 },
1883 { "xorB", { Gb
, EbS
}, 0 },
1884 { "xorS", { Gv
, EvS
}, 0 },
1885 { "xorB", { AL
, Ib
}, 0 },
1886 { "xorS", { eAX
, Iv
}, 0 },
1887 { Bad_Opcode
}, /* SEG SS prefix */
1888 { X86_64_TABLE (X86_64_37
) },
1890 { "cmpB", { Eb
, Gb
}, 0 },
1891 { "cmpS", { Ev
, Gv
}, 0 },
1892 { "cmpB", { Gb
, EbS
}, 0 },
1893 { "cmpS", { Gv
, EvS
}, 0 },
1894 { "cmpB", { AL
, Ib
}, 0 },
1895 { "cmpS", { eAX
, Iv
}, 0 },
1896 { Bad_Opcode
}, /* SEG DS prefix */
1897 { X86_64_TABLE (X86_64_3F
) },
1899 { "inc{S|}", { RMeAX
}, 0 },
1900 { "inc{S|}", { RMeCX
}, 0 },
1901 { "inc{S|}", { RMeDX
}, 0 },
1902 { "inc{S|}", { RMeBX
}, 0 },
1903 { "inc{S|}", { RMeSP
}, 0 },
1904 { "inc{S|}", { RMeBP
}, 0 },
1905 { "inc{S|}", { RMeSI
}, 0 },
1906 { "inc{S|}", { RMeDI
}, 0 },
1908 { "dec{S|}", { RMeAX
}, 0 },
1909 { "dec{S|}", { RMeCX
}, 0 },
1910 { "dec{S|}", { RMeDX
}, 0 },
1911 { "dec{S|}", { RMeBX
}, 0 },
1912 { "dec{S|}", { RMeSP
}, 0 },
1913 { "dec{S|}", { RMeBP
}, 0 },
1914 { "dec{S|}", { RMeSI
}, 0 },
1915 { "dec{S|}", { RMeDI
}, 0 },
1917 { "push{!P|}", { RMrAX
}, 0 },
1918 { "push{!P|}", { RMrCX
}, 0 },
1919 { "push{!P|}", { RMrDX
}, 0 },
1920 { "push{!P|}", { RMrBX
}, 0 },
1921 { "push{!P|}", { RMrSP
}, 0 },
1922 { "push{!P|}", { RMrBP
}, 0 },
1923 { "push{!P|}", { RMrSI
}, 0 },
1924 { "push{!P|}", { RMrDI
}, 0 },
1926 { "pop{!P|}", { RMrAX
}, 0 },
1927 { "pop{!P|}", { RMrCX
}, 0 },
1928 { "pop{!P|}", { RMrDX
}, 0 },
1929 { "pop{!P|}", { RMrBX
}, 0 },
1930 { "pop{!P|}", { RMrSP
}, 0 },
1931 { "pop{!P|}", { RMrBP
}, 0 },
1932 { "pop{!P|}", { RMrSI
}, 0 },
1933 { "pop{!P|}", { RMrDI
}, 0 },
1935 { X86_64_TABLE (X86_64_60
) },
1936 { X86_64_TABLE (X86_64_61
) },
1937 { X86_64_TABLE (X86_64_62
) },
1938 { X86_64_TABLE (X86_64_63
) },
1939 { Bad_Opcode
}, /* seg fs */
1940 { Bad_Opcode
}, /* seg gs */
1941 { Bad_Opcode
}, /* op size prefix */
1942 { Bad_Opcode
}, /* adr size prefix */
1944 { "pushP", { sIv
}, 0 },
1945 { "imulS", { Gv
, Ev
, Iv
}, 0 },
1946 { "pushP", { sIbT
}, 0 },
1947 { "imulS", { Gv
, Ev
, sIb
}, 0 },
1948 { "ins{b|}", { Ybr
, indirDX
}, 0 },
1949 { X86_64_TABLE (X86_64_6D
) },
1950 { "outs{b|}", { indirDXr
, Xb
}, 0 },
1951 { X86_64_TABLE (X86_64_6F
) },
1953 { "joH", { Jb
, BND
, cond_jump_flag
}, 0 },
1954 { "jnoH", { Jb
, BND
, cond_jump_flag
}, 0 },
1955 { "jbH", { Jb
, BND
, cond_jump_flag
}, 0 },
1956 { "jaeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1957 { "jeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1958 { "jneH", { Jb
, BND
, cond_jump_flag
}, 0 },
1959 { "jbeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1960 { "jaH", { Jb
, BND
, cond_jump_flag
}, 0 },
1962 { "jsH", { Jb
, BND
, cond_jump_flag
}, 0 },
1963 { "jnsH", { Jb
, BND
, cond_jump_flag
}, 0 },
1964 { "jpH", { Jb
, BND
, cond_jump_flag
}, 0 },
1965 { "jnpH", { Jb
, BND
, cond_jump_flag
}, 0 },
1966 { "jlH", { Jb
, BND
, cond_jump_flag
}, 0 },
1967 { "jgeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1968 { "jleH", { Jb
, BND
, cond_jump_flag
}, 0 },
1969 { "jgH", { Jb
, BND
, cond_jump_flag
}, 0 },
1971 { REG_TABLE (REG_80
) },
1972 { REG_TABLE (REG_81
) },
1973 { X86_64_TABLE (X86_64_82
) },
1974 { REG_TABLE (REG_83
) },
1975 { "testB", { Eb
, Gb
}, 0 },
1976 { "testS", { Ev
, Gv
}, 0 },
1977 { "xchgB", { Ebh2
, Gb
}, 0 },
1978 { "xchgS", { Evh2
, Gv
}, 0 },
1980 { "movB", { Ebh3
, Gb
}, 0 },
1981 { "movS", { Evh3
, Gv
}, 0 },
1982 { "movB", { Gb
, EbS
}, 0 },
1983 { "movS", { Gv
, EvS
}, 0 },
1984 { "movD", { Sv
, Sw
}, 0 },
1985 { MOD_TABLE (MOD_8D
) },
1986 { "movD", { Sw
, Sv
}, 0 },
1987 { REG_TABLE (REG_8F
) },
1989 { PREFIX_TABLE (PREFIX_90
) },
1990 { "xchgS", { RMeCX
, eAX
}, 0 },
1991 { "xchgS", { RMeDX
, eAX
}, 0 },
1992 { "xchgS", { RMeBX
, eAX
}, 0 },
1993 { "xchgS", { RMeSP
, eAX
}, 0 },
1994 { "xchgS", { RMeBP
, eAX
}, 0 },
1995 { "xchgS", { RMeSI
, eAX
}, 0 },
1996 { "xchgS", { RMeDI
, eAX
}, 0 },
1998 { "cW{t|}R", { XX
}, 0 },
1999 { "cR{t|}O", { XX
}, 0 },
2000 { X86_64_TABLE (X86_64_9A
) },
2001 { Bad_Opcode
}, /* fwait */
2002 { "pushfP", { XX
}, 0 },
2003 { "popfP", { XX
}, 0 },
2004 { "sahf", { XX
}, 0 },
2005 { "lahf", { XX
}, 0 },
2007 { "mov%LB", { AL
, Ob
}, 0 },
2008 { "mov%LS", { eAX
, Ov
}, 0 },
2009 { "mov%LB", { Ob
, AL
}, 0 },
2010 { "mov%LS", { Ov
, eAX
}, 0 },
2011 { "movs{b|}", { Ybr
, Xb
}, 0 },
2012 { "movs{R|}", { Yvr
, Xv
}, 0 },
2013 { "cmps{b|}", { Xb
, Yb
}, 0 },
2014 { "cmps{R|}", { Xv
, Yv
}, 0 },
2016 { "testB", { AL
, Ib
}, 0 },
2017 { "testS", { eAX
, Iv
}, 0 },
2018 { "stosB", { Ybr
, AL
}, 0 },
2019 { "stosS", { Yvr
, eAX
}, 0 },
2020 { "lodsB", { ALr
, Xb
}, 0 },
2021 { "lodsS", { eAXr
, Xv
}, 0 },
2022 { "scasB", { AL
, Yb
}, 0 },
2023 { "scasS", { eAX
, Yv
}, 0 },
2025 { "movB", { RMAL
, Ib
}, 0 },
2026 { "movB", { RMCL
, Ib
}, 0 },
2027 { "movB", { RMDL
, Ib
}, 0 },
2028 { "movB", { RMBL
, Ib
}, 0 },
2029 { "movB", { RMAH
, Ib
}, 0 },
2030 { "movB", { RMCH
, Ib
}, 0 },
2031 { "movB", { RMDH
, Ib
}, 0 },
2032 { "movB", { RMBH
, Ib
}, 0 },
2034 { "mov%LV", { RMeAX
, Iv64
}, 0 },
2035 { "mov%LV", { RMeCX
, Iv64
}, 0 },
2036 { "mov%LV", { RMeDX
, Iv64
}, 0 },
2037 { "mov%LV", { RMeBX
, Iv64
}, 0 },
2038 { "mov%LV", { RMeSP
, Iv64
}, 0 },
2039 { "mov%LV", { RMeBP
, Iv64
}, 0 },
2040 { "mov%LV", { RMeSI
, Iv64
}, 0 },
2041 { "mov%LV", { RMeDI
, Iv64
}, 0 },
2043 { REG_TABLE (REG_C0
) },
2044 { REG_TABLE (REG_C1
) },
2045 { X86_64_TABLE (X86_64_C2
) },
2046 { X86_64_TABLE (X86_64_C3
) },
2047 { X86_64_TABLE (X86_64_C4
) },
2048 { X86_64_TABLE (X86_64_C5
) },
2049 { REG_TABLE (REG_C6
) },
2050 { REG_TABLE (REG_C7
) },
2052 { "enterP", { Iw
, Ib
}, 0 },
2053 { "leaveP", { XX
}, 0 },
2054 { "{l|}ret{|f}%LP", { Iw
}, 0 },
2055 { "{l|}ret{|f}%LP", { XX
}, 0 },
2056 { "int3", { XX
}, 0 },
2057 { "int", { Ib
}, 0 },
2058 { X86_64_TABLE (X86_64_CE
) },
2059 { "iret%LP", { XX
}, 0 },
2061 { REG_TABLE (REG_D0
) },
2062 { REG_TABLE (REG_D1
) },
2063 { REG_TABLE (REG_D2
) },
2064 { REG_TABLE (REG_D3
) },
2065 { X86_64_TABLE (X86_64_D4
) },
2066 { X86_64_TABLE (X86_64_D5
) },
2068 { "xlat", { DSBX
}, 0 },
2079 { "loopneFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2080 { "loopeFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2081 { "loopFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2082 { "jEcxzH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2083 { "inB", { AL
, Ib
}, 0 },
2084 { "inG", { zAX
, Ib
}, 0 },
2085 { "outB", { Ib
, AL
}, 0 },
2086 { "outG", { Ib
, zAX
}, 0 },
2088 { X86_64_TABLE (X86_64_E8
) },
2089 { X86_64_TABLE (X86_64_E9
) },
2090 { X86_64_TABLE (X86_64_EA
) },
2091 { "jmp", { Jb
, BND
}, 0 },
2092 { "inB", { AL
, indirDX
}, 0 },
2093 { "inG", { zAX
, indirDX
}, 0 },
2094 { "outB", { indirDX
, AL
}, 0 },
2095 { "outG", { indirDX
, zAX
}, 0 },
2097 { Bad_Opcode
}, /* lock prefix */
2098 { "int1", { XX
}, 0 },
2099 { Bad_Opcode
}, /* repne */
2100 { Bad_Opcode
}, /* repz */
2101 { "hlt", { XX
}, 0 },
2102 { "cmc", { XX
}, 0 },
2103 { REG_TABLE (REG_F6
) },
2104 { REG_TABLE (REG_F7
) },
2106 { "clc", { XX
}, 0 },
2107 { "stc", { XX
}, 0 },
2108 { "cli", { XX
}, 0 },
2109 { "sti", { XX
}, 0 },
2110 { "cld", { XX
}, 0 },
2111 { "std", { XX
}, 0 },
2112 { REG_TABLE (REG_FE
) },
2113 { REG_TABLE (REG_FF
) },
2116 static const struct dis386 dis386_twobyte
[] = {
2118 { REG_TABLE (REG_0F00
) },
2119 { REG_TABLE (REG_0F01
) },
2120 { MOD_TABLE (MOD_0F02
) },
2121 { MOD_TABLE (MOD_0F03
) },
2123 { "syscall", { XX
}, 0 },
2124 { "clts", { XX
}, 0 },
2125 { "sysret%LQ", { XX
}, 0 },
2127 { "invd", { XX
}, 0 },
2128 { PREFIX_TABLE (PREFIX_0F09
) },
2130 { "ud2", { XX
}, 0 },
2132 { REG_TABLE (REG_0F0D
) },
2133 { "femms", { XX
}, 0 },
2134 { "", { MX
, EM
, OPSUF
}, 0 }, /* See OP_3DNowSuffix. */
2136 { PREFIX_TABLE (PREFIX_0F10
) },
2137 { PREFIX_TABLE (PREFIX_0F11
) },
2138 { PREFIX_TABLE (PREFIX_0F12
) },
2139 { MOD_TABLE (MOD_0F13
) },
2140 { "unpcklpX", { XM
, EXx
}, PREFIX_OPCODE
},
2141 { "unpckhpX", { XM
, EXx
}, PREFIX_OPCODE
},
2142 { PREFIX_TABLE (PREFIX_0F16
) },
2143 { MOD_TABLE (MOD_0F17
) },
2145 { REG_TABLE (REG_0F18
) },
2146 { "nopQ", { Ev
}, 0 },
2147 { PREFIX_TABLE (PREFIX_0F1A
) },
2148 { PREFIX_TABLE (PREFIX_0F1B
) },
2149 { PREFIX_TABLE (PREFIX_0F1C
) },
2150 { "nopQ", { Ev
}, 0 },
2151 { PREFIX_TABLE (PREFIX_0F1E
) },
2152 { "nopQ", { Ev
}, 0 },
2154 { "movZ", { Em
, Cm
}, 0 },
2155 { "movZ", { Em
, Dm
}, 0 },
2156 { "movZ", { Cm
, Em
}, 0 },
2157 { "movZ", { Dm
, Em
}, 0 },
2158 { X86_64_TABLE (X86_64_0F24
) },
2160 { X86_64_TABLE (X86_64_0F26
) },
2163 { "movapX", { XM
, EXx
}, PREFIX_OPCODE
},
2164 { "movapX", { EXxS
, XM
}, PREFIX_OPCODE
},
2165 { PREFIX_TABLE (PREFIX_0F2A
) },
2166 { PREFIX_TABLE (PREFIX_0F2B
) },
2167 { PREFIX_TABLE (PREFIX_0F2C
) },
2168 { PREFIX_TABLE (PREFIX_0F2D
) },
2169 { PREFIX_TABLE (PREFIX_0F2E
) },
2170 { PREFIX_TABLE (PREFIX_0F2F
) },
2172 { "wrmsr", { XX
}, 0 },
2173 { "rdtsc", { XX
}, 0 },
2174 { "rdmsr", { XX
}, 0 },
2175 { "rdpmc", { XX
}, 0 },
2176 { "sysenter", { SEP
}, 0 },
2177 { "sysexit%LQ", { SEP
}, 0 },
2179 { "getsec", { XX
}, 0 },
2181 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38
, PREFIX_OPCODE
) },
2183 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A
, PREFIX_OPCODE
) },
2190 { "cmovoS", { Gv
, Ev
}, 0 },
2191 { "cmovnoS", { Gv
, Ev
}, 0 },
2192 { "cmovbS", { Gv
, Ev
}, 0 },
2193 { "cmovaeS", { Gv
, Ev
}, 0 },
2194 { "cmoveS", { Gv
, Ev
}, 0 },
2195 { "cmovneS", { Gv
, Ev
}, 0 },
2196 { "cmovbeS", { Gv
, Ev
}, 0 },
2197 { "cmovaS", { Gv
, Ev
}, 0 },
2199 { "cmovsS", { Gv
, Ev
}, 0 },
2200 { "cmovnsS", { Gv
, Ev
}, 0 },
2201 { "cmovpS", { Gv
, Ev
}, 0 },
2202 { "cmovnpS", { Gv
, Ev
}, 0 },
2203 { "cmovlS", { Gv
, Ev
}, 0 },
2204 { "cmovgeS", { Gv
, Ev
}, 0 },
2205 { "cmovleS", { Gv
, Ev
}, 0 },
2206 { "cmovgS", { Gv
, Ev
}, 0 },
2208 { MOD_TABLE (MOD_0F50
) },
2209 { PREFIX_TABLE (PREFIX_0F51
) },
2210 { PREFIX_TABLE (PREFIX_0F52
) },
2211 { PREFIX_TABLE (PREFIX_0F53
) },
2212 { "andpX", { XM
, EXx
}, PREFIX_OPCODE
},
2213 { "andnpX", { XM
, EXx
}, PREFIX_OPCODE
},
2214 { "orpX", { XM
, EXx
}, PREFIX_OPCODE
},
2215 { "xorpX", { XM
, EXx
}, PREFIX_OPCODE
},
2217 { PREFIX_TABLE (PREFIX_0F58
) },
2218 { PREFIX_TABLE (PREFIX_0F59
) },
2219 { PREFIX_TABLE (PREFIX_0F5A
) },
2220 { PREFIX_TABLE (PREFIX_0F5B
) },
2221 { PREFIX_TABLE (PREFIX_0F5C
) },
2222 { PREFIX_TABLE (PREFIX_0F5D
) },
2223 { PREFIX_TABLE (PREFIX_0F5E
) },
2224 { PREFIX_TABLE (PREFIX_0F5F
) },
2226 { PREFIX_TABLE (PREFIX_0F60
) },
2227 { PREFIX_TABLE (PREFIX_0F61
) },
2228 { PREFIX_TABLE (PREFIX_0F62
) },
2229 { "packsswb", { MX
, EM
}, PREFIX_OPCODE
},
2230 { "pcmpgtb", { MX
, EM
}, PREFIX_OPCODE
},
2231 { "pcmpgtw", { MX
, EM
}, PREFIX_OPCODE
},
2232 { "pcmpgtd", { MX
, EM
}, PREFIX_OPCODE
},
2233 { "packuswb", { MX
, EM
}, PREFIX_OPCODE
},
2235 { "punpckhbw", { MX
, EM
}, PREFIX_OPCODE
},
2236 { "punpckhwd", { MX
, EM
}, PREFIX_OPCODE
},
2237 { "punpckhdq", { MX
, EM
}, PREFIX_OPCODE
},
2238 { "packssdw", { MX
, EM
}, PREFIX_OPCODE
},
2239 { "punpcklqdq", { XM
, EXx
}, PREFIX_DATA
},
2240 { "punpckhqdq", { XM
, EXx
}, PREFIX_DATA
},
2241 { "movK", { MX
, Edq
}, PREFIX_OPCODE
},
2242 { PREFIX_TABLE (PREFIX_0F6F
) },
2244 { PREFIX_TABLE (PREFIX_0F70
) },
2245 { MOD_TABLE (MOD_0F71
) },
2246 { MOD_TABLE (MOD_0F72
) },
2247 { MOD_TABLE (MOD_0F73
) },
2248 { "pcmpeqb", { MX
, EM
}, PREFIX_OPCODE
},
2249 { "pcmpeqw", { MX
, EM
}, PREFIX_OPCODE
},
2250 { "pcmpeqd", { MX
, EM
}, PREFIX_OPCODE
},
2251 { "emms", { XX
}, PREFIX_OPCODE
},
2253 { PREFIX_TABLE (PREFIX_0F78
) },
2254 { PREFIX_TABLE (PREFIX_0F79
) },
2257 { PREFIX_TABLE (PREFIX_0F7C
) },
2258 { PREFIX_TABLE (PREFIX_0F7D
) },
2259 { PREFIX_TABLE (PREFIX_0F7E
) },
2260 { PREFIX_TABLE (PREFIX_0F7F
) },
2262 { "joH", { Jv
, BND
, cond_jump_flag
}, 0 },
2263 { "jnoH", { Jv
, BND
, cond_jump_flag
}, 0 },
2264 { "jbH", { Jv
, BND
, cond_jump_flag
}, 0 },
2265 { "jaeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2266 { "jeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2267 { "jneH", { Jv
, BND
, cond_jump_flag
}, 0 },
2268 { "jbeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2269 { "jaH", { Jv
, BND
, cond_jump_flag
}, 0 },
2271 { "jsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2272 { "jnsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2273 { "jpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2274 { "jnpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2275 { "jlH", { Jv
, BND
, cond_jump_flag
}, 0 },
2276 { "jgeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2277 { "jleH", { Jv
, BND
, cond_jump_flag
}, 0 },
2278 { "jgH", { Jv
, BND
, cond_jump_flag
}, 0 },
2280 { "seto", { Eb
}, 0 },
2281 { "setno", { Eb
}, 0 },
2282 { "setb", { Eb
}, 0 },
2283 { "setae", { Eb
}, 0 },
2284 { "sete", { Eb
}, 0 },
2285 { "setne", { Eb
}, 0 },
2286 { "setbe", { Eb
}, 0 },
2287 { "seta", { Eb
}, 0 },
2289 { "sets", { Eb
}, 0 },
2290 { "setns", { Eb
}, 0 },
2291 { "setp", { Eb
}, 0 },
2292 { "setnp", { Eb
}, 0 },
2293 { "setl", { Eb
}, 0 },
2294 { "setge", { Eb
}, 0 },
2295 { "setle", { Eb
}, 0 },
2296 { "setg", { Eb
}, 0 },
2298 { "pushP", { fs
}, 0 },
2299 { "popP", { fs
}, 0 },
2300 { "cpuid", { XX
}, 0 },
2301 { "btS", { Ev
, Gv
}, 0 },
2302 { "shldS", { Ev
, Gv
, Ib
}, 0 },
2303 { "shldS", { Ev
, Gv
, CL
}, 0 },
2304 { REG_TABLE (REG_0FA6
) },
2305 { REG_TABLE (REG_0FA7
) },
2307 { "pushP", { gs
}, 0 },
2308 { "popP", { gs
}, 0 },
2309 { "rsm", { XX
}, 0 },
2310 { "btsS", { Evh1
, Gv
}, 0 },
2311 { "shrdS", { Ev
, Gv
, Ib
}, 0 },
2312 { "shrdS", { Ev
, Gv
, CL
}, 0 },
2313 { REG_TABLE (REG_0FAE
) },
2314 { "imulS", { Gv
, Ev
}, 0 },
2316 { "cmpxchgB", { Ebh1
, Gb
}, 0 },
2317 { "cmpxchgS", { Evh1
, Gv
}, 0 },
2318 { MOD_TABLE (MOD_0FB2
) },
2319 { "btrS", { Evh1
, Gv
}, 0 },
2320 { MOD_TABLE (MOD_0FB4
) },
2321 { MOD_TABLE (MOD_0FB5
) },
2322 { "movz{bR|x}", { Gv
, Eb
}, 0 },
2323 { "movz{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movzww ! */
2325 { PREFIX_TABLE (PREFIX_0FB8
) },
2326 { "ud1S", { Gv
, Ev
}, 0 },
2327 { REG_TABLE (REG_0FBA
) },
2328 { "btcS", { Evh1
, Gv
}, 0 },
2329 { PREFIX_TABLE (PREFIX_0FBC
) },
2330 { PREFIX_TABLE (PREFIX_0FBD
) },
2331 { "movs{bR|x}", { Gv
, Eb
}, 0 },
2332 { "movs{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movsww ! */
2334 { "xaddB", { Ebh1
, Gb
}, 0 },
2335 { "xaddS", { Evh1
, Gv
}, 0 },
2336 { PREFIX_TABLE (PREFIX_0FC2
) },
2337 { MOD_TABLE (MOD_0FC3
) },
2338 { "pinsrw", { MX
, Edw
, Ib
}, PREFIX_OPCODE
},
2339 { "pextrw", { Gd
, MS
, Ib
}, PREFIX_OPCODE
},
2340 { "shufpX", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
2341 { REG_TABLE (REG_0FC7
) },
2343 { "bswap", { RMeAX
}, 0 },
2344 { "bswap", { RMeCX
}, 0 },
2345 { "bswap", { RMeDX
}, 0 },
2346 { "bswap", { RMeBX
}, 0 },
2347 { "bswap", { RMeSP
}, 0 },
2348 { "bswap", { RMeBP
}, 0 },
2349 { "bswap", { RMeSI
}, 0 },
2350 { "bswap", { RMeDI
}, 0 },
2352 { PREFIX_TABLE (PREFIX_0FD0
) },
2353 { "psrlw", { MX
, EM
}, PREFIX_OPCODE
},
2354 { "psrld", { MX
, EM
}, PREFIX_OPCODE
},
2355 { "psrlq", { MX
, EM
}, PREFIX_OPCODE
},
2356 { "paddq", { MX
, EM
}, PREFIX_OPCODE
},
2357 { "pmullw", { MX
, EM
}, PREFIX_OPCODE
},
2358 { PREFIX_TABLE (PREFIX_0FD6
) },
2359 { MOD_TABLE (MOD_0FD7
) },
2361 { "psubusb", { MX
, EM
}, PREFIX_OPCODE
},
2362 { "psubusw", { MX
, EM
}, PREFIX_OPCODE
},
2363 { "pminub", { MX
, EM
}, PREFIX_OPCODE
},
2364 { "pand", { MX
, EM
}, PREFIX_OPCODE
},
2365 { "paddusb", { MX
, EM
}, PREFIX_OPCODE
},
2366 { "paddusw", { MX
, EM
}, PREFIX_OPCODE
},
2367 { "pmaxub", { MX
, EM
}, PREFIX_OPCODE
},
2368 { "pandn", { MX
, EM
}, PREFIX_OPCODE
},
2370 { "pavgb", { MX
, EM
}, PREFIX_OPCODE
},
2371 { "psraw", { MX
, EM
}, PREFIX_OPCODE
},
2372 { "psrad", { MX
, EM
}, PREFIX_OPCODE
},
2373 { "pavgw", { MX
, EM
}, PREFIX_OPCODE
},
2374 { "pmulhuw", { MX
, EM
}, PREFIX_OPCODE
},
2375 { "pmulhw", { MX
, EM
}, PREFIX_OPCODE
},
2376 { PREFIX_TABLE (PREFIX_0FE6
) },
2377 { PREFIX_TABLE (PREFIX_0FE7
) },
2379 { "psubsb", { MX
, EM
}, PREFIX_OPCODE
},
2380 { "psubsw", { MX
, EM
}, PREFIX_OPCODE
},
2381 { "pminsw", { MX
, EM
}, PREFIX_OPCODE
},
2382 { "por", { MX
, EM
}, PREFIX_OPCODE
},
2383 { "paddsb", { MX
, EM
}, PREFIX_OPCODE
},
2384 { "paddsw", { MX
, EM
}, PREFIX_OPCODE
},
2385 { "pmaxsw", { MX
, EM
}, PREFIX_OPCODE
},
2386 { "pxor", { MX
, EM
}, PREFIX_OPCODE
},
2388 { PREFIX_TABLE (PREFIX_0FF0
) },
2389 { "psllw", { MX
, EM
}, PREFIX_OPCODE
},
2390 { "pslld", { MX
, EM
}, PREFIX_OPCODE
},
2391 { "psllq", { MX
, EM
}, PREFIX_OPCODE
},
2392 { "pmuludq", { MX
, EM
}, PREFIX_OPCODE
},
2393 { "pmaddwd", { MX
, EM
}, PREFIX_OPCODE
},
2394 { "psadbw", { MX
, EM
}, PREFIX_OPCODE
},
2395 { PREFIX_TABLE (PREFIX_0FF7
) },
2397 { "psubb", { MX
, EM
}, PREFIX_OPCODE
},
2398 { "psubw", { MX
, EM
}, PREFIX_OPCODE
},
2399 { "psubd", { MX
, EM
}, PREFIX_OPCODE
},
2400 { "psubq", { MX
, EM
}, PREFIX_OPCODE
},
2401 { "paddb", { MX
, EM
}, PREFIX_OPCODE
},
2402 { "paddw", { MX
, EM
}, PREFIX_OPCODE
},
2403 { "paddd", { MX
, EM
}, PREFIX_OPCODE
},
2404 { "ud0S", { Gv
, Ev
}, 0 },
2407 static const bool onebyte_has_modrm
[256] = {
2408 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2409 /* ------------------------------- */
2410 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2411 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2412 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2413 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2414 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2415 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2416 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2417 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2418 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2419 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2420 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2421 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2422 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2423 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2424 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2425 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2426 /* ------------------------------- */
2427 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2430 static const bool twobyte_has_modrm
[256] = {
2431 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2432 /* ------------------------------- */
2433 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2434 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2435 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2436 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2437 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2438 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2439 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2440 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2441 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2442 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2443 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2444 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
2445 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2446 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2447 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2448 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
2449 /* ------------------------------- */
2450 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2460 /* If we are accessing mod/rm/reg without need_modrm set, then the
2461 values are stale. Hitting this abort likely indicates that you
2462 need to update onebyte_has_modrm or twobyte_has_modrm. */
2463 #define MODRM_CHECK if (!ins->need_modrm) abort ()
2465 static const char *const intel_index16
[] = {
2466 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
2469 static const char *const att_names64
[] = {
2470 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
2471 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
2473 static const char *const att_names32
[] = {
2474 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
2475 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
2477 static const char *const att_names16
[] = {
2478 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
2479 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
2481 static const char *const att_names8
[] = {
2482 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
2484 static const char *const att_names8rex
[] = {
2485 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
2486 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
2488 static const char *const att_names_seg
[] = {
2489 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
2491 static const char att_index64
[] = "%riz";
2492 static const char att_index32
[] = "%eiz";
2493 static const char *const att_index16
[] = {
2494 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
2497 static const char *const att_names_mm
[] = {
2498 "%mm0", "%mm1", "%mm2", "%mm3",
2499 "%mm4", "%mm5", "%mm6", "%mm7"
2502 static const char *const att_names_bnd
[] = {
2503 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
2506 static const char *const att_names_xmm
[] = {
2507 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
2508 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
2509 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
2510 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
2511 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
2512 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
2513 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
2514 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
2517 static const char *const att_names_ymm
[] = {
2518 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
2519 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
2520 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
2521 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
2522 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
2523 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
2524 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
2525 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
2528 static const char *const att_names_zmm
[] = {
2529 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
2530 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
2531 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
2532 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
2533 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
2534 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
2535 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
2536 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
2539 static const char *const att_names_tmm
[] = {
2540 "%tmm0", "%tmm1", "%tmm2", "%tmm3",
2541 "%tmm4", "%tmm5", "%tmm6", "%tmm7"
2544 static const char *const att_names_mask
[] = {
2545 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
2548 static const char *const names_rounding
[] =
2556 static const struct dis386 reg_table
[][8] = {
2559 { "addA", { Ebh1
, Ib
}, 0 },
2560 { "orA", { Ebh1
, Ib
}, 0 },
2561 { "adcA", { Ebh1
, Ib
}, 0 },
2562 { "sbbA", { Ebh1
, Ib
}, 0 },
2563 { "andA", { Ebh1
, Ib
}, 0 },
2564 { "subA", { Ebh1
, Ib
}, 0 },
2565 { "xorA", { Ebh1
, Ib
}, 0 },
2566 { "cmpA", { Eb
, Ib
}, 0 },
2570 { "addQ", { Evh1
, Iv
}, 0 },
2571 { "orQ", { Evh1
, Iv
}, 0 },
2572 { "adcQ", { Evh1
, Iv
}, 0 },
2573 { "sbbQ", { Evh1
, Iv
}, 0 },
2574 { "andQ", { Evh1
, Iv
}, 0 },
2575 { "subQ", { Evh1
, Iv
}, 0 },
2576 { "xorQ", { Evh1
, Iv
}, 0 },
2577 { "cmpQ", { Ev
, Iv
}, 0 },
2581 { "addQ", { Evh1
, sIb
}, 0 },
2582 { "orQ", { Evh1
, sIb
}, 0 },
2583 { "adcQ", { Evh1
, sIb
}, 0 },
2584 { "sbbQ", { Evh1
, sIb
}, 0 },
2585 { "andQ", { Evh1
, sIb
}, 0 },
2586 { "subQ", { Evh1
, sIb
}, 0 },
2587 { "xorQ", { Evh1
, sIb
}, 0 },
2588 { "cmpQ", { Ev
, sIb
}, 0 },
2592 { "pop{P|}", { stackEv
}, 0 },
2593 { XOP_8F_TABLE (XOP_09
) },
2597 { XOP_8F_TABLE (XOP_09
) },
2601 { "rolA", { Eb
, Ib
}, 0 },
2602 { "rorA", { Eb
, Ib
}, 0 },
2603 { "rclA", { Eb
, Ib
}, 0 },
2604 { "rcrA", { Eb
, Ib
}, 0 },
2605 { "shlA", { Eb
, Ib
}, 0 },
2606 { "shrA", { Eb
, Ib
}, 0 },
2607 { "shlA", { Eb
, Ib
}, 0 },
2608 { "sarA", { Eb
, Ib
}, 0 },
2612 { "rolQ", { Ev
, Ib
}, 0 },
2613 { "rorQ", { Ev
, Ib
}, 0 },
2614 { "rclQ", { Ev
, Ib
}, 0 },
2615 { "rcrQ", { Ev
, Ib
}, 0 },
2616 { "shlQ", { Ev
, Ib
}, 0 },
2617 { "shrQ", { Ev
, Ib
}, 0 },
2618 { "shlQ", { Ev
, Ib
}, 0 },
2619 { "sarQ", { Ev
, Ib
}, 0 },
2623 { "movA", { Ebh3
, Ib
}, 0 },
2630 { MOD_TABLE (MOD_C6_REG_7
) },
2634 { "movQ", { Evh3
, Iv
}, 0 },
2641 { MOD_TABLE (MOD_C7_REG_7
) },
2645 { "rolA", { Eb
, I1
}, 0 },
2646 { "rorA", { Eb
, I1
}, 0 },
2647 { "rclA", { Eb
, I1
}, 0 },
2648 { "rcrA", { Eb
, I1
}, 0 },
2649 { "shlA", { Eb
, I1
}, 0 },
2650 { "shrA", { Eb
, I1
}, 0 },
2651 { "shlA", { Eb
, I1
}, 0 },
2652 { "sarA", { Eb
, I1
}, 0 },
2656 { "rolQ", { Ev
, I1
}, 0 },
2657 { "rorQ", { Ev
, I1
}, 0 },
2658 { "rclQ", { Ev
, I1
}, 0 },
2659 { "rcrQ", { Ev
, I1
}, 0 },
2660 { "shlQ", { Ev
, I1
}, 0 },
2661 { "shrQ", { Ev
, I1
}, 0 },
2662 { "shlQ", { Ev
, I1
}, 0 },
2663 { "sarQ", { Ev
, I1
}, 0 },
2667 { "rolA", { Eb
, CL
}, 0 },
2668 { "rorA", { Eb
, CL
}, 0 },
2669 { "rclA", { Eb
, CL
}, 0 },
2670 { "rcrA", { Eb
, CL
}, 0 },
2671 { "shlA", { Eb
, CL
}, 0 },
2672 { "shrA", { Eb
, CL
}, 0 },
2673 { "shlA", { Eb
, CL
}, 0 },
2674 { "sarA", { Eb
, CL
}, 0 },
2678 { "rolQ", { Ev
, CL
}, 0 },
2679 { "rorQ", { Ev
, CL
}, 0 },
2680 { "rclQ", { Ev
, CL
}, 0 },
2681 { "rcrQ", { Ev
, CL
}, 0 },
2682 { "shlQ", { Ev
, CL
}, 0 },
2683 { "shrQ", { Ev
, CL
}, 0 },
2684 { "shlQ", { Ev
, CL
}, 0 },
2685 { "sarQ", { Ev
, CL
}, 0 },
2689 { "testA", { Eb
, Ib
}, 0 },
2690 { "testA", { Eb
, Ib
}, 0 },
2691 { "notA", { Ebh1
}, 0 },
2692 { "negA", { Ebh1
}, 0 },
2693 { "mulA", { Eb
}, 0 }, /* Don't print the implicit %al register, */
2694 { "imulA", { Eb
}, 0 }, /* to distinguish these opcodes from other */
2695 { "divA", { Eb
}, 0 }, /* mul/imul opcodes. Do the same for div */
2696 { "idivA", { Eb
}, 0 }, /* and idiv for consistency. */
2700 { "testQ", { Ev
, Iv
}, 0 },
2701 { "testQ", { Ev
, Iv
}, 0 },
2702 { "notQ", { Evh1
}, 0 },
2703 { "negQ", { Evh1
}, 0 },
2704 { "mulQ", { Ev
}, 0 }, /* Don't print the implicit register. */
2705 { "imulQ", { Ev
}, 0 },
2706 { "divQ", { Ev
}, 0 },
2707 { "idivQ", { Ev
}, 0 },
2711 { "incA", { Ebh1
}, 0 },
2712 { "decA", { Ebh1
}, 0 },
2716 { "incQ", { Evh1
}, 0 },
2717 { "decQ", { Evh1
}, 0 },
2718 { "call{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2719 { MOD_TABLE (MOD_FF_REG_3
) },
2720 { "jmp{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2721 { MOD_TABLE (MOD_FF_REG_5
) },
2722 { "push{P|}", { stackEv
}, 0 },
2727 { "sldtD", { Sv
}, 0 },
2728 { "strD", { Sv
}, 0 },
2729 { "lldt", { Ew
}, 0 },
2730 { "ltr", { Ew
}, 0 },
2731 { "verr", { Ew
}, 0 },
2732 { "verw", { Ew
}, 0 },
2738 { MOD_TABLE (MOD_0F01_REG_0
) },
2739 { MOD_TABLE (MOD_0F01_REG_1
) },
2740 { MOD_TABLE (MOD_0F01_REG_2
) },
2741 { MOD_TABLE (MOD_0F01_REG_3
) },
2742 { "smswD", { Sv
}, 0 },
2743 { MOD_TABLE (MOD_0F01_REG_5
) },
2744 { "lmsw", { Ew
}, 0 },
2745 { MOD_TABLE (MOD_0F01_REG_7
) },
2749 { "prefetch", { Mb
}, 0 },
2750 { "prefetchw", { Mb
}, 0 },
2751 { "prefetchwt1", { Mb
}, 0 },
2752 { "prefetch", { Mb
}, 0 },
2753 { "prefetch", { Mb
}, 0 },
2754 { "prefetch", { Mb
}, 0 },
2755 { "prefetch", { Mb
}, 0 },
2756 { "prefetch", { Mb
}, 0 },
2760 { MOD_TABLE (MOD_0F18_REG_0
) },
2761 { MOD_TABLE (MOD_0F18_REG_1
) },
2762 { MOD_TABLE (MOD_0F18_REG_2
) },
2763 { MOD_TABLE (MOD_0F18_REG_3
) },
2764 { "nopQ", { Ev
}, 0 },
2765 { "nopQ", { Ev
}, 0 },
2766 { MOD_TABLE (MOD_0F18_REG_6
) },
2767 { MOD_TABLE (MOD_0F18_REG_7
) },
2769 /* REG_0F1C_P_0_MOD_0 */
2771 { "cldemote", { Mb
}, 0 },
2772 { "nopQ", { Ev
}, 0 },
2773 { "nopQ", { Ev
}, 0 },
2774 { "nopQ", { Ev
}, 0 },
2775 { "nopQ", { Ev
}, 0 },
2776 { "nopQ", { Ev
}, 0 },
2777 { "nopQ", { Ev
}, 0 },
2778 { "nopQ", { Ev
}, 0 },
2780 /* REG_0F1E_P_1_MOD_3 */
2782 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2783 { "rdsspK", { Edq
}, 0 },
2784 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2785 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2786 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2787 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2788 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2789 { RM_TABLE (RM_0F1E_P_1_MOD_3_REG_7
) },
2791 /* REG_0F38D8_PREFIX_1 */
2793 { "aesencwide128kl", { M
}, 0 },
2794 { "aesdecwide128kl", { M
}, 0 },
2795 { "aesencwide256kl", { M
}, 0 },
2796 { "aesdecwide256kl", { M
}, 0 },
2798 /* REG_0F3A0F_PREFIX_1_MOD_3 */
2800 { RM_TABLE (RM_0F3A0F_P_1_MOD_3_REG_0
) },
2802 /* REG_0F71_MOD_0 */
2806 { "psrlw", { MS
, Ib
}, PREFIX_OPCODE
},
2808 { "psraw", { MS
, Ib
}, PREFIX_OPCODE
},
2810 { "psllw", { MS
, Ib
}, PREFIX_OPCODE
},
2812 /* REG_0F72_MOD_0 */
2816 { "psrld", { MS
, Ib
}, PREFIX_OPCODE
},
2818 { "psrad", { MS
, Ib
}, PREFIX_OPCODE
},
2820 { "pslld", { MS
, Ib
}, PREFIX_OPCODE
},
2822 /* REG_0F73_MOD_0 */
2826 { "psrlq", { MS
, Ib
}, PREFIX_OPCODE
},
2827 { "psrldq", { XS
, Ib
}, PREFIX_DATA
},
2830 { "psllq", { MS
, Ib
}, PREFIX_OPCODE
},
2831 { "pslldq", { XS
, Ib
}, PREFIX_DATA
},
2835 { "montmul", { { OP_0f07
, 0 } }, 0 },
2836 { "xsha1", { { OP_0f07
, 0 } }, 0 },
2837 { "xsha256", { { OP_0f07
, 0 } }, 0 },
2841 { "xstore-rng", { { OP_0f07
, 0 } }, 0 },
2842 { "xcrypt-ecb", { { OP_0f07
, 0 } }, 0 },
2843 { "xcrypt-cbc", { { OP_0f07
, 0 } }, 0 },
2844 { "xcrypt-ctr", { { OP_0f07
, 0 } }, 0 },
2845 { "xcrypt-cfb", { { OP_0f07
, 0 } }, 0 },
2846 { "xcrypt-ofb", { { OP_0f07
, 0 } }, 0 },
2850 { MOD_TABLE (MOD_0FAE_REG_0
) },
2851 { MOD_TABLE (MOD_0FAE_REG_1
) },
2852 { MOD_TABLE (MOD_0FAE_REG_2
) },
2853 { MOD_TABLE (MOD_0FAE_REG_3
) },
2854 { MOD_TABLE (MOD_0FAE_REG_4
) },
2855 { MOD_TABLE (MOD_0FAE_REG_5
) },
2856 { MOD_TABLE (MOD_0FAE_REG_6
) },
2857 { MOD_TABLE (MOD_0FAE_REG_7
) },
2865 { "btQ", { Ev
, Ib
}, 0 },
2866 { "btsQ", { Evh1
, Ib
}, 0 },
2867 { "btrQ", { Evh1
, Ib
}, 0 },
2868 { "btcQ", { Evh1
, Ib
}, 0 },
2873 { "cmpxchg8b", { { CMPXCHG8B_Fixup
, q_mode
} }, 0 },
2875 { MOD_TABLE (MOD_0FC7_REG_3
) },
2876 { MOD_TABLE (MOD_0FC7_REG_4
) },
2877 { MOD_TABLE (MOD_0FC7_REG_5
) },
2878 { MOD_TABLE (MOD_0FC7_REG_6
) },
2879 { MOD_TABLE (MOD_0FC7_REG_7
) },
2881 /* REG_VEX_0F71_M_0 */
2885 { "vpsrlw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2887 { "vpsraw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2889 { "vpsllw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2891 /* REG_VEX_0F72_M_0 */
2895 { "vpsrld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2897 { "vpsrad", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2899 { "vpslld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2901 /* REG_VEX_0F73_M_0 */
2905 { "vpsrlq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2906 { "vpsrldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2909 { "vpsllq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2910 { "vpslldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2916 { MOD_TABLE (MOD_VEX_0FAE_REG_2
) },
2917 { MOD_TABLE (MOD_VEX_0FAE_REG_3
) },
2919 /* REG_VEX_0F3849_X86_64_P_0_W_0_M_1 */
2921 { RM_TABLE (RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0
) },
2923 /* REG_VEX_0F38F3_L_0 */
2926 { "blsrS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2927 { "blsmskS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2928 { "blsiS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2930 /* REG_XOP_09_01_L_0 */
2933 { "blcfill", { VexGdq
, Edq
}, 0 },
2934 { "blsfill", { VexGdq
, Edq
}, 0 },
2935 { "blcs", { VexGdq
, Edq
}, 0 },
2936 { "tzmsk", { VexGdq
, Edq
}, 0 },
2937 { "blcic", { VexGdq
, Edq
}, 0 },
2938 { "blsic", { VexGdq
, Edq
}, 0 },
2939 { "t1mskc", { VexGdq
, Edq
}, 0 },
2941 /* REG_XOP_09_02_L_0 */
2944 { "blcmsk", { VexGdq
, Edq
}, 0 },
2949 { "blci", { VexGdq
, Edq
}, 0 },
2951 /* REG_XOP_09_12_M_1_L_0 */
2953 { "llwpcb", { Edq
}, 0 },
2954 { "slwpcb", { Edq
}, 0 },
2956 /* REG_XOP_0A_12_L_0 */
2958 { "lwpins", { VexGdq
, Ed
, Id
}, 0 },
2959 { "lwpval", { VexGdq
, Ed
, Id
}, 0 },
2962 #include "i386-dis-evex-reg.h"
2965 static const struct dis386 prefix_table
[][4] = {
2968 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2969 { "pause", { XX
}, 0 },
2970 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2971 { NULL
, { { NULL
, 0 } }, PREFIX_IGNORED
}
2974 /* PREFIX_0F01_REG_0_MOD_3_RM_6 */
2976 { "wrmsrns", { Skip_MODRM
}, 0 },
2977 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_1
) },
2979 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_3
) },
2982 /* PREFIX_0F01_REG_1_RM_4 */
2986 { "tdcall", { Skip_MODRM
}, 0 },
2990 /* PREFIX_0F01_REG_1_RM_5 */
2994 { X86_64_TABLE (X86_64_0F01_REG_1_RM_5_PREFIX_2
) },
2998 /* PREFIX_0F01_REG_1_RM_6 */
3002 { X86_64_TABLE (X86_64_0F01_REG_1_RM_6_PREFIX_2
) },
3006 /* PREFIX_0F01_REG_1_RM_7 */
3008 { "encls", { Skip_MODRM
}, 0 },
3010 { X86_64_TABLE (X86_64_0F01_REG_1_RM_7_PREFIX_2
) },
3014 /* PREFIX_0F01_REG_3_RM_1 */
3016 { "vmmcall", { Skip_MODRM
}, 0 },
3017 { "vmgexit", { Skip_MODRM
}, 0 },
3019 { "vmgexit", { Skip_MODRM
}, 0 },
3022 /* PREFIX_0F01_REG_5_MOD_0 */
3025 { "rstorssp", { Mq
}, PREFIX_OPCODE
},
3028 /* PREFIX_0F01_REG_5_MOD_3_RM_0 */
3030 { "serialize", { Skip_MODRM
}, PREFIX_OPCODE
},
3031 { "setssbsy", { Skip_MODRM
}, PREFIX_OPCODE
},
3033 { "xsusldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3036 /* PREFIX_0F01_REG_5_MOD_3_RM_1 */
3041 { "xresldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3044 /* PREFIX_0F01_REG_5_MOD_3_RM_2 */
3047 { "saveprevssp", { Skip_MODRM
}, PREFIX_OPCODE
},
3050 /* PREFIX_0F01_REG_5_MOD_3_RM_4 */
3053 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
) },
3056 /* PREFIX_0F01_REG_5_MOD_3_RM_5 */
3059 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
) },
3062 /* PREFIX_0F01_REG_5_MOD_3_RM_6 */
3064 { "rdpkru", { Skip_MODRM
}, 0 },
3065 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
) },
3068 /* PREFIX_0F01_REG_5_MOD_3_RM_7 */
3070 { "wrpkru", { Skip_MODRM
}, 0 },
3071 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
) },
3074 /* PREFIX_0F01_REG_7_MOD_3_RM_2 */
3076 { "monitorx", { { OP_Monitor
, 0 } }, 0 },
3077 { "mcommit", { Skip_MODRM
}, 0 },
3080 /* PREFIX_0F01_REG_7_MOD_3_RM_5 */
3082 { "rdpru", { Skip_MODRM
}, 0 },
3083 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1
) },
3086 /* PREFIX_0F01_REG_7_MOD_3_RM_6 */
3088 { "invlpgb", { Skip_MODRM
}, 0 },
3089 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
) },
3091 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
) },
3094 /* PREFIX_0F01_REG_7_MOD_3_RM_7 */
3096 { "tlbsync", { Skip_MODRM
}, 0 },
3097 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
) },
3099 { "pvalidate", { Skip_MODRM
}, 0 },
3104 { "wbinvd", { XX
}, 0 },
3105 { "wbnoinvd", { XX
}, 0 },
3110 { "movups", { XM
, EXx
}, PREFIX_OPCODE
},
3111 { "movss", { XM
, EXd
}, PREFIX_OPCODE
},
3112 { "movupd", { XM
, EXx
}, PREFIX_OPCODE
},
3113 { "movsd", { XM
, EXq
}, PREFIX_OPCODE
},
3118 { "movups", { EXxS
, XM
}, PREFIX_OPCODE
},
3119 { "movss", { EXdS
, XM
}, PREFIX_OPCODE
},
3120 { "movupd", { EXxS
, XM
}, PREFIX_OPCODE
},
3121 { "movsd", { EXqS
, XM
}, PREFIX_OPCODE
},
3126 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
3127 { "movsldup", { XM
, EXx
}, PREFIX_OPCODE
},
3128 { MOD_TABLE (MOD_0F12_PREFIX_2
) },
3129 { "movddup", { XM
, EXq
}, PREFIX_OPCODE
},
3134 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
3135 { "movshdup", { XM
, EXx
}, PREFIX_OPCODE
},
3136 { MOD_TABLE (MOD_0F16_PREFIX_2
) },
3139 /* PREFIX_0F18_REG_6_MOD_0_X86_64 */
3141 { "prefetchit1", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3142 { "nopQ", { Ev
}, 0 },
3143 { "nopQ", { Ev
}, 0 },
3144 { "nopQ", { Ev
}, 0 },
3147 /* PREFIX_0F18_REG_7_MOD_0_X86_64 */
3149 { "prefetchit0", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3150 { "nopQ", { Ev
}, 0 },
3151 { "nopQ", { Ev
}, 0 },
3152 { "nopQ", { Ev
}, 0 },
3157 { MOD_TABLE (MOD_0F1A_PREFIX_0
) },
3158 { "bndcl", { Gbnd
, Ev_bnd
}, 0 },
3159 { "bndmov", { Gbnd
, Ebnd
}, 0 },
3160 { "bndcu", { Gbnd
, Ev_bnd
}, 0 },
3165 { MOD_TABLE (MOD_0F1B_PREFIX_0
) },
3166 { MOD_TABLE (MOD_0F1B_PREFIX_1
) },
3167 { "bndmov", { EbndS
, Gbnd
}, 0 },
3168 { "bndcn", { Gbnd
, Ev_bnd
}, 0 },
3173 { MOD_TABLE (MOD_0F1C_PREFIX_0
) },
3174 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3175 { "nopQ", { Ev
}, 0 },
3176 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3181 { "nopQ", { Ev
}, 0 },
3182 { MOD_TABLE (MOD_0F1E_PREFIX_1
) },
3183 { "nopQ", { Ev
}, 0 },
3184 { NULL
, { XX
}, PREFIX_IGNORED
},
3189 { "cvtpi2ps", { XM
, EMCq
}, PREFIX_OPCODE
},
3190 { "cvtsi2ss{%LQ|}", { XM
, Edq
}, PREFIX_OPCODE
},
3191 { "cvtpi2pd", { XM
, EMCq
}, PREFIX_OPCODE
},
3192 { "cvtsi2sd{%LQ|}", { XM
, Edq
}, 0 },
3197 { MOD_TABLE (MOD_0F2B_PREFIX_0
) },
3198 { MOD_TABLE (MOD_0F2B_PREFIX_1
) },
3199 { MOD_TABLE (MOD_0F2B_PREFIX_2
) },
3200 { MOD_TABLE (MOD_0F2B_PREFIX_3
) },
3205 { "cvttps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3206 { "cvttss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3207 { "cvttpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3208 { "cvttsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3213 { "cvtps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3214 { "cvtss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3215 { "cvtpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3216 { "cvtsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3221 { "ucomiss",{ XM
, EXd
}, 0 },
3223 { "ucomisd",{ XM
, EXq
}, 0 },
3228 { "comiss", { XM
, EXd
}, 0 },
3230 { "comisd", { XM
, EXq
}, 0 },
3235 { "sqrtps", { XM
, EXx
}, PREFIX_OPCODE
},
3236 { "sqrtss", { XM
, EXd
}, PREFIX_OPCODE
},
3237 { "sqrtpd", { XM
, EXx
}, PREFIX_OPCODE
},
3238 { "sqrtsd", { XM
, EXq
}, PREFIX_OPCODE
},
3243 { "rsqrtps",{ XM
, EXx
}, PREFIX_OPCODE
},
3244 { "rsqrtss",{ XM
, EXd
}, PREFIX_OPCODE
},
3249 { "rcpps", { XM
, EXx
}, PREFIX_OPCODE
},
3250 { "rcpss", { XM
, EXd
}, PREFIX_OPCODE
},
3255 { "addps", { XM
, EXx
}, PREFIX_OPCODE
},
3256 { "addss", { XM
, EXd
}, PREFIX_OPCODE
},
3257 { "addpd", { XM
, EXx
}, PREFIX_OPCODE
},
3258 { "addsd", { XM
, EXq
}, PREFIX_OPCODE
},
3263 { "mulps", { XM
, EXx
}, PREFIX_OPCODE
},
3264 { "mulss", { XM
, EXd
}, PREFIX_OPCODE
},
3265 { "mulpd", { XM
, EXx
}, PREFIX_OPCODE
},
3266 { "mulsd", { XM
, EXq
}, PREFIX_OPCODE
},
3271 { "cvtps2pd", { XM
, EXq
}, PREFIX_OPCODE
},
3272 { "cvtss2sd", { XM
, EXd
}, PREFIX_OPCODE
},
3273 { "cvtpd2ps", { XM
, EXx
}, PREFIX_OPCODE
},
3274 { "cvtsd2ss", { XM
, EXq
}, PREFIX_OPCODE
},
3279 { "cvtdq2ps", { XM
, EXx
}, PREFIX_OPCODE
},
3280 { "cvttps2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3281 { "cvtps2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3286 { "subps", { XM
, EXx
}, PREFIX_OPCODE
},
3287 { "subss", { XM
, EXd
}, PREFIX_OPCODE
},
3288 { "subpd", { XM
, EXx
}, PREFIX_OPCODE
},
3289 { "subsd", { XM
, EXq
}, PREFIX_OPCODE
},
3294 { "minps", { XM
, EXx
}, PREFIX_OPCODE
},
3295 { "minss", { XM
, EXd
}, PREFIX_OPCODE
},
3296 { "minpd", { XM
, EXx
}, PREFIX_OPCODE
},
3297 { "minsd", { XM
, EXq
}, PREFIX_OPCODE
},
3302 { "divps", { XM
, EXx
}, PREFIX_OPCODE
},
3303 { "divss", { XM
, EXd
}, PREFIX_OPCODE
},
3304 { "divpd", { XM
, EXx
}, PREFIX_OPCODE
},
3305 { "divsd", { XM
, EXq
}, PREFIX_OPCODE
},
3310 { "maxps", { XM
, EXx
}, PREFIX_OPCODE
},
3311 { "maxss", { XM
, EXd
}, PREFIX_OPCODE
},
3312 { "maxpd", { XM
, EXx
}, PREFIX_OPCODE
},
3313 { "maxsd", { XM
, EXq
}, PREFIX_OPCODE
},
3318 { "punpcklbw",{ MX
, EMd
}, PREFIX_OPCODE
},
3320 { "punpcklbw",{ MX
, EMx
}, PREFIX_OPCODE
},
3325 { "punpcklwd",{ MX
, EMd
}, PREFIX_OPCODE
},
3327 { "punpcklwd",{ MX
, EMx
}, PREFIX_OPCODE
},
3332 { "punpckldq",{ MX
, EMd
}, PREFIX_OPCODE
},
3334 { "punpckldq",{ MX
, EMx
}, PREFIX_OPCODE
},
3339 { "movq", { MX
, EM
}, PREFIX_OPCODE
},
3340 { "movdqu", { XM
, EXx
}, PREFIX_OPCODE
},
3341 { "movdqa", { XM
, EXx
}, PREFIX_OPCODE
},
3346 { "pshufw", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
3347 { "pshufhw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3348 { "pshufd", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3349 { "pshuflw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3354 {"vmread", { Em
, Gm
}, 0 },
3356 {"extrq", { XS
, Ib
, Ib
}, 0 },
3357 {"insertq", { XM
, XS
, Ib
, Ib
}, 0 },
3362 {"vmwrite", { Gm
, Em
}, 0 },
3364 {"extrq", { XM
, XS
}, 0 },
3365 {"insertq", { XM
, XS
}, 0 },
3372 { "haddpd", { XM
, EXx
}, PREFIX_OPCODE
},
3373 { "haddps", { XM
, EXx
}, PREFIX_OPCODE
},
3380 { "hsubpd", { XM
, EXx
}, PREFIX_OPCODE
},
3381 { "hsubps", { XM
, EXx
}, PREFIX_OPCODE
},
3386 { "movK", { Edq
, MX
}, PREFIX_OPCODE
},
3387 { "movq", { XM
, EXq
}, PREFIX_OPCODE
},
3388 { "movK", { Edq
, XM
}, PREFIX_OPCODE
},
3393 { "movq", { EMS
, MX
}, PREFIX_OPCODE
},
3394 { "movdqu", { EXxS
, XM
}, PREFIX_OPCODE
},
3395 { "movdqa", { EXxS
, XM
}, PREFIX_OPCODE
},
3398 /* PREFIX_0FAE_REG_0_MOD_3 */
3401 { "rdfsbase", { Ev
}, 0 },
3404 /* PREFIX_0FAE_REG_1_MOD_3 */
3407 { "rdgsbase", { Ev
}, 0 },
3410 /* PREFIX_0FAE_REG_2_MOD_3 */
3413 { "wrfsbase", { Ev
}, 0 },
3416 /* PREFIX_0FAE_REG_3_MOD_3 */
3419 { "wrgsbase", { Ev
}, 0 },
3422 /* PREFIX_0FAE_REG_4_MOD_0 */
3424 { "xsave", { FXSAVE
}, 0 },
3425 { "ptwrite{%LQ|}", { Edq
}, 0 },
3428 /* PREFIX_0FAE_REG_4_MOD_3 */
3431 { "ptwrite{%LQ|}", { Edq
}, 0 },
3434 /* PREFIX_0FAE_REG_5_MOD_3 */
3436 { "lfence", { Skip_MODRM
}, 0 },
3437 { "incsspK", { Edq
}, PREFIX_OPCODE
},
3440 /* PREFIX_0FAE_REG_6_MOD_0 */
3442 { "xsaveopt", { FXSAVE
}, PREFIX_OPCODE
},
3443 { "clrssbsy", { Mq
}, PREFIX_OPCODE
},
3444 { "clwb", { Mb
}, PREFIX_OPCODE
},
3447 /* PREFIX_0FAE_REG_6_MOD_3 */
3449 { RM_TABLE (RM_0FAE_REG_6_MOD_3_P_0
) },
3450 { "umonitor", { Eva
}, PREFIX_OPCODE
},
3451 { "tpause", { Edq
}, PREFIX_OPCODE
},
3452 { "umwait", { Edq
}, PREFIX_OPCODE
},
3455 /* PREFIX_0FAE_REG_7_MOD_0 */
3457 { "clflush", { Mb
}, 0 },
3459 { "clflushopt", { Mb
}, 0 },
3465 { "popcntS", { Gv
, Ev
}, 0 },
3470 { "bsfS", { Gv
, Ev
}, 0 },
3471 { "tzcntS", { Gv
, Ev
}, 0 },
3472 { "bsfS", { Gv
, Ev
}, 0 },
3477 { "bsrS", { Gv
, Ev
}, 0 },
3478 { "lzcntS", { Gv
, Ev
}, 0 },
3479 { "bsrS", { Gv
, Ev
}, 0 },
3484 { "cmpps", { XM
, EXx
, CMP
}, PREFIX_OPCODE
},
3485 { "cmpss", { XM
, EXd
, CMP
}, PREFIX_OPCODE
},
3486 { "cmppd", { XM
, EXx
, CMP
}, PREFIX_OPCODE
},
3487 { "cmpsd", { XM
, EXq
, CMP
}, PREFIX_OPCODE
},
3490 /* PREFIX_0FC7_REG_6_MOD_0 */
3492 { "vmptrld",{ Mq
}, 0 },
3493 { "vmxon", { Mq
}, 0 },
3494 { "vmclear",{ Mq
}, 0 },
3497 /* PREFIX_0FC7_REG_6_MOD_3 */
3499 { "rdrand", { Ev
}, 0 },
3500 { X86_64_TABLE (X86_64_0FC7_REG_6_MOD_3_PREFIX_1
) },
3501 { "rdrand", { Ev
}, 0 }
3504 /* PREFIX_0FC7_REG_7_MOD_3 */
3506 { "rdseed", { Ev
}, 0 },
3507 { "rdpid", { Em
}, 0 },
3508 { "rdseed", { Ev
}, 0 },
3515 { "addsubpd", { XM
, EXx
}, 0 },
3516 { "addsubps", { XM
, EXx
}, 0 },
3522 { "movq2dq",{ XM
, MS
}, 0 },
3523 { "movq", { EXqS
, XM
}, 0 },
3524 { "movdq2q",{ MX
, XS
}, 0 },
3530 { "cvtdq2pd", { XM
, EXq
}, PREFIX_OPCODE
},
3531 { "cvttpd2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3532 { "cvtpd2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3537 { "movntq", { Mq
, MX
}, PREFIX_OPCODE
},
3539 { MOD_TABLE (MOD_0FE7_PREFIX_2
) },
3547 { MOD_TABLE (MOD_0FF0_PREFIX_3
) },
3552 { "maskmovq", { MX
, MS
}, PREFIX_OPCODE
},
3554 { "maskmovdqu", { XM
, XS
}, PREFIX_OPCODE
},
3560 { REG_TABLE (REG_0F38D8_PREFIX_1
) },
3566 { MOD_TABLE (MOD_0F38DC_PREFIX_1
) },
3567 { "aesenc", { XM
, EXx
}, 0 },
3573 { MOD_TABLE (MOD_0F38DD_PREFIX_1
) },
3574 { "aesenclast", { XM
, EXx
}, 0 },
3580 { MOD_TABLE (MOD_0F38DE_PREFIX_1
) },
3581 { "aesdec", { XM
, EXx
}, 0 },
3587 { MOD_TABLE (MOD_0F38DF_PREFIX_1
) },
3588 { "aesdeclast", { XM
, EXx
}, 0 },
3593 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3595 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3596 { "crc32A", { Gdq
, Eb
}, PREFIX_OPCODE
},
3601 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3603 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3604 { "crc32Q", { Gdq
, Ev
}, PREFIX_OPCODE
},
3609 { MOD_TABLE (MOD_0F38F6_PREFIX_0
) },
3610 { "adoxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3611 { "adcxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3618 { MOD_TABLE (MOD_0F38F8_PREFIX_1
) },
3619 { MOD_TABLE (MOD_0F38F8_PREFIX_2
) },
3620 { MOD_TABLE (MOD_0F38F8_PREFIX_3
) },
3625 { MOD_TABLE (MOD_0F38FA_PREFIX_1
) },
3631 { MOD_TABLE (MOD_0F38FB_PREFIX_1
) },
3636 { "aadd", { Mdq
, Gdq
}, 0 },
3637 { "axor", { Mdq
, Gdq
}, 0 },
3638 { "aand", { Mdq
, Gdq
}, 0 },
3639 { "aor", { Mdq
, Gdq
}, 0 },
3645 { MOD_TABLE (MOD_0F3A0F_PREFIX_1
)},
3648 /* PREFIX_VEX_0F10 */
3650 { "%XEvmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3651 { "%XEvmovs%XS", { XMScalar
, VexScalarR
, EXd
}, 0 },
3652 { "%XEvmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3653 { "%XEvmovs%XD", { XMScalar
, VexScalarR
, EXq
}, 0 },
3656 /* PREFIX_VEX_0F11 */
3658 { "%XEvmovupX", { EXxS
, XM
}, 0 },
3659 { "%XEvmovs%XS", { EXdS
, VexScalarR
, XMScalar
}, 0 },
3660 { "%XEvmovupX", { EXxS
, XM
}, 0 },
3661 { "%XEvmovs%XD", { EXqS
, VexScalarR
, XMScalar
}, 0 },
3664 /* PREFIX_VEX_0F12 */
3666 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0
) },
3667 { "%XEvmov%XSldup", { XM
, EXEvexXNoBcst
}, 0 },
3668 { MOD_TABLE (MOD_VEX_0F12_PREFIX_2
) },
3669 { "%XEvmov%XDdup", { XM
, EXymmq
}, 0 },
3672 /* PREFIX_VEX_0F16 */
3674 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0
) },
3675 { "%XEvmov%XShdup", { XM
, EXEvexXNoBcst
}, 0 },
3676 { MOD_TABLE (MOD_VEX_0F16_PREFIX_2
) },
3679 /* PREFIX_VEX_0F2A */
3682 { "%XEvcvtsi2ss{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR
, Edq
}, 0 },
3684 { "%XEvcvtsi2sd{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR64
, Edq
}, 0 },
3687 /* PREFIX_VEX_0F2C */
3690 { "%XEvcvttss2si", { Gdq
, EXd
, EXxEVexS
}, 0 },
3692 { "%XEvcvttsd2si", { Gdq
, EXq
, EXxEVexS
}, 0 },
3695 /* PREFIX_VEX_0F2D */
3698 { "%XEvcvtss2si", { Gdq
, EXd
, EXxEVexR
}, 0 },
3700 { "%XEvcvtsd2si", { Gdq
, EXq
, EXxEVexR
}, 0 },
3703 /* PREFIX_VEX_0F2E */
3705 { "%XEvucomisX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3707 { "%XEvucomisX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3710 /* PREFIX_VEX_0F2F */
3712 { "%XEvcomisX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3714 { "%XEvcomisX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3717 /* PREFIX_VEX_0F41_L_1_M_1_W_0 */
3719 { "kandw", { MaskG
, MaskVex
, MaskE
}, 0 },
3721 { "kandb", { MaskG
, MaskVex
, MaskE
}, 0 },
3724 /* PREFIX_VEX_0F41_L_1_M_1_W_1 */
3726 { "kandq", { MaskG
, MaskVex
, MaskE
}, 0 },
3728 { "kandd", { MaskG
, MaskVex
, MaskE
}, 0 },
3731 /* PREFIX_VEX_0F42_L_1_M_1_W_0 */
3733 { "kandnw", { MaskG
, MaskVex
, MaskE
}, 0 },
3735 { "kandnb", { MaskG
, MaskVex
, MaskE
}, 0 },
3738 /* PREFIX_VEX_0F42_L_1_M_1_W_1 */
3740 { "kandnq", { MaskG
, MaskVex
, MaskE
}, 0 },
3742 { "kandnd", { MaskG
, MaskVex
, MaskE
}, 0 },
3745 /* PREFIX_VEX_0F44_L_0_M_1_W_0 */
3747 { "knotw", { MaskG
, MaskE
}, 0 },
3749 { "knotb", { MaskG
, MaskE
}, 0 },
3752 /* PREFIX_VEX_0F44_L_0_M_1_W_1 */
3754 { "knotq", { MaskG
, MaskE
}, 0 },
3756 { "knotd", { MaskG
, MaskE
}, 0 },
3759 /* PREFIX_VEX_0F45_L_1_M_1_W_0 */
3761 { "korw", { MaskG
, MaskVex
, MaskE
}, 0 },
3763 { "korb", { MaskG
, MaskVex
, MaskE
}, 0 },
3766 /* PREFIX_VEX_0F45_L_1_M_1_W_1 */
3768 { "korq", { MaskG
, MaskVex
, MaskE
}, 0 },
3770 { "kord", { MaskG
, MaskVex
, MaskE
}, 0 },
3773 /* PREFIX_VEX_0F46_L_1_M_1_W_0 */
3775 { "kxnorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3777 { "kxnorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3780 /* PREFIX_VEX_0F46_L_1_M_1_W_1 */
3782 { "kxnorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3784 { "kxnord", { MaskG
, MaskVex
, MaskE
}, 0 },
3787 /* PREFIX_VEX_0F47_L_1_M_1_W_0 */
3789 { "kxorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3791 { "kxorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3794 /* PREFIX_VEX_0F47_L_1_M_1_W_1 */
3796 { "kxorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3798 { "kxord", { MaskG
, MaskVex
, MaskE
}, 0 },
3801 /* PREFIX_VEX_0F4A_L_1_M_1_W_0 */
3803 { "kaddw", { MaskG
, MaskVex
, MaskE
}, 0 },
3805 { "kaddb", { MaskG
, MaskVex
, MaskE
}, 0 },
3808 /* PREFIX_VEX_0F4A_L_1_M_1_W_1 */
3810 { "kaddq", { MaskG
, MaskVex
, MaskE
}, 0 },
3812 { "kaddd", { MaskG
, MaskVex
, MaskE
}, 0 },
3815 /* PREFIX_VEX_0F4B_L_1_M_1_W_0 */
3817 { "kunpckwd", { MaskG
, MaskVex
, MaskE
}, 0 },
3819 { "kunpckbw", { MaskG
, MaskVex
, MaskE
}, 0 },
3822 /* PREFIX_VEX_0F4B_L_1_M_1_W_1 */
3824 { "kunpckdq", { MaskG
, MaskVex
, MaskE
}, 0 },
3827 /* PREFIX_VEX_0F51 */
3829 { "%XEvsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3830 { "%XEvsqrts%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3831 { "%XEvsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3832 { "%XEvsqrts%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3835 /* PREFIX_VEX_0F52 */
3837 { "vrsqrtps", { XM
, EXx
}, 0 },
3838 { "vrsqrtss", { XMScalar
, VexScalar
, EXd
}, 0 },
3841 /* PREFIX_VEX_0F53 */
3843 { "vrcpps", { XM
, EXx
}, 0 },
3844 { "vrcpss", { XMScalar
, VexScalar
, EXd
}, 0 },
3847 /* PREFIX_VEX_0F58 */
3849 { "%XEvaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3850 { "%XEvadds%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3851 { "%XEvaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3852 { "%XEvadds%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3855 /* PREFIX_VEX_0F59 */
3857 { "%XEvmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3858 { "%XEvmuls%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3859 { "%XEvmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3860 { "%XEvmuls%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3863 /* PREFIX_VEX_0F5A */
3865 { "%XEvcvtp%XS2pd", { XM
, EXEvexHalfBcstXmmq
, EXxEVexS
}, 0 },
3866 { "%XEvcvts%XS2sd", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3867 { "%XEvcvtp%XD2ps%XY", { XMxmmq
, EXx
, EXxEVexR
}, 0 },
3868 { "%XEvcvts%XD2ss", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3871 /* PREFIX_VEX_0F5B */
3873 { "vcvtdq2ps", { XM
, EXx
}, 0 },
3874 { "vcvttps2dq", { XM
, EXx
}, 0 },
3875 { "vcvtps2dq", { XM
, EXx
}, 0 },
3878 /* PREFIX_VEX_0F5C */
3880 { "%XEvsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3881 { "%XEvsubs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3882 { "%XEvsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3883 { "%XEvsubs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3886 /* PREFIX_VEX_0F5D */
3888 { "%XEvminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3889 { "%XEvmins%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3890 { "%XEvminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3891 { "%XEvmins%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3894 /* PREFIX_VEX_0F5E */
3896 { "%XEvdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3897 { "%XEvdivs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3898 { "%XEvdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3899 { "%XEvdivs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3902 /* PREFIX_VEX_0F5F */
3904 { "%XEvmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3905 { "%XEvmaxs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3906 { "%XEvmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3907 { "%XEvmaxs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3910 /* PREFIX_VEX_0F6F */
3913 { "vmovdqu", { XM
, EXx
}, 0 },
3914 { "vmovdqa", { XM
, EXx
}, 0 },
3917 /* PREFIX_VEX_0F70 */
3920 { "vpshufhw", { XM
, EXx
, Ib
}, 0 },
3921 { "vpshufd", { XM
, EXx
, Ib
}, 0 },
3922 { "vpshuflw", { XM
, EXx
, Ib
}, 0 },
3925 /* PREFIX_VEX_0F7C */
3929 { "vhaddpd", { XM
, Vex
, EXx
}, 0 },
3930 { "vhaddps", { XM
, Vex
, EXx
}, 0 },
3933 /* PREFIX_VEX_0F7D */
3937 { "vhsubpd", { XM
, Vex
, EXx
}, 0 },
3938 { "vhsubps", { XM
, Vex
, EXx
}, 0 },
3941 /* PREFIX_VEX_0F7E */
3944 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1
) },
3945 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2
) },
3948 /* PREFIX_VEX_0F7F */
3951 { "vmovdqu", { EXxS
, XM
}, 0 },
3952 { "vmovdqa", { EXxS
, XM
}, 0 },
3955 /* PREFIX_VEX_0F90_L_0_W_0 */
3957 { "kmovw", { MaskG
, MaskE
}, 0 },
3959 { "kmovb", { MaskG
, MaskBDE
}, 0 },
3962 /* PREFIX_VEX_0F90_L_0_W_1 */
3964 { "kmovq", { MaskG
, MaskE
}, 0 },
3966 { "kmovd", { MaskG
, MaskBDE
}, 0 },
3969 /* PREFIX_VEX_0F91_L_0_M_0_W_0 */
3971 { "kmovw", { Ew
, MaskG
}, 0 },
3973 { "kmovb", { Eb
, MaskG
}, 0 },
3976 /* PREFIX_VEX_0F91_L_0_M_0_W_1 */
3978 { "kmovq", { Eq
, MaskG
}, 0 },
3980 { "kmovd", { Ed
, MaskG
}, 0 },
3983 /* PREFIX_VEX_0F92_L_0_M_1_W_0 */
3985 { "kmovw", { MaskG
, Edq
}, 0 },
3987 { "kmovb", { MaskG
, Edq
}, 0 },
3988 { "kmovd", { MaskG
, Edq
}, 0 },
3991 /* PREFIX_VEX_0F92_L_0_M_1_W_1 */
3996 { "kmovK", { MaskG
, Edq
}, 0 },
3999 /* PREFIX_VEX_0F93_L_0_M_1_W_0 */
4001 { "kmovw", { Gdq
, MaskE
}, 0 },
4003 { "kmovb", { Gdq
, MaskE
}, 0 },
4004 { "kmovd", { Gdq
, MaskE
}, 0 },
4007 /* PREFIX_VEX_0F93_L_0_M_1_W_1 */
4012 { "kmovK", { Gdq
, MaskE
}, 0 },
4015 /* PREFIX_VEX_0F98_L_0_M_1_W_0 */
4017 { "kortestw", { MaskG
, MaskE
}, 0 },
4019 { "kortestb", { MaskG
, MaskE
}, 0 },
4022 /* PREFIX_VEX_0F98_L_0_M_1_W_1 */
4024 { "kortestq", { MaskG
, MaskE
}, 0 },
4026 { "kortestd", { MaskG
, MaskE
}, 0 },
4029 /* PREFIX_VEX_0F99_L_0_M_1_W_0 */
4031 { "ktestw", { MaskG
, MaskE
}, 0 },
4033 { "ktestb", { MaskG
, MaskE
}, 0 },
4036 /* PREFIX_VEX_0F99_L_0_M_1_W_1 */
4038 { "ktestq", { MaskG
, MaskE
}, 0 },
4040 { "ktestd", { MaskG
, MaskE
}, 0 },
4043 /* PREFIX_VEX_0FC2 */
4045 { "vcmpps", { XM
, Vex
, EXx
, CMP
}, 0 },
4046 { "vcmpss", { XMScalar
, VexScalar
, EXd
, CMP
}, 0 },
4047 { "vcmppd", { XM
, Vex
, EXx
, CMP
}, 0 },
4048 { "vcmpsd", { XMScalar
, VexScalar
, EXq
, CMP
}, 0 },
4051 /* PREFIX_VEX_0FD0 */
4055 { "vaddsubpd", { XM
, Vex
, EXx
}, 0 },
4056 { "vaddsubps", { XM
, Vex
, EXx
}, 0 },
4059 /* PREFIX_VEX_0FE6 */
4062 { "vcvtdq2pd", { XM
, EXxmmq
}, 0 },
4063 { "vcvttpd2dq%XY", { XMM
, EXx
}, 0 },
4064 { "vcvtpd2dq%XY", { XMM
, EXx
}, 0 },
4067 /* PREFIX_VEX_0FF0 */
4072 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3
) },
4075 /* PREFIX_VEX_0F3849_X86_64 */
4077 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_0
) },
4079 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_2
) },
4080 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_3
) },
4083 /* PREFIX_VEX_0F384B_X86_64 */
4086 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_1
) },
4087 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_2
) },
4088 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_3
) },
4091 /* PREFIX_VEX_0F3850_W_0 */
4093 { "vpdpbuud", { XM
, Vex
, EXx
}, 0 },
4094 { "vpdpbsud", { XM
, Vex
, EXx
}, 0 },
4095 { "%XVvpdpbusd", { XM
, Vex
, EXx
}, 0 },
4096 { "vpdpbssd", { XM
, Vex
, EXx
}, 0 },
4099 /* PREFIX_VEX_0F3851_W_0 */
4101 { "vpdpbuuds", { XM
, Vex
, EXx
}, 0 },
4102 { "vpdpbsuds", { XM
, Vex
, EXx
}, 0 },
4103 { "%XVvpdpbusds", { XM
, Vex
, EXx
}, 0 },
4104 { "vpdpbssds", { XM
, Vex
, EXx
}, 0 },
4106 /* PREFIX_VEX_0F385C_X86_64 */
4109 { VEX_W_TABLE (VEX_W_0F385C_X86_64_P_1
) },
4111 { VEX_W_TABLE (VEX_W_0F385C_X86_64_P_3
) },
4114 /* PREFIX_VEX_0F385E_X86_64 */
4116 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_0
) },
4117 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_1
) },
4118 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_2
) },
4119 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_3
) },
4122 /* PREFIX_VEX_0F3872 */
4125 { VEX_W_TABLE (VEX_W_0F3872_P_1
) },
4128 /* PREFIX_VEX_0F38B0_W_0 */
4130 { "vcvtneoph2ps", { XM
, Mx
}, 0 },
4131 { "vcvtneebf162ps", { XM
, Mx
}, 0 },
4132 { "vcvtneeph2ps", { XM
, Mx
}, 0 },
4133 { "vcvtneobf162ps", { XM
, Mx
}, 0 },
4136 /* PREFIX_VEX_0F38B1_W_0 */
4139 { "vbcstnebf162ps", { XM
, Mw
}, 0 },
4140 { "vbcstnesh2ps", { XM
, Mw
}, 0 },
4143 /* PREFIX_VEX_0F38F5_L_0 */
4145 { "bzhiS", { Gdq
, Edq
, VexGdq
}, 0 },
4146 { "pextS", { Gdq
, VexGdq
, Edq
}, 0 },
4148 { "pdepS", { Gdq
, VexGdq
, Edq
}, 0 },
4151 /* PREFIX_VEX_0F38F6_L_0 */
4156 { "mulxS", { Gdq
, VexGdq
, Edq
}, 0 },
4159 /* PREFIX_VEX_0F38F7_L_0 */
4161 { "bextrS", { Gdq
, Edq
, VexGdq
}, 0 },
4162 { "sarxS", { Gdq
, Edq
, VexGdq
}, 0 },
4163 { "shlxS", { Gdq
, Edq
, VexGdq
}, 0 },
4164 { "shrxS", { Gdq
, Edq
, VexGdq
}, 0 },
4167 /* PREFIX_VEX_0F3AF0_L_0 */
4172 { "rorxS", { Gdq
, Edq
, Ib
}, 0 },
4175 #include "i386-dis-evex-prefix.h"
4178 static const struct dis386 x86_64_table
[][2] = {
4181 { "pushP", { es
}, 0 },
4186 { "popP", { es
}, 0 },
4191 { "pushP", { cs
}, 0 },
4196 { "pushP", { ss
}, 0 },
4201 { "popP", { ss
}, 0 },
4206 { "pushP", { ds
}, 0 },
4211 { "popP", { ds
}, 0 },
4216 { "daa", { XX
}, 0 },
4221 { "das", { XX
}, 0 },
4226 { "aaa", { XX
}, 0 },
4231 { "aas", { XX
}, 0 },
4236 { "pushaP", { XX
}, 0 },
4241 { "popaP", { XX
}, 0 },
4246 { MOD_TABLE (MOD_62_32BIT
) },
4247 { EVEX_TABLE (EVEX_0F
) },
4252 { "arpl", { Ew
, Gw
}, 0 },
4253 { "movs", { Gv
, { MOVSXD_Fixup
, movsxd_mode
} }, 0 },
4258 { "ins{R|}", { Yzr
, indirDX
}, 0 },
4259 { "ins{G|}", { Yzr
, indirDX
}, 0 },
4264 { "outs{R|}", { indirDXr
, Xz
}, 0 },
4265 { "outs{G|}", { indirDXr
, Xz
}, 0 },
4270 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
4271 { REG_TABLE (REG_80
) },
4276 { "{l|}call{P|}", { Ap
}, 0 },
4281 { "retP", { Iw
, BND
}, 0 },
4282 { "ret@", { Iw
, BND
}, 0 },
4287 { "retP", { BND
}, 0 },
4288 { "ret@", { BND
}, 0 },
4293 { MOD_TABLE (MOD_C4_32BIT
) },
4294 { VEX_C4_TABLE (VEX_0F
) },
4299 { MOD_TABLE (MOD_C5_32BIT
) },
4300 { VEX_C5_TABLE (VEX_0F
) },
4305 { "into", { XX
}, 0 },
4310 { "aam", { Ib
}, 0 },
4315 { "aad", { Ib
}, 0 },
4320 { "callP", { Jv
, BND
}, 0 },
4321 { "call@", { Jv
, BND
}, 0 }
4326 { "jmpP", { Jv
, BND
}, 0 },
4327 { "jmp@", { Jv
, BND
}, 0 }
4332 { "{l|}jmp{P|}", { Ap
}, 0 },
4335 /* X86_64_0F01_REG_0 */
4337 { "sgdt{Q|Q}", { M
}, 0 },
4338 { "sgdt", { M
}, 0 },
4341 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_1 */
4344 { "wrmsrlist", { Skip_MODRM
}, 0 },
4347 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_3 */
4350 { "rdmsrlist", { Skip_MODRM
}, 0 },
4353 /* X86_64_0F01_REG_1 */
4355 { "sidt{Q|Q}", { M
}, 0 },
4356 { "sidt", { M
}, 0 },
4359 /* X86_64_0F01_REG_1_RM_5_PREFIX_2 */
4362 { "seamret", { Skip_MODRM
}, 0 },
4365 /* X86_64_0F01_REG_1_RM_6_PREFIX_2 */
4368 { "seamops", { Skip_MODRM
}, 0 },
4371 /* X86_64_0F01_REG_1_RM_7_PREFIX_2 */
4374 { "seamcall", { Skip_MODRM
}, 0 },
4377 /* X86_64_0F01_REG_2 */
4379 { "lgdt{Q|Q}", { M
}, 0 },
4380 { "lgdt", { M
}, 0 },
4383 /* X86_64_0F01_REG_3 */
4385 { "lidt{Q|Q}", { M
}, 0 },
4386 { "lidt", { M
}, 0 },
4389 /* X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1 */
4392 { "uiret", { Skip_MODRM
}, 0 },
4395 /* X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1 */
4398 { "testui", { Skip_MODRM
}, 0 },
4401 /* X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1 */
4404 { "clui", { Skip_MODRM
}, 0 },
4407 /* X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1 */
4410 { "stui", { Skip_MODRM
}, 0 },
4413 /* X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1 */
4416 { "rmpquery", { Skip_MODRM
}, 0 },
4419 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1 */
4422 { "rmpadjust", { Skip_MODRM
}, 0 },
4425 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3 */
4428 { "rmpupdate", { Skip_MODRM
}, 0 },
4431 /* X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1 */
4434 { "psmash", { Skip_MODRM
}, 0 },
4437 /* X86_64_0F18_REG_6_MOD_0 */
4439 { "nopQ", { Ev
}, 0 },
4440 { PREFIX_TABLE (PREFIX_0F18_REG_6_MOD_0_X86_64
) },
4443 /* X86_64_0F18_REG_7_MOD_0 */
4445 { "nopQ", { Ev
}, 0 },
4446 { PREFIX_TABLE (PREFIX_0F18_REG_7_MOD_0_X86_64
) },
4451 { "movZ", { Em
, Td
}, 0 },
4456 { "movZ", { Td
, Em
}, 0 },
4459 /* X86_64_0FC7_REG_6_MOD_3_PREFIX_1 */
4462 { "senduipi", { Eq
}, 0 },
4465 /* X86_64_VEX_0F3849 */
4468 { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64
) },
4471 /* X86_64_VEX_0F384B */
4474 { PREFIX_TABLE (PREFIX_VEX_0F384B_X86_64
) },
4477 /* X86_64_VEX_0F385C */
4480 { PREFIX_TABLE (PREFIX_VEX_0F385C_X86_64
) },
4483 /* X86_64_VEX_0F385E */
4486 { PREFIX_TABLE (PREFIX_VEX_0F385E_X86_64
) },
4489 /* X86_64_VEX_0F38E0 */
4492 { "cmpoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4495 /* X86_64_VEX_0F38E1 */
4498 { "cmpnoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4501 /* X86_64_VEX_0F38E2 */
4504 { "cmpbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4507 /* X86_64_VEX_0F38E3 */
4510 { "cmpnbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4513 /* X86_64_VEX_0F38E4 */
4516 { "cmpzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4519 /* X86_64_VEX_0F38E5 */
4522 { "cmpnzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4525 /* X86_64_VEX_0F38E6 */
4528 { "cmpbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4531 /* X86_64_VEX_0F38E7 */
4534 { "cmpnbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4537 /* X86_64_VEX_0F38E8 */
4540 { "cmpsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4543 /* X86_64_VEX_0F38E9 */
4546 { "cmpnsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4549 /* X86_64_VEX_0F38EA */
4552 { "cmppxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4555 /* X86_64_VEX_0F38EB */
4558 { "cmpnpxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4561 /* X86_64_VEX_0F38EC */
4564 { "cmplxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4567 /* X86_64_VEX_0F38ED */
4570 { "cmpnlxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4573 /* X86_64_VEX_0F38EE */
4576 { "cmplexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4579 /* X86_64_VEX_0F38EF */
4582 { "cmpnlexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4586 static const struct dis386 three_byte_table
[][256] = {
4588 /* THREE_BYTE_0F38 */
4591 { "pshufb", { MX
, EM
}, PREFIX_OPCODE
},
4592 { "phaddw", { MX
, EM
}, PREFIX_OPCODE
},
4593 { "phaddd", { MX
, EM
}, PREFIX_OPCODE
},
4594 { "phaddsw", { MX
, EM
}, PREFIX_OPCODE
},
4595 { "pmaddubsw", { MX
, EM
}, PREFIX_OPCODE
},
4596 { "phsubw", { MX
, EM
}, PREFIX_OPCODE
},
4597 { "phsubd", { MX
, EM
}, PREFIX_OPCODE
},
4598 { "phsubsw", { MX
, EM
}, PREFIX_OPCODE
},
4600 { "psignb", { MX
, EM
}, PREFIX_OPCODE
},
4601 { "psignw", { MX
, EM
}, PREFIX_OPCODE
},
4602 { "psignd", { MX
, EM
}, PREFIX_OPCODE
},
4603 { "pmulhrsw", { MX
, EM
}, PREFIX_OPCODE
},
4609 { "pblendvb", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4613 { "blendvps", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4614 { "blendvpd", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4616 { "ptest", { XM
, EXx
}, PREFIX_DATA
},
4622 { "pabsb", { MX
, EM
}, PREFIX_OPCODE
},
4623 { "pabsw", { MX
, EM
}, PREFIX_OPCODE
},
4624 { "pabsd", { MX
, EM
}, PREFIX_OPCODE
},
4627 { "pmovsxbw", { XM
, EXq
}, PREFIX_DATA
},
4628 { "pmovsxbd", { XM
, EXd
}, PREFIX_DATA
},
4629 { "pmovsxbq", { XM
, EXw
}, PREFIX_DATA
},
4630 { "pmovsxwd", { XM
, EXq
}, PREFIX_DATA
},
4631 { "pmovsxwq", { XM
, EXd
}, PREFIX_DATA
},
4632 { "pmovsxdq", { XM
, EXq
}, PREFIX_DATA
},
4636 { "pmuldq", { XM
, EXx
}, PREFIX_DATA
},
4637 { "pcmpeqq", { XM
, EXx
}, PREFIX_DATA
},
4638 { MOD_TABLE (MOD_0F382A
) },
4639 { "packusdw", { XM
, EXx
}, PREFIX_DATA
},
4645 { "pmovzxbw", { XM
, EXq
}, PREFIX_DATA
},
4646 { "pmovzxbd", { XM
, EXd
}, PREFIX_DATA
},
4647 { "pmovzxbq", { XM
, EXw
}, PREFIX_DATA
},
4648 { "pmovzxwd", { XM
, EXq
}, PREFIX_DATA
},
4649 { "pmovzxwq", { XM
, EXd
}, PREFIX_DATA
},
4650 { "pmovzxdq", { XM
, EXq
}, PREFIX_DATA
},
4652 { "pcmpgtq", { XM
, EXx
}, PREFIX_DATA
},
4654 { "pminsb", { XM
, EXx
}, PREFIX_DATA
},
4655 { "pminsd", { XM
, EXx
}, PREFIX_DATA
},
4656 { "pminuw", { XM
, EXx
}, PREFIX_DATA
},
4657 { "pminud", { XM
, EXx
}, PREFIX_DATA
},
4658 { "pmaxsb", { XM
, EXx
}, PREFIX_DATA
},
4659 { "pmaxsd", { XM
, EXx
}, PREFIX_DATA
},
4660 { "pmaxuw", { XM
, EXx
}, PREFIX_DATA
},
4661 { "pmaxud", { XM
, EXx
}, PREFIX_DATA
},
4663 { "pmulld", { XM
, EXx
}, PREFIX_DATA
},
4664 { "phminposuw", { XM
, EXx
}, PREFIX_DATA
},
4735 { "invept", { Gm
, Mo
}, PREFIX_DATA
},
4736 { "invvpid", { Gm
, Mo
}, PREFIX_DATA
},
4737 { "invpcid", { Gm
, M
}, PREFIX_DATA
},
4816 { "sha1nexte", { XM
, EXxmm
}, PREFIX_OPCODE
},
4817 { "sha1msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4818 { "sha1msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4819 { "sha256rnds2", { XM
, EXxmm
, XMM0
}, PREFIX_OPCODE
},
4820 { "sha256msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4821 { "sha256msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4823 { "gf2p8mulb", { XM
, EXxmm
}, PREFIX_DATA
},
4834 { PREFIX_TABLE (PREFIX_0F38D8
) },
4837 { "aesimc", { XM
, EXx
}, PREFIX_DATA
},
4838 { PREFIX_TABLE (PREFIX_0F38DC
) },
4839 { PREFIX_TABLE (PREFIX_0F38DD
) },
4840 { PREFIX_TABLE (PREFIX_0F38DE
) },
4841 { PREFIX_TABLE (PREFIX_0F38DF
) },
4861 { PREFIX_TABLE (PREFIX_0F38F0
) },
4862 { PREFIX_TABLE (PREFIX_0F38F1
) },
4866 { MOD_TABLE (MOD_0F38F5
) },
4867 { PREFIX_TABLE (PREFIX_0F38F6
) },
4870 { PREFIX_TABLE (PREFIX_0F38F8
) },
4871 { MOD_TABLE (MOD_0F38F9
) },
4872 { PREFIX_TABLE (PREFIX_0F38FA
) },
4873 { PREFIX_TABLE (PREFIX_0F38FB
) },
4874 { PREFIX_TABLE (PREFIX_0F38FC
) },
4879 /* THREE_BYTE_0F3A */
4891 { "roundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4892 { "roundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4893 { "roundss", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4894 { "roundsd", { XM
, EXq
, Ib
}, PREFIX_DATA
},
4895 { "blendps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4896 { "blendpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4897 { "pblendw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4898 { "palignr", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
4904 { "pextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
4905 { "pextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
4906 { "pextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
4907 { "extractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
4918 { "pinsrb", { XM
, Edb
, Ib
}, PREFIX_DATA
},
4919 { "insertps", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4920 { "pinsrK", { XM
, Edq
, Ib
}, PREFIX_DATA
},
4954 { "dpps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4955 { "dppd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4956 { "mpsadbw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4958 { "pclmulqdq", { XM
, EXx
, PCLMUL
}, PREFIX_DATA
},
4990 { "pcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4991 { "pcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4992 { "pcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4993 { "pcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5111 { "sha1rnds4", { XM
, EXxmm
, Ib
}, PREFIX_OPCODE
},
5113 { "gf2p8affineqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5114 { "gf2p8affineinvqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5132 { "aeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5152 { PREFIX_TABLE (PREFIX_0F3A0F
) },
5172 static const struct dis386 xop_table
[][256] = {
5325 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_85
) },
5326 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_86
) },
5327 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_87
) },
5335 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8E
) },
5336 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8F
) },
5343 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_95
) },
5344 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_96
) },
5345 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_97
) },
5353 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9E
) },
5354 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9F
) },
5358 { "vpcmov", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
5359 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A3
) },
5362 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A6
) },
5380 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_B6
) },
5392 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C0
) },
5393 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C1
) },
5394 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C2
) },
5395 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C3
) },
5405 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC
) },
5406 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD
) },
5407 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE
) },
5408 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF
) },
5441 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC
) },
5442 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED
) },
5443 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE
) },
5444 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF
) },
5468 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_01
) },
5469 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_02
) },
5487 { MOD_TABLE (MOD_XOP_09_12
) },
5611 { VEX_W_TABLE (VEX_W_0FXOP_09_80
) },
5612 { VEX_W_TABLE (VEX_W_0FXOP_09_81
) },
5613 { VEX_W_TABLE (VEX_W_0FXOP_09_82
) },
5614 { VEX_W_TABLE (VEX_W_0FXOP_09_83
) },
5629 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_90
) },
5630 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_91
) },
5631 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_92
) },
5632 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_93
) },
5633 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_94
) },
5634 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_95
) },
5635 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_96
) },
5636 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_97
) },
5638 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_98
) },
5639 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_99
) },
5640 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9A
) },
5641 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9B
) },
5684 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C1
) },
5685 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C2
) },
5686 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C3
) },
5689 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C6
) },
5690 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C7
) },
5695 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_CB
) },
5702 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D1
) },
5703 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D2
) },
5704 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D3
) },
5707 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D6
) },
5708 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D7
) },
5713 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_DB
) },
5720 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E1
) },
5721 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E2
) },
5722 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E3
) },
5776 { "bextrS", { Gdq
, Edq
, Id
}, 0 },
5778 { VEX_LEN_TABLE (VEX_LEN_0FXOP_0A_12
) },
6048 static const struct dis386 vex_table
[][256] = {
6070 { PREFIX_TABLE (PREFIX_VEX_0F10
) },
6071 { PREFIX_TABLE (PREFIX_VEX_0F11
) },
6072 { PREFIX_TABLE (PREFIX_VEX_0F12
) },
6073 { MOD_TABLE (MOD_VEX_0F13
) },
6074 { "vunpcklpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6075 { "vunpckhpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6076 { PREFIX_TABLE (PREFIX_VEX_0F16
) },
6077 { MOD_TABLE (MOD_VEX_0F17
) },
6097 { "vmovapX", { XM
, EXx
}, PREFIX_OPCODE
},
6098 { "vmovapX", { EXxS
, XM
}, PREFIX_OPCODE
},
6099 { PREFIX_TABLE (PREFIX_VEX_0F2A
) },
6100 { MOD_TABLE (MOD_VEX_0F2B
) },
6101 { PREFIX_TABLE (PREFIX_VEX_0F2C
) },
6102 { PREFIX_TABLE (PREFIX_VEX_0F2D
) },
6103 { PREFIX_TABLE (PREFIX_VEX_0F2E
) },
6104 { PREFIX_TABLE (PREFIX_VEX_0F2F
) },
6125 { VEX_LEN_TABLE (VEX_LEN_0F41
) },
6126 { VEX_LEN_TABLE (VEX_LEN_0F42
) },
6128 { VEX_LEN_TABLE (VEX_LEN_0F44
) },
6129 { VEX_LEN_TABLE (VEX_LEN_0F45
) },
6130 { VEX_LEN_TABLE (VEX_LEN_0F46
) },
6131 { VEX_LEN_TABLE (VEX_LEN_0F47
) },
6135 { VEX_LEN_TABLE (VEX_LEN_0F4A
) },
6136 { VEX_LEN_TABLE (VEX_LEN_0F4B
) },
6142 { MOD_TABLE (MOD_VEX_0F50
) },
6143 { PREFIX_TABLE (PREFIX_VEX_0F51
) },
6144 { PREFIX_TABLE (PREFIX_VEX_0F52
) },
6145 { PREFIX_TABLE (PREFIX_VEX_0F53
) },
6146 { "vandpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6147 { "vandnpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6148 { "vorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6149 { "vxorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6151 { PREFIX_TABLE (PREFIX_VEX_0F58
) },
6152 { PREFIX_TABLE (PREFIX_VEX_0F59
) },
6153 { PREFIX_TABLE (PREFIX_VEX_0F5A
) },
6154 { PREFIX_TABLE (PREFIX_VEX_0F5B
) },
6155 { PREFIX_TABLE (PREFIX_VEX_0F5C
) },
6156 { PREFIX_TABLE (PREFIX_VEX_0F5D
) },
6157 { PREFIX_TABLE (PREFIX_VEX_0F5E
) },
6158 { PREFIX_TABLE (PREFIX_VEX_0F5F
) },
6160 { "vpunpcklbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6161 { "vpunpcklwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6162 { "vpunpckldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6163 { "vpacksswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6164 { "vpcmpgtb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6165 { "vpcmpgtw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6166 { "vpcmpgtd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6167 { "vpackuswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6169 { "vpunpckhbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6170 { "vpunpckhwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6171 { "vpunpckhdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6172 { "vpackssdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6173 { "vpunpcklqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6174 { "vpunpckhqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6175 { VEX_LEN_TABLE (VEX_LEN_0F6E
) },
6176 { PREFIX_TABLE (PREFIX_VEX_0F6F
) },
6178 { PREFIX_TABLE (PREFIX_VEX_0F70
) },
6179 { MOD_TABLE (MOD_VEX_0F71
) },
6180 { MOD_TABLE (MOD_VEX_0F72
) },
6181 { MOD_TABLE (MOD_VEX_0F73
) },
6182 { "vpcmpeqb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6183 { "vpcmpeqw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6184 { "vpcmpeqd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6185 { VEX_LEN_TABLE (VEX_LEN_0F77
) },
6191 { PREFIX_TABLE (PREFIX_VEX_0F7C
) },
6192 { PREFIX_TABLE (PREFIX_VEX_0F7D
) },
6193 { PREFIX_TABLE (PREFIX_VEX_0F7E
) },
6194 { PREFIX_TABLE (PREFIX_VEX_0F7F
) },
6214 { VEX_LEN_TABLE (VEX_LEN_0F90
) },
6215 { VEX_LEN_TABLE (VEX_LEN_0F91
) },
6216 { VEX_LEN_TABLE (VEX_LEN_0F92
) },
6217 { VEX_LEN_TABLE (VEX_LEN_0F93
) },
6223 { VEX_LEN_TABLE (VEX_LEN_0F98
) },
6224 { VEX_LEN_TABLE (VEX_LEN_0F99
) },
6247 { REG_TABLE (REG_VEX_0FAE
) },
6270 { PREFIX_TABLE (PREFIX_VEX_0FC2
) },
6272 { VEX_LEN_TABLE (VEX_LEN_0FC4
) },
6273 { VEX_LEN_TABLE (VEX_LEN_0FC5
) },
6274 { "vshufpX", { XM
, Vex
, EXx
, Ib
}, PREFIX_OPCODE
},
6286 { PREFIX_TABLE (PREFIX_VEX_0FD0
) },
6287 { "vpsrlw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6288 { "vpsrld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6289 { "vpsrlq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6290 { "vpaddq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6291 { "vpmullw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6292 { VEX_LEN_TABLE (VEX_LEN_0FD6
) },
6293 { MOD_TABLE (MOD_VEX_0FD7
) },
6295 { "vpsubusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6296 { "vpsubusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6297 { "vpminub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6298 { "vpand", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6299 { "vpaddusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6300 { "vpaddusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6301 { "vpmaxub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6302 { "vpandn", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6304 { "vpavgb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6305 { "vpsraw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6306 { "vpsrad", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6307 { "vpavgw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6308 { "vpmulhuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6309 { "vpmulhw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6310 { PREFIX_TABLE (PREFIX_VEX_0FE6
) },
6311 { MOD_TABLE (MOD_VEX_0FE7
) },
6313 { "vpsubsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6314 { "vpsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6315 { "vpminsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6316 { "vpor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6317 { "vpaddsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6318 { "vpaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6319 { "vpmaxsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6320 { "vpxor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6322 { PREFIX_TABLE (PREFIX_VEX_0FF0
) },
6323 { "vpsllw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6324 { "vpslld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6325 { "vpsllq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6326 { "vpmuludq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6327 { "vpmaddwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6328 { "vpsadbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6329 { VEX_LEN_TABLE (VEX_LEN_0FF7
) },
6331 { "vpsubb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6332 { "vpsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6333 { "vpsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6334 { "vpsubq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6335 { "vpaddb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6336 { "vpaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6337 { "vpaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6343 { "vpshufb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6344 { "vphaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6345 { "vphaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6346 { "vphaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6347 { "vpmaddubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6348 { "vphsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6349 { "vphsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6350 { "vphsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6352 { "vpsignb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6353 { "vpsignw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6354 { "vpsignd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6355 { "vpmulhrsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6356 { VEX_W_TABLE (VEX_W_0F380C
) },
6357 { VEX_W_TABLE (VEX_W_0F380D
) },
6358 { VEX_W_TABLE (VEX_W_0F380E
) },
6359 { VEX_W_TABLE (VEX_W_0F380F
) },
6364 { VEX_W_TABLE (VEX_W_0F3813
) },
6367 { VEX_LEN_TABLE (VEX_LEN_0F3816
) },
6368 { "vptest", { XM
, EXx
}, PREFIX_DATA
},
6370 { VEX_W_TABLE (VEX_W_0F3818
) },
6371 { VEX_LEN_TABLE (VEX_LEN_0F3819
) },
6372 { MOD_TABLE (MOD_VEX_0F381A
) },
6374 { "vpabsb", { XM
, EXx
}, PREFIX_DATA
},
6375 { "vpabsw", { XM
, EXx
}, PREFIX_DATA
},
6376 { "vpabsd", { XM
, EXx
}, PREFIX_DATA
},
6379 { "vpmovsxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6380 { "vpmovsxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6381 { "vpmovsxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6382 { "vpmovsxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6383 { "vpmovsxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6384 { "vpmovsxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6388 { "vpmuldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6389 { "vpcmpeqq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6390 { MOD_TABLE (MOD_VEX_0F382A
) },
6391 { "vpackusdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6392 { MOD_TABLE (MOD_VEX_0F382C
) },
6393 { MOD_TABLE (MOD_VEX_0F382D
) },
6394 { MOD_TABLE (MOD_VEX_0F382E
) },
6395 { MOD_TABLE (MOD_VEX_0F382F
) },
6397 { "vpmovzxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6398 { "vpmovzxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6399 { "vpmovzxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6400 { "vpmovzxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6401 { "vpmovzxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6402 { "vpmovzxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6403 { VEX_LEN_TABLE (VEX_LEN_0F3836
) },
6404 { "vpcmpgtq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6406 { "vpminsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6407 { "vpminsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6408 { "vpminuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6409 { "vpminud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6410 { "vpmaxsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6411 { "vpmaxsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6412 { "vpmaxuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6413 { "vpmaxud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6415 { "vpmulld", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6416 { VEX_LEN_TABLE (VEX_LEN_0F3841
) },
6420 { "vpsrlv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6421 { VEX_W_TABLE (VEX_W_0F3846
) },
6422 { "vpsllv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6425 { X86_64_TABLE (X86_64_VEX_0F3849
) },
6427 { X86_64_TABLE (X86_64_VEX_0F384B
) },
6433 { VEX_W_TABLE (VEX_W_0F3850
) },
6434 { VEX_W_TABLE (VEX_W_0F3851
) },
6435 { VEX_W_TABLE (VEX_W_0F3852
) },
6436 { VEX_W_TABLE (VEX_W_0F3853
) },
6442 { VEX_W_TABLE (VEX_W_0F3858
) },
6443 { VEX_W_TABLE (VEX_W_0F3859
) },
6444 { MOD_TABLE (MOD_VEX_0F385A
) },
6446 { X86_64_TABLE (X86_64_VEX_0F385C
) },
6448 { X86_64_TABLE (X86_64_VEX_0F385E
) },
6471 { PREFIX_TABLE (PREFIX_VEX_0F3872
) },
6478 { VEX_W_TABLE (VEX_W_0F3878
) },
6479 { VEX_W_TABLE (VEX_W_0F3879
) },
6500 { MOD_TABLE (MOD_VEX_0F388C
) },
6502 { MOD_TABLE (MOD_VEX_0F388E
) },
6505 { "vpgatherd%DQ", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6506 { "vpgatherq%DQ", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6507 { "vgatherdp%XW", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6508 { "vgatherqp%XW", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6511 { "vfmaddsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6512 { "vfmsubadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6514 { "vfmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6515 { "vfmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6516 { "vfmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6517 { "vfmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6518 { "vfnmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6519 { "vfnmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6520 { "vfnmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6521 { "vfnmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6529 { "vfmaddsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6530 { "vfmsubadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6532 { "vfmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6533 { "vfmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6534 { "vfmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6535 { "vfmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6536 { "vfnmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6537 { "vfnmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6538 { "vfnmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6539 { "vfnmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6541 { VEX_W_TABLE (VEX_W_0F38B0
) },
6542 { VEX_W_TABLE (VEX_W_0F38B1
) },
6545 { VEX_W_TABLE (VEX_W_0F38B4
) },
6546 { VEX_W_TABLE (VEX_W_0F38B5
) },
6547 { "vfmaddsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6548 { "vfmsubadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6550 { "vfmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6551 { "vfmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6552 { "vfmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6553 { "vfmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6554 { "vfnmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6555 { "vfnmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6556 { "vfnmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6557 { "vfnmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6575 { VEX_W_TABLE (VEX_W_0F38CF
) },
6589 { VEX_LEN_TABLE (VEX_LEN_0F38DB
) },
6590 { "vaesenc", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6591 { "vaesenclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6592 { "vaesdec", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6593 { "vaesdeclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6595 { X86_64_TABLE (X86_64_VEX_0F38E0
) },
6596 { X86_64_TABLE (X86_64_VEX_0F38E1
) },
6597 { X86_64_TABLE (X86_64_VEX_0F38E2
) },
6598 { X86_64_TABLE (X86_64_VEX_0F38E3
) },
6599 { X86_64_TABLE (X86_64_VEX_0F38E4
) },
6600 { X86_64_TABLE (X86_64_VEX_0F38E5
) },
6601 { X86_64_TABLE (X86_64_VEX_0F38E6
) },
6602 { X86_64_TABLE (X86_64_VEX_0F38E7
) },
6604 { X86_64_TABLE (X86_64_VEX_0F38E8
) },
6605 { X86_64_TABLE (X86_64_VEX_0F38E9
) },
6606 { X86_64_TABLE (X86_64_VEX_0F38EA
) },
6607 { X86_64_TABLE (X86_64_VEX_0F38EB
) },
6608 { X86_64_TABLE (X86_64_VEX_0F38EC
) },
6609 { X86_64_TABLE (X86_64_VEX_0F38ED
) },
6610 { X86_64_TABLE (X86_64_VEX_0F38EE
) },
6611 { X86_64_TABLE (X86_64_VEX_0F38EF
) },
6615 { VEX_LEN_TABLE (VEX_LEN_0F38F2
) },
6616 { VEX_LEN_TABLE (VEX_LEN_0F38F3
) },
6618 { VEX_LEN_TABLE (VEX_LEN_0F38F5
) },
6619 { VEX_LEN_TABLE (VEX_LEN_0F38F6
) },
6620 { VEX_LEN_TABLE (VEX_LEN_0F38F7
) },
6634 { VEX_LEN_TABLE (VEX_LEN_0F3A00
) },
6635 { VEX_LEN_TABLE (VEX_LEN_0F3A01
) },
6636 { VEX_W_TABLE (VEX_W_0F3A02
) },
6638 { VEX_W_TABLE (VEX_W_0F3A04
) },
6639 { VEX_W_TABLE (VEX_W_0F3A05
) },
6640 { VEX_LEN_TABLE (VEX_LEN_0F3A06
) },
6643 { "vroundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6644 { "vroundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6645 { "vroundss", { XMScalar
, VexScalar
, EXd
, Ib
}, PREFIX_DATA
},
6646 { "vroundsd", { XMScalar
, VexScalar
, EXq
, Ib
}, PREFIX_DATA
},
6647 { "vblendps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6648 { "vblendpd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6649 { "vpblendw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6650 { "vpalignr", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6656 { VEX_LEN_TABLE (VEX_LEN_0F3A14
) },
6657 { VEX_LEN_TABLE (VEX_LEN_0F3A15
) },
6658 { VEX_LEN_TABLE (VEX_LEN_0F3A16
) },
6659 { VEX_LEN_TABLE (VEX_LEN_0F3A17
) },
6661 { VEX_LEN_TABLE (VEX_LEN_0F3A18
) },
6662 { VEX_LEN_TABLE (VEX_LEN_0F3A19
) },
6666 { VEX_W_TABLE (VEX_W_0F3A1D
) },
6670 { VEX_LEN_TABLE (VEX_LEN_0F3A20
) },
6671 { VEX_LEN_TABLE (VEX_LEN_0F3A21
) },
6672 { VEX_LEN_TABLE (VEX_LEN_0F3A22
) },
6688 { VEX_LEN_TABLE (VEX_LEN_0F3A30
) },
6689 { VEX_LEN_TABLE (VEX_LEN_0F3A31
) },
6690 { VEX_LEN_TABLE (VEX_LEN_0F3A32
) },
6691 { VEX_LEN_TABLE (VEX_LEN_0F3A33
) },
6697 { VEX_LEN_TABLE (VEX_LEN_0F3A38
) },
6698 { VEX_LEN_TABLE (VEX_LEN_0F3A39
) },
6706 { "vdpps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6707 { VEX_LEN_TABLE (VEX_LEN_0F3A41
) },
6708 { "vmpsadbw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6710 { "vpclmulqdq", { XM
, Vex
, EXx
, PCLMUL
}, PREFIX_DATA
},
6712 { VEX_LEN_TABLE (VEX_LEN_0F3A46
) },
6715 { "vpermil2ps", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6716 { "vpermil2pd", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6717 { VEX_W_TABLE (VEX_W_0F3A4A
) },
6718 { VEX_W_TABLE (VEX_W_0F3A4B
) },
6719 { VEX_W_TABLE (VEX_W_0F3A4C
) },
6737 { "vfmaddsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6738 { "vfmaddsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6739 { "vfmsubaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6740 { "vfmsubaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6742 { VEX_LEN_TABLE (VEX_LEN_0F3A60
) },
6743 { VEX_LEN_TABLE (VEX_LEN_0F3A61
) },
6744 { VEX_LEN_TABLE (VEX_LEN_0F3A62
) },
6745 { VEX_LEN_TABLE (VEX_LEN_0F3A63
) },
6751 { "vfmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6752 { "vfmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6753 { "vfmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6754 { "vfmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6755 { "vfmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6756 { "vfmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6757 { "vfmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6758 { "vfmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6769 { "vfnmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6770 { "vfnmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6771 { "vfnmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6772 { "vfnmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6773 { "vfnmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6774 { "vfnmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6775 { "vfnmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6776 { "vfnmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6865 { VEX_W_TABLE (VEX_W_0F3ACE
) },
6866 { VEX_W_TABLE (VEX_W_0F3ACF
) },
6884 { VEX_LEN_TABLE (VEX_LEN_0F3ADF
) },
6904 { VEX_LEN_TABLE (VEX_LEN_0F3AF0
) },
6924 #include "i386-dis-evex.h"
6926 static const struct dis386 vex_len_table
[][2] = {
6927 /* VEX_LEN_0F12_P_0_M_0 / VEX_LEN_0F12_P_2_M_0 */
6929 { "%XEvmovlpX", { XM
, Vex
, EXq
}, 0 },
6932 /* VEX_LEN_0F12_P_0_M_1 */
6934 { "%XEvmovhlp%XS", { XM
, Vex
, EXq
}, 0 },
6937 /* VEX_LEN_0F13_M_0 */
6939 { "%XEvmovlpX", { EXq
, XM
}, PREFIX_OPCODE
},
6942 /* VEX_LEN_0F16_P_0_M_0 / VEX_LEN_0F16_P_2_M_0 */
6944 { "%XEvmovhpX", { XM
, Vex
, EXq
}, 0 },
6947 /* VEX_LEN_0F16_P_0_M_1 */
6949 { "%XEvmovlhp%XS", { XM
, Vex
, EXq
}, 0 },
6952 /* VEX_LEN_0F17_M_0 */
6954 { "%XEvmovhpX", { EXq
, XM
}, PREFIX_OPCODE
},
6960 { MOD_TABLE (MOD_VEX_0F41_L_1
) },
6966 { MOD_TABLE (MOD_VEX_0F42_L_1
) },
6971 { MOD_TABLE (MOD_VEX_0F44_L_0
) },
6977 { MOD_TABLE (MOD_VEX_0F45_L_1
) },
6983 { MOD_TABLE (MOD_VEX_0F46_L_1
) },
6989 { MOD_TABLE (MOD_VEX_0F47_L_1
) },
6995 { MOD_TABLE (MOD_VEX_0F4A_L_1
) },
7001 { MOD_TABLE (MOD_VEX_0F4B_L_1
) },
7006 { "%XEvmovK", { XMScalar
, Edq
}, PREFIX_DATA
},
7011 { "vzeroupper", { XX
}, 0 },
7012 { "vzeroall", { XX
}, 0 },
7015 /* VEX_LEN_0F7E_P_1 */
7017 { "%XEvmovq", { XMScalar
, EXq
}, 0 },
7020 /* VEX_LEN_0F7E_P_2 */
7022 { "%XEvmovK", { Edq
, XMScalar
}, 0 },
7027 { VEX_W_TABLE (VEX_W_0F90_L_0
) },
7032 { MOD_TABLE (MOD_VEX_0F91_L_0
) },
7037 { MOD_TABLE (MOD_VEX_0F92_L_0
) },
7042 { MOD_TABLE (MOD_VEX_0F93_L_0
) },
7047 { MOD_TABLE (MOD_VEX_0F98_L_0
) },
7052 { MOD_TABLE (MOD_VEX_0F99_L_0
) },
7055 /* VEX_LEN_0FAE_R_2_M_0 */
7057 { "vldmxcsr", { Md
}, 0 },
7060 /* VEX_LEN_0FAE_R_3_M_0 */
7062 { "vstmxcsr", { Md
}, 0 },
7067 { "%XEvpinsrw", { XM
, Vex
, Edw
, Ib
}, PREFIX_DATA
},
7072 { "%XEvpextrw", { Gd
, XS
, Ib
}, PREFIX_DATA
},
7077 { "%XEvmovq", { EXqS
, XMScalar
}, PREFIX_DATA
},
7082 { "vmaskmovdqu", { XM
, XS
}, PREFIX_DATA
},
7085 /* VEX_LEN_0F3816 */
7088 { VEX_W_TABLE (VEX_W_0F3816_L_1
) },
7091 /* VEX_LEN_0F3819 */
7094 { VEX_W_TABLE (VEX_W_0F3819_L_1
) },
7097 /* VEX_LEN_0F381A_M_0 */
7100 { VEX_W_TABLE (VEX_W_0F381A_M_0_L_1
) },
7103 /* VEX_LEN_0F3836 */
7106 { VEX_W_TABLE (VEX_W_0F3836
) },
7109 /* VEX_LEN_0F3841 */
7111 { "vphminposuw", { XM
, EXx
}, PREFIX_DATA
},
7114 /* VEX_LEN_0F3849_X86_64_P_0_W_0_M_0 */
7116 { "ldtilecfg", { M
}, 0 },
7119 /* VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0 */
7121 { "tilerelease", { Skip_MODRM
}, 0 },
7124 /* VEX_LEN_0F3849_X86_64_P_2_W_0_M_0 */
7126 { "sttilecfg", { M
}, 0 },
7129 /* VEX_LEN_0F3849_X86_64_P_3_W_0_M_0 */
7131 { "tilezero", { TMM
, Skip_MODRM
}, 0 },
7134 /* VEX_LEN_0F384B_X86_64_P_1_W_0_M_0 */
7136 { "tilestored", { MVexSIBMEM
, TMM
}, 0 },
7138 /* VEX_LEN_0F384B_X86_64_P_2_W_0_M_0 */
7140 { "tileloaddt1", { TMM
, MVexSIBMEM
}, 0 },
7143 /* VEX_LEN_0F384B_X86_64_P_3_W_0_M_0 */
7145 { "tileloadd", { TMM
, MVexSIBMEM
}, 0 },
7148 /* VEX_LEN_0F385A_M_0 */
7151 { VEX_W_TABLE (VEX_W_0F385A_M_0_L_0
) },
7154 /* VEX_LEN_0F385C_X86_64_P_1_W_0_M_0 */
7156 { "tdpbf16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
7159 /* VEX_LEN_0F385C_X86_64_P_3_W_0_M_0 */
7161 { "tdpfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
7164 /* VEX_LEN_0F385E_X86_64_P_0_W_0_M_0 */
7166 { "tdpbuud", {TMM
, EXtmm
, VexTmm
}, 0 },
7169 /* VEX_LEN_0F385E_X86_64_P_1_W_0_M_0 */
7171 { "tdpbsud", {TMM
, EXtmm
, VexTmm
}, 0 },
7174 /* VEX_LEN_0F385E_X86_64_P_2_W_0_M_0 */
7176 { "tdpbusd", {TMM
, EXtmm
, VexTmm
}, 0 },
7179 /* VEX_LEN_0F385E_X86_64_P_3_W_0_M_0 */
7181 { "tdpbssd", {TMM
, EXtmm
, VexTmm
}, 0 },
7184 /* VEX_LEN_0F38DB */
7186 { "vaesimc", { XM
, EXx
}, PREFIX_DATA
},
7189 /* VEX_LEN_0F38F2 */
7191 { "andnS", { Gdq
, VexGdq
, Edq
}, PREFIX_OPCODE
},
7194 /* VEX_LEN_0F38F3 */
7196 { REG_TABLE(REG_VEX_0F38F3_L_0
) },
7199 /* VEX_LEN_0F38F5 */
7201 { PREFIX_TABLE(PREFIX_VEX_0F38F5_L_0
) },
7204 /* VEX_LEN_0F38F6 */
7206 { PREFIX_TABLE(PREFIX_VEX_0F38F6_L_0
) },
7209 /* VEX_LEN_0F38F7 */
7211 { PREFIX_TABLE(PREFIX_VEX_0F38F7_L_0
) },
7214 /* VEX_LEN_0F3A00 */
7217 { VEX_W_TABLE (VEX_W_0F3A00_L_1
) },
7220 /* VEX_LEN_0F3A01 */
7223 { VEX_W_TABLE (VEX_W_0F3A01_L_1
) },
7226 /* VEX_LEN_0F3A06 */
7229 { VEX_W_TABLE (VEX_W_0F3A06_L_1
) },
7232 /* VEX_LEN_0F3A14 */
7234 { "%XEvpextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
7237 /* VEX_LEN_0F3A15 */
7239 { "%XEvpextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
7242 /* VEX_LEN_0F3A16 */
7244 { "%XEvpextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
7247 /* VEX_LEN_0F3A17 */
7249 { "%XEvextractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
7252 /* VEX_LEN_0F3A18 */
7255 { VEX_W_TABLE (VEX_W_0F3A18_L_1
) },
7258 /* VEX_LEN_0F3A19 */
7261 { VEX_W_TABLE (VEX_W_0F3A19_L_1
) },
7264 /* VEX_LEN_0F3A20 */
7266 { "%XEvpinsrb", { XM
, Vex
, Edb
, Ib
}, PREFIX_DATA
},
7269 /* VEX_LEN_0F3A21 */
7271 { "%XEvinsertps", { XM
, Vex
, EXd
, Ib
}, PREFIX_DATA
},
7274 /* VEX_LEN_0F3A22 */
7276 { "%XEvpinsrK", { XM
, Vex
, Edq
, Ib
}, PREFIX_DATA
},
7279 /* VEX_LEN_0F3A30 */
7281 { MOD_TABLE (MOD_VEX_0F3A30_L_0
) },
7284 /* VEX_LEN_0F3A31 */
7286 { MOD_TABLE (MOD_VEX_0F3A31_L_0
) },
7289 /* VEX_LEN_0F3A32 */
7291 { MOD_TABLE (MOD_VEX_0F3A32_L_0
) },
7294 /* VEX_LEN_0F3A33 */
7296 { MOD_TABLE (MOD_VEX_0F3A33_L_0
) },
7299 /* VEX_LEN_0F3A38 */
7302 { VEX_W_TABLE (VEX_W_0F3A38_L_1
) },
7305 /* VEX_LEN_0F3A39 */
7308 { VEX_W_TABLE (VEX_W_0F3A39_L_1
) },
7311 /* VEX_LEN_0F3A41 */
7313 { "vdppd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7316 /* VEX_LEN_0F3A46 */
7319 { VEX_W_TABLE (VEX_W_0F3A46_L_1
) },
7322 /* VEX_LEN_0F3A60 */
7324 { "vpcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7327 /* VEX_LEN_0F3A61 */
7329 { "vpcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7332 /* VEX_LEN_0F3A62 */
7334 { "vpcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7337 /* VEX_LEN_0F3A63 */
7339 { "vpcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7342 /* VEX_LEN_0F3ADF */
7344 { "vaeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7347 /* VEX_LEN_0F3AF0 */
7349 { PREFIX_TABLE (PREFIX_VEX_0F3AF0_L_0
) },
7352 /* VEX_LEN_0FXOP_08_85 */
7354 { VEX_W_TABLE (VEX_W_0FXOP_08_85_L_0
) },
7357 /* VEX_LEN_0FXOP_08_86 */
7359 { VEX_W_TABLE (VEX_W_0FXOP_08_86_L_0
) },
7362 /* VEX_LEN_0FXOP_08_87 */
7364 { VEX_W_TABLE (VEX_W_0FXOP_08_87_L_0
) },
7367 /* VEX_LEN_0FXOP_08_8E */
7369 { VEX_W_TABLE (VEX_W_0FXOP_08_8E_L_0
) },
7372 /* VEX_LEN_0FXOP_08_8F */
7374 { VEX_W_TABLE (VEX_W_0FXOP_08_8F_L_0
) },
7377 /* VEX_LEN_0FXOP_08_95 */
7379 { VEX_W_TABLE (VEX_W_0FXOP_08_95_L_0
) },
7382 /* VEX_LEN_0FXOP_08_96 */
7384 { VEX_W_TABLE (VEX_W_0FXOP_08_96_L_0
) },
7387 /* VEX_LEN_0FXOP_08_97 */
7389 { VEX_W_TABLE (VEX_W_0FXOP_08_97_L_0
) },
7392 /* VEX_LEN_0FXOP_08_9E */
7394 { VEX_W_TABLE (VEX_W_0FXOP_08_9E_L_0
) },
7397 /* VEX_LEN_0FXOP_08_9F */
7399 { VEX_W_TABLE (VEX_W_0FXOP_08_9F_L_0
) },
7402 /* VEX_LEN_0FXOP_08_A3 */
7404 { "vpperm", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7407 /* VEX_LEN_0FXOP_08_A6 */
7409 { VEX_W_TABLE (VEX_W_0FXOP_08_A6_L_0
) },
7412 /* VEX_LEN_0FXOP_08_B6 */
7414 { VEX_W_TABLE (VEX_W_0FXOP_08_B6_L_0
) },
7417 /* VEX_LEN_0FXOP_08_C0 */
7419 { VEX_W_TABLE (VEX_W_0FXOP_08_C0_L_0
) },
7422 /* VEX_LEN_0FXOP_08_C1 */
7424 { VEX_W_TABLE (VEX_W_0FXOP_08_C1_L_0
) },
7427 /* VEX_LEN_0FXOP_08_C2 */
7429 { VEX_W_TABLE (VEX_W_0FXOP_08_C2_L_0
) },
7432 /* VEX_LEN_0FXOP_08_C3 */
7434 { VEX_W_TABLE (VEX_W_0FXOP_08_C3_L_0
) },
7437 /* VEX_LEN_0FXOP_08_CC */
7439 { VEX_W_TABLE (VEX_W_0FXOP_08_CC_L_0
) },
7442 /* VEX_LEN_0FXOP_08_CD */
7444 { VEX_W_TABLE (VEX_W_0FXOP_08_CD_L_0
) },
7447 /* VEX_LEN_0FXOP_08_CE */
7449 { VEX_W_TABLE (VEX_W_0FXOP_08_CE_L_0
) },
7452 /* VEX_LEN_0FXOP_08_CF */
7454 { VEX_W_TABLE (VEX_W_0FXOP_08_CF_L_0
) },
7457 /* VEX_LEN_0FXOP_08_EC */
7459 { VEX_W_TABLE (VEX_W_0FXOP_08_EC_L_0
) },
7462 /* VEX_LEN_0FXOP_08_ED */
7464 { VEX_W_TABLE (VEX_W_0FXOP_08_ED_L_0
) },
7467 /* VEX_LEN_0FXOP_08_EE */
7469 { VEX_W_TABLE (VEX_W_0FXOP_08_EE_L_0
) },
7472 /* VEX_LEN_0FXOP_08_EF */
7474 { VEX_W_TABLE (VEX_W_0FXOP_08_EF_L_0
) },
7477 /* VEX_LEN_0FXOP_09_01 */
7479 { REG_TABLE (REG_XOP_09_01_L_0
) },
7482 /* VEX_LEN_0FXOP_09_02 */
7484 { REG_TABLE (REG_XOP_09_02_L_0
) },
7487 /* VEX_LEN_0FXOP_09_12_M_1 */
7489 { REG_TABLE (REG_XOP_09_12_M_1_L_0
) },
7492 /* VEX_LEN_0FXOP_09_82_W_0 */
7494 { "vfrczss", { XM
, EXd
}, 0 },
7497 /* VEX_LEN_0FXOP_09_83_W_0 */
7499 { "vfrczsd", { XM
, EXq
}, 0 },
7502 /* VEX_LEN_0FXOP_09_90 */
7504 { "vprotb", { XM
, EXx
, VexW
}, 0 },
7507 /* VEX_LEN_0FXOP_09_91 */
7509 { "vprotw", { XM
, EXx
, VexW
}, 0 },
7512 /* VEX_LEN_0FXOP_09_92 */
7514 { "vprotd", { XM
, EXx
, VexW
}, 0 },
7517 /* VEX_LEN_0FXOP_09_93 */
7519 { "vprotq", { XM
, EXx
, VexW
}, 0 },
7522 /* VEX_LEN_0FXOP_09_94 */
7524 { "vpshlb", { XM
, EXx
, VexW
}, 0 },
7527 /* VEX_LEN_0FXOP_09_95 */
7529 { "vpshlw", { XM
, EXx
, VexW
}, 0 },
7532 /* VEX_LEN_0FXOP_09_96 */
7534 { "vpshld", { XM
, EXx
, VexW
}, 0 },
7537 /* VEX_LEN_0FXOP_09_97 */
7539 { "vpshlq", { XM
, EXx
, VexW
}, 0 },
7542 /* VEX_LEN_0FXOP_09_98 */
7544 { "vpshab", { XM
, EXx
, VexW
}, 0 },
7547 /* VEX_LEN_0FXOP_09_99 */
7549 { "vpshaw", { XM
, EXx
, VexW
}, 0 },
7552 /* VEX_LEN_0FXOP_09_9A */
7554 { "vpshad", { XM
, EXx
, VexW
}, 0 },
7557 /* VEX_LEN_0FXOP_09_9B */
7559 { "vpshaq", { XM
, EXx
, VexW
}, 0 },
7562 /* VEX_LEN_0FXOP_09_C1 */
7564 { VEX_W_TABLE (VEX_W_0FXOP_09_C1_L_0
) },
7567 /* VEX_LEN_0FXOP_09_C2 */
7569 { VEX_W_TABLE (VEX_W_0FXOP_09_C2_L_0
) },
7572 /* VEX_LEN_0FXOP_09_C3 */
7574 { VEX_W_TABLE (VEX_W_0FXOP_09_C3_L_0
) },
7577 /* VEX_LEN_0FXOP_09_C6 */
7579 { VEX_W_TABLE (VEX_W_0FXOP_09_C6_L_0
) },
7582 /* VEX_LEN_0FXOP_09_C7 */
7584 { VEX_W_TABLE (VEX_W_0FXOP_09_C7_L_0
) },
7587 /* VEX_LEN_0FXOP_09_CB */
7589 { VEX_W_TABLE (VEX_W_0FXOP_09_CB_L_0
) },
7592 /* VEX_LEN_0FXOP_09_D1 */
7594 { VEX_W_TABLE (VEX_W_0FXOP_09_D1_L_0
) },
7597 /* VEX_LEN_0FXOP_09_D2 */
7599 { VEX_W_TABLE (VEX_W_0FXOP_09_D2_L_0
) },
7602 /* VEX_LEN_0FXOP_09_D3 */
7604 { VEX_W_TABLE (VEX_W_0FXOP_09_D3_L_0
) },
7607 /* VEX_LEN_0FXOP_09_D6 */
7609 { VEX_W_TABLE (VEX_W_0FXOP_09_D6_L_0
) },
7612 /* VEX_LEN_0FXOP_09_D7 */
7614 { VEX_W_TABLE (VEX_W_0FXOP_09_D7_L_0
) },
7617 /* VEX_LEN_0FXOP_09_DB */
7619 { VEX_W_TABLE (VEX_W_0FXOP_09_DB_L_0
) },
7622 /* VEX_LEN_0FXOP_09_E1 */
7624 { VEX_W_TABLE (VEX_W_0FXOP_09_E1_L_0
) },
7627 /* VEX_LEN_0FXOP_09_E2 */
7629 { VEX_W_TABLE (VEX_W_0FXOP_09_E2_L_0
) },
7632 /* VEX_LEN_0FXOP_09_E3 */
7634 { VEX_W_TABLE (VEX_W_0FXOP_09_E3_L_0
) },
7637 /* VEX_LEN_0FXOP_0A_12 */
7639 { REG_TABLE (REG_XOP_0A_12_L_0
) },
7643 #include "i386-dis-evex-len.h"
7645 static const struct dis386 vex_w_table
[][2] = {
7647 /* VEX_W_0F41_L_1_M_1 */
7648 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_0
) },
7649 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_1
) },
7652 /* VEX_W_0F42_L_1_M_1 */
7653 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_0
) },
7654 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_1
) },
7657 /* VEX_W_0F44_L_0_M_1 */
7658 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_0
) },
7659 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_1
) },
7662 /* VEX_W_0F45_L_1_M_1 */
7663 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_0
) },
7664 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_1
) },
7667 /* VEX_W_0F46_L_1_M_1 */
7668 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_0
) },
7669 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_1
) },
7672 /* VEX_W_0F47_L_1_M_1 */
7673 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_0
) },
7674 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_1
) },
7677 /* VEX_W_0F4A_L_1_M_1 */
7678 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_0
) },
7679 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_1
) },
7682 /* VEX_W_0F4B_L_1_M_1 */
7683 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_0
) },
7684 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_1
) },
7687 /* VEX_W_0F90_L_0 */
7688 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_0
) },
7689 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_1
) },
7692 /* VEX_W_0F91_L_0_M_0 */
7693 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_0
) },
7694 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_1
) },
7697 /* VEX_W_0F92_L_0_M_1 */
7698 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_0
) },
7699 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_1
) },
7702 /* VEX_W_0F93_L_0_M_1 */
7703 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_0
) },
7704 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_1
) },
7707 /* VEX_W_0F98_L_0_M_1 */
7708 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_0
) },
7709 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_1
) },
7712 /* VEX_W_0F99_L_0_M_1 */
7713 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_0
) },
7714 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_1
) },
7718 { "%XEvpermilps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7722 { "vpermilpd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7726 { "vtestps", { XM
, EXx
}, PREFIX_DATA
},
7730 { "vtestpd", { XM
, EXx
}, PREFIX_DATA
},
7734 { "vcvtph2ps", { XM
, EXxmmq
}, PREFIX_DATA
},
7737 /* VEX_W_0F3816_L_1 */
7738 { "vpermps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7742 { "%XEvbroadcastss", { XM
, EXd
}, PREFIX_DATA
},
7745 /* VEX_W_0F3819_L_1 */
7746 { "vbroadcastsd", { XM
, EXq
}, PREFIX_DATA
},
7749 /* VEX_W_0F381A_M_0_L_1 */
7750 { "vbroadcastf128", { XM
, Mxmm
}, PREFIX_DATA
},
7753 /* VEX_W_0F382C_M_0 */
7754 { "vmaskmovps", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7757 /* VEX_W_0F382D_M_0 */
7758 { "vmaskmovpd", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7761 /* VEX_W_0F382E_M_0 */
7762 { "vmaskmovps", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7765 /* VEX_W_0F382F_M_0 */
7766 { "vmaskmovpd", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7770 { "vpermd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7774 { "vpsravd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7777 /* VEX_W_0F3849_X86_64_P_0 */
7778 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_0_W_0
) },
7781 /* VEX_W_0F3849_X86_64_P_2 */
7782 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_2_W_0
) },
7785 /* VEX_W_0F3849_X86_64_P_3 */
7786 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_3_W_0
) },
7789 /* VEX_W_0F384B_X86_64_P_1 */
7790 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_1_W_0
) },
7793 /* VEX_W_0F384B_X86_64_P_2 */
7794 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_2_W_0
) },
7797 /* VEX_W_0F384B_X86_64_P_3 */
7798 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_3_W_0
) },
7802 { PREFIX_TABLE (PREFIX_VEX_0F3850_W_0
) },
7806 { PREFIX_TABLE (PREFIX_VEX_0F3851_W_0
) },
7810 { "%XVvpdpwssd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7814 { "%XVvpdpwssds", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7818 { "%XEvpbroadcastd", { XM
, EXd
}, PREFIX_DATA
},
7822 { "vpbroadcastq", { XM
, EXq
}, PREFIX_DATA
},
7825 /* VEX_W_0F385A_M_0_L_0 */
7826 { "vbroadcasti128", { XM
, Mxmm
}, PREFIX_DATA
},
7829 /* VEX_W_0F385C_X86_64_P_1 */
7830 { MOD_TABLE (MOD_VEX_0F385C_X86_64_P_1_W_0
) },
7833 /* VEX_W_0F385C_X86_64_P_3 */
7834 { MOD_TABLE (MOD_VEX_0F385C_X86_64_P_3_W_0
) },
7837 /* VEX_W_0F385E_X86_64_P_0 */
7838 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_0_W_0
) },
7841 /* VEX_W_0F385E_X86_64_P_1 */
7842 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_1_W_0
) },
7845 /* VEX_W_0F385E_X86_64_P_2 */
7846 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_2_W_0
) },
7849 /* VEX_W_0F385E_X86_64_P_3 */
7850 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_3_W_0
) },
7853 /* VEX_W_0F3872_P_1 */
7854 { "%XVvcvtneps2bf16%XY", { XMM
, EXx
}, 0 },
7858 { "%XEvpbroadcastb", { XM
, EXb
}, PREFIX_DATA
},
7862 { "%XEvpbroadcastw", { XM
, EXw
}, PREFIX_DATA
},
7866 { PREFIX_TABLE (PREFIX_VEX_0F38B0_W_0
) },
7870 { PREFIX_TABLE (PREFIX_VEX_0F38B1_W_0
) },
7875 { "%XVvpmadd52luq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7880 { "%XVvpmadd52huq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7884 { "%XEvgf2p8mulb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7887 /* VEX_W_0F3A00_L_1 */
7889 { "%XEvpermq", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7892 /* VEX_W_0F3A01_L_1 */
7894 { "%XEvpermpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7898 { "vpblendd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7902 { "%XEvpermilps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7906 { "vpermilpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7909 /* VEX_W_0F3A06_L_1 */
7910 { "vperm2f128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7913 /* VEX_W_0F3A18_L_1 */
7914 { "vinsertf128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7917 /* VEX_W_0F3A19_L_1 */
7918 { "vextractf128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7922 { "%XEvcvtps2ph", { EXxmmq
, XM
, EXxEVexS
, Ib
}, PREFIX_DATA
},
7925 /* VEX_W_0F3A38_L_1 */
7926 { "vinserti128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7929 /* VEX_W_0F3A39_L_1 */
7930 { "vextracti128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7933 /* VEX_W_0F3A46_L_1 */
7934 { "vperm2i128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7938 { "vblendvps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7942 { "vblendvpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7946 { "vpblendvb", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7951 { "%XEvgf2p8affineqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7956 { "%XEvgf2p8affineinvqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7958 /* VEX_W_0FXOP_08_85_L_0 */
7960 { "vpmacssww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7962 /* VEX_W_0FXOP_08_86_L_0 */
7964 { "vpmacsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7966 /* VEX_W_0FXOP_08_87_L_0 */
7968 { "vpmacssdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7970 /* VEX_W_0FXOP_08_8E_L_0 */
7972 { "vpmacssdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7974 /* VEX_W_0FXOP_08_8F_L_0 */
7976 { "vpmacssdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7978 /* VEX_W_0FXOP_08_95_L_0 */
7980 { "vpmacsww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7982 /* VEX_W_0FXOP_08_96_L_0 */
7984 { "vpmacswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7986 /* VEX_W_0FXOP_08_97_L_0 */
7988 { "vpmacsdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7990 /* VEX_W_0FXOP_08_9E_L_0 */
7992 { "vpmacsdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7994 /* VEX_W_0FXOP_08_9F_L_0 */
7996 { "vpmacsdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7998 /* VEX_W_0FXOP_08_A6_L_0 */
8000 { "vpmadcsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8002 /* VEX_W_0FXOP_08_B6_L_0 */
8004 { "vpmadcswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8006 /* VEX_W_0FXOP_08_C0_L_0 */
8008 { "vprotb", { XM
, EXx
, Ib
}, 0 },
8010 /* VEX_W_0FXOP_08_C1_L_0 */
8012 { "vprotw", { XM
, EXx
, Ib
}, 0 },
8014 /* VEX_W_0FXOP_08_C2_L_0 */
8016 { "vprotd", { XM
, EXx
, Ib
}, 0 },
8018 /* VEX_W_0FXOP_08_C3_L_0 */
8020 { "vprotq", { XM
, EXx
, Ib
}, 0 },
8022 /* VEX_W_0FXOP_08_CC_L_0 */
8024 { "vpcomb", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8026 /* VEX_W_0FXOP_08_CD_L_0 */
8028 { "vpcomw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8030 /* VEX_W_0FXOP_08_CE_L_0 */
8032 { "vpcomd", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8034 /* VEX_W_0FXOP_08_CF_L_0 */
8036 { "vpcomq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8038 /* VEX_W_0FXOP_08_EC_L_0 */
8040 { "vpcomub", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8042 /* VEX_W_0FXOP_08_ED_L_0 */
8044 { "vpcomuw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8046 /* VEX_W_0FXOP_08_EE_L_0 */
8048 { "vpcomud", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8050 /* VEX_W_0FXOP_08_EF_L_0 */
8052 { "vpcomuq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8054 /* VEX_W_0FXOP_09_80 */
8056 { "vfrczps", { XM
, EXx
}, 0 },
8058 /* VEX_W_0FXOP_09_81 */
8060 { "vfrczpd", { XM
, EXx
}, 0 },
8062 /* VEX_W_0FXOP_09_82 */
8064 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_82_W_0
) },
8066 /* VEX_W_0FXOP_09_83 */
8068 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_83_W_0
) },
8070 /* VEX_W_0FXOP_09_C1_L_0 */
8072 { "vphaddbw", { XM
, EXxmm
}, 0 },
8074 /* VEX_W_0FXOP_09_C2_L_0 */
8076 { "vphaddbd", { XM
, EXxmm
}, 0 },
8078 /* VEX_W_0FXOP_09_C3_L_0 */
8080 { "vphaddbq", { XM
, EXxmm
}, 0 },
8082 /* VEX_W_0FXOP_09_C6_L_0 */
8084 { "vphaddwd", { XM
, EXxmm
}, 0 },
8086 /* VEX_W_0FXOP_09_C7_L_0 */
8088 { "vphaddwq", { XM
, EXxmm
}, 0 },
8090 /* VEX_W_0FXOP_09_CB_L_0 */
8092 { "vphadddq", { XM
, EXxmm
}, 0 },
8094 /* VEX_W_0FXOP_09_D1_L_0 */
8096 { "vphaddubw", { XM
, EXxmm
}, 0 },
8098 /* VEX_W_0FXOP_09_D2_L_0 */
8100 { "vphaddubd", { XM
, EXxmm
}, 0 },
8102 /* VEX_W_0FXOP_09_D3_L_0 */
8104 { "vphaddubq", { XM
, EXxmm
}, 0 },
8106 /* VEX_W_0FXOP_09_D6_L_0 */
8108 { "vphadduwd", { XM
, EXxmm
}, 0 },
8110 /* VEX_W_0FXOP_09_D7_L_0 */
8112 { "vphadduwq", { XM
, EXxmm
}, 0 },
8114 /* VEX_W_0FXOP_09_DB_L_0 */
8116 { "vphaddudq", { XM
, EXxmm
}, 0 },
8118 /* VEX_W_0FXOP_09_E1_L_0 */
8120 { "vphsubbw", { XM
, EXxmm
}, 0 },
8122 /* VEX_W_0FXOP_09_E2_L_0 */
8124 { "vphsubwd", { XM
, EXxmm
}, 0 },
8126 /* VEX_W_0FXOP_09_E3_L_0 */
8128 { "vphsubdq", { XM
, EXxmm
}, 0 },
8131 #include "i386-dis-evex-w.h"
8134 static const struct dis386 mod_table
[][2] = {
8137 { "bound{S|}", { Gv
, Ma
}, 0 },
8138 { EVEX_TABLE (EVEX_0F
) },
8142 { "leaS", { Gv
, M
}, 0 },
8146 { "lesS", { Gv
, Mp
}, 0 },
8147 { VEX_C4_TABLE (VEX_0F
) },
8151 { "ldsS", { Gv
, Mp
}, 0 },
8152 { VEX_C5_TABLE (VEX_0F
) },
8157 { RM_TABLE (RM_C6_REG_7
) },
8162 { RM_TABLE (RM_C7_REG_7
) },
8166 { "{l|}call^", { indirEp
}, 0 },
8170 { "{l|}jmp^", { indirEp
}, 0 },
8173 /* MOD_0F01_REG_0 */
8174 { X86_64_TABLE (X86_64_0F01_REG_0
) },
8175 { RM_TABLE (RM_0F01_REG_0
) },
8178 /* MOD_0F01_REG_1 */
8179 { X86_64_TABLE (X86_64_0F01_REG_1
) },
8180 { RM_TABLE (RM_0F01_REG_1
) },
8183 /* MOD_0F01_REG_2 */
8184 { X86_64_TABLE (X86_64_0F01_REG_2
) },
8185 { RM_TABLE (RM_0F01_REG_2
) },
8188 /* MOD_0F01_REG_3 */
8189 { X86_64_TABLE (X86_64_0F01_REG_3
) },
8190 { RM_TABLE (RM_0F01_REG_3
) },
8193 /* MOD_0F01_REG_5 */
8194 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_0
) },
8195 { RM_TABLE (RM_0F01_REG_5_MOD_3
) },
8198 /* MOD_0F01_REG_7 */
8199 { "invlpg", { Mb
}, 0 },
8200 { RM_TABLE (RM_0F01_REG_7_MOD_3
) },
8204 { "larS", { Gv
, Mw
}, 0 },
8205 { "larS", { Gv
, Ev
}, 0 },
8209 { "lslS", { Gv
, Mw
}, 0 },
8210 { "lslS", { Gv
, Ev
}, 0 },
8213 /* MOD_0F12_PREFIX_0 */
8214 { "movlpX", { XM
, EXq
}, 0 },
8215 { "movhlps", { XM
, EXq
}, 0 },
8218 /* MOD_0F12_PREFIX_2 */
8219 { "movlpX", { XM
, EXq
}, 0 },
8223 { "movlpX", { EXq
, XM
}, PREFIX_OPCODE
},
8226 /* MOD_0F16_PREFIX_0 */
8227 { "movhpX", { XM
, EXq
}, 0 },
8228 { "movlhps", { XM
, EXq
}, 0 },
8231 /* MOD_0F16_PREFIX_2 */
8232 { "movhpX", { XM
, EXq
}, 0 },
8236 { "movhpX", { EXq
, XM
}, PREFIX_OPCODE
},
8239 /* MOD_0F18_REG_0 */
8240 { "prefetchnta", { Mb
}, 0 },
8241 { "nopQ", { Ev
}, 0 },
8244 /* MOD_0F18_REG_1 */
8245 { "prefetcht0", { Mb
}, 0 },
8246 { "nopQ", { Ev
}, 0 },
8249 /* MOD_0F18_REG_2 */
8250 { "prefetcht1", { Mb
}, 0 },
8251 { "nopQ", { Ev
}, 0 },
8254 /* MOD_0F18_REG_3 */
8255 { "prefetcht2", { Mb
}, 0 },
8256 { "nopQ", { Ev
}, 0 },
8259 /* MOD_0F18_REG_6 */
8260 { X86_64_TABLE (X86_64_0F18_REG_6_MOD_0
) },
8261 { "nopQ", { Ev
}, 0 },
8264 /* MOD_0F18_REG_7 */
8265 { X86_64_TABLE (X86_64_0F18_REG_7_MOD_0
) },
8266 { "nopQ", { Ev
}, 0 },
8269 /* MOD_0F1A_PREFIX_0 */
8270 { "bndldx", { Gbnd
, Mv_bnd
}, 0 },
8271 { "nopQ", { Ev
}, 0 },
8274 /* MOD_0F1B_PREFIX_0 */
8275 { "bndstx", { Mv_bnd
, Gbnd
}, 0 },
8276 { "nopQ", { Ev
}, 0 },
8279 /* MOD_0F1B_PREFIX_1 */
8280 { "bndmk", { Gbnd
, Mv_bnd
}, 0 },
8281 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8284 /* MOD_0F1C_PREFIX_0 */
8285 { REG_TABLE (REG_0F1C_P_0_MOD_0
) },
8286 { "nopQ", { Ev
}, 0 },
8289 /* MOD_0F1E_PREFIX_1 */
8290 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8291 { REG_TABLE (REG_0F1E_P_1_MOD_3
) },
8294 /* MOD_0F2B_PREFIX_0 */
8295 {"movntps", { Mx
, XM
}, PREFIX_OPCODE
},
8298 /* MOD_0F2B_PREFIX_1 */
8299 {"movntss", { Md
, XM
}, PREFIX_OPCODE
},
8302 /* MOD_0F2B_PREFIX_2 */
8303 {"movntpd", { Mx
, XM
}, PREFIX_OPCODE
},
8306 /* MOD_0F2B_PREFIX_3 */
8307 {"movntsd", { Mq
, XM
}, PREFIX_OPCODE
},
8312 { "movmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8317 { REG_TABLE (REG_0F71_MOD_0
) },
8322 { REG_TABLE (REG_0F72_MOD_0
) },
8327 { REG_TABLE (REG_0F73_MOD_0
) },
8330 /* MOD_0FAE_REG_0 */
8331 { "fxsave", { FXSAVE
}, 0 },
8332 { PREFIX_TABLE (PREFIX_0FAE_REG_0_MOD_3
) },
8335 /* MOD_0FAE_REG_1 */
8336 { "fxrstor", { FXSAVE
}, 0 },
8337 { PREFIX_TABLE (PREFIX_0FAE_REG_1_MOD_3
) },
8340 /* MOD_0FAE_REG_2 */
8341 { "ldmxcsr", { Md
}, 0 },
8342 { PREFIX_TABLE (PREFIX_0FAE_REG_2_MOD_3
) },
8345 /* MOD_0FAE_REG_3 */
8346 { "stmxcsr", { Md
}, 0 },
8347 { PREFIX_TABLE (PREFIX_0FAE_REG_3_MOD_3
) },
8350 /* MOD_0FAE_REG_4 */
8351 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_0
) },
8352 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_3
) },
8355 /* MOD_0FAE_REG_5 */
8356 { "xrstor", { FXSAVE
}, PREFIX_OPCODE
},
8357 { PREFIX_TABLE (PREFIX_0FAE_REG_5_MOD_3
) },
8360 /* MOD_0FAE_REG_6 */
8361 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_0
) },
8362 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_3
) },
8365 /* MOD_0FAE_REG_7 */
8366 { PREFIX_TABLE (PREFIX_0FAE_REG_7_MOD_0
) },
8367 { RM_TABLE (RM_0FAE_REG_7_MOD_3
) },
8371 { "lssS", { Gv
, Mp
}, 0 },
8375 { "lfsS", { Gv
, Mp
}, 0 },
8379 { "lgsS", { Gv
, Mp
}, 0 },
8383 { "movntiS", { Edq
, Gdq
}, PREFIX_OPCODE
},
8386 /* MOD_0FC7_REG_3 */
8387 { "xrstors", { FXSAVE
}, 0 },
8390 /* MOD_0FC7_REG_4 */
8391 { "xsavec", { FXSAVE
}, 0 },
8394 /* MOD_0FC7_REG_5 */
8395 { "xsaves", { FXSAVE
}, 0 },
8398 /* MOD_0FC7_REG_6 */
8399 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_0
) },
8400 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_3
) }
8403 /* MOD_0FC7_REG_7 */
8404 { "vmptrst", { Mq
}, 0 },
8405 { PREFIX_TABLE (PREFIX_0FC7_REG_7_MOD_3
) }
8410 { "pmovmskb", { Gdq
, MS
}, 0 },
8413 /* MOD_0FE7_PREFIX_2 */
8414 { "movntdq", { Mx
, XM
}, 0 },
8417 /* MOD_0FF0_PREFIX_3 */
8418 { "lddqu", { XM
, M
}, 0 },
8422 { "movntdqa", { XM
, Mx
}, PREFIX_DATA
},
8425 /* MOD_0F38DC_PREFIX_1 */
8426 { "aesenc128kl", { XM
, M
}, 0 },
8427 { "loadiwkey", { XM
, EXx
}, 0 },
8430 /* MOD_0F38DD_PREFIX_1 */
8431 { "aesdec128kl", { XM
, M
}, 0 },
8434 /* MOD_0F38DE_PREFIX_1 */
8435 { "aesenc256kl", { XM
, M
}, 0 },
8438 /* MOD_0F38DF_PREFIX_1 */
8439 { "aesdec256kl", { XM
, M
}, 0 },
8443 { "wrussK", { M
, Gdq
}, PREFIX_DATA
},
8446 /* MOD_0F38F6_PREFIX_0 */
8447 { "wrssK", { M
, Gdq
}, PREFIX_OPCODE
},
8450 /* MOD_0F38F8_PREFIX_1 */
8451 { "enqcmds", { Gva
, M
}, PREFIX_OPCODE
},
8454 /* MOD_0F38F8_PREFIX_2 */
8455 { "movdir64b", { Gva
, M
}, PREFIX_OPCODE
},
8458 /* MOD_0F38F8_PREFIX_3 */
8459 { "enqcmd", { Gva
, M
}, PREFIX_OPCODE
},
8463 { "movdiri", { Edq
, Gdq
}, PREFIX_OPCODE
},
8466 /* MOD_0F38FA_PREFIX_1 */
8468 { "encodekey128", { Gd
, Ed
}, 0 },
8471 /* MOD_0F38FB_PREFIX_1 */
8473 { "encodekey256", { Gd
, Ed
}, 0 },
8476 /* MOD_0F3A0F_PREFIX_1 */
8478 { REG_TABLE (REG_0F3A0F_PREFIX_1_MOD_3
) },
8481 /* MOD_VEX_0F12_PREFIX_0 */
8482 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0
) },
8483 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1
) },
8486 /* MOD_VEX_0F12_PREFIX_2 */
8487 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2_M_0
) },
8491 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0
) },
8494 /* MOD_VEX_0F16_PREFIX_0 */
8495 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0
) },
8496 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1
) },
8499 /* MOD_VEX_0F16_PREFIX_2 */
8500 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2_M_0
) },
8504 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0
) },
8508 { "%XEvmovntpX", { Mx
, XM
}, PREFIX_OPCODE
},
8511 /* MOD_VEX_0F41_L_1 */
8513 { VEX_W_TABLE (VEX_W_0F41_L_1_M_1
) },
8516 /* MOD_VEX_0F42_L_1 */
8518 { VEX_W_TABLE (VEX_W_0F42_L_1_M_1
) },
8521 /* MOD_VEX_0F44_L_0 */
8523 { VEX_W_TABLE (VEX_W_0F44_L_0_M_1
) },
8526 /* MOD_VEX_0F45_L_1 */
8528 { VEX_W_TABLE (VEX_W_0F45_L_1_M_1
) },
8531 /* MOD_VEX_0F46_L_1 */
8533 { VEX_W_TABLE (VEX_W_0F46_L_1_M_1
) },
8536 /* MOD_VEX_0F47_L_1 */
8538 { VEX_W_TABLE (VEX_W_0F47_L_1_M_1
) },
8541 /* MOD_VEX_0F4A_L_1 */
8543 { VEX_W_TABLE (VEX_W_0F4A_L_1_M_1
) },
8546 /* MOD_VEX_0F4B_L_1 */
8548 { VEX_W_TABLE (VEX_W_0F4B_L_1_M_1
) },
8553 { "vmovmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8558 { REG_TABLE (REG_VEX_0F71_M_0
) },
8563 { REG_TABLE (REG_VEX_0F72_M_0
) },
8568 { REG_TABLE (REG_VEX_0F73_M_0
) },
8571 /* MOD_VEX_0F91_L_0 */
8572 { VEX_W_TABLE (VEX_W_0F91_L_0_M_0
) },
8575 /* MOD_VEX_0F92_L_0 */
8577 { VEX_W_TABLE (VEX_W_0F92_L_0_M_1
) },
8580 /* MOD_VEX_0F93_L_0 */
8582 { VEX_W_TABLE (VEX_W_0F93_L_0_M_1
) },
8585 /* MOD_VEX_0F98_L_0 */
8587 { VEX_W_TABLE (VEX_W_0F98_L_0_M_1
) },
8590 /* MOD_VEX_0F99_L_0 */
8592 { VEX_W_TABLE (VEX_W_0F99_L_0_M_1
) },
8595 /* MOD_VEX_0FAE_REG_2 */
8596 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0
) },
8599 /* MOD_VEX_0FAE_REG_3 */
8600 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0
) },
8605 { "vpmovmskb", { Gdq
, XS
}, PREFIX_DATA
},
8609 { "vmovntdq", { Mx
, XM
}, PREFIX_DATA
},
8612 /* MOD_VEX_0FF0_PREFIX_3 */
8613 { "vlddqu", { XM
, M
}, 0 },
8616 /* MOD_VEX_0F381A */
8617 { VEX_LEN_TABLE (VEX_LEN_0F381A_M_0
) },
8620 /* MOD_VEX_0F382A */
8621 { "vmovntdqa", { XM
, Mx
}, PREFIX_DATA
},
8624 /* MOD_VEX_0F382C */
8625 { VEX_W_TABLE (VEX_W_0F382C_M_0
) },
8628 /* MOD_VEX_0F382D */
8629 { VEX_W_TABLE (VEX_W_0F382D_M_0
) },
8632 /* MOD_VEX_0F382E */
8633 { VEX_W_TABLE (VEX_W_0F382E_M_0
) },
8636 /* MOD_VEX_0F382F */
8637 { VEX_W_TABLE (VEX_W_0F382F_M_0
) },
8640 /* MOD_VEX_0F3849_X86_64_P_0_W_0 */
8641 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_0_W_0_M_0
) },
8642 { REG_TABLE (REG_VEX_0F3849_X86_64_P_0_W_0_M_1
) },
8645 /* MOD_VEX_0F3849_X86_64_P_2_W_0 */
8646 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_2_W_0_M_0
) },
8649 /* MOD_VEX_0F3849_X86_64_P_3_W_0 */
8651 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_3_W_0_M_0
) },
8654 /* MOD_VEX_0F384B_X86_64_P_1_W_0 */
8655 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_1_W_0_M_0
) },
8658 /* MOD_VEX_0F384B_X86_64_P_2_W_0 */
8659 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_2_W_0_M_0
) },
8662 /* MOD_VEX_0F384B_X86_64_P_3_W_0 */
8663 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_3_W_0_M_0
) },
8666 /* MOD_VEX_0F385A */
8667 { VEX_LEN_TABLE (VEX_LEN_0F385A_M_0
) },
8670 /* MOD_VEX_0F385C_X86_64_P_1_W_0 */
8672 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_P_1_W_0_M_0
) },
8675 /* MOD_VEX_0F385C_X86_64_P_3_W_0 */
8677 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_P_3_W_0_M_0
) },
8680 /* MOD_VEX_0F385E_X86_64_P_0_W_0 */
8682 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_0_W_0_M_0
) },
8685 /* MOD_VEX_0F385E_X86_64_P_1_W_0 */
8687 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_1_W_0_M_0
) },
8690 /* MOD_VEX_0F385E_X86_64_P_2_W_0 */
8692 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_2_W_0_M_0
) },
8695 /* MOD_VEX_0F385E_X86_64_P_3_W_0 */
8697 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_3_W_0_M_0
) },
8700 /* MOD_VEX_0F388C */
8701 { "vpmaskmov%DQ", { XM
, Vex
, Mx
}, PREFIX_DATA
},
8704 /* MOD_VEX_0F388E */
8705 { "vpmaskmov%DQ", { Mx
, Vex
, XM
}, PREFIX_DATA
},
8708 /* MOD_VEX_0F3A30_L_0 */
8710 { "kshiftr%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8713 /* MOD_VEX_0F3A31_L_0 */
8715 { "kshiftr%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8718 /* MOD_VEX_0F3A32_L_0 */
8720 { "kshiftl%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8723 /* MOD_VEX_0F3A33_L_0 */
8725 { "kshiftl%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8730 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_12_M_1
) },
8733 #include "i386-dis-evex-mod.h"
8736 static const struct dis386 rm_table
[][8] = {
8739 { "xabort", { Skip_MODRM
, Ib
}, 0 },
8743 { "xbeginT", { Skip_MODRM
, Jdqw
}, 0 },
8747 { "enclv", { Skip_MODRM
}, 0 },
8748 { "vmcall", { Skip_MODRM
}, 0 },
8749 { "vmlaunch", { Skip_MODRM
}, 0 },
8750 { "vmresume", { Skip_MODRM
}, 0 },
8751 { "vmxoff", { Skip_MODRM
}, 0 },
8752 { "pconfig", { Skip_MODRM
}, 0 },
8753 { PREFIX_TABLE (PREFIX_0F01_REG_0_MOD_3_RM_6
) },
8757 { "monitor", { { OP_Monitor
, 0 } }, 0 },
8758 { "mwait", { { OP_Mwait
, 0 } }, 0 },
8759 { "clac", { Skip_MODRM
}, 0 },
8760 { "stac", { Skip_MODRM
}, 0 },
8761 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_4
) },
8762 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_5
) },
8763 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_6
) },
8764 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_7
) },
8768 { "xgetbv", { Skip_MODRM
}, 0 },
8769 { "xsetbv", { Skip_MODRM
}, 0 },
8772 { "vmfunc", { Skip_MODRM
}, 0 },
8773 { "xend", { Skip_MODRM
}, 0 },
8774 { "xtest", { Skip_MODRM
}, 0 },
8775 { "enclu", { Skip_MODRM
}, 0 },
8779 { "vmrun", { Skip_MODRM
}, 0 },
8780 { PREFIX_TABLE (PREFIX_0F01_REG_3_RM_1
) },
8781 { "vmload", { Skip_MODRM
}, 0 },
8782 { "vmsave", { Skip_MODRM
}, 0 },
8783 { "stgi", { Skip_MODRM
}, 0 },
8784 { "clgi", { Skip_MODRM
}, 0 },
8785 { "skinit", { Skip_MODRM
}, 0 },
8786 { "invlpga", { Skip_MODRM
}, 0 },
8789 /* RM_0F01_REG_5_MOD_3 */
8790 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_0
) },
8791 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_1
) },
8792 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_2
) },
8794 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_4
) },
8795 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_5
) },
8796 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_6
) },
8797 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_7
) },
8800 /* RM_0F01_REG_7_MOD_3 */
8801 { "swapgs", { Skip_MODRM
}, 0 },
8802 { "rdtscp", { Skip_MODRM
}, 0 },
8803 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_2
) },
8804 { "mwaitx", { { OP_Mwait
, eBX_reg
} }, PREFIX_OPCODE
},
8805 { "clzero", { Skip_MODRM
}, 0 },
8806 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_5
) },
8807 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_6
) },
8808 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_7
) },
8811 /* RM_0F1E_P_1_MOD_3_REG_7 */
8812 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8813 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8814 { "endbr64", { Skip_MODRM
}, 0 },
8815 { "endbr32", { Skip_MODRM
}, 0 },
8816 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8817 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8818 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8819 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8822 /* RM_0FAE_REG_6_MOD_3 */
8823 { "mfence", { Skip_MODRM
}, 0 },
8826 /* RM_0FAE_REG_7_MOD_3 */
8827 { "sfence", { Skip_MODRM
}, 0 },
8830 /* RM_0F3A0F_P_1_MOD_3_REG_0 */
8831 { "hreset", { Skip_MODRM
, Ib
}, 0 },
8834 /* RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0 */
8835 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0
) },
8839 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
8841 /* The values used here must be non-zero, fit in 'unsigned char', and not be
8842 in conflict with actual prefix opcodes. */
8843 #define REP_PREFIX 0x01
8844 #define XACQUIRE_PREFIX 0x02
8845 #define XRELEASE_PREFIX 0x03
8846 #define BND_PREFIX 0x04
8847 #define NOTRACK_PREFIX 0x05
8850 ckprefix (instr_info
*ins
)
8852 int newrex
, i
, length
;
8856 /* The maximum instruction length is 15bytes. */
8857 while (length
< MAX_CODE_LENGTH
- 1)
8859 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
8861 switch (*ins
->codep
)
8863 /* REX prefixes family. */
8880 if (ins
->address_mode
== mode_64bit
)
8881 newrex
= *ins
->codep
;
8884 ins
->last_rex_prefix
= i
;
8887 ins
->prefixes
|= PREFIX_REPZ
;
8888 ins
->last_repz_prefix
= i
;
8891 ins
->prefixes
|= PREFIX_REPNZ
;
8892 ins
->last_repnz_prefix
= i
;
8895 ins
->prefixes
|= PREFIX_LOCK
;
8896 ins
->last_lock_prefix
= i
;
8899 ins
->prefixes
|= PREFIX_CS
;
8900 ins
->last_seg_prefix
= i
;
8901 if (ins
->address_mode
!= mode_64bit
)
8902 ins
->active_seg_prefix
= PREFIX_CS
;
8905 ins
->prefixes
|= PREFIX_SS
;
8906 ins
->last_seg_prefix
= i
;
8907 if (ins
->address_mode
!= mode_64bit
)
8908 ins
->active_seg_prefix
= PREFIX_SS
;
8911 ins
->prefixes
|= PREFIX_DS
;
8912 ins
->last_seg_prefix
= i
;
8913 if (ins
->address_mode
!= mode_64bit
)
8914 ins
->active_seg_prefix
= PREFIX_DS
;
8917 ins
->prefixes
|= PREFIX_ES
;
8918 ins
->last_seg_prefix
= i
;
8919 if (ins
->address_mode
!= mode_64bit
)
8920 ins
->active_seg_prefix
= PREFIX_ES
;
8923 ins
->prefixes
|= PREFIX_FS
;
8924 ins
->last_seg_prefix
= i
;
8925 ins
->active_seg_prefix
= PREFIX_FS
;
8928 ins
->prefixes
|= PREFIX_GS
;
8929 ins
->last_seg_prefix
= i
;
8930 ins
->active_seg_prefix
= PREFIX_GS
;
8933 ins
->prefixes
|= PREFIX_DATA
;
8934 ins
->last_data_prefix
= i
;
8937 ins
->prefixes
|= PREFIX_ADDR
;
8938 ins
->last_addr_prefix
= i
;
8941 /* fwait is really an instruction. If there are prefixes
8942 before the fwait, they belong to the fwait, *not* to the
8943 following instruction. */
8944 ins
->fwait_prefix
= i
;
8945 if (ins
->prefixes
|| ins
->rex
)
8947 ins
->prefixes
|= PREFIX_FWAIT
;
8949 /* This ensures that the previous REX prefixes are noticed
8950 as unused prefixes, as in the return case below. */
8951 ins
->rex_used
= ins
->rex
;
8954 ins
->prefixes
= PREFIX_FWAIT
;
8959 /* Rex is ignored when followed by another prefix. */
8962 ins
->rex_used
= ins
->rex
;
8965 if (*ins
->codep
!= FWAIT_OPCODE
)
8966 ins
->all_prefixes
[i
++] = *ins
->codep
;
8974 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
8978 prefix_name (instr_info
*ins
, int pref
, int sizeflag
)
8980 static const char *rexes
[16] =
8985 "rex.XB", /* 0x43 */
8987 "rex.RB", /* 0x45 */
8988 "rex.RX", /* 0x46 */
8989 "rex.RXB", /* 0x47 */
8991 "rex.WB", /* 0x49 */
8992 "rex.WX", /* 0x4a */
8993 "rex.WXB", /* 0x4b */
8994 "rex.WR", /* 0x4c */
8995 "rex.WRB", /* 0x4d */
8996 "rex.WRX", /* 0x4e */
8997 "rex.WRXB", /* 0x4f */
9002 /* REX prefixes family. */
9019 return rexes
[pref
- 0x40];
9039 return (sizeflag
& DFLAG
) ? "data16" : "data32";
9041 if (ins
->address_mode
== mode_64bit
)
9042 return (sizeflag
& AFLAG
) ? "addr32" : "addr64";
9044 return (sizeflag
& AFLAG
) ? "addr16" : "addr32";
9049 case XACQUIRE_PREFIX
:
9051 case XRELEASE_PREFIX
:
9055 case NOTRACK_PREFIX
:
9063 print_i386_disassembler_options (FILE *stream
)
9065 fprintf (stream
, _("\n\
9066 The following i386/x86-64 specific disassembler options are supported for use\n\
9067 with the -M switch (multiple options should be separated by commas):\n"));
9069 fprintf (stream
, _(" x86-64 Disassemble in 64bit mode\n"));
9070 fprintf (stream
, _(" i386 Disassemble in 32bit mode\n"));
9071 fprintf (stream
, _(" i8086 Disassemble in 16bit mode\n"));
9072 fprintf (stream
, _(" att Display instruction in AT&T syntax\n"));
9073 fprintf (stream
, _(" intel Display instruction in Intel syntax\n"));
9074 fprintf (stream
, _(" att-mnemonic\n"
9075 " Display instruction in AT&T mnemonic\n"));
9076 fprintf (stream
, _(" intel-mnemonic\n"
9077 " Display instruction in Intel mnemonic\n"));
9078 fprintf (stream
, _(" addr64 Assume 64bit address size\n"));
9079 fprintf (stream
, _(" addr32 Assume 32bit address size\n"));
9080 fprintf (stream
, _(" addr16 Assume 16bit address size\n"));
9081 fprintf (stream
, _(" data32 Assume 32bit data size\n"));
9082 fprintf (stream
, _(" data16 Assume 16bit data size\n"));
9083 fprintf (stream
, _(" suffix Always display instruction suffix in AT&T syntax\n"));
9084 fprintf (stream
, _(" amd64 Display instruction in AMD64 ISA\n"));
9085 fprintf (stream
, _(" intel64 Display instruction in Intel64 ISA\n"));
9089 static const struct dis386 bad_opcode
= { "(bad)", { XX
}, 0 };
9091 /* Get a pointer to struct dis386 with a valid name. */
9093 static const struct dis386
*
9094 get_valid_dis386 (const struct dis386
*dp
, instr_info
*ins
)
9096 int vindex
, vex_table_index
;
9098 if (dp
->name
!= NULL
)
9101 switch (dp
->op
[0].bytemode
)
9104 dp
= ®_table
[dp
->op
[1].bytemode
][ins
->modrm
.reg
];
9108 vindex
= ins
->modrm
.mod
== 0x3 ? 1 : 0;
9109 dp
= &mod_table
[dp
->op
[1].bytemode
][vindex
];
9113 dp
= &rm_table
[dp
->op
[1].bytemode
][ins
->modrm
.rm
];
9116 case USE_PREFIX_TABLE
:
9119 /* The prefix in VEX is implicit. */
9120 switch (ins
->vex
.prefix
)
9125 case REPE_PREFIX_OPCODE
:
9128 case DATA_PREFIX_OPCODE
:
9131 case REPNE_PREFIX_OPCODE
:
9141 int last_prefix
= -1;
9144 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
9145 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
9147 if ((ins
->prefixes
& (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
9149 if (ins
->last_repz_prefix
> ins
->last_repnz_prefix
)
9152 prefix
= PREFIX_REPZ
;
9153 last_prefix
= ins
->last_repz_prefix
;
9158 prefix
= PREFIX_REPNZ
;
9159 last_prefix
= ins
->last_repnz_prefix
;
9162 /* Check if prefix should be ignored. */
9163 if ((((prefix_table
[dp
->op
[1].bytemode
][vindex
].prefix_requirement
9164 & PREFIX_IGNORED
) >> PREFIX_IGNORED_SHIFT
)
9166 && !prefix_table
[dp
->op
[1].bytemode
][vindex
].name
)
9170 if (vindex
== 0 && (ins
->prefixes
& PREFIX_DATA
) != 0)
9173 prefix
= PREFIX_DATA
;
9174 last_prefix
= ins
->last_data_prefix
;
9179 ins
->used_prefixes
|= prefix
;
9180 ins
->all_prefixes
[last_prefix
] = 0;
9183 dp
= &prefix_table
[dp
->op
[1].bytemode
][vindex
];
9186 case USE_X86_64_TABLE
:
9187 vindex
= ins
->address_mode
== mode_64bit
? 1 : 0;
9188 dp
= &x86_64_table
[dp
->op
[1].bytemode
][vindex
];
9191 case USE_3BYTE_TABLE
:
9192 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
9193 vindex
= *ins
->codep
++;
9194 dp
= &three_byte_table
[dp
->op
[1].bytemode
][vindex
];
9195 ins
->end_codep
= ins
->codep
;
9196 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9197 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9198 ins
->modrm
.rm
= *ins
->codep
& 7;
9201 case USE_VEX_LEN_TABLE
:
9205 switch (ins
->vex
.length
)
9211 /* This allows re-using in particular table entries where only
9212 128-bit operand size (VEX.L=0 / EVEX.L'L=0) are valid. */
9225 dp
= &vex_len_table
[dp
->op
[1].bytemode
][vindex
];
9228 case USE_EVEX_LEN_TABLE
:
9232 switch (ins
->vex
.length
)
9248 dp
= &evex_len_table
[dp
->op
[1].bytemode
][vindex
];
9251 case USE_XOP_8F_TABLE
:
9252 FETCH_DATA (ins
->info
, ins
->codep
+ 3);
9253 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9255 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
9256 switch ((*ins
->codep
& 0x1f))
9262 vex_table_index
= XOP_08
;
9265 vex_table_index
= XOP_09
;
9268 vex_table_index
= XOP_0A
;
9272 ins
->vex
.w
= *ins
->codep
& 0x80;
9273 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9276 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9277 if (ins
->address_mode
!= mode_64bit
)
9279 /* In 16/32-bit mode REX_B is silently ignored. */
9283 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9284 switch ((*ins
->codep
& 0x3))
9289 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9292 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9295 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9298 ins
->need_vex
= true;
9300 vindex
= *ins
->codep
++;
9301 dp
= &xop_table
[vex_table_index
][vindex
];
9303 ins
->end_codep
= ins
->codep
;
9304 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9305 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9306 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9307 ins
->modrm
.rm
= *ins
->codep
& 7;
9309 /* No XOP encoding so far allows for a non-zero embedded prefix. Avoid
9310 having to decode the bits for every otherwise valid encoding. */
9311 if (ins
->vex
.prefix
)
9315 case USE_VEX_C4_TABLE
:
9317 FETCH_DATA (ins
->info
, ins
->codep
+ 3);
9318 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9319 switch ((*ins
->codep
& 0x1f))
9325 vex_table_index
= VEX_0F
;
9328 vex_table_index
= VEX_0F38
;
9331 vex_table_index
= VEX_0F3A
;
9335 ins
->vex
.w
= *ins
->codep
& 0x80;
9336 if (ins
->address_mode
== mode_64bit
)
9343 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
9344 is ignored, other REX bits are 0 and the highest bit in
9345 VEX.vvvv is also ignored (but we mustn't clear it here). */
9348 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9349 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9350 switch ((*ins
->codep
& 0x3))
9355 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9358 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9361 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9364 ins
->need_vex
= true;
9366 vindex
= *ins
->codep
++;
9367 dp
= &vex_table
[vex_table_index
][vindex
];
9368 ins
->end_codep
= ins
->codep
;
9369 /* There is no MODRM byte for VEX0F 77. */
9370 if (vex_table_index
!= VEX_0F
|| vindex
!= 0x77)
9372 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9373 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9374 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9375 ins
->modrm
.rm
= *ins
->codep
& 7;
9379 case USE_VEX_C5_TABLE
:
9381 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
9382 ins
->rex
= (*ins
->codep
& 0x80) ? 0 : REX_R
;
9384 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
9386 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9387 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9388 switch ((*ins
->codep
& 0x3))
9393 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9396 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9399 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9402 ins
->need_vex
= true;
9404 vindex
= *ins
->codep
++;
9405 dp
= &vex_table
[dp
->op
[1].bytemode
][vindex
];
9406 ins
->end_codep
= ins
->codep
;
9407 /* There is no MODRM byte for VEX 77. */
9410 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9411 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9412 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9413 ins
->modrm
.rm
= *ins
->codep
& 7;
9417 case USE_VEX_W_TABLE
:
9421 dp
= &vex_w_table
[dp
->op
[1].bytemode
][ins
->vex
.w
];
9424 case USE_EVEX_TABLE
:
9425 ins
->two_source_ops
= false;
9427 ins
->vex
.evex
= true;
9428 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
9429 /* The first byte after 0x62. */
9430 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9431 ins
->vex
.r
= *ins
->codep
& 0x10;
9432 switch ((*ins
->codep
& 0xf))
9437 vex_table_index
= EVEX_0F
;
9440 vex_table_index
= EVEX_0F38
;
9443 vex_table_index
= EVEX_0F3A
;
9446 vex_table_index
= EVEX_MAP5
;
9449 vex_table_index
= EVEX_MAP6
;
9453 /* The second byte after 0x62. */
9455 ins
->vex
.w
= *ins
->codep
& 0x80;
9456 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9459 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9462 if (!(*ins
->codep
& 0x4))
9465 switch ((*ins
->codep
& 0x3))
9470 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9473 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9476 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9480 /* The third byte after 0x62. */
9483 /* Remember the static rounding bits. */
9484 ins
->vex
.ll
= (*ins
->codep
>> 5) & 3;
9485 ins
->vex
.b
= *ins
->codep
& 0x10;
9487 ins
->vex
.v
= *ins
->codep
& 0x8;
9488 ins
->vex
.mask_register_specifier
= *ins
->codep
& 0x7;
9489 ins
->vex
.zeroing
= *ins
->codep
& 0x80;
9491 if (ins
->address_mode
!= mode_64bit
)
9493 /* In 16/32-bit mode silently ignore following bits. */
9498 ins
->need_vex
= true;
9500 vindex
= *ins
->codep
++;
9501 dp
= &evex_table
[vex_table_index
][vindex
];
9502 ins
->end_codep
= ins
->codep
;
9503 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9504 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9505 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9506 ins
->modrm
.rm
= *ins
->codep
& 7;
9508 /* Set vector length. */
9509 if (ins
->modrm
.mod
== 3 && ins
->vex
.b
)
9510 ins
->vex
.length
= 512;
9513 switch (ins
->vex
.ll
)
9516 ins
->vex
.length
= 128;
9519 ins
->vex
.length
= 256;
9522 ins
->vex
.length
= 512;
9538 if (dp
->name
!= NULL
)
9541 return get_valid_dis386 (dp
, ins
);
9545 get_sib (instr_info
*ins
, int sizeflag
)
9547 /* If modrm.mod == 3, operand must be register. */
9549 && ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
9550 && ins
->modrm
.mod
!= 3
9551 && ins
->modrm
.rm
== 4)
9553 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
9554 ins
->sib
.index
= (ins
->codep
[1] >> 3) & 7;
9555 ins
->sib
.scale
= (ins
->codep
[1] >> 6) & 3;
9556 ins
->sib
.base
= ins
->codep
[1] & 7;
9557 ins
->has_sib
= true;
9560 ins
->has_sib
= false;
9563 /* Like oappend (below), but S is a string starting with '%'. In
9564 Intel syntax, the '%' is elided. */
9567 oappend_register (instr_info
*ins
, const char *s
)
9569 oappend_with_style (ins
, s
+ ins
->intel_syntax
, dis_style_register
);
9572 /* Wrap around a call to INS->info->fprintf_styled_func, printing FMT.
9573 STYLE is the default style to use in the fprintf_styled_func calls,
9574 however, FMT might include embedded style markers (see oappend_style),
9575 these embedded markers are not printed, but instead change the style
9576 used in the next fprintf_styled_func call. */
9578 static void ATTRIBUTE_PRINTF_3
9579 i386_dis_printf (instr_info
*ins
, enum disassembler_style style
,
9580 const char *fmt
, ...)
9583 enum disassembler_style curr_style
= style
;
9584 const char *start
, *curr
;
9585 char staging_area
[40];
9588 /* In particular print_insn()'s processing of op_txt[] can hand rather long
9589 strings here. Bypass vsnprintf() in such cases to avoid capacity issues
9590 with the staging area. */
9591 if (strcmp (fmt
, "%s"))
9593 int res
= vsnprintf (staging_area
, sizeof (staging_area
), fmt
, ap
);
9600 if ((size_t) res
>= sizeof (staging_area
))
9603 start
= curr
= staging_area
;
9607 start
= curr
= va_arg (ap
, const char *);
9614 || (*curr
== STYLE_MARKER_CHAR
9615 && ISXDIGIT (*(curr
+ 1))
9616 && *(curr
+ 2) == STYLE_MARKER_CHAR
))
9618 /* Output content between our START position and CURR. */
9619 int len
= curr
- start
;
9620 int n
= (*ins
->info
->fprintf_styled_func
) (ins
->info
->stream
,
9622 "%.*s", len
, start
);
9629 /* Skip over the initial STYLE_MARKER_CHAR. */
9632 /* Update the CURR_STYLE. As there are less than 16 styles, it
9633 is possible, that if the input is corrupted in some way, that
9634 we might set CURR_STYLE to an invalid value. Don't worry
9635 though, we check for this situation. */
9636 if (*curr
>= '0' && *curr
<= '9')
9637 curr_style
= (enum disassembler_style
) (*curr
- '0');
9638 else if (*curr
>= 'a' && *curr
<= 'f')
9639 curr_style
= (enum disassembler_style
) (*curr
- 'a' + 10);
9641 curr_style
= dis_style_text
;
9643 /* Check for an invalid style having been selected. This should
9644 never happen, but it doesn't hurt to be a little paranoid. */
9645 if (curr_style
> dis_style_comment_start
)
9646 curr_style
= dis_style_text
;
9648 /* Skip the hex character, and the closing STYLE_MARKER_CHAR. */
9651 /* Reset the START to after the style marker. */
9661 print_insn (bfd_vma pc
, disassemble_info
*info
, int intel_syntax
)
9663 const struct dis386
*dp
;
9665 char *op_txt
[MAX_OPERANDS
];
9667 bool intel_swap_2_3
;
9668 int sizeflag
, orig_sizeflag
;
9670 struct dis_private priv
;
9675 .intel_syntax
= intel_syntax
>= 0
9677 : (info
->mach
& bfd_mach_i386_intel_syntax
) != 0,
9678 .intel_mnemonic
= !SYSV386_COMPAT
,
9679 .op_index
[0 ... MAX_OPERANDS
- 1] = -1,
9681 .start_codep
= priv
.the_buffer
,
9682 .codep
= priv
.the_buffer
,
9684 .last_lock_prefix
= -1,
9685 .last_repz_prefix
= -1,
9686 .last_repnz_prefix
= -1,
9687 .last_data_prefix
= -1,
9688 .last_addr_prefix
= -1,
9689 .last_rex_prefix
= -1,
9690 .last_seg_prefix
= -1,
9693 char op_out
[MAX_OPERANDS
][MAX_OPERAND_BUFFER_SIZE
];
9695 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
9696 if ((info
->mach
& bfd_mach_i386_i386
) != 0)
9697 ins
.address_mode
= mode_32bit
;
9698 else if (info
->mach
== bfd_mach_i386_i8086
)
9700 ins
.address_mode
= mode_16bit
;
9701 priv
.orig_sizeflag
= 0;
9704 ins
.address_mode
= mode_64bit
;
9706 for (p
= info
->disassembler_options
; p
!= NULL
;)
9708 if (startswith (p
, "amd64"))
9710 else if (startswith (p
, "intel64"))
9711 ins
.isa64
= intel64
;
9712 else if (startswith (p
, "x86-64"))
9714 ins
.address_mode
= mode_64bit
;
9715 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9717 else if (startswith (p
, "i386"))
9719 ins
.address_mode
= mode_32bit
;
9720 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9722 else if (startswith (p
, "i8086"))
9724 ins
.address_mode
= mode_16bit
;
9725 priv
.orig_sizeflag
&= ~(AFLAG
| DFLAG
);
9727 else if (startswith (p
, "intel"))
9729 ins
.intel_syntax
= 1;
9730 if (startswith (p
+ 5, "-mnemonic"))
9731 ins
.intel_mnemonic
= true;
9733 else if (startswith (p
, "att"))
9735 ins
.intel_syntax
= 0;
9736 if (startswith (p
+ 3, "-mnemonic"))
9737 ins
.intel_mnemonic
= false;
9739 else if (startswith (p
, "addr"))
9741 if (ins
.address_mode
== mode_64bit
)
9743 if (p
[4] == '3' && p
[5] == '2')
9744 priv
.orig_sizeflag
&= ~AFLAG
;
9745 else if (p
[4] == '6' && p
[5] == '4')
9746 priv
.orig_sizeflag
|= AFLAG
;
9750 if (p
[4] == '1' && p
[5] == '6')
9751 priv
.orig_sizeflag
&= ~AFLAG
;
9752 else if (p
[4] == '3' && p
[5] == '2')
9753 priv
.orig_sizeflag
|= AFLAG
;
9756 else if (startswith (p
, "data"))
9758 if (p
[4] == '1' && p
[5] == '6')
9759 priv
.orig_sizeflag
&= ~DFLAG
;
9760 else if (p
[4] == '3' && p
[5] == '2')
9761 priv
.orig_sizeflag
|= DFLAG
;
9763 else if (startswith (p
, "suffix"))
9764 priv
.orig_sizeflag
|= SUFFIX_ALWAYS
;
9766 p
= strchr (p
, ',');
9771 if (ins
.address_mode
== mode_64bit
&& sizeof (bfd_vma
) < 8)
9773 i386_dis_printf (&ins
, dis_style_text
, _("64-bit address is disabled"));
9777 if (ins
.intel_syntax
)
9779 ins
.open_char
= '[';
9780 ins
.close_char
= ']';
9781 ins
.separator_char
= '+';
9782 ins
.scale_char
= '*';
9786 ins
.open_char
= '(';
9787 ins
.close_char
= ')';
9788 ins
.separator_char
= ',';
9789 ins
.scale_char
= ',';
9792 /* The output looks better if we put 7 bytes on a line, since that
9793 puts most long word instructions on a single line. */
9794 info
->bytes_per_line
= 7;
9796 info
->private_data
= &priv
;
9797 priv
.max_fetched
= priv
.the_buffer
;
9798 priv
.insn_start
= pc
;
9800 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9803 ins
.op_out
[i
] = op_out
[i
];
9806 if (OPCODES_SIGSETJMP (priv
.bailout
) != 0)
9808 /* Getting here means we tried for data but didn't get it. That
9809 means we have an incomplete instruction of some sort. Just
9810 print the first byte as a prefix or a .byte pseudo-op. */
9811 if (ins
.codep
> priv
.the_buffer
)
9813 const char *name
= NULL
;
9815 if (ins
.prefixes
|| ins
.fwait_prefix
>= 0 || (ins
.rex
& REX_OPCODE
))
9816 name
= prefix_name (&ins
, priv
.the_buffer
[0], priv
.orig_sizeflag
);
9818 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s", name
);
9821 /* Just print the first byte as a .byte instruction. */
9822 i386_dis_printf (&ins
, dis_style_assembler_directive
,
9824 i386_dis_printf (&ins
, dis_style_immediate
, "0x%x",
9825 (unsigned int) priv
.the_buffer
[0]);
9834 sizeflag
= priv
.orig_sizeflag
;
9836 if (!ckprefix (&ins
) || ins
.rex_used
)
9838 /* Too many prefixes or unused REX prefixes. */
9840 i
< (int) ARRAY_SIZE (ins
.all_prefixes
) && ins
.all_prefixes
[i
];
9842 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s%s",
9843 (i
== 0 ? "" : " "),
9844 prefix_name (&ins
, ins
.all_prefixes
[i
], sizeflag
));
9848 ins
.insn_codep
= ins
.codep
;
9850 FETCH_DATA (info
, ins
.codep
+ 1);
9851 ins
.two_source_ops
= (*ins
.codep
== 0x62) || (*ins
.codep
== 0xc8);
9853 if (((ins
.prefixes
& PREFIX_FWAIT
)
9854 && ((*ins
.codep
< 0xd8) || (*ins
.codep
> 0xdf))))
9856 /* Handle ins.prefixes before fwait. */
9857 for (i
= 0; i
< ins
.fwait_prefix
&& ins
.all_prefixes
[i
];
9859 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s ",
9860 prefix_name (&ins
, ins
.all_prefixes
[i
], sizeflag
));
9861 i386_dis_printf (&ins
, dis_style_mnemonic
, "fwait");
9865 if (*ins
.codep
== 0x0f)
9867 unsigned char threebyte
;
9870 FETCH_DATA (info
, ins
.codep
+ 1);
9871 threebyte
= *ins
.codep
;
9872 dp
= &dis386_twobyte
[threebyte
];
9873 ins
.need_modrm
= twobyte_has_modrm
[threebyte
];
9878 dp
= &dis386
[*ins
.codep
];
9879 ins
.need_modrm
= onebyte_has_modrm
[*ins
.codep
];
9883 /* Save sizeflag for printing the extra ins.prefixes later before updating
9884 it for mnemonic and operand processing. The prefix names depend
9885 only on the address mode. */
9886 orig_sizeflag
= sizeflag
;
9887 if (ins
.prefixes
& PREFIX_ADDR
)
9889 if ((ins
.prefixes
& PREFIX_DATA
))
9892 ins
.end_codep
= ins
.codep
;
9895 FETCH_DATA (info
, ins
.codep
+ 1);
9896 ins
.modrm
.mod
= (*ins
.codep
>> 6) & 3;
9897 ins
.modrm
.reg
= (*ins
.codep
>> 3) & 7;
9898 ins
.modrm
.rm
= *ins
.codep
& 7;
9901 if (dp
->name
== NULL
&& dp
->op
[0].bytemode
== FLOATCODE
)
9903 get_sib (&ins
, sizeflag
);
9904 dofloat (&ins
, sizeflag
);
9908 dp
= get_valid_dis386 (dp
, &ins
);
9909 if (dp
!= NULL
&& putop (&ins
, dp
->name
, sizeflag
) == 0)
9911 get_sib (&ins
, sizeflag
);
9912 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9914 ins
.obufp
= ins
.op_out
[i
];
9915 ins
.op_ad
= MAX_OPERANDS
- 1 - i
;
9917 (*dp
->op
[i
].rtn
) (&ins
, dp
->op
[i
].bytemode
, sizeflag
);
9918 /* For EVEX instruction after the last operand masking
9919 should be printed. */
9920 if (i
== 0 && ins
.vex
.evex
)
9922 /* Don't print {%k0}. */
9923 if (ins
.vex
.mask_register_specifier
)
9925 const char *reg_name
9926 = att_names_mask
[ins
.vex
.mask_register_specifier
];
9928 oappend (&ins
, "{");
9929 oappend_register (&ins
, reg_name
);
9930 oappend (&ins
, "}");
9932 if (ins
.vex
.zeroing
)
9933 oappend (&ins
, "{z}");
9935 /* S/G insns require a mask and don't allow
9937 if ((dp
->op
[0].bytemode
== vex_vsib_d_w_dq_mode
9938 || dp
->op
[0].bytemode
== vex_vsib_q_w_dq_mode
)
9939 && (ins
.vex
.mask_register_specifier
== 0
9940 || ins
.vex
.zeroing
))
9941 oappend (&ins
, "/(bad)");
9945 /* Check whether rounding control was enabled for an insn not
9947 if (ins
.modrm
.mod
== 3 && ins
.vex
.b
9948 && !(ins
.evex_used
& EVEX_b_used
))
9950 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9952 ins
.obufp
= ins
.op_out
[i
];
9955 oappend (&ins
, names_rounding
[ins
.vex
.ll
]);
9956 oappend (&ins
, "bad}");
9963 /* Clear instruction information. */
9964 info
->insn_info_valid
= 0;
9965 info
->branch_delay_insns
= 0;
9966 info
->data_size
= 0;
9967 info
->insn_type
= dis_noninsn
;
9971 /* Reset jump operation indicator. */
9972 ins
.op_is_jump
= false;
9974 int jump_detection
= 0;
9976 /* Extract flags. */
9977 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9979 if ((dp
->op
[i
].rtn
== OP_J
)
9980 || (dp
->op
[i
].rtn
== OP_indirE
))
9981 jump_detection
|= 1;
9982 else if ((dp
->op
[i
].rtn
== BND_Fixup
)
9983 || (!dp
->op
[i
].rtn
&& !dp
->op
[i
].bytemode
))
9984 jump_detection
|= 2;
9985 else if ((dp
->op
[i
].bytemode
== cond_jump_mode
)
9986 || (dp
->op
[i
].bytemode
== loop_jcxz_mode
))
9987 jump_detection
|= 4;
9990 /* Determine if this is a jump or branch. */
9991 if ((jump_detection
& 0x3) == 0x3)
9993 ins
.op_is_jump
= true;
9994 if (jump_detection
& 0x4)
9995 info
->insn_type
= dis_condbranch
;
9997 info
->insn_type
= (dp
->name
&& !strncmp (dp
->name
, "call", 4))
9998 ? dis_jsr
: dis_branch
;
10002 /* If VEX.vvvv and EVEX.vvvv are unused, they must be all 1s, which
10003 are all 0s in inverted form. */
10004 if (ins
.need_vex
&& ins
.vex
.register_specifier
!= 0)
10006 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10007 return ins
.end_codep
- priv
.the_buffer
;
10010 /* If EVEX.z is set, there must be an actual mask register in use. */
10011 if (ins
.vex
.zeroing
&& ins
.vex
.mask_register_specifier
== 0)
10013 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10014 return ins
.end_codep
- priv
.the_buffer
;
10017 switch (dp
->prefix_requirement
)
10020 /* If only the data prefix is marked as mandatory, its absence renders
10021 the encoding invalid. Most other PREFIX_OPCODE rules still apply. */
10022 if (ins
.need_vex
? !ins
.vex
.prefix
: !(ins
.prefixes
& PREFIX_DATA
))
10024 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10025 return ins
.end_codep
- priv
.the_buffer
;
10027 ins
.used_prefixes
|= PREFIX_DATA
;
10028 /* Fall through. */
10029 case PREFIX_OPCODE
:
10030 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
10031 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
10032 used by putop and MMX/SSE operand and may be overridden by the
10033 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
10036 ? ins
.vex
.prefix
== REPE_PREFIX_OPCODE
10037 || ins
.vex
.prefix
== REPNE_PREFIX_OPCODE
10039 & (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
10040 && (ins
.used_prefixes
10041 & (PREFIX_REPZ
| PREFIX_REPNZ
)) == 0)
10043 ? ins
.vex
.prefix
== DATA_PREFIX_OPCODE
10045 & (PREFIX_REPZ
| PREFIX_REPNZ
| PREFIX_DATA
))
10047 && (ins
.used_prefixes
& PREFIX_DATA
) == 0))
10048 || (ins
.vex
.evex
&& dp
->prefix_requirement
!= PREFIX_DATA
10049 && !ins
.vex
.w
!= !(ins
.used_prefixes
& PREFIX_DATA
)))
10051 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10052 return ins
.end_codep
- priv
.the_buffer
;
10056 case PREFIX_IGNORED
:
10057 /* Zap data size and rep prefixes from used_prefixes and reinstate their
10058 origins in all_prefixes. */
10059 ins
.used_prefixes
&= ~PREFIX_OPCODE
;
10060 if (ins
.last_data_prefix
>= 0)
10061 ins
.all_prefixes
[ins
.last_data_prefix
] = 0x66;
10062 if (ins
.last_repz_prefix
>= 0)
10063 ins
.all_prefixes
[ins
.last_repz_prefix
] = 0xf3;
10064 if (ins
.last_repnz_prefix
>= 0)
10065 ins
.all_prefixes
[ins
.last_repnz_prefix
] = 0xf2;
10069 /* Check if the REX prefix is used. */
10070 if ((ins
.rex
^ ins
.rex_used
) == 0
10071 && !ins
.need_vex
&& ins
.last_rex_prefix
>= 0)
10072 ins
.all_prefixes
[ins
.last_rex_prefix
] = 0;
10074 /* Check if the SEG prefix is used. */
10075 if ((ins
.prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
| PREFIX_ES
10076 | PREFIX_FS
| PREFIX_GS
)) != 0
10077 && (ins
.used_prefixes
& ins
.active_seg_prefix
) != 0)
10078 ins
.all_prefixes
[ins
.last_seg_prefix
] = 0;
10080 /* Check if the ADDR prefix is used. */
10081 if ((ins
.prefixes
& PREFIX_ADDR
) != 0
10082 && (ins
.used_prefixes
& PREFIX_ADDR
) != 0)
10083 ins
.all_prefixes
[ins
.last_addr_prefix
] = 0;
10085 /* Check if the DATA prefix is used. */
10086 if ((ins
.prefixes
& PREFIX_DATA
) != 0
10087 && (ins
.used_prefixes
& PREFIX_DATA
) != 0
10089 ins
.all_prefixes
[ins
.last_data_prefix
] = 0;
10091 /* Print the extra ins.prefixes. */
10093 for (i
= 0; i
< (int) ARRAY_SIZE (ins
.all_prefixes
); i
++)
10094 if (ins
.all_prefixes
[i
])
10097 name
= prefix_name (&ins
, ins
.all_prefixes
[i
], orig_sizeflag
);
10100 prefix_length
+= strlen (name
) + 1;
10101 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s ", name
);
10104 /* Check maximum code length. */
10105 if ((ins
.codep
- ins
.start_codep
) > MAX_CODE_LENGTH
)
10107 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10108 return MAX_CODE_LENGTH
;
10111 /* Calculate the number of operands this instruction has. */
10113 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10114 if (*ins
.op_out
[i
] != '\0')
10117 /* Calculate the number of spaces to print after the mnemonic. */
10118 ins
.obufp
= ins
.mnemonicendp
;
10121 i
= strlen (ins
.obuf
) + prefix_length
;
10130 /* Print the instruction mnemonic along with any trailing whitespace. */
10131 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s%*s", ins
.obuf
, i
, "");
10133 /* The enter and bound instructions are printed with operands in the same
10134 order as the intel book; everything else is printed in reverse order. */
10135 intel_swap_2_3
= false;
10136 if (ins
.intel_syntax
|| ins
.two_source_ops
)
10138 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10139 op_txt
[i
] = ins
.op_out
[i
];
10141 if (ins
.intel_syntax
&& dp
&& dp
->op
[2].rtn
== OP_Rounding
10142 && dp
->op
[3].rtn
== OP_E
&& dp
->op
[4].rtn
== NULL
)
10144 op_txt
[2] = ins
.op_out
[3];
10145 op_txt
[3] = ins
.op_out
[2];
10146 intel_swap_2_3
= true;
10149 for (i
= 0; i
< (MAX_OPERANDS
>> 1); ++i
)
10153 ins
.op_ad
= ins
.op_index
[i
];
10154 ins
.op_index
[i
] = ins
.op_index
[MAX_OPERANDS
- 1 - i
];
10155 ins
.op_index
[MAX_OPERANDS
- 1 - i
] = ins
.op_ad
;
10156 riprel
= ins
.op_riprel
[i
];
10157 ins
.op_riprel
[i
] = ins
.op_riprel
[MAX_OPERANDS
- 1 - i
];
10158 ins
.op_riprel
[MAX_OPERANDS
- 1 - i
] = riprel
;
10163 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10164 op_txt
[MAX_OPERANDS
- 1 - i
] = ins
.op_out
[i
];
10168 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10171 /* In Intel syntax embedded rounding / SAE are not separate operands.
10172 Instead they're attached to the prior register operand. Simply
10173 suppress emission of the comma to achieve that effect. */
10174 switch (i
& -(ins
.intel_syntax
&& dp
))
10177 if (dp
->op
[2].rtn
== OP_Rounding
&& !intel_swap_2_3
)
10181 if (dp
->op
[3].rtn
== OP_Rounding
|| intel_swap_2_3
)
10186 i386_dis_printf (&ins
, dis_style_text
, ",");
10187 if (ins
.op_index
[i
] != -1 && !ins
.op_riprel
[i
])
10189 bfd_vma target
= (bfd_vma
) ins
.op_address
[ins
.op_index
[i
]];
10191 if (ins
.op_is_jump
)
10193 info
->insn_info_valid
= 1;
10194 info
->branch_delay_insns
= 0;
10195 info
->data_size
= 0;
10196 info
->target
= target
;
10199 (*info
->print_address_func
) (target
, info
);
10202 i386_dis_printf (&ins
, dis_style_text
, "%s", op_txt
[i
]);
10206 for (i
= 0; i
< MAX_OPERANDS
; i
++)
10207 if (ins
.op_index
[i
] != -1 && ins
.op_riprel
[i
])
10209 i386_dis_printf (&ins
, dis_style_comment_start
, " # ");
10210 (*info
->print_address_func
)
10211 ((bfd_vma
)(ins
.start_pc
+ (ins
.codep
- ins
.start_codep
)
10212 + ins
.op_address
[ins
.op_index
[i
]]),
10216 return ins
.codep
- priv
.the_buffer
;
10219 /* Here for backwards compatibility. When gdb stops using
10220 print_insn_i386_att and print_insn_i386_intel these functions can
10221 disappear, and print_insn_i386 be merged into print_insn. */
10223 print_insn_i386_att (bfd_vma pc
, disassemble_info
*info
)
10225 return print_insn (pc
, info
, 0);
10229 print_insn_i386_intel (bfd_vma pc
, disassemble_info
*info
)
10231 return print_insn (pc
, info
, 1);
10235 print_insn_i386 (bfd_vma pc
, disassemble_info
*info
)
10237 return print_insn (pc
, info
, -1);
10240 static const char *float_mem
[] = {
10315 static const unsigned char float_mem_mode
[] = {
10390 #define ST { OP_ST, 0 }
10391 #define STi { OP_STi, 0 }
10393 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
10394 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
10395 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
10396 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
10397 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
10398 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
10399 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
10400 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
10401 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
10403 static const struct dis386 float_reg
[][8] = {
10406 { "fadd", { ST
, STi
}, 0 },
10407 { "fmul", { ST
, STi
}, 0 },
10408 { "fcom", { STi
}, 0 },
10409 { "fcomp", { STi
}, 0 },
10410 { "fsub", { ST
, STi
}, 0 },
10411 { "fsubr", { ST
, STi
}, 0 },
10412 { "fdiv", { ST
, STi
}, 0 },
10413 { "fdivr", { ST
, STi
}, 0 },
10417 { "fld", { STi
}, 0 },
10418 { "fxch", { STi
}, 0 },
10428 { "fcmovb", { ST
, STi
}, 0 },
10429 { "fcmove", { ST
, STi
}, 0 },
10430 { "fcmovbe",{ ST
, STi
}, 0 },
10431 { "fcmovu", { ST
, STi
}, 0 },
10439 { "fcmovnb",{ ST
, STi
}, 0 },
10440 { "fcmovne",{ ST
, STi
}, 0 },
10441 { "fcmovnbe",{ ST
, STi
}, 0 },
10442 { "fcmovnu",{ ST
, STi
}, 0 },
10444 { "fucomi", { ST
, STi
}, 0 },
10445 { "fcomi", { ST
, STi
}, 0 },
10450 { "fadd", { STi
, ST
}, 0 },
10451 { "fmul", { STi
, ST
}, 0 },
10454 { "fsub{!M|r}", { STi
, ST
}, 0 },
10455 { "fsub{M|}", { STi
, ST
}, 0 },
10456 { "fdiv{!M|r}", { STi
, ST
}, 0 },
10457 { "fdiv{M|}", { STi
, ST
}, 0 },
10461 { "ffree", { STi
}, 0 },
10463 { "fst", { STi
}, 0 },
10464 { "fstp", { STi
}, 0 },
10465 { "fucom", { STi
}, 0 },
10466 { "fucomp", { STi
}, 0 },
10472 { "faddp", { STi
, ST
}, 0 },
10473 { "fmulp", { STi
, ST
}, 0 },
10476 { "fsub{!M|r}p", { STi
, ST
}, 0 },
10477 { "fsub{M|}p", { STi
, ST
}, 0 },
10478 { "fdiv{!M|r}p", { STi
, ST
}, 0 },
10479 { "fdiv{M|}p", { STi
, ST
}, 0 },
10483 { "ffreep", { STi
}, 0 },
10488 { "fucomip", { ST
, STi
}, 0 },
10489 { "fcomip", { ST
, STi
}, 0 },
10494 static const char *const fgrps
[][8] = {
10497 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10502 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10507 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
10512 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
10517 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
10522 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
10527 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10532 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
10533 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
10538 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10543 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10548 swap_operand (instr_info
*ins
)
10550 ins
->mnemonicendp
[0] = '.';
10551 ins
->mnemonicendp
[1] = 's';
10552 ins
->mnemonicendp
[2] = '\0';
10553 ins
->mnemonicendp
+= 2;
10557 OP_Skip_MODRM (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10558 int sizeflag ATTRIBUTE_UNUSED
)
10560 /* Skip mod/rm byte. */
10566 dofloat (instr_info
*ins
, int sizeflag
)
10568 const struct dis386
*dp
;
10569 unsigned char floatop
;
10571 floatop
= ins
->codep
[-1];
10573 if (ins
->modrm
.mod
!= 3)
10575 int fp_indx
= (floatop
- 0xd8) * 8 + ins
->modrm
.reg
;
10577 putop (ins
, float_mem
[fp_indx
], sizeflag
);
10578 ins
->obufp
= ins
->op_out
[0];
10580 OP_E (ins
, float_mem_mode
[fp_indx
], sizeflag
);
10583 /* Skip mod/rm byte. */
10587 dp
= &float_reg
[floatop
- 0xd8][ins
->modrm
.reg
];
10588 if (dp
->name
== NULL
)
10590 putop (ins
, fgrps
[dp
->op
[0].bytemode
][ins
->modrm
.rm
], sizeflag
);
10592 /* Instruction fnstsw is only one with strange arg. */
10593 if (floatop
== 0xdf && ins
->codep
[-1] == 0xe0)
10594 strcpy (ins
->op_out
[0], att_names16
[0] + ins
->intel_syntax
);
10598 putop (ins
, dp
->name
, sizeflag
);
10600 ins
->obufp
= ins
->op_out
[0];
10603 (*dp
->op
[0].rtn
) (ins
, dp
->op
[0].bytemode
, sizeflag
);
10605 ins
->obufp
= ins
->op_out
[1];
10608 (*dp
->op
[1].rtn
) (ins
, dp
->op
[1].bytemode
, sizeflag
);
10613 OP_ST (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10614 int sizeflag ATTRIBUTE_UNUSED
)
10616 oappend_register (ins
, "%st");
10620 OP_STi (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10621 int sizeflag ATTRIBUTE_UNUSED
)
10624 int res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%st(%d)", ins
->modrm
.rm
);
10626 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
10628 oappend_register (ins
, scratch
);
10631 /* Capital letters in template are macros. */
10633 putop (instr_info
*ins
, const char *in_template
, int sizeflag
)
10638 unsigned int l
= 0, len
= 0;
10641 for (p
= in_template
; *p
; p
++)
10645 if (l
>= sizeof (last
) || !ISUPPER (*p
))
10653 *ins
->obufp
++ = *p
;
10662 if (ins
->intel_syntax
)
10664 while (*++p
!= '|')
10665 if (*p
== '}' || *p
== '\0')
10671 while (*++p
!= '}')
10681 if (ins
->intel_syntax
)
10683 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10684 || (sizeflag
& SUFFIX_ALWAYS
))
10685 *ins
->obufp
++ = 'b';
10691 if (ins
->intel_syntax
)
10693 if (sizeflag
& SUFFIX_ALWAYS
)
10694 *ins
->obufp
++ = 'b';
10696 else if (l
== 1 && last
[0] == 'L')
10698 if (ins
->address_mode
== mode_64bit
10699 && !(ins
->prefixes
& PREFIX_ADDR
))
10701 *ins
->obufp
++ = 'a';
10702 *ins
->obufp
++ = 'b';
10703 *ins
->obufp
++ = 's';
10712 if (ins
->intel_syntax
&& !alt
)
10714 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10716 if (sizeflag
& DFLAG
)
10717 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10719 *ins
->obufp
++ = ins
->intel_syntax
? 'w' : 's';
10720 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10729 if (!ins
->vex
.evex
|| ins
->vex
.w
)
10730 *ins
->obufp
++ = 'd';
10732 oappend (ins
, "{bad}");
10741 if (ins
->intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
10744 if (ins
->modrm
.mod
== 3)
10746 if (ins
->rex
& REX_W
)
10747 *ins
->obufp
++ = 'q';
10750 if (sizeflag
& DFLAG
)
10751 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10753 *ins
->obufp
++ = 'w';
10754 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10758 *ins
->obufp
++ = 'w';
10766 if (!ins
->vex
.evex
|| ins
->vex
.b
|| ins
->vex
.ll
>= 2
10768 || (ins
->modrm
.mod
== 3 && (ins
->rex
& REX_X
))
10769 || !ins
->vex
.v
|| ins
->vex
.mask_register_specifier
)
10771 /* AVX512 extends a number of V*D insns to also have V*Q variants,
10772 merely distinguished by EVEX.W. Look for a use of the
10773 respective macro. */
10776 const char *pct
= strchr (p
+ 1, '%');
10778 if (pct
!= NULL
&& pct
[1] == 'D' && pct
[2] == 'Q')
10781 *ins
->obufp
++ = '{';
10782 *ins
->obufp
++ = 'e';
10783 *ins
->obufp
++ = 'v';
10784 *ins
->obufp
++ = 'e';
10785 *ins
->obufp
++ = 'x';
10786 *ins
->obufp
++ = '}';
10787 *ins
->obufp
++ = ' ';
10794 /* For jcxz/jecxz */
10795 if (ins
->address_mode
== mode_64bit
)
10797 if (sizeflag
& AFLAG
)
10798 *ins
->obufp
++ = 'r';
10800 *ins
->obufp
++ = 'e';
10803 if (sizeflag
& AFLAG
)
10804 *ins
->obufp
++ = 'e';
10805 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10808 if (ins
->intel_syntax
)
10810 if ((ins
->prefixes
& PREFIX_ADDR
) || (sizeflag
& SUFFIX_ALWAYS
))
10812 if (sizeflag
& AFLAG
)
10813 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10815 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'l' : 'w';
10816 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10820 if (ins
->intel_syntax
|| (ins
->obufp
[-1] != 's'
10821 && !(sizeflag
& SUFFIX_ALWAYS
)))
10823 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
10824 *ins
->obufp
++ = 'l';
10826 *ins
->obufp
++ = 'w';
10827 if (!(ins
->rex
& REX_W
))
10828 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10833 if (ins
->intel_syntax
)
10835 if ((ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_CS
10836 || (ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_DS
)
10838 ins
->used_prefixes
|= ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
);
10839 *ins
->obufp
++ = ',';
10840 *ins
->obufp
++ = 'p';
10842 /* Set active_seg_prefix even if not set in 64-bit mode
10843 because here it is a valid branch hint. */
10844 if (ins
->prefixes
& PREFIX_DS
)
10846 ins
->active_seg_prefix
= PREFIX_DS
;
10847 *ins
->obufp
++ = 't';
10851 ins
->active_seg_prefix
= PREFIX_CS
;
10852 *ins
->obufp
++ = 'n';
10856 else if (l
== 1 && last
[0] == 'X')
10859 *ins
->obufp
++ = 'h';
10861 oappend (ins
, "{bad}");
10868 if (ins
->rex
& REX_W
)
10869 *ins
->obufp
++ = 'q';
10871 *ins
->obufp
++ = 'd';
10876 if (ins
->intel_mnemonic
!= cond
)
10877 *ins
->obufp
++ = 'r';
10880 if ((ins
->prefixes
& PREFIX_FWAIT
) == 0)
10881 *ins
->obufp
++ = 'n';
10883 ins
->used_prefixes
|= PREFIX_FWAIT
;
10887 if (ins
->rex
& REX_W
)
10888 *ins
->obufp
++ = 'o';
10889 else if (ins
->intel_syntax
&& (sizeflag
& DFLAG
))
10890 *ins
->obufp
++ = 'q';
10892 *ins
->obufp
++ = 'd';
10893 if (!(ins
->rex
& REX_W
))
10894 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10897 if (ins
->address_mode
== mode_64bit
10898 && (ins
->isa64
== intel64
|| (ins
->rex
& REX_W
)
10899 || !(ins
->prefixes
& PREFIX_DATA
)))
10901 if (sizeflag
& SUFFIX_ALWAYS
)
10902 *ins
->obufp
++ = 'q';
10905 /* Fall through. */
10909 if ((ins
->modrm
.mod
== 3 || !cond
)
10910 && !(sizeflag
& SUFFIX_ALWAYS
))
10912 /* Fall through. */
10914 if ((!(ins
->rex
& REX_W
) && (ins
->prefixes
& PREFIX_DATA
))
10915 || ((sizeflag
& SUFFIX_ALWAYS
)
10916 && ins
->address_mode
!= mode_64bit
))
10918 *ins
->obufp
++ = (sizeflag
& DFLAG
)
10919 ? ins
->intel_syntax
? 'd' : 'l' : 'w';
10920 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10922 else if (sizeflag
& SUFFIX_ALWAYS
)
10923 *ins
->obufp
++ = 'q';
10925 else if (l
== 1 && last
[0] == 'L')
10927 if ((ins
->prefixes
& PREFIX_DATA
)
10928 || (ins
->rex
& REX_W
)
10929 || (sizeflag
& SUFFIX_ALWAYS
))
10932 if (ins
->rex
& REX_W
)
10933 *ins
->obufp
++ = 'q';
10936 if (sizeflag
& DFLAG
)
10937 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10939 *ins
->obufp
++ = 'w';
10940 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10950 if (ins
->intel_syntax
&& !alt
)
10953 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10954 || (sizeflag
& SUFFIX_ALWAYS
))
10956 if (ins
->rex
& REX_W
)
10957 *ins
->obufp
++ = 'q';
10960 if (sizeflag
& DFLAG
)
10961 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10963 *ins
->obufp
++ = 'w';
10964 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10968 else if (l
== 1 && last
[0] == 'D')
10969 *ins
->obufp
++ = ins
->vex
.w
? 'q' : 'd';
10970 else if (l
== 1 && last
[0] == 'L')
10972 if (cond
? ins
->modrm
.mod
== 3 && !(sizeflag
& SUFFIX_ALWAYS
)
10973 : ins
->address_mode
!= mode_64bit
)
10975 if ((ins
->rex
& REX_W
))
10978 *ins
->obufp
++ = 'q';
10980 else if ((ins
->address_mode
== mode_64bit
&& cond
)
10981 || (sizeflag
& SUFFIX_ALWAYS
))
10982 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10989 if (ins
->rex
& REX_W
)
10990 *ins
->obufp
++ = 'q';
10991 else if (sizeflag
& DFLAG
)
10993 if (ins
->intel_syntax
)
10994 *ins
->obufp
++ = 'd';
10996 *ins
->obufp
++ = 'l';
10999 *ins
->obufp
++ = 'w';
11000 if (ins
->intel_syntax
&& !p
[1]
11001 && ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
)))
11002 *ins
->obufp
++ = 'e';
11003 if (!(ins
->rex
& REX_W
))
11004 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11010 if (ins
->intel_syntax
)
11012 if (sizeflag
& SUFFIX_ALWAYS
)
11014 if (ins
->rex
& REX_W
)
11015 *ins
->obufp
++ = 'q';
11018 if (sizeflag
& DFLAG
)
11019 *ins
->obufp
++ = 'l';
11021 *ins
->obufp
++ = 'w';
11022 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11032 if (ins
->address_mode
== mode_64bit
11033 && !(ins
->prefixes
& PREFIX_ADDR
))
11035 *ins
->obufp
++ = 'a';
11036 *ins
->obufp
++ = 'b';
11037 *ins
->obufp
++ = 's';
11042 if (!ins
->vex
.evex
|| !ins
->vex
.w
)
11043 *ins
->obufp
++ = 's';
11045 oappend (ins
, "{bad}");
11061 *ins
->obufp
++ = '{';
11062 *ins
->obufp
++ = 'v';
11063 *ins
->obufp
++ = 'e';
11064 *ins
->obufp
++ = 'x';
11065 *ins
->obufp
++ = '}';
11066 *ins
->obufp
++ = ' ';
11069 if (!(ins
->rex
& REX_W
))
11071 *ins
->obufp
++ = 'a';
11072 *ins
->obufp
++ = 'b';
11073 *ins
->obufp
++ = 's';
11085 /* operand size flag for cwtl, cbtw */
11087 if (ins
->rex
& REX_W
)
11089 if (ins
->intel_syntax
)
11090 *ins
->obufp
++ = 'd';
11092 *ins
->obufp
++ = 'l';
11094 else if (sizeflag
& DFLAG
)
11095 *ins
->obufp
++ = 'w';
11097 *ins
->obufp
++ = 'b';
11098 if (!(ins
->rex
& REX_W
))
11099 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11103 if (!ins
->need_vex
)
11105 if (last
[0] == 'X')
11106 *ins
->obufp
++ = ins
->vex
.w
? 'd': 's';
11107 else if (last
[0] == 'B')
11108 *ins
->obufp
++ = ins
->vex
.w
? 'w': 'b';
11119 ? ins
->vex
.prefix
== DATA_PREFIX_OPCODE
11120 : ins
->prefixes
& PREFIX_DATA
)
11122 *ins
->obufp
++ = 'd';
11123 ins
->used_prefixes
|= PREFIX_DATA
;
11126 *ins
->obufp
++ = 's';
11129 if (l
== 1 && last
[0] == 'X')
11131 if (!ins
->need_vex
)
11133 if (ins
->intel_syntax
11134 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
11135 && !(sizeflag
& SUFFIX_ALWAYS
)))
11137 switch (ins
->vex
.length
)
11140 *ins
->obufp
++ = 'x';
11143 *ins
->obufp
++ = 'y';
11146 if (!ins
->vex
.evex
)
11157 /* These insns ignore ModR/M.mod: Force it to 3 for OP_E(). */
11158 ins
->modrm
.mod
= 3;
11159 if (!ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
11160 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
11162 else if (l
== 1 && last
[0] == 'X')
11164 if (!ins
->vex
.evex
)
11166 if (ins
->intel_syntax
11167 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
11168 && !(sizeflag
& SUFFIX_ALWAYS
)))
11170 switch (ins
->vex
.length
)
11173 *ins
->obufp
++ = 'x';
11176 *ins
->obufp
++ = 'y';
11179 *ins
->obufp
++ = 'z';
11189 if (ins
->intel_syntax
)
11191 if (ins
->isa64
== intel64
&& (ins
->rex
& REX_W
))
11194 *ins
->obufp
++ = 'q';
11197 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
11199 if (sizeflag
& DFLAG
)
11200 *ins
->obufp
++ = 'l';
11202 *ins
->obufp
++ = 'w';
11203 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11212 ins
->mnemonicendp
= ins
->obufp
;
11216 /* Add a style marker to *INS->obufp that encodes STYLE. This assumes that
11217 the buffer pointed to by INS->obufp has space. A style marker is made
11218 from the STYLE_MARKER_CHAR followed by STYLE converted to a single hex
11219 digit, followed by another STYLE_MARKER_CHAR. This function assumes
11220 that the number of styles is not greater than 16. */
11223 oappend_insert_style (instr_info
*ins
, enum disassembler_style style
)
11225 unsigned num
= (unsigned) style
;
11227 /* We currently assume that STYLE can be encoded as a single hex
11228 character. If more styles are added then this might start to fail,
11229 and we'll need to expand this code. */
11233 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11234 *ins
->obufp
++ = (num
< 10 ? ('0' + num
)
11235 : ((num
< 16) ? ('a' + (num
- 10)) : '0'));
11236 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11238 /* This final null character is not strictly necessary, after inserting a
11239 style marker we should always be inserting some additional content.
11240 However, having the buffer null terminated doesn't cost much, and make
11241 it easier to debug what's going on. Also, if we do ever forget to add
11242 any additional content after this style marker, then the buffer will
11243 still be well formed. */
11244 *ins
->obufp
= '\0';
11248 oappend_with_style (instr_info
*ins
, const char *s
,
11249 enum disassembler_style style
)
11251 oappend_insert_style (ins
, style
);
11252 ins
->obufp
= stpcpy (ins
->obufp
, s
);
11255 /* Like oappend_with_style but always with text style. */
11258 oappend (instr_info
*ins
, const char *s
)
11260 oappend_with_style (ins
, s
, dis_style_text
);
11263 /* Add a single character C to the buffer pointer to by INS->obufp, marking
11264 the style for the character as STYLE. */
11267 oappend_char_with_style (instr_info
*ins
, const char c
,
11268 enum disassembler_style style
)
11270 oappend_insert_style (ins
, style
);
11272 *ins
->obufp
= '\0';
11275 /* Like oappend_char_with_style, but always uses dis_style_text. */
11278 oappend_char (instr_info
*ins
, const char c
)
11280 oappend_char_with_style (ins
, c
, dis_style_text
);
11284 append_seg (instr_info
*ins
)
11286 /* Only print the active segment register. */
11287 if (!ins
->active_seg_prefix
)
11290 ins
->used_prefixes
|= ins
->active_seg_prefix
;
11291 switch (ins
->active_seg_prefix
)
11294 oappend_register (ins
, "%cs");
11297 oappend_register (ins
, "%ds");
11300 oappend_register (ins
, "%ss");
11303 oappend_register (ins
, "%es");
11306 oappend_register (ins
, "%fs");
11309 oappend_register (ins
, "%gs");
11314 oappend_char (ins
, ':');
11318 OP_indirE (instr_info
*ins
, int bytemode
, int sizeflag
)
11320 if (!ins
->intel_syntax
)
11321 oappend (ins
, "*");
11322 OP_E (ins
, bytemode
, sizeflag
);
11326 print_operand_value (instr_info
*ins
, bfd_vma disp
,
11327 enum disassembler_style style
)
11331 if (ins
->address_mode
== mode_64bit
)
11332 sprintf (tmp
, "0x%" PRIx64
, (uint64_t) disp
);
11334 sprintf (tmp
, "0x%x", (unsigned int) disp
);
11335 oappend_with_style (ins
, tmp
, style
);
11338 /* Like oappend, but called for immediate operands. */
11341 oappend_immediate (instr_info
*ins
, bfd_vma imm
)
11343 if (!ins
->intel_syntax
)
11344 oappend_char_with_style (ins
, '$', dis_style_immediate
);
11345 print_operand_value (ins
, imm
, dis_style_immediate
);
11348 /* Put DISP in BUF as signed hex number. */
11351 print_displacement (instr_info
*ins
, bfd_vma disp
)
11353 bfd_signed_vma val
= disp
;
11358 oappend_char_with_style (ins
, '-', dis_style_address_offset
);
11361 /* Check for possible overflow. */
11364 switch (ins
->address_mode
)
11367 oappend_with_style (ins
, "0x8000000000000000",
11368 dis_style_address_offset
);
11371 oappend_with_style (ins
, "0x80000000",
11372 dis_style_address_offset
);
11375 oappend_with_style (ins
, "0x8000",
11376 dis_style_address_offset
);
11383 sprintf (tmp
, "0x%" PRIx64
, (int64_t) val
);
11384 oappend_with_style (ins
, tmp
, dis_style_address_offset
);
11388 intel_operand_size (instr_info
*ins
, int bytemode
, int sizeflag
)
11392 if (!ins
->vex
.no_broadcast
)
11396 case evex_half_bcst_xmmq_mode
:
11398 oappend (ins
, "QWORD BCST ");
11400 oappend (ins
, "DWORD BCST ");
11403 case evex_half_bcst_xmmqh_mode
:
11404 case evex_half_bcst_xmmqdh_mode
:
11405 oappend (ins
, "WORD BCST ");
11408 ins
->vex
.no_broadcast
= true;
11418 oappend (ins
, "BYTE PTR ");
11423 oappend (ins
, "WORD PTR ");
11426 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11428 oappend (ins
, "QWORD PTR ");
11431 /* Fall through. */
11433 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11434 || (ins
->rex
& REX_W
)))
11436 oappend (ins
, "QWORD PTR ");
11439 /* Fall through. */
11444 if (ins
->rex
& REX_W
)
11445 oappend (ins
, "QWORD PTR ");
11446 else if (bytemode
== dq_mode
)
11447 oappend (ins
, "DWORD PTR ");
11450 if (sizeflag
& DFLAG
)
11451 oappend (ins
, "DWORD PTR ");
11453 oappend (ins
, "WORD PTR ");
11454 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11458 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
11459 *ins
->obufp
++ = 'D';
11460 oappend (ins
, "WORD PTR ");
11461 if (!(ins
->rex
& REX_W
))
11462 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11465 if (sizeflag
& DFLAG
)
11466 oappend (ins
, "QWORD PTR ");
11468 oappend (ins
, "DWORD PTR ");
11469 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11472 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11473 oappend (ins
, "WORD PTR ");
11475 oappend (ins
, "DWORD PTR ");
11476 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11480 oappend (ins
, "DWORD PTR ");
11484 oappend (ins
, "QWORD PTR ");
11487 if (ins
->address_mode
== mode_64bit
)
11488 oappend (ins
, "QWORD PTR ");
11490 oappend (ins
, "DWORD PTR ");
11493 if (sizeflag
& DFLAG
)
11494 oappend (ins
, "FWORD PTR ");
11496 oappend (ins
, "DWORD PTR ");
11497 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11500 oappend (ins
, "TBYTE PTR ");
11505 case evex_x_gscat_mode
:
11506 case evex_x_nobcst_mode
:
11510 switch (ins
->vex
.length
)
11513 oappend (ins
, "XMMWORD PTR ");
11516 oappend (ins
, "YMMWORD PTR ");
11519 oappend (ins
, "ZMMWORD PTR ");
11526 oappend (ins
, "XMMWORD PTR ");
11529 oappend (ins
, "XMMWORD PTR ");
11532 oappend (ins
, "YMMWORD PTR ");
11535 case evex_half_bcst_xmmqh_mode
:
11536 case evex_half_bcst_xmmq_mode
:
11537 if (!ins
->need_vex
)
11540 switch (ins
->vex
.length
)
11543 oappend (ins
, "QWORD PTR ");
11546 oappend (ins
, "XMMWORD PTR ");
11549 oappend (ins
, "YMMWORD PTR ");
11556 if (!ins
->need_vex
)
11559 switch (ins
->vex
.length
)
11562 oappend (ins
, "WORD PTR ");
11565 oappend (ins
, "DWORD PTR ");
11568 oappend (ins
, "QWORD PTR ");
11575 case evex_half_bcst_xmmqdh_mode
:
11576 if (!ins
->need_vex
)
11579 switch (ins
->vex
.length
)
11582 oappend (ins
, "DWORD PTR ");
11585 oappend (ins
, "QWORD PTR ");
11588 oappend (ins
, "XMMWORD PTR ");
11595 if (!ins
->need_vex
)
11598 switch (ins
->vex
.length
)
11601 oappend (ins
, "QWORD PTR ");
11604 oappend (ins
, "YMMWORD PTR ");
11607 oappend (ins
, "ZMMWORD PTR ");
11614 oappend (ins
, "OWORD PTR ");
11616 case vex_vsib_d_w_dq_mode
:
11617 case vex_vsib_q_w_dq_mode
:
11618 if (!ins
->need_vex
)
11621 oappend (ins
, "QWORD PTR ");
11623 oappend (ins
, "DWORD PTR ");
11626 if (!ins
->need_vex
|| ins
->vex
.length
!= 128)
11629 oappend (ins
, "DWORD PTR ");
11631 oappend (ins
, "BYTE PTR ");
11634 if (!ins
->need_vex
)
11637 oappend (ins
, "QWORD PTR ");
11639 oappend (ins
, "WORD PTR ");
11649 print_register (instr_info
*ins
, unsigned int reg
, unsigned int rexmask
,
11650 int bytemode
, int sizeflag
)
11652 const char *const *names
;
11654 USED_REX (rexmask
);
11655 if (ins
->rex
& rexmask
)
11665 names
= att_names8rex
;
11667 names
= att_names8
;
11670 names
= att_names16
;
11675 names
= att_names32
;
11678 names
= att_names64
;
11682 names
= ins
->address_mode
== mode_64bit
? att_names64
: att_names32
;
11685 case bnd_swap_mode
:
11688 oappend (ins
, "(bad)");
11691 names
= att_names_bnd
;
11694 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11696 names
= att_names64
;
11699 /* Fall through. */
11701 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11702 || (ins
->rex
& REX_W
)))
11704 names
= att_names64
;
11708 /* Fall through. */
11713 if (ins
->rex
& REX_W
)
11714 names
= att_names64
;
11715 else if (bytemode
!= v_mode
&& bytemode
!= v_swap_mode
)
11716 names
= att_names32
;
11719 if (sizeflag
& DFLAG
)
11720 names
= att_names32
;
11722 names
= att_names16
;
11723 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11727 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11728 names
= att_names16
;
11730 names
= att_names32
;
11731 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11734 names
= (ins
->address_mode
== mode_64bit
11735 ? att_names64
: att_names32
);
11736 if (!(ins
->prefixes
& PREFIX_ADDR
))
11737 names
= (ins
->address_mode
== mode_16bit
11738 ? att_names16
: names
);
11741 /* Remove "addr16/addr32". */
11742 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
11743 names
= (ins
->address_mode
!= mode_32bit
11744 ? att_names32
: att_names16
);
11745 ins
->used_prefixes
|= PREFIX_ADDR
;
11752 oappend (ins
, "(bad)");
11755 names
= att_names_mask
;
11760 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
11763 oappend_register (ins
, names
[reg
]);
11767 OP_E_memory (instr_info
*ins
, int bytemode
, int sizeflag
)
11770 int add
= (ins
->rex
& REX_B
) ? 8 : 0;
11788 if (ins
->address_mode
!= mode_64bit
)
11796 case vex_vsib_d_w_dq_mode
:
11797 case vex_vsib_q_w_dq_mode
:
11798 case evex_x_gscat_mode
:
11799 shift
= ins
->vex
.w
? 3 : 2;
11802 case evex_half_bcst_xmmqh_mode
:
11803 case evex_half_bcst_xmmqdh_mode
:
11806 shift
= ins
->vex
.w
? 2 : 1;
11809 /* Fall through. */
11811 case evex_half_bcst_xmmq_mode
:
11814 shift
= ins
->vex
.w
? 3 : 2;
11817 /* Fall through. */
11822 case evex_x_nobcst_mode
:
11824 switch (ins
->vex
.length
)
11838 /* Make necessary corrections to shift for modes that need it. */
11839 if (bytemode
== xmmq_mode
11840 || bytemode
== evex_half_bcst_xmmqh_mode
11841 || bytemode
== evex_half_bcst_xmmq_mode
11842 || (bytemode
== ymmq_mode
&& ins
->vex
.length
== 128))
11844 else if (bytemode
== xmmqd_mode
11845 || bytemode
== evex_half_bcst_xmmqdh_mode
)
11847 else if (bytemode
== xmmdw_mode
)
11861 shift
= ins
->vex
.w
? 1 : 0;
11871 if (ins
->intel_syntax
)
11872 intel_operand_size (ins
, bytemode
, sizeflag
);
11875 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
11877 /* 32/64 bit address mode */
11885 int addr32flag
= !((sizeflag
& AFLAG
)
11886 || bytemode
== v_bnd_mode
11887 || bytemode
== v_bndmk_mode
11888 || bytemode
== bnd_mode
11889 || bytemode
== bnd_swap_mode
);
11890 bool check_gather
= false;
11891 const char *const *indexes
= NULL
;
11894 base
= ins
->modrm
.rm
;
11898 vindex
= ins
->sib
.index
;
11900 if (ins
->rex
& REX_X
)
11904 case vex_vsib_d_w_dq_mode
:
11905 case vex_vsib_q_w_dq_mode
:
11906 if (!ins
->need_vex
)
11912 check_gather
= ins
->obufp
== ins
->op_out
[1];
11915 switch (ins
->vex
.length
)
11918 indexes
= att_names_xmm
;
11922 || bytemode
== vex_vsib_q_w_dq_mode
)
11923 indexes
= att_names_ymm
;
11925 indexes
= att_names_xmm
;
11929 || bytemode
== vex_vsib_q_w_dq_mode
)
11930 indexes
= att_names_zmm
;
11932 indexes
= att_names_ymm
;
11940 indexes
= ins
->address_mode
== mode_64bit
&& !addr32flag
11941 ? att_names64
: att_names32
;
11944 scale
= ins
->sib
.scale
;
11945 base
= ins
->sib
.base
;
11950 /* Check for mandatory SIB. */
11951 if (bytemode
== vex_vsib_d_w_dq_mode
11952 || bytemode
== vex_vsib_q_w_dq_mode
11953 || bytemode
== vex_sibmem_mode
)
11955 oappend (ins
, "(bad)");
11959 rbase
= base
+ add
;
11961 switch (ins
->modrm
.mod
)
11967 if (ins
->address_mode
== mode_64bit
&& !ins
->has_sib
)
11969 disp
= get32s (ins
);
11970 if (riprel
&& bytemode
== v_bndmk_mode
)
11972 oappend (ins
, "(bad)");
11978 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
11979 disp
= *ins
->codep
++;
11980 if ((disp
& 0x80) != 0)
11982 if (ins
->vex
.evex
&& shift
> 0)
11986 disp
= get32s (ins
);
11995 && ins
->address_mode
!= mode_16bit
)
11997 if (ins
->address_mode
== mode_64bit
)
12001 /* Without base nor index registers, zero-extend the
12002 lower 32-bit displacement to 64 bits. */
12003 disp
= (unsigned int) disp
;
12010 /* In 32-bit mode, we need index register to tell [offset]
12011 from [eiz*1 + offset]. */
12016 havedisp
= (havebase
12018 || (ins
->has_sib
&& (indexes
|| scale
!= 0)));
12020 if (!ins
->intel_syntax
)
12021 if (ins
->modrm
.mod
!= 0 || base
== 5)
12023 if (havedisp
|| riprel
)
12024 print_displacement (ins
, disp
);
12026 print_operand_value (ins
, disp
, dis_style_address_offset
);
12029 set_op (ins
, disp
, true);
12030 oappend_char (ins
, '(');
12031 oappend_with_style (ins
, !addr32flag
? "%rip" : "%eip",
12032 dis_style_register
);
12033 oappend_char (ins
, ')');
12037 if ((havebase
|| indexes
|| needindex
|| needaddr32
|| riprel
)
12038 && (ins
->address_mode
!= mode_64bit
12039 || ((bytemode
!= v_bnd_mode
)
12040 && (bytemode
!= v_bndmk_mode
)
12041 && (bytemode
!= bnd_mode
)
12042 && (bytemode
!= bnd_swap_mode
))))
12043 ins
->used_prefixes
|= PREFIX_ADDR
;
12045 if (havedisp
|| (ins
->intel_syntax
&& riprel
))
12047 oappend_char (ins
, ins
->open_char
);
12048 if (ins
->intel_syntax
&& riprel
)
12050 set_op (ins
, disp
, true);
12051 oappend_with_style (ins
, !addr32flag
? "rip" : "eip",
12052 dis_style_register
);
12057 (ins
->address_mode
== mode_64bit
&& !addr32flag
12058 ? att_names64
: att_names32
)[rbase
]);
12061 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
12062 print index to tell base + index from base. */
12066 || (havebase
&& base
!= ESP_REG_NUM
))
12068 if (!ins
->intel_syntax
|| havebase
)
12069 oappend_char (ins
, ins
->separator_char
);
12072 if (ins
->address_mode
== mode_64bit
|| vindex
< 16)
12073 oappend_register (ins
, indexes
[vindex
]);
12075 oappend (ins
, "(bad)");
12078 oappend_register (ins
,
12079 ins
->address_mode
== mode_64bit
12084 oappend_char (ins
, ins
->scale_char
);
12085 oappend_char_with_style (ins
, '0' + (1 << scale
),
12086 dis_style_immediate
);
12089 if (ins
->intel_syntax
12090 && (disp
|| ins
->modrm
.mod
!= 0 || base
== 5))
12092 if (!havedisp
|| (bfd_signed_vma
) disp
>= 0)
12093 oappend_char (ins
, '+');
12094 else if (ins
->modrm
.mod
!= 1 && disp
!= -disp
)
12096 oappend_char (ins
, '-');
12101 print_displacement (ins
, disp
);
12103 print_operand_value (ins
, disp
, dis_style_address_offset
);
12106 oappend_char (ins
, ins
->close_char
);
12110 /* Both XMM/YMM/ZMM registers must be distinct. */
12111 int modrm_reg
= ins
->modrm
.reg
;
12113 if (ins
->rex
& REX_R
)
12117 if (vindex
== modrm_reg
)
12118 oappend (ins
, "/(bad)");
12121 else if (ins
->intel_syntax
)
12123 if (ins
->modrm
.mod
!= 0 || base
== 5)
12125 if (!ins
->active_seg_prefix
)
12127 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12128 oappend (ins
, ":");
12130 print_operand_value (ins
, disp
, dis_style_text
);
12134 else if (bytemode
== v_bnd_mode
12135 || bytemode
== v_bndmk_mode
12136 || bytemode
== bnd_mode
12137 || bytemode
== bnd_swap_mode
12138 || bytemode
== vex_vsib_d_w_dq_mode
12139 || bytemode
== vex_vsib_q_w_dq_mode
)
12141 oappend (ins
, "(bad)");
12146 /* 16 bit address mode */
12147 ins
->used_prefixes
|= ins
->prefixes
& PREFIX_ADDR
;
12148 switch (ins
->modrm
.mod
)
12151 if (ins
->modrm
.rm
== 6)
12153 disp
= get16 (ins
);
12154 if ((disp
& 0x8000) != 0)
12159 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12160 disp
= *ins
->codep
++;
12161 if ((disp
& 0x80) != 0)
12163 if (ins
->vex
.evex
&& shift
> 0)
12167 disp
= get16 (ins
);
12168 if ((disp
& 0x8000) != 0)
12173 if (!ins
->intel_syntax
)
12174 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6)
12175 print_displacement (ins
, disp
);
12177 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 6)
12179 oappend_char (ins
, ins
->open_char
);
12180 oappend (ins
, (ins
->intel_syntax
? intel_index16
12181 : att_index16
)[ins
->modrm
.rm
]);
12182 if (ins
->intel_syntax
12183 && (disp
|| ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6))
12185 if ((bfd_signed_vma
) disp
>= 0)
12186 oappend_char (ins
, '+');
12187 else if (ins
->modrm
.mod
!= 1)
12189 oappend_char (ins
, '-');
12193 print_displacement (ins
, disp
);
12196 oappend_char (ins
, ins
->close_char
);
12198 else if (ins
->intel_syntax
)
12200 if (!ins
->active_seg_prefix
)
12202 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12203 oappend (ins
, ":");
12205 print_operand_value (ins
, disp
& 0xffff, dis_style_text
);
12210 ins
->evex_used
|= EVEX_b_used
;
12212 /* Broadcast can only ever be valid for memory sources. */
12213 if (ins
->obufp
== ins
->op_out
[0])
12214 ins
->vex
.no_broadcast
= true;
12216 if (!ins
->vex
.no_broadcast
12217 && (!ins
->intel_syntax
|| !(ins
->evex_used
& EVEX_len_used
)))
12219 if (bytemode
== xh_mode
)
12221 switch (ins
->vex
.length
)
12224 oappend (ins
, "{1to8}");
12227 oappend (ins
, "{1to16}");
12230 oappend (ins
, "{1to32}");
12236 else if (bytemode
== q_mode
12237 || bytemode
== ymmq_mode
)
12238 ins
->vex
.no_broadcast
= true;
12239 else if (ins
->vex
.w
12240 || bytemode
== evex_half_bcst_xmmqdh_mode
12241 || bytemode
== evex_half_bcst_xmmq_mode
)
12243 switch (ins
->vex
.length
)
12246 oappend (ins
, "{1to2}");
12249 oappend (ins
, "{1to4}");
12252 oappend (ins
, "{1to8}");
12258 else if (bytemode
== x_mode
12259 || bytemode
== evex_half_bcst_xmmqh_mode
)
12261 switch (ins
->vex
.length
)
12264 oappend (ins
, "{1to4}");
12267 oappend (ins
, "{1to8}");
12270 oappend (ins
, "{1to16}");
12277 ins
->vex
.no_broadcast
= true;
12279 if (ins
->vex
.no_broadcast
)
12280 oappend (ins
, "{bad}");
12285 OP_E (instr_info
*ins
, int bytemode
, int sizeflag
)
12287 /* Skip mod/rm byte. */
12291 if (ins
->modrm
.mod
== 3)
12293 if ((sizeflag
& SUFFIX_ALWAYS
)
12294 && (bytemode
== b_swap_mode
12295 || bytemode
== bnd_swap_mode
12296 || bytemode
== v_swap_mode
))
12297 swap_operand (ins
);
12299 print_register (ins
, ins
->modrm
.rm
, REX_B
, bytemode
, sizeflag
);
12302 OP_E_memory (ins
, bytemode
, sizeflag
);
12306 OP_G (instr_info
*ins
, int bytemode
, int sizeflag
)
12308 if (ins
->vex
.evex
&& !ins
->vex
.r
&& ins
->address_mode
== mode_64bit
)
12310 oappend (ins
, "(bad)");
12314 print_register (ins
, ins
->modrm
.reg
, REX_R
, bytemode
, sizeflag
);
12319 get64 (instr_info
*ins
)
12325 FETCH_DATA (ins
->info
, ins
->codep
+ 8);
12326 a
= *ins
->codep
++ & 0xff;
12327 a
|= (*ins
->codep
++ & 0xff) << 8;
12328 a
|= (*ins
->codep
++ & 0xff) << 16;
12329 a
|= (*ins
->codep
++ & 0xffu
) << 24;
12330 b
= *ins
->codep
++ & 0xff;
12331 b
|= (*ins
->codep
++ & 0xff) << 8;
12332 b
|= (*ins
->codep
++ & 0xff) << 16;
12333 b
|= (*ins
->codep
++ & 0xffu
) << 24;
12334 x
= a
+ ((bfd_vma
) b
<< 32);
12339 get64 (instr_info
*ins ATTRIBUTE_UNUSED
)
12346 static bfd_signed_vma
12347 get32 (instr_info
*ins
)
12351 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
12352 x
= *ins
->codep
++ & (bfd_vma
) 0xff;
12353 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 8;
12354 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 16;
12355 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 24;
12359 static bfd_signed_vma
12360 get32s (instr_info
*ins
)
12364 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
12365 x
= *ins
->codep
++ & (bfd_vma
) 0xff;
12366 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 8;
12367 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 16;
12368 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 24;
12370 x
= (x
^ ((bfd_vma
) 1 << 31)) - ((bfd_vma
) 1 << 31);
12376 get16 (instr_info
*ins
)
12380 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
12381 x
= *ins
->codep
++ & 0xff;
12382 x
|= (*ins
->codep
++ & 0xff) << 8;
12387 set_op (instr_info
*ins
, bfd_vma op
, bool riprel
)
12389 ins
->op_index
[ins
->op_ad
] = ins
->op_ad
;
12390 if (ins
->address_mode
== mode_64bit
)
12391 ins
->op_address
[ins
->op_ad
] = op
;
12392 else /* Mask to get a 32-bit address. */
12393 ins
->op_address
[ins
->op_ad
] = op
& 0xffffffff;
12394 ins
->op_riprel
[ins
->op_ad
] = riprel
;
12398 OP_REG (instr_info
*ins
, int code
, int sizeflag
)
12405 case es_reg
: case ss_reg
: case cs_reg
:
12406 case ds_reg
: case fs_reg
: case gs_reg
:
12407 oappend_register (ins
, att_names_seg
[code
- es_reg
]);
12412 if (ins
->rex
& REX_B
)
12419 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
12420 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
12421 s
= att_names16
[code
- ax_reg
+ add
];
12423 case ah_reg
: case ch_reg
: case dh_reg
: case bh_reg
:
12425 /* Fall through. */
12426 case al_reg
: case cl_reg
: case dl_reg
: case bl_reg
:
12428 s
= att_names8rex
[code
- al_reg
+ add
];
12430 s
= att_names8
[code
- al_reg
];
12432 case rAX_reg
: case rCX_reg
: case rDX_reg
: case rBX_reg
:
12433 case rSP_reg
: case rBP_reg
: case rSI_reg
: case rDI_reg
:
12434 if (ins
->address_mode
== mode_64bit
12435 && ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12437 s
= att_names64
[code
- rAX_reg
+ add
];
12440 code
+= eAX_reg
- rAX_reg
;
12441 /* Fall through. */
12442 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
12443 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
12445 if (ins
->rex
& REX_W
)
12446 s
= att_names64
[code
- eAX_reg
+ add
];
12449 if (sizeflag
& DFLAG
)
12450 s
= att_names32
[code
- eAX_reg
+ add
];
12452 s
= att_names16
[code
- eAX_reg
+ add
];
12453 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12457 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12460 oappend_register (ins
, s
);
12464 OP_IMREG (instr_info
*ins
, int code
, int sizeflag
)
12471 if (!ins
->intel_syntax
)
12473 oappend (ins
, "(%dx)");
12476 s
= att_names16
[dx_reg
- ax_reg
];
12478 case al_reg
: case cl_reg
:
12479 s
= att_names8
[code
- al_reg
];
12483 if (ins
->rex
& REX_W
)
12488 /* Fall through. */
12489 case z_mode_ax_reg
:
12490 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
12494 if (!(ins
->rex
& REX_W
))
12495 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12498 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12501 oappend_register (ins
, s
);
12505 OP_I (instr_info
*ins
, int bytemode
, int sizeflag
)
12508 bfd_signed_vma mask
= -1;
12513 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12514 op
= *ins
->codep
++;
12519 if (ins
->rex
& REX_W
)
12523 if (sizeflag
& DFLAG
)
12533 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12545 if (ins
->intel_syntax
)
12546 oappend (ins
, "1");
12549 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12554 oappend_immediate (ins
, op
);
12558 OP_I64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12560 if (bytemode
!= v_mode
|| ins
->address_mode
!= mode_64bit
12561 || !(ins
->rex
& REX_W
))
12563 OP_I (ins
, bytemode
, sizeflag
);
12569 oappend_immediate (ins
, get64 (ins
));
12573 OP_sI (instr_info
*ins
, int bytemode
, int sizeflag
)
12581 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12582 op
= *ins
->codep
++;
12583 if ((op
& 0x80) != 0)
12585 if (bytemode
== b_T_mode
)
12587 if (ins
->address_mode
!= mode_64bit
12588 || !((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12590 /* The operand-size prefix is overridden by a REX prefix. */
12591 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12599 if (!(ins
->rex
& REX_W
))
12601 if (sizeflag
& DFLAG
)
12609 /* The operand-size prefix is overridden by a REX prefix. */
12610 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12616 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12620 oappend_immediate (ins
, op
);
12624 OP_J (instr_info
*ins
, int bytemode
, int sizeflag
)
12628 bfd_vma segment
= 0;
12633 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12634 disp
= *ins
->codep
++;
12635 if ((disp
& 0x80) != 0)
12640 if ((sizeflag
& DFLAG
)
12641 || (ins
->address_mode
== mode_64bit
12642 && ((ins
->isa64
== intel64
&& bytemode
!= dqw_mode
)
12643 || (ins
->rex
& REX_W
))))
12644 disp
= get32s (ins
);
12647 disp
= get16 (ins
);
12648 if ((disp
& 0x8000) != 0)
12650 /* In 16bit mode, address is wrapped around at 64k within
12651 the same segment. Otherwise, a data16 prefix on a jump
12652 instruction means that the pc is masked to 16 bits after
12653 the displacement is added! */
12655 if ((ins
->prefixes
& PREFIX_DATA
) == 0)
12656 segment
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
))
12657 & ~((bfd_vma
) 0xffff));
12659 if (ins
->address_mode
!= mode_64bit
12660 || (ins
->isa64
!= intel64
&& !(ins
->rex
& REX_W
)))
12661 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12664 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12667 disp
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
) + disp
) & mask
)
12669 set_op (ins
, disp
, false);
12670 print_operand_value (ins
, disp
, dis_style_text
);
12674 OP_SEG (instr_info
*ins
, int bytemode
, int sizeflag
)
12676 if (bytemode
== w_mode
)
12677 oappend_register (ins
, att_names_seg
[ins
->modrm
.reg
]);
12679 OP_E (ins
, ins
->modrm
.mod
== 3 ? bytemode
: w_mode
, sizeflag
);
12683 OP_DIR (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
, int sizeflag
)
12685 int seg
, offset
, res
;
12688 if (sizeflag
& DFLAG
)
12690 offset
= get32 (ins
);
12695 offset
= get16 (ins
);
12698 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12700 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12701 ins
->intel_syntax
? "0x%x:0x%x" : "$0x%x,$0x%x",
12703 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12705 oappend (ins
, scratch
);
12709 OP_OFF (instr_info
*ins
, int bytemode
, int sizeflag
)
12713 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12714 intel_operand_size (ins
, bytemode
, sizeflag
);
12717 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
12722 if (ins
->intel_syntax
)
12724 if (!ins
->active_seg_prefix
)
12726 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12727 oappend (ins
, ":");
12730 print_operand_value (ins
, off
, dis_style_address_offset
);
12734 OP_OFF64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12738 if (ins
->address_mode
!= mode_64bit
12739 || (ins
->prefixes
& PREFIX_ADDR
))
12741 OP_OFF (ins
, bytemode
, sizeflag
);
12745 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12746 intel_operand_size (ins
, bytemode
, sizeflag
);
12751 if (ins
->intel_syntax
)
12753 if (!ins
->active_seg_prefix
)
12755 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12756 oappend (ins
, ":");
12759 print_operand_value (ins
, off
, dis_style_address_offset
);
12763 ptr_reg (instr_info
*ins
, int code
, int sizeflag
)
12767 *ins
->obufp
++ = ins
->open_char
;
12768 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
12769 if (ins
->address_mode
== mode_64bit
)
12771 if (!(sizeflag
& AFLAG
))
12772 s
= att_names32
[code
- eAX_reg
];
12774 s
= att_names64
[code
- eAX_reg
];
12776 else if (sizeflag
& AFLAG
)
12777 s
= att_names32
[code
- eAX_reg
];
12779 s
= att_names16
[code
- eAX_reg
];
12780 oappend_register (ins
, s
);
12781 oappend_char (ins
, ins
->close_char
);
12785 OP_ESreg (instr_info
*ins
, int code
, int sizeflag
)
12787 if (ins
->intel_syntax
)
12789 switch (ins
->codep
[-1])
12791 case 0x6d: /* insw/insl */
12792 intel_operand_size (ins
, z_mode
, sizeflag
);
12794 case 0xa5: /* movsw/movsl/movsq */
12795 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12796 case 0xab: /* stosw/stosl */
12797 case 0xaf: /* scasw/scasl */
12798 intel_operand_size (ins
, v_mode
, sizeflag
);
12801 intel_operand_size (ins
, b_mode
, sizeflag
);
12804 oappend_register (ins
, "%es");
12805 oappend_char (ins
, ':');
12806 ptr_reg (ins
, code
, sizeflag
);
12810 OP_DSreg (instr_info
*ins
, int code
, int sizeflag
)
12812 if (ins
->intel_syntax
)
12814 switch (ins
->codep
[-1])
12816 case 0x6f: /* outsw/outsl */
12817 intel_operand_size (ins
, z_mode
, sizeflag
);
12819 case 0xa5: /* movsw/movsl/movsq */
12820 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12821 case 0xad: /* lodsw/lodsl/lodsq */
12822 intel_operand_size (ins
, v_mode
, sizeflag
);
12825 intel_operand_size (ins
, b_mode
, sizeflag
);
12828 /* Set ins->active_seg_prefix to PREFIX_DS if it is unset so that the
12829 default segment register DS is printed. */
12830 if (!ins
->active_seg_prefix
)
12831 ins
->active_seg_prefix
= PREFIX_DS
;
12833 ptr_reg (ins
, code
, sizeflag
);
12837 OP_C (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12838 int sizeflag ATTRIBUTE_UNUSED
)
12843 if (ins
->rex
& REX_R
)
12848 else if (ins
->address_mode
!= mode_64bit
&& (ins
->prefixes
& PREFIX_LOCK
))
12850 ins
->all_prefixes
[ins
->last_lock_prefix
] = 0;
12851 ins
->used_prefixes
|= PREFIX_LOCK
;
12856 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%cr%d",
12857 ins
->modrm
.reg
+ add
);
12858 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12860 oappend_register (ins
, scratch
);
12864 OP_D (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12865 int sizeflag ATTRIBUTE_UNUSED
)
12871 if (ins
->rex
& REX_R
)
12875 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12876 ins
->intel_syntax
? "dr%d" : "%%db%d",
12877 ins
->modrm
.reg
+ add
);
12878 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12880 oappend (ins
, scratch
);
12884 OP_T (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12885 int sizeflag ATTRIBUTE_UNUSED
)
12890 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%tr%d", ins
->modrm
.reg
);
12891 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12893 oappend_register (ins
, scratch
);
12897 OP_MMX (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12898 int sizeflag ATTRIBUTE_UNUSED
)
12900 int reg
= ins
->modrm
.reg
;
12901 const char *const *names
;
12903 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12904 if (ins
->prefixes
& PREFIX_DATA
)
12906 names
= att_names_xmm
;
12908 if (ins
->rex
& REX_R
)
12912 names
= att_names_mm
;
12913 oappend_register (ins
, names
[reg
]);
12917 print_vector_reg (instr_info
*ins
, unsigned int reg
, int bytemode
)
12919 const char *const *names
;
12921 if (bytemode
== xmmq_mode
12922 || bytemode
== evex_half_bcst_xmmqh_mode
12923 || bytemode
== evex_half_bcst_xmmq_mode
)
12925 switch (ins
->vex
.length
)
12929 names
= att_names_xmm
;
12932 names
= att_names_ymm
;
12933 ins
->evex_used
|= EVEX_len_used
;
12939 else if (bytemode
== ymm_mode
)
12940 names
= att_names_ymm
;
12941 else if (bytemode
== tmm_mode
)
12945 oappend (ins
, "(bad)");
12948 names
= att_names_tmm
;
12950 else if (ins
->need_vex
12951 && bytemode
!= xmm_mode
12952 && bytemode
!= scalar_mode
12953 && bytemode
!= xmmdw_mode
12954 && bytemode
!= xmmqd_mode
12955 && bytemode
!= evex_half_bcst_xmmqdh_mode
12956 && bytemode
!= w_swap_mode
12957 && bytemode
!= b_mode
12958 && bytemode
!= w_mode
12959 && bytemode
!= d_mode
12960 && bytemode
!= q_mode
)
12962 ins
->evex_used
|= EVEX_len_used
;
12963 switch (ins
->vex
.length
)
12966 names
= att_names_xmm
;
12970 || bytemode
!= vex_vsib_q_w_dq_mode
)
12971 names
= att_names_ymm
;
12973 names
= att_names_xmm
;
12977 || bytemode
!= vex_vsib_q_w_dq_mode
)
12978 names
= att_names_zmm
;
12980 names
= att_names_ymm
;
12987 names
= att_names_xmm
;
12988 oappend_register (ins
, names
[reg
]);
12992 OP_XMM (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
12994 unsigned int reg
= ins
->modrm
.reg
;
12997 if (ins
->rex
& REX_R
)
13005 if (bytemode
== tmm_mode
)
13006 ins
->modrm
.reg
= reg
;
13007 else if (bytemode
== scalar_mode
)
13008 ins
->vex
.no_broadcast
= true;
13010 print_vector_reg (ins
, reg
, bytemode
);
13014 OP_EM (instr_info
*ins
, int bytemode
, int sizeflag
)
13017 const char *const *names
;
13019 if (ins
->modrm
.mod
!= 3)
13021 if (ins
->intel_syntax
13022 && (bytemode
== v_mode
|| bytemode
== v_swap_mode
))
13024 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
13025 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13027 OP_E (ins
, bytemode
, sizeflag
);
13031 if ((sizeflag
& SUFFIX_ALWAYS
) && bytemode
== v_swap_mode
)
13032 swap_operand (ins
);
13034 /* Skip mod/rm byte. */
13037 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13038 reg
= ins
->modrm
.rm
;
13039 if (ins
->prefixes
& PREFIX_DATA
)
13041 names
= att_names_xmm
;
13043 if (ins
->rex
& REX_B
)
13047 names
= att_names_mm
;
13048 oappend_register (ins
, names
[reg
]);
13051 /* cvt* are the only instructions in sse2 which have
13052 both SSE and MMX operands and also have 0x66 prefix
13053 in their opcode. 0x66 was originally used to differentiate
13054 between SSE and MMX instruction(operands). So we have to handle the
13055 cvt* separately using OP_EMC and OP_MXC */
13057 OP_EMC (instr_info
*ins
, int bytemode
, int sizeflag
)
13059 if (ins
->modrm
.mod
!= 3)
13061 if (ins
->intel_syntax
&& bytemode
== v_mode
)
13063 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
13064 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13066 OP_E (ins
, bytemode
, sizeflag
);
13070 /* Skip mod/rm byte. */
13073 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13074 oappend_register (ins
, att_names_mm
[ins
->modrm
.rm
]);
13078 OP_MXC (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13079 int sizeflag ATTRIBUTE_UNUSED
)
13081 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13082 oappend_register (ins
, att_names_mm
[ins
->modrm
.reg
]);
13086 OP_EX (instr_info
*ins
, int bytemode
, int sizeflag
)
13090 /* Skip mod/rm byte. */
13094 if (bytemode
== dq_mode
)
13095 bytemode
= ins
->vex
.w
? q_mode
: d_mode
;
13097 if (ins
->modrm
.mod
!= 3)
13099 OP_E_memory (ins
, bytemode
, sizeflag
);
13103 reg
= ins
->modrm
.rm
;
13105 if (ins
->rex
& REX_B
)
13110 if ((ins
->rex
& REX_X
))
13114 if ((sizeflag
& SUFFIX_ALWAYS
)
13115 && (bytemode
== x_swap_mode
13116 || bytemode
== w_swap_mode
13117 || bytemode
== d_swap_mode
13118 || bytemode
== q_swap_mode
))
13119 swap_operand (ins
);
13121 if (bytemode
== tmm_mode
)
13122 ins
->modrm
.rm
= reg
;
13124 print_vector_reg (ins
, reg
, bytemode
);
13128 OP_MS (instr_info
*ins
, int bytemode
, int sizeflag
)
13130 if (ins
->modrm
.mod
== 3)
13131 OP_EM (ins
, bytemode
, sizeflag
);
13137 OP_XS (instr_info
*ins
, int bytemode
, int sizeflag
)
13139 if (ins
->modrm
.mod
== 3)
13140 OP_EX (ins
, bytemode
, sizeflag
);
13146 OP_M (instr_info
*ins
, int bytemode
, int sizeflag
)
13148 if (ins
->modrm
.mod
== 3)
13149 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
13152 OP_E (ins
, bytemode
, sizeflag
);
13156 OP_0f07 (instr_info
*ins
, int bytemode
, int sizeflag
)
13158 if (ins
->modrm
.mod
!= 3 || ins
->modrm
.rm
!= 0)
13161 OP_E (ins
, bytemode
, sizeflag
);
13164 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
13165 32bit mode and "xchg %rax,%rax" in 64bit mode. */
13168 NOP_Fixup (instr_info
*ins
, int opnd
, int sizeflag
)
13170 if ((ins
->prefixes
& PREFIX_DATA
) == 0 && (ins
->rex
& REX_B
) == 0)
13171 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop");
13172 else if (opnd
== 0)
13173 OP_REG (ins
, eAX_reg
, sizeflag
);
13175 OP_IMREG (ins
, eAX_reg
, sizeflag
);
13178 static const char *const Suffix3DNow
[] = {
13179 /* 00 */ NULL
, NULL
, NULL
, NULL
,
13180 /* 04 */ NULL
, NULL
, NULL
, NULL
,
13181 /* 08 */ NULL
, NULL
, NULL
, NULL
,
13182 /* 0C */ "pi2fw", "pi2fd", NULL
, NULL
,
13183 /* 10 */ NULL
, NULL
, NULL
, NULL
,
13184 /* 14 */ NULL
, NULL
, NULL
, NULL
,
13185 /* 18 */ NULL
, NULL
, NULL
, NULL
,
13186 /* 1C */ "pf2iw", "pf2id", NULL
, NULL
,
13187 /* 20 */ NULL
, NULL
, NULL
, NULL
,
13188 /* 24 */ NULL
, NULL
, NULL
, NULL
,
13189 /* 28 */ NULL
, NULL
, NULL
, NULL
,
13190 /* 2C */ NULL
, NULL
, NULL
, NULL
,
13191 /* 30 */ NULL
, NULL
, NULL
, NULL
,
13192 /* 34 */ NULL
, NULL
, NULL
, NULL
,
13193 /* 38 */ NULL
, NULL
, NULL
, NULL
,
13194 /* 3C */ NULL
, NULL
, NULL
, NULL
,
13195 /* 40 */ NULL
, NULL
, NULL
, NULL
,
13196 /* 44 */ NULL
, NULL
, NULL
, NULL
,
13197 /* 48 */ NULL
, NULL
, NULL
, NULL
,
13198 /* 4C */ NULL
, NULL
, NULL
, NULL
,
13199 /* 50 */ NULL
, NULL
, NULL
, NULL
,
13200 /* 54 */ NULL
, NULL
, NULL
, NULL
,
13201 /* 58 */ NULL
, NULL
, NULL
, NULL
,
13202 /* 5C */ NULL
, NULL
, NULL
, NULL
,
13203 /* 60 */ NULL
, NULL
, NULL
, NULL
,
13204 /* 64 */ NULL
, NULL
, NULL
, NULL
,
13205 /* 68 */ NULL
, NULL
, NULL
, NULL
,
13206 /* 6C */ NULL
, NULL
, NULL
, NULL
,
13207 /* 70 */ NULL
, NULL
, NULL
, NULL
,
13208 /* 74 */ NULL
, NULL
, NULL
, NULL
,
13209 /* 78 */ NULL
, NULL
, NULL
, NULL
,
13210 /* 7C */ NULL
, NULL
, NULL
, NULL
,
13211 /* 80 */ NULL
, NULL
, NULL
, NULL
,
13212 /* 84 */ NULL
, NULL
, NULL
, NULL
,
13213 /* 88 */ NULL
, NULL
, "pfnacc", NULL
,
13214 /* 8C */ NULL
, NULL
, "pfpnacc", NULL
,
13215 /* 90 */ "pfcmpge", NULL
, NULL
, NULL
,
13216 /* 94 */ "pfmin", NULL
, "pfrcp", "pfrsqrt",
13217 /* 98 */ NULL
, NULL
, "pfsub", NULL
,
13218 /* 9C */ NULL
, NULL
, "pfadd", NULL
,
13219 /* A0 */ "pfcmpgt", NULL
, NULL
, NULL
,
13220 /* A4 */ "pfmax", NULL
, "pfrcpit1", "pfrsqit1",
13221 /* A8 */ NULL
, NULL
, "pfsubr", NULL
,
13222 /* AC */ NULL
, NULL
, "pfacc", NULL
,
13223 /* B0 */ "pfcmpeq", NULL
, NULL
, NULL
,
13224 /* B4 */ "pfmul", NULL
, "pfrcpit2", "pmulhrw",
13225 /* B8 */ NULL
, NULL
, NULL
, "pswapd",
13226 /* BC */ NULL
, NULL
, NULL
, "pavgusb",
13227 /* C0 */ NULL
, NULL
, NULL
, NULL
,
13228 /* C4 */ NULL
, NULL
, NULL
, NULL
,
13229 /* C8 */ NULL
, NULL
, NULL
, NULL
,
13230 /* CC */ NULL
, NULL
, NULL
, NULL
,
13231 /* D0 */ NULL
, NULL
, NULL
, NULL
,
13232 /* D4 */ NULL
, NULL
, NULL
, NULL
,
13233 /* D8 */ NULL
, NULL
, NULL
, NULL
,
13234 /* DC */ NULL
, NULL
, NULL
, NULL
,
13235 /* E0 */ NULL
, NULL
, NULL
, NULL
,
13236 /* E4 */ NULL
, NULL
, NULL
, NULL
,
13237 /* E8 */ NULL
, NULL
, NULL
, NULL
,
13238 /* EC */ NULL
, NULL
, NULL
, NULL
,
13239 /* F0 */ NULL
, NULL
, NULL
, NULL
,
13240 /* F4 */ NULL
, NULL
, NULL
, NULL
,
13241 /* F8 */ NULL
, NULL
, NULL
, NULL
,
13242 /* FC */ NULL
, NULL
, NULL
, NULL
,
13246 OP_3DNowSuffix (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13247 int sizeflag ATTRIBUTE_UNUSED
)
13249 const char *mnemonic
;
13251 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13252 /* AMD 3DNow! instructions are specified by an opcode suffix in the
13253 place where an 8-bit immediate would normally go. ie. the last
13254 byte of the instruction. */
13255 ins
->obufp
= ins
->mnemonicendp
;
13256 mnemonic
= Suffix3DNow
[*ins
->codep
++ & 0xff];
13258 ins
->obufp
= stpcpy (ins
->obufp
, mnemonic
);
13261 /* Since a variable sized ins->modrm/ins->sib chunk is between the start
13262 of the opcode (0x0f0f) and the opcode suffix, we need to do
13263 all the ins->modrm processing first, and don't know until now that
13264 we have a bad opcode. This necessitates some cleaning up. */
13265 ins
->op_out
[0][0] = '\0';
13266 ins
->op_out
[1][0] = '\0';
13269 ins
->mnemonicendp
= ins
->obufp
;
13272 static const struct op simd_cmp_op
[] =
13274 { STRING_COMMA_LEN ("eq") },
13275 { STRING_COMMA_LEN ("lt") },
13276 { STRING_COMMA_LEN ("le") },
13277 { STRING_COMMA_LEN ("unord") },
13278 { STRING_COMMA_LEN ("neq") },
13279 { STRING_COMMA_LEN ("nlt") },
13280 { STRING_COMMA_LEN ("nle") },
13281 { STRING_COMMA_LEN ("ord") }
13284 static const struct op vex_cmp_op
[] =
13286 { STRING_COMMA_LEN ("eq_uq") },
13287 { STRING_COMMA_LEN ("nge") },
13288 { STRING_COMMA_LEN ("ngt") },
13289 { STRING_COMMA_LEN ("false") },
13290 { STRING_COMMA_LEN ("neq_oq") },
13291 { STRING_COMMA_LEN ("ge") },
13292 { STRING_COMMA_LEN ("gt") },
13293 { STRING_COMMA_LEN ("true") },
13294 { STRING_COMMA_LEN ("eq_os") },
13295 { STRING_COMMA_LEN ("lt_oq") },
13296 { STRING_COMMA_LEN ("le_oq") },
13297 { STRING_COMMA_LEN ("unord_s") },
13298 { STRING_COMMA_LEN ("neq_us") },
13299 { STRING_COMMA_LEN ("nlt_uq") },
13300 { STRING_COMMA_LEN ("nle_uq") },
13301 { STRING_COMMA_LEN ("ord_s") },
13302 { STRING_COMMA_LEN ("eq_us") },
13303 { STRING_COMMA_LEN ("nge_uq") },
13304 { STRING_COMMA_LEN ("ngt_uq") },
13305 { STRING_COMMA_LEN ("false_os") },
13306 { STRING_COMMA_LEN ("neq_os") },
13307 { STRING_COMMA_LEN ("ge_oq") },
13308 { STRING_COMMA_LEN ("gt_oq") },
13309 { STRING_COMMA_LEN ("true_us") },
13313 CMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13314 int sizeflag ATTRIBUTE_UNUSED
)
13316 unsigned int cmp_type
;
13318 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13319 cmp_type
= *ins
->codep
++ & 0xff;
13320 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
))
13323 char *p
= ins
->mnemonicendp
- 2;
13327 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13328 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13330 else if (ins
->need_vex
13331 && cmp_type
< ARRAY_SIZE (simd_cmp_op
) + ARRAY_SIZE (vex_cmp_op
))
13334 char *p
= ins
->mnemonicendp
- 2;
13338 cmp_type
-= ARRAY_SIZE (simd_cmp_op
);
13339 sprintf (p
, "%s%s", vex_cmp_op
[cmp_type
].name
, suffix
);
13340 ins
->mnemonicendp
+= vex_cmp_op
[cmp_type
].len
;
13344 /* We have a reserved extension byte. Output it directly. */
13345 oappend_immediate (ins
, cmp_type
);
13350 OP_Mwait (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13352 /* mwait %eax,%ecx / mwaitx %eax,%ecx,%ebx */
13353 if (!ins
->intel_syntax
)
13355 strcpy (ins
->op_out
[0], att_names32
[0] + ins
->intel_syntax
);
13356 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13357 if (bytemode
== eBX_reg
)
13358 strcpy (ins
->op_out
[2], att_names32
[3] + ins
->intel_syntax
);
13359 ins
->two_source_ops
= true;
13361 /* Skip mod/rm byte. */
13367 OP_Monitor (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13368 int sizeflag ATTRIBUTE_UNUSED
)
13370 /* monitor %{e,r,}ax,%ecx,%edx" */
13371 if (!ins
->intel_syntax
)
13373 const char *const *names
= (ins
->address_mode
== mode_64bit
13374 ? att_names64
: att_names32
);
13376 if (ins
->prefixes
& PREFIX_ADDR
)
13378 /* Remove "addr16/addr32". */
13379 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
13380 names
= (ins
->address_mode
!= mode_32bit
13381 ? att_names32
: att_names16
);
13382 ins
->used_prefixes
|= PREFIX_ADDR
;
13384 else if (ins
->address_mode
== mode_16bit
)
13385 names
= att_names16
;
13386 strcpy (ins
->op_out
[0], names
[0] + ins
->intel_syntax
);
13387 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13388 strcpy (ins
->op_out
[2], att_names32
[2] + ins
->intel_syntax
);
13389 ins
->two_source_ops
= true;
13391 /* Skip mod/rm byte. */
13397 BadOp (instr_info
*ins
)
13399 /* Throw away prefixes and 1st. opcode byte. */
13400 ins
->codep
= ins
->insn_codep
+ 1;
13401 ins
->obufp
= stpcpy (ins
->obufp
, "(bad)");
13405 REP_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13407 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
13409 if (ins
->prefixes
& PREFIX_REPZ
)
13410 ins
->all_prefixes
[ins
->last_repz_prefix
] = REP_PREFIX
;
13417 OP_IMREG (ins
, bytemode
, sizeflag
);
13420 OP_ESreg (ins
, bytemode
, sizeflag
);
13423 OP_DSreg (ins
, bytemode
, sizeflag
);
13432 SEP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13433 int sizeflag ATTRIBUTE_UNUSED
)
13435 if (ins
->isa64
!= amd64
)
13438 ins
->obufp
= ins
->obuf
;
13440 ins
->mnemonicendp
= ins
->obufp
;
13444 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
13448 BND_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13449 int sizeflag ATTRIBUTE_UNUSED
)
13451 if (ins
->prefixes
& PREFIX_REPNZ
)
13452 ins
->all_prefixes
[ins
->last_repnz_prefix
] = BND_PREFIX
;
13455 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
13459 NOTRACK_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13460 int sizeflag ATTRIBUTE_UNUSED
)
13462 /* Since active_seg_prefix is not set in 64-bit mode, check whether
13463 we've seen a PREFIX_DS. */
13464 if ((ins
->prefixes
& PREFIX_DS
) != 0
13465 && (ins
->address_mode
!= mode_64bit
|| ins
->last_data_prefix
< 0))
13467 /* NOTRACK prefix is only valid on indirect branch instructions.
13468 NB: DATA prefix is unsupported for Intel64. */
13469 ins
->active_seg_prefix
= 0;
13470 ins
->all_prefixes
[ins
->last_seg_prefix
] = NOTRACK_PREFIX
;
13474 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13475 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
13479 HLE_Fixup1 (instr_info
*ins
, int bytemode
, int sizeflag
)
13481 if (ins
->modrm
.mod
!= 3
13482 && (ins
->prefixes
& PREFIX_LOCK
) != 0)
13484 if (ins
->prefixes
& PREFIX_REPZ
)
13485 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13486 if (ins
->prefixes
& PREFIX_REPNZ
)
13487 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13490 OP_E (ins
, bytemode
, sizeflag
);
13493 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13494 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
13498 HLE_Fixup2 (instr_info
*ins
, int bytemode
, int sizeflag
)
13500 if (ins
->modrm
.mod
!= 3)
13502 if (ins
->prefixes
& PREFIX_REPZ
)
13503 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13504 if (ins
->prefixes
& PREFIX_REPNZ
)
13505 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13508 OP_E (ins
, bytemode
, sizeflag
);
13511 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
13512 "xrelease" for memory operand. No check for LOCK prefix. */
13515 HLE_Fixup3 (instr_info
*ins
, int bytemode
, int sizeflag
)
13517 if (ins
->modrm
.mod
!= 3
13518 && ins
->last_repz_prefix
> ins
->last_repnz_prefix
13519 && (ins
->prefixes
& PREFIX_REPZ
) != 0)
13520 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13522 OP_E (ins
, bytemode
, sizeflag
);
13526 CMPXCHG8B_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13529 if (ins
->rex
& REX_W
)
13531 /* Change cmpxchg8b to cmpxchg16b. */
13532 char *p
= ins
->mnemonicendp
- 2;
13533 ins
->mnemonicendp
= stpcpy (p
, "16b");
13536 else if ((ins
->prefixes
& PREFIX_LOCK
) != 0)
13538 if (ins
->prefixes
& PREFIX_REPZ
)
13539 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13540 if (ins
->prefixes
& PREFIX_REPNZ
)
13541 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13544 OP_M (ins
, bytemode
, sizeflag
);
13548 XMM_Fixup (instr_info
*ins
, int reg
, int sizeflag ATTRIBUTE_UNUSED
)
13550 const char *const *names
= att_names_xmm
;
13554 switch (ins
->vex
.length
)
13559 names
= att_names_ymm
;
13565 oappend_register (ins
, names
[reg
]);
13569 FXSAVE_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13571 /* Add proper suffix to "fxsave" and "fxrstor". */
13573 if (ins
->rex
& REX_W
)
13575 char *p
= ins
->mnemonicendp
;
13579 ins
->mnemonicendp
= p
;
13581 OP_M (ins
, bytemode
, sizeflag
);
13584 /* Display the destination register operand for instructions with
13588 OP_VEX (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13590 int reg
, modrm_reg
, sib_index
= -1;
13591 const char *const *names
;
13593 if (!ins
->need_vex
)
13596 reg
= ins
->vex
.register_specifier
;
13597 ins
->vex
.register_specifier
= 0;
13598 if (ins
->address_mode
!= mode_64bit
)
13600 if (ins
->vex
.evex
&& !ins
->vex
.v
)
13602 oappend (ins
, "(bad)");
13608 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13614 oappend_register (ins
, att_names_xmm
[reg
]);
13617 case vex_vsib_d_w_dq_mode
:
13618 case vex_vsib_q_w_dq_mode
:
13619 /* This must be the 3rd operand. */
13620 if (ins
->obufp
!= ins
->op_out
[2])
13622 if (ins
->vex
.length
== 128
13623 || (bytemode
!= vex_vsib_d_w_dq_mode
13625 oappend_register (ins
, att_names_xmm
[reg
]);
13627 oappend_register (ins
, att_names_ymm
[reg
]);
13629 /* All 3 XMM/YMM registers must be distinct. */
13630 modrm_reg
= ins
->modrm
.reg
;
13631 if (ins
->rex
& REX_R
)
13634 if (ins
->has_sib
&& ins
->modrm
.rm
== 4)
13636 sib_index
= ins
->sib
.index
;
13637 if (ins
->rex
& REX_X
)
13641 if (reg
== modrm_reg
|| reg
== sib_index
)
13642 strcpy (ins
->obufp
, "/(bad)");
13643 if (modrm_reg
== sib_index
|| modrm_reg
== reg
)
13644 strcat (ins
->op_out
[0], "/(bad)");
13645 if (sib_index
== modrm_reg
|| sib_index
== reg
)
13646 strcat (ins
->op_out
[1], "/(bad)");
13651 /* All 3 TMM registers must be distinct. */
13653 oappend (ins
, "(bad)");
13656 /* This must be the 3rd operand. */
13657 if (ins
->obufp
!= ins
->op_out
[2])
13659 oappend_register (ins
, att_names_tmm
[reg
]);
13660 if (reg
== ins
->modrm
.reg
|| reg
== ins
->modrm
.rm
)
13661 strcpy (ins
->obufp
, "/(bad)");
13664 if (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
13665 || ins
->modrm
.rm
== reg
)
13667 if (ins
->modrm
.reg
<= 8
13668 && (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
))
13669 strcat (ins
->op_out
[0], "/(bad)");
13670 if (ins
->modrm
.rm
<= 8
13671 && (ins
->modrm
.rm
== ins
->modrm
.reg
|| ins
->modrm
.rm
== reg
))
13672 strcat (ins
->op_out
[1], "/(bad)");
13678 switch (ins
->vex
.length
)
13684 names
= att_names_xmm
;
13685 ins
->evex_used
|= EVEX_len_used
;
13688 if (ins
->rex
& REX_W
)
13689 names
= att_names64
;
13691 names
= att_names32
;
13697 oappend (ins
, "(bad)");
13700 names
= att_names_mask
;
13711 names
= att_names_ymm
;
13712 ins
->evex_used
|= EVEX_len_used
;
13718 oappend (ins
, "(bad)");
13721 names
= att_names_mask
;
13724 /* See PR binutils/20893 for a reproducer. */
13725 oappend (ins
, "(bad)");
13730 names
= att_names_zmm
;
13731 ins
->evex_used
|= EVEX_len_used
;
13737 oappend_register (ins
, names
[reg
]);
13741 OP_VexR (instr_info
*ins
, int bytemode
, int sizeflag
)
13743 if (ins
->modrm
.mod
== 3)
13744 OP_VEX (ins
, bytemode
, sizeflag
);
13748 OP_VexW (instr_info
*ins
, int bytemode
, int sizeflag
)
13750 OP_VEX (ins
, bytemode
, sizeflag
);
13754 /* Swap 2nd and 3rd operands. */
13755 char *tmp
= ins
->op_out
[2];
13757 ins
->op_out
[2] = ins
->op_out
[1];
13758 ins
->op_out
[1] = tmp
;
13763 OP_REG_VexI4 (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13766 const char *const *names
= att_names_xmm
;
13768 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13769 reg
= *ins
->codep
++;
13771 if (bytemode
!= x_mode
&& bytemode
!= scalar_mode
)
13775 if (ins
->address_mode
!= mode_64bit
)
13778 if (bytemode
== x_mode
&& ins
->vex
.length
== 256)
13779 names
= att_names_ymm
;
13781 oappend_register (ins
, names
[reg
]);
13785 /* Swap 3rd and 4th operands. */
13786 char *tmp
= ins
->op_out
[3];
13788 ins
->op_out
[3] = ins
->op_out
[2];
13789 ins
->op_out
[2] = tmp
;
13794 OP_VexI4 (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13795 int sizeflag ATTRIBUTE_UNUSED
)
13797 oappend_immediate (ins
, ins
->codep
[-1] & 0xf);
13801 VPCMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13802 int sizeflag ATTRIBUTE_UNUSED
)
13804 unsigned int cmp_type
;
13806 if (!ins
->vex
.evex
)
13809 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13810 cmp_type
= *ins
->codep
++ & 0xff;
13811 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
13812 If it's the case, print suffix, otherwise - print the immediate. */
13813 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
)
13818 char *p
= ins
->mnemonicendp
- 2;
13820 /* vpcmp* can have both one- and two-lettered suffix. */
13834 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13835 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13839 /* We have a reserved extension byte. Output it directly. */
13840 oappend_immediate (ins
, cmp_type
);
13844 static const struct op xop_cmp_op
[] =
13846 { STRING_COMMA_LEN ("lt") },
13847 { STRING_COMMA_LEN ("le") },
13848 { STRING_COMMA_LEN ("gt") },
13849 { STRING_COMMA_LEN ("ge") },
13850 { STRING_COMMA_LEN ("eq") },
13851 { STRING_COMMA_LEN ("neq") },
13852 { STRING_COMMA_LEN ("false") },
13853 { STRING_COMMA_LEN ("true") }
13857 VPCOM_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13858 int sizeflag ATTRIBUTE_UNUSED
)
13860 unsigned int cmp_type
;
13862 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13863 cmp_type
= *ins
->codep
++ & 0xff;
13864 if (cmp_type
< ARRAY_SIZE (xop_cmp_op
))
13867 char *p
= ins
->mnemonicendp
- 2;
13869 /* vpcom* can have both one- and two-lettered suffix. */
13883 sprintf (p
, "%s%s", xop_cmp_op
[cmp_type
].name
, suffix
);
13884 ins
->mnemonicendp
+= xop_cmp_op
[cmp_type
].len
;
13888 /* We have a reserved extension byte. Output it directly. */
13889 oappend_immediate (ins
, cmp_type
);
13893 static const struct op pclmul_op
[] =
13895 { STRING_COMMA_LEN ("lql") },
13896 { STRING_COMMA_LEN ("hql") },
13897 { STRING_COMMA_LEN ("lqh") },
13898 { STRING_COMMA_LEN ("hqh") }
13902 PCLMUL_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13903 int sizeflag ATTRIBUTE_UNUSED
)
13905 unsigned int pclmul_type
;
13907 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13908 pclmul_type
= *ins
->codep
++ & 0xff;
13909 switch (pclmul_type
)
13920 if (pclmul_type
< ARRAY_SIZE (pclmul_op
))
13923 char *p
= ins
->mnemonicendp
- 3;
13928 sprintf (p
, "%s%s", pclmul_op
[pclmul_type
].name
, suffix
);
13929 ins
->mnemonicendp
+= pclmul_op
[pclmul_type
].len
;
13933 /* We have a reserved extension byte. Output it directly. */
13934 oappend_immediate (ins
, pclmul_type
);
13939 MOVSXD_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13941 /* Add proper suffix to "movsxd". */
13942 char *p
= ins
->mnemonicendp
;
13947 if (!ins
->intel_syntax
)
13950 if (ins
->rex
& REX_W
)
13962 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
13966 ins
->mnemonicendp
= p
;
13968 OP_E (ins
, bytemode
, sizeflag
);
13972 DistinctDest_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13974 unsigned int reg
= ins
->vex
.register_specifier
;
13975 unsigned int modrm_reg
= ins
->modrm
.reg
;
13976 unsigned int modrm_rm
= ins
->modrm
.rm
;
13978 /* Calc destination register number. */
13979 if (ins
->rex
& REX_R
)
13984 /* Calc src1 register number. */
13985 if (ins
->address_mode
!= mode_64bit
)
13987 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13990 /* Calc src2 register number. */
13991 if (ins
->modrm
.mod
== 3)
13993 if (ins
->rex
& REX_B
)
13995 if (ins
->rex
& REX_X
)
13999 /* Destination and source registers must be distinct, output bad if
14000 dest == src1 or dest == src2. */
14001 if (modrm_reg
== reg
14002 || (ins
->modrm
.mod
== 3
14003 && modrm_reg
== modrm_rm
))
14005 oappend (ins
, "(bad)");
14008 OP_XMM (ins
, bytemode
, sizeflag
);
14012 OP_Rounding (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
14014 if (ins
->modrm
.mod
!= 3 || !ins
->vex
.b
)
14019 case evex_rounding_64_mode
:
14020 if (ins
->address_mode
!= mode_64bit
|| !ins
->vex
.w
)
14022 /* Fall through. */
14023 case evex_rounding_mode
:
14024 ins
->evex_used
|= EVEX_b_used
;
14025 oappend (ins
, names_rounding
[ins
->vex
.ll
]);
14027 case evex_sae_mode
:
14028 ins
->evex_used
|= EVEX_b_used
;
14029 oappend (ins
, "{");
14034 oappend (ins
, "sae}");
14038 PREFETCHI_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
14040 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 5)
14042 if (ins
->intel_syntax
)
14044 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop ");
14049 if (ins
->rex
& REX_W
)
14050 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopq ");
14053 if (sizeflag
& DFLAG
)
14054 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopl ");
14056 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopw ");
14057 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
14063 OP_M (ins
, bytemode
, sizeflag
);