1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2022 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
896 MOD_VEX_0F12_PREFIX_0
,
897 MOD_VEX_0F12_PREFIX_2
,
899 MOD_VEX_0F16_PREFIX_0
,
900 MOD_VEX_0F16_PREFIX_2
,
924 MOD_VEX_0FF0_PREFIX_3
,
931 MOD_VEX_0F3849_X86_64_P_0_W_0
,
932 MOD_VEX_0F3849_X86_64_P_2_W_0
,
933 MOD_VEX_0F3849_X86_64_P_3_W_0
,
934 MOD_VEX_0F384B_X86_64_P_1_W_0
,
935 MOD_VEX_0F384B_X86_64_P_2_W_0
,
936 MOD_VEX_0F384B_X86_64_P_3_W_0
,
938 MOD_VEX_0F385C_X86_64_P_1_W_0
,
939 MOD_VEX_0F385C_X86_64_P_3_W_0
,
940 MOD_VEX_0F385E_X86_64_P_0_W_0
,
941 MOD_VEX_0F385E_X86_64_P_1_W_0
,
942 MOD_VEX_0F385E_X86_64_P_2_W_0
,
943 MOD_VEX_0F385E_X86_64_P_3_W_0
,
956 MOD_EVEX_0F382A_P_1_W_1
,
958 MOD_EVEX_0F383A_P_1_W_0
,
978 RM_0F1E_P_1_MOD_3_REG_7
,
979 RM_0FAE_REG_6_MOD_3_P_0
,
981 RM_0F3A0F_P_1_MOD_3_REG_0
,
983 RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0
989 PREFIX_0F01_REG_0_MOD_3_RM_6
,
990 PREFIX_0F01_REG_1_RM_4
,
991 PREFIX_0F01_REG_1_RM_5
,
992 PREFIX_0F01_REG_1_RM_6
,
993 PREFIX_0F01_REG_1_RM_7
,
994 PREFIX_0F01_REG_3_RM_1
,
995 PREFIX_0F01_REG_5_MOD_0
,
996 PREFIX_0F01_REG_5_MOD_3_RM_0
,
997 PREFIX_0F01_REG_5_MOD_3_RM_1
,
998 PREFIX_0F01_REG_5_MOD_3_RM_2
,
999 PREFIX_0F01_REG_5_MOD_3_RM_4
,
1000 PREFIX_0F01_REG_5_MOD_3_RM_5
,
1001 PREFIX_0F01_REG_5_MOD_3_RM_6
,
1002 PREFIX_0F01_REG_5_MOD_3_RM_7
,
1003 PREFIX_0F01_REG_7_MOD_3_RM_2
,
1004 PREFIX_0F01_REG_7_MOD_3_RM_6
,
1005 PREFIX_0F01_REG_7_MOD_3_RM_7
,
1011 PREFIX_0F18_REG_6_MOD_0_X86_64
,
1012 PREFIX_0F18_REG_7_MOD_0_X86_64
,
1045 PREFIX_0FAE_REG_0_MOD_3
,
1046 PREFIX_0FAE_REG_1_MOD_3
,
1047 PREFIX_0FAE_REG_2_MOD_3
,
1048 PREFIX_0FAE_REG_3_MOD_3
,
1049 PREFIX_0FAE_REG_4_MOD_0
,
1050 PREFIX_0FAE_REG_4_MOD_3
,
1051 PREFIX_0FAE_REG_5_MOD_3
,
1052 PREFIX_0FAE_REG_6_MOD_0
,
1053 PREFIX_0FAE_REG_6_MOD_3
,
1054 PREFIX_0FAE_REG_7_MOD_0
,
1059 PREFIX_0FC7_REG_6_MOD_0
,
1060 PREFIX_0FC7_REG_6_MOD_3
,
1061 PREFIX_0FC7_REG_7_MOD_3
,
1089 PREFIX_VEX_0F41_L_1_M_1_W_0
,
1090 PREFIX_VEX_0F41_L_1_M_1_W_1
,
1091 PREFIX_VEX_0F42_L_1_M_1_W_0
,
1092 PREFIX_VEX_0F42_L_1_M_1_W_1
,
1093 PREFIX_VEX_0F44_L_0_M_1_W_0
,
1094 PREFIX_VEX_0F44_L_0_M_1_W_1
,
1095 PREFIX_VEX_0F45_L_1_M_1_W_0
,
1096 PREFIX_VEX_0F45_L_1_M_1_W_1
,
1097 PREFIX_VEX_0F46_L_1_M_1_W_0
,
1098 PREFIX_VEX_0F46_L_1_M_1_W_1
,
1099 PREFIX_VEX_0F47_L_1_M_1_W_0
,
1100 PREFIX_VEX_0F47_L_1_M_1_W_1
,
1101 PREFIX_VEX_0F4A_L_1_M_1_W_0
,
1102 PREFIX_VEX_0F4A_L_1_M_1_W_1
,
1103 PREFIX_VEX_0F4B_L_1_M_1_W_0
,
1104 PREFIX_VEX_0F4B_L_1_M_1_W_1
,
1122 PREFIX_VEX_0F90_L_0_W_0
,
1123 PREFIX_VEX_0F90_L_0_W_1
,
1124 PREFIX_VEX_0F91_L_0_M_0_W_0
,
1125 PREFIX_VEX_0F91_L_0_M_0_W_1
,
1126 PREFIX_VEX_0F92_L_0_M_1_W_0
,
1127 PREFIX_VEX_0F92_L_0_M_1_W_1
,
1128 PREFIX_VEX_0F93_L_0_M_1_W_0
,
1129 PREFIX_VEX_0F93_L_0_M_1_W_1
,
1130 PREFIX_VEX_0F98_L_0_M_1_W_0
,
1131 PREFIX_VEX_0F98_L_0_M_1_W_1
,
1132 PREFIX_VEX_0F99_L_0_M_1_W_0
,
1133 PREFIX_VEX_0F99_L_0_M_1_W_1
,
1138 PREFIX_VEX_0F3849_X86_64
,
1139 PREFIX_VEX_0F384B_X86_64
,
1140 PREFIX_VEX_0F3850_W_0
,
1141 PREFIX_VEX_0F3851_W_0
,
1142 PREFIX_VEX_0F385C_X86_64
,
1143 PREFIX_VEX_0F385E_X86_64
,
1145 PREFIX_VEX_0F38B0_W_0
,
1146 PREFIX_VEX_0F38B1_W_0
,
1147 PREFIX_VEX_0F38F5_L_0
,
1148 PREFIX_VEX_0F38F6_L_0
,
1149 PREFIX_VEX_0F38F7_L_0
,
1150 PREFIX_VEX_0F3AF0_L_0
,
1208 PREFIX_EVEX_MAP5_10
,
1209 PREFIX_EVEX_MAP5_11
,
1210 PREFIX_EVEX_MAP5_1D
,
1211 PREFIX_EVEX_MAP5_2A
,
1212 PREFIX_EVEX_MAP5_2C
,
1213 PREFIX_EVEX_MAP5_2D
,
1214 PREFIX_EVEX_MAP5_2E
,
1215 PREFIX_EVEX_MAP5_2F
,
1216 PREFIX_EVEX_MAP5_51
,
1217 PREFIX_EVEX_MAP5_58
,
1218 PREFIX_EVEX_MAP5_59
,
1219 PREFIX_EVEX_MAP5_5A
,
1220 PREFIX_EVEX_MAP5_5B
,
1221 PREFIX_EVEX_MAP5_5C
,
1222 PREFIX_EVEX_MAP5_5D
,
1223 PREFIX_EVEX_MAP5_5E
,
1224 PREFIX_EVEX_MAP5_5F
,
1225 PREFIX_EVEX_MAP5_78
,
1226 PREFIX_EVEX_MAP5_79
,
1227 PREFIX_EVEX_MAP5_7A
,
1228 PREFIX_EVEX_MAP5_7B
,
1229 PREFIX_EVEX_MAP5_7C
,
1230 PREFIX_EVEX_MAP5_7D
,
1232 PREFIX_EVEX_MAP6_13
,
1233 PREFIX_EVEX_MAP6_56
,
1234 PREFIX_EVEX_MAP6_57
,
1235 PREFIX_EVEX_MAP6_D6
,
1236 PREFIX_EVEX_MAP6_D7
,
1271 X86_64_0F01_REG_0_MOD_3_RM_6_P_1
,
1272 X86_64_0F01_REG_0_MOD_3_RM_6_P_3
,
1274 X86_64_0F01_REG_1_RM_5_PREFIX_2
,
1275 X86_64_0F01_REG_1_RM_6_PREFIX_2
,
1276 X86_64_0F01_REG_1_RM_7_PREFIX_2
,
1279 X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
,
1280 X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
,
1281 X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
,
1282 X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
,
1283 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
,
1284 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
,
1285 X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
,
1286 X86_64_0F18_REG_6_MOD_0
,
1287 X86_64_0F18_REG_7_MOD_0
,
1290 X86_64_0FC7_REG_6_MOD_3_PREFIX_1
,
1316 THREE_BYTE_0F38
= 0,
1345 VEX_LEN_0F12_P_0_M_0
= 0,
1346 VEX_LEN_0F12_P_0_M_1
,
1347 #define VEX_LEN_0F12_P_2_M_0 VEX_LEN_0F12_P_0_M_0
1349 VEX_LEN_0F16_P_0_M_0
,
1350 VEX_LEN_0F16_P_0_M_1
,
1351 #define VEX_LEN_0F16_P_2_M_0 VEX_LEN_0F16_P_0_M_0
1371 VEX_LEN_0FAE_R_2_M_0
,
1372 VEX_LEN_0FAE_R_3_M_0
,
1382 VEX_LEN_0F3849_X86_64_P_0_W_0_M_0
,
1383 VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0
,
1384 VEX_LEN_0F3849_X86_64_P_2_W_0_M_0
,
1385 VEX_LEN_0F3849_X86_64_P_3_W_0_M_0
,
1386 VEX_LEN_0F384B_X86_64_P_1_W_0_M_0
,
1387 VEX_LEN_0F384B_X86_64_P_2_W_0_M_0
,
1388 VEX_LEN_0F384B_X86_64_P_3_W_0_M_0
,
1390 VEX_LEN_0F385C_X86_64_P_1_W_0_M_0
,
1391 VEX_LEN_0F385C_X86_64_P_3_W_0_M_0
,
1392 VEX_LEN_0F385E_X86_64_P_0_W_0_M_0
,
1393 VEX_LEN_0F385E_X86_64_P_1_W_0_M_0
,
1394 VEX_LEN_0F385E_X86_64_P_2_W_0_M_0
,
1395 VEX_LEN_0F385E_X86_64_P_3_W_0_M_0
,
1428 VEX_LEN_0FXOP_08_85
,
1429 VEX_LEN_0FXOP_08_86
,
1430 VEX_LEN_0FXOP_08_87
,
1431 VEX_LEN_0FXOP_08_8E
,
1432 VEX_LEN_0FXOP_08_8F
,
1433 VEX_LEN_0FXOP_08_95
,
1434 VEX_LEN_0FXOP_08_96
,
1435 VEX_LEN_0FXOP_08_97
,
1436 VEX_LEN_0FXOP_08_9E
,
1437 VEX_LEN_0FXOP_08_9F
,
1438 VEX_LEN_0FXOP_08_A3
,
1439 VEX_LEN_0FXOP_08_A6
,
1440 VEX_LEN_0FXOP_08_B6
,
1441 VEX_LEN_0FXOP_08_C0
,
1442 VEX_LEN_0FXOP_08_C1
,
1443 VEX_LEN_0FXOP_08_C2
,
1444 VEX_LEN_0FXOP_08_C3
,
1445 VEX_LEN_0FXOP_08_CC
,
1446 VEX_LEN_0FXOP_08_CD
,
1447 VEX_LEN_0FXOP_08_CE
,
1448 VEX_LEN_0FXOP_08_CF
,
1449 VEX_LEN_0FXOP_08_EC
,
1450 VEX_LEN_0FXOP_08_ED
,
1451 VEX_LEN_0FXOP_08_EE
,
1452 VEX_LEN_0FXOP_08_EF
,
1453 VEX_LEN_0FXOP_09_01
,
1454 VEX_LEN_0FXOP_09_02
,
1455 VEX_LEN_0FXOP_09_12_M_1
,
1456 VEX_LEN_0FXOP_09_82_W_0
,
1457 VEX_LEN_0FXOP_09_83_W_0
,
1458 VEX_LEN_0FXOP_09_90
,
1459 VEX_LEN_0FXOP_09_91
,
1460 VEX_LEN_0FXOP_09_92
,
1461 VEX_LEN_0FXOP_09_93
,
1462 VEX_LEN_0FXOP_09_94
,
1463 VEX_LEN_0FXOP_09_95
,
1464 VEX_LEN_0FXOP_09_96
,
1465 VEX_LEN_0FXOP_09_97
,
1466 VEX_LEN_0FXOP_09_98
,
1467 VEX_LEN_0FXOP_09_99
,
1468 VEX_LEN_0FXOP_09_9A
,
1469 VEX_LEN_0FXOP_09_9B
,
1470 VEX_LEN_0FXOP_09_C1
,
1471 VEX_LEN_0FXOP_09_C2
,
1472 VEX_LEN_0FXOP_09_C3
,
1473 VEX_LEN_0FXOP_09_C6
,
1474 VEX_LEN_0FXOP_09_C7
,
1475 VEX_LEN_0FXOP_09_CB
,
1476 VEX_LEN_0FXOP_09_D1
,
1477 VEX_LEN_0FXOP_09_D2
,
1478 VEX_LEN_0FXOP_09_D3
,
1479 VEX_LEN_0FXOP_09_D6
,
1480 VEX_LEN_0FXOP_09_D7
,
1481 VEX_LEN_0FXOP_09_DB
,
1482 VEX_LEN_0FXOP_09_E1
,
1483 VEX_LEN_0FXOP_09_E2
,
1484 VEX_LEN_0FXOP_09_E3
,
1485 VEX_LEN_0FXOP_0A_12
,
1490 EVEX_LEN_0F3816
= 0,
1492 EVEX_LEN_0F381A_M_0
,
1493 EVEX_LEN_0F381B_M_0
,
1495 EVEX_LEN_0F385A_M_0
,
1496 EVEX_LEN_0F385B_M_0
,
1497 EVEX_LEN_0F38C6_M_0
,
1498 EVEX_LEN_0F38C7_M_0
,
1515 VEX_W_0F41_L_1_M_1
= 0,
1537 VEX_W_0F381A_M_0_L_1
,
1544 VEX_W_0F3849_X86_64_P_0
,
1545 VEX_W_0F3849_X86_64_P_2
,
1546 VEX_W_0F3849_X86_64_P_3
,
1547 VEX_W_0F384B_X86_64_P_1
,
1548 VEX_W_0F384B_X86_64_P_2
,
1549 VEX_W_0F384B_X86_64_P_3
,
1556 VEX_W_0F385A_M_0_L_0
,
1557 VEX_W_0F385C_X86_64_P_1
,
1558 VEX_W_0F385C_X86_64_P_3
,
1559 VEX_W_0F385E_X86_64_P_0
,
1560 VEX_W_0F385E_X86_64_P_1
,
1561 VEX_W_0F385E_X86_64_P_2
,
1562 VEX_W_0F385E_X86_64_P_3
,
1589 VEX_W_0FXOP_08_85_L_0
,
1590 VEX_W_0FXOP_08_86_L_0
,
1591 VEX_W_0FXOP_08_87_L_0
,
1592 VEX_W_0FXOP_08_8E_L_0
,
1593 VEX_W_0FXOP_08_8F_L_0
,
1594 VEX_W_0FXOP_08_95_L_0
,
1595 VEX_W_0FXOP_08_96_L_0
,
1596 VEX_W_0FXOP_08_97_L_0
,
1597 VEX_W_0FXOP_08_9E_L_0
,
1598 VEX_W_0FXOP_08_9F_L_0
,
1599 VEX_W_0FXOP_08_A6_L_0
,
1600 VEX_W_0FXOP_08_B6_L_0
,
1601 VEX_W_0FXOP_08_C0_L_0
,
1602 VEX_W_0FXOP_08_C1_L_0
,
1603 VEX_W_0FXOP_08_C2_L_0
,
1604 VEX_W_0FXOP_08_C3_L_0
,
1605 VEX_W_0FXOP_08_CC_L_0
,
1606 VEX_W_0FXOP_08_CD_L_0
,
1607 VEX_W_0FXOP_08_CE_L_0
,
1608 VEX_W_0FXOP_08_CF_L_0
,
1609 VEX_W_0FXOP_08_EC_L_0
,
1610 VEX_W_0FXOP_08_ED_L_0
,
1611 VEX_W_0FXOP_08_EE_L_0
,
1612 VEX_W_0FXOP_08_EF_L_0
,
1618 VEX_W_0FXOP_09_C1_L_0
,
1619 VEX_W_0FXOP_09_C2_L_0
,
1620 VEX_W_0FXOP_09_C3_L_0
,
1621 VEX_W_0FXOP_09_C6_L_0
,
1622 VEX_W_0FXOP_09_C7_L_0
,
1623 VEX_W_0FXOP_09_CB_L_0
,
1624 VEX_W_0FXOP_09_D1_L_0
,
1625 VEX_W_0FXOP_09_D2_L_0
,
1626 VEX_W_0FXOP_09_D3_L_0
,
1627 VEX_W_0FXOP_09_D6_L_0
,
1628 VEX_W_0FXOP_09_D7_L_0
,
1629 VEX_W_0FXOP_09_DB_L_0
,
1630 VEX_W_0FXOP_09_E1_L_0
,
1631 VEX_W_0FXOP_09_E2_L_0
,
1632 VEX_W_0FXOP_09_E3_L_0
,
1685 EVEX_W_0F381A_M_0_L_n
,
1686 EVEX_W_0F381B_M_0_L_2
,
1711 EVEX_W_0F385A_M_0_L_n
,
1712 EVEX_W_0F385B_M_0_L_2
,
1738 typedef void (*op_rtn
) (instr_info
*ins
, int bytemode
, int sizeflag
);
1747 unsigned int prefix_requirement
;
1750 /* Upper case letters in the instruction names here are macros.
1751 'A' => print 'b' if no register operands or suffix_always is true
1752 'B' => print 'b' if suffix_always is true
1753 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
1755 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
1756 suffix_always is true
1757 'E' => print 'e' if 32-bit form of jcxz
1758 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
1759 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
1760 'H' => print ",pt" or ",pn" branch hint
1763 'K' => print 'd' or 'q' if rex prefix is present.
1765 'M' => print 'r' if intel_mnemonic is false.
1766 'N' => print 'n' if instruction has no wait "prefix"
1767 'O' => print 'd' or 'o' (or 'q' in Intel mode)
1768 'P' => behave as 'T' except with register operand outside of suffix_always
1770 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
1772 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
1773 'S' => print 'w', 'l' or 'q' if suffix_always is true
1774 'T' => print 'w', 'l'/'d', or 'q' if instruction has an operand size
1775 prefix or if suffix_always is true.
1778 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
1779 'X' => print 's', 'd' depending on data16 prefix (for XMM)
1781 'Z' => print 'q' in 64bit mode and 'l' otherwise, if suffix_always is true.
1782 '!' => change condition from true to false or from false to true.
1783 '%' => add 1 upper case letter to the macro.
1784 '^' => print 'w', 'l', or 'q' (Intel64 ISA only) depending on operand size
1785 prefix or suffix_always is true (lcall/ljmp).
1786 '@' => in 64bit mode for Intel64 ISA or if instruction
1787 has no operand sizing prefix, print 'q' if suffix_always is true or
1788 nothing otherwise; behave as 'P' in all other cases
1790 2 upper case letter macros:
1791 "XY" => print 'x' or 'y' if suffix_always is true or no register
1792 operands and no broadcast.
1793 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
1794 register operands and no broadcast.
1795 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
1796 "XD" => print 'd' if !EVEX or EVEX.W=1, EVEX.W=0 is not a valid encoding
1797 "XH" => print 'h' if EVEX.W=0, EVEX.W=1 is not a valid encoding (for FP16)
1798 "XS" => print 's' if !EVEX or EVEX.W=0, EVEX.W=1 is not a valid encoding
1799 "XV" => print "{vex} " pseudo prefix
1800 "XE" => print "{evex} " pseudo prefix if no EVEX-specific functionality is
1801 is used by an EVEX-encoded (AVX512VL) instruction.
1802 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond
1803 being false, or no operand at all in 64bit mode, or if suffix_always
1805 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
1806 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
1807 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
1808 "DQ" => print 'd' or 'q' depending on the VEX.W bit
1809 "BW" => print 'b' or 'w' depending on the VEX.W bit
1810 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
1811 an operand size prefix, or suffix_always is true. print
1812 'q' if rex prefix is present.
1814 Many of the above letters print nothing in Intel mode. See "putop"
1817 Braces '{' and '}', and vertical bars '|', indicate alternative
1818 mnemonic strings for AT&T and Intel. */
1820 static const struct dis386 dis386
[] = {
1822 { "addB", { Ebh1
, Gb
}, 0 },
1823 { "addS", { Evh1
, Gv
}, 0 },
1824 { "addB", { Gb
, EbS
}, 0 },
1825 { "addS", { Gv
, EvS
}, 0 },
1826 { "addB", { AL
, Ib
}, 0 },
1827 { "addS", { eAX
, Iv
}, 0 },
1828 { X86_64_TABLE (X86_64_06
) },
1829 { X86_64_TABLE (X86_64_07
) },
1831 { "orB", { Ebh1
, Gb
}, 0 },
1832 { "orS", { Evh1
, Gv
}, 0 },
1833 { "orB", { Gb
, EbS
}, 0 },
1834 { "orS", { Gv
, EvS
}, 0 },
1835 { "orB", { AL
, Ib
}, 0 },
1836 { "orS", { eAX
, Iv
}, 0 },
1837 { X86_64_TABLE (X86_64_0E
) },
1838 { Bad_Opcode
}, /* 0x0f extended opcode escape */
1840 { "adcB", { Ebh1
, Gb
}, 0 },
1841 { "adcS", { Evh1
, Gv
}, 0 },
1842 { "adcB", { Gb
, EbS
}, 0 },
1843 { "adcS", { Gv
, EvS
}, 0 },
1844 { "adcB", { AL
, Ib
}, 0 },
1845 { "adcS", { eAX
, Iv
}, 0 },
1846 { X86_64_TABLE (X86_64_16
) },
1847 { X86_64_TABLE (X86_64_17
) },
1849 { "sbbB", { Ebh1
, Gb
}, 0 },
1850 { "sbbS", { Evh1
, Gv
}, 0 },
1851 { "sbbB", { Gb
, EbS
}, 0 },
1852 { "sbbS", { Gv
, EvS
}, 0 },
1853 { "sbbB", { AL
, Ib
}, 0 },
1854 { "sbbS", { eAX
, Iv
}, 0 },
1855 { X86_64_TABLE (X86_64_1E
) },
1856 { X86_64_TABLE (X86_64_1F
) },
1858 { "andB", { Ebh1
, Gb
}, 0 },
1859 { "andS", { Evh1
, Gv
}, 0 },
1860 { "andB", { Gb
, EbS
}, 0 },
1861 { "andS", { Gv
, EvS
}, 0 },
1862 { "andB", { AL
, Ib
}, 0 },
1863 { "andS", { eAX
, Iv
}, 0 },
1864 { Bad_Opcode
}, /* SEG ES prefix */
1865 { X86_64_TABLE (X86_64_27
) },
1867 { "subB", { Ebh1
, Gb
}, 0 },
1868 { "subS", { Evh1
, Gv
}, 0 },
1869 { "subB", { Gb
, EbS
}, 0 },
1870 { "subS", { Gv
, EvS
}, 0 },
1871 { "subB", { AL
, Ib
}, 0 },
1872 { "subS", { eAX
, Iv
}, 0 },
1873 { Bad_Opcode
}, /* SEG CS prefix */
1874 { X86_64_TABLE (X86_64_2F
) },
1876 { "xorB", { Ebh1
, Gb
}, 0 },
1877 { "xorS", { Evh1
, Gv
}, 0 },
1878 { "xorB", { Gb
, EbS
}, 0 },
1879 { "xorS", { Gv
, EvS
}, 0 },
1880 { "xorB", { AL
, Ib
}, 0 },
1881 { "xorS", { eAX
, Iv
}, 0 },
1882 { Bad_Opcode
}, /* SEG SS prefix */
1883 { X86_64_TABLE (X86_64_37
) },
1885 { "cmpB", { Eb
, Gb
}, 0 },
1886 { "cmpS", { Ev
, Gv
}, 0 },
1887 { "cmpB", { Gb
, EbS
}, 0 },
1888 { "cmpS", { Gv
, EvS
}, 0 },
1889 { "cmpB", { AL
, Ib
}, 0 },
1890 { "cmpS", { eAX
, Iv
}, 0 },
1891 { Bad_Opcode
}, /* SEG DS prefix */
1892 { X86_64_TABLE (X86_64_3F
) },
1894 { "inc{S|}", { RMeAX
}, 0 },
1895 { "inc{S|}", { RMeCX
}, 0 },
1896 { "inc{S|}", { RMeDX
}, 0 },
1897 { "inc{S|}", { RMeBX
}, 0 },
1898 { "inc{S|}", { RMeSP
}, 0 },
1899 { "inc{S|}", { RMeBP
}, 0 },
1900 { "inc{S|}", { RMeSI
}, 0 },
1901 { "inc{S|}", { RMeDI
}, 0 },
1903 { "dec{S|}", { RMeAX
}, 0 },
1904 { "dec{S|}", { RMeCX
}, 0 },
1905 { "dec{S|}", { RMeDX
}, 0 },
1906 { "dec{S|}", { RMeBX
}, 0 },
1907 { "dec{S|}", { RMeSP
}, 0 },
1908 { "dec{S|}", { RMeBP
}, 0 },
1909 { "dec{S|}", { RMeSI
}, 0 },
1910 { "dec{S|}", { RMeDI
}, 0 },
1912 { "push{!P|}", { RMrAX
}, 0 },
1913 { "push{!P|}", { RMrCX
}, 0 },
1914 { "push{!P|}", { RMrDX
}, 0 },
1915 { "push{!P|}", { RMrBX
}, 0 },
1916 { "push{!P|}", { RMrSP
}, 0 },
1917 { "push{!P|}", { RMrBP
}, 0 },
1918 { "push{!P|}", { RMrSI
}, 0 },
1919 { "push{!P|}", { RMrDI
}, 0 },
1921 { "pop{!P|}", { RMrAX
}, 0 },
1922 { "pop{!P|}", { RMrCX
}, 0 },
1923 { "pop{!P|}", { RMrDX
}, 0 },
1924 { "pop{!P|}", { RMrBX
}, 0 },
1925 { "pop{!P|}", { RMrSP
}, 0 },
1926 { "pop{!P|}", { RMrBP
}, 0 },
1927 { "pop{!P|}", { RMrSI
}, 0 },
1928 { "pop{!P|}", { RMrDI
}, 0 },
1930 { X86_64_TABLE (X86_64_60
) },
1931 { X86_64_TABLE (X86_64_61
) },
1932 { X86_64_TABLE (X86_64_62
) },
1933 { X86_64_TABLE (X86_64_63
) },
1934 { Bad_Opcode
}, /* seg fs */
1935 { Bad_Opcode
}, /* seg gs */
1936 { Bad_Opcode
}, /* op size prefix */
1937 { Bad_Opcode
}, /* adr size prefix */
1939 { "pushP", { sIv
}, 0 },
1940 { "imulS", { Gv
, Ev
, Iv
}, 0 },
1941 { "pushP", { sIbT
}, 0 },
1942 { "imulS", { Gv
, Ev
, sIb
}, 0 },
1943 { "ins{b|}", { Ybr
, indirDX
}, 0 },
1944 { X86_64_TABLE (X86_64_6D
) },
1945 { "outs{b|}", { indirDXr
, Xb
}, 0 },
1946 { X86_64_TABLE (X86_64_6F
) },
1948 { "joH", { Jb
, BND
, cond_jump_flag
}, 0 },
1949 { "jnoH", { Jb
, BND
, cond_jump_flag
}, 0 },
1950 { "jbH", { Jb
, BND
, cond_jump_flag
}, 0 },
1951 { "jaeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1952 { "jeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1953 { "jneH", { Jb
, BND
, cond_jump_flag
}, 0 },
1954 { "jbeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1955 { "jaH", { Jb
, BND
, cond_jump_flag
}, 0 },
1957 { "jsH", { Jb
, BND
, cond_jump_flag
}, 0 },
1958 { "jnsH", { Jb
, BND
, cond_jump_flag
}, 0 },
1959 { "jpH", { Jb
, BND
, cond_jump_flag
}, 0 },
1960 { "jnpH", { Jb
, BND
, cond_jump_flag
}, 0 },
1961 { "jlH", { Jb
, BND
, cond_jump_flag
}, 0 },
1962 { "jgeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1963 { "jleH", { Jb
, BND
, cond_jump_flag
}, 0 },
1964 { "jgH", { Jb
, BND
, cond_jump_flag
}, 0 },
1966 { REG_TABLE (REG_80
) },
1967 { REG_TABLE (REG_81
) },
1968 { X86_64_TABLE (X86_64_82
) },
1969 { REG_TABLE (REG_83
) },
1970 { "testB", { Eb
, Gb
}, 0 },
1971 { "testS", { Ev
, Gv
}, 0 },
1972 { "xchgB", { Ebh2
, Gb
}, 0 },
1973 { "xchgS", { Evh2
, Gv
}, 0 },
1975 { "movB", { Ebh3
, Gb
}, 0 },
1976 { "movS", { Evh3
, Gv
}, 0 },
1977 { "movB", { Gb
, EbS
}, 0 },
1978 { "movS", { Gv
, EvS
}, 0 },
1979 { "movD", { Sv
, Sw
}, 0 },
1980 { MOD_TABLE (MOD_8D
) },
1981 { "movD", { Sw
, Sv
}, 0 },
1982 { REG_TABLE (REG_8F
) },
1984 { PREFIX_TABLE (PREFIX_90
) },
1985 { "xchgS", { RMeCX
, eAX
}, 0 },
1986 { "xchgS", { RMeDX
, eAX
}, 0 },
1987 { "xchgS", { RMeBX
, eAX
}, 0 },
1988 { "xchgS", { RMeSP
, eAX
}, 0 },
1989 { "xchgS", { RMeBP
, eAX
}, 0 },
1990 { "xchgS", { RMeSI
, eAX
}, 0 },
1991 { "xchgS", { RMeDI
, eAX
}, 0 },
1993 { "cW{t|}R", { XX
}, 0 },
1994 { "cR{t|}O", { XX
}, 0 },
1995 { X86_64_TABLE (X86_64_9A
) },
1996 { Bad_Opcode
}, /* fwait */
1997 { "pushfP", { XX
}, 0 },
1998 { "popfP", { XX
}, 0 },
1999 { "sahf", { XX
}, 0 },
2000 { "lahf", { XX
}, 0 },
2002 { "mov%LB", { AL
, Ob
}, 0 },
2003 { "mov%LS", { eAX
, Ov
}, 0 },
2004 { "mov%LB", { Ob
, AL
}, 0 },
2005 { "mov%LS", { Ov
, eAX
}, 0 },
2006 { "movs{b|}", { Ybr
, Xb
}, 0 },
2007 { "movs{R|}", { Yvr
, Xv
}, 0 },
2008 { "cmps{b|}", { Xb
, Yb
}, 0 },
2009 { "cmps{R|}", { Xv
, Yv
}, 0 },
2011 { "testB", { AL
, Ib
}, 0 },
2012 { "testS", { eAX
, Iv
}, 0 },
2013 { "stosB", { Ybr
, AL
}, 0 },
2014 { "stosS", { Yvr
, eAX
}, 0 },
2015 { "lodsB", { ALr
, Xb
}, 0 },
2016 { "lodsS", { eAXr
, Xv
}, 0 },
2017 { "scasB", { AL
, Yb
}, 0 },
2018 { "scasS", { eAX
, Yv
}, 0 },
2020 { "movB", { RMAL
, Ib
}, 0 },
2021 { "movB", { RMCL
, Ib
}, 0 },
2022 { "movB", { RMDL
, Ib
}, 0 },
2023 { "movB", { RMBL
, Ib
}, 0 },
2024 { "movB", { RMAH
, Ib
}, 0 },
2025 { "movB", { RMCH
, Ib
}, 0 },
2026 { "movB", { RMDH
, Ib
}, 0 },
2027 { "movB", { RMBH
, Ib
}, 0 },
2029 { "mov%LV", { RMeAX
, Iv64
}, 0 },
2030 { "mov%LV", { RMeCX
, Iv64
}, 0 },
2031 { "mov%LV", { RMeDX
, Iv64
}, 0 },
2032 { "mov%LV", { RMeBX
, Iv64
}, 0 },
2033 { "mov%LV", { RMeSP
, Iv64
}, 0 },
2034 { "mov%LV", { RMeBP
, Iv64
}, 0 },
2035 { "mov%LV", { RMeSI
, Iv64
}, 0 },
2036 { "mov%LV", { RMeDI
, Iv64
}, 0 },
2038 { REG_TABLE (REG_C0
) },
2039 { REG_TABLE (REG_C1
) },
2040 { X86_64_TABLE (X86_64_C2
) },
2041 { X86_64_TABLE (X86_64_C3
) },
2042 { X86_64_TABLE (X86_64_C4
) },
2043 { X86_64_TABLE (X86_64_C5
) },
2044 { REG_TABLE (REG_C6
) },
2045 { REG_TABLE (REG_C7
) },
2047 { "enterP", { Iw
, Ib
}, 0 },
2048 { "leaveP", { XX
}, 0 },
2049 { "{l|}ret{|f}%LP", { Iw
}, 0 },
2050 { "{l|}ret{|f}%LP", { XX
}, 0 },
2051 { "int3", { XX
}, 0 },
2052 { "int", { Ib
}, 0 },
2053 { X86_64_TABLE (X86_64_CE
) },
2054 { "iret%LP", { XX
}, 0 },
2056 { REG_TABLE (REG_D0
) },
2057 { REG_TABLE (REG_D1
) },
2058 { REG_TABLE (REG_D2
) },
2059 { REG_TABLE (REG_D3
) },
2060 { X86_64_TABLE (X86_64_D4
) },
2061 { X86_64_TABLE (X86_64_D5
) },
2063 { "xlat", { DSBX
}, 0 },
2074 { "loopneFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2075 { "loopeFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2076 { "loopFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2077 { "jEcxzH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2078 { "inB", { AL
, Ib
}, 0 },
2079 { "inG", { zAX
, Ib
}, 0 },
2080 { "outB", { Ib
, AL
}, 0 },
2081 { "outG", { Ib
, zAX
}, 0 },
2083 { X86_64_TABLE (X86_64_E8
) },
2084 { X86_64_TABLE (X86_64_E9
) },
2085 { X86_64_TABLE (X86_64_EA
) },
2086 { "jmp", { Jb
, BND
}, 0 },
2087 { "inB", { AL
, indirDX
}, 0 },
2088 { "inG", { zAX
, indirDX
}, 0 },
2089 { "outB", { indirDX
, AL
}, 0 },
2090 { "outG", { indirDX
, zAX
}, 0 },
2092 { Bad_Opcode
}, /* lock prefix */
2093 { "int1", { XX
}, 0 },
2094 { Bad_Opcode
}, /* repne */
2095 { Bad_Opcode
}, /* repz */
2096 { "hlt", { XX
}, 0 },
2097 { "cmc", { XX
}, 0 },
2098 { REG_TABLE (REG_F6
) },
2099 { REG_TABLE (REG_F7
) },
2101 { "clc", { XX
}, 0 },
2102 { "stc", { XX
}, 0 },
2103 { "cli", { XX
}, 0 },
2104 { "sti", { XX
}, 0 },
2105 { "cld", { XX
}, 0 },
2106 { "std", { XX
}, 0 },
2107 { REG_TABLE (REG_FE
) },
2108 { REG_TABLE (REG_FF
) },
2111 static const struct dis386 dis386_twobyte
[] = {
2113 { REG_TABLE (REG_0F00
) },
2114 { REG_TABLE (REG_0F01
) },
2115 { "larS", { Gv
, Ew
}, 0 },
2116 { "lslS", { Gv
, Ew
}, 0 },
2118 { "syscall", { XX
}, 0 },
2119 { "clts", { XX
}, 0 },
2120 { "sysret%LQ", { XX
}, 0 },
2122 { "invd", { XX
}, 0 },
2123 { PREFIX_TABLE (PREFIX_0F09
) },
2125 { "ud2", { XX
}, 0 },
2127 { REG_TABLE (REG_0F0D
) },
2128 { "femms", { XX
}, 0 },
2129 { "", { MX
, EM
, OPSUF
}, 0 }, /* See OP_3DNowSuffix. */
2131 { PREFIX_TABLE (PREFIX_0F10
) },
2132 { PREFIX_TABLE (PREFIX_0F11
) },
2133 { PREFIX_TABLE (PREFIX_0F12
) },
2134 { MOD_TABLE (MOD_0F13
) },
2135 { "unpcklpX", { XM
, EXx
}, PREFIX_OPCODE
},
2136 { "unpckhpX", { XM
, EXx
}, PREFIX_OPCODE
},
2137 { PREFIX_TABLE (PREFIX_0F16
) },
2138 { MOD_TABLE (MOD_0F17
) },
2140 { REG_TABLE (REG_0F18
) },
2141 { "nopQ", { Ev
}, 0 },
2142 { PREFIX_TABLE (PREFIX_0F1A
) },
2143 { PREFIX_TABLE (PREFIX_0F1B
) },
2144 { PREFIX_TABLE (PREFIX_0F1C
) },
2145 { "nopQ", { Ev
}, 0 },
2146 { PREFIX_TABLE (PREFIX_0F1E
) },
2147 { "nopQ", { Ev
}, 0 },
2149 { "movZ", { Em
, Cm
}, 0 },
2150 { "movZ", { Em
, Dm
}, 0 },
2151 { "movZ", { Cm
, Em
}, 0 },
2152 { "movZ", { Dm
, Em
}, 0 },
2153 { X86_64_TABLE (X86_64_0F24
) },
2155 { X86_64_TABLE (X86_64_0F26
) },
2158 { "movapX", { XM
, EXx
}, PREFIX_OPCODE
},
2159 { "movapX", { EXxS
, XM
}, PREFIX_OPCODE
},
2160 { PREFIX_TABLE (PREFIX_0F2A
) },
2161 { PREFIX_TABLE (PREFIX_0F2B
) },
2162 { PREFIX_TABLE (PREFIX_0F2C
) },
2163 { PREFIX_TABLE (PREFIX_0F2D
) },
2164 { PREFIX_TABLE (PREFIX_0F2E
) },
2165 { PREFIX_TABLE (PREFIX_0F2F
) },
2167 { "wrmsr", { XX
}, 0 },
2168 { "rdtsc", { XX
}, 0 },
2169 { "rdmsr", { XX
}, 0 },
2170 { "rdpmc", { XX
}, 0 },
2171 { "sysenter", { SEP
}, 0 },
2172 { "sysexit%LQ", { SEP
}, 0 },
2174 { "getsec", { XX
}, 0 },
2176 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38
, PREFIX_OPCODE
) },
2178 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A
, PREFIX_OPCODE
) },
2185 { "cmovoS", { Gv
, Ev
}, 0 },
2186 { "cmovnoS", { Gv
, Ev
}, 0 },
2187 { "cmovbS", { Gv
, Ev
}, 0 },
2188 { "cmovaeS", { Gv
, Ev
}, 0 },
2189 { "cmoveS", { Gv
, Ev
}, 0 },
2190 { "cmovneS", { Gv
, Ev
}, 0 },
2191 { "cmovbeS", { Gv
, Ev
}, 0 },
2192 { "cmovaS", { Gv
, Ev
}, 0 },
2194 { "cmovsS", { Gv
, Ev
}, 0 },
2195 { "cmovnsS", { Gv
, Ev
}, 0 },
2196 { "cmovpS", { Gv
, Ev
}, 0 },
2197 { "cmovnpS", { Gv
, Ev
}, 0 },
2198 { "cmovlS", { Gv
, Ev
}, 0 },
2199 { "cmovgeS", { Gv
, Ev
}, 0 },
2200 { "cmovleS", { Gv
, Ev
}, 0 },
2201 { "cmovgS", { Gv
, Ev
}, 0 },
2203 { MOD_TABLE (MOD_0F50
) },
2204 { PREFIX_TABLE (PREFIX_0F51
) },
2205 { PREFIX_TABLE (PREFIX_0F52
) },
2206 { PREFIX_TABLE (PREFIX_0F53
) },
2207 { "andpX", { XM
, EXx
}, PREFIX_OPCODE
},
2208 { "andnpX", { XM
, EXx
}, PREFIX_OPCODE
},
2209 { "orpX", { XM
, EXx
}, PREFIX_OPCODE
},
2210 { "xorpX", { XM
, EXx
}, PREFIX_OPCODE
},
2212 { PREFIX_TABLE (PREFIX_0F58
) },
2213 { PREFIX_TABLE (PREFIX_0F59
) },
2214 { PREFIX_TABLE (PREFIX_0F5A
) },
2215 { PREFIX_TABLE (PREFIX_0F5B
) },
2216 { PREFIX_TABLE (PREFIX_0F5C
) },
2217 { PREFIX_TABLE (PREFIX_0F5D
) },
2218 { PREFIX_TABLE (PREFIX_0F5E
) },
2219 { PREFIX_TABLE (PREFIX_0F5F
) },
2221 { PREFIX_TABLE (PREFIX_0F60
) },
2222 { PREFIX_TABLE (PREFIX_0F61
) },
2223 { PREFIX_TABLE (PREFIX_0F62
) },
2224 { "packsswb", { MX
, EM
}, PREFIX_OPCODE
},
2225 { "pcmpgtb", { MX
, EM
}, PREFIX_OPCODE
},
2226 { "pcmpgtw", { MX
, EM
}, PREFIX_OPCODE
},
2227 { "pcmpgtd", { MX
, EM
}, PREFIX_OPCODE
},
2228 { "packuswb", { MX
, EM
}, PREFIX_OPCODE
},
2230 { "punpckhbw", { MX
, EM
}, PREFIX_OPCODE
},
2231 { "punpckhwd", { MX
, EM
}, PREFIX_OPCODE
},
2232 { "punpckhdq", { MX
, EM
}, PREFIX_OPCODE
},
2233 { "packssdw", { MX
, EM
}, PREFIX_OPCODE
},
2234 { "punpcklqdq", { XM
, EXx
}, PREFIX_DATA
},
2235 { "punpckhqdq", { XM
, EXx
}, PREFIX_DATA
},
2236 { "movK", { MX
, Edq
}, PREFIX_OPCODE
},
2237 { PREFIX_TABLE (PREFIX_0F6F
) },
2239 { PREFIX_TABLE (PREFIX_0F70
) },
2240 { MOD_TABLE (MOD_0F71
) },
2241 { MOD_TABLE (MOD_0F72
) },
2242 { MOD_TABLE (MOD_0F73
) },
2243 { "pcmpeqb", { MX
, EM
}, PREFIX_OPCODE
},
2244 { "pcmpeqw", { MX
, EM
}, PREFIX_OPCODE
},
2245 { "pcmpeqd", { MX
, EM
}, PREFIX_OPCODE
},
2246 { "emms", { XX
}, PREFIX_OPCODE
},
2248 { PREFIX_TABLE (PREFIX_0F78
) },
2249 { PREFIX_TABLE (PREFIX_0F79
) },
2252 { PREFIX_TABLE (PREFIX_0F7C
) },
2253 { PREFIX_TABLE (PREFIX_0F7D
) },
2254 { PREFIX_TABLE (PREFIX_0F7E
) },
2255 { PREFIX_TABLE (PREFIX_0F7F
) },
2257 { "joH", { Jv
, BND
, cond_jump_flag
}, 0 },
2258 { "jnoH", { Jv
, BND
, cond_jump_flag
}, 0 },
2259 { "jbH", { Jv
, BND
, cond_jump_flag
}, 0 },
2260 { "jaeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2261 { "jeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2262 { "jneH", { Jv
, BND
, cond_jump_flag
}, 0 },
2263 { "jbeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2264 { "jaH", { Jv
, BND
, cond_jump_flag
}, 0 },
2266 { "jsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2267 { "jnsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2268 { "jpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2269 { "jnpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2270 { "jlH", { Jv
, BND
, cond_jump_flag
}, 0 },
2271 { "jgeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2272 { "jleH", { Jv
, BND
, cond_jump_flag
}, 0 },
2273 { "jgH", { Jv
, BND
, cond_jump_flag
}, 0 },
2275 { "seto", { Eb
}, 0 },
2276 { "setno", { Eb
}, 0 },
2277 { "setb", { Eb
}, 0 },
2278 { "setae", { Eb
}, 0 },
2279 { "sete", { Eb
}, 0 },
2280 { "setne", { Eb
}, 0 },
2281 { "setbe", { Eb
}, 0 },
2282 { "seta", { Eb
}, 0 },
2284 { "sets", { Eb
}, 0 },
2285 { "setns", { Eb
}, 0 },
2286 { "setp", { Eb
}, 0 },
2287 { "setnp", { Eb
}, 0 },
2288 { "setl", { Eb
}, 0 },
2289 { "setge", { Eb
}, 0 },
2290 { "setle", { Eb
}, 0 },
2291 { "setg", { Eb
}, 0 },
2293 { "pushP", { fs
}, 0 },
2294 { "popP", { fs
}, 0 },
2295 { "cpuid", { XX
}, 0 },
2296 { "btS", { Ev
, Gv
}, 0 },
2297 { "shldS", { Ev
, Gv
, Ib
}, 0 },
2298 { "shldS", { Ev
, Gv
, CL
}, 0 },
2299 { REG_TABLE (REG_0FA6
) },
2300 { REG_TABLE (REG_0FA7
) },
2302 { "pushP", { gs
}, 0 },
2303 { "popP", { gs
}, 0 },
2304 { "rsm", { XX
}, 0 },
2305 { "btsS", { Evh1
, Gv
}, 0 },
2306 { "shrdS", { Ev
, Gv
, Ib
}, 0 },
2307 { "shrdS", { Ev
, Gv
, CL
}, 0 },
2308 { REG_TABLE (REG_0FAE
) },
2309 { "imulS", { Gv
, Ev
}, 0 },
2311 { "cmpxchgB", { Ebh1
, Gb
}, 0 },
2312 { "cmpxchgS", { Evh1
, Gv
}, 0 },
2313 { MOD_TABLE (MOD_0FB2
) },
2314 { "btrS", { Evh1
, Gv
}, 0 },
2315 { MOD_TABLE (MOD_0FB4
) },
2316 { MOD_TABLE (MOD_0FB5
) },
2317 { "movz{bR|x}", { Gv
, Eb
}, 0 },
2318 { "movz{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movzww ! */
2320 { PREFIX_TABLE (PREFIX_0FB8
) },
2321 { "ud1S", { Gv
, Ev
}, 0 },
2322 { REG_TABLE (REG_0FBA
) },
2323 { "btcS", { Evh1
, Gv
}, 0 },
2324 { PREFIX_TABLE (PREFIX_0FBC
) },
2325 { PREFIX_TABLE (PREFIX_0FBD
) },
2326 { "movs{bR|x}", { Gv
, Eb
}, 0 },
2327 { "movs{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movsww ! */
2329 { "xaddB", { Ebh1
, Gb
}, 0 },
2330 { "xaddS", { Evh1
, Gv
}, 0 },
2331 { PREFIX_TABLE (PREFIX_0FC2
) },
2332 { MOD_TABLE (MOD_0FC3
) },
2333 { "pinsrw", { MX
, Edw
, Ib
}, PREFIX_OPCODE
},
2334 { "pextrw", { Gd
, MS
, Ib
}, PREFIX_OPCODE
},
2335 { "shufpX", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
2336 { REG_TABLE (REG_0FC7
) },
2338 { "bswap", { RMeAX
}, 0 },
2339 { "bswap", { RMeCX
}, 0 },
2340 { "bswap", { RMeDX
}, 0 },
2341 { "bswap", { RMeBX
}, 0 },
2342 { "bswap", { RMeSP
}, 0 },
2343 { "bswap", { RMeBP
}, 0 },
2344 { "bswap", { RMeSI
}, 0 },
2345 { "bswap", { RMeDI
}, 0 },
2347 { PREFIX_TABLE (PREFIX_0FD0
) },
2348 { "psrlw", { MX
, EM
}, PREFIX_OPCODE
},
2349 { "psrld", { MX
, EM
}, PREFIX_OPCODE
},
2350 { "psrlq", { MX
, EM
}, PREFIX_OPCODE
},
2351 { "paddq", { MX
, EM
}, PREFIX_OPCODE
},
2352 { "pmullw", { MX
, EM
}, PREFIX_OPCODE
},
2353 { PREFIX_TABLE (PREFIX_0FD6
) },
2354 { MOD_TABLE (MOD_0FD7
) },
2356 { "psubusb", { MX
, EM
}, PREFIX_OPCODE
},
2357 { "psubusw", { MX
, EM
}, PREFIX_OPCODE
},
2358 { "pminub", { MX
, EM
}, PREFIX_OPCODE
},
2359 { "pand", { MX
, EM
}, PREFIX_OPCODE
},
2360 { "paddusb", { MX
, EM
}, PREFIX_OPCODE
},
2361 { "paddusw", { MX
, EM
}, PREFIX_OPCODE
},
2362 { "pmaxub", { MX
, EM
}, PREFIX_OPCODE
},
2363 { "pandn", { MX
, EM
}, PREFIX_OPCODE
},
2365 { "pavgb", { MX
, EM
}, PREFIX_OPCODE
},
2366 { "psraw", { MX
, EM
}, PREFIX_OPCODE
},
2367 { "psrad", { MX
, EM
}, PREFIX_OPCODE
},
2368 { "pavgw", { MX
, EM
}, PREFIX_OPCODE
},
2369 { "pmulhuw", { MX
, EM
}, PREFIX_OPCODE
},
2370 { "pmulhw", { MX
, EM
}, PREFIX_OPCODE
},
2371 { PREFIX_TABLE (PREFIX_0FE6
) },
2372 { PREFIX_TABLE (PREFIX_0FE7
) },
2374 { "psubsb", { MX
, EM
}, PREFIX_OPCODE
},
2375 { "psubsw", { MX
, EM
}, PREFIX_OPCODE
},
2376 { "pminsw", { MX
, EM
}, PREFIX_OPCODE
},
2377 { "por", { MX
, EM
}, PREFIX_OPCODE
},
2378 { "paddsb", { MX
, EM
}, PREFIX_OPCODE
},
2379 { "paddsw", { MX
, EM
}, PREFIX_OPCODE
},
2380 { "pmaxsw", { MX
, EM
}, PREFIX_OPCODE
},
2381 { "pxor", { MX
, EM
}, PREFIX_OPCODE
},
2383 { PREFIX_TABLE (PREFIX_0FF0
) },
2384 { "psllw", { MX
, EM
}, PREFIX_OPCODE
},
2385 { "pslld", { MX
, EM
}, PREFIX_OPCODE
},
2386 { "psllq", { MX
, EM
}, PREFIX_OPCODE
},
2387 { "pmuludq", { MX
, EM
}, PREFIX_OPCODE
},
2388 { "pmaddwd", { MX
, EM
}, PREFIX_OPCODE
},
2389 { "psadbw", { MX
, EM
}, PREFIX_OPCODE
},
2390 { PREFIX_TABLE (PREFIX_0FF7
) },
2392 { "psubb", { MX
, EM
}, PREFIX_OPCODE
},
2393 { "psubw", { MX
, EM
}, PREFIX_OPCODE
},
2394 { "psubd", { MX
, EM
}, PREFIX_OPCODE
},
2395 { "psubq", { MX
, EM
}, PREFIX_OPCODE
},
2396 { "paddb", { MX
, EM
}, PREFIX_OPCODE
},
2397 { "paddw", { MX
, EM
}, PREFIX_OPCODE
},
2398 { "paddd", { MX
, EM
}, PREFIX_OPCODE
},
2399 { "ud0S", { Gv
, Ev
}, 0 },
2402 static const bool onebyte_has_modrm
[256] = {
2403 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2404 /* ------------------------------- */
2405 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2406 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2407 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2408 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2409 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2410 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2411 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2412 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2413 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2414 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2415 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2416 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2417 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2418 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2419 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2420 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2421 /* ------------------------------- */
2422 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2425 static const bool twobyte_has_modrm
[256] = {
2426 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2427 /* ------------------------------- */
2428 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2429 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2430 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2431 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2432 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2433 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2434 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2435 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2436 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2437 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2438 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2439 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
2440 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2441 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2442 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2443 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
2444 /* ------------------------------- */
2445 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2455 /* If we are accessing mod/rm/reg without need_modrm set, then the
2456 values are stale. Hitting this abort likely indicates that you
2457 need to update onebyte_has_modrm or twobyte_has_modrm. */
2458 #define MODRM_CHECK if (!ins->need_modrm) abort ()
2460 static const char *const intel_index16
[] = {
2461 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
2464 static const char *const att_names64
[] = {
2465 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
2466 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
2468 static const char *const att_names32
[] = {
2469 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
2470 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
2472 static const char *const att_names16
[] = {
2473 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
2474 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
2476 static const char *const att_names8
[] = {
2477 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
2479 static const char *const att_names8rex
[] = {
2480 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
2481 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
2483 static const char *const att_names_seg
[] = {
2484 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
2486 static const char att_index64
[] = "%riz";
2487 static const char att_index32
[] = "%eiz";
2488 static const char *const att_index16
[] = {
2489 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
2492 static const char *const att_names_mm
[] = {
2493 "%mm0", "%mm1", "%mm2", "%mm3",
2494 "%mm4", "%mm5", "%mm6", "%mm7"
2497 static const char *const att_names_bnd
[] = {
2498 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
2501 static const char *const att_names_xmm
[] = {
2502 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
2503 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
2504 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
2505 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
2506 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
2507 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
2508 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
2509 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
2512 static const char *const att_names_ymm
[] = {
2513 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
2514 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
2515 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
2516 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
2517 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
2518 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
2519 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
2520 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
2523 static const char *const att_names_zmm
[] = {
2524 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
2525 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
2526 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
2527 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
2528 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
2529 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
2530 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
2531 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
2534 static const char *const att_names_tmm
[] = {
2535 "%tmm0", "%tmm1", "%tmm2", "%tmm3",
2536 "%tmm4", "%tmm5", "%tmm6", "%tmm7"
2539 static const char *const att_names_mask
[] = {
2540 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
2543 static const char *const names_rounding
[] =
2551 static const struct dis386 reg_table
[][8] = {
2554 { "addA", { Ebh1
, Ib
}, 0 },
2555 { "orA", { Ebh1
, Ib
}, 0 },
2556 { "adcA", { Ebh1
, Ib
}, 0 },
2557 { "sbbA", { Ebh1
, Ib
}, 0 },
2558 { "andA", { Ebh1
, Ib
}, 0 },
2559 { "subA", { Ebh1
, Ib
}, 0 },
2560 { "xorA", { Ebh1
, Ib
}, 0 },
2561 { "cmpA", { Eb
, Ib
}, 0 },
2565 { "addQ", { Evh1
, Iv
}, 0 },
2566 { "orQ", { Evh1
, Iv
}, 0 },
2567 { "adcQ", { Evh1
, Iv
}, 0 },
2568 { "sbbQ", { Evh1
, Iv
}, 0 },
2569 { "andQ", { Evh1
, Iv
}, 0 },
2570 { "subQ", { Evh1
, Iv
}, 0 },
2571 { "xorQ", { Evh1
, Iv
}, 0 },
2572 { "cmpQ", { Ev
, Iv
}, 0 },
2576 { "addQ", { Evh1
, sIb
}, 0 },
2577 { "orQ", { Evh1
, sIb
}, 0 },
2578 { "adcQ", { Evh1
, sIb
}, 0 },
2579 { "sbbQ", { Evh1
, sIb
}, 0 },
2580 { "andQ", { Evh1
, sIb
}, 0 },
2581 { "subQ", { Evh1
, sIb
}, 0 },
2582 { "xorQ", { Evh1
, sIb
}, 0 },
2583 { "cmpQ", { Ev
, sIb
}, 0 },
2587 { "pop{P|}", { stackEv
}, 0 },
2588 { XOP_8F_TABLE (XOP_09
) },
2592 { XOP_8F_TABLE (XOP_09
) },
2596 { "rolA", { Eb
, Ib
}, 0 },
2597 { "rorA", { Eb
, Ib
}, 0 },
2598 { "rclA", { Eb
, Ib
}, 0 },
2599 { "rcrA", { Eb
, Ib
}, 0 },
2600 { "shlA", { Eb
, Ib
}, 0 },
2601 { "shrA", { Eb
, Ib
}, 0 },
2602 { "shlA", { Eb
, Ib
}, 0 },
2603 { "sarA", { Eb
, Ib
}, 0 },
2607 { "rolQ", { Ev
, Ib
}, 0 },
2608 { "rorQ", { Ev
, Ib
}, 0 },
2609 { "rclQ", { Ev
, Ib
}, 0 },
2610 { "rcrQ", { Ev
, Ib
}, 0 },
2611 { "shlQ", { Ev
, Ib
}, 0 },
2612 { "shrQ", { Ev
, Ib
}, 0 },
2613 { "shlQ", { Ev
, Ib
}, 0 },
2614 { "sarQ", { Ev
, Ib
}, 0 },
2618 { "movA", { Ebh3
, Ib
}, 0 },
2625 { MOD_TABLE (MOD_C6_REG_7
) },
2629 { "movQ", { Evh3
, Iv
}, 0 },
2636 { MOD_TABLE (MOD_C7_REG_7
) },
2640 { "rolA", { Eb
, I1
}, 0 },
2641 { "rorA", { Eb
, I1
}, 0 },
2642 { "rclA", { Eb
, I1
}, 0 },
2643 { "rcrA", { Eb
, I1
}, 0 },
2644 { "shlA", { Eb
, I1
}, 0 },
2645 { "shrA", { Eb
, I1
}, 0 },
2646 { "shlA", { Eb
, I1
}, 0 },
2647 { "sarA", { Eb
, I1
}, 0 },
2651 { "rolQ", { Ev
, I1
}, 0 },
2652 { "rorQ", { Ev
, I1
}, 0 },
2653 { "rclQ", { Ev
, I1
}, 0 },
2654 { "rcrQ", { Ev
, I1
}, 0 },
2655 { "shlQ", { Ev
, I1
}, 0 },
2656 { "shrQ", { Ev
, I1
}, 0 },
2657 { "shlQ", { Ev
, I1
}, 0 },
2658 { "sarQ", { Ev
, I1
}, 0 },
2662 { "rolA", { Eb
, CL
}, 0 },
2663 { "rorA", { Eb
, CL
}, 0 },
2664 { "rclA", { Eb
, CL
}, 0 },
2665 { "rcrA", { Eb
, CL
}, 0 },
2666 { "shlA", { Eb
, CL
}, 0 },
2667 { "shrA", { Eb
, CL
}, 0 },
2668 { "shlA", { Eb
, CL
}, 0 },
2669 { "sarA", { Eb
, CL
}, 0 },
2673 { "rolQ", { Ev
, CL
}, 0 },
2674 { "rorQ", { Ev
, CL
}, 0 },
2675 { "rclQ", { Ev
, CL
}, 0 },
2676 { "rcrQ", { Ev
, CL
}, 0 },
2677 { "shlQ", { Ev
, CL
}, 0 },
2678 { "shrQ", { Ev
, CL
}, 0 },
2679 { "shlQ", { Ev
, CL
}, 0 },
2680 { "sarQ", { Ev
, CL
}, 0 },
2684 { "testA", { Eb
, Ib
}, 0 },
2685 { "testA", { Eb
, Ib
}, 0 },
2686 { "notA", { Ebh1
}, 0 },
2687 { "negA", { Ebh1
}, 0 },
2688 { "mulA", { Eb
}, 0 }, /* Don't print the implicit %al register, */
2689 { "imulA", { Eb
}, 0 }, /* to distinguish these opcodes from other */
2690 { "divA", { Eb
}, 0 }, /* mul/imul opcodes. Do the same for div */
2691 { "idivA", { Eb
}, 0 }, /* and idiv for consistency. */
2695 { "testQ", { Ev
, Iv
}, 0 },
2696 { "testQ", { Ev
, Iv
}, 0 },
2697 { "notQ", { Evh1
}, 0 },
2698 { "negQ", { Evh1
}, 0 },
2699 { "mulQ", { Ev
}, 0 }, /* Don't print the implicit register. */
2700 { "imulQ", { Ev
}, 0 },
2701 { "divQ", { Ev
}, 0 },
2702 { "idivQ", { Ev
}, 0 },
2706 { "incA", { Ebh1
}, 0 },
2707 { "decA", { Ebh1
}, 0 },
2711 { "incQ", { Evh1
}, 0 },
2712 { "decQ", { Evh1
}, 0 },
2713 { "call{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2714 { MOD_TABLE (MOD_FF_REG_3
) },
2715 { "jmp{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2716 { MOD_TABLE (MOD_FF_REG_5
) },
2717 { "push{P|}", { stackEv
}, 0 },
2722 { "sldtD", { Sv
}, 0 },
2723 { "strD", { Sv
}, 0 },
2724 { "lldt", { Ew
}, 0 },
2725 { "ltr", { Ew
}, 0 },
2726 { "verr", { Ew
}, 0 },
2727 { "verw", { Ew
}, 0 },
2733 { MOD_TABLE (MOD_0F01_REG_0
) },
2734 { MOD_TABLE (MOD_0F01_REG_1
) },
2735 { MOD_TABLE (MOD_0F01_REG_2
) },
2736 { MOD_TABLE (MOD_0F01_REG_3
) },
2737 { "smswD", { Sv
}, 0 },
2738 { MOD_TABLE (MOD_0F01_REG_5
) },
2739 { "lmsw", { Ew
}, 0 },
2740 { MOD_TABLE (MOD_0F01_REG_7
) },
2744 { "prefetch", { Mb
}, 0 },
2745 { "prefetchw", { Mb
}, 0 },
2746 { "prefetchwt1", { Mb
}, 0 },
2747 { "prefetch", { Mb
}, 0 },
2748 { "prefetch", { Mb
}, 0 },
2749 { "prefetch", { Mb
}, 0 },
2750 { "prefetch", { Mb
}, 0 },
2751 { "prefetch", { Mb
}, 0 },
2755 { MOD_TABLE (MOD_0F18_REG_0
) },
2756 { MOD_TABLE (MOD_0F18_REG_1
) },
2757 { MOD_TABLE (MOD_0F18_REG_2
) },
2758 { MOD_TABLE (MOD_0F18_REG_3
) },
2759 { "nopQ", { Ev
}, 0 },
2760 { "nopQ", { Ev
}, 0 },
2761 { MOD_TABLE (MOD_0F18_REG_6
) },
2762 { MOD_TABLE (MOD_0F18_REG_7
) },
2764 /* REG_0F1C_P_0_MOD_0 */
2766 { "cldemote", { Mb
}, 0 },
2767 { "nopQ", { Ev
}, 0 },
2768 { "nopQ", { Ev
}, 0 },
2769 { "nopQ", { Ev
}, 0 },
2770 { "nopQ", { Ev
}, 0 },
2771 { "nopQ", { Ev
}, 0 },
2772 { "nopQ", { Ev
}, 0 },
2773 { "nopQ", { Ev
}, 0 },
2775 /* REG_0F1E_P_1_MOD_3 */
2777 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2778 { "rdsspK", { Edq
}, 0 },
2779 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2780 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2781 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2782 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2783 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2784 { RM_TABLE (RM_0F1E_P_1_MOD_3_REG_7
) },
2786 /* REG_0F38D8_PREFIX_1 */
2788 { "aesencwide128kl", { M
}, 0 },
2789 { "aesdecwide128kl", { M
}, 0 },
2790 { "aesencwide256kl", { M
}, 0 },
2791 { "aesdecwide256kl", { M
}, 0 },
2793 /* REG_0F3A0F_PREFIX_1_MOD_3 */
2795 { RM_TABLE (RM_0F3A0F_P_1_MOD_3_REG_0
) },
2797 /* REG_0F71_MOD_0 */
2801 { "psrlw", { MS
, Ib
}, PREFIX_OPCODE
},
2803 { "psraw", { MS
, Ib
}, PREFIX_OPCODE
},
2805 { "psllw", { MS
, Ib
}, PREFIX_OPCODE
},
2807 /* REG_0F72_MOD_0 */
2811 { "psrld", { MS
, Ib
}, PREFIX_OPCODE
},
2813 { "psrad", { MS
, Ib
}, PREFIX_OPCODE
},
2815 { "pslld", { MS
, Ib
}, PREFIX_OPCODE
},
2817 /* REG_0F73_MOD_0 */
2821 { "psrlq", { MS
, Ib
}, PREFIX_OPCODE
},
2822 { "psrldq", { XS
, Ib
}, PREFIX_DATA
},
2825 { "psllq", { MS
, Ib
}, PREFIX_OPCODE
},
2826 { "pslldq", { XS
, Ib
}, PREFIX_DATA
},
2830 { "montmul", { { OP_0f07
, 0 } }, 0 },
2831 { "xsha1", { { OP_0f07
, 0 } }, 0 },
2832 { "xsha256", { { OP_0f07
, 0 } }, 0 },
2836 { "xstore-rng", { { OP_0f07
, 0 } }, 0 },
2837 { "xcrypt-ecb", { { OP_0f07
, 0 } }, 0 },
2838 { "xcrypt-cbc", { { OP_0f07
, 0 } }, 0 },
2839 { "xcrypt-ctr", { { OP_0f07
, 0 } }, 0 },
2840 { "xcrypt-cfb", { { OP_0f07
, 0 } }, 0 },
2841 { "xcrypt-ofb", { { OP_0f07
, 0 } }, 0 },
2845 { MOD_TABLE (MOD_0FAE_REG_0
) },
2846 { MOD_TABLE (MOD_0FAE_REG_1
) },
2847 { MOD_TABLE (MOD_0FAE_REG_2
) },
2848 { MOD_TABLE (MOD_0FAE_REG_3
) },
2849 { MOD_TABLE (MOD_0FAE_REG_4
) },
2850 { MOD_TABLE (MOD_0FAE_REG_5
) },
2851 { MOD_TABLE (MOD_0FAE_REG_6
) },
2852 { MOD_TABLE (MOD_0FAE_REG_7
) },
2860 { "btQ", { Ev
, Ib
}, 0 },
2861 { "btsQ", { Evh1
, Ib
}, 0 },
2862 { "btrQ", { Evh1
, Ib
}, 0 },
2863 { "btcQ", { Evh1
, Ib
}, 0 },
2868 { "cmpxchg8b", { { CMPXCHG8B_Fixup
, q_mode
} }, 0 },
2870 { MOD_TABLE (MOD_0FC7_REG_3
) },
2871 { MOD_TABLE (MOD_0FC7_REG_4
) },
2872 { MOD_TABLE (MOD_0FC7_REG_5
) },
2873 { MOD_TABLE (MOD_0FC7_REG_6
) },
2874 { MOD_TABLE (MOD_0FC7_REG_7
) },
2876 /* REG_VEX_0F71_M_0 */
2880 { "vpsrlw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2882 { "vpsraw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2884 { "vpsllw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2886 /* REG_VEX_0F72_M_0 */
2890 { "vpsrld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2892 { "vpsrad", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2894 { "vpslld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2896 /* REG_VEX_0F73_M_0 */
2900 { "vpsrlq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2901 { "vpsrldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2904 { "vpsllq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2905 { "vpslldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2911 { MOD_TABLE (MOD_VEX_0FAE_REG_2
) },
2912 { MOD_TABLE (MOD_VEX_0FAE_REG_3
) },
2914 /* REG_VEX_0F3849_X86_64_P_0_W_0_M_1 */
2916 { RM_TABLE (RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0
) },
2918 /* REG_VEX_0F38F3_L_0 */
2921 { "blsrS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2922 { "blsmskS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2923 { "blsiS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2925 /* REG_XOP_09_01_L_0 */
2928 { "blcfill", { VexGdq
, Edq
}, 0 },
2929 { "blsfill", { VexGdq
, Edq
}, 0 },
2930 { "blcs", { VexGdq
, Edq
}, 0 },
2931 { "tzmsk", { VexGdq
, Edq
}, 0 },
2932 { "blcic", { VexGdq
, Edq
}, 0 },
2933 { "blsic", { VexGdq
, Edq
}, 0 },
2934 { "t1mskc", { VexGdq
, Edq
}, 0 },
2936 /* REG_XOP_09_02_L_0 */
2939 { "blcmsk", { VexGdq
, Edq
}, 0 },
2944 { "blci", { VexGdq
, Edq
}, 0 },
2946 /* REG_XOP_09_12_M_1_L_0 */
2948 { "llwpcb", { Edq
}, 0 },
2949 { "slwpcb", { Edq
}, 0 },
2951 /* REG_XOP_0A_12_L_0 */
2953 { "lwpins", { VexGdq
, Ed
, Id
}, 0 },
2954 { "lwpval", { VexGdq
, Ed
, Id
}, 0 },
2957 #include "i386-dis-evex-reg.h"
2960 static const struct dis386 prefix_table
[][4] = {
2963 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2964 { "pause", { XX
}, 0 },
2965 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2966 { NULL
, { { NULL
, 0 } }, PREFIX_IGNORED
}
2969 /* PREFIX_0F01_REG_0_MOD_3_RM_6 */
2971 { "wrmsrns", { Skip_MODRM
}, 0 },
2972 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_1
) },
2974 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_3
) },
2977 /* PREFIX_0F01_REG_1_RM_4 */
2981 { "tdcall", { Skip_MODRM
}, 0 },
2985 /* PREFIX_0F01_REG_1_RM_5 */
2989 { X86_64_TABLE (X86_64_0F01_REG_1_RM_5_PREFIX_2
) },
2993 /* PREFIX_0F01_REG_1_RM_6 */
2997 { X86_64_TABLE (X86_64_0F01_REG_1_RM_6_PREFIX_2
) },
3001 /* PREFIX_0F01_REG_1_RM_7 */
3003 { "encls", { Skip_MODRM
}, 0 },
3005 { X86_64_TABLE (X86_64_0F01_REG_1_RM_7_PREFIX_2
) },
3009 /* PREFIX_0F01_REG_3_RM_1 */
3011 { "vmmcall", { Skip_MODRM
}, 0 },
3012 { "vmgexit", { Skip_MODRM
}, 0 },
3014 { "vmgexit", { Skip_MODRM
}, 0 },
3017 /* PREFIX_0F01_REG_5_MOD_0 */
3020 { "rstorssp", { Mq
}, PREFIX_OPCODE
},
3023 /* PREFIX_0F01_REG_5_MOD_3_RM_0 */
3025 { "serialize", { Skip_MODRM
}, PREFIX_OPCODE
},
3026 { "setssbsy", { Skip_MODRM
}, PREFIX_OPCODE
},
3028 { "xsusldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3031 /* PREFIX_0F01_REG_5_MOD_3_RM_1 */
3036 { "xresldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3039 /* PREFIX_0F01_REG_5_MOD_3_RM_2 */
3042 { "saveprevssp", { Skip_MODRM
}, PREFIX_OPCODE
},
3045 /* PREFIX_0F01_REG_5_MOD_3_RM_4 */
3048 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
) },
3051 /* PREFIX_0F01_REG_5_MOD_3_RM_5 */
3054 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
) },
3057 /* PREFIX_0F01_REG_5_MOD_3_RM_6 */
3059 { "rdpkru", { Skip_MODRM
}, 0 },
3060 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
) },
3063 /* PREFIX_0F01_REG_5_MOD_3_RM_7 */
3065 { "wrpkru", { Skip_MODRM
}, 0 },
3066 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
) },
3069 /* PREFIX_0F01_REG_7_MOD_3_RM_2 */
3071 { "monitorx", { { OP_Monitor
, 0 } }, 0 },
3072 { "mcommit", { Skip_MODRM
}, 0 },
3075 /* PREFIX_0F01_REG_7_MOD_3_RM_6 */
3077 { "invlpgb", { Skip_MODRM
}, 0 },
3078 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
) },
3080 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
) },
3083 /* PREFIX_0F01_REG_7_MOD_3_RM_7 */
3085 { "tlbsync", { Skip_MODRM
}, 0 },
3086 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
) },
3088 { "pvalidate", { Skip_MODRM
}, 0 },
3093 { "wbinvd", { XX
}, 0 },
3094 { "wbnoinvd", { XX
}, 0 },
3099 { "movups", { XM
, EXx
}, PREFIX_OPCODE
},
3100 { "movss", { XM
, EXd
}, PREFIX_OPCODE
},
3101 { "movupd", { XM
, EXx
}, PREFIX_OPCODE
},
3102 { "movsd", { XM
, EXq
}, PREFIX_OPCODE
},
3107 { "movups", { EXxS
, XM
}, PREFIX_OPCODE
},
3108 { "movss", { EXdS
, XM
}, PREFIX_OPCODE
},
3109 { "movupd", { EXxS
, XM
}, PREFIX_OPCODE
},
3110 { "movsd", { EXqS
, XM
}, PREFIX_OPCODE
},
3115 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
3116 { "movsldup", { XM
, EXx
}, PREFIX_OPCODE
},
3117 { MOD_TABLE (MOD_0F12_PREFIX_2
) },
3118 { "movddup", { XM
, EXq
}, PREFIX_OPCODE
},
3123 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
3124 { "movshdup", { XM
, EXx
}, PREFIX_OPCODE
},
3125 { MOD_TABLE (MOD_0F16_PREFIX_2
) },
3128 /* PREFIX_0F18_REG_6_MOD_0_X86_64 */
3130 { "prefetchit1", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3131 { "nopQ", { Ev
}, 0 },
3132 { "nopQ", { Ev
}, 0 },
3133 { "nopQ", { Ev
}, 0 },
3136 /* PREFIX_0F18_REG_7_MOD_0_X86_64 */
3138 { "prefetchit0", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3139 { "nopQ", { Ev
}, 0 },
3140 { "nopQ", { Ev
}, 0 },
3141 { "nopQ", { Ev
}, 0 },
3146 { MOD_TABLE (MOD_0F1A_PREFIX_0
) },
3147 { "bndcl", { Gbnd
, Ev_bnd
}, 0 },
3148 { "bndmov", { Gbnd
, Ebnd
}, 0 },
3149 { "bndcu", { Gbnd
, Ev_bnd
}, 0 },
3154 { MOD_TABLE (MOD_0F1B_PREFIX_0
) },
3155 { MOD_TABLE (MOD_0F1B_PREFIX_1
) },
3156 { "bndmov", { EbndS
, Gbnd
}, 0 },
3157 { "bndcn", { Gbnd
, Ev_bnd
}, 0 },
3162 { MOD_TABLE (MOD_0F1C_PREFIX_0
) },
3163 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3164 { "nopQ", { Ev
}, 0 },
3165 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3170 { "nopQ", { Ev
}, 0 },
3171 { MOD_TABLE (MOD_0F1E_PREFIX_1
) },
3172 { "nopQ", { Ev
}, 0 },
3173 { NULL
, { XX
}, PREFIX_IGNORED
},
3178 { "cvtpi2ps", { XM
, EMCq
}, PREFIX_OPCODE
},
3179 { "cvtsi2ss{%LQ|}", { XM
, Edq
}, PREFIX_OPCODE
},
3180 { "cvtpi2pd", { XM
, EMCq
}, PREFIX_OPCODE
},
3181 { "cvtsi2sd{%LQ|}", { XM
, Edq
}, 0 },
3186 { MOD_TABLE (MOD_0F2B_PREFIX_0
) },
3187 { MOD_TABLE (MOD_0F2B_PREFIX_1
) },
3188 { MOD_TABLE (MOD_0F2B_PREFIX_2
) },
3189 { MOD_TABLE (MOD_0F2B_PREFIX_3
) },
3194 { "cvttps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3195 { "cvttss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3196 { "cvttpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3197 { "cvttsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3202 { "cvtps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3203 { "cvtss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3204 { "cvtpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3205 { "cvtsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3210 { "ucomiss",{ XM
, EXd
}, 0 },
3212 { "ucomisd",{ XM
, EXq
}, 0 },
3217 { "comiss", { XM
, EXd
}, 0 },
3219 { "comisd", { XM
, EXq
}, 0 },
3224 { "sqrtps", { XM
, EXx
}, PREFIX_OPCODE
},
3225 { "sqrtss", { XM
, EXd
}, PREFIX_OPCODE
},
3226 { "sqrtpd", { XM
, EXx
}, PREFIX_OPCODE
},
3227 { "sqrtsd", { XM
, EXq
}, PREFIX_OPCODE
},
3232 { "rsqrtps",{ XM
, EXx
}, PREFIX_OPCODE
},
3233 { "rsqrtss",{ XM
, EXd
}, PREFIX_OPCODE
},
3238 { "rcpps", { XM
, EXx
}, PREFIX_OPCODE
},
3239 { "rcpss", { XM
, EXd
}, PREFIX_OPCODE
},
3244 { "addps", { XM
, EXx
}, PREFIX_OPCODE
},
3245 { "addss", { XM
, EXd
}, PREFIX_OPCODE
},
3246 { "addpd", { XM
, EXx
}, PREFIX_OPCODE
},
3247 { "addsd", { XM
, EXq
}, PREFIX_OPCODE
},
3252 { "mulps", { XM
, EXx
}, PREFIX_OPCODE
},
3253 { "mulss", { XM
, EXd
}, PREFIX_OPCODE
},
3254 { "mulpd", { XM
, EXx
}, PREFIX_OPCODE
},
3255 { "mulsd", { XM
, EXq
}, PREFIX_OPCODE
},
3260 { "cvtps2pd", { XM
, EXq
}, PREFIX_OPCODE
},
3261 { "cvtss2sd", { XM
, EXd
}, PREFIX_OPCODE
},
3262 { "cvtpd2ps", { XM
, EXx
}, PREFIX_OPCODE
},
3263 { "cvtsd2ss", { XM
, EXq
}, PREFIX_OPCODE
},
3268 { "cvtdq2ps", { XM
, EXx
}, PREFIX_OPCODE
},
3269 { "cvttps2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3270 { "cvtps2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3275 { "subps", { XM
, EXx
}, PREFIX_OPCODE
},
3276 { "subss", { XM
, EXd
}, PREFIX_OPCODE
},
3277 { "subpd", { XM
, EXx
}, PREFIX_OPCODE
},
3278 { "subsd", { XM
, EXq
}, PREFIX_OPCODE
},
3283 { "minps", { XM
, EXx
}, PREFIX_OPCODE
},
3284 { "minss", { XM
, EXd
}, PREFIX_OPCODE
},
3285 { "minpd", { XM
, EXx
}, PREFIX_OPCODE
},
3286 { "minsd", { XM
, EXq
}, PREFIX_OPCODE
},
3291 { "divps", { XM
, EXx
}, PREFIX_OPCODE
},
3292 { "divss", { XM
, EXd
}, PREFIX_OPCODE
},
3293 { "divpd", { XM
, EXx
}, PREFIX_OPCODE
},
3294 { "divsd", { XM
, EXq
}, PREFIX_OPCODE
},
3299 { "maxps", { XM
, EXx
}, PREFIX_OPCODE
},
3300 { "maxss", { XM
, EXd
}, PREFIX_OPCODE
},
3301 { "maxpd", { XM
, EXx
}, PREFIX_OPCODE
},
3302 { "maxsd", { XM
, EXq
}, PREFIX_OPCODE
},
3307 { "punpcklbw",{ MX
, EMd
}, PREFIX_OPCODE
},
3309 { "punpcklbw",{ MX
, EMx
}, PREFIX_OPCODE
},
3314 { "punpcklwd",{ MX
, EMd
}, PREFIX_OPCODE
},
3316 { "punpcklwd",{ MX
, EMx
}, PREFIX_OPCODE
},
3321 { "punpckldq",{ MX
, EMd
}, PREFIX_OPCODE
},
3323 { "punpckldq",{ MX
, EMx
}, PREFIX_OPCODE
},
3328 { "movq", { MX
, EM
}, PREFIX_OPCODE
},
3329 { "movdqu", { XM
, EXx
}, PREFIX_OPCODE
},
3330 { "movdqa", { XM
, EXx
}, PREFIX_OPCODE
},
3335 { "pshufw", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
3336 { "pshufhw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3337 { "pshufd", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3338 { "pshuflw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3343 {"vmread", { Em
, Gm
}, 0 },
3345 {"extrq", { XS
, Ib
, Ib
}, 0 },
3346 {"insertq", { XM
, XS
, Ib
, Ib
}, 0 },
3351 {"vmwrite", { Gm
, Em
}, 0 },
3353 {"extrq", { XM
, XS
}, 0 },
3354 {"insertq", { XM
, XS
}, 0 },
3361 { "haddpd", { XM
, EXx
}, PREFIX_OPCODE
},
3362 { "haddps", { XM
, EXx
}, PREFIX_OPCODE
},
3369 { "hsubpd", { XM
, EXx
}, PREFIX_OPCODE
},
3370 { "hsubps", { XM
, EXx
}, PREFIX_OPCODE
},
3375 { "movK", { Edq
, MX
}, PREFIX_OPCODE
},
3376 { "movq", { XM
, EXq
}, PREFIX_OPCODE
},
3377 { "movK", { Edq
, XM
}, PREFIX_OPCODE
},
3382 { "movq", { EMS
, MX
}, PREFIX_OPCODE
},
3383 { "movdqu", { EXxS
, XM
}, PREFIX_OPCODE
},
3384 { "movdqa", { EXxS
, XM
}, PREFIX_OPCODE
},
3387 /* PREFIX_0FAE_REG_0_MOD_3 */
3390 { "rdfsbase", { Ev
}, 0 },
3393 /* PREFIX_0FAE_REG_1_MOD_3 */
3396 { "rdgsbase", { Ev
}, 0 },
3399 /* PREFIX_0FAE_REG_2_MOD_3 */
3402 { "wrfsbase", { Ev
}, 0 },
3405 /* PREFIX_0FAE_REG_3_MOD_3 */
3408 { "wrgsbase", { Ev
}, 0 },
3411 /* PREFIX_0FAE_REG_4_MOD_0 */
3413 { "xsave", { FXSAVE
}, 0 },
3414 { "ptwrite{%LQ|}", { Edq
}, 0 },
3417 /* PREFIX_0FAE_REG_4_MOD_3 */
3420 { "ptwrite{%LQ|}", { Edq
}, 0 },
3423 /* PREFIX_0FAE_REG_5_MOD_3 */
3425 { "lfence", { Skip_MODRM
}, 0 },
3426 { "incsspK", { Edq
}, PREFIX_OPCODE
},
3429 /* PREFIX_0FAE_REG_6_MOD_0 */
3431 { "xsaveopt", { FXSAVE
}, PREFIX_OPCODE
},
3432 { "clrssbsy", { Mq
}, PREFIX_OPCODE
},
3433 { "clwb", { Mb
}, PREFIX_OPCODE
},
3436 /* PREFIX_0FAE_REG_6_MOD_3 */
3438 { RM_TABLE (RM_0FAE_REG_6_MOD_3_P_0
) },
3439 { "umonitor", { Eva
}, PREFIX_OPCODE
},
3440 { "tpause", { Edq
}, PREFIX_OPCODE
},
3441 { "umwait", { Edq
}, PREFIX_OPCODE
},
3444 /* PREFIX_0FAE_REG_7_MOD_0 */
3446 { "clflush", { Mb
}, 0 },
3448 { "clflushopt", { Mb
}, 0 },
3454 { "popcntS", { Gv
, Ev
}, 0 },
3459 { "bsfS", { Gv
, Ev
}, 0 },
3460 { "tzcntS", { Gv
, Ev
}, 0 },
3461 { "bsfS", { Gv
, Ev
}, 0 },
3466 { "bsrS", { Gv
, Ev
}, 0 },
3467 { "lzcntS", { Gv
, Ev
}, 0 },
3468 { "bsrS", { Gv
, Ev
}, 0 },
3473 { "cmpps", { XM
, EXx
, CMP
}, PREFIX_OPCODE
},
3474 { "cmpss", { XM
, EXd
, CMP
}, PREFIX_OPCODE
},
3475 { "cmppd", { XM
, EXx
, CMP
}, PREFIX_OPCODE
},
3476 { "cmpsd", { XM
, EXq
, CMP
}, PREFIX_OPCODE
},
3479 /* PREFIX_0FC7_REG_6_MOD_0 */
3481 { "vmptrld",{ Mq
}, 0 },
3482 { "vmxon", { Mq
}, 0 },
3483 { "vmclear",{ Mq
}, 0 },
3486 /* PREFIX_0FC7_REG_6_MOD_3 */
3488 { "rdrand", { Ev
}, 0 },
3489 { X86_64_TABLE (X86_64_0FC7_REG_6_MOD_3_PREFIX_1
) },
3490 { "rdrand", { Ev
}, 0 }
3493 /* PREFIX_0FC7_REG_7_MOD_3 */
3495 { "rdseed", { Ev
}, 0 },
3496 { "rdpid", { Em
}, 0 },
3497 { "rdseed", { Ev
}, 0 },
3504 { "addsubpd", { XM
, EXx
}, 0 },
3505 { "addsubps", { XM
, EXx
}, 0 },
3511 { "movq2dq",{ XM
, MS
}, 0 },
3512 { "movq", { EXqS
, XM
}, 0 },
3513 { "movdq2q",{ MX
, XS
}, 0 },
3519 { "cvtdq2pd", { XM
, EXq
}, PREFIX_OPCODE
},
3520 { "cvttpd2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3521 { "cvtpd2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3526 { "movntq", { Mq
, MX
}, PREFIX_OPCODE
},
3528 { MOD_TABLE (MOD_0FE7_PREFIX_2
) },
3536 { MOD_TABLE (MOD_0FF0_PREFIX_3
) },
3541 { "maskmovq", { MX
, MS
}, PREFIX_OPCODE
},
3543 { "maskmovdqu", { XM
, XS
}, PREFIX_OPCODE
},
3549 { REG_TABLE (REG_0F38D8_PREFIX_1
) },
3555 { MOD_TABLE (MOD_0F38DC_PREFIX_1
) },
3556 { "aesenc", { XM
, EXx
}, 0 },
3562 { MOD_TABLE (MOD_0F38DD_PREFIX_1
) },
3563 { "aesenclast", { XM
, EXx
}, 0 },
3569 { MOD_TABLE (MOD_0F38DE_PREFIX_1
) },
3570 { "aesdec", { XM
, EXx
}, 0 },
3576 { MOD_TABLE (MOD_0F38DF_PREFIX_1
) },
3577 { "aesdeclast", { XM
, EXx
}, 0 },
3582 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3584 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3585 { "crc32A", { Gdq
, Eb
}, PREFIX_OPCODE
},
3590 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3592 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3593 { "crc32Q", { Gdq
, Ev
}, PREFIX_OPCODE
},
3598 { MOD_TABLE (MOD_0F38F6_PREFIX_0
) },
3599 { "adoxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3600 { "adcxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3607 { MOD_TABLE (MOD_0F38F8_PREFIX_1
) },
3608 { MOD_TABLE (MOD_0F38F8_PREFIX_2
) },
3609 { MOD_TABLE (MOD_0F38F8_PREFIX_3
) },
3614 { MOD_TABLE (MOD_0F38FA_PREFIX_1
) },
3620 { MOD_TABLE (MOD_0F38FB_PREFIX_1
) },
3626 { MOD_TABLE (MOD_0F3A0F_PREFIX_1
)},
3629 /* PREFIX_VEX_0F10 */
3631 { "%XEvmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3632 { "%XEvmovs%XS", { XMScalar
, VexScalarR
, EXd
}, 0 },
3633 { "%XEvmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3634 { "%XEvmovs%XD", { XMScalar
, VexScalarR
, EXq
}, 0 },
3637 /* PREFIX_VEX_0F11 */
3639 { "%XEvmovupX", { EXxS
, XM
}, 0 },
3640 { "%XEvmovs%XS", { EXdS
, VexScalarR
, XMScalar
}, 0 },
3641 { "%XEvmovupX", { EXxS
, XM
}, 0 },
3642 { "%XEvmovs%XD", { EXqS
, VexScalarR
, XMScalar
}, 0 },
3645 /* PREFIX_VEX_0F12 */
3647 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0
) },
3648 { "%XEvmov%XSldup", { XM
, EXEvexXNoBcst
}, 0 },
3649 { MOD_TABLE (MOD_VEX_0F12_PREFIX_2
) },
3650 { "%XEvmov%XDdup", { XM
, EXymmq
}, 0 },
3653 /* PREFIX_VEX_0F16 */
3655 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0
) },
3656 { "%XEvmov%XShdup", { XM
, EXEvexXNoBcst
}, 0 },
3657 { MOD_TABLE (MOD_VEX_0F16_PREFIX_2
) },
3660 /* PREFIX_VEX_0F2A */
3663 { "%XEvcvtsi2ss{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR
, Edq
}, 0 },
3665 { "%XEvcvtsi2sd{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR64
, Edq
}, 0 },
3668 /* PREFIX_VEX_0F2C */
3671 { "%XEvcvttss2si", { Gdq
, EXd
, EXxEVexS
}, 0 },
3673 { "%XEvcvttsd2si", { Gdq
, EXq
, EXxEVexS
}, 0 },
3676 /* PREFIX_VEX_0F2D */
3679 { "%XEvcvtss2si", { Gdq
, EXd
, EXxEVexR
}, 0 },
3681 { "%XEvcvtsd2si", { Gdq
, EXq
, EXxEVexR
}, 0 },
3684 /* PREFIX_VEX_0F2E */
3686 { "%XEvucomisX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3688 { "%XEvucomisX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3691 /* PREFIX_VEX_0F2F */
3693 { "%XEvcomisX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3695 { "%XEvcomisX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3698 /* PREFIX_VEX_0F41_L_1_M_1_W_0 */
3700 { "kandw", { MaskG
, MaskVex
, MaskE
}, 0 },
3702 { "kandb", { MaskG
, MaskVex
, MaskE
}, 0 },
3705 /* PREFIX_VEX_0F41_L_1_M_1_W_1 */
3707 { "kandq", { MaskG
, MaskVex
, MaskE
}, 0 },
3709 { "kandd", { MaskG
, MaskVex
, MaskE
}, 0 },
3712 /* PREFIX_VEX_0F42_L_1_M_1_W_0 */
3714 { "kandnw", { MaskG
, MaskVex
, MaskE
}, 0 },
3716 { "kandnb", { MaskG
, MaskVex
, MaskE
}, 0 },
3719 /* PREFIX_VEX_0F42_L_1_M_1_W_1 */
3721 { "kandnq", { MaskG
, MaskVex
, MaskE
}, 0 },
3723 { "kandnd", { MaskG
, MaskVex
, MaskE
}, 0 },
3726 /* PREFIX_VEX_0F44_L_0_M_1_W_0 */
3728 { "knotw", { MaskG
, MaskE
}, 0 },
3730 { "knotb", { MaskG
, MaskE
}, 0 },
3733 /* PREFIX_VEX_0F44_L_0_M_1_W_1 */
3735 { "knotq", { MaskG
, MaskE
}, 0 },
3737 { "knotd", { MaskG
, MaskE
}, 0 },
3740 /* PREFIX_VEX_0F45_L_1_M_1_W_0 */
3742 { "korw", { MaskG
, MaskVex
, MaskE
}, 0 },
3744 { "korb", { MaskG
, MaskVex
, MaskE
}, 0 },
3747 /* PREFIX_VEX_0F45_L_1_M_1_W_1 */
3749 { "korq", { MaskG
, MaskVex
, MaskE
}, 0 },
3751 { "kord", { MaskG
, MaskVex
, MaskE
}, 0 },
3754 /* PREFIX_VEX_0F46_L_1_M_1_W_0 */
3756 { "kxnorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3758 { "kxnorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3761 /* PREFIX_VEX_0F46_L_1_M_1_W_1 */
3763 { "kxnorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3765 { "kxnord", { MaskG
, MaskVex
, MaskE
}, 0 },
3768 /* PREFIX_VEX_0F47_L_1_M_1_W_0 */
3770 { "kxorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3772 { "kxorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3775 /* PREFIX_VEX_0F47_L_1_M_1_W_1 */
3777 { "kxorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3779 { "kxord", { MaskG
, MaskVex
, MaskE
}, 0 },
3782 /* PREFIX_VEX_0F4A_L_1_M_1_W_0 */
3784 { "kaddw", { MaskG
, MaskVex
, MaskE
}, 0 },
3786 { "kaddb", { MaskG
, MaskVex
, MaskE
}, 0 },
3789 /* PREFIX_VEX_0F4A_L_1_M_1_W_1 */
3791 { "kaddq", { MaskG
, MaskVex
, MaskE
}, 0 },
3793 { "kaddd", { MaskG
, MaskVex
, MaskE
}, 0 },
3796 /* PREFIX_VEX_0F4B_L_1_M_1_W_0 */
3798 { "kunpckwd", { MaskG
, MaskVex
, MaskE
}, 0 },
3800 { "kunpckbw", { MaskG
, MaskVex
, MaskE
}, 0 },
3803 /* PREFIX_VEX_0F4B_L_1_M_1_W_1 */
3805 { "kunpckdq", { MaskG
, MaskVex
, MaskE
}, 0 },
3808 /* PREFIX_VEX_0F51 */
3810 { "%XEvsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3811 { "%XEvsqrts%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3812 { "%XEvsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3813 { "%XEvsqrts%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3816 /* PREFIX_VEX_0F52 */
3818 { "vrsqrtps", { XM
, EXx
}, 0 },
3819 { "vrsqrtss", { XMScalar
, VexScalar
, EXd
}, 0 },
3822 /* PREFIX_VEX_0F53 */
3824 { "vrcpps", { XM
, EXx
}, 0 },
3825 { "vrcpss", { XMScalar
, VexScalar
, EXd
}, 0 },
3828 /* PREFIX_VEX_0F58 */
3830 { "%XEvaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3831 { "%XEvadds%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3832 { "%XEvaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3833 { "%XEvadds%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3836 /* PREFIX_VEX_0F59 */
3838 { "%XEvmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3839 { "%XEvmuls%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3840 { "%XEvmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3841 { "%XEvmuls%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3844 /* PREFIX_VEX_0F5A */
3846 { "%XEvcvtp%XS2pd", { XM
, EXEvexHalfBcstXmmq
, EXxEVexS
}, 0 },
3847 { "%XEvcvts%XS2sd", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3848 { "%XEvcvtp%XD2ps%XY", { XMxmmq
, EXx
, EXxEVexR
}, 0 },
3849 { "%XEvcvts%XD2ss", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3852 /* PREFIX_VEX_0F5B */
3854 { "vcvtdq2ps", { XM
, EXx
}, 0 },
3855 { "vcvttps2dq", { XM
, EXx
}, 0 },
3856 { "vcvtps2dq", { XM
, EXx
}, 0 },
3859 /* PREFIX_VEX_0F5C */
3861 { "%XEvsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3862 { "%XEvsubs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3863 { "%XEvsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3864 { "%XEvsubs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3867 /* PREFIX_VEX_0F5D */
3869 { "%XEvminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3870 { "%XEvmins%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3871 { "%XEvminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3872 { "%XEvmins%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3875 /* PREFIX_VEX_0F5E */
3877 { "%XEvdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3878 { "%XEvdivs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3879 { "%XEvdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3880 { "%XEvdivs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3883 /* PREFIX_VEX_0F5F */
3885 { "%XEvmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3886 { "%XEvmaxs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3887 { "%XEvmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3888 { "%XEvmaxs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3891 /* PREFIX_VEX_0F6F */
3894 { "vmovdqu", { XM
, EXx
}, 0 },
3895 { "vmovdqa", { XM
, EXx
}, 0 },
3898 /* PREFIX_VEX_0F70 */
3901 { "vpshufhw", { XM
, EXx
, Ib
}, 0 },
3902 { "vpshufd", { XM
, EXx
, Ib
}, 0 },
3903 { "vpshuflw", { XM
, EXx
, Ib
}, 0 },
3906 /* PREFIX_VEX_0F7C */
3910 { "vhaddpd", { XM
, Vex
, EXx
}, 0 },
3911 { "vhaddps", { XM
, Vex
, EXx
}, 0 },
3914 /* PREFIX_VEX_0F7D */
3918 { "vhsubpd", { XM
, Vex
, EXx
}, 0 },
3919 { "vhsubps", { XM
, Vex
, EXx
}, 0 },
3922 /* PREFIX_VEX_0F7E */
3925 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1
) },
3926 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2
) },
3929 /* PREFIX_VEX_0F7F */
3932 { "vmovdqu", { EXxS
, XM
}, 0 },
3933 { "vmovdqa", { EXxS
, XM
}, 0 },
3936 /* PREFIX_VEX_0F90_L_0_W_0 */
3938 { "kmovw", { MaskG
, MaskE
}, 0 },
3940 { "kmovb", { MaskG
, MaskBDE
}, 0 },
3943 /* PREFIX_VEX_0F90_L_0_W_1 */
3945 { "kmovq", { MaskG
, MaskE
}, 0 },
3947 { "kmovd", { MaskG
, MaskBDE
}, 0 },
3950 /* PREFIX_VEX_0F91_L_0_M_0_W_0 */
3952 { "kmovw", { Ew
, MaskG
}, 0 },
3954 { "kmovb", { Eb
, MaskG
}, 0 },
3957 /* PREFIX_VEX_0F91_L_0_M_0_W_1 */
3959 { "kmovq", { Eq
, MaskG
}, 0 },
3961 { "kmovd", { Ed
, MaskG
}, 0 },
3964 /* PREFIX_VEX_0F92_L_0_M_1_W_0 */
3966 { "kmovw", { MaskG
, Edq
}, 0 },
3968 { "kmovb", { MaskG
, Edq
}, 0 },
3969 { "kmovd", { MaskG
, Edq
}, 0 },
3972 /* PREFIX_VEX_0F92_L_0_M_1_W_1 */
3977 { "kmovK", { MaskG
, Edq
}, 0 },
3980 /* PREFIX_VEX_0F93_L_0_M_1_W_0 */
3982 { "kmovw", { Gdq
, MaskE
}, 0 },
3984 { "kmovb", { Gdq
, MaskE
}, 0 },
3985 { "kmovd", { Gdq
, MaskE
}, 0 },
3988 /* PREFIX_VEX_0F93_L_0_M_1_W_1 */
3993 { "kmovK", { Gdq
, MaskE
}, 0 },
3996 /* PREFIX_VEX_0F98_L_0_M_1_W_0 */
3998 { "kortestw", { MaskG
, MaskE
}, 0 },
4000 { "kortestb", { MaskG
, MaskE
}, 0 },
4003 /* PREFIX_VEX_0F98_L_0_M_1_W_1 */
4005 { "kortestq", { MaskG
, MaskE
}, 0 },
4007 { "kortestd", { MaskG
, MaskE
}, 0 },
4010 /* PREFIX_VEX_0F99_L_0_M_1_W_0 */
4012 { "ktestw", { MaskG
, MaskE
}, 0 },
4014 { "ktestb", { MaskG
, MaskE
}, 0 },
4017 /* PREFIX_VEX_0F99_L_0_M_1_W_1 */
4019 { "ktestq", { MaskG
, MaskE
}, 0 },
4021 { "ktestd", { MaskG
, MaskE
}, 0 },
4024 /* PREFIX_VEX_0FC2 */
4026 { "vcmpps", { XM
, Vex
, EXx
, CMP
}, 0 },
4027 { "vcmpss", { XMScalar
, VexScalar
, EXd
, CMP
}, 0 },
4028 { "vcmppd", { XM
, Vex
, EXx
, CMP
}, 0 },
4029 { "vcmpsd", { XMScalar
, VexScalar
, EXq
, CMP
}, 0 },
4032 /* PREFIX_VEX_0FD0 */
4036 { "vaddsubpd", { XM
, Vex
, EXx
}, 0 },
4037 { "vaddsubps", { XM
, Vex
, EXx
}, 0 },
4040 /* PREFIX_VEX_0FE6 */
4043 { "vcvtdq2pd", { XM
, EXxmmq
}, 0 },
4044 { "vcvttpd2dq%XY", { XMM
, EXx
}, 0 },
4045 { "vcvtpd2dq%XY", { XMM
, EXx
}, 0 },
4048 /* PREFIX_VEX_0FF0 */
4053 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3
) },
4056 /* PREFIX_VEX_0F3849_X86_64 */
4058 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_0
) },
4060 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_2
) },
4061 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_3
) },
4064 /* PREFIX_VEX_0F384B_X86_64 */
4067 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_1
) },
4068 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_2
) },
4069 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_3
) },
4072 /* PREFIX_VEX_0F3850_W_0 */
4074 { "vpdpbuud", { XM
, Vex
, EXx
}, 0 },
4075 { "vpdpbsud", { XM
, Vex
, EXx
}, 0 },
4076 { "%XVvpdpbusd", { XM
, Vex
, EXx
}, 0 },
4077 { "vpdpbssd", { XM
, Vex
, EXx
}, 0 },
4080 /* PREFIX_VEX_0F3851_W_0 */
4082 { "vpdpbuuds", { XM
, Vex
, EXx
}, 0 },
4083 { "vpdpbsuds", { XM
, Vex
, EXx
}, 0 },
4084 { "%XVvpdpbusds", { XM
, Vex
, EXx
}, 0 },
4085 { "vpdpbssds", { XM
, Vex
, EXx
}, 0 },
4087 /* PREFIX_VEX_0F385C_X86_64 */
4090 { VEX_W_TABLE (VEX_W_0F385C_X86_64_P_1
) },
4092 { VEX_W_TABLE (VEX_W_0F385C_X86_64_P_3
) },
4095 /* PREFIX_VEX_0F385E_X86_64 */
4097 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_0
) },
4098 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_1
) },
4099 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_2
) },
4100 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_3
) },
4103 /* PREFIX_VEX_0F3872 */
4106 { VEX_W_TABLE (VEX_W_0F3872_P_1
) },
4109 /* PREFIX_VEX_0F38B0_W_0 */
4111 { "vcvtneoph2ps", { XM
, Mx
}, 0 },
4112 { "vcvtneebf162ps", { XM
, Mx
}, 0 },
4113 { "vcvtneeph2ps", { XM
, Mx
}, 0 },
4114 { "vcvtneobf162ps", { XM
, Mx
}, 0 },
4117 /* PREFIX_VEX_0F38B1_W_0 */
4120 { "vbcstnebf162ps", { XM
, Mw
}, 0 },
4121 { "vbcstnesh2ps", { XM
, Mw
}, 0 },
4124 /* PREFIX_VEX_0F38F5_L_0 */
4126 { "bzhiS", { Gdq
, Edq
, VexGdq
}, 0 },
4127 { "pextS", { Gdq
, VexGdq
, Edq
}, 0 },
4129 { "pdepS", { Gdq
, VexGdq
, Edq
}, 0 },
4132 /* PREFIX_VEX_0F38F6_L_0 */
4137 { "mulxS", { Gdq
, VexGdq
, Edq
}, 0 },
4140 /* PREFIX_VEX_0F38F7_L_0 */
4142 { "bextrS", { Gdq
, Edq
, VexGdq
}, 0 },
4143 { "sarxS", { Gdq
, Edq
, VexGdq
}, 0 },
4144 { "shlxS", { Gdq
, Edq
, VexGdq
}, 0 },
4145 { "shrxS", { Gdq
, Edq
, VexGdq
}, 0 },
4148 /* PREFIX_VEX_0F3AF0_L_0 */
4153 { "rorxS", { Gdq
, Edq
, Ib
}, 0 },
4156 #include "i386-dis-evex-prefix.h"
4159 static const struct dis386 x86_64_table
[][2] = {
4162 { "pushP", { es
}, 0 },
4167 { "popP", { es
}, 0 },
4172 { "pushP", { cs
}, 0 },
4177 { "pushP", { ss
}, 0 },
4182 { "popP", { ss
}, 0 },
4187 { "pushP", { ds
}, 0 },
4192 { "popP", { ds
}, 0 },
4197 { "daa", { XX
}, 0 },
4202 { "das", { XX
}, 0 },
4207 { "aaa", { XX
}, 0 },
4212 { "aas", { XX
}, 0 },
4217 { "pushaP", { XX
}, 0 },
4222 { "popaP", { XX
}, 0 },
4227 { MOD_TABLE (MOD_62_32BIT
) },
4228 { EVEX_TABLE (EVEX_0F
) },
4233 { "arpl", { Ew
, Gw
}, 0 },
4234 { "movs", { Gv
, { MOVSXD_Fixup
, movsxd_mode
} }, 0 },
4239 { "ins{R|}", { Yzr
, indirDX
}, 0 },
4240 { "ins{G|}", { Yzr
, indirDX
}, 0 },
4245 { "outs{R|}", { indirDXr
, Xz
}, 0 },
4246 { "outs{G|}", { indirDXr
, Xz
}, 0 },
4251 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
4252 { REG_TABLE (REG_80
) },
4257 { "{l|}call{P|}", { Ap
}, 0 },
4262 { "retP", { Iw
, BND
}, 0 },
4263 { "ret@", { Iw
, BND
}, 0 },
4268 { "retP", { BND
}, 0 },
4269 { "ret@", { BND
}, 0 },
4274 { MOD_TABLE (MOD_C4_32BIT
) },
4275 { VEX_C4_TABLE (VEX_0F
) },
4280 { MOD_TABLE (MOD_C5_32BIT
) },
4281 { VEX_C5_TABLE (VEX_0F
) },
4286 { "into", { XX
}, 0 },
4291 { "aam", { Ib
}, 0 },
4296 { "aad", { Ib
}, 0 },
4301 { "callP", { Jv
, BND
}, 0 },
4302 { "call@", { Jv
, BND
}, 0 }
4307 { "jmpP", { Jv
, BND
}, 0 },
4308 { "jmp@", { Jv
, BND
}, 0 }
4313 { "{l|}jmp{P|}", { Ap
}, 0 },
4316 /* X86_64_0F01_REG_0 */
4318 { "sgdt{Q|Q}", { M
}, 0 },
4319 { "sgdt", { M
}, 0 },
4322 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_1 */
4325 { "wrmsrlist", { Skip_MODRM
}, 0 },
4328 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_3 */
4331 { "rdmsrlist", { Skip_MODRM
}, 0 },
4334 /* X86_64_0F01_REG_1 */
4336 { "sidt{Q|Q}", { M
}, 0 },
4337 { "sidt", { M
}, 0 },
4340 /* X86_64_0F01_REG_1_RM_5_PREFIX_2 */
4343 { "seamret", { Skip_MODRM
}, 0 },
4346 /* X86_64_0F01_REG_1_RM_6_PREFIX_2 */
4349 { "seamops", { Skip_MODRM
}, 0 },
4352 /* X86_64_0F01_REG_1_RM_7_PREFIX_2 */
4355 { "seamcall", { Skip_MODRM
}, 0 },
4358 /* X86_64_0F01_REG_2 */
4360 { "lgdt{Q|Q}", { M
}, 0 },
4361 { "lgdt", { M
}, 0 },
4364 /* X86_64_0F01_REG_3 */
4366 { "lidt{Q|Q}", { M
}, 0 },
4367 { "lidt", { M
}, 0 },
4370 /* X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1 */
4373 { "uiret", { Skip_MODRM
}, 0 },
4376 /* X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1 */
4379 { "testui", { Skip_MODRM
}, 0 },
4382 /* X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1 */
4385 { "clui", { Skip_MODRM
}, 0 },
4388 /* X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1 */
4391 { "stui", { Skip_MODRM
}, 0 },
4394 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1 */
4397 { "rmpadjust", { Skip_MODRM
}, 0 },
4400 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3 */
4403 { "rmpupdate", { Skip_MODRM
}, 0 },
4406 /* X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1 */
4409 { "psmash", { Skip_MODRM
}, 0 },
4412 /* X86_64_0F18_REG_6_MOD_0 */
4414 { "nopQ", { Ev
}, 0 },
4415 { PREFIX_TABLE (PREFIX_0F18_REG_6_MOD_0_X86_64
) },
4418 /* X86_64_0F18_REG_7_MOD_0 */
4420 { "nopQ", { Ev
}, 0 },
4421 { PREFIX_TABLE (PREFIX_0F18_REG_7_MOD_0_X86_64
) },
4426 { "movZ", { Em
, Td
}, 0 },
4431 { "movZ", { Td
, Em
}, 0 },
4434 /* X86_64_0FC7_REG_6_MOD_3_PREFIX_1 */
4437 { "senduipi", { Eq
}, 0 },
4440 /* X86_64_VEX_0F3849 */
4443 { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64
) },
4446 /* X86_64_VEX_0F384B */
4449 { PREFIX_TABLE (PREFIX_VEX_0F384B_X86_64
) },
4452 /* X86_64_VEX_0F385C */
4455 { PREFIX_TABLE (PREFIX_VEX_0F385C_X86_64
) },
4458 /* X86_64_VEX_0F385E */
4461 { PREFIX_TABLE (PREFIX_VEX_0F385E_X86_64
) },
4464 /* X86_64_VEX_0F38E0 */
4467 { "cmpoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4470 /* X86_64_VEX_0F38E1 */
4473 { "cmpnoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4476 /* X86_64_VEX_0F38E2 */
4479 { "cmpbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4482 /* X86_64_VEX_0F38E3 */
4485 { "cmpnbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4488 /* X86_64_VEX_0F38E4 */
4491 { "cmpzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4494 /* X86_64_VEX_0F38E5 */
4497 { "cmpnzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4500 /* X86_64_VEX_0F38E6 */
4503 { "cmpbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4506 /* X86_64_VEX_0F38E7 */
4509 { "cmpnbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4512 /* X86_64_VEX_0F38E8 */
4515 { "cmpsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4518 /* X86_64_VEX_0F38E9 */
4521 { "cmpnsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4524 /* X86_64_VEX_0F38EA */
4527 { "cmppxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4530 /* X86_64_VEX_0F38EB */
4533 { "cmpnpxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4536 /* X86_64_VEX_0F38EC */
4539 { "cmplxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4542 /* X86_64_VEX_0F38ED */
4545 { "cmpnlxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4548 /* X86_64_VEX_0F38EE */
4551 { "cmplexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4554 /* X86_64_VEX_0F38EF */
4557 { "cmpnlexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4561 static const struct dis386 three_byte_table
[][256] = {
4563 /* THREE_BYTE_0F38 */
4566 { "pshufb", { MX
, EM
}, PREFIX_OPCODE
},
4567 { "phaddw", { MX
, EM
}, PREFIX_OPCODE
},
4568 { "phaddd", { MX
, EM
}, PREFIX_OPCODE
},
4569 { "phaddsw", { MX
, EM
}, PREFIX_OPCODE
},
4570 { "pmaddubsw", { MX
, EM
}, PREFIX_OPCODE
},
4571 { "phsubw", { MX
, EM
}, PREFIX_OPCODE
},
4572 { "phsubd", { MX
, EM
}, PREFIX_OPCODE
},
4573 { "phsubsw", { MX
, EM
}, PREFIX_OPCODE
},
4575 { "psignb", { MX
, EM
}, PREFIX_OPCODE
},
4576 { "psignw", { MX
, EM
}, PREFIX_OPCODE
},
4577 { "psignd", { MX
, EM
}, PREFIX_OPCODE
},
4578 { "pmulhrsw", { MX
, EM
}, PREFIX_OPCODE
},
4584 { "pblendvb", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4588 { "blendvps", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4589 { "blendvpd", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4591 { "ptest", { XM
, EXx
}, PREFIX_DATA
},
4597 { "pabsb", { MX
, EM
}, PREFIX_OPCODE
},
4598 { "pabsw", { MX
, EM
}, PREFIX_OPCODE
},
4599 { "pabsd", { MX
, EM
}, PREFIX_OPCODE
},
4602 { "pmovsxbw", { XM
, EXq
}, PREFIX_DATA
},
4603 { "pmovsxbd", { XM
, EXd
}, PREFIX_DATA
},
4604 { "pmovsxbq", { XM
, EXw
}, PREFIX_DATA
},
4605 { "pmovsxwd", { XM
, EXq
}, PREFIX_DATA
},
4606 { "pmovsxwq", { XM
, EXd
}, PREFIX_DATA
},
4607 { "pmovsxdq", { XM
, EXq
}, PREFIX_DATA
},
4611 { "pmuldq", { XM
, EXx
}, PREFIX_DATA
},
4612 { "pcmpeqq", { XM
, EXx
}, PREFIX_DATA
},
4613 { MOD_TABLE (MOD_0F382A
) },
4614 { "packusdw", { XM
, EXx
}, PREFIX_DATA
},
4620 { "pmovzxbw", { XM
, EXq
}, PREFIX_DATA
},
4621 { "pmovzxbd", { XM
, EXd
}, PREFIX_DATA
},
4622 { "pmovzxbq", { XM
, EXw
}, PREFIX_DATA
},
4623 { "pmovzxwd", { XM
, EXq
}, PREFIX_DATA
},
4624 { "pmovzxwq", { XM
, EXd
}, PREFIX_DATA
},
4625 { "pmovzxdq", { XM
, EXq
}, PREFIX_DATA
},
4627 { "pcmpgtq", { XM
, EXx
}, PREFIX_DATA
},
4629 { "pminsb", { XM
, EXx
}, PREFIX_DATA
},
4630 { "pminsd", { XM
, EXx
}, PREFIX_DATA
},
4631 { "pminuw", { XM
, EXx
}, PREFIX_DATA
},
4632 { "pminud", { XM
, EXx
}, PREFIX_DATA
},
4633 { "pmaxsb", { XM
, EXx
}, PREFIX_DATA
},
4634 { "pmaxsd", { XM
, EXx
}, PREFIX_DATA
},
4635 { "pmaxuw", { XM
, EXx
}, PREFIX_DATA
},
4636 { "pmaxud", { XM
, EXx
}, PREFIX_DATA
},
4638 { "pmulld", { XM
, EXx
}, PREFIX_DATA
},
4639 { "phminposuw", { XM
, EXx
}, PREFIX_DATA
},
4710 { "invept", { Gm
, Mo
}, PREFIX_DATA
},
4711 { "invvpid", { Gm
, Mo
}, PREFIX_DATA
},
4712 { "invpcid", { Gm
, M
}, PREFIX_DATA
},
4791 { "sha1nexte", { XM
, EXxmm
}, PREFIX_OPCODE
},
4792 { "sha1msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4793 { "sha1msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4794 { "sha256rnds2", { XM
, EXxmm
, XMM0
}, PREFIX_OPCODE
},
4795 { "sha256msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4796 { "sha256msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4798 { "gf2p8mulb", { XM
, EXxmm
}, PREFIX_DATA
},
4809 { PREFIX_TABLE (PREFIX_0F38D8
) },
4812 { "aesimc", { XM
, EXx
}, PREFIX_DATA
},
4813 { PREFIX_TABLE (PREFIX_0F38DC
) },
4814 { PREFIX_TABLE (PREFIX_0F38DD
) },
4815 { PREFIX_TABLE (PREFIX_0F38DE
) },
4816 { PREFIX_TABLE (PREFIX_0F38DF
) },
4836 { PREFIX_TABLE (PREFIX_0F38F0
) },
4837 { PREFIX_TABLE (PREFIX_0F38F1
) },
4841 { MOD_TABLE (MOD_0F38F5
) },
4842 { PREFIX_TABLE (PREFIX_0F38F6
) },
4845 { PREFIX_TABLE (PREFIX_0F38F8
) },
4846 { MOD_TABLE (MOD_0F38F9
) },
4847 { PREFIX_TABLE (PREFIX_0F38FA
) },
4848 { PREFIX_TABLE (PREFIX_0F38FB
) },
4854 /* THREE_BYTE_0F3A */
4866 { "roundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4867 { "roundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4868 { "roundss", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4869 { "roundsd", { XM
, EXq
, Ib
}, PREFIX_DATA
},
4870 { "blendps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4871 { "blendpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4872 { "pblendw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4873 { "palignr", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
4879 { "pextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
4880 { "pextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
4881 { "pextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
4882 { "extractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
4893 { "pinsrb", { XM
, Edb
, Ib
}, PREFIX_DATA
},
4894 { "insertps", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4895 { "pinsrK", { XM
, Edq
, Ib
}, PREFIX_DATA
},
4929 { "dpps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4930 { "dppd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4931 { "mpsadbw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4933 { "pclmulqdq", { XM
, EXx
, PCLMUL
}, PREFIX_DATA
},
4965 { "pcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4966 { "pcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4967 { "pcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4968 { "pcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5086 { "sha1rnds4", { XM
, EXxmm
, Ib
}, PREFIX_OPCODE
},
5088 { "gf2p8affineqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5089 { "gf2p8affineinvqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5107 { "aeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5127 { PREFIX_TABLE (PREFIX_0F3A0F
) },
5147 static const struct dis386 xop_table
[][256] = {
5300 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_85
) },
5301 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_86
) },
5302 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_87
) },
5310 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8E
) },
5311 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8F
) },
5318 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_95
) },
5319 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_96
) },
5320 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_97
) },
5328 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9E
) },
5329 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9F
) },
5333 { "vpcmov", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
5334 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A3
) },
5337 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A6
) },
5355 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_B6
) },
5367 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C0
) },
5368 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C1
) },
5369 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C2
) },
5370 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C3
) },
5380 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC
) },
5381 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD
) },
5382 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE
) },
5383 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF
) },
5416 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC
) },
5417 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED
) },
5418 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE
) },
5419 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF
) },
5443 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_01
) },
5444 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_02
) },
5462 { MOD_TABLE (MOD_XOP_09_12
) },
5586 { VEX_W_TABLE (VEX_W_0FXOP_09_80
) },
5587 { VEX_W_TABLE (VEX_W_0FXOP_09_81
) },
5588 { VEX_W_TABLE (VEX_W_0FXOP_09_82
) },
5589 { VEX_W_TABLE (VEX_W_0FXOP_09_83
) },
5604 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_90
) },
5605 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_91
) },
5606 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_92
) },
5607 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_93
) },
5608 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_94
) },
5609 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_95
) },
5610 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_96
) },
5611 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_97
) },
5613 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_98
) },
5614 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_99
) },
5615 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9A
) },
5616 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9B
) },
5659 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C1
) },
5660 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C2
) },
5661 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C3
) },
5664 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C6
) },
5665 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C7
) },
5670 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_CB
) },
5677 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D1
) },
5678 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D2
) },
5679 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D3
) },
5682 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D6
) },
5683 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D7
) },
5688 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_DB
) },
5695 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E1
) },
5696 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E2
) },
5697 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E3
) },
5751 { "bextrS", { Gdq
, Edq
, Id
}, 0 },
5753 { VEX_LEN_TABLE (VEX_LEN_0FXOP_0A_12
) },
6023 static const struct dis386 vex_table
[][256] = {
6045 { PREFIX_TABLE (PREFIX_VEX_0F10
) },
6046 { PREFIX_TABLE (PREFIX_VEX_0F11
) },
6047 { PREFIX_TABLE (PREFIX_VEX_0F12
) },
6048 { MOD_TABLE (MOD_VEX_0F13
) },
6049 { "vunpcklpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6050 { "vunpckhpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6051 { PREFIX_TABLE (PREFIX_VEX_0F16
) },
6052 { MOD_TABLE (MOD_VEX_0F17
) },
6072 { "vmovapX", { XM
, EXx
}, PREFIX_OPCODE
},
6073 { "vmovapX", { EXxS
, XM
}, PREFIX_OPCODE
},
6074 { PREFIX_TABLE (PREFIX_VEX_0F2A
) },
6075 { MOD_TABLE (MOD_VEX_0F2B
) },
6076 { PREFIX_TABLE (PREFIX_VEX_0F2C
) },
6077 { PREFIX_TABLE (PREFIX_VEX_0F2D
) },
6078 { PREFIX_TABLE (PREFIX_VEX_0F2E
) },
6079 { PREFIX_TABLE (PREFIX_VEX_0F2F
) },
6100 { VEX_LEN_TABLE (VEX_LEN_0F41
) },
6101 { VEX_LEN_TABLE (VEX_LEN_0F42
) },
6103 { VEX_LEN_TABLE (VEX_LEN_0F44
) },
6104 { VEX_LEN_TABLE (VEX_LEN_0F45
) },
6105 { VEX_LEN_TABLE (VEX_LEN_0F46
) },
6106 { VEX_LEN_TABLE (VEX_LEN_0F47
) },
6110 { VEX_LEN_TABLE (VEX_LEN_0F4A
) },
6111 { VEX_LEN_TABLE (VEX_LEN_0F4B
) },
6117 { MOD_TABLE (MOD_VEX_0F50
) },
6118 { PREFIX_TABLE (PREFIX_VEX_0F51
) },
6119 { PREFIX_TABLE (PREFIX_VEX_0F52
) },
6120 { PREFIX_TABLE (PREFIX_VEX_0F53
) },
6121 { "vandpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6122 { "vandnpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6123 { "vorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6124 { "vxorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6126 { PREFIX_TABLE (PREFIX_VEX_0F58
) },
6127 { PREFIX_TABLE (PREFIX_VEX_0F59
) },
6128 { PREFIX_TABLE (PREFIX_VEX_0F5A
) },
6129 { PREFIX_TABLE (PREFIX_VEX_0F5B
) },
6130 { PREFIX_TABLE (PREFIX_VEX_0F5C
) },
6131 { PREFIX_TABLE (PREFIX_VEX_0F5D
) },
6132 { PREFIX_TABLE (PREFIX_VEX_0F5E
) },
6133 { PREFIX_TABLE (PREFIX_VEX_0F5F
) },
6135 { "vpunpcklbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6136 { "vpunpcklwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6137 { "vpunpckldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6138 { "vpacksswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6139 { "vpcmpgtb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6140 { "vpcmpgtw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6141 { "vpcmpgtd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6142 { "vpackuswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6144 { "vpunpckhbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6145 { "vpunpckhwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6146 { "vpunpckhdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6147 { "vpackssdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6148 { "vpunpcklqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6149 { "vpunpckhqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6150 { VEX_LEN_TABLE (VEX_LEN_0F6E
) },
6151 { PREFIX_TABLE (PREFIX_VEX_0F6F
) },
6153 { PREFIX_TABLE (PREFIX_VEX_0F70
) },
6154 { MOD_TABLE (MOD_VEX_0F71
) },
6155 { MOD_TABLE (MOD_VEX_0F72
) },
6156 { MOD_TABLE (MOD_VEX_0F73
) },
6157 { "vpcmpeqb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6158 { "vpcmpeqw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6159 { "vpcmpeqd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6160 { VEX_LEN_TABLE (VEX_LEN_0F77
) },
6166 { PREFIX_TABLE (PREFIX_VEX_0F7C
) },
6167 { PREFIX_TABLE (PREFIX_VEX_0F7D
) },
6168 { PREFIX_TABLE (PREFIX_VEX_0F7E
) },
6169 { PREFIX_TABLE (PREFIX_VEX_0F7F
) },
6189 { VEX_LEN_TABLE (VEX_LEN_0F90
) },
6190 { VEX_LEN_TABLE (VEX_LEN_0F91
) },
6191 { VEX_LEN_TABLE (VEX_LEN_0F92
) },
6192 { VEX_LEN_TABLE (VEX_LEN_0F93
) },
6198 { VEX_LEN_TABLE (VEX_LEN_0F98
) },
6199 { VEX_LEN_TABLE (VEX_LEN_0F99
) },
6222 { REG_TABLE (REG_VEX_0FAE
) },
6245 { PREFIX_TABLE (PREFIX_VEX_0FC2
) },
6247 { VEX_LEN_TABLE (VEX_LEN_0FC4
) },
6248 { VEX_LEN_TABLE (VEX_LEN_0FC5
) },
6249 { "vshufpX", { XM
, Vex
, EXx
, Ib
}, PREFIX_OPCODE
},
6261 { PREFIX_TABLE (PREFIX_VEX_0FD0
) },
6262 { "vpsrlw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6263 { "vpsrld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6264 { "vpsrlq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6265 { "vpaddq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6266 { "vpmullw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6267 { VEX_LEN_TABLE (VEX_LEN_0FD6
) },
6268 { MOD_TABLE (MOD_VEX_0FD7
) },
6270 { "vpsubusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6271 { "vpsubusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6272 { "vpminub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6273 { "vpand", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6274 { "vpaddusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6275 { "vpaddusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6276 { "vpmaxub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6277 { "vpandn", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6279 { "vpavgb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6280 { "vpsraw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6281 { "vpsrad", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6282 { "vpavgw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6283 { "vpmulhuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6284 { "vpmulhw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6285 { PREFIX_TABLE (PREFIX_VEX_0FE6
) },
6286 { MOD_TABLE (MOD_VEX_0FE7
) },
6288 { "vpsubsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6289 { "vpsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6290 { "vpminsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6291 { "vpor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6292 { "vpaddsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6293 { "vpaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6294 { "vpmaxsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6295 { "vpxor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6297 { PREFIX_TABLE (PREFIX_VEX_0FF0
) },
6298 { "vpsllw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6299 { "vpslld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6300 { "vpsllq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6301 { "vpmuludq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6302 { "vpmaddwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6303 { "vpsadbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6304 { VEX_LEN_TABLE (VEX_LEN_0FF7
) },
6306 { "vpsubb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6307 { "vpsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6308 { "vpsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6309 { "vpsubq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6310 { "vpaddb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6311 { "vpaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6312 { "vpaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6318 { "vpshufb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6319 { "vphaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6320 { "vphaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6321 { "vphaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6322 { "vpmaddubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6323 { "vphsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6324 { "vphsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6325 { "vphsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6327 { "vpsignb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6328 { "vpsignw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6329 { "vpsignd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6330 { "vpmulhrsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6331 { VEX_W_TABLE (VEX_W_0F380C
) },
6332 { VEX_W_TABLE (VEX_W_0F380D
) },
6333 { VEX_W_TABLE (VEX_W_0F380E
) },
6334 { VEX_W_TABLE (VEX_W_0F380F
) },
6339 { VEX_W_TABLE (VEX_W_0F3813
) },
6342 { VEX_LEN_TABLE (VEX_LEN_0F3816
) },
6343 { "vptest", { XM
, EXx
}, PREFIX_DATA
},
6345 { VEX_W_TABLE (VEX_W_0F3818
) },
6346 { VEX_LEN_TABLE (VEX_LEN_0F3819
) },
6347 { MOD_TABLE (MOD_VEX_0F381A
) },
6349 { "vpabsb", { XM
, EXx
}, PREFIX_DATA
},
6350 { "vpabsw", { XM
, EXx
}, PREFIX_DATA
},
6351 { "vpabsd", { XM
, EXx
}, PREFIX_DATA
},
6354 { "vpmovsxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6355 { "vpmovsxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6356 { "vpmovsxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6357 { "vpmovsxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6358 { "vpmovsxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6359 { "vpmovsxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6363 { "vpmuldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6364 { "vpcmpeqq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6365 { MOD_TABLE (MOD_VEX_0F382A
) },
6366 { "vpackusdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6367 { MOD_TABLE (MOD_VEX_0F382C
) },
6368 { MOD_TABLE (MOD_VEX_0F382D
) },
6369 { MOD_TABLE (MOD_VEX_0F382E
) },
6370 { MOD_TABLE (MOD_VEX_0F382F
) },
6372 { "vpmovzxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6373 { "vpmovzxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6374 { "vpmovzxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6375 { "vpmovzxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6376 { "vpmovzxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6377 { "vpmovzxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6378 { VEX_LEN_TABLE (VEX_LEN_0F3836
) },
6379 { "vpcmpgtq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6381 { "vpminsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6382 { "vpminsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6383 { "vpminuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6384 { "vpminud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6385 { "vpmaxsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6386 { "vpmaxsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6387 { "vpmaxuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6388 { "vpmaxud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6390 { "vpmulld", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6391 { VEX_LEN_TABLE (VEX_LEN_0F3841
) },
6395 { "vpsrlv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6396 { VEX_W_TABLE (VEX_W_0F3846
) },
6397 { "vpsllv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6400 { X86_64_TABLE (X86_64_VEX_0F3849
) },
6402 { X86_64_TABLE (X86_64_VEX_0F384B
) },
6408 { VEX_W_TABLE (VEX_W_0F3850
) },
6409 { VEX_W_TABLE (VEX_W_0F3851
) },
6410 { VEX_W_TABLE (VEX_W_0F3852
) },
6411 { VEX_W_TABLE (VEX_W_0F3853
) },
6417 { VEX_W_TABLE (VEX_W_0F3858
) },
6418 { VEX_W_TABLE (VEX_W_0F3859
) },
6419 { MOD_TABLE (MOD_VEX_0F385A
) },
6421 { X86_64_TABLE (X86_64_VEX_0F385C
) },
6423 { X86_64_TABLE (X86_64_VEX_0F385E
) },
6446 { PREFIX_TABLE (PREFIX_VEX_0F3872
) },
6453 { VEX_W_TABLE (VEX_W_0F3878
) },
6454 { VEX_W_TABLE (VEX_W_0F3879
) },
6475 { MOD_TABLE (MOD_VEX_0F388C
) },
6477 { MOD_TABLE (MOD_VEX_0F388E
) },
6480 { "vpgatherd%DQ", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6481 { "vpgatherq%DQ", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6482 { "vgatherdp%XW", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6483 { "vgatherqp%XW", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6486 { "vfmaddsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6487 { "vfmsubadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6489 { "vfmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6490 { "vfmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6491 { "vfmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6492 { "vfmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6493 { "vfnmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6494 { "vfnmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6495 { "vfnmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6496 { "vfnmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6504 { "vfmaddsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6505 { "vfmsubadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6507 { "vfmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6508 { "vfmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6509 { "vfmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6510 { "vfmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6511 { "vfnmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6512 { "vfnmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6513 { "vfnmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6514 { "vfnmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6516 { VEX_W_TABLE (VEX_W_0F38B0
) },
6517 { VEX_W_TABLE (VEX_W_0F38B1
) },
6520 { VEX_W_TABLE (VEX_W_0F38B4
) },
6521 { VEX_W_TABLE (VEX_W_0F38B5
) },
6522 { "vfmaddsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6523 { "vfmsubadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6525 { "vfmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6526 { "vfmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6527 { "vfmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6528 { "vfmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6529 { "vfnmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6530 { "vfnmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6531 { "vfnmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6532 { "vfnmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6550 { VEX_W_TABLE (VEX_W_0F38CF
) },
6564 { VEX_LEN_TABLE (VEX_LEN_0F38DB
) },
6565 { "vaesenc", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6566 { "vaesenclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6567 { "vaesdec", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6568 { "vaesdeclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6570 { X86_64_TABLE (X86_64_VEX_0F38E0
) },
6571 { X86_64_TABLE (X86_64_VEX_0F38E1
) },
6572 { X86_64_TABLE (X86_64_VEX_0F38E2
) },
6573 { X86_64_TABLE (X86_64_VEX_0F38E3
) },
6574 { X86_64_TABLE (X86_64_VEX_0F38E4
) },
6575 { X86_64_TABLE (X86_64_VEX_0F38E5
) },
6576 { X86_64_TABLE (X86_64_VEX_0F38E6
) },
6577 { X86_64_TABLE (X86_64_VEX_0F38E7
) },
6579 { X86_64_TABLE (X86_64_VEX_0F38E8
) },
6580 { X86_64_TABLE (X86_64_VEX_0F38E9
) },
6581 { X86_64_TABLE (X86_64_VEX_0F38EA
) },
6582 { X86_64_TABLE (X86_64_VEX_0F38EB
) },
6583 { X86_64_TABLE (X86_64_VEX_0F38EC
) },
6584 { X86_64_TABLE (X86_64_VEX_0F38ED
) },
6585 { X86_64_TABLE (X86_64_VEX_0F38EE
) },
6586 { X86_64_TABLE (X86_64_VEX_0F38EF
) },
6590 { VEX_LEN_TABLE (VEX_LEN_0F38F2
) },
6591 { VEX_LEN_TABLE (VEX_LEN_0F38F3
) },
6593 { VEX_LEN_TABLE (VEX_LEN_0F38F5
) },
6594 { VEX_LEN_TABLE (VEX_LEN_0F38F6
) },
6595 { VEX_LEN_TABLE (VEX_LEN_0F38F7
) },
6609 { VEX_LEN_TABLE (VEX_LEN_0F3A00
) },
6610 { VEX_LEN_TABLE (VEX_LEN_0F3A01
) },
6611 { VEX_W_TABLE (VEX_W_0F3A02
) },
6613 { VEX_W_TABLE (VEX_W_0F3A04
) },
6614 { VEX_W_TABLE (VEX_W_0F3A05
) },
6615 { VEX_LEN_TABLE (VEX_LEN_0F3A06
) },
6618 { "vroundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6619 { "vroundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6620 { "vroundss", { XMScalar
, VexScalar
, EXd
, Ib
}, PREFIX_DATA
},
6621 { "vroundsd", { XMScalar
, VexScalar
, EXq
, Ib
}, PREFIX_DATA
},
6622 { "vblendps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6623 { "vblendpd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6624 { "vpblendw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6625 { "vpalignr", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6631 { VEX_LEN_TABLE (VEX_LEN_0F3A14
) },
6632 { VEX_LEN_TABLE (VEX_LEN_0F3A15
) },
6633 { VEX_LEN_TABLE (VEX_LEN_0F3A16
) },
6634 { VEX_LEN_TABLE (VEX_LEN_0F3A17
) },
6636 { VEX_LEN_TABLE (VEX_LEN_0F3A18
) },
6637 { VEX_LEN_TABLE (VEX_LEN_0F3A19
) },
6641 { VEX_W_TABLE (VEX_W_0F3A1D
) },
6645 { VEX_LEN_TABLE (VEX_LEN_0F3A20
) },
6646 { VEX_LEN_TABLE (VEX_LEN_0F3A21
) },
6647 { VEX_LEN_TABLE (VEX_LEN_0F3A22
) },
6663 { VEX_LEN_TABLE (VEX_LEN_0F3A30
) },
6664 { VEX_LEN_TABLE (VEX_LEN_0F3A31
) },
6665 { VEX_LEN_TABLE (VEX_LEN_0F3A32
) },
6666 { VEX_LEN_TABLE (VEX_LEN_0F3A33
) },
6672 { VEX_LEN_TABLE (VEX_LEN_0F3A38
) },
6673 { VEX_LEN_TABLE (VEX_LEN_0F3A39
) },
6681 { "vdpps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6682 { VEX_LEN_TABLE (VEX_LEN_0F3A41
) },
6683 { "vmpsadbw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6685 { "vpclmulqdq", { XM
, Vex
, EXx
, PCLMUL
}, PREFIX_DATA
},
6687 { VEX_LEN_TABLE (VEX_LEN_0F3A46
) },
6690 { "vpermil2ps", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6691 { "vpermil2pd", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6692 { VEX_W_TABLE (VEX_W_0F3A4A
) },
6693 { VEX_W_TABLE (VEX_W_0F3A4B
) },
6694 { VEX_W_TABLE (VEX_W_0F3A4C
) },
6712 { "vfmaddsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6713 { "vfmaddsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6714 { "vfmsubaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6715 { "vfmsubaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6717 { VEX_LEN_TABLE (VEX_LEN_0F3A60
) },
6718 { VEX_LEN_TABLE (VEX_LEN_0F3A61
) },
6719 { VEX_LEN_TABLE (VEX_LEN_0F3A62
) },
6720 { VEX_LEN_TABLE (VEX_LEN_0F3A63
) },
6726 { "vfmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6727 { "vfmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6728 { "vfmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6729 { "vfmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6730 { "vfmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6731 { "vfmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6732 { "vfmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6733 { "vfmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6744 { "vfnmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6745 { "vfnmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6746 { "vfnmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6747 { "vfnmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6748 { "vfnmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6749 { "vfnmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6750 { "vfnmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6751 { "vfnmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6840 { VEX_W_TABLE (VEX_W_0F3ACE
) },
6841 { VEX_W_TABLE (VEX_W_0F3ACF
) },
6859 { VEX_LEN_TABLE (VEX_LEN_0F3ADF
) },
6879 { VEX_LEN_TABLE (VEX_LEN_0F3AF0
) },
6899 #include "i386-dis-evex.h"
6901 static const struct dis386 vex_len_table
[][2] = {
6902 /* VEX_LEN_0F12_P_0_M_0 / VEX_LEN_0F12_P_2_M_0 */
6904 { "%XEvmovlpX", { XM
, Vex
, EXq
}, 0 },
6907 /* VEX_LEN_0F12_P_0_M_1 */
6909 { "%XEvmovhlp%XS", { XM
, Vex
, EXq
}, 0 },
6912 /* VEX_LEN_0F13_M_0 */
6914 { "%XEvmovlpX", { EXq
, XM
}, PREFIX_OPCODE
},
6917 /* VEX_LEN_0F16_P_0_M_0 / VEX_LEN_0F16_P_2_M_0 */
6919 { "%XEvmovhpX", { XM
, Vex
, EXq
}, 0 },
6922 /* VEX_LEN_0F16_P_0_M_1 */
6924 { "%XEvmovlhp%XS", { XM
, Vex
, EXq
}, 0 },
6927 /* VEX_LEN_0F17_M_0 */
6929 { "%XEvmovhpX", { EXq
, XM
}, PREFIX_OPCODE
},
6935 { MOD_TABLE (MOD_VEX_0F41_L_1
) },
6941 { MOD_TABLE (MOD_VEX_0F42_L_1
) },
6946 { MOD_TABLE (MOD_VEX_0F44_L_0
) },
6952 { MOD_TABLE (MOD_VEX_0F45_L_1
) },
6958 { MOD_TABLE (MOD_VEX_0F46_L_1
) },
6964 { MOD_TABLE (MOD_VEX_0F47_L_1
) },
6970 { MOD_TABLE (MOD_VEX_0F4A_L_1
) },
6976 { MOD_TABLE (MOD_VEX_0F4B_L_1
) },
6981 { "%XEvmovK", { XMScalar
, Edq
}, PREFIX_DATA
},
6986 { "vzeroupper", { XX
}, 0 },
6987 { "vzeroall", { XX
}, 0 },
6990 /* VEX_LEN_0F7E_P_1 */
6992 { "%XEvmovq", { XMScalar
, EXq
}, 0 },
6995 /* VEX_LEN_0F7E_P_2 */
6997 { "%XEvmovK", { Edq
, XMScalar
}, 0 },
7002 { VEX_W_TABLE (VEX_W_0F90_L_0
) },
7007 { MOD_TABLE (MOD_VEX_0F91_L_0
) },
7012 { MOD_TABLE (MOD_VEX_0F92_L_0
) },
7017 { MOD_TABLE (MOD_VEX_0F93_L_0
) },
7022 { MOD_TABLE (MOD_VEX_0F98_L_0
) },
7027 { MOD_TABLE (MOD_VEX_0F99_L_0
) },
7030 /* VEX_LEN_0FAE_R_2_M_0 */
7032 { "vldmxcsr", { Md
}, 0 },
7035 /* VEX_LEN_0FAE_R_3_M_0 */
7037 { "vstmxcsr", { Md
}, 0 },
7042 { "%XEvpinsrw", { XM
, Vex
, Edw
, Ib
}, PREFIX_DATA
},
7047 { "%XEvpextrw", { Gd
, XS
, Ib
}, PREFIX_DATA
},
7052 { "%XEvmovq", { EXqS
, XMScalar
}, PREFIX_DATA
},
7057 { "vmaskmovdqu", { XM
, XS
}, PREFIX_DATA
},
7060 /* VEX_LEN_0F3816 */
7063 { VEX_W_TABLE (VEX_W_0F3816_L_1
) },
7066 /* VEX_LEN_0F3819 */
7069 { VEX_W_TABLE (VEX_W_0F3819_L_1
) },
7072 /* VEX_LEN_0F381A_M_0 */
7075 { VEX_W_TABLE (VEX_W_0F381A_M_0_L_1
) },
7078 /* VEX_LEN_0F3836 */
7081 { VEX_W_TABLE (VEX_W_0F3836
) },
7084 /* VEX_LEN_0F3841 */
7086 { "vphminposuw", { XM
, EXx
}, PREFIX_DATA
},
7089 /* VEX_LEN_0F3849_X86_64_P_0_W_0_M_0 */
7091 { "ldtilecfg", { M
}, 0 },
7094 /* VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0 */
7096 { "tilerelease", { Skip_MODRM
}, 0 },
7099 /* VEX_LEN_0F3849_X86_64_P_2_W_0_M_0 */
7101 { "sttilecfg", { M
}, 0 },
7104 /* VEX_LEN_0F3849_X86_64_P_3_W_0_M_0 */
7106 { "tilezero", { TMM
, Skip_MODRM
}, 0 },
7109 /* VEX_LEN_0F384B_X86_64_P_1_W_0_M_0 */
7111 { "tilestored", { MVexSIBMEM
, TMM
}, 0 },
7113 /* VEX_LEN_0F384B_X86_64_P_2_W_0_M_0 */
7115 { "tileloaddt1", { TMM
, MVexSIBMEM
}, 0 },
7118 /* VEX_LEN_0F384B_X86_64_P_3_W_0_M_0 */
7120 { "tileloadd", { TMM
, MVexSIBMEM
}, 0 },
7123 /* VEX_LEN_0F385A_M_0 */
7126 { VEX_W_TABLE (VEX_W_0F385A_M_0_L_0
) },
7129 /* VEX_LEN_0F385C_X86_64_P_1_W_0_M_0 */
7131 { "tdpbf16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
7134 /* VEX_LEN_0F385C_X86_64_P_3_W_0_M_0 */
7136 { "tdpfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
7139 /* VEX_LEN_0F385E_X86_64_P_0_W_0_M_0 */
7141 { "tdpbuud", {TMM
, EXtmm
, VexTmm
}, 0 },
7144 /* VEX_LEN_0F385E_X86_64_P_1_W_0_M_0 */
7146 { "tdpbsud", {TMM
, EXtmm
, VexTmm
}, 0 },
7149 /* VEX_LEN_0F385E_X86_64_P_2_W_0_M_0 */
7151 { "tdpbusd", {TMM
, EXtmm
, VexTmm
}, 0 },
7154 /* VEX_LEN_0F385E_X86_64_P_3_W_0_M_0 */
7156 { "tdpbssd", {TMM
, EXtmm
, VexTmm
}, 0 },
7159 /* VEX_LEN_0F38DB */
7161 { "vaesimc", { XM
, EXx
}, PREFIX_DATA
},
7164 /* VEX_LEN_0F38F2 */
7166 { "andnS", { Gdq
, VexGdq
, Edq
}, PREFIX_OPCODE
},
7169 /* VEX_LEN_0F38F3 */
7171 { REG_TABLE(REG_VEX_0F38F3_L_0
) },
7174 /* VEX_LEN_0F38F5 */
7176 { PREFIX_TABLE(PREFIX_VEX_0F38F5_L_0
) },
7179 /* VEX_LEN_0F38F6 */
7181 { PREFIX_TABLE(PREFIX_VEX_0F38F6_L_0
) },
7184 /* VEX_LEN_0F38F7 */
7186 { PREFIX_TABLE(PREFIX_VEX_0F38F7_L_0
) },
7189 /* VEX_LEN_0F3A00 */
7192 { VEX_W_TABLE (VEX_W_0F3A00_L_1
) },
7195 /* VEX_LEN_0F3A01 */
7198 { VEX_W_TABLE (VEX_W_0F3A01_L_1
) },
7201 /* VEX_LEN_0F3A06 */
7204 { VEX_W_TABLE (VEX_W_0F3A06_L_1
) },
7207 /* VEX_LEN_0F3A14 */
7209 { "%XEvpextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
7212 /* VEX_LEN_0F3A15 */
7214 { "%XEvpextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
7217 /* VEX_LEN_0F3A16 */
7219 { "%XEvpextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
7222 /* VEX_LEN_0F3A17 */
7224 { "%XEvextractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
7227 /* VEX_LEN_0F3A18 */
7230 { VEX_W_TABLE (VEX_W_0F3A18_L_1
) },
7233 /* VEX_LEN_0F3A19 */
7236 { VEX_W_TABLE (VEX_W_0F3A19_L_1
) },
7239 /* VEX_LEN_0F3A20 */
7241 { "%XEvpinsrb", { XM
, Vex
, Edb
, Ib
}, PREFIX_DATA
},
7244 /* VEX_LEN_0F3A21 */
7246 { "%XEvinsertps", { XM
, Vex
, EXd
, Ib
}, PREFIX_DATA
},
7249 /* VEX_LEN_0F3A22 */
7251 { "%XEvpinsrK", { XM
, Vex
, Edq
, Ib
}, PREFIX_DATA
},
7254 /* VEX_LEN_0F3A30 */
7256 { MOD_TABLE (MOD_VEX_0F3A30_L_0
) },
7259 /* VEX_LEN_0F3A31 */
7261 { MOD_TABLE (MOD_VEX_0F3A31_L_0
) },
7264 /* VEX_LEN_0F3A32 */
7266 { MOD_TABLE (MOD_VEX_0F3A32_L_0
) },
7269 /* VEX_LEN_0F3A33 */
7271 { MOD_TABLE (MOD_VEX_0F3A33_L_0
) },
7274 /* VEX_LEN_0F3A38 */
7277 { VEX_W_TABLE (VEX_W_0F3A38_L_1
) },
7280 /* VEX_LEN_0F3A39 */
7283 { VEX_W_TABLE (VEX_W_0F3A39_L_1
) },
7286 /* VEX_LEN_0F3A41 */
7288 { "vdppd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7291 /* VEX_LEN_0F3A46 */
7294 { VEX_W_TABLE (VEX_W_0F3A46_L_1
) },
7297 /* VEX_LEN_0F3A60 */
7299 { "vpcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7302 /* VEX_LEN_0F3A61 */
7304 { "vpcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7307 /* VEX_LEN_0F3A62 */
7309 { "vpcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7312 /* VEX_LEN_0F3A63 */
7314 { "vpcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7317 /* VEX_LEN_0F3ADF */
7319 { "vaeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7322 /* VEX_LEN_0F3AF0 */
7324 { PREFIX_TABLE (PREFIX_VEX_0F3AF0_L_0
) },
7327 /* VEX_LEN_0FXOP_08_85 */
7329 { VEX_W_TABLE (VEX_W_0FXOP_08_85_L_0
) },
7332 /* VEX_LEN_0FXOP_08_86 */
7334 { VEX_W_TABLE (VEX_W_0FXOP_08_86_L_0
) },
7337 /* VEX_LEN_0FXOP_08_87 */
7339 { VEX_W_TABLE (VEX_W_0FXOP_08_87_L_0
) },
7342 /* VEX_LEN_0FXOP_08_8E */
7344 { VEX_W_TABLE (VEX_W_0FXOP_08_8E_L_0
) },
7347 /* VEX_LEN_0FXOP_08_8F */
7349 { VEX_W_TABLE (VEX_W_0FXOP_08_8F_L_0
) },
7352 /* VEX_LEN_0FXOP_08_95 */
7354 { VEX_W_TABLE (VEX_W_0FXOP_08_95_L_0
) },
7357 /* VEX_LEN_0FXOP_08_96 */
7359 { VEX_W_TABLE (VEX_W_0FXOP_08_96_L_0
) },
7362 /* VEX_LEN_0FXOP_08_97 */
7364 { VEX_W_TABLE (VEX_W_0FXOP_08_97_L_0
) },
7367 /* VEX_LEN_0FXOP_08_9E */
7369 { VEX_W_TABLE (VEX_W_0FXOP_08_9E_L_0
) },
7372 /* VEX_LEN_0FXOP_08_9F */
7374 { VEX_W_TABLE (VEX_W_0FXOP_08_9F_L_0
) },
7377 /* VEX_LEN_0FXOP_08_A3 */
7379 { "vpperm", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7382 /* VEX_LEN_0FXOP_08_A6 */
7384 { VEX_W_TABLE (VEX_W_0FXOP_08_A6_L_0
) },
7387 /* VEX_LEN_0FXOP_08_B6 */
7389 { VEX_W_TABLE (VEX_W_0FXOP_08_B6_L_0
) },
7392 /* VEX_LEN_0FXOP_08_C0 */
7394 { VEX_W_TABLE (VEX_W_0FXOP_08_C0_L_0
) },
7397 /* VEX_LEN_0FXOP_08_C1 */
7399 { VEX_W_TABLE (VEX_W_0FXOP_08_C1_L_0
) },
7402 /* VEX_LEN_0FXOP_08_C2 */
7404 { VEX_W_TABLE (VEX_W_0FXOP_08_C2_L_0
) },
7407 /* VEX_LEN_0FXOP_08_C3 */
7409 { VEX_W_TABLE (VEX_W_0FXOP_08_C3_L_0
) },
7412 /* VEX_LEN_0FXOP_08_CC */
7414 { VEX_W_TABLE (VEX_W_0FXOP_08_CC_L_0
) },
7417 /* VEX_LEN_0FXOP_08_CD */
7419 { VEX_W_TABLE (VEX_W_0FXOP_08_CD_L_0
) },
7422 /* VEX_LEN_0FXOP_08_CE */
7424 { VEX_W_TABLE (VEX_W_0FXOP_08_CE_L_0
) },
7427 /* VEX_LEN_0FXOP_08_CF */
7429 { VEX_W_TABLE (VEX_W_0FXOP_08_CF_L_0
) },
7432 /* VEX_LEN_0FXOP_08_EC */
7434 { VEX_W_TABLE (VEX_W_0FXOP_08_EC_L_0
) },
7437 /* VEX_LEN_0FXOP_08_ED */
7439 { VEX_W_TABLE (VEX_W_0FXOP_08_ED_L_0
) },
7442 /* VEX_LEN_0FXOP_08_EE */
7444 { VEX_W_TABLE (VEX_W_0FXOP_08_EE_L_0
) },
7447 /* VEX_LEN_0FXOP_08_EF */
7449 { VEX_W_TABLE (VEX_W_0FXOP_08_EF_L_0
) },
7452 /* VEX_LEN_0FXOP_09_01 */
7454 { REG_TABLE (REG_XOP_09_01_L_0
) },
7457 /* VEX_LEN_0FXOP_09_02 */
7459 { REG_TABLE (REG_XOP_09_02_L_0
) },
7462 /* VEX_LEN_0FXOP_09_12_M_1 */
7464 { REG_TABLE (REG_XOP_09_12_M_1_L_0
) },
7467 /* VEX_LEN_0FXOP_09_82_W_0 */
7469 { "vfrczss", { XM
, EXd
}, 0 },
7472 /* VEX_LEN_0FXOP_09_83_W_0 */
7474 { "vfrczsd", { XM
, EXq
}, 0 },
7477 /* VEX_LEN_0FXOP_09_90 */
7479 { "vprotb", { XM
, EXx
, VexW
}, 0 },
7482 /* VEX_LEN_0FXOP_09_91 */
7484 { "vprotw", { XM
, EXx
, VexW
}, 0 },
7487 /* VEX_LEN_0FXOP_09_92 */
7489 { "vprotd", { XM
, EXx
, VexW
}, 0 },
7492 /* VEX_LEN_0FXOP_09_93 */
7494 { "vprotq", { XM
, EXx
, VexW
}, 0 },
7497 /* VEX_LEN_0FXOP_09_94 */
7499 { "vpshlb", { XM
, EXx
, VexW
}, 0 },
7502 /* VEX_LEN_0FXOP_09_95 */
7504 { "vpshlw", { XM
, EXx
, VexW
}, 0 },
7507 /* VEX_LEN_0FXOP_09_96 */
7509 { "vpshld", { XM
, EXx
, VexW
}, 0 },
7512 /* VEX_LEN_0FXOP_09_97 */
7514 { "vpshlq", { XM
, EXx
, VexW
}, 0 },
7517 /* VEX_LEN_0FXOP_09_98 */
7519 { "vpshab", { XM
, EXx
, VexW
}, 0 },
7522 /* VEX_LEN_0FXOP_09_99 */
7524 { "vpshaw", { XM
, EXx
, VexW
}, 0 },
7527 /* VEX_LEN_0FXOP_09_9A */
7529 { "vpshad", { XM
, EXx
, VexW
}, 0 },
7532 /* VEX_LEN_0FXOP_09_9B */
7534 { "vpshaq", { XM
, EXx
, VexW
}, 0 },
7537 /* VEX_LEN_0FXOP_09_C1 */
7539 { VEX_W_TABLE (VEX_W_0FXOP_09_C1_L_0
) },
7542 /* VEX_LEN_0FXOP_09_C2 */
7544 { VEX_W_TABLE (VEX_W_0FXOP_09_C2_L_0
) },
7547 /* VEX_LEN_0FXOP_09_C3 */
7549 { VEX_W_TABLE (VEX_W_0FXOP_09_C3_L_0
) },
7552 /* VEX_LEN_0FXOP_09_C6 */
7554 { VEX_W_TABLE (VEX_W_0FXOP_09_C6_L_0
) },
7557 /* VEX_LEN_0FXOP_09_C7 */
7559 { VEX_W_TABLE (VEX_W_0FXOP_09_C7_L_0
) },
7562 /* VEX_LEN_0FXOP_09_CB */
7564 { VEX_W_TABLE (VEX_W_0FXOP_09_CB_L_0
) },
7567 /* VEX_LEN_0FXOP_09_D1 */
7569 { VEX_W_TABLE (VEX_W_0FXOP_09_D1_L_0
) },
7572 /* VEX_LEN_0FXOP_09_D2 */
7574 { VEX_W_TABLE (VEX_W_0FXOP_09_D2_L_0
) },
7577 /* VEX_LEN_0FXOP_09_D3 */
7579 { VEX_W_TABLE (VEX_W_0FXOP_09_D3_L_0
) },
7582 /* VEX_LEN_0FXOP_09_D6 */
7584 { VEX_W_TABLE (VEX_W_0FXOP_09_D6_L_0
) },
7587 /* VEX_LEN_0FXOP_09_D7 */
7589 { VEX_W_TABLE (VEX_W_0FXOP_09_D7_L_0
) },
7592 /* VEX_LEN_0FXOP_09_DB */
7594 { VEX_W_TABLE (VEX_W_0FXOP_09_DB_L_0
) },
7597 /* VEX_LEN_0FXOP_09_E1 */
7599 { VEX_W_TABLE (VEX_W_0FXOP_09_E1_L_0
) },
7602 /* VEX_LEN_0FXOP_09_E2 */
7604 { VEX_W_TABLE (VEX_W_0FXOP_09_E2_L_0
) },
7607 /* VEX_LEN_0FXOP_09_E3 */
7609 { VEX_W_TABLE (VEX_W_0FXOP_09_E3_L_0
) },
7612 /* VEX_LEN_0FXOP_0A_12 */
7614 { REG_TABLE (REG_XOP_0A_12_L_0
) },
7618 #include "i386-dis-evex-len.h"
7620 static const struct dis386 vex_w_table
[][2] = {
7622 /* VEX_W_0F41_L_1_M_1 */
7623 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_0
) },
7624 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_1
) },
7627 /* VEX_W_0F42_L_1_M_1 */
7628 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_0
) },
7629 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_1
) },
7632 /* VEX_W_0F44_L_0_M_1 */
7633 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_0
) },
7634 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_1
) },
7637 /* VEX_W_0F45_L_1_M_1 */
7638 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_0
) },
7639 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_1
) },
7642 /* VEX_W_0F46_L_1_M_1 */
7643 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_0
) },
7644 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_1
) },
7647 /* VEX_W_0F47_L_1_M_1 */
7648 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_0
) },
7649 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_1
) },
7652 /* VEX_W_0F4A_L_1_M_1 */
7653 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_0
) },
7654 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_1
) },
7657 /* VEX_W_0F4B_L_1_M_1 */
7658 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_0
) },
7659 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_1
) },
7662 /* VEX_W_0F90_L_0 */
7663 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_0
) },
7664 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_1
) },
7667 /* VEX_W_0F91_L_0_M_0 */
7668 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_0
) },
7669 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_1
) },
7672 /* VEX_W_0F92_L_0_M_1 */
7673 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_0
) },
7674 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_1
) },
7677 /* VEX_W_0F93_L_0_M_1 */
7678 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_0
) },
7679 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_1
) },
7682 /* VEX_W_0F98_L_0_M_1 */
7683 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_0
) },
7684 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_1
) },
7687 /* VEX_W_0F99_L_0_M_1 */
7688 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_0
) },
7689 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_1
) },
7693 { "%XEvpermilps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7697 { "vpermilpd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7701 { "vtestps", { XM
, EXx
}, PREFIX_DATA
},
7705 { "vtestpd", { XM
, EXx
}, PREFIX_DATA
},
7709 { "vcvtph2ps", { XM
, EXxmmq
}, PREFIX_DATA
},
7712 /* VEX_W_0F3816_L_1 */
7713 { "vpermps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7717 { "%XEvbroadcastss", { XM
, EXd
}, PREFIX_DATA
},
7720 /* VEX_W_0F3819_L_1 */
7721 { "vbroadcastsd", { XM
, EXq
}, PREFIX_DATA
},
7724 /* VEX_W_0F381A_M_0_L_1 */
7725 { "vbroadcastf128", { XM
, Mxmm
}, PREFIX_DATA
},
7728 /* VEX_W_0F382C_M_0 */
7729 { "vmaskmovps", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7732 /* VEX_W_0F382D_M_0 */
7733 { "vmaskmovpd", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7736 /* VEX_W_0F382E_M_0 */
7737 { "vmaskmovps", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7740 /* VEX_W_0F382F_M_0 */
7741 { "vmaskmovpd", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7745 { "vpermd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7749 { "vpsravd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7752 /* VEX_W_0F3849_X86_64_P_0 */
7753 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_0_W_0
) },
7756 /* VEX_W_0F3849_X86_64_P_2 */
7757 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_2_W_0
) },
7760 /* VEX_W_0F3849_X86_64_P_3 */
7761 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_3_W_0
) },
7764 /* VEX_W_0F384B_X86_64_P_1 */
7765 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_1_W_0
) },
7768 /* VEX_W_0F384B_X86_64_P_2 */
7769 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_2_W_0
) },
7772 /* VEX_W_0F384B_X86_64_P_3 */
7773 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_3_W_0
) },
7777 { PREFIX_TABLE (PREFIX_VEX_0F3850_W_0
) },
7780 /* VEX_W_0F3851_P_0 */
7781 { PREFIX_TABLE (PREFIX_VEX_0F3851_W_0
) },
7785 { "%XVvpdpwssd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7789 { "%XVvpdpwssds", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7793 { "%XEvpbroadcastd", { XM
, EXd
}, PREFIX_DATA
},
7797 { "vpbroadcastq", { XM
, EXq
}, PREFIX_DATA
},
7800 /* VEX_W_0F385A_M_0_L_0 */
7801 { "vbroadcasti128", { XM
, Mxmm
}, PREFIX_DATA
},
7804 /* VEX_W_0F385C_X86_64_P_1 */
7805 { MOD_TABLE (MOD_VEX_0F385C_X86_64_P_1_W_0
) },
7808 /* VEX_W_0F385C_X86_64_P_3 */
7809 { MOD_TABLE (MOD_VEX_0F385C_X86_64_P_3_W_0
) },
7812 /* VEX_W_0F385E_X86_64_P_0 */
7813 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_0_W_0
) },
7816 /* VEX_W_0F385E_X86_64_P_1 */
7817 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_1_W_0
) },
7820 /* VEX_W_0F385E_X86_64_P_2 */
7821 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_2_W_0
) },
7824 /* VEX_W_0F385E_X86_64_P_3 */
7825 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_3_W_0
) },
7828 /* VEX_W_0F3872_P_1 */
7829 { "%XVvcvtneps2bf16%XY", { XMM
, EXx
}, 0 },
7833 { "%XEvpbroadcastb", { XM
, EXb
}, PREFIX_DATA
},
7837 { "%XEvpbroadcastw", { XM
, EXw
}, PREFIX_DATA
},
7841 { PREFIX_TABLE (PREFIX_VEX_0F38B0_W_0
) },
7845 { PREFIX_TABLE (PREFIX_VEX_0F38B1_W_0
) },
7850 { "%XVvpmadd52luq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7855 { "%XVvpmadd52huq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7859 { "%XEvgf2p8mulb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7862 /* VEX_W_0F3A00_L_1 */
7864 { "%XEvpermq", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7867 /* VEX_W_0F3A01_L_1 */
7869 { "%XEvpermpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7873 { "vpblendd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7877 { "%XEvpermilps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7881 { "vpermilpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7884 /* VEX_W_0F3A06_L_1 */
7885 { "vperm2f128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7888 /* VEX_W_0F3A18_L_1 */
7889 { "vinsertf128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7892 /* VEX_W_0F3A19_L_1 */
7893 { "vextractf128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7897 { "%XEvcvtps2ph", { EXxmmq
, XM
, EXxEVexS
, Ib
}, PREFIX_DATA
},
7900 /* VEX_W_0F3A38_L_1 */
7901 { "vinserti128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7904 /* VEX_W_0F3A39_L_1 */
7905 { "vextracti128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7908 /* VEX_W_0F3A46_L_1 */
7909 { "vperm2i128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7913 { "vblendvps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7917 { "vblendvpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7921 { "vpblendvb", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7926 { "%XEvgf2p8affineqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7931 { "%XEvgf2p8affineinvqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7933 /* VEX_W_0FXOP_08_85_L_0 */
7935 { "vpmacssww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7937 /* VEX_W_0FXOP_08_86_L_0 */
7939 { "vpmacsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7941 /* VEX_W_0FXOP_08_87_L_0 */
7943 { "vpmacssdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7945 /* VEX_W_0FXOP_08_8E_L_0 */
7947 { "vpmacssdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7949 /* VEX_W_0FXOP_08_8F_L_0 */
7951 { "vpmacssdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7953 /* VEX_W_0FXOP_08_95_L_0 */
7955 { "vpmacsww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7957 /* VEX_W_0FXOP_08_96_L_0 */
7959 { "vpmacswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7961 /* VEX_W_0FXOP_08_97_L_0 */
7963 { "vpmacsdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7965 /* VEX_W_0FXOP_08_9E_L_0 */
7967 { "vpmacsdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7969 /* VEX_W_0FXOP_08_9F_L_0 */
7971 { "vpmacsdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7973 /* VEX_W_0FXOP_08_A6_L_0 */
7975 { "vpmadcsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7977 /* VEX_W_0FXOP_08_B6_L_0 */
7979 { "vpmadcswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7981 /* VEX_W_0FXOP_08_C0_L_0 */
7983 { "vprotb", { XM
, EXx
, Ib
}, 0 },
7985 /* VEX_W_0FXOP_08_C1_L_0 */
7987 { "vprotw", { XM
, EXx
, Ib
}, 0 },
7989 /* VEX_W_0FXOP_08_C2_L_0 */
7991 { "vprotd", { XM
, EXx
, Ib
}, 0 },
7993 /* VEX_W_0FXOP_08_C3_L_0 */
7995 { "vprotq", { XM
, EXx
, Ib
}, 0 },
7997 /* VEX_W_0FXOP_08_CC_L_0 */
7999 { "vpcomb", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8001 /* VEX_W_0FXOP_08_CD_L_0 */
8003 { "vpcomw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8005 /* VEX_W_0FXOP_08_CE_L_0 */
8007 { "vpcomd", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8009 /* VEX_W_0FXOP_08_CF_L_0 */
8011 { "vpcomq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8013 /* VEX_W_0FXOP_08_EC_L_0 */
8015 { "vpcomub", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8017 /* VEX_W_0FXOP_08_ED_L_0 */
8019 { "vpcomuw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8021 /* VEX_W_0FXOP_08_EE_L_0 */
8023 { "vpcomud", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8025 /* VEX_W_0FXOP_08_EF_L_0 */
8027 { "vpcomuq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8029 /* VEX_W_0FXOP_09_80 */
8031 { "vfrczps", { XM
, EXx
}, 0 },
8033 /* VEX_W_0FXOP_09_81 */
8035 { "vfrczpd", { XM
, EXx
}, 0 },
8037 /* VEX_W_0FXOP_09_82 */
8039 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_82_W_0
) },
8041 /* VEX_W_0FXOP_09_83 */
8043 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_83_W_0
) },
8045 /* VEX_W_0FXOP_09_C1_L_0 */
8047 { "vphaddbw", { XM
, EXxmm
}, 0 },
8049 /* VEX_W_0FXOP_09_C2_L_0 */
8051 { "vphaddbd", { XM
, EXxmm
}, 0 },
8053 /* VEX_W_0FXOP_09_C3_L_0 */
8055 { "vphaddbq", { XM
, EXxmm
}, 0 },
8057 /* VEX_W_0FXOP_09_C6_L_0 */
8059 { "vphaddwd", { XM
, EXxmm
}, 0 },
8061 /* VEX_W_0FXOP_09_C7_L_0 */
8063 { "vphaddwq", { XM
, EXxmm
}, 0 },
8065 /* VEX_W_0FXOP_09_CB_L_0 */
8067 { "vphadddq", { XM
, EXxmm
}, 0 },
8069 /* VEX_W_0FXOP_09_D1_L_0 */
8071 { "vphaddubw", { XM
, EXxmm
}, 0 },
8073 /* VEX_W_0FXOP_09_D2_L_0 */
8075 { "vphaddubd", { XM
, EXxmm
}, 0 },
8077 /* VEX_W_0FXOP_09_D3_L_0 */
8079 { "vphaddubq", { XM
, EXxmm
}, 0 },
8081 /* VEX_W_0FXOP_09_D6_L_0 */
8083 { "vphadduwd", { XM
, EXxmm
}, 0 },
8085 /* VEX_W_0FXOP_09_D7_L_0 */
8087 { "vphadduwq", { XM
, EXxmm
}, 0 },
8089 /* VEX_W_0FXOP_09_DB_L_0 */
8091 { "vphaddudq", { XM
, EXxmm
}, 0 },
8093 /* VEX_W_0FXOP_09_E1_L_0 */
8095 { "vphsubbw", { XM
, EXxmm
}, 0 },
8097 /* VEX_W_0FXOP_09_E2_L_0 */
8099 { "vphsubwd", { XM
, EXxmm
}, 0 },
8101 /* VEX_W_0FXOP_09_E3_L_0 */
8103 { "vphsubdq", { XM
, EXxmm
}, 0 },
8106 #include "i386-dis-evex-w.h"
8109 static const struct dis386 mod_table
[][2] = {
8112 { "bound{S|}", { Gv
, Ma
}, 0 },
8113 { EVEX_TABLE (EVEX_0F
) },
8117 { "leaS", { Gv
, M
}, 0 },
8121 { "lesS", { Gv
, Mp
}, 0 },
8122 { VEX_C4_TABLE (VEX_0F
) },
8126 { "ldsS", { Gv
, Mp
}, 0 },
8127 { VEX_C5_TABLE (VEX_0F
) },
8132 { RM_TABLE (RM_C6_REG_7
) },
8137 { RM_TABLE (RM_C7_REG_7
) },
8141 { "{l|}call^", { indirEp
}, 0 },
8145 { "{l|}jmp^", { indirEp
}, 0 },
8148 /* MOD_0F01_REG_0 */
8149 { X86_64_TABLE (X86_64_0F01_REG_0
) },
8150 { RM_TABLE (RM_0F01_REG_0
) },
8153 /* MOD_0F01_REG_1 */
8154 { X86_64_TABLE (X86_64_0F01_REG_1
) },
8155 { RM_TABLE (RM_0F01_REG_1
) },
8158 /* MOD_0F01_REG_2 */
8159 { X86_64_TABLE (X86_64_0F01_REG_2
) },
8160 { RM_TABLE (RM_0F01_REG_2
) },
8163 /* MOD_0F01_REG_3 */
8164 { X86_64_TABLE (X86_64_0F01_REG_3
) },
8165 { RM_TABLE (RM_0F01_REG_3
) },
8168 /* MOD_0F01_REG_5 */
8169 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_0
) },
8170 { RM_TABLE (RM_0F01_REG_5_MOD_3
) },
8173 /* MOD_0F01_REG_7 */
8174 { "invlpg", { Mb
}, 0 },
8175 { RM_TABLE (RM_0F01_REG_7_MOD_3
) },
8178 /* MOD_0F12_PREFIX_0 */
8179 { "movlpX", { XM
, EXq
}, 0 },
8180 { "movhlps", { XM
, EXq
}, 0 },
8183 /* MOD_0F12_PREFIX_2 */
8184 { "movlpX", { XM
, EXq
}, 0 },
8188 { "movlpX", { EXq
, XM
}, PREFIX_OPCODE
},
8191 /* MOD_0F16_PREFIX_0 */
8192 { "movhpX", { XM
, EXq
}, 0 },
8193 { "movlhps", { XM
, EXq
}, 0 },
8196 /* MOD_0F16_PREFIX_2 */
8197 { "movhpX", { XM
, EXq
}, 0 },
8201 { "movhpX", { EXq
, XM
}, PREFIX_OPCODE
},
8204 /* MOD_0F18_REG_0 */
8205 { "prefetchnta", { Mb
}, 0 },
8206 { "nopQ", { Ev
}, 0 },
8209 /* MOD_0F18_REG_1 */
8210 { "prefetcht0", { Mb
}, 0 },
8211 { "nopQ", { Ev
}, 0 },
8214 /* MOD_0F18_REG_2 */
8215 { "prefetcht1", { Mb
}, 0 },
8216 { "nopQ", { Ev
}, 0 },
8219 /* MOD_0F18_REG_3 */
8220 { "prefetcht2", { Mb
}, 0 },
8221 { "nopQ", { Ev
}, 0 },
8224 /* MOD_0F18_REG_6 */
8225 { X86_64_TABLE (X86_64_0F18_REG_6_MOD_0
) },
8226 { "nopQ", { Ev
}, 0 },
8229 /* MOD_0F18_REG_7 */
8230 { X86_64_TABLE (X86_64_0F18_REG_7_MOD_0
) },
8231 { "nopQ", { Ev
}, 0 },
8234 /* MOD_0F1A_PREFIX_0 */
8235 { "bndldx", { Gbnd
, Mv_bnd
}, 0 },
8236 { "nopQ", { Ev
}, 0 },
8239 /* MOD_0F1B_PREFIX_0 */
8240 { "bndstx", { Mv_bnd
, Gbnd
}, 0 },
8241 { "nopQ", { Ev
}, 0 },
8244 /* MOD_0F1B_PREFIX_1 */
8245 { "bndmk", { Gbnd
, Mv_bnd
}, 0 },
8246 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8249 /* MOD_0F1C_PREFIX_0 */
8250 { REG_TABLE (REG_0F1C_P_0_MOD_0
) },
8251 { "nopQ", { Ev
}, 0 },
8254 /* MOD_0F1E_PREFIX_1 */
8255 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8256 { REG_TABLE (REG_0F1E_P_1_MOD_3
) },
8259 /* MOD_0F2B_PREFIX_0 */
8260 {"movntps", { Mx
, XM
}, PREFIX_OPCODE
},
8263 /* MOD_0F2B_PREFIX_1 */
8264 {"movntss", { Md
, XM
}, PREFIX_OPCODE
},
8267 /* MOD_0F2B_PREFIX_2 */
8268 {"movntpd", { Mx
, XM
}, PREFIX_OPCODE
},
8271 /* MOD_0F2B_PREFIX_3 */
8272 {"movntsd", { Mq
, XM
}, PREFIX_OPCODE
},
8277 { "movmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8282 { REG_TABLE (REG_0F71_MOD_0
) },
8287 { REG_TABLE (REG_0F72_MOD_0
) },
8292 { REG_TABLE (REG_0F73_MOD_0
) },
8295 /* MOD_0FAE_REG_0 */
8296 { "fxsave", { FXSAVE
}, 0 },
8297 { PREFIX_TABLE (PREFIX_0FAE_REG_0_MOD_3
) },
8300 /* MOD_0FAE_REG_1 */
8301 { "fxrstor", { FXSAVE
}, 0 },
8302 { PREFIX_TABLE (PREFIX_0FAE_REG_1_MOD_3
) },
8305 /* MOD_0FAE_REG_2 */
8306 { "ldmxcsr", { Md
}, 0 },
8307 { PREFIX_TABLE (PREFIX_0FAE_REG_2_MOD_3
) },
8310 /* MOD_0FAE_REG_3 */
8311 { "stmxcsr", { Md
}, 0 },
8312 { PREFIX_TABLE (PREFIX_0FAE_REG_3_MOD_3
) },
8315 /* MOD_0FAE_REG_4 */
8316 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_0
) },
8317 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_3
) },
8320 /* MOD_0FAE_REG_5 */
8321 { "xrstor", { FXSAVE
}, PREFIX_OPCODE
},
8322 { PREFIX_TABLE (PREFIX_0FAE_REG_5_MOD_3
) },
8325 /* MOD_0FAE_REG_6 */
8326 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_0
) },
8327 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_3
) },
8330 /* MOD_0FAE_REG_7 */
8331 { PREFIX_TABLE (PREFIX_0FAE_REG_7_MOD_0
) },
8332 { RM_TABLE (RM_0FAE_REG_7_MOD_3
) },
8336 { "lssS", { Gv
, Mp
}, 0 },
8340 { "lfsS", { Gv
, Mp
}, 0 },
8344 { "lgsS", { Gv
, Mp
}, 0 },
8348 { "movntiS", { Edq
, Gdq
}, PREFIX_OPCODE
},
8351 /* MOD_0FC7_REG_3 */
8352 { "xrstors", { FXSAVE
}, 0 },
8355 /* MOD_0FC7_REG_4 */
8356 { "xsavec", { FXSAVE
}, 0 },
8359 /* MOD_0FC7_REG_5 */
8360 { "xsaves", { FXSAVE
}, 0 },
8363 /* MOD_0FC7_REG_6 */
8364 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_0
) },
8365 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_3
) }
8368 /* MOD_0FC7_REG_7 */
8369 { "vmptrst", { Mq
}, 0 },
8370 { PREFIX_TABLE (PREFIX_0FC7_REG_7_MOD_3
) }
8375 { "pmovmskb", { Gdq
, MS
}, 0 },
8378 /* MOD_0FE7_PREFIX_2 */
8379 { "movntdq", { Mx
, XM
}, 0 },
8382 /* MOD_0FF0_PREFIX_3 */
8383 { "lddqu", { XM
, M
}, 0 },
8387 { "movntdqa", { XM
, Mx
}, PREFIX_DATA
},
8390 /* MOD_0F38DC_PREFIX_1 */
8391 { "aesenc128kl", { XM
, M
}, 0 },
8392 { "loadiwkey", { XM
, EXx
}, 0 },
8395 /* MOD_0F38DD_PREFIX_1 */
8396 { "aesdec128kl", { XM
, M
}, 0 },
8399 /* MOD_0F38DE_PREFIX_1 */
8400 { "aesenc256kl", { XM
, M
}, 0 },
8403 /* MOD_0F38DF_PREFIX_1 */
8404 { "aesdec256kl", { XM
, M
}, 0 },
8408 { "wrussK", { M
, Gdq
}, PREFIX_DATA
},
8411 /* MOD_0F38F6_PREFIX_0 */
8412 { "wrssK", { M
, Gdq
}, PREFIX_OPCODE
},
8415 /* MOD_0F38F8_PREFIX_1 */
8416 { "enqcmds", { Gva
, M
}, PREFIX_OPCODE
},
8419 /* MOD_0F38F8_PREFIX_2 */
8420 { "movdir64b", { Gva
, M
}, PREFIX_OPCODE
},
8423 /* MOD_0F38F8_PREFIX_3 */
8424 { "enqcmd", { Gva
, M
}, PREFIX_OPCODE
},
8428 { "movdiri", { Edq
, Gdq
}, PREFIX_OPCODE
},
8431 /* MOD_0F38FA_PREFIX_1 */
8433 { "encodekey128", { Gd
, Ed
}, 0 },
8436 /* MOD_0F38FB_PREFIX_1 */
8438 { "encodekey256", { Gd
, Ed
}, 0 },
8441 /* MOD_0F3A0F_PREFIX_1 */
8443 { REG_TABLE (REG_0F3A0F_PREFIX_1_MOD_3
) },
8446 /* MOD_VEX_0F12_PREFIX_0 */
8447 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0
) },
8448 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1
) },
8451 /* MOD_VEX_0F12_PREFIX_2 */
8452 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2_M_0
) },
8456 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0
) },
8459 /* MOD_VEX_0F16_PREFIX_0 */
8460 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0
) },
8461 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1
) },
8464 /* MOD_VEX_0F16_PREFIX_2 */
8465 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2_M_0
) },
8469 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0
) },
8473 { "%XEvmovntpX", { Mx
, XM
}, PREFIX_OPCODE
},
8476 /* MOD_VEX_0F41_L_1 */
8478 { VEX_W_TABLE (VEX_W_0F41_L_1_M_1
) },
8481 /* MOD_VEX_0F42_L_1 */
8483 { VEX_W_TABLE (VEX_W_0F42_L_1_M_1
) },
8486 /* MOD_VEX_0F44_L_0 */
8488 { VEX_W_TABLE (VEX_W_0F44_L_0_M_1
) },
8491 /* MOD_VEX_0F45_L_1 */
8493 { VEX_W_TABLE (VEX_W_0F45_L_1_M_1
) },
8496 /* MOD_VEX_0F46_L_1 */
8498 { VEX_W_TABLE (VEX_W_0F46_L_1_M_1
) },
8501 /* MOD_VEX_0F47_L_1 */
8503 { VEX_W_TABLE (VEX_W_0F47_L_1_M_1
) },
8506 /* MOD_VEX_0F4A_L_1 */
8508 { VEX_W_TABLE (VEX_W_0F4A_L_1_M_1
) },
8511 /* MOD_VEX_0F4B_L_1 */
8513 { VEX_W_TABLE (VEX_W_0F4B_L_1_M_1
) },
8518 { "vmovmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8523 { REG_TABLE (REG_VEX_0F71_M_0
) },
8528 { REG_TABLE (REG_VEX_0F72_M_0
) },
8533 { REG_TABLE (REG_VEX_0F73_M_0
) },
8536 /* MOD_VEX_0F91_L_0 */
8537 { VEX_W_TABLE (VEX_W_0F91_L_0_M_0
) },
8540 /* MOD_VEX_0F92_L_0 */
8542 { VEX_W_TABLE (VEX_W_0F92_L_0_M_1
) },
8545 /* MOD_VEX_0F93_L_0 */
8547 { VEX_W_TABLE (VEX_W_0F93_L_0_M_1
) },
8550 /* MOD_VEX_0F98_L_0 */
8552 { VEX_W_TABLE (VEX_W_0F98_L_0_M_1
) },
8555 /* MOD_VEX_0F99_L_0 */
8557 { VEX_W_TABLE (VEX_W_0F99_L_0_M_1
) },
8560 /* MOD_VEX_0FAE_REG_2 */
8561 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0
) },
8564 /* MOD_VEX_0FAE_REG_3 */
8565 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0
) },
8570 { "vpmovmskb", { Gdq
, XS
}, PREFIX_DATA
},
8574 { "vmovntdq", { Mx
, XM
}, PREFIX_DATA
},
8577 /* MOD_VEX_0FF0_PREFIX_3 */
8578 { "vlddqu", { XM
, M
}, 0 },
8581 /* MOD_VEX_0F381A */
8582 { VEX_LEN_TABLE (VEX_LEN_0F381A_M_0
) },
8585 /* MOD_VEX_0F382A */
8586 { "vmovntdqa", { XM
, Mx
}, PREFIX_DATA
},
8589 /* MOD_VEX_0F382C */
8590 { VEX_W_TABLE (VEX_W_0F382C_M_0
) },
8593 /* MOD_VEX_0F382D */
8594 { VEX_W_TABLE (VEX_W_0F382D_M_0
) },
8597 /* MOD_VEX_0F382E */
8598 { VEX_W_TABLE (VEX_W_0F382E_M_0
) },
8601 /* MOD_VEX_0F382F */
8602 { VEX_W_TABLE (VEX_W_0F382F_M_0
) },
8605 /* MOD_VEX_0F3849_X86_64_P_0_W_0 */
8606 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_0_W_0_M_0
) },
8607 { REG_TABLE (REG_VEX_0F3849_X86_64_P_0_W_0_M_1
) },
8610 /* MOD_VEX_0F3849_X86_64_P_2_W_0 */
8611 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_2_W_0_M_0
) },
8614 /* MOD_VEX_0F3849_X86_64_P_3_W_0 */
8616 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_3_W_0_M_0
) },
8619 /* MOD_VEX_0F384B_X86_64_P_1_W_0 */
8620 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_1_W_0_M_0
) },
8623 /* MOD_VEX_0F384B_X86_64_P_2_W_0 */
8624 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_2_W_0_M_0
) },
8627 /* MOD_VEX_0F384B_X86_64_P_3_W_0 */
8628 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_3_W_0_M_0
) },
8631 /* MOD_VEX_0F385A */
8632 { VEX_LEN_TABLE (VEX_LEN_0F385A_M_0
) },
8635 /* MOD_VEX_0F385C_X86_64_P_1_W_0 */
8637 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_P_1_W_0_M_0
) },
8640 /* MOD_VEX_0F385C_X86_64_P_3_W_0 */
8642 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_P_3_W_0_M_0
) },
8645 /* MOD_VEX_0F385E_X86_64_P_0_W_0 */
8647 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_0_W_0_M_0
) },
8650 /* MOD_VEX_0F385E_X86_64_P_1_W_0 */
8652 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_1_W_0_M_0
) },
8655 /* MOD_VEX_0F385E_X86_64_P_2_W_0 */
8657 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_2_W_0_M_0
) },
8660 /* MOD_VEX_0F385E_X86_64_P_3_W_0 */
8662 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_3_W_0_M_0
) },
8665 /* MOD_VEX_0F388C */
8666 { "vpmaskmov%DQ", { XM
, Vex
, Mx
}, PREFIX_DATA
},
8669 /* MOD_VEX_0F388E */
8670 { "vpmaskmov%DQ", { Mx
, Vex
, XM
}, PREFIX_DATA
},
8673 /* MOD_VEX_0F3A30_L_0 */
8675 { "kshiftr%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8678 /* MOD_VEX_0F3A31_L_0 */
8680 { "kshiftr%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8683 /* MOD_VEX_0F3A32_L_0 */
8685 { "kshiftl%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8688 /* MOD_VEX_0F3A33_L_0 */
8690 { "kshiftl%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8695 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_12_M_1
) },
8698 #include "i386-dis-evex-mod.h"
8701 static const struct dis386 rm_table
[][8] = {
8704 { "xabort", { Skip_MODRM
, Ib
}, 0 },
8708 { "xbeginT", { Skip_MODRM
, Jdqw
}, 0 },
8712 { "enclv", { Skip_MODRM
}, 0 },
8713 { "vmcall", { Skip_MODRM
}, 0 },
8714 { "vmlaunch", { Skip_MODRM
}, 0 },
8715 { "vmresume", { Skip_MODRM
}, 0 },
8716 { "vmxoff", { Skip_MODRM
}, 0 },
8717 { "pconfig", { Skip_MODRM
}, 0 },
8718 { PREFIX_TABLE (PREFIX_0F01_REG_0_MOD_3_RM_6
) },
8722 { "monitor", { { OP_Monitor
, 0 } }, 0 },
8723 { "mwait", { { OP_Mwait
, 0 } }, 0 },
8724 { "clac", { Skip_MODRM
}, 0 },
8725 { "stac", { Skip_MODRM
}, 0 },
8726 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_4
) },
8727 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_5
) },
8728 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_6
) },
8729 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_7
) },
8733 { "xgetbv", { Skip_MODRM
}, 0 },
8734 { "xsetbv", { Skip_MODRM
}, 0 },
8737 { "vmfunc", { Skip_MODRM
}, 0 },
8738 { "xend", { Skip_MODRM
}, 0 },
8739 { "xtest", { Skip_MODRM
}, 0 },
8740 { "enclu", { Skip_MODRM
}, 0 },
8744 { "vmrun", { Skip_MODRM
}, 0 },
8745 { PREFIX_TABLE (PREFIX_0F01_REG_3_RM_1
) },
8746 { "vmload", { Skip_MODRM
}, 0 },
8747 { "vmsave", { Skip_MODRM
}, 0 },
8748 { "stgi", { Skip_MODRM
}, 0 },
8749 { "clgi", { Skip_MODRM
}, 0 },
8750 { "skinit", { Skip_MODRM
}, 0 },
8751 { "invlpga", { Skip_MODRM
}, 0 },
8754 /* RM_0F01_REG_5_MOD_3 */
8755 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_0
) },
8756 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_1
) },
8757 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_2
) },
8759 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_4
) },
8760 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_5
) },
8761 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_6
) },
8762 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_7
) },
8765 /* RM_0F01_REG_7_MOD_3 */
8766 { "swapgs", { Skip_MODRM
}, 0 },
8767 { "rdtscp", { Skip_MODRM
}, 0 },
8768 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_2
) },
8769 { "mwaitx", { { OP_Mwait
, eBX_reg
} }, PREFIX_OPCODE
},
8770 { "clzero", { Skip_MODRM
}, 0 },
8771 { "rdpru", { Skip_MODRM
}, 0 },
8772 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_6
) },
8773 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_7
) },
8776 /* RM_0F1E_P_1_MOD_3_REG_7 */
8777 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8778 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8779 { "endbr64", { Skip_MODRM
}, 0 },
8780 { "endbr32", { Skip_MODRM
}, 0 },
8781 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8782 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8783 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8784 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8787 /* RM_0FAE_REG_6_MOD_3 */
8788 { "mfence", { Skip_MODRM
}, 0 },
8791 /* RM_0FAE_REG_7_MOD_3 */
8792 { "sfence", { Skip_MODRM
}, 0 },
8795 /* RM_0F3A0F_P_1_MOD_3_REG_0 */
8796 { "hreset", { Skip_MODRM
, Ib
}, 0 },
8799 /* RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0 */
8800 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0
) },
8804 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
8806 /* The values used here must be non-zero, fit in 'unsigned char', and not be
8807 in conflict with actual prefix opcodes. */
8808 #define REP_PREFIX 0x01
8809 #define XACQUIRE_PREFIX 0x02
8810 #define XRELEASE_PREFIX 0x03
8811 #define BND_PREFIX 0x04
8812 #define NOTRACK_PREFIX 0x05
8815 ckprefix (instr_info
*ins
)
8817 int newrex
, i
, length
;
8821 /* The maximum instruction length is 15bytes. */
8822 while (length
< MAX_CODE_LENGTH
- 1)
8824 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
8826 switch (*ins
->codep
)
8828 /* REX prefixes family. */
8845 if (ins
->address_mode
== mode_64bit
)
8846 newrex
= *ins
->codep
;
8849 ins
->last_rex_prefix
= i
;
8852 ins
->prefixes
|= PREFIX_REPZ
;
8853 ins
->last_repz_prefix
= i
;
8856 ins
->prefixes
|= PREFIX_REPNZ
;
8857 ins
->last_repnz_prefix
= i
;
8860 ins
->prefixes
|= PREFIX_LOCK
;
8861 ins
->last_lock_prefix
= i
;
8864 ins
->prefixes
|= PREFIX_CS
;
8865 ins
->last_seg_prefix
= i
;
8866 if (ins
->address_mode
!= mode_64bit
)
8867 ins
->active_seg_prefix
= PREFIX_CS
;
8870 ins
->prefixes
|= PREFIX_SS
;
8871 ins
->last_seg_prefix
= i
;
8872 if (ins
->address_mode
!= mode_64bit
)
8873 ins
->active_seg_prefix
= PREFIX_SS
;
8876 ins
->prefixes
|= PREFIX_DS
;
8877 ins
->last_seg_prefix
= i
;
8878 if (ins
->address_mode
!= mode_64bit
)
8879 ins
->active_seg_prefix
= PREFIX_DS
;
8882 ins
->prefixes
|= PREFIX_ES
;
8883 ins
->last_seg_prefix
= i
;
8884 if (ins
->address_mode
!= mode_64bit
)
8885 ins
->active_seg_prefix
= PREFIX_ES
;
8888 ins
->prefixes
|= PREFIX_FS
;
8889 ins
->last_seg_prefix
= i
;
8890 ins
->active_seg_prefix
= PREFIX_FS
;
8893 ins
->prefixes
|= PREFIX_GS
;
8894 ins
->last_seg_prefix
= i
;
8895 ins
->active_seg_prefix
= PREFIX_GS
;
8898 ins
->prefixes
|= PREFIX_DATA
;
8899 ins
->last_data_prefix
= i
;
8902 ins
->prefixes
|= PREFIX_ADDR
;
8903 ins
->last_addr_prefix
= i
;
8906 /* fwait is really an instruction. If there are prefixes
8907 before the fwait, they belong to the fwait, *not* to the
8908 following instruction. */
8909 ins
->fwait_prefix
= i
;
8910 if (ins
->prefixes
|| ins
->rex
)
8912 ins
->prefixes
|= PREFIX_FWAIT
;
8914 /* This ensures that the previous REX prefixes are noticed
8915 as unused prefixes, as in the return case below. */
8916 ins
->rex_used
= ins
->rex
;
8919 ins
->prefixes
= PREFIX_FWAIT
;
8924 /* Rex is ignored when followed by another prefix. */
8927 ins
->rex_used
= ins
->rex
;
8930 if (*ins
->codep
!= FWAIT_OPCODE
)
8931 ins
->all_prefixes
[i
++] = *ins
->codep
;
8939 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
8943 prefix_name (instr_info
*ins
, int pref
, int sizeflag
)
8945 static const char *rexes
[16] =
8950 "rex.XB", /* 0x43 */
8952 "rex.RB", /* 0x45 */
8953 "rex.RX", /* 0x46 */
8954 "rex.RXB", /* 0x47 */
8956 "rex.WB", /* 0x49 */
8957 "rex.WX", /* 0x4a */
8958 "rex.WXB", /* 0x4b */
8959 "rex.WR", /* 0x4c */
8960 "rex.WRB", /* 0x4d */
8961 "rex.WRX", /* 0x4e */
8962 "rex.WRXB", /* 0x4f */
8967 /* REX prefixes family. */
8984 return rexes
[pref
- 0x40];
9004 return (sizeflag
& DFLAG
) ? "data16" : "data32";
9006 if (ins
->address_mode
== mode_64bit
)
9007 return (sizeflag
& AFLAG
) ? "addr32" : "addr64";
9009 return (sizeflag
& AFLAG
) ? "addr16" : "addr32";
9014 case XACQUIRE_PREFIX
:
9016 case XRELEASE_PREFIX
:
9020 case NOTRACK_PREFIX
:
9028 print_i386_disassembler_options (FILE *stream
)
9030 fprintf (stream
, _("\n\
9031 The following i386/x86-64 specific disassembler options are supported for use\n\
9032 with the -M switch (multiple options should be separated by commas):\n"));
9034 fprintf (stream
, _(" x86-64 Disassemble in 64bit mode\n"));
9035 fprintf (stream
, _(" i386 Disassemble in 32bit mode\n"));
9036 fprintf (stream
, _(" i8086 Disassemble in 16bit mode\n"));
9037 fprintf (stream
, _(" att Display instruction in AT&T syntax\n"));
9038 fprintf (stream
, _(" intel Display instruction in Intel syntax\n"));
9039 fprintf (stream
, _(" att-mnemonic\n"
9040 " Display instruction in AT&T mnemonic\n"));
9041 fprintf (stream
, _(" intel-mnemonic\n"
9042 " Display instruction in Intel mnemonic\n"));
9043 fprintf (stream
, _(" addr64 Assume 64bit address size\n"));
9044 fprintf (stream
, _(" addr32 Assume 32bit address size\n"));
9045 fprintf (stream
, _(" addr16 Assume 16bit address size\n"));
9046 fprintf (stream
, _(" data32 Assume 32bit data size\n"));
9047 fprintf (stream
, _(" data16 Assume 16bit data size\n"));
9048 fprintf (stream
, _(" suffix Always display instruction suffix in AT&T syntax\n"));
9049 fprintf (stream
, _(" amd64 Display instruction in AMD64 ISA\n"));
9050 fprintf (stream
, _(" intel64 Display instruction in Intel64 ISA\n"));
9054 static const struct dis386 bad_opcode
= { "(bad)", { XX
}, 0 };
9056 /* Get a pointer to struct dis386 with a valid name. */
9058 static const struct dis386
*
9059 get_valid_dis386 (const struct dis386
*dp
, instr_info
*ins
)
9061 int vindex
, vex_table_index
;
9063 if (dp
->name
!= NULL
)
9066 switch (dp
->op
[0].bytemode
)
9069 dp
= ®_table
[dp
->op
[1].bytemode
][ins
->modrm
.reg
];
9073 vindex
= ins
->modrm
.mod
== 0x3 ? 1 : 0;
9074 dp
= &mod_table
[dp
->op
[1].bytemode
][vindex
];
9078 dp
= &rm_table
[dp
->op
[1].bytemode
][ins
->modrm
.rm
];
9081 case USE_PREFIX_TABLE
:
9084 /* The prefix in VEX is implicit. */
9085 switch (ins
->vex
.prefix
)
9090 case REPE_PREFIX_OPCODE
:
9093 case DATA_PREFIX_OPCODE
:
9096 case REPNE_PREFIX_OPCODE
:
9106 int last_prefix
= -1;
9109 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
9110 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
9112 if ((ins
->prefixes
& (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
9114 if (ins
->last_repz_prefix
> ins
->last_repnz_prefix
)
9117 prefix
= PREFIX_REPZ
;
9118 last_prefix
= ins
->last_repz_prefix
;
9123 prefix
= PREFIX_REPNZ
;
9124 last_prefix
= ins
->last_repnz_prefix
;
9127 /* Check if prefix should be ignored. */
9128 if ((((prefix_table
[dp
->op
[1].bytemode
][vindex
].prefix_requirement
9129 & PREFIX_IGNORED
) >> PREFIX_IGNORED_SHIFT
)
9131 && !prefix_table
[dp
->op
[1].bytemode
][vindex
].name
)
9135 if (vindex
== 0 && (ins
->prefixes
& PREFIX_DATA
) != 0)
9138 prefix
= PREFIX_DATA
;
9139 last_prefix
= ins
->last_data_prefix
;
9144 ins
->used_prefixes
|= prefix
;
9145 ins
->all_prefixes
[last_prefix
] = 0;
9148 dp
= &prefix_table
[dp
->op
[1].bytemode
][vindex
];
9151 case USE_X86_64_TABLE
:
9152 vindex
= ins
->address_mode
== mode_64bit
? 1 : 0;
9153 dp
= &x86_64_table
[dp
->op
[1].bytemode
][vindex
];
9156 case USE_3BYTE_TABLE
:
9157 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
9158 vindex
= *ins
->codep
++;
9159 dp
= &three_byte_table
[dp
->op
[1].bytemode
][vindex
];
9160 ins
->end_codep
= ins
->codep
;
9161 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9162 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9163 ins
->modrm
.rm
= *ins
->codep
& 7;
9166 case USE_VEX_LEN_TABLE
:
9170 switch (ins
->vex
.length
)
9176 /* This allows re-using in particular table entries where only
9177 128-bit operand size (VEX.L=0 / EVEX.L'L=0) are valid. */
9190 dp
= &vex_len_table
[dp
->op
[1].bytemode
][vindex
];
9193 case USE_EVEX_LEN_TABLE
:
9197 switch (ins
->vex
.length
)
9213 dp
= &evex_len_table
[dp
->op
[1].bytemode
][vindex
];
9216 case USE_XOP_8F_TABLE
:
9217 FETCH_DATA (ins
->info
, ins
->codep
+ 3);
9218 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9220 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
9221 switch ((*ins
->codep
& 0x1f))
9227 vex_table_index
= XOP_08
;
9230 vex_table_index
= XOP_09
;
9233 vex_table_index
= XOP_0A
;
9237 ins
->vex
.w
= *ins
->codep
& 0x80;
9238 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9241 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9242 if (ins
->address_mode
!= mode_64bit
)
9244 /* In 16/32-bit mode REX_B is silently ignored. */
9248 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9249 switch ((*ins
->codep
& 0x3))
9254 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9257 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9260 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9263 ins
->need_vex
= true;
9265 vindex
= *ins
->codep
++;
9266 dp
= &xop_table
[vex_table_index
][vindex
];
9268 ins
->end_codep
= ins
->codep
;
9269 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9270 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9271 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9272 ins
->modrm
.rm
= *ins
->codep
& 7;
9274 /* No XOP encoding so far allows for a non-zero embedded prefix. Avoid
9275 having to decode the bits for every otherwise valid encoding. */
9276 if (ins
->vex
.prefix
)
9280 case USE_VEX_C4_TABLE
:
9282 FETCH_DATA (ins
->info
, ins
->codep
+ 3);
9283 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9284 switch ((*ins
->codep
& 0x1f))
9290 vex_table_index
= VEX_0F
;
9293 vex_table_index
= VEX_0F38
;
9296 vex_table_index
= VEX_0F3A
;
9300 ins
->vex
.w
= *ins
->codep
& 0x80;
9301 if (ins
->address_mode
== mode_64bit
)
9308 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
9309 is ignored, other REX bits are 0 and the highest bit in
9310 VEX.vvvv is also ignored (but we mustn't clear it here). */
9313 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9314 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9315 switch ((*ins
->codep
& 0x3))
9320 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9323 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9326 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9329 ins
->need_vex
= true;
9331 vindex
= *ins
->codep
++;
9332 dp
= &vex_table
[vex_table_index
][vindex
];
9333 ins
->end_codep
= ins
->codep
;
9334 /* There is no MODRM byte for VEX0F 77. */
9335 if (vex_table_index
!= VEX_0F
|| vindex
!= 0x77)
9337 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9338 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9339 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9340 ins
->modrm
.rm
= *ins
->codep
& 7;
9344 case USE_VEX_C5_TABLE
:
9346 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
9347 ins
->rex
= (*ins
->codep
& 0x80) ? 0 : REX_R
;
9349 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
9351 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9352 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9353 switch ((*ins
->codep
& 0x3))
9358 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9361 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9364 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9367 ins
->need_vex
= true;
9369 vindex
= *ins
->codep
++;
9370 dp
= &vex_table
[dp
->op
[1].bytemode
][vindex
];
9371 ins
->end_codep
= ins
->codep
;
9372 /* There is no MODRM byte for VEX 77. */
9375 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9376 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9377 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9378 ins
->modrm
.rm
= *ins
->codep
& 7;
9382 case USE_VEX_W_TABLE
:
9386 dp
= &vex_w_table
[dp
->op
[1].bytemode
][ins
->vex
.w
];
9389 case USE_EVEX_TABLE
:
9390 ins
->two_source_ops
= false;
9392 ins
->vex
.evex
= true;
9393 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
9394 /* The first byte after 0x62. */
9395 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9396 ins
->vex
.r
= *ins
->codep
& 0x10;
9397 switch ((*ins
->codep
& 0xf))
9402 vex_table_index
= EVEX_0F
;
9405 vex_table_index
= EVEX_0F38
;
9408 vex_table_index
= EVEX_0F3A
;
9411 vex_table_index
= EVEX_MAP5
;
9414 vex_table_index
= EVEX_MAP6
;
9418 /* The second byte after 0x62. */
9420 ins
->vex
.w
= *ins
->codep
& 0x80;
9421 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9424 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9427 if (!(*ins
->codep
& 0x4))
9430 switch ((*ins
->codep
& 0x3))
9435 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9438 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9441 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9445 /* The third byte after 0x62. */
9448 /* Remember the static rounding bits. */
9449 ins
->vex
.ll
= (*ins
->codep
>> 5) & 3;
9450 ins
->vex
.b
= *ins
->codep
& 0x10;
9452 ins
->vex
.v
= *ins
->codep
& 0x8;
9453 ins
->vex
.mask_register_specifier
= *ins
->codep
& 0x7;
9454 ins
->vex
.zeroing
= *ins
->codep
& 0x80;
9456 if (ins
->address_mode
!= mode_64bit
)
9458 /* In 16/32-bit mode silently ignore following bits. */
9463 ins
->need_vex
= true;
9465 vindex
= *ins
->codep
++;
9466 dp
= &evex_table
[vex_table_index
][vindex
];
9467 ins
->end_codep
= ins
->codep
;
9468 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9469 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9470 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9471 ins
->modrm
.rm
= *ins
->codep
& 7;
9473 /* Set vector length. */
9474 if (ins
->modrm
.mod
== 3 && ins
->vex
.b
)
9475 ins
->vex
.length
= 512;
9478 switch (ins
->vex
.ll
)
9481 ins
->vex
.length
= 128;
9484 ins
->vex
.length
= 256;
9487 ins
->vex
.length
= 512;
9503 if (dp
->name
!= NULL
)
9506 return get_valid_dis386 (dp
, ins
);
9510 get_sib (instr_info
*ins
, int sizeflag
)
9512 /* If modrm.mod == 3, operand must be register. */
9514 && ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
9515 && ins
->modrm
.mod
!= 3
9516 && ins
->modrm
.rm
== 4)
9518 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
9519 ins
->sib
.index
= (ins
->codep
[1] >> 3) & 7;
9520 ins
->sib
.scale
= (ins
->codep
[1] >> 6) & 3;
9521 ins
->sib
.base
= ins
->codep
[1] & 7;
9522 ins
->has_sib
= true;
9525 ins
->has_sib
= false;
9528 /* Like oappend (below), but S is a string starting with '%'. In
9529 Intel syntax, the '%' is elided. */
9532 oappend_register (instr_info
*ins
, const char *s
)
9534 oappend_with_style (ins
, s
+ ins
->intel_syntax
, dis_style_register
);
9537 /* Wrap around a call to INS->info->fprintf_styled_func, printing FMT.
9538 STYLE is the default style to use in the fprintf_styled_func calls,
9539 however, FMT might include embedded style markers (see oappend_style),
9540 these embedded markers are not printed, but instead change the style
9541 used in the next fprintf_styled_func call. */
9543 static void ATTRIBUTE_PRINTF_3
9544 i386_dis_printf (instr_info
*ins
, enum disassembler_style style
,
9545 const char *fmt
, ...)
9548 enum disassembler_style curr_style
= style
;
9549 const char *start
, *curr
;
9550 char staging_area
[40];
9553 /* In particular print_insn()'s processing of op_txt[] can hand rather long
9554 strings here. Bypass vsnprintf() in such cases to avoid capacity issues
9555 with the staging area. */
9556 if (strcmp (fmt
, "%s"))
9558 int res
= vsnprintf (staging_area
, sizeof (staging_area
), fmt
, ap
);
9565 if ((size_t) res
>= sizeof (staging_area
))
9568 start
= curr
= staging_area
;
9572 start
= curr
= va_arg (ap
, const char *);
9579 || (*curr
== STYLE_MARKER_CHAR
9580 && ISXDIGIT (*(curr
+ 1))
9581 && *(curr
+ 2) == STYLE_MARKER_CHAR
))
9583 /* Output content between our START position and CURR. */
9584 int len
= curr
- start
;
9585 int n
= (*ins
->info
->fprintf_styled_func
) (ins
->info
->stream
,
9587 "%.*s", len
, start
);
9594 /* Skip over the initial STYLE_MARKER_CHAR. */
9597 /* Update the CURR_STYLE. As there are less than 16 styles, it
9598 is possible, that if the input is corrupted in some way, that
9599 we might set CURR_STYLE to an invalid value. Don't worry
9600 though, we check for this situation. */
9601 if (*curr
>= '0' && *curr
<= '9')
9602 curr_style
= (enum disassembler_style
) (*curr
- '0');
9603 else if (*curr
>= 'a' && *curr
<= 'f')
9604 curr_style
= (enum disassembler_style
) (*curr
- 'a' + 10);
9606 curr_style
= dis_style_text
;
9608 /* Check for an invalid style having been selected. This should
9609 never happen, but it doesn't hurt to be a little paranoid. */
9610 if (curr_style
> dis_style_comment_start
)
9611 curr_style
= dis_style_text
;
9613 /* Skip the hex character, and the closing STYLE_MARKER_CHAR. */
9616 /* Reset the START to after the style marker. */
9626 print_insn (bfd_vma pc
, disassemble_info
*info
, int intel_syntax
)
9628 const struct dis386
*dp
;
9630 char *op_txt
[MAX_OPERANDS
];
9632 bool intel_swap_2_3
;
9633 int sizeflag
, orig_sizeflag
;
9635 struct dis_private priv
;
9640 .intel_syntax
= intel_syntax
>= 0
9642 : (info
->mach
& bfd_mach_i386_intel_syntax
) != 0,
9643 .intel_mnemonic
= !SYSV386_COMPAT
,
9644 .op_index
[0 ... MAX_OPERANDS
- 1] = -1,
9646 .start_codep
= priv
.the_buffer
,
9647 .codep
= priv
.the_buffer
,
9649 .last_lock_prefix
= -1,
9650 .last_repz_prefix
= -1,
9651 .last_repnz_prefix
= -1,
9652 .last_data_prefix
= -1,
9653 .last_addr_prefix
= -1,
9654 .last_rex_prefix
= -1,
9655 .last_seg_prefix
= -1,
9658 char op_out
[MAX_OPERANDS
][MAX_OPERAND_BUFFER_SIZE
];
9660 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
9661 if ((info
->mach
& bfd_mach_i386_i386
) != 0)
9662 ins
.address_mode
= mode_32bit
;
9663 else if (info
->mach
== bfd_mach_i386_i8086
)
9665 ins
.address_mode
= mode_16bit
;
9666 priv
.orig_sizeflag
= 0;
9669 ins
.address_mode
= mode_64bit
;
9671 for (p
= info
->disassembler_options
; p
!= NULL
;)
9673 if (startswith (p
, "amd64"))
9675 else if (startswith (p
, "intel64"))
9676 ins
.isa64
= intel64
;
9677 else if (startswith (p
, "x86-64"))
9679 ins
.address_mode
= mode_64bit
;
9680 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9682 else if (startswith (p
, "i386"))
9684 ins
.address_mode
= mode_32bit
;
9685 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9687 else if (startswith (p
, "i8086"))
9689 ins
.address_mode
= mode_16bit
;
9690 priv
.orig_sizeflag
&= ~(AFLAG
| DFLAG
);
9692 else if (startswith (p
, "intel"))
9694 ins
.intel_syntax
= 1;
9695 if (startswith (p
+ 5, "-mnemonic"))
9696 ins
.intel_mnemonic
= true;
9698 else if (startswith (p
, "att"))
9700 ins
.intel_syntax
= 0;
9701 if (startswith (p
+ 3, "-mnemonic"))
9702 ins
.intel_mnemonic
= false;
9704 else if (startswith (p
, "addr"))
9706 if (ins
.address_mode
== mode_64bit
)
9708 if (p
[4] == '3' && p
[5] == '2')
9709 priv
.orig_sizeflag
&= ~AFLAG
;
9710 else if (p
[4] == '6' && p
[5] == '4')
9711 priv
.orig_sizeflag
|= AFLAG
;
9715 if (p
[4] == '1' && p
[5] == '6')
9716 priv
.orig_sizeflag
&= ~AFLAG
;
9717 else if (p
[4] == '3' && p
[5] == '2')
9718 priv
.orig_sizeflag
|= AFLAG
;
9721 else if (startswith (p
, "data"))
9723 if (p
[4] == '1' && p
[5] == '6')
9724 priv
.orig_sizeflag
&= ~DFLAG
;
9725 else if (p
[4] == '3' && p
[5] == '2')
9726 priv
.orig_sizeflag
|= DFLAG
;
9728 else if (startswith (p
, "suffix"))
9729 priv
.orig_sizeflag
|= SUFFIX_ALWAYS
;
9731 p
= strchr (p
, ',');
9736 if (ins
.address_mode
== mode_64bit
&& sizeof (bfd_vma
) < 8)
9738 i386_dis_printf (&ins
, dis_style_text
, _("64-bit address is disabled"));
9742 if (ins
.intel_syntax
)
9744 ins
.open_char
= '[';
9745 ins
.close_char
= ']';
9746 ins
.separator_char
= '+';
9747 ins
.scale_char
= '*';
9751 ins
.open_char
= '(';
9752 ins
.close_char
= ')';
9753 ins
.separator_char
= ',';
9754 ins
.scale_char
= ',';
9757 /* The output looks better if we put 7 bytes on a line, since that
9758 puts most long word instructions on a single line. */
9759 info
->bytes_per_line
= 7;
9761 info
->private_data
= &priv
;
9762 priv
.max_fetched
= priv
.the_buffer
;
9763 priv
.insn_start
= pc
;
9765 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9768 ins
.op_out
[i
] = op_out
[i
];
9771 if (OPCODES_SIGSETJMP (priv
.bailout
) != 0)
9773 /* Getting here means we tried for data but didn't get it. That
9774 means we have an incomplete instruction of some sort. Just
9775 print the first byte as a prefix or a .byte pseudo-op. */
9776 if (ins
.codep
> priv
.the_buffer
)
9778 const char *name
= NULL
;
9780 if (ins
.prefixes
|| ins
.fwait_prefix
>= 0 || (ins
.rex
& REX_OPCODE
))
9781 name
= prefix_name (&ins
, priv
.the_buffer
[0], priv
.orig_sizeflag
);
9783 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s", name
);
9786 /* Just print the first byte as a .byte instruction. */
9787 i386_dis_printf (&ins
, dis_style_assembler_directive
,
9789 i386_dis_printf (&ins
, dis_style_immediate
, "0x%x",
9790 (unsigned int) priv
.the_buffer
[0]);
9799 sizeflag
= priv
.orig_sizeflag
;
9801 if (!ckprefix (&ins
) || ins
.rex_used
)
9803 /* Too many prefixes or unused REX prefixes. */
9805 i
< (int) ARRAY_SIZE (ins
.all_prefixes
) && ins
.all_prefixes
[i
];
9807 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s%s",
9808 (i
== 0 ? "" : " "),
9809 prefix_name (&ins
, ins
.all_prefixes
[i
], sizeflag
));
9813 ins
.insn_codep
= ins
.codep
;
9815 FETCH_DATA (info
, ins
.codep
+ 1);
9816 ins
.two_source_ops
= (*ins
.codep
== 0x62) || (*ins
.codep
== 0xc8);
9818 if (((ins
.prefixes
& PREFIX_FWAIT
)
9819 && ((*ins
.codep
< 0xd8) || (*ins
.codep
> 0xdf))))
9821 /* Handle ins.prefixes before fwait. */
9822 for (i
= 0; i
< ins
.fwait_prefix
&& ins
.all_prefixes
[i
];
9824 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s ",
9825 prefix_name (&ins
, ins
.all_prefixes
[i
], sizeflag
));
9826 i386_dis_printf (&ins
, dis_style_mnemonic
, "fwait");
9830 if (*ins
.codep
== 0x0f)
9832 unsigned char threebyte
;
9835 FETCH_DATA (info
, ins
.codep
+ 1);
9836 threebyte
= *ins
.codep
;
9837 dp
= &dis386_twobyte
[threebyte
];
9838 ins
.need_modrm
= twobyte_has_modrm
[threebyte
];
9843 dp
= &dis386
[*ins
.codep
];
9844 ins
.need_modrm
= onebyte_has_modrm
[*ins
.codep
];
9848 /* Save sizeflag for printing the extra ins.prefixes later before updating
9849 it for mnemonic and operand processing. The prefix names depend
9850 only on the address mode. */
9851 orig_sizeflag
= sizeflag
;
9852 if (ins
.prefixes
& PREFIX_ADDR
)
9854 if ((ins
.prefixes
& PREFIX_DATA
))
9857 ins
.end_codep
= ins
.codep
;
9860 FETCH_DATA (info
, ins
.codep
+ 1);
9861 ins
.modrm
.mod
= (*ins
.codep
>> 6) & 3;
9862 ins
.modrm
.reg
= (*ins
.codep
>> 3) & 7;
9863 ins
.modrm
.rm
= *ins
.codep
& 7;
9866 if (dp
->name
== NULL
&& dp
->op
[0].bytemode
== FLOATCODE
)
9868 get_sib (&ins
, sizeflag
);
9869 dofloat (&ins
, sizeflag
);
9873 dp
= get_valid_dis386 (dp
, &ins
);
9874 if (dp
!= NULL
&& putop (&ins
, dp
->name
, sizeflag
) == 0)
9876 get_sib (&ins
, sizeflag
);
9877 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9879 ins
.obufp
= ins
.op_out
[i
];
9880 ins
.op_ad
= MAX_OPERANDS
- 1 - i
;
9882 (*dp
->op
[i
].rtn
) (&ins
, dp
->op
[i
].bytemode
, sizeflag
);
9883 /* For EVEX instruction after the last operand masking
9884 should be printed. */
9885 if (i
== 0 && ins
.vex
.evex
)
9887 /* Don't print {%k0}. */
9888 if (ins
.vex
.mask_register_specifier
)
9890 const char *reg_name
9891 = att_names_mask
[ins
.vex
.mask_register_specifier
];
9893 oappend (&ins
, "{");
9894 oappend_register (&ins
, reg_name
);
9895 oappend (&ins
, "}");
9897 if (ins
.vex
.zeroing
)
9898 oappend (&ins
, "{z}");
9900 /* S/G insns require a mask and don't allow
9902 if ((dp
->op
[0].bytemode
== vex_vsib_d_w_dq_mode
9903 || dp
->op
[0].bytemode
== vex_vsib_q_w_dq_mode
)
9904 && (ins
.vex
.mask_register_specifier
== 0
9905 || ins
.vex
.zeroing
))
9906 oappend (&ins
, "/(bad)");
9910 /* Check whether rounding control was enabled for an insn not
9912 if (ins
.modrm
.mod
== 3 && ins
.vex
.b
9913 && !(ins
.evex_used
& EVEX_b_used
))
9915 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9917 ins
.obufp
= ins
.op_out
[i
];
9920 oappend (&ins
, names_rounding
[ins
.vex
.ll
]);
9921 oappend (&ins
, "bad}");
9928 /* Clear instruction information. */
9929 info
->insn_info_valid
= 0;
9930 info
->branch_delay_insns
= 0;
9931 info
->data_size
= 0;
9932 info
->insn_type
= dis_noninsn
;
9936 /* Reset jump operation indicator. */
9937 ins
.op_is_jump
= false;
9939 int jump_detection
= 0;
9941 /* Extract flags. */
9942 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9944 if ((dp
->op
[i
].rtn
== OP_J
)
9945 || (dp
->op
[i
].rtn
== OP_indirE
))
9946 jump_detection
|= 1;
9947 else if ((dp
->op
[i
].rtn
== BND_Fixup
)
9948 || (!dp
->op
[i
].rtn
&& !dp
->op
[i
].bytemode
))
9949 jump_detection
|= 2;
9950 else if ((dp
->op
[i
].bytemode
== cond_jump_mode
)
9951 || (dp
->op
[i
].bytemode
== loop_jcxz_mode
))
9952 jump_detection
|= 4;
9955 /* Determine if this is a jump or branch. */
9956 if ((jump_detection
& 0x3) == 0x3)
9958 ins
.op_is_jump
= true;
9959 if (jump_detection
& 0x4)
9960 info
->insn_type
= dis_condbranch
;
9962 info
->insn_type
= (dp
->name
&& !strncmp (dp
->name
, "call", 4))
9963 ? dis_jsr
: dis_branch
;
9967 /* If VEX.vvvv and EVEX.vvvv are unused, they must be all 1s, which
9968 are all 0s in inverted form. */
9969 if (ins
.need_vex
&& ins
.vex
.register_specifier
!= 0)
9971 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
9972 return ins
.end_codep
- priv
.the_buffer
;
9975 /* If EVEX.z is set, there must be an actual mask register in use. */
9976 if (ins
.vex
.zeroing
&& ins
.vex
.mask_register_specifier
== 0)
9978 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
9979 return ins
.end_codep
- priv
.the_buffer
;
9982 switch (dp
->prefix_requirement
)
9985 /* If only the data prefix is marked as mandatory, its absence renders
9986 the encoding invalid. Most other PREFIX_OPCODE rules still apply. */
9987 if (ins
.need_vex
? !ins
.vex
.prefix
: !(ins
.prefixes
& PREFIX_DATA
))
9989 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
9990 return ins
.end_codep
- priv
.the_buffer
;
9992 ins
.used_prefixes
|= PREFIX_DATA
;
9995 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
9996 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
9997 used by putop and MMX/SSE operand and may be overridden by the
9998 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
10001 ? ins
.vex
.prefix
== REPE_PREFIX_OPCODE
10002 || ins
.vex
.prefix
== REPNE_PREFIX_OPCODE
10004 & (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
10005 && (ins
.used_prefixes
10006 & (PREFIX_REPZ
| PREFIX_REPNZ
)) == 0)
10008 ? ins
.vex
.prefix
== DATA_PREFIX_OPCODE
10010 & (PREFIX_REPZ
| PREFIX_REPNZ
| PREFIX_DATA
))
10012 && (ins
.used_prefixes
& PREFIX_DATA
) == 0))
10013 || (ins
.vex
.evex
&& dp
->prefix_requirement
!= PREFIX_DATA
10014 && !ins
.vex
.w
!= !(ins
.used_prefixes
& PREFIX_DATA
)))
10016 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10017 return ins
.end_codep
- priv
.the_buffer
;
10021 case PREFIX_IGNORED
:
10022 /* Zap data size and rep prefixes from used_prefixes and reinstate their
10023 origins in all_prefixes. */
10024 ins
.used_prefixes
&= ~PREFIX_OPCODE
;
10025 if (ins
.last_data_prefix
>= 0)
10026 ins
.all_prefixes
[ins
.last_data_prefix
] = 0x66;
10027 if (ins
.last_repz_prefix
>= 0)
10028 ins
.all_prefixes
[ins
.last_repz_prefix
] = 0xf3;
10029 if (ins
.last_repnz_prefix
>= 0)
10030 ins
.all_prefixes
[ins
.last_repnz_prefix
] = 0xf2;
10034 /* Check if the REX prefix is used. */
10035 if ((ins
.rex
^ ins
.rex_used
) == 0
10036 && !ins
.need_vex
&& ins
.last_rex_prefix
>= 0)
10037 ins
.all_prefixes
[ins
.last_rex_prefix
] = 0;
10039 /* Check if the SEG prefix is used. */
10040 if ((ins
.prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
| PREFIX_ES
10041 | PREFIX_FS
| PREFIX_GS
)) != 0
10042 && (ins
.used_prefixes
& ins
.active_seg_prefix
) != 0)
10043 ins
.all_prefixes
[ins
.last_seg_prefix
] = 0;
10045 /* Check if the ADDR prefix is used. */
10046 if ((ins
.prefixes
& PREFIX_ADDR
) != 0
10047 && (ins
.used_prefixes
& PREFIX_ADDR
) != 0)
10048 ins
.all_prefixes
[ins
.last_addr_prefix
] = 0;
10050 /* Check if the DATA prefix is used. */
10051 if ((ins
.prefixes
& PREFIX_DATA
) != 0
10052 && (ins
.used_prefixes
& PREFIX_DATA
) != 0
10054 ins
.all_prefixes
[ins
.last_data_prefix
] = 0;
10056 /* Print the extra ins.prefixes. */
10058 for (i
= 0; i
< (int) ARRAY_SIZE (ins
.all_prefixes
); i
++)
10059 if (ins
.all_prefixes
[i
])
10062 name
= prefix_name (&ins
, ins
.all_prefixes
[i
], orig_sizeflag
);
10065 prefix_length
+= strlen (name
) + 1;
10066 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s ", name
);
10069 /* Check maximum code length. */
10070 if ((ins
.codep
- ins
.start_codep
) > MAX_CODE_LENGTH
)
10072 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10073 return MAX_CODE_LENGTH
;
10076 /* Calculate the number of operands this instruction has. */
10078 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10079 if (*ins
.op_out
[i
] != '\0')
10082 /* Calculate the number of spaces to print after the mnemonic. */
10083 ins
.obufp
= ins
.mnemonicendp
;
10086 i
= strlen (ins
.obuf
) + prefix_length
;
10095 /* Print the instruction mnemonic along with any trailing whitespace. */
10096 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s%*s", ins
.obuf
, i
, "");
10098 /* The enter and bound instructions are printed with operands in the same
10099 order as the intel book; everything else is printed in reverse order. */
10100 intel_swap_2_3
= false;
10101 if (ins
.intel_syntax
|| ins
.two_source_ops
)
10103 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10104 op_txt
[i
] = ins
.op_out
[i
];
10106 if (ins
.intel_syntax
&& dp
&& dp
->op
[2].rtn
== OP_Rounding
10107 && dp
->op
[3].rtn
== OP_E
&& dp
->op
[4].rtn
== NULL
)
10109 op_txt
[2] = ins
.op_out
[3];
10110 op_txt
[3] = ins
.op_out
[2];
10111 intel_swap_2_3
= true;
10114 for (i
= 0; i
< (MAX_OPERANDS
>> 1); ++i
)
10118 ins
.op_ad
= ins
.op_index
[i
];
10119 ins
.op_index
[i
] = ins
.op_index
[MAX_OPERANDS
- 1 - i
];
10120 ins
.op_index
[MAX_OPERANDS
- 1 - i
] = ins
.op_ad
;
10121 riprel
= ins
.op_riprel
[i
];
10122 ins
.op_riprel
[i
] = ins
.op_riprel
[MAX_OPERANDS
- 1 - i
];
10123 ins
.op_riprel
[MAX_OPERANDS
- 1 - i
] = riprel
;
10128 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10129 op_txt
[MAX_OPERANDS
- 1 - i
] = ins
.op_out
[i
];
10133 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10136 /* In Intel syntax embedded rounding / SAE are not separate operands.
10137 Instead they're attached to the prior register operand. Simply
10138 suppress emission of the comma to achieve that effect. */
10139 switch (i
& -(ins
.intel_syntax
&& dp
))
10142 if (dp
->op
[2].rtn
== OP_Rounding
&& !intel_swap_2_3
)
10146 if (dp
->op
[3].rtn
== OP_Rounding
|| intel_swap_2_3
)
10151 i386_dis_printf (&ins
, dis_style_text
, ",");
10152 if (ins
.op_index
[i
] != -1 && !ins
.op_riprel
[i
])
10154 bfd_vma target
= (bfd_vma
) ins
.op_address
[ins
.op_index
[i
]];
10156 if (ins
.op_is_jump
)
10158 info
->insn_info_valid
= 1;
10159 info
->branch_delay_insns
= 0;
10160 info
->data_size
= 0;
10161 info
->target
= target
;
10164 (*info
->print_address_func
) (target
, info
);
10167 i386_dis_printf (&ins
, dis_style_text
, "%s", op_txt
[i
]);
10171 for (i
= 0; i
< MAX_OPERANDS
; i
++)
10172 if (ins
.op_index
[i
] != -1 && ins
.op_riprel
[i
])
10174 i386_dis_printf (&ins
, dis_style_comment_start
, " # ");
10175 (*info
->print_address_func
)
10176 ((bfd_vma
)(ins
.start_pc
+ (ins
.codep
- ins
.start_codep
)
10177 + ins
.op_address
[ins
.op_index
[i
]]),
10181 return ins
.codep
- priv
.the_buffer
;
10184 /* Here for backwards compatibility. When gdb stops using
10185 print_insn_i386_att and print_insn_i386_intel these functions can
10186 disappear, and print_insn_i386 be merged into print_insn. */
10188 print_insn_i386_att (bfd_vma pc
, disassemble_info
*info
)
10190 return print_insn (pc
, info
, 0);
10194 print_insn_i386_intel (bfd_vma pc
, disassemble_info
*info
)
10196 return print_insn (pc
, info
, 1);
10200 print_insn_i386 (bfd_vma pc
, disassemble_info
*info
)
10202 return print_insn (pc
, info
, -1);
10205 static const char *float_mem
[] = {
10280 static const unsigned char float_mem_mode
[] = {
10355 #define ST { OP_ST, 0 }
10356 #define STi { OP_STi, 0 }
10358 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
10359 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
10360 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
10361 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
10362 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
10363 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
10364 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
10365 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
10366 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
10368 static const struct dis386 float_reg
[][8] = {
10371 { "fadd", { ST
, STi
}, 0 },
10372 { "fmul", { ST
, STi
}, 0 },
10373 { "fcom", { STi
}, 0 },
10374 { "fcomp", { STi
}, 0 },
10375 { "fsub", { ST
, STi
}, 0 },
10376 { "fsubr", { ST
, STi
}, 0 },
10377 { "fdiv", { ST
, STi
}, 0 },
10378 { "fdivr", { ST
, STi
}, 0 },
10382 { "fld", { STi
}, 0 },
10383 { "fxch", { STi
}, 0 },
10393 { "fcmovb", { ST
, STi
}, 0 },
10394 { "fcmove", { ST
, STi
}, 0 },
10395 { "fcmovbe",{ ST
, STi
}, 0 },
10396 { "fcmovu", { ST
, STi
}, 0 },
10404 { "fcmovnb",{ ST
, STi
}, 0 },
10405 { "fcmovne",{ ST
, STi
}, 0 },
10406 { "fcmovnbe",{ ST
, STi
}, 0 },
10407 { "fcmovnu",{ ST
, STi
}, 0 },
10409 { "fucomi", { ST
, STi
}, 0 },
10410 { "fcomi", { ST
, STi
}, 0 },
10415 { "fadd", { STi
, ST
}, 0 },
10416 { "fmul", { STi
, ST
}, 0 },
10419 { "fsub{!M|r}", { STi
, ST
}, 0 },
10420 { "fsub{M|}", { STi
, ST
}, 0 },
10421 { "fdiv{!M|r}", { STi
, ST
}, 0 },
10422 { "fdiv{M|}", { STi
, ST
}, 0 },
10426 { "ffree", { STi
}, 0 },
10428 { "fst", { STi
}, 0 },
10429 { "fstp", { STi
}, 0 },
10430 { "fucom", { STi
}, 0 },
10431 { "fucomp", { STi
}, 0 },
10437 { "faddp", { STi
, ST
}, 0 },
10438 { "fmulp", { STi
, ST
}, 0 },
10441 { "fsub{!M|r}p", { STi
, ST
}, 0 },
10442 { "fsub{M|}p", { STi
, ST
}, 0 },
10443 { "fdiv{!M|r}p", { STi
, ST
}, 0 },
10444 { "fdiv{M|}p", { STi
, ST
}, 0 },
10448 { "ffreep", { STi
}, 0 },
10453 { "fucomip", { ST
, STi
}, 0 },
10454 { "fcomip", { ST
, STi
}, 0 },
10459 static const char *const fgrps
[][8] = {
10462 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10467 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10472 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
10477 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
10482 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
10487 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
10492 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10497 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
10498 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
10503 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10508 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10513 swap_operand (instr_info
*ins
)
10515 ins
->mnemonicendp
[0] = '.';
10516 ins
->mnemonicendp
[1] = 's';
10517 ins
->mnemonicendp
[2] = '\0';
10518 ins
->mnemonicendp
+= 2;
10522 OP_Skip_MODRM (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10523 int sizeflag ATTRIBUTE_UNUSED
)
10525 /* Skip mod/rm byte. */
10531 dofloat (instr_info
*ins
, int sizeflag
)
10533 const struct dis386
*dp
;
10534 unsigned char floatop
;
10536 floatop
= ins
->codep
[-1];
10538 if (ins
->modrm
.mod
!= 3)
10540 int fp_indx
= (floatop
- 0xd8) * 8 + ins
->modrm
.reg
;
10542 putop (ins
, float_mem
[fp_indx
], sizeflag
);
10543 ins
->obufp
= ins
->op_out
[0];
10545 OP_E (ins
, float_mem_mode
[fp_indx
], sizeflag
);
10548 /* Skip mod/rm byte. */
10552 dp
= &float_reg
[floatop
- 0xd8][ins
->modrm
.reg
];
10553 if (dp
->name
== NULL
)
10555 putop (ins
, fgrps
[dp
->op
[0].bytemode
][ins
->modrm
.rm
], sizeflag
);
10557 /* Instruction fnstsw is only one with strange arg. */
10558 if (floatop
== 0xdf && ins
->codep
[-1] == 0xe0)
10559 strcpy (ins
->op_out
[0], att_names16
[0] + ins
->intel_syntax
);
10563 putop (ins
, dp
->name
, sizeflag
);
10565 ins
->obufp
= ins
->op_out
[0];
10568 (*dp
->op
[0].rtn
) (ins
, dp
->op
[0].bytemode
, sizeflag
);
10570 ins
->obufp
= ins
->op_out
[1];
10573 (*dp
->op
[1].rtn
) (ins
, dp
->op
[1].bytemode
, sizeflag
);
10578 OP_ST (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10579 int sizeflag ATTRIBUTE_UNUSED
)
10581 oappend_register (ins
, "%st");
10585 OP_STi (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10586 int sizeflag ATTRIBUTE_UNUSED
)
10589 int res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%st(%d)", ins
->modrm
.rm
);
10591 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
10593 oappend_register (ins
, scratch
);
10596 /* Capital letters in template are macros. */
10598 putop (instr_info
*ins
, const char *in_template
, int sizeflag
)
10603 unsigned int l
= 0, len
= 0;
10606 for (p
= in_template
; *p
; p
++)
10610 if (l
>= sizeof (last
) || !ISUPPER (*p
))
10618 *ins
->obufp
++ = *p
;
10627 if (ins
->intel_syntax
)
10629 while (*++p
!= '|')
10630 if (*p
== '}' || *p
== '\0')
10636 while (*++p
!= '}')
10646 if (ins
->intel_syntax
)
10648 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10649 || (sizeflag
& SUFFIX_ALWAYS
))
10650 *ins
->obufp
++ = 'b';
10656 if (ins
->intel_syntax
)
10658 if (sizeflag
& SUFFIX_ALWAYS
)
10659 *ins
->obufp
++ = 'b';
10661 else if (l
== 1 && last
[0] == 'L')
10663 if (ins
->address_mode
== mode_64bit
10664 && !(ins
->prefixes
& PREFIX_ADDR
))
10666 *ins
->obufp
++ = 'a';
10667 *ins
->obufp
++ = 'b';
10668 *ins
->obufp
++ = 's';
10677 if (ins
->intel_syntax
&& !alt
)
10679 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10681 if (sizeflag
& DFLAG
)
10682 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10684 *ins
->obufp
++ = ins
->intel_syntax
? 'w' : 's';
10685 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10694 if (!ins
->vex
.evex
|| ins
->vex
.w
)
10695 *ins
->obufp
++ = 'd';
10697 oappend (ins
, "{bad}");
10706 if (ins
->intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
10709 if (ins
->modrm
.mod
== 3)
10711 if (ins
->rex
& REX_W
)
10712 *ins
->obufp
++ = 'q';
10715 if (sizeflag
& DFLAG
)
10716 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10718 *ins
->obufp
++ = 'w';
10719 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10723 *ins
->obufp
++ = 'w';
10731 if (!ins
->vex
.evex
|| ins
->vex
.b
|| ins
->vex
.ll
>= 2
10733 || (ins
->modrm
.mod
== 3 && (ins
->rex
& REX_X
))
10734 || !ins
->vex
.v
|| ins
->vex
.mask_register_specifier
)
10736 /* AVX512 extends a number of V*D insns to also have V*Q variants,
10737 merely distinguished by EVEX.W. Look for a use of the
10738 respective macro. */
10741 const char *pct
= strchr (p
+ 1, '%');
10743 if (pct
!= NULL
&& pct
[1] == 'D' && pct
[2] == 'Q')
10746 *ins
->obufp
++ = '{';
10747 *ins
->obufp
++ = 'e';
10748 *ins
->obufp
++ = 'v';
10749 *ins
->obufp
++ = 'e';
10750 *ins
->obufp
++ = 'x';
10751 *ins
->obufp
++ = '}';
10752 *ins
->obufp
++ = ' ';
10759 /* For jcxz/jecxz */
10760 if (ins
->address_mode
== mode_64bit
)
10762 if (sizeflag
& AFLAG
)
10763 *ins
->obufp
++ = 'r';
10765 *ins
->obufp
++ = 'e';
10768 if (sizeflag
& AFLAG
)
10769 *ins
->obufp
++ = 'e';
10770 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10773 if (ins
->intel_syntax
)
10775 if ((ins
->prefixes
& PREFIX_ADDR
) || (sizeflag
& SUFFIX_ALWAYS
))
10777 if (sizeflag
& AFLAG
)
10778 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10780 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'l' : 'w';
10781 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10785 if (ins
->intel_syntax
|| (ins
->obufp
[-1] != 's'
10786 && !(sizeflag
& SUFFIX_ALWAYS
)))
10788 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
10789 *ins
->obufp
++ = 'l';
10791 *ins
->obufp
++ = 'w';
10792 if (!(ins
->rex
& REX_W
))
10793 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10798 if (ins
->intel_syntax
)
10800 if ((ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_CS
10801 || (ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_DS
)
10803 ins
->used_prefixes
|= ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
);
10804 *ins
->obufp
++ = ',';
10805 *ins
->obufp
++ = 'p';
10807 /* Set active_seg_prefix even if not set in 64-bit mode
10808 because here it is a valid branch hint. */
10809 if (ins
->prefixes
& PREFIX_DS
)
10811 ins
->active_seg_prefix
= PREFIX_DS
;
10812 *ins
->obufp
++ = 't';
10816 ins
->active_seg_prefix
= PREFIX_CS
;
10817 *ins
->obufp
++ = 'n';
10821 else if (l
== 1 && last
[0] == 'X')
10824 *ins
->obufp
++ = 'h';
10826 oappend (ins
, "{bad}");
10833 if (ins
->rex
& REX_W
)
10834 *ins
->obufp
++ = 'q';
10836 *ins
->obufp
++ = 'd';
10841 if (ins
->intel_mnemonic
!= cond
)
10842 *ins
->obufp
++ = 'r';
10845 if ((ins
->prefixes
& PREFIX_FWAIT
) == 0)
10846 *ins
->obufp
++ = 'n';
10848 ins
->used_prefixes
|= PREFIX_FWAIT
;
10852 if (ins
->rex
& REX_W
)
10853 *ins
->obufp
++ = 'o';
10854 else if (ins
->intel_syntax
&& (sizeflag
& DFLAG
))
10855 *ins
->obufp
++ = 'q';
10857 *ins
->obufp
++ = 'd';
10858 if (!(ins
->rex
& REX_W
))
10859 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10862 if (ins
->address_mode
== mode_64bit
10863 && (ins
->isa64
== intel64
|| (ins
->rex
& REX_W
)
10864 || !(ins
->prefixes
& PREFIX_DATA
)))
10866 if (sizeflag
& SUFFIX_ALWAYS
)
10867 *ins
->obufp
++ = 'q';
10870 /* Fall through. */
10874 if ((ins
->modrm
.mod
== 3 || !cond
)
10875 && !(sizeflag
& SUFFIX_ALWAYS
))
10877 /* Fall through. */
10879 if ((!(ins
->rex
& REX_W
) && (ins
->prefixes
& PREFIX_DATA
))
10880 || ((sizeflag
& SUFFIX_ALWAYS
)
10881 && ins
->address_mode
!= mode_64bit
))
10883 *ins
->obufp
++ = (sizeflag
& DFLAG
)
10884 ? ins
->intel_syntax
? 'd' : 'l' : 'w';
10885 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10887 else if (sizeflag
& SUFFIX_ALWAYS
)
10888 *ins
->obufp
++ = 'q';
10890 else if (l
== 1 && last
[0] == 'L')
10892 if ((ins
->prefixes
& PREFIX_DATA
)
10893 || (ins
->rex
& REX_W
)
10894 || (sizeflag
& SUFFIX_ALWAYS
))
10897 if (ins
->rex
& REX_W
)
10898 *ins
->obufp
++ = 'q';
10901 if (sizeflag
& DFLAG
)
10902 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10904 *ins
->obufp
++ = 'w';
10905 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10915 if (ins
->intel_syntax
&& !alt
)
10918 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10919 || (sizeflag
& SUFFIX_ALWAYS
))
10921 if (ins
->rex
& REX_W
)
10922 *ins
->obufp
++ = 'q';
10925 if (sizeflag
& DFLAG
)
10926 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10928 *ins
->obufp
++ = 'w';
10929 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10933 else if (l
== 1 && last
[0] == 'D')
10934 *ins
->obufp
++ = ins
->vex
.w
? 'q' : 'd';
10935 else if (l
== 1 && last
[0] == 'L')
10937 if (cond
? ins
->modrm
.mod
== 3 && !(sizeflag
& SUFFIX_ALWAYS
)
10938 : ins
->address_mode
!= mode_64bit
)
10940 if ((ins
->rex
& REX_W
))
10943 *ins
->obufp
++ = 'q';
10945 else if ((ins
->address_mode
== mode_64bit
&& cond
)
10946 || (sizeflag
& SUFFIX_ALWAYS
))
10947 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10954 if (ins
->rex
& REX_W
)
10955 *ins
->obufp
++ = 'q';
10956 else if (sizeflag
& DFLAG
)
10958 if (ins
->intel_syntax
)
10959 *ins
->obufp
++ = 'd';
10961 *ins
->obufp
++ = 'l';
10964 *ins
->obufp
++ = 'w';
10965 if (ins
->intel_syntax
&& !p
[1]
10966 && ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
)))
10967 *ins
->obufp
++ = 'e';
10968 if (!(ins
->rex
& REX_W
))
10969 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10975 if (ins
->intel_syntax
)
10977 if (sizeflag
& SUFFIX_ALWAYS
)
10979 if (ins
->rex
& REX_W
)
10980 *ins
->obufp
++ = 'q';
10983 if (sizeflag
& DFLAG
)
10984 *ins
->obufp
++ = 'l';
10986 *ins
->obufp
++ = 'w';
10987 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10997 if (ins
->address_mode
== mode_64bit
10998 && !(ins
->prefixes
& PREFIX_ADDR
))
11000 *ins
->obufp
++ = 'a';
11001 *ins
->obufp
++ = 'b';
11002 *ins
->obufp
++ = 's';
11007 if (!ins
->vex
.evex
|| !ins
->vex
.w
)
11008 *ins
->obufp
++ = 's';
11010 oappend (ins
, "{bad}");
11026 *ins
->obufp
++ = '{';
11027 *ins
->obufp
++ = 'v';
11028 *ins
->obufp
++ = 'e';
11029 *ins
->obufp
++ = 'x';
11030 *ins
->obufp
++ = '}';
11031 *ins
->obufp
++ = ' ';
11034 if (!(ins
->rex
& REX_W
))
11036 *ins
->obufp
++ = 'a';
11037 *ins
->obufp
++ = 'b';
11038 *ins
->obufp
++ = 's';
11050 /* operand size flag for cwtl, cbtw */
11052 if (ins
->rex
& REX_W
)
11054 if (ins
->intel_syntax
)
11055 *ins
->obufp
++ = 'd';
11057 *ins
->obufp
++ = 'l';
11059 else if (sizeflag
& DFLAG
)
11060 *ins
->obufp
++ = 'w';
11062 *ins
->obufp
++ = 'b';
11063 if (!(ins
->rex
& REX_W
))
11064 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11068 if (!ins
->need_vex
)
11070 if (last
[0] == 'X')
11071 *ins
->obufp
++ = ins
->vex
.w
? 'd': 's';
11072 else if (last
[0] == 'B')
11073 *ins
->obufp
++ = ins
->vex
.w
? 'w': 'b';
11084 ? ins
->vex
.prefix
== DATA_PREFIX_OPCODE
11085 : ins
->prefixes
& PREFIX_DATA
)
11087 *ins
->obufp
++ = 'd';
11088 ins
->used_prefixes
|= PREFIX_DATA
;
11091 *ins
->obufp
++ = 's';
11094 if (l
== 1 && last
[0] == 'X')
11096 if (!ins
->need_vex
)
11098 if (ins
->intel_syntax
11099 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
11100 && !(sizeflag
& SUFFIX_ALWAYS
)))
11102 switch (ins
->vex
.length
)
11105 *ins
->obufp
++ = 'x';
11108 *ins
->obufp
++ = 'y';
11111 if (!ins
->vex
.evex
)
11122 /* These insns ignore ModR/M.mod: Force it to 3 for OP_E(). */
11123 ins
->modrm
.mod
= 3;
11124 if (!ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
11125 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
11127 else if (l
== 1 && last
[0] == 'X')
11129 if (!ins
->vex
.evex
)
11131 if (ins
->intel_syntax
11132 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
11133 && !(sizeflag
& SUFFIX_ALWAYS
)))
11135 switch (ins
->vex
.length
)
11138 *ins
->obufp
++ = 'x';
11141 *ins
->obufp
++ = 'y';
11144 *ins
->obufp
++ = 'z';
11154 if (ins
->intel_syntax
)
11156 if (ins
->isa64
== intel64
&& (ins
->rex
& REX_W
))
11159 *ins
->obufp
++ = 'q';
11162 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
11164 if (sizeflag
& DFLAG
)
11165 *ins
->obufp
++ = 'l';
11167 *ins
->obufp
++ = 'w';
11168 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11177 ins
->mnemonicendp
= ins
->obufp
;
11181 /* Add a style marker to *INS->obufp that encodes STYLE. This assumes that
11182 the buffer pointed to by INS->obufp has space. A style marker is made
11183 from the STYLE_MARKER_CHAR followed by STYLE converted to a single hex
11184 digit, followed by another STYLE_MARKER_CHAR. This function assumes
11185 that the number of styles is not greater than 16. */
11188 oappend_insert_style (instr_info
*ins
, enum disassembler_style style
)
11190 unsigned num
= (unsigned) style
;
11192 /* We currently assume that STYLE can be encoded as a single hex
11193 character. If more styles are added then this might start to fail,
11194 and we'll need to expand this code. */
11198 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11199 *ins
->obufp
++ = (num
< 10 ? ('0' + num
)
11200 : ((num
< 16) ? ('a' + (num
- 10)) : '0'));
11201 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11203 /* This final null character is not strictly necessary, after inserting a
11204 style marker we should always be inserting some additional content.
11205 However, having the buffer null terminated doesn't cost much, and make
11206 it easier to debug what's going on. Also, if we do ever forget to add
11207 any additional content after this style marker, then the buffer will
11208 still be well formed. */
11209 *ins
->obufp
= '\0';
11213 oappend_with_style (instr_info
*ins
, const char *s
,
11214 enum disassembler_style style
)
11216 oappend_insert_style (ins
, style
);
11217 ins
->obufp
= stpcpy (ins
->obufp
, s
);
11220 /* Like oappend_with_style but always with text style. */
11223 oappend (instr_info
*ins
, const char *s
)
11225 oappend_with_style (ins
, s
, dis_style_text
);
11228 /* Add a single character C to the buffer pointer to by INS->obufp, marking
11229 the style for the character as STYLE. */
11232 oappend_char_with_style (instr_info
*ins
, const char c
,
11233 enum disassembler_style style
)
11235 oappend_insert_style (ins
, style
);
11237 *ins
->obufp
= '\0';
11240 /* Like oappend_char_with_style, but always uses dis_style_text. */
11243 oappend_char (instr_info
*ins
, const char c
)
11245 oappend_char_with_style (ins
, c
, dis_style_text
);
11249 append_seg (instr_info
*ins
)
11251 /* Only print the active segment register. */
11252 if (!ins
->active_seg_prefix
)
11255 ins
->used_prefixes
|= ins
->active_seg_prefix
;
11256 switch (ins
->active_seg_prefix
)
11259 oappend_register (ins
, "%cs");
11262 oappend_register (ins
, "%ds");
11265 oappend_register (ins
, "%ss");
11268 oappend_register (ins
, "%es");
11271 oappend_register (ins
, "%fs");
11274 oappend_register (ins
, "%gs");
11279 oappend_char (ins
, ':');
11283 OP_indirE (instr_info
*ins
, int bytemode
, int sizeflag
)
11285 if (!ins
->intel_syntax
)
11286 oappend (ins
, "*");
11287 OP_E (ins
, bytemode
, sizeflag
);
11291 print_operand_value (instr_info
*ins
, bfd_vma disp
,
11292 enum disassembler_style style
)
11296 if (ins
->address_mode
== mode_64bit
)
11297 sprintf (tmp
, "0x%" PRIx64
, (uint64_t) disp
);
11299 sprintf (tmp
, "0x%x", (unsigned int) disp
);
11300 oappend_with_style (ins
, tmp
, style
);
11303 /* Like oappend, but called for immediate operands. */
11306 oappend_immediate (instr_info
*ins
, bfd_vma imm
)
11308 if (!ins
->intel_syntax
)
11309 oappend_char_with_style (ins
, '$', dis_style_immediate
);
11310 print_operand_value (ins
, imm
, dis_style_immediate
);
11313 /* Put DISP in BUF as signed hex number. */
11316 print_displacement (instr_info
*ins
, bfd_vma disp
)
11318 bfd_signed_vma val
= disp
;
11323 oappend_char_with_style (ins
, '-', dis_style_address_offset
);
11326 /* Check for possible overflow. */
11329 switch (ins
->address_mode
)
11332 oappend_with_style (ins
, "0x8000000000000000",
11333 dis_style_address_offset
);
11336 oappend_with_style (ins
, "0x80000000",
11337 dis_style_address_offset
);
11340 oappend_with_style (ins
, "0x8000",
11341 dis_style_address_offset
);
11348 sprintf (tmp
, "0x%" PRIx64
, (int64_t) val
);
11349 oappend_with_style (ins
, tmp
, dis_style_address_offset
);
11353 intel_operand_size (instr_info
*ins
, int bytemode
, int sizeflag
)
11357 if (!ins
->vex
.no_broadcast
)
11361 case evex_half_bcst_xmmq_mode
:
11363 oappend (ins
, "QWORD BCST ");
11365 oappend (ins
, "DWORD BCST ");
11368 case evex_half_bcst_xmmqh_mode
:
11369 case evex_half_bcst_xmmqdh_mode
:
11370 oappend (ins
, "WORD BCST ");
11373 ins
->vex
.no_broadcast
= true;
11383 oappend (ins
, "BYTE PTR ");
11388 oappend (ins
, "WORD PTR ");
11391 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11393 oappend (ins
, "QWORD PTR ");
11396 /* Fall through. */
11398 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11399 || (ins
->rex
& REX_W
)))
11401 oappend (ins
, "QWORD PTR ");
11404 /* Fall through. */
11409 if (ins
->rex
& REX_W
)
11410 oappend (ins
, "QWORD PTR ");
11411 else if (bytemode
== dq_mode
)
11412 oappend (ins
, "DWORD PTR ");
11415 if (sizeflag
& DFLAG
)
11416 oappend (ins
, "DWORD PTR ");
11418 oappend (ins
, "WORD PTR ");
11419 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11423 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
11424 *ins
->obufp
++ = 'D';
11425 oappend (ins
, "WORD PTR ");
11426 if (!(ins
->rex
& REX_W
))
11427 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11430 if (sizeflag
& DFLAG
)
11431 oappend (ins
, "QWORD PTR ");
11433 oappend (ins
, "DWORD PTR ");
11434 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11437 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11438 oappend (ins
, "WORD PTR ");
11440 oappend (ins
, "DWORD PTR ");
11441 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11445 oappend (ins
, "DWORD PTR ");
11449 oappend (ins
, "QWORD PTR ");
11452 if (ins
->address_mode
== mode_64bit
)
11453 oappend (ins
, "QWORD PTR ");
11455 oappend (ins
, "DWORD PTR ");
11458 if (sizeflag
& DFLAG
)
11459 oappend (ins
, "FWORD PTR ");
11461 oappend (ins
, "DWORD PTR ");
11462 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11465 oappend (ins
, "TBYTE PTR ");
11470 case evex_x_gscat_mode
:
11471 case evex_x_nobcst_mode
:
11475 switch (ins
->vex
.length
)
11478 oappend (ins
, "XMMWORD PTR ");
11481 oappend (ins
, "YMMWORD PTR ");
11484 oappend (ins
, "ZMMWORD PTR ");
11491 oappend (ins
, "XMMWORD PTR ");
11494 oappend (ins
, "XMMWORD PTR ");
11497 oappend (ins
, "YMMWORD PTR ");
11500 case evex_half_bcst_xmmqh_mode
:
11501 case evex_half_bcst_xmmq_mode
:
11502 if (!ins
->need_vex
)
11505 switch (ins
->vex
.length
)
11508 oappend (ins
, "QWORD PTR ");
11511 oappend (ins
, "XMMWORD PTR ");
11514 oappend (ins
, "YMMWORD PTR ");
11521 if (!ins
->need_vex
)
11524 switch (ins
->vex
.length
)
11527 oappend (ins
, "WORD PTR ");
11530 oappend (ins
, "DWORD PTR ");
11533 oappend (ins
, "QWORD PTR ");
11540 case evex_half_bcst_xmmqdh_mode
:
11541 if (!ins
->need_vex
)
11544 switch (ins
->vex
.length
)
11547 oappend (ins
, "DWORD PTR ");
11550 oappend (ins
, "QWORD PTR ");
11553 oappend (ins
, "XMMWORD PTR ");
11560 if (!ins
->need_vex
)
11563 switch (ins
->vex
.length
)
11566 oappend (ins
, "QWORD PTR ");
11569 oappend (ins
, "YMMWORD PTR ");
11572 oappend (ins
, "ZMMWORD PTR ");
11579 oappend (ins
, "OWORD PTR ");
11581 case vex_vsib_d_w_dq_mode
:
11582 case vex_vsib_q_w_dq_mode
:
11583 if (!ins
->need_vex
)
11586 oappend (ins
, "QWORD PTR ");
11588 oappend (ins
, "DWORD PTR ");
11591 if (!ins
->need_vex
|| ins
->vex
.length
!= 128)
11594 oappend (ins
, "DWORD PTR ");
11596 oappend (ins
, "BYTE PTR ");
11599 if (!ins
->need_vex
)
11602 oappend (ins
, "QWORD PTR ");
11604 oappend (ins
, "WORD PTR ");
11614 print_register (instr_info
*ins
, unsigned int reg
, unsigned int rexmask
,
11615 int bytemode
, int sizeflag
)
11617 const char *const *names
;
11619 USED_REX (rexmask
);
11620 if (ins
->rex
& rexmask
)
11630 names
= att_names8rex
;
11632 names
= att_names8
;
11635 names
= att_names16
;
11640 names
= att_names32
;
11643 names
= att_names64
;
11647 names
= ins
->address_mode
== mode_64bit
? att_names64
: att_names32
;
11650 case bnd_swap_mode
:
11653 oappend (ins
, "(bad)");
11656 names
= att_names_bnd
;
11659 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11661 names
= att_names64
;
11664 /* Fall through. */
11666 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11667 || (ins
->rex
& REX_W
)))
11669 names
= att_names64
;
11673 /* Fall through. */
11678 if (ins
->rex
& REX_W
)
11679 names
= att_names64
;
11680 else if (bytemode
!= v_mode
&& bytemode
!= v_swap_mode
)
11681 names
= att_names32
;
11684 if (sizeflag
& DFLAG
)
11685 names
= att_names32
;
11687 names
= att_names16
;
11688 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11692 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11693 names
= att_names16
;
11695 names
= att_names32
;
11696 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11699 names
= (ins
->address_mode
== mode_64bit
11700 ? att_names64
: att_names32
);
11701 if (!(ins
->prefixes
& PREFIX_ADDR
))
11702 names
= (ins
->address_mode
== mode_16bit
11703 ? att_names16
: names
);
11706 /* Remove "addr16/addr32". */
11707 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
11708 names
= (ins
->address_mode
!= mode_32bit
11709 ? att_names32
: att_names16
);
11710 ins
->used_prefixes
|= PREFIX_ADDR
;
11717 oappend (ins
, "(bad)");
11720 names
= att_names_mask
;
11725 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
11728 oappend_register (ins
, names
[reg
]);
11732 OP_E_memory (instr_info
*ins
, int bytemode
, int sizeflag
)
11735 int add
= (ins
->rex
& REX_B
) ? 8 : 0;
11753 if (ins
->address_mode
!= mode_64bit
)
11761 case vex_vsib_d_w_dq_mode
:
11762 case vex_vsib_q_w_dq_mode
:
11763 case evex_x_gscat_mode
:
11764 shift
= ins
->vex
.w
? 3 : 2;
11767 case evex_half_bcst_xmmqh_mode
:
11768 case evex_half_bcst_xmmqdh_mode
:
11771 shift
= ins
->vex
.w
? 2 : 1;
11774 /* Fall through. */
11776 case evex_half_bcst_xmmq_mode
:
11779 shift
= ins
->vex
.w
? 3 : 2;
11782 /* Fall through. */
11787 case evex_x_nobcst_mode
:
11789 switch (ins
->vex
.length
)
11803 /* Make necessary corrections to shift for modes that need it. */
11804 if (bytemode
== xmmq_mode
11805 || bytemode
== evex_half_bcst_xmmqh_mode
11806 || bytemode
== evex_half_bcst_xmmq_mode
11807 || (bytemode
== ymmq_mode
&& ins
->vex
.length
== 128))
11809 else if (bytemode
== xmmqd_mode
11810 || bytemode
== evex_half_bcst_xmmqdh_mode
)
11812 else if (bytemode
== xmmdw_mode
)
11826 shift
= ins
->vex
.w
? 1 : 0;
11836 if (ins
->intel_syntax
)
11837 intel_operand_size (ins
, bytemode
, sizeflag
);
11840 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
11842 /* 32/64 bit address mode */
11850 int addr32flag
= !((sizeflag
& AFLAG
)
11851 || bytemode
== v_bnd_mode
11852 || bytemode
== v_bndmk_mode
11853 || bytemode
== bnd_mode
11854 || bytemode
== bnd_swap_mode
);
11855 bool check_gather
= false;
11856 const char *const *indexes
= NULL
;
11859 base
= ins
->modrm
.rm
;
11863 vindex
= ins
->sib
.index
;
11865 if (ins
->rex
& REX_X
)
11869 case vex_vsib_d_w_dq_mode
:
11870 case vex_vsib_q_w_dq_mode
:
11871 if (!ins
->need_vex
)
11877 check_gather
= ins
->obufp
== ins
->op_out
[1];
11880 switch (ins
->vex
.length
)
11883 indexes
= att_names_xmm
;
11887 || bytemode
== vex_vsib_q_w_dq_mode
)
11888 indexes
= att_names_ymm
;
11890 indexes
= att_names_xmm
;
11894 || bytemode
== vex_vsib_q_w_dq_mode
)
11895 indexes
= att_names_zmm
;
11897 indexes
= att_names_ymm
;
11905 indexes
= ins
->address_mode
== mode_64bit
&& !addr32flag
11906 ? att_names64
: att_names32
;
11909 scale
= ins
->sib
.scale
;
11910 base
= ins
->sib
.base
;
11915 /* Check for mandatory SIB. */
11916 if (bytemode
== vex_vsib_d_w_dq_mode
11917 || bytemode
== vex_vsib_q_w_dq_mode
11918 || bytemode
== vex_sibmem_mode
)
11920 oappend (ins
, "(bad)");
11924 rbase
= base
+ add
;
11926 switch (ins
->modrm
.mod
)
11932 if (ins
->address_mode
== mode_64bit
&& !ins
->has_sib
)
11934 disp
= get32s (ins
);
11935 if (riprel
&& bytemode
== v_bndmk_mode
)
11937 oappend (ins
, "(bad)");
11943 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
11944 disp
= *ins
->codep
++;
11945 if ((disp
& 0x80) != 0)
11947 if (ins
->vex
.evex
&& shift
> 0)
11951 disp
= get32s (ins
);
11960 && ins
->address_mode
!= mode_16bit
)
11962 if (ins
->address_mode
== mode_64bit
)
11966 /* Without base nor index registers, zero-extend the
11967 lower 32-bit displacement to 64 bits. */
11968 disp
= (unsigned int) disp
;
11975 /* In 32-bit mode, we need index register to tell [offset]
11976 from [eiz*1 + offset]. */
11981 havedisp
= (havebase
11983 || (ins
->has_sib
&& (indexes
|| scale
!= 0)));
11985 if (!ins
->intel_syntax
)
11986 if (ins
->modrm
.mod
!= 0 || base
== 5)
11988 if (havedisp
|| riprel
)
11989 print_displacement (ins
, disp
);
11991 print_operand_value (ins
, disp
, dis_style_address_offset
);
11994 set_op (ins
, disp
, true);
11995 oappend_char (ins
, '(');
11996 oappend_with_style (ins
, !addr32flag
? "%rip" : "%eip",
11997 dis_style_register
);
11998 oappend_char (ins
, ')');
12002 if ((havebase
|| indexes
|| needindex
|| needaddr32
|| riprel
)
12003 && (ins
->address_mode
!= mode_64bit
12004 || ((bytemode
!= v_bnd_mode
)
12005 && (bytemode
!= v_bndmk_mode
)
12006 && (bytemode
!= bnd_mode
)
12007 && (bytemode
!= bnd_swap_mode
))))
12008 ins
->used_prefixes
|= PREFIX_ADDR
;
12010 if (havedisp
|| (ins
->intel_syntax
&& riprel
))
12012 oappend_char (ins
, ins
->open_char
);
12013 if (ins
->intel_syntax
&& riprel
)
12015 set_op (ins
, disp
, true);
12016 oappend_with_style (ins
, !addr32flag
? "rip" : "eip",
12017 dis_style_register
);
12022 (ins
->address_mode
== mode_64bit
&& !addr32flag
12023 ? att_names64
: att_names32
)[rbase
]);
12026 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
12027 print index to tell base + index from base. */
12031 || (havebase
&& base
!= ESP_REG_NUM
))
12033 if (!ins
->intel_syntax
|| havebase
)
12034 oappend_char (ins
, ins
->separator_char
);
12037 if (ins
->address_mode
== mode_64bit
|| vindex
< 16)
12038 oappend_register (ins
, indexes
[vindex
]);
12040 oappend (ins
, "(bad)");
12043 oappend_register (ins
,
12044 ins
->address_mode
== mode_64bit
12049 oappend_char (ins
, ins
->scale_char
);
12050 oappend_char_with_style (ins
, '0' + (1 << scale
),
12051 dis_style_immediate
);
12054 if (ins
->intel_syntax
12055 && (disp
|| ins
->modrm
.mod
!= 0 || base
== 5))
12057 if (!havedisp
|| (bfd_signed_vma
) disp
>= 0)
12058 oappend_char (ins
, '+');
12059 else if (ins
->modrm
.mod
!= 1 && disp
!= -disp
)
12061 oappend_char (ins
, '-');
12066 print_displacement (ins
, disp
);
12068 print_operand_value (ins
, disp
, dis_style_address_offset
);
12071 oappend_char (ins
, ins
->close_char
);
12075 /* Both XMM/YMM/ZMM registers must be distinct. */
12076 int modrm_reg
= ins
->modrm
.reg
;
12078 if (ins
->rex
& REX_R
)
12082 if (vindex
== modrm_reg
)
12083 oappend (ins
, "/(bad)");
12086 else if (ins
->intel_syntax
)
12088 if (ins
->modrm
.mod
!= 0 || base
== 5)
12090 if (!ins
->active_seg_prefix
)
12092 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12093 oappend (ins
, ":");
12095 print_operand_value (ins
, disp
, dis_style_text
);
12099 else if (bytemode
== v_bnd_mode
12100 || bytemode
== v_bndmk_mode
12101 || bytemode
== bnd_mode
12102 || bytemode
== bnd_swap_mode
12103 || bytemode
== vex_vsib_d_w_dq_mode
12104 || bytemode
== vex_vsib_q_w_dq_mode
)
12106 oappend (ins
, "(bad)");
12111 /* 16 bit address mode */
12112 ins
->used_prefixes
|= ins
->prefixes
& PREFIX_ADDR
;
12113 switch (ins
->modrm
.mod
)
12116 if (ins
->modrm
.rm
== 6)
12118 disp
= get16 (ins
);
12119 if ((disp
& 0x8000) != 0)
12124 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12125 disp
= *ins
->codep
++;
12126 if ((disp
& 0x80) != 0)
12128 if (ins
->vex
.evex
&& shift
> 0)
12132 disp
= get16 (ins
);
12133 if ((disp
& 0x8000) != 0)
12138 if (!ins
->intel_syntax
)
12139 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6)
12140 print_displacement (ins
, disp
);
12142 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 6)
12144 oappend_char (ins
, ins
->open_char
);
12145 oappend (ins
, (ins
->intel_syntax
? intel_index16
12146 : att_index16
)[ins
->modrm
.rm
]);
12147 if (ins
->intel_syntax
12148 && (disp
|| ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6))
12150 if ((bfd_signed_vma
) disp
>= 0)
12151 oappend_char (ins
, '+');
12152 else if (ins
->modrm
.mod
!= 1)
12154 oappend_char (ins
, '-');
12158 print_displacement (ins
, disp
);
12161 oappend_char (ins
, ins
->close_char
);
12163 else if (ins
->intel_syntax
)
12165 if (!ins
->active_seg_prefix
)
12167 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12168 oappend (ins
, ":");
12170 print_operand_value (ins
, disp
& 0xffff, dis_style_text
);
12175 ins
->evex_used
|= EVEX_b_used
;
12177 /* Broadcast can only ever be valid for memory sources. */
12178 if (ins
->obufp
== ins
->op_out
[0])
12179 ins
->vex
.no_broadcast
= true;
12181 if (!ins
->vex
.no_broadcast
12182 && (!ins
->intel_syntax
|| !(ins
->evex_used
& EVEX_len_used
)))
12184 if (bytemode
== xh_mode
)
12187 oappend (ins
, "{bad}");
12190 switch (ins
->vex
.length
)
12193 oappend (ins
, "{1to8}");
12196 oappend (ins
, "{1to16}");
12199 oappend (ins
, "{1to32}");
12206 else if (bytemode
== q_mode
12207 || bytemode
== ymmq_mode
)
12208 ins
->vex
.no_broadcast
= true;
12209 else if (ins
->vex
.w
12210 || bytemode
== evex_half_bcst_xmmqdh_mode
12211 || bytemode
== evex_half_bcst_xmmq_mode
)
12213 switch (ins
->vex
.length
)
12216 oappend (ins
, "{1to2}");
12219 oappend (ins
, "{1to4}");
12222 oappend (ins
, "{1to8}");
12228 else if (bytemode
== x_mode
12229 || bytemode
== evex_half_bcst_xmmqh_mode
)
12231 switch (ins
->vex
.length
)
12234 oappend (ins
, "{1to4}");
12237 oappend (ins
, "{1to8}");
12240 oappend (ins
, "{1to16}");
12247 ins
->vex
.no_broadcast
= true;
12249 if (ins
->vex
.no_broadcast
)
12250 oappend (ins
, "{bad}");
12255 OP_E (instr_info
*ins
, int bytemode
, int sizeflag
)
12257 /* Skip mod/rm byte. */
12261 if (ins
->modrm
.mod
== 3)
12263 if ((sizeflag
& SUFFIX_ALWAYS
)
12264 && (bytemode
== b_swap_mode
12265 || bytemode
== bnd_swap_mode
12266 || bytemode
== v_swap_mode
))
12267 swap_operand (ins
);
12269 print_register (ins
, ins
->modrm
.rm
, REX_B
, bytemode
, sizeflag
);
12272 OP_E_memory (ins
, bytemode
, sizeflag
);
12276 OP_G (instr_info
*ins
, int bytemode
, int sizeflag
)
12278 if (ins
->vex
.evex
&& !ins
->vex
.r
&& ins
->address_mode
== mode_64bit
)
12280 oappend (ins
, "(bad)");
12284 print_register (ins
, ins
->modrm
.reg
, REX_R
, bytemode
, sizeflag
);
12289 get64 (instr_info
*ins
)
12295 FETCH_DATA (ins
->info
, ins
->codep
+ 8);
12296 a
= *ins
->codep
++ & 0xff;
12297 a
|= (*ins
->codep
++ & 0xff) << 8;
12298 a
|= (*ins
->codep
++ & 0xff) << 16;
12299 a
|= (*ins
->codep
++ & 0xffu
) << 24;
12300 b
= *ins
->codep
++ & 0xff;
12301 b
|= (*ins
->codep
++ & 0xff) << 8;
12302 b
|= (*ins
->codep
++ & 0xff) << 16;
12303 b
|= (*ins
->codep
++ & 0xffu
) << 24;
12304 x
= a
+ ((bfd_vma
) b
<< 32);
12309 get64 (instr_info
*ins ATTRIBUTE_UNUSED
)
12316 static bfd_signed_vma
12317 get32 (instr_info
*ins
)
12321 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
12322 x
= *ins
->codep
++ & (bfd_vma
) 0xff;
12323 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 8;
12324 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 16;
12325 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 24;
12329 static bfd_signed_vma
12330 get32s (instr_info
*ins
)
12334 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
12335 x
= *ins
->codep
++ & (bfd_vma
) 0xff;
12336 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 8;
12337 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 16;
12338 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 24;
12340 x
= (x
^ ((bfd_vma
) 1 << 31)) - ((bfd_vma
) 1 << 31);
12346 get16 (instr_info
*ins
)
12350 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
12351 x
= *ins
->codep
++ & 0xff;
12352 x
|= (*ins
->codep
++ & 0xff) << 8;
12357 set_op (instr_info
*ins
, bfd_vma op
, bool riprel
)
12359 ins
->op_index
[ins
->op_ad
] = ins
->op_ad
;
12360 if (ins
->address_mode
== mode_64bit
)
12361 ins
->op_address
[ins
->op_ad
] = op
;
12362 else /* Mask to get a 32-bit address. */
12363 ins
->op_address
[ins
->op_ad
] = op
& 0xffffffff;
12364 ins
->op_riprel
[ins
->op_ad
] = riprel
;
12368 OP_REG (instr_info
*ins
, int code
, int sizeflag
)
12375 case es_reg
: case ss_reg
: case cs_reg
:
12376 case ds_reg
: case fs_reg
: case gs_reg
:
12377 oappend_register (ins
, att_names_seg
[code
- es_reg
]);
12382 if (ins
->rex
& REX_B
)
12389 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
12390 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
12391 s
= att_names16
[code
- ax_reg
+ add
];
12393 case ah_reg
: case ch_reg
: case dh_reg
: case bh_reg
:
12395 /* Fall through. */
12396 case al_reg
: case cl_reg
: case dl_reg
: case bl_reg
:
12398 s
= att_names8rex
[code
- al_reg
+ add
];
12400 s
= att_names8
[code
- al_reg
];
12402 case rAX_reg
: case rCX_reg
: case rDX_reg
: case rBX_reg
:
12403 case rSP_reg
: case rBP_reg
: case rSI_reg
: case rDI_reg
:
12404 if (ins
->address_mode
== mode_64bit
12405 && ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12407 s
= att_names64
[code
- rAX_reg
+ add
];
12410 code
+= eAX_reg
- rAX_reg
;
12411 /* Fall through. */
12412 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
12413 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
12415 if (ins
->rex
& REX_W
)
12416 s
= att_names64
[code
- eAX_reg
+ add
];
12419 if (sizeflag
& DFLAG
)
12420 s
= att_names32
[code
- eAX_reg
+ add
];
12422 s
= att_names16
[code
- eAX_reg
+ add
];
12423 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12427 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12430 oappend_register (ins
, s
);
12434 OP_IMREG (instr_info
*ins
, int code
, int sizeflag
)
12441 if (!ins
->intel_syntax
)
12443 oappend (ins
, "(%dx)");
12446 s
= att_names16
[dx_reg
- ax_reg
];
12448 case al_reg
: case cl_reg
:
12449 s
= att_names8
[code
- al_reg
];
12453 if (ins
->rex
& REX_W
)
12458 /* Fall through. */
12459 case z_mode_ax_reg
:
12460 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
12464 if (!(ins
->rex
& REX_W
))
12465 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12468 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12471 oappend_register (ins
, s
);
12475 OP_I (instr_info
*ins
, int bytemode
, int sizeflag
)
12478 bfd_signed_vma mask
= -1;
12483 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12484 op
= *ins
->codep
++;
12489 if (ins
->rex
& REX_W
)
12493 if (sizeflag
& DFLAG
)
12503 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12515 if (ins
->intel_syntax
)
12516 oappend (ins
, "1");
12519 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12524 oappend_immediate (ins
, op
);
12528 OP_I64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12530 if (bytemode
!= v_mode
|| ins
->address_mode
!= mode_64bit
12531 || !(ins
->rex
& REX_W
))
12533 OP_I (ins
, bytemode
, sizeflag
);
12539 oappend_immediate (ins
, get64 (ins
));
12543 OP_sI (instr_info
*ins
, int bytemode
, int sizeflag
)
12551 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12552 op
= *ins
->codep
++;
12553 if ((op
& 0x80) != 0)
12555 if (bytemode
== b_T_mode
)
12557 if (ins
->address_mode
!= mode_64bit
12558 || !((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12560 /* The operand-size prefix is overridden by a REX prefix. */
12561 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12569 if (!(ins
->rex
& REX_W
))
12571 if (sizeflag
& DFLAG
)
12579 /* The operand-size prefix is overridden by a REX prefix. */
12580 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12586 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12590 oappend_immediate (ins
, op
);
12594 OP_J (instr_info
*ins
, int bytemode
, int sizeflag
)
12598 bfd_vma segment
= 0;
12603 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12604 disp
= *ins
->codep
++;
12605 if ((disp
& 0x80) != 0)
12610 if ((sizeflag
& DFLAG
)
12611 || (ins
->address_mode
== mode_64bit
12612 && ((ins
->isa64
== intel64
&& bytemode
!= dqw_mode
)
12613 || (ins
->rex
& REX_W
))))
12614 disp
= get32s (ins
);
12617 disp
= get16 (ins
);
12618 if ((disp
& 0x8000) != 0)
12620 /* In 16bit mode, address is wrapped around at 64k within
12621 the same segment. Otherwise, a data16 prefix on a jump
12622 instruction means that the pc is masked to 16 bits after
12623 the displacement is added! */
12625 if ((ins
->prefixes
& PREFIX_DATA
) == 0)
12626 segment
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
))
12627 & ~((bfd_vma
) 0xffff));
12629 if (ins
->address_mode
!= mode_64bit
12630 || (ins
->isa64
!= intel64
&& !(ins
->rex
& REX_W
)))
12631 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12634 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12637 disp
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
) + disp
) & mask
)
12639 set_op (ins
, disp
, false);
12640 print_operand_value (ins
, disp
, dis_style_text
);
12644 OP_SEG (instr_info
*ins
, int bytemode
, int sizeflag
)
12646 if (bytemode
== w_mode
)
12647 oappend_register (ins
, att_names_seg
[ins
->modrm
.reg
]);
12649 OP_E (ins
, ins
->modrm
.mod
== 3 ? bytemode
: w_mode
, sizeflag
);
12653 OP_DIR (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
, int sizeflag
)
12655 int seg
, offset
, res
;
12658 if (sizeflag
& DFLAG
)
12660 offset
= get32 (ins
);
12665 offset
= get16 (ins
);
12668 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12670 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12671 ins
->intel_syntax
? "0x%x:0x%x" : "$0x%x,$0x%x",
12673 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12675 oappend (ins
, scratch
);
12679 OP_OFF (instr_info
*ins
, int bytemode
, int sizeflag
)
12683 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12684 intel_operand_size (ins
, bytemode
, sizeflag
);
12687 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
12692 if (ins
->intel_syntax
)
12694 if (!ins
->active_seg_prefix
)
12696 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12697 oappend (ins
, ":");
12700 print_operand_value (ins
, off
, dis_style_address_offset
);
12704 OP_OFF64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12708 if (ins
->address_mode
!= mode_64bit
12709 || (ins
->prefixes
& PREFIX_ADDR
))
12711 OP_OFF (ins
, bytemode
, sizeflag
);
12715 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12716 intel_operand_size (ins
, bytemode
, sizeflag
);
12721 if (ins
->intel_syntax
)
12723 if (!ins
->active_seg_prefix
)
12725 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12726 oappend (ins
, ":");
12729 print_operand_value (ins
, off
, dis_style_address_offset
);
12733 ptr_reg (instr_info
*ins
, int code
, int sizeflag
)
12737 *ins
->obufp
++ = ins
->open_char
;
12738 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
12739 if (ins
->address_mode
== mode_64bit
)
12741 if (!(sizeflag
& AFLAG
))
12742 s
= att_names32
[code
- eAX_reg
];
12744 s
= att_names64
[code
- eAX_reg
];
12746 else if (sizeflag
& AFLAG
)
12747 s
= att_names32
[code
- eAX_reg
];
12749 s
= att_names16
[code
- eAX_reg
];
12750 oappend_register (ins
, s
);
12751 oappend_char (ins
, ins
->close_char
);
12755 OP_ESreg (instr_info
*ins
, int code
, int sizeflag
)
12757 if (ins
->intel_syntax
)
12759 switch (ins
->codep
[-1])
12761 case 0x6d: /* insw/insl */
12762 intel_operand_size (ins
, z_mode
, sizeflag
);
12764 case 0xa5: /* movsw/movsl/movsq */
12765 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12766 case 0xab: /* stosw/stosl */
12767 case 0xaf: /* scasw/scasl */
12768 intel_operand_size (ins
, v_mode
, sizeflag
);
12771 intel_operand_size (ins
, b_mode
, sizeflag
);
12774 oappend_register (ins
, "%es");
12775 oappend_char (ins
, ':');
12776 ptr_reg (ins
, code
, sizeflag
);
12780 OP_DSreg (instr_info
*ins
, int code
, int sizeflag
)
12782 if (ins
->intel_syntax
)
12784 switch (ins
->codep
[-1])
12786 case 0x6f: /* outsw/outsl */
12787 intel_operand_size (ins
, z_mode
, sizeflag
);
12789 case 0xa5: /* movsw/movsl/movsq */
12790 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12791 case 0xad: /* lodsw/lodsl/lodsq */
12792 intel_operand_size (ins
, v_mode
, sizeflag
);
12795 intel_operand_size (ins
, b_mode
, sizeflag
);
12798 /* Set ins->active_seg_prefix to PREFIX_DS if it is unset so that the
12799 default segment register DS is printed. */
12800 if (!ins
->active_seg_prefix
)
12801 ins
->active_seg_prefix
= PREFIX_DS
;
12803 ptr_reg (ins
, code
, sizeflag
);
12807 OP_C (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12808 int sizeflag ATTRIBUTE_UNUSED
)
12813 if (ins
->rex
& REX_R
)
12818 else if (ins
->address_mode
!= mode_64bit
&& (ins
->prefixes
& PREFIX_LOCK
))
12820 ins
->all_prefixes
[ins
->last_lock_prefix
] = 0;
12821 ins
->used_prefixes
|= PREFIX_LOCK
;
12826 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%cr%d",
12827 ins
->modrm
.reg
+ add
);
12828 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12830 oappend_register (ins
, scratch
);
12834 OP_D (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12835 int sizeflag ATTRIBUTE_UNUSED
)
12841 if (ins
->rex
& REX_R
)
12845 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12846 ins
->intel_syntax
? "dr%d" : "%%db%d",
12847 ins
->modrm
.reg
+ add
);
12848 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12850 oappend (ins
, scratch
);
12854 OP_T (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12855 int sizeflag ATTRIBUTE_UNUSED
)
12860 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%tr%d", ins
->modrm
.reg
);
12861 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12863 oappend_register (ins
, scratch
);
12867 OP_MMX (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12868 int sizeflag ATTRIBUTE_UNUSED
)
12870 int reg
= ins
->modrm
.reg
;
12871 const char *const *names
;
12873 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12874 if (ins
->prefixes
& PREFIX_DATA
)
12876 names
= att_names_xmm
;
12878 if (ins
->rex
& REX_R
)
12882 names
= att_names_mm
;
12883 oappend_register (ins
, names
[reg
]);
12887 print_vector_reg (instr_info
*ins
, unsigned int reg
, int bytemode
)
12889 const char *const *names
;
12891 if (bytemode
== xmmq_mode
12892 || bytemode
== evex_half_bcst_xmmqh_mode
12893 || bytemode
== evex_half_bcst_xmmq_mode
)
12895 switch (ins
->vex
.length
)
12899 names
= att_names_xmm
;
12902 names
= att_names_ymm
;
12903 ins
->evex_used
|= EVEX_len_used
;
12909 else if (bytemode
== ymm_mode
)
12910 names
= att_names_ymm
;
12911 else if (bytemode
== tmm_mode
)
12915 oappend (ins
, "(bad)");
12918 names
= att_names_tmm
;
12920 else if (ins
->need_vex
12921 && bytemode
!= xmm_mode
12922 && bytemode
!= scalar_mode
12923 && bytemode
!= xmmdw_mode
12924 && bytemode
!= xmmqd_mode
12925 && bytemode
!= evex_half_bcst_xmmqdh_mode
12926 && bytemode
!= w_swap_mode
12927 && bytemode
!= b_mode
12928 && bytemode
!= w_mode
12929 && bytemode
!= d_mode
12930 && bytemode
!= q_mode
)
12932 ins
->evex_used
|= EVEX_len_used
;
12933 switch (ins
->vex
.length
)
12936 names
= att_names_xmm
;
12940 || bytemode
!= vex_vsib_q_w_dq_mode
)
12941 names
= att_names_ymm
;
12943 names
= att_names_xmm
;
12947 || bytemode
!= vex_vsib_q_w_dq_mode
)
12948 names
= att_names_zmm
;
12950 names
= att_names_ymm
;
12957 names
= att_names_xmm
;
12958 oappend_register (ins
, names
[reg
]);
12962 OP_XMM (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
12964 unsigned int reg
= ins
->modrm
.reg
;
12967 if (ins
->rex
& REX_R
)
12975 if (bytemode
== tmm_mode
)
12976 ins
->modrm
.reg
= reg
;
12977 else if (bytemode
== scalar_mode
)
12978 ins
->vex
.no_broadcast
= true;
12980 print_vector_reg (ins
, reg
, bytemode
);
12984 OP_EM (instr_info
*ins
, int bytemode
, int sizeflag
)
12987 const char *const *names
;
12989 if (ins
->modrm
.mod
!= 3)
12991 if (ins
->intel_syntax
12992 && (bytemode
== v_mode
|| bytemode
== v_swap_mode
))
12994 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
12995 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12997 OP_E (ins
, bytemode
, sizeflag
);
13001 if ((sizeflag
& SUFFIX_ALWAYS
) && bytemode
== v_swap_mode
)
13002 swap_operand (ins
);
13004 /* Skip mod/rm byte. */
13007 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13008 reg
= ins
->modrm
.rm
;
13009 if (ins
->prefixes
& PREFIX_DATA
)
13011 names
= att_names_xmm
;
13013 if (ins
->rex
& REX_B
)
13017 names
= att_names_mm
;
13018 oappend_register (ins
, names
[reg
]);
13021 /* cvt* are the only instructions in sse2 which have
13022 both SSE and MMX operands and also have 0x66 prefix
13023 in their opcode. 0x66 was originally used to differentiate
13024 between SSE and MMX instruction(operands). So we have to handle the
13025 cvt* separately using OP_EMC and OP_MXC */
13027 OP_EMC (instr_info
*ins
, int bytemode
, int sizeflag
)
13029 if (ins
->modrm
.mod
!= 3)
13031 if (ins
->intel_syntax
&& bytemode
== v_mode
)
13033 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
13034 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13036 OP_E (ins
, bytemode
, sizeflag
);
13040 /* Skip mod/rm byte. */
13043 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13044 oappend_register (ins
, att_names_mm
[ins
->modrm
.rm
]);
13048 OP_MXC (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13049 int sizeflag ATTRIBUTE_UNUSED
)
13051 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13052 oappend_register (ins
, att_names_mm
[ins
->modrm
.reg
]);
13056 OP_EX (instr_info
*ins
, int bytemode
, int sizeflag
)
13060 /* Skip mod/rm byte. */
13064 if (bytemode
== dq_mode
)
13065 bytemode
= ins
->vex
.w
? q_mode
: d_mode
;
13067 if (ins
->modrm
.mod
!= 3)
13069 OP_E_memory (ins
, bytemode
, sizeflag
);
13073 reg
= ins
->modrm
.rm
;
13075 if (ins
->rex
& REX_B
)
13080 if ((ins
->rex
& REX_X
))
13084 if ((sizeflag
& SUFFIX_ALWAYS
)
13085 && (bytemode
== x_swap_mode
13086 || bytemode
== w_swap_mode
13087 || bytemode
== d_swap_mode
13088 || bytemode
== q_swap_mode
))
13089 swap_operand (ins
);
13091 if (bytemode
== tmm_mode
)
13092 ins
->modrm
.rm
= reg
;
13094 print_vector_reg (ins
, reg
, bytemode
);
13098 OP_MS (instr_info
*ins
, int bytemode
, int sizeflag
)
13100 if (ins
->modrm
.mod
== 3)
13101 OP_EM (ins
, bytemode
, sizeflag
);
13107 OP_XS (instr_info
*ins
, int bytemode
, int sizeflag
)
13109 if (ins
->modrm
.mod
== 3)
13110 OP_EX (ins
, bytemode
, sizeflag
);
13116 OP_M (instr_info
*ins
, int bytemode
, int sizeflag
)
13118 if (ins
->modrm
.mod
== 3)
13119 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
13122 OP_E (ins
, bytemode
, sizeflag
);
13126 OP_0f07 (instr_info
*ins
, int bytemode
, int sizeflag
)
13128 if (ins
->modrm
.mod
!= 3 || ins
->modrm
.rm
!= 0)
13131 OP_E (ins
, bytemode
, sizeflag
);
13134 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
13135 32bit mode and "xchg %rax,%rax" in 64bit mode. */
13138 NOP_Fixup (instr_info
*ins
, int opnd
, int sizeflag
)
13140 if ((ins
->prefixes
& PREFIX_DATA
) == 0 && (ins
->rex
& REX_B
) == 0)
13141 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop");
13142 else if (opnd
== 0)
13143 OP_REG (ins
, eAX_reg
, sizeflag
);
13145 OP_IMREG (ins
, eAX_reg
, sizeflag
);
13148 static const char *const Suffix3DNow
[] = {
13149 /* 00 */ NULL
, NULL
, NULL
, NULL
,
13150 /* 04 */ NULL
, NULL
, NULL
, NULL
,
13151 /* 08 */ NULL
, NULL
, NULL
, NULL
,
13152 /* 0C */ "pi2fw", "pi2fd", NULL
, NULL
,
13153 /* 10 */ NULL
, NULL
, NULL
, NULL
,
13154 /* 14 */ NULL
, NULL
, NULL
, NULL
,
13155 /* 18 */ NULL
, NULL
, NULL
, NULL
,
13156 /* 1C */ "pf2iw", "pf2id", NULL
, NULL
,
13157 /* 20 */ NULL
, NULL
, NULL
, NULL
,
13158 /* 24 */ NULL
, NULL
, NULL
, NULL
,
13159 /* 28 */ NULL
, NULL
, NULL
, NULL
,
13160 /* 2C */ NULL
, NULL
, NULL
, NULL
,
13161 /* 30 */ NULL
, NULL
, NULL
, NULL
,
13162 /* 34 */ NULL
, NULL
, NULL
, NULL
,
13163 /* 38 */ NULL
, NULL
, NULL
, NULL
,
13164 /* 3C */ NULL
, NULL
, NULL
, NULL
,
13165 /* 40 */ NULL
, NULL
, NULL
, NULL
,
13166 /* 44 */ NULL
, NULL
, NULL
, NULL
,
13167 /* 48 */ NULL
, NULL
, NULL
, NULL
,
13168 /* 4C */ NULL
, NULL
, NULL
, NULL
,
13169 /* 50 */ NULL
, NULL
, NULL
, NULL
,
13170 /* 54 */ NULL
, NULL
, NULL
, NULL
,
13171 /* 58 */ NULL
, NULL
, NULL
, NULL
,
13172 /* 5C */ NULL
, NULL
, NULL
, NULL
,
13173 /* 60 */ NULL
, NULL
, NULL
, NULL
,
13174 /* 64 */ NULL
, NULL
, NULL
, NULL
,
13175 /* 68 */ NULL
, NULL
, NULL
, NULL
,
13176 /* 6C */ NULL
, NULL
, NULL
, NULL
,
13177 /* 70 */ NULL
, NULL
, NULL
, NULL
,
13178 /* 74 */ NULL
, NULL
, NULL
, NULL
,
13179 /* 78 */ NULL
, NULL
, NULL
, NULL
,
13180 /* 7C */ NULL
, NULL
, NULL
, NULL
,
13181 /* 80 */ NULL
, NULL
, NULL
, NULL
,
13182 /* 84 */ NULL
, NULL
, NULL
, NULL
,
13183 /* 88 */ NULL
, NULL
, "pfnacc", NULL
,
13184 /* 8C */ NULL
, NULL
, "pfpnacc", NULL
,
13185 /* 90 */ "pfcmpge", NULL
, NULL
, NULL
,
13186 /* 94 */ "pfmin", NULL
, "pfrcp", "pfrsqrt",
13187 /* 98 */ NULL
, NULL
, "pfsub", NULL
,
13188 /* 9C */ NULL
, NULL
, "pfadd", NULL
,
13189 /* A0 */ "pfcmpgt", NULL
, NULL
, NULL
,
13190 /* A4 */ "pfmax", NULL
, "pfrcpit1", "pfrsqit1",
13191 /* A8 */ NULL
, NULL
, "pfsubr", NULL
,
13192 /* AC */ NULL
, NULL
, "pfacc", NULL
,
13193 /* B0 */ "pfcmpeq", NULL
, NULL
, NULL
,
13194 /* B4 */ "pfmul", NULL
, "pfrcpit2", "pmulhrw",
13195 /* B8 */ NULL
, NULL
, NULL
, "pswapd",
13196 /* BC */ NULL
, NULL
, NULL
, "pavgusb",
13197 /* C0 */ NULL
, NULL
, NULL
, NULL
,
13198 /* C4 */ NULL
, NULL
, NULL
, NULL
,
13199 /* C8 */ NULL
, NULL
, NULL
, NULL
,
13200 /* CC */ NULL
, NULL
, NULL
, NULL
,
13201 /* D0 */ NULL
, NULL
, NULL
, NULL
,
13202 /* D4 */ NULL
, NULL
, NULL
, NULL
,
13203 /* D8 */ NULL
, NULL
, NULL
, NULL
,
13204 /* DC */ NULL
, NULL
, NULL
, NULL
,
13205 /* E0 */ NULL
, NULL
, NULL
, NULL
,
13206 /* E4 */ NULL
, NULL
, NULL
, NULL
,
13207 /* E8 */ NULL
, NULL
, NULL
, NULL
,
13208 /* EC */ NULL
, NULL
, NULL
, NULL
,
13209 /* F0 */ NULL
, NULL
, NULL
, NULL
,
13210 /* F4 */ NULL
, NULL
, NULL
, NULL
,
13211 /* F8 */ NULL
, NULL
, NULL
, NULL
,
13212 /* FC */ NULL
, NULL
, NULL
, NULL
,
13216 OP_3DNowSuffix (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13217 int sizeflag ATTRIBUTE_UNUSED
)
13219 const char *mnemonic
;
13221 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13222 /* AMD 3DNow! instructions are specified by an opcode suffix in the
13223 place where an 8-bit immediate would normally go. ie. the last
13224 byte of the instruction. */
13225 ins
->obufp
= ins
->mnemonicendp
;
13226 mnemonic
= Suffix3DNow
[*ins
->codep
++ & 0xff];
13228 ins
->obufp
= stpcpy (ins
->obufp
, mnemonic
);
13231 /* Since a variable sized ins->modrm/ins->sib chunk is between the start
13232 of the opcode (0x0f0f) and the opcode suffix, we need to do
13233 all the ins->modrm processing first, and don't know until now that
13234 we have a bad opcode. This necessitates some cleaning up. */
13235 ins
->op_out
[0][0] = '\0';
13236 ins
->op_out
[1][0] = '\0';
13239 ins
->mnemonicendp
= ins
->obufp
;
13242 static const struct op simd_cmp_op
[] =
13244 { STRING_COMMA_LEN ("eq") },
13245 { STRING_COMMA_LEN ("lt") },
13246 { STRING_COMMA_LEN ("le") },
13247 { STRING_COMMA_LEN ("unord") },
13248 { STRING_COMMA_LEN ("neq") },
13249 { STRING_COMMA_LEN ("nlt") },
13250 { STRING_COMMA_LEN ("nle") },
13251 { STRING_COMMA_LEN ("ord") }
13254 static const struct op vex_cmp_op
[] =
13256 { STRING_COMMA_LEN ("eq_uq") },
13257 { STRING_COMMA_LEN ("nge") },
13258 { STRING_COMMA_LEN ("ngt") },
13259 { STRING_COMMA_LEN ("false") },
13260 { STRING_COMMA_LEN ("neq_oq") },
13261 { STRING_COMMA_LEN ("ge") },
13262 { STRING_COMMA_LEN ("gt") },
13263 { STRING_COMMA_LEN ("true") },
13264 { STRING_COMMA_LEN ("eq_os") },
13265 { STRING_COMMA_LEN ("lt_oq") },
13266 { STRING_COMMA_LEN ("le_oq") },
13267 { STRING_COMMA_LEN ("unord_s") },
13268 { STRING_COMMA_LEN ("neq_us") },
13269 { STRING_COMMA_LEN ("nlt_uq") },
13270 { STRING_COMMA_LEN ("nle_uq") },
13271 { STRING_COMMA_LEN ("ord_s") },
13272 { STRING_COMMA_LEN ("eq_us") },
13273 { STRING_COMMA_LEN ("nge_uq") },
13274 { STRING_COMMA_LEN ("ngt_uq") },
13275 { STRING_COMMA_LEN ("false_os") },
13276 { STRING_COMMA_LEN ("neq_os") },
13277 { STRING_COMMA_LEN ("ge_oq") },
13278 { STRING_COMMA_LEN ("gt_oq") },
13279 { STRING_COMMA_LEN ("true_us") },
13283 CMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13284 int sizeflag ATTRIBUTE_UNUSED
)
13286 unsigned int cmp_type
;
13288 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13289 cmp_type
= *ins
->codep
++ & 0xff;
13290 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
))
13293 char *p
= ins
->mnemonicendp
- 2;
13297 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13298 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13300 else if (ins
->need_vex
13301 && cmp_type
< ARRAY_SIZE (simd_cmp_op
) + ARRAY_SIZE (vex_cmp_op
))
13304 char *p
= ins
->mnemonicendp
- 2;
13308 cmp_type
-= ARRAY_SIZE (simd_cmp_op
);
13309 sprintf (p
, "%s%s", vex_cmp_op
[cmp_type
].name
, suffix
);
13310 ins
->mnemonicendp
+= vex_cmp_op
[cmp_type
].len
;
13314 /* We have a reserved extension byte. Output it directly. */
13315 oappend_immediate (ins
, cmp_type
);
13320 OP_Mwait (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13322 /* mwait %eax,%ecx / mwaitx %eax,%ecx,%ebx */
13323 if (!ins
->intel_syntax
)
13325 strcpy (ins
->op_out
[0], att_names32
[0] + ins
->intel_syntax
);
13326 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13327 if (bytemode
== eBX_reg
)
13328 strcpy (ins
->op_out
[2], att_names32
[3] + ins
->intel_syntax
);
13329 ins
->two_source_ops
= true;
13331 /* Skip mod/rm byte. */
13337 OP_Monitor (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13338 int sizeflag ATTRIBUTE_UNUSED
)
13340 /* monitor %{e,r,}ax,%ecx,%edx" */
13341 if (!ins
->intel_syntax
)
13343 const char *const *names
= (ins
->address_mode
== mode_64bit
13344 ? att_names64
: att_names32
);
13346 if (ins
->prefixes
& PREFIX_ADDR
)
13348 /* Remove "addr16/addr32". */
13349 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
13350 names
= (ins
->address_mode
!= mode_32bit
13351 ? att_names32
: att_names16
);
13352 ins
->used_prefixes
|= PREFIX_ADDR
;
13354 else if (ins
->address_mode
== mode_16bit
)
13355 names
= att_names16
;
13356 strcpy (ins
->op_out
[0], names
[0] + ins
->intel_syntax
);
13357 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13358 strcpy (ins
->op_out
[2], att_names32
[2] + ins
->intel_syntax
);
13359 ins
->two_source_ops
= true;
13361 /* Skip mod/rm byte. */
13367 BadOp (instr_info
*ins
)
13369 /* Throw away prefixes and 1st. opcode byte. */
13370 ins
->codep
= ins
->insn_codep
+ 1;
13371 ins
->obufp
= stpcpy (ins
->obufp
, "(bad)");
13375 REP_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13377 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
13379 if (ins
->prefixes
& PREFIX_REPZ
)
13380 ins
->all_prefixes
[ins
->last_repz_prefix
] = REP_PREFIX
;
13387 OP_IMREG (ins
, bytemode
, sizeflag
);
13390 OP_ESreg (ins
, bytemode
, sizeflag
);
13393 OP_DSreg (ins
, bytemode
, sizeflag
);
13402 SEP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13403 int sizeflag ATTRIBUTE_UNUSED
)
13405 if (ins
->isa64
!= amd64
)
13408 ins
->obufp
= ins
->obuf
;
13410 ins
->mnemonicendp
= ins
->obufp
;
13414 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
13418 BND_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13419 int sizeflag ATTRIBUTE_UNUSED
)
13421 if (ins
->prefixes
& PREFIX_REPNZ
)
13422 ins
->all_prefixes
[ins
->last_repnz_prefix
] = BND_PREFIX
;
13425 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
13429 NOTRACK_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13430 int sizeflag ATTRIBUTE_UNUSED
)
13432 /* Since active_seg_prefix is not set in 64-bit mode, check whether
13433 we've seen a PREFIX_DS. */
13434 if ((ins
->prefixes
& PREFIX_DS
) != 0
13435 && (ins
->address_mode
!= mode_64bit
|| ins
->last_data_prefix
< 0))
13437 /* NOTRACK prefix is only valid on indirect branch instructions.
13438 NB: DATA prefix is unsupported for Intel64. */
13439 ins
->active_seg_prefix
= 0;
13440 ins
->all_prefixes
[ins
->last_seg_prefix
] = NOTRACK_PREFIX
;
13444 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13445 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
13449 HLE_Fixup1 (instr_info
*ins
, int bytemode
, int sizeflag
)
13451 if (ins
->modrm
.mod
!= 3
13452 && (ins
->prefixes
& PREFIX_LOCK
) != 0)
13454 if (ins
->prefixes
& PREFIX_REPZ
)
13455 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13456 if (ins
->prefixes
& PREFIX_REPNZ
)
13457 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13460 OP_E (ins
, bytemode
, sizeflag
);
13463 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13464 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
13468 HLE_Fixup2 (instr_info
*ins
, int bytemode
, int sizeflag
)
13470 if (ins
->modrm
.mod
!= 3)
13472 if (ins
->prefixes
& PREFIX_REPZ
)
13473 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13474 if (ins
->prefixes
& PREFIX_REPNZ
)
13475 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13478 OP_E (ins
, bytemode
, sizeflag
);
13481 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
13482 "xrelease" for memory operand. No check for LOCK prefix. */
13485 HLE_Fixup3 (instr_info
*ins
, int bytemode
, int sizeflag
)
13487 if (ins
->modrm
.mod
!= 3
13488 && ins
->last_repz_prefix
> ins
->last_repnz_prefix
13489 && (ins
->prefixes
& PREFIX_REPZ
) != 0)
13490 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13492 OP_E (ins
, bytemode
, sizeflag
);
13496 CMPXCHG8B_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13499 if (ins
->rex
& REX_W
)
13501 /* Change cmpxchg8b to cmpxchg16b. */
13502 char *p
= ins
->mnemonicendp
- 2;
13503 ins
->mnemonicendp
= stpcpy (p
, "16b");
13506 else if ((ins
->prefixes
& PREFIX_LOCK
) != 0)
13508 if (ins
->prefixes
& PREFIX_REPZ
)
13509 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13510 if (ins
->prefixes
& PREFIX_REPNZ
)
13511 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13514 OP_M (ins
, bytemode
, sizeflag
);
13518 XMM_Fixup (instr_info
*ins
, int reg
, int sizeflag ATTRIBUTE_UNUSED
)
13520 const char *const *names
= att_names_xmm
;
13524 switch (ins
->vex
.length
)
13529 names
= att_names_ymm
;
13535 oappend_register (ins
, names
[reg
]);
13539 FXSAVE_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13541 /* Add proper suffix to "fxsave" and "fxrstor". */
13543 if (ins
->rex
& REX_W
)
13545 char *p
= ins
->mnemonicendp
;
13549 ins
->mnemonicendp
= p
;
13551 OP_M (ins
, bytemode
, sizeflag
);
13554 /* Display the destination register operand for instructions with
13558 OP_VEX (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13560 int reg
, modrm_reg
, sib_index
= -1;
13561 const char *const *names
;
13563 if (!ins
->need_vex
)
13566 reg
= ins
->vex
.register_specifier
;
13567 ins
->vex
.register_specifier
= 0;
13568 if (ins
->address_mode
!= mode_64bit
)
13570 if (ins
->vex
.evex
&& !ins
->vex
.v
)
13572 oappend (ins
, "(bad)");
13578 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13584 oappend_register (ins
, att_names_xmm
[reg
]);
13587 case vex_vsib_d_w_dq_mode
:
13588 case vex_vsib_q_w_dq_mode
:
13589 /* This must be the 3rd operand. */
13590 if (ins
->obufp
!= ins
->op_out
[2])
13592 if (ins
->vex
.length
== 128
13593 || (bytemode
!= vex_vsib_d_w_dq_mode
13595 oappend_register (ins
, att_names_xmm
[reg
]);
13597 oappend_register (ins
, att_names_ymm
[reg
]);
13599 /* All 3 XMM/YMM registers must be distinct. */
13600 modrm_reg
= ins
->modrm
.reg
;
13601 if (ins
->rex
& REX_R
)
13604 if (ins
->has_sib
&& ins
->modrm
.rm
== 4)
13606 sib_index
= ins
->sib
.index
;
13607 if (ins
->rex
& REX_X
)
13611 if (reg
== modrm_reg
|| reg
== sib_index
)
13612 strcpy (ins
->obufp
, "/(bad)");
13613 if (modrm_reg
== sib_index
|| modrm_reg
== reg
)
13614 strcat (ins
->op_out
[0], "/(bad)");
13615 if (sib_index
== modrm_reg
|| sib_index
== reg
)
13616 strcat (ins
->op_out
[1], "/(bad)");
13621 /* All 3 TMM registers must be distinct. */
13623 oappend (ins
, "(bad)");
13626 /* This must be the 3rd operand. */
13627 if (ins
->obufp
!= ins
->op_out
[2])
13629 oappend_register (ins
, att_names_tmm
[reg
]);
13630 if (reg
== ins
->modrm
.reg
|| reg
== ins
->modrm
.rm
)
13631 strcpy (ins
->obufp
, "/(bad)");
13634 if (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
13635 || ins
->modrm
.rm
== reg
)
13637 if (ins
->modrm
.reg
<= 8
13638 && (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
))
13639 strcat (ins
->op_out
[0], "/(bad)");
13640 if (ins
->modrm
.rm
<= 8
13641 && (ins
->modrm
.rm
== ins
->modrm
.reg
|| ins
->modrm
.rm
== reg
))
13642 strcat (ins
->op_out
[1], "/(bad)");
13648 switch (ins
->vex
.length
)
13654 names
= att_names_xmm
;
13655 ins
->evex_used
|= EVEX_len_used
;
13658 if (ins
->rex
& REX_W
)
13659 names
= att_names64
;
13661 names
= att_names32
;
13667 oappend (ins
, "(bad)");
13670 names
= att_names_mask
;
13681 names
= att_names_ymm
;
13682 ins
->evex_used
|= EVEX_len_used
;
13688 oappend (ins
, "(bad)");
13691 names
= att_names_mask
;
13694 /* See PR binutils/20893 for a reproducer. */
13695 oappend (ins
, "(bad)");
13700 names
= att_names_zmm
;
13701 ins
->evex_used
|= EVEX_len_used
;
13707 oappend_register (ins
, names
[reg
]);
13711 OP_VexR (instr_info
*ins
, int bytemode
, int sizeflag
)
13713 if (ins
->modrm
.mod
== 3)
13714 OP_VEX (ins
, bytemode
, sizeflag
);
13718 OP_VexW (instr_info
*ins
, int bytemode
, int sizeflag
)
13720 OP_VEX (ins
, bytemode
, sizeflag
);
13724 /* Swap 2nd and 3rd operands. */
13725 char *tmp
= ins
->op_out
[2];
13727 ins
->op_out
[2] = ins
->op_out
[1];
13728 ins
->op_out
[1] = tmp
;
13733 OP_REG_VexI4 (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13736 const char *const *names
= att_names_xmm
;
13738 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13739 reg
= *ins
->codep
++;
13741 if (bytemode
!= x_mode
&& bytemode
!= scalar_mode
)
13745 if (ins
->address_mode
!= mode_64bit
)
13748 if (bytemode
== x_mode
&& ins
->vex
.length
== 256)
13749 names
= att_names_ymm
;
13751 oappend_register (ins
, names
[reg
]);
13755 /* Swap 3rd and 4th operands. */
13756 char *tmp
= ins
->op_out
[3];
13758 ins
->op_out
[3] = ins
->op_out
[2];
13759 ins
->op_out
[2] = tmp
;
13764 OP_VexI4 (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13765 int sizeflag ATTRIBUTE_UNUSED
)
13767 oappend_immediate (ins
, ins
->codep
[-1] & 0xf);
13771 VPCMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13772 int sizeflag ATTRIBUTE_UNUSED
)
13774 unsigned int cmp_type
;
13776 if (!ins
->vex
.evex
)
13779 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13780 cmp_type
= *ins
->codep
++ & 0xff;
13781 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
13782 If it's the case, print suffix, otherwise - print the immediate. */
13783 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
)
13788 char *p
= ins
->mnemonicendp
- 2;
13790 /* vpcmp* can have both one- and two-lettered suffix. */
13804 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13805 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13809 /* We have a reserved extension byte. Output it directly. */
13810 oappend_immediate (ins
, cmp_type
);
13814 static const struct op xop_cmp_op
[] =
13816 { STRING_COMMA_LEN ("lt") },
13817 { STRING_COMMA_LEN ("le") },
13818 { STRING_COMMA_LEN ("gt") },
13819 { STRING_COMMA_LEN ("ge") },
13820 { STRING_COMMA_LEN ("eq") },
13821 { STRING_COMMA_LEN ("neq") },
13822 { STRING_COMMA_LEN ("false") },
13823 { STRING_COMMA_LEN ("true") }
13827 VPCOM_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13828 int sizeflag ATTRIBUTE_UNUSED
)
13830 unsigned int cmp_type
;
13832 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13833 cmp_type
= *ins
->codep
++ & 0xff;
13834 if (cmp_type
< ARRAY_SIZE (xop_cmp_op
))
13837 char *p
= ins
->mnemonicendp
- 2;
13839 /* vpcom* can have both one- and two-lettered suffix. */
13853 sprintf (p
, "%s%s", xop_cmp_op
[cmp_type
].name
, suffix
);
13854 ins
->mnemonicendp
+= xop_cmp_op
[cmp_type
].len
;
13858 /* We have a reserved extension byte. Output it directly. */
13859 oappend_immediate (ins
, cmp_type
);
13863 static const struct op pclmul_op
[] =
13865 { STRING_COMMA_LEN ("lql") },
13866 { STRING_COMMA_LEN ("hql") },
13867 { STRING_COMMA_LEN ("lqh") },
13868 { STRING_COMMA_LEN ("hqh") }
13872 PCLMUL_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13873 int sizeflag ATTRIBUTE_UNUSED
)
13875 unsigned int pclmul_type
;
13877 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13878 pclmul_type
= *ins
->codep
++ & 0xff;
13879 switch (pclmul_type
)
13890 if (pclmul_type
< ARRAY_SIZE (pclmul_op
))
13893 char *p
= ins
->mnemonicendp
- 3;
13898 sprintf (p
, "%s%s", pclmul_op
[pclmul_type
].name
, suffix
);
13899 ins
->mnemonicendp
+= pclmul_op
[pclmul_type
].len
;
13903 /* We have a reserved extension byte. Output it directly. */
13904 oappend_immediate (ins
, pclmul_type
);
13909 MOVSXD_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13911 /* Add proper suffix to "movsxd". */
13912 char *p
= ins
->mnemonicendp
;
13917 if (!ins
->intel_syntax
)
13920 if (ins
->rex
& REX_W
)
13932 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
13936 ins
->mnemonicendp
= p
;
13938 OP_E (ins
, bytemode
, sizeflag
);
13942 DistinctDest_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13944 unsigned int reg
= ins
->vex
.register_specifier
;
13945 unsigned int modrm_reg
= ins
->modrm
.reg
;
13946 unsigned int modrm_rm
= ins
->modrm
.rm
;
13948 /* Calc destination register number. */
13949 if (ins
->rex
& REX_R
)
13954 /* Calc src1 register number. */
13955 if (ins
->address_mode
!= mode_64bit
)
13957 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13960 /* Calc src2 register number. */
13961 if (ins
->modrm
.mod
== 3)
13963 if (ins
->rex
& REX_B
)
13965 if (ins
->rex
& REX_X
)
13969 /* Destination and source registers must be distinct, output bad if
13970 dest == src1 or dest == src2. */
13971 if (modrm_reg
== reg
13972 || (ins
->modrm
.mod
== 3
13973 && modrm_reg
== modrm_rm
))
13975 oappend (ins
, "(bad)");
13978 OP_XMM (ins
, bytemode
, sizeflag
);
13982 OP_Rounding (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13984 if (ins
->modrm
.mod
!= 3 || !ins
->vex
.b
)
13989 case evex_rounding_64_mode
:
13990 if (ins
->address_mode
!= mode_64bit
|| !ins
->vex
.w
)
13992 /* Fall through. */
13993 case evex_rounding_mode
:
13994 ins
->evex_used
|= EVEX_b_used
;
13995 oappend (ins
, names_rounding
[ins
->vex
.ll
]);
13997 case evex_sae_mode
:
13998 ins
->evex_used
|= EVEX_b_used
;
13999 oappend (ins
, "{");
14004 oappend (ins
, "sae}");
14008 PREFETCHI_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
14010 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 5)
14012 if (ins
->intel_syntax
)
14014 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop ");
14019 if (ins
->rex
& REX_W
)
14020 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopq ");
14023 if (sizeflag
& DFLAG
)
14024 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopl ");
14026 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopw ");
14027 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
14033 OP_M (ins
, bytemode
, sizeflag
);