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
);
49 static bool OP_E (instr_info
*, int, int);
50 static bool OP_E_memory (instr_info
*, int, int);
51 static bool OP_indirE (instr_info
*, int, int);
52 static bool OP_G (instr_info
*, int, int);
53 static bool OP_ST (instr_info
*, int, int);
54 static bool OP_STi (instr_info
*, int, int);
55 static bool OP_Skip_MODRM (instr_info
*, int, int);
56 static bool OP_REG (instr_info
*, int, int);
57 static bool OP_IMREG (instr_info
*, int, int);
58 static bool OP_I (instr_info
*, int, int);
59 static bool OP_I64 (instr_info
*, int, int);
60 static bool OP_sI (instr_info
*, int, int);
61 static bool OP_J (instr_info
*, int, int);
62 static bool OP_SEG (instr_info
*, int, int);
63 static bool OP_DIR (instr_info
*, int, int);
64 static bool OP_OFF (instr_info
*, int, int);
65 static bool OP_OFF64 (instr_info
*, int, int);
66 static bool OP_ESreg (instr_info
*, int, int);
67 static bool OP_DSreg (instr_info
*, int, int);
68 static bool OP_C (instr_info
*, int, int);
69 static bool OP_D (instr_info
*, int, int);
70 static bool OP_T (instr_info
*, int, int);
71 static bool OP_MMX (instr_info
*, int, int);
72 static bool OP_XMM (instr_info
*, int, int);
73 static bool OP_EM (instr_info
*, int, int);
74 static bool OP_EX (instr_info
*, int, int);
75 static bool OP_EMC (instr_info
*, int,int);
76 static bool OP_MXC (instr_info
*, int,int);
77 static bool OP_MS (instr_info
*, int, int);
78 static bool OP_XS (instr_info
*, int, int);
79 static bool OP_M (instr_info
*, int, int);
80 static bool OP_VEX (instr_info
*, int, int);
81 static bool OP_VexR (instr_info
*, int, int);
82 static bool OP_VexW (instr_info
*, int, int);
83 static bool OP_Rounding (instr_info
*, int, int);
84 static bool OP_REG_VexI4 (instr_info
*, int, int);
85 static bool OP_VexI4 (instr_info
*, int, int);
86 static bool OP_0f07 (instr_info
*, int, int);
87 static bool OP_Monitor (instr_info
*, int, int);
88 static bool OP_Mwait (instr_info
*, int, int);
90 static bool PCLMUL_Fixup (instr_info
*, int, int);
91 static bool VPCMP_Fixup (instr_info
*, int, int);
92 static bool VPCOM_Fixup (instr_info
*, int, int);
93 static bool NOP_Fixup (instr_info
*, int, int);
94 static bool OP_3DNowSuffix (instr_info
*, int, int);
95 static bool CMP_Fixup (instr_info
*, int, int);
96 static bool REP_Fixup (instr_info
*, int, int);
97 static bool SEP_Fixup (instr_info
*, int, int);
98 static bool BND_Fixup (instr_info
*, int, int);
99 static bool NOTRACK_Fixup (instr_info
*, int, int);
100 static bool HLE_Fixup1 (instr_info
*, int, int);
101 static bool HLE_Fixup2 (instr_info
*, int, int);
102 static bool HLE_Fixup3 (instr_info
*, int, int);
103 static bool CMPXCHG8B_Fixup (instr_info
*, int, int);
104 static bool XMM_Fixup (instr_info
*, int, int);
105 static bool FXSAVE_Fixup (instr_info
*, int, int);
106 static bool MOVSXD_Fixup (instr_info
*, int, int);
107 static bool DistinctDest_Fixup (instr_info
*, int, int);
108 static bool PREFETCHI_Fixup (instr_info
*, int, int);
110 static void ATTRIBUTE_PRINTF_3
i386_dis_printf (const disassemble_info
*,
111 enum disassembler_style
,
114 /* This character is used to encode style information within the output
115 buffers. See oappend_insert_style for more details. */
116 #define STYLE_MARKER_CHAR '\002'
118 /* The maximum operand buffer size. */
119 #define MAX_OPERAND_BUFFER_SIZE 128
128 static const char *prefix_name (enum address_mode
, uint8_t, int);
138 enum address_mode address_mode
;
140 /* Flags for the prefixes for the current instruction. See below. */
143 /* REX prefix the current instruction. See below. */
145 /* Bits of REX we've already used. */
152 /* Flags for ins->prefixes which we somehow handled when printing the
153 current instruction. */
156 /* Flags for EVEX bits which we somehow handled when printing the
157 current instruction. */
160 char obuf
[MAX_OPERAND_BUFFER_SIZE
];
163 const uint8_t *start_codep
;
165 const uint8_t *end_codep
;
166 unsigned char nr_prefixes
;
167 signed char last_lock_prefix
;
168 signed char last_repz_prefix
;
169 signed char last_repnz_prefix
;
170 signed char last_data_prefix
;
171 signed char last_addr_prefix
;
172 signed char last_rex_prefix
;
173 signed char last_seg_prefix
;
174 signed char fwait_prefix
;
175 /* The active segment register prefix. */
176 unsigned char active_seg_prefix
;
178 #define MAX_CODE_LENGTH 15
179 /* We can up to 14 ins->prefixes since the maximum instruction length is
181 uint8_t all_prefixes
[MAX_CODE_LENGTH
- 1];
182 disassemble_info
*info
;
202 int register_specifier
;
205 int mask_register_specifier
;
217 /* Remember if the current op is a jump instruction. */
222 /* Record whether EVEX masking is used incorrectly. */
223 bool illegal_masking
;
226 signed char op_index
[MAX_OPERANDS
];
227 bool op_riprel
[MAX_OPERANDS
];
228 char *op_out
[MAX_OPERANDS
];
229 bfd_vma op_address
[MAX_OPERANDS
];
232 /* On the 386's of 1988, the maximum length of an instruction is 15 bytes.
233 * (see topic "Redundant ins->prefixes" in the "Differences from 8086"
234 * section of the "Virtual 8086 Mode" chapter.)
235 * 'pc' should be the address of this instruction, it will
236 * be used to print the target address if this is a relative jump or call
237 * The function returns the length of this instruction in bytes.
246 enum x86_64_isa isa64
;
253 /* Indexes first byte not fetched. */
254 unsigned int fetched
;
255 uint8_t the_buffer
[2 * MAX_CODE_LENGTH
- 1];
258 /* Mark parts used in the REX prefix. When we are testing for
259 empty prefix (for 8bit register REX extension), just mask it
260 out. Otherwise test for REX bit is excuse for existence of REX
261 only in case value is nonzero. */
262 #define USED_REX(value) \
266 if ((ins->rex & value)) \
267 ins->rex_used |= (value) | REX_OPCODE; \
270 ins->rex_used |= REX_OPCODE; \
274 #define EVEX_b_used 1
275 #define EVEX_len_used 2
277 /* Flags stored in PREFIXES. */
278 #define PREFIX_REPZ 1
279 #define PREFIX_REPNZ 2
282 #define PREFIX_DS 0x10
283 #define PREFIX_ES 0x20
284 #define PREFIX_FS 0x40
285 #define PREFIX_GS 0x80
286 #define PREFIX_LOCK 0x100
287 #define PREFIX_DATA 0x200
288 #define PREFIX_ADDR 0x400
289 #define PREFIX_FWAIT 0x800
291 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
292 to ADDR (exclusive) are valid. Returns true for success, false
295 fetch_code (struct disassemble_info
*info
, const uint8_t *until
)
298 struct dis_private
*priv
= info
->private_data
;
299 bfd_vma start
= priv
->insn_start
+ priv
->fetched
;
300 uint8_t *fetch_end
= priv
->the_buffer
+ priv
->fetched
;
301 ptrdiff_t needed
= until
- fetch_end
;
306 if (priv
->fetched
+ (size_t) needed
<= ARRAY_SIZE (priv
->the_buffer
))
307 status
= (*info
->read_memory_func
) (start
, fetch_end
, needed
, info
);
310 /* If we did manage to read at least one byte, then
311 print_insn_i386 will do something sensible. Otherwise, print
312 an error. We do that here because this is where we know
315 (*info
->memory_error_func
) (status
, start
, info
);
319 priv
->fetched
+= needed
;
324 fetch_modrm (instr_info
*ins
)
326 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
329 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
330 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
331 ins
->modrm
.rm
= *ins
->codep
& 7;
337 fetch_error (const instr_info
*ins
)
339 /* Getting here means we tried for data but didn't get it. That
340 means we have an incomplete instruction of some sort. Just
341 print the first byte as a prefix or a .byte pseudo-op. */
342 const struct dis_private
*priv
= ins
->info
->private_data
;
343 const char *name
= NULL
;
345 if (ins
->codep
<= priv
->the_buffer
)
348 if (ins
->prefixes
|| ins
->fwait_prefix
>= 0 || (ins
->rex
& REX_OPCODE
))
349 name
= prefix_name (ins
->address_mode
, priv
->the_buffer
[0],
350 priv
->orig_sizeflag
);
352 i386_dis_printf (ins
->info
, dis_style_mnemonic
, "%s", name
);
355 /* Just print the first byte as a .byte instruction. */
356 i386_dis_printf (ins
->info
, dis_style_assembler_directive
, ".byte ");
357 i386_dis_printf (ins
->info
, dis_style_immediate
, "%#x",
358 (unsigned int) priv
->the_buffer
[0]);
364 /* Possible values for prefix requirement. */
365 #define PREFIX_IGNORED_SHIFT 16
366 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
367 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
368 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
369 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
370 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
372 /* Opcode prefixes. */
373 #define PREFIX_OPCODE (PREFIX_REPZ \
377 /* Prefixes ignored. */
378 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
379 | PREFIX_IGNORED_REPNZ \
380 | PREFIX_IGNORED_DATA)
382 #define XX { NULL, 0 }
383 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
385 #define Eb { OP_E, b_mode }
386 #define Ebnd { OP_E, bnd_mode }
387 #define EbS { OP_E, b_swap_mode }
388 #define EbndS { OP_E, bnd_swap_mode }
389 #define Ev { OP_E, v_mode }
390 #define Eva { OP_E, va_mode }
391 #define Ev_bnd { OP_E, v_bnd_mode }
392 #define EvS { OP_E, v_swap_mode }
393 #define Ed { OP_E, d_mode }
394 #define Edq { OP_E, dq_mode }
395 #define Edb { OP_E, db_mode }
396 #define Edw { OP_E, dw_mode }
397 #define Eq { OP_E, q_mode }
398 #define indirEv { OP_indirE, indir_v_mode }
399 #define indirEp { OP_indirE, f_mode }
400 #define stackEv { OP_E, stack_v_mode }
401 #define Em { OP_E, m_mode }
402 #define Ew { OP_E, w_mode }
403 #define M { OP_M, 0 } /* lea, lgdt, etc. */
404 #define Ma { OP_M, a_mode }
405 #define Mb { OP_M, b_mode }
406 #define Md { OP_M, d_mode }
407 #define Mdq { OP_M, dq_mode }
408 #define Mo { OP_M, o_mode }
409 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
410 #define Mq { OP_M, q_mode }
411 #define Mv { OP_M, v_mode }
412 #define Mv_bnd { OP_M, v_bndmk_mode }
413 #define Mw { OP_M, w_mode }
414 #define Mx { OP_M, x_mode }
415 #define Mxmm { OP_M, xmm_mode }
416 #define Gb { OP_G, b_mode }
417 #define Gbnd { OP_G, bnd_mode }
418 #define Gv { OP_G, v_mode }
419 #define Gd { OP_G, d_mode }
420 #define Gdq { OP_G, dq_mode }
421 #define Gm { OP_G, m_mode }
422 #define Gva { OP_G, va_mode }
423 #define Gw { OP_G, w_mode }
424 #define Ib { OP_I, b_mode }
425 #define sIb { OP_sI, b_mode } /* sign extened byte */
426 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
427 #define Iv { OP_I, v_mode }
428 #define sIv { OP_sI, v_mode }
429 #define Iv64 { OP_I64, v_mode }
430 #define Id { OP_I, d_mode }
431 #define Iw { OP_I, w_mode }
432 #define I1 { OP_I, const_1_mode }
433 #define Jb { OP_J, b_mode }
434 #define Jv { OP_J, v_mode }
435 #define Jdqw { OP_J, dqw_mode }
436 #define Cm { OP_C, m_mode }
437 #define Dm { OP_D, m_mode }
438 #define Td { OP_T, d_mode }
439 #define Skip_MODRM { OP_Skip_MODRM, 0 }
441 #define RMeAX { OP_REG, eAX_reg }
442 #define RMeBX { OP_REG, eBX_reg }
443 #define RMeCX { OP_REG, eCX_reg }
444 #define RMeDX { OP_REG, eDX_reg }
445 #define RMeSP { OP_REG, eSP_reg }
446 #define RMeBP { OP_REG, eBP_reg }
447 #define RMeSI { OP_REG, eSI_reg }
448 #define RMeDI { OP_REG, eDI_reg }
449 #define RMrAX { OP_REG, rAX_reg }
450 #define RMrBX { OP_REG, rBX_reg }
451 #define RMrCX { OP_REG, rCX_reg }
452 #define RMrDX { OP_REG, rDX_reg }
453 #define RMrSP { OP_REG, rSP_reg }
454 #define RMrBP { OP_REG, rBP_reg }
455 #define RMrSI { OP_REG, rSI_reg }
456 #define RMrDI { OP_REG, rDI_reg }
457 #define RMAL { OP_REG, al_reg }
458 #define RMCL { OP_REG, cl_reg }
459 #define RMDL { OP_REG, dl_reg }
460 #define RMBL { OP_REG, bl_reg }
461 #define RMAH { OP_REG, ah_reg }
462 #define RMCH { OP_REG, ch_reg }
463 #define RMDH { OP_REG, dh_reg }
464 #define RMBH { OP_REG, bh_reg }
465 #define RMAX { OP_REG, ax_reg }
466 #define RMDX { OP_REG, dx_reg }
468 #define eAX { OP_IMREG, eAX_reg }
469 #define AL { OP_IMREG, al_reg }
470 #define CL { OP_IMREG, cl_reg }
471 #define zAX { OP_IMREG, z_mode_ax_reg }
472 #define indirDX { OP_IMREG, indir_dx_reg }
474 #define Sw { OP_SEG, w_mode }
475 #define Sv { OP_SEG, v_mode }
476 #define Ap { OP_DIR, 0 }
477 #define Ob { OP_OFF64, b_mode }
478 #define Ov { OP_OFF64, v_mode }
479 #define Xb { OP_DSreg, eSI_reg }
480 #define Xv { OP_DSreg, eSI_reg }
481 #define Xz { OP_DSreg, eSI_reg }
482 #define Yb { OP_ESreg, eDI_reg }
483 #define Yv { OP_ESreg, eDI_reg }
484 #define DSBX { OP_DSreg, eBX_reg }
486 #define es { OP_REG, es_reg }
487 #define ss { OP_REG, ss_reg }
488 #define cs { OP_REG, cs_reg }
489 #define ds { OP_REG, ds_reg }
490 #define fs { OP_REG, fs_reg }
491 #define gs { OP_REG, gs_reg }
493 #define MX { OP_MMX, 0 }
494 #define XM { OP_XMM, 0 }
495 #define XMScalar { OP_XMM, scalar_mode }
496 #define XMGatherD { OP_XMM, vex_vsib_d_w_dq_mode }
497 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
498 #define XMM { OP_XMM, xmm_mode }
499 #define TMM { OP_XMM, tmm_mode }
500 #define XMxmmq { OP_XMM, xmmq_mode }
501 #define EM { OP_EM, v_mode }
502 #define EMS { OP_EM, v_swap_mode }
503 #define EMd { OP_EM, d_mode }
504 #define EMx { OP_EM, x_mode }
505 #define EXbwUnit { OP_EX, bw_unit_mode }
506 #define EXb { OP_EX, b_mode }
507 #define EXw { OP_EX, w_mode }
508 #define EXd { OP_EX, d_mode }
509 #define EXdS { OP_EX, d_swap_mode }
510 #define EXwS { OP_EX, w_swap_mode }
511 #define EXq { OP_EX, q_mode }
512 #define EXqS { OP_EX, q_swap_mode }
513 #define EXdq { OP_EX, dq_mode }
514 #define EXx { OP_EX, x_mode }
515 #define EXxh { OP_EX, xh_mode }
516 #define EXxS { OP_EX, x_swap_mode }
517 #define EXxmm { OP_EX, xmm_mode }
518 #define EXymm { OP_EX, ymm_mode }
519 #define EXtmm { OP_EX, tmm_mode }
520 #define EXxmmq { OP_EX, xmmq_mode }
521 #define EXxmmqh { OP_EX, evex_half_bcst_xmmqh_mode }
522 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
523 #define EXxmmdw { OP_EX, xmmdw_mode }
524 #define EXxmmqd { OP_EX, xmmqd_mode }
525 #define EXxmmqdh { OP_EX, evex_half_bcst_xmmqdh_mode }
526 #define EXymmq { OP_EX, ymmq_mode }
527 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
528 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
529 #define MS { OP_MS, v_mode }
530 #define XS { OP_XS, v_mode }
531 #define EMCq { OP_EMC, q_mode }
532 #define MXC { OP_MXC, 0 }
533 #define OPSUF { OP_3DNowSuffix, 0 }
534 #define SEP { SEP_Fixup, 0 }
535 #define CMP { CMP_Fixup, 0 }
536 #define XMM0 { XMM_Fixup, 0 }
537 #define FXSAVE { FXSAVE_Fixup, 0 }
539 #define Vex { OP_VEX, x_mode }
540 #define VexW { OP_VexW, x_mode }
541 #define VexScalar { OP_VEX, scalar_mode }
542 #define VexScalarR { OP_VexR, scalar_mode }
543 #define VexGatherD { OP_VEX, vex_vsib_d_w_dq_mode }
544 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
545 #define VexGdq { OP_VEX, dq_mode }
546 #define VexTmm { OP_VEX, tmm_mode }
547 #define XMVexI4 { OP_REG_VexI4, x_mode }
548 #define XMVexScalarI4 { OP_REG_VexI4, scalar_mode }
549 #define VexI4 { OP_VexI4, 0 }
550 #define PCLMUL { PCLMUL_Fixup, 0 }
551 #define VPCMP { VPCMP_Fixup, 0 }
552 #define VPCOM { VPCOM_Fixup, 0 }
554 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
555 #define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
556 #define EXxEVexS { OP_Rounding, evex_sae_mode }
558 #define MaskG { OP_G, mask_mode }
559 #define MaskE { OP_E, mask_mode }
560 #define MaskBDE { OP_E, mask_bd_mode }
561 #define MaskVex { OP_VEX, mask_mode }
563 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
564 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
566 #define MVexSIBMEM { OP_M, vex_sibmem_mode }
568 /* Used handle "rep" prefix for string instructions. */
569 #define Xbr { REP_Fixup, eSI_reg }
570 #define Xvr { REP_Fixup, eSI_reg }
571 #define Ybr { REP_Fixup, eDI_reg }
572 #define Yvr { REP_Fixup, eDI_reg }
573 #define Yzr { REP_Fixup, eDI_reg }
574 #define indirDXr { REP_Fixup, indir_dx_reg }
575 #define ALr { REP_Fixup, al_reg }
576 #define eAXr { REP_Fixup, eAX_reg }
578 /* Used handle HLE prefix for lockable instructions. */
579 #define Ebh1 { HLE_Fixup1, b_mode }
580 #define Evh1 { HLE_Fixup1, v_mode }
581 #define Ebh2 { HLE_Fixup2, b_mode }
582 #define Evh2 { HLE_Fixup2, v_mode }
583 #define Ebh3 { HLE_Fixup3, b_mode }
584 #define Evh3 { HLE_Fixup3, v_mode }
586 #define BND { BND_Fixup, 0 }
587 #define NOTRACK { NOTRACK_Fixup, 0 }
589 #define cond_jump_flag { NULL, cond_jump_mode }
590 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
592 /* bits in sizeflag */
593 #define SUFFIX_ALWAYS 4
601 /* byte operand with operand swapped */
603 /* byte operand, sign extend like 'T' suffix */
605 /* operand size depends on prefixes */
607 /* operand size depends on prefixes with operand swapped */
609 /* operand size depends on address prefix */
613 /* double word operand */
615 /* word operand with operand swapped */
617 /* double word operand with operand swapped */
619 /* quad word operand */
621 /* quad word operand with operand swapped */
623 /* ten-byte operand */
625 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
626 broadcast enabled. */
628 /* Similar to x_mode, but with different EVEX mem shifts. */
630 /* Similar to x_mode, but with yet different EVEX mem shifts. */
632 /* Similar to x_mode, but with disabled broadcast. */
634 /* Similar to x_mode, but with operands swapped and disabled broadcast
637 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
638 broadcast of 16bit enabled. */
640 /* 16-byte XMM operand */
642 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
643 memory operand (depending on vector length). Broadcast isn't
646 /* Same as xmmq_mode, but broadcast is allowed. */
647 evex_half_bcst_xmmq_mode
,
648 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
649 memory operand (depending on vector length). 16bit broadcast. */
650 evex_half_bcst_xmmqh_mode
,
651 /* 16-byte XMM, word, double word or quad word operand. */
653 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
655 /* 16-byte XMM, double word, quad word operand or xmm word operand.
657 evex_half_bcst_xmmqdh_mode
,
658 /* 32-byte YMM operand */
660 /* quad word, ymmword or zmmword memory operand. */
664 /* d_mode in 32bit, q_mode in 64bit mode. */
666 /* pair of v_mode operands */
672 /* like v_bnd_mode in 32bit, no RIP-rel in 64bit mode. */
674 /* operand size depends on REX.W / VEX.W. */
676 /* Displacements like v_mode without considering Intel64 ISA. */
680 /* bounds operand with operand swapped */
682 /* 4- or 6-byte pointer operand */
685 /* v_mode for indirect branch opcodes. */
687 /* v_mode for stack-related opcodes. */
689 /* non-quad operand size depends on prefixes */
691 /* 16-byte operand */
693 /* registers like d_mode, memory like b_mode. */
695 /* registers like d_mode, memory like w_mode. */
698 /* Operand size depends on the VEX.W bit, with VSIB dword indices. */
699 vex_vsib_d_w_dq_mode
,
700 /* Operand size depends on the VEX.W bit, with VSIB qword indices. */
701 vex_vsib_q_w_dq_mode
,
702 /* mandatory non-vector SIB. */
705 /* scalar, ignore vector length. */
708 /* Static rounding. */
710 /* Static rounding, 64-bit mode only. */
711 evex_rounding_64_mode
,
712 /* Supress all exceptions. */
715 /* Mask register operand. */
717 /* Mask register operand. */
785 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
787 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
788 #define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
789 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
790 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
791 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
792 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
793 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
794 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
795 #define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
796 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
797 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
798 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
799 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
800 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
801 #define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
802 #define EVEX_LEN_TABLE(I) DIS386 (USE_EVEX_LEN_TABLE, (I))
829 REG_0F3A0F_PREFIX_1_MOD_3
,
842 REG_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0
,
847 REG_XOP_09_12_M_1_L_0
,
853 REG_EVEX_0F38C6_M_0_L_2
,
854 REG_EVEX_0F38C7_M_0_L_2
961 MOD_VEX_0F3849_X86_64_L_0_W_0
,
962 MOD_VEX_0F384B_X86_64_L_0_W_0
,
964 MOD_VEX_0F385C_X86_64
,
965 MOD_VEX_0F385E_X86_64
,
966 MOD_VEX_0F386C_X86_64
,
979 MOD_EVEX_0F382A_P_1_W_1
,
981 MOD_EVEX_0F383A_P_1_W_0
,
1000 RM_0F01_REG_7_MOD_3
,
1001 RM_0F1E_P_1_MOD_3_REG_7
,
1002 RM_0FAE_REG_6_MOD_3_P_0
,
1003 RM_0FAE_REG_7_MOD_3
,
1004 RM_0F3A0F_P_1_MOD_3_REG_0
,
1006 RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0_R_0
,
1007 RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_3
,
1013 PREFIX_0F00_REG_6_X86_64
,
1014 PREFIX_0F01_REG_0_MOD_3_RM_6
,
1015 PREFIX_0F01_REG_1_RM_2
,
1016 PREFIX_0F01_REG_1_RM_4
,
1017 PREFIX_0F01_REG_1_RM_5
,
1018 PREFIX_0F01_REG_1_RM_6
,
1019 PREFIX_0F01_REG_1_RM_7
,
1020 PREFIX_0F01_REG_3_RM_1
,
1021 PREFIX_0F01_REG_5_MOD_0
,
1022 PREFIX_0F01_REG_5_MOD_3_RM_0
,
1023 PREFIX_0F01_REG_5_MOD_3_RM_1
,
1024 PREFIX_0F01_REG_5_MOD_3_RM_2
,
1025 PREFIX_0F01_REG_5_MOD_3_RM_4
,
1026 PREFIX_0F01_REG_5_MOD_3_RM_5
,
1027 PREFIX_0F01_REG_5_MOD_3_RM_6
,
1028 PREFIX_0F01_REG_5_MOD_3_RM_7
,
1029 PREFIX_0F01_REG_7_MOD_3_RM_2
,
1030 PREFIX_0F01_REG_7_MOD_3_RM_5
,
1031 PREFIX_0F01_REG_7_MOD_3_RM_6
,
1032 PREFIX_0F01_REG_7_MOD_3_RM_7
,
1038 PREFIX_0F18_REG_6_MOD_0_X86_64
,
1039 PREFIX_0F18_REG_7_MOD_0_X86_64
,
1072 PREFIX_0FAE_REG_0_MOD_3
,
1073 PREFIX_0FAE_REG_1_MOD_3
,
1074 PREFIX_0FAE_REG_2_MOD_3
,
1075 PREFIX_0FAE_REG_3_MOD_3
,
1076 PREFIX_0FAE_REG_4_MOD_0
,
1077 PREFIX_0FAE_REG_4_MOD_3
,
1078 PREFIX_0FAE_REG_5_MOD_3
,
1079 PREFIX_0FAE_REG_6_MOD_0
,
1080 PREFIX_0FAE_REG_6_MOD_3
,
1081 PREFIX_0FAE_REG_7_MOD_0
,
1086 PREFIX_0FC7_REG_6_MOD_0
,
1087 PREFIX_0FC7_REG_6_MOD_3
,
1088 PREFIX_0FC7_REG_7_MOD_3
,
1113 PREFIX_VEX_0F41_L_1_M_1_W_0
,
1114 PREFIX_VEX_0F41_L_1_M_1_W_1
,
1115 PREFIX_VEX_0F42_L_1_M_1_W_0
,
1116 PREFIX_VEX_0F42_L_1_M_1_W_1
,
1117 PREFIX_VEX_0F44_L_0_M_1_W_0
,
1118 PREFIX_VEX_0F44_L_0_M_1_W_1
,
1119 PREFIX_VEX_0F45_L_1_M_1_W_0
,
1120 PREFIX_VEX_0F45_L_1_M_1_W_1
,
1121 PREFIX_VEX_0F46_L_1_M_1_W_0
,
1122 PREFIX_VEX_0F46_L_1_M_1_W_1
,
1123 PREFIX_VEX_0F47_L_1_M_1_W_0
,
1124 PREFIX_VEX_0F47_L_1_M_1_W_1
,
1125 PREFIX_VEX_0F4A_L_1_M_1_W_0
,
1126 PREFIX_VEX_0F4A_L_1_M_1_W_1
,
1127 PREFIX_VEX_0F4B_L_1_M_1_W_0
,
1128 PREFIX_VEX_0F4B_L_1_M_1_W_1
,
1133 PREFIX_VEX_0F90_L_0_W_0
,
1134 PREFIX_VEX_0F90_L_0_W_1
,
1135 PREFIX_VEX_0F91_L_0_M_0_W_0
,
1136 PREFIX_VEX_0F91_L_0_M_0_W_1
,
1137 PREFIX_VEX_0F92_L_0_M_1_W_0
,
1138 PREFIX_VEX_0F92_L_0_M_1_W_1
,
1139 PREFIX_VEX_0F93_L_0_M_1_W_0
,
1140 PREFIX_VEX_0F93_L_0_M_1_W_1
,
1141 PREFIX_VEX_0F98_L_0_M_1_W_0
,
1142 PREFIX_VEX_0F98_L_0_M_1_W_1
,
1143 PREFIX_VEX_0F99_L_0_M_1_W_0
,
1144 PREFIX_VEX_0F99_L_0_M_1_W_1
,
1145 PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_0
,
1146 PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_1
,
1147 PREFIX_VEX_0F384B_X86_64_L_0_W_0_M_0
,
1148 PREFIX_VEX_0F3850_W_0
,
1149 PREFIX_VEX_0F3851_W_0
,
1150 PREFIX_VEX_0F385C_X86_64_M_1_L_0_W_0
,
1151 PREFIX_VEX_0F385E_X86_64_M_1_L_0_W_0
,
1152 PREFIX_VEX_0F386C_X86_64_M_1_L_0_W_0
,
1154 PREFIX_VEX_0F38B0_W_0
,
1155 PREFIX_VEX_0F38B1_W_0
,
1156 PREFIX_VEX_0F38F5_L_0
,
1157 PREFIX_VEX_0F38F6_L_0
,
1158 PREFIX_VEX_0F38F7_L_0
,
1159 PREFIX_VEX_0F3AF0_L_0
,
1217 PREFIX_EVEX_MAP5_10
,
1218 PREFIX_EVEX_MAP5_11
,
1219 PREFIX_EVEX_MAP5_1D
,
1220 PREFIX_EVEX_MAP5_2A
,
1221 PREFIX_EVEX_MAP5_2C
,
1222 PREFIX_EVEX_MAP5_2D
,
1223 PREFIX_EVEX_MAP5_2E
,
1224 PREFIX_EVEX_MAP5_2F
,
1225 PREFIX_EVEX_MAP5_51
,
1226 PREFIX_EVEX_MAP5_58
,
1227 PREFIX_EVEX_MAP5_59
,
1228 PREFIX_EVEX_MAP5_5A
,
1229 PREFIX_EVEX_MAP5_5B
,
1230 PREFIX_EVEX_MAP5_5C
,
1231 PREFIX_EVEX_MAP5_5D
,
1232 PREFIX_EVEX_MAP5_5E
,
1233 PREFIX_EVEX_MAP5_5F
,
1234 PREFIX_EVEX_MAP5_78
,
1235 PREFIX_EVEX_MAP5_79
,
1236 PREFIX_EVEX_MAP5_7A
,
1237 PREFIX_EVEX_MAP5_7B
,
1238 PREFIX_EVEX_MAP5_7C
,
1239 PREFIX_EVEX_MAP5_7D
,
1241 PREFIX_EVEX_MAP6_13
,
1242 PREFIX_EVEX_MAP6_56
,
1243 PREFIX_EVEX_MAP6_57
,
1244 PREFIX_EVEX_MAP6_D6
,
1245 PREFIX_EVEX_MAP6_D7
,
1281 X86_64_0F01_REG_0_MOD_3_RM_6_P_1
,
1282 X86_64_0F01_REG_0_MOD_3_RM_6_P_3
,
1284 X86_64_0F01_REG_1_RM_2_PREFIX_1
,
1285 X86_64_0F01_REG_1_RM_2_PREFIX_3
,
1286 X86_64_0F01_REG_1_RM_5_PREFIX_2
,
1287 X86_64_0F01_REG_1_RM_6_PREFIX_2
,
1288 X86_64_0F01_REG_1_RM_7_PREFIX_2
,
1291 X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
,
1292 X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
,
1293 X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
,
1294 X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
,
1295 X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1
,
1296 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
,
1297 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
,
1298 X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
,
1299 X86_64_0F18_REG_6_MOD_0
,
1300 X86_64_0F18_REG_7_MOD_0
,
1303 X86_64_0FC7_REG_6_MOD_3_PREFIX_1
,
1330 THREE_BYTE_0F38
= 0,
1359 VEX_LEN_0F12_P_0
= 0,
1383 VEX_LEN_0FAE_R_2_M_0
,
1384 VEX_LEN_0FAE_R_3_M_0
,
1394 VEX_LEN_0F3849_X86_64
,
1395 VEX_LEN_0F384B_X86_64
,
1397 VEX_LEN_0F385C_X86_64_M_1
,
1398 VEX_LEN_0F385E_X86_64_M_1
,
1399 VEX_LEN_0F386C_X86_64_M_1
,
1432 VEX_LEN_0FXOP_08_85
,
1433 VEX_LEN_0FXOP_08_86
,
1434 VEX_LEN_0FXOP_08_87
,
1435 VEX_LEN_0FXOP_08_8E
,
1436 VEX_LEN_0FXOP_08_8F
,
1437 VEX_LEN_0FXOP_08_95
,
1438 VEX_LEN_0FXOP_08_96
,
1439 VEX_LEN_0FXOP_08_97
,
1440 VEX_LEN_0FXOP_08_9E
,
1441 VEX_LEN_0FXOP_08_9F
,
1442 VEX_LEN_0FXOP_08_A3
,
1443 VEX_LEN_0FXOP_08_A6
,
1444 VEX_LEN_0FXOP_08_B6
,
1445 VEX_LEN_0FXOP_08_C0
,
1446 VEX_LEN_0FXOP_08_C1
,
1447 VEX_LEN_0FXOP_08_C2
,
1448 VEX_LEN_0FXOP_08_C3
,
1449 VEX_LEN_0FXOP_08_CC
,
1450 VEX_LEN_0FXOP_08_CD
,
1451 VEX_LEN_0FXOP_08_CE
,
1452 VEX_LEN_0FXOP_08_CF
,
1453 VEX_LEN_0FXOP_08_EC
,
1454 VEX_LEN_0FXOP_08_ED
,
1455 VEX_LEN_0FXOP_08_EE
,
1456 VEX_LEN_0FXOP_08_EF
,
1457 VEX_LEN_0FXOP_09_01
,
1458 VEX_LEN_0FXOP_09_02
,
1459 VEX_LEN_0FXOP_09_12_M_1
,
1460 VEX_LEN_0FXOP_09_82_W_0
,
1461 VEX_LEN_0FXOP_09_83_W_0
,
1462 VEX_LEN_0FXOP_09_90
,
1463 VEX_LEN_0FXOP_09_91
,
1464 VEX_LEN_0FXOP_09_92
,
1465 VEX_LEN_0FXOP_09_93
,
1466 VEX_LEN_0FXOP_09_94
,
1467 VEX_LEN_0FXOP_09_95
,
1468 VEX_LEN_0FXOP_09_96
,
1469 VEX_LEN_0FXOP_09_97
,
1470 VEX_LEN_0FXOP_09_98
,
1471 VEX_LEN_0FXOP_09_99
,
1472 VEX_LEN_0FXOP_09_9A
,
1473 VEX_LEN_0FXOP_09_9B
,
1474 VEX_LEN_0FXOP_09_C1
,
1475 VEX_LEN_0FXOP_09_C2
,
1476 VEX_LEN_0FXOP_09_C3
,
1477 VEX_LEN_0FXOP_09_C6
,
1478 VEX_LEN_0FXOP_09_C7
,
1479 VEX_LEN_0FXOP_09_CB
,
1480 VEX_LEN_0FXOP_09_D1
,
1481 VEX_LEN_0FXOP_09_D2
,
1482 VEX_LEN_0FXOP_09_D3
,
1483 VEX_LEN_0FXOP_09_D6
,
1484 VEX_LEN_0FXOP_09_D7
,
1485 VEX_LEN_0FXOP_09_DB
,
1486 VEX_LEN_0FXOP_09_E1
,
1487 VEX_LEN_0FXOP_09_E2
,
1488 VEX_LEN_0FXOP_09_E3
,
1489 VEX_LEN_0FXOP_0A_12
,
1494 EVEX_LEN_0F3816
= 0,
1496 EVEX_LEN_0F381A_M_0
,
1497 EVEX_LEN_0F381B_M_0
,
1499 EVEX_LEN_0F385A_M_0
,
1500 EVEX_LEN_0F385B_M_0
,
1501 EVEX_LEN_0F38C6_M_0
,
1502 EVEX_LEN_0F38C7_M_0
,
1519 VEX_W_0F41_L_1_M_1
= 0,
1541 VEX_W_0F381A_M_0_L_1
,
1548 VEX_W_0F3849_X86_64_L_0
,
1549 VEX_W_0F384B_X86_64_L_0
,
1556 VEX_W_0F385A_M_0_L_0
,
1557 VEX_W_0F385C_X86_64_M_1_L_0
,
1558 VEX_W_0F385E_X86_64_M_1_L_0
,
1559 VEX_W_0F386C_X86_64_M_1_L_0
,
1586 VEX_W_0FXOP_08_85_L_0
,
1587 VEX_W_0FXOP_08_86_L_0
,
1588 VEX_W_0FXOP_08_87_L_0
,
1589 VEX_W_0FXOP_08_8E_L_0
,
1590 VEX_W_0FXOP_08_8F_L_0
,
1591 VEX_W_0FXOP_08_95_L_0
,
1592 VEX_W_0FXOP_08_96_L_0
,
1593 VEX_W_0FXOP_08_97_L_0
,
1594 VEX_W_0FXOP_08_9E_L_0
,
1595 VEX_W_0FXOP_08_9F_L_0
,
1596 VEX_W_0FXOP_08_A6_L_0
,
1597 VEX_W_0FXOP_08_B6_L_0
,
1598 VEX_W_0FXOP_08_C0_L_0
,
1599 VEX_W_0FXOP_08_C1_L_0
,
1600 VEX_W_0FXOP_08_C2_L_0
,
1601 VEX_W_0FXOP_08_C3_L_0
,
1602 VEX_W_0FXOP_08_CC_L_0
,
1603 VEX_W_0FXOP_08_CD_L_0
,
1604 VEX_W_0FXOP_08_CE_L_0
,
1605 VEX_W_0FXOP_08_CF_L_0
,
1606 VEX_W_0FXOP_08_EC_L_0
,
1607 VEX_W_0FXOP_08_ED_L_0
,
1608 VEX_W_0FXOP_08_EE_L_0
,
1609 VEX_W_0FXOP_08_EF_L_0
,
1615 VEX_W_0FXOP_09_C1_L_0
,
1616 VEX_W_0FXOP_09_C2_L_0
,
1617 VEX_W_0FXOP_09_C3_L_0
,
1618 VEX_W_0FXOP_09_C6_L_0
,
1619 VEX_W_0FXOP_09_C7_L_0
,
1620 VEX_W_0FXOP_09_CB_L_0
,
1621 VEX_W_0FXOP_09_D1_L_0
,
1622 VEX_W_0FXOP_09_D2_L_0
,
1623 VEX_W_0FXOP_09_D3_L_0
,
1624 VEX_W_0FXOP_09_D6_L_0
,
1625 VEX_W_0FXOP_09_D7_L_0
,
1626 VEX_W_0FXOP_09_DB_L_0
,
1627 VEX_W_0FXOP_09_E1_L_0
,
1628 VEX_W_0FXOP_09_E2_L_0
,
1629 VEX_W_0FXOP_09_E3_L_0
,
1682 EVEX_W_0F381A_M_0_L_n
,
1683 EVEX_W_0F381B_M_0_L_2
,
1708 EVEX_W_0F385A_M_0_L_n
,
1709 EVEX_W_0F385B_M_0_L_2
,
1735 typedef bool (*op_rtn
) (instr_info
*ins
, int bytemode
, int sizeflag
);
1744 unsigned int prefix_requirement
;
1747 /* Upper case letters in the instruction names here are macros.
1748 'A' => print 'b' if no register operands or suffix_always is true
1749 'B' => print 'b' if suffix_always is true
1750 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
1752 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
1753 suffix_always is true
1754 'E' => print 'e' if 32-bit form of jcxz
1755 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
1756 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
1757 'H' => print ",pt" or ",pn" branch hint
1760 'K' => print 'd' or 'q' if rex prefix is present.
1762 'M' => print 'r' if intel_mnemonic is false.
1763 'N' => print 'n' if instruction has no wait "prefix"
1764 'O' => print 'd' or 'o' (or 'q' in Intel mode)
1765 'P' => behave as 'T' except with register operand outside of suffix_always
1767 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
1769 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
1770 'S' => print 'w', 'l' or 'q' if suffix_always is true
1771 'T' => print 'w', 'l'/'d', or 'q' if instruction has an operand size
1772 prefix or if suffix_always is true.
1774 'V' => print 'v' for VEX/EVEX and nothing for legacy encodings.
1775 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
1776 'X' => print 's', 'd' depending on data16 prefix (for XMM)
1777 'Y' => no output, mark EVEX.aaa != 0 as bad.
1778 'Z' => print 'q' in 64bit mode and 'l' otherwise, if suffix_always is true.
1779 '!' => change condition from true to false or from false to true.
1780 '%' => add 1 upper case letter to the macro.
1781 '^' => print 'w', 'l', or 'q' (Intel64 ISA only) depending on operand size
1782 prefix or suffix_always is true (lcall/ljmp).
1783 '@' => in 64bit mode for Intel64 ISA or if instruction
1784 has no operand sizing prefix, print 'q' if suffix_always is true or
1785 nothing otherwise; behave as 'P' in all other cases
1787 2 upper case letter macros:
1788 "XY" => print 'x' or 'y' if suffix_always is true or no register
1789 operands and no broadcast.
1790 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
1791 register operands and no broadcast.
1792 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
1793 "XD" => print 'd' if !EVEX or EVEX.W=1, EVEX.W=0 is not a valid encoding
1794 "XH" => print 'h' if EVEX.W=0, EVEX.W=1 is not a valid encoding (for FP16)
1795 "XS" => print 's' if !EVEX or EVEX.W=0, EVEX.W=1 is not a valid encoding
1796 "XV" => print "{vex} " pseudo prefix
1797 "XE" => print "{evex} " pseudo prefix if no EVEX-specific functionality is
1798 is used by an EVEX-encoded (AVX512VL) instruction.
1799 "YK" keep unused, to avoid ambiguity with the combined use of Y and K.
1800 "YX" keep unused, to avoid ambiguity with the combined use of Y and X.
1801 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond
1802 being false, or no operand at all in 64bit mode, or if suffix_always
1804 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
1805 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
1806 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
1807 "DQ" => print 'd' or 'q' depending on the VEX.W bit
1808 "BW" => print 'b' or 'w' depending on the VEX.W bit
1809 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
1810 an operand size prefix, or suffix_always is true. print
1811 'q' if rex prefix is present.
1813 Many of the above letters print nothing in Intel mode. See "putop"
1816 Braces '{' and '}', and vertical bars '|', indicate alternative
1817 mnemonic strings for AT&T and Intel. */
1819 static const struct dis386 dis386
[] = {
1821 { "addB", { Ebh1
, Gb
}, 0 },
1822 { "addS", { Evh1
, Gv
}, 0 },
1823 { "addB", { Gb
, EbS
}, 0 },
1824 { "addS", { Gv
, EvS
}, 0 },
1825 { "addB", { AL
, Ib
}, 0 },
1826 { "addS", { eAX
, Iv
}, 0 },
1827 { X86_64_TABLE (X86_64_06
) },
1828 { X86_64_TABLE (X86_64_07
) },
1830 { "orB", { Ebh1
, Gb
}, 0 },
1831 { "orS", { Evh1
, Gv
}, 0 },
1832 { "orB", { Gb
, EbS
}, 0 },
1833 { "orS", { Gv
, EvS
}, 0 },
1834 { "orB", { AL
, Ib
}, 0 },
1835 { "orS", { eAX
, Iv
}, 0 },
1836 { X86_64_TABLE (X86_64_0E
) },
1837 { Bad_Opcode
}, /* 0x0f extended opcode escape */
1839 { "adcB", { Ebh1
, Gb
}, 0 },
1840 { "adcS", { Evh1
, Gv
}, 0 },
1841 { "adcB", { Gb
, EbS
}, 0 },
1842 { "adcS", { Gv
, EvS
}, 0 },
1843 { "adcB", { AL
, Ib
}, 0 },
1844 { "adcS", { eAX
, Iv
}, 0 },
1845 { X86_64_TABLE (X86_64_16
) },
1846 { X86_64_TABLE (X86_64_17
) },
1848 { "sbbB", { Ebh1
, Gb
}, 0 },
1849 { "sbbS", { Evh1
, Gv
}, 0 },
1850 { "sbbB", { Gb
, EbS
}, 0 },
1851 { "sbbS", { Gv
, EvS
}, 0 },
1852 { "sbbB", { AL
, Ib
}, 0 },
1853 { "sbbS", { eAX
, Iv
}, 0 },
1854 { X86_64_TABLE (X86_64_1E
) },
1855 { X86_64_TABLE (X86_64_1F
) },
1857 { "andB", { Ebh1
, Gb
}, 0 },
1858 { "andS", { Evh1
, Gv
}, 0 },
1859 { "andB", { Gb
, EbS
}, 0 },
1860 { "andS", { Gv
, EvS
}, 0 },
1861 { "andB", { AL
, Ib
}, 0 },
1862 { "andS", { eAX
, Iv
}, 0 },
1863 { Bad_Opcode
}, /* SEG ES prefix */
1864 { X86_64_TABLE (X86_64_27
) },
1866 { "subB", { Ebh1
, Gb
}, 0 },
1867 { "subS", { Evh1
, Gv
}, 0 },
1868 { "subB", { Gb
, EbS
}, 0 },
1869 { "subS", { Gv
, EvS
}, 0 },
1870 { "subB", { AL
, Ib
}, 0 },
1871 { "subS", { eAX
, Iv
}, 0 },
1872 { Bad_Opcode
}, /* SEG CS prefix */
1873 { X86_64_TABLE (X86_64_2F
) },
1875 { "xorB", { Ebh1
, Gb
}, 0 },
1876 { "xorS", { Evh1
, Gv
}, 0 },
1877 { "xorB", { Gb
, EbS
}, 0 },
1878 { "xorS", { Gv
, EvS
}, 0 },
1879 { "xorB", { AL
, Ib
}, 0 },
1880 { "xorS", { eAX
, Iv
}, 0 },
1881 { Bad_Opcode
}, /* SEG SS prefix */
1882 { X86_64_TABLE (X86_64_37
) },
1884 { "cmpB", { Eb
, Gb
}, 0 },
1885 { "cmpS", { Ev
, Gv
}, 0 },
1886 { "cmpB", { Gb
, EbS
}, 0 },
1887 { "cmpS", { Gv
, EvS
}, 0 },
1888 { "cmpB", { AL
, Ib
}, 0 },
1889 { "cmpS", { eAX
, Iv
}, 0 },
1890 { Bad_Opcode
}, /* SEG DS prefix */
1891 { X86_64_TABLE (X86_64_3F
) },
1893 { "inc{S|}", { RMeAX
}, 0 },
1894 { "inc{S|}", { RMeCX
}, 0 },
1895 { "inc{S|}", { RMeDX
}, 0 },
1896 { "inc{S|}", { RMeBX
}, 0 },
1897 { "inc{S|}", { RMeSP
}, 0 },
1898 { "inc{S|}", { RMeBP
}, 0 },
1899 { "inc{S|}", { RMeSI
}, 0 },
1900 { "inc{S|}", { RMeDI
}, 0 },
1902 { "dec{S|}", { RMeAX
}, 0 },
1903 { "dec{S|}", { RMeCX
}, 0 },
1904 { "dec{S|}", { RMeDX
}, 0 },
1905 { "dec{S|}", { RMeBX
}, 0 },
1906 { "dec{S|}", { RMeSP
}, 0 },
1907 { "dec{S|}", { RMeBP
}, 0 },
1908 { "dec{S|}", { RMeSI
}, 0 },
1909 { "dec{S|}", { RMeDI
}, 0 },
1911 { "push{!P|}", { RMrAX
}, 0 },
1912 { "push{!P|}", { RMrCX
}, 0 },
1913 { "push{!P|}", { RMrDX
}, 0 },
1914 { "push{!P|}", { RMrBX
}, 0 },
1915 { "push{!P|}", { RMrSP
}, 0 },
1916 { "push{!P|}", { RMrBP
}, 0 },
1917 { "push{!P|}", { RMrSI
}, 0 },
1918 { "push{!P|}", { RMrDI
}, 0 },
1920 { "pop{!P|}", { RMrAX
}, 0 },
1921 { "pop{!P|}", { RMrCX
}, 0 },
1922 { "pop{!P|}", { RMrDX
}, 0 },
1923 { "pop{!P|}", { RMrBX
}, 0 },
1924 { "pop{!P|}", { RMrSP
}, 0 },
1925 { "pop{!P|}", { RMrBP
}, 0 },
1926 { "pop{!P|}", { RMrSI
}, 0 },
1927 { "pop{!P|}", { RMrDI
}, 0 },
1929 { X86_64_TABLE (X86_64_60
) },
1930 { X86_64_TABLE (X86_64_61
) },
1931 { X86_64_TABLE (X86_64_62
) },
1932 { X86_64_TABLE (X86_64_63
) },
1933 { Bad_Opcode
}, /* seg fs */
1934 { Bad_Opcode
}, /* seg gs */
1935 { Bad_Opcode
}, /* op size prefix */
1936 { Bad_Opcode
}, /* adr size prefix */
1938 { "pushP", { sIv
}, 0 },
1939 { "imulS", { Gv
, Ev
, Iv
}, 0 },
1940 { "pushP", { sIbT
}, 0 },
1941 { "imulS", { Gv
, Ev
, sIb
}, 0 },
1942 { "ins{b|}", { Ybr
, indirDX
}, 0 },
1943 { X86_64_TABLE (X86_64_6D
) },
1944 { "outs{b|}", { indirDXr
, Xb
}, 0 },
1945 { X86_64_TABLE (X86_64_6F
) },
1947 { "joH", { Jb
, BND
, cond_jump_flag
}, 0 },
1948 { "jnoH", { Jb
, BND
, cond_jump_flag
}, 0 },
1949 { "jbH", { Jb
, BND
, cond_jump_flag
}, 0 },
1950 { "jaeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1951 { "jeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1952 { "jneH", { Jb
, BND
, cond_jump_flag
}, 0 },
1953 { "jbeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1954 { "jaH", { Jb
, BND
, cond_jump_flag
}, 0 },
1956 { "jsH", { Jb
, BND
, cond_jump_flag
}, 0 },
1957 { "jnsH", { Jb
, BND
, cond_jump_flag
}, 0 },
1958 { "jpH", { Jb
, BND
, cond_jump_flag
}, 0 },
1959 { "jnpH", { Jb
, BND
, cond_jump_flag
}, 0 },
1960 { "jlH", { Jb
, BND
, cond_jump_flag
}, 0 },
1961 { "jgeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1962 { "jleH", { Jb
, BND
, cond_jump_flag
}, 0 },
1963 { "jgH", { Jb
, BND
, cond_jump_flag
}, 0 },
1965 { REG_TABLE (REG_80
) },
1966 { REG_TABLE (REG_81
) },
1967 { X86_64_TABLE (X86_64_82
) },
1968 { REG_TABLE (REG_83
) },
1969 { "testB", { Eb
, Gb
}, 0 },
1970 { "testS", { Ev
, Gv
}, 0 },
1971 { "xchgB", { Ebh2
, Gb
}, 0 },
1972 { "xchgS", { Evh2
, Gv
}, 0 },
1974 { "movB", { Ebh3
, Gb
}, 0 },
1975 { "movS", { Evh3
, Gv
}, 0 },
1976 { "movB", { Gb
, EbS
}, 0 },
1977 { "movS", { Gv
, EvS
}, 0 },
1978 { "movD", { Sv
, Sw
}, 0 },
1979 { MOD_TABLE (MOD_8D
) },
1980 { "movD", { Sw
, Sv
}, 0 },
1981 { REG_TABLE (REG_8F
) },
1983 { PREFIX_TABLE (PREFIX_90
) },
1984 { "xchgS", { RMeCX
, eAX
}, 0 },
1985 { "xchgS", { RMeDX
, eAX
}, 0 },
1986 { "xchgS", { RMeBX
, eAX
}, 0 },
1987 { "xchgS", { RMeSP
, eAX
}, 0 },
1988 { "xchgS", { RMeBP
, eAX
}, 0 },
1989 { "xchgS", { RMeSI
, eAX
}, 0 },
1990 { "xchgS", { RMeDI
, eAX
}, 0 },
1992 { "cW{t|}R", { XX
}, 0 },
1993 { "cR{t|}O", { XX
}, 0 },
1994 { X86_64_TABLE (X86_64_9A
) },
1995 { Bad_Opcode
}, /* fwait */
1996 { "pushfP", { XX
}, 0 },
1997 { "popfP", { XX
}, 0 },
1998 { "sahf", { XX
}, 0 },
1999 { "lahf", { XX
}, 0 },
2001 { "mov%LB", { AL
, Ob
}, 0 },
2002 { "mov%LS", { eAX
, Ov
}, 0 },
2003 { "mov%LB", { Ob
, AL
}, 0 },
2004 { "mov%LS", { Ov
, eAX
}, 0 },
2005 { "movs{b|}", { Ybr
, Xb
}, 0 },
2006 { "movs{R|}", { Yvr
, Xv
}, 0 },
2007 { "cmps{b|}", { Xb
, Yb
}, 0 },
2008 { "cmps{R|}", { Xv
, Yv
}, 0 },
2010 { "testB", { AL
, Ib
}, 0 },
2011 { "testS", { eAX
, Iv
}, 0 },
2012 { "stosB", { Ybr
, AL
}, 0 },
2013 { "stosS", { Yvr
, eAX
}, 0 },
2014 { "lodsB", { ALr
, Xb
}, 0 },
2015 { "lodsS", { eAXr
, Xv
}, 0 },
2016 { "scasB", { AL
, Yb
}, 0 },
2017 { "scasS", { eAX
, Yv
}, 0 },
2019 { "movB", { RMAL
, Ib
}, 0 },
2020 { "movB", { RMCL
, Ib
}, 0 },
2021 { "movB", { RMDL
, Ib
}, 0 },
2022 { "movB", { RMBL
, Ib
}, 0 },
2023 { "movB", { RMAH
, Ib
}, 0 },
2024 { "movB", { RMCH
, Ib
}, 0 },
2025 { "movB", { RMDH
, Ib
}, 0 },
2026 { "movB", { RMBH
, Ib
}, 0 },
2028 { "mov%LV", { RMeAX
, Iv64
}, 0 },
2029 { "mov%LV", { RMeCX
, Iv64
}, 0 },
2030 { "mov%LV", { RMeDX
, Iv64
}, 0 },
2031 { "mov%LV", { RMeBX
, Iv64
}, 0 },
2032 { "mov%LV", { RMeSP
, Iv64
}, 0 },
2033 { "mov%LV", { RMeBP
, Iv64
}, 0 },
2034 { "mov%LV", { RMeSI
, Iv64
}, 0 },
2035 { "mov%LV", { RMeDI
, Iv64
}, 0 },
2037 { REG_TABLE (REG_C0
) },
2038 { REG_TABLE (REG_C1
) },
2039 { X86_64_TABLE (X86_64_C2
) },
2040 { X86_64_TABLE (X86_64_C3
) },
2041 { X86_64_TABLE (X86_64_C4
) },
2042 { X86_64_TABLE (X86_64_C5
) },
2043 { REG_TABLE (REG_C6
) },
2044 { REG_TABLE (REG_C7
) },
2046 { "enterP", { Iw
, Ib
}, 0 },
2047 { "leaveP", { XX
}, 0 },
2048 { "{l|}ret{|f}%LP", { Iw
}, 0 },
2049 { "{l|}ret{|f}%LP", { XX
}, 0 },
2050 { "int3", { XX
}, 0 },
2051 { "int", { Ib
}, 0 },
2052 { X86_64_TABLE (X86_64_CE
) },
2053 { "iret%LP", { XX
}, 0 },
2055 { REG_TABLE (REG_D0
) },
2056 { REG_TABLE (REG_D1
) },
2057 { REG_TABLE (REG_D2
) },
2058 { REG_TABLE (REG_D3
) },
2059 { X86_64_TABLE (X86_64_D4
) },
2060 { X86_64_TABLE (X86_64_D5
) },
2062 { "xlat", { DSBX
}, 0 },
2073 { "loopneFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2074 { "loopeFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2075 { "loopFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2076 { "jEcxzH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2077 { "inB", { AL
, Ib
}, 0 },
2078 { "inG", { zAX
, Ib
}, 0 },
2079 { "outB", { Ib
, AL
}, 0 },
2080 { "outG", { Ib
, zAX
}, 0 },
2082 { X86_64_TABLE (X86_64_E8
) },
2083 { X86_64_TABLE (X86_64_E9
) },
2084 { X86_64_TABLE (X86_64_EA
) },
2085 { "jmp", { Jb
, BND
}, 0 },
2086 { "inB", { AL
, indirDX
}, 0 },
2087 { "inG", { zAX
, indirDX
}, 0 },
2088 { "outB", { indirDX
, AL
}, 0 },
2089 { "outG", { indirDX
, zAX
}, 0 },
2091 { Bad_Opcode
}, /* lock prefix */
2092 { "int1", { XX
}, 0 },
2093 { Bad_Opcode
}, /* repne */
2094 { Bad_Opcode
}, /* repz */
2095 { "hlt", { XX
}, 0 },
2096 { "cmc", { XX
}, 0 },
2097 { REG_TABLE (REG_F6
) },
2098 { REG_TABLE (REG_F7
) },
2100 { "clc", { XX
}, 0 },
2101 { "stc", { XX
}, 0 },
2102 { "cli", { XX
}, 0 },
2103 { "sti", { XX
}, 0 },
2104 { "cld", { XX
}, 0 },
2105 { "std", { XX
}, 0 },
2106 { REG_TABLE (REG_FE
) },
2107 { REG_TABLE (REG_FF
) },
2110 static const struct dis386 dis386_twobyte
[] = {
2112 { REG_TABLE (REG_0F00
) },
2113 { REG_TABLE (REG_0F01
) },
2114 { MOD_TABLE (MOD_0F02
) },
2115 { MOD_TABLE (MOD_0F03
) },
2117 { "syscall", { XX
}, 0 },
2118 { "clts", { XX
}, 0 },
2119 { "sysret%LQ", { XX
}, 0 },
2121 { "invd", { XX
}, 0 },
2122 { PREFIX_TABLE (PREFIX_0F09
) },
2124 { "ud2", { XX
}, 0 },
2126 { REG_TABLE (REG_0F0D
) },
2127 { "femms", { XX
}, 0 },
2128 { "", { MX
, EM
, OPSUF
}, 0 }, /* See OP_3DNowSuffix. */
2130 { PREFIX_TABLE (PREFIX_0F10
) },
2131 { PREFIX_TABLE (PREFIX_0F11
) },
2132 { PREFIX_TABLE (PREFIX_0F12
) },
2133 { MOD_TABLE (MOD_0F13
) },
2134 { "unpcklpX", { XM
, EXx
}, PREFIX_OPCODE
},
2135 { "unpckhpX", { XM
, EXx
}, PREFIX_OPCODE
},
2136 { PREFIX_TABLE (PREFIX_0F16
) },
2137 { MOD_TABLE (MOD_0F17
) },
2139 { REG_TABLE (REG_0F18
) },
2140 { "nopQ", { Ev
}, 0 },
2141 { PREFIX_TABLE (PREFIX_0F1A
) },
2142 { PREFIX_TABLE (PREFIX_0F1B
) },
2143 { PREFIX_TABLE (PREFIX_0F1C
) },
2144 { "nopQ", { Ev
}, 0 },
2145 { PREFIX_TABLE (PREFIX_0F1E
) },
2146 { "nopQ", { Ev
}, 0 },
2148 { "movZ", { Em
, Cm
}, 0 },
2149 { "movZ", { Em
, Dm
}, 0 },
2150 { "movZ", { Cm
, Em
}, 0 },
2151 { "movZ", { Dm
, Em
}, 0 },
2152 { X86_64_TABLE (X86_64_0F24
) },
2154 { X86_64_TABLE (X86_64_0F26
) },
2157 { "movapX", { XM
, EXx
}, PREFIX_OPCODE
},
2158 { "movapX", { EXxS
, XM
}, PREFIX_OPCODE
},
2159 { PREFIX_TABLE (PREFIX_0F2A
) },
2160 { PREFIX_TABLE (PREFIX_0F2B
) },
2161 { PREFIX_TABLE (PREFIX_0F2C
) },
2162 { PREFIX_TABLE (PREFIX_0F2D
) },
2163 { PREFIX_TABLE (PREFIX_0F2E
) },
2164 { PREFIX_TABLE (PREFIX_0F2F
) },
2166 { "wrmsr", { XX
}, 0 },
2167 { "rdtsc", { XX
}, 0 },
2168 { "rdmsr", { XX
}, 0 },
2169 { "rdpmc", { XX
}, 0 },
2170 { "sysenter", { SEP
}, 0 },
2171 { "sysexit%LQ", { SEP
}, 0 },
2173 { "getsec", { XX
}, 0 },
2175 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38
, PREFIX_OPCODE
) },
2177 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A
, PREFIX_OPCODE
) },
2184 { "cmovoS", { Gv
, Ev
}, 0 },
2185 { "cmovnoS", { Gv
, Ev
}, 0 },
2186 { "cmovbS", { Gv
, Ev
}, 0 },
2187 { "cmovaeS", { Gv
, Ev
}, 0 },
2188 { "cmoveS", { Gv
, Ev
}, 0 },
2189 { "cmovneS", { Gv
, Ev
}, 0 },
2190 { "cmovbeS", { Gv
, Ev
}, 0 },
2191 { "cmovaS", { Gv
, Ev
}, 0 },
2193 { "cmovsS", { Gv
, Ev
}, 0 },
2194 { "cmovnsS", { Gv
, Ev
}, 0 },
2195 { "cmovpS", { Gv
, Ev
}, 0 },
2196 { "cmovnpS", { Gv
, Ev
}, 0 },
2197 { "cmovlS", { Gv
, Ev
}, 0 },
2198 { "cmovgeS", { Gv
, Ev
}, 0 },
2199 { "cmovleS", { Gv
, Ev
}, 0 },
2200 { "cmovgS", { Gv
, Ev
}, 0 },
2202 { MOD_TABLE (MOD_0F50
) },
2203 { PREFIX_TABLE (PREFIX_0F51
) },
2204 { PREFIX_TABLE (PREFIX_0F52
) },
2205 { PREFIX_TABLE (PREFIX_0F53
) },
2206 { "andpX", { XM
, EXx
}, PREFIX_OPCODE
},
2207 { "andnpX", { XM
, EXx
}, PREFIX_OPCODE
},
2208 { "orpX", { XM
, EXx
}, PREFIX_OPCODE
},
2209 { "xorpX", { XM
, EXx
}, PREFIX_OPCODE
},
2211 { PREFIX_TABLE (PREFIX_0F58
) },
2212 { PREFIX_TABLE (PREFIX_0F59
) },
2213 { PREFIX_TABLE (PREFIX_0F5A
) },
2214 { PREFIX_TABLE (PREFIX_0F5B
) },
2215 { PREFIX_TABLE (PREFIX_0F5C
) },
2216 { PREFIX_TABLE (PREFIX_0F5D
) },
2217 { PREFIX_TABLE (PREFIX_0F5E
) },
2218 { PREFIX_TABLE (PREFIX_0F5F
) },
2220 { PREFIX_TABLE (PREFIX_0F60
) },
2221 { PREFIX_TABLE (PREFIX_0F61
) },
2222 { PREFIX_TABLE (PREFIX_0F62
) },
2223 { "packsswb", { MX
, EM
}, PREFIX_OPCODE
},
2224 { "pcmpgtb", { MX
, EM
}, PREFIX_OPCODE
},
2225 { "pcmpgtw", { MX
, EM
}, PREFIX_OPCODE
},
2226 { "pcmpgtd", { MX
, EM
}, PREFIX_OPCODE
},
2227 { "packuswb", { MX
, EM
}, PREFIX_OPCODE
},
2229 { "punpckhbw", { MX
, EM
}, PREFIX_OPCODE
},
2230 { "punpckhwd", { MX
, EM
}, PREFIX_OPCODE
},
2231 { "punpckhdq", { MX
, EM
}, PREFIX_OPCODE
},
2232 { "packssdw", { MX
, EM
}, PREFIX_OPCODE
},
2233 { "punpcklqdq", { XM
, EXx
}, PREFIX_DATA
},
2234 { "punpckhqdq", { XM
, EXx
}, PREFIX_DATA
},
2235 { "movK", { MX
, Edq
}, PREFIX_OPCODE
},
2236 { PREFIX_TABLE (PREFIX_0F6F
) },
2238 { PREFIX_TABLE (PREFIX_0F70
) },
2239 { MOD_TABLE (MOD_0F71
) },
2240 { MOD_TABLE (MOD_0F72
) },
2241 { MOD_TABLE (MOD_0F73
) },
2242 { "pcmpeqb", { MX
, EM
}, PREFIX_OPCODE
},
2243 { "pcmpeqw", { MX
, EM
}, PREFIX_OPCODE
},
2244 { "pcmpeqd", { MX
, EM
}, PREFIX_OPCODE
},
2245 { "emms", { XX
}, PREFIX_OPCODE
},
2247 { PREFIX_TABLE (PREFIX_0F78
) },
2248 { PREFIX_TABLE (PREFIX_0F79
) },
2251 { PREFIX_TABLE (PREFIX_0F7C
) },
2252 { PREFIX_TABLE (PREFIX_0F7D
) },
2253 { PREFIX_TABLE (PREFIX_0F7E
) },
2254 { PREFIX_TABLE (PREFIX_0F7F
) },
2256 { "joH", { Jv
, BND
, cond_jump_flag
}, 0 },
2257 { "jnoH", { Jv
, BND
, cond_jump_flag
}, 0 },
2258 { "jbH", { Jv
, BND
, cond_jump_flag
}, 0 },
2259 { "jaeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2260 { "jeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2261 { "jneH", { Jv
, BND
, cond_jump_flag
}, 0 },
2262 { "jbeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2263 { "jaH", { Jv
, BND
, cond_jump_flag
}, 0 },
2265 { "jsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2266 { "jnsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2267 { "jpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2268 { "jnpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2269 { "jlH", { Jv
, BND
, cond_jump_flag
}, 0 },
2270 { "jgeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2271 { "jleH", { Jv
, BND
, cond_jump_flag
}, 0 },
2272 { "jgH", { Jv
, BND
, cond_jump_flag
}, 0 },
2274 { "seto", { Eb
}, 0 },
2275 { "setno", { Eb
}, 0 },
2276 { "setb", { Eb
}, 0 },
2277 { "setae", { Eb
}, 0 },
2278 { "sete", { Eb
}, 0 },
2279 { "setne", { Eb
}, 0 },
2280 { "setbe", { Eb
}, 0 },
2281 { "seta", { Eb
}, 0 },
2283 { "sets", { Eb
}, 0 },
2284 { "setns", { Eb
}, 0 },
2285 { "setp", { Eb
}, 0 },
2286 { "setnp", { Eb
}, 0 },
2287 { "setl", { Eb
}, 0 },
2288 { "setge", { Eb
}, 0 },
2289 { "setle", { Eb
}, 0 },
2290 { "setg", { Eb
}, 0 },
2292 { "pushP", { fs
}, 0 },
2293 { "popP", { fs
}, 0 },
2294 { "cpuid", { XX
}, 0 },
2295 { "btS", { Ev
, Gv
}, 0 },
2296 { "shldS", { Ev
, Gv
, Ib
}, 0 },
2297 { "shldS", { Ev
, Gv
, CL
}, 0 },
2298 { REG_TABLE (REG_0FA6
) },
2299 { REG_TABLE (REG_0FA7
) },
2301 { "pushP", { gs
}, 0 },
2302 { "popP", { gs
}, 0 },
2303 { "rsm", { XX
}, 0 },
2304 { "btsS", { Evh1
, Gv
}, 0 },
2305 { "shrdS", { Ev
, Gv
, Ib
}, 0 },
2306 { "shrdS", { Ev
, Gv
, CL
}, 0 },
2307 { REG_TABLE (REG_0FAE
) },
2308 { "imulS", { Gv
, Ev
}, 0 },
2310 { "cmpxchgB", { Ebh1
, Gb
}, 0 },
2311 { "cmpxchgS", { Evh1
, Gv
}, 0 },
2312 { MOD_TABLE (MOD_0FB2
) },
2313 { "btrS", { Evh1
, Gv
}, 0 },
2314 { MOD_TABLE (MOD_0FB4
) },
2315 { MOD_TABLE (MOD_0FB5
) },
2316 { "movz{bR|x}", { Gv
, Eb
}, 0 },
2317 { "movz{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movzww ! */
2319 { PREFIX_TABLE (PREFIX_0FB8
) },
2320 { "ud1S", { Gv
, Ev
}, 0 },
2321 { REG_TABLE (REG_0FBA
) },
2322 { "btcS", { Evh1
, Gv
}, 0 },
2323 { PREFIX_TABLE (PREFIX_0FBC
) },
2324 { PREFIX_TABLE (PREFIX_0FBD
) },
2325 { "movs{bR|x}", { Gv
, Eb
}, 0 },
2326 { "movs{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movsww ! */
2328 { "xaddB", { Ebh1
, Gb
}, 0 },
2329 { "xaddS", { Evh1
, Gv
}, 0 },
2330 { PREFIX_TABLE (PREFIX_0FC2
) },
2331 { MOD_TABLE (MOD_0FC3
) },
2332 { "pinsrw", { MX
, Edw
, Ib
}, PREFIX_OPCODE
},
2333 { "pextrw", { Gd
, MS
, Ib
}, PREFIX_OPCODE
},
2334 { "shufpX", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
2335 { REG_TABLE (REG_0FC7
) },
2337 { "bswap", { RMeAX
}, 0 },
2338 { "bswap", { RMeCX
}, 0 },
2339 { "bswap", { RMeDX
}, 0 },
2340 { "bswap", { RMeBX
}, 0 },
2341 { "bswap", { RMeSP
}, 0 },
2342 { "bswap", { RMeBP
}, 0 },
2343 { "bswap", { RMeSI
}, 0 },
2344 { "bswap", { RMeDI
}, 0 },
2346 { PREFIX_TABLE (PREFIX_0FD0
) },
2347 { "psrlw", { MX
, EM
}, PREFIX_OPCODE
},
2348 { "psrld", { MX
, EM
}, PREFIX_OPCODE
},
2349 { "psrlq", { MX
, EM
}, PREFIX_OPCODE
},
2350 { "paddq", { MX
, EM
}, PREFIX_OPCODE
},
2351 { "pmullw", { MX
, EM
}, PREFIX_OPCODE
},
2352 { PREFIX_TABLE (PREFIX_0FD6
) },
2353 { MOD_TABLE (MOD_0FD7
) },
2355 { "psubusb", { MX
, EM
}, PREFIX_OPCODE
},
2356 { "psubusw", { MX
, EM
}, PREFIX_OPCODE
},
2357 { "pminub", { MX
, EM
}, PREFIX_OPCODE
},
2358 { "pand", { MX
, EM
}, PREFIX_OPCODE
},
2359 { "paddusb", { MX
, EM
}, PREFIX_OPCODE
},
2360 { "paddusw", { MX
, EM
}, PREFIX_OPCODE
},
2361 { "pmaxub", { MX
, EM
}, PREFIX_OPCODE
},
2362 { "pandn", { MX
, EM
}, PREFIX_OPCODE
},
2364 { "pavgb", { MX
, EM
}, PREFIX_OPCODE
},
2365 { "psraw", { MX
, EM
}, PREFIX_OPCODE
},
2366 { "psrad", { MX
, EM
}, PREFIX_OPCODE
},
2367 { "pavgw", { MX
, EM
}, PREFIX_OPCODE
},
2368 { "pmulhuw", { MX
, EM
}, PREFIX_OPCODE
},
2369 { "pmulhw", { MX
, EM
}, PREFIX_OPCODE
},
2370 { PREFIX_TABLE (PREFIX_0FE6
) },
2371 { PREFIX_TABLE (PREFIX_0FE7
) },
2373 { "psubsb", { MX
, EM
}, PREFIX_OPCODE
},
2374 { "psubsw", { MX
, EM
}, PREFIX_OPCODE
},
2375 { "pminsw", { MX
, EM
}, PREFIX_OPCODE
},
2376 { "por", { MX
, EM
}, PREFIX_OPCODE
},
2377 { "paddsb", { MX
, EM
}, PREFIX_OPCODE
},
2378 { "paddsw", { MX
, EM
}, PREFIX_OPCODE
},
2379 { "pmaxsw", { MX
, EM
}, PREFIX_OPCODE
},
2380 { "pxor", { MX
, EM
}, PREFIX_OPCODE
},
2382 { PREFIX_TABLE (PREFIX_0FF0
) },
2383 { "psllw", { MX
, EM
}, PREFIX_OPCODE
},
2384 { "pslld", { MX
, EM
}, PREFIX_OPCODE
},
2385 { "psllq", { MX
, EM
}, PREFIX_OPCODE
},
2386 { "pmuludq", { MX
, EM
}, PREFIX_OPCODE
},
2387 { "pmaddwd", { MX
, EM
}, PREFIX_OPCODE
},
2388 { "psadbw", { MX
, EM
}, PREFIX_OPCODE
},
2389 { PREFIX_TABLE (PREFIX_0FF7
) },
2391 { "psubb", { MX
, EM
}, PREFIX_OPCODE
},
2392 { "psubw", { MX
, EM
}, PREFIX_OPCODE
},
2393 { "psubd", { MX
, EM
}, PREFIX_OPCODE
},
2394 { "psubq", { MX
, EM
}, PREFIX_OPCODE
},
2395 { "paddb", { MX
, EM
}, PREFIX_OPCODE
},
2396 { "paddw", { MX
, EM
}, PREFIX_OPCODE
},
2397 { "paddd", { MX
, EM
}, PREFIX_OPCODE
},
2398 { "ud0S", { Gv
, Ev
}, 0 },
2401 static const bool onebyte_has_modrm
[256] = {
2402 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2403 /* ------------------------------- */
2404 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2405 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2406 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2407 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2408 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2409 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2410 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2411 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2412 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2413 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2414 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2415 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2416 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2417 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2418 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2419 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2420 /* ------------------------------- */
2421 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2424 static const bool twobyte_has_modrm
[256] = {
2425 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2426 /* ------------------------------- */
2427 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2428 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2429 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2430 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2431 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2432 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2433 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2434 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2435 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2436 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2437 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2438 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
2439 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2440 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2441 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2442 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
2443 /* ------------------------------- */
2444 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2454 /* If we are accessing mod/rm/reg without need_modrm set, then the
2455 values are stale. Hitting this abort likely indicates that you
2456 need to update onebyte_has_modrm or twobyte_has_modrm. */
2457 #define MODRM_CHECK if (!ins->need_modrm) abort ()
2459 static const char intel_index16
[][6] = {
2460 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
2463 static const char att_names64
[][8] = {
2464 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
2465 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
2467 static const char att_names32
[][8] = {
2468 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
2469 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
2471 static const char att_names16
[][8] = {
2472 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
2473 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
2475 static const char att_names8
[][8] = {
2476 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
2478 static const char att_names8rex
[][8] = {
2479 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
2480 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
2482 static const char att_names_seg
[][4] = {
2483 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
2485 static const char att_index64
[] = "%riz";
2486 static const char att_index32
[] = "%eiz";
2487 static const char att_index16
[][8] = {
2488 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
2491 static const char att_names_mm
[][8] = {
2492 "%mm0", "%mm1", "%mm2", "%mm3",
2493 "%mm4", "%mm5", "%mm6", "%mm7"
2496 static const char att_names_bnd
[][8] = {
2497 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
2500 static const char att_names_xmm
[][8] = {
2501 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
2502 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
2503 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
2504 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
2505 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
2506 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
2507 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
2508 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
2511 static const char att_names_ymm
[][8] = {
2512 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
2513 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
2514 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
2515 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
2516 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
2517 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
2518 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
2519 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
2522 static const char att_names_zmm
[][8] = {
2523 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
2524 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
2525 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
2526 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
2527 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
2528 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
2529 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
2530 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
2533 static const char att_names_tmm
[][8] = {
2534 "%tmm0", "%tmm1", "%tmm2", "%tmm3",
2535 "%tmm4", "%tmm5", "%tmm6", "%tmm7"
2538 static const char att_names_mask
[][8] = {
2539 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
2542 static const char *const names_rounding
[] =
2550 static const struct dis386 reg_table
[][8] = {
2553 { "addA", { Ebh1
, Ib
}, 0 },
2554 { "orA", { Ebh1
, Ib
}, 0 },
2555 { "adcA", { Ebh1
, Ib
}, 0 },
2556 { "sbbA", { Ebh1
, Ib
}, 0 },
2557 { "andA", { Ebh1
, Ib
}, 0 },
2558 { "subA", { Ebh1
, Ib
}, 0 },
2559 { "xorA", { Ebh1
, Ib
}, 0 },
2560 { "cmpA", { Eb
, Ib
}, 0 },
2564 { "addQ", { Evh1
, Iv
}, 0 },
2565 { "orQ", { Evh1
, Iv
}, 0 },
2566 { "adcQ", { Evh1
, Iv
}, 0 },
2567 { "sbbQ", { Evh1
, Iv
}, 0 },
2568 { "andQ", { Evh1
, Iv
}, 0 },
2569 { "subQ", { Evh1
, Iv
}, 0 },
2570 { "xorQ", { Evh1
, Iv
}, 0 },
2571 { "cmpQ", { Ev
, Iv
}, 0 },
2575 { "addQ", { Evh1
, sIb
}, 0 },
2576 { "orQ", { Evh1
, sIb
}, 0 },
2577 { "adcQ", { Evh1
, sIb
}, 0 },
2578 { "sbbQ", { Evh1
, sIb
}, 0 },
2579 { "andQ", { Evh1
, sIb
}, 0 },
2580 { "subQ", { Evh1
, sIb
}, 0 },
2581 { "xorQ", { Evh1
, sIb
}, 0 },
2582 { "cmpQ", { Ev
, sIb
}, 0 },
2586 { "pop{P|}", { stackEv
}, 0 },
2587 { XOP_8F_TABLE (XOP_09
) },
2591 { XOP_8F_TABLE (XOP_09
) },
2595 { "rolA", { Eb
, Ib
}, 0 },
2596 { "rorA", { Eb
, Ib
}, 0 },
2597 { "rclA", { Eb
, Ib
}, 0 },
2598 { "rcrA", { Eb
, Ib
}, 0 },
2599 { "shlA", { Eb
, Ib
}, 0 },
2600 { "shrA", { Eb
, Ib
}, 0 },
2601 { "shlA", { Eb
, Ib
}, 0 },
2602 { "sarA", { Eb
, Ib
}, 0 },
2606 { "rolQ", { Ev
, Ib
}, 0 },
2607 { "rorQ", { Ev
, Ib
}, 0 },
2608 { "rclQ", { Ev
, Ib
}, 0 },
2609 { "rcrQ", { Ev
, Ib
}, 0 },
2610 { "shlQ", { Ev
, Ib
}, 0 },
2611 { "shrQ", { Ev
, Ib
}, 0 },
2612 { "shlQ", { Ev
, Ib
}, 0 },
2613 { "sarQ", { Ev
, Ib
}, 0 },
2617 { "movA", { Ebh3
, Ib
}, 0 },
2624 { MOD_TABLE (MOD_C6_REG_7
) },
2628 { "movQ", { Evh3
, Iv
}, 0 },
2635 { MOD_TABLE (MOD_C7_REG_7
) },
2639 { "rolA", { Eb
, I1
}, 0 },
2640 { "rorA", { Eb
, I1
}, 0 },
2641 { "rclA", { Eb
, I1
}, 0 },
2642 { "rcrA", { Eb
, I1
}, 0 },
2643 { "shlA", { Eb
, I1
}, 0 },
2644 { "shrA", { Eb
, I1
}, 0 },
2645 { "shlA", { Eb
, I1
}, 0 },
2646 { "sarA", { Eb
, I1
}, 0 },
2650 { "rolQ", { Ev
, I1
}, 0 },
2651 { "rorQ", { Ev
, I1
}, 0 },
2652 { "rclQ", { Ev
, I1
}, 0 },
2653 { "rcrQ", { Ev
, I1
}, 0 },
2654 { "shlQ", { Ev
, I1
}, 0 },
2655 { "shrQ", { Ev
, I1
}, 0 },
2656 { "shlQ", { Ev
, I1
}, 0 },
2657 { "sarQ", { Ev
, I1
}, 0 },
2661 { "rolA", { Eb
, CL
}, 0 },
2662 { "rorA", { Eb
, CL
}, 0 },
2663 { "rclA", { Eb
, CL
}, 0 },
2664 { "rcrA", { Eb
, CL
}, 0 },
2665 { "shlA", { Eb
, CL
}, 0 },
2666 { "shrA", { Eb
, CL
}, 0 },
2667 { "shlA", { Eb
, CL
}, 0 },
2668 { "sarA", { Eb
, CL
}, 0 },
2672 { "rolQ", { Ev
, CL
}, 0 },
2673 { "rorQ", { Ev
, CL
}, 0 },
2674 { "rclQ", { Ev
, CL
}, 0 },
2675 { "rcrQ", { Ev
, CL
}, 0 },
2676 { "shlQ", { Ev
, CL
}, 0 },
2677 { "shrQ", { Ev
, CL
}, 0 },
2678 { "shlQ", { Ev
, CL
}, 0 },
2679 { "sarQ", { Ev
, CL
}, 0 },
2683 { "testA", { Eb
, Ib
}, 0 },
2684 { "testA", { Eb
, Ib
}, 0 },
2685 { "notA", { Ebh1
}, 0 },
2686 { "negA", { Ebh1
}, 0 },
2687 { "mulA", { Eb
}, 0 }, /* Don't print the implicit %al register, */
2688 { "imulA", { Eb
}, 0 }, /* to distinguish these opcodes from other */
2689 { "divA", { Eb
}, 0 }, /* mul/imul opcodes. Do the same for div */
2690 { "idivA", { Eb
}, 0 }, /* and idiv for consistency. */
2694 { "testQ", { Ev
, Iv
}, 0 },
2695 { "testQ", { Ev
, Iv
}, 0 },
2696 { "notQ", { Evh1
}, 0 },
2697 { "negQ", { Evh1
}, 0 },
2698 { "mulQ", { Ev
}, 0 }, /* Don't print the implicit register. */
2699 { "imulQ", { Ev
}, 0 },
2700 { "divQ", { Ev
}, 0 },
2701 { "idivQ", { Ev
}, 0 },
2705 { "incA", { Ebh1
}, 0 },
2706 { "decA", { Ebh1
}, 0 },
2710 { "incQ", { Evh1
}, 0 },
2711 { "decQ", { Evh1
}, 0 },
2712 { "call{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2713 { MOD_TABLE (MOD_FF_REG_3
) },
2714 { "jmp{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2715 { MOD_TABLE (MOD_FF_REG_5
) },
2716 { "push{P|}", { stackEv
}, 0 },
2721 { "sldtD", { Sv
}, 0 },
2722 { "strD", { Sv
}, 0 },
2723 { "lldt", { Ew
}, 0 },
2724 { "ltr", { Ew
}, 0 },
2725 { "verr", { Ew
}, 0 },
2726 { "verw", { Ew
}, 0 },
2727 { X86_64_TABLE (X86_64_0F00_REG_6
) },
2732 { MOD_TABLE (MOD_0F01_REG_0
) },
2733 { MOD_TABLE (MOD_0F01_REG_1
) },
2734 { MOD_TABLE (MOD_0F01_REG_2
) },
2735 { MOD_TABLE (MOD_0F01_REG_3
) },
2736 { "smswD", { Sv
}, 0 },
2737 { MOD_TABLE (MOD_0F01_REG_5
) },
2738 { "lmsw", { Ew
}, 0 },
2739 { MOD_TABLE (MOD_0F01_REG_7
) },
2743 { "prefetch", { Mb
}, 0 },
2744 { "prefetchw", { Mb
}, 0 },
2745 { "prefetchwt1", { Mb
}, 0 },
2746 { "prefetch", { Mb
}, 0 },
2747 { "prefetch", { Mb
}, 0 },
2748 { "prefetch", { Mb
}, 0 },
2749 { "prefetch", { Mb
}, 0 },
2750 { "prefetch", { Mb
}, 0 },
2754 { MOD_TABLE (MOD_0F18_REG_0
) },
2755 { MOD_TABLE (MOD_0F18_REG_1
) },
2756 { MOD_TABLE (MOD_0F18_REG_2
) },
2757 { MOD_TABLE (MOD_0F18_REG_3
) },
2758 { "nopQ", { Ev
}, 0 },
2759 { "nopQ", { Ev
}, 0 },
2760 { MOD_TABLE (MOD_0F18_REG_6
) },
2761 { MOD_TABLE (MOD_0F18_REG_7
) },
2763 /* REG_0F1C_P_0_MOD_0 */
2765 { "cldemote", { Mb
}, 0 },
2766 { "nopQ", { Ev
}, 0 },
2767 { "nopQ", { Ev
}, 0 },
2768 { "nopQ", { Ev
}, 0 },
2769 { "nopQ", { Ev
}, 0 },
2770 { "nopQ", { Ev
}, 0 },
2771 { "nopQ", { Ev
}, 0 },
2772 { "nopQ", { Ev
}, 0 },
2774 /* REG_0F1E_P_1_MOD_3 */
2776 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2777 { "rdsspK", { Edq
}, 0 },
2778 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2779 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2780 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2781 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2782 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2783 { RM_TABLE (RM_0F1E_P_1_MOD_3_REG_7
) },
2785 /* REG_0F38D8_PREFIX_1 */
2787 { "aesencwide128kl", { M
}, 0 },
2788 { "aesdecwide128kl", { M
}, 0 },
2789 { "aesencwide256kl", { M
}, 0 },
2790 { "aesdecwide256kl", { M
}, 0 },
2792 /* REG_0F3A0F_PREFIX_1_MOD_3 */
2794 { RM_TABLE (RM_0F3A0F_P_1_MOD_3_REG_0
) },
2796 /* REG_0F71_MOD_0 */
2800 { "psrlw", { MS
, Ib
}, PREFIX_OPCODE
},
2802 { "psraw", { MS
, Ib
}, PREFIX_OPCODE
},
2804 { "psllw", { MS
, Ib
}, PREFIX_OPCODE
},
2806 /* REG_0F72_MOD_0 */
2810 { "psrld", { MS
, Ib
}, PREFIX_OPCODE
},
2812 { "psrad", { MS
, Ib
}, PREFIX_OPCODE
},
2814 { "pslld", { MS
, Ib
}, PREFIX_OPCODE
},
2816 /* REG_0F73_MOD_0 */
2820 { "psrlq", { MS
, Ib
}, PREFIX_OPCODE
},
2821 { "psrldq", { XS
, Ib
}, PREFIX_DATA
},
2824 { "psllq", { MS
, Ib
}, PREFIX_OPCODE
},
2825 { "pslldq", { XS
, Ib
}, PREFIX_DATA
},
2829 { "montmul", { { OP_0f07
, 0 } }, 0 },
2830 { "xsha1", { { OP_0f07
, 0 } }, 0 },
2831 { "xsha256", { { OP_0f07
, 0 } }, 0 },
2835 { "xstore-rng", { { OP_0f07
, 0 } }, 0 },
2836 { "xcrypt-ecb", { { OP_0f07
, 0 } }, 0 },
2837 { "xcrypt-cbc", { { OP_0f07
, 0 } }, 0 },
2838 { "xcrypt-ctr", { { OP_0f07
, 0 } }, 0 },
2839 { "xcrypt-cfb", { { OP_0f07
, 0 } }, 0 },
2840 { "xcrypt-ofb", { { OP_0f07
, 0 } }, 0 },
2844 { MOD_TABLE (MOD_0FAE_REG_0
) },
2845 { MOD_TABLE (MOD_0FAE_REG_1
) },
2846 { MOD_TABLE (MOD_0FAE_REG_2
) },
2847 { MOD_TABLE (MOD_0FAE_REG_3
) },
2848 { MOD_TABLE (MOD_0FAE_REG_4
) },
2849 { MOD_TABLE (MOD_0FAE_REG_5
) },
2850 { MOD_TABLE (MOD_0FAE_REG_6
) },
2851 { MOD_TABLE (MOD_0FAE_REG_7
) },
2859 { "btQ", { Ev
, Ib
}, 0 },
2860 { "btsQ", { Evh1
, Ib
}, 0 },
2861 { "btrQ", { Evh1
, Ib
}, 0 },
2862 { "btcQ", { Evh1
, Ib
}, 0 },
2867 { "cmpxchg8b", { { CMPXCHG8B_Fixup
, q_mode
} }, 0 },
2869 { MOD_TABLE (MOD_0FC7_REG_3
) },
2870 { MOD_TABLE (MOD_0FC7_REG_4
) },
2871 { MOD_TABLE (MOD_0FC7_REG_5
) },
2872 { MOD_TABLE (MOD_0FC7_REG_6
) },
2873 { MOD_TABLE (MOD_0FC7_REG_7
) },
2875 /* REG_VEX_0F71_M_0 */
2879 { "vpsrlw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2881 { "vpsraw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2883 { "vpsllw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2885 /* REG_VEX_0F72_M_0 */
2889 { "vpsrld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2891 { "vpsrad", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2893 { "vpslld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2895 /* REG_VEX_0F73_M_0 */
2899 { "vpsrlq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2900 { "vpsrldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2903 { "vpsllq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2904 { "vpslldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2910 { MOD_TABLE (MOD_VEX_0FAE_REG_2
) },
2911 { MOD_TABLE (MOD_VEX_0FAE_REG_3
) },
2913 /* REG_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0 */
2915 { RM_TABLE (RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0_R_0
) },
2917 /* REG_VEX_0F38F3_L_0 */
2920 { "blsrS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2921 { "blsmskS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2922 { "blsiS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2924 /* REG_XOP_09_01_L_0 */
2927 { "blcfill", { VexGdq
, Edq
}, 0 },
2928 { "blsfill", { VexGdq
, Edq
}, 0 },
2929 { "blcs", { VexGdq
, Edq
}, 0 },
2930 { "tzmsk", { VexGdq
, Edq
}, 0 },
2931 { "blcic", { VexGdq
, Edq
}, 0 },
2932 { "blsic", { VexGdq
, Edq
}, 0 },
2933 { "t1mskc", { VexGdq
, Edq
}, 0 },
2935 /* REG_XOP_09_02_L_0 */
2938 { "blcmsk", { VexGdq
, Edq
}, 0 },
2943 { "blci", { VexGdq
, Edq
}, 0 },
2945 /* REG_XOP_09_12_M_1_L_0 */
2947 { "llwpcb", { Edq
}, 0 },
2948 { "slwpcb", { Edq
}, 0 },
2950 /* REG_XOP_0A_12_L_0 */
2952 { "lwpins", { VexGdq
, Ed
, Id
}, 0 },
2953 { "lwpval", { VexGdq
, Ed
, Id
}, 0 },
2956 #include "i386-dis-evex-reg.h"
2959 static const struct dis386 prefix_table
[][4] = {
2962 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2963 { "pause", { XX
}, 0 },
2964 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2965 { NULL
, { { NULL
, 0 } }, PREFIX_IGNORED
}
2968 /* PREFIX_0F00_REG_6_X86_64 */
2973 { "lkgs", { Ew
}, 0 },
2976 /* PREFIX_0F01_REG_0_MOD_3_RM_6 */
2978 { "wrmsrns", { Skip_MODRM
}, 0 },
2979 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_1
) },
2981 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_3
) },
2984 /* PREFIX_0F01_REG_1_RM_2 */
2986 { "clac", { Skip_MODRM
}, 0 },
2987 { X86_64_TABLE (X86_64_0F01_REG_1_RM_2_PREFIX_1
) },
2989 { X86_64_TABLE (X86_64_0F01_REG_1_RM_2_PREFIX_3
)},
2992 /* PREFIX_0F01_REG_1_RM_4 */
2996 { "tdcall", { Skip_MODRM
}, 0 },
3000 /* PREFIX_0F01_REG_1_RM_5 */
3004 { X86_64_TABLE (X86_64_0F01_REG_1_RM_5_PREFIX_2
) },
3008 /* PREFIX_0F01_REG_1_RM_6 */
3012 { X86_64_TABLE (X86_64_0F01_REG_1_RM_6_PREFIX_2
) },
3016 /* PREFIX_0F01_REG_1_RM_7 */
3018 { "encls", { Skip_MODRM
}, 0 },
3020 { X86_64_TABLE (X86_64_0F01_REG_1_RM_7_PREFIX_2
) },
3024 /* PREFIX_0F01_REG_3_RM_1 */
3026 { "vmmcall", { Skip_MODRM
}, 0 },
3027 { "vmgexit", { Skip_MODRM
}, 0 },
3029 { "vmgexit", { Skip_MODRM
}, 0 },
3032 /* PREFIX_0F01_REG_5_MOD_0 */
3035 { "rstorssp", { Mq
}, PREFIX_OPCODE
},
3038 /* PREFIX_0F01_REG_5_MOD_3_RM_0 */
3040 { "serialize", { Skip_MODRM
}, PREFIX_OPCODE
},
3041 { "setssbsy", { Skip_MODRM
}, PREFIX_OPCODE
},
3043 { "xsusldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3046 /* PREFIX_0F01_REG_5_MOD_3_RM_1 */
3051 { "xresldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3054 /* PREFIX_0F01_REG_5_MOD_3_RM_2 */
3057 { "saveprevssp", { Skip_MODRM
}, PREFIX_OPCODE
},
3060 /* PREFIX_0F01_REG_5_MOD_3_RM_4 */
3063 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
) },
3066 /* PREFIX_0F01_REG_5_MOD_3_RM_5 */
3069 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
) },
3072 /* PREFIX_0F01_REG_5_MOD_3_RM_6 */
3074 { "rdpkru", { Skip_MODRM
}, 0 },
3075 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
) },
3078 /* PREFIX_0F01_REG_5_MOD_3_RM_7 */
3080 { "wrpkru", { Skip_MODRM
}, 0 },
3081 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
) },
3084 /* PREFIX_0F01_REG_7_MOD_3_RM_2 */
3086 { "monitorx", { { OP_Monitor
, 0 } }, 0 },
3087 { "mcommit", { Skip_MODRM
}, 0 },
3090 /* PREFIX_0F01_REG_7_MOD_3_RM_5 */
3092 { "rdpru", { Skip_MODRM
}, 0 },
3093 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1
) },
3096 /* PREFIX_0F01_REG_7_MOD_3_RM_6 */
3098 { "invlpgb", { Skip_MODRM
}, 0 },
3099 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
) },
3101 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
) },
3104 /* PREFIX_0F01_REG_7_MOD_3_RM_7 */
3106 { "tlbsync", { Skip_MODRM
}, 0 },
3107 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
) },
3109 { "pvalidate", { Skip_MODRM
}, 0 },
3114 { "wbinvd", { XX
}, 0 },
3115 { "wbnoinvd", { XX
}, 0 },
3120 { "%XEVmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3121 { "%XEVmovs%XS", { XMScalar
, VexScalarR
, EXd
}, 0 },
3122 { "%XEVmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3123 { "%XEVmovs%XD", { XMScalar
, VexScalarR
, EXq
}, 0 },
3128 { "%XEVmovupX", { EXxS
, XM
}, 0 },
3129 { "%XEVmovs%XS", { EXdS
, VexScalarR
, XMScalar
}, 0 },
3130 { "%XEVmovupX", { EXxS
, XM
}, 0 },
3131 { "%XEVmovs%XD", { EXqS
, VexScalarR
, XMScalar
}, 0 },
3136 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
3137 { "movsldup", { XM
, EXx
}, PREFIX_OPCODE
},
3138 { MOD_TABLE (MOD_0F12_PREFIX_2
) },
3139 { "movddup", { XM
, EXq
}, PREFIX_OPCODE
},
3144 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
3145 { "movshdup", { XM
, EXx
}, PREFIX_OPCODE
},
3146 { MOD_TABLE (MOD_0F16_PREFIX_2
) },
3149 /* PREFIX_0F18_REG_6_MOD_0_X86_64 */
3151 { "prefetchit1", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3152 { "nopQ", { Ev
}, 0 },
3153 { "nopQ", { Ev
}, 0 },
3154 { "nopQ", { Ev
}, 0 },
3157 /* PREFIX_0F18_REG_7_MOD_0_X86_64 */
3159 { "prefetchit0", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3160 { "nopQ", { Ev
}, 0 },
3161 { "nopQ", { Ev
}, 0 },
3162 { "nopQ", { Ev
}, 0 },
3167 { MOD_TABLE (MOD_0F1A_PREFIX_0
) },
3168 { "bndcl", { Gbnd
, Ev_bnd
}, 0 },
3169 { "bndmov", { Gbnd
, Ebnd
}, 0 },
3170 { "bndcu", { Gbnd
, Ev_bnd
}, 0 },
3175 { MOD_TABLE (MOD_0F1B_PREFIX_0
) },
3176 { MOD_TABLE (MOD_0F1B_PREFIX_1
) },
3177 { "bndmov", { EbndS
, Gbnd
}, 0 },
3178 { "bndcn", { Gbnd
, Ev_bnd
}, 0 },
3183 { MOD_TABLE (MOD_0F1C_PREFIX_0
) },
3184 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3185 { "nopQ", { Ev
}, 0 },
3186 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3191 { "nopQ", { Ev
}, 0 },
3192 { MOD_TABLE (MOD_0F1E_PREFIX_1
) },
3193 { "nopQ", { Ev
}, 0 },
3194 { NULL
, { XX
}, PREFIX_IGNORED
},
3199 { "cvtpi2ps", { XM
, EMCq
}, PREFIX_OPCODE
},
3200 { "cvtsi2ss{%LQ|}", { XM
, Edq
}, PREFIX_OPCODE
},
3201 { "cvtpi2pd", { XM
, EMCq
}, PREFIX_OPCODE
},
3202 { "cvtsi2sd{%LQ|}", { XM
, Edq
}, 0 },
3207 { MOD_TABLE (MOD_0F2B_PREFIX_0
) },
3208 { MOD_TABLE (MOD_0F2B_PREFIX_1
) },
3209 { MOD_TABLE (MOD_0F2B_PREFIX_2
) },
3210 { MOD_TABLE (MOD_0F2B_PREFIX_3
) },
3215 { "cvttps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3216 { "cvttss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3217 { "cvttpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3218 { "cvttsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3223 { "cvtps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3224 { "cvtss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3225 { "cvtpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3226 { "cvtsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3231 { "%XEVucomisYX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3233 { "%XEVucomisYX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3238 { "%XEVcomisYX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3240 { "%XEVcomisYX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3245 { "%XEVsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3246 { "%XEVsqrts%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3247 { "%XEVsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3248 { "%XEVsqrts%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3253 { "Vrsqrtps", { XM
, EXx
}, 0 },
3254 { "Vrsqrtss", { XMScalar
, VexScalar
, EXd
}, 0 },
3259 { "Vrcpps", { XM
, EXx
}, 0 },
3260 { "Vrcpss", { XMScalar
, VexScalar
, EXd
}, 0 },
3265 { "%XEVaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3266 { "%XEVadds%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3267 { "%XEVaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3268 { "%XEVadds%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3273 { "%XEVmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3274 { "%XEVmuls%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3275 { "%XEVmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3276 { "%XEVmuls%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3281 { "%XEVcvtp%XS2pd", { XM
, EXEvexHalfBcstXmmq
, EXxEVexS
}, 0 },
3282 { "%XEVcvts%XS2sd", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3283 { "%XEVcvtp%XD2ps%XY", { XMxmmq
, EXx
, EXxEVexR
}, 0 },
3284 { "%XEVcvts%XD2ss", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3289 { "Vcvtdq2ps", { XM
, EXx
}, 0 },
3290 { "Vcvttps2dq", { XM
, EXx
}, 0 },
3291 { "Vcvtps2dq", { XM
, EXx
}, 0 },
3296 { "%XEVsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3297 { "%XEVsubs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3298 { "%XEVsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3299 { "%XEVsubs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3304 { "%XEVminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3305 { "%XEVmins%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3306 { "%XEVminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3307 { "%XEVmins%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3312 { "%XEVdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3313 { "%XEVdivs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3314 { "%XEVdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3315 { "%XEVdivs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3320 { "%XEVmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3321 { "%XEVmaxs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3322 { "%XEVmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3323 { "%XEVmaxs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3328 { "punpcklbw",{ MX
, EMd
}, PREFIX_OPCODE
},
3330 { "punpcklbw",{ MX
, EMx
}, PREFIX_OPCODE
},
3335 { "punpcklwd",{ MX
, EMd
}, PREFIX_OPCODE
},
3337 { "punpcklwd",{ MX
, EMx
}, PREFIX_OPCODE
},
3342 { "punpckldq",{ MX
, EMd
}, PREFIX_OPCODE
},
3344 { "punpckldq",{ MX
, EMx
}, PREFIX_OPCODE
},
3349 { "movq", { MX
, EM
}, PREFIX_OPCODE
},
3350 { "movdqu", { XM
, EXx
}, PREFIX_OPCODE
},
3351 { "movdqa", { XM
, EXx
}, PREFIX_OPCODE
},
3356 { "pshufw", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
3357 { "pshufhw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3358 { "pshufd", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3359 { "pshuflw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3364 {"vmread", { Em
, Gm
}, 0 },
3366 {"extrq", { XS
, Ib
, Ib
}, 0 },
3367 {"insertq", { XM
, XS
, Ib
, Ib
}, 0 },
3372 {"vmwrite", { Gm
, Em
}, 0 },
3374 {"extrq", { XM
, XS
}, 0 },
3375 {"insertq", { XM
, XS
}, 0 },
3382 { "Vhaddpd", { XM
, Vex
, EXx
}, 0 },
3383 { "Vhaddps", { XM
, Vex
, EXx
}, 0 },
3390 { "Vhsubpd", { XM
, Vex
, EXx
}, 0 },
3391 { "Vhsubps", { XM
, Vex
, EXx
}, 0 },
3396 { "movK", { Edq
, MX
}, PREFIX_OPCODE
},
3397 { "movq", { XM
, EXq
}, PREFIX_OPCODE
},
3398 { "movK", { Edq
, XM
}, PREFIX_OPCODE
},
3403 { "movq", { EMS
, MX
}, PREFIX_OPCODE
},
3404 { "movdqu", { EXxS
, XM
}, PREFIX_OPCODE
},
3405 { "movdqa", { EXxS
, XM
}, PREFIX_OPCODE
},
3408 /* PREFIX_0FAE_REG_0_MOD_3 */
3411 { "rdfsbase", { Ev
}, 0 },
3414 /* PREFIX_0FAE_REG_1_MOD_3 */
3417 { "rdgsbase", { Ev
}, 0 },
3420 /* PREFIX_0FAE_REG_2_MOD_3 */
3423 { "wrfsbase", { Ev
}, 0 },
3426 /* PREFIX_0FAE_REG_3_MOD_3 */
3429 { "wrgsbase", { Ev
}, 0 },
3432 /* PREFIX_0FAE_REG_4_MOD_0 */
3434 { "xsave", { FXSAVE
}, 0 },
3435 { "ptwrite{%LQ|}", { Edq
}, 0 },
3438 /* PREFIX_0FAE_REG_4_MOD_3 */
3441 { "ptwrite{%LQ|}", { Edq
}, 0 },
3444 /* PREFIX_0FAE_REG_5_MOD_3 */
3446 { "lfence", { Skip_MODRM
}, 0 },
3447 { "incsspK", { Edq
}, PREFIX_OPCODE
},
3450 /* PREFIX_0FAE_REG_6_MOD_0 */
3452 { "xsaveopt", { FXSAVE
}, PREFIX_OPCODE
},
3453 { "clrssbsy", { Mq
}, PREFIX_OPCODE
},
3454 { "clwb", { Mb
}, PREFIX_OPCODE
},
3457 /* PREFIX_0FAE_REG_6_MOD_3 */
3459 { RM_TABLE (RM_0FAE_REG_6_MOD_3_P_0
) },
3460 { "umonitor", { Eva
}, PREFIX_OPCODE
},
3461 { "tpause", { Edq
}, PREFIX_OPCODE
},
3462 { "umwait", { Edq
}, PREFIX_OPCODE
},
3465 /* PREFIX_0FAE_REG_7_MOD_0 */
3467 { "clflush", { Mb
}, 0 },
3469 { "clflushopt", { Mb
}, 0 },
3475 { "popcntS", { Gv
, Ev
}, 0 },
3480 { "bsfS", { Gv
, Ev
}, 0 },
3481 { "tzcntS", { Gv
, Ev
}, 0 },
3482 { "bsfS", { Gv
, Ev
}, 0 },
3487 { "bsrS", { Gv
, Ev
}, 0 },
3488 { "lzcntS", { Gv
, Ev
}, 0 },
3489 { "bsrS", { Gv
, Ev
}, 0 },
3494 { "VcmppX", { XM
, Vex
, EXx
, CMP
}, 0 },
3495 { "Vcmpss", { XMScalar
, VexScalar
, EXd
, CMP
}, 0 },
3496 { "VcmppX", { XM
, Vex
, EXx
, CMP
}, 0 },
3497 { "Vcmpsd", { XMScalar
, VexScalar
, EXq
, CMP
}, 0 },
3500 /* PREFIX_0FC7_REG_6_MOD_0 */
3502 { "vmptrld",{ Mq
}, 0 },
3503 { "vmxon", { Mq
}, 0 },
3504 { "vmclear",{ Mq
}, 0 },
3507 /* PREFIX_0FC7_REG_6_MOD_3 */
3509 { "rdrand", { Ev
}, 0 },
3510 { X86_64_TABLE (X86_64_0FC7_REG_6_MOD_3_PREFIX_1
) },
3511 { "rdrand", { Ev
}, 0 }
3514 /* PREFIX_0FC7_REG_7_MOD_3 */
3516 { "rdseed", { Ev
}, 0 },
3517 { "rdpid", { Em
}, 0 },
3518 { "rdseed", { Ev
}, 0 },
3525 { "VaddsubpX", { XM
, Vex
, EXx
}, 0 },
3526 { "VaddsubpX", { XM
, Vex
, EXx
}, 0 },
3532 { "movq2dq",{ XM
, MS
}, 0 },
3533 { "movq", { EXqS
, XM
}, 0 },
3534 { "movdq2q",{ MX
, XS
}, 0 },
3540 { "Vcvtdq2pd", { XM
, EXxmmq
}, 0 },
3541 { "Vcvttpd2dq%XY", { XMM
, EXx
}, 0 },
3542 { "Vcvtpd2dq%XY", { XMM
, EXx
}, 0 },
3547 { "movntq", { Mq
, MX
}, PREFIX_OPCODE
},
3549 { MOD_TABLE (MOD_0FE7_PREFIX_2
) },
3557 { "Vlddqu", { XM
, M
}, 0 },
3562 { "maskmovq", { MX
, MS
}, PREFIX_OPCODE
},
3564 { "maskmovdqu", { XM
, XS
}, PREFIX_OPCODE
},
3570 { REG_TABLE (REG_0F38D8_PREFIX_1
) },
3576 { MOD_TABLE (MOD_0F38DC_PREFIX_1
) },
3577 { "aesenc", { XM
, EXx
}, 0 },
3583 { MOD_TABLE (MOD_0F38DD_PREFIX_1
) },
3584 { "aesenclast", { XM
, EXx
}, 0 },
3590 { MOD_TABLE (MOD_0F38DE_PREFIX_1
) },
3591 { "aesdec", { XM
, EXx
}, 0 },
3597 { MOD_TABLE (MOD_0F38DF_PREFIX_1
) },
3598 { "aesdeclast", { XM
, EXx
}, 0 },
3603 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3605 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3606 { "crc32A", { Gdq
, Eb
}, PREFIX_OPCODE
},
3611 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3613 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3614 { "crc32Q", { Gdq
, Ev
}, PREFIX_OPCODE
},
3619 { MOD_TABLE (MOD_0F38F6_PREFIX_0
) },
3620 { "adoxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3621 { "adcxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3628 { MOD_TABLE (MOD_0F38F8_PREFIX_1
) },
3629 { MOD_TABLE (MOD_0F38F8_PREFIX_2
) },
3630 { MOD_TABLE (MOD_0F38F8_PREFIX_3
) },
3635 { MOD_TABLE (MOD_0F38FA_PREFIX_1
) },
3641 { MOD_TABLE (MOD_0F38FB_PREFIX_1
) },
3646 { "aadd", { Mdq
, Gdq
}, 0 },
3647 { "axor", { Mdq
, Gdq
}, 0 },
3648 { "aand", { Mdq
, Gdq
}, 0 },
3649 { "aor", { Mdq
, Gdq
}, 0 },
3655 { MOD_TABLE (MOD_0F3A0F_PREFIX_1
)},
3658 /* PREFIX_VEX_0F12 */
3660 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0
) },
3661 { "%XEvmov%XSldup", { XM
, EXEvexXNoBcst
}, 0 },
3662 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2
) },
3663 { "%XEvmov%XDdup", { XM
, EXymmq
}, 0 },
3666 /* PREFIX_VEX_0F16 */
3668 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0
) },
3669 { "%XEvmov%XShdup", { XM
, EXEvexXNoBcst
}, 0 },
3670 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2
) },
3673 /* PREFIX_VEX_0F2A */
3676 { "%XEvcvtsi2ssY{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR
, Edq
}, 0 },
3678 { "%XEvcvtsi2sdY{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR64
, Edq
}, 0 },
3681 /* PREFIX_VEX_0F2C */
3684 { "%XEvcvttss2si", { Gdq
, EXd
, EXxEVexS
}, 0 },
3686 { "%XEvcvttsd2si", { Gdq
, EXq
, EXxEVexS
}, 0 },
3689 /* PREFIX_VEX_0F2D */
3692 { "%XEvcvtss2si", { Gdq
, EXd
, EXxEVexR
}, 0 },
3694 { "%XEvcvtsd2si", { Gdq
, EXq
, EXxEVexR
}, 0 },
3697 /* PREFIX_VEX_0F41_L_1_M_1_W_0 */
3699 { "kandw", { MaskG
, MaskVex
, MaskE
}, 0 },
3701 { "kandb", { MaskG
, MaskVex
, MaskE
}, 0 },
3704 /* PREFIX_VEX_0F41_L_1_M_1_W_1 */
3706 { "kandq", { MaskG
, MaskVex
, MaskE
}, 0 },
3708 { "kandd", { MaskG
, MaskVex
, MaskE
}, 0 },
3711 /* PREFIX_VEX_0F42_L_1_M_1_W_0 */
3713 { "kandnw", { MaskG
, MaskVex
, MaskE
}, 0 },
3715 { "kandnb", { MaskG
, MaskVex
, MaskE
}, 0 },
3718 /* PREFIX_VEX_0F42_L_1_M_1_W_1 */
3720 { "kandnq", { MaskG
, MaskVex
, MaskE
}, 0 },
3722 { "kandnd", { MaskG
, MaskVex
, MaskE
}, 0 },
3725 /* PREFIX_VEX_0F44_L_0_M_1_W_0 */
3727 { "knotw", { MaskG
, MaskE
}, 0 },
3729 { "knotb", { MaskG
, MaskE
}, 0 },
3732 /* PREFIX_VEX_0F44_L_0_M_1_W_1 */
3734 { "knotq", { MaskG
, MaskE
}, 0 },
3736 { "knotd", { MaskG
, MaskE
}, 0 },
3739 /* PREFIX_VEX_0F45_L_1_M_1_W_0 */
3741 { "korw", { MaskG
, MaskVex
, MaskE
}, 0 },
3743 { "korb", { MaskG
, MaskVex
, MaskE
}, 0 },
3746 /* PREFIX_VEX_0F45_L_1_M_1_W_1 */
3748 { "korq", { MaskG
, MaskVex
, MaskE
}, 0 },
3750 { "kord", { MaskG
, MaskVex
, MaskE
}, 0 },
3753 /* PREFIX_VEX_0F46_L_1_M_1_W_0 */
3755 { "kxnorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3757 { "kxnorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3760 /* PREFIX_VEX_0F46_L_1_M_1_W_1 */
3762 { "kxnorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3764 { "kxnord", { MaskG
, MaskVex
, MaskE
}, 0 },
3767 /* PREFIX_VEX_0F47_L_1_M_1_W_0 */
3769 { "kxorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3771 { "kxorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3774 /* PREFIX_VEX_0F47_L_1_M_1_W_1 */
3776 { "kxorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3778 { "kxord", { MaskG
, MaskVex
, MaskE
}, 0 },
3781 /* PREFIX_VEX_0F4A_L_1_M_1_W_0 */
3783 { "kaddw", { MaskG
, MaskVex
, MaskE
}, 0 },
3785 { "kaddb", { MaskG
, MaskVex
, MaskE
}, 0 },
3788 /* PREFIX_VEX_0F4A_L_1_M_1_W_1 */
3790 { "kaddq", { MaskG
, MaskVex
, MaskE
}, 0 },
3792 { "kaddd", { MaskG
, MaskVex
, MaskE
}, 0 },
3795 /* PREFIX_VEX_0F4B_L_1_M_1_W_0 */
3797 { "kunpckwd", { MaskG
, MaskVex
, MaskE
}, 0 },
3799 { "kunpckbw", { MaskG
, MaskVex
, MaskE
}, 0 },
3802 /* PREFIX_VEX_0F4B_L_1_M_1_W_1 */
3804 { "kunpckdq", { MaskG
, MaskVex
, MaskE
}, 0 },
3807 /* PREFIX_VEX_0F6F */
3810 { "vmovdqu", { XM
, EXx
}, 0 },
3811 { "vmovdqa", { XM
, EXx
}, 0 },
3814 /* PREFIX_VEX_0F70 */
3817 { "vpshufhw", { XM
, EXx
, Ib
}, 0 },
3818 { "vpshufd", { XM
, EXx
, Ib
}, 0 },
3819 { "vpshuflw", { XM
, EXx
, Ib
}, 0 },
3822 /* PREFIX_VEX_0F7E */
3825 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1
) },
3826 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2
) },
3829 /* PREFIX_VEX_0F7F */
3832 { "vmovdqu", { EXxS
, XM
}, 0 },
3833 { "vmovdqa", { EXxS
, XM
}, 0 },
3836 /* PREFIX_VEX_0F90_L_0_W_0 */
3838 { "kmovw", { MaskG
, MaskE
}, 0 },
3840 { "kmovb", { MaskG
, MaskBDE
}, 0 },
3843 /* PREFIX_VEX_0F90_L_0_W_1 */
3845 { "kmovq", { MaskG
, MaskE
}, 0 },
3847 { "kmovd", { MaskG
, MaskBDE
}, 0 },
3850 /* PREFIX_VEX_0F91_L_0_M_0_W_0 */
3852 { "kmovw", { Ew
, MaskG
}, 0 },
3854 { "kmovb", { Eb
, MaskG
}, 0 },
3857 /* PREFIX_VEX_0F91_L_0_M_0_W_1 */
3859 { "kmovq", { Eq
, MaskG
}, 0 },
3861 { "kmovd", { Ed
, MaskG
}, 0 },
3864 /* PREFIX_VEX_0F92_L_0_M_1_W_0 */
3866 { "kmovw", { MaskG
, Edq
}, 0 },
3868 { "kmovb", { MaskG
, Edq
}, 0 },
3869 { "kmovd", { MaskG
, Edq
}, 0 },
3872 /* PREFIX_VEX_0F92_L_0_M_1_W_1 */
3877 { "kmovK", { MaskG
, Edq
}, 0 },
3880 /* PREFIX_VEX_0F93_L_0_M_1_W_0 */
3882 { "kmovw", { Gdq
, MaskE
}, 0 },
3884 { "kmovb", { Gdq
, MaskE
}, 0 },
3885 { "kmovd", { Gdq
, MaskE
}, 0 },
3888 /* PREFIX_VEX_0F93_L_0_M_1_W_1 */
3893 { "kmovK", { Gdq
, MaskE
}, 0 },
3896 /* PREFIX_VEX_0F98_L_0_M_1_W_0 */
3898 { "kortestw", { MaskG
, MaskE
}, 0 },
3900 { "kortestb", { MaskG
, MaskE
}, 0 },
3903 /* PREFIX_VEX_0F98_L_0_M_1_W_1 */
3905 { "kortestq", { MaskG
, MaskE
}, 0 },
3907 { "kortestd", { MaskG
, MaskE
}, 0 },
3910 /* PREFIX_VEX_0F99_L_0_M_1_W_0 */
3912 { "ktestw", { MaskG
, MaskE
}, 0 },
3914 { "ktestb", { MaskG
, MaskE
}, 0 },
3917 /* PREFIX_VEX_0F99_L_0_M_1_W_1 */
3919 { "ktestq", { MaskG
, MaskE
}, 0 },
3921 { "ktestd", { MaskG
, MaskE
}, 0 },
3924 /* PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_0 */
3926 { "ldtilecfg", { M
}, 0 },
3928 { "sttilecfg", { M
}, 0 },
3931 /* PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_1 */
3933 { REG_TABLE (REG_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0
) },
3936 { RM_TABLE (RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_3
) },
3939 /* PREFIX_VEX_0F384B_X86_64_L_0_W_0_M_0 */
3942 { "tilestored", { MVexSIBMEM
, TMM
}, 0 },
3943 { "tileloaddt1", { TMM
, MVexSIBMEM
}, 0 },
3944 { "tileloadd", { TMM
, MVexSIBMEM
}, 0 },
3947 /* PREFIX_VEX_0F3850_W_0 */
3949 { "vpdpbuud", { XM
, Vex
, EXx
}, 0 },
3950 { "vpdpbsud", { XM
, Vex
, EXx
}, 0 },
3951 { "%XVvpdpbusd", { XM
, Vex
, EXx
}, 0 },
3952 { "vpdpbssd", { XM
, Vex
, EXx
}, 0 },
3955 /* PREFIX_VEX_0F3851_W_0 */
3957 { "vpdpbuuds", { XM
, Vex
, EXx
}, 0 },
3958 { "vpdpbsuds", { XM
, Vex
, EXx
}, 0 },
3959 { "%XVvpdpbusds", { XM
, Vex
, EXx
}, 0 },
3960 { "vpdpbssds", { XM
, Vex
, EXx
}, 0 },
3962 /* PREFIX_VEX_0F385C_X86_64_M_1_L_0_W_0 */
3965 { "tdpbf16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
3967 { "tdpfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
3970 /* PREFIX_VEX_0F385E_X86_64_M_1_L_0_W_0 */
3972 { "tdpbuud", {TMM
, EXtmm
, VexTmm
}, 0 },
3973 { "tdpbsud", {TMM
, EXtmm
, VexTmm
}, 0 },
3974 { "tdpbusd", {TMM
, EXtmm
, VexTmm
}, 0 },
3975 { "tdpbssd", {TMM
, EXtmm
, VexTmm
}, 0 },
3978 /* PREFIX_VEX_0F386C_X86_64_M_1_L_0_W_0 */
3980 { "tcmmrlfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
3982 { "tcmmimfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
3985 /* PREFIX_VEX_0F3872 */
3988 { VEX_W_TABLE (VEX_W_0F3872_P_1
) },
3991 /* PREFIX_VEX_0F38B0_W_0 */
3993 { "vcvtneoph2ps", { XM
, Mx
}, 0 },
3994 { "vcvtneebf162ps", { XM
, Mx
}, 0 },
3995 { "vcvtneeph2ps", { XM
, Mx
}, 0 },
3996 { "vcvtneobf162ps", { XM
, Mx
}, 0 },
3999 /* PREFIX_VEX_0F38B1_W_0 */
4002 { "vbcstnebf162ps", { XM
, Mw
}, 0 },
4003 { "vbcstnesh2ps", { XM
, Mw
}, 0 },
4006 /* PREFIX_VEX_0F38F5_L_0 */
4008 { "bzhiS", { Gdq
, Edq
, VexGdq
}, 0 },
4009 { "pextS", { Gdq
, VexGdq
, Edq
}, 0 },
4011 { "pdepS", { Gdq
, VexGdq
, Edq
}, 0 },
4014 /* PREFIX_VEX_0F38F6_L_0 */
4019 { "mulxS", { Gdq
, VexGdq
, Edq
}, 0 },
4022 /* PREFIX_VEX_0F38F7_L_0 */
4024 { "bextrS", { Gdq
, Edq
, VexGdq
}, 0 },
4025 { "sarxS", { Gdq
, Edq
, VexGdq
}, 0 },
4026 { "shlxS", { Gdq
, Edq
, VexGdq
}, 0 },
4027 { "shrxS", { Gdq
, Edq
, VexGdq
}, 0 },
4030 /* PREFIX_VEX_0F3AF0_L_0 */
4035 { "rorxS", { Gdq
, Edq
, Ib
}, 0 },
4038 #include "i386-dis-evex-prefix.h"
4041 static const struct dis386 x86_64_table
[][2] = {
4044 { "pushP", { es
}, 0 },
4049 { "popP", { es
}, 0 },
4054 { "pushP", { cs
}, 0 },
4059 { "pushP", { ss
}, 0 },
4064 { "popP", { ss
}, 0 },
4069 { "pushP", { ds
}, 0 },
4074 { "popP", { ds
}, 0 },
4079 { "daa", { XX
}, 0 },
4084 { "das", { XX
}, 0 },
4089 { "aaa", { XX
}, 0 },
4094 { "aas", { XX
}, 0 },
4099 { "pushaP", { XX
}, 0 },
4104 { "popaP", { XX
}, 0 },
4109 { MOD_TABLE (MOD_62_32BIT
) },
4110 { EVEX_TABLE (EVEX_0F
) },
4115 { "arpl", { Ew
, Gw
}, 0 },
4116 { "movs", { Gv
, { MOVSXD_Fixup
, movsxd_mode
} }, 0 },
4121 { "ins{R|}", { Yzr
, indirDX
}, 0 },
4122 { "ins{G|}", { Yzr
, indirDX
}, 0 },
4127 { "outs{R|}", { indirDXr
, Xz
}, 0 },
4128 { "outs{G|}", { indirDXr
, Xz
}, 0 },
4133 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
4134 { REG_TABLE (REG_80
) },
4139 { "{l|}call{P|}", { Ap
}, 0 },
4144 { "retP", { Iw
, BND
}, 0 },
4145 { "ret@", { Iw
, BND
}, 0 },
4150 { "retP", { BND
}, 0 },
4151 { "ret@", { BND
}, 0 },
4156 { MOD_TABLE (MOD_C4_32BIT
) },
4157 { VEX_C4_TABLE (VEX_0F
) },
4162 { MOD_TABLE (MOD_C5_32BIT
) },
4163 { VEX_C5_TABLE (VEX_0F
) },
4168 { "into", { XX
}, 0 },
4173 { "aam", { Ib
}, 0 },
4178 { "aad", { Ib
}, 0 },
4183 { "callP", { Jv
, BND
}, 0 },
4184 { "call@", { Jv
, BND
}, 0 }
4189 { "jmpP", { Jv
, BND
}, 0 },
4190 { "jmp@", { Jv
, BND
}, 0 }
4195 { "{l|}jmp{P|}", { Ap
}, 0 },
4198 /* X86_64_0F00_REG_6 */
4201 { PREFIX_TABLE (PREFIX_0F00_REG_6_X86_64
) },
4204 /* X86_64_0F01_REG_0 */
4206 { "sgdt{Q|Q}", { M
}, 0 },
4207 { "sgdt", { M
}, 0 },
4210 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_1 */
4213 { "wrmsrlist", { Skip_MODRM
}, 0 },
4216 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_3 */
4219 { "rdmsrlist", { Skip_MODRM
}, 0 },
4222 /* X86_64_0F01_REG_1 */
4224 { "sidt{Q|Q}", { M
}, 0 },
4225 { "sidt", { M
}, 0 },
4228 /* X86_64_0F01_REG_1_RM_2_PREFIX_1 */
4231 { "eretu", { Skip_MODRM
}, 0 },
4234 /* X86_64_0F01_REG_1_RM_2_PREFIX_3 */
4237 { "erets", { Skip_MODRM
}, 0 },
4240 /* X86_64_0F01_REG_1_RM_5_PREFIX_2 */
4243 { "seamret", { Skip_MODRM
}, 0 },
4246 /* X86_64_0F01_REG_1_RM_6_PREFIX_2 */
4249 { "seamops", { Skip_MODRM
}, 0 },
4252 /* X86_64_0F01_REG_1_RM_7_PREFIX_2 */
4255 { "seamcall", { Skip_MODRM
}, 0 },
4258 /* X86_64_0F01_REG_2 */
4260 { "lgdt{Q|Q}", { M
}, 0 },
4261 { "lgdt", { M
}, 0 },
4264 /* X86_64_0F01_REG_3 */
4266 { "lidt{Q|Q}", { M
}, 0 },
4267 { "lidt", { M
}, 0 },
4270 /* X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1 */
4273 { "uiret", { Skip_MODRM
}, 0 },
4276 /* X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1 */
4279 { "testui", { Skip_MODRM
}, 0 },
4282 /* X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1 */
4285 { "clui", { Skip_MODRM
}, 0 },
4288 /* X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1 */
4291 { "stui", { Skip_MODRM
}, 0 },
4294 /* X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1 */
4297 { "rmpquery", { Skip_MODRM
}, 0 },
4300 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1 */
4303 { "rmpadjust", { Skip_MODRM
}, 0 },
4306 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3 */
4309 { "rmpupdate", { Skip_MODRM
}, 0 },
4312 /* X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1 */
4315 { "psmash", { Skip_MODRM
}, 0 },
4318 /* X86_64_0F18_REG_6_MOD_0 */
4320 { "nopQ", { Ev
}, 0 },
4321 { PREFIX_TABLE (PREFIX_0F18_REG_6_MOD_0_X86_64
) },
4324 /* X86_64_0F18_REG_7_MOD_0 */
4326 { "nopQ", { Ev
}, 0 },
4327 { PREFIX_TABLE (PREFIX_0F18_REG_7_MOD_0_X86_64
) },
4332 { "movZ", { Em
, Td
}, 0 },
4337 { "movZ", { Td
, Em
}, 0 },
4340 /* X86_64_0FC7_REG_6_MOD_3_PREFIX_1 */
4343 { "senduipi", { Eq
}, 0 },
4346 /* X86_64_VEX_0F3849 */
4349 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64
) },
4352 /* X86_64_VEX_0F384B */
4355 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64
) },
4358 /* X86_64_VEX_0F385C */
4361 { MOD_TABLE (MOD_VEX_0F385C_X86_64
) },
4364 /* X86_64_VEX_0F385E */
4367 { MOD_TABLE (MOD_VEX_0F385E_X86_64
) },
4370 /* X86_64_VEX_0F386C */
4373 { MOD_TABLE (MOD_VEX_0F386C_X86_64
) },
4376 /* X86_64_VEX_0F38E0 */
4379 { "cmpoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4382 /* X86_64_VEX_0F38E1 */
4385 { "cmpnoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4388 /* X86_64_VEX_0F38E2 */
4391 { "cmpbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4394 /* X86_64_VEX_0F38E3 */
4397 { "cmpnbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4400 /* X86_64_VEX_0F38E4 */
4403 { "cmpzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4406 /* X86_64_VEX_0F38E5 */
4409 { "cmpnzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4412 /* X86_64_VEX_0F38E6 */
4415 { "cmpbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4418 /* X86_64_VEX_0F38E7 */
4421 { "cmpnbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4424 /* X86_64_VEX_0F38E8 */
4427 { "cmpsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4430 /* X86_64_VEX_0F38E9 */
4433 { "cmpnsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4436 /* X86_64_VEX_0F38EA */
4439 { "cmppxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4442 /* X86_64_VEX_0F38EB */
4445 { "cmpnpxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4448 /* X86_64_VEX_0F38EC */
4451 { "cmplxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4454 /* X86_64_VEX_0F38ED */
4457 { "cmpnlxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4460 /* X86_64_VEX_0F38EE */
4463 { "cmplexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4466 /* X86_64_VEX_0F38EF */
4469 { "cmpnlexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4473 static const struct dis386 three_byte_table
[][256] = {
4475 /* THREE_BYTE_0F38 */
4478 { "pshufb", { MX
, EM
}, PREFIX_OPCODE
},
4479 { "phaddw", { MX
, EM
}, PREFIX_OPCODE
},
4480 { "phaddd", { MX
, EM
}, PREFIX_OPCODE
},
4481 { "phaddsw", { MX
, EM
}, PREFIX_OPCODE
},
4482 { "pmaddubsw", { MX
, EM
}, PREFIX_OPCODE
},
4483 { "phsubw", { MX
, EM
}, PREFIX_OPCODE
},
4484 { "phsubd", { MX
, EM
}, PREFIX_OPCODE
},
4485 { "phsubsw", { MX
, EM
}, PREFIX_OPCODE
},
4487 { "psignb", { MX
, EM
}, PREFIX_OPCODE
},
4488 { "psignw", { MX
, EM
}, PREFIX_OPCODE
},
4489 { "psignd", { MX
, EM
}, PREFIX_OPCODE
},
4490 { "pmulhrsw", { MX
, EM
}, PREFIX_OPCODE
},
4496 { "pblendvb", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4500 { "blendvps", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4501 { "blendvpd", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4503 { "ptest", { XM
, EXx
}, PREFIX_DATA
},
4509 { "pabsb", { MX
, EM
}, PREFIX_OPCODE
},
4510 { "pabsw", { MX
, EM
}, PREFIX_OPCODE
},
4511 { "pabsd", { MX
, EM
}, PREFIX_OPCODE
},
4514 { "pmovsxbw", { XM
, EXq
}, PREFIX_DATA
},
4515 { "pmovsxbd", { XM
, EXd
}, PREFIX_DATA
},
4516 { "pmovsxbq", { XM
, EXw
}, PREFIX_DATA
},
4517 { "pmovsxwd", { XM
, EXq
}, PREFIX_DATA
},
4518 { "pmovsxwq", { XM
, EXd
}, PREFIX_DATA
},
4519 { "pmovsxdq", { XM
, EXq
}, PREFIX_DATA
},
4523 { "pmuldq", { XM
, EXx
}, PREFIX_DATA
},
4524 { "pcmpeqq", { XM
, EXx
}, PREFIX_DATA
},
4525 { MOD_TABLE (MOD_0F382A
) },
4526 { "packusdw", { XM
, EXx
}, PREFIX_DATA
},
4532 { "pmovzxbw", { XM
, EXq
}, PREFIX_DATA
},
4533 { "pmovzxbd", { XM
, EXd
}, PREFIX_DATA
},
4534 { "pmovzxbq", { XM
, EXw
}, PREFIX_DATA
},
4535 { "pmovzxwd", { XM
, EXq
}, PREFIX_DATA
},
4536 { "pmovzxwq", { XM
, EXd
}, PREFIX_DATA
},
4537 { "pmovzxdq", { XM
, EXq
}, PREFIX_DATA
},
4539 { "pcmpgtq", { XM
, EXx
}, PREFIX_DATA
},
4541 { "pminsb", { XM
, EXx
}, PREFIX_DATA
},
4542 { "pminsd", { XM
, EXx
}, PREFIX_DATA
},
4543 { "pminuw", { XM
, EXx
}, PREFIX_DATA
},
4544 { "pminud", { XM
, EXx
}, PREFIX_DATA
},
4545 { "pmaxsb", { XM
, EXx
}, PREFIX_DATA
},
4546 { "pmaxsd", { XM
, EXx
}, PREFIX_DATA
},
4547 { "pmaxuw", { XM
, EXx
}, PREFIX_DATA
},
4548 { "pmaxud", { XM
, EXx
}, PREFIX_DATA
},
4550 { "pmulld", { XM
, EXx
}, PREFIX_DATA
},
4551 { "phminposuw", { XM
, EXx
}, PREFIX_DATA
},
4622 { "invept", { Gm
, Mo
}, PREFIX_DATA
},
4623 { "invvpid", { Gm
, Mo
}, PREFIX_DATA
},
4624 { "invpcid", { Gm
, M
}, PREFIX_DATA
},
4703 { "sha1nexte", { XM
, EXxmm
}, PREFIX_OPCODE
},
4704 { "sha1msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4705 { "sha1msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4706 { "sha256rnds2", { XM
, EXxmm
, XMM0
}, PREFIX_OPCODE
},
4707 { "sha256msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4708 { "sha256msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4710 { "gf2p8mulb", { XM
, EXxmm
}, PREFIX_DATA
},
4721 { PREFIX_TABLE (PREFIX_0F38D8
) },
4724 { "aesimc", { XM
, EXx
}, PREFIX_DATA
},
4725 { PREFIX_TABLE (PREFIX_0F38DC
) },
4726 { PREFIX_TABLE (PREFIX_0F38DD
) },
4727 { PREFIX_TABLE (PREFIX_0F38DE
) },
4728 { PREFIX_TABLE (PREFIX_0F38DF
) },
4748 { PREFIX_TABLE (PREFIX_0F38F0
) },
4749 { PREFIX_TABLE (PREFIX_0F38F1
) },
4753 { MOD_TABLE (MOD_0F38F5
) },
4754 { PREFIX_TABLE (PREFIX_0F38F6
) },
4757 { PREFIX_TABLE (PREFIX_0F38F8
) },
4758 { MOD_TABLE (MOD_0F38F9
) },
4759 { PREFIX_TABLE (PREFIX_0F38FA
) },
4760 { PREFIX_TABLE (PREFIX_0F38FB
) },
4761 { PREFIX_TABLE (PREFIX_0F38FC
) },
4766 /* THREE_BYTE_0F3A */
4778 { "roundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4779 { "roundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4780 { "roundss", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4781 { "roundsd", { XM
, EXq
, Ib
}, PREFIX_DATA
},
4782 { "blendps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4783 { "blendpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4784 { "pblendw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4785 { "palignr", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
4791 { "pextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
4792 { "pextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
4793 { "pextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
4794 { "extractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
4805 { "pinsrb", { XM
, Edb
, Ib
}, PREFIX_DATA
},
4806 { "insertps", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4807 { "pinsrK", { XM
, Edq
, Ib
}, PREFIX_DATA
},
4841 { "dpps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4842 { "dppd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4843 { "mpsadbw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4845 { "pclmulqdq", { XM
, EXx
, PCLMUL
}, PREFIX_DATA
},
4877 { "pcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4878 { "pcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4879 { "pcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4880 { "pcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4998 { "sha1rnds4", { XM
, EXxmm
, Ib
}, PREFIX_OPCODE
},
5000 { "gf2p8affineqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5001 { "gf2p8affineinvqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5019 { "aeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5039 { PREFIX_TABLE (PREFIX_0F3A0F
) },
5059 static const struct dis386 xop_table
[][256] = {
5212 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_85
) },
5213 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_86
) },
5214 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_87
) },
5222 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8E
) },
5223 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8F
) },
5230 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_95
) },
5231 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_96
) },
5232 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_97
) },
5240 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9E
) },
5241 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9F
) },
5245 { "vpcmov", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
5246 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A3
) },
5249 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A6
) },
5267 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_B6
) },
5279 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C0
) },
5280 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C1
) },
5281 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C2
) },
5282 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C3
) },
5292 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC
) },
5293 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD
) },
5294 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE
) },
5295 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF
) },
5328 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC
) },
5329 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED
) },
5330 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE
) },
5331 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF
) },
5355 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_01
) },
5356 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_02
) },
5374 { MOD_TABLE (MOD_XOP_09_12
) },
5498 { VEX_W_TABLE (VEX_W_0FXOP_09_80
) },
5499 { VEX_W_TABLE (VEX_W_0FXOP_09_81
) },
5500 { VEX_W_TABLE (VEX_W_0FXOP_09_82
) },
5501 { VEX_W_TABLE (VEX_W_0FXOP_09_83
) },
5516 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_90
) },
5517 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_91
) },
5518 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_92
) },
5519 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_93
) },
5520 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_94
) },
5521 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_95
) },
5522 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_96
) },
5523 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_97
) },
5525 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_98
) },
5526 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_99
) },
5527 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9A
) },
5528 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9B
) },
5571 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C1
) },
5572 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C2
) },
5573 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C3
) },
5576 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C6
) },
5577 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C7
) },
5582 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_CB
) },
5589 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D1
) },
5590 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D2
) },
5591 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D3
) },
5594 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D6
) },
5595 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D7
) },
5600 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_DB
) },
5607 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E1
) },
5608 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E2
) },
5609 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E3
) },
5663 { "bextrS", { Gdq
, Edq
, Id
}, 0 },
5665 { VEX_LEN_TABLE (VEX_LEN_0FXOP_0A_12
) },
5935 static const struct dis386 vex_table
[][256] = {
5957 { PREFIX_TABLE (PREFIX_0F10
) },
5958 { PREFIX_TABLE (PREFIX_0F11
) },
5959 { PREFIX_TABLE (PREFIX_VEX_0F12
) },
5960 { VEX_LEN_TABLE (VEX_LEN_0F13
) },
5961 { "vunpcklpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
5962 { "vunpckhpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
5963 { PREFIX_TABLE (PREFIX_VEX_0F16
) },
5964 { VEX_LEN_TABLE (VEX_LEN_0F17
) },
5984 { "vmovapX", { XM
, EXx
}, PREFIX_OPCODE
},
5985 { "vmovapX", { EXxS
, XM
}, PREFIX_OPCODE
},
5986 { PREFIX_TABLE (PREFIX_VEX_0F2A
) },
5987 { MOD_TABLE (MOD_VEX_0F2B
) },
5988 { PREFIX_TABLE (PREFIX_VEX_0F2C
) },
5989 { PREFIX_TABLE (PREFIX_VEX_0F2D
) },
5990 { PREFIX_TABLE (PREFIX_0F2E
) },
5991 { PREFIX_TABLE (PREFIX_0F2F
) },
6012 { VEX_LEN_TABLE (VEX_LEN_0F41
) },
6013 { VEX_LEN_TABLE (VEX_LEN_0F42
) },
6015 { VEX_LEN_TABLE (VEX_LEN_0F44
) },
6016 { VEX_LEN_TABLE (VEX_LEN_0F45
) },
6017 { VEX_LEN_TABLE (VEX_LEN_0F46
) },
6018 { VEX_LEN_TABLE (VEX_LEN_0F47
) },
6022 { VEX_LEN_TABLE (VEX_LEN_0F4A
) },
6023 { VEX_LEN_TABLE (VEX_LEN_0F4B
) },
6029 { MOD_TABLE (MOD_0F50
) },
6030 { PREFIX_TABLE (PREFIX_0F51
) },
6031 { PREFIX_TABLE (PREFIX_0F52
) },
6032 { PREFIX_TABLE (PREFIX_0F53
) },
6033 { "vandpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6034 { "vandnpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6035 { "vorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6036 { "vxorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6038 { PREFIX_TABLE (PREFIX_0F58
) },
6039 { PREFIX_TABLE (PREFIX_0F59
) },
6040 { PREFIX_TABLE (PREFIX_0F5A
) },
6041 { PREFIX_TABLE (PREFIX_0F5B
) },
6042 { PREFIX_TABLE (PREFIX_0F5C
) },
6043 { PREFIX_TABLE (PREFIX_0F5D
) },
6044 { PREFIX_TABLE (PREFIX_0F5E
) },
6045 { PREFIX_TABLE (PREFIX_0F5F
) },
6047 { "vpunpcklbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6048 { "vpunpcklwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6049 { "vpunpckldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6050 { "vpacksswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6051 { "vpcmpgtb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6052 { "vpcmpgtw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6053 { "vpcmpgtd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6054 { "vpackuswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6056 { "vpunpckhbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6057 { "vpunpckhwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6058 { "vpunpckhdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6059 { "vpackssdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6060 { "vpunpcklqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6061 { "vpunpckhqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6062 { VEX_LEN_TABLE (VEX_LEN_0F6E
) },
6063 { PREFIX_TABLE (PREFIX_VEX_0F6F
) },
6065 { PREFIX_TABLE (PREFIX_VEX_0F70
) },
6066 { MOD_TABLE (MOD_VEX_0F71
) },
6067 { MOD_TABLE (MOD_VEX_0F72
) },
6068 { MOD_TABLE (MOD_VEX_0F73
) },
6069 { "vpcmpeqb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6070 { "vpcmpeqw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6071 { "vpcmpeqd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6072 { VEX_LEN_TABLE (VEX_LEN_0F77
) },
6078 { PREFIX_TABLE (PREFIX_0F7C
) },
6079 { PREFIX_TABLE (PREFIX_0F7D
) },
6080 { PREFIX_TABLE (PREFIX_VEX_0F7E
) },
6081 { PREFIX_TABLE (PREFIX_VEX_0F7F
) },
6101 { VEX_LEN_TABLE (VEX_LEN_0F90
) },
6102 { VEX_LEN_TABLE (VEX_LEN_0F91
) },
6103 { VEX_LEN_TABLE (VEX_LEN_0F92
) },
6104 { VEX_LEN_TABLE (VEX_LEN_0F93
) },
6110 { VEX_LEN_TABLE (VEX_LEN_0F98
) },
6111 { VEX_LEN_TABLE (VEX_LEN_0F99
) },
6134 { REG_TABLE (REG_VEX_0FAE
) },
6157 { PREFIX_TABLE (PREFIX_0FC2
) },
6159 { VEX_LEN_TABLE (VEX_LEN_0FC4
) },
6160 { VEX_LEN_TABLE (VEX_LEN_0FC5
) },
6161 { "vshufpX", { XM
, Vex
, EXx
, Ib
}, PREFIX_OPCODE
},
6173 { PREFIX_TABLE (PREFIX_0FD0
) },
6174 { "vpsrlw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6175 { "vpsrld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6176 { "vpsrlq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6177 { "vpaddq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6178 { "vpmullw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6179 { VEX_LEN_TABLE (VEX_LEN_0FD6
) },
6180 { MOD_TABLE (MOD_VEX_0FD7
) },
6182 { "vpsubusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6183 { "vpsubusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6184 { "vpminub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6185 { "vpand", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6186 { "vpaddusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6187 { "vpaddusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6188 { "vpmaxub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6189 { "vpandn", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6191 { "vpavgb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6192 { "vpsraw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6193 { "vpsrad", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6194 { "vpavgw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6195 { "vpmulhuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6196 { "vpmulhw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6197 { PREFIX_TABLE (PREFIX_0FE6
) },
6198 { MOD_TABLE (MOD_VEX_0FE7
) },
6200 { "vpsubsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6201 { "vpsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6202 { "vpminsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6203 { "vpor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6204 { "vpaddsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6205 { "vpaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6206 { "vpmaxsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6207 { "vpxor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6209 { PREFIX_TABLE (PREFIX_0FF0
) },
6210 { "vpsllw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6211 { "vpslld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6212 { "vpsllq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6213 { "vpmuludq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6214 { "vpmaddwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6215 { "vpsadbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6216 { VEX_LEN_TABLE (VEX_LEN_0FF7
) },
6218 { "vpsubb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6219 { "vpsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6220 { "vpsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6221 { "vpsubq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6222 { "vpaddb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6223 { "vpaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6224 { "vpaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6230 { "vpshufb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6231 { "vphaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6232 { "vphaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6233 { "vphaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6234 { "vpmaddubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6235 { "vphsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6236 { "vphsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6237 { "vphsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6239 { "vpsignb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6240 { "vpsignw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6241 { "vpsignd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6242 { "vpmulhrsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6243 { VEX_W_TABLE (VEX_W_0F380C
) },
6244 { VEX_W_TABLE (VEX_W_0F380D
) },
6245 { VEX_W_TABLE (VEX_W_0F380E
) },
6246 { VEX_W_TABLE (VEX_W_0F380F
) },
6251 { VEX_W_TABLE (VEX_W_0F3813
) },
6254 { VEX_LEN_TABLE (VEX_LEN_0F3816
) },
6255 { "vptest", { XM
, EXx
}, PREFIX_DATA
},
6257 { VEX_W_TABLE (VEX_W_0F3818
) },
6258 { VEX_LEN_TABLE (VEX_LEN_0F3819
) },
6259 { MOD_TABLE (MOD_VEX_0F381A
) },
6261 { "vpabsb", { XM
, EXx
}, PREFIX_DATA
},
6262 { "vpabsw", { XM
, EXx
}, PREFIX_DATA
},
6263 { "vpabsd", { XM
, EXx
}, PREFIX_DATA
},
6266 { "vpmovsxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6267 { "vpmovsxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6268 { "vpmovsxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6269 { "vpmovsxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6270 { "vpmovsxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6271 { "vpmovsxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6275 { "vpmuldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6276 { "vpcmpeqq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6277 { MOD_TABLE (MOD_VEX_0F382A
) },
6278 { "vpackusdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6279 { MOD_TABLE (MOD_VEX_0F382C
) },
6280 { MOD_TABLE (MOD_VEX_0F382D
) },
6281 { MOD_TABLE (MOD_VEX_0F382E
) },
6282 { MOD_TABLE (MOD_VEX_0F382F
) },
6284 { "vpmovzxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6285 { "vpmovzxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6286 { "vpmovzxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6287 { "vpmovzxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6288 { "vpmovzxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6289 { "vpmovzxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6290 { VEX_LEN_TABLE (VEX_LEN_0F3836
) },
6291 { "vpcmpgtq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6293 { "vpminsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6294 { "vpminsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6295 { "vpminuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6296 { "vpminud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6297 { "vpmaxsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6298 { "vpmaxsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6299 { "vpmaxuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6300 { "vpmaxud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6302 { "vpmulld", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6303 { VEX_LEN_TABLE (VEX_LEN_0F3841
) },
6307 { "vpsrlv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6308 { VEX_W_TABLE (VEX_W_0F3846
) },
6309 { "vpsllv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6312 { X86_64_TABLE (X86_64_VEX_0F3849
) },
6314 { X86_64_TABLE (X86_64_VEX_0F384B
) },
6320 { VEX_W_TABLE (VEX_W_0F3850
) },
6321 { VEX_W_TABLE (VEX_W_0F3851
) },
6322 { VEX_W_TABLE (VEX_W_0F3852
) },
6323 { VEX_W_TABLE (VEX_W_0F3853
) },
6329 { VEX_W_TABLE (VEX_W_0F3858
) },
6330 { VEX_W_TABLE (VEX_W_0F3859
) },
6331 { MOD_TABLE (MOD_VEX_0F385A
) },
6333 { X86_64_TABLE (X86_64_VEX_0F385C
) },
6335 { X86_64_TABLE (X86_64_VEX_0F385E
) },
6351 { X86_64_TABLE (X86_64_VEX_0F386C
) },
6358 { PREFIX_TABLE (PREFIX_VEX_0F3872
) },
6365 { VEX_W_TABLE (VEX_W_0F3878
) },
6366 { VEX_W_TABLE (VEX_W_0F3879
) },
6387 { MOD_TABLE (MOD_VEX_0F388C
) },
6389 { MOD_TABLE (MOD_VEX_0F388E
) },
6392 { "vpgatherd%DQ", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6393 { "vpgatherq%DQ", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6394 { "vgatherdp%XW", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6395 { "vgatherqp%XW", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6398 { "vfmaddsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6399 { "vfmsubadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6401 { "vfmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6402 { "vfmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6403 { "vfmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6404 { "vfmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6405 { "vfnmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6406 { "vfnmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6407 { "vfnmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6408 { "vfnmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6416 { "vfmaddsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6417 { "vfmsubadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6419 { "vfmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6420 { "vfmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6421 { "vfmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6422 { "vfmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6423 { "vfnmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6424 { "vfnmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6425 { "vfnmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6426 { "vfnmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6428 { VEX_W_TABLE (VEX_W_0F38B0
) },
6429 { VEX_W_TABLE (VEX_W_0F38B1
) },
6432 { VEX_W_TABLE (VEX_W_0F38B4
) },
6433 { VEX_W_TABLE (VEX_W_0F38B5
) },
6434 { "vfmaddsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6435 { "vfmsubadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6437 { "vfmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6438 { "vfmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6439 { "vfmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6440 { "vfmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6441 { "vfnmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6442 { "vfnmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6443 { "vfnmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6444 { "vfnmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6462 { VEX_W_TABLE (VEX_W_0F38CF
) },
6476 { VEX_LEN_TABLE (VEX_LEN_0F38DB
) },
6477 { "vaesenc", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6478 { "vaesenclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6479 { "vaesdec", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6480 { "vaesdeclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6482 { X86_64_TABLE (X86_64_VEX_0F38E0
) },
6483 { X86_64_TABLE (X86_64_VEX_0F38E1
) },
6484 { X86_64_TABLE (X86_64_VEX_0F38E2
) },
6485 { X86_64_TABLE (X86_64_VEX_0F38E3
) },
6486 { X86_64_TABLE (X86_64_VEX_0F38E4
) },
6487 { X86_64_TABLE (X86_64_VEX_0F38E5
) },
6488 { X86_64_TABLE (X86_64_VEX_0F38E6
) },
6489 { X86_64_TABLE (X86_64_VEX_0F38E7
) },
6491 { X86_64_TABLE (X86_64_VEX_0F38E8
) },
6492 { X86_64_TABLE (X86_64_VEX_0F38E9
) },
6493 { X86_64_TABLE (X86_64_VEX_0F38EA
) },
6494 { X86_64_TABLE (X86_64_VEX_0F38EB
) },
6495 { X86_64_TABLE (X86_64_VEX_0F38EC
) },
6496 { X86_64_TABLE (X86_64_VEX_0F38ED
) },
6497 { X86_64_TABLE (X86_64_VEX_0F38EE
) },
6498 { X86_64_TABLE (X86_64_VEX_0F38EF
) },
6502 { VEX_LEN_TABLE (VEX_LEN_0F38F2
) },
6503 { VEX_LEN_TABLE (VEX_LEN_0F38F3
) },
6505 { VEX_LEN_TABLE (VEX_LEN_0F38F5
) },
6506 { VEX_LEN_TABLE (VEX_LEN_0F38F6
) },
6507 { VEX_LEN_TABLE (VEX_LEN_0F38F7
) },
6521 { VEX_LEN_TABLE (VEX_LEN_0F3A00
) },
6522 { VEX_LEN_TABLE (VEX_LEN_0F3A01
) },
6523 { VEX_W_TABLE (VEX_W_0F3A02
) },
6525 { VEX_W_TABLE (VEX_W_0F3A04
) },
6526 { VEX_W_TABLE (VEX_W_0F3A05
) },
6527 { VEX_LEN_TABLE (VEX_LEN_0F3A06
) },
6530 { "vroundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6531 { "vroundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6532 { "vroundss", { XMScalar
, VexScalar
, EXd
, Ib
}, PREFIX_DATA
},
6533 { "vroundsd", { XMScalar
, VexScalar
, EXq
, Ib
}, PREFIX_DATA
},
6534 { "vblendps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6535 { "vblendpd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6536 { "vpblendw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6537 { "vpalignr", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6543 { VEX_LEN_TABLE (VEX_LEN_0F3A14
) },
6544 { VEX_LEN_TABLE (VEX_LEN_0F3A15
) },
6545 { VEX_LEN_TABLE (VEX_LEN_0F3A16
) },
6546 { VEX_LEN_TABLE (VEX_LEN_0F3A17
) },
6548 { VEX_LEN_TABLE (VEX_LEN_0F3A18
) },
6549 { VEX_LEN_TABLE (VEX_LEN_0F3A19
) },
6553 { VEX_W_TABLE (VEX_W_0F3A1D
) },
6557 { VEX_LEN_TABLE (VEX_LEN_0F3A20
) },
6558 { VEX_LEN_TABLE (VEX_LEN_0F3A21
) },
6559 { VEX_LEN_TABLE (VEX_LEN_0F3A22
) },
6575 { VEX_LEN_TABLE (VEX_LEN_0F3A30
) },
6576 { VEX_LEN_TABLE (VEX_LEN_0F3A31
) },
6577 { VEX_LEN_TABLE (VEX_LEN_0F3A32
) },
6578 { VEX_LEN_TABLE (VEX_LEN_0F3A33
) },
6584 { VEX_LEN_TABLE (VEX_LEN_0F3A38
) },
6585 { VEX_LEN_TABLE (VEX_LEN_0F3A39
) },
6593 { "vdpps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6594 { VEX_LEN_TABLE (VEX_LEN_0F3A41
) },
6595 { "vmpsadbw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6597 { "vpclmulqdq", { XM
, Vex
, EXx
, PCLMUL
}, PREFIX_DATA
},
6599 { VEX_LEN_TABLE (VEX_LEN_0F3A46
) },
6602 { "vpermil2ps", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6603 { "vpermil2pd", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6604 { VEX_W_TABLE (VEX_W_0F3A4A
) },
6605 { VEX_W_TABLE (VEX_W_0F3A4B
) },
6606 { VEX_W_TABLE (VEX_W_0F3A4C
) },
6624 { "vfmaddsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6625 { "vfmaddsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6626 { "vfmsubaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6627 { "vfmsubaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6629 { VEX_LEN_TABLE (VEX_LEN_0F3A60
) },
6630 { VEX_LEN_TABLE (VEX_LEN_0F3A61
) },
6631 { VEX_LEN_TABLE (VEX_LEN_0F3A62
) },
6632 { VEX_LEN_TABLE (VEX_LEN_0F3A63
) },
6638 { "vfmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6639 { "vfmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6640 { "vfmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6641 { "vfmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6642 { "vfmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6643 { "vfmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6644 { "vfmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6645 { "vfmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6656 { "vfnmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6657 { "vfnmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6658 { "vfnmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6659 { "vfnmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6660 { "vfnmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6661 { "vfnmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6662 { "vfnmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6663 { "vfnmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6752 { VEX_W_TABLE (VEX_W_0F3ACE
) },
6753 { VEX_W_TABLE (VEX_W_0F3ACF
) },
6771 { VEX_LEN_TABLE (VEX_LEN_0F3ADF
) },
6791 { VEX_LEN_TABLE (VEX_LEN_0F3AF0
) },
6811 #include "i386-dis-evex.h"
6813 static const struct dis386 vex_len_table
[][2] = {
6814 /* VEX_LEN_0F12_P_0 */
6816 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
6819 /* VEX_LEN_0F12_P_2 */
6821 { MOD_TABLE (MOD_0F12_PREFIX_2
) },
6826 { MOD_TABLE (MOD_0F13
) },
6829 /* VEX_LEN_0F16_P_0 */
6831 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
6834 /* VEX_LEN_0F16_P_2 */
6836 { MOD_TABLE (MOD_0F16_PREFIX_2
) },
6841 { MOD_TABLE (MOD_0F17
) },
6847 { MOD_TABLE (MOD_VEX_0F41_L_1
) },
6853 { MOD_TABLE (MOD_VEX_0F42_L_1
) },
6858 { MOD_TABLE (MOD_VEX_0F44_L_0
) },
6864 { MOD_TABLE (MOD_VEX_0F45_L_1
) },
6870 { MOD_TABLE (MOD_VEX_0F46_L_1
) },
6876 { MOD_TABLE (MOD_VEX_0F47_L_1
) },
6882 { MOD_TABLE (MOD_VEX_0F4A_L_1
) },
6888 { MOD_TABLE (MOD_VEX_0F4B_L_1
) },
6893 { "%XEvmovYK", { XMScalar
, Edq
}, PREFIX_DATA
},
6898 { "vzeroupper", { XX
}, 0 },
6899 { "vzeroall", { XX
}, 0 },
6902 /* VEX_LEN_0F7E_P_1 */
6904 { "%XEvmovqY", { XMScalar
, EXq
}, 0 },
6907 /* VEX_LEN_0F7E_P_2 */
6909 { "%XEvmovK", { Edq
, XMScalar
}, 0 },
6914 { VEX_W_TABLE (VEX_W_0F90_L_0
) },
6919 { MOD_TABLE (MOD_VEX_0F91_L_0
) },
6924 { MOD_TABLE (MOD_VEX_0F92_L_0
) },
6929 { MOD_TABLE (MOD_VEX_0F93_L_0
) },
6934 { MOD_TABLE (MOD_VEX_0F98_L_0
) },
6939 { MOD_TABLE (MOD_VEX_0F99_L_0
) },
6942 /* VEX_LEN_0FAE_R_2_M_0 */
6944 { "vldmxcsr", { Md
}, 0 },
6947 /* VEX_LEN_0FAE_R_3_M_0 */
6949 { "vstmxcsr", { Md
}, 0 },
6954 { "%XEvpinsrwY", { XM
, Vex
, Edw
, Ib
}, PREFIX_DATA
},
6959 { "%XEvpextrw", { Gd
, XS
, Ib
}, PREFIX_DATA
},
6964 { "%XEvmovqY", { EXqS
, XMScalar
}, PREFIX_DATA
},
6969 { "vmaskmovdqu", { XM
, XS
}, PREFIX_DATA
},
6972 /* VEX_LEN_0F3816 */
6975 { VEX_W_TABLE (VEX_W_0F3816_L_1
) },
6978 /* VEX_LEN_0F3819 */
6981 { VEX_W_TABLE (VEX_W_0F3819_L_1
) },
6984 /* VEX_LEN_0F381A_M_0 */
6987 { VEX_W_TABLE (VEX_W_0F381A_M_0_L_1
) },
6990 /* VEX_LEN_0F3836 */
6993 { VEX_W_TABLE (VEX_W_0F3836
) },
6996 /* VEX_LEN_0F3841 */
6998 { "vphminposuw", { XM
, EXx
}, PREFIX_DATA
},
7001 /* VEX_LEN_0F3849_X86_64 */
7003 { VEX_W_TABLE (VEX_W_0F3849_X86_64_L_0
) },
7006 /* VEX_LEN_0F384B_X86_64 */
7008 { VEX_W_TABLE (VEX_W_0F384B_X86_64_L_0
) },
7011 /* VEX_LEN_0F385A_M_0 */
7014 { VEX_W_TABLE (VEX_W_0F385A_M_0_L_0
) },
7017 /* VEX_LEN_0F385C_X86_64_M_1 */
7019 { VEX_W_TABLE (VEX_W_0F385C_X86_64_M_1_L_0
) },
7022 /* VEX_LEN_0F385E_X86_64_M_1 */
7024 { VEX_W_TABLE (VEX_W_0F385E_X86_64_M_1_L_0
) },
7027 /* VEX_LEN_0F386C_X86_64_M_1 */
7029 { VEX_W_TABLE (VEX_W_0F386C_X86_64_M_1_L_0
) },
7032 /* VEX_LEN_0F38DB */
7034 { "vaesimc", { XM
, EXx
}, PREFIX_DATA
},
7037 /* VEX_LEN_0F38F2 */
7039 { "andnS", { Gdq
, VexGdq
, Edq
}, PREFIX_OPCODE
},
7042 /* VEX_LEN_0F38F3 */
7044 { REG_TABLE(REG_VEX_0F38F3_L_0
) },
7047 /* VEX_LEN_0F38F5 */
7049 { PREFIX_TABLE(PREFIX_VEX_0F38F5_L_0
) },
7052 /* VEX_LEN_0F38F6 */
7054 { PREFIX_TABLE(PREFIX_VEX_0F38F6_L_0
) },
7057 /* VEX_LEN_0F38F7 */
7059 { PREFIX_TABLE(PREFIX_VEX_0F38F7_L_0
) },
7062 /* VEX_LEN_0F3A00 */
7065 { VEX_W_TABLE (VEX_W_0F3A00_L_1
) },
7068 /* VEX_LEN_0F3A01 */
7071 { VEX_W_TABLE (VEX_W_0F3A01_L_1
) },
7074 /* VEX_LEN_0F3A06 */
7077 { VEX_W_TABLE (VEX_W_0F3A06_L_1
) },
7080 /* VEX_LEN_0F3A14 */
7082 { "%XEvpextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
7085 /* VEX_LEN_0F3A15 */
7087 { "%XEvpextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
7090 /* VEX_LEN_0F3A16 */
7092 { "%XEvpextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
7095 /* VEX_LEN_0F3A17 */
7097 { "%XEvextractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
7100 /* VEX_LEN_0F3A18 */
7103 { VEX_W_TABLE (VEX_W_0F3A18_L_1
) },
7106 /* VEX_LEN_0F3A19 */
7109 { VEX_W_TABLE (VEX_W_0F3A19_L_1
) },
7112 /* VEX_LEN_0F3A20 */
7114 { "%XEvpinsrbY", { XM
, Vex
, Edb
, Ib
}, PREFIX_DATA
},
7117 /* VEX_LEN_0F3A21 */
7119 { "%XEvinsertpsY", { XM
, Vex
, EXd
, Ib
}, PREFIX_DATA
},
7122 /* VEX_LEN_0F3A22 */
7124 { "%XEvpinsrYK", { XM
, Vex
, Edq
, Ib
}, PREFIX_DATA
},
7127 /* VEX_LEN_0F3A30 */
7129 { MOD_TABLE (MOD_VEX_0F3A30_L_0
) },
7132 /* VEX_LEN_0F3A31 */
7134 { MOD_TABLE (MOD_VEX_0F3A31_L_0
) },
7137 /* VEX_LEN_0F3A32 */
7139 { MOD_TABLE (MOD_VEX_0F3A32_L_0
) },
7142 /* VEX_LEN_0F3A33 */
7144 { MOD_TABLE (MOD_VEX_0F3A33_L_0
) },
7147 /* VEX_LEN_0F3A38 */
7150 { VEX_W_TABLE (VEX_W_0F3A38_L_1
) },
7153 /* VEX_LEN_0F3A39 */
7156 { VEX_W_TABLE (VEX_W_0F3A39_L_1
) },
7159 /* VEX_LEN_0F3A41 */
7161 { "vdppd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7164 /* VEX_LEN_0F3A46 */
7167 { VEX_W_TABLE (VEX_W_0F3A46_L_1
) },
7170 /* VEX_LEN_0F3A60 */
7172 { "vpcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7175 /* VEX_LEN_0F3A61 */
7177 { "vpcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7180 /* VEX_LEN_0F3A62 */
7182 { "vpcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7185 /* VEX_LEN_0F3A63 */
7187 { "vpcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7190 /* VEX_LEN_0F3ADF */
7192 { "vaeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7195 /* VEX_LEN_0F3AF0 */
7197 { PREFIX_TABLE (PREFIX_VEX_0F3AF0_L_0
) },
7200 /* VEX_LEN_0FXOP_08_85 */
7202 { VEX_W_TABLE (VEX_W_0FXOP_08_85_L_0
) },
7205 /* VEX_LEN_0FXOP_08_86 */
7207 { VEX_W_TABLE (VEX_W_0FXOP_08_86_L_0
) },
7210 /* VEX_LEN_0FXOP_08_87 */
7212 { VEX_W_TABLE (VEX_W_0FXOP_08_87_L_0
) },
7215 /* VEX_LEN_0FXOP_08_8E */
7217 { VEX_W_TABLE (VEX_W_0FXOP_08_8E_L_0
) },
7220 /* VEX_LEN_0FXOP_08_8F */
7222 { VEX_W_TABLE (VEX_W_0FXOP_08_8F_L_0
) },
7225 /* VEX_LEN_0FXOP_08_95 */
7227 { VEX_W_TABLE (VEX_W_0FXOP_08_95_L_0
) },
7230 /* VEX_LEN_0FXOP_08_96 */
7232 { VEX_W_TABLE (VEX_W_0FXOP_08_96_L_0
) },
7235 /* VEX_LEN_0FXOP_08_97 */
7237 { VEX_W_TABLE (VEX_W_0FXOP_08_97_L_0
) },
7240 /* VEX_LEN_0FXOP_08_9E */
7242 { VEX_W_TABLE (VEX_W_0FXOP_08_9E_L_0
) },
7245 /* VEX_LEN_0FXOP_08_9F */
7247 { VEX_W_TABLE (VEX_W_0FXOP_08_9F_L_0
) },
7250 /* VEX_LEN_0FXOP_08_A3 */
7252 { "vpperm", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7255 /* VEX_LEN_0FXOP_08_A6 */
7257 { VEX_W_TABLE (VEX_W_0FXOP_08_A6_L_0
) },
7260 /* VEX_LEN_0FXOP_08_B6 */
7262 { VEX_W_TABLE (VEX_W_0FXOP_08_B6_L_0
) },
7265 /* VEX_LEN_0FXOP_08_C0 */
7267 { VEX_W_TABLE (VEX_W_0FXOP_08_C0_L_0
) },
7270 /* VEX_LEN_0FXOP_08_C1 */
7272 { VEX_W_TABLE (VEX_W_0FXOP_08_C1_L_0
) },
7275 /* VEX_LEN_0FXOP_08_C2 */
7277 { VEX_W_TABLE (VEX_W_0FXOP_08_C2_L_0
) },
7280 /* VEX_LEN_0FXOP_08_C3 */
7282 { VEX_W_TABLE (VEX_W_0FXOP_08_C3_L_0
) },
7285 /* VEX_LEN_0FXOP_08_CC */
7287 { VEX_W_TABLE (VEX_W_0FXOP_08_CC_L_0
) },
7290 /* VEX_LEN_0FXOP_08_CD */
7292 { VEX_W_TABLE (VEX_W_0FXOP_08_CD_L_0
) },
7295 /* VEX_LEN_0FXOP_08_CE */
7297 { VEX_W_TABLE (VEX_W_0FXOP_08_CE_L_0
) },
7300 /* VEX_LEN_0FXOP_08_CF */
7302 { VEX_W_TABLE (VEX_W_0FXOP_08_CF_L_0
) },
7305 /* VEX_LEN_0FXOP_08_EC */
7307 { VEX_W_TABLE (VEX_W_0FXOP_08_EC_L_0
) },
7310 /* VEX_LEN_0FXOP_08_ED */
7312 { VEX_W_TABLE (VEX_W_0FXOP_08_ED_L_0
) },
7315 /* VEX_LEN_0FXOP_08_EE */
7317 { VEX_W_TABLE (VEX_W_0FXOP_08_EE_L_0
) },
7320 /* VEX_LEN_0FXOP_08_EF */
7322 { VEX_W_TABLE (VEX_W_0FXOP_08_EF_L_0
) },
7325 /* VEX_LEN_0FXOP_09_01 */
7327 { REG_TABLE (REG_XOP_09_01_L_0
) },
7330 /* VEX_LEN_0FXOP_09_02 */
7332 { REG_TABLE (REG_XOP_09_02_L_0
) },
7335 /* VEX_LEN_0FXOP_09_12_M_1 */
7337 { REG_TABLE (REG_XOP_09_12_M_1_L_0
) },
7340 /* VEX_LEN_0FXOP_09_82_W_0 */
7342 { "vfrczss", { XM
, EXd
}, 0 },
7345 /* VEX_LEN_0FXOP_09_83_W_0 */
7347 { "vfrczsd", { XM
, EXq
}, 0 },
7350 /* VEX_LEN_0FXOP_09_90 */
7352 { "vprotb", { XM
, EXx
, VexW
}, 0 },
7355 /* VEX_LEN_0FXOP_09_91 */
7357 { "vprotw", { XM
, EXx
, VexW
}, 0 },
7360 /* VEX_LEN_0FXOP_09_92 */
7362 { "vprotd", { XM
, EXx
, VexW
}, 0 },
7365 /* VEX_LEN_0FXOP_09_93 */
7367 { "vprotq", { XM
, EXx
, VexW
}, 0 },
7370 /* VEX_LEN_0FXOP_09_94 */
7372 { "vpshlb", { XM
, EXx
, VexW
}, 0 },
7375 /* VEX_LEN_0FXOP_09_95 */
7377 { "vpshlw", { XM
, EXx
, VexW
}, 0 },
7380 /* VEX_LEN_0FXOP_09_96 */
7382 { "vpshld", { XM
, EXx
, VexW
}, 0 },
7385 /* VEX_LEN_0FXOP_09_97 */
7387 { "vpshlq", { XM
, EXx
, VexW
}, 0 },
7390 /* VEX_LEN_0FXOP_09_98 */
7392 { "vpshab", { XM
, EXx
, VexW
}, 0 },
7395 /* VEX_LEN_0FXOP_09_99 */
7397 { "vpshaw", { XM
, EXx
, VexW
}, 0 },
7400 /* VEX_LEN_0FXOP_09_9A */
7402 { "vpshad", { XM
, EXx
, VexW
}, 0 },
7405 /* VEX_LEN_0FXOP_09_9B */
7407 { "vpshaq", { XM
, EXx
, VexW
}, 0 },
7410 /* VEX_LEN_0FXOP_09_C1 */
7412 { VEX_W_TABLE (VEX_W_0FXOP_09_C1_L_0
) },
7415 /* VEX_LEN_0FXOP_09_C2 */
7417 { VEX_W_TABLE (VEX_W_0FXOP_09_C2_L_0
) },
7420 /* VEX_LEN_0FXOP_09_C3 */
7422 { VEX_W_TABLE (VEX_W_0FXOP_09_C3_L_0
) },
7425 /* VEX_LEN_0FXOP_09_C6 */
7427 { VEX_W_TABLE (VEX_W_0FXOP_09_C6_L_0
) },
7430 /* VEX_LEN_0FXOP_09_C7 */
7432 { VEX_W_TABLE (VEX_W_0FXOP_09_C7_L_0
) },
7435 /* VEX_LEN_0FXOP_09_CB */
7437 { VEX_W_TABLE (VEX_W_0FXOP_09_CB_L_0
) },
7440 /* VEX_LEN_0FXOP_09_D1 */
7442 { VEX_W_TABLE (VEX_W_0FXOP_09_D1_L_0
) },
7445 /* VEX_LEN_0FXOP_09_D2 */
7447 { VEX_W_TABLE (VEX_W_0FXOP_09_D2_L_0
) },
7450 /* VEX_LEN_0FXOP_09_D3 */
7452 { VEX_W_TABLE (VEX_W_0FXOP_09_D3_L_0
) },
7455 /* VEX_LEN_0FXOP_09_D6 */
7457 { VEX_W_TABLE (VEX_W_0FXOP_09_D6_L_0
) },
7460 /* VEX_LEN_0FXOP_09_D7 */
7462 { VEX_W_TABLE (VEX_W_0FXOP_09_D7_L_0
) },
7465 /* VEX_LEN_0FXOP_09_DB */
7467 { VEX_W_TABLE (VEX_W_0FXOP_09_DB_L_0
) },
7470 /* VEX_LEN_0FXOP_09_E1 */
7472 { VEX_W_TABLE (VEX_W_0FXOP_09_E1_L_0
) },
7475 /* VEX_LEN_0FXOP_09_E2 */
7477 { VEX_W_TABLE (VEX_W_0FXOP_09_E2_L_0
) },
7480 /* VEX_LEN_0FXOP_09_E3 */
7482 { VEX_W_TABLE (VEX_W_0FXOP_09_E3_L_0
) },
7485 /* VEX_LEN_0FXOP_0A_12 */
7487 { REG_TABLE (REG_XOP_0A_12_L_0
) },
7491 #include "i386-dis-evex-len.h"
7493 static const struct dis386 vex_w_table
[][2] = {
7495 /* VEX_W_0F41_L_1_M_1 */
7496 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_0
) },
7497 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_1
) },
7500 /* VEX_W_0F42_L_1_M_1 */
7501 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_0
) },
7502 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_1
) },
7505 /* VEX_W_0F44_L_0_M_1 */
7506 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_0
) },
7507 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_1
) },
7510 /* VEX_W_0F45_L_1_M_1 */
7511 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_0
) },
7512 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_1
) },
7515 /* VEX_W_0F46_L_1_M_1 */
7516 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_0
) },
7517 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_1
) },
7520 /* VEX_W_0F47_L_1_M_1 */
7521 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_0
) },
7522 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_1
) },
7525 /* VEX_W_0F4A_L_1_M_1 */
7526 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_0
) },
7527 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_1
) },
7530 /* VEX_W_0F4B_L_1_M_1 */
7531 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_0
) },
7532 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_1
) },
7535 /* VEX_W_0F90_L_0 */
7536 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_0
) },
7537 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_1
) },
7540 /* VEX_W_0F91_L_0_M_0 */
7541 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_0
) },
7542 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_1
) },
7545 /* VEX_W_0F92_L_0_M_1 */
7546 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_0
) },
7547 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_1
) },
7550 /* VEX_W_0F93_L_0_M_1 */
7551 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_0
) },
7552 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_1
) },
7555 /* VEX_W_0F98_L_0_M_1 */
7556 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_0
) },
7557 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_1
) },
7560 /* VEX_W_0F99_L_0_M_1 */
7561 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_0
) },
7562 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_1
) },
7566 { "%XEvpermilps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7570 { "vpermilpd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7574 { "vtestps", { XM
, EXx
}, PREFIX_DATA
},
7578 { "vtestpd", { XM
, EXx
}, PREFIX_DATA
},
7582 { "vcvtph2ps", { XM
, EXxmmq
}, PREFIX_DATA
},
7585 /* VEX_W_0F3816_L_1 */
7586 { "vpermps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7590 { "%XEvbroadcastss", { XM
, EXd
}, PREFIX_DATA
},
7593 /* VEX_W_0F3819_L_1 */
7594 { "vbroadcastsd", { XM
, EXq
}, PREFIX_DATA
},
7597 /* VEX_W_0F381A_M_0_L_1 */
7598 { "vbroadcastf128", { XM
, Mxmm
}, PREFIX_DATA
},
7601 /* VEX_W_0F382C_M_0 */
7602 { "vmaskmovps", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7605 /* VEX_W_0F382D_M_0 */
7606 { "vmaskmovpd", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7609 /* VEX_W_0F382E_M_0 */
7610 { "vmaskmovps", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7613 /* VEX_W_0F382F_M_0 */
7614 { "vmaskmovpd", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7618 { "vpermd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7622 { "vpsravd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7625 /* VEX_W_0F3849_X86_64_L_0 */
7626 { MOD_TABLE (MOD_VEX_0F3849_X86_64_L_0_W_0
) },
7629 /* VEX_W_0F384B_X86_64_L_0 */
7630 { MOD_TABLE (MOD_VEX_0F384B_X86_64_L_0_W_0
) },
7634 { PREFIX_TABLE (PREFIX_VEX_0F3850_W_0
) },
7638 { PREFIX_TABLE (PREFIX_VEX_0F3851_W_0
) },
7642 { "%XVvpdpwssd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7646 { "%XVvpdpwssds", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7650 { "%XEvpbroadcastd", { XM
, EXd
}, PREFIX_DATA
},
7654 { "vpbroadcastq", { XM
, EXq
}, PREFIX_DATA
},
7657 /* VEX_W_0F385A_M_0_L_0 */
7658 { "vbroadcasti128", { XM
, Mxmm
}, PREFIX_DATA
},
7661 /* VEX_W_0F385C_X86_64_M_1_L_0 */
7662 { PREFIX_TABLE (PREFIX_VEX_0F385C_X86_64_M_1_L_0_W_0
) },
7665 /* VEX_W_0F385E_X86_64_M_1_L_0 */
7666 { PREFIX_TABLE (PREFIX_VEX_0F385E_X86_64_M_1_L_0_W_0
) },
7669 /* VEX_W_0F386C_X86_64_M_1_L_0 */
7670 { PREFIX_TABLE (PREFIX_VEX_0F386C_X86_64_M_1_L_0_W_0
) },
7673 /* VEX_W_0F3872_P_1 */
7674 { "%XVvcvtneps2bf16%XY", { XMM
, EXx
}, 0 },
7678 { "%XEvpbroadcastb", { XM
, EXb
}, PREFIX_DATA
},
7682 { "%XEvpbroadcastw", { XM
, EXw
}, PREFIX_DATA
},
7686 { PREFIX_TABLE (PREFIX_VEX_0F38B0_W_0
) },
7690 { PREFIX_TABLE (PREFIX_VEX_0F38B1_W_0
) },
7695 { "%XVvpmadd52luq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7700 { "%XVvpmadd52huq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7704 { "%XEvgf2p8mulb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7707 /* VEX_W_0F3A00_L_1 */
7709 { "%XEvpermq", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7712 /* VEX_W_0F3A01_L_1 */
7714 { "%XEvpermpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7718 { "vpblendd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7722 { "%XEvpermilps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7726 { "vpermilpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7729 /* VEX_W_0F3A06_L_1 */
7730 { "vperm2f128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7733 /* VEX_W_0F3A18_L_1 */
7734 { "vinsertf128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7737 /* VEX_W_0F3A19_L_1 */
7738 { "vextractf128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7742 { "%XEvcvtps2ph", { EXxmmq
, XM
, EXxEVexS
, Ib
}, PREFIX_DATA
},
7745 /* VEX_W_0F3A38_L_1 */
7746 { "vinserti128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7749 /* VEX_W_0F3A39_L_1 */
7750 { "vextracti128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7753 /* VEX_W_0F3A46_L_1 */
7754 { "vperm2i128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7758 { "vblendvps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7762 { "vblendvpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7766 { "vpblendvb", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7771 { "%XEvgf2p8affineqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7776 { "%XEvgf2p8affineinvqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7778 /* VEX_W_0FXOP_08_85_L_0 */
7780 { "vpmacssww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7782 /* VEX_W_0FXOP_08_86_L_0 */
7784 { "vpmacsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7786 /* VEX_W_0FXOP_08_87_L_0 */
7788 { "vpmacssdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7790 /* VEX_W_0FXOP_08_8E_L_0 */
7792 { "vpmacssdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7794 /* VEX_W_0FXOP_08_8F_L_0 */
7796 { "vpmacssdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7798 /* VEX_W_0FXOP_08_95_L_0 */
7800 { "vpmacsww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7802 /* VEX_W_0FXOP_08_96_L_0 */
7804 { "vpmacswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7806 /* VEX_W_0FXOP_08_97_L_0 */
7808 { "vpmacsdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7810 /* VEX_W_0FXOP_08_9E_L_0 */
7812 { "vpmacsdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7814 /* VEX_W_0FXOP_08_9F_L_0 */
7816 { "vpmacsdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7818 /* VEX_W_0FXOP_08_A6_L_0 */
7820 { "vpmadcsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7822 /* VEX_W_0FXOP_08_B6_L_0 */
7824 { "vpmadcswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7826 /* VEX_W_0FXOP_08_C0_L_0 */
7828 { "vprotb", { XM
, EXx
, Ib
}, 0 },
7830 /* VEX_W_0FXOP_08_C1_L_0 */
7832 { "vprotw", { XM
, EXx
, Ib
}, 0 },
7834 /* VEX_W_0FXOP_08_C2_L_0 */
7836 { "vprotd", { XM
, EXx
, Ib
}, 0 },
7838 /* VEX_W_0FXOP_08_C3_L_0 */
7840 { "vprotq", { XM
, EXx
, Ib
}, 0 },
7842 /* VEX_W_0FXOP_08_CC_L_0 */
7844 { "vpcomb", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7846 /* VEX_W_0FXOP_08_CD_L_0 */
7848 { "vpcomw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7850 /* VEX_W_0FXOP_08_CE_L_0 */
7852 { "vpcomd", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7854 /* VEX_W_0FXOP_08_CF_L_0 */
7856 { "vpcomq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7858 /* VEX_W_0FXOP_08_EC_L_0 */
7860 { "vpcomub", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7862 /* VEX_W_0FXOP_08_ED_L_0 */
7864 { "vpcomuw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7866 /* VEX_W_0FXOP_08_EE_L_0 */
7868 { "vpcomud", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7870 /* VEX_W_0FXOP_08_EF_L_0 */
7872 { "vpcomuq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7874 /* VEX_W_0FXOP_09_80 */
7876 { "vfrczps", { XM
, EXx
}, 0 },
7878 /* VEX_W_0FXOP_09_81 */
7880 { "vfrczpd", { XM
, EXx
}, 0 },
7882 /* VEX_W_0FXOP_09_82 */
7884 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_82_W_0
) },
7886 /* VEX_W_0FXOP_09_83 */
7888 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_83_W_0
) },
7890 /* VEX_W_0FXOP_09_C1_L_0 */
7892 { "vphaddbw", { XM
, EXxmm
}, 0 },
7894 /* VEX_W_0FXOP_09_C2_L_0 */
7896 { "vphaddbd", { XM
, EXxmm
}, 0 },
7898 /* VEX_W_0FXOP_09_C3_L_0 */
7900 { "vphaddbq", { XM
, EXxmm
}, 0 },
7902 /* VEX_W_0FXOP_09_C6_L_0 */
7904 { "vphaddwd", { XM
, EXxmm
}, 0 },
7906 /* VEX_W_0FXOP_09_C7_L_0 */
7908 { "vphaddwq", { XM
, EXxmm
}, 0 },
7910 /* VEX_W_0FXOP_09_CB_L_0 */
7912 { "vphadddq", { XM
, EXxmm
}, 0 },
7914 /* VEX_W_0FXOP_09_D1_L_0 */
7916 { "vphaddubw", { XM
, EXxmm
}, 0 },
7918 /* VEX_W_0FXOP_09_D2_L_0 */
7920 { "vphaddubd", { XM
, EXxmm
}, 0 },
7922 /* VEX_W_0FXOP_09_D3_L_0 */
7924 { "vphaddubq", { XM
, EXxmm
}, 0 },
7926 /* VEX_W_0FXOP_09_D6_L_0 */
7928 { "vphadduwd", { XM
, EXxmm
}, 0 },
7930 /* VEX_W_0FXOP_09_D7_L_0 */
7932 { "vphadduwq", { XM
, EXxmm
}, 0 },
7934 /* VEX_W_0FXOP_09_DB_L_0 */
7936 { "vphaddudq", { XM
, EXxmm
}, 0 },
7938 /* VEX_W_0FXOP_09_E1_L_0 */
7940 { "vphsubbw", { XM
, EXxmm
}, 0 },
7942 /* VEX_W_0FXOP_09_E2_L_0 */
7944 { "vphsubwd", { XM
, EXxmm
}, 0 },
7946 /* VEX_W_0FXOP_09_E3_L_0 */
7948 { "vphsubdq", { XM
, EXxmm
}, 0 },
7951 #include "i386-dis-evex-w.h"
7954 static const struct dis386 mod_table
[][2] = {
7957 { "bound{S|}", { Gv
, Ma
}, 0 },
7958 { EVEX_TABLE (EVEX_0F
) },
7962 { "leaS", { Gv
, M
}, 0 },
7966 { "lesS", { Gv
, Mp
}, 0 },
7967 { VEX_C4_TABLE (VEX_0F
) },
7971 { "ldsS", { Gv
, Mp
}, 0 },
7972 { VEX_C5_TABLE (VEX_0F
) },
7977 { RM_TABLE (RM_C6_REG_7
) },
7982 { RM_TABLE (RM_C7_REG_7
) },
7986 { "{l|}call^", { indirEp
}, 0 },
7990 { "{l|}jmp^", { indirEp
}, 0 },
7993 /* MOD_0F01_REG_0 */
7994 { X86_64_TABLE (X86_64_0F01_REG_0
) },
7995 { RM_TABLE (RM_0F01_REG_0
) },
7998 /* MOD_0F01_REG_1 */
7999 { X86_64_TABLE (X86_64_0F01_REG_1
) },
8000 { RM_TABLE (RM_0F01_REG_1
) },
8003 /* MOD_0F01_REG_2 */
8004 { X86_64_TABLE (X86_64_0F01_REG_2
) },
8005 { RM_TABLE (RM_0F01_REG_2
) },
8008 /* MOD_0F01_REG_3 */
8009 { X86_64_TABLE (X86_64_0F01_REG_3
) },
8010 { RM_TABLE (RM_0F01_REG_3
) },
8013 /* MOD_0F01_REG_5 */
8014 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_0
) },
8015 { RM_TABLE (RM_0F01_REG_5_MOD_3
) },
8018 /* MOD_0F01_REG_7 */
8019 { "invlpg", { Mb
}, 0 },
8020 { RM_TABLE (RM_0F01_REG_7_MOD_3
) },
8024 { "larS", { Gv
, Mw
}, 0 },
8025 { "larS", { Gv
, Ev
}, 0 },
8029 { "lslS", { Gv
, Mw
}, 0 },
8030 { "lslS", { Gv
, Ev
}, 0 },
8033 /* MOD_0F12_PREFIX_0 */
8034 { "%XEVmovlpYX", { XM
, Vex
, EXq
}, 0 },
8035 { "%XEVmovhlpY%XS", { XM
, Vex
, EXq
}, 0 },
8038 /* MOD_0F12_PREFIX_2 */
8039 { "%XEVmovlpYX", { XM
, Vex
, EXq
}, 0 },
8043 { "%XEVmovlpYX", { EXq
, XM
}, PREFIX_OPCODE
},
8046 /* MOD_0F16_PREFIX_0 */
8047 { "%XEVmovhpYX", { XM
, Vex
, EXq
}, 0 },
8048 { "%XEVmovlhpY%XS", { XM
, Vex
, EXq
}, 0 },
8051 /* MOD_0F16_PREFIX_2 */
8052 { "%XEVmovhpYX", { XM
, Vex
, EXq
}, 0 },
8056 { "%XEVmovhpYX", { EXq
, XM
}, PREFIX_OPCODE
},
8059 /* MOD_0F18_REG_0 */
8060 { "prefetchnta", { Mb
}, 0 },
8061 { "nopQ", { Ev
}, 0 },
8064 /* MOD_0F18_REG_1 */
8065 { "prefetcht0", { Mb
}, 0 },
8066 { "nopQ", { Ev
}, 0 },
8069 /* MOD_0F18_REG_2 */
8070 { "prefetcht1", { Mb
}, 0 },
8071 { "nopQ", { Ev
}, 0 },
8074 /* MOD_0F18_REG_3 */
8075 { "prefetcht2", { Mb
}, 0 },
8076 { "nopQ", { Ev
}, 0 },
8079 /* MOD_0F18_REG_6 */
8080 { X86_64_TABLE (X86_64_0F18_REG_6_MOD_0
) },
8081 { "nopQ", { Ev
}, 0 },
8084 /* MOD_0F18_REG_7 */
8085 { X86_64_TABLE (X86_64_0F18_REG_7_MOD_0
) },
8086 { "nopQ", { Ev
}, 0 },
8089 /* MOD_0F1A_PREFIX_0 */
8090 { "bndldx", { Gbnd
, Mv_bnd
}, 0 },
8091 { "nopQ", { Ev
}, 0 },
8094 /* MOD_0F1B_PREFIX_0 */
8095 { "bndstx", { Mv_bnd
, Gbnd
}, 0 },
8096 { "nopQ", { Ev
}, 0 },
8099 /* MOD_0F1B_PREFIX_1 */
8100 { "bndmk", { Gbnd
, Mv_bnd
}, 0 },
8101 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8104 /* MOD_0F1C_PREFIX_0 */
8105 { REG_TABLE (REG_0F1C_P_0_MOD_0
) },
8106 { "nopQ", { Ev
}, 0 },
8109 /* MOD_0F1E_PREFIX_1 */
8110 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8111 { REG_TABLE (REG_0F1E_P_1_MOD_3
) },
8114 /* MOD_0F2B_PREFIX_0 */
8115 {"movntps", { Mx
, XM
}, PREFIX_OPCODE
},
8118 /* MOD_0F2B_PREFIX_1 */
8119 {"movntss", { Md
, XM
}, PREFIX_OPCODE
},
8122 /* MOD_0F2B_PREFIX_2 */
8123 {"movntpd", { Mx
, XM
}, PREFIX_OPCODE
},
8126 /* MOD_0F2B_PREFIX_3 */
8127 {"movntsd", { Mq
, XM
}, PREFIX_OPCODE
},
8132 { "VmovmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8137 { REG_TABLE (REG_0F71_MOD_0
) },
8142 { REG_TABLE (REG_0F72_MOD_0
) },
8147 { REG_TABLE (REG_0F73_MOD_0
) },
8150 /* MOD_0FAE_REG_0 */
8151 { "fxsave", { FXSAVE
}, 0 },
8152 { PREFIX_TABLE (PREFIX_0FAE_REG_0_MOD_3
) },
8155 /* MOD_0FAE_REG_1 */
8156 { "fxrstor", { FXSAVE
}, 0 },
8157 { PREFIX_TABLE (PREFIX_0FAE_REG_1_MOD_3
) },
8160 /* MOD_0FAE_REG_2 */
8161 { "ldmxcsr", { Md
}, 0 },
8162 { PREFIX_TABLE (PREFIX_0FAE_REG_2_MOD_3
) },
8165 /* MOD_0FAE_REG_3 */
8166 { "stmxcsr", { Md
}, 0 },
8167 { PREFIX_TABLE (PREFIX_0FAE_REG_3_MOD_3
) },
8170 /* MOD_0FAE_REG_4 */
8171 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_0
) },
8172 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_3
) },
8175 /* MOD_0FAE_REG_5 */
8176 { "xrstor", { FXSAVE
}, PREFIX_OPCODE
},
8177 { PREFIX_TABLE (PREFIX_0FAE_REG_5_MOD_3
) },
8180 /* MOD_0FAE_REG_6 */
8181 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_0
) },
8182 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_3
) },
8185 /* MOD_0FAE_REG_7 */
8186 { PREFIX_TABLE (PREFIX_0FAE_REG_7_MOD_0
) },
8187 { RM_TABLE (RM_0FAE_REG_7_MOD_3
) },
8191 { "lssS", { Gv
, Mp
}, 0 },
8195 { "lfsS", { Gv
, Mp
}, 0 },
8199 { "lgsS", { Gv
, Mp
}, 0 },
8203 { "movntiS", { Edq
, Gdq
}, PREFIX_OPCODE
},
8206 /* MOD_0FC7_REG_3 */
8207 { "xrstors", { FXSAVE
}, 0 },
8210 /* MOD_0FC7_REG_4 */
8211 { "xsavec", { FXSAVE
}, 0 },
8214 /* MOD_0FC7_REG_5 */
8215 { "xsaves", { FXSAVE
}, 0 },
8218 /* MOD_0FC7_REG_6 */
8219 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_0
) },
8220 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_3
) }
8223 /* MOD_0FC7_REG_7 */
8224 { "vmptrst", { Mq
}, 0 },
8225 { PREFIX_TABLE (PREFIX_0FC7_REG_7_MOD_3
) }
8230 { "pmovmskb", { Gdq
, MS
}, 0 },
8233 /* MOD_0FE7_PREFIX_2 */
8234 { "movntdq", { Mx
, XM
}, 0 },
8238 { "movntdqa", { XM
, Mx
}, PREFIX_DATA
},
8241 /* MOD_0F38DC_PREFIX_1 */
8242 { "aesenc128kl", { XM
, M
}, 0 },
8243 { "loadiwkey", { XM
, EXx
}, 0 },
8246 /* MOD_0F38DD_PREFIX_1 */
8247 { "aesdec128kl", { XM
, M
}, 0 },
8250 /* MOD_0F38DE_PREFIX_1 */
8251 { "aesenc256kl", { XM
, M
}, 0 },
8254 /* MOD_0F38DF_PREFIX_1 */
8255 { "aesdec256kl", { XM
, M
}, 0 },
8259 { "wrussK", { M
, Gdq
}, PREFIX_DATA
},
8262 /* MOD_0F38F6_PREFIX_0 */
8263 { "wrssK", { M
, Gdq
}, PREFIX_OPCODE
},
8266 /* MOD_0F38F8_PREFIX_1 */
8267 { "enqcmds", { Gva
, M
}, PREFIX_OPCODE
},
8270 /* MOD_0F38F8_PREFIX_2 */
8271 { "movdir64b", { Gva
, M
}, PREFIX_OPCODE
},
8274 /* MOD_0F38F8_PREFIX_3 */
8275 { "enqcmd", { Gva
, M
}, PREFIX_OPCODE
},
8279 { "movdiri", { Edq
, Gdq
}, PREFIX_OPCODE
},
8282 /* MOD_0F38FA_PREFIX_1 */
8284 { "encodekey128", { Gd
, Ed
}, 0 },
8287 /* MOD_0F38FB_PREFIX_1 */
8289 { "encodekey256", { Gd
, Ed
}, 0 },
8292 /* MOD_0F3A0F_PREFIX_1 */
8294 { REG_TABLE (REG_0F3A0F_PREFIX_1_MOD_3
) },
8298 { "%XEvmovntpX", { Mx
, XM
}, PREFIX_OPCODE
},
8301 /* MOD_VEX_0F41_L_1 */
8303 { VEX_W_TABLE (VEX_W_0F41_L_1_M_1
) },
8306 /* MOD_VEX_0F42_L_1 */
8308 { VEX_W_TABLE (VEX_W_0F42_L_1_M_1
) },
8311 /* MOD_VEX_0F44_L_0 */
8313 { VEX_W_TABLE (VEX_W_0F44_L_0_M_1
) },
8316 /* MOD_VEX_0F45_L_1 */
8318 { VEX_W_TABLE (VEX_W_0F45_L_1_M_1
) },
8321 /* MOD_VEX_0F46_L_1 */
8323 { VEX_W_TABLE (VEX_W_0F46_L_1_M_1
) },
8326 /* MOD_VEX_0F47_L_1 */
8328 { VEX_W_TABLE (VEX_W_0F47_L_1_M_1
) },
8331 /* MOD_VEX_0F4A_L_1 */
8333 { VEX_W_TABLE (VEX_W_0F4A_L_1_M_1
) },
8336 /* MOD_VEX_0F4B_L_1 */
8338 { VEX_W_TABLE (VEX_W_0F4B_L_1_M_1
) },
8343 { REG_TABLE (REG_VEX_0F71_M_0
) },
8348 { REG_TABLE (REG_VEX_0F72_M_0
) },
8353 { REG_TABLE (REG_VEX_0F73_M_0
) },
8356 /* MOD_VEX_0F91_L_0 */
8357 { VEX_W_TABLE (VEX_W_0F91_L_0_M_0
) },
8360 /* MOD_VEX_0F92_L_0 */
8362 { VEX_W_TABLE (VEX_W_0F92_L_0_M_1
) },
8365 /* MOD_VEX_0F93_L_0 */
8367 { VEX_W_TABLE (VEX_W_0F93_L_0_M_1
) },
8370 /* MOD_VEX_0F98_L_0 */
8372 { VEX_W_TABLE (VEX_W_0F98_L_0_M_1
) },
8375 /* MOD_VEX_0F99_L_0 */
8377 { VEX_W_TABLE (VEX_W_0F99_L_0_M_1
) },
8380 /* MOD_VEX_0FAE_REG_2 */
8381 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0
) },
8384 /* MOD_VEX_0FAE_REG_3 */
8385 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0
) },
8390 { "vpmovmskb", { Gdq
, XS
}, PREFIX_DATA
},
8394 { "vmovntdq", { Mx
, XM
}, PREFIX_DATA
},
8397 /* MOD_VEX_0F381A */
8398 { VEX_LEN_TABLE (VEX_LEN_0F381A_M_0
) },
8401 /* MOD_VEX_0F382A */
8402 { "vmovntdqa", { XM
, Mx
}, PREFIX_DATA
},
8405 /* MOD_VEX_0F382C */
8406 { VEX_W_TABLE (VEX_W_0F382C_M_0
) },
8409 /* MOD_VEX_0F382D */
8410 { VEX_W_TABLE (VEX_W_0F382D_M_0
) },
8413 /* MOD_VEX_0F382E */
8414 { VEX_W_TABLE (VEX_W_0F382E_M_0
) },
8417 /* MOD_VEX_0F382F */
8418 { VEX_W_TABLE (VEX_W_0F382F_M_0
) },
8421 /* MOD_VEX_0F3849_X86_64_L_0_W_0 */
8422 { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_0
) },
8423 { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_1
) },
8426 /* MOD_VEX_0F384B_X86_64_L_0_W_0 */
8427 { PREFIX_TABLE (PREFIX_VEX_0F384B_X86_64_L_0_W_0_M_0
) },
8430 /* MOD_VEX_0F385A */
8431 { VEX_LEN_TABLE (VEX_LEN_0F385A_M_0
) },
8434 /* MOD_VEX_0F385C_X86_64 */
8436 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_M_1
) },
8439 /* MOD_VEX_0F385E_X86_64 */
8441 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_M_1
) },
8444 /* MOD_VEX_0F386C_X86_64 */
8446 { VEX_LEN_TABLE (VEX_LEN_0F386C_X86_64_M_1
) },
8449 /* MOD_VEX_0F388C */
8450 { "vpmaskmov%DQ", { XM
, Vex
, Mx
}, PREFIX_DATA
},
8453 /* MOD_VEX_0F388E */
8454 { "vpmaskmov%DQ", { Mx
, Vex
, XM
}, PREFIX_DATA
},
8457 /* MOD_VEX_0F3A30_L_0 */
8459 { "kshiftr%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8462 /* MOD_VEX_0F3A31_L_0 */
8464 { "kshiftr%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8467 /* MOD_VEX_0F3A32_L_0 */
8469 { "kshiftl%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8472 /* MOD_VEX_0F3A33_L_0 */
8474 { "kshiftl%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8479 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_12_M_1
) },
8482 #include "i386-dis-evex-mod.h"
8485 static const struct dis386 rm_table
[][8] = {
8488 { "xabort", { Skip_MODRM
, Ib
}, 0 },
8492 { "xbeginT", { Skip_MODRM
, Jdqw
}, 0 },
8496 { "enclv", { Skip_MODRM
}, 0 },
8497 { "vmcall", { Skip_MODRM
}, 0 },
8498 { "vmlaunch", { Skip_MODRM
}, 0 },
8499 { "vmresume", { Skip_MODRM
}, 0 },
8500 { "vmxoff", { Skip_MODRM
}, 0 },
8501 { "pconfig", { Skip_MODRM
}, 0 },
8502 { PREFIX_TABLE (PREFIX_0F01_REG_0_MOD_3_RM_6
) },
8506 { "monitor", { { OP_Monitor
, 0 } }, 0 },
8507 { "mwait", { { OP_Mwait
, 0 } }, 0 },
8508 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_2
) },
8509 { "stac", { Skip_MODRM
}, 0 },
8510 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_4
) },
8511 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_5
) },
8512 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_6
) },
8513 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_7
) },
8517 { "xgetbv", { Skip_MODRM
}, 0 },
8518 { "xsetbv", { Skip_MODRM
}, 0 },
8521 { "vmfunc", { Skip_MODRM
}, 0 },
8522 { "xend", { Skip_MODRM
}, 0 },
8523 { "xtest", { Skip_MODRM
}, 0 },
8524 { "enclu", { Skip_MODRM
}, 0 },
8528 { "vmrun", { Skip_MODRM
}, 0 },
8529 { PREFIX_TABLE (PREFIX_0F01_REG_3_RM_1
) },
8530 { "vmload", { Skip_MODRM
}, 0 },
8531 { "vmsave", { Skip_MODRM
}, 0 },
8532 { "stgi", { Skip_MODRM
}, 0 },
8533 { "clgi", { Skip_MODRM
}, 0 },
8534 { "skinit", { Skip_MODRM
}, 0 },
8535 { "invlpga", { Skip_MODRM
}, 0 },
8538 /* RM_0F01_REG_5_MOD_3 */
8539 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_0
) },
8540 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_1
) },
8541 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_2
) },
8543 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_4
) },
8544 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_5
) },
8545 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_6
) },
8546 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_7
) },
8549 /* RM_0F01_REG_7_MOD_3 */
8550 { "swapgs", { Skip_MODRM
}, 0 },
8551 { "rdtscp", { Skip_MODRM
}, 0 },
8552 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_2
) },
8553 { "mwaitx", { { OP_Mwait
, eBX_reg
} }, PREFIX_OPCODE
},
8554 { "clzero", { Skip_MODRM
}, 0 },
8555 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_5
) },
8556 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_6
) },
8557 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_7
) },
8560 /* RM_0F1E_P_1_MOD_3_REG_7 */
8561 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8562 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8563 { "endbr64", { Skip_MODRM
}, 0 },
8564 { "endbr32", { Skip_MODRM
}, 0 },
8565 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8566 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8567 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8568 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8571 /* RM_0FAE_REG_6_MOD_3 */
8572 { "mfence", { Skip_MODRM
}, 0 },
8575 /* RM_0FAE_REG_7_MOD_3 */
8576 { "sfence", { Skip_MODRM
}, 0 },
8579 /* RM_0F3A0F_P_1_MOD_3_REG_0 */
8580 { "hreset", { Skip_MODRM
, Ib
}, 0 },
8583 /* RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0_R_0 */
8584 { "tilerelease", { Skip_MODRM
}, 0 },
8587 /* RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_3 */
8588 { "tilezero", { TMM
, Skip_MODRM
}, 0 },
8592 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
8594 /* The values used here must be non-zero, fit in 'unsigned char', and not be
8595 in conflict with actual prefix opcodes. */
8596 #define REP_PREFIX 0x01
8597 #define XACQUIRE_PREFIX 0x02
8598 #define XRELEASE_PREFIX 0x03
8599 #define BND_PREFIX 0x04
8600 #define NOTRACK_PREFIX 0x05
8607 ckprefix (instr_info
*ins
)
8614 /* The maximum instruction length is 15bytes. */
8615 while (length
< MAX_CODE_LENGTH
- 1)
8617 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
8618 return ckp_fetch_error
;
8620 switch (*ins
->codep
)
8622 /* REX prefixes family. */
8639 if (ins
->address_mode
== mode_64bit
)
8640 newrex
= *ins
->codep
;
8643 ins
->last_rex_prefix
= i
;
8646 ins
->prefixes
|= PREFIX_REPZ
;
8647 ins
->last_repz_prefix
= i
;
8650 ins
->prefixes
|= PREFIX_REPNZ
;
8651 ins
->last_repnz_prefix
= i
;
8654 ins
->prefixes
|= PREFIX_LOCK
;
8655 ins
->last_lock_prefix
= i
;
8658 ins
->prefixes
|= PREFIX_CS
;
8659 ins
->last_seg_prefix
= i
;
8660 if (ins
->address_mode
!= mode_64bit
)
8661 ins
->active_seg_prefix
= PREFIX_CS
;
8664 ins
->prefixes
|= PREFIX_SS
;
8665 ins
->last_seg_prefix
= i
;
8666 if (ins
->address_mode
!= mode_64bit
)
8667 ins
->active_seg_prefix
= PREFIX_SS
;
8670 ins
->prefixes
|= PREFIX_DS
;
8671 ins
->last_seg_prefix
= i
;
8672 if (ins
->address_mode
!= mode_64bit
)
8673 ins
->active_seg_prefix
= PREFIX_DS
;
8676 ins
->prefixes
|= PREFIX_ES
;
8677 ins
->last_seg_prefix
= i
;
8678 if (ins
->address_mode
!= mode_64bit
)
8679 ins
->active_seg_prefix
= PREFIX_ES
;
8682 ins
->prefixes
|= PREFIX_FS
;
8683 ins
->last_seg_prefix
= i
;
8684 ins
->active_seg_prefix
= PREFIX_FS
;
8687 ins
->prefixes
|= PREFIX_GS
;
8688 ins
->last_seg_prefix
= i
;
8689 ins
->active_seg_prefix
= PREFIX_GS
;
8692 ins
->prefixes
|= PREFIX_DATA
;
8693 ins
->last_data_prefix
= i
;
8696 ins
->prefixes
|= PREFIX_ADDR
;
8697 ins
->last_addr_prefix
= i
;
8700 /* fwait is really an instruction. If there are prefixes
8701 before the fwait, they belong to the fwait, *not* to the
8702 following instruction. */
8703 ins
->fwait_prefix
= i
;
8704 if (ins
->prefixes
|| ins
->rex
)
8706 ins
->prefixes
|= PREFIX_FWAIT
;
8708 /* This ensures that the previous REX prefixes are noticed
8709 as unused prefixes, as in the return case below. */
8710 return ins
->rex
? ckp_bogus
: ckp_okay
;
8712 ins
->prefixes
= PREFIX_FWAIT
;
8717 /* Rex is ignored when followed by another prefix. */
8720 if (*ins
->codep
!= FWAIT_OPCODE
)
8721 ins
->all_prefixes
[i
++] = *ins
->codep
;
8729 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
8733 prefix_name (enum address_mode mode
, uint8_t pref
, int sizeflag
)
8735 static const char *rexes
[16] =
8740 "rex.XB", /* 0x43 */
8742 "rex.RB", /* 0x45 */
8743 "rex.RX", /* 0x46 */
8744 "rex.RXB", /* 0x47 */
8746 "rex.WB", /* 0x49 */
8747 "rex.WX", /* 0x4a */
8748 "rex.WXB", /* 0x4b */
8749 "rex.WR", /* 0x4c */
8750 "rex.WRB", /* 0x4d */
8751 "rex.WRX", /* 0x4e */
8752 "rex.WRXB", /* 0x4f */
8757 /* REX prefixes family. */
8774 return rexes
[pref
- 0x40];
8794 return (sizeflag
& DFLAG
) ? "data16" : "data32";
8796 if (mode
== mode_64bit
)
8797 return (sizeflag
& AFLAG
) ? "addr32" : "addr64";
8799 return (sizeflag
& AFLAG
) ? "addr16" : "addr32";
8804 case XACQUIRE_PREFIX
:
8806 case XRELEASE_PREFIX
:
8810 case NOTRACK_PREFIX
:
8818 print_i386_disassembler_options (FILE *stream
)
8820 fprintf (stream
, _("\n\
8821 The following i386/x86-64 specific disassembler options are supported for use\n\
8822 with the -M switch (multiple options should be separated by commas):\n"));
8824 fprintf (stream
, _(" x86-64 Disassemble in 64bit mode\n"));
8825 fprintf (stream
, _(" i386 Disassemble in 32bit mode\n"));
8826 fprintf (stream
, _(" i8086 Disassemble in 16bit mode\n"));
8827 fprintf (stream
, _(" att Display instruction in AT&T syntax\n"));
8828 fprintf (stream
, _(" intel Display instruction in Intel syntax\n"));
8829 fprintf (stream
, _(" att-mnemonic\n"
8830 " Display instruction in AT&T mnemonic\n"));
8831 fprintf (stream
, _(" intel-mnemonic\n"
8832 " Display instruction in Intel mnemonic\n"));
8833 fprintf (stream
, _(" addr64 Assume 64bit address size\n"));
8834 fprintf (stream
, _(" addr32 Assume 32bit address size\n"));
8835 fprintf (stream
, _(" addr16 Assume 16bit address size\n"));
8836 fprintf (stream
, _(" data32 Assume 32bit data size\n"));
8837 fprintf (stream
, _(" data16 Assume 16bit data size\n"));
8838 fprintf (stream
, _(" suffix Always display instruction suffix in AT&T syntax\n"));
8839 fprintf (stream
, _(" amd64 Display instruction in AMD64 ISA\n"));
8840 fprintf (stream
, _(" intel64 Display instruction in Intel64 ISA\n"));
8844 static const struct dis386 bad_opcode
= { "(bad)", { XX
}, 0 };
8846 /* Fetch error indicator. */
8847 static const struct dis386 err_opcode
= { NULL
, { XX
}, 0 };
8849 /* Get a pointer to struct dis386 with a valid name. */
8851 static const struct dis386
*
8852 get_valid_dis386 (const struct dis386
*dp
, instr_info
*ins
)
8854 int vindex
, vex_table_index
;
8856 if (dp
->name
!= NULL
)
8859 switch (dp
->op
[0].bytemode
)
8862 dp
= ®_table
[dp
->op
[1].bytemode
][ins
->modrm
.reg
];
8866 vindex
= ins
->modrm
.mod
== 0x3 ? 1 : 0;
8867 dp
= &mod_table
[dp
->op
[1].bytemode
][vindex
];
8871 dp
= &rm_table
[dp
->op
[1].bytemode
][ins
->modrm
.rm
];
8874 case USE_PREFIX_TABLE
:
8877 /* The prefix in VEX is implicit. */
8878 switch (ins
->vex
.prefix
)
8883 case REPE_PREFIX_OPCODE
:
8886 case DATA_PREFIX_OPCODE
:
8889 case REPNE_PREFIX_OPCODE
:
8899 int last_prefix
= -1;
8902 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
8903 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
8905 if ((ins
->prefixes
& (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
8907 if (ins
->last_repz_prefix
> ins
->last_repnz_prefix
)
8910 prefix
= PREFIX_REPZ
;
8911 last_prefix
= ins
->last_repz_prefix
;
8916 prefix
= PREFIX_REPNZ
;
8917 last_prefix
= ins
->last_repnz_prefix
;
8920 /* Check if prefix should be ignored. */
8921 if ((((prefix_table
[dp
->op
[1].bytemode
][vindex
].prefix_requirement
8922 & PREFIX_IGNORED
) >> PREFIX_IGNORED_SHIFT
)
8924 && !prefix_table
[dp
->op
[1].bytemode
][vindex
].name
)
8928 if (vindex
== 0 && (ins
->prefixes
& PREFIX_DATA
) != 0)
8931 prefix
= PREFIX_DATA
;
8932 last_prefix
= ins
->last_data_prefix
;
8937 ins
->used_prefixes
|= prefix
;
8938 ins
->all_prefixes
[last_prefix
] = 0;
8941 dp
= &prefix_table
[dp
->op
[1].bytemode
][vindex
];
8944 case USE_X86_64_TABLE
:
8945 vindex
= ins
->address_mode
== mode_64bit
? 1 : 0;
8946 dp
= &x86_64_table
[dp
->op
[1].bytemode
][vindex
];
8949 case USE_3BYTE_TABLE
:
8950 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
8952 vindex
= *ins
->codep
++;
8953 dp
= &three_byte_table
[dp
->op
[1].bytemode
][vindex
];
8954 ins
->end_codep
= ins
->codep
;
8955 if (!fetch_modrm (ins
))
8959 case USE_VEX_LEN_TABLE
:
8963 switch (ins
->vex
.length
)
8969 /* This allows re-using in particular table entries where only
8970 128-bit operand size (VEX.L=0 / EVEX.L'L=0) are valid. */
8983 dp
= &vex_len_table
[dp
->op
[1].bytemode
][vindex
];
8986 case USE_EVEX_LEN_TABLE
:
8990 switch (ins
->vex
.length
)
9006 dp
= &evex_len_table
[dp
->op
[1].bytemode
][vindex
];
9009 case USE_XOP_8F_TABLE
:
9010 if (!fetch_code (ins
->info
, ins
->codep
+ 3))
9012 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9014 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
9015 switch ((*ins
->codep
& 0x1f))
9021 vex_table_index
= XOP_08
;
9024 vex_table_index
= XOP_09
;
9027 vex_table_index
= XOP_0A
;
9031 ins
->vex
.w
= *ins
->codep
& 0x80;
9032 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9035 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9036 if (ins
->address_mode
!= mode_64bit
)
9038 /* In 16/32-bit mode REX_B is silently ignored. */
9042 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9043 switch ((*ins
->codep
& 0x3))
9048 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9051 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9054 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9057 ins
->need_vex
= true;
9059 vindex
= *ins
->codep
++;
9060 dp
= &xop_table
[vex_table_index
][vindex
];
9062 ins
->end_codep
= ins
->codep
;
9063 if (!fetch_modrm (ins
))
9066 /* No XOP encoding so far allows for a non-zero embedded prefix. Avoid
9067 having to decode the bits for every otherwise valid encoding. */
9068 if (ins
->vex
.prefix
)
9072 case USE_VEX_C4_TABLE
:
9074 if (!fetch_code (ins
->info
, ins
->codep
+ 3))
9076 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9077 switch ((*ins
->codep
& 0x1f))
9083 vex_table_index
= VEX_0F
;
9086 vex_table_index
= VEX_0F38
;
9089 vex_table_index
= VEX_0F3A
;
9093 ins
->vex
.w
= *ins
->codep
& 0x80;
9094 if (ins
->address_mode
== mode_64bit
)
9101 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
9102 is ignored, other REX bits are 0 and the highest bit in
9103 VEX.vvvv is also ignored (but we mustn't clear it here). */
9106 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9107 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9108 switch ((*ins
->codep
& 0x3))
9113 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9116 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9119 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9122 ins
->need_vex
= true;
9124 vindex
= *ins
->codep
++;
9125 dp
= &vex_table
[vex_table_index
][vindex
];
9126 ins
->end_codep
= ins
->codep
;
9127 /* There is no MODRM byte for VEX0F 77. */
9128 if ((vex_table_index
!= VEX_0F
|| vindex
!= 0x77)
9129 && !fetch_modrm (ins
))
9133 case USE_VEX_C5_TABLE
:
9135 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
9137 ins
->rex
= (*ins
->codep
& 0x80) ? 0 : REX_R
;
9139 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
9141 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9142 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9143 switch ((*ins
->codep
& 0x3))
9148 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9151 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9154 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9157 ins
->need_vex
= true;
9159 vindex
= *ins
->codep
++;
9160 dp
= &vex_table
[dp
->op
[1].bytemode
][vindex
];
9161 ins
->end_codep
= ins
->codep
;
9162 /* There is no MODRM byte for VEX 77. */
9163 if (vindex
!= 0x77 && !fetch_modrm (ins
))
9167 case USE_VEX_W_TABLE
:
9171 dp
= &vex_w_table
[dp
->op
[1].bytemode
][ins
->vex
.w
];
9174 case USE_EVEX_TABLE
:
9175 ins
->two_source_ops
= false;
9177 ins
->vex
.evex
= true;
9178 if (!fetch_code (ins
->info
, ins
->codep
+ 4))
9180 /* The first byte after 0x62. */
9181 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9182 ins
->vex
.r
= *ins
->codep
& 0x10;
9183 switch ((*ins
->codep
& 0xf))
9188 vex_table_index
= EVEX_0F
;
9191 vex_table_index
= EVEX_0F38
;
9194 vex_table_index
= EVEX_0F3A
;
9197 vex_table_index
= EVEX_MAP5
;
9200 vex_table_index
= EVEX_MAP6
;
9204 /* The second byte after 0x62. */
9206 ins
->vex
.w
= *ins
->codep
& 0x80;
9207 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9210 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9213 if (!(*ins
->codep
& 0x4))
9216 switch ((*ins
->codep
& 0x3))
9221 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9224 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9227 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9231 /* The third byte after 0x62. */
9234 /* Remember the static rounding bits. */
9235 ins
->vex
.ll
= (*ins
->codep
>> 5) & 3;
9236 ins
->vex
.b
= *ins
->codep
& 0x10;
9238 ins
->vex
.v
= *ins
->codep
& 0x8;
9239 ins
->vex
.mask_register_specifier
= *ins
->codep
& 0x7;
9240 ins
->vex
.zeroing
= *ins
->codep
& 0x80;
9242 if (ins
->address_mode
!= mode_64bit
)
9244 /* In 16/32-bit mode silently ignore following bits. */
9249 ins
->need_vex
= true;
9251 vindex
= *ins
->codep
++;
9252 dp
= &evex_table
[vex_table_index
][vindex
];
9253 ins
->end_codep
= ins
->codep
;
9254 if (!fetch_modrm (ins
))
9257 /* Set vector length. */
9258 if (ins
->modrm
.mod
== 3 && ins
->vex
.b
)
9259 ins
->vex
.length
= 512;
9262 switch (ins
->vex
.ll
)
9265 ins
->vex
.length
= 128;
9268 ins
->vex
.length
= 256;
9271 ins
->vex
.length
= 512;
9287 if (dp
->name
!= NULL
)
9290 return get_valid_dis386 (dp
, ins
);
9294 get_sib (instr_info
*ins
, int sizeflag
)
9296 /* If modrm.mod == 3, operand must be register. */
9298 && ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
9299 && ins
->modrm
.mod
!= 3
9300 && ins
->modrm
.rm
== 4)
9302 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
9304 ins
->sib
.index
= (ins
->codep
[1] >> 3) & 7;
9305 ins
->sib
.scale
= (ins
->codep
[1] >> 6) & 3;
9306 ins
->sib
.base
= ins
->codep
[1] & 7;
9307 ins
->has_sib
= true;
9310 ins
->has_sib
= false;
9315 /* Like oappend_with_style (below) but always with text style. */
9318 oappend (instr_info
*ins
, const char *s
)
9320 oappend_with_style (ins
, s
, dis_style_text
);
9323 /* Like oappend (above), but S is a string starting with '%'. In
9324 Intel syntax, the '%' is elided. */
9327 oappend_register (instr_info
*ins
, const char *s
)
9329 oappend_with_style (ins
, s
+ ins
->intel_syntax
, dis_style_register
);
9332 /* Wrap around a call to INS->info->fprintf_styled_func, printing FMT.
9333 STYLE is the default style to use in the fprintf_styled_func calls,
9334 however, FMT might include embedded style markers (see oappend_style),
9335 these embedded markers are not printed, but instead change the style
9336 used in the next fprintf_styled_func call. */
9338 static void ATTRIBUTE_PRINTF_3
9339 i386_dis_printf (const disassemble_info
*info
, enum disassembler_style style
,
9340 const char *fmt
, ...)
9343 enum disassembler_style curr_style
= style
;
9344 const char *start
, *curr
;
9345 char staging_area
[40];
9348 /* In particular print_insn()'s processing of op_txt[] can hand rather long
9349 strings here. Bypass vsnprintf() in such cases to avoid capacity issues
9350 with the staging area. */
9351 if (strcmp (fmt
, "%s"))
9353 int res
= vsnprintf (staging_area
, sizeof (staging_area
), fmt
, ap
);
9360 if ((size_t) res
>= sizeof (staging_area
))
9363 start
= curr
= staging_area
;
9367 start
= curr
= va_arg (ap
, const char *);
9374 || (*curr
== STYLE_MARKER_CHAR
9375 && ISXDIGIT (*(curr
+ 1))
9376 && *(curr
+ 2) == STYLE_MARKER_CHAR
))
9378 /* Output content between our START position and CURR. */
9379 int len
= curr
- start
;
9380 int n
= (*info
->fprintf_styled_func
) (info
->stream
, curr_style
,
9381 "%.*s", len
, start
);
9388 /* Skip over the initial STYLE_MARKER_CHAR. */
9391 /* Update the CURR_STYLE. As there are less than 16 styles, it
9392 is possible, that if the input is corrupted in some way, that
9393 we might set CURR_STYLE to an invalid value. Don't worry
9394 though, we check for this situation. */
9395 if (*curr
>= '0' && *curr
<= '9')
9396 curr_style
= (enum disassembler_style
) (*curr
- '0');
9397 else if (*curr
>= 'a' && *curr
<= 'f')
9398 curr_style
= (enum disassembler_style
) (*curr
- 'a' + 10);
9400 curr_style
= dis_style_text
;
9402 /* Check for an invalid style having been selected. This should
9403 never happen, but it doesn't hurt to be a little paranoid. */
9404 if (curr_style
> dis_style_comment_start
)
9405 curr_style
= dis_style_text
;
9407 /* Skip the hex character, and the closing STYLE_MARKER_CHAR. */
9410 /* Reset the START to after the style marker. */
9420 print_insn (bfd_vma pc
, disassemble_info
*info
, int intel_syntax
)
9422 const struct dis386
*dp
;
9425 char *op_txt
[MAX_OPERANDS
];
9427 bool intel_swap_2_3
;
9428 int sizeflag
, orig_sizeflag
;
9430 struct dis_private priv
;
9435 .intel_syntax
= intel_syntax
>= 0
9437 : (info
->mach
& bfd_mach_i386_intel_syntax
) != 0,
9438 .intel_mnemonic
= !SYSV386_COMPAT
,
9439 .op_index
[0 ... MAX_OPERANDS
- 1] = -1,
9441 .start_codep
= priv
.the_buffer
,
9442 .codep
= priv
.the_buffer
,
9444 .last_lock_prefix
= -1,
9445 .last_repz_prefix
= -1,
9446 .last_repnz_prefix
= -1,
9447 .last_data_prefix
= -1,
9448 .last_addr_prefix
= -1,
9449 .last_rex_prefix
= -1,
9450 .last_seg_prefix
= -1,
9453 char op_out
[MAX_OPERANDS
][MAX_OPERAND_BUFFER_SIZE
];
9455 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
9456 if ((info
->mach
& bfd_mach_i386_i386
) != 0)
9457 ins
.address_mode
= mode_32bit
;
9458 else if (info
->mach
== bfd_mach_i386_i8086
)
9460 ins
.address_mode
= mode_16bit
;
9461 priv
.orig_sizeflag
= 0;
9464 ins
.address_mode
= mode_64bit
;
9466 for (p
= info
->disassembler_options
; p
!= NULL
;)
9468 if (startswith (p
, "amd64"))
9470 else if (startswith (p
, "intel64"))
9471 ins
.isa64
= intel64
;
9472 else if (startswith (p
, "x86-64"))
9474 ins
.address_mode
= mode_64bit
;
9475 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9477 else if (startswith (p
, "i386"))
9479 ins
.address_mode
= mode_32bit
;
9480 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9482 else if (startswith (p
, "i8086"))
9484 ins
.address_mode
= mode_16bit
;
9485 priv
.orig_sizeflag
&= ~(AFLAG
| DFLAG
);
9487 else if (startswith (p
, "intel"))
9489 ins
.intel_syntax
= 1;
9490 if (startswith (p
+ 5, "-mnemonic"))
9491 ins
.intel_mnemonic
= true;
9493 else if (startswith (p
, "att"))
9495 ins
.intel_syntax
= 0;
9496 if (startswith (p
+ 3, "-mnemonic"))
9497 ins
.intel_mnemonic
= false;
9499 else if (startswith (p
, "addr"))
9501 if (ins
.address_mode
== mode_64bit
)
9503 if (p
[4] == '3' && p
[5] == '2')
9504 priv
.orig_sizeflag
&= ~AFLAG
;
9505 else if (p
[4] == '6' && p
[5] == '4')
9506 priv
.orig_sizeflag
|= AFLAG
;
9510 if (p
[4] == '1' && p
[5] == '6')
9511 priv
.orig_sizeflag
&= ~AFLAG
;
9512 else if (p
[4] == '3' && p
[5] == '2')
9513 priv
.orig_sizeflag
|= AFLAG
;
9516 else if (startswith (p
, "data"))
9518 if (p
[4] == '1' && p
[5] == '6')
9519 priv
.orig_sizeflag
&= ~DFLAG
;
9520 else if (p
[4] == '3' && p
[5] == '2')
9521 priv
.orig_sizeflag
|= DFLAG
;
9523 else if (startswith (p
, "suffix"))
9524 priv
.orig_sizeflag
|= SUFFIX_ALWAYS
;
9526 p
= strchr (p
, ',');
9531 if (ins
.address_mode
== mode_64bit
&& sizeof (bfd_vma
) < 8)
9533 i386_dis_printf (info
, dis_style_text
, _("64-bit address is disabled"));
9537 if (ins
.intel_syntax
)
9539 ins
.open_char
= '[';
9540 ins
.close_char
= ']';
9541 ins
.separator_char
= '+';
9542 ins
.scale_char
= '*';
9546 ins
.open_char
= '(';
9547 ins
.close_char
= ')';
9548 ins
.separator_char
= ',';
9549 ins
.scale_char
= ',';
9552 /* The output looks better if we put 7 bytes on a line, since that
9553 puts most long word instructions on a single line. */
9554 info
->bytes_per_line
= 7;
9556 info
->private_data
= &priv
;
9558 priv
.insn_start
= pc
;
9560 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9563 ins
.op_out
[i
] = op_out
[i
];
9566 sizeflag
= priv
.orig_sizeflag
;
9568 switch (ckprefix (&ins
))
9574 /* Too many prefixes or unused REX prefixes. */
9576 i
< (int) ARRAY_SIZE (ins
.all_prefixes
) && ins
.all_prefixes
[i
];
9578 i386_dis_printf (info
, dis_style_mnemonic
, "%s%s",
9579 (i
== 0 ? "" : " "),
9580 prefix_name (ins
.address_mode
, ins
.all_prefixes
[i
],
9585 case ckp_fetch_error
:
9586 goto fetch_error_out
;
9589 ins
.nr_prefixes
= ins
.codep
- ins
.start_codep
;
9591 if (!fetch_code (info
, ins
.codep
+ 1))
9594 ret
= fetch_error (&ins
);
9598 ins
.two_source_ops
= (*ins
.codep
== 0x62 || *ins
.codep
== 0xc8);
9600 if ((ins
.prefixes
& PREFIX_FWAIT
)
9601 && (*ins
.codep
< 0xd8 || *ins
.codep
> 0xdf))
9603 /* Handle ins.prefixes before fwait. */
9604 for (i
= 0; i
< ins
.fwait_prefix
&& ins
.all_prefixes
[i
];
9606 i386_dis_printf (info
, dis_style_mnemonic
, "%s ",
9607 prefix_name (ins
.address_mode
, ins
.all_prefixes
[i
],
9609 i386_dis_printf (info
, dis_style_mnemonic
, "fwait");
9614 if (*ins
.codep
== 0x0f)
9616 unsigned char threebyte
;
9619 if (!fetch_code (info
, ins
.codep
+ 1))
9620 goto fetch_error_out
;
9621 threebyte
= *ins
.codep
;
9622 dp
= &dis386_twobyte
[threebyte
];
9623 ins
.need_modrm
= twobyte_has_modrm
[threebyte
];
9628 dp
= &dis386
[*ins
.codep
];
9629 ins
.need_modrm
= onebyte_has_modrm
[*ins
.codep
];
9633 /* Save sizeflag for printing the extra ins.prefixes later before updating
9634 it for mnemonic and operand processing. The prefix names depend
9635 only on the address mode. */
9636 orig_sizeflag
= sizeflag
;
9637 if (ins
.prefixes
& PREFIX_ADDR
)
9639 if ((ins
.prefixes
& PREFIX_DATA
))
9642 ins
.end_codep
= ins
.codep
;
9643 if (ins
.need_modrm
&& !fetch_modrm (&ins
))
9644 goto fetch_error_out
;
9646 if (dp
->name
== NULL
&& dp
->op
[0].bytemode
== FLOATCODE
)
9648 if (!get_sib (&ins
, sizeflag
)
9649 || !dofloat (&ins
, sizeflag
))
9650 goto fetch_error_out
;
9654 dp
= get_valid_dis386 (dp
, &ins
);
9655 if (dp
== &err_opcode
)
9656 goto fetch_error_out
;
9657 if (dp
!= NULL
&& putop (&ins
, dp
->name
, sizeflag
) == 0)
9659 if (!get_sib (&ins
, sizeflag
))
9660 goto fetch_error_out
;
9661 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9663 ins
.obufp
= ins
.op_out
[i
];
9664 ins
.op_ad
= MAX_OPERANDS
- 1 - i
;
9666 && !dp
->op
[i
].rtn (&ins
, dp
->op
[i
].bytemode
, sizeflag
))
9667 goto fetch_error_out
;
9668 /* For EVEX instruction after the last operand masking
9669 should be printed. */
9670 if (i
== 0 && ins
.vex
.evex
)
9672 /* Don't print {%k0}. */
9673 if (ins
.vex
.mask_register_specifier
)
9675 const char *reg_name
9676 = att_names_mask
[ins
.vex
.mask_register_specifier
];
9678 oappend (&ins
, "{");
9679 oappend_register (&ins
, reg_name
);
9680 oappend (&ins
, "}");
9682 if (ins
.vex
.zeroing
)
9683 oappend (&ins
, "{z}");
9685 else if (ins
.vex
.zeroing
)
9687 oappend (&ins
, "{bad}");
9691 /* Instructions with a mask register destination allow for
9692 zeroing-masking only (if any masking at all), which is
9693 _not_ expressed by EVEX.z. */
9694 if (ins
.vex
.zeroing
&& dp
->op
[0].bytemode
== mask_mode
)
9695 ins
.illegal_masking
= true;
9697 /* S/G insns require a mask and don't allow
9699 if ((dp
->op
[0].bytemode
== vex_vsib_d_w_dq_mode
9700 || dp
->op
[0].bytemode
== vex_vsib_q_w_dq_mode
)
9701 && (ins
.vex
.mask_register_specifier
== 0
9702 || ins
.vex
.zeroing
))
9703 ins
.illegal_masking
= true;
9705 if (ins
.illegal_masking
)
9706 oappend (&ins
, "/(bad)");
9710 /* Check whether rounding control was enabled for an insn not
9712 if (ins
.modrm
.mod
== 3 && ins
.vex
.b
9713 && !(ins
.evex_used
& EVEX_b_used
))
9715 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9717 ins
.obufp
= ins
.op_out
[i
];
9720 oappend (&ins
, names_rounding
[ins
.vex
.ll
]);
9721 oappend (&ins
, "bad}");
9728 /* Clear instruction information. */
9729 info
->insn_info_valid
= 0;
9730 info
->branch_delay_insns
= 0;
9731 info
->data_size
= 0;
9732 info
->insn_type
= dis_noninsn
;
9736 /* Reset jump operation indicator. */
9737 ins
.op_is_jump
= false;
9739 int jump_detection
= 0;
9741 /* Extract flags. */
9742 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9744 if ((dp
->op
[i
].rtn
== OP_J
)
9745 || (dp
->op
[i
].rtn
== OP_indirE
))
9746 jump_detection
|= 1;
9747 else if ((dp
->op
[i
].rtn
== BND_Fixup
)
9748 || (!dp
->op
[i
].rtn
&& !dp
->op
[i
].bytemode
))
9749 jump_detection
|= 2;
9750 else if ((dp
->op
[i
].bytemode
== cond_jump_mode
)
9751 || (dp
->op
[i
].bytemode
== loop_jcxz_mode
))
9752 jump_detection
|= 4;
9755 /* Determine if this is a jump or branch. */
9756 if ((jump_detection
& 0x3) == 0x3)
9758 ins
.op_is_jump
= true;
9759 if (jump_detection
& 0x4)
9760 info
->insn_type
= dis_condbranch
;
9762 info
->insn_type
= (dp
->name
&& !strncmp (dp
->name
, "call", 4))
9763 ? dis_jsr
: dis_branch
;
9767 /* If VEX.vvvv and EVEX.vvvv are unused, they must be all 1s, which
9768 are all 0s in inverted form. */
9769 if (ins
.need_vex
&& ins
.vex
.register_specifier
!= 0)
9771 i386_dis_printf (info
, dis_style_text
, "(bad)");
9772 ret
= ins
.end_codep
- priv
.the_buffer
;
9776 switch (dp
->prefix_requirement
)
9779 /* If only the data prefix is marked as mandatory, its absence renders
9780 the encoding invalid. Most other PREFIX_OPCODE rules still apply. */
9781 if (ins
.need_vex
? !ins
.vex
.prefix
: !(ins
.prefixes
& PREFIX_DATA
))
9783 i386_dis_printf (info
, dis_style_text
, "(bad)");
9784 ret
= ins
.end_codep
- priv
.the_buffer
;
9787 ins
.used_prefixes
|= PREFIX_DATA
;
9790 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
9791 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
9792 used by putop and MMX/SSE operand and may be overridden by the
9793 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
9796 ? ins
.vex
.prefix
== REPE_PREFIX_OPCODE
9797 || ins
.vex
.prefix
== REPNE_PREFIX_OPCODE
9799 & (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
9800 && (ins
.used_prefixes
9801 & (PREFIX_REPZ
| PREFIX_REPNZ
)) == 0)
9803 ? ins
.vex
.prefix
== DATA_PREFIX_OPCODE
9805 & (PREFIX_REPZ
| PREFIX_REPNZ
| PREFIX_DATA
))
9807 && (ins
.used_prefixes
& PREFIX_DATA
) == 0))
9808 || (ins
.vex
.evex
&& dp
->prefix_requirement
!= PREFIX_DATA
9809 && !ins
.vex
.w
!= !(ins
.used_prefixes
& PREFIX_DATA
)))
9811 i386_dis_printf (info
, dis_style_text
, "(bad)");
9812 ret
= ins
.end_codep
- priv
.the_buffer
;
9817 case PREFIX_IGNORED
:
9818 /* Zap data size and rep prefixes from used_prefixes and reinstate their
9819 origins in all_prefixes. */
9820 ins
.used_prefixes
&= ~PREFIX_OPCODE
;
9821 if (ins
.last_data_prefix
>= 0)
9822 ins
.all_prefixes
[ins
.last_data_prefix
] = 0x66;
9823 if (ins
.last_repz_prefix
>= 0)
9824 ins
.all_prefixes
[ins
.last_repz_prefix
] = 0xf3;
9825 if (ins
.last_repnz_prefix
>= 0)
9826 ins
.all_prefixes
[ins
.last_repnz_prefix
] = 0xf2;
9830 /* Check if the REX prefix is used. */
9831 if ((ins
.rex
^ ins
.rex_used
) == 0
9832 && !ins
.need_vex
&& ins
.last_rex_prefix
>= 0)
9833 ins
.all_prefixes
[ins
.last_rex_prefix
] = 0;
9835 /* Check if the SEG prefix is used. */
9836 if ((ins
.prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
| PREFIX_ES
9837 | PREFIX_FS
| PREFIX_GS
)) != 0
9838 && (ins
.used_prefixes
& ins
.active_seg_prefix
) != 0)
9839 ins
.all_prefixes
[ins
.last_seg_prefix
] = 0;
9841 /* Check if the ADDR prefix is used. */
9842 if ((ins
.prefixes
& PREFIX_ADDR
) != 0
9843 && (ins
.used_prefixes
& PREFIX_ADDR
) != 0)
9844 ins
.all_prefixes
[ins
.last_addr_prefix
] = 0;
9846 /* Check if the DATA prefix is used. */
9847 if ((ins
.prefixes
& PREFIX_DATA
) != 0
9848 && (ins
.used_prefixes
& PREFIX_DATA
) != 0
9850 ins
.all_prefixes
[ins
.last_data_prefix
] = 0;
9852 /* Print the extra ins.prefixes. */
9854 for (i
= 0; i
< (int) ARRAY_SIZE (ins
.all_prefixes
); i
++)
9855 if (ins
.all_prefixes
[i
])
9857 const char *name
= prefix_name (ins
.address_mode
, ins
.all_prefixes
[i
],
9862 prefix_length
+= strlen (name
) + 1;
9863 i386_dis_printf (info
, dis_style_mnemonic
, "%s ", name
);
9866 /* Check maximum code length. */
9867 if ((ins
.codep
- ins
.start_codep
) > MAX_CODE_LENGTH
)
9869 i386_dis_printf (info
, dis_style_text
, "(bad)");
9870 ret
= MAX_CODE_LENGTH
;
9874 /* Calculate the number of operands this instruction has. */
9876 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9877 if (*ins
.op_out
[i
] != '\0')
9880 /* Calculate the number of spaces to print after the mnemonic. */
9881 ins
.obufp
= ins
.mnemonicendp
;
9884 i
= strlen (ins
.obuf
) + prefix_length
;
9893 /* Print the instruction mnemonic along with any trailing whitespace. */
9894 i386_dis_printf (info
, dis_style_mnemonic
, "%s%*s", ins
.obuf
, i
, "");
9896 /* The enter and bound instructions are printed with operands in the same
9897 order as the intel book; everything else is printed in reverse order. */
9898 intel_swap_2_3
= false;
9899 if (ins
.intel_syntax
|| ins
.two_source_ops
)
9901 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9902 op_txt
[i
] = ins
.op_out
[i
];
9904 if (ins
.intel_syntax
&& dp
&& dp
->op
[2].rtn
== OP_Rounding
9905 && dp
->op
[3].rtn
== OP_E
&& dp
->op
[4].rtn
== NULL
)
9907 op_txt
[2] = ins
.op_out
[3];
9908 op_txt
[3] = ins
.op_out
[2];
9909 intel_swap_2_3
= true;
9912 for (i
= 0; i
< (MAX_OPERANDS
>> 1); ++i
)
9916 ins
.op_ad
= ins
.op_index
[i
];
9917 ins
.op_index
[i
] = ins
.op_index
[MAX_OPERANDS
- 1 - i
];
9918 ins
.op_index
[MAX_OPERANDS
- 1 - i
] = ins
.op_ad
;
9919 riprel
= ins
.op_riprel
[i
];
9920 ins
.op_riprel
[i
] = ins
.op_riprel
[MAX_OPERANDS
- 1 - i
];
9921 ins
.op_riprel
[MAX_OPERANDS
- 1 - i
] = riprel
;
9926 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9927 op_txt
[MAX_OPERANDS
- 1 - i
] = ins
.op_out
[i
];
9931 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9934 /* In Intel syntax embedded rounding / SAE are not separate operands.
9935 Instead they're attached to the prior register operand. Simply
9936 suppress emission of the comma to achieve that effect. */
9937 switch (i
& -(ins
.intel_syntax
&& dp
))
9940 if (dp
->op
[2].rtn
== OP_Rounding
&& !intel_swap_2_3
)
9944 if (dp
->op
[3].rtn
== OP_Rounding
|| intel_swap_2_3
)
9949 i386_dis_printf (info
, dis_style_text
, ",");
9950 if (ins
.op_index
[i
] != -1 && !ins
.op_riprel
[i
])
9952 bfd_vma target
= (bfd_vma
) ins
.op_address
[ins
.op_index
[i
]];
9956 info
->insn_info_valid
= 1;
9957 info
->branch_delay_insns
= 0;
9958 info
->data_size
= 0;
9959 info
->target
= target
;
9962 (*info
->print_address_func
) (target
, info
);
9965 i386_dis_printf (info
, dis_style_text
, "%s", op_txt
[i
]);
9969 for (i
= 0; i
< MAX_OPERANDS
; i
++)
9970 if (ins
.op_index
[i
] != -1 && ins
.op_riprel
[i
])
9972 i386_dis_printf (info
, dis_style_comment_start
, " # ");
9973 (*info
->print_address_func
)
9974 ((bfd_vma
)(ins
.start_pc
+ (ins
.codep
- ins
.start_codep
)
9975 + ins
.op_address
[ins
.op_index
[i
]]),
9979 ret
= ins
.codep
- priv
.the_buffer
;
9981 info
->private_data
= NULL
;
9985 /* Here for backwards compatibility. When gdb stops using
9986 print_insn_i386_att and print_insn_i386_intel these functions can
9987 disappear, and print_insn_i386 be merged into print_insn. */
9989 print_insn_i386_att (bfd_vma pc
, disassemble_info
*info
)
9991 return print_insn (pc
, info
, 0);
9995 print_insn_i386_intel (bfd_vma pc
, disassemble_info
*info
)
9997 return print_insn (pc
, info
, 1);
10001 print_insn_i386 (bfd_vma pc
, disassemble_info
*info
)
10003 return print_insn (pc
, info
, -1);
10006 static const char *float_mem
[] = {
10081 static const unsigned char float_mem_mode
[] = {
10156 #define ST { OP_ST, 0 }
10157 #define STi { OP_STi, 0 }
10159 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
10160 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
10161 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
10162 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
10163 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
10164 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
10165 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
10166 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
10167 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
10169 static const struct dis386 float_reg
[][8] = {
10172 { "fadd", { ST
, STi
}, 0 },
10173 { "fmul", { ST
, STi
}, 0 },
10174 { "fcom", { STi
}, 0 },
10175 { "fcomp", { STi
}, 0 },
10176 { "fsub", { ST
, STi
}, 0 },
10177 { "fsubr", { ST
, STi
}, 0 },
10178 { "fdiv", { ST
, STi
}, 0 },
10179 { "fdivr", { ST
, STi
}, 0 },
10183 { "fld", { STi
}, 0 },
10184 { "fxch", { STi
}, 0 },
10194 { "fcmovb", { ST
, STi
}, 0 },
10195 { "fcmove", { ST
, STi
}, 0 },
10196 { "fcmovbe",{ ST
, STi
}, 0 },
10197 { "fcmovu", { ST
, STi
}, 0 },
10205 { "fcmovnb",{ ST
, STi
}, 0 },
10206 { "fcmovne",{ ST
, STi
}, 0 },
10207 { "fcmovnbe",{ ST
, STi
}, 0 },
10208 { "fcmovnu",{ ST
, STi
}, 0 },
10210 { "fucomi", { ST
, STi
}, 0 },
10211 { "fcomi", { ST
, STi
}, 0 },
10216 { "fadd", { STi
, ST
}, 0 },
10217 { "fmul", { STi
, ST
}, 0 },
10220 { "fsub{!M|r}", { STi
, ST
}, 0 },
10221 { "fsub{M|}", { STi
, ST
}, 0 },
10222 { "fdiv{!M|r}", { STi
, ST
}, 0 },
10223 { "fdiv{M|}", { STi
, ST
}, 0 },
10227 { "ffree", { STi
}, 0 },
10229 { "fst", { STi
}, 0 },
10230 { "fstp", { STi
}, 0 },
10231 { "fucom", { STi
}, 0 },
10232 { "fucomp", { STi
}, 0 },
10238 { "faddp", { STi
, ST
}, 0 },
10239 { "fmulp", { STi
, ST
}, 0 },
10242 { "fsub{!M|r}p", { STi
, ST
}, 0 },
10243 { "fsub{M|}p", { STi
, ST
}, 0 },
10244 { "fdiv{!M|r}p", { STi
, ST
}, 0 },
10245 { "fdiv{M|}p", { STi
, ST
}, 0 },
10249 { "ffreep", { STi
}, 0 },
10254 { "fucomip", { ST
, STi
}, 0 },
10255 { "fcomip", { ST
, STi
}, 0 },
10260 static const char *const fgrps
[][8] = {
10263 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10268 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10273 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
10278 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
10283 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
10288 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
10293 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10298 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
10299 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
10304 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10309 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10314 swap_operand (instr_info
*ins
)
10316 ins
->mnemonicendp
[0] = '.';
10317 ins
->mnemonicendp
[1] = 's';
10318 ins
->mnemonicendp
[2] = '\0';
10319 ins
->mnemonicendp
+= 2;
10323 OP_Skip_MODRM (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10324 int sizeflag ATTRIBUTE_UNUSED
)
10326 /* Skip mod/rm byte. */
10333 dofloat (instr_info
*ins
, int sizeflag
)
10335 const struct dis386
*dp
;
10336 unsigned char floatop
= ins
->codep
[-1];
10338 if (ins
->modrm
.mod
!= 3)
10340 int fp_indx
= (floatop
- 0xd8) * 8 + ins
->modrm
.reg
;
10342 putop (ins
, float_mem
[fp_indx
], sizeflag
);
10343 ins
->obufp
= ins
->op_out
[0];
10345 return OP_E (ins
, float_mem_mode
[fp_indx
], sizeflag
);
10347 /* Skip mod/rm byte. */
10351 dp
= &float_reg
[floatop
- 0xd8][ins
->modrm
.reg
];
10352 if (dp
->name
== NULL
)
10354 putop (ins
, fgrps
[dp
->op
[0].bytemode
][ins
->modrm
.rm
], sizeflag
);
10356 /* Instruction fnstsw is only one with strange arg. */
10357 if (floatop
== 0xdf && ins
->codep
[-1] == 0xe0)
10358 strcpy (ins
->op_out
[0], att_names16
[0] + ins
->intel_syntax
);
10362 putop (ins
, dp
->name
, sizeflag
);
10364 ins
->obufp
= ins
->op_out
[0];
10367 && !dp
->op
[0].rtn (ins
, dp
->op
[0].bytemode
, sizeflag
))
10370 ins
->obufp
= ins
->op_out
[1];
10373 && !dp
->op
[1].rtn (ins
, dp
->op
[1].bytemode
, sizeflag
))
10380 OP_ST (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10381 int sizeflag ATTRIBUTE_UNUSED
)
10383 oappend_register (ins
, "%st");
10388 OP_STi (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10389 int sizeflag ATTRIBUTE_UNUSED
)
10392 int res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%st(%d)", ins
->modrm
.rm
);
10394 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
10396 oappend_register (ins
, scratch
);
10400 /* Capital letters in template are macros. */
10402 putop (instr_info
*ins
, const char *in_template
, int sizeflag
)
10407 unsigned int l
= 0, len
= 0;
10410 for (p
= in_template
; *p
; p
++)
10414 if (l
>= sizeof (last
) || !ISUPPER (*p
))
10422 *ins
->obufp
++ = *p
;
10431 if (ins
->intel_syntax
)
10433 while (*++p
!= '|')
10434 if (*p
== '}' || *p
== '\0')
10440 while (*++p
!= '}')
10450 if (ins
->intel_syntax
)
10452 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10453 || (sizeflag
& SUFFIX_ALWAYS
))
10454 *ins
->obufp
++ = 'b';
10460 if (ins
->intel_syntax
)
10462 if (sizeflag
& SUFFIX_ALWAYS
)
10463 *ins
->obufp
++ = 'b';
10465 else if (l
== 1 && last
[0] == 'L')
10467 if (ins
->address_mode
== mode_64bit
10468 && !(ins
->prefixes
& PREFIX_ADDR
))
10470 *ins
->obufp
++ = 'a';
10471 *ins
->obufp
++ = 'b';
10472 *ins
->obufp
++ = 's';
10481 if (ins
->intel_syntax
&& !alt
)
10483 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10485 if (sizeflag
& DFLAG
)
10486 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10488 *ins
->obufp
++ = ins
->intel_syntax
? 'w' : 's';
10489 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10498 if (!ins
->vex
.evex
|| ins
->vex
.w
)
10499 *ins
->obufp
++ = 'd';
10501 oappend (ins
, "{bad}");
10510 if (ins
->intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
10513 if (ins
->modrm
.mod
== 3)
10515 if (ins
->rex
& REX_W
)
10516 *ins
->obufp
++ = 'q';
10519 if (sizeflag
& DFLAG
)
10520 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10522 *ins
->obufp
++ = 'w';
10523 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10527 *ins
->obufp
++ = 'w';
10535 if (!ins
->vex
.evex
|| ins
->vex
.b
|| ins
->vex
.ll
>= 2
10537 || (ins
->modrm
.mod
== 3 && (ins
->rex
& REX_X
))
10538 || !ins
->vex
.v
|| ins
->vex
.mask_register_specifier
)
10540 /* AVX512 extends a number of V*D insns to also have V*Q variants,
10541 merely distinguished by EVEX.W. Look for a use of the
10542 respective macro. */
10545 const char *pct
= strchr (p
+ 1, '%');
10547 if (pct
!= NULL
&& pct
[1] == 'D' && pct
[2] == 'Q')
10550 *ins
->obufp
++ = '{';
10551 *ins
->obufp
++ = 'e';
10552 *ins
->obufp
++ = 'v';
10553 *ins
->obufp
++ = 'e';
10554 *ins
->obufp
++ = 'x';
10555 *ins
->obufp
++ = '}';
10556 *ins
->obufp
++ = ' ';
10563 /* For jcxz/jecxz */
10564 if (ins
->address_mode
== mode_64bit
)
10566 if (sizeflag
& AFLAG
)
10567 *ins
->obufp
++ = 'r';
10569 *ins
->obufp
++ = 'e';
10572 if (sizeflag
& AFLAG
)
10573 *ins
->obufp
++ = 'e';
10574 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10577 if (ins
->intel_syntax
)
10579 if ((ins
->prefixes
& PREFIX_ADDR
) || (sizeflag
& SUFFIX_ALWAYS
))
10581 if (sizeflag
& AFLAG
)
10582 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10584 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'l' : 'w';
10585 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10589 if (ins
->intel_syntax
|| (ins
->obufp
[-1] != 's'
10590 && !(sizeflag
& SUFFIX_ALWAYS
)))
10592 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
10593 *ins
->obufp
++ = 'l';
10595 *ins
->obufp
++ = 'w';
10596 if (!(ins
->rex
& REX_W
))
10597 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10602 if (ins
->intel_syntax
)
10604 if ((ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_CS
10605 || (ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_DS
)
10607 ins
->used_prefixes
|= ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
);
10608 *ins
->obufp
++ = ',';
10609 *ins
->obufp
++ = 'p';
10611 /* Set active_seg_prefix even if not set in 64-bit mode
10612 because here it is a valid branch hint. */
10613 if (ins
->prefixes
& PREFIX_DS
)
10615 ins
->active_seg_prefix
= PREFIX_DS
;
10616 *ins
->obufp
++ = 't';
10620 ins
->active_seg_prefix
= PREFIX_CS
;
10621 *ins
->obufp
++ = 'n';
10625 else if (l
== 1 && last
[0] == 'X')
10628 *ins
->obufp
++ = 'h';
10630 oappend (ins
, "{bad}");
10637 if (ins
->rex
& REX_W
)
10638 *ins
->obufp
++ = 'q';
10640 *ins
->obufp
++ = 'd';
10645 if (ins
->intel_mnemonic
!= cond
)
10646 *ins
->obufp
++ = 'r';
10649 if ((ins
->prefixes
& PREFIX_FWAIT
) == 0)
10650 *ins
->obufp
++ = 'n';
10652 ins
->used_prefixes
|= PREFIX_FWAIT
;
10656 if (ins
->rex
& REX_W
)
10657 *ins
->obufp
++ = 'o';
10658 else if (ins
->intel_syntax
&& (sizeflag
& DFLAG
))
10659 *ins
->obufp
++ = 'q';
10661 *ins
->obufp
++ = 'd';
10662 if (!(ins
->rex
& REX_W
))
10663 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10666 if (ins
->address_mode
== mode_64bit
10667 && (ins
->isa64
== intel64
|| (ins
->rex
& REX_W
)
10668 || !(ins
->prefixes
& PREFIX_DATA
)))
10670 if (sizeflag
& SUFFIX_ALWAYS
)
10671 *ins
->obufp
++ = 'q';
10674 /* Fall through. */
10678 if ((ins
->modrm
.mod
== 3 || !cond
)
10679 && !(sizeflag
& SUFFIX_ALWAYS
))
10681 /* Fall through. */
10683 if ((!(ins
->rex
& REX_W
) && (ins
->prefixes
& PREFIX_DATA
))
10684 || ((sizeflag
& SUFFIX_ALWAYS
)
10685 && ins
->address_mode
!= mode_64bit
))
10687 *ins
->obufp
++ = (sizeflag
& DFLAG
)
10688 ? ins
->intel_syntax
? 'd' : 'l' : 'w';
10689 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10691 else if (sizeflag
& SUFFIX_ALWAYS
)
10692 *ins
->obufp
++ = 'q';
10694 else if (l
== 1 && last
[0] == 'L')
10696 if ((ins
->prefixes
& PREFIX_DATA
)
10697 || (ins
->rex
& REX_W
)
10698 || (sizeflag
& SUFFIX_ALWAYS
))
10701 if (ins
->rex
& REX_W
)
10702 *ins
->obufp
++ = 'q';
10705 if (sizeflag
& DFLAG
)
10706 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10708 *ins
->obufp
++ = 'w';
10709 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10719 if (ins
->intel_syntax
&& !alt
)
10722 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10723 || (sizeflag
& SUFFIX_ALWAYS
))
10725 if (ins
->rex
& REX_W
)
10726 *ins
->obufp
++ = 'q';
10729 if (sizeflag
& DFLAG
)
10730 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10732 *ins
->obufp
++ = 'w';
10733 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10737 else if (l
== 1 && last
[0] == 'D')
10738 *ins
->obufp
++ = ins
->vex
.w
? 'q' : 'd';
10739 else if (l
== 1 && last
[0] == 'L')
10741 if (cond
? ins
->modrm
.mod
== 3 && !(sizeflag
& SUFFIX_ALWAYS
)
10742 : ins
->address_mode
!= mode_64bit
)
10744 if ((ins
->rex
& REX_W
))
10747 *ins
->obufp
++ = 'q';
10749 else if ((ins
->address_mode
== mode_64bit
&& cond
)
10750 || (sizeflag
& SUFFIX_ALWAYS
))
10751 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10758 if (ins
->rex
& REX_W
)
10759 *ins
->obufp
++ = 'q';
10760 else if (sizeflag
& DFLAG
)
10762 if (ins
->intel_syntax
)
10763 *ins
->obufp
++ = 'd';
10765 *ins
->obufp
++ = 'l';
10768 *ins
->obufp
++ = 'w';
10769 if (ins
->intel_syntax
&& !p
[1]
10770 && ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
)))
10771 *ins
->obufp
++ = 'e';
10772 if (!(ins
->rex
& REX_W
))
10773 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10779 if (ins
->intel_syntax
)
10781 if (sizeflag
& SUFFIX_ALWAYS
)
10783 if (ins
->rex
& REX_W
)
10784 *ins
->obufp
++ = 'q';
10787 if (sizeflag
& DFLAG
)
10788 *ins
->obufp
++ = 'l';
10790 *ins
->obufp
++ = 'w';
10791 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10801 if (ins
->address_mode
== mode_64bit
10802 && !(ins
->prefixes
& PREFIX_ADDR
))
10804 *ins
->obufp
++ = 'a';
10805 *ins
->obufp
++ = 'b';
10806 *ins
->obufp
++ = 's';
10811 if (!ins
->vex
.evex
|| !ins
->vex
.w
)
10812 *ins
->obufp
++ = 's';
10814 oappend (ins
, "{bad}");
10824 *ins
->obufp
++ = 'v';
10833 *ins
->obufp
++ = '{';
10834 *ins
->obufp
++ = 'v';
10835 *ins
->obufp
++ = 'e';
10836 *ins
->obufp
++ = 'x';
10837 *ins
->obufp
++ = '}';
10838 *ins
->obufp
++ = ' ';
10841 if (ins
->rex
& REX_W
)
10843 *ins
->obufp
++ = 'a';
10844 *ins
->obufp
++ = 'b';
10845 *ins
->obufp
++ = 's';
10858 /* operand size flag for cwtl, cbtw */
10860 if (ins
->rex
& REX_W
)
10862 if (ins
->intel_syntax
)
10863 *ins
->obufp
++ = 'd';
10865 *ins
->obufp
++ = 'l';
10867 else if (sizeflag
& DFLAG
)
10868 *ins
->obufp
++ = 'w';
10870 *ins
->obufp
++ = 'b';
10871 if (!(ins
->rex
& REX_W
))
10872 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10876 if (!ins
->need_vex
)
10878 if (last
[0] == 'X')
10879 *ins
->obufp
++ = ins
->vex
.w
? 'd': 's';
10880 else if (last
[0] == 'B')
10881 *ins
->obufp
++ = ins
->vex
.w
? 'w': 'b';
10892 ? ins
->vex
.prefix
== DATA_PREFIX_OPCODE
10893 : ins
->prefixes
& PREFIX_DATA
)
10895 *ins
->obufp
++ = 'd';
10896 ins
->used_prefixes
|= PREFIX_DATA
;
10899 *ins
->obufp
++ = 's';
10904 if (ins
->vex
.mask_register_specifier
)
10905 ins
->illegal_masking
= true;
10907 else if (l
== 1 && last
[0] == 'X')
10909 if (!ins
->need_vex
)
10911 if (ins
->intel_syntax
10912 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
10913 && !(sizeflag
& SUFFIX_ALWAYS
)))
10915 switch (ins
->vex
.length
)
10918 *ins
->obufp
++ = 'x';
10921 *ins
->obufp
++ = 'y';
10924 if (!ins
->vex
.evex
)
10935 /* These insns ignore ModR/M.mod: Force it to 3 for OP_E(). */
10936 ins
->modrm
.mod
= 3;
10937 if (!ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
10938 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10940 else if (l
== 1 && last
[0] == 'X')
10942 if (!ins
->vex
.evex
)
10944 if (ins
->intel_syntax
10945 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
10946 && !(sizeflag
& SUFFIX_ALWAYS
)))
10948 switch (ins
->vex
.length
)
10951 *ins
->obufp
++ = 'x';
10954 *ins
->obufp
++ = 'y';
10957 *ins
->obufp
++ = 'z';
10967 if (ins
->intel_syntax
)
10969 if (ins
->isa64
== intel64
&& (ins
->rex
& REX_W
))
10972 *ins
->obufp
++ = 'q';
10975 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10977 if (sizeflag
& DFLAG
)
10978 *ins
->obufp
++ = 'l';
10980 *ins
->obufp
++ = 'w';
10981 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10990 ins
->mnemonicendp
= ins
->obufp
;
10994 /* Add a style marker to *INS->obufp that encodes STYLE. This assumes that
10995 the buffer pointed to by INS->obufp has space. A style marker is made
10996 from the STYLE_MARKER_CHAR followed by STYLE converted to a single hex
10997 digit, followed by another STYLE_MARKER_CHAR. This function assumes
10998 that the number of styles is not greater than 16. */
11001 oappend_insert_style (instr_info
*ins
, enum disassembler_style style
)
11003 unsigned num
= (unsigned) style
;
11005 /* We currently assume that STYLE can be encoded as a single hex
11006 character. If more styles are added then this might start to fail,
11007 and we'll need to expand this code. */
11011 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11012 *ins
->obufp
++ = (num
< 10 ? ('0' + num
)
11013 : ((num
< 16) ? ('a' + (num
- 10)) : '0'));
11014 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11016 /* This final null character is not strictly necessary, after inserting a
11017 style marker we should always be inserting some additional content.
11018 However, having the buffer null terminated doesn't cost much, and make
11019 it easier to debug what's going on. Also, if we do ever forget to add
11020 any additional content after this style marker, then the buffer will
11021 still be well formed. */
11022 *ins
->obufp
= '\0';
11026 oappend_with_style (instr_info
*ins
, const char *s
,
11027 enum disassembler_style style
)
11029 oappend_insert_style (ins
, style
);
11030 ins
->obufp
= stpcpy (ins
->obufp
, s
);
11033 /* Add a single character C to the buffer pointer to by INS->obufp, marking
11034 the style for the character as STYLE. */
11037 oappend_char_with_style (instr_info
*ins
, const char c
,
11038 enum disassembler_style style
)
11040 oappend_insert_style (ins
, style
);
11042 *ins
->obufp
= '\0';
11045 /* Like oappend_char_with_style, but always uses dis_style_text. */
11048 oappend_char (instr_info
*ins
, const char c
)
11050 oappend_char_with_style (ins
, c
, dis_style_text
);
11054 append_seg (instr_info
*ins
)
11056 /* Only print the active segment register. */
11057 if (!ins
->active_seg_prefix
)
11060 ins
->used_prefixes
|= ins
->active_seg_prefix
;
11061 switch (ins
->active_seg_prefix
)
11064 oappend_register (ins
, att_names_seg
[1]);
11067 oappend_register (ins
, att_names_seg
[3]);
11070 oappend_register (ins
, att_names_seg
[2]);
11073 oappend_register (ins
, att_names_seg
[0]);
11076 oappend_register (ins
, att_names_seg
[4]);
11079 oappend_register (ins
, att_names_seg
[5]);
11084 oappend_char (ins
, ':');
11088 OP_indirE (instr_info
*ins
, int bytemode
, int sizeflag
)
11090 if (!ins
->intel_syntax
)
11091 oappend (ins
, "*");
11092 return OP_E (ins
, bytemode
, sizeflag
);
11096 print_operand_value (instr_info
*ins
, bfd_vma disp
,
11097 enum disassembler_style style
)
11101 if (ins
->address_mode
!= mode_64bit
)
11102 disp
&= 0xffffffff;
11103 sprintf (tmp
, "0x%" PRIx64
, (uint64_t) disp
);
11104 oappend_with_style (ins
, tmp
, style
);
11107 /* Like oappend, but called for immediate operands. */
11110 oappend_immediate (instr_info
*ins
, bfd_vma imm
)
11112 if (!ins
->intel_syntax
)
11113 oappend_char_with_style (ins
, '$', dis_style_immediate
);
11114 print_operand_value (ins
, imm
, dis_style_immediate
);
11117 /* Put DISP in BUF as signed hex number. */
11120 print_displacement (instr_info
*ins
, bfd_signed_vma val
)
11126 oappend_char_with_style (ins
, '-', dis_style_address_offset
);
11127 val
= (bfd_vma
) 0 - val
;
11129 /* Check for possible overflow. */
11132 switch (ins
->address_mode
)
11135 oappend_with_style (ins
, "0x8000000000000000",
11136 dis_style_address_offset
);
11139 oappend_with_style (ins
, "0x80000000",
11140 dis_style_address_offset
);
11143 oappend_with_style (ins
, "0x8000",
11144 dis_style_address_offset
);
11151 sprintf (tmp
, "0x%" PRIx64
, (int64_t) val
);
11152 oappend_with_style (ins
, tmp
, dis_style_address_offset
);
11156 intel_operand_size (instr_info
*ins
, int bytemode
, int sizeflag
)
11160 if (!ins
->vex
.no_broadcast
)
11164 case evex_half_bcst_xmmq_mode
:
11166 oappend (ins
, "QWORD BCST ");
11168 oappend (ins
, "DWORD BCST ");
11171 case evex_half_bcst_xmmqh_mode
:
11172 case evex_half_bcst_xmmqdh_mode
:
11173 oappend (ins
, "WORD BCST ");
11176 ins
->vex
.no_broadcast
= true;
11186 oappend (ins
, "BYTE PTR ");
11191 oappend (ins
, "WORD PTR ");
11194 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11196 oappend (ins
, "QWORD PTR ");
11199 /* Fall through. */
11201 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11202 || (ins
->rex
& REX_W
)))
11204 oappend (ins
, "QWORD PTR ");
11207 /* Fall through. */
11212 if (ins
->rex
& REX_W
)
11213 oappend (ins
, "QWORD PTR ");
11214 else if (bytemode
== dq_mode
)
11215 oappend (ins
, "DWORD PTR ");
11218 if (sizeflag
& DFLAG
)
11219 oappend (ins
, "DWORD PTR ");
11221 oappend (ins
, "WORD PTR ");
11222 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11226 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
11227 *ins
->obufp
++ = 'D';
11228 oappend (ins
, "WORD PTR ");
11229 if (!(ins
->rex
& REX_W
))
11230 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11233 if (sizeflag
& DFLAG
)
11234 oappend (ins
, "QWORD PTR ");
11236 oappend (ins
, "DWORD PTR ");
11237 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11240 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11241 oappend (ins
, "WORD PTR ");
11243 oappend (ins
, "DWORD PTR ");
11244 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11248 oappend (ins
, "DWORD PTR ");
11252 oappend (ins
, "QWORD PTR ");
11255 if (ins
->address_mode
== mode_64bit
)
11256 oappend (ins
, "QWORD PTR ");
11258 oappend (ins
, "DWORD PTR ");
11261 if (sizeflag
& DFLAG
)
11262 oappend (ins
, "FWORD PTR ");
11264 oappend (ins
, "DWORD PTR ");
11265 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11268 oappend (ins
, "TBYTE PTR ");
11273 case evex_x_gscat_mode
:
11274 case evex_x_nobcst_mode
:
11278 switch (ins
->vex
.length
)
11281 oappend (ins
, "XMMWORD PTR ");
11284 oappend (ins
, "YMMWORD PTR ");
11287 oappend (ins
, "ZMMWORD PTR ");
11294 oappend (ins
, "XMMWORD PTR ");
11297 oappend (ins
, "XMMWORD PTR ");
11300 oappend (ins
, "YMMWORD PTR ");
11303 case evex_half_bcst_xmmqh_mode
:
11304 case evex_half_bcst_xmmq_mode
:
11305 switch (ins
->vex
.length
)
11309 oappend (ins
, "QWORD PTR ");
11312 oappend (ins
, "XMMWORD PTR ");
11315 oappend (ins
, "YMMWORD PTR ");
11322 if (!ins
->need_vex
)
11325 switch (ins
->vex
.length
)
11328 oappend (ins
, "WORD PTR ");
11331 oappend (ins
, "DWORD PTR ");
11334 oappend (ins
, "QWORD PTR ");
11341 case evex_half_bcst_xmmqdh_mode
:
11342 if (!ins
->need_vex
)
11345 switch (ins
->vex
.length
)
11348 oappend (ins
, "DWORD PTR ");
11351 oappend (ins
, "QWORD PTR ");
11354 oappend (ins
, "XMMWORD PTR ");
11361 if (!ins
->need_vex
)
11364 switch (ins
->vex
.length
)
11367 oappend (ins
, "QWORD PTR ");
11370 oappend (ins
, "YMMWORD PTR ");
11373 oappend (ins
, "ZMMWORD PTR ");
11380 oappend (ins
, "OWORD PTR ");
11382 case vex_vsib_d_w_dq_mode
:
11383 case vex_vsib_q_w_dq_mode
:
11384 if (!ins
->need_vex
)
11387 oappend (ins
, "QWORD PTR ");
11389 oappend (ins
, "DWORD PTR ");
11392 if (!ins
->need_vex
|| ins
->vex
.length
!= 128)
11395 oappend (ins
, "DWORD PTR ");
11397 oappend (ins
, "BYTE PTR ");
11400 if (!ins
->need_vex
)
11403 oappend (ins
, "QWORD PTR ");
11405 oappend (ins
, "WORD PTR ");
11415 print_register (instr_info
*ins
, unsigned int reg
, unsigned int rexmask
,
11416 int bytemode
, int sizeflag
)
11418 const char (*names
)[8];
11420 /* Masking is invalid for insns with GPR destination. Set the flag uniformly,
11421 as the consumer will inspect it only for the destination operand. */
11422 if (bytemode
!= mask_mode
&& ins
->vex
.mask_register_specifier
)
11423 ins
->illegal_masking
= true;
11425 USED_REX (rexmask
);
11426 if (ins
->rex
& rexmask
)
11436 names
= att_names8rex
;
11438 names
= att_names8
;
11441 names
= att_names16
;
11446 names
= att_names32
;
11449 names
= att_names64
;
11453 names
= ins
->address_mode
== mode_64bit
? att_names64
: att_names32
;
11456 case bnd_swap_mode
:
11459 oappend (ins
, "(bad)");
11462 names
= att_names_bnd
;
11465 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11467 names
= att_names64
;
11470 /* Fall through. */
11472 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11473 || (ins
->rex
& REX_W
)))
11475 names
= att_names64
;
11479 /* Fall through. */
11484 if (ins
->rex
& REX_W
)
11485 names
= att_names64
;
11486 else if (bytemode
!= v_mode
&& bytemode
!= v_swap_mode
)
11487 names
= att_names32
;
11490 if (sizeflag
& DFLAG
)
11491 names
= att_names32
;
11493 names
= att_names16
;
11494 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11498 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11499 names
= att_names16
;
11501 names
= att_names32
;
11502 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11505 names
= (ins
->address_mode
== mode_64bit
11506 ? att_names64
: att_names32
);
11507 if (!(ins
->prefixes
& PREFIX_ADDR
))
11508 names
= (ins
->address_mode
== mode_16bit
11509 ? att_names16
: names
);
11512 /* Remove "addr16/addr32". */
11513 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
11514 names
= (ins
->address_mode
!= mode_32bit
11515 ? att_names32
: att_names16
);
11516 ins
->used_prefixes
|= PREFIX_ADDR
;
11523 oappend (ins
, "(bad)");
11526 names
= att_names_mask
;
11531 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
11534 oappend_register (ins
, names
[reg
]);
11538 get8s (instr_info
*ins
, bfd_vma
*res
)
11540 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
11542 *res
= ((bfd_vma
) *ins
->codep
++ ^ 0x80) - 0x80;
11547 get16 (instr_info
*ins
, bfd_vma
*res
)
11549 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
11551 *res
= *ins
->codep
++;
11552 *res
|= (bfd_vma
) *ins
->codep
++ << 8;
11557 get16s (instr_info
*ins
, bfd_vma
*res
)
11559 if (!get16 (ins
, res
))
11561 *res
= (*res
^ 0x8000) - 0x8000;
11566 get32 (instr_info
*ins
, bfd_vma
*res
)
11568 if (!fetch_code (ins
->info
, ins
->codep
+ 4))
11570 *res
= *ins
->codep
++;
11571 *res
|= (bfd_vma
) *ins
->codep
++ << 8;
11572 *res
|= (bfd_vma
) *ins
->codep
++ << 16;
11573 *res
|= (bfd_vma
) *ins
->codep
++ << 24;
11578 get32s (instr_info
*ins
, bfd_vma
*res
)
11580 if (!get32 (ins
, res
))
11583 *res
= (*res
^ ((bfd_vma
) 1 << 31)) - ((bfd_vma
) 1 << 31);
11589 get64 (instr_info
*ins
, uint64_t *res
)
11594 if (!fetch_code (ins
->info
, ins
->codep
+ 8))
11597 a
|= (unsigned int) *ins
->codep
++ << 8;
11598 a
|= (unsigned int) *ins
->codep
++ << 16;
11599 a
|= (unsigned int) *ins
->codep
++ << 24;
11601 b
|= (unsigned int) *ins
->codep
++ << 8;
11602 b
|= (unsigned int) *ins
->codep
++ << 16;
11603 b
|= (unsigned int) *ins
->codep
++ << 24;
11604 *res
= a
+ ((uint64_t) b
<< 32);
11609 set_op (instr_info
*ins
, bfd_vma op
, bool riprel
)
11611 ins
->op_index
[ins
->op_ad
] = ins
->op_ad
;
11612 if (ins
->address_mode
== mode_64bit
)
11613 ins
->op_address
[ins
->op_ad
] = op
;
11614 else /* Mask to get a 32-bit address. */
11615 ins
->op_address
[ins
->op_ad
] = op
& 0xffffffff;
11616 ins
->op_riprel
[ins
->op_ad
] = riprel
;
11620 BadOp (instr_info
*ins
)
11622 /* Throw away prefixes and 1st. opcode byte. */
11623 struct dis_private
*priv
= ins
->info
->private_data
;
11625 ins
->codep
= priv
->the_buffer
+ ins
->nr_prefixes
+ 1;
11626 ins
->obufp
= stpcpy (ins
->obufp
, "(bad)");
11631 OP_E_memory (instr_info
*ins
, int bytemode
, int sizeflag
)
11633 int add
= (ins
->rex
& REX_B
) ? 8 : 0;
11640 /* Zeroing-masking is invalid for memory destinations. Set the flag
11641 uniformly, as the consumer will inspect it only for the destination
11643 if (ins
->vex
.zeroing
)
11644 ins
->illegal_masking
= true;
11658 if (ins
->address_mode
!= mode_64bit
)
11666 case vex_vsib_d_w_dq_mode
:
11667 case vex_vsib_q_w_dq_mode
:
11668 case evex_x_gscat_mode
:
11669 shift
= ins
->vex
.w
? 3 : 2;
11672 case evex_half_bcst_xmmqh_mode
:
11673 case evex_half_bcst_xmmqdh_mode
:
11676 shift
= ins
->vex
.w
? 2 : 1;
11679 /* Fall through. */
11681 case evex_half_bcst_xmmq_mode
:
11684 shift
= ins
->vex
.w
? 3 : 2;
11687 /* Fall through. */
11692 case evex_x_nobcst_mode
:
11694 switch (ins
->vex
.length
)
11708 /* Make necessary corrections to shift for modes that need it. */
11709 if (bytemode
== xmmq_mode
11710 || bytemode
== evex_half_bcst_xmmqh_mode
11711 || bytemode
== evex_half_bcst_xmmq_mode
11712 || (bytemode
== ymmq_mode
&& ins
->vex
.length
== 128))
11714 else if (bytemode
== xmmqd_mode
11715 || bytemode
== evex_half_bcst_xmmqdh_mode
)
11717 else if (bytemode
== xmmdw_mode
)
11731 shift
= ins
->vex
.w
? 1 : 0;
11741 if (ins
->intel_syntax
)
11742 intel_operand_size (ins
, bytemode
, sizeflag
);
11745 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
11747 /* 32/64 bit address mode */
11756 int addr32flag
= !((sizeflag
& AFLAG
)
11757 || bytemode
== v_bnd_mode
11758 || bytemode
== v_bndmk_mode
11759 || bytemode
== bnd_mode
11760 || bytemode
== bnd_swap_mode
);
11761 bool check_gather
= false;
11762 const char (*indexes
)[8] = NULL
;
11765 base
= ins
->modrm
.rm
;
11769 vindex
= ins
->sib
.index
;
11771 if (ins
->rex
& REX_X
)
11775 case vex_vsib_d_w_dq_mode
:
11776 case vex_vsib_q_w_dq_mode
:
11777 if (!ins
->need_vex
)
11783 check_gather
= ins
->obufp
== ins
->op_out
[1];
11786 switch (ins
->vex
.length
)
11789 indexes
= att_names_xmm
;
11793 || bytemode
== vex_vsib_q_w_dq_mode
)
11794 indexes
= att_names_ymm
;
11796 indexes
= att_names_xmm
;
11800 || bytemode
== vex_vsib_q_w_dq_mode
)
11801 indexes
= att_names_zmm
;
11803 indexes
= att_names_ymm
;
11811 indexes
= ins
->address_mode
== mode_64bit
&& !addr32flag
11812 ? att_names64
: att_names32
;
11815 scale
= ins
->sib
.scale
;
11816 base
= ins
->sib
.base
;
11821 /* Check for mandatory SIB. */
11822 if (bytemode
== vex_vsib_d_w_dq_mode
11823 || bytemode
== vex_vsib_q_w_dq_mode
11824 || bytemode
== vex_sibmem_mode
)
11826 oappend (ins
, "(bad)");
11830 rbase
= base
+ add
;
11832 switch (ins
->modrm
.mod
)
11838 if (ins
->address_mode
== mode_64bit
&& !ins
->has_sib
)
11840 if (!get32s (ins
, &disp
))
11842 if (riprel
&& bytemode
== v_bndmk_mode
)
11844 oappend (ins
, "(bad)");
11850 if (!get8s (ins
, &disp
))
11852 if (ins
->vex
.evex
&& shift
> 0)
11856 if (!get32s (ins
, &disp
))
11866 && ins
->address_mode
!= mode_16bit
)
11868 if (ins
->address_mode
== mode_64bit
)
11872 /* Without base nor index registers, zero-extend the
11873 lower 32-bit displacement to 64 bits. */
11874 disp
&= 0xffffffff;
11881 /* In 32-bit mode, we need index register to tell [offset]
11882 from [eiz*1 + offset]. */
11887 havedisp
= (havebase
11889 || (ins
->has_sib
&& (indexes
|| scale
!= 0)));
11891 if (!ins
->intel_syntax
)
11892 if (ins
->modrm
.mod
!= 0 || base
== 5)
11894 if (havedisp
|| riprel
)
11895 print_displacement (ins
, disp
);
11897 print_operand_value (ins
, disp
, dis_style_address_offset
);
11900 set_op (ins
, disp
, true);
11901 oappend_char (ins
, '(');
11902 oappend_with_style (ins
, !addr32flag
? "%rip" : "%eip",
11903 dis_style_register
);
11904 oappend_char (ins
, ')');
11908 if ((havebase
|| indexes
|| needindex
|| needaddr32
|| riprel
)
11909 && (ins
->address_mode
!= mode_64bit
11910 || ((bytemode
!= v_bnd_mode
)
11911 && (bytemode
!= v_bndmk_mode
)
11912 && (bytemode
!= bnd_mode
)
11913 && (bytemode
!= bnd_swap_mode
))))
11914 ins
->used_prefixes
|= PREFIX_ADDR
;
11916 if (havedisp
|| (ins
->intel_syntax
&& riprel
))
11918 oappend_char (ins
, ins
->open_char
);
11919 if (ins
->intel_syntax
&& riprel
)
11921 set_op (ins
, disp
, true);
11922 oappend_with_style (ins
, !addr32flag
? "rip" : "eip",
11923 dis_style_register
);
11928 (ins
->address_mode
== mode_64bit
&& !addr32flag
11929 ? att_names64
: att_names32
)[rbase
]);
11932 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
11933 print index to tell base + index from base. */
11937 || (havebase
&& base
!= ESP_REG_NUM
))
11939 if (!ins
->intel_syntax
|| havebase
)
11940 oappend_char (ins
, ins
->separator_char
);
11943 if (ins
->address_mode
== mode_64bit
|| vindex
< 16)
11944 oappend_register (ins
, indexes
[vindex
]);
11946 oappend (ins
, "(bad)");
11949 oappend_register (ins
,
11950 ins
->address_mode
== mode_64bit
11955 oappend_char (ins
, ins
->scale_char
);
11956 oappend_char_with_style (ins
, '0' + (1 << scale
),
11957 dis_style_immediate
);
11960 if (ins
->intel_syntax
11961 && (disp
|| ins
->modrm
.mod
!= 0 || base
== 5))
11963 if (!havedisp
|| (bfd_signed_vma
) disp
>= 0)
11964 oappend_char (ins
, '+');
11966 print_displacement (ins
, disp
);
11968 print_operand_value (ins
, disp
, dis_style_address_offset
);
11971 oappend_char (ins
, ins
->close_char
);
11975 /* Both XMM/YMM/ZMM registers must be distinct. */
11976 int modrm_reg
= ins
->modrm
.reg
;
11978 if (ins
->rex
& REX_R
)
11982 if (vindex
== modrm_reg
)
11983 oappend (ins
, "/(bad)");
11986 else if (ins
->intel_syntax
)
11988 if (ins
->modrm
.mod
!= 0 || base
== 5)
11990 if (!ins
->active_seg_prefix
)
11992 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
11993 oappend (ins
, ":");
11995 print_operand_value (ins
, disp
, dis_style_text
);
11999 else if (bytemode
== v_bnd_mode
12000 || bytemode
== v_bndmk_mode
12001 || bytemode
== bnd_mode
12002 || bytemode
== bnd_swap_mode
12003 || bytemode
== vex_vsib_d_w_dq_mode
12004 || bytemode
== vex_vsib_q_w_dq_mode
)
12006 oappend (ins
, "(bad)");
12011 /* 16 bit address mode */
12014 ins
->used_prefixes
|= ins
->prefixes
& PREFIX_ADDR
;
12015 switch (ins
->modrm
.mod
)
12018 if (ins
->modrm
.rm
== 6)
12021 if (!get16s (ins
, &disp
))
12026 if (!get8s (ins
, &disp
))
12028 if (ins
->vex
.evex
&& shift
> 0)
12033 if (!ins
->intel_syntax
)
12034 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6)
12035 print_displacement (ins
, disp
);
12037 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 6)
12039 oappend_char (ins
, ins
->open_char
);
12040 oappend (ins
, ins
->intel_syntax
? intel_index16
[ins
->modrm
.rm
]
12041 : att_index16
[ins
->modrm
.rm
]);
12042 if (ins
->intel_syntax
12043 && (disp
|| ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6))
12045 if ((bfd_signed_vma
) disp
>= 0)
12046 oappend_char (ins
, '+');
12047 print_displacement (ins
, disp
);
12050 oappend_char (ins
, ins
->close_char
);
12052 else if (ins
->intel_syntax
)
12054 if (!ins
->active_seg_prefix
)
12056 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12057 oappend (ins
, ":");
12059 print_operand_value (ins
, disp
& 0xffff, dis_style_text
);
12064 ins
->evex_used
|= EVEX_b_used
;
12066 /* Broadcast can only ever be valid for memory sources. */
12067 if (ins
->obufp
== ins
->op_out
[0])
12068 ins
->vex
.no_broadcast
= true;
12070 if (!ins
->vex
.no_broadcast
12071 && (!ins
->intel_syntax
|| !(ins
->evex_used
& EVEX_len_used
)))
12073 if (bytemode
== xh_mode
)
12075 switch (ins
->vex
.length
)
12078 oappend (ins
, "{1to8}");
12081 oappend (ins
, "{1to16}");
12084 oappend (ins
, "{1to32}");
12090 else if (bytemode
== q_mode
12091 || bytemode
== ymmq_mode
)
12092 ins
->vex
.no_broadcast
= true;
12093 else if (ins
->vex
.w
12094 || bytemode
== evex_half_bcst_xmmqdh_mode
12095 || bytemode
== evex_half_bcst_xmmq_mode
)
12097 switch (ins
->vex
.length
)
12100 oappend (ins
, "{1to2}");
12103 oappend (ins
, "{1to4}");
12106 oappend (ins
, "{1to8}");
12112 else if (bytemode
== x_mode
12113 || bytemode
== evex_half_bcst_xmmqh_mode
)
12115 switch (ins
->vex
.length
)
12118 oappend (ins
, "{1to4}");
12121 oappend (ins
, "{1to8}");
12124 oappend (ins
, "{1to16}");
12131 ins
->vex
.no_broadcast
= true;
12133 if (ins
->vex
.no_broadcast
)
12134 oappend (ins
, "{bad}");
12141 OP_E (instr_info
*ins
, int bytemode
, int sizeflag
)
12143 /* Skip mod/rm byte. */
12147 if (ins
->modrm
.mod
== 3)
12149 if ((sizeflag
& SUFFIX_ALWAYS
)
12150 && (bytemode
== b_swap_mode
12151 || bytemode
== bnd_swap_mode
12152 || bytemode
== v_swap_mode
))
12153 swap_operand (ins
);
12155 print_register (ins
, ins
->modrm
.rm
, REX_B
, bytemode
, sizeflag
);
12159 /* Masking is invalid for insns with GPR-like memory destination. Set the
12160 flag uniformly, as the consumer will inspect it only for the destination
12162 if (ins
->vex
.mask_register_specifier
)
12163 ins
->illegal_masking
= true;
12165 return OP_E_memory (ins
, bytemode
, sizeflag
);
12169 OP_G (instr_info
*ins
, int bytemode
, int sizeflag
)
12171 if (ins
->vex
.evex
&& !ins
->vex
.r
&& ins
->address_mode
== mode_64bit
)
12172 oappend (ins
, "(bad)");
12174 print_register (ins
, ins
->modrm
.reg
, REX_R
, bytemode
, sizeflag
);
12179 OP_REG (instr_info
*ins
, int code
, int sizeflag
)
12186 case es_reg
: case ss_reg
: case cs_reg
:
12187 case ds_reg
: case fs_reg
: case gs_reg
:
12188 oappend_register (ins
, att_names_seg
[code
- es_reg
]);
12193 if (ins
->rex
& REX_B
)
12200 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
12201 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
12202 s
= att_names16
[code
- ax_reg
+ add
];
12204 case ah_reg
: case ch_reg
: case dh_reg
: case bh_reg
:
12206 /* Fall through. */
12207 case al_reg
: case cl_reg
: case dl_reg
: case bl_reg
:
12209 s
= att_names8rex
[code
- al_reg
+ add
];
12211 s
= att_names8
[code
- al_reg
];
12213 case rAX_reg
: case rCX_reg
: case rDX_reg
: case rBX_reg
:
12214 case rSP_reg
: case rBP_reg
: case rSI_reg
: case rDI_reg
:
12215 if (ins
->address_mode
== mode_64bit
12216 && ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12218 s
= att_names64
[code
- rAX_reg
+ add
];
12221 code
+= eAX_reg
- rAX_reg
;
12222 /* Fall through. */
12223 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
12224 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
12226 if (ins
->rex
& REX_W
)
12227 s
= att_names64
[code
- eAX_reg
+ add
];
12230 if (sizeflag
& DFLAG
)
12231 s
= att_names32
[code
- eAX_reg
+ add
];
12233 s
= att_names16
[code
- eAX_reg
+ add
];
12234 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12238 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12241 oappend_register (ins
, s
);
12246 OP_IMREG (instr_info
*ins
, int code
, int sizeflag
)
12253 if (!ins
->intel_syntax
)
12255 oappend (ins
, "(%dx)");
12258 s
= att_names16
[dx_reg
- ax_reg
];
12260 case al_reg
: case cl_reg
:
12261 s
= att_names8
[code
- al_reg
];
12265 if (ins
->rex
& REX_W
)
12270 /* Fall through. */
12271 case z_mode_ax_reg
:
12272 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
12276 if (!(ins
->rex
& REX_W
))
12277 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12280 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12283 oappend_register (ins
, s
);
12288 OP_I (instr_info
*ins
, int bytemode
, int sizeflag
)
12295 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
12297 op
= *ins
->codep
++;
12301 if (ins
->rex
& REX_W
)
12303 if (!get32s (ins
, &op
))
12308 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12309 if (sizeflag
& DFLAG
)
12312 if (!get32 (ins
, &op
))
12317 /* Fall through. */
12319 if (!get16 (ins
, &op
))
12325 if (ins
->intel_syntax
)
12326 oappend (ins
, "1");
12329 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12333 oappend_immediate (ins
, op
);
12338 OP_I64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12342 if (bytemode
!= v_mode
|| ins
->address_mode
!= mode_64bit
12343 || !(ins
->rex
& REX_W
))
12344 return OP_I (ins
, bytemode
, sizeflag
);
12348 if (!get64 (ins
, &op
))
12351 oappend_immediate (ins
, op
);
12356 OP_sI (instr_info
*ins
, int bytemode
, int sizeflag
)
12364 if (!get8s (ins
, &op
))
12366 if (bytemode
== b_T_mode
)
12368 if (ins
->address_mode
!= mode_64bit
12369 || !((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12371 /* The operand-size prefix is overridden by a REX prefix. */
12372 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12380 if (!(ins
->rex
& REX_W
))
12382 if (sizeflag
& DFLAG
)
12390 /* The operand-size prefix is overridden by a REX prefix. */
12391 if (!(sizeflag
& DFLAG
) && !(ins
->rex
& REX_W
))
12393 if (!get16 (ins
, &op
))
12396 else if (!get32s (ins
, &op
))
12400 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12404 oappend_immediate (ins
, op
);
12409 OP_J (instr_info
*ins
, int bytemode
, int sizeflag
)
12413 bfd_vma segment
= 0;
12418 if (!get8s (ins
, &disp
))
12423 if ((sizeflag
& DFLAG
)
12424 || (ins
->address_mode
== mode_64bit
12425 && ((ins
->isa64
== intel64
&& bytemode
!= dqw_mode
)
12426 || (ins
->rex
& REX_W
))))
12428 if (!get32s (ins
, &disp
))
12433 if (!get16s (ins
, &disp
))
12435 /* In 16bit mode, address is wrapped around at 64k within
12436 the same segment. Otherwise, a data16 prefix on a jump
12437 instruction means that the pc is masked to 16 bits after
12438 the displacement is added! */
12440 if ((ins
->prefixes
& PREFIX_DATA
) == 0)
12441 segment
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
))
12442 & ~((bfd_vma
) 0xffff));
12444 if (ins
->address_mode
!= mode_64bit
12445 || (ins
->isa64
!= intel64
&& !(ins
->rex
& REX_W
)))
12446 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12449 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12452 disp
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
) + disp
) & mask
)
12454 set_op (ins
, disp
, false);
12455 print_operand_value (ins
, disp
, dis_style_text
);
12460 OP_SEG (instr_info
*ins
, int bytemode
, int sizeflag
)
12462 if (bytemode
== w_mode
)
12464 oappend_register (ins
, att_names_seg
[ins
->modrm
.reg
]);
12467 return OP_E (ins
, ins
->modrm
.mod
== 3 ? bytemode
: w_mode
, sizeflag
);
12471 OP_DIR (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
, int sizeflag
)
12473 bfd_vma seg
, offset
;
12477 if (sizeflag
& DFLAG
)
12479 if (!get32 (ins
, &offset
))
12482 else if (!get16 (ins
, &offset
))
12484 if (!get16 (ins
, &seg
))
12486 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12488 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12489 ins
->intel_syntax
? "0x%x:0x%x" : "$0x%x,$0x%x",
12490 (unsigned) seg
, (unsigned) offset
);
12491 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12493 oappend (ins
, scratch
);
12498 OP_OFF (instr_info
*ins
, int bytemode
, int sizeflag
)
12502 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12503 intel_operand_size (ins
, bytemode
, sizeflag
);
12506 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
12508 if (!get32 (ins
, &off
))
12513 if (!get16 (ins
, &off
))
12517 if (ins
->intel_syntax
)
12519 if (!ins
->active_seg_prefix
)
12521 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12522 oappend (ins
, ":");
12525 print_operand_value (ins
, off
, dis_style_address_offset
);
12530 OP_OFF64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12534 if (ins
->address_mode
!= mode_64bit
12535 || (ins
->prefixes
& PREFIX_ADDR
))
12536 return OP_OFF (ins
, bytemode
, sizeflag
);
12538 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12539 intel_operand_size (ins
, bytemode
, sizeflag
);
12542 if (!get64 (ins
, &off
))
12545 if (ins
->intel_syntax
)
12547 if (!ins
->active_seg_prefix
)
12549 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12550 oappend (ins
, ":");
12553 print_operand_value (ins
, off
, dis_style_address_offset
);
12558 ptr_reg (instr_info
*ins
, int code
, int sizeflag
)
12562 *ins
->obufp
++ = ins
->open_char
;
12563 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
12564 if (ins
->address_mode
== mode_64bit
)
12566 if (!(sizeflag
& AFLAG
))
12567 s
= att_names32
[code
- eAX_reg
];
12569 s
= att_names64
[code
- eAX_reg
];
12571 else if (sizeflag
& AFLAG
)
12572 s
= att_names32
[code
- eAX_reg
];
12574 s
= att_names16
[code
- eAX_reg
];
12575 oappend_register (ins
, s
);
12576 oappend_char (ins
, ins
->close_char
);
12580 OP_ESreg (instr_info
*ins
, int code
, int sizeflag
)
12582 if (ins
->intel_syntax
)
12584 switch (ins
->codep
[-1])
12586 case 0x6d: /* insw/insl */
12587 intel_operand_size (ins
, z_mode
, sizeflag
);
12589 case 0xa5: /* movsw/movsl/movsq */
12590 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12591 case 0xab: /* stosw/stosl */
12592 case 0xaf: /* scasw/scasl */
12593 intel_operand_size (ins
, v_mode
, sizeflag
);
12596 intel_operand_size (ins
, b_mode
, sizeflag
);
12599 oappend_register (ins
, att_names_seg
[0]);
12600 oappend_char (ins
, ':');
12601 ptr_reg (ins
, code
, sizeflag
);
12606 OP_DSreg (instr_info
*ins
, int code
, int sizeflag
)
12608 if (ins
->intel_syntax
)
12610 switch (ins
->codep
[-1])
12612 case 0x6f: /* outsw/outsl */
12613 intel_operand_size (ins
, z_mode
, sizeflag
);
12615 case 0xa5: /* movsw/movsl/movsq */
12616 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12617 case 0xad: /* lodsw/lodsl/lodsq */
12618 intel_operand_size (ins
, v_mode
, sizeflag
);
12621 intel_operand_size (ins
, b_mode
, sizeflag
);
12624 /* Set ins->active_seg_prefix to PREFIX_DS if it is unset so that the
12625 default segment register DS is printed. */
12626 if (!ins
->active_seg_prefix
)
12627 ins
->active_seg_prefix
= PREFIX_DS
;
12629 ptr_reg (ins
, code
, sizeflag
);
12634 OP_C (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12635 int sizeflag ATTRIBUTE_UNUSED
)
12640 if (ins
->rex
& REX_R
)
12645 else if (ins
->address_mode
!= mode_64bit
&& (ins
->prefixes
& PREFIX_LOCK
))
12647 ins
->all_prefixes
[ins
->last_lock_prefix
] = 0;
12648 ins
->used_prefixes
|= PREFIX_LOCK
;
12653 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%cr%d",
12654 ins
->modrm
.reg
+ add
);
12655 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12657 oappend_register (ins
, scratch
);
12662 OP_D (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12663 int sizeflag ATTRIBUTE_UNUSED
)
12669 if (ins
->rex
& REX_R
)
12673 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12674 ins
->intel_syntax
? "dr%d" : "%%db%d",
12675 ins
->modrm
.reg
+ add
);
12676 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12678 oappend (ins
, scratch
);
12683 OP_T (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12684 int sizeflag ATTRIBUTE_UNUSED
)
12689 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%tr%d", ins
->modrm
.reg
);
12690 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12692 oappend_register (ins
, scratch
);
12697 OP_MMX (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12698 int sizeflag ATTRIBUTE_UNUSED
)
12700 int reg
= ins
->modrm
.reg
;
12701 const char (*names
)[8];
12703 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12704 if (ins
->prefixes
& PREFIX_DATA
)
12706 names
= att_names_xmm
;
12708 if (ins
->rex
& REX_R
)
12712 names
= att_names_mm
;
12713 oappend_register (ins
, names
[reg
]);
12718 print_vector_reg (instr_info
*ins
, unsigned int reg
, int bytemode
)
12720 const char (*names
)[8];
12722 if (bytemode
== xmmq_mode
12723 || bytemode
== evex_half_bcst_xmmqh_mode
12724 || bytemode
== evex_half_bcst_xmmq_mode
)
12726 switch (ins
->vex
.length
)
12731 names
= att_names_xmm
;
12734 names
= att_names_ymm
;
12735 ins
->evex_used
|= EVEX_len_used
;
12741 else if (bytemode
== ymm_mode
)
12742 names
= att_names_ymm
;
12743 else if (bytemode
== tmm_mode
)
12747 oappend (ins
, "(bad)");
12750 names
= att_names_tmm
;
12752 else if (ins
->need_vex
12753 && bytemode
!= xmm_mode
12754 && bytemode
!= scalar_mode
12755 && bytemode
!= xmmdw_mode
12756 && bytemode
!= xmmqd_mode
12757 && bytemode
!= evex_half_bcst_xmmqdh_mode
12758 && bytemode
!= w_swap_mode
12759 && bytemode
!= b_mode
12760 && bytemode
!= w_mode
12761 && bytemode
!= d_mode
12762 && bytemode
!= q_mode
)
12764 ins
->evex_used
|= EVEX_len_used
;
12765 switch (ins
->vex
.length
)
12768 names
= att_names_xmm
;
12772 || bytemode
!= vex_vsib_q_w_dq_mode
)
12773 names
= att_names_ymm
;
12775 names
= att_names_xmm
;
12779 || bytemode
!= vex_vsib_q_w_dq_mode
)
12780 names
= att_names_zmm
;
12782 names
= att_names_ymm
;
12789 names
= att_names_xmm
;
12790 oappend_register (ins
, names
[reg
]);
12794 OP_XMM (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
12796 unsigned int reg
= ins
->modrm
.reg
;
12799 if (ins
->rex
& REX_R
)
12807 if (bytemode
== tmm_mode
)
12808 ins
->modrm
.reg
= reg
;
12809 else if (bytemode
== scalar_mode
)
12810 ins
->vex
.no_broadcast
= true;
12812 print_vector_reg (ins
, reg
, bytemode
);
12817 OP_EM (instr_info
*ins
, int bytemode
, int sizeflag
)
12820 const char (*names
)[8];
12822 if (ins
->modrm
.mod
!= 3)
12824 if (ins
->intel_syntax
12825 && (bytemode
== v_mode
|| bytemode
== v_swap_mode
))
12827 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
12828 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12830 return OP_E (ins
, bytemode
, sizeflag
);
12833 if ((sizeflag
& SUFFIX_ALWAYS
) && bytemode
== v_swap_mode
)
12834 swap_operand (ins
);
12836 /* Skip mod/rm byte. */
12839 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12840 reg
= ins
->modrm
.rm
;
12841 if (ins
->prefixes
& PREFIX_DATA
)
12843 names
= att_names_xmm
;
12845 if (ins
->rex
& REX_B
)
12849 names
= att_names_mm
;
12850 oappend_register (ins
, names
[reg
]);
12854 /* cvt* are the only instructions in sse2 which have
12855 both SSE and MMX operands and also have 0x66 prefix
12856 in their opcode. 0x66 was originally used to differentiate
12857 between SSE and MMX instruction(operands). So we have to handle the
12858 cvt* separately using OP_EMC and OP_MXC */
12860 OP_EMC (instr_info
*ins
, int bytemode
, int sizeflag
)
12862 if (ins
->modrm
.mod
!= 3)
12864 if (ins
->intel_syntax
&& bytemode
== v_mode
)
12866 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
12867 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12869 return OP_E (ins
, bytemode
, sizeflag
);
12872 /* Skip mod/rm byte. */
12875 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12876 oappend_register (ins
, att_names_mm
[ins
->modrm
.rm
]);
12881 OP_MXC (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12882 int sizeflag ATTRIBUTE_UNUSED
)
12884 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12885 oappend_register (ins
, att_names_mm
[ins
->modrm
.reg
]);
12890 OP_EX (instr_info
*ins
, int bytemode
, int sizeflag
)
12894 /* Skip mod/rm byte. */
12898 if (bytemode
== dq_mode
)
12899 bytemode
= ins
->vex
.w
? q_mode
: d_mode
;
12901 if (ins
->modrm
.mod
!= 3)
12902 return OP_E_memory (ins
, bytemode
, sizeflag
);
12904 reg
= ins
->modrm
.rm
;
12906 if (ins
->rex
& REX_B
)
12911 if ((ins
->rex
& REX_X
))
12915 if ((sizeflag
& SUFFIX_ALWAYS
)
12916 && (bytemode
== x_swap_mode
12917 || bytemode
== w_swap_mode
12918 || bytemode
== d_swap_mode
12919 || bytemode
== q_swap_mode
))
12920 swap_operand (ins
);
12922 if (bytemode
== tmm_mode
)
12923 ins
->modrm
.rm
= reg
;
12925 print_vector_reg (ins
, reg
, bytemode
);
12930 OP_MS (instr_info
*ins
, int bytemode
, int sizeflag
)
12932 if (ins
->modrm
.mod
== 3)
12933 return OP_EM (ins
, bytemode
, sizeflag
);
12934 return BadOp (ins
);
12938 OP_XS (instr_info
*ins
, int bytemode
, int sizeflag
)
12940 if (ins
->modrm
.mod
== 3)
12941 return OP_EX (ins
, bytemode
, sizeflag
);
12942 return BadOp (ins
);
12946 OP_M (instr_info
*ins
, int bytemode
, int sizeflag
)
12948 /* Skip mod/rm byte. */
12952 if (ins
->modrm
.mod
== 3)
12953 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
12954 return BadOp (ins
);
12955 return OP_E_memory (ins
, bytemode
, sizeflag
);
12959 OP_0f07 (instr_info
*ins
, int bytemode
, int sizeflag
)
12961 if (ins
->modrm
.mod
!= 3 || ins
->modrm
.rm
!= 0)
12962 return BadOp (ins
);
12963 return OP_E (ins
, bytemode
, sizeflag
);
12966 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
12967 32bit mode and "xchg %rax,%rax" in 64bit mode. */
12970 NOP_Fixup (instr_info
*ins
, int opnd
, int sizeflag
)
12972 if ((ins
->prefixes
& PREFIX_DATA
) == 0 && (ins
->rex
& REX_B
) == 0)
12974 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop");
12978 return OP_REG (ins
, eAX_reg
, sizeflag
);
12979 return OP_IMREG (ins
, eAX_reg
, sizeflag
);
12982 static const char *const Suffix3DNow
[] = {
12983 /* 00 */ NULL
, NULL
, NULL
, NULL
,
12984 /* 04 */ NULL
, NULL
, NULL
, NULL
,
12985 /* 08 */ NULL
, NULL
, NULL
, NULL
,
12986 /* 0C */ "pi2fw", "pi2fd", NULL
, NULL
,
12987 /* 10 */ NULL
, NULL
, NULL
, NULL
,
12988 /* 14 */ NULL
, NULL
, NULL
, NULL
,
12989 /* 18 */ NULL
, NULL
, NULL
, NULL
,
12990 /* 1C */ "pf2iw", "pf2id", NULL
, NULL
,
12991 /* 20 */ NULL
, NULL
, NULL
, NULL
,
12992 /* 24 */ NULL
, NULL
, NULL
, NULL
,
12993 /* 28 */ NULL
, NULL
, NULL
, NULL
,
12994 /* 2C */ NULL
, NULL
, NULL
, NULL
,
12995 /* 30 */ NULL
, NULL
, NULL
, NULL
,
12996 /* 34 */ NULL
, NULL
, NULL
, NULL
,
12997 /* 38 */ NULL
, NULL
, NULL
, NULL
,
12998 /* 3C */ NULL
, NULL
, NULL
, NULL
,
12999 /* 40 */ NULL
, NULL
, NULL
, NULL
,
13000 /* 44 */ NULL
, NULL
, NULL
, NULL
,
13001 /* 48 */ NULL
, NULL
, NULL
, NULL
,
13002 /* 4C */ NULL
, NULL
, NULL
, NULL
,
13003 /* 50 */ NULL
, NULL
, NULL
, NULL
,
13004 /* 54 */ NULL
, NULL
, NULL
, NULL
,
13005 /* 58 */ NULL
, NULL
, NULL
, NULL
,
13006 /* 5C */ NULL
, NULL
, NULL
, NULL
,
13007 /* 60 */ NULL
, NULL
, NULL
, NULL
,
13008 /* 64 */ NULL
, NULL
, NULL
, NULL
,
13009 /* 68 */ NULL
, NULL
, NULL
, NULL
,
13010 /* 6C */ NULL
, NULL
, NULL
, NULL
,
13011 /* 70 */ NULL
, NULL
, NULL
, NULL
,
13012 /* 74 */ NULL
, NULL
, NULL
, NULL
,
13013 /* 78 */ NULL
, NULL
, NULL
, NULL
,
13014 /* 7C */ NULL
, NULL
, NULL
, NULL
,
13015 /* 80 */ NULL
, NULL
, NULL
, NULL
,
13016 /* 84 */ NULL
, NULL
, NULL
, NULL
,
13017 /* 88 */ NULL
, NULL
, "pfnacc", NULL
,
13018 /* 8C */ NULL
, NULL
, "pfpnacc", NULL
,
13019 /* 90 */ "pfcmpge", NULL
, NULL
, NULL
,
13020 /* 94 */ "pfmin", NULL
, "pfrcp", "pfrsqrt",
13021 /* 98 */ NULL
, NULL
, "pfsub", NULL
,
13022 /* 9C */ NULL
, NULL
, "pfadd", NULL
,
13023 /* A0 */ "pfcmpgt", NULL
, NULL
, NULL
,
13024 /* A4 */ "pfmax", NULL
, "pfrcpit1", "pfrsqit1",
13025 /* A8 */ NULL
, NULL
, "pfsubr", NULL
,
13026 /* AC */ NULL
, NULL
, "pfacc", NULL
,
13027 /* B0 */ "pfcmpeq", NULL
, NULL
, NULL
,
13028 /* B4 */ "pfmul", NULL
, "pfrcpit2", "pmulhrw",
13029 /* B8 */ NULL
, NULL
, NULL
, "pswapd",
13030 /* BC */ NULL
, NULL
, NULL
, "pavgusb",
13031 /* C0 */ NULL
, NULL
, NULL
, NULL
,
13032 /* C4 */ NULL
, NULL
, NULL
, NULL
,
13033 /* C8 */ NULL
, NULL
, NULL
, NULL
,
13034 /* CC */ NULL
, NULL
, NULL
, NULL
,
13035 /* D0 */ NULL
, NULL
, NULL
, NULL
,
13036 /* D4 */ NULL
, NULL
, NULL
, NULL
,
13037 /* D8 */ NULL
, NULL
, NULL
, NULL
,
13038 /* DC */ NULL
, NULL
, NULL
, NULL
,
13039 /* E0 */ NULL
, NULL
, NULL
, NULL
,
13040 /* E4 */ NULL
, NULL
, NULL
, NULL
,
13041 /* E8 */ NULL
, NULL
, NULL
, NULL
,
13042 /* EC */ NULL
, NULL
, NULL
, NULL
,
13043 /* F0 */ NULL
, NULL
, NULL
, NULL
,
13044 /* F4 */ NULL
, NULL
, NULL
, NULL
,
13045 /* F8 */ NULL
, NULL
, NULL
, NULL
,
13046 /* FC */ NULL
, NULL
, NULL
, NULL
,
13050 OP_3DNowSuffix (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13051 int sizeflag ATTRIBUTE_UNUSED
)
13053 const char *mnemonic
;
13055 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13057 /* AMD 3DNow! instructions are specified by an opcode suffix in the
13058 place where an 8-bit immediate would normally go. ie. the last
13059 byte of the instruction. */
13060 ins
->obufp
= ins
->mnemonicendp
;
13061 mnemonic
= Suffix3DNow
[*ins
->codep
++];
13063 ins
->obufp
= stpcpy (ins
->obufp
, mnemonic
);
13066 /* Since a variable sized ins->modrm/ins->sib chunk is between the start
13067 of the opcode (0x0f0f) and the opcode suffix, we need to do
13068 all the ins->modrm processing first, and don't know until now that
13069 we have a bad opcode. This necessitates some cleaning up. */
13070 ins
->op_out
[0][0] = '\0';
13071 ins
->op_out
[1][0] = '\0';
13074 ins
->mnemonicendp
= ins
->obufp
;
13078 static const struct op simd_cmp_op
[] =
13080 { STRING_COMMA_LEN ("eq") },
13081 { STRING_COMMA_LEN ("lt") },
13082 { STRING_COMMA_LEN ("le") },
13083 { STRING_COMMA_LEN ("unord") },
13084 { STRING_COMMA_LEN ("neq") },
13085 { STRING_COMMA_LEN ("nlt") },
13086 { STRING_COMMA_LEN ("nle") },
13087 { STRING_COMMA_LEN ("ord") }
13090 static const struct op vex_cmp_op
[] =
13092 { STRING_COMMA_LEN ("eq_uq") },
13093 { STRING_COMMA_LEN ("nge") },
13094 { STRING_COMMA_LEN ("ngt") },
13095 { STRING_COMMA_LEN ("false") },
13096 { STRING_COMMA_LEN ("neq_oq") },
13097 { STRING_COMMA_LEN ("ge") },
13098 { STRING_COMMA_LEN ("gt") },
13099 { STRING_COMMA_LEN ("true") },
13100 { STRING_COMMA_LEN ("eq_os") },
13101 { STRING_COMMA_LEN ("lt_oq") },
13102 { STRING_COMMA_LEN ("le_oq") },
13103 { STRING_COMMA_LEN ("unord_s") },
13104 { STRING_COMMA_LEN ("neq_us") },
13105 { STRING_COMMA_LEN ("nlt_uq") },
13106 { STRING_COMMA_LEN ("nle_uq") },
13107 { STRING_COMMA_LEN ("ord_s") },
13108 { STRING_COMMA_LEN ("eq_us") },
13109 { STRING_COMMA_LEN ("nge_uq") },
13110 { STRING_COMMA_LEN ("ngt_uq") },
13111 { STRING_COMMA_LEN ("false_os") },
13112 { STRING_COMMA_LEN ("neq_os") },
13113 { STRING_COMMA_LEN ("ge_oq") },
13114 { STRING_COMMA_LEN ("gt_oq") },
13115 { STRING_COMMA_LEN ("true_us") },
13119 CMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13120 int sizeflag ATTRIBUTE_UNUSED
)
13122 unsigned int cmp_type
;
13124 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13126 cmp_type
= *ins
->codep
++;
13127 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
))
13130 char *p
= ins
->mnemonicendp
- 2;
13134 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13135 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13137 else if (ins
->need_vex
13138 && cmp_type
< ARRAY_SIZE (simd_cmp_op
) + ARRAY_SIZE (vex_cmp_op
))
13141 char *p
= ins
->mnemonicendp
- 2;
13145 cmp_type
-= ARRAY_SIZE (simd_cmp_op
);
13146 sprintf (p
, "%s%s", vex_cmp_op
[cmp_type
].name
, suffix
);
13147 ins
->mnemonicendp
+= vex_cmp_op
[cmp_type
].len
;
13151 /* We have a reserved extension byte. Output it directly. */
13152 oappend_immediate (ins
, cmp_type
);
13158 OP_Mwait (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13160 /* mwait %eax,%ecx / mwaitx %eax,%ecx,%ebx */
13161 if (!ins
->intel_syntax
)
13163 strcpy (ins
->op_out
[0], att_names32
[0] + ins
->intel_syntax
);
13164 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13165 if (bytemode
== eBX_reg
)
13166 strcpy (ins
->op_out
[2], att_names32
[3] + ins
->intel_syntax
);
13167 ins
->two_source_ops
= true;
13169 /* Skip mod/rm byte. */
13176 OP_Monitor (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13177 int sizeflag ATTRIBUTE_UNUSED
)
13179 /* monitor %{e,r,}ax,%ecx,%edx" */
13180 if (!ins
->intel_syntax
)
13182 const char (*names
)[8] = (ins
->address_mode
== mode_64bit
13183 ? att_names64
: att_names32
);
13185 if (ins
->prefixes
& PREFIX_ADDR
)
13187 /* Remove "addr16/addr32". */
13188 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
13189 names
= (ins
->address_mode
!= mode_32bit
13190 ? att_names32
: att_names16
);
13191 ins
->used_prefixes
|= PREFIX_ADDR
;
13193 else if (ins
->address_mode
== mode_16bit
)
13194 names
= att_names16
;
13195 strcpy (ins
->op_out
[0], names
[0] + ins
->intel_syntax
);
13196 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13197 strcpy (ins
->op_out
[2], att_names32
[2] + ins
->intel_syntax
);
13198 ins
->two_source_ops
= true;
13200 /* Skip mod/rm byte. */
13207 REP_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13209 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
13211 if (ins
->prefixes
& PREFIX_REPZ
)
13212 ins
->all_prefixes
[ins
->last_repz_prefix
] = REP_PREFIX
;
13219 return OP_IMREG (ins
, bytemode
, sizeflag
);
13221 return OP_ESreg (ins
, bytemode
, sizeflag
);
13223 return OP_DSreg (ins
, bytemode
, sizeflag
);
13232 SEP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13233 int sizeflag ATTRIBUTE_UNUSED
)
13235 if (ins
->isa64
!= amd64
)
13238 ins
->obufp
= ins
->obuf
;
13240 ins
->mnemonicendp
= ins
->obufp
;
13245 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
13249 BND_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13250 int sizeflag ATTRIBUTE_UNUSED
)
13252 if (ins
->prefixes
& PREFIX_REPNZ
)
13253 ins
->all_prefixes
[ins
->last_repnz_prefix
] = BND_PREFIX
;
13257 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
13261 NOTRACK_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13262 int sizeflag ATTRIBUTE_UNUSED
)
13264 /* Since active_seg_prefix is not set in 64-bit mode, check whether
13265 we've seen a PREFIX_DS. */
13266 if ((ins
->prefixes
& PREFIX_DS
) != 0
13267 && (ins
->address_mode
!= mode_64bit
|| ins
->last_data_prefix
< 0))
13269 /* NOTRACK prefix is only valid on indirect branch instructions.
13270 NB: DATA prefix is unsupported for Intel64. */
13271 ins
->active_seg_prefix
= 0;
13272 ins
->all_prefixes
[ins
->last_seg_prefix
] = NOTRACK_PREFIX
;
13277 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13278 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
13282 HLE_Fixup1 (instr_info
*ins
, int bytemode
, int sizeflag
)
13284 if (ins
->modrm
.mod
!= 3
13285 && (ins
->prefixes
& PREFIX_LOCK
) != 0)
13287 if (ins
->prefixes
& PREFIX_REPZ
)
13288 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13289 if (ins
->prefixes
& PREFIX_REPNZ
)
13290 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13293 return OP_E (ins
, bytemode
, sizeflag
);
13296 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13297 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
13301 HLE_Fixup2 (instr_info
*ins
, int bytemode
, int sizeflag
)
13303 if (ins
->modrm
.mod
!= 3)
13305 if (ins
->prefixes
& PREFIX_REPZ
)
13306 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13307 if (ins
->prefixes
& PREFIX_REPNZ
)
13308 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13311 return OP_E (ins
, bytemode
, sizeflag
);
13314 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
13315 "xrelease" for memory operand. No check for LOCK prefix. */
13318 HLE_Fixup3 (instr_info
*ins
, int bytemode
, int sizeflag
)
13320 if (ins
->modrm
.mod
!= 3
13321 && ins
->last_repz_prefix
> ins
->last_repnz_prefix
13322 && (ins
->prefixes
& PREFIX_REPZ
) != 0)
13323 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13325 return OP_E (ins
, bytemode
, sizeflag
);
13329 CMPXCHG8B_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13332 if (ins
->rex
& REX_W
)
13334 /* Change cmpxchg8b to cmpxchg16b. */
13335 char *p
= ins
->mnemonicendp
- 2;
13336 ins
->mnemonicendp
= stpcpy (p
, "16b");
13339 else if ((ins
->prefixes
& PREFIX_LOCK
) != 0)
13341 if (ins
->prefixes
& PREFIX_REPZ
)
13342 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13343 if (ins
->prefixes
& PREFIX_REPNZ
)
13344 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13347 return OP_M (ins
, bytemode
, sizeflag
);
13351 XMM_Fixup (instr_info
*ins
, int reg
, int sizeflag ATTRIBUTE_UNUSED
)
13353 const char (*names
)[8] = att_names_xmm
;
13357 switch (ins
->vex
.length
)
13362 names
= att_names_ymm
;
13368 oappend_register (ins
, names
[reg
]);
13373 FXSAVE_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13375 /* Add proper suffix to "fxsave" and "fxrstor". */
13377 if (ins
->rex
& REX_W
)
13379 char *p
= ins
->mnemonicendp
;
13383 ins
->mnemonicendp
= p
;
13385 return OP_M (ins
, bytemode
, sizeflag
);
13388 /* Display the destination register operand for instructions with
13392 OP_VEX (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13394 int reg
, modrm_reg
, sib_index
= -1;
13395 const char (*names
)[8];
13397 if (!ins
->need_vex
)
13400 reg
= ins
->vex
.register_specifier
;
13401 ins
->vex
.register_specifier
= 0;
13402 if (ins
->address_mode
!= mode_64bit
)
13404 if (ins
->vex
.evex
&& !ins
->vex
.v
)
13406 oappend (ins
, "(bad)");
13412 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13418 oappend_register (ins
, att_names_xmm
[reg
]);
13421 case vex_vsib_d_w_dq_mode
:
13422 case vex_vsib_q_w_dq_mode
:
13423 /* This must be the 3rd operand. */
13424 if (ins
->obufp
!= ins
->op_out
[2])
13426 if (ins
->vex
.length
== 128
13427 || (bytemode
!= vex_vsib_d_w_dq_mode
13429 oappend_register (ins
, att_names_xmm
[reg
]);
13431 oappend_register (ins
, att_names_ymm
[reg
]);
13433 /* All 3 XMM/YMM registers must be distinct. */
13434 modrm_reg
= ins
->modrm
.reg
;
13435 if (ins
->rex
& REX_R
)
13438 if (ins
->has_sib
&& ins
->modrm
.rm
== 4)
13440 sib_index
= ins
->sib
.index
;
13441 if (ins
->rex
& REX_X
)
13445 if (reg
== modrm_reg
|| reg
== sib_index
)
13446 strcpy (ins
->obufp
, "/(bad)");
13447 if (modrm_reg
== sib_index
|| modrm_reg
== reg
)
13448 strcat (ins
->op_out
[0], "/(bad)");
13449 if (sib_index
== modrm_reg
|| sib_index
== reg
)
13450 strcat (ins
->op_out
[1], "/(bad)");
13455 /* All 3 TMM registers must be distinct. */
13457 oappend (ins
, "(bad)");
13460 /* This must be the 3rd operand. */
13461 if (ins
->obufp
!= ins
->op_out
[2])
13463 oappend_register (ins
, att_names_tmm
[reg
]);
13464 if (reg
== ins
->modrm
.reg
|| reg
== ins
->modrm
.rm
)
13465 strcpy (ins
->obufp
, "/(bad)");
13468 if (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
13469 || ins
->modrm
.rm
== reg
)
13471 if (ins
->modrm
.reg
<= 8
13472 && (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
))
13473 strcat (ins
->op_out
[0], "/(bad)");
13474 if (ins
->modrm
.rm
<= 8
13475 && (ins
->modrm
.rm
== ins
->modrm
.reg
|| ins
->modrm
.rm
== reg
))
13476 strcat (ins
->op_out
[1], "/(bad)");
13482 switch (ins
->vex
.length
)
13488 names
= att_names_xmm
;
13489 ins
->evex_used
|= EVEX_len_used
;
13492 if (ins
->rex
& REX_W
)
13493 names
= att_names64
;
13495 names
= att_names32
;
13501 oappend (ins
, "(bad)");
13504 names
= att_names_mask
;
13515 names
= att_names_ymm
;
13516 ins
->evex_used
|= EVEX_len_used
;
13522 names
= att_names_mask
;
13525 /* Fall through. */
13527 /* See PR binutils/20893 for a reproducer. */
13528 oappend (ins
, "(bad)");
13533 names
= att_names_zmm
;
13534 ins
->evex_used
|= EVEX_len_used
;
13540 oappend_register (ins
, names
[reg
]);
13545 OP_VexR (instr_info
*ins
, int bytemode
, int sizeflag
)
13547 if (ins
->modrm
.mod
== 3)
13548 return OP_VEX (ins
, bytemode
, sizeflag
);
13553 OP_VexW (instr_info
*ins
, int bytemode
, int sizeflag
)
13555 OP_VEX (ins
, bytemode
, sizeflag
);
13559 /* Swap 2nd and 3rd operands. */
13560 char *tmp
= ins
->op_out
[2];
13562 ins
->op_out
[2] = ins
->op_out
[1];
13563 ins
->op_out
[1] = tmp
;
13569 OP_REG_VexI4 (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13572 const char (*names
)[8] = att_names_xmm
;
13574 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13576 reg
= *ins
->codep
++;
13578 if (bytemode
!= x_mode
&& bytemode
!= scalar_mode
)
13582 if (ins
->address_mode
!= mode_64bit
)
13585 if (bytemode
== x_mode
&& ins
->vex
.length
== 256)
13586 names
= att_names_ymm
;
13588 oappend_register (ins
, names
[reg
]);
13592 /* Swap 3rd and 4th operands. */
13593 char *tmp
= ins
->op_out
[3];
13595 ins
->op_out
[3] = ins
->op_out
[2];
13596 ins
->op_out
[2] = tmp
;
13602 OP_VexI4 (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13603 int sizeflag ATTRIBUTE_UNUSED
)
13605 oappend_immediate (ins
, ins
->codep
[-1] & 0xf);
13610 VPCMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13611 int sizeflag ATTRIBUTE_UNUSED
)
13613 unsigned int cmp_type
;
13615 if (!ins
->vex
.evex
)
13618 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13620 cmp_type
= *ins
->codep
++;
13621 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
13622 If it's the case, print suffix, otherwise - print the immediate. */
13623 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
)
13628 char *p
= ins
->mnemonicendp
- 2;
13630 /* vpcmp* can have both one- and two-lettered suffix. */
13644 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13645 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13649 /* We have a reserved extension byte. Output it directly. */
13650 oappend_immediate (ins
, cmp_type
);
13655 static const struct op xop_cmp_op
[] =
13657 { STRING_COMMA_LEN ("lt") },
13658 { STRING_COMMA_LEN ("le") },
13659 { STRING_COMMA_LEN ("gt") },
13660 { STRING_COMMA_LEN ("ge") },
13661 { STRING_COMMA_LEN ("eq") },
13662 { STRING_COMMA_LEN ("neq") },
13663 { STRING_COMMA_LEN ("false") },
13664 { STRING_COMMA_LEN ("true") }
13668 VPCOM_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13669 int sizeflag ATTRIBUTE_UNUSED
)
13671 unsigned int cmp_type
;
13673 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13675 cmp_type
= *ins
->codep
++;
13676 if (cmp_type
< ARRAY_SIZE (xop_cmp_op
))
13679 char *p
= ins
->mnemonicendp
- 2;
13681 /* vpcom* can have both one- and two-lettered suffix. */
13695 sprintf (p
, "%s%s", xop_cmp_op
[cmp_type
].name
, suffix
);
13696 ins
->mnemonicendp
+= xop_cmp_op
[cmp_type
].len
;
13700 /* We have a reserved extension byte. Output it directly. */
13701 oappend_immediate (ins
, cmp_type
);
13706 static const struct op pclmul_op
[] =
13708 { STRING_COMMA_LEN ("lql") },
13709 { STRING_COMMA_LEN ("hql") },
13710 { STRING_COMMA_LEN ("lqh") },
13711 { STRING_COMMA_LEN ("hqh") }
13715 PCLMUL_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13716 int sizeflag ATTRIBUTE_UNUSED
)
13718 unsigned int pclmul_type
;
13720 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13722 pclmul_type
= *ins
->codep
++;
13723 switch (pclmul_type
)
13734 if (pclmul_type
< ARRAY_SIZE (pclmul_op
))
13737 char *p
= ins
->mnemonicendp
- 3;
13742 sprintf (p
, "%s%s", pclmul_op
[pclmul_type
].name
, suffix
);
13743 ins
->mnemonicendp
+= pclmul_op
[pclmul_type
].len
;
13747 /* We have a reserved extension byte. Output it directly. */
13748 oappend_immediate (ins
, pclmul_type
);
13754 MOVSXD_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13756 /* Add proper suffix to "movsxd". */
13757 char *p
= ins
->mnemonicendp
;
13762 if (!ins
->intel_syntax
)
13765 if (ins
->rex
& REX_W
)
13777 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
13781 ins
->mnemonicendp
= p
;
13783 return OP_E (ins
, bytemode
, sizeflag
);
13787 DistinctDest_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13789 unsigned int reg
= ins
->vex
.register_specifier
;
13790 unsigned int modrm_reg
= ins
->modrm
.reg
;
13791 unsigned int modrm_rm
= ins
->modrm
.rm
;
13793 /* Calc destination register number. */
13794 if (ins
->rex
& REX_R
)
13799 /* Calc src1 register number. */
13800 if (ins
->address_mode
!= mode_64bit
)
13802 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13805 /* Calc src2 register number. */
13806 if (ins
->modrm
.mod
== 3)
13808 if (ins
->rex
& REX_B
)
13810 if (ins
->rex
& REX_X
)
13814 /* Destination and source registers must be distinct, output bad if
13815 dest == src1 or dest == src2. */
13816 if (modrm_reg
== reg
13817 || (ins
->modrm
.mod
== 3
13818 && modrm_reg
== modrm_rm
))
13820 oappend (ins
, "(bad)");
13823 return OP_XMM (ins
, bytemode
, sizeflag
);
13827 OP_Rounding (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13829 if (ins
->modrm
.mod
!= 3 || !ins
->vex
.b
)
13834 case evex_rounding_64_mode
:
13835 if (ins
->address_mode
!= mode_64bit
|| !ins
->vex
.w
)
13837 /* Fall through. */
13838 case evex_rounding_mode
:
13839 ins
->evex_used
|= EVEX_b_used
;
13840 oappend (ins
, names_rounding
[ins
->vex
.ll
]);
13842 case evex_sae_mode
:
13843 ins
->evex_used
|= EVEX_b_used
;
13844 oappend (ins
, "{");
13849 oappend (ins
, "sae}");
13854 PREFETCHI_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13856 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 5)
13858 if (ins
->intel_syntax
)
13860 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop ");
13865 if (ins
->rex
& REX_W
)
13866 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopq ");
13869 if (sizeflag
& DFLAG
)
13870 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopl ");
13872 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopw ");
13873 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13879 return OP_M (ins
, bytemode
, sizeflag
);