1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2023 Free Software Foundation, Inc.
4 This file is part of the GNU opcodes library.
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 It is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
22 /* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
24 modified by John Hassey (hassey@dg-rtp.dg.com)
25 x86-64 support added by Jan Hubicka (jh@suse.cz)
26 VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */
28 /* The main tables describing the instructions is essentially a copy
29 of the "Opcode Map" chapter (Appendix A) of the Intel 80386
30 Programmers Manual. Usually, there is a capital letter, followed
31 by a small letter. The capital letter tell the addressing mode,
32 and the small letter tells about the operand size. Refer to
33 the Intel manual for details. */
36 #include "disassemble.h"
38 #include "opcode/i386.h"
39 #include "libiberty.h"
40 #include "safe-ctype.h"
42 typedef struct instr_info instr_info
;
44 static bool dofloat (instr_info
*, int);
45 static int putop (instr_info
*, const char *, int);
46 static void oappend_with_style (instr_info
*, const char *,
47 enum disassembler_style
);
48 static void oappend (instr_info
*, const char *);
49 static void append_seg (instr_info
*);
50 static bool get32s (instr_info
*, bfd_signed_vma
*);
51 static bool get16 (instr_info
*, int *);
52 static void set_op (instr_info
*, bfd_vma
, bool);
54 static bool OP_E (instr_info
*, int, int);
55 static bool OP_E_memory (instr_info
*, int, int);
56 static bool OP_indirE (instr_info
*, int, int);
57 static bool OP_G (instr_info
*, int, int);
58 static bool OP_ST (instr_info
*, int, int);
59 static bool OP_STi (instr_info
*, int, int);
60 static bool OP_Skip_MODRM (instr_info
*, int, int);
61 static bool OP_REG (instr_info
*, int, int);
62 static bool OP_IMREG (instr_info
*, int, int);
63 static bool OP_I (instr_info
*, int, int);
64 static bool OP_I64 (instr_info
*, int, int);
65 static bool OP_sI (instr_info
*, int, int);
66 static bool OP_J (instr_info
*, int, int);
67 static bool OP_SEG (instr_info
*, int, int);
68 static bool OP_DIR (instr_info
*, int, int);
69 static bool OP_OFF (instr_info
*, int, int);
70 static bool OP_OFF64 (instr_info
*, int, int);
71 static bool OP_ESreg (instr_info
*, int, int);
72 static bool OP_DSreg (instr_info
*, int, int);
73 static bool OP_C (instr_info
*, int, int);
74 static bool OP_D (instr_info
*, int, int);
75 static bool OP_T (instr_info
*, int, int);
76 static bool OP_MMX (instr_info
*, int, int);
77 static bool OP_XMM (instr_info
*, int, int);
78 static bool OP_EM (instr_info
*, int, int);
79 static bool OP_EX (instr_info
*, int, int);
80 static bool OP_EMC (instr_info
*, int,int);
81 static bool OP_MXC (instr_info
*, int,int);
82 static bool OP_MS (instr_info
*, int, int);
83 static bool OP_XS (instr_info
*, int, int);
84 static bool OP_M (instr_info
*, int, int);
85 static bool OP_VEX (instr_info
*, int, int);
86 static bool OP_VexR (instr_info
*, int, int);
87 static bool OP_VexW (instr_info
*, int, int);
88 static bool OP_Rounding (instr_info
*, int, int);
89 static bool OP_REG_VexI4 (instr_info
*, int, int);
90 static bool OP_VexI4 (instr_info
*, int, int);
91 static bool OP_0f07 (instr_info
*, int, int);
92 static bool OP_Monitor (instr_info
*, int, int);
93 static bool OP_Mwait (instr_info
*, int, int);
95 static bool BadOp (instr_info
*);
97 static bool PCLMUL_Fixup (instr_info
*, int, int);
98 static bool VPCMP_Fixup (instr_info
*, int, int);
99 static bool VPCOM_Fixup (instr_info
*, int, int);
100 static bool NOP_Fixup (instr_info
*, int, int);
101 static bool OP_3DNowSuffix (instr_info
*, int, int);
102 static bool CMP_Fixup (instr_info
*, int, int);
103 static bool REP_Fixup (instr_info
*, int, int);
104 static bool SEP_Fixup (instr_info
*, int, int);
105 static bool BND_Fixup (instr_info
*, int, int);
106 static bool NOTRACK_Fixup (instr_info
*, int, int);
107 static bool HLE_Fixup1 (instr_info
*, int, int);
108 static bool HLE_Fixup2 (instr_info
*, int, int);
109 static bool HLE_Fixup3 (instr_info
*, int, int);
110 static bool CMPXCHG8B_Fixup (instr_info
*, int, int);
111 static bool XMM_Fixup (instr_info
*, int, int);
112 static bool FXSAVE_Fixup (instr_info
*, int, int);
113 static bool MOVSXD_Fixup (instr_info
*, int, int);
114 static bool DistinctDest_Fixup (instr_info
*, int, int);
115 static bool PREFETCHI_Fixup (instr_info
*, int, int);
117 static void ATTRIBUTE_PRINTF_3
i386_dis_printf (const instr_info
*,
118 enum disassembler_style
,
120 static const char *prefix_name (const instr_info
*, int, int);
122 /* This character is used to encode style information within the output
123 buffers. See oappend_insert_style for more details. */
124 #define STYLE_MARKER_CHAR '\002'
126 /* The maximum operand buffer size. */
127 #define MAX_OPERAND_BUFFER_SIZE 128
130 /* Points to first byte not fetched. */
131 bfd_byte
*max_fetched
;
132 bfd_byte the_buffer
[MAX_MNEM_SIZE
];
152 enum address_mode address_mode
;
154 /* Flags for the prefixes for the current instruction. See below. */
157 /* REX prefix the current instruction. See below. */
159 /* Bits of REX we've already used. */
160 unsigned char rex_used
;
166 /* Flags for ins->prefixes which we somehow handled when printing the
167 current instruction. */
170 /* Flags for EVEX bits which we somehow handled when printing the
171 current instruction. */
174 char obuf
[MAX_OPERAND_BUFFER_SIZE
];
177 unsigned char *start_codep
;
178 unsigned char *insn_codep
;
179 unsigned char *codep
;
180 unsigned char *end_codep
;
181 signed char last_lock_prefix
;
182 signed char last_repz_prefix
;
183 signed char last_repnz_prefix
;
184 signed char last_data_prefix
;
185 signed char last_addr_prefix
;
186 signed char last_rex_prefix
;
187 signed char last_seg_prefix
;
188 signed char fwait_prefix
;
189 /* The active segment register prefix. */
190 unsigned char active_seg_prefix
;
192 #define MAX_CODE_LENGTH 15
193 /* We can up to 14 ins->prefixes since the maximum instruction length is
195 unsigned char all_prefixes
[MAX_CODE_LENGTH
- 1];
196 disassemble_info
*info
;
216 int register_specifier
;
219 int mask_register_specifier
;
231 /* Remember if the current op is a jump instruction. */
237 signed char op_index
[MAX_OPERANDS
];
238 bool op_riprel
[MAX_OPERANDS
];
239 char *op_out
[MAX_OPERANDS
];
240 bfd_vma op_address
[MAX_OPERANDS
];
243 /* On the 386's of 1988, the maximum length of an instruction is 15 bytes.
244 * (see topic "Redundant ins->prefixes" in the "Differences from 8086"
245 * section of the "Virtual 8086 Mode" chapter.)
246 * 'pc' should be the address of this instruction, it will
247 * be used to print the target address if this is a relative jump or call
248 * The function returns the length of this instruction in bytes.
257 enum x86_64_isa isa64
;
260 /* Mark parts used in the REX prefix. When we are testing for
261 empty prefix (for 8bit register REX extension), just mask it
262 out. Otherwise test for REX bit is excuse for existence of REX
263 only in case value is nonzero. */
264 #define USED_REX(value) \
268 if ((ins->rex & value)) \
269 ins->rex_used |= (value) | REX_OPCODE; \
272 ins->rex_used |= REX_OPCODE; \
276 #define EVEX_b_used 1
277 #define EVEX_len_used 2
279 /* Flags stored in PREFIXES. */
280 #define PREFIX_REPZ 1
281 #define PREFIX_REPNZ 2
284 #define PREFIX_DS 0x10
285 #define PREFIX_ES 0x20
286 #define PREFIX_FS 0x40
287 #define PREFIX_GS 0x80
288 #define PREFIX_LOCK 0x100
289 #define PREFIX_DATA 0x200
290 #define PREFIX_ADDR 0x400
291 #define PREFIX_FWAIT 0x800
293 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
294 to ADDR (exclusive) are valid. Returns true for success, false
297 fetch_code (struct disassemble_info
*info
, bfd_byte
*until
)
300 struct dis_private
*priv
= info
->private_data
;
301 bfd_vma start
= priv
->insn_start
+ (priv
->max_fetched
- priv
->the_buffer
);
303 if (until
<= priv
->max_fetched
)
306 if (until
<= priv
->the_buffer
+ MAX_MNEM_SIZE
)
307 status
= (*info
->read_memory_func
) (start
,
309 until
- priv
->max_fetched
,
313 /* If we did manage to read at least one byte, then
314 print_insn_i386 will do something sensible. Otherwise, print
315 an error. We do that here because this is where we know
317 if (priv
->max_fetched
== priv
->the_buffer
)
318 (*info
->memory_error_func
) (status
, start
, info
);
322 priv
->max_fetched
= until
;
327 fetch_modrm (instr_info
*ins
)
329 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
332 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
333 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
334 ins
->modrm
.rm
= *ins
->codep
& 7;
340 fetch_error (const instr_info
*ins
)
342 /* Getting here means we tried for data but didn't get it. That
343 means we have an incomplete instruction of some sort. Just
344 print the first byte as a prefix or a .byte pseudo-op. */
345 const struct dis_private
*priv
= ins
->info
->private_data
;
346 const char *name
= NULL
;
348 if (ins
->codep
<= priv
->the_buffer
)
351 if (ins
->prefixes
|| ins
->fwait_prefix
>= 0 || (ins
->rex
& REX_OPCODE
))
352 name
= prefix_name (ins
, priv
->the_buffer
[0], priv
->orig_sizeflag
);
354 i386_dis_printf (ins
, dis_style_mnemonic
, "%s", name
);
357 /* Just print the first byte as a .byte instruction. */
358 i386_dis_printf (ins
, dis_style_assembler_directive
, ".byte ");
359 i386_dis_printf (ins
, dis_style_immediate
, "%#x",
360 (unsigned int) priv
->the_buffer
[0]);
366 /* Possible values for prefix requirement. */
367 #define PREFIX_IGNORED_SHIFT 16
368 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
369 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
370 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
371 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
372 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
374 /* Opcode prefixes. */
375 #define PREFIX_OPCODE (PREFIX_REPZ \
379 /* Prefixes ignored. */
380 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
381 | PREFIX_IGNORED_REPNZ \
382 | PREFIX_IGNORED_DATA)
384 #define XX { NULL, 0 }
385 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
387 #define Eb { OP_E, b_mode }
388 #define Ebnd { OP_E, bnd_mode }
389 #define EbS { OP_E, b_swap_mode }
390 #define EbndS { OP_E, bnd_swap_mode }
391 #define Ev { OP_E, v_mode }
392 #define Eva { OP_E, va_mode }
393 #define Ev_bnd { OP_E, v_bnd_mode }
394 #define EvS { OP_E, v_swap_mode }
395 #define Ed { OP_E, d_mode }
396 #define Edq { OP_E, dq_mode }
397 #define Edb { OP_E, db_mode }
398 #define Edw { OP_E, dw_mode }
399 #define Eq { OP_E, q_mode }
400 #define indirEv { OP_indirE, indir_v_mode }
401 #define indirEp { OP_indirE, f_mode }
402 #define stackEv { OP_E, stack_v_mode }
403 #define Em { OP_E, m_mode }
404 #define Ew { OP_E, w_mode }
405 #define M { OP_M, 0 } /* lea, lgdt, etc. */
406 #define Ma { OP_M, a_mode }
407 #define Mb { OP_M, b_mode }
408 #define Md { OP_M, d_mode }
409 #define Mdq { OP_M, dq_mode }
410 #define Mo { OP_M, o_mode }
411 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
412 #define Mq { OP_M, q_mode }
413 #define Mv { OP_M, v_mode }
414 #define Mv_bnd { OP_M, v_bndmk_mode }
415 #define Mw { OP_M, w_mode }
416 #define Mx { OP_M, x_mode }
417 #define Mxmm { OP_M, xmm_mode }
418 #define Gb { OP_G, b_mode }
419 #define Gbnd { OP_G, bnd_mode }
420 #define Gv { OP_G, v_mode }
421 #define Gd { OP_G, d_mode }
422 #define Gdq { OP_G, dq_mode }
423 #define Gm { OP_G, m_mode }
424 #define Gva { OP_G, va_mode }
425 #define Gw { OP_G, w_mode }
426 #define Ib { OP_I, b_mode }
427 #define sIb { OP_sI, b_mode } /* sign extened byte */
428 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
429 #define Iv { OP_I, v_mode }
430 #define sIv { OP_sI, v_mode }
431 #define Iv64 { OP_I64, v_mode }
432 #define Id { OP_I, d_mode }
433 #define Iw { OP_I, w_mode }
434 #define I1 { OP_I, const_1_mode }
435 #define Jb { OP_J, b_mode }
436 #define Jv { OP_J, v_mode }
437 #define Jdqw { OP_J, dqw_mode }
438 #define Cm { OP_C, m_mode }
439 #define Dm { OP_D, m_mode }
440 #define Td { OP_T, d_mode }
441 #define Skip_MODRM { OP_Skip_MODRM, 0 }
443 #define RMeAX { OP_REG, eAX_reg }
444 #define RMeBX { OP_REG, eBX_reg }
445 #define RMeCX { OP_REG, eCX_reg }
446 #define RMeDX { OP_REG, eDX_reg }
447 #define RMeSP { OP_REG, eSP_reg }
448 #define RMeBP { OP_REG, eBP_reg }
449 #define RMeSI { OP_REG, eSI_reg }
450 #define RMeDI { OP_REG, eDI_reg }
451 #define RMrAX { OP_REG, rAX_reg }
452 #define RMrBX { OP_REG, rBX_reg }
453 #define RMrCX { OP_REG, rCX_reg }
454 #define RMrDX { OP_REG, rDX_reg }
455 #define RMrSP { OP_REG, rSP_reg }
456 #define RMrBP { OP_REG, rBP_reg }
457 #define RMrSI { OP_REG, rSI_reg }
458 #define RMrDI { OP_REG, rDI_reg }
459 #define RMAL { OP_REG, al_reg }
460 #define RMCL { OP_REG, cl_reg }
461 #define RMDL { OP_REG, dl_reg }
462 #define RMBL { OP_REG, bl_reg }
463 #define RMAH { OP_REG, ah_reg }
464 #define RMCH { OP_REG, ch_reg }
465 #define RMDH { OP_REG, dh_reg }
466 #define RMBH { OP_REG, bh_reg }
467 #define RMAX { OP_REG, ax_reg }
468 #define RMDX { OP_REG, dx_reg }
470 #define eAX { OP_IMREG, eAX_reg }
471 #define AL { OP_IMREG, al_reg }
472 #define CL { OP_IMREG, cl_reg }
473 #define zAX { OP_IMREG, z_mode_ax_reg }
474 #define indirDX { OP_IMREG, indir_dx_reg }
476 #define Sw { OP_SEG, w_mode }
477 #define Sv { OP_SEG, v_mode }
478 #define Ap { OP_DIR, 0 }
479 #define Ob { OP_OFF64, b_mode }
480 #define Ov { OP_OFF64, v_mode }
481 #define Xb { OP_DSreg, eSI_reg }
482 #define Xv { OP_DSreg, eSI_reg }
483 #define Xz { OP_DSreg, eSI_reg }
484 #define Yb { OP_ESreg, eDI_reg }
485 #define Yv { OP_ESreg, eDI_reg }
486 #define DSBX { OP_DSreg, eBX_reg }
488 #define es { OP_REG, es_reg }
489 #define ss { OP_REG, ss_reg }
490 #define cs { OP_REG, cs_reg }
491 #define ds { OP_REG, ds_reg }
492 #define fs { OP_REG, fs_reg }
493 #define gs { OP_REG, gs_reg }
495 #define MX { OP_MMX, 0 }
496 #define XM { OP_XMM, 0 }
497 #define XMScalar { OP_XMM, scalar_mode }
498 #define XMGatherD { OP_XMM, vex_vsib_d_w_dq_mode }
499 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
500 #define XMM { OP_XMM, xmm_mode }
501 #define TMM { OP_XMM, tmm_mode }
502 #define XMxmmq { OP_XMM, xmmq_mode }
503 #define EM { OP_EM, v_mode }
504 #define EMS { OP_EM, v_swap_mode }
505 #define EMd { OP_EM, d_mode }
506 #define EMx { OP_EM, x_mode }
507 #define EXbwUnit { OP_EX, bw_unit_mode }
508 #define EXb { OP_EX, b_mode }
509 #define EXw { OP_EX, w_mode }
510 #define EXd { OP_EX, d_mode }
511 #define EXdS { OP_EX, d_swap_mode }
512 #define EXwS { OP_EX, w_swap_mode }
513 #define EXq { OP_EX, q_mode }
514 #define EXqS { OP_EX, q_swap_mode }
515 #define EXdq { OP_EX, dq_mode }
516 #define EXx { OP_EX, x_mode }
517 #define EXxh { OP_EX, xh_mode }
518 #define EXxS { OP_EX, x_swap_mode }
519 #define EXxmm { OP_EX, xmm_mode }
520 #define EXymm { OP_EX, ymm_mode }
521 #define EXtmm { OP_EX, tmm_mode }
522 #define EXxmmq { OP_EX, xmmq_mode }
523 #define EXxmmqh { OP_EX, evex_half_bcst_xmmqh_mode }
524 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
525 #define EXxmmdw { OP_EX, xmmdw_mode }
526 #define EXxmmqd { OP_EX, xmmqd_mode }
527 #define EXxmmqdh { OP_EX, evex_half_bcst_xmmqdh_mode }
528 #define EXymmq { OP_EX, ymmq_mode }
529 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
530 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
531 #define MS { OP_MS, v_mode }
532 #define XS { OP_XS, v_mode }
533 #define EMCq { OP_EMC, q_mode }
534 #define MXC { OP_MXC, 0 }
535 #define OPSUF { OP_3DNowSuffix, 0 }
536 #define SEP { SEP_Fixup, 0 }
537 #define CMP { CMP_Fixup, 0 }
538 #define XMM0 { XMM_Fixup, 0 }
539 #define FXSAVE { FXSAVE_Fixup, 0 }
541 #define Vex { OP_VEX, x_mode }
542 #define VexW { OP_VexW, x_mode }
543 #define VexScalar { OP_VEX, scalar_mode }
544 #define VexScalarR { OP_VexR, scalar_mode }
545 #define VexGatherD { OP_VEX, vex_vsib_d_w_dq_mode }
546 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
547 #define VexGdq { OP_VEX, dq_mode }
548 #define VexTmm { OP_VEX, tmm_mode }
549 #define XMVexI4 { OP_REG_VexI4, x_mode }
550 #define XMVexScalarI4 { OP_REG_VexI4, scalar_mode }
551 #define VexI4 { OP_VexI4, 0 }
552 #define PCLMUL { PCLMUL_Fixup, 0 }
553 #define VPCMP { VPCMP_Fixup, 0 }
554 #define VPCOM { VPCOM_Fixup, 0 }
556 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
557 #define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
558 #define EXxEVexS { OP_Rounding, evex_sae_mode }
560 #define MaskG { OP_G, mask_mode }
561 #define MaskE { OP_E, mask_mode }
562 #define MaskBDE { OP_E, mask_bd_mode }
563 #define MaskVex { OP_VEX, mask_mode }
565 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
566 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
568 #define MVexSIBMEM { OP_M, vex_sibmem_mode }
570 /* Used handle "rep" prefix for string instructions. */
571 #define Xbr { REP_Fixup, eSI_reg }
572 #define Xvr { REP_Fixup, eSI_reg }
573 #define Ybr { REP_Fixup, eDI_reg }
574 #define Yvr { REP_Fixup, eDI_reg }
575 #define Yzr { REP_Fixup, eDI_reg }
576 #define indirDXr { REP_Fixup, indir_dx_reg }
577 #define ALr { REP_Fixup, al_reg }
578 #define eAXr { REP_Fixup, eAX_reg }
580 /* Used handle HLE prefix for lockable instructions. */
581 #define Ebh1 { HLE_Fixup1, b_mode }
582 #define Evh1 { HLE_Fixup1, v_mode }
583 #define Ebh2 { HLE_Fixup2, b_mode }
584 #define Evh2 { HLE_Fixup2, v_mode }
585 #define Ebh3 { HLE_Fixup3, b_mode }
586 #define Evh3 { HLE_Fixup3, v_mode }
588 #define BND { BND_Fixup, 0 }
589 #define NOTRACK { NOTRACK_Fixup, 0 }
591 #define cond_jump_flag { NULL, cond_jump_mode }
592 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
594 /* bits in sizeflag */
595 #define SUFFIX_ALWAYS 4
603 /* byte operand with operand swapped */
605 /* byte operand, sign extend like 'T' suffix */
607 /* operand size depends on prefixes */
609 /* operand size depends on prefixes with operand swapped */
611 /* operand size depends on address prefix */
615 /* double word operand */
617 /* word operand with operand swapped */
619 /* double word operand with operand swapped */
621 /* quad word operand */
623 /* quad word operand with operand swapped */
625 /* ten-byte operand */
627 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
628 broadcast enabled. */
630 /* Similar to x_mode, but with different EVEX mem shifts. */
632 /* Similar to x_mode, but with yet different EVEX mem shifts. */
634 /* Similar to x_mode, but with disabled broadcast. */
636 /* Similar to x_mode, but with operands swapped and disabled broadcast
639 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
640 broadcast of 16bit enabled. */
642 /* 16-byte XMM operand */
644 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
645 memory operand (depending on vector length). Broadcast isn't
648 /* Same as xmmq_mode, but broadcast is allowed. */
649 evex_half_bcst_xmmq_mode
,
650 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
651 memory operand (depending on vector length). 16bit broadcast. */
652 evex_half_bcst_xmmqh_mode
,
653 /* 16-byte XMM, word, double word or quad word operand. */
655 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
657 /* 16-byte XMM, double word, quad word operand or xmm word operand.
659 evex_half_bcst_xmmqdh_mode
,
660 /* 32-byte YMM operand */
662 /* quad word, ymmword or zmmword memory operand. */
666 /* d_mode in 32bit, q_mode in 64bit mode. */
668 /* pair of v_mode operands */
674 /* like v_bnd_mode in 32bit, no RIP-rel in 64bit mode. */
676 /* operand size depends on REX.W / VEX.W. */
678 /* Displacements like v_mode without considering Intel64 ISA. */
682 /* bounds operand with operand swapped */
684 /* 4- or 6-byte pointer operand */
687 /* v_mode for indirect branch opcodes. */
689 /* v_mode for stack-related opcodes. */
691 /* non-quad operand size depends on prefixes */
693 /* 16-byte operand */
695 /* registers like d_mode, memory like b_mode. */
697 /* registers like d_mode, memory like w_mode. */
700 /* Operand size depends on the VEX.W bit, with VSIB dword indices. */
701 vex_vsib_d_w_dq_mode
,
702 /* Operand size depends on the VEX.W bit, with VSIB qword indices. */
703 vex_vsib_q_w_dq_mode
,
704 /* mandatory non-vector SIB. */
707 /* scalar, ignore vector length. */
710 /* Static rounding. */
712 /* Static rounding, 64-bit mode only. */
713 evex_rounding_64_mode
,
714 /* Supress all exceptions. */
717 /* Mask register operand. */
719 /* Mask register operand. */
787 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
789 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
790 #define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
791 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
792 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
793 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
794 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
795 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
796 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
797 #define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
798 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
799 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
800 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
801 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
802 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
803 #define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
804 #define EVEX_LEN_TABLE(I) DIS386 (USE_EVEX_LEN_TABLE, (I))
831 REG_0F3A0F_PREFIX_1_MOD_3
,
844 REG_VEX_0F3849_X86_64_P_0_W_0_M_1
,
849 REG_XOP_09_12_M_1_L_0
,
855 REG_EVEX_0F38C6_M_0_L_2
,
856 REG_EVEX_0F38C7_M_0_L_2
937 MOD_VEX_0F12_PREFIX_0
,
938 MOD_VEX_0F12_PREFIX_2
,
940 MOD_VEX_0F16_PREFIX_0
,
941 MOD_VEX_0F16_PREFIX_2
,
965 MOD_VEX_0FF0_PREFIX_3
,
972 MOD_VEX_0F3849_X86_64_P_0_W_0
,
973 MOD_VEX_0F3849_X86_64_P_2_W_0
,
974 MOD_VEX_0F3849_X86_64_P_3_W_0
,
975 MOD_VEX_0F384B_X86_64_P_1_W_0
,
976 MOD_VEX_0F384B_X86_64_P_2_W_0
,
977 MOD_VEX_0F384B_X86_64_P_3_W_0
,
979 MOD_VEX_0F385C_X86_64_P_1_W_0
,
980 MOD_VEX_0F385C_X86_64_P_3_W_0
,
981 MOD_VEX_0F385E_X86_64_P_0_W_0
,
982 MOD_VEX_0F385E_X86_64_P_1_W_0
,
983 MOD_VEX_0F385E_X86_64_P_2_W_0
,
984 MOD_VEX_0F385E_X86_64_P_3_W_0
,
985 MOD_VEX_0F386C_X86_64_W_0
,
998 MOD_EVEX_0F382A_P_1_W_1
,
1000 MOD_EVEX_0F383A_P_1_W_0
,
1003 MOD_EVEX_0F387A_W_0
,
1004 MOD_EVEX_0F387B_W_0
,
1018 RM_0F01_REG_5_MOD_3
,
1019 RM_0F01_REG_7_MOD_3
,
1020 RM_0F1E_P_1_MOD_3_REG_7
,
1021 RM_0FAE_REG_6_MOD_3_P_0
,
1022 RM_0FAE_REG_7_MOD_3
,
1023 RM_0F3A0F_P_1_MOD_3_REG_0
,
1025 RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0
1031 PREFIX_0F01_REG_0_MOD_3_RM_6
,
1032 PREFIX_0F01_REG_1_RM_4
,
1033 PREFIX_0F01_REG_1_RM_5
,
1034 PREFIX_0F01_REG_1_RM_6
,
1035 PREFIX_0F01_REG_1_RM_7
,
1036 PREFIX_0F01_REG_3_RM_1
,
1037 PREFIX_0F01_REG_5_MOD_0
,
1038 PREFIX_0F01_REG_5_MOD_3_RM_0
,
1039 PREFIX_0F01_REG_5_MOD_3_RM_1
,
1040 PREFIX_0F01_REG_5_MOD_3_RM_2
,
1041 PREFIX_0F01_REG_5_MOD_3_RM_4
,
1042 PREFIX_0F01_REG_5_MOD_3_RM_5
,
1043 PREFIX_0F01_REG_5_MOD_3_RM_6
,
1044 PREFIX_0F01_REG_5_MOD_3_RM_7
,
1045 PREFIX_0F01_REG_7_MOD_3_RM_2
,
1046 PREFIX_0F01_REG_7_MOD_3_RM_5
,
1047 PREFIX_0F01_REG_7_MOD_3_RM_6
,
1048 PREFIX_0F01_REG_7_MOD_3_RM_7
,
1054 PREFIX_0F18_REG_6_MOD_0_X86_64
,
1055 PREFIX_0F18_REG_7_MOD_0_X86_64
,
1088 PREFIX_0FAE_REG_0_MOD_3
,
1089 PREFIX_0FAE_REG_1_MOD_3
,
1090 PREFIX_0FAE_REG_2_MOD_3
,
1091 PREFIX_0FAE_REG_3_MOD_3
,
1092 PREFIX_0FAE_REG_4_MOD_0
,
1093 PREFIX_0FAE_REG_4_MOD_3
,
1094 PREFIX_0FAE_REG_5_MOD_3
,
1095 PREFIX_0FAE_REG_6_MOD_0
,
1096 PREFIX_0FAE_REG_6_MOD_3
,
1097 PREFIX_0FAE_REG_7_MOD_0
,
1102 PREFIX_0FC7_REG_6_MOD_0
,
1103 PREFIX_0FC7_REG_6_MOD_3
,
1104 PREFIX_0FC7_REG_7_MOD_3
,
1133 PREFIX_VEX_0F41_L_1_M_1_W_0
,
1134 PREFIX_VEX_0F41_L_1_M_1_W_1
,
1135 PREFIX_VEX_0F42_L_1_M_1_W_0
,
1136 PREFIX_VEX_0F42_L_1_M_1_W_1
,
1137 PREFIX_VEX_0F44_L_0_M_1_W_0
,
1138 PREFIX_VEX_0F44_L_0_M_1_W_1
,
1139 PREFIX_VEX_0F45_L_1_M_1_W_0
,
1140 PREFIX_VEX_0F45_L_1_M_1_W_1
,
1141 PREFIX_VEX_0F46_L_1_M_1_W_0
,
1142 PREFIX_VEX_0F46_L_1_M_1_W_1
,
1143 PREFIX_VEX_0F47_L_1_M_1_W_0
,
1144 PREFIX_VEX_0F47_L_1_M_1_W_1
,
1145 PREFIX_VEX_0F4A_L_1_M_1_W_0
,
1146 PREFIX_VEX_0F4A_L_1_M_1_W_1
,
1147 PREFIX_VEX_0F4B_L_1_M_1_W_0
,
1148 PREFIX_VEX_0F4B_L_1_M_1_W_1
,
1166 PREFIX_VEX_0F90_L_0_W_0
,
1167 PREFIX_VEX_0F90_L_0_W_1
,
1168 PREFIX_VEX_0F91_L_0_M_0_W_0
,
1169 PREFIX_VEX_0F91_L_0_M_0_W_1
,
1170 PREFIX_VEX_0F92_L_0_M_1_W_0
,
1171 PREFIX_VEX_0F92_L_0_M_1_W_1
,
1172 PREFIX_VEX_0F93_L_0_M_1_W_0
,
1173 PREFIX_VEX_0F93_L_0_M_1_W_1
,
1174 PREFIX_VEX_0F98_L_0_M_1_W_0
,
1175 PREFIX_VEX_0F98_L_0_M_1_W_1
,
1176 PREFIX_VEX_0F99_L_0_M_1_W_0
,
1177 PREFIX_VEX_0F99_L_0_M_1_W_1
,
1182 PREFIX_VEX_0F3849_X86_64
,
1183 PREFIX_VEX_0F384B_X86_64
,
1184 PREFIX_VEX_0F3850_W_0
,
1185 PREFIX_VEX_0F3851_W_0
,
1186 PREFIX_VEX_0F385C_X86_64
,
1187 PREFIX_VEX_0F385E_X86_64
,
1188 PREFIX_VEX_0F386C_X86_64_W_0_M_1_L_0
,
1190 PREFIX_VEX_0F38B0_W_0
,
1191 PREFIX_VEX_0F38B1_W_0
,
1192 PREFIX_VEX_0F38F5_L_0
,
1193 PREFIX_VEX_0F38F6_L_0
,
1194 PREFIX_VEX_0F38F7_L_0
,
1195 PREFIX_VEX_0F3AF0_L_0
,
1253 PREFIX_EVEX_MAP5_10
,
1254 PREFIX_EVEX_MAP5_11
,
1255 PREFIX_EVEX_MAP5_1D
,
1256 PREFIX_EVEX_MAP5_2A
,
1257 PREFIX_EVEX_MAP5_2C
,
1258 PREFIX_EVEX_MAP5_2D
,
1259 PREFIX_EVEX_MAP5_2E
,
1260 PREFIX_EVEX_MAP5_2F
,
1261 PREFIX_EVEX_MAP5_51
,
1262 PREFIX_EVEX_MAP5_58
,
1263 PREFIX_EVEX_MAP5_59
,
1264 PREFIX_EVEX_MAP5_5A
,
1265 PREFIX_EVEX_MAP5_5B
,
1266 PREFIX_EVEX_MAP5_5C
,
1267 PREFIX_EVEX_MAP5_5D
,
1268 PREFIX_EVEX_MAP5_5E
,
1269 PREFIX_EVEX_MAP5_5F
,
1270 PREFIX_EVEX_MAP5_78
,
1271 PREFIX_EVEX_MAP5_79
,
1272 PREFIX_EVEX_MAP5_7A
,
1273 PREFIX_EVEX_MAP5_7B
,
1274 PREFIX_EVEX_MAP5_7C
,
1275 PREFIX_EVEX_MAP5_7D
,
1277 PREFIX_EVEX_MAP6_13
,
1278 PREFIX_EVEX_MAP6_56
,
1279 PREFIX_EVEX_MAP6_57
,
1280 PREFIX_EVEX_MAP6_D6
,
1281 PREFIX_EVEX_MAP6_D7
,
1316 X86_64_0F01_REG_0_MOD_3_RM_6_P_1
,
1317 X86_64_0F01_REG_0_MOD_3_RM_6_P_3
,
1319 X86_64_0F01_REG_1_RM_5_PREFIX_2
,
1320 X86_64_0F01_REG_1_RM_6_PREFIX_2
,
1321 X86_64_0F01_REG_1_RM_7_PREFIX_2
,
1324 X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
,
1325 X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
,
1326 X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
,
1327 X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
,
1328 X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1
,
1329 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
,
1330 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
,
1331 X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
,
1332 X86_64_0F18_REG_6_MOD_0
,
1333 X86_64_0F18_REG_7_MOD_0
,
1336 X86_64_0FC7_REG_6_MOD_3_PREFIX_1
,
1363 THREE_BYTE_0F38
= 0,
1392 VEX_LEN_0F12_P_0_M_0
= 0,
1393 VEX_LEN_0F12_P_0_M_1
,
1394 #define VEX_LEN_0F12_P_2_M_0 VEX_LEN_0F12_P_0_M_0
1396 VEX_LEN_0F16_P_0_M_0
,
1397 VEX_LEN_0F16_P_0_M_1
,
1398 #define VEX_LEN_0F16_P_2_M_0 VEX_LEN_0F16_P_0_M_0
1418 VEX_LEN_0FAE_R_2_M_0
,
1419 VEX_LEN_0FAE_R_3_M_0
,
1429 VEX_LEN_0F3849_X86_64_P_0_W_0_M_0
,
1430 VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0
,
1431 VEX_LEN_0F3849_X86_64_P_2_W_0_M_0
,
1432 VEX_LEN_0F3849_X86_64_P_3_W_0_M_0
,
1433 VEX_LEN_0F384B_X86_64_P_1_W_0_M_0
,
1434 VEX_LEN_0F384B_X86_64_P_2_W_0_M_0
,
1435 VEX_LEN_0F384B_X86_64_P_3_W_0_M_0
,
1437 VEX_LEN_0F385C_X86_64_P_1_W_0_M_0
,
1438 VEX_LEN_0F385C_X86_64_P_3_W_0_M_0
,
1439 VEX_LEN_0F385E_X86_64_P_0_W_0_M_0
,
1440 VEX_LEN_0F385E_X86_64_P_1_W_0_M_0
,
1441 VEX_LEN_0F385E_X86_64_P_2_W_0_M_0
,
1442 VEX_LEN_0F385E_X86_64_P_3_W_0_M_0
,
1443 VEX_LEN_0F386C_X86_64_W_0_M_1
,
1476 VEX_LEN_0FXOP_08_85
,
1477 VEX_LEN_0FXOP_08_86
,
1478 VEX_LEN_0FXOP_08_87
,
1479 VEX_LEN_0FXOP_08_8E
,
1480 VEX_LEN_0FXOP_08_8F
,
1481 VEX_LEN_0FXOP_08_95
,
1482 VEX_LEN_0FXOP_08_96
,
1483 VEX_LEN_0FXOP_08_97
,
1484 VEX_LEN_0FXOP_08_9E
,
1485 VEX_LEN_0FXOP_08_9F
,
1486 VEX_LEN_0FXOP_08_A3
,
1487 VEX_LEN_0FXOP_08_A6
,
1488 VEX_LEN_0FXOP_08_B6
,
1489 VEX_LEN_0FXOP_08_C0
,
1490 VEX_LEN_0FXOP_08_C1
,
1491 VEX_LEN_0FXOP_08_C2
,
1492 VEX_LEN_0FXOP_08_C3
,
1493 VEX_LEN_0FXOP_08_CC
,
1494 VEX_LEN_0FXOP_08_CD
,
1495 VEX_LEN_0FXOP_08_CE
,
1496 VEX_LEN_0FXOP_08_CF
,
1497 VEX_LEN_0FXOP_08_EC
,
1498 VEX_LEN_0FXOP_08_ED
,
1499 VEX_LEN_0FXOP_08_EE
,
1500 VEX_LEN_0FXOP_08_EF
,
1501 VEX_LEN_0FXOP_09_01
,
1502 VEX_LEN_0FXOP_09_02
,
1503 VEX_LEN_0FXOP_09_12_M_1
,
1504 VEX_LEN_0FXOP_09_82_W_0
,
1505 VEX_LEN_0FXOP_09_83_W_0
,
1506 VEX_LEN_0FXOP_09_90
,
1507 VEX_LEN_0FXOP_09_91
,
1508 VEX_LEN_0FXOP_09_92
,
1509 VEX_LEN_0FXOP_09_93
,
1510 VEX_LEN_0FXOP_09_94
,
1511 VEX_LEN_0FXOP_09_95
,
1512 VEX_LEN_0FXOP_09_96
,
1513 VEX_LEN_0FXOP_09_97
,
1514 VEX_LEN_0FXOP_09_98
,
1515 VEX_LEN_0FXOP_09_99
,
1516 VEX_LEN_0FXOP_09_9A
,
1517 VEX_LEN_0FXOP_09_9B
,
1518 VEX_LEN_0FXOP_09_C1
,
1519 VEX_LEN_0FXOP_09_C2
,
1520 VEX_LEN_0FXOP_09_C3
,
1521 VEX_LEN_0FXOP_09_C6
,
1522 VEX_LEN_0FXOP_09_C7
,
1523 VEX_LEN_0FXOP_09_CB
,
1524 VEX_LEN_0FXOP_09_D1
,
1525 VEX_LEN_0FXOP_09_D2
,
1526 VEX_LEN_0FXOP_09_D3
,
1527 VEX_LEN_0FXOP_09_D6
,
1528 VEX_LEN_0FXOP_09_D7
,
1529 VEX_LEN_0FXOP_09_DB
,
1530 VEX_LEN_0FXOP_09_E1
,
1531 VEX_LEN_0FXOP_09_E2
,
1532 VEX_LEN_0FXOP_09_E3
,
1533 VEX_LEN_0FXOP_0A_12
,
1538 EVEX_LEN_0F3816
= 0,
1540 EVEX_LEN_0F381A_M_0
,
1541 EVEX_LEN_0F381B_M_0
,
1543 EVEX_LEN_0F385A_M_0
,
1544 EVEX_LEN_0F385B_M_0
,
1545 EVEX_LEN_0F38C6_M_0
,
1546 EVEX_LEN_0F38C7_M_0
,
1563 VEX_W_0F41_L_1_M_1
= 0,
1585 VEX_W_0F381A_M_0_L_1
,
1592 VEX_W_0F3849_X86_64_P_0
,
1593 VEX_W_0F3849_X86_64_P_2
,
1594 VEX_W_0F3849_X86_64_P_3
,
1595 VEX_W_0F384B_X86_64_P_1
,
1596 VEX_W_0F384B_X86_64_P_2
,
1597 VEX_W_0F384B_X86_64_P_3
,
1604 VEX_W_0F385A_M_0_L_0
,
1605 VEX_W_0F385C_X86_64_P_1
,
1606 VEX_W_0F385C_X86_64_P_3
,
1607 VEX_W_0F385E_X86_64_P_0
,
1608 VEX_W_0F385E_X86_64_P_1
,
1609 VEX_W_0F385E_X86_64_P_2
,
1610 VEX_W_0F385E_X86_64_P_3
,
1611 VEX_W_0F386C_X86_64
,
1638 VEX_W_0FXOP_08_85_L_0
,
1639 VEX_W_0FXOP_08_86_L_0
,
1640 VEX_W_0FXOP_08_87_L_0
,
1641 VEX_W_0FXOP_08_8E_L_0
,
1642 VEX_W_0FXOP_08_8F_L_0
,
1643 VEX_W_0FXOP_08_95_L_0
,
1644 VEX_W_0FXOP_08_96_L_0
,
1645 VEX_W_0FXOP_08_97_L_0
,
1646 VEX_W_0FXOP_08_9E_L_0
,
1647 VEX_W_0FXOP_08_9F_L_0
,
1648 VEX_W_0FXOP_08_A6_L_0
,
1649 VEX_W_0FXOP_08_B6_L_0
,
1650 VEX_W_0FXOP_08_C0_L_0
,
1651 VEX_W_0FXOP_08_C1_L_0
,
1652 VEX_W_0FXOP_08_C2_L_0
,
1653 VEX_W_0FXOP_08_C3_L_0
,
1654 VEX_W_0FXOP_08_CC_L_0
,
1655 VEX_W_0FXOP_08_CD_L_0
,
1656 VEX_W_0FXOP_08_CE_L_0
,
1657 VEX_W_0FXOP_08_CF_L_0
,
1658 VEX_W_0FXOP_08_EC_L_0
,
1659 VEX_W_0FXOP_08_ED_L_0
,
1660 VEX_W_0FXOP_08_EE_L_0
,
1661 VEX_W_0FXOP_08_EF_L_0
,
1667 VEX_W_0FXOP_09_C1_L_0
,
1668 VEX_W_0FXOP_09_C2_L_0
,
1669 VEX_W_0FXOP_09_C3_L_0
,
1670 VEX_W_0FXOP_09_C6_L_0
,
1671 VEX_W_0FXOP_09_C7_L_0
,
1672 VEX_W_0FXOP_09_CB_L_0
,
1673 VEX_W_0FXOP_09_D1_L_0
,
1674 VEX_W_0FXOP_09_D2_L_0
,
1675 VEX_W_0FXOP_09_D3_L_0
,
1676 VEX_W_0FXOP_09_D6_L_0
,
1677 VEX_W_0FXOP_09_D7_L_0
,
1678 VEX_W_0FXOP_09_DB_L_0
,
1679 VEX_W_0FXOP_09_E1_L_0
,
1680 VEX_W_0FXOP_09_E2_L_0
,
1681 VEX_W_0FXOP_09_E3_L_0
,
1734 EVEX_W_0F381A_M_0_L_n
,
1735 EVEX_W_0F381B_M_0_L_2
,
1760 EVEX_W_0F385A_M_0_L_n
,
1761 EVEX_W_0F385B_M_0_L_2
,
1787 typedef bool (*op_rtn
) (instr_info
*ins
, int bytemode
, int sizeflag
);
1796 unsigned int prefix_requirement
;
1799 /* Upper case letters in the instruction names here are macros.
1800 'A' => print 'b' if no register operands or suffix_always is true
1801 'B' => print 'b' if suffix_always is true
1802 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
1804 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
1805 suffix_always is true
1806 'E' => print 'e' if 32-bit form of jcxz
1807 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
1808 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
1809 'H' => print ",pt" or ",pn" branch hint
1812 'K' => print 'd' or 'q' if rex prefix is present.
1814 'M' => print 'r' if intel_mnemonic is false.
1815 'N' => print 'n' if instruction has no wait "prefix"
1816 'O' => print 'd' or 'o' (or 'q' in Intel mode)
1817 'P' => behave as 'T' except with register operand outside of suffix_always
1819 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
1821 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
1822 'S' => print 'w', 'l' or 'q' if suffix_always is true
1823 'T' => print 'w', 'l'/'d', or 'q' if instruction has an operand size
1824 prefix or if suffix_always is true.
1827 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
1828 'X' => print 's', 'd' depending on data16 prefix (for XMM)
1830 'Z' => print 'q' in 64bit mode and 'l' otherwise, if suffix_always is true.
1831 '!' => change condition from true to false or from false to true.
1832 '%' => add 1 upper case letter to the macro.
1833 '^' => print 'w', 'l', or 'q' (Intel64 ISA only) depending on operand size
1834 prefix or suffix_always is true (lcall/ljmp).
1835 '@' => in 64bit mode for Intel64 ISA or if instruction
1836 has no operand sizing prefix, print 'q' if suffix_always is true or
1837 nothing otherwise; behave as 'P' in all other cases
1839 2 upper case letter macros:
1840 "XY" => print 'x' or 'y' if suffix_always is true or no register
1841 operands and no broadcast.
1842 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
1843 register operands and no broadcast.
1844 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
1845 "XD" => print 'd' if !EVEX or EVEX.W=1, EVEX.W=0 is not a valid encoding
1846 "XH" => print 'h' if EVEX.W=0, EVEX.W=1 is not a valid encoding (for FP16)
1847 "XS" => print 's' if !EVEX or EVEX.W=0, EVEX.W=1 is not a valid encoding
1848 "XV" => print "{vex} " pseudo prefix
1849 "XE" => print "{evex} " pseudo prefix if no EVEX-specific functionality is
1850 is used by an EVEX-encoded (AVX512VL) instruction.
1851 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond
1852 being false, or no operand at all in 64bit mode, or if suffix_always
1854 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
1855 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
1856 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
1857 "DQ" => print 'd' or 'q' depending on the VEX.W bit
1858 "BW" => print 'b' or 'w' depending on the VEX.W bit
1859 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
1860 an operand size prefix, or suffix_always is true. print
1861 'q' if rex prefix is present.
1863 Many of the above letters print nothing in Intel mode. See "putop"
1866 Braces '{' and '}', and vertical bars '|', indicate alternative
1867 mnemonic strings for AT&T and Intel. */
1869 static const struct dis386 dis386
[] = {
1871 { "addB", { Ebh1
, Gb
}, 0 },
1872 { "addS", { Evh1
, Gv
}, 0 },
1873 { "addB", { Gb
, EbS
}, 0 },
1874 { "addS", { Gv
, EvS
}, 0 },
1875 { "addB", { AL
, Ib
}, 0 },
1876 { "addS", { eAX
, Iv
}, 0 },
1877 { X86_64_TABLE (X86_64_06
) },
1878 { X86_64_TABLE (X86_64_07
) },
1880 { "orB", { Ebh1
, Gb
}, 0 },
1881 { "orS", { Evh1
, Gv
}, 0 },
1882 { "orB", { Gb
, EbS
}, 0 },
1883 { "orS", { Gv
, EvS
}, 0 },
1884 { "orB", { AL
, Ib
}, 0 },
1885 { "orS", { eAX
, Iv
}, 0 },
1886 { X86_64_TABLE (X86_64_0E
) },
1887 { Bad_Opcode
}, /* 0x0f extended opcode escape */
1889 { "adcB", { Ebh1
, Gb
}, 0 },
1890 { "adcS", { Evh1
, Gv
}, 0 },
1891 { "adcB", { Gb
, EbS
}, 0 },
1892 { "adcS", { Gv
, EvS
}, 0 },
1893 { "adcB", { AL
, Ib
}, 0 },
1894 { "adcS", { eAX
, Iv
}, 0 },
1895 { X86_64_TABLE (X86_64_16
) },
1896 { X86_64_TABLE (X86_64_17
) },
1898 { "sbbB", { Ebh1
, Gb
}, 0 },
1899 { "sbbS", { Evh1
, Gv
}, 0 },
1900 { "sbbB", { Gb
, EbS
}, 0 },
1901 { "sbbS", { Gv
, EvS
}, 0 },
1902 { "sbbB", { AL
, Ib
}, 0 },
1903 { "sbbS", { eAX
, Iv
}, 0 },
1904 { X86_64_TABLE (X86_64_1E
) },
1905 { X86_64_TABLE (X86_64_1F
) },
1907 { "andB", { Ebh1
, Gb
}, 0 },
1908 { "andS", { Evh1
, Gv
}, 0 },
1909 { "andB", { Gb
, EbS
}, 0 },
1910 { "andS", { Gv
, EvS
}, 0 },
1911 { "andB", { AL
, Ib
}, 0 },
1912 { "andS", { eAX
, Iv
}, 0 },
1913 { Bad_Opcode
}, /* SEG ES prefix */
1914 { X86_64_TABLE (X86_64_27
) },
1916 { "subB", { Ebh1
, Gb
}, 0 },
1917 { "subS", { Evh1
, Gv
}, 0 },
1918 { "subB", { Gb
, EbS
}, 0 },
1919 { "subS", { Gv
, EvS
}, 0 },
1920 { "subB", { AL
, Ib
}, 0 },
1921 { "subS", { eAX
, Iv
}, 0 },
1922 { Bad_Opcode
}, /* SEG CS prefix */
1923 { X86_64_TABLE (X86_64_2F
) },
1925 { "xorB", { Ebh1
, Gb
}, 0 },
1926 { "xorS", { Evh1
, Gv
}, 0 },
1927 { "xorB", { Gb
, EbS
}, 0 },
1928 { "xorS", { Gv
, EvS
}, 0 },
1929 { "xorB", { AL
, Ib
}, 0 },
1930 { "xorS", { eAX
, Iv
}, 0 },
1931 { Bad_Opcode
}, /* SEG SS prefix */
1932 { X86_64_TABLE (X86_64_37
) },
1934 { "cmpB", { Eb
, Gb
}, 0 },
1935 { "cmpS", { Ev
, Gv
}, 0 },
1936 { "cmpB", { Gb
, EbS
}, 0 },
1937 { "cmpS", { Gv
, EvS
}, 0 },
1938 { "cmpB", { AL
, Ib
}, 0 },
1939 { "cmpS", { eAX
, Iv
}, 0 },
1940 { Bad_Opcode
}, /* SEG DS prefix */
1941 { X86_64_TABLE (X86_64_3F
) },
1943 { "inc{S|}", { RMeAX
}, 0 },
1944 { "inc{S|}", { RMeCX
}, 0 },
1945 { "inc{S|}", { RMeDX
}, 0 },
1946 { "inc{S|}", { RMeBX
}, 0 },
1947 { "inc{S|}", { RMeSP
}, 0 },
1948 { "inc{S|}", { RMeBP
}, 0 },
1949 { "inc{S|}", { RMeSI
}, 0 },
1950 { "inc{S|}", { RMeDI
}, 0 },
1952 { "dec{S|}", { RMeAX
}, 0 },
1953 { "dec{S|}", { RMeCX
}, 0 },
1954 { "dec{S|}", { RMeDX
}, 0 },
1955 { "dec{S|}", { RMeBX
}, 0 },
1956 { "dec{S|}", { RMeSP
}, 0 },
1957 { "dec{S|}", { RMeBP
}, 0 },
1958 { "dec{S|}", { RMeSI
}, 0 },
1959 { "dec{S|}", { RMeDI
}, 0 },
1961 { "push{!P|}", { RMrAX
}, 0 },
1962 { "push{!P|}", { RMrCX
}, 0 },
1963 { "push{!P|}", { RMrDX
}, 0 },
1964 { "push{!P|}", { RMrBX
}, 0 },
1965 { "push{!P|}", { RMrSP
}, 0 },
1966 { "push{!P|}", { RMrBP
}, 0 },
1967 { "push{!P|}", { RMrSI
}, 0 },
1968 { "push{!P|}", { RMrDI
}, 0 },
1970 { "pop{!P|}", { RMrAX
}, 0 },
1971 { "pop{!P|}", { RMrCX
}, 0 },
1972 { "pop{!P|}", { RMrDX
}, 0 },
1973 { "pop{!P|}", { RMrBX
}, 0 },
1974 { "pop{!P|}", { RMrSP
}, 0 },
1975 { "pop{!P|}", { RMrBP
}, 0 },
1976 { "pop{!P|}", { RMrSI
}, 0 },
1977 { "pop{!P|}", { RMrDI
}, 0 },
1979 { X86_64_TABLE (X86_64_60
) },
1980 { X86_64_TABLE (X86_64_61
) },
1981 { X86_64_TABLE (X86_64_62
) },
1982 { X86_64_TABLE (X86_64_63
) },
1983 { Bad_Opcode
}, /* seg fs */
1984 { Bad_Opcode
}, /* seg gs */
1985 { Bad_Opcode
}, /* op size prefix */
1986 { Bad_Opcode
}, /* adr size prefix */
1988 { "pushP", { sIv
}, 0 },
1989 { "imulS", { Gv
, Ev
, Iv
}, 0 },
1990 { "pushP", { sIbT
}, 0 },
1991 { "imulS", { Gv
, Ev
, sIb
}, 0 },
1992 { "ins{b|}", { Ybr
, indirDX
}, 0 },
1993 { X86_64_TABLE (X86_64_6D
) },
1994 { "outs{b|}", { indirDXr
, Xb
}, 0 },
1995 { X86_64_TABLE (X86_64_6F
) },
1997 { "joH", { Jb
, BND
, cond_jump_flag
}, 0 },
1998 { "jnoH", { Jb
, BND
, cond_jump_flag
}, 0 },
1999 { "jbH", { Jb
, BND
, cond_jump_flag
}, 0 },
2000 { "jaeH", { Jb
, BND
, cond_jump_flag
}, 0 },
2001 { "jeH", { Jb
, BND
, cond_jump_flag
}, 0 },
2002 { "jneH", { Jb
, BND
, cond_jump_flag
}, 0 },
2003 { "jbeH", { Jb
, BND
, cond_jump_flag
}, 0 },
2004 { "jaH", { Jb
, BND
, cond_jump_flag
}, 0 },
2006 { "jsH", { Jb
, BND
, cond_jump_flag
}, 0 },
2007 { "jnsH", { Jb
, BND
, cond_jump_flag
}, 0 },
2008 { "jpH", { Jb
, BND
, cond_jump_flag
}, 0 },
2009 { "jnpH", { Jb
, BND
, cond_jump_flag
}, 0 },
2010 { "jlH", { Jb
, BND
, cond_jump_flag
}, 0 },
2011 { "jgeH", { Jb
, BND
, cond_jump_flag
}, 0 },
2012 { "jleH", { Jb
, BND
, cond_jump_flag
}, 0 },
2013 { "jgH", { Jb
, BND
, cond_jump_flag
}, 0 },
2015 { REG_TABLE (REG_80
) },
2016 { REG_TABLE (REG_81
) },
2017 { X86_64_TABLE (X86_64_82
) },
2018 { REG_TABLE (REG_83
) },
2019 { "testB", { Eb
, Gb
}, 0 },
2020 { "testS", { Ev
, Gv
}, 0 },
2021 { "xchgB", { Ebh2
, Gb
}, 0 },
2022 { "xchgS", { Evh2
, Gv
}, 0 },
2024 { "movB", { Ebh3
, Gb
}, 0 },
2025 { "movS", { Evh3
, Gv
}, 0 },
2026 { "movB", { Gb
, EbS
}, 0 },
2027 { "movS", { Gv
, EvS
}, 0 },
2028 { "movD", { Sv
, Sw
}, 0 },
2029 { MOD_TABLE (MOD_8D
) },
2030 { "movD", { Sw
, Sv
}, 0 },
2031 { REG_TABLE (REG_8F
) },
2033 { PREFIX_TABLE (PREFIX_90
) },
2034 { "xchgS", { RMeCX
, eAX
}, 0 },
2035 { "xchgS", { RMeDX
, eAX
}, 0 },
2036 { "xchgS", { RMeBX
, eAX
}, 0 },
2037 { "xchgS", { RMeSP
, eAX
}, 0 },
2038 { "xchgS", { RMeBP
, eAX
}, 0 },
2039 { "xchgS", { RMeSI
, eAX
}, 0 },
2040 { "xchgS", { RMeDI
, eAX
}, 0 },
2042 { "cW{t|}R", { XX
}, 0 },
2043 { "cR{t|}O", { XX
}, 0 },
2044 { X86_64_TABLE (X86_64_9A
) },
2045 { Bad_Opcode
}, /* fwait */
2046 { "pushfP", { XX
}, 0 },
2047 { "popfP", { XX
}, 0 },
2048 { "sahf", { XX
}, 0 },
2049 { "lahf", { XX
}, 0 },
2051 { "mov%LB", { AL
, Ob
}, 0 },
2052 { "mov%LS", { eAX
, Ov
}, 0 },
2053 { "mov%LB", { Ob
, AL
}, 0 },
2054 { "mov%LS", { Ov
, eAX
}, 0 },
2055 { "movs{b|}", { Ybr
, Xb
}, 0 },
2056 { "movs{R|}", { Yvr
, Xv
}, 0 },
2057 { "cmps{b|}", { Xb
, Yb
}, 0 },
2058 { "cmps{R|}", { Xv
, Yv
}, 0 },
2060 { "testB", { AL
, Ib
}, 0 },
2061 { "testS", { eAX
, Iv
}, 0 },
2062 { "stosB", { Ybr
, AL
}, 0 },
2063 { "stosS", { Yvr
, eAX
}, 0 },
2064 { "lodsB", { ALr
, Xb
}, 0 },
2065 { "lodsS", { eAXr
, Xv
}, 0 },
2066 { "scasB", { AL
, Yb
}, 0 },
2067 { "scasS", { eAX
, Yv
}, 0 },
2069 { "movB", { RMAL
, Ib
}, 0 },
2070 { "movB", { RMCL
, Ib
}, 0 },
2071 { "movB", { RMDL
, Ib
}, 0 },
2072 { "movB", { RMBL
, Ib
}, 0 },
2073 { "movB", { RMAH
, Ib
}, 0 },
2074 { "movB", { RMCH
, Ib
}, 0 },
2075 { "movB", { RMDH
, Ib
}, 0 },
2076 { "movB", { RMBH
, Ib
}, 0 },
2078 { "mov%LV", { RMeAX
, Iv64
}, 0 },
2079 { "mov%LV", { RMeCX
, Iv64
}, 0 },
2080 { "mov%LV", { RMeDX
, Iv64
}, 0 },
2081 { "mov%LV", { RMeBX
, Iv64
}, 0 },
2082 { "mov%LV", { RMeSP
, Iv64
}, 0 },
2083 { "mov%LV", { RMeBP
, Iv64
}, 0 },
2084 { "mov%LV", { RMeSI
, Iv64
}, 0 },
2085 { "mov%LV", { RMeDI
, Iv64
}, 0 },
2087 { REG_TABLE (REG_C0
) },
2088 { REG_TABLE (REG_C1
) },
2089 { X86_64_TABLE (X86_64_C2
) },
2090 { X86_64_TABLE (X86_64_C3
) },
2091 { X86_64_TABLE (X86_64_C4
) },
2092 { X86_64_TABLE (X86_64_C5
) },
2093 { REG_TABLE (REG_C6
) },
2094 { REG_TABLE (REG_C7
) },
2096 { "enterP", { Iw
, Ib
}, 0 },
2097 { "leaveP", { XX
}, 0 },
2098 { "{l|}ret{|f}%LP", { Iw
}, 0 },
2099 { "{l|}ret{|f}%LP", { XX
}, 0 },
2100 { "int3", { XX
}, 0 },
2101 { "int", { Ib
}, 0 },
2102 { X86_64_TABLE (X86_64_CE
) },
2103 { "iret%LP", { XX
}, 0 },
2105 { REG_TABLE (REG_D0
) },
2106 { REG_TABLE (REG_D1
) },
2107 { REG_TABLE (REG_D2
) },
2108 { REG_TABLE (REG_D3
) },
2109 { X86_64_TABLE (X86_64_D4
) },
2110 { X86_64_TABLE (X86_64_D5
) },
2112 { "xlat", { DSBX
}, 0 },
2123 { "loopneFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2124 { "loopeFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2125 { "loopFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2126 { "jEcxzH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2127 { "inB", { AL
, Ib
}, 0 },
2128 { "inG", { zAX
, Ib
}, 0 },
2129 { "outB", { Ib
, AL
}, 0 },
2130 { "outG", { Ib
, zAX
}, 0 },
2132 { X86_64_TABLE (X86_64_E8
) },
2133 { X86_64_TABLE (X86_64_E9
) },
2134 { X86_64_TABLE (X86_64_EA
) },
2135 { "jmp", { Jb
, BND
}, 0 },
2136 { "inB", { AL
, indirDX
}, 0 },
2137 { "inG", { zAX
, indirDX
}, 0 },
2138 { "outB", { indirDX
, AL
}, 0 },
2139 { "outG", { indirDX
, zAX
}, 0 },
2141 { Bad_Opcode
}, /* lock prefix */
2142 { "int1", { XX
}, 0 },
2143 { Bad_Opcode
}, /* repne */
2144 { Bad_Opcode
}, /* repz */
2145 { "hlt", { XX
}, 0 },
2146 { "cmc", { XX
}, 0 },
2147 { REG_TABLE (REG_F6
) },
2148 { REG_TABLE (REG_F7
) },
2150 { "clc", { XX
}, 0 },
2151 { "stc", { XX
}, 0 },
2152 { "cli", { XX
}, 0 },
2153 { "sti", { XX
}, 0 },
2154 { "cld", { XX
}, 0 },
2155 { "std", { XX
}, 0 },
2156 { REG_TABLE (REG_FE
) },
2157 { REG_TABLE (REG_FF
) },
2160 static const struct dis386 dis386_twobyte
[] = {
2162 { REG_TABLE (REG_0F00
) },
2163 { REG_TABLE (REG_0F01
) },
2164 { MOD_TABLE (MOD_0F02
) },
2165 { MOD_TABLE (MOD_0F03
) },
2167 { "syscall", { XX
}, 0 },
2168 { "clts", { XX
}, 0 },
2169 { "sysret%LQ", { XX
}, 0 },
2171 { "invd", { XX
}, 0 },
2172 { PREFIX_TABLE (PREFIX_0F09
) },
2174 { "ud2", { XX
}, 0 },
2176 { REG_TABLE (REG_0F0D
) },
2177 { "femms", { XX
}, 0 },
2178 { "", { MX
, EM
, OPSUF
}, 0 }, /* See OP_3DNowSuffix. */
2180 { PREFIX_TABLE (PREFIX_0F10
) },
2181 { PREFIX_TABLE (PREFIX_0F11
) },
2182 { PREFIX_TABLE (PREFIX_0F12
) },
2183 { MOD_TABLE (MOD_0F13
) },
2184 { "unpcklpX", { XM
, EXx
}, PREFIX_OPCODE
},
2185 { "unpckhpX", { XM
, EXx
}, PREFIX_OPCODE
},
2186 { PREFIX_TABLE (PREFIX_0F16
) },
2187 { MOD_TABLE (MOD_0F17
) },
2189 { REG_TABLE (REG_0F18
) },
2190 { "nopQ", { Ev
}, 0 },
2191 { PREFIX_TABLE (PREFIX_0F1A
) },
2192 { PREFIX_TABLE (PREFIX_0F1B
) },
2193 { PREFIX_TABLE (PREFIX_0F1C
) },
2194 { "nopQ", { Ev
}, 0 },
2195 { PREFIX_TABLE (PREFIX_0F1E
) },
2196 { "nopQ", { Ev
}, 0 },
2198 { "movZ", { Em
, Cm
}, 0 },
2199 { "movZ", { Em
, Dm
}, 0 },
2200 { "movZ", { Cm
, Em
}, 0 },
2201 { "movZ", { Dm
, Em
}, 0 },
2202 { X86_64_TABLE (X86_64_0F24
) },
2204 { X86_64_TABLE (X86_64_0F26
) },
2207 { "movapX", { XM
, EXx
}, PREFIX_OPCODE
},
2208 { "movapX", { EXxS
, XM
}, PREFIX_OPCODE
},
2209 { PREFIX_TABLE (PREFIX_0F2A
) },
2210 { PREFIX_TABLE (PREFIX_0F2B
) },
2211 { PREFIX_TABLE (PREFIX_0F2C
) },
2212 { PREFIX_TABLE (PREFIX_0F2D
) },
2213 { PREFIX_TABLE (PREFIX_0F2E
) },
2214 { PREFIX_TABLE (PREFIX_0F2F
) },
2216 { "wrmsr", { XX
}, 0 },
2217 { "rdtsc", { XX
}, 0 },
2218 { "rdmsr", { XX
}, 0 },
2219 { "rdpmc", { XX
}, 0 },
2220 { "sysenter", { SEP
}, 0 },
2221 { "sysexit%LQ", { SEP
}, 0 },
2223 { "getsec", { XX
}, 0 },
2225 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38
, PREFIX_OPCODE
) },
2227 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A
, PREFIX_OPCODE
) },
2234 { "cmovoS", { Gv
, Ev
}, 0 },
2235 { "cmovnoS", { Gv
, Ev
}, 0 },
2236 { "cmovbS", { Gv
, Ev
}, 0 },
2237 { "cmovaeS", { Gv
, Ev
}, 0 },
2238 { "cmoveS", { Gv
, Ev
}, 0 },
2239 { "cmovneS", { Gv
, Ev
}, 0 },
2240 { "cmovbeS", { Gv
, Ev
}, 0 },
2241 { "cmovaS", { Gv
, Ev
}, 0 },
2243 { "cmovsS", { Gv
, Ev
}, 0 },
2244 { "cmovnsS", { Gv
, Ev
}, 0 },
2245 { "cmovpS", { Gv
, Ev
}, 0 },
2246 { "cmovnpS", { Gv
, Ev
}, 0 },
2247 { "cmovlS", { Gv
, Ev
}, 0 },
2248 { "cmovgeS", { Gv
, Ev
}, 0 },
2249 { "cmovleS", { Gv
, Ev
}, 0 },
2250 { "cmovgS", { Gv
, Ev
}, 0 },
2252 { MOD_TABLE (MOD_0F50
) },
2253 { PREFIX_TABLE (PREFIX_0F51
) },
2254 { PREFIX_TABLE (PREFIX_0F52
) },
2255 { PREFIX_TABLE (PREFIX_0F53
) },
2256 { "andpX", { XM
, EXx
}, PREFIX_OPCODE
},
2257 { "andnpX", { XM
, EXx
}, PREFIX_OPCODE
},
2258 { "orpX", { XM
, EXx
}, PREFIX_OPCODE
},
2259 { "xorpX", { XM
, EXx
}, PREFIX_OPCODE
},
2261 { PREFIX_TABLE (PREFIX_0F58
) },
2262 { PREFIX_TABLE (PREFIX_0F59
) },
2263 { PREFIX_TABLE (PREFIX_0F5A
) },
2264 { PREFIX_TABLE (PREFIX_0F5B
) },
2265 { PREFIX_TABLE (PREFIX_0F5C
) },
2266 { PREFIX_TABLE (PREFIX_0F5D
) },
2267 { PREFIX_TABLE (PREFIX_0F5E
) },
2268 { PREFIX_TABLE (PREFIX_0F5F
) },
2270 { PREFIX_TABLE (PREFIX_0F60
) },
2271 { PREFIX_TABLE (PREFIX_0F61
) },
2272 { PREFIX_TABLE (PREFIX_0F62
) },
2273 { "packsswb", { MX
, EM
}, PREFIX_OPCODE
},
2274 { "pcmpgtb", { MX
, EM
}, PREFIX_OPCODE
},
2275 { "pcmpgtw", { MX
, EM
}, PREFIX_OPCODE
},
2276 { "pcmpgtd", { MX
, EM
}, PREFIX_OPCODE
},
2277 { "packuswb", { MX
, EM
}, PREFIX_OPCODE
},
2279 { "punpckhbw", { MX
, EM
}, PREFIX_OPCODE
},
2280 { "punpckhwd", { MX
, EM
}, PREFIX_OPCODE
},
2281 { "punpckhdq", { MX
, EM
}, PREFIX_OPCODE
},
2282 { "packssdw", { MX
, EM
}, PREFIX_OPCODE
},
2283 { "punpcklqdq", { XM
, EXx
}, PREFIX_DATA
},
2284 { "punpckhqdq", { XM
, EXx
}, PREFIX_DATA
},
2285 { "movK", { MX
, Edq
}, PREFIX_OPCODE
},
2286 { PREFIX_TABLE (PREFIX_0F6F
) },
2288 { PREFIX_TABLE (PREFIX_0F70
) },
2289 { MOD_TABLE (MOD_0F71
) },
2290 { MOD_TABLE (MOD_0F72
) },
2291 { MOD_TABLE (MOD_0F73
) },
2292 { "pcmpeqb", { MX
, EM
}, PREFIX_OPCODE
},
2293 { "pcmpeqw", { MX
, EM
}, PREFIX_OPCODE
},
2294 { "pcmpeqd", { MX
, EM
}, PREFIX_OPCODE
},
2295 { "emms", { XX
}, PREFIX_OPCODE
},
2297 { PREFIX_TABLE (PREFIX_0F78
) },
2298 { PREFIX_TABLE (PREFIX_0F79
) },
2301 { PREFIX_TABLE (PREFIX_0F7C
) },
2302 { PREFIX_TABLE (PREFIX_0F7D
) },
2303 { PREFIX_TABLE (PREFIX_0F7E
) },
2304 { PREFIX_TABLE (PREFIX_0F7F
) },
2306 { "joH", { Jv
, BND
, cond_jump_flag
}, 0 },
2307 { "jnoH", { Jv
, BND
, cond_jump_flag
}, 0 },
2308 { "jbH", { Jv
, BND
, cond_jump_flag
}, 0 },
2309 { "jaeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2310 { "jeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2311 { "jneH", { Jv
, BND
, cond_jump_flag
}, 0 },
2312 { "jbeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2313 { "jaH", { Jv
, BND
, cond_jump_flag
}, 0 },
2315 { "jsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2316 { "jnsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2317 { "jpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2318 { "jnpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2319 { "jlH", { Jv
, BND
, cond_jump_flag
}, 0 },
2320 { "jgeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2321 { "jleH", { Jv
, BND
, cond_jump_flag
}, 0 },
2322 { "jgH", { Jv
, BND
, cond_jump_flag
}, 0 },
2324 { "seto", { Eb
}, 0 },
2325 { "setno", { Eb
}, 0 },
2326 { "setb", { Eb
}, 0 },
2327 { "setae", { Eb
}, 0 },
2328 { "sete", { Eb
}, 0 },
2329 { "setne", { Eb
}, 0 },
2330 { "setbe", { Eb
}, 0 },
2331 { "seta", { Eb
}, 0 },
2333 { "sets", { Eb
}, 0 },
2334 { "setns", { Eb
}, 0 },
2335 { "setp", { Eb
}, 0 },
2336 { "setnp", { Eb
}, 0 },
2337 { "setl", { Eb
}, 0 },
2338 { "setge", { Eb
}, 0 },
2339 { "setle", { Eb
}, 0 },
2340 { "setg", { Eb
}, 0 },
2342 { "pushP", { fs
}, 0 },
2343 { "popP", { fs
}, 0 },
2344 { "cpuid", { XX
}, 0 },
2345 { "btS", { Ev
, Gv
}, 0 },
2346 { "shldS", { Ev
, Gv
, Ib
}, 0 },
2347 { "shldS", { Ev
, Gv
, CL
}, 0 },
2348 { REG_TABLE (REG_0FA6
) },
2349 { REG_TABLE (REG_0FA7
) },
2351 { "pushP", { gs
}, 0 },
2352 { "popP", { gs
}, 0 },
2353 { "rsm", { XX
}, 0 },
2354 { "btsS", { Evh1
, Gv
}, 0 },
2355 { "shrdS", { Ev
, Gv
, Ib
}, 0 },
2356 { "shrdS", { Ev
, Gv
, CL
}, 0 },
2357 { REG_TABLE (REG_0FAE
) },
2358 { "imulS", { Gv
, Ev
}, 0 },
2360 { "cmpxchgB", { Ebh1
, Gb
}, 0 },
2361 { "cmpxchgS", { Evh1
, Gv
}, 0 },
2362 { MOD_TABLE (MOD_0FB2
) },
2363 { "btrS", { Evh1
, Gv
}, 0 },
2364 { MOD_TABLE (MOD_0FB4
) },
2365 { MOD_TABLE (MOD_0FB5
) },
2366 { "movz{bR|x}", { Gv
, Eb
}, 0 },
2367 { "movz{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movzww ! */
2369 { PREFIX_TABLE (PREFIX_0FB8
) },
2370 { "ud1S", { Gv
, Ev
}, 0 },
2371 { REG_TABLE (REG_0FBA
) },
2372 { "btcS", { Evh1
, Gv
}, 0 },
2373 { PREFIX_TABLE (PREFIX_0FBC
) },
2374 { PREFIX_TABLE (PREFIX_0FBD
) },
2375 { "movs{bR|x}", { Gv
, Eb
}, 0 },
2376 { "movs{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movsww ! */
2378 { "xaddB", { Ebh1
, Gb
}, 0 },
2379 { "xaddS", { Evh1
, Gv
}, 0 },
2380 { PREFIX_TABLE (PREFIX_0FC2
) },
2381 { MOD_TABLE (MOD_0FC3
) },
2382 { "pinsrw", { MX
, Edw
, Ib
}, PREFIX_OPCODE
},
2383 { "pextrw", { Gd
, MS
, Ib
}, PREFIX_OPCODE
},
2384 { "shufpX", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
2385 { REG_TABLE (REG_0FC7
) },
2387 { "bswap", { RMeAX
}, 0 },
2388 { "bswap", { RMeCX
}, 0 },
2389 { "bswap", { RMeDX
}, 0 },
2390 { "bswap", { RMeBX
}, 0 },
2391 { "bswap", { RMeSP
}, 0 },
2392 { "bswap", { RMeBP
}, 0 },
2393 { "bswap", { RMeSI
}, 0 },
2394 { "bswap", { RMeDI
}, 0 },
2396 { PREFIX_TABLE (PREFIX_0FD0
) },
2397 { "psrlw", { MX
, EM
}, PREFIX_OPCODE
},
2398 { "psrld", { MX
, EM
}, PREFIX_OPCODE
},
2399 { "psrlq", { MX
, EM
}, PREFIX_OPCODE
},
2400 { "paddq", { MX
, EM
}, PREFIX_OPCODE
},
2401 { "pmullw", { MX
, EM
}, PREFIX_OPCODE
},
2402 { PREFIX_TABLE (PREFIX_0FD6
) },
2403 { MOD_TABLE (MOD_0FD7
) },
2405 { "psubusb", { MX
, EM
}, PREFIX_OPCODE
},
2406 { "psubusw", { MX
, EM
}, PREFIX_OPCODE
},
2407 { "pminub", { MX
, EM
}, PREFIX_OPCODE
},
2408 { "pand", { MX
, EM
}, PREFIX_OPCODE
},
2409 { "paddusb", { MX
, EM
}, PREFIX_OPCODE
},
2410 { "paddusw", { MX
, EM
}, PREFIX_OPCODE
},
2411 { "pmaxub", { MX
, EM
}, PREFIX_OPCODE
},
2412 { "pandn", { MX
, EM
}, PREFIX_OPCODE
},
2414 { "pavgb", { MX
, EM
}, PREFIX_OPCODE
},
2415 { "psraw", { MX
, EM
}, PREFIX_OPCODE
},
2416 { "psrad", { MX
, EM
}, PREFIX_OPCODE
},
2417 { "pavgw", { MX
, EM
}, PREFIX_OPCODE
},
2418 { "pmulhuw", { MX
, EM
}, PREFIX_OPCODE
},
2419 { "pmulhw", { MX
, EM
}, PREFIX_OPCODE
},
2420 { PREFIX_TABLE (PREFIX_0FE6
) },
2421 { PREFIX_TABLE (PREFIX_0FE7
) },
2423 { "psubsb", { MX
, EM
}, PREFIX_OPCODE
},
2424 { "psubsw", { MX
, EM
}, PREFIX_OPCODE
},
2425 { "pminsw", { MX
, EM
}, PREFIX_OPCODE
},
2426 { "por", { MX
, EM
}, PREFIX_OPCODE
},
2427 { "paddsb", { MX
, EM
}, PREFIX_OPCODE
},
2428 { "paddsw", { MX
, EM
}, PREFIX_OPCODE
},
2429 { "pmaxsw", { MX
, EM
}, PREFIX_OPCODE
},
2430 { "pxor", { MX
, EM
}, PREFIX_OPCODE
},
2432 { PREFIX_TABLE (PREFIX_0FF0
) },
2433 { "psllw", { MX
, EM
}, PREFIX_OPCODE
},
2434 { "pslld", { MX
, EM
}, PREFIX_OPCODE
},
2435 { "psllq", { MX
, EM
}, PREFIX_OPCODE
},
2436 { "pmuludq", { MX
, EM
}, PREFIX_OPCODE
},
2437 { "pmaddwd", { MX
, EM
}, PREFIX_OPCODE
},
2438 { "psadbw", { MX
, EM
}, PREFIX_OPCODE
},
2439 { PREFIX_TABLE (PREFIX_0FF7
) },
2441 { "psubb", { MX
, EM
}, PREFIX_OPCODE
},
2442 { "psubw", { MX
, EM
}, PREFIX_OPCODE
},
2443 { "psubd", { MX
, EM
}, PREFIX_OPCODE
},
2444 { "psubq", { MX
, EM
}, PREFIX_OPCODE
},
2445 { "paddb", { MX
, EM
}, PREFIX_OPCODE
},
2446 { "paddw", { MX
, EM
}, PREFIX_OPCODE
},
2447 { "paddd", { MX
, EM
}, PREFIX_OPCODE
},
2448 { "ud0S", { Gv
, Ev
}, 0 },
2451 static const bool onebyte_has_modrm
[256] = {
2452 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2453 /* ------------------------------- */
2454 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2455 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2456 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2457 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2458 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2459 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2460 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2461 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2462 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2463 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2464 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2465 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2466 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2467 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2468 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2469 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2470 /* ------------------------------- */
2471 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2474 static const bool twobyte_has_modrm
[256] = {
2475 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2476 /* ------------------------------- */
2477 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2478 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2479 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2480 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2481 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2482 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2483 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2484 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2485 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2486 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2487 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2488 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
2489 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2490 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2491 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2492 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
2493 /* ------------------------------- */
2494 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2504 /* If we are accessing mod/rm/reg without need_modrm set, then the
2505 values are stale. Hitting this abort likely indicates that you
2506 need to update onebyte_has_modrm or twobyte_has_modrm. */
2507 #define MODRM_CHECK if (!ins->need_modrm) abort ()
2509 static const char intel_index16
[][6] = {
2510 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
2513 static const char att_names64
[][8] = {
2514 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
2515 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
2517 static const char att_names32
[][8] = {
2518 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
2519 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
2521 static const char att_names16
[][8] = {
2522 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
2523 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
2525 static const char att_names8
[][8] = {
2526 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
2528 static const char att_names8rex
[][8] = {
2529 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
2530 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
2532 static const char att_names_seg
[][4] = {
2533 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
2535 static const char att_index64
[] = "%riz";
2536 static const char att_index32
[] = "%eiz";
2537 static const char att_index16
[][8] = {
2538 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
2541 static const char att_names_mm
[][8] = {
2542 "%mm0", "%mm1", "%mm2", "%mm3",
2543 "%mm4", "%mm5", "%mm6", "%mm7"
2546 static const char att_names_bnd
[][8] = {
2547 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
2550 static const char att_names_xmm
[][8] = {
2551 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
2552 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
2553 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
2554 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
2555 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
2556 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
2557 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
2558 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
2561 static const char att_names_ymm
[][8] = {
2562 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
2563 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
2564 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
2565 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
2566 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
2567 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
2568 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
2569 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
2572 static const char att_names_zmm
[][8] = {
2573 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
2574 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
2575 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
2576 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
2577 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
2578 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
2579 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
2580 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
2583 static const char att_names_tmm
[][8] = {
2584 "%tmm0", "%tmm1", "%tmm2", "%tmm3",
2585 "%tmm4", "%tmm5", "%tmm6", "%tmm7"
2588 static const char att_names_mask
[][8] = {
2589 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
2592 static const char *const names_rounding
[] =
2600 static const struct dis386 reg_table
[][8] = {
2603 { "addA", { Ebh1
, Ib
}, 0 },
2604 { "orA", { Ebh1
, Ib
}, 0 },
2605 { "adcA", { Ebh1
, Ib
}, 0 },
2606 { "sbbA", { Ebh1
, Ib
}, 0 },
2607 { "andA", { Ebh1
, Ib
}, 0 },
2608 { "subA", { Ebh1
, Ib
}, 0 },
2609 { "xorA", { Ebh1
, Ib
}, 0 },
2610 { "cmpA", { Eb
, Ib
}, 0 },
2614 { "addQ", { Evh1
, Iv
}, 0 },
2615 { "orQ", { Evh1
, Iv
}, 0 },
2616 { "adcQ", { Evh1
, Iv
}, 0 },
2617 { "sbbQ", { Evh1
, Iv
}, 0 },
2618 { "andQ", { Evh1
, Iv
}, 0 },
2619 { "subQ", { Evh1
, Iv
}, 0 },
2620 { "xorQ", { Evh1
, Iv
}, 0 },
2621 { "cmpQ", { Ev
, Iv
}, 0 },
2625 { "addQ", { Evh1
, sIb
}, 0 },
2626 { "orQ", { Evh1
, sIb
}, 0 },
2627 { "adcQ", { Evh1
, sIb
}, 0 },
2628 { "sbbQ", { Evh1
, sIb
}, 0 },
2629 { "andQ", { Evh1
, sIb
}, 0 },
2630 { "subQ", { Evh1
, sIb
}, 0 },
2631 { "xorQ", { Evh1
, sIb
}, 0 },
2632 { "cmpQ", { Ev
, sIb
}, 0 },
2636 { "pop{P|}", { stackEv
}, 0 },
2637 { XOP_8F_TABLE (XOP_09
) },
2641 { XOP_8F_TABLE (XOP_09
) },
2645 { "rolA", { Eb
, Ib
}, 0 },
2646 { "rorA", { Eb
, Ib
}, 0 },
2647 { "rclA", { Eb
, Ib
}, 0 },
2648 { "rcrA", { Eb
, Ib
}, 0 },
2649 { "shlA", { Eb
, Ib
}, 0 },
2650 { "shrA", { Eb
, Ib
}, 0 },
2651 { "shlA", { Eb
, Ib
}, 0 },
2652 { "sarA", { Eb
, Ib
}, 0 },
2656 { "rolQ", { Ev
, Ib
}, 0 },
2657 { "rorQ", { Ev
, Ib
}, 0 },
2658 { "rclQ", { Ev
, Ib
}, 0 },
2659 { "rcrQ", { Ev
, Ib
}, 0 },
2660 { "shlQ", { Ev
, Ib
}, 0 },
2661 { "shrQ", { Ev
, Ib
}, 0 },
2662 { "shlQ", { Ev
, Ib
}, 0 },
2663 { "sarQ", { Ev
, Ib
}, 0 },
2667 { "movA", { Ebh3
, Ib
}, 0 },
2674 { MOD_TABLE (MOD_C6_REG_7
) },
2678 { "movQ", { Evh3
, Iv
}, 0 },
2685 { MOD_TABLE (MOD_C7_REG_7
) },
2689 { "rolA", { Eb
, I1
}, 0 },
2690 { "rorA", { Eb
, I1
}, 0 },
2691 { "rclA", { Eb
, I1
}, 0 },
2692 { "rcrA", { Eb
, I1
}, 0 },
2693 { "shlA", { Eb
, I1
}, 0 },
2694 { "shrA", { Eb
, I1
}, 0 },
2695 { "shlA", { Eb
, I1
}, 0 },
2696 { "sarA", { Eb
, I1
}, 0 },
2700 { "rolQ", { Ev
, I1
}, 0 },
2701 { "rorQ", { Ev
, I1
}, 0 },
2702 { "rclQ", { Ev
, I1
}, 0 },
2703 { "rcrQ", { Ev
, I1
}, 0 },
2704 { "shlQ", { Ev
, I1
}, 0 },
2705 { "shrQ", { Ev
, I1
}, 0 },
2706 { "shlQ", { Ev
, I1
}, 0 },
2707 { "sarQ", { Ev
, I1
}, 0 },
2711 { "rolA", { Eb
, CL
}, 0 },
2712 { "rorA", { Eb
, CL
}, 0 },
2713 { "rclA", { Eb
, CL
}, 0 },
2714 { "rcrA", { Eb
, CL
}, 0 },
2715 { "shlA", { Eb
, CL
}, 0 },
2716 { "shrA", { Eb
, CL
}, 0 },
2717 { "shlA", { Eb
, CL
}, 0 },
2718 { "sarA", { Eb
, CL
}, 0 },
2722 { "rolQ", { Ev
, CL
}, 0 },
2723 { "rorQ", { Ev
, CL
}, 0 },
2724 { "rclQ", { Ev
, CL
}, 0 },
2725 { "rcrQ", { Ev
, CL
}, 0 },
2726 { "shlQ", { Ev
, CL
}, 0 },
2727 { "shrQ", { Ev
, CL
}, 0 },
2728 { "shlQ", { Ev
, CL
}, 0 },
2729 { "sarQ", { Ev
, CL
}, 0 },
2733 { "testA", { Eb
, Ib
}, 0 },
2734 { "testA", { Eb
, Ib
}, 0 },
2735 { "notA", { Ebh1
}, 0 },
2736 { "negA", { Ebh1
}, 0 },
2737 { "mulA", { Eb
}, 0 }, /* Don't print the implicit %al register, */
2738 { "imulA", { Eb
}, 0 }, /* to distinguish these opcodes from other */
2739 { "divA", { Eb
}, 0 }, /* mul/imul opcodes. Do the same for div */
2740 { "idivA", { Eb
}, 0 }, /* and idiv for consistency. */
2744 { "testQ", { Ev
, Iv
}, 0 },
2745 { "testQ", { Ev
, Iv
}, 0 },
2746 { "notQ", { Evh1
}, 0 },
2747 { "negQ", { Evh1
}, 0 },
2748 { "mulQ", { Ev
}, 0 }, /* Don't print the implicit register. */
2749 { "imulQ", { Ev
}, 0 },
2750 { "divQ", { Ev
}, 0 },
2751 { "idivQ", { Ev
}, 0 },
2755 { "incA", { Ebh1
}, 0 },
2756 { "decA", { Ebh1
}, 0 },
2760 { "incQ", { Evh1
}, 0 },
2761 { "decQ", { Evh1
}, 0 },
2762 { "call{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2763 { MOD_TABLE (MOD_FF_REG_3
) },
2764 { "jmp{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2765 { MOD_TABLE (MOD_FF_REG_5
) },
2766 { "push{P|}", { stackEv
}, 0 },
2771 { "sldtD", { Sv
}, 0 },
2772 { "strD", { Sv
}, 0 },
2773 { "lldt", { Ew
}, 0 },
2774 { "ltr", { Ew
}, 0 },
2775 { "verr", { Ew
}, 0 },
2776 { "verw", { Ew
}, 0 },
2782 { MOD_TABLE (MOD_0F01_REG_0
) },
2783 { MOD_TABLE (MOD_0F01_REG_1
) },
2784 { MOD_TABLE (MOD_0F01_REG_2
) },
2785 { MOD_TABLE (MOD_0F01_REG_3
) },
2786 { "smswD", { Sv
}, 0 },
2787 { MOD_TABLE (MOD_0F01_REG_5
) },
2788 { "lmsw", { Ew
}, 0 },
2789 { MOD_TABLE (MOD_0F01_REG_7
) },
2793 { "prefetch", { Mb
}, 0 },
2794 { "prefetchw", { Mb
}, 0 },
2795 { "prefetchwt1", { Mb
}, 0 },
2796 { "prefetch", { Mb
}, 0 },
2797 { "prefetch", { Mb
}, 0 },
2798 { "prefetch", { Mb
}, 0 },
2799 { "prefetch", { Mb
}, 0 },
2800 { "prefetch", { Mb
}, 0 },
2804 { MOD_TABLE (MOD_0F18_REG_0
) },
2805 { MOD_TABLE (MOD_0F18_REG_1
) },
2806 { MOD_TABLE (MOD_0F18_REG_2
) },
2807 { MOD_TABLE (MOD_0F18_REG_3
) },
2808 { "nopQ", { Ev
}, 0 },
2809 { "nopQ", { Ev
}, 0 },
2810 { MOD_TABLE (MOD_0F18_REG_6
) },
2811 { MOD_TABLE (MOD_0F18_REG_7
) },
2813 /* REG_0F1C_P_0_MOD_0 */
2815 { "cldemote", { Mb
}, 0 },
2816 { "nopQ", { Ev
}, 0 },
2817 { "nopQ", { Ev
}, 0 },
2818 { "nopQ", { Ev
}, 0 },
2819 { "nopQ", { Ev
}, 0 },
2820 { "nopQ", { Ev
}, 0 },
2821 { "nopQ", { Ev
}, 0 },
2822 { "nopQ", { Ev
}, 0 },
2824 /* REG_0F1E_P_1_MOD_3 */
2826 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2827 { "rdsspK", { Edq
}, 0 },
2828 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2829 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2830 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2831 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2832 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2833 { RM_TABLE (RM_0F1E_P_1_MOD_3_REG_7
) },
2835 /* REG_0F38D8_PREFIX_1 */
2837 { "aesencwide128kl", { M
}, 0 },
2838 { "aesdecwide128kl", { M
}, 0 },
2839 { "aesencwide256kl", { M
}, 0 },
2840 { "aesdecwide256kl", { M
}, 0 },
2842 /* REG_0F3A0F_PREFIX_1_MOD_3 */
2844 { RM_TABLE (RM_0F3A0F_P_1_MOD_3_REG_0
) },
2846 /* REG_0F71_MOD_0 */
2850 { "psrlw", { MS
, Ib
}, PREFIX_OPCODE
},
2852 { "psraw", { MS
, Ib
}, PREFIX_OPCODE
},
2854 { "psllw", { MS
, Ib
}, PREFIX_OPCODE
},
2856 /* REG_0F72_MOD_0 */
2860 { "psrld", { MS
, Ib
}, PREFIX_OPCODE
},
2862 { "psrad", { MS
, Ib
}, PREFIX_OPCODE
},
2864 { "pslld", { MS
, Ib
}, PREFIX_OPCODE
},
2866 /* REG_0F73_MOD_0 */
2870 { "psrlq", { MS
, Ib
}, PREFIX_OPCODE
},
2871 { "psrldq", { XS
, Ib
}, PREFIX_DATA
},
2874 { "psllq", { MS
, Ib
}, PREFIX_OPCODE
},
2875 { "pslldq", { XS
, Ib
}, PREFIX_DATA
},
2879 { "montmul", { { OP_0f07
, 0 } }, 0 },
2880 { "xsha1", { { OP_0f07
, 0 } }, 0 },
2881 { "xsha256", { { OP_0f07
, 0 } }, 0 },
2885 { "xstore-rng", { { OP_0f07
, 0 } }, 0 },
2886 { "xcrypt-ecb", { { OP_0f07
, 0 } }, 0 },
2887 { "xcrypt-cbc", { { OP_0f07
, 0 } }, 0 },
2888 { "xcrypt-ctr", { { OP_0f07
, 0 } }, 0 },
2889 { "xcrypt-cfb", { { OP_0f07
, 0 } }, 0 },
2890 { "xcrypt-ofb", { { OP_0f07
, 0 } }, 0 },
2894 { MOD_TABLE (MOD_0FAE_REG_0
) },
2895 { MOD_TABLE (MOD_0FAE_REG_1
) },
2896 { MOD_TABLE (MOD_0FAE_REG_2
) },
2897 { MOD_TABLE (MOD_0FAE_REG_3
) },
2898 { MOD_TABLE (MOD_0FAE_REG_4
) },
2899 { MOD_TABLE (MOD_0FAE_REG_5
) },
2900 { MOD_TABLE (MOD_0FAE_REG_6
) },
2901 { MOD_TABLE (MOD_0FAE_REG_7
) },
2909 { "btQ", { Ev
, Ib
}, 0 },
2910 { "btsQ", { Evh1
, Ib
}, 0 },
2911 { "btrQ", { Evh1
, Ib
}, 0 },
2912 { "btcQ", { Evh1
, Ib
}, 0 },
2917 { "cmpxchg8b", { { CMPXCHG8B_Fixup
, q_mode
} }, 0 },
2919 { MOD_TABLE (MOD_0FC7_REG_3
) },
2920 { MOD_TABLE (MOD_0FC7_REG_4
) },
2921 { MOD_TABLE (MOD_0FC7_REG_5
) },
2922 { MOD_TABLE (MOD_0FC7_REG_6
) },
2923 { MOD_TABLE (MOD_0FC7_REG_7
) },
2925 /* REG_VEX_0F71_M_0 */
2929 { "vpsrlw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2931 { "vpsraw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2933 { "vpsllw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2935 /* REG_VEX_0F72_M_0 */
2939 { "vpsrld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2941 { "vpsrad", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2943 { "vpslld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2945 /* REG_VEX_0F73_M_0 */
2949 { "vpsrlq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2950 { "vpsrldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2953 { "vpsllq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2954 { "vpslldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2960 { MOD_TABLE (MOD_VEX_0FAE_REG_2
) },
2961 { MOD_TABLE (MOD_VEX_0FAE_REG_3
) },
2963 /* REG_VEX_0F3849_X86_64_P_0_W_0_M_1 */
2965 { RM_TABLE (RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0
) },
2967 /* REG_VEX_0F38F3_L_0 */
2970 { "blsrS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2971 { "blsmskS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2972 { "blsiS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2974 /* REG_XOP_09_01_L_0 */
2977 { "blcfill", { VexGdq
, Edq
}, 0 },
2978 { "blsfill", { VexGdq
, Edq
}, 0 },
2979 { "blcs", { VexGdq
, Edq
}, 0 },
2980 { "tzmsk", { VexGdq
, Edq
}, 0 },
2981 { "blcic", { VexGdq
, Edq
}, 0 },
2982 { "blsic", { VexGdq
, Edq
}, 0 },
2983 { "t1mskc", { VexGdq
, Edq
}, 0 },
2985 /* REG_XOP_09_02_L_0 */
2988 { "blcmsk", { VexGdq
, Edq
}, 0 },
2993 { "blci", { VexGdq
, Edq
}, 0 },
2995 /* REG_XOP_09_12_M_1_L_0 */
2997 { "llwpcb", { Edq
}, 0 },
2998 { "slwpcb", { Edq
}, 0 },
3000 /* REG_XOP_0A_12_L_0 */
3002 { "lwpins", { VexGdq
, Ed
, Id
}, 0 },
3003 { "lwpval", { VexGdq
, Ed
, Id
}, 0 },
3006 #include "i386-dis-evex-reg.h"
3009 static const struct dis386 prefix_table
[][4] = {
3012 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
3013 { "pause", { XX
}, 0 },
3014 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
3015 { NULL
, { { NULL
, 0 } }, PREFIX_IGNORED
}
3018 /* PREFIX_0F01_REG_0_MOD_3_RM_6 */
3020 { "wrmsrns", { Skip_MODRM
}, 0 },
3021 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_1
) },
3023 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_3
) },
3026 /* PREFIX_0F01_REG_1_RM_4 */
3030 { "tdcall", { Skip_MODRM
}, 0 },
3034 /* PREFIX_0F01_REG_1_RM_5 */
3038 { X86_64_TABLE (X86_64_0F01_REG_1_RM_5_PREFIX_2
) },
3042 /* PREFIX_0F01_REG_1_RM_6 */
3046 { X86_64_TABLE (X86_64_0F01_REG_1_RM_6_PREFIX_2
) },
3050 /* PREFIX_0F01_REG_1_RM_7 */
3052 { "encls", { Skip_MODRM
}, 0 },
3054 { X86_64_TABLE (X86_64_0F01_REG_1_RM_7_PREFIX_2
) },
3058 /* PREFIX_0F01_REG_3_RM_1 */
3060 { "vmmcall", { Skip_MODRM
}, 0 },
3061 { "vmgexit", { Skip_MODRM
}, 0 },
3063 { "vmgexit", { Skip_MODRM
}, 0 },
3066 /* PREFIX_0F01_REG_5_MOD_0 */
3069 { "rstorssp", { Mq
}, PREFIX_OPCODE
},
3072 /* PREFIX_0F01_REG_5_MOD_3_RM_0 */
3074 { "serialize", { Skip_MODRM
}, PREFIX_OPCODE
},
3075 { "setssbsy", { Skip_MODRM
}, PREFIX_OPCODE
},
3077 { "xsusldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3080 /* PREFIX_0F01_REG_5_MOD_3_RM_1 */
3085 { "xresldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3088 /* PREFIX_0F01_REG_5_MOD_3_RM_2 */
3091 { "saveprevssp", { Skip_MODRM
}, PREFIX_OPCODE
},
3094 /* PREFIX_0F01_REG_5_MOD_3_RM_4 */
3097 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
) },
3100 /* PREFIX_0F01_REG_5_MOD_3_RM_5 */
3103 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
) },
3106 /* PREFIX_0F01_REG_5_MOD_3_RM_6 */
3108 { "rdpkru", { Skip_MODRM
}, 0 },
3109 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
) },
3112 /* PREFIX_0F01_REG_5_MOD_3_RM_7 */
3114 { "wrpkru", { Skip_MODRM
}, 0 },
3115 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
) },
3118 /* PREFIX_0F01_REG_7_MOD_3_RM_2 */
3120 { "monitorx", { { OP_Monitor
, 0 } }, 0 },
3121 { "mcommit", { Skip_MODRM
}, 0 },
3124 /* PREFIX_0F01_REG_7_MOD_3_RM_5 */
3126 { "rdpru", { Skip_MODRM
}, 0 },
3127 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1
) },
3130 /* PREFIX_0F01_REG_7_MOD_3_RM_6 */
3132 { "invlpgb", { Skip_MODRM
}, 0 },
3133 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
) },
3135 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
) },
3138 /* PREFIX_0F01_REG_7_MOD_3_RM_7 */
3140 { "tlbsync", { Skip_MODRM
}, 0 },
3141 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
) },
3143 { "pvalidate", { Skip_MODRM
}, 0 },
3148 { "wbinvd", { XX
}, 0 },
3149 { "wbnoinvd", { XX
}, 0 },
3154 { "movups", { XM
, EXx
}, PREFIX_OPCODE
},
3155 { "movss", { XM
, EXd
}, PREFIX_OPCODE
},
3156 { "movupd", { XM
, EXx
}, PREFIX_OPCODE
},
3157 { "movsd", { XM
, EXq
}, PREFIX_OPCODE
},
3162 { "movups", { EXxS
, XM
}, PREFIX_OPCODE
},
3163 { "movss", { EXdS
, XM
}, PREFIX_OPCODE
},
3164 { "movupd", { EXxS
, XM
}, PREFIX_OPCODE
},
3165 { "movsd", { EXqS
, XM
}, PREFIX_OPCODE
},
3170 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
3171 { "movsldup", { XM
, EXx
}, PREFIX_OPCODE
},
3172 { MOD_TABLE (MOD_0F12_PREFIX_2
) },
3173 { "movddup", { XM
, EXq
}, PREFIX_OPCODE
},
3178 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
3179 { "movshdup", { XM
, EXx
}, PREFIX_OPCODE
},
3180 { MOD_TABLE (MOD_0F16_PREFIX_2
) },
3183 /* PREFIX_0F18_REG_6_MOD_0_X86_64 */
3185 { "prefetchit1", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3186 { "nopQ", { Ev
}, 0 },
3187 { "nopQ", { Ev
}, 0 },
3188 { "nopQ", { Ev
}, 0 },
3191 /* PREFIX_0F18_REG_7_MOD_0_X86_64 */
3193 { "prefetchit0", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3194 { "nopQ", { Ev
}, 0 },
3195 { "nopQ", { Ev
}, 0 },
3196 { "nopQ", { Ev
}, 0 },
3201 { MOD_TABLE (MOD_0F1A_PREFIX_0
) },
3202 { "bndcl", { Gbnd
, Ev_bnd
}, 0 },
3203 { "bndmov", { Gbnd
, Ebnd
}, 0 },
3204 { "bndcu", { Gbnd
, Ev_bnd
}, 0 },
3209 { MOD_TABLE (MOD_0F1B_PREFIX_0
) },
3210 { MOD_TABLE (MOD_0F1B_PREFIX_1
) },
3211 { "bndmov", { EbndS
, Gbnd
}, 0 },
3212 { "bndcn", { Gbnd
, Ev_bnd
}, 0 },
3217 { MOD_TABLE (MOD_0F1C_PREFIX_0
) },
3218 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3219 { "nopQ", { Ev
}, 0 },
3220 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3225 { "nopQ", { Ev
}, 0 },
3226 { MOD_TABLE (MOD_0F1E_PREFIX_1
) },
3227 { "nopQ", { Ev
}, 0 },
3228 { NULL
, { XX
}, PREFIX_IGNORED
},
3233 { "cvtpi2ps", { XM
, EMCq
}, PREFIX_OPCODE
},
3234 { "cvtsi2ss{%LQ|}", { XM
, Edq
}, PREFIX_OPCODE
},
3235 { "cvtpi2pd", { XM
, EMCq
}, PREFIX_OPCODE
},
3236 { "cvtsi2sd{%LQ|}", { XM
, Edq
}, 0 },
3241 { MOD_TABLE (MOD_0F2B_PREFIX_0
) },
3242 { MOD_TABLE (MOD_0F2B_PREFIX_1
) },
3243 { MOD_TABLE (MOD_0F2B_PREFIX_2
) },
3244 { MOD_TABLE (MOD_0F2B_PREFIX_3
) },
3249 { "cvttps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3250 { "cvttss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3251 { "cvttpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3252 { "cvttsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3257 { "cvtps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3258 { "cvtss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3259 { "cvtpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3260 { "cvtsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3265 { "ucomiss",{ XM
, EXd
}, 0 },
3267 { "ucomisd",{ XM
, EXq
}, 0 },
3272 { "comiss", { XM
, EXd
}, 0 },
3274 { "comisd", { XM
, EXq
}, 0 },
3279 { "sqrtps", { XM
, EXx
}, PREFIX_OPCODE
},
3280 { "sqrtss", { XM
, EXd
}, PREFIX_OPCODE
},
3281 { "sqrtpd", { XM
, EXx
}, PREFIX_OPCODE
},
3282 { "sqrtsd", { XM
, EXq
}, PREFIX_OPCODE
},
3287 { "rsqrtps",{ XM
, EXx
}, PREFIX_OPCODE
},
3288 { "rsqrtss",{ XM
, EXd
}, PREFIX_OPCODE
},
3293 { "rcpps", { XM
, EXx
}, PREFIX_OPCODE
},
3294 { "rcpss", { XM
, EXd
}, PREFIX_OPCODE
},
3299 { "addps", { XM
, EXx
}, PREFIX_OPCODE
},
3300 { "addss", { XM
, EXd
}, PREFIX_OPCODE
},
3301 { "addpd", { XM
, EXx
}, PREFIX_OPCODE
},
3302 { "addsd", { XM
, EXq
}, PREFIX_OPCODE
},
3307 { "mulps", { XM
, EXx
}, PREFIX_OPCODE
},
3308 { "mulss", { XM
, EXd
}, PREFIX_OPCODE
},
3309 { "mulpd", { XM
, EXx
}, PREFIX_OPCODE
},
3310 { "mulsd", { XM
, EXq
}, PREFIX_OPCODE
},
3315 { "cvtps2pd", { XM
, EXq
}, PREFIX_OPCODE
},
3316 { "cvtss2sd", { XM
, EXd
}, PREFIX_OPCODE
},
3317 { "cvtpd2ps", { XM
, EXx
}, PREFIX_OPCODE
},
3318 { "cvtsd2ss", { XM
, EXq
}, PREFIX_OPCODE
},
3323 { "cvtdq2ps", { XM
, EXx
}, PREFIX_OPCODE
},
3324 { "cvttps2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3325 { "cvtps2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3330 { "subps", { XM
, EXx
}, PREFIX_OPCODE
},
3331 { "subss", { XM
, EXd
}, PREFIX_OPCODE
},
3332 { "subpd", { XM
, EXx
}, PREFIX_OPCODE
},
3333 { "subsd", { XM
, EXq
}, PREFIX_OPCODE
},
3338 { "minps", { XM
, EXx
}, PREFIX_OPCODE
},
3339 { "minss", { XM
, EXd
}, PREFIX_OPCODE
},
3340 { "minpd", { XM
, EXx
}, PREFIX_OPCODE
},
3341 { "minsd", { XM
, EXq
}, PREFIX_OPCODE
},
3346 { "divps", { XM
, EXx
}, PREFIX_OPCODE
},
3347 { "divss", { XM
, EXd
}, PREFIX_OPCODE
},
3348 { "divpd", { XM
, EXx
}, PREFIX_OPCODE
},
3349 { "divsd", { XM
, EXq
}, PREFIX_OPCODE
},
3354 { "maxps", { XM
, EXx
}, PREFIX_OPCODE
},
3355 { "maxss", { XM
, EXd
}, PREFIX_OPCODE
},
3356 { "maxpd", { XM
, EXx
}, PREFIX_OPCODE
},
3357 { "maxsd", { XM
, EXq
}, PREFIX_OPCODE
},
3362 { "punpcklbw",{ MX
, EMd
}, PREFIX_OPCODE
},
3364 { "punpcklbw",{ MX
, EMx
}, PREFIX_OPCODE
},
3369 { "punpcklwd",{ MX
, EMd
}, PREFIX_OPCODE
},
3371 { "punpcklwd",{ MX
, EMx
}, PREFIX_OPCODE
},
3376 { "punpckldq",{ MX
, EMd
}, PREFIX_OPCODE
},
3378 { "punpckldq",{ MX
, EMx
}, PREFIX_OPCODE
},
3383 { "movq", { MX
, EM
}, PREFIX_OPCODE
},
3384 { "movdqu", { XM
, EXx
}, PREFIX_OPCODE
},
3385 { "movdqa", { XM
, EXx
}, PREFIX_OPCODE
},
3390 { "pshufw", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
3391 { "pshufhw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3392 { "pshufd", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3393 { "pshuflw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3398 {"vmread", { Em
, Gm
}, 0 },
3400 {"extrq", { XS
, Ib
, Ib
}, 0 },
3401 {"insertq", { XM
, XS
, Ib
, Ib
}, 0 },
3406 {"vmwrite", { Gm
, Em
}, 0 },
3408 {"extrq", { XM
, XS
}, 0 },
3409 {"insertq", { XM
, XS
}, 0 },
3416 { "haddpd", { XM
, EXx
}, PREFIX_OPCODE
},
3417 { "haddps", { XM
, EXx
}, PREFIX_OPCODE
},
3424 { "hsubpd", { XM
, EXx
}, PREFIX_OPCODE
},
3425 { "hsubps", { XM
, EXx
}, PREFIX_OPCODE
},
3430 { "movK", { Edq
, MX
}, PREFIX_OPCODE
},
3431 { "movq", { XM
, EXq
}, PREFIX_OPCODE
},
3432 { "movK", { Edq
, XM
}, PREFIX_OPCODE
},
3437 { "movq", { EMS
, MX
}, PREFIX_OPCODE
},
3438 { "movdqu", { EXxS
, XM
}, PREFIX_OPCODE
},
3439 { "movdqa", { EXxS
, XM
}, PREFIX_OPCODE
},
3442 /* PREFIX_0FAE_REG_0_MOD_3 */
3445 { "rdfsbase", { Ev
}, 0 },
3448 /* PREFIX_0FAE_REG_1_MOD_3 */
3451 { "rdgsbase", { Ev
}, 0 },
3454 /* PREFIX_0FAE_REG_2_MOD_3 */
3457 { "wrfsbase", { Ev
}, 0 },
3460 /* PREFIX_0FAE_REG_3_MOD_3 */
3463 { "wrgsbase", { Ev
}, 0 },
3466 /* PREFIX_0FAE_REG_4_MOD_0 */
3468 { "xsave", { FXSAVE
}, 0 },
3469 { "ptwrite{%LQ|}", { Edq
}, 0 },
3472 /* PREFIX_0FAE_REG_4_MOD_3 */
3475 { "ptwrite{%LQ|}", { Edq
}, 0 },
3478 /* PREFIX_0FAE_REG_5_MOD_3 */
3480 { "lfence", { Skip_MODRM
}, 0 },
3481 { "incsspK", { Edq
}, PREFIX_OPCODE
},
3484 /* PREFIX_0FAE_REG_6_MOD_0 */
3486 { "xsaveopt", { FXSAVE
}, PREFIX_OPCODE
},
3487 { "clrssbsy", { Mq
}, PREFIX_OPCODE
},
3488 { "clwb", { Mb
}, PREFIX_OPCODE
},
3491 /* PREFIX_0FAE_REG_6_MOD_3 */
3493 { RM_TABLE (RM_0FAE_REG_6_MOD_3_P_0
) },
3494 { "umonitor", { Eva
}, PREFIX_OPCODE
},
3495 { "tpause", { Edq
}, PREFIX_OPCODE
},
3496 { "umwait", { Edq
}, PREFIX_OPCODE
},
3499 /* PREFIX_0FAE_REG_7_MOD_0 */
3501 { "clflush", { Mb
}, 0 },
3503 { "clflushopt", { Mb
}, 0 },
3509 { "popcntS", { Gv
, Ev
}, 0 },
3514 { "bsfS", { Gv
, Ev
}, 0 },
3515 { "tzcntS", { Gv
, Ev
}, 0 },
3516 { "bsfS", { Gv
, Ev
}, 0 },
3521 { "bsrS", { Gv
, Ev
}, 0 },
3522 { "lzcntS", { Gv
, Ev
}, 0 },
3523 { "bsrS", { Gv
, Ev
}, 0 },
3528 { "cmpps", { XM
, EXx
, CMP
}, PREFIX_OPCODE
},
3529 { "cmpss", { XM
, EXd
, CMP
}, PREFIX_OPCODE
},
3530 { "cmppd", { XM
, EXx
, CMP
}, PREFIX_OPCODE
},
3531 { "cmpsd", { XM
, EXq
, CMP
}, PREFIX_OPCODE
},
3534 /* PREFIX_0FC7_REG_6_MOD_0 */
3536 { "vmptrld",{ Mq
}, 0 },
3537 { "vmxon", { Mq
}, 0 },
3538 { "vmclear",{ Mq
}, 0 },
3541 /* PREFIX_0FC7_REG_6_MOD_3 */
3543 { "rdrand", { Ev
}, 0 },
3544 { X86_64_TABLE (X86_64_0FC7_REG_6_MOD_3_PREFIX_1
) },
3545 { "rdrand", { Ev
}, 0 }
3548 /* PREFIX_0FC7_REG_7_MOD_3 */
3550 { "rdseed", { Ev
}, 0 },
3551 { "rdpid", { Em
}, 0 },
3552 { "rdseed", { Ev
}, 0 },
3559 { "addsubpd", { XM
, EXx
}, 0 },
3560 { "addsubps", { XM
, EXx
}, 0 },
3566 { "movq2dq",{ XM
, MS
}, 0 },
3567 { "movq", { EXqS
, XM
}, 0 },
3568 { "movdq2q",{ MX
, XS
}, 0 },
3574 { "cvtdq2pd", { XM
, EXq
}, PREFIX_OPCODE
},
3575 { "cvttpd2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3576 { "cvtpd2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3581 { "movntq", { Mq
, MX
}, PREFIX_OPCODE
},
3583 { MOD_TABLE (MOD_0FE7_PREFIX_2
) },
3591 { MOD_TABLE (MOD_0FF0_PREFIX_3
) },
3596 { "maskmovq", { MX
, MS
}, PREFIX_OPCODE
},
3598 { "maskmovdqu", { XM
, XS
}, PREFIX_OPCODE
},
3604 { REG_TABLE (REG_0F38D8_PREFIX_1
) },
3610 { MOD_TABLE (MOD_0F38DC_PREFIX_1
) },
3611 { "aesenc", { XM
, EXx
}, 0 },
3617 { MOD_TABLE (MOD_0F38DD_PREFIX_1
) },
3618 { "aesenclast", { XM
, EXx
}, 0 },
3624 { MOD_TABLE (MOD_0F38DE_PREFIX_1
) },
3625 { "aesdec", { XM
, EXx
}, 0 },
3631 { MOD_TABLE (MOD_0F38DF_PREFIX_1
) },
3632 { "aesdeclast", { XM
, EXx
}, 0 },
3637 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3639 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3640 { "crc32A", { Gdq
, Eb
}, PREFIX_OPCODE
},
3645 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3647 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3648 { "crc32Q", { Gdq
, Ev
}, PREFIX_OPCODE
},
3653 { MOD_TABLE (MOD_0F38F6_PREFIX_0
) },
3654 { "adoxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3655 { "adcxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3662 { MOD_TABLE (MOD_0F38F8_PREFIX_1
) },
3663 { MOD_TABLE (MOD_0F38F8_PREFIX_2
) },
3664 { MOD_TABLE (MOD_0F38F8_PREFIX_3
) },
3669 { MOD_TABLE (MOD_0F38FA_PREFIX_1
) },
3675 { MOD_TABLE (MOD_0F38FB_PREFIX_1
) },
3680 { "aadd", { Mdq
, Gdq
}, 0 },
3681 { "axor", { Mdq
, Gdq
}, 0 },
3682 { "aand", { Mdq
, Gdq
}, 0 },
3683 { "aor", { Mdq
, Gdq
}, 0 },
3689 { MOD_TABLE (MOD_0F3A0F_PREFIX_1
)},
3692 /* PREFIX_VEX_0F10 */
3694 { "%XEvmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3695 { "%XEvmovs%XS", { XMScalar
, VexScalarR
, EXd
}, 0 },
3696 { "%XEvmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3697 { "%XEvmovs%XD", { XMScalar
, VexScalarR
, EXq
}, 0 },
3700 /* PREFIX_VEX_0F11 */
3702 { "%XEvmovupX", { EXxS
, XM
}, 0 },
3703 { "%XEvmovs%XS", { EXdS
, VexScalarR
, XMScalar
}, 0 },
3704 { "%XEvmovupX", { EXxS
, XM
}, 0 },
3705 { "%XEvmovs%XD", { EXqS
, VexScalarR
, XMScalar
}, 0 },
3708 /* PREFIX_VEX_0F12 */
3710 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0
) },
3711 { "%XEvmov%XSldup", { XM
, EXEvexXNoBcst
}, 0 },
3712 { MOD_TABLE (MOD_VEX_0F12_PREFIX_2
) },
3713 { "%XEvmov%XDdup", { XM
, EXymmq
}, 0 },
3716 /* PREFIX_VEX_0F16 */
3718 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0
) },
3719 { "%XEvmov%XShdup", { XM
, EXEvexXNoBcst
}, 0 },
3720 { MOD_TABLE (MOD_VEX_0F16_PREFIX_2
) },
3723 /* PREFIX_VEX_0F2A */
3726 { "%XEvcvtsi2ss{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR
, Edq
}, 0 },
3728 { "%XEvcvtsi2sd{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR64
, Edq
}, 0 },
3731 /* PREFIX_VEX_0F2C */
3734 { "%XEvcvttss2si", { Gdq
, EXd
, EXxEVexS
}, 0 },
3736 { "%XEvcvttsd2si", { Gdq
, EXq
, EXxEVexS
}, 0 },
3739 /* PREFIX_VEX_0F2D */
3742 { "%XEvcvtss2si", { Gdq
, EXd
, EXxEVexR
}, 0 },
3744 { "%XEvcvtsd2si", { Gdq
, EXq
, EXxEVexR
}, 0 },
3747 /* PREFIX_VEX_0F2E */
3749 { "%XEvucomisX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3751 { "%XEvucomisX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3754 /* PREFIX_VEX_0F2F */
3756 { "%XEvcomisX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3758 { "%XEvcomisX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3761 /* PREFIX_VEX_0F41_L_1_M_1_W_0 */
3763 { "kandw", { MaskG
, MaskVex
, MaskE
}, 0 },
3765 { "kandb", { MaskG
, MaskVex
, MaskE
}, 0 },
3768 /* PREFIX_VEX_0F41_L_1_M_1_W_1 */
3770 { "kandq", { MaskG
, MaskVex
, MaskE
}, 0 },
3772 { "kandd", { MaskG
, MaskVex
, MaskE
}, 0 },
3775 /* PREFIX_VEX_0F42_L_1_M_1_W_0 */
3777 { "kandnw", { MaskG
, MaskVex
, MaskE
}, 0 },
3779 { "kandnb", { MaskG
, MaskVex
, MaskE
}, 0 },
3782 /* PREFIX_VEX_0F42_L_1_M_1_W_1 */
3784 { "kandnq", { MaskG
, MaskVex
, MaskE
}, 0 },
3786 { "kandnd", { MaskG
, MaskVex
, MaskE
}, 0 },
3789 /* PREFIX_VEX_0F44_L_0_M_1_W_0 */
3791 { "knotw", { MaskG
, MaskE
}, 0 },
3793 { "knotb", { MaskG
, MaskE
}, 0 },
3796 /* PREFIX_VEX_0F44_L_0_M_1_W_1 */
3798 { "knotq", { MaskG
, MaskE
}, 0 },
3800 { "knotd", { MaskG
, MaskE
}, 0 },
3803 /* PREFIX_VEX_0F45_L_1_M_1_W_0 */
3805 { "korw", { MaskG
, MaskVex
, MaskE
}, 0 },
3807 { "korb", { MaskG
, MaskVex
, MaskE
}, 0 },
3810 /* PREFIX_VEX_0F45_L_1_M_1_W_1 */
3812 { "korq", { MaskG
, MaskVex
, MaskE
}, 0 },
3814 { "kord", { MaskG
, MaskVex
, MaskE
}, 0 },
3817 /* PREFIX_VEX_0F46_L_1_M_1_W_0 */
3819 { "kxnorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3821 { "kxnorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3824 /* PREFIX_VEX_0F46_L_1_M_1_W_1 */
3826 { "kxnorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3828 { "kxnord", { MaskG
, MaskVex
, MaskE
}, 0 },
3831 /* PREFIX_VEX_0F47_L_1_M_1_W_0 */
3833 { "kxorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3835 { "kxorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3838 /* PREFIX_VEX_0F47_L_1_M_1_W_1 */
3840 { "kxorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3842 { "kxord", { MaskG
, MaskVex
, MaskE
}, 0 },
3845 /* PREFIX_VEX_0F4A_L_1_M_1_W_0 */
3847 { "kaddw", { MaskG
, MaskVex
, MaskE
}, 0 },
3849 { "kaddb", { MaskG
, MaskVex
, MaskE
}, 0 },
3852 /* PREFIX_VEX_0F4A_L_1_M_1_W_1 */
3854 { "kaddq", { MaskG
, MaskVex
, MaskE
}, 0 },
3856 { "kaddd", { MaskG
, MaskVex
, MaskE
}, 0 },
3859 /* PREFIX_VEX_0F4B_L_1_M_1_W_0 */
3861 { "kunpckwd", { MaskG
, MaskVex
, MaskE
}, 0 },
3863 { "kunpckbw", { MaskG
, MaskVex
, MaskE
}, 0 },
3866 /* PREFIX_VEX_0F4B_L_1_M_1_W_1 */
3868 { "kunpckdq", { MaskG
, MaskVex
, MaskE
}, 0 },
3871 /* PREFIX_VEX_0F51 */
3873 { "%XEvsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3874 { "%XEvsqrts%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3875 { "%XEvsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3876 { "%XEvsqrts%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3879 /* PREFIX_VEX_0F52 */
3881 { "vrsqrtps", { XM
, EXx
}, 0 },
3882 { "vrsqrtss", { XMScalar
, VexScalar
, EXd
}, 0 },
3885 /* PREFIX_VEX_0F53 */
3887 { "vrcpps", { XM
, EXx
}, 0 },
3888 { "vrcpss", { XMScalar
, VexScalar
, EXd
}, 0 },
3891 /* PREFIX_VEX_0F58 */
3893 { "%XEvaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3894 { "%XEvadds%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3895 { "%XEvaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3896 { "%XEvadds%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3899 /* PREFIX_VEX_0F59 */
3901 { "%XEvmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3902 { "%XEvmuls%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3903 { "%XEvmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3904 { "%XEvmuls%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3907 /* PREFIX_VEX_0F5A */
3909 { "%XEvcvtp%XS2pd", { XM
, EXEvexHalfBcstXmmq
, EXxEVexS
}, 0 },
3910 { "%XEvcvts%XS2sd", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3911 { "%XEvcvtp%XD2ps%XY", { XMxmmq
, EXx
, EXxEVexR
}, 0 },
3912 { "%XEvcvts%XD2ss", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3915 /* PREFIX_VEX_0F5B */
3917 { "vcvtdq2ps", { XM
, EXx
}, 0 },
3918 { "vcvttps2dq", { XM
, EXx
}, 0 },
3919 { "vcvtps2dq", { XM
, EXx
}, 0 },
3922 /* PREFIX_VEX_0F5C */
3924 { "%XEvsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3925 { "%XEvsubs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3926 { "%XEvsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3927 { "%XEvsubs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3930 /* PREFIX_VEX_0F5D */
3932 { "%XEvminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3933 { "%XEvmins%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3934 { "%XEvminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3935 { "%XEvmins%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3938 /* PREFIX_VEX_0F5E */
3940 { "%XEvdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3941 { "%XEvdivs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3942 { "%XEvdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3943 { "%XEvdivs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3946 /* PREFIX_VEX_0F5F */
3948 { "%XEvmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3949 { "%XEvmaxs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3950 { "%XEvmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3951 { "%XEvmaxs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3954 /* PREFIX_VEX_0F6F */
3957 { "vmovdqu", { XM
, EXx
}, 0 },
3958 { "vmovdqa", { XM
, EXx
}, 0 },
3961 /* PREFIX_VEX_0F70 */
3964 { "vpshufhw", { XM
, EXx
, Ib
}, 0 },
3965 { "vpshufd", { XM
, EXx
, Ib
}, 0 },
3966 { "vpshuflw", { XM
, EXx
, Ib
}, 0 },
3969 /* PREFIX_VEX_0F7C */
3973 { "vhaddpd", { XM
, Vex
, EXx
}, 0 },
3974 { "vhaddps", { XM
, Vex
, EXx
}, 0 },
3977 /* PREFIX_VEX_0F7D */
3981 { "vhsubpd", { XM
, Vex
, EXx
}, 0 },
3982 { "vhsubps", { XM
, Vex
, EXx
}, 0 },
3985 /* PREFIX_VEX_0F7E */
3988 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1
) },
3989 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2
) },
3992 /* PREFIX_VEX_0F7F */
3995 { "vmovdqu", { EXxS
, XM
}, 0 },
3996 { "vmovdqa", { EXxS
, XM
}, 0 },
3999 /* PREFIX_VEX_0F90_L_0_W_0 */
4001 { "kmovw", { MaskG
, MaskE
}, 0 },
4003 { "kmovb", { MaskG
, MaskBDE
}, 0 },
4006 /* PREFIX_VEX_0F90_L_0_W_1 */
4008 { "kmovq", { MaskG
, MaskE
}, 0 },
4010 { "kmovd", { MaskG
, MaskBDE
}, 0 },
4013 /* PREFIX_VEX_0F91_L_0_M_0_W_0 */
4015 { "kmovw", { Ew
, MaskG
}, 0 },
4017 { "kmovb", { Eb
, MaskG
}, 0 },
4020 /* PREFIX_VEX_0F91_L_0_M_0_W_1 */
4022 { "kmovq", { Eq
, MaskG
}, 0 },
4024 { "kmovd", { Ed
, MaskG
}, 0 },
4027 /* PREFIX_VEX_0F92_L_0_M_1_W_0 */
4029 { "kmovw", { MaskG
, Edq
}, 0 },
4031 { "kmovb", { MaskG
, Edq
}, 0 },
4032 { "kmovd", { MaskG
, Edq
}, 0 },
4035 /* PREFIX_VEX_0F92_L_0_M_1_W_1 */
4040 { "kmovK", { MaskG
, Edq
}, 0 },
4043 /* PREFIX_VEX_0F93_L_0_M_1_W_0 */
4045 { "kmovw", { Gdq
, MaskE
}, 0 },
4047 { "kmovb", { Gdq
, MaskE
}, 0 },
4048 { "kmovd", { Gdq
, MaskE
}, 0 },
4051 /* PREFIX_VEX_0F93_L_0_M_1_W_1 */
4056 { "kmovK", { Gdq
, MaskE
}, 0 },
4059 /* PREFIX_VEX_0F98_L_0_M_1_W_0 */
4061 { "kortestw", { MaskG
, MaskE
}, 0 },
4063 { "kortestb", { MaskG
, MaskE
}, 0 },
4066 /* PREFIX_VEX_0F98_L_0_M_1_W_1 */
4068 { "kortestq", { MaskG
, MaskE
}, 0 },
4070 { "kortestd", { MaskG
, MaskE
}, 0 },
4073 /* PREFIX_VEX_0F99_L_0_M_1_W_0 */
4075 { "ktestw", { MaskG
, MaskE
}, 0 },
4077 { "ktestb", { MaskG
, MaskE
}, 0 },
4080 /* PREFIX_VEX_0F99_L_0_M_1_W_1 */
4082 { "ktestq", { MaskG
, MaskE
}, 0 },
4084 { "ktestd", { MaskG
, MaskE
}, 0 },
4087 /* PREFIX_VEX_0FC2 */
4089 { "vcmpps", { XM
, Vex
, EXx
, CMP
}, 0 },
4090 { "vcmpss", { XMScalar
, VexScalar
, EXd
, CMP
}, 0 },
4091 { "vcmppd", { XM
, Vex
, EXx
, CMP
}, 0 },
4092 { "vcmpsd", { XMScalar
, VexScalar
, EXq
, CMP
}, 0 },
4095 /* PREFIX_VEX_0FD0 */
4099 { "vaddsubpd", { XM
, Vex
, EXx
}, 0 },
4100 { "vaddsubps", { XM
, Vex
, EXx
}, 0 },
4103 /* PREFIX_VEX_0FE6 */
4106 { "vcvtdq2pd", { XM
, EXxmmq
}, 0 },
4107 { "vcvttpd2dq%XY", { XMM
, EXx
}, 0 },
4108 { "vcvtpd2dq%XY", { XMM
, EXx
}, 0 },
4111 /* PREFIX_VEX_0FF0 */
4116 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3
) },
4119 /* PREFIX_VEX_0F3849_X86_64 */
4121 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_0
) },
4123 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_2
) },
4124 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_3
) },
4127 /* PREFIX_VEX_0F384B_X86_64 */
4130 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_1
) },
4131 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_2
) },
4132 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_3
) },
4135 /* PREFIX_VEX_0F3850_W_0 */
4137 { "vpdpbuud", { XM
, Vex
, EXx
}, 0 },
4138 { "vpdpbsud", { XM
, Vex
, EXx
}, 0 },
4139 { "%XVvpdpbusd", { XM
, Vex
, EXx
}, 0 },
4140 { "vpdpbssd", { XM
, Vex
, EXx
}, 0 },
4143 /* PREFIX_VEX_0F3851_W_0 */
4145 { "vpdpbuuds", { XM
, Vex
, EXx
}, 0 },
4146 { "vpdpbsuds", { XM
, Vex
, EXx
}, 0 },
4147 { "%XVvpdpbusds", { XM
, Vex
, EXx
}, 0 },
4148 { "vpdpbssds", { XM
, Vex
, EXx
}, 0 },
4150 /* PREFIX_VEX_0F385C_X86_64 */
4153 { VEX_W_TABLE (VEX_W_0F385C_X86_64_P_1
) },
4155 { VEX_W_TABLE (VEX_W_0F385C_X86_64_P_3
) },
4158 /* PREFIX_VEX_0F385E_X86_64 */
4160 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_0
) },
4161 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_1
) },
4162 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_2
) },
4163 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_3
) },
4166 /* PREFIX_VEX_0F386C_X86_64_W_0_M_1_L_0 */
4168 { "tcmmrlfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
4170 { "tcmmimfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
4173 /* PREFIX_VEX_0F3872 */
4176 { VEX_W_TABLE (VEX_W_0F3872_P_1
) },
4179 /* PREFIX_VEX_0F38B0_W_0 */
4181 { "vcvtneoph2ps", { XM
, Mx
}, 0 },
4182 { "vcvtneebf162ps", { XM
, Mx
}, 0 },
4183 { "vcvtneeph2ps", { XM
, Mx
}, 0 },
4184 { "vcvtneobf162ps", { XM
, Mx
}, 0 },
4187 /* PREFIX_VEX_0F38B1_W_0 */
4190 { "vbcstnebf162ps", { XM
, Mw
}, 0 },
4191 { "vbcstnesh2ps", { XM
, Mw
}, 0 },
4194 /* PREFIX_VEX_0F38F5_L_0 */
4196 { "bzhiS", { Gdq
, Edq
, VexGdq
}, 0 },
4197 { "pextS", { Gdq
, VexGdq
, Edq
}, 0 },
4199 { "pdepS", { Gdq
, VexGdq
, Edq
}, 0 },
4202 /* PREFIX_VEX_0F38F6_L_0 */
4207 { "mulxS", { Gdq
, VexGdq
, Edq
}, 0 },
4210 /* PREFIX_VEX_0F38F7_L_0 */
4212 { "bextrS", { Gdq
, Edq
, VexGdq
}, 0 },
4213 { "sarxS", { Gdq
, Edq
, VexGdq
}, 0 },
4214 { "shlxS", { Gdq
, Edq
, VexGdq
}, 0 },
4215 { "shrxS", { Gdq
, Edq
, VexGdq
}, 0 },
4218 /* PREFIX_VEX_0F3AF0_L_0 */
4223 { "rorxS", { Gdq
, Edq
, Ib
}, 0 },
4226 #include "i386-dis-evex-prefix.h"
4229 static const struct dis386 x86_64_table
[][2] = {
4232 { "pushP", { es
}, 0 },
4237 { "popP", { es
}, 0 },
4242 { "pushP", { cs
}, 0 },
4247 { "pushP", { ss
}, 0 },
4252 { "popP", { ss
}, 0 },
4257 { "pushP", { ds
}, 0 },
4262 { "popP", { ds
}, 0 },
4267 { "daa", { XX
}, 0 },
4272 { "das", { XX
}, 0 },
4277 { "aaa", { XX
}, 0 },
4282 { "aas", { XX
}, 0 },
4287 { "pushaP", { XX
}, 0 },
4292 { "popaP", { XX
}, 0 },
4297 { MOD_TABLE (MOD_62_32BIT
) },
4298 { EVEX_TABLE (EVEX_0F
) },
4303 { "arpl", { Ew
, Gw
}, 0 },
4304 { "movs", { Gv
, { MOVSXD_Fixup
, movsxd_mode
} }, 0 },
4309 { "ins{R|}", { Yzr
, indirDX
}, 0 },
4310 { "ins{G|}", { Yzr
, indirDX
}, 0 },
4315 { "outs{R|}", { indirDXr
, Xz
}, 0 },
4316 { "outs{G|}", { indirDXr
, Xz
}, 0 },
4321 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
4322 { REG_TABLE (REG_80
) },
4327 { "{l|}call{P|}", { Ap
}, 0 },
4332 { "retP", { Iw
, BND
}, 0 },
4333 { "ret@", { Iw
, BND
}, 0 },
4338 { "retP", { BND
}, 0 },
4339 { "ret@", { BND
}, 0 },
4344 { MOD_TABLE (MOD_C4_32BIT
) },
4345 { VEX_C4_TABLE (VEX_0F
) },
4350 { MOD_TABLE (MOD_C5_32BIT
) },
4351 { VEX_C5_TABLE (VEX_0F
) },
4356 { "into", { XX
}, 0 },
4361 { "aam", { Ib
}, 0 },
4366 { "aad", { Ib
}, 0 },
4371 { "callP", { Jv
, BND
}, 0 },
4372 { "call@", { Jv
, BND
}, 0 }
4377 { "jmpP", { Jv
, BND
}, 0 },
4378 { "jmp@", { Jv
, BND
}, 0 }
4383 { "{l|}jmp{P|}", { Ap
}, 0 },
4386 /* X86_64_0F01_REG_0 */
4388 { "sgdt{Q|Q}", { M
}, 0 },
4389 { "sgdt", { M
}, 0 },
4392 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_1 */
4395 { "wrmsrlist", { Skip_MODRM
}, 0 },
4398 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_3 */
4401 { "rdmsrlist", { Skip_MODRM
}, 0 },
4404 /* X86_64_0F01_REG_1 */
4406 { "sidt{Q|Q}", { M
}, 0 },
4407 { "sidt", { M
}, 0 },
4410 /* X86_64_0F01_REG_1_RM_5_PREFIX_2 */
4413 { "seamret", { Skip_MODRM
}, 0 },
4416 /* X86_64_0F01_REG_1_RM_6_PREFIX_2 */
4419 { "seamops", { Skip_MODRM
}, 0 },
4422 /* X86_64_0F01_REG_1_RM_7_PREFIX_2 */
4425 { "seamcall", { Skip_MODRM
}, 0 },
4428 /* X86_64_0F01_REG_2 */
4430 { "lgdt{Q|Q}", { M
}, 0 },
4431 { "lgdt", { M
}, 0 },
4434 /* X86_64_0F01_REG_3 */
4436 { "lidt{Q|Q}", { M
}, 0 },
4437 { "lidt", { M
}, 0 },
4440 /* X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1 */
4443 { "uiret", { Skip_MODRM
}, 0 },
4446 /* X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1 */
4449 { "testui", { Skip_MODRM
}, 0 },
4452 /* X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1 */
4455 { "clui", { Skip_MODRM
}, 0 },
4458 /* X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1 */
4461 { "stui", { Skip_MODRM
}, 0 },
4464 /* X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1 */
4467 { "rmpquery", { Skip_MODRM
}, 0 },
4470 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1 */
4473 { "rmpadjust", { Skip_MODRM
}, 0 },
4476 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3 */
4479 { "rmpupdate", { Skip_MODRM
}, 0 },
4482 /* X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1 */
4485 { "psmash", { Skip_MODRM
}, 0 },
4488 /* X86_64_0F18_REG_6_MOD_0 */
4490 { "nopQ", { Ev
}, 0 },
4491 { PREFIX_TABLE (PREFIX_0F18_REG_6_MOD_0_X86_64
) },
4494 /* X86_64_0F18_REG_7_MOD_0 */
4496 { "nopQ", { Ev
}, 0 },
4497 { PREFIX_TABLE (PREFIX_0F18_REG_7_MOD_0_X86_64
) },
4502 { "movZ", { Em
, Td
}, 0 },
4507 { "movZ", { Td
, Em
}, 0 },
4510 /* X86_64_0FC7_REG_6_MOD_3_PREFIX_1 */
4513 { "senduipi", { Eq
}, 0 },
4516 /* X86_64_VEX_0F3849 */
4519 { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64
) },
4522 /* X86_64_VEX_0F384B */
4525 { PREFIX_TABLE (PREFIX_VEX_0F384B_X86_64
) },
4528 /* X86_64_VEX_0F385C */
4531 { PREFIX_TABLE (PREFIX_VEX_0F385C_X86_64
) },
4534 /* X86_64_VEX_0F385E */
4537 { PREFIX_TABLE (PREFIX_VEX_0F385E_X86_64
) },
4540 /* X86_64_VEX_0F386C */
4543 { VEX_W_TABLE (VEX_W_0F386C_X86_64
) },
4546 /* X86_64_VEX_0F38E0 */
4549 { "cmpoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4552 /* X86_64_VEX_0F38E1 */
4555 { "cmpnoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4558 /* X86_64_VEX_0F38E2 */
4561 { "cmpbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4564 /* X86_64_VEX_0F38E3 */
4567 { "cmpnbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4570 /* X86_64_VEX_0F38E4 */
4573 { "cmpzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4576 /* X86_64_VEX_0F38E5 */
4579 { "cmpnzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4582 /* X86_64_VEX_0F38E6 */
4585 { "cmpbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4588 /* X86_64_VEX_0F38E7 */
4591 { "cmpnbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4594 /* X86_64_VEX_0F38E8 */
4597 { "cmpsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4600 /* X86_64_VEX_0F38E9 */
4603 { "cmpnsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4606 /* X86_64_VEX_0F38EA */
4609 { "cmppxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4612 /* X86_64_VEX_0F38EB */
4615 { "cmpnpxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4618 /* X86_64_VEX_0F38EC */
4621 { "cmplxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4624 /* X86_64_VEX_0F38ED */
4627 { "cmpnlxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4630 /* X86_64_VEX_0F38EE */
4633 { "cmplexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4636 /* X86_64_VEX_0F38EF */
4639 { "cmpnlexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4643 static const struct dis386 three_byte_table
[][256] = {
4645 /* THREE_BYTE_0F38 */
4648 { "pshufb", { MX
, EM
}, PREFIX_OPCODE
},
4649 { "phaddw", { MX
, EM
}, PREFIX_OPCODE
},
4650 { "phaddd", { MX
, EM
}, PREFIX_OPCODE
},
4651 { "phaddsw", { MX
, EM
}, PREFIX_OPCODE
},
4652 { "pmaddubsw", { MX
, EM
}, PREFIX_OPCODE
},
4653 { "phsubw", { MX
, EM
}, PREFIX_OPCODE
},
4654 { "phsubd", { MX
, EM
}, PREFIX_OPCODE
},
4655 { "phsubsw", { MX
, EM
}, PREFIX_OPCODE
},
4657 { "psignb", { MX
, EM
}, PREFIX_OPCODE
},
4658 { "psignw", { MX
, EM
}, PREFIX_OPCODE
},
4659 { "psignd", { MX
, EM
}, PREFIX_OPCODE
},
4660 { "pmulhrsw", { MX
, EM
}, PREFIX_OPCODE
},
4666 { "pblendvb", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4670 { "blendvps", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4671 { "blendvpd", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4673 { "ptest", { XM
, EXx
}, PREFIX_DATA
},
4679 { "pabsb", { MX
, EM
}, PREFIX_OPCODE
},
4680 { "pabsw", { MX
, EM
}, PREFIX_OPCODE
},
4681 { "pabsd", { MX
, EM
}, PREFIX_OPCODE
},
4684 { "pmovsxbw", { XM
, EXq
}, PREFIX_DATA
},
4685 { "pmovsxbd", { XM
, EXd
}, PREFIX_DATA
},
4686 { "pmovsxbq", { XM
, EXw
}, PREFIX_DATA
},
4687 { "pmovsxwd", { XM
, EXq
}, PREFIX_DATA
},
4688 { "pmovsxwq", { XM
, EXd
}, PREFIX_DATA
},
4689 { "pmovsxdq", { XM
, EXq
}, PREFIX_DATA
},
4693 { "pmuldq", { XM
, EXx
}, PREFIX_DATA
},
4694 { "pcmpeqq", { XM
, EXx
}, PREFIX_DATA
},
4695 { MOD_TABLE (MOD_0F382A
) },
4696 { "packusdw", { XM
, EXx
}, PREFIX_DATA
},
4702 { "pmovzxbw", { XM
, EXq
}, PREFIX_DATA
},
4703 { "pmovzxbd", { XM
, EXd
}, PREFIX_DATA
},
4704 { "pmovzxbq", { XM
, EXw
}, PREFIX_DATA
},
4705 { "pmovzxwd", { XM
, EXq
}, PREFIX_DATA
},
4706 { "pmovzxwq", { XM
, EXd
}, PREFIX_DATA
},
4707 { "pmovzxdq", { XM
, EXq
}, PREFIX_DATA
},
4709 { "pcmpgtq", { XM
, EXx
}, PREFIX_DATA
},
4711 { "pminsb", { XM
, EXx
}, PREFIX_DATA
},
4712 { "pminsd", { XM
, EXx
}, PREFIX_DATA
},
4713 { "pminuw", { XM
, EXx
}, PREFIX_DATA
},
4714 { "pminud", { XM
, EXx
}, PREFIX_DATA
},
4715 { "pmaxsb", { XM
, EXx
}, PREFIX_DATA
},
4716 { "pmaxsd", { XM
, EXx
}, PREFIX_DATA
},
4717 { "pmaxuw", { XM
, EXx
}, PREFIX_DATA
},
4718 { "pmaxud", { XM
, EXx
}, PREFIX_DATA
},
4720 { "pmulld", { XM
, EXx
}, PREFIX_DATA
},
4721 { "phminposuw", { XM
, EXx
}, PREFIX_DATA
},
4792 { "invept", { Gm
, Mo
}, PREFIX_DATA
},
4793 { "invvpid", { Gm
, Mo
}, PREFIX_DATA
},
4794 { "invpcid", { Gm
, M
}, PREFIX_DATA
},
4873 { "sha1nexte", { XM
, EXxmm
}, PREFIX_OPCODE
},
4874 { "sha1msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4875 { "sha1msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4876 { "sha256rnds2", { XM
, EXxmm
, XMM0
}, PREFIX_OPCODE
},
4877 { "sha256msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4878 { "sha256msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4880 { "gf2p8mulb", { XM
, EXxmm
}, PREFIX_DATA
},
4891 { PREFIX_TABLE (PREFIX_0F38D8
) },
4894 { "aesimc", { XM
, EXx
}, PREFIX_DATA
},
4895 { PREFIX_TABLE (PREFIX_0F38DC
) },
4896 { PREFIX_TABLE (PREFIX_0F38DD
) },
4897 { PREFIX_TABLE (PREFIX_0F38DE
) },
4898 { PREFIX_TABLE (PREFIX_0F38DF
) },
4918 { PREFIX_TABLE (PREFIX_0F38F0
) },
4919 { PREFIX_TABLE (PREFIX_0F38F1
) },
4923 { MOD_TABLE (MOD_0F38F5
) },
4924 { PREFIX_TABLE (PREFIX_0F38F6
) },
4927 { PREFIX_TABLE (PREFIX_0F38F8
) },
4928 { MOD_TABLE (MOD_0F38F9
) },
4929 { PREFIX_TABLE (PREFIX_0F38FA
) },
4930 { PREFIX_TABLE (PREFIX_0F38FB
) },
4931 { PREFIX_TABLE (PREFIX_0F38FC
) },
4936 /* THREE_BYTE_0F3A */
4948 { "roundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4949 { "roundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4950 { "roundss", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4951 { "roundsd", { XM
, EXq
, Ib
}, PREFIX_DATA
},
4952 { "blendps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4953 { "blendpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4954 { "pblendw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4955 { "palignr", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
4961 { "pextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
4962 { "pextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
4963 { "pextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
4964 { "extractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
4975 { "pinsrb", { XM
, Edb
, Ib
}, PREFIX_DATA
},
4976 { "insertps", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4977 { "pinsrK", { XM
, Edq
, Ib
}, PREFIX_DATA
},
5011 { "dpps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5012 { "dppd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5013 { "mpsadbw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5015 { "pclmulqdq", { XM
, EXx
, PCLMUL
}, PREFIX_DATA
},
5047 { "pcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5048 { "pcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5049 { "pcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5050 { "pcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5168 { "sha1rnds4", { XM
, EXxmm
, Ib
}, PREFIX_OPCODE
},
5170 { "gf2p8affineqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5171 { "gf2p8affineinvqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5189 { "aeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5209 { PREFIX_TABLE (PREFIX_0F3A0F
) },
5229 static const struct dis386 xop_table
[][256] = {
5382 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_85
) },
5383 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_86
) },
5384 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_87
) },
5392 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8E
) },
5393 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8F
) },
5400 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_95
) },
5401 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_96
) },
5402 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_97
) },
5410 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9E
) },
5411 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9F
) },
5415 { "vpcmov", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
5416 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A3
) },
5419 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A6
) },
5437 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_B6
) },
5449 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C0
) },
5450 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C1
) },
5451 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C2
) },
5452 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C3
) },
5462 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC
) },
5463 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD
) },
5464 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE
) },
5465 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF
) },
5498 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC
) },
5499 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED
) },
5500 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE
) },
5501 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF
) },
5525 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_01
) },
5526 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_02
) },
5544 { MOD_TABLE (MOD_XOP_09_12
) },
5668 { VEX_W_TABLE (VEX_W_0FXOP_09_80
) },
5669 { VEX_W_TABLE (VEX_W_0FXOP_09_81
) },
5670 { VEX_W_TABLE (VEX_W_0FXOP_09_82
) },
5671 { VEX_W_TABLE (VEX_W_0FXOP_09_83
) },
5686 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_90
) },
5687 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_91
) },
5688 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_92
) },
5689 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_93
) },
5690 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_94
) },
5691 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_95
) },
5692 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_96
) },
5693 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_97
) },
5695 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_98
) },
5696 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_99
) },
5697 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9A
) },
5698 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9B
) },
5741 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C1
) },
5742 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C2
) },
5743 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C3
) },
5746 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C6
) },
5747 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C7
) },
5752 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_CB
) },
5759 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D1
) },
5760 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D2
) },
5761 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D3
) },
5764 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D6
) },
5765 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D7
) },
5770 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_DB
) },
5777 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E1
) },
5778 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E2
) },
5779 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E3
) },
5833 { "bextrS", { Gdq
, Edq
, Id
}, 0 },
5835 { VEX_LEN_TABLE (VEX_LEN_0FXOP_0A_12
) },
6105 static const struct dis386 vex_table
[][256] = {
6127 { PREFIX_TABLE (PREFIX_VEX_0F10
) },
6128 { PREFIX_TABLE (PREFIX_VEX_0F11
) },
6129 { PREFIX_TABLE (PREFIX_VEX_0F12
) },
6130 { MOD_TABLE (MOD_VEX_0F13
) },
6131 { "vunpcklpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6132 { "vunpckhpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6133 { PREFIX_TABLE (PREFIX_VEX_0F16
) },
6134 { MOD_TABLE (MOD_VEX_0F17
) },
6154 { "vmovapX", { XM
, EXx
}, PREFIX_OPCODE
},
6155 { "vmovapX", { EXxS
, XM
}, PREFIX_OPCODE
},
6156 { PREFIX_TABLE (PREFIX_VEX_0F2A
) },
6157 { MOD_TABLE (MOD_VEX_0F2B
) },
6158 { PREFIX_TABLE (PREFIX_VEX_0F2C
) },
6159 { PREFIX_TABLE (PREFIX_VEX_0F2D
) },
6160 { PREFIX_TABLE (PREFIX_VEX_0F2E
) },
6161 { PREFIX_TABLE (PREFIX_VEX_0F2F
) },
6182 { VEX_LEN_TABLE (VEX_LEN_0F41
) },
6183 { VEX_LEN_TABLE (VEX_LEN_0F42
) },
6185 { VEX_LEN_TABLE (VEX_LEN_0F44
) },
6186 { VEX_LEN_TABLE (VEX_LEN_0F45
) },
6187 { VEX_LEN_TABLE (VEX_LEN_0F46
) },
6188 { VEX_LEN_TABLE (VEX_LEN_0F47
) },
6192 { VEX_LEN_TABLE (VEX_LEN_0F4A
) },
6193 { VEX_LEN_TABLE (VEX_LEN_0F4B
) },
6199 { MOD_TABLE (MOD_VEX_0F50
) },
6200 { PREFIX_TABLE (PREFIX_VEX_0F51
) },
6201 { PREFIX_TABLE (PREFIX_VEX_0F52
) },
6202 { PREFIX_TABLE (PREFIX_VEX_0F53
) },
6203 { "vandpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6204 { "vandnpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6205 { "vorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6206 { "vxorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6208 { PREFIX_TABLE (PREFIX_VEX_0F58
) },
6209 { PREFIX_TABLE (PREFIX_VEX_0F59
) },
6210 { PREFIX_TABLE (PREFIX_VEX_0F5A
) },
6211 { PREFIX_TABLE (PREFIX_VEX_0F5B
) },
6212 { PREFIX_TABLE (PREFIX_VEX_0F5C
) },
6213 { PREFIX_TABLE (PREFIX_VEX_0F5D
) },
6214 { PREFIX_TABLE (PREFIX_VEX_0F5E
) },
6215 { PREFIX_TABLE (PREFIX_VEX_0F5F
) },
6217 { "vpunpcklbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6218 { "vpunpcklwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6219 { "vpunpckldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6220 { "vpacksswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6221 { "vpcmpgtb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6222 { "vpcmpgtw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6223 { "vpcmpgtd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6224 { "vpackuswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6226 { "vpunpckhbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6227 { "vpunpckhwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6228 { "vpunpckhdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6229 { "vpackssdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6230 { "vpunpcklqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6231 { "vpunpckhqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6232 { VEX_LEN_TABLE (VEX_LEN_0F6E
) },
6233 { PREFIX_TABLE (PREFIX_VEX_0F6F
) },
6235 { PREFIX_TABLE (PREFIX_VEX_0F70
) },
6236 { MOD_TABLE (MOD_VEX_0F71
) },
6237 { MOD_TABLE (MOD_VEX_0F72
) },
6238 { MOD_TABLE (MOD_VEX_0F73
) },
6239 { "vpcmpeqb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6240 { "vpcmpeqw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6241 { "vpcmpeqd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6242 { VEX_LEN_TABLE (VEX_LEN_0F77
) },
6248 { PREFIX_TABLE (PREFIX_VEX_0F7C
) },
6249 { PREFIX_TABLE (PREFIX_VEX_0F7D
) },
6250 { PREFIX_TABLE (PREFIX_VEX_0F7E
) },
6251 { PREFIX_TABLE (PREFIX_VEX_0F7F
) },
6271 { VEX_LEN_TABLE (VEX_LEN_0F90
) },
6272 { VEX_LEN_TABLE (VEX_LEN_0F91
) },
6273 { VEX_LEN_TABLE (VEX_LEN_0F92
) },
6274 { VEX_LEN_TABLE (VEX_LEN_0F93
) },
6280 { VEX_LEN_TABLE (VEX_LEN_0F98
) },
6281 { VEX_LEN_TABLE (VEX_LEN_0F99
) },
6304 { REG_TABLE (REG_VEX_0FAE
) },
6327 { PREFIX_TABLE (PREFIX_VEX_0FC2
) },
6329 { VEX_LEN_TABLE (VEX_LEN_0FC4
) },
6330 { VEX_LEN_TABLE (VEX_LEN_0FC5
) },
6331 { "vshufpX", { XM
, Vex
, EXx
, Ib
}, PREFIX_OPCODE
},
6343 { PREFIX_TABLE (PREFIX_VEX_0FD0
) },
6344 { "vpsrlw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6345 { "vpsrld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6346 { "vpsrlq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6347 { "vpaddq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6348 { "vpmullw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6349 { VEX_LEN_TABLE (VEX_LEN_0FD6
) },
6350 { MOD_TABLE (MOD_VEX_0FD7
) },
6352 { "vpsubusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6353 { "vpsubusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6354 { "vpminub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6355 { "vpand", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6356 { "vpaddusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6357 { "vpaddusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6358 { "vpmaxub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6359 { "vpandn", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6361 { "vpavgb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6362 { "vpsraw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6363 { "vpsrad", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6364 { "vpavgw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6365 { "vpmulhuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6366 { "vpmulhw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6367 { PREFIX_TABLE (PREFIX_VEX_0FE6
) },
6368 { MOD_TABLE (MOD_VEX_0FE7
) },
6370 { "vpsubsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6371 { "vpsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6372 { "vpminsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6373 { "vpor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6374 { "vpaddsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6375 { "vpaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6376 { "vpmaxsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6377 { "vpxor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6379 { PREFIX_TABLE (PREFIX_VEX_0FF0
) },
6380 { "vpsllw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6381 { "vpslld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6382 { "vpsllq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6383 { "vpmuludq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6384 { "vpmaddwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6385 { "vpsadbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6386 { VEX_LEN_TABLE (VEX_LEN_0FF7
) },
6388 { "vpsubb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6389 { "vpsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6390 { "vpsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6391 { "vpsubq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6392 { "vpaddb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6393 { "vpaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6394 { "vpaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6400 { "vpshufb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6401 { "vphaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6402 { "vphaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6403 { "vphaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6404 { "vpmaddubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6405 { "vphsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6406 { "vphsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6407 { "vphsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6409 { "vpsignb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6410 { "vpsignw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6411 { "vpsignd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6412 { "vpmulhrsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6413 { VEX_W_TABLE (VEX_W_0F380C
) },
6414 { VEX_W_TABLE (VEX_W_0F380D
) },
6415 { VEX_W_TABLE (VEX_W_0F380E
) },
6416 { VEX_W_TABLE (VEX_W_0F380F
) },
6421 { VEX_W_TABLE (VEX_W_0F3813
) },
6424 { VEX_LEN_TABLE (VEX_LEN_0F3816
) },
6425 { "vptest", { XM
, EXx
}, PREFIX_DATA
},
6427 { VEX_W_TABLE (VEX_W_0F3818
) },
6428 { VEX_LEN_TABLE (VEX_LEN_0F3819
) },
6429 { MOD_TABLE (MOD_VEX_0F381A
) },
6431 { "vpabsb", { XM
, EXx
}, PREFIX_DATA
},
6432 { "vpabsw", { XM
, EXx
}, PREFIX_DATA
},
6433 { "vpabsd", { XM
, EXx
}, PREFIX_DATA
},
6436 { "vpmovsxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6437 { "vpmovsxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6438 { "vpmovsxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6439 { "vpmovsxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6440 { "vpmovsxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6441 { "vpmovsxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6445 { "vpmuldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6446 { "vpcmpeqq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6447 { MOD_TABLE (MOD_VEX_0F382A
) },
6448 { "vpackusdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6449 { MOD_TABLE (MOD_VEX_0F382C
) },
6450 { MOD_TABLE (MOD_VEX_0F382D
) },
6451 { MOD_TABLE (MOD_VEX_0F382E
) },
6452 { MOD_TABLE (MOD_VEX_0F382F
) },
6454 { "vpmovzxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6455 { "vpmovzxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6456 { "vpmovzxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6457 { "vpmovzxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6458 { "vpmovzxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6459 { "vpmovzxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6460 { VEX_LEN_TABLE (VEX_LEN_0F3836
) },
6461 { "vpcmpgtq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6463 { "vpminsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6464 { "vpminsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6465 { "vpminuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6466 { "vpminud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6467 { "vpmaxsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6468 { "vpmaxsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6469 { "vpmaxuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6470 { "vpmaxud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6472 { "vpmulld", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6473 { VEX_LEN_TABLE (VEX_LEN_0F3841
) },
6477 { "vpsrlv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6478 { VEX_W_TABLE (VEX_W_0F3846
) },
6479 { "vpsllv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6482 { X86_64_TABLE (X86_64_VEX_0F3849
) },
6484 { X86_64_TABLE (X86_64_VEX_0F384B
) },
6490 { VEX_W_TABLE (VEX_W_0F3850
) },
6491 { VEX_W_TABLE (VEX_W_0F3851
) },
6492 { VEX_W_TABLE (VEX_W_0F3852
) },
6493 { VEX_W_TABLE (VEX_W_0F3853
) },
6499 { VEX_W_TABLE (VEX_W_0F3858
) },
6500 { VEX_W_TABLE (VEX_W_0F3859
) },
6501 { MOD_TABLE (MOD_VEX_0F385A
) },
6503 { X86_64_TABLE (X86_64_VEX_0F385C
) },
6505 { X86_64_TABLE (X86_64_VEX_0F385E
) },
6521 { X86_64_TABLE (X86_64_VEX_0F386C
) },
6528 { PREFIX_TABLE (PREFIX_VEX_0F3872
) },
6535 { VEX_W_TABLE (VEX_W_0F3878
) },
6536 { VEX_W_TABLE (VEX_W_0F3879
) },
6557 { MOD_TABLE (MOD_VEX_0F388C
) },
6559 { MOD_TABLE (MOD_VEX_0F388E
) },
6562 { "vpgatherd%DQ", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6563 { "vpgatherq%DQ", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6564 { "vgatherdp%XW", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6565 { "vgatherqp%XW", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6568 { "vfmaddsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6569 { "vfmsubadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6571 { "vfmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6572 { "vfmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6573 { "vfmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6574 { "vfmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6575 { "vfnmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6576 { "vfnmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6577 { "vfnmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6578 { "vfnmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6586 { "vfmaddsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6587 { "vfmsubadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6589 { "vfmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6590 { "vfmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6591 { "vfmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6592 { "vfmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6593 { "vfnmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6594 { "vfnmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6595 { "vfnmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6596 { "vfnmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6598 { VEX_W_TABLE (VEX_W_0F38B0
) },
6599 { VEX_W_TABLE (VEX_W_0F38B1
) },
6602 { VEX_W_TABLE (VEX_W_0F38B4
) },
6603 { VEX_W_TABLE (VEX_W_0F38B5
) },
6604 { "vfmaddsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6605 { "vfmsubadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6607 { "vfmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6608 { "vfmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6609 { "vfmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6610 { "vfmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6611 { "vfnmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6612 { "vfnmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6613 { "vfnmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6614 { "vfnmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6632 { VEX_W_TABLE (VEX_W_0F38CF
) },
6646 { VEX_LEN_TABLE (VEX_LEN_0F38DB
) },
6647 { "vaesenc", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6648 { "vaesenclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6649 { "vaesdec", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6650 { "vaesdeclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6652 { X86_64_TABLE (X86_64_VEX_0F38E0
) },
6653 { X86_64_TABLE (X86_64_VEX_0F38E1
) },
6654 { X86_64_TABLE (X86_64_VEX_0F38E2
) },
6655 { X86_64_TABLE (X86_64_VEX_0F38E3
) },
6656 { X86_64_TABLE (X86_64_VEX_0F38E4
) },
6657 { X86_64_TABLE (X86_64_VEX_0F38E5
) },
6658 { X86_64_TABLE (X86_64_VEX_0F38E6
) },
6659 { X86_64_TABLE (X86_64_VEX_0F38E7
) },
6661 { X86_64_TABLE (X86_64_VEX_0F38E8
) },
6662 { X86_64_TABLE (X86_64_VEX_0F38E9
) },
6663 { X86_64_TABLE (X86_64_VEX_0F38EA
) },
6664 { X86_64_TABLE (X86_64_VEX_0F38EB
) },
6665 { X86_64_TABLE (X86_64_VEX_0F38EC
) },
6666 { X86_64_TABLE (X86_64_VEX_0F38ED
) },
6667 { X86_64_TABLE (X86_64_VEX_0F38EE
) },
6668 { X86_64_TABLE (X86_64_VEX_0F38EF
) },
6672 { VEX_LEN_TABLE (VEX_LEN_0F38F2
) },
6673 { VEX_LEN_TABLE (VEX_LEN_0F38F3
) },
6675 { VEX_LEN_TABLE (VEX_LEN_0F38F5
) },
6676 { VEX_LEN_TABLE (VEX_LEN_0F38F6
) },
6677 { VEX_LEN_TABLE (VEX_LEN_0F38F7
) },
6691 { VEX_LEN_TABLE (VEX_LEN_0F3A00
) },
6692 { VEX_LEN_TABLE (VEX_LEN_0F3A01
) },
6693 { VEX_W_TABLE (VEX_W_0F3A02
) },
6695 { VEX_W_TABLE (VEX_W_0F3A04
) },
6696 { VEX_W_TABLE (VEX_W_0F3A05
) },
6697 { VEX_LEN_TABLE (VEX_LEN_0F3A06
) },
6700 { "vroundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6701 { "vroundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6702 { "vroundss", { XMScalar
, VexScalar
, EXd
, Ib
}, PREFIX_DATA
},
6703 { "vroundsd", { XMScalar
, VexScalar
, EXq
, Ib
}, PREFIX_DATA
},
6704 { "vblendps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6705 { "vblendpd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6706 { "vpblendw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6707 { "vpalignr", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6713 { VEX_LEN_TABLE (VEX_LEN_0F3A14
) },
6714 { VEX_LEN_TABLE (VEX_LEN_0F3A15
) },
6715 { VEX_LEN_TABLE (VEX_LEN_0F3A16
) },
6716 { VEX_LEN_TABLE (VEX_LEN_0F3A17
) },
6718 { VEX_LEN_TABLE (VEX_LEN_0F3A18
) },
6719 { VEX_LEN_TABLE (VEX_LEN_0F3A19
) },
6723 { VEX_W_TABLE (VEX_W_0F3A1D
) },
6727 { VEX_LEN_TABLE (VEX_LEN_0F3A20
) },
6728 { VEX_LEN_TABLE (VEX_LEN_0F3A21
) },
6729 { VEX_LEN_TABLE (VEX_LEN_0F3A22
) },
6745 { VEX_LEN_TABLE (VEX_LEN_0F3A30
) },
6746 { VEX_LEN_TABLE (VEX_LEN_0F3A31
) },
6747 { VEX_LEN_TABLE (VEX_LEN_0F3A32
) },
6748 { VEX_LEN_TABLE (VEX_LEN_0F3A33
) },
6754 { VEX_LEN_TABLE (VEX_LEN_0F3A38
) },
6755 { VEX_LEN_TABLE (VEX_LEN_0F3A39
) },
6763 { "vdpps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6764 { VEX_LEN_TABLE (VEX_LEN_0F3A41
) },
6765 { "vmpsadbw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6767 { "vpclmulqdq", { XM
, Vex
, EXx
, PCLMUL
}, PREFIX_DATA
},
6769 { VEX_LEN_TABLE (VEX_LEN_0F3A46
) },
6772 { "vpermil2ps", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6773 { "vpermil2pd", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6774 { VEX_W_TABLE (VEX_W_0F3A4A
) },
6775 { VEX_W_TABLE (VEX_W_0F3A4B
) },
6776 { VEX_W_TABLE (VEX_W_0F3A4C
) },
6794 { "vfmaddsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6795 { "vfmaddsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6796 { "vfmsubaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6797 { "vfmsubaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6799 { VEX_LEN_TABLE (VEX_LEN_0F3A60
) },
6800 { VEX_LEN_TABLE (VEX_LEN_0F3A61
) },
6801 { VEX_LEN_TABLE (VEX_LEN_0F3A62
) },
6802 { VEX_LEN_TABLE (VEX_LEN_0F3A63
) },
6808 { "vfmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6809 { "vfmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6810 { "vfmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6811 { "vfmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6812 { "vfmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6813 { "vfmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6814 { "vfmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6815 { "vfmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6826 { "vfnmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6827 { "vfnmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6828 { "vfnmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6829 { "vfnmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6830 { "vfnmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6831 { "vfnmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6832 { "vfnmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6833 { "vfnmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6922 { VEX_W_TABLE (VEX_W_0F3ACE
) },
6923 { VEX_W_TABLE (VEX_W_0F3ACF
) },
6941 { VEX_LEN_TABLE (VEX_LEN_0F3ADF
) },
6961 { VEX_LEN_TABLE (VEX_LEN_0F3AF0
) },
6981 #include "i386-dis-evex.h"
6983 static const struct dis386 vex_len_table
[][2] = {
6984 /* VEX_LEN_0F12_P_0_M_0 / VEX_LEN_0F12_P_2_M_0 */
6986 { "%XEvmovlpX", { XM
, Vex
, EXq
}, 0 },
6989 /* VEX_LEN_0F12_P_0_M_1 */
6991 { "%XEvmovhlp%XS", { XM
, Vex
, EXq
}, 0 },
6994 /* VEX_LEN_0F13_M_0 */
6996 { "%XEvmovlpX", { EXq
, XM
}, PREFIX_OPCODE
},
6999 /* VEX_LEN_0F16_P_0_M_0 / VEX_LEN_0F16_P_2_M_0 */
7001 { "%XEvmovhpX", { XM
, Vex
, EXq
}, 0 },
7004 /* VEX_LEN_0F16_P_0_M_1 */
7006 { "%XEvmovlhp%XS", { XM
, Vex
, EXq
}, 0 },
7009 /* VEX_LEN_0F17_M_0 */
7011 { "%XEvmovhpX", { EXq
, XM
}, PREFIX_OPCODE
},
7017 { MOD_TABLE (MOD_VEX_0F41_L_1
) },
7023 { MOD_TABLE (MOD_VEX_0F42_L_1
) },
7028 { MOD_TABLE (MOD_VEX_0F44_L_0
) },
7034 { MOD_TABLE (MOD_VEX_0F45_L_1
) },
7040 { MOD_TABLE (MOD_VEX_0F46_L_1
) },
7046 { MOD_TABLE (MOD_VEX_0F47_L_1
) },
7052 { MOD_TABLE (MOD_VEX_0F4A_L_1
) },
7058 { MOD_TABLE (MOD_VEX_0F4B_L_1
) },
7063 { "%XEvmovK", { XMScalar
, Edq
}, PREFIX_DATA
},
7068 { "vzeroupper", { XX
}, 0 },
7069 { "vzeroall", { XX
}, 0 },
7072 /* VEX_LEN_0F7E_P_1 */
7074 { "%XEvmovq", { XMScalar
, EXq
}, 0 },
7077 /* VEX_LEN_0F7E_P_2 */
7079 { "%XEvmovK", { Edq
, XMScalar
}, 0 },
7084 { VEX_W_TABLE (VEX_W_0F90_L_0
) },
7089 { MOD_TABLE (MOD_VEX_0F91_L_0
) },
7094 { MOD_TABLE (MOD_VEX_0F92_L_0
) },
7099 { MOD_TABLE (MOD_VEX_0F93_L_0
) },
7104 { MOD_TABLE (MOD_VEX_0F98_L_0
) },
7109 { MOD_TABLE (MOD_VEX_0F99_L_0
) },
7112 /* VEX_LEN_0FAE_R_2_M_0 */
7114 { "vldmxcsr", { Md
}, 0 },
7117 /* VEX_LEN_0FAE_R_3_M_0 */
7119 { "vstmxcsr", { Md
}, 0 },
7124 { "%XEvpinsrw", { XM
, Vex
, Edw
, Ib
}, PREFIX_DATA
},
7129 { "%XEvpextrw", { Gd
, XS
, Ib
}, PREFIX_DATA
},
7134 { "%XEvmovq", { EXqS
, XMScalar
}, PREFIX_DATA
},
7139 { "vmaskmovdqu", { XM
, XS
}, PREFIX_DATA
},
7142 /* VEX_LEN_0F3816 */
7145 { VEX_W_TABLE (VEX_W_0F3816_L_1
) },
7148 /* VEX_LEN_0F3819 */
7151 { VEX_W_TABLE (VEX_W_0F3819_L_1
) },
7154 /* VEX_LEN_0F381A_M_0 */
7157 { VEX_W_TABLE (VEX_W_0F381A_M_0_L_1
) },
7160 /* VEX_LEN_0F3836 */
7163 { VEX_W_TABLE (VEX_W_0F3836
) },
7166 /* VEX_LEN_0F3841 */
7168 { "vphminposuw", { XM
, EXx
}, PREFIX_DATA
},
7171 /* VEX_LEN_0F3849_X86_64_P_0_W_0_M_0 */
7173 { "ldtilecfg", { M
}, 0 },
7176 /* VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0 */
7178 { "tilerelease", { Skip_MODRM
}, 0 },
7181 /* VEX_LEN_0F3849_X86_64_P_2_W_0_M_0 */
7183 { "sttilecfg", { M
}, 0 },
7186 /* VEX_LEN_0F3849_X86_64_P_3_W_0_M_0 */
7188 { "tilezero", { TMM
, Skip_MODRM
}, 0 },
7191 /* VEX_LEN_0F384B_X86_64_P_1_W_0_M_0 */
7193 { "tilestored", { MVexSIBMEM
, TMM
}, 0 },
7195 /* VEX_LEN_0F384B_X86_64_P_2_W_0_M_0 */
7197 { "tileloaddt1", { TMM
, MVexSIBMEM
}, 0 },
7200 /* VEX_LEN_0F384B_X86_64_P_3_W_0_M_0 */
7202 { "tileloadd", { TMM
, MVexSIBMEM
}, 0 },
7205 /* VEX_LEN_0F385A_M_0 */
7208 { VEX_W_TABLE (VEX_W_0F385A_M_0_L_0
) },
7211 /* VEX_LEN_0F385C_X86_64_P_1_W_0_M_0 */
7213 { "tdpbf16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
7216 /* VEX_LEN_0F385C_X86_64_P_3_W_0_M_0 */
7218 { "tdpfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
7221 /* VEX_LEN_0F385E_X86_64_P_0_W_0_M_0 */
7223 { "tdpbuud", {TMM
, EXtmm
, VexTmm
}, 0 },
7226 /* VEX_LEN_0F385E_X86_64_P_1_W_0_M_0 */
7228 { "tdpbsud", {TMM
, EXtmm
, VexTmm
}, 0 },
7231 /* VEX_LEN_0F385E_X86_64_P_2_W_0_M_0 */
7233 { "tdpbusd", {TMM
, EXtmm
, VexTmm
}, 0 },
7236 /* VEX_LEN_0F385E_X86_64_P_3_W_0_M_0 */
7238 { "tdpbssd", {TMM
, EXtmm
, VexTmm
}, 0 },
7241 /* VEX_LEN_0F386C_X86_64_W_0_M_1 */
7243 { PREFIX_TABLE (PREFIX_VEX_0F386C_X86_64_W_0_M_1_L_0
) },
7246 /* VEX_LEN_0F38DB */
7248 { "vaesimc", { XM
, EXx
}, PREFIX_DATA
},
7251 /* VEX_LEN_0F38F2 */
7253 { "andnS", { Gdq
, VexGdq
, Edq
}, PREFIX_OPCODE
},
7256 /* VEX_LEN_0F38F3 */
7258 { REG_TABLE(REG_VEX_0F38F3_L_0
) },
7261 /* VEX_LEN_0F38F5 */
7263 { PREFIX_TABLE(PREFIX_VEX_0F38F5_L_0
) },
7266 /* VEX_LEN_0F38F6 */
7268 { PREFIX_TABLE(PREFIX_VEX_0F38F6_L_0
) },
7271 /* VEX_LEN_0F38F7 */
7273 { PREFIX_TABLE(PREFIX_VEX_0F38F7_L_0
) },
7276 /* VEX_LEN_0F3A00 */
7279 { VEX_W_TABLE (VEX_W_0F3A00_L_1
) },
7282 /* VEX_LEN_0F3A01 */
7285 { VEX_W_TABLE (VEX_W_0F3A01_L_1
) },
7288 /* VEX_LEN_0F3A06 */
7291 { VEX_W_TABLE (VEX_W_0F3A06_L_1
) },
7294 /* VEX_LEN_0F3A14 */
7296 { "%XEvpextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
7299 /* VEX_LEN_0F3A15 */
7301 { "%XEvpextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
7304 /* VEX_LEN_0F3A16 */
7306 { "%XEvpextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
7309 /* VEX_LEN_0F3A17 */
7311 { "%XEvextractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
7314 /* VEX_LEN_0F3A18 */
7317 { VEX_W_TABLE (VEX_W_0F3A18_L_1
) },
7320 /* VEX_LEN_0F3A19 */
7323 { VEX_W_TABLE (VEX_W_0F3A19_L_1
) },
7326 /* VEX_LEN_0F3A20 */
7328 { "%XEvpinsrb", { XM
, Vex
, Edb
, Ib
}, PREFIX_DATA
},
7331 /* VEX_LEN_0F3A21 */
7333 { "%XEvinsertps", { XM
, Vex
, EXd
, Ib
}, PREFIX_DATA
},
7336 /* VEX_LEN_0F3A22 */
7338 { "%XEvpinsrK", { XM
, Vex
, Edq
, Ib
}, PREFIX_DATA
},
7341 /* VEX_LEN_0F3A30 */
7343 { MOD_TABLE (MOD_VEX_0F3A30_L_0
) },
7346 /* VEX_LEN_0F3A31 */
7348 { MOD_TABLE (MOD_VEX_0F3A31_L_0
) },
7351 /* VEX_LEN_0F3A32 */
7353 { MOD_TABLE (MOD_VEX_0F3A32_L_0
) },
7356 /* VEX_LEN_0F3A33 */
7358 { MOD_TABLE (MOD_VEX_0F3A33_L_0
) },
7361 /* VEX_LEN_0F3A38 */
7364 { VEX_W_TABLE (VEX_W_0F3A38_L_1
) },
7367 /* VEX_LEN_0F3A39 */
7370 { VEX_W_TABLE (VEX_W_0F3A39_L_1
) },
7373 /* VEX_LEN_0F3A41 */
7375 { "vdppd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7378 /* VEX_LEN_0F3A46 */
7381 { VEX_W_TABLE (VEX_W_0F3A46_L_1
) },
7384 /* VEX_LEN_0F3A60 */
7386 { "vpcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7389 /* VEX_LEN_0F3A61 */
7391 { "vpcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7394 /* VEX_LEN_0F3A62 */
7396 { "vpcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7399 /* VEX_LEN_0F3A63 */
7401 { "vpcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7404 /* VEX_LEN_0F3ADF */
7406 { "vaeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7409 /* VEX_LEN_0F3AF0 */
7411 { PREFIX_TABLE (PREFIX_VEX_0F3AF0_L_0
) },
7414 /* VEX_LEN_0FXOP_08_85 */
7416 { VEX_W_TABLE (VEX_W_0FXOP_08_85_L_0
) },
7419 /* VEX_LEN_0FXOP_08_86 */
7421 { VEX_W_TABLE (VEX_W_0FXOP_08_86_L_0
) },
7424 /* VEX_LEN_0FXOP_08_87 */
7426 { VEX_W_TABLE (VEX_W_0FXOP_08_87_L_0
) },
7429 /* VEX_LEN_0FXOP_08_8E */
7431 { VEX_W_TABLE (VEX_W_0FXOP_08_8E_L_0
) },
7434 /* VEX_LEN_0FXOP_08_8F */
7436 { VEX_W_TABLE (VEX_W_0FXOP_08_8F_L_0
) },
7439 /* VEX_LEN_0FXOP_08_95 */
7441 { VEX_W_TABLE (VEX_W_0FXOP_08_95_L_0
) },
7444 /* VEX_LEN_0FXOP_08_96 */
7446 { VEX_W_TABLE (VEX_W_0FXOP_08_96_L_0
) },
7449 /* VEX_LEN_0FXOP_08_97 */
7451 { VEX_W_TABLE (VEX_W_0FXOP_08_97_L_0
) },
7454 /* VEX_LEN_0FXOP_08_9E */
7456 { VEX_W_TABLE (VEX_W_0FXOP_08_9E_L_0
) },
7459 /* VEX_LEN_0FXOP_08_9F */
7461 { VEX_W_TABLE (VEX_W_0FXOP_08_9F_L_0
) },
7464 /* VEX_LEN_0FXOP_08_A3 */
7466 { "vpperm", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7469 /* VEX_LEN_0FXOP_08_A6 */
7471 { VEX_W_TABLE (VEX_W_0FXOP_08_A6_L_0
) },
7474 /* VEX_LEN_0FXOP_08_B6 */
7476 { VEX_W_TABLE (VEX_W_0FXOP_08_B6_L_0
) },
7479 /* VEX_LEN_0FXOP_08_C0 */
7481 { VEX_W_TABLE (VEX_W_0FXOP_08_C0_L_0
) },
7484 /* VEX_LEN_0FXOP_08_C1 */
7486 { VEX_W_TABLE (VEX_W_0FXOP_08_C1_L_0
) },
7489 /* VEX_LEN_0FXOP_08_C2 */
7491 { VEX_W_TABLE (VEX_W_0FXOP_08_C2_L_0
) },
7494 /* VEX_LEN_0FXOP_08_C3 */
7496 { VEX_W_TABLE (VEX_W_0FXOP_08_C3_L_0
) },
7499 /* VEX_LEN_0FXOP_08_CC */
7501 { VEX_W_TABLE (VEX_W_0FXOP_08_CC_L_0
) },
7504 /* VEX_LEN_0FXOP_08_CD */
7506 { VEX_W_TABLE (VEX_W_0FXOP_08_CD_L_0
) },
7509 /* VEX_LEN_0FXOP_08_CE */
7511 { VEX_W_TABLE (VEX_W_0FXOP_08_CE_L_0
) },
7514 /* VEX_LEN_0FXOP_08_CF */
7516 { VEX_W_TABLE (VEX_W_0FXOP_08_CF_L_0
) },
7519 /* VEX_LEN_0FXOP_08_EC */
7521 { VEX_W_TABLE (VEX_W_0FXOP_08_EC_L_0
) },
7524 /* VEX_LEN_0FXOP_08_ED */
7526 { VEX_W_TABLE (VEX_W_0FXOP_08_ED_L_0
) },
7529 /* VEX_LEN_0FXOP_08_EE */
7531 { VEX_W_TABLE (VEX_W_0FXOP_08_EE_L_0
) },
7534 /* VEX_LEN_0FXOP_08_EF */
7536 { VEX_W_TABLE (VEX_W_0FXOP_08_EF_L_0
) },
7539 /* VEX_LEN_0FXOP_09_01 */
7541 { REG_TABLE (REG_XOP_09_01_L_0
) },
7544 /* VEX_LEN_0FXOP_09_02 */
7546 { REG_TABLE (REG_XOP_09_02_L_0
) },
7549 /* VEX_LEN_0FXOP_09_12_M_1 */
7551 { REG_TABLE (REG_XOP_09_12_M_1_L_0
) },
7554 /* VEX_LEN_0FXOP_09_82_W_0 */
7556 { "vfrczss", { XM
, EXd
}, 0 },
7559 /* VEX_LEN_0FXOP_09_83_W_0 */
7561 { "vfrczsd", { XM
, EXq
}, 0 },
7564 /* VEX_LEN_0FXOP_09_90 */
7566 { "vprotb", { XM
, EXx
, VexW
}, 0 },
7569 /* VEX_LEN_0FXOP_09_91 */
7571 { "vprotw", { XM
, EXx
, VexW
}, 0 },
7574 /* VEX_LEN_0FXOP_09_92 */
7576 { "vprotd", { XM
, EXx
, VexW
}, 0 },
7579 /* VEX_LEN_0FXOP_09_93 */
7581 { "vprotq", { XM
, EXx
, VexW
}, 0 },
7584 /* VEX_LEN_0FXOP_09_94 */
7586 { "vpshlb", { XM
, EXx
, VexW
}, 0 },
7589 /* VEX_LEN_0FXOP_09_95 */
7591 { "vpshlw", { XM
, EXx
, VexW
}, 0 },
7594 /* VEX_LEN_0FXOP_09_96 */
7596 { "vpshld", { XM
, EXx
, VexW
}, 0 },
7599 /* VEX_LEN_0FXOP_09_97 */
7601 { "vpshlq", { XM
, EXx
, VexW
}, 0 },
7604 /* VEX_LEN_0FXOP_09_98 */
7606 { "vpshab", { XM
, EXx
, VexW
}, 0 },
7609 /* VEX_LEN_0FXOP_09_99 */
7611 { "vpshaw", { XM
, EXx
, VexW
}, 0 },
7614 /* VEX_LEN_0FXOP_09_9A */
7616 { "vpshad", { XM
, EXx
, VexW
}, 0 },
7619 /* VEX_LEN_0FXOP_09_9B */
7621 { "vpshaq", { XM
, EXx
, VexW
}, 0 },
7624 /* VEX_LEN_0FXOP_09_C1 */
7626 { VEX_W_TABLE (VEX_W_0FXOP_09_C1_L_0
) },
7629 /* VEX_LEN_0FXOP_09_C2 */
7631 { VEX_W_TABLE (VEX_W_0FXOP_09_C2_L_0
) },
7634 /* VEX_LEN_0FXOP_09_C3 */
7636 { VEX_W_TABLE (VEX_W_0FXOP_09_C3_L_0
) },
7639 /* VEX_LEN_0FXOP_09_C6 */
7641 { VEX_W_TABLE (VEX_W_0FXOP_09_C6_L_0
) },
7644 /* VEX_LEN_0FXOP_09_C7 */
7646 { VEX_W_TABLE (VEX_W_0FXOP_09_C7_L_0
) },
7649 /* VEX_LEN_0FXOP_09_CB */
7651 { VEX_W_TABLE (VEX_W_0FXOP_09_CB_L_0
) },
7654 /* VEX_LEN_0FXOP_09_D1 */
7656 { VEX_W_TABLE (VEX_W_0FXOP_09_D1_L_0
) },
7659 /* VEX_LEN_0FXOP_09_D2 */
7661 { VEX_W_TABLE (VEX_W_0FXOP_09_D2_L_0
) },
7664 /* VEX_LEN_0FXOP_09_D3 */
7666 { VEX_W_TABLE (VEX_W_0FXOP_09_D3_L_0
) },
7669 /* VEX_LEN_0FXOP_09_D6 */
7671 { VEX_W_TABLE (VEX_W_0FXOP_09_D6_L_0
) },
7674 /* VEX_LEN_0FXOP_09_D7 */
7676 { VEX_W_TABLE (VEX_W_0FXOP_09_D7_L_0
) },
7679 /* VEX_LEN_0FXOP_09_DB */
7681 { VEX_W_TABLE (VEX_W_0FXOP_09_DB_L_0
) },
7684 /* VEX_LEN_0FXOP_09_E1 */
7686 { VEX_W_TABLE (VEX_W_0FXOP_09_E1_L_0
) },
7689 /* VEX_LEN_0FXOP_09_E2 */
7691 { VEX_W_TABLE (VEX_W_0FXOP_09_E2_L_0
) },
7694 /* VEX_LEN_0FXOP_09_E3 */
7696 { VEX_W_TABLE (VEX_W_0FXOP_09_E3_L_0
) },
7699 /* VEX_LEN_0FXOP_0A_12 */
7701 { REG_TABLE (REG_XOP_0A_12_L_0
) },
7705 #include "i386-dis-evex-len.h"
7707 static const struct dis386 vex_w_table
[][2] = {
7709 /* VEX_W_0F41_L_1_M_1 */
7710 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_0
) },
7711 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_1
) },
7714 /* VEX_W_0F42_L_1_M_1 */
7715 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_0
) },
7716 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_1
) },
7719 /* VEX_W_0F44_L_0_M_1 */
7720 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_0
) },
7721 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_1
) },
7724 /* VEX_W_0F45_L_1_M_1 */
7725 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_0
) },
7726 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_1
) },
7729 /* VEX_W_0F46_L_1_M_1 */
7730 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_0
) },
7731 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_1
) },
7734 /* VEX_W_0F47_L_1_M_1 */
7735 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_0
) },
7736 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_1
) },
7739 /* VEX_W_0F4A_L_1_M_1 */
7740 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_0
) },
7741 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_1
) },
7744 /* VEX_W_0F4B_L_1_M_1 */
7745 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_0
) },
7746 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_1
) },
7749 /* VEX_W_0F90_L_0 */
7750 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_0
) },
7751 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_1
) },
7754 /* VEX_W_0F91_L_0_M_0 */
7755 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_0
) },
7756 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_1
) },
7759 /* VEX_W_0F92_L_0_M_1 */
7760 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_0
) },
7761 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_1
) },
7764 /* VEX_W_0F93_L_0_M_1 */
7765 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_0
) },
7766 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_1
) },
7769 /* VEX_W_0F98_L_0_M_1 */
7770 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_0
) },
7771 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_1
) },
7774 /* VEX_W_0F99_L_0_M_1 */
7775 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_0
) },
7776 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_1
) },
7780 { "%XEvpermilps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7784 { "vpermilpd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7788 { "vtestps", { XM
, EXx
}, PREFIX_DATA
},
7792 { "vtestpd", { XM
, EXx
}, PREFIX_DATA
},
7796 { "vcvtph2ps", { XM
, EXxmmq
}, PREFIX_DATA
},
7799 /* VEX_W_0F3816_L_1 */
7800 { "vpermps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7804 { "%XEvbroadcastss", { XM
, EXd
}, PREFIX_DATA
},
7807 /* VEX_W_0F3819_L_1 */
7808 { "vbroadcastsd", { XM
, EXq
}, PREFIX_DATA
},
7811 /* VEX_W_0F381A_M_0_L_1 */
7812 { "vbroadcastf128", { XM
, Mxmm
}, PREFIX_DATA
},
7815 /* VEX_W_0F382C_M_0 */
7816 { "vmaskmovps", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7819 /* VEX_W_0F382D_M_0 */
7820 { "vmaskmovpd", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7823 /* VEX_W_0F382E_M_0 */
7824 { "vmaskmovps", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7827 /* VEX_W_0F382F_M_0 */
7828 { "vmaskmovpd", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7832 { "vpermd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7836 { "vpsravd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7839 /* VEX_W_0F3849_X86_64_P_0 */
7840 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_0_W_0
) },
7843 /* VEX_W_0F3849_X86_64_P_2 */
7844 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_2_W_0
) },
7847 /* VEX_W_0F3849_X86_64_P_3 */
7848 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_3_W_0
) },
7851 /* VEX_W_0F384B_X86_64_P_1 */
7852 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_1_W_0
) },
7855 /* VEX_W_0F384B_X86_64_P_2 */
7856 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_2_W_0
) },
7859 /* VEX_W_0F384B_X86_64_P_3 */
7860 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_3_W_0
) },
7864 { PREFIX_TABLE (PREFIX_VEX_0F3850_W_0
) },
7868 { PREFIX_TABLE (PREFIX_VEX_0F3851_W_0
) },
7872 { "%XVvpdpwssd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7876 { "%XVvpdpwssds", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7880 { "%XEvpbroadcastd", { XM
, EXd
}, PREFIX_DATA
},
7884 { "vpbroadcastq", { XM
, EXq
}, PREFIX_DATA
},
7887 /* VEX_W_0F385A_M_0_L_0 */
7888 { "vbroadcasti128", { XM
, Mxmm
}, PREFIX_DATA
},
7891 /* VEX_W_0F385C_X86_64_P_1 */
7892 { MOD_TABLE (MOD_VEX_0F385C_X86_64_P_1_W_0
) },
7895 /* VEX_W_0F385C_X86_64_P_3 */
7896 { MOD_TABLE (MOD_VEX_0F385C_X86_64_P_3_W_0
) },
7899 /* VEX_W_0F385E_X86_64_P_0 */
7900 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_0_W_0
) },
7903 /* VEX_W_0F385E_X86_64_P_1 */
7904 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_1_W_0
) },
7907 /* VEX_W_0F385E_X86_64_P_2 */
7908 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_2_W_0
) },
7911 /* VEX_W_0F385E_X86_64_P_3 */
7912 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_3_W_0
) },
7915 /* VEX_W_0F386C_X86_64 */
7916 { MOD_TABLE (MOD_VEX_0F386C_X86_64_W_0
) },
7919 /* VEX_W_0F3872_P_1 */
7920 { "%XVvcvtneps2bf16%XY", { XMM
, EXx
}, 0 },
7924 { "%XEvpbroadcastb", { XM
, EXb
}, PREFIX_DATA
},
7928 { "%XEvpbroadcastw", { XM
, EXw
}, PREFIX_DATA
},
7932 { PREFIX_TABLE (PREFIX_VEX_0F38B0_W_0
) },
7936 { PREFIX_TABLE (PREFIX_VEX_0F38B1_W_0
) },
7941 { "%XVvpmadd52luq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7946 { "%XVvpmadd52huq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7950 { "%XEvgf2p8mulb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7953 /* VEX_W_0F3A00_L_1 */
7955 { "%XEvpermq", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7958 /* VEX_W_0F3A01_L_1 */
7960 { "%XEvpermpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7964 { "vpblendd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7968 { "%XEvpermilps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7972 { "vpermilpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7975 /* VEX_W_0F3A06_L_1 */
7976 { "vperm2f128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7979 /* VEX_W_0F3A18_L_1 */
7980 { "vinsertf128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7983 /* VEX_W_0F3A19_L_1 */
7984 { "vextractf128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7988 { "%XEvcvtps2ph", { EXxmmq
, XM
, EXxEVexS
, Ib
}, PREFIX_DATA
},
7991 /* VEX_W_0F3A38_L_1 */
7992 { "vinserti128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7995 /* VEX_W_0F3A39_L_1 */
7996 { "vextracti128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7999 /* VEX_W_0F3A46_L_1 */
8000 { "vperm2i128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
8004 { "vblendvps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
8008 { "vblendvpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
8012 { "vpblendvb", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
8017 { "%XEvgf2p8affineqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
8022 { "%XEvgf2p8affineinvqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
8024 /* VEX_W_0FXOP_08_85_L_0 */
8026 { "vpmacssww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8028 /* VEX_W_0FXOP_08_86_L_0 */
8030 { "vpmacsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8032 /* VEX_W_0FXOP_08_87_L_0 */
8034 { "vpmacssdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8036 /* VEX_W_0FXOP_08_8E_L_0 */
8038 { "vpmacssdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8040 /* VEX_W_0FXOP_08_8F_L_0 */
8042 { "vpmacssdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8044 /* VEX_W_0FXOP_08_95_L_0 */
8046 { "vpmacsww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8048 /* VEX_W_0FXOP_08_96_L_0 */
8050 { "vpmacswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8052 /* VEX_W_0FXOP_08_97_L_0 */
8054 { "vpmacsdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8056 /* VEX_W_0FXOP_08_9E_L_0 */
8058 { "vpmacsdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8060 /* VEX_W_0FXOP_08_9F_L_0 */
8062 { "vpmacsdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8064 /* VEX_W_0FXOP_08_A6_L_0 */
8066 { "vpmadcsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8068 /* VEX_W_0FXOP_08_B6_L_0 */
8070 { "vpmadcswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8072 /* VEX_W_0FXOP_08_C0_L_0 */
8074 { "vprotb", { XM
, EXx
, Ib
}, 0 },
8076 /* VEX_W_0FXOP_08_C1_L_0 */
8078 { "vprotw", { XM
, EXx
, Ib
}, 0 },
8080 /* VEX_W_0FXOP_08_C2_L_0 */
8082 { "vprotd", { XM
, EXx
, Ib
}, 0 },
8084 /* VEX_W_0FXOP_08_C3_L_0 */
8086 { "vprotq", { XM
, EXx
, Ib
}, 0 },
8088 /* VEX_W_0FXOP_08_CC_L_0 */
8090 { "vpcomb", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8092 /* VEX_W_0FXOP_08_CD_L_0 */
8094 { "vpcomw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8096 /* VEX_W_0FXOP_08_CE_L_0 */
8098 { "vpcomd", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8100 /* VEX_W_0FXOP_08_CF_L_0 */
8102 { "vpcomq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8104 /* VEX_W_0FXOP_08_EC_L_0 */
8106 { "vpcomub", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8108 /* VEX_W_0FXOP_08_ED_L_0 */
8110 { "vpcomuw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8112 /* VEX_W_0FXOP_08_EE_L_0 */
8114 { "vpcomud", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8116 /* VEX_W_0FXOP_08_EF_L_0 */
8118 { "vpcomuq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8120 /* VEX_W_0FXOP_09_80 */
8122 { "vfrczps", { XM
, EXx
}, 0 },
8124 /* VEX_W_0FXOP_09_81 */
8126 { "vfrczpd", { XM
, EXx
}, 0 },
8128 /* VEX_W_0FXOP_09_82 */
8130 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_82_W_0
) },
8132 /* VEX_W_0FXOP_09_83 */
8134 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_83_W_0
) },
8136 /* VEX_W_0FXOP_09_C1_L_0 */
8138 { "vphaddbw", { XM
, EXxmm
}, 0 },
8140 /* VEX_W_0FXOP_09_C2_L_0 */
8142 { "vphaddbd", { XM
, EXxmm
}, 0 },
8144 /* VEX_W_0FXOP_09_C3_L_0 */
8146 { "vphaddbq", { XM
, EXxmm
}, 0 },
8148 /* VEX_W_0FXOP_09_C6_L_0 */
8150 { "vphaddwd", { XM
, EXxmm
}, 0 },
8152 /* VEX_W_0FXOP_09_C7_L_0 */
8154 { "vphaddwq", { XM
, EXxmm
}, 0 },
8156 /* VEX_W_0FXOP_09_CB_L_0 */
8158 { "vphadddq", { XM
, EXxmm
}, 0 },
8160 /* VEX_W_0FXOP_09_D1_L_0 */
8162 { "vphaddubw", { XM
, EXxmm
}, 0 },
8164 /* VEX_W_0FXOP_09_D2_L_0 */
8166 { "vphaddubd", { XM
, EXxmm
}, 0 },
8168 /* VEX_W_0FXOP_09_D3_L_0 */
8170 { "vphaddubq", { XM
, EXxmm
}, 0 },
8172 /* VEX_W_0FXOP_09_D6_L_0 */
8174 { "vphadduwd", { XM
, EXxmm
}, 0 },
8176 /* VEX_W_0FXOP_09_D7_L_0 */
8178 { "vphadduwq", { XM
, EXxmm
}, 0 },
8180 /* VEX_W_0FXOP_09_DB_L_0 */
8182 { "vphaddudq", { XM
, EXxmm
}, 0 },
8184 /* VEX_W_0FXOP_09_E1_L_0 */
8186 { "vphsubbw", { XM
, EXxmm
}, 0 },
8188 /* VEX_W_0FXOP_09_E2_L_0 */
8190 { "vphsubwd", { XM
, EXxmm
}, 0 },
8192 /* VEX_W_0FXOP_09_E3_L_0 */
8194 { "vphsubdq", { XM
, EXxmm
}, 0 },
8197 #include "i386-dis-evex-w.h"
8200 static const struct dis386 mod_table
[][2] = {
8203 { "bound{S|}", { Gv
, Ma
}, 0 },
8204 { EVEX_TABLE (EVEX_0F
) },
8208 { "leaS", { Gv
, M
}, 0 },
8212 { "lesS", { Gv
, Mp
}, 0 },
8213 { VEX_C4_TABLE (VEX_0F
) },
8217 { "ldsS", { Gv
, Mp
}, 0 },
8218 { VEX_C5_TABLE (VEX_0F
) },
8223 { RM_TABLE (RM_C6_REG_7
) },
8228 { RM_TABLE (RM_C7_REG_7
) },
8232 { "{l|}call^", { indirEp
}, 0 },
8236 { "{l|}jmp^", { indirEp
}, 0 },
8239 /* MOD_0F01_REG_0 */
8240 { X86_64_TABLE (X86_64_0F01_REG_0
) },
8241 { RM_TABLE (RM_0F01_REG_0
) },
8244 /* MOD_0F01_REG_1 */
8245 { X86_64_TABLE (X86_64_0F01_REG_1
) },
8246 { RM_TABLE (RM_0F01_REG_1
) },
8249 /* MOD_0F01_REG_2 */
8250 { X86_64_TABLE (X86_64_0F01_REG_2
) },
8251 { RM_TABLE (RM_0F01_REG_2
) },
8254 /* MOD_0F01_REG_3 */
8255 { X86_64_TABLE (X86_64_0F01_REG_3
) },
8256 { RM_TABLE (RM_0F01_REG_3
) },
8259 /* MOD_0F01_REG_5 */
8260 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_0
) },
8261 { RM_TABLE (RM_0F01_REG_5_MOD_3
) },
8264 /* MOD_0F01_REG_7 */
8265 { "invlpg", { Mb
}, 0 },
8266 { RM_TABLE (RM_0F01_REG_7_MOD_3
) },
8270 { "larS", { Gv
, Mw
}, 0 },
8271 { "larS", { Gv
, Ev
}, 0 },
8275 { "lslS", { Gv
, Mw
}, 0 },
8276 { "lslS", { Gv
, Ev
}, 0 },
8279 /* MOD_0F12_PREFIX_0 */
8280 { "movlpX", { XM
, EXq
}, 0 },
8281 { "movhlps", { XM
, EXq
}, 0 },
8284 /* MOD_0F12_PREFIX_2 */
8285 { "movlpX", { XM
, EXq
}, 0 },
8289 { "movlpX", { EXq
, XM
}, PREFIX_OPCODE
},
8292 /* MOD_0F16_PREFIX_0 */
8293 { "movhpX", { XM
, EXq
}, 0 },
8294 { "movlhps", { XM
, EXq
}, 0 },
8297 /* MOD_0F16_PREFIX_2 */
8298 { "movhpX", { XM
, EXq
}, 0 },
8302 { "movhpX", { EXq
, XM
}, PREFIX_OPCODE
},
8305 /* MOD_0F18_REG_0 */
8306 { "prefetchnta", { Mb
}, 0 },
8307 { "nopQ", { Ev
}, 0 },
8310 /* MOD_0F18_REG_1 */
8311 { "prefetcht0", { Mb
}, 0 },
8312 { "nopQ", { Ev
}, 0 },
8315 /* MOD_0F18_REG_2 */
8316 { "prefetcht1", { Mb
}, 0 },
8317 { "nopQ", { Ev
}, 0 },
8320 /* MOD_0F18_REG_3 */
8321 { "prefetcht2", { Mb
}, 0 },
8322 { "nopQ", { Ev
}, 0 },
8325 /* MOD_0F18_REG_6 */
8326 { X86_64_TABLE (X86_64_0F18_REG_6_MOD_0
) },
8327 { "nopQ", { Ev
}, 0 },
8330 /* MOD_0F18_REG_7 */
8331 { X86_64_TABLE (X86_64_0F18_REG_7_MOD_0
) },
8332 { "nopQ", { Ev
}, 0 },
8335 /* MOD_0F1A_PREFIX_0 */
8336 { "bndldx", { Gbnd
, Mv_bnd
}, 0 },
8337 { "nopQ", { Ev
}, 0 },
8340 /* MOD_0F1B_PREFIX_0 */
8341 { "bndstx", { Mv_bnd
, Gbnd
}, 0 },
8342 { "nopQ", { Ev
}, 0 },
8345 /* MOD_0F1B_PREFIX_1 */
8346 { "bndmk", { Gbnd
, Mv_bnd
}, 0 },
8347 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8350 /* MOD_0F1C_PREFIX_0 */
8351 { REG_TABLE (REG_0F1C_P_0_MOD_0
) },
8352 { "nopQ", { Ev
}, 0 },
8355 /* MOD_0F1E_PREFIX_1 */
8356 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8357 { REG_TABLE (REG_0F1E_P_1_MOD_3
) },
8360 /* MOD_0F2B_PREFIX_0 */
8361 {"movntps", { Mx
, XM
}, PREFIX_OPCODE
},
8364 /* MOD_0F2B_PREFIX_1 */
8365 {"movntss", { Md
, XM
}, PREFIX_OPCODE
},
8368 /* MOD_0F2B_PREFIX_2 */
8369 {"movntpd", { Mx
, XM
}, PREFIX_OPCODE
},
8372 /* MOD_0F2B_PREFIX_3 */
8373 {"movntsd", { Mq
, XM
}, PREFIX_OPCODE
},
8378 { "movmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8383 { REG_TABLE (REG_0F71_MOD_0
) },
8388 { REG_TABLE (REG_0F72_MOD_0
) },
8393 { REG_TABLE (REG_0F73_MOD_0
) },
8396 /* MOD_0FAE_REG_0 */
8397 { "fxsave", { FXSAVE
}, 0 },
8398 { PREFIX_TABLE (PREFIX_0FAE_REG_0_MOD_3
) },
8401 /* MOD_0FAE_REG_1 */
8402 { "fxrstor", { FXSAVE
}, 0 },
8403 { PREFIX_TABLE (PREFIX_0FAE_REG_1_MOD_3
) },
8406 /* MOD_0FAE_REG_2 */
8407 { "ldmxcsr", { Md
}, 0 },
8408 { PREFIX_TABLE (PREFIX_0FAE_REG_2_MOD_3
) },
8411 /* MOD_0FAE_REG_3 */
8412 { "stmxcsr", { Md
}, 0 },
8413 { PREFIX_TABLE (PREFIX_0FAE_REG_3_MOD_3
) },
8416 /* MOD_0FAE_REG_4 */
8417 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_0
) },
8418 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_3
) },
8421 /* MOD_0FAE_REG_5 */
8422 { "xrstor", { FXSAVE
}, PREFIX_OPCODE
},
8423 { PREFIX_TABLE (PREFIX_0FAE_REG_5_MOD_3
) },
8426 /* MOD_0FAE_REG_6 */
8427 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_0
) },
8428 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_3
) },
8431 /* MOD_0FAE_REG_7 */
8432 { PREFIX_TABLE (PREFIX_0FAE_REG_7_MOD_0
) },
8433 { RM_TABLE (RM_0FAE_REG_7_MOD_3
) },
8437 { "lssS", { Gv
, Mp
}, 0 },
8441 { "lfsS", { Gv
, Mp
}, 0 },
8445 { "lgsS", { Gv
, Mp
}, 0 },
8449 { "movntiS", { Edq
, Gdq
}, PREFIX_OPCODE
},
8452 /* MOD_0FC7_REG_3 */
8453 { "xrstors", { FXSAVE
}, 0 },
8456 /* MOD_0FC7_REG_4 */
8457 { "xsavec", { FXSAVE
}, 0 },
8460 /* MOD_0FC7_REG_5 */
8461 { "xsaves", { FXSAVE
}, 0 },
8464 /* MOD_0FC7_REG_6 */
8465 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_0
) },
8466 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_3
) }
8469 /* MOD_0FC7_REG_7 */
8470 { "vmptrst", { Mq
}, 0 },
8471 { PREFIX_TABLE (PREFIX_0FC7_REG_7_MOD_3
) }
8476 { "pmovmskb", { Gdq
, MS
}, 0 },
8479 /* MOD_0FE7_PREFIX_2 */
8480 { "movntdq", { Mx
, XM
}, 0 },
8483 /* MOD_0FF0_PREFIX_3 */
8484 { "lddqu", { XM
, M
}, 0 },
8488 { "movntdqa", { XM
, Mx
}, PREFIX_DATA
},
8491 /* MOD_0F38DC_PREFIX_1 */
8492 { "aesenc128kl", { XM
, M
}, 0 },
8493 { "loadiwkey", { XM
, EXx
}, 0 },
8496 /* MOD_0F38DD_PREFIX_1 */
8497 { "aesdec128kl", { XM
, M
}, 0 },
8500 /* MOD_0F38DE_PREFIX_1 */
8501 { "aesenc256kl", { XM
, M
}, 0 },
8504 /* MOD_0F38DF_PREFIX_1 */
8505 { "aesdec256kl", { XM
, M
}, 0 },
8509 { "wrussK", { M
, Gdq
}, PREFIX_DATA
},
8512 /* MOD_0F38F6_PREFIX_0 */
8513 { "wrssK", { M
, Gdq
}, PREFIX_OPCODE
},
8516 /* MOD_0F38F8_PREFIX_1 */
8517 { "enqcmds", { Gva
, M
}, PREFIX_OPCODE
},
8520 /* MOD_0F38F8_PREFIX_2 */
8521 { "movdir64b", { Gva
, M
}, PREFIX_OPCODE
},
8524 /* MOD_0F38F8_PREFIX_3 */
8525 { "enqcmd", { Gva
, M
}, PREFIX_OPCODE
},
8529 { "movdiri", { Edq
, Gdq
}, PREFIX_OPCODE
},
8532 /* MOD_0F38FA_PREFIX_1 */
8534 { "encodekey128", { Gd
, Ed
}, 0 },
8537 /* MOD_0F38FB_PREFIX_1 */
8539 { "encodekey256", { Gd
, Ed
}, 0 },
8542 /* MOD_0F3A0F_PREFIX_1 */
8544 { REG_TABLE (REG_0F3A0F_PREFIX_1_MOD_3
) },
8547 /* MOD_VEX_0F12_PREFIX_0 */
8548 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0
) },
8549 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1
) },
8552 /* MOD_VEX_0F12_PREFIX_2 */
8553 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2_M_0
) },
8557 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0
) },
8560 /* MOD_VEX_0F16_PREFIX_0 */
8561 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0
) },
8562 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1
) },
8565 /* MOD_VEX_0F16_PREFIX_2 */
8566 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2_M_0
) },
8570 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0
) },
8574 { "%XEvmovntpX", { Mx
, XM
}, PREFIX_OPCODE
},
8577 /* MOD_VEX_0F41_L_1 */
8579 { VEX_W_TABLE (VEX_W_0F41_L_1_M_1
) },
8582 /* MOD_VEX_0F42_L_1 */
8584 { VEX_W_TABLE (VEX_W_0F42_L_1_M_1
) },
8587 /* MOD_VEX_0F44_L_0 */
8589 { VEX_W_TABLE (VEX_W_0F44_L_0_M_1
) },
8592 /* MOD_VEX_0F45_L_1 */
8594 { VEX_W_TABLE (VEX_W_0F45_L_1_M_1
) },
8597 /* MOD_VEX_0F46_L_1 */
8599 { VEX_W_TABLE (VEX_W_0F46_L_1_M_1
) },
8602 /* MOD_VEX_0F47_L_1 */
8604 { VEX_W_TABLE (VEX_W_0F47_L_1_M_1
) },
8607 /* MOD_VEX_0F4A_L_1 */
8609 { VEX_W_TABLE (VEX_W_0F4A_L_1_M_1
) },
8612 /* MOD_VEX_0F4B_L_1 */
8614 { VEX_W_TABLE (VEX_W_0F4B_L_1_M_1
) },
8619 { "vmovmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8624 { REG_TABLE (REG_VEX_0F71_M_0
) },
8629 { REG_TABLE (REG_VEX_0F72_M_0
) },
8634 { REG_TABLE (REG_VEX_0F73_M_0
) },
8637 /* MOD_VEX_0F91_L_0 */
8638 { VEX_W_TABLE (VEX_W_0F91_L_0_M_0
) },
8641 /* MOD_VEX_0F92_L_0 */
8643 { VEX_W_TABLE (VEX_W_0F92_L_0_M_1
) },
8646 /* MOD_VEX_0F93_L_0 */
8648 { VEX_W_TABLE (VEX_W_0F93_L_0_M_1
) },
8651 /* MOD_VEX_0F98_L_0 */
8653 { VEX_W_TABLE (VEX_W_0F98_L_0_M_1
) },
8656 /* MOD_VEX_0F99_L_0 */
8658 { VEX_W_TABLE (VEX_W_0F99_L_0_M_1
) },
8661 /* MOD_VEX_0FAE_REG_2 */
8662 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0
) },
8665 /* MOD_VEX_0FAE_REG_3 */
8666 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0
) },
8671 { "vpmovmskb", { Gdq
, XS
}, PREFIX_DATA
},
8675 { "vmovntdq", { Mx
, XM
}, PREFIX_DATA
},
8678 /* MOD_VEX_0FF0_PREFIX_3 */
8679 { "vlddqu", { XM
, M
}, 0 },
8682 /* MOD_VEX_0F381A */
8683 { VEX_LEN_TABLE (VEX_LEN_0F381A_M_0
) },
8686 /* MOD_VEX_0F382A */
8687 { "vmovntdqa", { XM
, Mx
}, PREFIX_DATA
},
8690 /* MOD_VEX_0F382C */
8691 { VEX_W_TABLE (VEX_W_0F382C_M_0
) },
8694 /* MOD_VEX_0F382D */
8695 { VEX_W_TABLE (VEX_W_0F382D_M_0
) },
8698 /* MOD_VEX_0F382E */
8699 { VEX_W_TABLE (VEX_W_0F382E_M_0
) },
8702 /* MOD_VEX_0F382F */
8703 { VEX_W_TABLE (VEX_W_0F382F_M_0
) },
8706 /* MOD_VEX_0F3849_X86_64_P_0_W_0 */
8707 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_0_W_0_M_0
) },
8708 { REG_TABLE (REG_VEX_0F3849_X86_64_P_0_W_0_M_1
) },
8711 /* MOD_VEX_0F3849_X86_64_P_2_W_0 */
8712 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_2_W_0_M_0
) },
8715 /* MOD_VEX_0F3849_X86_64_P_3_W_0 */
8717 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_3_W_0_M_0
) },
8720 /* MOD_VEX_0F384B_X86_64_P_1_W_0 */
8721 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_1_W_0_M_0
) },
8724 /* MOD_VEX_0F384B_X86_64_P_2_W_0 */
8725 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_2_W_0_M_0
) },
8728 /* MOD_VEX_0F384B_X86_64_P_3_W_0 */
8729 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_3_W_0_M_0
) },
8732 /* MOD_VEX_0F385A */
8733 { VEX_LEN_TABLE (VEX_LEN_0F385A_M_0
) },
8736 /* MOD_VEX_0F385C_X86_64_P_1_W_0 */
8738 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_P_1_W_0_M_0
) },
8741 /* MOD_VEX_0F385C_X86_64_P_3_W_0 */
8743 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_P_3_W_0_M_0
) },
8746 /* MOD_VEX_0F385E_X86_64_P_0_W_0 */
8748 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_0_W_0_M_0
) },
8751 /* MOD_VEX_0F385E_X86_64_P_1_W_0 */
8753 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_1_W_0_M_0
) },
8756 /* MOD_VEX_0F385E_X86_64_P_2_W_0 */
8758 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_2_W_0_M_0
) },
8761 /* MOD_VEX_0F385E_X86_64_P_3_W_0 */
8763 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_3_W_0_M_0
) },
8766 /* MOD_VEX_0F386C_X86_64_W_0 */
8768 { VEX_LEN_TABLE (VEX_LEN_0F386C_X86_64_W_0_M_1
) },
8771 /* MOD_VEX_0F388C */
8772 { "vpmaskmov%DQ", { XM
, Vex
, Mx
}, PREFIX_DATA
},
8775 /* MOD_VEX_0F388E */
8776 { "vpmaskmov%DQ", { Mx
, Vex
, XM
}, PREFIX_DATA
},
8779 /* MOD_VEX_0F3A30_L_0 */
8781 { "kshiftr%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8784 /* MOD_VEX_0F3A31_L_0 */
8786 { "kshiftr%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8789 /* MOD_VEX_0F3A32_L_0 */
8791 { "kshiftl%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8794 /* MOD_VEX_0F3A33_L_0 */
8796 { "kshiftl%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8801 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_12_M_1
) },
8804 #include "i386-dis-evex-mod.h"
8807 static const struct dis386 rm_table
[][8] = {
8810 { "xabort", { Skip_MODRM
, Ib
}, 0 },
8814 { "xbeginT", { Skip_MODRM
, Jdqw
}, 0 },
8818 { "enclv", { Skip_MODRM
}, 0 },
8819 { "vmcall", { Skip_MODRM
}, 0 },
8820 { "vmlaunch", { Skip_MODRM
}, 0 },
8821 { "vmresume", { Skip_MODRM
}, 0 },
8822 { "vmxoff", { Skip_MODRM
}, 0 },
8823 { "pconfig", { Skip_MODRM
}, 0 },
8824 { PREFIX_TABLE (PREFIX_0F01_REG_0_MOD_3_RM_6
) },
8828 { "monitor", { { OP_Monitor
, 0 } }, 0 },
8829 { "mwait", { { OP_Mwait
, 0 } }, 0 },
8830 { "clac", { Skip_MODRM
}, 0 },
8831 { "stac", { Skip_MODRM
}, 0 },
8832 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_4
) },
8833 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_5
) },
8834 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_6
) },
8835 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_7
) },
8839 { "xgetbv", { Skip_MODRM
}, 0 },
8840 { "xsetbv", { Skip_MODRM
}, 0 },
8843 { "vmfunc", { Skip_MODRM
}, 0 },
8844 { "xend", { Skip_MODRM
}, 0 },
8845 { "xtest", { Skip_MODRM
}, 0 },
8846 { "enclu", { Skip_MODRM
}, 0 },
8850 { "vmrun", { Skip_MODRM
}, 0 },
8851 { PREFIX_TABLE (PREFIX_0F01_REG_3_RM_1
) },
8852 { "vmload", { Skip_MODRM
}, 0 },
8853 { "vmsave", { Skip_MODRM
}, 0 },
8854 { "stgi", { Skip_MODRM
}, 0 },
8855 { "clgi", { Skip_MODRM
}, 0 },
8856 { "skinit", { Skip_MODRM
}, 0 },
8857 { "invlpga", { Skip_MODRM
}, 0 },
8860 /* RM_0F01_REG_5_MOD_3 */
8861 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_0
) },
8862 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_1
) },
8863 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_2
) },
8865 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_4
) },
8866 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_5
) },
8867 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_6
) },
8868 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_7
) },
8871 /* RM_0F01_REG_7_MOD_3 */
8872 { "swapgs", { Skip_MODRM
}, 0 },
8873 { "rdtscp", { Skip_MODRM
}, 0 },
8874 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_2
) },
8875 { "mwaitx", { { OP_Mwait
, eBX_reg
} }, PREFIX_OPCODE
},
8876 { "clzero", { Skip_MODRM
}, 0 },
8877 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_5
) },
8878 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_6
) },
8879 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_7
) },
8882 /* RM_0F1E_P_1_MOD_3_REG_7 */
8883 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8884 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8885 { "endbr64", { Skip_MODRM
}, 0 },
8886 { "endbr32", { Skip_MODRM
}, 0 },
8887 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8888 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8889 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8890 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8893 /* RM_0FAE_REG_6_MOD_3 */
8894 { "mfence", { Skip_MODRM
}, 0 },
8897 /* RM_0FAE_REG_7_MOD_3 */
8898 { "sfence", { Skip_MODRM
}, 0 },
8901 /* RM_0F3A0F_P_1_MOD_3_REG_0 */
8902 { "hreset", { Skip_MODRM
, Ib
}, 0 },
8905 /* RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0 */
8906 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0
) },
8910 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
8912 /* The values used here must be non-zero, fit in 'unsigned char', and not be
8913 in conflict with actual prefix opcodes. */
8914 #define REP_PREFIX 0x01
8915 #define XACQUIRE_PREFIX 0x02
8916 #define XRELEASE_PREFIX 0x03
8917 #define BND_PREFIX 0x04
8918 #define NOTRACK_PREFIX 0x05
8925 ckprefix (instr_info
*ins
)
8927 int newrex
, i
, length
;
8931 /* The maximum instruction length is 15bytes. */
8932 while (length
< MAX_CODE_LENGTH
- 1)
8934 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
8935 return ckp_fetch_error
;
8937 switch (*ins
->codep
)
8939 /* REX prefixes family. */
8956 if (ins
->address_mode
== mode_64bit
)
8957 newrex
= *ins
->codep
;
8960 ins
->last_rex_prefix
= i
;
8963 ins
->prefixes
|= PREFIX_REPZ
;
8964 ins
->last_repz_prefix
= i
;
8967 ins
->prefixes
|= PREFIX_REPNZ
;
8968 ins
->last_repnz_prefix
= i
;
8971 ins
->prefixes
|= PREFIX_LOCK
;
8972 ins
->last_lock_prefix
= i
;
8975 ins
->prefixes
|= PREFIX_CS
;
8976 ins
->last_seg_prefix
= i
;
8977 if (ins
->address_mode
!= mode_64bit
)
8978 ins
->active_seg_prefix
= PREFIX_CS
;
8981 ins
->prefixes
|= PREFIX_SS
;
8982 ins
->last_seg_prefix
= i
;
8983 if (ins
->address_mode
!= mode_64bit
)
8984 ins
->active_seg_prefix
= PREFIX_SS
;
8987 ins
->prefixes
|= PREFIX_DS
;
8988 ins
->last_seg_prefix
= i
;
8989 if (ins
->address_mode
!= mode_64bit
)
8990 ins
->active_seg_prefix
= PREFIX_DS
;
8993 ins
->prefixes
|= PREFIX_ES
;
8994 ins
->last_seg_prefix
= i
;
8995 if (ins
->address_mode
!= mode_64bit
)
8996 ins
->active_seg_prefix
= PREFIX_ES
;
8999 ins
->prefixes
|= PREFIX_FS
;
9000 ins
->last_seg_prefix
= i
;
9001 ins
->active_seg_prefix
= PREFIX_FS
;
9004 ins
->prefixes
|= PREFIX_GS
;
9005 ins
->last_seg_prefix
= i
;
9006 ins
->active_seg_prefix
= PREFIX_GS
;
9009 ins
->prefixes
|= PREFIX_DATA
;
9010 ins
->last_data_prefix
= i
;
9013 ins
->prefixes
|= PREFIX_ADDR
;
9014 ins
->last_addr_prefix
= i
;
9017 /* fwait is really an instruction. If there are prefixes
9018 before the fwait, they belong to the fwait, *not* to the
9019 following instruction. */
9020 ins
->fwait_prefix
= i
;
9021 if (ins
->prefixes
|| ins
->rex
)
9023 ins
->prefixes
|= PREFIX_FWAIT
;
9025 /* This ensures that the previous REX prefixes are noticed
9026 as unused prefixes, as in the return case below. */
9027 return ins
->rex
? ckp_bogus
: ckp_okay
;
9029 ins
->prefixes
= PREFIX_FWAIT
;
9034 /* Rex is ignored when followed by another prefix. */
9037 if (*ins
->codep
!= FWAIT_OPCODE
)
9038 ins
->all_prefixes
[i
++] = *ins
->codep
;
9046 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
9050 prefix_name (const instr_info
*ins
, int pref
, int sizeflag
)
9052 static const char *rexes
[16] =
9057 "rex.XB", /* 0x43 */
9059 "rex.RB", /* 0x45 */
9060 "rex.RX", /* 0x46 */
9061 "rex.RXB", /* 0x47 */
9063 "rex.WB", /* 0x49 */
9064 "rex.WX", /* 0x4a */
9065 "rex.WXB", /* 0x4b */
9066 "rex.WR", /* 0x4c */
9067 "rex.WRB", /* 0x4d */
9068 "rex.WRX", /* 0x4e */
9069 "rex.WRXB", /* 0x4f */
9074 /* REX prefixes family. */
9091 return rexes
[pref
- 0x40];
9111 return (sizeflag
& DFLAG
) ? "data16" : "data32";
9113 if (ins
->address_mode
== mode_64bit
)
9114 return (sizeflag
& AFLAG
) ? "addr32" : "addr64";
9116 return (sizeflag
& AFLAG
) ? "addr16" : "addr32";
9121 case XACQUIRE_PREFIX
:
9123 case XRELEASE_PREFIX
:
9127 case NOTRACK_PREFIX
:
9135 print_i386_disassembler_options (FILE *stream
)
9137 fprintf (stream
, _("\n\
9138 The following i386/x86-64 specific disassembler options are supported for use\n\
9139 with the -M switch (multiple options should be separated by commas):\n"));
9141 fprintf (stream
, _(" x86-64 Disassemble in 64bit mode\n"));
9142 fprintf (stream
, _(" i386 Disassemble in 32bit mode\n"));
9143 fprintf (stream
, _(" i8086 Disassemble in 16bit mode\n"));
9144 fprintf (stream
, _(" att Display instruction in AT&T syntax\n"));
9145 fprintf (stream
, _(" intel Display instruction in Intel syntax\n"));
9146 fprintf (stream
, _(" att-mnemonic\n"
9147 " Display instruction in AT&T mnemonic\n"));
9148 fprintf (stream
, _(" intel-mnemonic\n"
9149 " Display instruction in Intel mnemonic\n"));
9150 fprintf (stream
, _(" addr64 Assume 64bit address size\n"));
9151 fprintf (stream
, _(" addr32 Assume 32bit address size\n"));
9152 fprintf (stream
, _(" addr16 Assume 16bit address size\n"));
9153 fprintf (stream
, _(" data32 Assume 32bit data size\n"));
9154 fprintf (stream
, _(" data16 Assume 16bit data size\n"));
9155 fprintf (stream
, _(" suffix Always display instruction suffix in AT&T syntax\n"));
9156 fprintf (stream
, _(" amd64 Display instruction in AMD64 ISA\n"));
9157 fprintf (stream
, _(" intel64 Display instruction in Intel64 ISA\n"));
9161 static const struct dis386 bad_opcode
= { "(bad)", { XX
}, 0 };
9163 /* Fetch error indicator. */
9164 static const struct dis386 err_opcode
= { NULL
, { XX
}, 0 };
9166 /* Get a pointer to struct dis386 with a valid name. */
9168 static const struct dis386
*
9169 get_valid_dis386 (const struct dis386
*dp
, instr_info
*ins
)
9171 int vindex
, vex_table_index
;
9173 if (dp
->name
!= NULL
)
9176 switch (dp
->op
[0].bytemode
)
9179 dp
= ®_table
[dp
->op
[1].bytemode
][ins
->modrm
.reg
];
9183 vindex
= ins
->modrm
.mod
== 0x3 ? 1 : 0;
9184 dp
= &mod_table
[dp
->op
[1].bytemode
][vindex
];
9188 dp
= &rm_table
[dp
->op
[1].bytemode
][ins
->modrm
.rm
];
9191 case USE_PREFIX_TABLE
:
9194 /* The prefix in VEX is implicit. */
9195 switch (ins
->vex
.prefix
)
9200 case REPE_PREFIX_OPCODE
:
9203 case DATA_PREFIX_OPCODE
:
9206 case REPNE_PREFIX_OPCODE
:
9216 int last_prefix
= -1;
9219 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
9220 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
9222 if ((ins
->prefixes
& (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
9224 if (ins
->last_repz_prefix
> ins
->last_repnz_prefix
)
9227 prefix
= PREFIX_REPZ
;
9228 last_prefix
= ins
->last_repz_prefix
;
9233 prefix
= PREFIX_REPNZ
;
9234 last_prefix
= ins
->last_repnz_prefix
;
9237 /* Check if prefix should be ignored. */
9238 if ((((prefix_table
[dp
->op
[1].bytemode
][vindex
].prefix_requirement
9239 & PREFIX_IGNORED
) >> PREFIX_IGNORED_SHIFT
)
9241 && !prefix_table
[dp
->op
[1].bytemode
][vindex
].name
)
9245 if (vindex
== 0 && (ins
->prefixes
& PREFIX_DATA
) != 0)
9248 prefix
= PREFIX_DATA
;
9249 last_prefix
= ins
->last_data_prefix
;
9254 ins
->used_prefixes
|= prefix
;
9255 ins
->all_prefixes
[last_prefix
] = 0;
9258 dp
= &prefix_table
[dp
->op
[1].bytemode
][vindex
];
9261 case USE_X86_64_TABLE
:
9262 vindex
= ins
->address_mode
== mode_64bit
? 1 : 0;
9263 dp
= &x86_64_table
[dp
->op
[1].bytemode
][vindex
];
9266 case USE_3BYTE_TABLE
:
9267 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
9269 vindex
= *ins
->codep
++;
9270 dp
= &three_byte_table
[dp
->op
[1].bytemode
][vindex
];
9271 ins
->end_codep
= ins
->codep
;
9272 if (!fetch_modrm (ins
))
9276 case USE_VEX_LEN_TABLE
:
9280 switch (ins
->vex
.length
)
9286 /* This allows re-using in particular table entries where only
9287 128-bit operand size (VEX.L=0 / EVEX.L'L=0) are valid. */
9300 dp
= &vex_len_table
[dp
->op
[1].bytemode
][vindex
];
9303 case USE_EVEX_LEN_TABLE
:
9307 switch (ins
->vex
.length
)
9323 dp
= &evex_len_table
[dp
->op
[1].bytemode
][vindex
];
9326 case USE_XOP_8F_TABLE
:
9327 if (!fetch_code (ins
->info
, ins
->codep
+ 3))
9329 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9331 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
9332 switch ((*ins
->codep
& 0x1f))
9338 vex_table_index
= XOP_08
;
9341 vex_table_index
= XOP_09
;
9344 vex_table_index
= XOP_0A
;
9348 ins
->vex
.w
= *ins
->codep
& 0x80;
9349 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9352 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9353 if (ins
->address_mode
!= mode_64bit
)
9355 /* In 16/32-bit mode REX_B is silently ignored. */
9359 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9360 switch ((*ins
->codep
& 0x3))
9365 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9368 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9371 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9374 ins
->need_vex
= true;
9376 vindex
= *ins
->codep
++;
9377 dp
= &xop_table
[vex_table_index
][vindex
];
9379 ins
->end_codep
= ins
->codep
;
9380 if (!fetch_modrm (ins
))
9383 /* No XOP encoding so far allows for a non-zero embedded prefix. Avoid
9384 having to decode the bits for every otherwise valid encoding. */
9385 if (ins
->vex
.prefix
)
9389 case USE_VEX_C4_TABLE
:
9391 if (!fetch_code (ins
->info
, ins
->codep
+ 3))
9393 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9394 switch ((*ins
->codep
& 0x1f))
9400 vex_table_index
= VEX_0F
;
9403 vex_table_index
= VEX_0F38
;
9406 vex_table_index
= VEX_0F3A
;
9410 ins
->vex
.w
= *ins
->codep
& 0x80;
9411 if (ins
->address_mode
== mode_64bit
)
9418 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
9419 is ignored, other REX bits are 0 and the highest bit in
9420 VEX.vvvv is also ignored (but we mustn't clear it here). */
9423 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9424 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9425 switch ((*ins
->codep
& 0x3))
9430 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9433 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9436 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9439 ins
->need_vex
= true;
9441 vindex
= *ins
->codep
++;
9442 dp
= &vex_table
[vex_table_index
][vindex
];
9443 ins
->end_codep
= ins
->codep
;
9444 /* There is no MODRM byte for VEX0F 77. */
9445 if ((vex_table_index
!= VEX_0F
|| vindex
!= 0x77)
9446 && !fetch_modrm (ins
))
9450 case USE_VEX_C5_TABLE
:
9452 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
9454 ins
->rex
= (*ins
->codep
& 0x80) ? 0 : REX_R
;
9456 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
9458 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9459 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9460 switch ((*ins
->codep
& 0x3))
9465 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9468 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9471 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9474 ins
->need_vex
= true;
9476 vindex
= *ins
->codep
++;
9477 dp
= &vex_table
[dp
->op
[1].bytemode
][vindex
];
9478 ins
->end_codep
= ins
->codep
;
9479 /* There is no MODRM byte for VEX 77. */
9480 if (vindex
!= 0x77 && !fetch_modrm (ins
))
9484 case USE_VEX_W_TABLE
:
9488 dp
= &vex_w_table
[dp
->op
[1].bytemode
][ins
->vex
.w
];
9491 case USE_EVEX_TABLE
:
9492 ins
->two_source_ops
= false;
9494 ins
->vex
.evex
= true;
9495 if (!fetch_code (ins
->info
, ins
->codep
+ 4))
9497 /* The first byte after 0x62. */
9498 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9499 ins
->vex
.r
= *ins
->codep
& 0x10;
9500 switch ((*ins
->codep
& 0xf))
9505 vex_table_index
= EVEX_0F
;
9508 vex_table_index
= EVEX_0F38
;
9511 vex_table_index
= EVEX_0F3A
;
9514 vex_table_index
= EVEX_MAP5
;
9517 vex_table_index
= EVEX_MAP6
;
9521 /* The second byte after 0x62. */
9523 ins
->vex
.w
= *ins
->codep
& 0x80;
9524 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9527 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9530 if (!(*ins
->codep
& 0x4))
9533 switch ((*ins
->codep
& 0x3))
9538 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9541 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9544 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9548 /* The third byte after 0x62. */
9551 /* Remember the static rounding bits. */
9552 ins
->vex
.ll
= (*ins
->codep
>> 5) & 3;
9553 ins
->vex
.b
= *ins
->codep
& 0x10;
9555 ins
->vex
.v
= *ins
->codep
& 0x8;
9556 ins
->vex
.mask_register_specifier
= *ins
->codep
& 0x7;
9557 ins
->vex
.zeroing
= *ins
->codep
& 0x80;
9559 if (ins
->address_mode
!= mode_64bit
)
9561 /* In 16/32-bit mode silently ignore following bits. */
9566 ins
->need_vex
= true;
9568 vindex
= *ins
->codep
++;
9569 dp
= &evex_table
[vex_table_index
][vindex
];
9570 ins
->end_codep
= ins
->codep
;
9571 if (!fetch_modrm (ins
))
9574 /* Set vector length. */
9575 if (ins
->modrm
.mod
== 3 && ins
->vex
.b
)
9576 ins
->vex
.length
= 512;
9579 switch (ins
->vex
.ll
)
9582 ins
->vex
.length
= 128;
9585 ins
->vex
.length
= 256;
9588 ins
->vex
.length
= 512;
9604 if (dp
->name
!= NULL
)
9607 return get_valid_dis386 (dp
, ins
);
9611 get_sib (instr_info
*ins
, int sizeflag
)
9613 /* If modrm.mod == 3, operand must be register. */
9615 && ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
9616 && ins
->modrm
.mod
!= 3
9617 && ins
->modrm
.rm
== 4)
9619 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
9621 ins
->sib
.index
= (ins
->codep
[1] >> 3) & 7;
9622 ins
->sib
.scale
= (ins
->codep
[1] >> 6) & 3;
9623 ins
->sib
.base
= ins
->codep
[1] & 7;
9624 ins
->has_sib
= true;
9627 ins
->has_sib
= false;
9632 /* Like oappend (below), but S is a string starting with '%'. In
9633 Intel syntax, the '%' is elided. */
9636 oappend_register (instr_info
*ins
, const char *s
)
9638 oappend_with_style (ins
, s
+ ins
->intel_syntax
, dis_style_register
);
9641 /* Wrap around a call to INS->info->fprintf_styled_func, printing FMT.
9642 STYLE is the default style to use in the fprintf_styled_func calls,
9643 however, FMT might include embedded style markers (see oappend_style),
9644 these embedded markers are not printed, but instead change the style
9645 used in the next fprintf_styled_func call. */
9647 static void ATTRIBUTE_PRINTF_3
9648 i386_dis_printf (const instr_info
*ins
, enum disassembler_style style
,
9649 const char *fmt
, ...)
9652 enum disassembler_style curr_style
= style
;
9653 const char *start
, *curr
;
9654 char staging_area
[40];
9657 /* In particular print_insn()'s processing of op_txt[] can hand rather long
9658 strings here. Bypass vsnprintf() in such cases to avoid capacity issues
9659 with the staging area. */
9660 if (strcmp (fmt
, "%s"))
9662 int res
= vsnprintf (staging_area
, sizeof (staging_area
), fmt
, ap
);
9669 if ((size_t) res
>= sizeof (staging_area
))
9672 start
= curr
= staging_area
;
9676 start
= curr
= va_arg (ap
, const char *);
9683 || (*curr
== STYLE_MARKER_CHAR
9684 && ISXDIGIT (*(curr
+ 1))
9685 && *(curr
+ 2) == STYLE_MARKER_CHAR
))
9687 /* Output content between our START position and CURR. */
9688 int len
= curr
- start
;
9689 int n
= (*ins
->info
->fprintf_styled_func
) (ins
->info
->stream
,
9691 "%.*s", len
, start
);
9698 /* Skip over the initial STYLE_MARKER_CHAR. */
9701 /* Update the CURR_STYLE. As there are less than 16 styles, it
9702 is possible, that if the input is corrupted in some way, that
9703 we might set CURR_STYLE to an invalid value. Don't worry
9704 though, we check for this situation. */
9705 if (*curr
>= '0' && *curr
<= '9')
9706 curr_style
= (enum disassembler_style
) (*curr
- '0');
9707 else if (*curr
>= 'a' && *curr
<= 'f')
9708 curr_style
= (enum disassembler_style
) (*curr
- 'a' + 10);
9710 curr_style
= dis_style_text
;
9712 /* Check for an invalid style having been selected. This should
9713 never happen, but it doesn't hurt to be a little paranoid. */
9714 if (curr_style
> dis_style_comment_start
)
9715 curr_style
= dis_style_text
;
9717 /* Skip the hex character, and the closing STYLE_MARKER_CHAR. */
9720 /* Reset the START to after the style marker. */
9730 print_insn (bfd_vma pc
, disassemble_info
*info
, int intel_syntax
)
9732 const struct dis386
*dp
;
9734 char *op_txt
[MAX_OPERANDS
];
9736 bool intel_swap_2_3
;
9737 int sizeflag
, orig_sizeflag
;
9739 struct dis_private priv
;
9744 .intel_syntax
= intel_syntax
>= 0
9746 : (info
->mach
& bfd_mach_i386_intel_syntax
) != 0,
9747 .intel_mnemonic
= !SYSV386_COMPAT
,
9748 .op_index
[0 ... MAX_OPERANDS
- 1] = -1,
9750 .start_codep
= priv
.the_buffer
,
9751 .codep
= priv
.the_buffer
,
9753 .last_lock_prefix
= -1,
9754 .last_repz_prefix
= -1,
9755 .last_repnz_prefix
= -1,
9756 .last_data_prefix
= -1,
9757 .last_addr_prefix
= -1,
9758 .last_rex_prefix
= -1,
9759 .last_seg_prefix
= -1,
9762 char op_out
[MAX_OPERANDS
][MAX_OPERAND_BUFFER_SIZE
];
9764 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
9765 if ((info
->mach
& bfd_mach_i386_i386
) != 0)
9766 ins
.address_mode
= mode_32bit
;
9767 else if (info
->mach
== bfd_mach_i386_i8086
)
9769 ins
.address_mode
= mode_16bit
;
9770 priv
.orig_sizeflag
= 0;
9773 ins
.address_mode
= mode_64bit
;
9775 for (p
= info
->disassembler_options
; p
!= NULL
;)
9777 if (startswith (p
, "amd64"))
9779 else if (startswith (p
, "intel64"))
9780 ins
.isa64
= intel64
;
9781 else if (startswith (p
, "x86-64"))
9783 ins
.address_mode
= mode_64bit
;
9784 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9786 else if (startswith (p
, "i386"))
9788 ins
.address_mode
= mode_32bit
;
9789 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9791 else if (startswith (p
, "i8086"))
9793 ins
.address_mode
= mode_16bit
;
9794 priv
.orig_sizeflag
&= ~(AFLAG
| DFLAG
);
9796 else if (startswith (p
, "intel"))
9798 ins
.intel_syntax
= 1;
9799 if (startswith (p
+ 5, "-mnemonic"))
9800 ins
.intel_mnemonic
= true;
9802 else if (startswith (p
, "att"))
9804 ins
.intel_syntax
= 0;
9805 if (startswith (p
+ 3, "-mnemonic"))
9806 ins
.intel_mnemonic
= false;
9808 else if (startswith (p
, "addr"))
9810 if (ins
.address_mode
== mode_64bit
)
9812 if (p
[4] == '3' && p
[5] == '2')
9813 priv
.orig_sizeflag
&= ~AFLAG
;
9814 else if (p
[4] == '6' && p
[5] == '4')
9815 priv
.orig_sizeflag
|= AFLAG
;
9819 if (p
[4] == '1' && p
[5] == '6')
9820 priv
.orig_sizeflag
&= ~AFLAG
;
9821 else if (p
[4] == '3' && p
[5] == '2')
9822 priv
.orig_sizeflag
|= AFLAG
;
9825 else if (startswith (p
, "data"))
9827 if (p
[4] == '1' && p
[5] == '6')
9828 priv
.orig_sizeflag
&= ~DFLAG
;
9829 else if (p
[4] == '3' && p
[5] == '2')
9830 priv
.orig_sizeflag
|= DFLAG
;
9832 else if (startswith (p
, "suffix"))
9833 priv
.orig_sizeflag
|= SUFFIX_ALWAYS
;
9835 p
= strchr (p
, ',');
9840 if (ins
.address_mode
== mode_64bit
&& sizeof (bfd_vma
) < 8)
9842 i386_dis_printf (&ins
, dis_style_text
, _("64-bit address is disabled"));
9846 if (ins
.intel_syntax
)
9848 ins
.open_char
= '[';
9849 ins
.close_char
= ']';
9850 ins
.separator_char
= '+';
9851 ins
.scale_char
= '*';
9855 ins
.open_char
= '(';
9856 ins
.close_char
= ')';
9857 ins
.separator_char
= ',';
9858 ins
.scale_char
= ',';
9861 /* The output looks better if we put 7 bytes on a line, since that
9862 puts most long word instructions on a single line. */
9863 info
->bytes_per_line
= 7;
9865 info
->private_data
= &priv
;
9866 priv
.max_fetched
= priv
.the_buffer
;
9867 priv
.insn_start
= pc
;
9869 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9872 ins
.op_out
[i
] = op_out
[i
];
9875 sizeflag
= priv
.orig_sizeflag
;
9877 switch (ckprefix (&ins
))
9883 /* Too many prefixes or unused REX prefixes. */
9885 i
< (int) ARRAY_SIZE (ins
.all_prefixes
) && ins
.all_prefixes
[i
];
9887 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s%s",
9888 (i
== 0 ? "" : " "),
9889 prefix_name (&ins
, ins
.all_prefixes
[i
], sizeflag
));
9892 case ckp_fetch_error
:
9893 return fetch_error (&ins
);
9896 ins
.insn_codep
= ins
.codep
;
9898 if (!fetch_code (info
, ins
.codep
+ 1))
9899 return fetch_error (&ins
);
9901 ins
.two_source_ops
= (*ins
.codep
== 0x62) || (*ins
.codep
== 0xc8);
9903 if (((ins
.prefixes
& PREFIX_FWAIT
)
9904 && ((*ins
.codep
< 0xd8) || (*ins
.codep
> 0xdf))))
9906 /* Handle ins.prefixes before fwait. */
9907 for (i
= 0; i
< ins
.fwait_prefix
&& ins
.all_prefixes
[i
];
9909 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s ",
9910 prefix_name (&ins
, ins
.all_prefixes
[i
], sizeflag
));
9911 i386_dis_printf (&ins
, dis_style_mnemonic
, "fwait");
9915 if (*ins
.codep
== 0x0f)
9917 unsigned char threebyte
;
9920 if (!fetch_code (info
, ins
.codep
+ 1))
9921 return fetch_error (&ins
);
9922 threebyte
= *ins
.codep
;
9923 dp
= &dis386_twobyte
[threebyte
];
9924 ins
.need_modrm
= twobyte_has_modrm
[threebyte
];
9929 dp
= &dis386
[*ins
.codep
];
9930 ins
.need_modrm
= onebyte_has_modrm
[*ins
.codep
];
9934 /* Save sizeflag for printing the extra ins.prefixes later before updating
9935 it for mnemonic and operand processing. The prefix names depend
9936 only on the address mode. */
9937 orig_sizeflag
= sizeflag
;
9938 if (ins
.prefixes
& PREFIX_ADDR
)
9940 if ((ins
.prefixes
& PREFIX_DATA
))
9943 ins
.end_codep
= ins
.codep
;
9944 if (ins
.need_modrm
&& !fetch_modrm (&ins
))
9945 return fetch_error (&ins
);
9947 if (dp
->name
== NULL
&& dp
->op
[0].bytemode
== FLOATCODE
)
9949 if (!get_sib (&ins
, sizeflag
)
9950 || !dofloat (&ins
, sizeflag
))
9951 return fetch_error (&ins
);
9955 dp
= get_valid_dis386 (dp
, &ins
);
9956 if (dp
== &err_opcode
)
9957 return fetch_error (&ins
);
9958 if (dp
!= NULL
&& putop (&ins
, dp
->name
, sizeflag
) == 0)
9960 if (!get_sib (&ins
, sizeflag
))
9961 return fetch_error (&ins
);
9962 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9964 ins
.obufp
= ins
.op_out
[i
];
9965 ins
.op_ad
= MAX_OPERANDS
- 1 - i
;
9967 && !dp
->op
[i
].rtn (&ins
, dp
->op
[i
].bytemode
, sizeflag
))
9968 return fetch_error (&ins
);
9969 /* For EVEX instruction after the last operand masking
9970 should be printed. */
9971 if (i
== 0 && ins
.vex
.evex
)
9973 /* Don't print {%k0}. */
9974 if (ins
.vex
.mask_register_specifier
)
9976 const char *reg_name
9977 = att_names_mask
[ins
.vex
.mask_register_specifier
];
9979 oappend (&ins
, "{");
9980 oappend_register (&ins
, reg_name
);
9981 oappend (&ins
, "}");
9983 if (ins
.vex
.zeroing
)
9984 oappend (&ins
, "{z}");
9986 /* S/G insns require a mask and don't allow
9988 if ((dp
->op
[0].bytemode
== vex_vsib_d_w_dq_mode
9989 || dp
->op
[0].bytemode
== vex_vsib_q_w_dq_mode
)
9990 && (ins
.vex
.mask_register_specifier
== 0
9991 || ins
.vex
.zeroing
))
9992 oappend (&ins
, "/(bad)");
9996 /* Check whether rounding control was enabled for an insn not
9998 if (ins
.modrm
.mod
== 3 && ins
.vex
.b
9999 && !(ins
.evex_used
& EVEX_b_used
))
10001 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10003 ins
.obufp
= ins
.op_out
[i
];
10006 oappend (&ins
, names_rounding
[ins
.vex
.ll
]);
10007 oappend (&ins
, "bad}");
10014 /* Clear instruction information. */
10015 info
->insn_info_valid
= 0;
10016 info
->branch_delay_insns
= 0;
10017 info
->data_size
= 0;
10018 info
->insn_type
= dis_noninsn
;
10022 /* Reset jump operation indicator. */
10023 ins
.op_is_jump
= false;
10025 int jump_detection
= 0;
10027 /* Extract flags. */
10028 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10030 if ((dp
->op
[i
].rtn
== OP_J
)
10031 || (dp
->op
[i
].rtn
== OP_indirE
))
10032 jump_detection
|= 1;
10033 else if ((dp
->op
[i
].rtn
== BND_Fixup
)
10034 || (!dp
->op
[i
].rtn
&& !dp
->op
[i
].bytemode
))
10035 jump_detection
|= 2;
10036 else if ((dp
->op
[i
].bytemode
== cond_jump_mode
)
10037 || (dp
->op
[i
].bytemode
== loop_jcxz_mode
))
10038 jump_detection
|= 4;
10041 /* Determine if this is a jump or branch. */
10042 if ((jump_detection
& 0x3) == 0x3)
10044 ins
.op_is_jump
= true;
10045 if (jump_detection
& 0x4)
10046 info
->insn_type
= dis_condbranch
;
10048 info
->insn_type
= (dp
->name
&& !strncmp (dp
->name
, "call", 4))
10049 ? dis_jsr
: dis_branch
;
10053 /* If VEX.vvvv and EVEX.vvvv are unused, they must be all 1s, which
10054 are all 0s in inverted form. */
10055 if (ins
.need_vex
&& ins
.vex
.register_specifier
!= 0)
10057 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10058 return ins
.end_codep
- priv
.the_buffer
;
10061 /* If EVEX.z is set, there must be an actual mask register in use. */
10062 if (ins
.vex
.zeroing
&& ins
.vex
.mask_register_specifier
== 0)
10064 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10065 return ins
.end_codep
- priv
.the_buffer
;
10068 switch (dp
->prefix_requirement
)
10071 /* If only the data prefix is marked as mandatory, its absence renders
10072 the encoding invalid. Most other PREFIX_OPCODE rules still apply. */
10073 if (ins
.need_vex
? !ins
.vex
.prefix
: !(ins
.prefixes
& PREFIX_DATA
))
10075 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10076 return ins
.end_codep
- priv
.the_buffer
;
10078 ins
.used_prefixes
|= PREFIX_DATA
;
10079 /* Fall through. */
10080 case PREFIX_OPCODE
:
10081 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
10082 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
10083 used by putop and MMX/SSE operand and may be overridden by the
10084 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
10087 ? ins
.vex
.prefix
== REPE_PREFIX_OPCODE
10088 || ins
.vex
.prefix
== REPNE_PREFIX_OPCODE
10090 & (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
10091 && (ins
.used_prefixes
10092 & (PREFIX_REPZ
| PREFIX_REPNZ
)) == 0)
10094 ? ins
.vex
.prefix
== DATA_PREFIX_OPCODE
10096 & (PREFIX_REPZ
| PREFIX_REPNZ
| PREFIX_DATA
))
10098 && (ins
.used_prefixes
& PREFIX_DATA
) == 0))
10099 || (ins
.vex
.evex
&& dp
->prefix_requirement
!= PREFIX_DATA
10100 && !ins
.vex
.w
!= !(ins
.used_prefixes
& PREFIX_DATA
)))
10102 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10103 return ins
.end_codep
- priv
.the_buffer
;
10107 case PREFIX_IGNORED
:
10108 /* Zap data size and rep prefixes from used_prefixes and reinstate their
10109 origins in all_prefixes. */
10110 ins
.used_prefixes
&= ~PREFIX_OPCODE
;
10111 if (ins
.last_data_prefix
>= 0)
10112 ins
.all_prefixes
[ins
.last_data_prefix
] = 0x66;
10113 if (ins
.last_repz_prefix
>= 0)
10114 ins
.all_prefixes
[ins
.last_repz_prefix
] = 0xf3;
10115 if (ins
.last_repnz_prefix
>= 0)
10116 ins
.all_prefixes
[ins
.last_repnz_prefix
] = 0xf2;
10120 /* Check if the REX prefix is used. */
10121 if ((ins
.rex
^ ins
.rex_used
) == 0
10122 && !ins
.need_vex
&& ins
.last_rex_prefix
>= 0)
10123 ins
.all_prefixes
[ins
.last_rex_prefix
] = 0;
10125 /* Check if the SEG prefix is used. */
10126 if ((ins
.prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
| PREFIX_ES
10127 | PREFIX_FS
| PREFIX_GS
)) != 0
10128 && (ins
.used_prefixes
& ins
.active_seg_prefix
) != 0)
10129 ins
.all_prefixes
[ins
.last_seg_prefix
] = 0;
10131 /* Check if the ADDR prefix is used. */
10132 if ((ins
.prefixes
& PREFIX_ADDR
) != 0
10133 && (ins
.used_prefixes
& PREFIX_ADDR
) != 0)
10134 ins
.all_prefixes
[ins
.last_addr_prefix
] = 0;
10136 /* Check if the DATA prefix is used. */
10137 if ((ins
.prefixes
& PREFIX_DATA
) != 0
10138 && (ins
.used_prefixes
& PREFIX_DATA
) != 0
10140 ins
.all_prefixes
[ins
.last_data_prefix
] = 0;
10142 /* Print the extra ins.prefixes. */
10144 for (i
= 0; i
< (int) ARRAY_SIZE (ins
.all_prefixes
); i
++)
10145 if (ins
.all_prefixes
[i
])
10148 name
= prefix_name (&ins
, ins
.all_prefixes
[i
], orig_sizeflag
);
10151 prefix_length
+= strlen (name
) + 1;
10152 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s ", name
);
10155 /* Check maximum code length. */
10156 if ((ins
.codep
- ins
.start_codep
) > MAX_CODE_LENGTH
)
10158 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
10159 return MAX_CODE_LENGTH
;
10162 /* Calculate the number of operands this instruction has. */
10164 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10165 if (*ins
.op_out
[i
] != '\0')
10168 /* Calculate the number of spaces to print after the mnemonic. */
10169 ins
.obufp
= ins
.mnemonicendp
;
10172 i
= strlen (ins
.obuf
) + prefix_length
;
10181 /* Print the instruction mnemonic along with any trailing whitespace. */
10182 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s%*s", ins
.obuf
, i
, "");
10184 /* The enter and bound instructions are printed with operands in the same
10185 order as the intel book; everything else is printed in reverse order. */
10186 intel_swap_2_3
= false;
10187 if (ins
.intel_syntax
|| ins
.two_source_ops
)
10189 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10190 op_txt
[i
] = ins
.op_out
[i
];
10192 if (ins
.intel_syntax
&& dp
&& dp
->op
[2].rtn
== OP_Rounding
10193 && dp
->op
[3].rtn
== OP_E
&& dp
->op
[4].rtn
== NULL
)
10195 op_txt
[2] = ins
.op_out
[3];
10196 op_txt
[3] = ins
.op_out
[2];
10197 intel_swap_2_3
= true;
10200 for (i
= 0; i
< (MAX_OPERANDS
>> 1); ++i
)
10204 ins
.op_ad
= ins
.op_index
[i
];
10205 ins
.op_index
[i
] = ins
.op_index
[MAX_OPERANDS
- 1 - i
];
10206 ins
.op_index
[MAX_OPERANDS
- 1 - i
] = ins
.op_ad
;
10207 riprel
= ins
.op_riprel
[i
];
10208 ins
.op_riprel
[i
] = ins
.op_riprel
[MAX_OPERANDS
- 1 - i
];
10209 ins
.op_riprel
[MAX_OPERANDS
- 1 - i
] = riprel
;
10214 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10215 op_txt
[MAX_OPERANDS
- 1 - i
] = ins
.op_out
[i
];
10219 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
10222 /* In Intel syntax embedded rounding / SAE are not separate operands.
10223 Instead they're attached to the prior register operand. Simply
10224 suppress emission of the comma to achieve that effect. */
10225 switch (i
& -(ins
.intel_syntax
&& dp
))
10228 if (dp
->op
[2].rtn
== OP_Rounding
&& !intel_swap_2_3
)
10232 if (dp
->op
[3].rtn
== OP_Rounding
|| intel_swap_2_3
)
10237 i386_dis_printf (&ins
, dis_style_text
, ",");
10238 if (ins
.op_index
[i
] != -1 && !ins
.op_riprel
[i
])
10240 bfd_vma target
= (bfd_vma
) ins
.op_address
[ins
.op_index
[i
]];
10242 if (ins
.op_is_jump
)
10244 info
->insn_info_valid
= 1;
10245 info
->branch_delay_insns
= 0;
10246 info
->data_size
= 0;
10247 info
->target
= target
;
10250 (*info
->print_address_func
) (target
, info
);
10253 i386_dis_printf (&ins
, dis_style_text
, "%s", op_txt
[i
]);
10257 for (i
= 0; i
< MAX_OPERANDS
; i
++)
10258 if (ins
.op_index
[i
] != -1 && ins
.op_riprel
[i
])
10260 i386_dis_printf (&ins
, dis_style_comment_start
, " # ");
10261 (*info
->print_address_func
)
10262 ((bfd_vma
)(ins
.start_pc
+ (ins
.codep
- ins
.start_codep
)
10263 + ins
.op_address
[ins
.op_index
[i
]]),
10267 return ins
.codep
- priv
.the_buffer
;
10270 /* Here for backwards compatibility. When gdb stops using
10271 print_insn_i386_att and print_insn_i386_intel these functions can
10272 disappear, and print_insn_i386 be merged into print_insn. */
10274 print_insn_i386_att (bfd_vma pc
, disassemble_info
*info
)
10276 return print_insn (pc
, info
, 0);
10280 print_insn_i386_intel (bfd_vma pc
, disassemble_info
*info
)
10282 return print_insn (pc
, info
, 1);
10286 print_insn_i386 (bfd_vma pc
, disassemble_info
*info
)
10288 return print_insn (pc
, info
, -1);
10291 static const char *float_mem
[] = {
10366 static const unsigned char float_mem_mode
[] = {
10441 #define ST { OP_ST, 0 }
10442 #define STi { OP_STi, 0 }
10444 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
10445 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
10446 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
10447 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
10448 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
10449 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
10450 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
10451 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
10452 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
10454 static const struct dis386 float_reg
[][8] = {
10457 { "fadd", { ST
, STi
}, 0 },
10458 { "fmul", { ST
, STi
}, 0 },
10459 { "fcom", { STi
}, 0 },
10460 { "fcomp", { STi
}, 0 },
10461 { "fsub", { ST
, STi
}, 0 },
10462 { "fsubr", { ST
, STi
}, 0 },
10463 { "fdiv", { ST
, STi
}, 0 },
10464 { "fdivr", { ST
, STi
}, 0 },
10468 { "fld", { STi
}, 0 },
10469 { "fxch", { STi
}, 0 },
10479 { "fcmovb", { ST
, STi
}, 0 },
10480 { "fcmove", { ST
, STi
}, 0 },
10481 { "fcmovbe",{ ST
, STi
}, 0 },
10482 { "fcmovu", { ST
, STi
}, 0 },
10490 { "fcmovnb",{ ST
, STi
}, 0 },
10491 { "fcmovne",{ ST
, STi
}, 0 },
10492 { "fcmovnbe",{ ST
, STi
}, 0 },
10493 { "fcmovnu",{ ST
, STi
}, 0 },
10495 { "fucomi", { ST
, STi
}, 0 },
10496 { "fcomi", { ST
, STi
}, 0 },
10501 { "fadd", { STi
, ST
}, 0 },
10502 { "fmul", { STi
, ST
}, 0 },
10505 { "fsub{!M|r}", { STi
, ST
}, 0 },
10506 { "fsub{M|}", { STi
, ST
}, 0 },
10507 { "fdiv{!M|r}", { STi
, ST
}, 0 },
10508 { "fdiv{M|}", { STi
, ST
}, 0 },
10512 { "ffree", { STi
}, 0 },
10514 { "fst", { STi
}, 0 },
10515 { "fstp", { STi
}, 0 },
10516 { "fucom", { STi
}, 0 },
10517 { "fucomp", { STi
}, 0 },
10523 { "faddp", { STi
, ST
}, 0 },
10524 { "fmulp", { STi
, ST
}, 0 },
10527 { "fsub{!M|r}p", { STi
, ST
}, 0 },
10528 { "fsub{M|}p", { STi
, ST
}, 0 },
10529 { "fdiv{!M|r}p", { STi
, ST
}, 0 },
10530 { "fdiv{M|}p", { STi
, ST
}, 0 },
10534 { "ffreep", { STi
}, 0 },
10539 { "fucomip", { ST
, STi
}, 0 },
10540 { "fcomip", { ST
, STi
}, 0 },
10545 static const char *const fgrps
[][8] = {
10548 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10553 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10558 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
10563 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
10568 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
10573 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
10578 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10583 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
10584 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
10589 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10594 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10599 swap_operand (instr_info
*ins
)
10601 ins
->mnemonicendp
[0] = '.';
10602 ins
->mnemonicendp
[1] = 's';
10603 ins
->mnemonicendp
[2] = '\0';
10604 ins
->mnemonicendp
+= 2;
10608 OP_Skip_MODRM (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10609 int sizeflag ATTRIBUTE_UNUSED
)
10611 /* Skip mod/rm byte. */
10618 dofloat (instr_info
*ins
, int sizeflag
)
10620 const struct dis386
*dp
;
10621 unsigned char floatop
;
10623 floatop
= ins
->codep
[-1];
10625 if (ins
->modrm
.mod
!= 3)
10627 int fp_indx
= (floatop
- 0xd8) * 8 + ins
->modrm
.reg
;
10629 putop (ins
, float_mem
[fp_indx
], sizeflag
);
10630 ins
->obufp
= ins
->op_out
[0];
10632 return OP_E (ins
, float_mem_mode
[fp_indx
], sizeflag
);
10634 /* Skip mod/rm byte. */
10638 dp
= &float_reg
[floatop
- 0xd8][ins
->modrm
.reg
];
10639 if (dp
->name
== NULL
)
10641 putop (ins
, fgrps
[dp
->op
[0].bytemode
][ins
->modrm
.rm
], sizeflag
);
10643 /* Instruction fnstsw is only one with strange arg. */
10644 if (floatop
== 0xdf && ins
->codep
[-1] == 0xe0)
10645 strcpy (ins
->op_out
[0], att_names16
[0] + ins
->intel_syntax
);
10649 putop (ins
, dp
->name
, sizeflag
);
10651 ins
->obufp
= ins
->op_out
[0];
10654 && !dp
->op
[0].rtn (ins
, dp
->op
[0].bytemode
, sizeflag
))
10657 ins
->obufp
= ins
->op_out
[1];
10660 && !dp
->op
[1].rtn (ins
, dp
->op
[1].bytemode
, sizeflag
))
10667 OP_ST (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10668 int sizeflag ATTRIBUTE_UNUSED
)
10670 oappend_register (ins
, "%st");
10675 OP_STi (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10676 int sizeflag ATTRIBUTE_UNUSED
)
10679 int res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%st(%d)", ins
->modrm
.rm
);
10681 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
10683 oappend_register (ins
, scratch
);
10687 /* Capital letters in template are macros. */
10689 putop (instr_info
*ins
, const char *in_template
, int sizeflag
)
10694 unsigned int l
= 0, len
= 0;
10697 for (p
= in_template
; *p
; p
++)
10701 if (l
>= sizeof (last
) || !ISUPPER (*p
))
10709 *ins
->obufp
++ = *p
;
10718 if (ins
->intel_syntax
)
10720 while (*++p
!= '|')
10721 if (*p
== '}' || *p
== '\0')
10727 while (*++p
!= '}')
10737 if (ins
->intel_syntax
)
10739 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10740 || (sizeflag
& SUFFIX_ALWAYS
))
10741 *ins
->obufp
++ = 'b';
10747 if (ins
->intel_syntax
)
10749 if (sizeflag
& SUFFIX_ALWAYS
)
10750 *ins
->obufp
++ = 'b';
10752 else if (l
== 1 && last
[0] == 'L')
10754 if (ins
->address_mode
== mode_64bit
10755 && !(ins
->prefixes
& PREFIX_ADDR
))
10757 *ins
->obufp
++ = 'a';
10758 *ins
->obufp
++ = 'b';
10759 *ins
->obufp
++ = 's';
10768 if (ins
->intel_syntax
&& !alt
)
10770 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10772 if (sizeflag
& DFLAG
)
10773 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10775 *ins
->obufp
++ = ins
->intel_syntax
? 'w' : 's';
10776 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10785 if (!ins
->vex
.evex
|| ins
->vex
.w
)
10786 *ins
->obufp
++ = 'd';
10788 oappend (ins
, "{bad}");
10797 if (ins
->intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
10800 if (ins
->modrm
.mod
== 3)
10802 if (ins
->rex
& REX_W
)
10803 *ins
->obufp
++ = 'q';
10806 if (sizeflag
& DFLAG
)
10807 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10809 *ins
->obufp
++ = 'w';
10810 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10814 *ins
->obufp
++ = 'w';
10822 if (!ins
->vex
.evex
|| ins
->vex
.b
|| ins
->vex
.ll
>= 2
10824 || (ins
->modrm
.mod
== 3 && (ins
->rex
& REX_X
))
10825 || !ins
->vex
.v
|| ins
->vex
.mask_register_specifier
)
10827 /* AVX512 extends a number of V*D insns to also have V*Q variants,
10828 merely distinguished by EVEX.W. Look for a use of the
10829 respective macro. */
10832 const char *pct
= strchr (p
+ 1, '%');
10834 if (pct
!= NULL
&& pct
[1] == 'D' && pct
[2] == 'Q')
10837 *ins
->obufp
++ = '{';
10838 *ins
->obufp
++ = 'e';
10839 *ins
->obufp
++ = 'v';
10840 *ins
->obufp
++ = 'e';
10841 *ins
->obufp
++ = 'x';
10842 *ins
->obufp
++ = '}';
10843 *ins
->obufp
++ = ' ';
10850 /* For jcxz/jecxz */
10851 if (ins
->address_mode
== mode_64bit
)
10853 if (sizeflag
& AFLAG
)
10854 *ins
->obufp
++ = 'r';
10856 *ins
->obufp
++ = 'e';
10859 if (sizeflag
& AFLAG
)
10860 *ins
->obufp
++ = 'e';
10861 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10864 if (ins
->intel_syntax
)
10866 if ((ins
->prefixes
& PREFIX_ADDR
) || (sizeflag
& SUFFIX_ALWAYS
))
10868 if (sizeflag
& AFLAG
)
10869 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10871 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'l' : 'w';
10872 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10876 if (ins
->intel_syntax
|| (ins
->obufp
[-1] != 's'
10877 && !(sizeflag
& SUFFIX_ALWAYS
)))
10879 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
10880 *ins
->obufp
++ = 'l';
10882 *ins
->obufp
++ = 'w';
10883 if (!(ins
->rex
& REX_W
))
10884 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10889 if (ins
->intel_syntax
)
10891 if ((ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_CS
10892 || (ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_DS
)
10894 ins
->used_prefixes
|= ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
);
10895 *ins
->obufp
++ = ',';
10896 *ins
->obufp
++ = 'p';
10898 /* Set active_seg_prefix even if not set in 64-bit mode
10899 because here it is a valid branch hint. */
10900 if (ins
->prefixes
& PREFIX_DS
)
10902 ins
->active_seg_prefix
= PREFIX_DS
;
10903 *ins
->obufp
++ = 't';
10907 ins
->active_seg_prefix
= PREFIX_CS
;
10908 *ins
->obufp
++ = 'n';
10912 else if (l
== 1 && last
[0] == 'X')
10915 *ins
->obufp
++ = 'h';
10917 oappend (ins
, "{bad}");
10924 if (ins
->rex
& REX_W
)
10925 *ins
->obufp
++ = 'q';
10927 *ins
->obufp
++ = 'd';
10932 if (ins
->intel_mnemonic
!= cond
)
10933 *ins
->obufp
++ = 'r';
10936 if ((ins
->prefixes
& PREFIX_FWAIT
) == 0)
10937 *ins
->obufp
++ = 'n';
10939 ins
->used_prefixes
|= PREFIX_FWAIT
;
10943 if (ins
->rex
& REX_W
)
10944 *ins
->obufp
++ = 'o';
10945 else if (ins
->intel_syntax
&& (sizeflag
& DFLAG
))
10946 *ins
->obufp
++ = 'q';
10948 *ins
->obufp
++ = 'd';
10949 if (!(ins
->rex
& REX_W
))
10950 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10953 if (ins
->address_mode
== mode_64bit
10954 && (ins
->isa64
== intel64
|| (ins
->rex
& REX_W
)
10955 || !(ins
->prefixes
& PREFIX_DATA
)))
10957 if (sizeflag
& SUFFIX_ALWAYS
)
10958 *ins
->obufp
++ = 'q';
10961 /* Fall through. */
10965 if ((ins
->modrm
.mod
== 3 || !cond
)
10966 && !(sizeflag
& SUFFIX_ALWAYS
))
10968 /* Fall through. */
10970 if ((!(ins
->rex
& REX_W
) && (ins
->prefixes
& PREFIX_DATA
))
10971 || ((sizeflag
& SUFFIX_ALWAYS
)
10972 && ins
->address_mode
!= mode_64bit
))
10974 *ins
->obufp
++ = (sizeflag
& DFLAG
)
10975 ? ins
->intel_syntax
? 'd' : 'l' : 'w';
10976 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10978 else if (sizeflag
& SUFFIX_ALWAYS
)
10979 *ins
->obufp
++ = 'q';
10981 else if (l
== 1 && last
[0] == 'L')
10983 if ((ins
->prefixes
& PREFIX_DATA
)
10984 || (ins
->rex
& REX_W
)
10985 || (sizeflag
& SUFFIX_ALWAYS
))
10988 if (ins
->rex
& REX_W
)
10989 *ins
->obufp
++ = 'q';
10992 if (sizeflag
& DFLAG
)
10993 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10995 *ins
->obufp
++ = 'w';
10996 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11006 if (ins
->intel_syntax
&& !alt
)
11009 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
11010 || (sizeflag
& SUFFIX_ALWAYS
))
11012 if (ins
->rex
& REX_W
)
11013 *ins
->obufp
++ = 'q';
11016 if (sizeflag
& DFLAG
)
11017 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
11019 *ins
->obufp
++ = 'w';
11020 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11024 else if (l
== 1 && last
[0] == 'D')
11025 *ins
->obufp
++ = ins
->vex
.w
? 'q' : 'd';
11026 else if (l
== 1 && last
[0] == 'L')
11028 if (cond
? ins
->modrm
.mod
== 3 && !(sizeflag
& SUFFIX_ALWAYS
)
11029 : ins
->address_mode
!= mode_64bit
)
11031 if ((ins
->rex
& REX_W
))
11034 *ins
->obufp
++ = 'q';
11036 else if ((ins
->address_mode
== mode_64bit
&& cond
)
11037 || (sizeflag
& SUFFIX_ALWAYS
))
11038 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
11045 if (ins
->rex
& REX_W
)
11046 *ins
->obufp
++ = 'q';
11047 else if (sizeflag
& DFLAG
)
11049 if (ins
->intel_syntax
)
11050 *ins
->obufp
++ = 'd';
11052 *ins
->obufp
++ = 'l';
11055 *ins
->obufp
++ = 'w';
11056 if (ins
->intel_syntax
&& !p
[1]
11057 && ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
)))
11058 *ins
->obufp
++ = 'e';
11059 if (!(ins
->rex
& REX_W
))
11060 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11066 if (ins
->intel_syntax
)
11068 if (sizeflag
& SUFFIX_ALWAYS
)
11070 if (ins
->rex
& REX_W
)
11071 *ins
->obufp
++ = 'q';
11074 if (sizeflag
& DFLAG
)
11075 *ins
->obufp
++ = 'l';
11077 *ins
->obufp
++ = 'w';
11078 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11088 if (ins
->address_mode
== mode_64bit
11089 && !(ins
->prefixes
& PREFIX_ADDR
))
11091 *ins
->obufp
++ = 'a';
11092 *ins
->obufp
++ = 'b';
11093 *ins
->obufp
++ = 's';
11098 if (!ins
->vex
.evex
|| !ins
->vex
.w
)
11099 *ins
->obufp
++ = 's';
11101 oappend (ins
, "{bad}");
11117 *ins
->obufp
++ = '{';
11118 *ins
->obufp
++ = 'v';
11119 *ins
->obufp
++ = 'e';
11120 *ins
->obufp
++ = 'x';
11121 *ins
->obufp
++ = '}';
11122 *ins
->obufp
++ = ' ';
11125 if (!(ins
->rex
& REX_W
))
11127 *ins
->obufp
++ = 'a';
11128 *ins
->obufp
++ = 'b';
11129 *ins
->obufp
++ = 's';
11141 /* operand size flag for cwtl, cbtw */
11143 if (ins
->rex
& REX_W
)
11145 if (ins
->intel_syntax
)
11146 *ins
->obufp
++ = 'd';
11148 *ins
->obufp
++ = 'l';
11150 else if (sizeflag
& DFLAG
)
11151 *ins
->obufp
++ = 'w';
11153 *ins
->obufp
++ = 'b';
11154 if (!(ins
->rex
& REX_W
))
11155 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11159 if (!ins
->need_vex
)
11161 if (last
[0] == 'X')
11162 *ins
->obufp
++ = ins
->vex
.w
? 'd': 's';
11163 else if (last
[0] == 'B')
11164 *ins
->obufp
++ = ins
->vex
.w
? 'w': 'b';
11175 ? ins
->vex
.prefix
== DATA_PREFIX_OPCODE
11176 : ins
->prefixes
& PREFIX_DATA
)
11178 *ins
->obufp
++ = 'd';
11179 ins
->used_prefixes
|= PREFIX_DATA
;
11182 *ins
->obufp
++ = 's';
11185 if (l
== 1 && last
[0] == 'X')
11187 if (!ins
->need_vex
)
11189 if (ins
->intel_syntax
11190 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
11191 && !(sizeflag
& SUFFIX_ALWAYS
)))
11193 switch (ins
->vex
.length
)
11196 *ins
->obufp
++ = 'x';
11199 *ins
->obufp
++ = 'y';
11202 if (!ins
->vex
.evex
)
11213 /* These insns ignore ModR/M.mod: Force it to 3 for OP_E(). */
11214 ins
->modrm
.mod
= 3;
11215 if (!ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
11216 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
11218 else if (l
== 1 && last
[0] == 'X')
11220 if (!ins
->vex
.evex
)
11222 if (ins
->intel_syntax
11223 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
11224 && !(sizeflag
& SUFFIX_ALWAYS
)))
11226 switch (ins
->vex
.length
)
11229 *ins
->obufp
++ = 'x';
11232 *ins
->obufp
++ = 'y';
11235 *ins
->obufp
++ = 'z';
11245 if (ins
->intel_syntax
)
11247 if (ins
->isa64
== intel64
&& (ins
->rex
& REX_W
))
11250 *ins
->obufp
++ = 'q';
11253 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
11255 if (sizeflag
& DFLAG
)
11256 *ins
->obufp
++ = 'l';
11258 *ins
->obufp
++ = 'w';
11259 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11268 ins
->mnemonicendp
= ins
->obufp
;
11272 /* Add a style marker to *INS->obufp that encodes STYLE. This assumes that
11273 the buffer pointed to by INS->obufp has space. A style marker is made
11274 from the STYLE_MARKER_CHAR followed by STYLE converted to a single hex
11275 digit, followed by another STYLE_MARKER_CHAR. This function assumes
11276 that the number of styles is not greater than 16. */
11279 oappend_insert_style (instr_info
*ins
, enum disassembler_style style
)
11281 unsigned num
= (unsigned) style
;
11283 /* We currently assume that STYLE can be encoded as a single hex
11284 character. If more styles are added then this might start to fail,
11285 and we'll need to expand this code. */
11289 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11290 *ins
->obufp
++ = (num
< 10 ? ('0' + num
)
11291 : ((num
< 16) ? ('a' + (num
- 10)) : '0'));
11292 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11294 /* This final null character is not strictly necessary, after inserting a
11295 style marker we should always be inserting some additional content.
11296 However, having the buffer null terminated doesn't cost much, and make
11297 it easier to debug what's going on. Also, if we do ever forget to add
11298 any additional content after this style marker, then the buffer will
11299 still be well formed. */
11300 *ins
->obufp
= '\0';
11304 oappend_with_style (instr_info
*ins
, const char *s
,
11305 enum disassembler_style style
)
11307 oappend_insert_style (ins
, style
);
11308 ins
->obufp
= stpcpy (ins
->obufp
, s
);
11311 /* Like oappend_with_style but always with text style. */
11314 oappend (instr_info
*ins
, const char *s
)
11316 oappend_with_style (ins
, s
, dis_style_text
);
11319 /* Add a single character C to the buffer pointer to by INS->obufp, marking
11320 the style for the character as STYLE. */
11323 oappend_char_with_style (instr_info
*ins
, const char c
,
11324 enum disassembler_style style
)
11326 oappend_insert_style (ins
, style
);
11328 *ins
->obufp
= '\0';
11331 /* Like oappend_char_with_style, but always uses dis_style_text. */
11334 oappend_char (instr_info
*ins
, const char c
)
11336 oappend_char_with_style (ins
, c
, dis_style_text
);
11340 append_seg (instr_info
*ins
)
11342 /* Only print the active segment register. */
11343 if (!ins
->active_seg_prefix
)
11346 ins
->used_prefixes
|= ins
->active_seg_prefix
;
11347 switch (ins
->active_seg_prefix
)
11350 oappend_register (ins
, att_names_seg
[1]);
11353 oappend_register (ins
, att_names_seg
[3]);
11356 oappend_register (ins
, att_names_seg
[2]);
11359 oappend_register (ins
, att_names_seg
[0]);
11362 oappend_register (ins
, att_names_seg
[4]);
11365 oappend_register (ins
, att_names_seg
[5]);
11370 oappend_char (ins
, ':');
11374 OP_indirE (instr_info
*ins
, int bytemode
, int sizeflag
)
11376 if (!ins
->intel_syntax
)
11377 oappend (ins
, "*");
11378 return OP_E (ins
, bytemode
, sizeflag
);
11382 print_operand_value (instr_info
*ins
, bfd_vma disp
,
11383 enum disassembler_style style
)
11387 if (ins
->address_mode
== mode_64bit
)
11388 sprintf (tmp
, "0x%" PRIx64
, (uint64_t) disp
);
11390 sprintf (tmp
, "0x%x", (unsigned int) disp
);
11391 oappend_with_style (ins
, tmp
, style
);
11394 /* Like oappend, but called for immediate operands. */
11397 oappend_immediate (instr_info
*ins
, bfd_vma imm
)
11399 if (!ins
->intel_syntax
)
11400 oappend_char_with_style (ins
, '$', dis_style_immediate
);
11401 print_operand_value (ins
, imm
, dis_style_immediate
);
11404 /* Put DISP in BUF as signed hex number. */
11407 print_displacement (instr_info
*ins
, bfd_signed_vma val
)
11413 oappend_char_with_style (ins
, '-', dis_style_address_offset
);
11414 val
= (bfd_vma
) 0 - val
;
11416 /* Check for possible overflow. */
11419 switch (ins
->address_mode
)
11422 oappend_with_style (ins
, "0x8000000000000000",
11423 dis_style_address_offset
);
11426 oappend_with_style (ins
, "0x80000000",
11427 dis_style_address_offset
);
11430 oappend_with_style (ins
, "0x8000",
11431 dis_style_address_offset
);
11438 sprintf (tmp
, "0x%" PRIx64
, (int64_t) val
);
11439 oappend_with_style (ins
, tmp
, dis_style_address_offset
);
11443 intel_operand_size (instr_info
*ins
, int bytemode
, int sizeflag
)
11447 if (!ins
->vex
.no_broadcast
)
11451 case evex_half_bcst_xmmq_mode
:
11453 oappend (ins
, "QWORD BCST ");
11455 oappend (ins
, "DWORD BCST ");
11458 case evex_half_bcst_xmmqh_mode
:
11459 case evex_half_bcst_xmmqdh_mode
:
11460 oappend (ins
, "WORD BCST ");
11463 ins
->vex
.no_broadcast
= true;
11473 oappend (ins
, "BYTE PTR ");
11478 oappend (ins
, "WORD PTR ");
11481 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11483 oappend (ins
, "QWORD PTR ");
11486 /* Fall through. */
11488 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11489 || (ins
->rex
& REX_W
)))
11491 oappend (ins
, "QWORD PTR ");
11494 /* Fall through. */
11499 if (ins
->rex
& REX_W
)
11500 oappend (ins
, "QWORD PTR ");
11501 else if (bytemode
== dq_mode
)
11502 oappend (ins
, "DWORD PTR ");
11505 if (sizeflag
& DFLAG
)
11506 oappend (ins
, "DWORD PTR ");
11508 oappend (ins
, "WORD PTR ");
11509 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11513 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
11514 *ins
->obufp
++ = 'D';
11515 oappend (ins
, "WORD PTR ");
11516 if (!(ins
->rex
& REX_W
))
11517 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11520 if (sizeflag
& DFLAG
)
11521 oappend (ins
, "QWORD PTR ");
11523 oappend (ins
, "DWORD PTR ");
11524 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11527 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11528 oappend (ins
, "WORD PTR ");
11530 oappend (ins
, "DWORD PTR ");
11531 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11535 oappend (ins
, "DWORD PTR ");
11539 oappend (ins
, "QWORD PTR ");
11542 if (ins
->address_mode
== mode_64bit
)
11543 oappend (ins
, "QWORD PTR ");
11545 oappend (ins
, "DWORD PTR ");
11548 if (sizeflag
& DFLAG
)
11549 oappend (ins
, "FWORD PTR ");
11551 oappend (ins
, "DWORD PTR ");
11552 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11555 oappend (ins
, "TBYTE PTR ");
11560 case evex_x_gscat_mode
:
11561 case evex_x_nobcst_mode
:
11565 switch (ins
->vex
.length
)
11568 oappend (ins
, "XMMWORD PTR ");
11571 oappend (ins
, "YMMWORD PTR ");
11574 oappend (ins
, "ZMMWORD PTR ");
11581 oappend (ins
, "XMMWORD PTR ");
11584 oappend (ins
, "XMMWORD PTR ");
11587 oappend (ins
, "YMMWORD PTR ");
11590 case evex_half_bcst_xmmqh_mode
:
11591 case evex_half_bcst_xmmq_mode
:
11592 if (!ins
->need_vex
)
11595 switch (ins
->vex
.length
)
11598 oappend (ins
, "QWORD PTR ");
11601 oappend (ins
, "XMMWORD PTR ");
11604 oappend (ins
, "YMMWORD PTR ");
11611 if (!ins
->need_vex
)
11614 switch (ins
->vex
.length
)
11617 oappend (ins
, "WORD PTR ");
11620 oappend (ins
, "DWORD PTR ");
11623 oappend (ins
, "QWORD PTR ");
11630 case evex_half_bcst_xmmqdh_mode
:
11631 if (!ins
->need_vex
)
11634 switch (ins
->vex
.length
)
11637 oappend (ins
, "DWORD PTR ");
11640 oappend (ins
, "QWORD PTR ");
11643 oappend (ins
, "XMMWORD PTR ");
11650 if (!ins
->need_vex
)
11653 switch (ins
->vex
.length
)
11656 oappend (ins
, "QWORD PTR ");
11659 oappend (ins
, "YMMWORD PTR ");
11662 oappend (ins
, "ZMMWORD PTR ");
11669 oappend (ins
, "OWORD PTR ");
11671 case vex_vsib_d_w_dq_mode
:
11672 case vex_vsib_q_w_dq_mode
:
11673 if (!ins
->need_vex
)
11676 oappend (ins
, "QWORD PTR ");
11678 oappend (ins
, "DWORD PTR ");
11681 if (!ins
->need_vex
|| ins
->vex
.length
!= 128)
11684 oappend (ins
, "DWORD PTR ");
11686 oappend (ins
, "BYTE PTR ");
11689 if (!ins
->need_vex
)
11692 oappend (ins
, "QWORD PTR ");
11694 oappend (ins
, "WORD PTR ");
11704 print_register (instr_info
*ins
, unsigned int reg
, unsigned int rexmask
,
11705 int bytemode
, int sizeflag
)
11707 const char (*names
)[8];
11709 USED_REX (rexmask
);
11710 if (ins
->rex
& rexmask
)
11720 names
= att_names8rex
;
11722 names
= att_names8
;
11725 names
= att_names16
;
11730 names
= att_names32
;
11733 names
= att_names64
;
11737 names
= ins
->address_mode
== mode_64bit
? att_names64
: att_names32
;
11740 case bnd_swap_mode
:
11743 oappend (ins
, "(bad)");
11746 names
= att_names_bnd
;
11749 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11751 names
= att_names64
;
11754 /* Fall through. */
11756 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11757 || (ins
->rex
& REX_W
)))
11759 names
= att_names64
;
11763 /* Fall through. */
11768 if (ins
->rex
& REX_W
)
11769 names
= att_names64
;
11770 else if (bytemode
!= v_mode
&& bytemode
!= v_swap_mode
)
11771 names
= att_names32
;
11774 if (sizeflag
& DFLAG
)
11775 names
= att_names32
;
11777 names
= att_names16
;
11778 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11782 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11783 names
= att_names16
;
11785 names
= att_names32
;
11786 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11789 names
= (ins
->address_mode
== mode_64bit
11790 ? att_names64
: att_names32
);
11791 if (!(ins
->prefixes
& PREFIX_ADDR
))
11792 names
= (ins
->address_mode
== mode_16bit
11793 ? att_names16
: names
);
11796 /* Remove "addr16/addr32". */
11797 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
11798 names
= (ins
->address_mode
!= mode_32bit
11799 ? att_names32
: att_names16
);
11800 ins
->used_prefixes
|= PREFIX_ADDR
;
11807 oappend (ins
, "(bad)");
11810 names
= att_names_mask
;
11815 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
11818 oappend_register (ins
, names
[reg
]);
11822 OP_E_memory (instr_info
*ins
, int bytemode
, int sizeflag
)
11824 int add
= (ins
->rex
& REX_B
) ? 8 : 0;
11842 if (ins
->address_mode
!= mode_64bit
)
11850 case vex_vsib_d_w_dq_mode
:
11851 case vex_vsib_q_w_dq_mode
:
11852 case evex_x_gscat_mode
:
11853 shift
= ins
->vex
.w
? 3 : 2;
11856 case evex_half_bcst_xmmqh_mode
:
11857 case evex_half_bcst_xmmqdh_mode
:
11860 shift
= ins
->vex
.w
? 2 : 1;
11863 /* Fall through. */
11865 case evex_half_bcst_xmmq_mode
:
11868 shift
= ins
->vex
.w
? 3 : 2;
11871 /* Fall through. */
11876 case evex_x_nobcst_mode
:
11878 switch (ins
->vex
.length
)
11892 /* Make necessary corrections to shift for modes that need it. */
11893 if (bytemode
== xmmq_mode
11894 || bytemode
== evex_half_bcst_xmmqh_mode
11895 || bytemode
== evex_half_bcst_xmmq_mode
11896 || (bytemode
== ymmq_mode
&& ins
->vex
.length
== 128))
11898 else if (bytemode
== xmmqd_mode
11899 || bytemode
== evex_half_bcst_xmmqdh_mode
)
11901 else if (bytemode
== xmmdw_mode
)
11915 shift
= ins
->vex
.w
? 1 : 0;
11925 if (ins
->intel_syntax
)
11926 intel_operand_size (ins
, bytemode
, sizeflag
);
11929 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
11931 /* 32/64 bit address mode */
11932 bfd_signed_vma disp
= 0;
11940 int addr32flag
= !((sizeflag
& AFLAG
)
11941 || bytemode
== v_bnd_mode
11942 || bytemode
== v_bndmk_mode
11943 || bytemode
== bnd_mode
11944 || bytemode
== bnd_swap_mode
);
11945 bool check_gather
= false;
11946 const char (*indexes
)[8] = NULL
;
11949 base
= ins
->modrm
.rm
;
11953 vindex
= ins
->sib
.index
;
11955 if (ins
->rex
& REX_X
)
11959 case vex_vsib_d_w_dq_mode
:
11960 case vex_vsib_q_w_dq_mode
:
11961 if (!ins
->need_vex
)
11967 check_gather
= ins
->obufp
== ins
->op_out
[1];
11970 switch (ins
->vex
.length
)
11973 indexes
= att_names_xmm
;
11977 || bytemode
== vex_vsib_q_w_dq_mode
)
11978 indexes
= att_names_ymm
;
11980 indexes
= att_names_xmm
;
11984 || bytemode
== vex_vsib_q_w_dq_mode
)
11985 indexes
= att_names_zmm
;
11987 indexes
= att_names_ymm
;
11995 indexes
= ins
->address_mode
== mode_64bit
&& !addr32flag
11996 ? att_names64
: att_names32
;
11999 scale
= ins
->sib
.scale
;
12000 base
= ins
->sib
.base
;
12005 /* Check for mandatory SIB. */
12006 if (bytemode
== vex_vsib_d_w_dq_mode
12007 || bytemode
== vex_vsib_q_w_dq_mode
12008 || bytemode
== vex_sibmem_mode
)
12010 oappend (ins
, "(bad)");
12014 rbase
= base
+ add
;
12016 switch (ins
->modrm
.mod
)
12022 if (ins
->address_mode
== mode_64bit
&& !ins
->has_sib
)
12024 if (!get32s (ins
, &disp
))
12026 if (riprel
&& bytemode
== v_bndmk_mode
)
12028 oappend (ins
, "(bad)");
12034 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
12036 disp
= *ins
->codep
++;
12037 if ((disp
& 0x80) != 0)
12039 if (ins
->vex
.evex
&& shift
> 0)
12043 if (!get32s (ins
, &disp
))
12053 && ins
->address_mode
!= mode_16bit
)
12055 if (ins
->address_mode
== mode_64bit
)
12059 /* Without base nor index registers, zero-extend the
12060 lower 32-bit displacement to 64 bits. */
12061 disp
= (unsigned int) disp
;
12068 /* In 32-bit mode, we need index register to tell [offset]
12069 from [eiz*1 + offset]. */
12074 havedisp
= (havebase
12076 || (ins
->has_sib
&& (indexes
|| scale
!= 0)));
12078 if (!ins
->intel_syntax
)
12079 if (ins
->modrm
.mod
!= 0 || base
== 5)
12081 if (havedisp
|| riprel
)
12082 print_displacement (ins
, disp
);
12084 print_operand_value (ins
, disp
, dis_style_address_offset
);
12087 set_op (ins
, disp
, true);
12088 oappend_char (ins
, '(');
12089 oappend_with_style (ins
, !addr32flag
? "%rip" : "%eip",
12090 dis_style_register
);
12091 oappend_char (ins
, ')');
12095 if ((havebase
|| indexes
|| needindex
|| needaddr32
|| riprel
)
12096 && (ins
->address_mode
!= mode_64bit
12097 || ((bytemode
!= v_bnd_mode
)
12098 && (bytemode
!= v_bndmk_mode
)
12099 && (bytemode
!= bnd_mode
)
12100 && (bytemode
!= bnd_swap_mode
))))
12101 ins
->used_prefixes
|= PREFIX_ADDR
;
12103 if (havedisp
|| (ins
->intel_syntax
&& riprel
))
12105 oappend_char (ins
, ins
->open_char
);
12106 if (ins
->intel_syntax
&& riprel
)
12108 set_op (ins
, disp
, true);
12109 oappend_with_style (ins
, !addr32flag
? "rip" : "eip",
12110 dis_style_register
);
12115 (ins
->address_mode
== mode_64bit
&& !addr32flag
12116 ? att_names64
: att_names32
)[rbase
]);
12119 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
12120 print index to tell base + index from base. */
12124 || (havebase
&& base
!= ESP_REG_NUM
))
12126 if (!ins
->intel_syntax
|| havebase
)
12127 oappend_char (ins
, ins
->separator_char
);
12130 if (ins
->address_mode
== mode_64bit
|| vindex
< 16)
12131 oappend_register (ins
, indexes
[vindex
]);
12133 oappend (ins
, "(bad)");
12136 oappend_register (ins
,
12137 ins
->address_mode
== mode_64bit
12142 oappend_char (ins
, ins
->scale_char
);
12143 oappend_char_with_style (ins
, '0' + (1 << scale
),
12144 dis_style_immediate
);
12147 if (ins
->intel_syntax
12148 && (disp
|| ins
->modrm
.mod
!= 0 || base
== 5))
12150 if (!havedisp
|| disp
>= 0)
12151 oappend_char (ins
, '+');
12153 print_displacement (ins
, disp
);
12155 print_operand_value (ins
, disp
, dis_style_address_offset
);
12158 oappend_char (ins
, ins
->close_char
);
12162 /* Both XMM/YMM/ZMM registers must be distinct. */
12163 int modrm_reg
= ins
->modrm
.reg
;
12165 if (ins
->rex
& REX_R
)
12169 if (vindex
== modrm_reg
)
12170 oappend (ins
, "/(bad)");
12173 else if (ins
->intel_syntax
)
12175 if (ins
->modrm
.mod
!= 0 || base
== 5)
12177 if (!ins
->active_seg_prefix
)
12179 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12180 oappend (ins
, ":");
12182 print_operand_value (ins
, disp
, dis_style_text
);
12186 else if (bytemode
== v_bnd_mode
12187 || bytemode
== v_bndmk_mode
12188 || bytemode
== bnd_mode
12189 || bytemode
== bnd_swap_mode
12190 || bytemode
== vex_vsib_d_w_dq_mode
12191 || bytemode
== vex_vsib_q_w_dq_mode
)
12193 oappend (ins
, "(bad)");
12198 /* 16 bit address mode */
12201 ins
->used_prefixes
|= ins
->prefixes
& PREFIX_ADDR
;
12202 switch (ins
->modrm
.mod
)
12205 if (ins
->modrm
.rm
== 6)
12208 if (!get16 (ins
, &disp
))
12210 if ((disp
& 0x8000) != 0)
12215 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
12217 disp
= *ins
->codep
++;
12218 if ((disp
& 0x80) != 0)
12220 if (ins
->vex
.evex
&& shift
> 0)
12225 if (!ins
->intel_syntax
)
12226 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6)
12227 print_displacement (ins
, disp
);
12229 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 6)
12231 oappend_char (ins
, ins
->open_char
);
12232 oappend (ins
, ins
->intel_syntax
? intel_index16
[ins
->modrm
.rm
]
12233 : att_index16
[ins
->modrm
.rm
]);
12234 if (ins
->intel_syntax
12235 && (disp
|| ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6))
12238 oappend_char (ins
, '+');
12239 print_displacement (ins
, disp
);
12242 oappend_char (ins
, ins
->close_char
);
12244 else if (ins
->intel_syntax
)
12246 if (!ins
->active_seg_prefix
)
12248 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12249 oappend (ins
, ":");
12251 print_operand_value (ins
, disp
& 0xffff, dis_style_text
);
12256 ins
->evex_used
|= EVEX_b_used
;
12258 /* Broadcast can only ever be valid for memory sources. */
12259 if (ins
->obufp
== ins
->op_out
[0])
12260 ins
->vex
.no_broadcast
= true;
12262 if (!ins
->vex
.no_broadcast
12263 && (!ins
->intel_syntax
|| !(ins
->evex_used
& EVEX_len_used
)))
12265 if (bytemode
== xh_mode
)
12267 switch (ins
->vex
.length
)
12270 oappend (ins
, "{1to8}");
12273 oappend (ins
, "{1to16}");
12276 oappend (ins
, "{1to32}");
12282 else if (bytemode
== q_mode
12283 || bytemode
== ymmq_mode
)
12284 ins
->vex
.no_broadcast
= true;
12285 else if (ins
->vex
.w
12286 || bytemode
== evex_half_bcst_xmmqdh_mode
12287 || bytemode
== evex_half_bcst_xmmq_mode
)
12289 switch (ins
->vex
.length
)
12292 oappend (ins
, "{1to2}");
12295 oappend (ins
, "{1to4}");
12298 oappend (ins
, "{1to8}");
12304 else if (bytemode
== x_mode
12305 || bytemode
== evex_half_bcst_xmmqh_mode
)
12307 switch (ins
->vex
.length
)
12310 oappend (ins
, "{1to4}");
12313 oappend (ins
, "{1to8}");
12316 oappend (ins
, "{1to16}");
12323 ins
->vex
.no_broadcast
= true;
12325 if (ins
->vex
.no_broadcast
)
12326 oappend (ins
, "{bad}");
12333 OP_E (instr_info
*ins
, int bytemode
, int sizeflag
)
12335 /* Skip mod/rm byte. */
12339 if (ins
->modrm
.mod
== 3)
12341 if ((sizeflag
& SUFFIX_ALWAYS
)
12342 && (bytemode
== b_swap_mode
12343 || bytemode
== bnd_swap_mode
12344 || bytemode
== v_swap_mode
))
12345 swap_operand (ins
);
12347 print_register (ins
, ins
->modrm
.rm
, REX_B
, bytemode
, sizeflag
);
12351 return OP_E_memory (ins
, bytemode
, sizeflag
);
12355 OP_G (instr_info
*ins
, int bytemode
, int sizeflag
)
12357 if (ins
->vex
.evex
&& !ins
->vex
.r
&& ins
->address_mode
== mode_64bit
)
12358 oappend (ins
, "(bad)");
12360 print_register (ins
, ins
->modrm
.reg
, REX_R
, bytemode
, sizeflag
);
12365 get64 (instr_info
*ins
, uint64_t *res
)
12370 if (!fetch_code (ins
->info
, ins
->codep
+ 8))
12372 a
= *ins
->codep
++ & 0xff;
12373 a
|= (*ins
->codep
++ & 0xff) << 8;
12374 a
|= (*ins
->codep
++ & 0xff) << 16;
12375 a
|= (*ins
->codep
++ & 0xffu
) << 24;
12376 b
= *ins
->codep
++ & 0xff;
12377 b
|= (*ins
->codep
++ & 0xff) << 8;
12378 b
|= (*ins
->codep
++ & 0xff) << 16;
12379 b
|= (*ins
->codep
++ & 0xffu
) << 24;
12380 *res
= a
+ ((uint64_t) b
<< 32);
12385 get32 (instr_info
*ins
, bfd_signed_vma
*res
)
12387 if (!fetch_code (ins
->info
, ins
->codep
+ 4))
12389 *res
= *ins
->codep
++ & (bfd_vma
) 0xff;
12390 *res
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 8;
12391 *res
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 16;
12392 *res
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 24;
12397 get32s (instr_info
*ins
, bfd_signed_vma
*res
)
12399 if (!get32 (ins
, res
))
12402 *res
= (*res
^ ((bfd_vma
) 1 << 31)) - ((bfd_vma
) 1 << 31);
12408 get16 (instr_info
*ins
, int *res
)
12410 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
12412 *res
= *ins
->codep
++ & 0xff;
12413 *res
|= (*ins
->codep
++ & 0xff) << 8;
12418 set_op (instr_info
*ins
, bfd_vma op
, bool riprel
)
12420 ins
->op_index
[ins
->op_ad
] = ins
->op_ad
;
12421 if (ins
->address_mode
== mode_64bit
)
12422 ins
->op_address
[ins
->op_ad
] = op
;
12423 else /* Mask to get a 32-bit address. */
12424 ins
->op_address
[ins
->op_ad
] = op
& 0xffffffff;
12425 ins
->op_riprel
[ins
->op_ad
] = riprel
;
12429 OP_REG (instr_info
*ins
, int code
, int sizeflag
)
12436 case es_reg
: case ss_reg
: case cs_reg
:
12437 case ds_reg
: case fs_reg
: case gs_reg
:
12438 oappend_register (ins
, att_names_seg
[code
- es_reg
]);
12443 if (ins
->rex
& REX_B
)
12450 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
12451 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
12452 s
= att_names16
[code
- ax_reg
+ add
];
12454 case ah_reg
: case ch_reg
: case dh_reg
: case bh_reg
:
12456 /* Fall through. */
12457 case al_reg
: case cl_reg
: case dl_reg
: case bl_reg
:
12459 s
= att_names8rex
[code
- al_reg
+ add
];
12461 s
= att_names8
[code
- al_reg
];
12463 case rAX_reg
: case rCX_reg
: case rDX_reg
: case rBX_reg
:
12464 case rSP_reg
: case rBP_reg
: case rSI_reg
: case rDI_reg
:
12465 if (ins
->address_mode
== mode_64bit
12466 && ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12468 s
= att_names64
[code
- rAX_reg
+ add
];
12471 code
+= eAX_reg
- rAX_reg
;
12472 /* Fall through. */
12473 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
12474 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
12476 if (ins
->rex
& REX_W
)
12477 s
= att_names64
[code
- eAX_reg
+ add
];
12480 if (sizeflag
& DFLAG
)
12481 s
= att_names32
[code
- eAX_reg
+ add
];
12483 s
= att_names16
[code
- eAX_reg
+ add
];
12484 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12488 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12491 oappend_register (ins
, s
);
12496 OP_IMREG (instr_info
*ins
, int code
, int sizeflag
)
12503 if (!ins
->intel_syntax
)
12505 oappend (ins
, "(%dx)");
12508 s
= att_names16
[dx_reg
- ax_reg
];
12510 case al_reg
: case cl_reg
:
12511 s
= att_names8
[code
- al_reg
];
12515 if (ins
->rex
& REX_W
)
12520 /* Fall through. */
12521 case z_mode_ax_reg
:
12522 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
12526 if (!(ins
->rex
& REX_W
))
12527 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12530 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12533 oappend_register (ins
, s
);
12538 OP_I (instr_info
*ins
, int bytemode
, int sizeflag
)
12541 bfd_signed_vma mask
= -1;
12546 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
12548 op
= *ins
->codep
++;
12553 if (ins
->rex
& REX_W
)
12555 if (!get32s (ins
, &op
))
12560 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12561 if (sizeflag
& DFLAG
)
12564 if (!get32 (ins
, &op
))
12573 if (!get16 (ins
, &num
))
12581 if (ins
->intel_syntax
)
12582 oappend (ins
, "1");
12585 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12590 oappend_immediate (ins
, op
);
12595 OP_I64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12599 if (bytemode
!= v_mode
|| ins
->address_mode
!= mode_64bit
12600 || !(ins
->rex
& REX_W
))
12601 return OP_I (ins
, bytemode
, sizeflag
);
12605 if (!get64 (ins
, &op
))
12608 oappend_immediate (ins
, op
);
12613 OP_sI (instr_info
*ins
, int bytemode
, int sizeflag
)
12621 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
12623 op
= *ins
->codep
++;
12624 if ((op
& 0x80) != 0)
12626 if (bytemode
== b_T_mode
)
12628 if (ins
->address_mode
!= mode_64bit
12629 || !((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12631 /* The operand-size prefix is overridden by a REX prefix. */
12632 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12640 if (!(ins
->rex
& REX_W
))
12642 if (sizeflag
& DFLAG
)
12650 /* The operand-size prefix is overridden by a REX prefix. */
12651 if (!(sizeflag
& DFLAG
) && !(ins
->rex
& REX_W
))
12655 if (!get16 (ins
, &val
))
12659 else if (!get32s (ins
, &op
))
12663 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12667 oappend_immediate (ins
, op
);
12672 OP_J (instr_info
*ins
, int bytemode
, int sizeflag
)
12676 bfd_vma segment
= 0;
12681 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
12683 disp
= *ins
->codep
++;
12684 if ((disp
& 0x80) != 0)
12689 if ((sizeflag
& DFLAG
)
12690 || (ins
->address_mode
== mode_64bit
12691 && ((ins
->isa64
== intel64
&& bytemode
!= dqw_mode
)
12692 || (ins
->rex
& REX_W
))))
12694 bfd_signed_vma val
;
12696 if (!get32s (ins
, &val
))
12705 disp
= val
& 0x8000 ? val
- 0x10000 : val
;
12706 /* In 16bit mode, address is wrapped around at 64k within
12707 the same segment. Otherwise, a data16 prefix on a jump
12708 instruction means that the pc is masked to 16 bits after
12709 the displacement is added! */
12711 if ((ins
->prefixes
& PREFIX_DATA
) == 0)
12712 segment
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
))
12713 & ~((bfd_vma
) 0xffff));
12715 if (ins
->address_mode
!= mode_64bit
12716 || (ins
->isa64
!= intel64
&& !(ins
->rex
& REX_W
)))
12717 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12720 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12723 disp
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
) + disp
) & mask
)
12725 set_op (ins
, disp
, false);
12726 print_operand_value (ins
, disp
, dis_style_text
);
12731 OP_SEG (instr_info
*ins
, int bytemode
, int sizeflag
)
12733 if (bytemode
== w_mode
)
12735 oappend_register (ins
, att_names_seg
[ins
->modrm
.reg
]);
12738 return OP_E (ins
, ins
->modrm
.mod
== 3 ? bytemode
: w_mode
, sizeflag
);
12742 OP_DIR (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
, int sizeflag
)
12744 int seg
, offset
, res
;
12747 if (sizeflag
& DFLAG
)
12749 bfd_signed_vma val
;
12751 if (!get32 (ins
, &val
))
12755 else if (!get16 (ins
, &offset
))
12757 if (!get16 (ins
, &seg
))
12759 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12761 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12762 ins
->intel_syntax
? "0x%x:0x%x" : "$0x%x,$0x%x",
12764 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12766 oappend (ins
, scratch
);
12771 OP_OFF (instr_info
*ins
, int bytemode
, int sizeflag
)
12775 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12776 intel_operand_size (ins
, bytemode
, sizeflag
);
12779 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
12781 bfd_signed_vma val
;
12783 if (!get32 (ins
, &val
))
12791 if (!get16 (ins
, &val
))
12796 if (ins
->intel_syntax
)
12798 if (!ins
->active_seg_prefix
)
12800 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12801 oappend (ins
, ":");
12804 print_operand_value (ins
, off
, dis_style_address_offset
);
12809 OP_OFF64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12813 if (ins
->address_mode
!= mode_64bit
12814 || (ins
->prefixes
& PREFIX_ADDR
))
12815 return OP_OFF (ins
, bytemode
, sizeflag
);
12817 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12818 intel_operand_size (ins
, bytemode
, sizeflag
);
12821 if (!get64 (ins
, &off
))
12824 if (ins
->intel_syntax
)
12826 if (!ins
->active_seg_prefix
)
12828 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12829 oappend (ins
, ":");
12832 print_operand_value (ins
, off
, dis_style_address_offset
);
12837 ptr_reg (instr_info
*ins
, int code
, int sizeflag
)
12841 *ins
->obufp
++ = ins
->open_char
;
12842 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
12843 if (ins
->address_mode
== mode_64bit
)
12845 if (!(sizeflag
& AFLAG
))
12846 s
= att_names32
[code
- eAX_reg
];
12848 s
= att_names64
[code
- eAX_reg
];
12850 else if (sizeflag
& AFLAG
)
12851 s
= att_names32
[code
- eAX_reg
];
12853 s
= att_names16
[code
- eAX_reg
];
12854 oappend_register (ins
, s
);
12855 oappend_char (ins
, ins
->close_char
);
12859 OP_ESreg (instr_info
*ins
, int code
, int sizeflag
)
12861 if (ins
->intel_syntax
)
12863 switch (ins
->codep
[-1])
12865 case 0x6d: /* insw/insl */
12866 intel_operand_size (ins
, z_mode
, sizeflag
);
12868 case 0xa5: /* movsw/movsl/movsq */
12869 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12870 case 0xab: /* stosw/stosl */
12871 case 0xaf: /* scasw/scasl */
12872 intel_operand_size (ins
, v_mode
, sizeflag
);
12875 intel_operand_size (ins
, b_mode
, sizeflag
);
12878 oappend_register (ins
, att_names_seg
[0]);
12879 oappend_char (ins
, ':');
12880 ptr_reg (ins
, code
, sizeflag
);
12885 OP_DSreg (instr_info
*ins
, int code
, int sizeflag
)
12887 if (ins
->intel_syntax
)
12889 switch (ins
->codep
[-1])
12891 case 0x6f: /* outsw/outsl */
12892 intel_operand_size (ins
, z_mode
, sizeflag
);
12894 case 0xa5: /* movsw/movsl/movsq */
12895 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12896 case 0xad: /* lodsw/lodsl/lodsq */
12897 intel_operand_size (ins
, v_mode
, sizeflag
);
12900 intel_operand_size (ins
, b_mode
, sizeflag
);
12903 /* Set ins->active_seg_prefix to PREFIX_DS if it is unset so that the
12904 default segment register DS is printed. */
12905 if (!ins
->active_seg_prefix
)
12906 ins
->active_seg_prefix
= PREFIX_DS
;
12908 ptr_reg (ins
, code
, sizeflag
);
12913 OP_C (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12914 int sizeflag ATTRIBUTE_UNUSED
)
12919 if (ins
->rex
& REX_R
)
12924 else if (ins
->address_mode
!= mode_64bit
&& (ins
->prefixes
& PREFIX_LOCK
))
12926 ins
->all_prefixes
[ins
->last_lock_prefix
] = 0;
12927 ins
->used_prefixes
|= PREFIX_LOCK
;
12932 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%cr%d",
12933 ins
->modrm
.reg
+ add
);
12934 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12936 oappend_register (ins
, scratch
);
12941 OP_D (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12942 int sizeflag ATTRIBUTE_UNUSED
)
12948 if (ins
->rex
& REX_R
)
12952 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12953 ins
->intel_syntax
? "dr%d" : "%%db%d",
12954 ins
->modrm
.reg
+ add
);
12955 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12957 oappend (ins
, scratch
);
12962 OP_T (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12963 int sizeflag ATTRIBUTE_UNUSED
)
12968 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%tr%d", ins
->modrm
.reg
);
12969 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12971 oappend_register (ins
, scratch
);
12976 OP_MMX (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12977 int sizeflag ATTRIBUTE_UNUSED
)
12979 int reg
= ins
->modrm
.reg
;
12980 const char (*names
)[8];
12982 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12983 if (ins
->prefixes
& PREFIX_DATA
)
12985 names
= att_names_xmm
;
12987 if (ins
->rex
& REX_R
)
12991 names
= att_names_mm
;
12992 oappend_register (ins
, names
[reg
]);
12997 print_vector_reg (instr_info
*ins
, unsigned int reg
, int bytemode
)
12999 const char (*names
)[8];
13001 if (bytemode
== xmmq_mode
13002 || bytemode
== evex_half_bcst_xmmqh_mode
13003 || bytemode
== evex_half_bcst_xmmq_mode
)
13005 switch (ins
->vex
.length
)
13009 names
= att_names_xmm
;
13012 names
= att_names_ymm
;
13013 ins
->evex_used
|= EVEX_len_used
;
13019 else if (bytemode
== ymm_mode
)
13020 names
= att_names_ymm
;
13021 else if (bytemode
== tmm_mode
)
13025 oappend (ins
, "(bad)");
13028 names
= att_names_tmm
;
13030 else if (ins
->need_vex
13031 && bytemode
!= xmm_mode
13032 && bytemode
!= scalar_mode
13033 && bytemode
!= xmmdw_mode
13034 && bytemode
!= xmmqd_mode
13035 && bytemode
!= evex_half_bcst_xmmqdh_mode
13036 && bytemode
!= w_swap_mode
13037 && bytemode
!= b_mode
13038 && bytemode
!= w_mode
13039 && bytemode
!= d_mode
13040 && bytemode
!= q_mode
)
13042 ins
->evex_used
|= EVEX_len_used
;
13043 switch (ins
->vex
.length
)
13046 names
= att_names_xmm
;
13050 || bytemode
!= vex_vsib_q_w_dq_mode
)
13051 names
= att_names_ymm
;
13053 names
= att_names_xmm
;
13057 || bytemode
!= vex_vsib_q_w_dq_mode
)
13058 names
= att_names_zmm
;
13060 names
= att_names_ymm
;
13067 names
= att_names_xmm
;
13068 oappend_register (ins
, names
[reg
]);
13072 OP_XMM (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13074 unsigned int reg
= ins
->modrm
.reg
;
13077 if (ins
->rex
& REX_R
)
13085 if (bytemode
== tmm_mode
)
13086 ins
->modrm
.reg
= reg
;
13087 else if (bytemode
== scalar_mode
)
13088 ins
->vex
.no_broadcast
= true;
13090 print_vector_reg (ins
, reg
, bytemode
);
13095 OP_EM (instr_info
*ins
, int bytemode
, int sizeflag
)
13098 const char (*names
)[8];
13100 if (ins
->modrm
.mod
!= 3)
13102 if (ins
->intel_syntax
13103 && (bytemode
== v_mode
|| bytemode
== v_swap_mode
))
13105 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
13106 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13108 return OP_E (ins
, bytemode
, sizeflag
);
13111 if ((sizeflag
& SUFFIX_ALWAYS
) && bytemode
== v_swap_mode
)
13112 swap_operand (ins
);
13114 /* Skip mod/rm byte. */
13117 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13118 reg
= ins
->modrm
.rm
;
13119 if (ins
->prefixes
& PREFIX_DATA
)
13121 names
= att_names_xmm
;
13123 if (ins
->rex
& REX_B
)
13127 names
= att_names_mm
;
13128 oappend_register (ins
, names
[reg
]);
13132 /* cvt* are the only instructions in sse2 which have
13133 both SSE and MMX operands and also have 0x66 prefix
13134 in their opcode. 0x66 was originally used to differentiate
13135 between SSE and MMX instruction(operands). So we have to handle the
13136 cvt* separately using OP_EMC and OP_MXC */
13138 OP_EMC (instr_info
*ins
, int bytemode
, int sizeflag
)
13140 if (ins
->modrm
.mod
!= 3)
13142 if (ins
->intel_syntax
&& bytemode
== v_mode
)
13144 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
13145 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13147 return OP_E (ins
, bytemode
, sizeflag
);
13150 /* Skip mod/rm byte. */
13153 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13154 oappend_register (ins
, att_names_mm
[ins
->modrm
.rm
]);
13159 OP_MXC (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13160 int sizeflag ATTRIBUTE_UNUSED
)
13162 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13163 oappend_register (ins
, att_names_mm
[ins
->modrm
.reg
]);
13168 OP_EX (instr_info
*ins
, int bytemode
, int sizeflag
)
13172 /* Skip mod/rm byte. */
13176 if (bytemode
== dq_mode
)
13177 bytemode
= ins
->vex
.w
? q_mode
: d_mode
;
13179 if (ins
->modrm
.mod
!= 3)
13180 return OP_E_memory (ins
, bytemode
, sizeflag
);
13182 reg
= ins
->modrm
.rm
;
13184 if (ins
->rex
& REX_B
)
13189 if ((ins
->rex
& REX_X
))
13193 if ((sizeflag
& SUFFIX_ALWAYS
)
13194 && (bytemode
== x_swap_mode
13195 || bytemode
== w_swap_mode
13196 || bytemode
== d_swap_mode
13197 || bytemode
== q_swap_mode
))
13198 swap_operand (ins
);
13200 if (bytemode
== tmm_mode
)
13201 ins
->modrm
.rm
= reg
;
13203 print_vector_reg (ins
, reg
, bytemode
);
13208 OP_MS (instr_info
*ins
, int bytemode
, int sizeflag
)
13210 if (ins
->modrm
.mod
== 3)
13211 return OP_EM (ins
, bytemode
, sizeflag
);
13212 return BadOp (ins
);
13216 OP_XS (instr_info
*ins
, int bytemode
, int sizeflag
)
13218 if (ins
->modrm
.mod
== 3)
13219 return OP_EX (ins
, bytemode
, sizeflag
);
13220 return BadOp (ins
);
13224 OP_M (instr_info
*ins
, int bytemode
, int sizeflag
)
13226 if (ins
->modrm
.mod
== 3)
13227 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
13228 return BadOp (ins
);
13229 return OP_E (ins
, bytemode
, sizeflag
);
13233 OP_0f07 (instr_info
*ins
, int bytemode
, int sizeflag
)
13235 if (ins
->modrm
.mod
!= 3 || ins
->modrm
.rm
!= 0)
13236 return BadOp (ins
);
13237 return OP_E (ins
, bytemode
, sizeflag
);
13240 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
13241 32bit mode and "xchg %rax,%rax" in 64bit mode. */
13244 NOP_Fixup (instr_info
*ins
, int opnd
, int sizeflag
)
13246 if ((ins
->prefixes
& PREFIX_DATA
) == 0 && (ins
->rex
& REX_B
) == 0)
13248 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop");
13252 return OP_REG (ins
, eAX_reg
, sizeflag
);
13253 return OP_IMREG (ins
, eAX_reg
, sizeflag
);
13256 static const char *const Suffix3DNow
[] = {
13257 /* 00 */ NULL
, NULL
, NULL
, NULL
,
13258 /* 04 */ NULL
, NULL
, NULL
, NULL
,
13259 /* 08 */ NULL
, NULL
, NULL
, NULL
,
13260 /* 0C */ "pi2fw", "pi2fd", NULL
, NULL
,
13261 /* 10 */ NULL
, NULL
, NULL
, NULL
,
13262 /* 14 */ NULL
, NULL
, NULL
, NULL
,
13263 /* 18 */ NULL
, NULL
, NULL
, NULL
,
13264 /* 1C */ "pf2iw", "pf2id", NULL
, NULL
,
13265 /* 20 */ NULL
, NULL
, NULL
, NULL
,
13266 /* 24 */ NULL
, NULL
, NULL
, NULL
,
13267 /* 28 */ NULL
, NULL
, NULL
, NULL
,
13268 /* 2C */ NULL
, NULL
, NULL
, NULL
,
13269 /* 30 */ NULL
, NULL
, NULL
, NULL
,
13270 /* 34 */ NULL
, NULL
, NULL
, NULL
,
13271 /* 38 */ NULL
, NULL
, NULL
, NULL
,
13272 /* 3C */ NULL
, NULL
, NULL
, NULL
,
13273 /* 40 */ NULL
, NULL
, NULL
, NULL
,
13274 /* 44 */ NULL
, NULL
, NULL
, NULL
,
13275 /* 48 */ NULL
, NULL
, NULL
, NULL
,
13276 /* 4C */ NULL
, NULL
, NULL
, NULL
,
13277 /* 50 */ NULL
, NULL
, NULL
, NULL
,
13278 /* 54 */ NULL
, NULL
, NULL
, NULL
,
13279 /* 58 */ NULL
, NULL
, NULL
, NULL
,
13280 /* 5C */ NULL
, NULL
, NULL
, NULL
,
13281 /* 60 */ NULL
, NULL
, NULL
, NULL
,
13282 /* 64 */ NULL
, NULL
, NULL
, NULL
,
13283 /* 68 */ NULL
, NULL
, NULL
, NULL
,
13284 /* 6C */ NULL
, NULL
, NULL
, NULL
,
13285 /* 70 */ NULL
, NULL
, NULL
, NULL
,
13286 /* 74 */ NULL
, NULL
, NULL
, NULL
,
13287 /* 78 */ NULL
, NULL
, NULL
, NULL
,
13288 /* 7C */ NULL
, NULL
, NULL
, NULL
,
13289 /* 80 */ NULL
, NULL
, NULL
, NULL
,
13290 /* 84 */ NULL
, NULL
, NULL
, NULL
,
13291 /* 88 */ NULL
, NULL
, "pfnacc", NULL
,
13292 /* 8C */ NULL
, NULL
, "pfpnacc", NULL
,
13293 /* 90 */ "pfcmpge", NULL
, NULL
, NULL
,
13294 /* 94 */ "pfmin", NULL
, "pfrcp", "pfrsqrt",
13295 /* 98 */ NULL
, NULL
, "pfsub", NULL
,
13296 /* 9C */ NULL
, NULL
, "pfadd", NULL
,
13297 /* A0 */ "pfcmpgt", NULL
, NULL
, NULL
,
13298 /* A4 */ "pfmax", NULL
, "pfrcpit1", "pfrsqit1",
13299 /* A8 */ NULL
, NULL
, "pfsubr", NULL
,
13300 /* AC */ NULL
, NULL
, "pfacc", NULL
,
13301 /* B0 */ "pfcmpeq", NULL
, NULL
, NULL
,
13302 /* B4 */ "pfmul", NULL
, "pfrcpit2", "pmulhrw",
13303 /* B8 */ NULL
, NULL
, NULL
, "pswapd",
13304 /* BC */ NULL
, NULL
, NULL
, "pavgusb",
13305 /* C0 */ NULL
, NULL
, NULL
, NULL
,
13306 /* C4 */ NULL
, NULL
, NULL
, NULL
,
13307 /* C8 */ NULL
, NULL
, NULL
, NULL
,
13308 /* CC */ NULL
, NULL
, NULL
, NULL
,
13309 /* D0 */ NULL
, NULL
, NULL
, NULL
,
13310 /* D4 */ NULL
, NULL
, NULL
, NULL
,
13311 /* D8 */ NULL
, NULL
, NULL
, NULL
,
13312 /* DC */ NULL
, NULL
, NULL
, NULL
,
13313 /* E0 */ NULL
, NULL
, NULL
, NULL
,
13314 /* E4 */ NULL
, NULL
, NULL
, NULL
,
13315 /* E8 */ NULL
, NULL
, NULL
, NULL
,
13316 /* EC */ NULL
, NULL
, NULL
, NULL
,
13317 /* F0 */ NULL
, NULL
, NULL
, NULL
,
13318 /* F4 */ NULL
, NULL
, NULL
, NULL
,
13319 /* F8 */ NULL
, NULL
, NULL
, NULL
,
13320 /* FC */ NULL
, NULL
, NULL
, NULL
,
13324 OP_3DNowSuffix (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13325 int sizeflag ATTRIBUTE_UNUSED
)
13327 const char *mnemonic
;
13329 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13331 /* AMD 3DNow! instructions are specified by an opcode suffix in the
13332 place where an 8-bit immediate would normally go. ie. the last
13333 byte of the instruction. */
13334 ins
->obufp
= ins
->mnemonicendp
;
13335 mnemonic
= Suffix3DNow
[*ins
->codep
++ & 0xff];
13337 ins
->obufp
= stpcpy (ins
->obufp
, mnemonic
);
13340 /* Since a variable sized ins->modrm/ins->sib chunk is between the start
13341 of the opcode (0x0f0f) and the opcode suffix, we need to do
13342 all the ins->modrm processing first, and don't know until now that
13343 we have a bad opcode. This necessitates some cleaning up. */
13344 ins
->op_out
[0][0] = '\0';
13345 ins
->op_out
[1][0] = '\0';
13348 ins
->mnemonicendp
= ins
->obufp
;
13352 static const struct op simd_cmp_op
[] =
13354 { STRING_COMMA_LEN ("eq") },
13355 { STRING_COMMA_LEN ("lt") },
13356 { STRING_COMMA_LEN ("le") },
13357 { STRING_COMMA_LEN ("unord") },
13358 { STRING_COMMA_LEN ("neq") },
13359 { STRING_COMMA_LEN ("nlt") },
13360 { STRING_COMMA_LEN ("nle") },
13361 { STRING_COMMA_LEN ("ord") }
13364 static const struct op vex_cmp_op
[] =
13366 { STRING_COMMA_LEN ("eq_uq") },
13367 { STRING_COMMA_LEN ("nge") },
13368 { STRING_COMMA_LEN ("ngt") },
13369 { STRING_COMMA_LEN ("false") },
13370 { STRING_COMMA_LEN ("neq_oq") },
13371 { STRING_COMMA_LEN ("ge") },
13372 { STRING_COMMA_LEN ("gt") },
13373 { STRING_COMMA_LEN ("true") },
13374 { STRING_COMMA_LEN ("eq_os") },
13375 { STRING_COMMA_LEN ("lt_oq") },
13376 { STRING_COMMA_LEN ("le_oq") },
13377 { STRING_COMMA_LEN ("unord_s") },
13378 { STRING_COMMA_LEN ("neq_us") },
13379 { STRING_COMMA_LEN ("nlt_uq") },
13380 { STRING_COMMA_LEN ("nle_uq") },
13381 { STRING_COMMA_LEN ("ord_s") },
13382 { STRING_COMMA_LEN ("eq_us") },
13383 { STRING_COMMA_LEN ("nge_uq") },
13384 { STRING_COMMA_LEN ("ngt_uq") },
13385 { STRING_COMMA_LEN ("false_os") },
13386 { STRING_COMMA_LEN ("neq_os") },
13387 { STRING_COMMA_LEN ("ge_oq") },
13388 { STRING_COMMA_LEN ("gt_oq") },
13389 { STRING_COMMA_LEN ("true_us") },
13393 CMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13394 int sizeflag ATTRIBUTE_UNUSED
)
13396 unsigned int cmp_type
;
13398 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13400 cmp_type
= *ins
->codep
++ & 0xff;
13401 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
))
13404 char *p
= ins
->mnemonicendp
- 2;
13408 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13409 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13411 else if (ins
->need_vex
13412 && cmp_type
< ARRAY_SIZE (simd_cmp_op
) + ARRAY_SIZE (vex_cmp_op
))
13415 char *p
= ins
->mnemonicendp
- 2;
13419 cmp_type
-= ARRAY_SIZE (simd_cmp_op
);
13420 sprintf (p
, "%s%s", vex_cmp_op
[cmp_type
].name
, suffix
);
13421 ins
->mnemonicendp
+= vex_cmp_op
[cmp_type
].len
;
13425 /* We have a reserved extension byte. Output it directly. */
13426 oappend_immediate (ins
, cmp_type
);
13432 OP_Mwait (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13434 /* mwait %eax,%ecx / mwaitx %eax,%ecx,%ebx */
13435 if (!ins
->intel_syntax
)
13437 strcpy (ins
->op_out
[0], att_names32
[0] + ins
->intel_syntax
);
13438 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13439 if (bytemode
== eBX_reg
)
13440 strcpy (ins
->op_out
[2], att_names32
[3] + ins
->intel_syntax
);
13441 ins
->two_source_ops
= true;
13443 /* Skip mod/rm byte. */
13450 OP_Monitor (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13451 int sizeflag ATTRIBUTE_UNUSED
)
13453 /* monitor %{e,r,}ax,%ecx,%edx" */
13454 if (!ins
->intel_syntax
)
13456 const char (*names
)[8] = (ins
->address_mode
== mode_64bit
13457 ? att_names64
: att_names32
);
13459 if (ins
->prefixes
& PREFIX_ADDR
)
13461 /* Remove "addr16/addr32". */
13462 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
13463 names
= (ins
->address_mode
!= mode_32bit
13464 ? att_names32
: att_names16
);
13465 ins
->used_prefixes
|= PREFIX_ADDR
;
13467 else if (ins
->address_mode
== mode_16bit
)
13468 names
= att_names16
;
13469 strcpy (ins
->op_out
[0], names
[0] + ins
->intel_syntax
);
13470 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13471 strcpy (ins
->op_out
[2], att_names32
[2] + ins
->intel_syntax
);
13472 ins
->two_source_ops
= true;
13474 /* Skip mod/rm byte. */
13481 BadOp (instr_info
*ins
)
13483 /* Throw away prefixes and 1st. opcode byte. */
13484 ins
->codep
= ins
->insn_codep
+ 1;
13485 ins
->obufp
= stpcpy (ins
->obufp
, "(bad)");
13490 REP_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13492 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
13494 if (ins
->prefixes
& PREFIX_REPZ
)
13495 ins
->all_prefixes
[ins
->last_repz_prefix
] = REP_PREFIX
;
13502 return OP_IMREG (ins
, bytemode
, sizeflag
);
13504 return OP_ESreg (ins
, bytemode
, sizeflag
);
13506 return OP_DSreg (ins
, bytemode
, sizeflag
);
13515 SEP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13516 int sizeflag ATTRIBUTE_UNUSED
)
13518 if (ins
->isa64
!= amd64
)
13521 ins
->obufp
= ins
->obuf
;
13523 ins
->mnemonicendp
= ins
->obufp
;
13528 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
13532 BND_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13533 int sizeflag ATTRIBUTE_UNUSED
)
13535 if (ins
->prefixes
& PREFIX_REPNZ
)
13536 ins
->all_prefixes
[ins
->last_repnz_prefix
] = BND_PREFIX
;
13540 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
13544 NOTRACK_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13545 int sizeflag ATTRIBUTE_UNUSED
)
13547 /* Since active_seg_prefix is not set in 64-bit mode, check whether
13548 we've seen a PREFIX_DS. */
13549 if ((ins
->prefixes
& PREFIX_DS
) != 0
13550 && (ins
->address_mode
!= mode_64bit
|| ins
->last_data_prefix
< 0))
13552 /* NOTRACK prefix is only valid on indirect branch instructions.
13553 NB: DATA prefix is unsupported for Intel64. */
13554 ins
->active_seg_prefix
= 0;
13555 ins
->all_prefixes
[ins
->last_seg_prefix
] = NOTRACK_PREFIX
;
13560 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13561 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
13565 HLE_Fixup1 (instr_info
*ins
, int bytemode
, int sizeflag
)
13567 if (ins
->modrm
.mod
!= 3
13568 && (ins
->prefixes
& PREFIX_LOCK
) != 0)
13570 if (ins
->prefixes
& PREFIX_REPZ
)
13571 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13572 if (ins
->prefixes
& PREFIX_REPNZ
)
13573 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13576 return OP_E (ins
, bytemode
, sizeflag
);
13579 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13580 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
13584 HLE_Fixup2 (instr_info
*ins
, int bytemode
, int sizeflag
)
13586 if (ins
->modrm
.mod
!= 3)
13588 if (ins
->prefixes
& PREFIX_REPZ
)
13589 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13590 if (ins
->prefixes
& PREFIX_REPNZ
)
13591 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13594 return OP_E (ins
, bytemode
, sizeflag
);
13597 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
13598 "xrelease" for memory operand. No check for LOCK prefix. */
13601 HLE_Fixup3 (instr_info
*ins
, int bytemode
, int sizeflag
)
13603 if (ins
->modrm
.mod
!= 3
13604 && ins
->last_repz_prefix
> ins
->last_repnz_prefix
13605 && (ins
->prefixes
& PREFIX_REPZ
) != 0)
13606 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13608 return OP_E (ins
, bytemode
, sizeflag
);
13612 CMPXCHG8B_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13615 if (ins
->rex
& REX_W
)
13617 /* Change cmpxchg8b to cmpxchg16b. */
13618 char *p
= ins
->mnemonicendp
- 2;
13619 ins
->mnemonicendp
= stpcpy (p
, "16b");
13622 else if ((ins
->prefixes
& PREFIX_LOCK
) != 0)
13624 if (ins
->prefixes
& PREFIX_REPZ
)
13625 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13626 if (ins
->prefixes
& PREFIX_REPNZ
)
13627 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13630 return OP_M (ins
, bytemode
, sizeflag
);
13634 XMM_Fixup (instr_info
*ins
, int reg
, int sizeflag ATTRIBUTE_UNUSED
)
13636 const char (*names
)[8] = att_names_xmm
;
13640 switch (ins
->vex
.length
)
13645 names
= att_names_ymm
;
13651 oappend_register (ins
, names
[reg
]);
13656 FXSAVE_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13658 /* Add proper suffix to "fxsave" and "fxrstor". */
13660 if (ins
->rex
& REX_W
)
13662 char *p
= ins
->mnemonicendp
;
13666 ins
->mnemonicendp
= p
;
13668 return OP_M (ins
, bytemode
, sizeflag
);
13671 /* Display the destination register operand for instructions with
13675 OP_VEX (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13677 int reg
, modrm_reg
, sib_index
= -1;
13678 const char (*names
)[8];
13680 if (!ins
->need_vex
)
13683 reg
= ins
->vex
.register_specifier
;
13684 ins
->vex
.register_specifier
= 0;
13685 if (ins
->address_mode
!= mode_64bit
)
13687 if (ins
->vex
.evex
&& !ins
->vex
.v
)
13689 oappend (ins
, "(bad)");
13695 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13701 oappend_register (ins
, att_names_xmm
[reg
]);
13704 case vex_vsib_d_w_dq_mode
:
13705 case vex_vsib_q_w_dq_mode
:
13706 /* This must be the 3rd operand. */
13707 if (ins
->obufp
!= ins
->op_out
[2])
13709 if (ins
->vex
.length
== 128
13710 || (bytemode
!= vex_vsib_d_w_dq_mode
13712 oappend_register (ins
, att_names_xmm
[reg
]);
13714 oappend_register (ins
, att_names_ymm
[reg
]);
13716 /* All 3 XMM/YMM registers must be distinct. */
13717 modrm_reg
= ins
->modrm
.reg
;
13718 if (ins
->rex
& REX_R
)
13721 if (ins
->has_sib
&& ins
->modrm
.rm
== 4)
13723 sib_index
= ins
->sib
.index
;
13724 if (ins
->rex
& REX_X
)
13728 if (reg
== modrm_reg
|| reg
== sib_index
)
13729 strcpy (ins
->obufp
, "/(bad)");
13730 if (modrm_reg
== sib_index
|| modrm_reg
== reg
)
13731 strcat (ins
->op_out
[0], "/(bad)");
13732 if (sib_index
== modrm_reg
|| sib_index
== reg
)
13733 strcat (ins
->op_out
[1], "/(bad)");
13738 /* All 3 TMM registers must be distinct. */
13740 oappend (ins
, "(bad)");
13743 /* This must be the 3rd operand. */
13744 if (ins
->obufp
!= ins
->op_out
[2])
13746 oappend_register (ins
, att_names_tmm
[reg
]);
13747 if (reg
== ins
->modrm
.reg
|| reg
== ins
->modrm
.rm
)
13748 strcpy (ins
->obufp
, "/(bad)");
13751 if (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
13752 || ins
->modrm
.rm
== reg
)
13754 if (ins
->modrm
.reg
<= 8
13755 && (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
))
13756 strcat (ins
->op_out
[0], "/(bad)");
13757 if (ins
->modrm
.rm
<= 8
13758 && (ins
->modrm
.rm
== ins
->modrm
.reg
|| ins
->modrm
.rm
== reg
))
13759 strcat (ins
->op_out
[1], "/(bad)");
13765 switch (ins
->vex
.length
)
13771 names
= att_names_xmm
;
13772 ins
->evex_used
|= EVEX_len_used
;
13775 if (ins
->rex
& REX_W
)
13776 names
= att_names64
;
13778 names
= att_names32
;
13784 oappend (ins
, "(bad)");
13787 names
= att_names_mask
;
13798 names
= att_names_ymm
;
13799 ins
->evex_used
|= EVEX_len_used
;
13805 names
= att_names_mask
;
13808 /* Fall through. */
13810 /* See PR binutils/20893 for a reproducer. */
13811 oappend (ins
, "(bad)");
13816 names
= att_names_zmm
;
13817 ins
->evex_used
|= EVEX_len_used
;
13823 oappend_register (ins
, names
[reg
]);
13828 OP_VexR (instr_info
*ins
, int bytemode
, int sizeflag
)
13830 if (ins
->modrm
.mod
== 3)
13831 return OP_VEX (ins
, bytemode
, sizeflag
);
13836 OP_VexW (instr_info
*ins
, int bytemode
, int sizeflag
)
13838 OP_VEX (ins
, bytemode
, sizeflag
);
13842 /* Swap 2nd and 3rd operands. */
13843 char *tmp
= ins
->op_out
[2];
13845 ins
->op_out
[2] = ins
->op_out
[1];
13846 ins
->op_out
[1] = tmp
;
13852 OP_REG_VexI4 (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13855 const char (*names
)[8] = att_names_xmm
;
13857 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13859 reg
= *ins
->codep
++;
13861 if (bytemode
!= x_mode
&& bytemode
!= scalar_mode
)
13865 if (ins
->address_mode
!= mode_64bit
)
13868 if (bytemode
== x_mode
&& ins
->vex
.length
== 256)
13869 names
= att_names_ymm
;
13871 oappend_register (ins
, names
[reg
]);
13875 /* Swap 3rd and 4th operands. */
13876 char *tmp
= ins
->op_out
[3];
13878 ins
->op_out
[3] = ins
->op_out
[2];
13879 ins
->op_out
[2] = tmp
;
13885 OP_VexI4 (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13886 int sizeflag ATTRIBUTE_UNUSED
)
13888 oappend_immediate (ins
, ins
->codep
[-1] & 0xf);
13893 VPCMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13894 int sizeflag ATTRIBUTE_UNUSED
)
13896 unsigned int cmp_type
;
13898 if (!ins
->vex
.evex
)
13901 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13903 cmp_type
= *ins
->codep
++ & 0xff;
13904 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
13905 If it's the case, print suffix, otherwise - print the immediate. */
13906 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
)
13911 char *p
= ins
->mnemonicendp
- 2;
13913 /* vpcmp* can have both one- and two-lettered suffix. */
13927 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13928 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13932 /* We have a reserved extension byte. Output it directly. */
13933 oappend_immediate (ins
, cmp_type
);
13938 static const struct op xop_cmp_op
[] =
13940 { STRING_COMMA_LEN ("lt") },
13941 { STRING_COMMA_LEN ("le") },
13942 { STRING_COMMA_LEN ("gt") },
13943 { STRING_COMMA_LEN ("ge") },
13944 { STRING_COMMA_LEN ("eq") },
13945 { STRING_COMMA_LEN ("neq") },
13946 { STRING_COMMA_LEN ("false") },
13947 { STRING_COMMA_LEN ("true") }
13951 VPCOM_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13952 int sizeflag ATTRIBUTE_UNUSED
)
13954 unsigned int cmp_type
;
13956 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13958 cmp_type
= *ins
->codep
++ & 0xff;
13959 if (cmp_type
< ARRAY_SIZE (xop_cmp_op
))
13962 char *p
= ins
->mnemonicendp
- 2;
13964 /* vpcom* can have both one- and two-lettered suffix. */
13978 sprintf (p
, "%s%s", xop_cmp_op
[cmp_type
].name
, suffix
);
13979 ins
->mnemonicendp
+= xop_cmp_op
[cmp_type
].len
;
13983 /* We have a reserved extension byte. Output it directly. */
13984 oappend_immediate (ins
, cmp_type
);
13989 static const struct op pclmul_op
[] =
13991 { STRING_COMMA_LEN ("lql") },
13992 { STRING_COMMA_LEN ("hql") },
13993 { STRING_COMMA_LEN ("lqh") },
13994 { STRING_COMMA_LEN ("hqh") }
13998 PCLMUL_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13999 int sizeflag ATTRIBUTE_UNUSED
)
14001 unsigned int pclmul_type
;
14003 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
14005 pclmul_type
= *ins
->codep
++ & 0xff;
14006 switch (pclmul_type
)
14017 if (pclmul_type
< ARRAY_SIZE (pclmul_op
))
14020 char *p
= ins
->mnemonicendp
- 3;
14025 sprintf (p
, "%s%s", pclmul_op
[pclmul_type
].name
, suffix
);
14026 ins
->mnemonicendp
+= pclmul_op
[pclmul_type
].len
;
14030 /* We have a reserved extension byte. Output it directly. */
14031 oappend_immediate (ins
, pclmul_type
);
14037 MOVSXD_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
14039 /* Add proper suffix to "movsxd". */
14040 char *p
= ins
->mnemonicendp
;
14045 if (!ins
->intel_syntax
)
14048 if (ins
->rex
& REX_W
)
14060 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
14064 ins
->mnemonicendp
= p
;
14066 return OP_E (ins
, bytemode
, sizeflag
);
14070 DistinctDest_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
14072 unsigned int reg
= ins
->vex
.register_specifier
;
14073 unsigned int modrm_reg
= ins
->modrm
.reg
;
14074 unsigned int modrm_rm
= ins
->modrm
.rm
;
14076 /* Calc destination register number. */
14077 if (ins
->rex
& REX_R
)
14082 /* Calc src1 register number. */
14083 if (ins
->address_mode
!= mode_64bit
)
14085 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
14088 /* Calc src2 register number. */
14089 if (ins
->modrm
.mod
== 3)
14091 if (ins
->rex
& REX_B
)
14093 if (ins
->rex
& REX_X
)
14097 /* Destination and source registers must be distinct, output bad if
14098 dest == src1 or dest == src2. */
14099 if (modrm_reg
== reg
14100 || (ins
->modrm
.mod
== 3
14101 && modrm_reg
== modrm_rm
))
14103 oappend (ins
, "(bad)");
14106 return OP_XMM (ins
, bytemode
, sizeflag
);
14110 OP_Rounding (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
14112 if (ins
->modrm
.mod
!= 3 || !ins
->vex
.b
)
14117 case evex_rounding_64_mode
:
14118 if (ins
->address_mode
!= mode_64bit
|| !ins
->vex
.w
)
14120 /* Fall through. */
14121 case evex_rounding_mode
:
14122 ins
->evex_used
|= EVEX_b_used
;
14123 oappend (ins
, names_rounding
[ins
->vex
.ll
]);
14125 case evex_sae_mode
:
14126 ins
->evex_used
|= EVEX_b_used
;
14127 oappend (ins
, "{");
14132 oappend (ins
, "sae}");
14137 PREFETCHI_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
14139 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 5)
14141 if (ins
->intel_syntax
)
14143 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop ");
14148 if (ins
->rex
& REX_W
)
14149 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopq ");
14152 if (sizeflag
& DFLAG
)
14153 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopl ");
14155 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopw ");
14156 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
14162 return OP_M (ins
, bytemode
, sizeflag
);