1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2024 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_R (instr_info
*, int, int);
78 static bool OP_M (instr_info
*, int, int);
79 static bool OP_VEX (instr_info
*, int, int);
80 static bool OP_VexR (instr_info
*, int, int);
81 static bool OP_VexW (instr_info
*, int, int);
82 static bool OP_Rounding (instr_info
*, int, int);
83 static bool OP_REG_VexI4 (instr_info
*, int, int);
84 static bool OP_VexI4 (instr_info
*, int, int);
85 static bool OP_0f07 (instr_info
*, int, int);
86 static bool OP_Monitor (instr_info
*, int, int);
87 static bool OP_Mwait (instr_info
*, int, int);
89 static bool PCLMUL_Fixup (instr_info
*, int, int);
90 static bool VPCMP_Fixup (instr_info
*, int, int);
91 static bool VPCOM_Fixup (instr_info
*, int, int);
92 static bool NOP_Fixup (instr_info
*, int, int);
93 static bool OP_3DNowSuffix (instr_info
*, int, int);
94 static bool CMP_Fixup (instr_info
*, int, int);
95 static bool REP_Fixup (instr_info
*, int, int);
96 static bool SEP_Fixup (instr_info
*, int, int);
97 static bool BND_Fixup (instr_info
*, int, int);
98 static bool NOTRACK_Fixup (instr_info
*, int, int);
99 static bool HLE_Fixup1 (instr_info
*, int, int);
100 static bool HLE_Fixup2 (instr_info
*, int, int);
101 static bool HLE_Fixup3 (instr_info
*, int, int);
102 static bool CMPXCHG8B_Fixup (instr_info
*, int, int);
103 static bool XMM_Fixup (instr_info
*, int, int);
104 static bool FXSAVE_Fixup (instr_info
*, int, int);
105 static bool MOVSXD_Fixup (instr_info
*, int, int);
106 static bool DistinctDest_Fixup (instr_info
*, int, int);
107 static bool PREFETCHI_Fixup (instr_info
*, int, int);
108 static bool PUSH2_POP2_Fixup (instr_info
*, int, int);
109 static bool JMPABS_Fixup (instr_info
*, int, int);
111 static void ATTRIBUTE_PRINTF_3
i386_dis_printf (const disassemble_info
*,
112 enum disassembler_style
,
115 /* This character is used to encode style information within the output
116 buffers. See oappend_insert_style for more details. */
117 #define STYLE_MARKER_CHAR '\002'
119 /* The maximum operand buffer size. */
120 #define MAX_OPERAND_BUFFER_SIZE 128
129 static const char *prefix_name (enum address_mode
, uint8_t, int);
146 enum address_mode address_mode
;
148 /* Flags for the prefixes for the current instruction. See below. */
151 /* REX prefix the current instruction. See below. */
153 /* Bits of REX we've already used. */
156 /* Record W R4 X4 B4 bits for rex2. */
158 /* Bits of rex2 we've already used. */
159 unsigned char rex2_used
;
160 unsigned char rex2_payload
;
163 unsigned char need_vex
;
166 /* Flags for ins->prefixes which we somehow handled when printing the
167 current instruction. */
170 /* Flags for EVEX bits which we somehow handled when printing the
171 current instruction. */
174 char obuf
[MAX_OPERAND_BUFFER_SIZE
];
177 const uint8_t *start_codep
;
179 const uint8_t *end_codep
;
180 unsigned char nr_prefixes
;
181 signed char last_lock_prefix
;
182 signed char last_repz_prefix
;
183 signed char last_repnz_prefix
;
184 signed char last_data_prefix
;
185 signed char last_addr_prefix
;
186 signed char last_rex_prefix
;
187 signed char last_rex2_prefix
;
188 signed char last_seg_prefix
;
189 signed char fwait_prefix
;
190 /* The active segment register prefix. */
191 unsigned char active_seg_prefix
;
193 #define MAX_CODE_LENGTH 15
194 /* We can up to 14 ins->prefixes since the maximum instruction length is
196 uint8_t all_prefixes
[MAX_CODE_LENGTH
- 1];
197 disassemble_info
*info
;
217 int register_specifier
;
220 int mask_register_specifier
;
231 /* For APX EVEX-promoted prefix, EVEX.ND shares the same bit as vex.b. */
234 enum evex_type evex_type
;
236 /* Remember if the current op is a jump instruction. */
241 /* Record whether EVEX masking is used incorrectly. */
242 bool illegal_masking
;
244 /* Record whether the modrm byte has been skipped. */
245 bool has_skipped_modrm
;
248 signed char op_index
[MAX_OPERANDS
];
249 bool op_riprel
[MAX_OPERANDS
];
250 char *op_out
[MAX_OPERANDS
];
251 bfd_vma op_address
[MAX_OPERANDS
];
254 /* On the 386's of 1988, the maximum length of an instruction is 15 bytes.
255 * (see topic "Redundant ins->prefixes" in the "Differences from 8086"
256 * section of the "Virtual 8086 Mode" chapter.)
257 * 'pc' should be the address of this instruction, it will
258 * be used to print the target address if this is a relative jump or call
259 * The function returns the length of this instruction in bytes.
268 enum x86_64_isa isa64
;
275 /* Indexes first byte not fetched. */
276 unsigned int fetched
;
277 uint8_t the_buffer
[2 * MAX_CODE_LENGTH
- 1];
280 /* Mark parts used in the REX prefix. When we are testing for
281 empty prefix (for 8bit register REX extension), just mask it
282 out. Otherwise test for REX bit is excuse for existence of REX
283 only in case value is nonzero. */
284 #define USED_REX(value) \
288 if (ins->rex & value) \
289 ins->rex_used |= (value) | REX_OPCODE; \
290 if (ins->rex2 & value) \
292 ins->rex2_used |= (value); \
293 ins->rex_used |= REX_OPCODE; \
297 ins->rex_used |= REX_OPCODE; \
301 #define EVEX_b_used 1
302 #define EVEX_len_used 2
305 /* {rex2} is not printed when the REX2_SPECIAL is set. */
306 #define REX2_SPECIAL 16
308 /* Flags stored in PREFIXES. */
309 #define PREFIX_REPZ 1
310 #define PREFIX_REPNZ 2
313 #define PREFIX_DS 0x10
314 #define PREFIX_ES 0x20
315 #define PREFIX_FS 0x40
316 #define PREFIX_GS 0x80
317 #define PREFIX_LOCK 0x100
318 #define PREFIX_DATA 0x200
319 #define PREFIX_ADDR 0x400
320 #define PREFIX_FWAIT 0x800
321 #define PREFIX_REX2 0x1000
322 #define PREFIX_NP_OR_DATA 0x2000
323 #define NO_PREFIX 0x4000
325 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
326 to ADDR (exclusive) are valid. Returns true for success, false
329 fetch_code (struct disassemble_info
*info
, const uint8_t *until
)
332 struct dis_private
*priv
= info
->private_data
;
333 bfd_vma start
= priv
->insn_start
+ priv
->fetched
;
334 uint8_t *fetch_end
= priv
->the_buffer
+ priv
->fetched
;
335 ptrdiff_t needed
= until
- fetch_end
;
340 if (priv
->fetched
+ (size_t) needed
<= ARRAY_SIZE (priv
->the_buffer
))
341 status
= (*info
->read_memory_func
) (start
, fetch_end
, needed
, info
);
344 /* If we did manage to read at least one byte, then
345 print_insn_i386 will do something sensible. Otherwise, print
346 an error. We do that here because this is where we know
349 (*info
->memory_error_func
) (status
, start
, info
);
353 priv
->fetched
+= needed
;
358 fetch_modrm (instr_info
*ins
)
360 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
363 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
364 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
365 ins
->modrm
.rm
= *ins
->codep
& 7;
371 fetch_error (const instr_info
*ins
)
373 /* Getting here means we tried for data but didn't get it. That
374 means we have an incomplete instruction of some sort. Just
375 print the first byte as a prefix or a .byte pseudo-op. */
376 const struct dis_private
*priv
= ins
->info
->private_data
;
377 const char *name
= NULL
;
379 if (ins
->codep
<= priv
->the_buffer
)
382 if (ins
->prefixes
|| ins
->fwait_prefix
>= 0 || (ins
->rex
& REX_OPCODE
))
383 name
= prefix_name (ins
->address_mode
, priv
->the_buffer
[0],
384 priv
->orig_sizeflag
);
386 i386_dis_printf (ins
->info
, dis_style_mnemonic
, "%s", name
);
389 /* Just print the first byte as a .byte instruction. */
390 i386_dis_printf (ins
->info
, dis_style_assembler_directive
, ".byte ");
391 i386_dis_printf (ins
->info
, dis_style_immediate
, "%#x",
392 (unsigned int) priv
->the_buffer
[0]);
398 /* Possible values for prefix requirement. */
399 #define PREFIX_IGNORED_SHIFT 16
400 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
401 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
402 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
403 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
404 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
405 #define PREFIX_REX2_ILLEGAL (PREFIX_REX2 << PREFIX_IGNORED_SHIFT)
407 /* Opcode prefixes. */
408 #define PREFIX_OPCODE (PREFIX_REPZ \
412 /* Prefixes ignored. */
413 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
414 | PREFIX_IGNORED_REPNZ \
415 | PREFIX_IGNORED_DATA)
417 #define XX { NULL, 0 }
418 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
420 #define Eb { OP_E, b_mode }
421 #define Ebnd { OP_E, bnd_mode }
422 #define EbS { OP_E, b_swap_mode }
423 #define EbndS { OP_E, bnd_swap_mode }
424 #define Ev { OP_E, v_mode }
425 #define Eva { OP_E, va_mode }
426 #define Ev_bnd { OP_E, v_bnd_mode }
427 #define EvS { OP_E, v_swap_mode }
428 #define Ed { OP_E, d_mode }
429 #define Edq { OP_E, dq_mode }
430 #define Edb { OP_E, db_mode }
431 #define Edw { OP_E, dw_mode }
432 #define Eq { OP_E, q_mode }
433 #define indirEv { OP_indirE, indir_v_mode }
434 #define indirEp { OP_indirE, f_mode }
435 #define stackEv { OP_E, stack_v_mode }
436 #define Em { OP_E, m_mode }
437 #define Ew { OP_E, w_mode }
438 #define M { OP_M, 0 } /* lea, lgdt, etc. */
439 #define Ma { OP_M, a_mode }
440 #define Mb { OP_M, b_mode }
441 #define Md { OP_M, d_mode }
442 #define Mdq { OP_M, dq_mode }
443 #define Mo { OP_M, o_mode }
444 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
445 #define Mq { OP_M, q_mode }
446 #define Mv { OP_M, v_mode }
447 #define Mv_bnd { OP_M, v_bndmk_mode }
448 #define Mw { OP_M, w_mode }
449 #define Mx { OP_M, x_mode }
450 #define Mxmm { OP_M, xmm_mode }
451 #define Mymm { OP_M, ymm_mode }
452 #define Gb { OP_G, b_mode }
453 #define Gbnd { OP_G, bnd_mode }
454 #define Gv { OP_G, v_mode }
455 #define Gd { OP_G, d_mode }
456 #define Gdq { OP_G, dq_mode }
457 #define Gq { OP_G, q_mode }
458 #define Gm { OP_G, m_mode }
459 #define Gva { OP_G, va_mode }
460 #define Gw { OP_G, w_mode }
461 #define Ib { OP_I, b_mode }
462 #define sIb { OP_sI, b_mode } /* sign extened byte */
463 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
464 #define Iv { OP_I, v_mode }
465 #define sIv { OP_sI, v_mode }
466 #define Iv64 { OP_I64, v_mode }
467 #define Id { OP_I, d_mode }
468 #define Iw { OP_I, w_mode }
469 #define I1 { OP_I, const_1_mode }
470 #define Jb { OP_J, b_mode }
471 #define Jv { OP_J, v_mode }
472 #define Jdqw { OP_J, dqw_mode }
473 #define Cm { OP_C, m_mode }
474 #define Dm { OP_D, m_mode }
475 #define Td { OP_T, d_mode }
476 #define Skip_MODRM { OP_Skip_MODRM, 0 }
478 #define RMeAX { OP_REG, eAX_reg }
479 #define RMeBX { OP_REG, eBX_reg }
480 #define RMeCX { OP_REG, eCX_reg }
481 #define RMeDX { OP_REG, eDX_reg }
482 #define RMeSP { OP_REG, eSP_reg }
483 #define RMeBP { OP_REG, eBP_reg }
484 #define RMeSI { OP_REG, eSI_reg }
485 #define RMeDI { OP_REG, eDI_reg }
486 #define RMrAX { OP_REG, rAX_reg }
487 #define RMrBX { OP_REG, rBX_reg }
488 #define RMrCX { OP_REG, rCX_reg }
489 #define RMrDX { OP_REG, rDX_reg }
490 #define RMrSP { OP_REG, rSP_reg }
491 #define RMrBP { OP_REG, rBP_reg }
492 #define RMrSI { OP_REG, rSI_reg }
493 #define RMrDI { OP_REG, rDI_reg }
494 #define RMAL { OP_REG, al_reg }
495 #define RMCL { OP_REG, cl_reg }
496 #define RMDL { OP_REG, dl_reg }
497 #define RMBL { OP_REG, bl_reg }
498 #define RMAH { OP_REG, ah_reg }
499 #define RMCH { OP_REG, ch_reg }
500 #define RMDH { OP_REG, dh_reg }
501 #define RMBH { OP_REG, bh_reg }
502 #define RMAX { OP_REG, ax_reg }
503 #define RMDX { OP_REG, dx_reg }
505 #define eAX { OP_IMREG, eAX_reg }
506 #define AL { OP_IMREG, al_reg }
507 #define CL { OP_IMREG, cl_reg }
508 #define zAX { OP_IMREG, z_mode_ax_reg }
509 #define indirDX { OP_IMREG, indir_dx_reg }
511 #define Sw { OP_SEG, w_mode }
512 #define Sv { OP_SEG, v_mode }
513 #define Ap { OP_DIR, 0 }
514 #define Ob { OP_OFF64, b_mode }
515 #define Ov { OP_OFF64, v_mode }
516 #define Xb { OP_DSreg, eSI_reg }
517 #define Xv { OP_DSreg, eSI_reg }
518 #define Xz { OP_DSreg, eSI_reg }
519 #define Yb { OP_ESreg, eDI_reg }
520 #define Yv { OP_ESreg, eDI_reg }
521 #define DSBX { OP_DSreg, eBX_reg }
523 #define es { OP_REG, es_reg }
524 #define ss { OP_REG, ss_reg }
525 #define cs { OP_REG, cs_reg }
526 #define ds { OP_REG, ds_reg }
527 #define fs { OP_REG, fs_reg }
528 #define gs { OP_REG, gs_reg }
530 #define MX { OP_MMX, 0 }
531 #define XM { OP_XMM, 0 }
532 #define XMScalar { OP_XMM, scalar_mode }
533 #define XMGatherD { OP_XMM, vex_vsib_d_w_dq_mode }
534 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
535 #define XMM { OP_XMM, xmm_mode }
536 #define TMM { OP_XMM, tmm_mode }
537 #define XMxmmq { OP_XMM, xmmq_mode }
538 #define EM { OP_EM, v_mode }
539 #define EMS { OP_EM, v_swap_mode }
540 #define EMd { OP_EM, d_mode }
541 #define EMx { OP_EM, x_mode }
542 #define EXbwUnit { OP_EX, bw_unit_mode }
543 #define EXb { OP_EX, b_mode }
544 #define EXw { OP_EX, w_mode }
545 #define EXd { OP_EX, d_mode }
546 #define EXdS { OP_EX, d_swap_mode }
547 #define EXwS { OP_EX, w_swap_mode }
548 #define EXq { OP_EX, q_mode }
549 #define EXqS { OP_EX, q_swap_mode }
550 #define EXdq { OP_EX, dq_mode }
551 #define EXx { OP_EX, x_mode }
552 #define EXxh { OP_EX, xh_mode }
553 #define EXxS { OP_EX, x_swap_mode }
554 #define EXxmm { OP_EX, xmm_mode }
555 #define EXymm { OP_EX, ymm_mode }
556 #define EXxmmq { OP_EX, xmmq_mode }
557 #define EXxmmqh { OP_EX, evex_half_bcst_xmmqh_mode }
558 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
559 #define EXxmmdw { OP_EX, xmmdw_mode }
560 #define EXxmmqd { OP_EX, xmmqd_mode }
561 #define EXxmmqdh { OP_EX, evex_half_bcst_xmmqdh_mode }
562 #define EXymmq { OP_EX, ymmq_mode }
563 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
564 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
565 #define Rd { OP_R, d_mode }
566 #define Rdq { OP_R, dq_mode }
567 #define Rq { OP_R, q_mode }
568 #define Nq { OP_R, q_mm_mode }
569 #define Ux { OP_R, x_mode }
570 #define Uxmm { OP_R, xmm_mode }
571 #define Rxmmq { OP_R, xmmq_mode }
572 #define Rymm { OP_R, ymm_mode }
573 #define Rtmm { OP_R, tmm_mode }
574 #define EMCq { OP_EMC, q_mode }
575 #define MXC { OP_MXC, 0 }
576 #define OPSUF { OP_3DNowSuffix, 0 }
577 #define SEP { SEP_Fixup, 0 }
578 #define CMP { CMP_Fixup, 0 }
579 #define XMM0 { XMM_Fixup, 0 }
580 #define FXSAVE { FXSAVE_Fixup, 0 }
582 #define Vex { OP_VEX, x_mode }
583 #define VexW { OP_VexW, x_mode }
584 #define VexScalar { OP_VEX, scalar_mode }
585 #define VexScalarR { OP_VexR, scalar_mode }
586 #define VexGatherD { OP_VEX, vex_vsib_d_w_dq_mode }
587 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
588 #define VexGdq { OP_VEX, dq_mode }
589 #define VexGb { OP_VEX, b_mode }
590 #define VexGv { OP_VEX, v_mode }
591 #define VexTmm { OP_VEX, tmm_mode }
592 #define XMVexI4 { OP_REG_VexI4, x_mode }
593 #define XMVexScalarI4 { OP_REG_VexI4, scalar_mode }
594 #define VexI4 { OP_VexI4, 0 }
595 #define PCLMUL { PCLMUL_Fixup, 0 }
596 #define VPCMP { VPCMP_Fixup, 0 }
597 #define VPCOM { VPCOM_Fixup, 0 }
599 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
600 #define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
601 #define EXxEVexS { OP_Rounding, evex_sae_mode }
603 #define MaskG { OP_G, mask_mode }
604 #define MaskE { OP_E, mask_mode }
605 #define MaskR { OP_R, mask_mode }
606 #define MaskBDE { OP_E, mask_bd_mode }
607 #define MaskVex { OP_VEX, mask_mode }
609 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
610 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
612 #define MVexSIBMEM { OP_M, vex_sibmem_mode }
614 /* Used handle "rep" prefix for string instructions. */
615 #define Xbr { REP_Fixup, eSI_reg }
616 #define Xvr { REP_Fixup, eSI_reg }
617 #define Ybr { REP_Fixup, eDI_reg }
618 #define Yvr { REP_Fixup, eDI_reg }
619 #define Yzr { REP_Fixup, eDI_reg }
620 #define indirDXr { REP_Fixup, indir_dx_reg }
621 #define ALr { REP_Fixup, al_reg }
622 #define eAXr { REP_Fixup, eAX_reg }
624 /* Used handle HLE prefix for lockable instructions. */
625 #define Ebh1 { HLE_Fixup1, b_mode }
626 #define Evh1 { HLE_Fixup1, v_mode }
627 #define Ebh2 { HLE_Fixup2, b_mode }
628 #define Evh2 { HLE_Fixup2, v_mode }
629 #define Ebh3 { HLE_Fixup3, b_mode }
630 #define Evh3 { HLE_Fixup3, v_mode }
632 #define BND { BND_Fixup, 0 }
633 #define NOTRACK { NOTRACK_Fixup, 0 }
635 #define cond_jump_flag { NULL, cond_jump_mode }
636 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
638 /* bits in sizeflag */
639 #define SUFFIX_ALWAYS 4
647 /* byte operand with operand swapped */
649 /* byte operand, sign extend like 'T' suffix */
651 /* operand size depends on prefixes */
653 /* operand size depends on prefixes with operand swapped */
655 /* operand size depends on address prefix */
659 /* double word operand */
661 /* word operand with operand swapped */
663 /* double word operand with operand swapped */
665 /* quad word operand */
667 /* 8-byte MM operand */
669 /* quad word operand with operand swapped */
671 /* ten-byte operand */
673 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
674 broadcast enabled. */
676 /* Similar to x_mode, but with different EVEX mem shifts. */
678 /* Similar to x_mode, but with yet different EVEX mem shifts. */
680 /* Similar to x_mode, but with disabled broadcast. */
682 /* Similar to x_mode, but with operands swapped and disabled broadcast
685 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
686 broadcast of 16bit enabled. */
688 /* 16-byte XMM operand */
690 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
691 memory operand (depending on vector length). Broadcast isn't
694 /* Same as xmmq_mode, but broadcast is allowed. */
695 evex_half_bcst_xmmq_mode
,
696 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
697 memory operand (depending on vector length). 16bit broadcast. */
698 evex_half_bcst_xmmqh_mode
,
699 /* 16-byte XMM, word, double word or quad word operand. */
701 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
703 /* 16-byte XMM, double word, quad word operand or xmm word operand.
705 evex_half_bcst_xmmqdh_mode
,
706 /* 32-byte YMM operand */
708 /* quad word, ymmword or zmmword memory operand. */
712 /* d_mode in 32bit, q_mode in 64bit mode. */
714 /* pair of v_mode operands */
720 /* like v_bnd_mode in 32bit, no RIP-rel in 64bit mode. */
722 /* operand size depends on REX.W / VEX.W. */
724 /* Displacements like v_mode without considering Intel64 ISA. */
728 /* bounds operand with operand swapped */
730 /* 4- or 6-byte pointer operand */
733 /* v_mode for indirect branch opcodes. */
735 /* v_mode for stack-related opcodes. */
737 /* non-quad operand size depends on prefixes */
739 /* 16-byte operand */
741 /* registers like d_mode, memory like b_mode. */
743 /* registers like d_mode, memory like w_mode. */
746 /* Operand size depends on the VEX.W bit, with VSIB dword indices. */
747 vex_vsib_d_w_dq_mode
,
748 /* Operand size depends on the VEX.W bit, with VSIB qword indices. */
749 vex_vsib_q_w_dq_mode
,
750 /* mandatory non-vector SIB. */
753 /* scalar, ignore vector length. */
756 /* Static rounding. */
758 /* Static rounding, 64-bit mode only. */
759 evex_rounding_64_mode
,
760 /* Supress all exceptions. */
763 /* Mask register operand. */
765 /* Mask register operand. */
823 USE_X86_64_EVEX_FROM_VEX_TABLE
,
834 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
836 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
837 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
838 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
839 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
840 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
841 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
842 #define X86_64_EVEX_FROM_VEX_TABLE(I) \
843 DIS386 (USE_X86_64_EVEX_FROM_VEX_TABLE, (I))
844 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
845 #define XOP_8F_TABLE() DIS386 (USE_XOP_8F_TABLE, 0)
846 #define VEX_C4_TABLE() DIS386 (USE_VEX_C4_TABLE, 0)
847 #define VEX_C5_TABLE() DIS386 (USE_VEX_C5_TABLE, 0)
848 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
849 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
850 #define EVEX_TABLE() DIS386 (USE_EVEX_TABLE, 0)
851 #define EVEX_LEN_TABLE(I) DIS386 (USE_EVEX_LEN_TABLE, (I))
891 REG_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0
,
892 REG_VEX_0F38F3_L_0_P_0
,
893 REG_VEX_MAP7_F8_L_0_W_0
,
952 MOD_VEX_0F3849_X86_64_L_0_W_0
,
965 RM_0F1E_P_1_MOD_3_REG_7
,
966 RM_0FAE_REG_6_MOD_3_P_0
,
970 RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0_R_0
,
971 RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_3
,
977 PREFIX_0F00_REG_6_X86_64
,
978 PREFIX_0F01_REG_0_MOD_3_RM_6
,
979 PREFIX_0F01_REG_0_MOD_3_RM_7
,
980 PREFIX_0F01_REG_1_RM_2
,
981 PREFIX_0F01_REG_1_RM_4
,
982 PREFIX_0F01_REG_1_RM_5
,
983 PREFIX_0F01_REG_1_RM_6
,
984 PREFIX_0F01_REG_1_RM_7
,
985 PREFIX_0F01_REG_3_RM_1
,
986 PREFIX_0F01_REG_5_MOD_0
,
987 PREFIX_0F01_REG_5_MOD_3_RM_0
,
988 PREFIX_0F01_REG_5_MOD_3_RM_1
,
989 PREFIX_0F01_REG_5_MOD_3_RM_2
,
990 PREFIX_0F01_REG_5_MOD_3_RM_4
,
991 PREFIX_0F01_REG_5_MOD_3_RM_5
,
992 PREFIX_0F01_REG_5_MOD_3_RM_6
,
993 PREFIX_0F01_REG_5_MOD_3_RM_7
,
994 PREFIX_0F01_REG_7_MOD_3_RM_2
,
995 PREFIX_0F01_REG_7_MOD_3_RM_5
,
996 PREFIX_0F01_REG_7_MOD_3_RM_6
,
997 PREFIX_0F01_REG_7_MOD_3_RM_7
,
1003 PREFIX_0F18_REG_6_MOD_0_X86_64
,
1004 PREFIX_0F18_REG_7_MOD_0_X86_64
,
1037 PREFIX_0FAE_REG_0_MOD_3
,
1038 PREFIX_0FAE_REG_1_MOD_3
,
1039 PREFIX_0FAE_REG_2_MOD_3
,
1040 PREFIX_0FAE_REG_3_MOD_3
,
1041 PREFIX_0FAE_REG_4_MOD_0
,
1042 PREFIX_0FAE_REG_4_MOD_3
,
1043 PREFIX_0FAE_REG_5_MOD_3
,
1044 PREFIX_0FAE_REG_6_MOD_0
,
1045 PREFIX_0FAE_REG_6_MOD_3
,
1046 PREFIX_0FAE_REG_7_MOD_0
,
1051 PREFIX_0FC7_REG_6_MOD_0
,
1052 PREFIX_0FC7_REG_6_MOD_3
,
1053 PREFIX_0FC7_REG_7_MOD_3
,
1069 PREFIX_0F38F8_M_1_X86_64
,
1079 PREFIX_VEX_0F41_L_1_W_0
,
1080 PREFIX_VEX_0F41_L_1_W_1
,
1081 PREFIX_VEX_0F42_L_1_W_0
,
1082 PREFIX_VEX_0F42_L_1_W_1
,
1083 PREFIX_VEX_0F44_L_0_W_0
,
1084 PREFIX_VEX_0F44_L_0_W_1
,
1085 PREFIX_VEX_0F45_L_1_W_0
,
1086 PREFIX_VEX_0F45_L_1_W_1
,
1087 PREFIX_VEX_0F46_L_1_W_0
,
1088 PREFIX_VEX_0F46_L_1_W_1
,
1089 PREFIX_VEX_0F47_L_1_W_0
,
1090 PREFIX_VEX_0F47_L_1_W_1
,
1091 PREFIX_VEX_0F4A_L_1_W_0
,
1092 PREFIX_VEX_0F4A_L_1_W_1
,
1093 PREFIX_VEX_0F4B_L_1_W_0
,
1094 PREFIX_VEX_0F4B_L_1_W_1
,
1099 PREFIX_VEX_0F90_L_0_W_0
,
1100 PREFIX_VEX_0F90_L_0_W_1
,
1101 PREFIX_VEX_0F91_L_0_W_0
,
1102 PREFIX_VEX_0F91_L_0_W_1
,
1103 PREFIX_VEX_0F92_L_0_W_0
,
1104 PREFIX_VEX_0F92_L_0_W_1
,
1105 PREFIX_VEX_0F93_L_0_W_0
,
1106 PREFIX_VEX_0F93_L_0_W_1
,
1107 PREFIX_VEX_0F98_L_0_W_0
,
1108 PREFIX_VEX_0F98_L_0_W_1
,
1109 PREFIX_VEX_0F99_L_0_W_0
,
1110 PREFIX_VEX_0F99_L_0_W_1
,
1111 PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_0
,
1112 PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_1
,
1113 PREFIX_VEX_0F384B_X86_64_L_0_W_0
,
1114 PREFIX_VEX_0F3850_W_0
,
1115 PREFIX_VEX_0F3851_W_0
,
1116 PREFIX_VEX_0F385C_X86_64_L_0_W_0
,
1117 PREFIX_VEX_0F385E_X86_64_L_0_W_0
,
1118 PREFIX_VEX_0F386C_X86_64_L_0_W_0
,
1120 PREFIX_VEX_0F38B0_W_0
,
1121 PREFIX_VEX_0F38B1_W_0
,
1122 PREFIX_VEX_0F38D2_W_0
,
1123 PREFIX_VEX_0F38D3_W_0
,
1127 PREFIX_VEX_0F38DA_W_0
,
1128 PREFIX_VEX_0F38F2_L_0
,
1129 PREFIX_VEX_0F38F3_L_0
,
1130 PREFIX_VEX_0F38F5_L_0
,
1131 PREFIX_VEX_0F38F6_L_0
,
1132 PREFIX_VEX_0F38F7_L_0
,
1133 PREFIX_VEX_0F3AF0_L_0
,
1134 PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64
,
1192 PREFIX_EVEX_MAP4_D8
,
1193 PREFIX_EVEX_MAP4_DA
,
1194 PREFIX_EVEX_MAP4_DB
,
1195 PREFIX_EVEX_MAP4_DC
,
1196 PREFIX_EVEX_MAP4_DD
,
1197 PREFIX_EVEX_MAP4_DE
,
1198 PREFIX_EVEX_MAP4_DF
,
1199 PREFIX_EVEX_MAP4_F0
,
1200 PREFIX_EVEX_MAP4_F1
,
1201 PREFIX_EVEX_MAP4_F2
,
1202 PREFIX_EVEX_MAP4_F8
,
1204 PREFIX_EVEX_MAP5_10
,
1205 PREFIX_EVEX_MAP5_11
,
1206 PREFIX_EVEX_MAP5_1D
,
1207 PREFIX_EVEX_MAP5_2A
,
1208 PREFIX_EVEX_MAP5_2C
,
1209 PREFIX_EVEX_MAP5_2D
,
1210 PREFIX_EVEX_MAP5_2E
,
1211 PREFIX_EVEX_MAP5_2F
,
1212 PREFIX_EVEX_MAP5_51
,
1213 PREFIX_EVEX_MAP5_58
,
1214 PREFIX_EVEX_MAP5_59
,
1215 PREFIX_EVEX_MAP5_5A
,
1216 PREFIX_EVEX_MAP5_5B
,
1217 PREFIX_EVEX_MAP5_5C
,
1218 PREFIX_EVEX_MAP5_5D
,
1219 PREFIX_EVEX_MAP5_5E
,
1220 PREFIX_EVEX_MAP5_5F
,
1221 PREFIX_EVEX_MAP5_78
,
1222 PREFIX_EVEX_MAP5_79
,
1223 PREFIX_EVEX_MAP5_7A
,
1224 PREFIX_EVEX_MAP5_7B
,
1225 PREFIX_EVEX_MAP5_7C
,
1226 PREFIX_EVEX_MAP5_7D
,
1228 PREFIX_EVEX_MAP6_13
,
1229 PREFIX_EVEX_MAP6_56
,
1230 PREFIX_EVEX_MAP6_57
,
1231 PREFIX_EVEX_MAP6_D6
,
1232 PREFIX_EVEX_MAP6_D7
,
1268 X86_64_0F01_REG_0_MOD_3_RM_6_P_1
,
1269 X86_64_0F01_REG_0_MOD_3_RM_6_P_3
,
1270 X86_64_0F01_REG_0_MOD_3_RM_7_P_0
,
1272 X86_64_0F01_REG_1_RM_2_PREFIX_1
,
1273 X86_64_0F01_REG_1_RM_2_PREFIX_3
,
1274 X86_64_0F01_REG_1_RM_5_PREFIX_2
,
1275 X86_64_0F01_REG_1_RM_6_PREFIX_2
,
1276 X86_64_0F01_REG_1_RM_7_PREFIX_2
,
1279 X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
,
1280 X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
,
1281 X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
,
1282 X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
,
1283 X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1
,
1284 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
,
1285 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
,
1286 X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
,
1287 X86_64_0F18_REG_6_MOD_0
,
1288 X86_64_0F18_REG_7_MOD_0
,
1292 X86_64_0FC7_REG_6_MOD_3_PREFIX_1
,
1316 X86_64_VEX_MAP7_F8_L_0_W_0_R_0
,
1332 THREE_BYTE_0F38
= 0,
1363 VEX_LEN_0F12_P_0
= 0,
1396 VEX_LEN_0F3849_X86_64
,
1397 VEX_LEN_0F384B_X86_64
,
1399 VEX_LEN_0F385C_X86_64
,
1400 VEX_LEN_0F385E_X86_64
,
1401 VEX_LEN_0F386C_X86_64
,
1402 VEX_LEN_0F38CB_P_3_W_0
,
1403 VEX_LEN_0F38CC_P_3_W_0
,
1404 VEX_LEN_0F38CD_P_3_W_0
,
1405 VEX_LEN_0F38DA_W_0_P_0
,
1406 VEX_LEN_0F38DA_W_0_P_2
,
1469 VEX_LEN_XOP_09_82_W_0
,
1470 VEX_LEN_XOP_09_83_W_0
,
1503 EVEX_LEN_0F3816
= 0,
1557 VEX_W_0F3849_X86_64_L_0
,
1558 VEX_W_0F384B_X86_64_L_0
,
1566 VEX_W_0F385C_X86_64_L_0
,
1567 VEX_W_0F385E_X86_64_L_0
,
1568 VEX_W_0F386C_X86_64_L_0
,
1603 VEX_W_XOP_08_85_L_0
,
1604 VEX_W_XOP_08_86_L_0
,
1605 VEX_W_XOP_08_87_L_0
,
1606 VEX_W_XOP_08_8E_L_0
,
1607 VEX_W_XOP_08_8F_L_0
,
1608 VEX_W_XOP_08_95_L_0
,
1609 VEX_W_XOP_08_96_L_0
,
1610 VEX_W_XOP_08_97_L_0
,
1611 VEX_W_XOP_08_9E_L_0
,
1612 VEX_W_XOP_08_9F_L_0
,
1613 VEX_W_XOP_08_A6_L_0
,
1614 VEX_W_XOP_08_B6_L_0
,
1615 VEX_W_XOP_08_C0_L_0
,
1616 VEX_W_XOP_08_C1_L_0
,
1617 VEX_W_XOP_08_C2_L_0
,
1618 VEX_W_XOP_08_C3_L_0
,
1619 VEX_W_XOP_08_CC_L_0
,
1620 VEX_W_XOP_08_CD_L_0
,
1621 VEX_W_XOP_08_CE_L_0
,
1622 VEX_W_XOP_08_CF_L_0
,
1623 VEX_W_XOP_08_EC_L_0
,
1624 VEX_W_XOP_08_ED_L_0
,
1625 VEX_W_XOP_08_EE_L_0
,
1626 VEX_W_XOP_08_EF_L_0
,
1632 VEX_W_XOP_09_C1_L_0
,
1633 VEX_W_XOP_09_C2_L_0
,
1634 VEX_W_XOP_09_C3_L_0
,
1635 VEX_W_XOP_09_C6_L_0
,
1636 VEX_W_XOP_09_C7_L_0
,
1637 VEX_W_XOP_09_CB_L_0
,
1638 VEX_W_XOP_09_D1_L_0
,
1639 VEX_W_XOP_09_D2_L_0
,
1640 VEX_W_XOP_09_D3_L_0
,
1641 VEX_W_XOP_09_D6_L_0
,
1642 VEX_W_XOP_09_D7_L_0
,
1643 VEX_W_XOP_09_DB_L_0
,
1644 VEX_W_XOP_09_E1_L_0
,
1645 VEX_W_XOP_09_E2_L_0
,
1646 VEX_W_XOP_09_E3_L_0
,
1755 typedef bool (*op_rtn
) (instr_info
*ins
, int bytemode
, int sizeflag
);
1764 unsigned int prefix_requirement
;
1767 /* Upper case letters in the instruction names here are macros.
1768 'A' => print 'b' if no register operands or suffix_always is true
1769 'B' => print 'b' if suffix_always is true
1770 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
1772 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
1773 suffix_always is true
1774 'E' => print 'e' if 32-bit form of jcxz
1775 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
1776 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
1777 'H' => print ",pt" or ",pn" branch hint
1780 'K' => print 'd' or 'q' if rex prefix is present.
1781 'L' => print 'l' or 'q' if suffix_always is true
1782 'M' => print 'r' if intel_mnemonic is false.
1783 'N' => print 'n' if instruction has no wait "prefix"
1784 'O' => print 'd' or 'o' (or 'q' in Intel mode)
1785 'P' => behave as 'T' except with register operand outside of suffix_always
1787 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
1789 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
1790 'S' => print 'w', 'l' or 'q' if suffix_always is true
1791 'T' => print 'w', 'l'/'d', or 'q' if instruction has an operand size
1792 prefix or if suffix_always is true.
1794 'V' => print 'v' for VEX/EVEX and nothing for legacy encodings.
1795 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
1796 'X' => print 's', 'd' depending on data16 prefix (for XMM)
1797 'Y' => no output, mark EVEX.aaa != 0 as bad.
1798 'Z' => print 'q' in 64bit mode and 'l' otherwise, if suffix_always is true.
1799 '!' => change condition from true to false or from false to true.
1800 '%' => add 1 upper case letter to the macro.
1801 '^' => print 'w', 'l', or 'q' (Intel64 ISA only) depending on operand size
1802 prefix or suffix_always is true (lcall/ljmp).
1803 '@' => in 64bit mode for Intel64 ISA or if instruction
1804 has no operand sizing prefix, print 'q' if suffix_always is true or
1805 nothing otherwise; behave as 'P' in all other cases
1807 2 upper case letter macros:
1808 "XY" => print 'x' or 'y' if suffix_always is true or no register
1809 operands and no broadcast.
1810 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
1811 register operands and no broadcast.
1812 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
1813 "XD" => print 'd' if !EVEX or EVEX.W=1, EVEX.W=0 is not a valid encoding
1814 "XH" => print 'h' if EVEX.W=0, EVEX.W=1 is not a valid encoding (for FP16)
1815 "XS" => print 's' if !EVEX or EVEX.W=0, EVEX.W=1 is not a valid encoding
1816 "XV" => print "{vex} " pseudo prefix
1817 "XE" => print "{evex} " pseudo prefix if no EVEX-specific functionality is
1818 is used by an EVEX-encoded (AVX512VL) instruction.
1819 "YK" keep unused, to avoid ambiguity with the combined use of Y and K.
1820 "YX" keep unused, to avoid ambiguity with the combined use of Y and X.
1821 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond
1822 being false, or no operand at all in 64bit mode, or if suffix_always
1824 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
1825 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
1826 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
1827 "DQ" => print 'd' or 'q' depending on the VEX.W bit
1828 "BW" => print 'b' or 'w' depending on the VEX.W bit
1829 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
1830 an operand size prefix, or suffix_always is true. print
1831 'q' if rex prefix is present.
1833 Many of the above letters print nothing in Intel mode. See "putop"
1836 Braces '{' and '}', and vertical bars '|', indicate alternative
1837 mnemonic strings for AT&T and Intel. */
1839 static const struct dis386 dis386
[] = {
1841 { "addB", { Ebh1
, Gb
}, 0 },
1842 { "addS", { Evh1
, Gv
}, 0 },
1843 { "addB", { Gb
, EbS
}, 0 },
1844 { "addS", { Gv
, EvS
}, 0 },
1845 { "addB", { AL
, Ib
}, 0 },
1846 { "addS", { eAX
, Iv
}, 0 },
1847 { X86_64_TABLE (X86_64_06
) },
1848 { X86_64_TABLE (X86_64_07
) },
1850 { "orB", { Ebh1
, Gb
}, 0 },
1851 { "orS", { Evh1
, Gv
}, 0 },
1852 { "orB", { Gb
, EbS
}, 0 },
1853 { "orS", { Gv
, EvS
}, 0 },
1854 { "orB", { AL
, Ib
}, 0 },
1855 { "orS", { eAX
, Iv
}, 0 },
1856 { X86_64_TABLE (X86_64_0E
) },
1857 { Bad_Opcode
}, /* 0x0f extended opcode escape */
1859 { "adcB", { Ebh1
, Gb
}, 0 },
1860 { "adcS", { Evh1
, Gv
}, 0 },
1861 { "adcB", { Gb
, EbS
}, 0 },
1862 { "adcS", { Gv
, EvS
}, 0 },
1863 { "adcB", { AL
, Ib
}, 0 },
1864 { "adcS", { eAX
, Iv
}, 0 },
1865 { X86_64_TABLE (X86_64_16
) },
1866 { X86_64_TABLE (X86_64_17
) },
1868 { "sbbB", { Ebh1
, Gb
}, 0 },
1869 { "sbbS", { Evh1
, Gv
}, 0 },
1870 { "sbbB", { Gb
, EbS
}, 0 },
1871 { "sbbS", { Gv
, EvS
}, 0 },
1872 { "sbbB", { AL
, Ib
}, 0 },
1873 { "sbbS", { eAX
, Iv
}, 0 },
1874 { X86_64_TABLE (X86_64_1E
) },
1875 { X86_64_TABLE (X86_64_1F
) },
1877 { "andB", { Ebh1
, Gb
}, 0 },
1878 { "andS", { Evh1
, Gv
}, 0 },
1879 { "andB", { Gb
, EbS
}, 0 },
1880 { "andS", { Gv
, EvS
}, 0 },
1881 { "andB", { AL
, Ib
}, 0 },
1882 { "andS", { eAX
, Iv
}, 0 },
1883 { Bad_Opcode
}, /* SEG ES prefix */
1884 { X86_64_TABLE (X86_64_27
) },
1886 { "subB", { Ebh1
, Gb
}, 0 },
1887 { "subS", { Evh1
, Gv
}, 0 },
1888 { "subB", { Gb
, EbS
}, 0 },
1889 { "subS", { Gv
, EvS
}, 0 },
1890 { "subB", { AL
, Ib
}, 0 },
1891 { "subS", { eAX
, Iv
}, 0 },
1892 { Bad_Opcode
}, /* SEG CS prefix */
1893 { X86_64_TABLE (X86_64_2F
) },
1895 { "xorB", { Ebh1
, Gb
}, 0 },
1896 { "xorS", { Evh1
, Gv
}, 0 },
1897 { "xorB", { Gb
, EbS
}, 0 },
1898 { "xorS", { Gv
, EvS
}, 0 },
1899 { "xorB", { AL
, Ib
}, 0 },
1900 { "xorS", { eAX
, Iv
}, 0 },
1901 { Bad_Opcode
}, /* SEG SS prefix */
1902 { X86_64_TABLE (X86_64_37
) },
1904 { "cmpB", { Eb
, Gb
}, 0 },
1905 { "cmpS", { Ev
, Gv
}, 0 },
1906 { "cmpB", { Gb
, EbS
}, 0 },
1907 { "cmpS", { Gv
, EvS
}, 0 },
1908 { "cmpB", { AL
, Ib
}, 0 },
1909 { "cmpS", { eAX
, Iv
}, 0 },
1910 { Bad_Opcode
}, /* SEG DS prefix */
1911 { X86_64_TABLE (X86_64_3F
) },
1913 { "inc{S|}", { RMeAX
}, 0 },
1914 { "inc{S|}", { RMeCX
}, 0 },
1915 { "inc{S|}", { RMeDX
}, 0 },
1916 { "inc{S|}", { RMeBX
}, 0 },
1917 { "inc{S|}", { RMeSP
}, 0 },
1918 { "inc{S|}", { RMeBP
}, 0 },
1919 { "inc{S|}", { RMeSI
}, 0 },
1920 { "inc{S|}", { RMeDI
}, 0 },
1922 { "dec{S|}", { RMeAX
}, 0 },
1923 { "dec{S|}", { RMeCX
}, 0 },
1924 { "dec{S|}", { RMeDX
}, 0 },
1925 { "dec{S|}", { RMeBX
}, 0 },
1926 { "dec{S|}", { RMeSP
}, 0 },
1927 { "dec{S|}", { RMeBP
}, 0 },
1928 { "dec{S|}", { RMeSI
}, 0 },
1929 { "dec{S|}", { RMeDI
}, 0 },
1931 { "push!P", { RMrAX
}, 0 },
1932 { "push!P", { RMrCX
}, 0 },
1933 { "push!P", { RMrDX
}, 0 },
1934 { "push!P", { RMrBX
}, 0 },
1935 { "push!P", { RMrSP
}, 0 },
1936 { "push!P", { RMrBP
}, 0 },
1937 { "push!P", { RMrSI
}, 0 },
1938 { "push!P", { RMrDI
}, 0 },
1940 { "pop!P", { RMrAX
}, 0 },
1941 { "pop!P", { RMrCX
}, 0 },
1942 { "pop!P", { RMrDX
}, 0 },
1943 { "pop!P", { RMrBX
}, 0 },
1944 { "pop!P", { RMrSP
}, 0 },
1945 { "pop!P", { RMrBP
}, 0 },
1946 { "pop!P", { RMrSI
}, 0 },
1947 { "pop!P", { RMrDI
}, 0 },
1949 { X86_64_TABLE (X86_64_60
) },
1950 { X86_64_TABLE (X86_64_61
) },
1951 { X86_64_TABLE (X86_64_62
) },
1952 { X86_64_TABLE (X86_64_63
) },
1953 { Bad_Opcode
}, /* seg fs */
1954 { Bad_Opcode
}, /* seg gs */
1955 { Bad_Opcode
}, /* op size prefix */
1956 { Bad_Opcode
}, /* adr size prefix */
1958 { "pushP", { sIv
}, 0 },
1959 { "imulS", { Gv
, Ev
, Iv
}, 0 },
1960 { "pushP", { sIbT
}, 0 },
1961 { "imulS", { Gv
, Ev
, sIb
}, 0 },
1962 { "ins{b|}", { Ybr
, indirDX
}, 0 },
1963 { X86_64_TABLE (X86_64_6D
) },
1964 { "outs{b|}", { indirDXr
, Xb
}, 0 },
1965 { X86_64_TABLE (X86_64_6F
) },
1967 { "joH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1968 { "jnoH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1969 { "jbH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1970 { "jaeH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1971 { "jeH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1972 { "jneH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1973 { "jbeH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1974 { "jaH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1976 { "jsH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1977 { "jnsH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1978 { "jpH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1979 { "jnpH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1980 { "jlH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1981 { "jgeH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1982 { "jleH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1983 { "jgH", { Jb
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
1985 { REG_TABLE (REG_80
) },
1986 { REG_TABLE (REG_81
) },
1987 { X86_64_TABLE (X86_64_82
) },
1988 { REG_TABLE (REG_83
) },
1989 { "testB", { Eb
, Gb
}, 0 },
1990 { "testS", { Ev
, Gv
}, 0 },
1991 { "xchgB", { Ebh2
, Gb
}, 0 },
1992 { "xchgS", { Evh2
, Gv
}, 0 },
1994 { "movB", { Ebh3
, Gb
}, 0 },
1995 { "movS", { Evh3
, Gv
}, 0 },
1996 { "movB", { Gb
, EbS
}, 0 },
1997 { "movS", { Gv
, EvS
}, 0 },
1998 { "movD", { Sv
, Sw
}, 0 },
1999 { "leaS", { Gv
, M
}, 0 },
2000 { "movD", { Sw
, Sv
}, 0 },
2001 { REG_TABLE (REG_8F
) },
2003 { PREFIX_TABLE (PREFIX_90
) },
2004 { "xchgS", { RMeCX
, eAX
}, 0 },
2005 { "xchgS", { RMeDX
, eAX
}, 0 },
2006 { "xchgS", { RMeBX
, eAX
}, 0 },
2007 { "xchgS", { RMeSP
, eAX
}, 0 },
2008 { "xchgS", { RMeBP
, eAX
}, 0 },
2009 { "xchgS", { RMeSI
, eAX
}, 0 },
2010 { "xchgS", { RMeDI
, eAX
}, 0 },
2012 { "cW{t|}R", { XX
}, 0 },
2013 { "cR{t|}O", { XX
}, 0 },
2014 { X86_64_TABLE (X86_64_9A
) },
2015 { Bad_Opcode
}, /* fwait */
2016 { "pushfP", { XX
}, 0 },
2017 { "popfP", { XX
}, 0 },
2018 { "sahf", { XX
}, 0 },
2019 { "lahf", { XX
}, 0 },
2021 { "mov%LB", { AL
, Ob
}, PREFIX_REX2_ILLEGAL
},
2022 { "mov%LS", { { JMPABS_Fixup
, eAX_reg
}, { JMPABS_Fixup
, v_mode
} }, PREFIX_REX2_ILLEGAL
},
2023 { "mov%LB", { Ob
, AL
}, PREFIX_REX2_ILLEGAL
},
2024 { "mov%LS", { Ov
, eAX
}, PREFIX_REX2_ILLEGAL
},
2025 { "movs{b|}", { Ybr
, Xb
}, PREFIX_REX2_ILLEGAL
},
2026 { "movs{R|}", { Yvr
, Xv
}, PREFIX_REX2_ILLEGAL
},
2027 { "cmps{b|}", { Xb
, Yb
}, PREFIX_REX2_ILLEGAL
},
2028 { "cmps{R|}", { Xv
, Yv
}, PREFIX_REX2_ILLEGAL
},
2030 { "testB", { AL
, Ib
}, PREFIX_REX2_ILLEGAL
},
2031 { "testS", { eAX
, Iv
}, PREFIX_REX2_ILLEGAL
},
2032 { "stosB", { Ybr
, AL
}, PREFIX_REX2_ILLEGAL
},
2033 { "stosS", { Yvr
, eAX
}, PREFIX_REX2_ILLEGAL
},
2034 { "lodsB", { ALr
, Xb
}, PREFIX_REX2_ILLEGAL
},
2035 { "lodsS", { eAXr
, Xv
}, PREFIX_REX2_ILLEGAL
},
2036 { "scasB", { AL
, Yb
}, PREFIX_REX2_ILLEGAL
},
2037 { "scasS", { eAX
, Yv
}, PREFIX_REX2_ILLEGAL
},
2039 { "movB", { RMAL
, Ib
}, 0 },
2040 { "movB", { RMCL
, Ib
}, 0 },
2041 { "movB", { RMDL
, Ib
}, 0 },
2042 { "movB", { RMBL
, Ib
}, 0 },
2043 { "movB", { RMAH
, Ib
}, 0 },
2044 { "movB", { RMCH
, Ib
}, 0 },
2045 { "movB", { RMDH
, Ib
}, 0 },
2046 { "movB", { RMBH
, Ib
}, 0 },
2048 { "mov%LV", { RMeAX
, Iv64
}, 0 },
2049 { "mov%LV", { RMeCX
, Iv64
}, 0 },
2050 { "mov%LV", { RMeDX
, Iv64
}, 0 },
2051 { "mov%LV", { RMeBX
, Iv64
}, 0 },
2052 { "mov%LV", { RMeSP
, Iv64
}, 0 },
2053 { "mov%LV", { RMeBP
, Iv64
}, 0 },
2054 { "mov%LV", { RMeSI
, Iv64
}, 0 },
2055 { "mov%LV", { RMeDI
, Iv64
}, 0 },
2057 { REG_TABLE (REG_C0
) },
2058 { REG_TABLE (REG_C1
) },
2059 { X86_64_TABLE (X86_64_C2
) },
2060 { X86_64_TABLE (X86_64_C3
) },
2061 { X86_64_TABLE (X86_64_C4
) },
2062 { X86_64_TABLE (X86_64_C5
) },
2063 { REG_TABLE (REG_C6
) },
2064 { REG_TABLE (REG_C7
) },
2066 { "enterP", { Iw
, Ib
}, 0 },
2067 { "leaveP", { XX
}, 0 },
2068 { "{l|}ret{|f}%LP", { Iw
}, 0 },
2069 { "{l|}ret{|f}%LP", { XX
}, 0 },
2070 { "int3", { XX
}, 0 },
2071 { "int", { Ib
}, 0 },
2072 { X86_64_TABLE (X86_64_CE
) },
2073 { "iret%LP", { XX
}, 0 },
2075 { REG_TABLE (REG_D0
) },
2076 { REG_TABLE (REG_D1
) },
2077 { REG_TABLE (REG_D2
) },
2078 { REG_TABLE (REG_D3
) },
2079 { X86_64_TABLE (X86_64_D4
) },
2080 { X86_64_TABLE (X86_64_D5
) },
2082 { "xlat", { DSBX
}, 0 },
2093 { "loopneFH", { Jb
, XX
, loop_jcxz_flag
}, PREFIX_REX2_ILLEGAL
},
2094 { "loopeFH", { Jb
, XX
, loop_jcxz_flag
}, PREFIX_REX2_ILLEGAL
},
2095 { "loopFH", { Jb
, XX
, loop_jcxz_flag
}, PREFIX_REX2_ILLEGAL
},
2096 { "jEcxzH", { Jb
, XX
, loop_jcxz_flag
}, PREFIX_REX2_ILLEGAL
},
2097 { "inB", { AL
, Ib
}, PREFIX_REX2_ILLEGAL
},
2098 { "inG", { zAX
, Ib
}, PREFIX_REX2_ILLEGAL
},
2099 { "outB", { Ib
, AL
}, PREFIX_REX2_ILLEGAL
},
2100 { "outG", { Ib
, zAX
}, PREFIX_REX2_ILLEGAL
},
2102 { X86_64_TABLE (X86_64_E8
) },
2103 { X86_64_TABLE (X86_64_E9
) },
2104 { X86_64_TABLE (X86_64_EA
) },
2105 { "jmp", { Jb
, BND
}, PREFIX_REX2_ILLEGAL
},
2106 { "inB", { AL
, indirDX
}, PREFIX_REX2_ILLEGAL
},
2107 { "inG", { zAX
, indirDX
}, PREFIX_REX2_ILLEGAL
},
2108 { "outB", { indirDX
, AL
}, PREFIX_REX2_ILLEGAL
},
2109 { "outG", { indirDX
, zAX
}, PREFIX_REX2_ILLEGAL
},
2111 { Bad_Opcode
}, /* lock prefix */
2112 { "int1", { XX
}, 0 },
2113 { Bad_Opcode
}, /* repne */
2114 { Bad_Opcode
}, /* repz */
2115 { "hlt", { XX
}, 0 },
2116 { "cmc", { XX
}, 0 },
2117 { REG_TABLE (REG_F6
) },
2118 { REG_TABLE (REG_F7
) },
2120 { "clc", { XX
}, 0 },
2121 { "stc", { XX
}, 0 },
2122 { "cli", { XX
}, 0 },
2123 { "sti", { XX
}, 0 },
2124 { "cld", { XX
}, 0 },
2125 { "std", { XX
}, 0 },
2126 { REG_TABLE (REG_FE
) },
2127 { REG_TABLE (REG_FF
) },
2130 static const struct dis386 dis386_twobyte
[] = {
2132 { REG_TABLE (REG_0F00
) },
2133 { REG_TABLE (REG_0F01
) },
2134 { "larS", { Gv
, Sv
}, 0 },
2135 { "lslS", { Gv
, Sv
}, 0 },
2137 { "syscall", { XX
}, 0 },
2138 { "clts", { XX
}, 0 },
2139 { "sysret%LQ", { XX
}, 0 },
2141 { "invd", { XX
}, 0 },
2142 { PREFIX_TABLE (PREFIX_0F09
) },
2144 { "ud2", { XX
}, 0 },
2146 { REG_TABLE (REG_0F0D
) },
2147 { "femms", { XX
}, 0 },
2148 { "", { MX
, EM
, OPSUF
}, 0 }, /* See OP_3DNowSuffix. */
2150 { PREFIX_TABLE (PREFIX_0F10
) },
2151 { PREFIX_TABLE (PREFIX_0F11
) },
2152 { PREFIX_TABLE (PREFIX_0F12
) },
2153 { "movlpX", { Mq
, XM
}, PREFIX_OPCODE
},
2154 { "unpcklpX", { XM
, EXx
}, PREFIX_OPCODE
},
2155 { "unpckhpX", { XM
, EXx
}, PREFIX_OPCODE
},
2156 { PREFIX_TABLE (PREFIX_0F16
) },
2157 { "movhpX", { Mq
, XM
}, PREFIX_OPCODE
},
2159 { REG_TABLE (REG_0F18
) },
2160 { "nopQ", { Ev
}, 0 },
2161 { PREFIX_TABLE (PREFIX_0F1A
) },
2162 { PREFIX_TABLE (PREFIX_0F1B
) },
2163 { PREFIX_TABLE (PREFIX_0F1C
) },
2164 { "nopQ", { Ev
}, 0 },
2165 { PREFIX_TABLE (PREFIX_0F1E
) },
2166 { "nopQ", { Ev
}, 0 },
2168 { "movZ", { Em
, Cm
}, 0 },
2169 { "movZ", { Em
, Dm
}, 0 },
2170 { "movZ", { Cm
, Em
}, 0 },
2171 { "movZ", { Dm
, Em
}, 0 },
2172 { X86_64_TABLE (X86_64_0F24
) },
2174 { X86_64_TABLE (X86_64_0F26
) },
2177 { "movapX", { XM
, EXx
}, PREFIX_OPCODE
},
2178 { "movapX", { EXxS
, XM
}, PREFIX_OPCODE
},
2179 { PREFIX_TABLE (PREFIX_0F2A
) },
2180 { PREFIX_TABLE (PREFIX_0F2B
) },
2181 { PREFIX_TABLE (PREFIX_0F2C
) },
2182 { PREFIX_TABLE (PREFIX_0F2D
) },
2183 { PREFIX_TABLE (PREFIX_0F2E
) },
2184 { PREFIX_TABLE (PREFIX_0F2F
) },
2186 { "wrmsr", { XX
}, PREFIX_REX2_ILLEGAL
},
2187 { "rdtsc", { XX
}, PREFIX_REX2_ILLEGAL
},
2188 { "rdmsr", { XX
}, PREFIX_REX2_ILLEGAL
},
2189 { "rdpmc", { XX
}, PREFIX_REX2_ILLEGAL
},
2190 { "sysenter", { SEP
}, PREFIX_REX2_ILLEGAL
},
2191 { "sysexit%LQ", { SEP
}, PREFIX_REX2_ILLEGAL
},
2193 { "getsec", { XX
}, 0 },
2195 { THREE_BYTE_TABLE (THREE_BYTE_0F38
) },
2197 { THREE_BYTE_TABLE (THREE_BYTE_0F3A
) },
2204 { "cmovoS", { Gv
, Ev
}, 0 },
2205 { "cmovnoS", { Gv
, Ev
}, 0 },
2206 { "cmovbS", { Gv
, Ev
}, 0 },
2207 { "cmovaeS", { Gv
, Ev
}, 0 },
2208 { "cmoveS", { Gv
, Ev
}, 0 },
2209 { "cmovneS", { Gv
, Ev
}, 0 },
2210 { "cmovbeS", { Gv
, Ev
}, 0 },
2211 { "cmovaS", { Gv
, Ev
}, 0 },
2213 { "cmovsS", { Gv
, Ev
}, 0 },
2214 { "cmovnsS", { Gv
, Ev
}, 0 },
2215 { "cmovpS", { Gv
, Ev
}, 0 },
2216 { "cmovnpS", { Gv
, Ev
}, 0 },
2217 { "cmovlS", { Gv
, Ev
}, 0 },
2218 { "cmovgeS", { Gv
, Ev
}, 0 },
2219 { "cmovleS", { Gv
, Ev
}, 0 },
2220 { "cmovgS", { Gv
, Ev
}, 0 },
2222 { "movmskpX", { Gdq
, Ux
}, PREFIX_OPCODE
},
2223 { PREFIX_TABLE (PREFIX_0F51
) },
2224 { PREFIX_TABLE (PREFIX_0F52
) },
2225 { PREFIX_TABLE (PREFIX_0F53
) },
2226 { "andpX", { XM
, EXx
}, PREFIX_OPCODE
},
2227 { "andnpX", { XM
, EXx
}, PREFIX_OPCODE
},
2228 { "orpX", { XM
, EXx
}, PREFIX_OPCODE
},
2229 { "xorpX", { XM
, EXx
}, PREFIX_OPCODE
},
2231 { PREFIX_TABLE (PREFIX_0F58
) },
2232 { PREFIX_TABLE (PREFIX_0F59
) },
2233 { PREFIX_TABLE (PREFIX_0F5A
) },
2234 { PREFIX_TABLE (PREFIX_0F5B
) },
2235 { PREFIX_TABLE (PREFIX_0F5C
) },
2236 { PREFIX_TABLE (PREFIX_0F5D
) },
2237 { PREFIX_TABLE (PREFIX_0F5E
) },
2238 { PREFIX_TABLE (PREFIX_0F5F
) },
2240 { PREFIX_TABLE (PREFIX_0F60
) },
2241 { PREFIX_TABLE (PREFIX_0F61
) },
2242 { PREFIX_TABLE (PREFIX_0F62
) },
2243 { "packsswb", { MX
, EM
}, PREFIX_OPCODE
},
2244 { "pcmpgtb", { MX
, EM
}, PREFIX_OPCODE
},
2245 { "pcmpgtw", { MX
, EM
}, PREFIX_OPCODE
},
2246 { "pcmpgtd", { MX
, EM
}, PREFIX_OPCODE
},
2247 { "packuswb", { MX
, EM
}, PREFIX_OPCODE
},
2249 { "punpckhbw", { MX
, EM
}, PREFIX_OPCODE
},
2250 { "punpckhwd", { MX
, EM
}, PREFIX_OPCODE
},
2251 { "punpckhdq", { MX
, EM
}, PREFIX_OPCODE
},
2252 { "packssdw", { MX
, EM
}, PREFIX_OPCODE
},
2253 { "punpcklqdq", { XM
, EXx
}, PREFIX_DATA
},
2254 { "punpckhqdq", { XM
, EXx
}, PREFIX_DATA
},
2255 { "movK", { MX
, Edq
}, PREFIX_OPCODE
},
2256 { PREFIX_TABLE (PREFIX_0F6F
) },
2258 { PREFIX_TABLE (PREFIX_0F70
) },
2259 { REG_TABLE (REG_0F71
) },
2260 { REG_TABLE (REG_0F72
) },
2261 { REG_TABLE (REG_0F73
) },
2262 { "pcmpeqb", { MX
, EM
}, PREFIX_OPCODE
},
2263 { "pcmpeqw", { MX
, EM
}, PREFIX_OPCODE
},
2264 { "pcmpeqd", { MX
, EM
}, PREFIX_OPCODE
},
2265 { "emms", { XX
}, PREFIX_OPCODE
},
2267 { PREFIX_TABLE (PREFIX_0F78
) },
2268 { PREFIX_TABLE (PREFIX_0F79
) },
2271 { PREFIX_TABLE (PREFIX_0F7C
) },
2272 { PREFIX_TABLE (PREFIX_0F7D
) },
2273 { PREFIX_TABLE (PREFIX_0F7E
) },
2274 { PREFIX_TABLE (PREFIX_0F7F
) },
2276 { "joH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2277 { "jnoH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2278 { "jbH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2279 { "jaeH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2280 { "jeH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2281 { "jneH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2282 { "jbeH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2283 { "jaH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2285 { "jsH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2286 { "jnsH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2287 { "jpH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2288 { "jnpH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2289 { "jlH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2290 { "jgeH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2291 { "jleH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2292 { "jgH", { Jv
, BND
, cond_jump_flag
}, PREFIX_REX2_ILLEGAL
},
2294 { "seto", { Eb
}, 0 },
2295 { "setno", { Eb
}, 0 },
2296 { "setb", { Eb
}, 0 },
2297 { "setae", { Eb
}, 0 },
2298 { "sete", { Eb
}, 0 },
2299 { "setne", { Eb
}, 0 },
2300 { "setbe", { Eb
}, 0 },
2301 { "seta", { Eb
}, 0 },
2303 { "sets", { Eb
}, 0 },
2304 { "setns", { Eb
}, 0 },
2305 { "setp", { Eb
}, 0 },
2306 { "setnp", { Eb
}, 0 },
2307 { "setl", { Eb
}, 0 },
2308 { "setge", { Eb
}, 0 },
2309 { "setle", { Eb
}, 0 },
2310 { "setg", { Eb
}, 0 },
2312 { "pushP", { fs
}, 0 },
2313 { "popP", { fs
}, 0 },
2314 { "cpuid", { XX
}, 0 },
2315 { "btS", { Ev
, Gv
}, 0 },
2316 { "shldS", { Ev
, Gv
, Ib
}, 0 },
2317 { "shldS", { Ev
, Gv
, CL
}, 0 },
2318 { REG_TABLE (REG_0FA6
) },
2319 { REG_TABLE (REG_0FA7
) },
2321 { "pushP", { gs
}, 0 },
2322 { "popP", { gs
}, 0 },
2323 { "rsm", { XX
}, 0 },
2324 { "btsS", { Evh1
, Gv
}, 0 },
2325 { "shrdS", { Ev
, Gv
, Ib
}, 0 },
2326 { "shrdS", { Ev
, Gv
, CL
}, 0 },
2327 { REG_TABLE (REG_0FAE
) },
2328 { "imulS", { Gv
, Ev
}, 0 },
2330 { "cmpxchgB", { Ebh1
, Gb
}, 0 },
2331 { "cmpxchgS", { Evh1
, Gv
}, 0 },
2332 { "lssS", { Gv
, Mp
}, 0 },
2333 { "btrS", { Evh1
, Gv
}, 0 },
2334 { "lfsS", { Gv
, Mp
}, 0 },
2335 { "lgsS", { Gv
, Mp
}, 0 },
2336 { "movz{bR|x}", { Gv
, Eb
}, 0 },
2337 { "movz{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movzww ! */
2339 { PREFIX_TABLE (PREFIX_0FB8
) },
2340 { "ud1S", { Gv
, Ev
}, 0 },
2341 { REG_TABLE (REG_0FBA
) },
2342 { "btcS", { Evh1
, Gv
}, 0 },
2343 { PREFIX_TABLE (PREFIX_0FBC
) },
2344 { PREFIX_TABLE (PREFIX_0FBD
) },
2345 { "movs{bR|x}", { Gv
, Eb
}, 0 },
2346 { "movs{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movsww ! */
2348 { "xaddB", { Ebh1
, Gb
}, 0 },
2349 { "xaddS", { Evh1
, Gv
}, 0 },
2350 { PREFIX_TABLE (PREFIX_0FC2
) },
2351 { "movntiS", { Mdq
, Gdq
}, PREFIX_OPCODE
},
2352 { "pinsrw", { MX
, Edw
, Ib
}, PREFIX_OPCODE
},
2353 { "pextrw", { Gd
, Nq
, Ib
}, PREFIX_OPCODE
},
2354 { "shufpX", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
2355 { REG_TABLE (REG_0FC7
) },
2357 { "bswap", { RMeAX
}, 0 },
2358 { "bswap", { RMeCX
}, 0 },
2359 { "bswap", { RMeDX
}, 0 },
2360 { "bswap", { RMeBX
}, 0 },
2361 { "bswap", { RMeSP
}, 0 },
2362 { "bswap", { RMeBP
}, 0 },
2363 { "bswap", { RMeSI
}, 0 },
2364 { "bswap", { RMeDI
}, 0 },
2366 { PREFIX_TABLE (PREFIX_0FD0
) },
2367 { "psrlw", { MX
, EM
}, PREFIX_OPCODE
},
2368 { "psrld", { MX
, EM
}, PREFIX_OPCODE
},
2369 { "psrlq", { MX
, EM
}, PREFIX_OPCODE
},
2370 { "paddq", { MX
, EM
}, PREFIX_OPCODE
},
2371 { "pmullw", { MX
, EM
}, PREFIX_OPCODE
},
2372 { PREFIX_TABLE (PREFIX_0FD6
) },
2373 { "pmovmskb", { Gdq
, Nq
}, PREFIX_OPCODE
},
2375 { "psubusb", { MX
, EM
}, PREFIX_OPCODE
},
2376 { "psubusw", { MX
, EM
}, PREFIX_OPCODE
},
2377 { "pminub", { MX
, EM
}, PREFIX_OPCODE
},
2378 { "pand", { MX
, EM
}, PREFIX_OPCODE
},
2379 { "paddusb", { MX
, EM
}, PREFIX_OPCODE
},
2380 { "paddusw", { MX
, EM
}, PREFIX_OPCODE
},
2381 { "pmaxub", { MX
, EM
}, PREFIX_OPCODE
},
2382 { "pandn", { MX
, EM
}, PREFIX_OPCODE
},
2384 { "pavgb", { MX
, EM
}, PREFIX_OPCODE
},
2385 { "psraw", { MX
, EM
}, PREFIX_OPCODE
},
2386 { "psrad", { MX
, EM
}, PREFIX_OPCODE
},
2387 { "pavgw", { MX
, EM
}, PREFIX_OPCODE
},
2388 { "pmulhuw", { MX
, EM
}, PREFIX_OPCODE
},
2389 { "pmulhw", { MX
, EM
}, PREFIX_OPCODE
},
2390 { PREFIX_TABLE (PREFIX_0FE6
) },
2391 { PREFIX_TABLE (PREFIX_0FE7
) },
2393 { "psubsb", { MX
, EM
}, PREFIX_OPCODE
},
2394 { "psubsw", { MX
, EM
}, PREFIX_OPCODE
},
2395 { "pminsw", { MX
, EM
}, PREFIX_OPCODE
},
2396 { "por", { MX
, EM
}, PREFIX_OPCODE
},
2397 { "paddsb", { MX
, EM
}, PREFIX_OPCODE
},
2398 { "paddsw", { MX
, EM
}, PREFIX_OPCODE
},
2399 { "pmaxsw", { MX
, EM
}, PREFIX_OPCODE
},
2400 { "pxor", { MX
, EM
}, PREFIX_OPCODE
},
2402 { PREFIX_TABLE (PREFIX_0FF0
) },
2403 { "psllw", { MX
, EM
}, PREFIX_OPCODE
},
2404 { "pslld", { MX
, EM
}, PREFIX_OPCODE
},
2405 { "psllq", { MX
, EM
}, PREFIX_OPCODE
},
2406 { "pmuludq", { MX
, EM
}, PREFIX_OPCODE
},
2407 { "pmaddwd", { MX
, EM
}, PREFIX_OPCODE
},
2408 { "psadbw", { MX
, EM
}, PREFIX_OPCODE
},
2409 { PREFIX_TABLE (PREFIX_0FF7
) },
2411 { "psubb", { MX
, EM
}, PREFIX_OPCODE
},
2412 { "psubw", { MX
, EM
}, PREFIX_OPCODE
},
2413 { "psubd", { MX
, EM
}, PREFIX_OPCODE
},
2414 { "psubq", { MX
, EM
}, PREFIX_OPCODE
},
2415 { "paddb", { MX
, EM
}, PREFIX_OPCODE
},
2416 { "paddw", { MX
, EM
}, PREFIX_OPCODE
},
2417 { "paddd", { MX
, EM
}, PREFIX_OPCODE
},
2418 { "ud0S", { Gv
, Ev
}, 0 },
2421 static const bool onebyte_has_modrm
[256] = {
2422 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2423 /* ------------------------------- */
2424 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2425 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2426 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2427 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2428 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2429 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2430 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2431 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2432 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2433 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2434 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2435 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2436 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2437 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2438 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2439 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2440 /* ------------------------------- */
2441 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2444 static const bool twobyte_has_modrm
[256] = {
2445 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2446 /* ------------------------------- */
2447 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2448 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2449 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2450 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2451 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2452 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2453 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2454 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2455 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2456 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2457 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2458 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
2459 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2460 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2461 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2462 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
2463 /* ------------------------------- */
2464 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2474 /* If we are accessing mod/rm/reg without need_modrm set, then the
2475 values are stale. Hitting this abort likely indicates that you
2476 need to update onebyte_has_modrm or twobyte_has_modrm. */
2477 #define MODRM_CHECK if (!ins->need_modrm) abort ()
2479 static const char intel_index16
[][6] = {
2480 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
2483 static const char att_names64
[][8] = {
2484 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
2485 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15",
2486 "%r16", "%r17", "%r18", "%r19", "%r20", "%r21", "%r22", "%r23",
2487 "%r24", "%r25", "%r26", "%r27", "%r28", "%r29", "%r30", "%r31",
2489 static const char att_names32
[][8] = {
2490 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
2491 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d",
2492 "%r16d", "%r17d", "%r18d", "%r19d", "%r20d", "%r21d", "%r22d", "%r23d",
2493 "%r24d", "%r25d", "%r26d", "%r27d", "%r28d", "%r29d", "%r30d", "%r31d",
2495 static const char att_names16
[][8] = {
2496 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
2497 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w",
2498 "%r16w", "%r17w", "%r18w", "%r19w", "%r20w", "%r21w", "%r22w", "%r23w",
2499 "%r24w", "%r25w", "%r26w", "%r27w", "%r28w", "%r29w", "%r30w", "%r31w",
2501 static const char att_names8
[][8] = {
2502 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
2504 static const char att_names8rex
[][8] = {
2505 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
2506 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b",
2507 "%r16b", "%r17b", "%r18b", "%r19b", "%r20b", "%r21b", "%r22b", "%r23b",
2508 "%r24b", "%r25b", "%r26b", "%r27b", "%r28b", "%r29b", "%r30b", "%r31b",
2510 static const char att_names_seg
[][4] = {
2511 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
2513 static const char att_index64
[] = "%riz";
2514 static const char att_index32
[] = "%eiz";
2515 static const char att_index16
[][8] = {
2516 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
2519 static const char att_names_mm
[][8] = {
2520 "%mm0", "%mm1", "%mm2", "%mm3",
2521 "%mm4", "%mm5", "%mm6", "%mm7"
2524 static const char att_names_bnd
[][8] = {
2525 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
2528 static const char att_names_xmm
[][8] = {
2529 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
2530 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
2531 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
2532 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
2533 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
2534 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
2535 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
2536 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
2539 static const char att_names_ymm
[][8] = {
2540 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
2541 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
2542 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
2543 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
2544 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
2545 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
2546 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
2547 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
2550 static const char att_names_zmm
[][8] = {
2551 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
2552 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
2553 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
2554 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
2555 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
2556 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
2557 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
2558 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
2561 static const char att_names_tmm
[][8] = {
2562 "%tmm0", "%tmm1", "%tmm2", "%tmm3",
2563 "%tmm4", "%tmm5", "%tmm6", "%tmm7"
2566 static const char att_names_mask
[][8] = {
2567 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
2570 static const char *const names_rounding
[] =
2578 static const struct dis386 reg_table
[][8] = {
2581 { "addA", { Ebh1
, Ib
}, 0 },
2582 { "orA", { Ebh1
, Ib
}, 0 },
2583 { "adcA", { Ebh1
, Ib
}, 0 },
2584 { "sbbA", { Ebh1
, Ib
}, 0 },
2585 { "andA", { Ebh1
, Ib
}, 0 },
2586 { "subA", { Ebh1
, Ib
}, 0 },
2587 { "xorA", { Ebh1
, Ib
}, 0 },
2588 { "cmpA", { Eb
, Ib
}, 0 },
2592 { "addQ", { Evh1
, Iv
}, 0 },
2593 { "orQ", { Evh1
, Iv
}, 0 },
2594 { "adcQ", { Evh1
, Iv
}, 0 },
2595 { "sbbQ", { Evh1
, Iv
}, 0 },
2596 { "andQ", { Evh1
, Iv
}, 0 },
2597 { "subQ", { Evh1
, Iv
}, 0 },
2598 { "xorQ", { Evh1
, Iv
}, 0 },
2599 { "cmpQ", { Ev
, Iv
}, 0 },
2603 { "addQ", { Evh1
, sIb
}, 0 },
2604 { "orQ", { Evh1
, sIb
}, 0 },
2605 { "adcQ", { Evh1
, sIb
}, 0 },
2606 { "sbbQ", { Evh1
, sIb
}, 0 },
2607 { "andQ", { Evh1
, sIb
}, 0 },
2608 { "subQ", { Evh1
, sIb
}, 0 },
2609 { "xorQ", { Evh1
, sIb
}, 0 },
2610 { "cmpQ", { Ev
, sIb
}, 0 },
2614 { "pop{P|}", { stackEv
}, 0 },
2615 { XOP_8F_TABLE () },
2619 { XOP_8F_TABLE () },
2623 { "rolA", { VexGb
, Eb
, Ib
}, NO_PREFIX
},
2624 { "rorA", { VexGb
, Eb
, Ib
}, NO_PREFIX
},
2625 { "rclA", { VexGb
, Eb
, Ib
}, NO_PREFIX
},
2626 { "rcrA", { VexGb
, Eb
, Ib
}, NO_PREFIX
},
2627 { "shlA", { VexGb
, Eb
, Ib
}, NO_PREFIX
},
2628 { "shrA", { VexGb
, Eb
, Ib
}, NO_PREFIX
},
2629 { "shlA", { VexGb
, Eb
, Ib
}, NO_PREFIX
},
2630 { "sarA", { VexGb
, Eb
, Ib
}, NO_PREFIX
},
2634 { "rolQ", { VexGv
, Ev
, Ib
}, PREFIX_NP_OR_DATA
},
2635 { "rorQ", { VexGv
, Ev
, Ib
}, PREFIX_NP_OR_DATA
},
2636 { "rclQ", { VexGv
, Ev
, Ib
}, PREFIX_NP_OR_DATA
},
2637 { "rcrQ", { VexGv
, Ev
, Ib
}, PREFIX_NP_OR_DATA
},
2638 { "shlQ", { VexGv
, Ev
, Ib
}, PREFIX_NP_OR_DATA
},
2639 { "shrQ", { VexGv
, Ev
, Ib
}, PREFIX_NP_OR_DATA
},
2640 { "shlQ", { VexGv
, Ev
, Ib
}, PREFIX_NP_OR_DATA
},
2641 { "sarQ", { VexGv
, Ev
, Ib
}, PREFIX_NP_OR_DATA
},
2645 { "movA", { Ebh3
, Ib
}, 0 },
2652 { RM_TABLE (RM_C6_REG_7
) },
2656 { "movQ", { Evh3
, Iv
}, 0 },
2663 { RM_TABLE (RM_C7_REG_7
) },
2667 { "rolA", { VexGb
, Eb
, I1
}, NO_PREFIX
},
2668 { "rorA", { VexGb
, Eb
, I1
}, NO_PREFIX
},
2669 { "rclA", { VexGb
, Eb
, I1
}, NO_PREFIX
},
2670 { "rcrA", { VexGb
, Eb
, I1
}, NO_PREFIX
},
2671 { "shlA", { VexGb
, Eb
, I1
}, NO_PREFIX
},
2672 { "shrA", { VexGb
, Eb
, I1
}, NO_PREFIX
},
2673 { "shlA", { VexGb
, Eb
, I1
}, NO_PREFIX
},
2674 { "sarA", { VexGb
, Eb
, I1
}, NO_PREFIX
},
2678 { "rolQ", { VexGv
, Ev
, I1
}, PREFIX_NP_OR_DATA
},
2679 { "rorQ", { VexGv
, Ev
, I1
}, PREFIX_NP_OR_DATA
},
2680 { "rclQ", { VexGv
, Ev
, I1
}, PREFIX_NP_OR_DATA
},
2681 { "rcrQ", { VexGv
, Ev
, I1
}, PREFIX_NP_OR_DATA
},
2682 { "shlQ", { VexGv
, Ev
, I1
}, PREFIX_NP_OR_DATA
},
2683 { "shrQ", { VexGv
, Ev
, I1
}, PREFIX_NP_OR_DATA
},
2684 { "shlQ", { VexGv
, Ev
, I1
}, PREFIX_NP_OR_DATA
},
2685 { "sarQ", { VexGv
, Ev
, I1
}, PREFIX_NP_OR_DATA
},
2689 { "rolA", { VexGb
, Eb
, CL
}, NO_PREFIX
},
2690 { "rorA", { VexGb
, Eb
, CL
}, NO_PREFIX
},
2691 { "rclA", { VexGb
, Eb
, CL
}, NO_PREFIX
},
2692 { "rcrA", { VexGb
, Eb
, CL
}, NO_PREFIX
},
2693 { "shlA", { VexGb
, Eb
, CL
}, NO_PREFIX
},
2694 { "shrA", { VexGb
, Eb
, CL
}, NO_PREFIX
},
2695 { "shlA", { VexGb
, Eb
, CL
}, NO_PREFIX
},
2696 { "sarA", { VexGb
, Eb
, CL
}, NO_PREFIX
},
2700 { "rolQ", { VexGv
, Ev
, CL
}, PREFIX_NP_OR_DATA
},
2701 { "rorQ", { VexGv
, Ev
, CL
}, PREFIX_NP_OR_DATA
},
2702 { "rclQ", { VexGv
, Ev
, CL
}, PREFIX_NP_OR_DATA
},
2703 { "rcrQ", { VexGv
, Ev
, CL
}, PREFIX_NP_OR_DATA
},
2704 { "shlQ", { VexGv
, Ev
, CL
}, PREFIX_NP_OR_DATA
},
2705 { "shrQ", { VexGv
, Ev
, CL
}, PREFIX_NP_OR_DATA
},
2706 { "shlQ", { VexGv
, Ev
, CL
}, PREFIX_NP_OR_DATA
},
2707 { "sarQ", { VexGv
, Ev
, CL
}, PREFIX_NP_OR_DATA
},
2711 { "testA", { Eb
, Ib
}, 0 },
2712 { "testA", { Eb
, Ib
}, 0 },
2713 { "notA", { Ebh1
}, 0 },
2714 { "negA", { Ebh1
}, 0 },
2715 { "mulA", { Eb
}, 0 }, /* Don't print the implicit %al register, */
2716 { "imulA", { Eb
}, 0 }, /* to distinguish these opcodes from other */
2717 { "divA", { Eb
}, 0 }, /* mul/imul opcodes. Do the same for div */
2718 { "idivA", { Eb
}, 0 }, /* and idiv for consistency. */
2722 { "testQ", { Ev
, Iv
}, 0 },
2723 { "testQ", { Ev
, Iv
}, 0 },
2724 { "notQ", { Evh1
}, 0 },
2725 { "negQ", { Evh1
}, 0 },
2726 { "mulQ", { Ev
}, 0 }, /* Don't print the implicit register. */
2727 { "imulQ", { Ev
}, 0 },
2728 { "divQ", { Ev
}, 0 },
2729 { "idivQ", { Ev
}, 0 },
2733 { "incA", { Ebh1
}, 0 },
2734 { "decA", { Ebh1
}, 0 },
2738 { "incQ", { Evh1
}, 0 },
2739 { "decQ", { Evh1
}, 0 },
2740 { "call{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2741 { "{l|}call^", { indirEp
}, 0 },
2742 { "jmp{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2743 { "{l|}jmp^", { indirEp
}, 0 },
2744 { "push{P|}", { stackEv
}, 0 },
2749 { "sldtD", { Sv
}, 0 },
2750 { "strD", { Sv
}, 0 },
2751 { "lldtD", { Sv
}, 0 },
2752 { "ltrD", { Sv
}, 0 },
2753 { "verrD", { Sv
}, 0 },
2754 { "verwD", { Sv
}, 0 },
2755 { X86_64_TABLE (X86_64_0F00_REG_6
) },
2760 { MOD_TABLE (MOD_0F01_REG_0
) },
2761 { MOD_TABLE (MOD_0F01_REG_1
) },
2762 { MOD_TABLE (MOD_0F01_REG_2
) },
2763 { MOD_TABLE (MOD_0F01_REG_3
) },
2764 { "smswD", { Sv
}, 0 },
2765 { MOD_TABLE (MOD_0F01_REG_5
) },
2766 { "lmsw", { Ew
}, 0 },
2767 { MOD_TABLE (MOD_0F01_REG_7
) },
2771 { "prefetch", { Mb
}, 0 },
2772 { "prefetchw", { Mb
}, 0 },
2773 { "prefetchwt1", { Mb
}, 0 },
2774 { "prefetch", { Mb
}, 0 },
2775 { "prefetch", { Mb
}, 0 },
2776 { "prefetch", { Mb
}, 0 },
2777 { "prefetch", { Mb
}, 0 },
2778 { "prefetch", { Mb
}, 0 },
2782 { MOD_TABLE (MOD_0F18_REG_0
) },
2783 { MOD_TABLE (MOD_0F18_REG_1
) },
2784 { MOD_TABLE (MOD_0F18_REG_2
) },
2785 { MOD_TABLE (MOD_0F18_REG_3
) },
2786 { "nopQ", { Ev
}, 0 },
2787 { "nopQ", { Ev
}, 0 },
2788 { MOD_TABLE (MOD_0F18_REG_6
) },
2789 { MOD_TABLE (MOD_0F18_REG_7
) },
2791 /* REG_0F1C_P_0_MOD_0 */
2793 { "cldemote", { Mb
}, 0 },
2794 { "nopQ", { Ev
}, 0 },
2795 { "nopQ", { Ev
}, 0 },
2796 { "nopQ", { Ev
}, 0 },
2797 { "nopQ", { Ev
}, 0 },
2798 { "nopQ", { Ev
}, 0 },
2799 { "nopQ", { Ev
}, 0 },
2800 { "nopQ", { Ev
}, 0 },
2802 /* REG_0F1E_P_1_MOD_3 */
2804 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2805 { "rdsspK", { Edq
}, 0 },
2806 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2807 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2808 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2809 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2810 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2811 { RM_TABLE (RM_0F1E_P_1_MOD_3_REG_7
) },
2813 /* REG_0F38D8_PREFIX_1 */
2815 { "aesencwide128kl", { M
}, 0 },
2816 { "aesdecwide128kl", { M
}, 0 },
2817 { "aesencwide256kl", { M
}, 0 },
2818 { "aesdecwide256kl", { M
}, 0 },
2820 /* REG_0F3A0F_P_1 */
2822 { RM_TABLE (RM_0F3A0F_P_1_R_0
) },
2828 { "psrlw", { Nq
, Ib
}, PREFIX_OPCODE
},
2830 { "psraw", { Nq
, Ib
}, PREFIX_OPCODE
},
2832 { "psllw", { Nq
, Ib
}, PREFIX_OPCODE
},
2838 { "psrld", { Nq
, Ib
}, PREFIX_OPCODE
},
2840 { "psrad", { Nq
, Ib
}, PREFIX_OPCODE
},
2842 { "pslld", { Nq
, Ib
}, PREFIX_OPCODE
},
2848 { "psrlq", { Nq
, Ib
}, PREFIX_OPCODE
},
2849 { "psrldq", { Ux
, Ib
}, PREFIX_DATA
},
2852 { "psllq", { Nq
, Ib
}, PREFIX_OPCODE
},
2853 { "pslldq", { Ux
, Ib
}, PREFIX_DATA
},
2857 { "montmul", { { OP_0f07
, 0 } }, 0 },
2858 { "xsha1", { { OP_0f07
, 0 } }, 0 },
2859 { "xsha256", { { OP_0f07
, 0 } }, 0 },
2863 { "xstore-rng", { { OP_0f07
, 0 } }, 0 },
2864 { "xcrypt-ecb", { { OP_0f07
, 0 } }, 0 },
2865 { "xcrypt-cbc", { { OP_0f07
, 0 } }, 0 },
2866 { "xcrypt-ctr", { { OP_0f07
, 0 } }, 0 },
2867 { "xcrypt-cfb", { { OP_0f07
, 0 } }, 0 },
2868 { "xcrypt-ofb", { { OP_0f07
, 0 } }, 0 },
2872 { MOD_TABLE (MOD_0FAE_REG_0
) },
2873 { MOD_TABLE (MOD_0FAE_REG_1
) },
2874 { MOD_TABLE (MOD_0FAE_REG_2
) },
2875 { MOD_TABLE (MOD_0FAE_REG_3
) },
2876 { MOD_TABLE (MOD_0FAE_REG_4
) },
2877 { MOD_TABLE (MOD_0FAE_REG_5
) },
2878 { MOD_TABLE (MOD_0FAE_REG_6
) },
2879 { MOD_TABLE (MOD_0FAE_REG_7
) },
2887 { "btQ", { Ev
, Ib
}, 0 },
2888 { "btsQ", { Evh1
, Ib
}, 0 },
2889 { "btrQ", { Evh1
, Ib
}, 0 },
2890 { "btcQ", { Evh1
, Ib
}, 0 },
2895 { "cmpxchg8b", { { CMPXCHG8B_Fixup
, q_mode
} }, 0 },
2897 { "xrstors", { FXSAVE
}, PREFIX_REX2_ILLEGAL
},
2898 { "xsavec", { FXSAVE
}, PREFIX_REX2_ILLEGAL
},
2899 { "xsaves", { FXSAVE
}, PREFIX_REX2_ILLEGAL
},
2900 { MOD_TABLE (MOD_0FC7_REG_6
) },
2901 { MOD_TABLE (MOD_0FC7_REG_7
) },
2907 { "vpsrlw", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2909 { "vpsraw", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2911 { "vpsllw", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2917 { "vpsrld", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2919 { "vpsrad", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2921 { "vpslld", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2927 { "vpsrlq", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2928 { "vpsrldq", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2931 { "vpsllq", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2932 { "vpslldq", { Vex
, Ux
, Ib
}, PREFIX_DATA
},
2938 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2
) },
2939 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3
) },
2941 /* REG_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0 */
2943 { RM_TABLE (RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0_R_0
) },
2945 /* REG_VEX_0F38F3_L_0_P_0 */
2948 { "blsrS", { VexGdq
, Edq
}, 0 },
2949 { "blsmskS", { VexGdq
, Edq
}, 0 },
2950 { "blsiS", { VexGdq
, Edq
}, 0 },
2952 /* REG_VEX_MAP7_F8_L_0_W_0 */
2954 { X86_64_TABLE (X86_64_VEX_MAP7_F8_L_0_W_0_R_0
) },
2956 /* REG_XOP_09_01_L_0 */
2959 { "blcfill", { VexGdq
, Edq
}, 0 },
2960 { "blsfill", { VexGdq
, Edq
}, 0 },
2961 { "blcs", { VexGdq
, Edq
}, 0 },
2962 { "tzmsk", { VexGdq
, Edq
}, 0 },
2963 { "blcic", { VexGdq
, Edq
}, 0 },
2964 { "blsic", { VexGdq
, Edq
}, 0 },
2965 { "t1mskc", { VexGdq
, Edq
}, 0 },
2967 /* REG_XOP_09_02_L_0 */
2970 { "blcmsk", { VexGdq
, Edq
}, 0 },
2975 { "blci", { VexGdq
, Edq
}, 0 },
2977 /* REG_XOP_09_12_L_0 */
2979 { "llwpcb", { Rdq
}, 0 },
2980 { "slwpcb", { Rdq
}, 0 },
2982 /* REG_XOP_0A_12_L_0 */
2984 { "lwpins", { VexGdq
, Ed
, Id
}, 0 },
2985 { "lwpval", { VexGdq
, Ed
, Id
}, 0 },
2988 #include "i386-dis-evex-reg.h"
2991 static const struct dis386 prefix_table
[][4] = {
2994 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2995 { "pause", { XX
}, 0 },
2996 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2997 { NULL
, { { NULL
, 0 } }, PREFIX_IGNORED
}
3000 /* PREFIX_0F00_REG_6_X86_64 */
3005 { "lkgsD", { Sv
}, 0 },
3008 /* PREFIX_0F01_REG_0_MOD_3_RM_6 */
3010 { "wrmsrns", { Skip_MODRM
}, 0 },
3011 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_1
) },
3013 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_6_P_3
) },
3016 /* PREFIX_0F01_REG_0_MOD_3_RM_7 */
3018 { X86_64_TABLE (X86_64_0F01_REG_0_MOD_3_RM_7_P_0
) },
3021 /* PREFIX_0F01_REG_1_RM_2 */
3023 { "clac", { Skip_MODRM
}, 0 },
3024 { X86_64_TABLE (X86_64_0F01_REG_1_RM_2_PREFIX_1
) },
3026 { X86_64_TABLE (X86_64_0F01_REG_1_RM_2_PREFIX_3
)},
3029 /* PREFIX_0F01_REG_1_RM_4 */
3033 { "tdcall", { Skip_MODRM
}, 0 },
3037 /* PREFIX_0F01_REG_1_RM_5 */
3041 { X86_64_TABLE (X86_64_0F01_REG_1_RM_5_PREFIX_2
) },
3045 /* PREFIX_0F01_REG_1_RM_6 */
3049 { X86_64_TABLE (X86_64_0F01_REG_1_RM_6_PREFIX_2
) },
3053 /* PREFIX_0F01_REG_1_RM_7 */
3055 { "encls", { Skip_MODRM
}, 0 },
3057 { X86_64_TABLE (X86_64_0F01_REG_1_RM_7_PREFIX_2
) },
3061 /* PREFIX_0F01_REG_3_RM_1 */
3063 { "vmmcall", { Skip_MODRM
}, 0 },
3064 { "vmgexit", { Skip_MODRM
}, 0 },
3066 { "vmgexit", { Skip_MODRM
}, 0 },
3069 /* PREFIX_0F01_REG_5_MOD_0 */
3072 { "rstorssp", { Mq
}, PREFIX_OPCODE
},
3075 /* PREFIX_0F01_REG_5_MOD_3_RM_0 */
3077 { "serialize", { Skip_MODRM
}, PREFIX_OPCODE
},
3078 { "setssbsy", { Skip_MODRM
}, PREFIX_OPCODE
},
3080 { "xsusldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3083 /* PREFIX_0F01_REG_5_MOD_3_RM_1 */
3088 { "xresldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
3091 /* PREFIX_0F01_REG_5_MOD_3_RM_2 */
3094 { "saveprevssp", { Skip_MODRM
}, PREFIX_OPCODE
},
3097 /* PREFIX_0F01_REG_5_MOD_3_RM_4 */
3100 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
) },
3103 /* PREFIX_0F01_REG_5_MOD_3_RM_5 */
3106 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
) },
3109 /* PREFIX_0F01_REG_5_MOD_3_RM_6 */
3111 { "rdpkru", { Skip_MODRM
}, 0 },
3112 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
) },
3115 /* PREFIX_0F01_REG_5_MOD_3_RM_7 */
3117 { "wrpkru", { Skip_MODRM
}, 0 },
3118 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
) },
3121 /* PREFIX_0F01_REG_7_MOD_3_RM_2 */
3123 { "monitorx", { { OP_Monitor
, 0 } }, 0 },
3124 { "mcommit", { Skip_MODRM
}, 0 },
3127 /* PREFIX_0F01_REG_7_MOD_3_RM_5 */
3129 { "rdpru", { Skip_MODRM
}, 0 },
3130 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1
) },
3133 /* PREFIX_0F01_REG_7_MOD_3_RM_6 */
3135 { "invlpgb", { Skip_MODRM
}, 0 },
3136 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
) },
3138 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
) },
3141 /* PREFIX_0F01_REG_7_MOD_3_RM_7 */
3143 { "tlbsync", { Skip_MODRM
}, 0 },
3144 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
) },
3146 { "pvalidate", { Skip_MODRM
}, 0 },
3151 { "wbinvd", { XX
}, 0 },
3152 { "wbnoinvd", { XX
}, 0 },
3157 { "%XEVmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3158 { "%XEVmovs%XS", { XMScalar
, VexScalarR
, EXd
}, 0 },
3159 { "%XEVmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3160 { "%XEVmovs%XD", { XMScalar
, VexScalarR
, EXq
}, 0 },
3165 { "%XEVmovupX", { EXxS
, XM
}, 0 },
3166 { "%XEVmovs%XS", { EXdS
, VexScalarR
, XMScalar
}, 0 },
3167 { "%XEVmovupX", { EXxS
, XM
}, 0 },
3168 { "%XEVmovs%XD", { EXqS
, VexScalarR
, XMScalar
}, 0 },
3173 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
3174 { "movsldup", { XM
, EXx
}, 0 },
3175 { "%XEVmovlpYX", { XM
, Vex
, Mq
}, 0 },
3176 { "movddup", { XM
, EXq
}, 0 },
3181 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
3182 { "movshdup", { XM
, EXx
}, 0 },
3183 { "%XEVmovhpYX", { XM
, Vex
, Mq
}, 0 },
3186 /* PREFIX_0F18_REG_6_MOD_0_X86_64 */
3188 { "prefetchit1", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3189 { "nopQ", { Ev
}, 0 },
3190 { "nopQ", { Ev
}, 0 },
3191 { "nopQ", { Ev
}, 0 },
3194 /* PREFIX_0F18_REG_7_MOD_0_X86_64 */
3196 { "prefetchit0", { { PREFETCHI_Fixup
, b_mode
} }, 0 },
3197 { "nopQ", { Ev
}, 0 },
3198 { "nopQ", { Ev
}, 0 },
3199 { "nopQ", { Ev
}, 0 },
3204 { MOD_TABLE (MOD_0F1A_PREFIX_0
) },
3205 { "bndcl", { Gbnd
, Ev_bnd
}, 0 },
3206 { "bndmov", { Gbnd
, Ebnd
}, 0 },
3207 { "bndcu", { Gbnd
, Ev_bnd
}, 0 },
3212 { MOD_TABLE (MOD_0F1B_PREFIX_0
) },
3213 { MOD_TABLE (MOD_0F1B_PREFIX_1
) },
3214 { "bndmov", { EbndS
, Gbnd
}, 0 },
3215 { "bndcn", { Gbnd
, Ev_bnd
}, 0 },
3220 { MOD_TABLE (MOD_0F1C_PREFIX_0
) },
3221 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3222 { "nopQ", { Ev
}, 0 },
3223 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3228 { "nopQ", { Ev
}, 0 },
3229 { MOD_TABLE (MOD_0F1E_PREFIX_1
) },
3230 { "nopQ", { Ev
}, 0 },
3231 { NULL
, { XX
}, PREFIX_IGNORED
},
3236 { "cvtpi2ps", { XM
, EMCq
}, PREFIX_OPCODE
},
3237 { "cvtsi2ss{%LQ|}", { XM
, Edq
}, PREFIX_OPCODE
},
3238 { "cvtpi2pd", { XM
, EMCq
}, PREFIX_OPCODE
},
3239 { "cvtsi2sd{%LQ|}", { XM
, Edq
}, 0 },
3244 { "movntps", { Mx
, XM
}, 0 },
3245 { "movntss", { Md
, XM
}, 0 },
3246 { "movntpd", { Mx
, XM
}, 0 },
3247 { "movntsd", { Mq
, XM
}, 0 },
3252 { "cvttps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3253 { "cvttss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3254 { "cvttpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3255 { "cvttsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3260 { "cvtps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3261 { "cvtss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3262 { "cvtpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3263 { "cvtsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3268 { "%XEVucomisYX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3270 { "%XEVucomisYX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3275 { "%XEVcomisYX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3277 { "%XEVcomisYX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3282 { "%XEVsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3283 { "%XEVsqrts%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3284 { "%XEVsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3285 { "%XEVsqrts%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3290 { "Vrsqrtps", { XM
, EXx
}, 0 },
3291 { "Vrsqrtss", { XMScalar
, VexScalar
, EXd
}, 0 },
3296 { "Vrcpps", { XM
, EXx
}, 0 },
3297 { "Vrcpss", { XMScalar
, VexScalar
, EXd
}, 0 },
3302 { "%XEVaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3303 { "%XEVadds%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3304 { "%XEVaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3305 { "%XEVadds%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3310 { "%XEVmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3311 { "%XEVmuls%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3312 { "%XEVmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3313 { "%XEVmuls%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3318 { "%XEVcvtp%XS2pd", { XM
, EXEvexHalfBcstXmmq
, EXxEVexS
}, 0 },
3319 { "%XEVcvts%XS2sd", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3320 { "%XEVcvtp%XD2ps%XY", { XMxmmq
, EXx
, EXxEVexR
}, 0 },
3321 { "%XEVcvts%XD2ss", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3326 { "Vcvtdq2ps", { XM
, EXx
}, 0 },
3327 { "Vcvttps2dq", { XM
, EXx
}, 0 },
3328 { "Vcvtps2dq", { XM
, EXx
}, 0 },
3333 { "%XEVsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3334 { "%XEVsubs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3335 { "%XEVsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3336 { "%XEVsubs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3341 { "%XEVminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3342 { "%XEVmins%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3343 { "%XEVminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3344 { "%XEVmins%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3349 { "%XEVdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3350 { "%XEVdivs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3351 { "%XEVdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3352 { "%XEVdivs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3357 { "%XEVmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3358 { "%XEVmaxs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3359 { "%XEVmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3360 { "%XEVmaxs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3365 { "punpcklbw",{ MX
, EMd
}, PREFIX_OPCODE
},
3367 { "punpcklbw",{ MX
, EMx
}, PREFIX_OPCODE
},
3372 { "punpcklwd",{ MX
, EMd
}, PREFIX_OPCODE
},
3374 { "punpcklwd",{ MX
, EMx
}, PREFIX_OPCODE
},
3379 { "punpckldq",{ MX
, EMd
}, PREFIX_OPCODE
},
3381 { "punpckldq",{ MX
, EMx
}, PREFIX_OPCODE
},
3386 { "movq", { MX
, EM
}, PREFIX_OPCODE
},
3387 { "movdqu", { XM
, EXx
}, PREFIX_OPCODE
},
3388 { "movdqa", { XM
, EXx
}, PREFIX_OPCODE
},
3393 { "pshufw", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
3394 { "pshufhw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3395 { "pshufd", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3396 { "pshuflw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3401 {"vmread", { Em
, Gm
}, 0 },
3403 {"extrq", { Uxmm
, Ib
, Ib
}, 0 },
3404 {"insertq", { XM
, Uxmm
, Ib
, Ib
}, 0 },
3409 {"vmwrite", { Gm
, Em
}, 0 },
3411 {"extrq", { XM
, Uxmm
}, 0 },
3412 {"insertq", { XM
, Uxmm
}, 0 },
3419 { "Vhaddpd", { XM
, Vex
, EXx
}, 0 },
3420 { "Vhaddps", { XM
, Vex
, EXx
}, 0 },
3427 { "Vhsubpd", { XM
, Vex
, EXx
}, 0 },
3428 { "Vhsubps", { XM
, Vex
, EXx
}, 0 },
3433 { "movK", { Edq
, MX
}, PREFIX_OPCODE
},
3434 { "movq", { XM
, EXq
}, PREFIX_OPCODE
},
3435 { "movK", { Edq
, XM
}, PREFIX_OPCODE
},
3440 { "movq", { EMS
, MX
}, PREFIX_OPCODE
},
3441 { "movdqu", { EXxS
, XM
}, PREFIX_OPCODE
},
3442 { "movdqa", { EXxS
, XM
}, PREFIX_OPCODE
},
3445 /* PREFIX_0FAE_REG_0_MOD_3 */
3448 { "rdfsbase", { Ev
}, 0 },
3451 /* PREFIX_0FAE_REG_1_MOD_3 */
3454 { "rdgsbase", { Ev
}, 0 },
3457 /* PREFIX_0FAE_REG_2_MOD_3 */
3460 { "wrfsbase", { Ev
}, 0 },
3463 /* PREFIX_0FAE_REG_3_MOD_3 */
3466 { "wrgsbase", { Ev
}, 0 },
3469 /* PREFIX_0FAE_REG_4_MOD_0 */
3471 { "xsave", { FXSAVE
}, PREFIX_REX2_ILLEGAL
},
3472 { "ptwrite{%LQ|}", { Edq
}, 0 },
3475 /* PREFIX_0FAE_REG_4_MOD_3 */
3478 { "ptwrite{%LQ|}", { Edq
}, 0 },
3481 /* PREFIX_0FAE_REG_5_MOD_3 */
3483 { "lfence", { Skip_MODRM
}, 0 },
3484 { "incsspK", { Edq
}, PREFIX_OPCODE
},
3487 /* PREFIX_0FAE_REG_6_MOD_0 */
3489 { "xsaveopt", { FXSAVE
}, PREFIX_OPCODE
| PREFIX_REX2_ILLEGAL
},
3490 { "clrssbsy", { Mq
}, PREFIX_OPCODE
},
3491 { "clwb", { Mb
}, PREFIX_OPCODE
},
3494 /* PREFIX_0FAE_REG_6_MOD_3 */
3496 { RM_TABLE (RM_0FAE_REG_6_MOD_3_P_0
) },
3497 { "umonitor", { Eva
}, PREFIX_OPCODE
},
3498 { "tpause", { Edq
}, PREFIX_OPCODE
},
3499 { "umwait", { Edq
}, PREFIX_OPCODE
},
3502 /* PREFIX_0FAE_REG_7_MOD_0 */
3504 { "clflush", { Mb
}, 0 },
3506 { "clflushopt", { Mb
}, 0 },
3512 { "popcntS", { Gv
, Ev
}, 0 },
3517 { "bsfS", { Gv
, Ev
}, 0 },
3518 { "tzcntS", { Gv
, Ev
}, 0 },
3519 { "bsfS", { Gv
, Ev
}, 0 },
3524 { "bsrS", { Gv
, Ev
}, 0 },
3525 { "lzcntS", { Gv
, Ev
}, 0 },
3526 { "bsrS", { Gv
, Ev
}, 0 },
3531 { "VcmppX", { XM
, Vex
, EXx
, CMP
}, 0 },
3532 { "Vcmpss", { XMScalar
, VexScalar
, EXd
, CMP
}, 0 },
3533 { "VcmppX", { XM
, Vex
, EXx
, CMP
}, 0 },
3534 { "Vcmpsd", { XMScalar
, VexScalar
, EXq
, CMP
}, 0 },
3537 /* PREFIX_0FC7_REG_6_MOD_0 */
3539 { "vmptrld",{ Mq
}, 0 },
3540 { "vmxon", { Mq
}, 0 },
3541 { "vmclear",{ Mq
}, 0 },
3544 /* PREFIX_0FC7_REG_6_MOD_3 */
3546 { "rdrand", { Ev
}, 0 },
3547 { X86_64_TABLE (X86_64_0FC7_REG_6_MOD_3_PREFIX_1
) },
3548 { "rdrand", { Ev
}, 0 }
3551 /* PREFIX_0FC7_REG_7_MOD_3 */
3553 { "rdseed", { Ev
}, 0 },
3554 { "rdpid", { Em
}, 0 },
3555 { "rdseed", { Ev
}, 0 },
3562 { "VaddsubpX", { XM
, Vex
, EXx
}, 0 },
3563 { "VaddsubpX", { XM
, Vex
, EXx
}, 0 },
3569 { "movq2dq",{ XM
, Nq
}, 0 },
3570 { "movq", { EXqS
, XM
}, 0 },
3571 { "movdq2q",{ MX
, Ux
}, 0 },
3577 { "Vcvtdq2pd", { XM
, EXxmmq
}, 0 },
3578 { "Vcvttpd2dq%XY", { XMM
, EXx
}, 0 },
3579 { "Vcvtpd2dq%XY", { XMM
, EXx
}, 0 },
3584 { "movntq", { Mq
, MX
}, 0 },
3586 { "movntdq", { Mx
, XM
}, 0 },
3594 { "Vlddqu", { XM
, M
}, 0 },
3599 { "maskmovq", { MX
, Nq
}, PREFIX_OPCODE
},
3601 { "maskmovdqu", { XM
, Ux
}, PREFIX_OPCODE
},
3607 { REG_TABLE (REG_0F38D8_PREFIX_1
) },
3613 { MOD_TABLE (MOD_0F38DC_PREFIX_1
) },
3614 { "aesenc", { XM
, EXx
}, 0 },
3620 { "aesdec128kl", { XM
, M
}, 0 },
3621 { "aesenclast", { XM
, EXx
}, 0 },
3627 { "aesenc256kl", { XM
, M
}, 0 },
3628 { "aesdec", { XM
, EXx
}, 0 },
3634 { "aesdec256kl", { XM
, M
}, 0 },
3635 { "aesdeclast", { XM
, EXx
}, 0 },
3640 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3642 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3643 { "crc32A", { Gdq
, Eb
}, PREFIX_OPCODE
},
3648 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3650 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3651 { "crc32Q", { Gdq
, Ev
}, PREFIX_OPCODE
},
3656 { "wrssK", { M
, Gdq
}, 0 },
3657 { "adoxL", { VexGdq
, Gdq
, Edq
}, 0 },
3658 { "adcxL", { VexGdq
, Gdq
, Edq
}, 0 },
3662 /* PREFIX_0F38F8_M_0 */
3665 { "enqcmds", { Gva
, M
}, 0 },
3666 { "movdir64b", { Gva
, M
}, 0 },
3667 { "enqcmd", { Gva
, M
}, 0 },
3670 /* PREFIX_0F38F8_M_1_X86_64 */
3673 { "uwrmsr", { Gq
, Rq
}, 0 },
3675 { "urdmsr", { Rq
, Gq
}, 0 },
3681 { "encodekey128", { Gd
, Rd
}, 0 },
3687 { "encodekey256", { Gd
, Rd
}, 0 },
3692 { "aadd", { Mdq
, Gdq
}, 0 },
3693 { "axor", { Mdq
, Gdq
}, 0 },
3694 { "aand", { Mdq
, Gdq
}, 0 },
3695 { "aor", { Mdq
, Gdq
}, 0 },
3701 { REG_TABLE (REG_0F3A0F_P_1
) },
3704 /* PREFIX_VEX_0F12 */
3706 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0
) },
3707 { "%XEvmov%XSldup", { XM
, EXEvexXNoBcst
}, 0 },
3708 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2
) },
3709 { "%XEvmov%XDdup", { XM
, EXymmq
}, 0 },
3712 /* PREFIX_VEX_0F16 */
3714 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0
) },
3715 { "%XEvmov%XShdup", { XM
, EXEvexXNoBcst
}, 0 },
3716 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2
) },
3719 /* PREFIX_VEX_0F2A */
3722 { "%XEvcvtsi2ssY{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR
, Edq
}, 0 },
3724 { "%XEvcvtsi2sdY{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR64
, Edq
}, 0 },
3727 /* PREFIX_VEX_0F2C */
3730 { "%XEvcvttss2si", { Gdq
, EXd
, EXxEVexS
}, 0 },
3732 { "%XEvcvttsd2si", { Gdq
, EXq
, EXxEVexS
}, 0 },
3735 /* PREFIX_VEX_0F2D */
3738 { "%XEvcvtss2si", { Gdq
, EXd
, EXxEVexR
}, 0 },
3740 { "%XEvcvtsd2si", { Gdq
, EXq
, EXxEVexR
}, 0 },
3743 /* PREFIX_VEX_0F41_L_1_W_0 */
3745 { "kandw", { MaskG
, MaskVex
, MaskR
}, 0 },
3747 { "kandb", { MaskG
, MaskVex
, MaskR
}, 0 },
3750 /* PREFIX_VEX_0F41_L_1_W_1 */
3752 { "kandq", { MaskG
, MaskVex
, MaskR
}, 0 },
3754 { "kandd", { MaskG
, MaskVex
, MaskR
}, 0 },
3757 /* PREFIX_VEX_0F42_L_1_W_0 */
3759 { "kandnw", { MaskG
, MaskVex
, MaskR
}, 0 },
3761 { "kandnb", { MaskG
, MaskVex
, MaskR
}, 0 },
3764 /* PREFIX_VEX_0F42_L_1_W_1 */
3766 { "kandnq", { MaskG
, MaskVex
, MaskR
}, 0 },
3768 { "kandnd", { MaskG
, MaskVex
, MaskR
}, 0 },
3771 /* PREFIX_VEX_0F44_L_0_W_0 */
3773 { "knotw", { MaskG
, MaskR
}, 0 },
3775 { "knotb", { MaskG
, MaskR
}, 0 },
3778 /* PREFIX_VEX_0F44_L_0_W_1 */
3780 { "knotq", { MaskG
, MaskR
}, 0 },
3782 { "knotd", { MaskG
, MaskR
}, 0 },
3785 /* PREFIX_VEX_0F45_L_1_W_0 */
3787 { "korw", { MaskG
, MaskVex
, MaskR
}, 0 },
3789 { "korb", { MaskG
, MaskVex
, MaskR
}, 0 },
3792 /* PREFIX_VEX_0F45_L_1_W_1 */
3794 { "korq", { MaskG
, MaskVex
, MaskR
}, 0 },
3796 { "kord", { MaskG
, MaskVex
, MaskR
}, 0 },
3799 /* PREFIX_VEX_0F46_L_1_W_0 */
3801 { "kxnorw", { MaskG
, MaskVex
, MaskR
}, 0 },
3803 { "kxnorb", { MaskG
, MaskVex
, MaskR
}, 0 },
3806 /* PREFIX_VEX_0F46_L_1_W_1 */
3808 { "kxnorq", { MaskG
, MaskVex
, MaskR
}, 0 },
3810 { "kxnord", { MaskG
, MaskVex
, MaskR
}, 0 },
3813 /* PREFIX_VEX_0F47_L_1_W_0 */
3815 { "kxorw", { MaskG
, MaskVex
, MaskR
}, 0 },
3817 { "kxorb", { MaskG
, MaskVex
, MaskR
}, 0 },
3820 /* PREFIX_VEX_0F47_L_1_W_1 */
3822 { "kxorq", { MaskG
, MaskVex
, MaskR
}, 0 },
3824 { "kxord", { MaskG
, MaskVex
, MaskR
}, 0 },
3827 /* PREFIX_VEX_0F4A_L_1_W_0 */
3829 { "kaddw", { MaskG
, MaskVex
, MaskR
}, 0 },
3831 { "kaddb", { MaskG
, MaskVex
, MaskR
}, 0 },
3834 /* PREFIX_VEX_0F4A_L_1_W_1 */
3836 { "kaddq", { MaskG
, MaskVex
, MaskR
}, 0 },
3838 { "kaddd", { MaskG
, MaskVex
, MaskR
}, 0 },
3841 /* PREFIX_VEX_0F4B_L_1_W_0 */
3843 { "kunpckwd", { MaskG
, MaskVex
, MaskR
}, 0 },
3845 { "kunpckbw", { MaskG
, MaskVex
, MaskR
}, 0 },
3848 /* PREFIX_VEX_0F4B_L_1_W_1 */
3850 { "kunpckdq", { MaskG
, MaskVex
, MaskR
}, 0 },
3853 /* PREFIX_VEX_0F6F */
3856 { "vmovdqu", { XM
, EXx
}, 0 },
3857 { "vmovdqa", { XM
, EXx
}, 0 },
3860 /* PREFIX_VEX_0F70 */
3863 { "vpshufhw", { XM
, EXx
, Ib
}, 0 },
3864 { "vpshufd", { XM
, EXx
, Ib
}, 0 },
3865 { "vpshuflw", { XM
, EXx
, Ib
}, 0 },
3868 /* PREFIX_VEX_0F7E */
3871 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1
) },
3872 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2
) },
3875 /* PREFIX_VEX_0F7F */
3878 { "vmovdqu", { EXxS
, XM
}, 0 },
3879 { "vmovdqa", { EXxS
, XM
}, 0 },
3882 /* PREFIX_VEX_0F90_L_0_W_0 */
3884 { "kmovw", { MaskG
, MaskE
}, 0 },
3886 { "kmovb", { MaskG
, MaskBDE
}, 0 },
3889 /* PREFIX_VEX_0F90_L_0_W_1 */
3891 { "kmovq", { MaskG
, MaskE
}, 0 },
3893 { "kmovd", { MaskG
, MaskBDE
}, 0 },
3896 /* PREFIX_VEX_0F91_L_0_W_0 */
3898 { "kmovw", { Mw
, MaskG
}, 0 },
3900 { "kmovb", { Mb
, MaskG
}, 0 },
3903 /* PREFIX_VEX_0F91_L_0_W_1 */
3905 { "kmovq", { Mq
, MaskG
}, 0 },
3907 { "kmovd", { Md
, MaskG
}, 0 },
3910 /* PREFIX_VEX_0F92_L_0_W_0 */
3912 { "kmovw", { MaskG
, Rdq
}, 0 },
3914 { "kmovb", { MaskG
, Rdq
}, 0 },
3915 { "kmovd", { MaskG
, Rdq
}, 0 },
3918 /* PREFIX_VEX_0F92_L_0_W_1 */
3923 { "kmovK", { MaskG
, Rdq
}, 0 },
3926 /* PREFIX_VEX_0F93_L_0_W_0 */
3928 { "kmovw", { Gdq
, MaskR
}, 0 },
3930 { "kmovb", { Gdq
, MaskR
}, 0 },
3931 { "kmovd", { Gdq
, MaskR
}, 0 },
3934 /* PREFIX_VEX_0F93_L_0_W_1 */
3939 { "kmovK", { Gdq
, MaskR
}, 0 },
3942 /* PREFIX_VEX_0F98_L_0_W_0 */
3944 { "kortestw", { MaskG
, MaskR
}, 0 },
3946 { "kortestb", { MaskG
, MaskR
}, 0 },
3949 /* PREFIX_VEX_0F98_L_0_W_1 */
3951 { "kortestq", { MaskG
, MaskR
}, 0 },
3953 { "kortestd", { MaskG
, MaskR
}, 0 },
3956 /* PREFIX_VEX_0F99_L_0_W_0 */
3958 { "ktestw", { MaskG
, MaskR
}, 0 },
3960 { "ktestb", { MaskG
, MaskR
}, 0 },
3963 /* PREFIX_VEX_0F99_L_0_W_1 */
3965 { "ktestq", { MaskG
, MaskR
}, 0 },
3967 { "ktestd", { MaskG
, MaskR
}, 0 },
3970 /* PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_0 */
3972 { "ldtilecfg", { M
}, 0 },
3974 { "sttilecfg", { M
}, 0 },
3977 /* PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_1 */
3979 { REG_TABLE (REG_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0
) },
3982 { RM_TABLE (RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_3
) },
3985 /* PREFIX_VEX_0F384B_X86_64_L_0_W_0 */
3988 { "tilestored", { MVexSIBMEM
, TMM
}, 0 },
3989 { "tileloaddt1", { TMM
, MVexSIBMEM
}, 0 },
3990 { "tileloadd", { TMM
, MVexSIBMEM
}, 0 },
3993 /* PREFIX_VEX_0F3850_W_0 */
3995 { "vpdpbuud", { XM
, Vex
, EXx
}, 0 },
3996 { "vpdpbsud", { XM
, Vex
, EXx
}, 0 },
3997 { "%XVvpdpbusd", { XM
, Vex
, EXx
}, 0 },
3998 { "vpdpbssd", { XM
, Vex
, EXx
}, 0 },
4001 /* PREFIX_VEX_0F3851_W_0 */
4003 { "vpdpbuuds", { XM
, Vex
, EXx
}, 0 },
4004 { "vpdpbsuds", { XM
, Vex
, EXx
}, 0 },
4005 { "%XVvpdpbusds", { XM
, Vex
, EXx
}, 0 },
4006 { "vpdpbssds", { XM
, Vex
, EXx
}, 0 },
4008 /* PREFIX_VEX_0F385C_X86_64_L_0_W_0 */
4011 { "tdpbf16ps", { TMM
, Rtmm
, VexTmm
}, 0 },
4013 { "tdpfp16ps", { TMM
, Rtmm
, VexTmm
}, 0 },
4016 /* PREFIX_VEX_0F385E_X86_64_L_0_W_0 */
4018 { "tdpbuud", {TMM
, Rtmm
, VexTmm
}, 0 },
4019 { "tdpbsud", {TMM
, Rtmm
, VexTmm
}, 0 },
4020 { "tdpbusd", {TMM
, Rtmm
, VexTmm
}, 0 },
4021 { "tdpbssd", {TMM
, Rtmm
, VexTmm
}, 0 },
4024 /* PREFIX_VEX_0F386C_X86_64_L_0_W_0 */
4026 { "tcmmrlfp16ps", { TMM
, Rtmm
, VexTmm
}, 0 },
4028 { "tcmmimfp16ps", { TMM
, Rtmm
, VexTmm
}, 0 },
4031 /* PREFIX_VEX_0F3872 */
4034 { VEX_W_TABLE (VEX_W_0F3872_P_1
) },
4037 /* PREFIX_VEX_0F38B0_W_0 */
4039 { "vcvtneoph2ps", { XM
, Mx
}, 0 },
4040 { "vcvtneebf162ps", { XM
, Mx
}, 0 },
4041 { "vcvtneeph2ps", { XM
, Mx
}, 0 },
4042 { "vcvtneobf162ps", { XM
, Mx
}, 0 },
4045 /* PREFIX_VEX_0F38B1_W_0 */
4048 { "vbcstnebf162ps", { XM
, Mw
}, 0 },
4049 { "vbcstnesh2ps", { XM
, Mw
}, 0 },
4052 /* PREFIX_VEX_0F38D2_W_0 */
4054 { "vpdpwuud", { XM
, Vex
, EXx
}, 0 },
4055 { "vpdpwsud", { XM
, Vex
, EXx
}, 0 },
4056 { "vpdpwusd", { XM
, Vex
, EXx
}, 0 },
4059 /* PREFIX_VEX_0F38D3_W_0 */
4061 { "vpdpwuuds", { XM
, Vex
, EXx
}, 0 },
4062 { "vpdpwsuds", { XM
, Vex
, EXx
}, 0 },
4063 { "vpdpwusds", { XM
, Vex
, EXx
}, 0 },
4066 /* PREFIX_VEX_0F38CB */
4071 { VEX_W_TABLE (VEX_W_0F38CB_P_3
) },
4074 /* PREFIX_VEX_0F38CC */
4079 { VEX_W_TABLE (VEX_W_0F38CC_P_3
) },
4082 /* PREFIX_VEX_0F38CD */
4087 { VEX_W_TABLE (VEX_W_0F38CD_P_3
) },
4090 /* PREFIX_VEX_0F38DA_W_0 */
4092 { VEX_LEN_TABLE (VEX_LEN_0F38DA_W_0_P_0
) },
4093 { "vsm4key4", { XM
, Vex
, EXx
}, 0 },
4094 { VEX_LEN_TABLE (VEX_LEN_0F38DA_W_0_P_2
) },
4095 { "vsm4rnds4", { XM
, Vex
, EXx
}, 0 },
4098 /* PREFIX_VEX_0F38F2_L_0 */
4100 { "andnS", { Gdq
, VexGdq
, Edq
}, 0 },
4103 /* PREFIX_VEX_0F38F3_L_0 */
4105 { REG_TABLE (REG_VEX_0F38F3_L_0_P_0
) },
4108 /* PREFIX_VEX_0F38F5_L_0 */
4110 { "bzhiS", { Gdq
, Edq
, VexGdq
}, 0 },
4111 { "pextS", { Gdq
, VexGdq
, Edq
}, 0 },
4113 { "pdepS", { Gdq
, VexGdq
, Edq
}, 0 },
4116 /* PREFIX_VEX_0F38F6_L_0 */
4121 { "mulxS", { Gdq
, VexGdq
, Edq
}, 0 },
4124 /* PREFIX_VEX_0F38F7_L_0 */
4126 { "bextrS", { Gdq
, Edq
, VexGdq
}, 0 },
4127 { "sarxS", { Gdq
, Edq
, VexGdq
}, 0 },
4128 { "shlxS", { Gdq
, Edq
, VexGdq
}, 0 },
4129 { "shrxS", { Gdq
, Edq
, VexGdq
}, 0 },
4132 /* PREFIX_VEX_0F3AF0_L_0 */
4137 { "rorxS", { Gdq
, Edq
, Ib
}, 0 },
4140 /* PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64 */
4143 { "uwrmsr", { Skip_MODRM
, Id
, Rq
}, 0 },
4145 { "urdmsr", { Rq
, Id
}, 0 },
4148 #include "i386-dis-evex-prefix.h"
4151 static const struct dis386 x86_64_table
[][2] = {
4154 { "pushP", { es
}, 0 },
4159 { "popP", { es
}, 0 },
4164 { "pushP", { cs
}, 0 },
4169 { "pushP", { ss
}, 0 },
4174 { "popP", { ss
}, 0 },
4179 { "pushP", { ds
}, 0 },
4184 { "popP", { ds
}, 0 },
4189 { "daa", { XX
}, 0 },
4194 { "das", { XX
}, 0 },
4199 { "aaa", { XX
}, 0 },
4204 { "aas", { XX
}, 0 },
4209 { "pushaP", { XX
}, 0 },
4214 { "popaP", { XX
}, 0 },
4219 { MOD_TABLE (MOD_62_32BIT
) },
4225 { "arplS", { Sv
, Gv
}, 0 },
4226 { "movs", { Gv
, { MOVSXD_Fixup
, movsxd_mode
} }, 0 },
4231 { "ins{R|}", { Yzr
, indirDX
}, 0 },
4232 { "ins{G|}", { Yzr
, indirDX
}, 0 },
4237 { "outs{R|}", { indirDXr
, Xz
}, 0 },
4238 { "outs{G|}", { indirDXr
, Xz
}, 0 },
4243 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
4244 { REG_TABLE (REG_80
) },
4249 { "{l|}call{P|}", { Ap
}, 0 },
4254 { "retP", { Iw
, BND
}, 0 },
4255 { "ret@", { Iw
, BND
}, 0 },
4260 { "retP", { BND
}, 0 },
4261 { "ret@", { BND
}, 0 },
4266 { MOD_TABLE (MOD_C4_32BIT
) },
4267 { VEX_C4_TABLE () },
4272 { MOD_TABLE (MOD_C5_32BIT
) },
4273 { VEX_C5_TABLE () },
4278 { "into", { XX
}, 0 },
4283 { "aam", { Ib
}, 0 },
4288 { "aad", { Ib
}, 0 },
4293 { "callP", { Jv
, BND
}, 0 },
4294 { "call@", { Jv
, BND
}, PREFIX_REX2_ILLEGAL
}
4299 { "jmpP", { Jv
, BND
}, 0 },
4300 { "jmp@", { Jv
, BND
}, PREFIX_REX2_ILLEGAL
}
4305 { "{l|}jmp{P|}", { Ap
}, 0 },
4308 /* X86_64_0F00_REG_6 */
4311 { PREFIX_TABLE (PREFIX_0F00_REG_6_X86_64
) },
4314 /* X86_64_0F01_REG_0 */
4316 { "sgdt{Q|Q}", { M
}, 0 },
4317 { "sgdt", { M
}, 0 },
4320 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_1 */
4323 { "wrmsrlist", { Skip_MODRM
}, 0 },
4326 /* X86_64_0F01_REG_0_MOD_3_RM_6_P_3 */
4329 { "rdmsrlist", { Skip_MODRM
}, 0 },
4332 /* X86_64_0F01_REG_0_MOD_3_RM_7_P_0 */
4335 { "pbndkb", { Skip_MODRM
}, 0 },
4338 /* X86_64_0F01_REG_1 */
4340 { "sidt{Q|Q}", { M
}, 0 },
4341 { "sidt", { M
}, 0 },
4344 /* X86_64_0F01_REG_1_RM_2_PREFIX_1 */
4347 { "eretu", { Skip_MODRM
}, 0 },
4350 /* X86_64_0F01_REG_1_RM_2_PREFIX_3 */
4353 { "erets", { Skip_MODRM
}, 0 },
4356 /* X86_64_0F01_REG_1_RM_5_PREFIX_2 */
4359 { "seamret", { Skip_MODRM
}, 0 },
4362 /* X86_64_0F01_REG_1_RM_6_PREFIX_2 */
4365 { "seamops", { Skip_MODRM
}, 0 },
4368 /* X86_64_0F01_REG_1_RM_7_PREFIX_2 */
4371 { "seamcall", { Skip_MODRM
}, 0 },
4374 /* X86_64_0F01_REG_2 */
4376 { "lgdt{Q|Q}", { M
}, 0 },
4377 { "lgdt", { M
}, 0 },
4380 /* X86_64_0F01_REG_3 */
4382 { "lidt{Q|Q}", { M
}, 0 },
4383 { "lidt", { M
}, 0 },
4386 /* X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1 */
4389 { "uiret", { Skip_MODRM
}, 0 },
4392 /* X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1 */
4395 { "testui", { Skip_MODRM
}, 0 },
4398 /* X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1 */
4401 { "clui", { Skip_MODRM
}, 0 },
4404 /* X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1 */
4407 { "stui", { Skip_MODRM
}, 0 },
4410 /* X86_64_0F01_REG_7_MOD_3_RM_5_PREFIX_1 */
4413 { "rmpquery", { Skip_MODRM
}, 0 },
4416 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1 */
4419 { "rmpadjust", { Skip_MODRM
}, 0 },
4422 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3 */
4425 { "rmpupdate", { Skip_MODRM
}, 0 },
4428 /* X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1 */
4431 { "psmash", { Skip_MODRM
}, 0 },
4434 /* X86_64_0F18_REG_6_MOD_0 */
4436 { "nopQ", { Ev
}, 0 },
4437 { PREFIX_TABLE (PREFIX_0F18_REG_6_MOD_0_X86_64
) },
4440 /* X86_64_0F18_REG_7_MOD_0 */
4442 { "nopQ", { Ev
}, 0 },
4443 { PREFIX_TABLE (PREFIX_0F18_REG_7_MOD_0_X86_64
) },
4448 { "movZ", { Em
, Td
}, 0 },
4453 { "movZ", { Td
, Em
}, 0 },
4457 /* X86_64_0F38F8_M_1 */
4459 { PREFIX_TABLE (PREFIX_0F38F8_M_1_X86_64
) },
4462 /* X86_64_0FC7_REG_6_MOD_3_PREFIX_1 */
4465 { "senduipi", { Eq
}, 0 },
4468 /* X86_64_VEX_0F3849 */
4471 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64
) },
4474 /* X86_64_VEX_0F384B */
4477 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64
) },
4480 /* X86_64_VEX_0F385C */
4483 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64
) },
4486 /* X86_64_VEX_0F385E */
4489 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64
) },
4492 /* X86_64_VEX_0F386C */
4495 { VEX_LEN_TABLE (VEX_LEN_0F386C_X86_64
) },
4498 /* X86_64_VEX_0F38E0 */
4501 { "cmpoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4504 /* X86_64_VEX_0F38E1 */
4507 { "cmpnoxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4510 /* X86_64_VEX_0F38E2 */
4513 { "cmpbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4516 /* X86_64_VEX_0F38E3 */
4519 { "cmpnbxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4522 /* X86_64_VEX_0F38E4 */
4525 { "cmpzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4528 /* X86_64_VEX_0F38E5 */
4531 { "cmpnzxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4534 /* X86_64_VEX_0F38E6 */
4537 { "cmpbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4540 /* X86_64_VEX_0F38E7 */
4543 { "cmpnbexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4546 /* X86_64_VEX_0F38E8 */
4549 { "cmpsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4552 /* X86_64_VEX_0F38E9 */
4555 { "cmpnsxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4558 /* X86_64_VEX_0F38EA */
4561 { "cmppxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4564 /* X86_64_VEX_0F38EB */
4567 { "cmpnpxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4570 /* X86_64_VEX_0F38EC */
4573 { "cmplxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4576 /* X86_64_VEX_0F38ED */
4579 { "cmpnlxadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4582 /* X86_64_VEX_0F38EE */
4585 { "cmplexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4588 /* X86_64_VEX_0F38EF */
4591 { "cmpnlexadd", { Mdq
, Gdq
, VexGdq
}, PREFIX_DATA
},
4594 /* X86_64_VEX_MAP7_F8_L_0_W_0_R_0 */
4597 { PREFIX_TABLE (PREFIX_VEX_MAP7_F8_L_0_W_0_R_0_X86_64
) },
4600 #include "i386-dis-evex-x86-64.h"
4603 static const struct dis386 three_byte_table
[][256] = {
4605 /* THREE_BYTE_0F38 */
4608 { "pshufb", { MX
, EM
}, PREFIX_OPCODE
},
4609 { "phaddw", { MX
, EM
}, PREFIX_OPCODE
},
4610 { "phaddd", { MX
, EM
}, PREFIX_OPCODE
},
4611 { "phaddsw", { MX
, EM
}, PREFIX_OPCODE
},
4612 { "pmaddubsw", { MX
, EM
}, PREFIX_OPCODE
},
4613 { "phsubw", { MX
, EM
}, PREFIX_OPCODE
},
4614 { "phsubd", { MX
, EM
}, PREFIX_OPCODE
},
4615 { "phsubsw", { MX
, EM
}, PREFIX_OPCODE
},
4617 { "psignb", { MX
, EM
}, PREFIX_OPCODE
},
4618 { "psignw", { MX
, EM
}, PREFIX_OPCODE
},
4619 { "psignd", { MX
, EM
}, PREFIX_OPCODE
},
4620 { "pmulhrsw", { MX
, EM
}, PREFIX_OPCODE
},
4626 { "pblendvb", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4630 { "blendvps", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4631 { "blendvpd", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4633 { "ptest", { XM
, EXx
}, PREFIX_DATA
},
4639 { "pabsb", { MX
, EM
}, PREFIX_OPCODE
},
4640 { "pabsw", { MX
, EM
}, PREFIX_OPCODE
},
4641 { "pabsd", { MX
, EM
}, PREFIX_OPCODE
},
4644 { "pmovsxbw", { XM
, EXq
}, PREFIX_DATA
},
4645 { "pmovsxbd", { XM
, EXd
}, PREFIX_DATA
},
4646 { "pmovsxbq", { XM
, EXw
}, PREFIX_DATA
},
4647 { "pmovsxwd", { XM
, EXq
}, PREFIX_DATA
},
4648 { "pmovsxwq", { XM
, EXd
}, PREFIX_DATA
},
4649 { "pmovsxdq", { XM
, EXq
}, PREFIX_DATA
},
4653 { "pmuldq", { XM
, EXx
}, PREFIX_DATA
},
4654 { "pcmpeqq", { XM
, EXx
}, PREFIX_DATA
},
4655 { "movntdqa", { XM
, Mx
}, PREFIX_DATA
},
4656 { "packusdw", { XM
, EXx
}, PREFIX_DATA
},
4662 { "pmovzxbw", { XM
, EXq
}, PREFIX_DATA
},
4663 { "pmovzxbd", { XM
, EXd
}, PREFIX_DATA
},
4664 { "pmovzxbq", { XM
, EXw
}, PREFIX_DATA
},
4665 { "pmovzxwd", { XM
, EXq
}, PREFIX_DATA
},
4666 { "pmovzxwq", { XM
, EXd
}, PREFIX_DATA
},
4667 { "pmovzxdq", { XM
, EXq
}, PREFIX_DATA
},
4669 { "pcmpgtq", { XM
, EXx
}, PREFIX_DATA
},
4671 { "pminsb", { XM
, EXx
}, PREFIX_DATA
},
4672 { "pminsd", { XM
, EXx
}, PREFIX_DATA
},
4673 { "pminuw", { XM
, EXx
}, PREFIX_DATA
},
4674 { "pminud", { XM
, EXx
}, PREFIX_DATA
},
4675 { "pmaxsb", { XM
, EXx
}, PREFIX_DATA
},
4676 { "pmaxsd", { XM
, EXx
}, PREFIX_DATA
},
4677 { "pmaxuw", { XM
, EXx
}, PREFIX_DATA
},
4678 { "pmaxud", { XM
, EXx
}, PREFIX_DATA
},
4680 { "pmulld", { XM
, EXx
}, PREFIX_DATA
},
4681 { "phminposuw", { XM
, EXx
}, PREFIX_DATA
},
4752 { "invept", { Gm
, Mo
}, PREFIX_DATA
},
4753 { "invvpid", { Gm
, Mo
}, PREFIX_DATA
},
4754 { "invpcid", { Gm
, M
}, PREFIX_DATA
},
4833 { "sha1nexte", { XM
, EXxmm
}, PREFIX_OPCODE
},
4834 { "sha1msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4835 { "sha1msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4836 { "sha256rnds2", { XM
, EXxmm
, XMM0
}, PREFIX_OPCODE
},
4837 { "sha256msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4838 { "sha256msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4840 { "gf2p8mulb", { XM
, EXxmm
}, PREFIX_DATA
},
4851 { PREFIX_TABLE (PREFIX_0F38D8
) },
4854 { "aesimc", { XM
, EXx
}, PREFIX_DATA
},
4855 { PREFIX_TABLE (PREFIX_0F38DC
) },
4856 { PREFIX_TABLE (PREFIX_0F38DD
) },
4857 { PREFIX_TABLE (PREFIX_0F38DE
) },
4858 { PREFIX_TABLE (PREFIX_0F38DF
) },
4878 { PREFIX_TABLE (PREFIX_0F38F0
) },
4879 { PREFIX_TABLE (PREFIX_0F38F1
) },
4883 { "wrussK", { M
, Gdq
}, PREFIX_DATA
},
4884 { PREFIX_TABLE (PREFIX_0F38F6
) },
4887 { MOD_TABLE (MOD_0F38F8
) },
4888 { "movdiri", { Mdq
, Gdq
}, PREFIX_OPCODE
},
4889 { PREFIX_TABLE (PREFIX_0F38FA
) },
4890 { PREFIX_TABLE (PREFIX_0F38FB
) },
4891 { PREFIX_TABLE (PREFIX_0F38FC
) },
4896 /* THREE_BYTE_0F3A */
4908 { "roundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4909 { "roundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4910 { "roundss", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4911 { "roundsd", { XM
, EXq
, Ib
}, PREFIX_DATA
},
4912 { "blendps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4913 { "blendpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4914 { "pblendw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4915 { "palignr", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
4921 { "pextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
4922 { "pextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
4923 { "pextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
4924 { "extractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
4935 { "pinsrb", { XM
, Edb
, Ib
}, PREFIX_DATA
},
4936 { "insertps", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4937 { "pinsrK", { XM
, Edq
, Ib
}, PREFIX_DATA
},
4971 { "dpps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4972 { "dppd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4973 { "mpsadbw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4975 { "pclmulqdq", { XM
, EXx
, PCLMUL
}, PREFIX_DATA
},
5007 { "pcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5008 { "pcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5009 { "pcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5010 { "pcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5128 { "sha1rnds4", { XM
, EXxmm
, Ib
}, PREFIX_OPCODE
},
5130 { "gf2p8affineqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5131 { "gf2p8affineinvqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
5149 { "aeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
5169 { PREFIX_TABLE (PREFIX_0F3A0F
) },
5189 static const struct dis386 xop_table
[][256] = {
5342 { VEX_LEN_TABLE (VEX_LEN_XOP_08_85
) },
5343 { VEX_LEN_TABLE (VEX_LEN_XOP_08_86
) },
5344 { VEX_LEN_TABLE (VEX_LEN_XOP_08_87
) },
5352 { VEX_LEN_TABLE (VEX_LEN_XOP_08_8E
) },
5353 { VEX_LEN_TABLE (VEX_LEN_XOP_08_8F
) },
5360 { VEX_LEN_TABLE (VEX_LEN_XOP_08_95
) },
5361 { VEX_LEN_TABLE (VEX_LEN_XOP_08_96
) },
5362 { VEX_LEN_TABLE (VEX_LEN_XOP_08_97
) },
5370 { VEX_LEN_TABLE (VEX_LEN_XOP_08_9E
) },
5371 { VEX_LEN_TABLE (VEX_LEN_XOP_08_9F
) },
5375 { "vpcmov", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
5376 { VEX_LEN_TABLE (VEX_LEN_XOP_08_A3
) },
5379 { VEX_LEN_TABLE (VEX_LEN_XOP_08_A6
) },
5397 { VEX_LEN_TABLE (VEX_LEN_XOP_08_B6
) },
5409 { VEX_LEN_TABLE (VEX_LEN_XOP_08_C0
) },
5410 { VEX_LEN_TABLE (VEX_LEN_XOP_08_C1
) },
5411 { VEX_LEN_TABLE (VEX_LEN_XOP_08_C2
) },
5412 { VEX_LEN_TABLE (VEX_LEN_XOP_08_C3
) },
5422 { VEX_LEN_TABLE (VEX_LEN_XOP_08_CC
) },
5423 { VEX_LEN_TABLE (VEX_LEN_XOP_08_CD
) },
5424 { VEX_LEN_TABLE (VEX_LEN_XOP_08_CE
) },
5425 { VEX_LEN_TABLE (VEX_LEN_XOP_08_CF
) },
5458 { VEX_LEN_TABLE (VEX_LEN_XOP_08_EC
) },
5459 { VEX_LEN_TABLE (VEX_LEN_XOP_08_ED
) },
5460 { VEX_LEN_TABLE (VEX_LEN_XOP_08_EE
) },
5461 { VEX_LEN_TABLE (VEX_LEN_XOP_08_EF
) },
5485 { VEX_LEN_TABLE (VEX_LEN_XOP_09_01
) },
5486 { VEX_LEN_TABLE (VEX_LEN_XOP_09_02
) },
5504 { VEX_LEN_TABLE (VEX_LEN_XOP_09_12
) },
5628 { VEX_W_TABLE (VEX_W_XOP_09_80
) },
5629 { VEX_W_TABLE (VEX_W_XOP_09_81
) },
5630 { VEX_W_TABLE (VEX_W_XOP_09_82
) },
5631 { VEX_W_TABLE (VEX_W_XOP_09_83
) },
5646 { VEX_LEN_TABLE (VEX_LEN_XOP_09_90
) },
5647 { VEX_LEN_TABLE (VEX_LEN_XOP_09_91
) },
5648 { VEX_LEN_TABLE (VEX_LEN_XOP_09_92
) },
5649 { VEX_LEN_TABLE (VEX_LEN_XOP_09_93
) },
5650 { VEX_LEN_TABLE (VEX_LEN_XOP_09_94
) },
5651 { VEX_LEN_TABLE (VEX_LEN_XOP_09_95
) },
5652 { VEX_LEN_TABLE (VEX_LEN_XOP_09_96
) },
5653 { VEX_LEN_TABLE (VEX_LEN_XOP_09_97
) },
5655 { VEX_LEN_TABLE (VEX_LEN_XOP_09_98
) },
5656 { VEX_LEN_TABLE (VEX_LEN_XOP_09_99
) },
5657 { VEX_LEN_TABLE (VEX_LEN_XOP_09_9A
) },
5658 { VEX_LEN_TABLE (VEX_LEN_XOP_09_9B
) },
5701 { VEX_LEN_TABLE (VEX_LEN_XOP_09_C1
) },
5702 { VEX_LEN_TABLE (VEX_LEN_XOP_09_C2
) },
5703 { VEX_LEN_TABLE (VEX_LEN_XOP_09_C3
) },
5706 { VEX_LEN_TABLE (VEX_LEN_XOP_09_C6
) },
5707 { VEX_LEN_TABLE (VEX_LEN_XOP_09_C7
) },
5712 { VEX_LEN_TABLE (VEX_LEN_XOP_09_CB
) },
5719 { VEX_LEN_TABLE (VEX_LEN_XOP_09_D1
) },
5720 { VEX_LEN_TABLE (VEX_LEN_XOP_09_D2
) },
5721 { VEX_LEN_TABLE (VEX_LEN_XOP_09_D3
) },
5724 { VEX_LEN_TABLE (VEX_LEN_XOP_09_D6
) },
5725 { VEX_LEN_TABLE (VEX_LEN_XOP_09_D7
) },
5730 { VEX_LEN_TABLE (VEX_LEN_XOP_09_DB
) },
5737 { VEX_LEN_TABLE (VEX_LEN_XOP_09_E1
) },
5738 { VEX_LEN_TABLE (VEX_LEN_XOP_09_E2
) },
5739 { VEX_LEN_TABLE (VEX_LEN_XOP_09_E3
) },
5793 { "bextrS", { Gdq
, Edq
, Id
}, 0 },
5795 { VEX_LEN_TABLE (VEX_LEN_XOP_0A_12
) },
6065 static const struct dis386 vex_table
[][256] = {
6087 { PREFIX_TABLE (PREFIX_0F10
) },
6088 { PREFIX_TABLE (PREFIX_0F11
) },
6089 { PREFIX_TABLE (PREFIX_VEX_0F12
) },
6090 { VEX_LEN_TABLE (VEX_LEN_0F13
) },
6091 { "vunpcklpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6092 { "vunpckhpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6093 { PREFIX_TABLE (PREFIX_VEX_0F16
) },
6094 { VEX_LEN_TABLE (VEX_LEN_0F17
) },
6114 { "vmovapX", { XM
, EXx
}, PREFIX_OPCODE
},
6115 { "vmovapX", { EXxS
, XM
}, PREFIX_OPCODE
},
6116 { PREFIX_TABLE (PREFIX_VEX_0F2A
) },
6117 { "vmovntpX", { Mx
, XM
}, PREFIX_OPCODE
},
6118 { PREFIX_TABLE (PREFIX_VEX_0F2C
) },
6119 { PREFIX_TABLE (PREFIX_VEX_0F2D
) },
6120 { PREFIX_TABLE (PREFIX_0F2E
) },
6121 { PREFIX_TABLE (PREFIX_0F2F
) },
6142 { VEX_LEN_TABLE (VEX_LEN_0F41
) },
6143 { VEX_LEN_TABLE (VEX_LEN_0F42
) },
6145 { VEX_LEN_TABLE (VEX_LEN_0F44
) },
6146 { VEX_LEN_TABLE (VEX_LEN_0F45
) },
6147 { VEX_LEN_TABLE (VEX_LEN_0F46
) },
6148 { VEX_LEN_TABLE (VEX_LEN_0F47
) },
6152 { VEX_LEN_TABLE (VEX_LEN_0F4A
) },
6153 { VEX_LEN_TABLE (VEX_LEN_0F4B
) },
6159 { "vmovmskpX", { Gdq
, Ux
}, PREFIX_OPCODE
},
6160 { PREFIX_TABLE (PREFIX_0F51
) },
6161 { PREFIX_TABLE (PREFIX_0F52
) },
6162 { PREFIX_TABLE (PREFIX_0F53
) },
6163 { "vandpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6164 { "vandnpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6165 { "vorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6166 { "vxorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
6168 { PREFIX_TABLE (PREFIX_0F58
) },
6169 { PREFIX_TABLE (PREFIX_0F59
) },
6170 { PREFIX_TABLE (PREFIX_0F5A
) },
6171 { PREFIX_TABLE (PREFIX_0F5B
) },
6172 { PREFIX_TABLE (PREFIX_0F5C
) },
6173 { PREFIX_TABLE (PREFIX_0F5D
) },
6174 { PREFIX_TABLE (PREFIX_0F5E
) },
6175 { PREFIX_TABLE (PREFIX_0F5F
) },
6177 { "vpunpcklbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6178 { "vpunpcklwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6179 { "vpunpckldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6180 { "vpacksswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6181 { "vpcmpgtb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6182 { "vpcmpgtw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6183 { "vpcmpgtd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6184 { "vpackuswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6186 { "vpunpckhbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6187 { "vpunpckhwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6188 { "vpunpckhdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6189 { "vpackssdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6190 { "vpunpcklqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6191 { "vpunpckhqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6192 { VEX_LEN_TABLE (VEX_LEN_0F6E
) },
6193 { PREFIX_TABLE (PREFIX_VEX_0F6F
) },
6195 { PREFIX_TABLE (PREFIX_VEX_0F70
) },
6196 { REG_TABLE (REG_VEX_0F71
) },
6197 { REG_TABLE (REG_VEX_0F72
) },
6198 { REG_TABLE (REG_VEX_0F73
) },
6199 { "vpcmpeqb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6200 { "vpcmpeqw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6201 { "vpcmpeqd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6202 { VEX_LEN_TABLE (VEX_LEN_0F77
) },
6208 { PREFIX_TABLE (PREFIX_0F7C
) },
6209 { PREFIX_TABLE (PREFIX_0F7D
) },
6210 { PREFIX_TABLE (PREFIX_VEX_0F7E
) },
6211 { PREFIX_TABLE (PREFIX_VEX_0F7F
) },
6231 { VEX_LEN_TABLE (VEX_LEN_0F90
) },
6232 { VEX_LEN_TABLE (VEX_LEN_0F91
) },
6233 { VEX_LEN_TABLE (VEX_LEN_0F92
) },
6234 { VEX_LEN_TABLE (VEX_LEN_0F93
) },
6240 { VEX_LEN_TABLE (VEX_LEN_0F98
) },
6241 { VEX_LEN_TABLE (VEX_LEN_0F99
) },
6264 { REG_TABLE (REG_VEX_0FAE
) },
6287 { PREFIX_TABLE (PREFIX_0FC2
) },
6289 { VEX_LEN_TABLE (VEX_LEN_0FC4
) },
6290 { "vpextrw", { Gd
, Uxmm
, Ib
}, PREFIX_DATA
},
6291 { "vshufpX", { XM
, Vex
, EXx
, Ib
}, PREFIX_OPCODE
},
6303 { PREFIX_TABLE (PREFIX_0FD0
) },
6304 { "vpsrlw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6305 { "vpsrld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6306 { "vpsrlq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6307 { "vpaddq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6308 { "vpmullw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6309 { VEX_LEN_TABLE (VEX_LEN_0FD6
) },
6310 { "vpmovmskb", { Gdq
, Ux
}, PREFIX_DATA
},
6312 { "vpsubusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6313 { "vpsubusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6314 { "vpminub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6315 { "vpand", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6316 { "vpaddusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6317 { "vpaddusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6318 { "vpmaxub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6319 { "vpandn", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6321 { "vpavgb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6322 { "vpsraw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6323 { "vpsrad", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6324 { "vpavgw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6325 { "vpmulhuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6326 { "vpmulhw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6327 { PREFIX_TABLE (PREFIX_0FE6
) },
6328 { "vmovntdq", { Mx
, XM
}, PREFIX_DATA
},
6330 { "vpsubsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6331 { "vpsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6332 { "vpminsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6333 { "vpor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6334 { "vpaddsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6335 { "vpaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6336 { "vpmaxsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6337 { "vpxor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6339 { PREFIX_TABLE (PREFIX_0FF0
) },
6340 { "vpsllw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6341 { "vpslld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6342 { "vpsllq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6343 { "vpmuludq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6344 { "vpmaddwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6345 { "vpsadbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6346 { "vmaskmovdqu", { XM
, Uxmm
}, PREFIX_DATA
},
6348 { "vpsubb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6349 { "vpsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6350 { "vpsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6351 { "vpsubq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6352 { "vpaddb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6353 { "vpaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6354 { "vpaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6360 { "vpshufb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6361 { "vphaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6362 { "vphaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6363 { "vphaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6364 { "vpmaddubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6365 { "vphsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6366 { "vphsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6367 { "vphsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6369 { "vpsignb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6370 { "vpsignw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6371 { "vpsignd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6372 { "vpmulhrsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6373 { VEX_W_TABLE (VEX_W_0F380C
) },
6374 { VEX_W_TABLE (VEX_W_0F380D
) },
6375 { VEX_W_TABLE (VEX_W_0F380E
) },
6376 { VEX_W_TABLE (VEX_W_0F380F
) },
6381 { VEX_W_TABLE (VEX_W_0F3813
) },
6384 { VEX_LEN_TABLE (VEX_LEN_0F3816
) },
6385 { "vptest", { XM
, EXx
}, PREFIX_DATA
},
6387 { VEX_W_TABLE (VEX_W_0F3818
) },
6388 { VEX_LEN_TABLE (VEX_LEN_0F3819
) },
6389 { VEX_LEN_TABLE (VEX_LEN_0F381A
) },
6391 { "vpabsb", { XM
, EXx
}, PREFIX_DATA
},
6392 { "vpabsw", { XM
, EXx
}, PREFIX_DATA
},
6393 { "vpabsd", { XM
, EXx
}, PREFIX_DATA
},
6396 { "vpmovsxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6397 { "vpmovsxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6398 { "vpmovsxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6399 { "vpmovsxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6400 { "vpmovsxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6401 { "vpmovsxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6405 { "vpmuldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6406 { "vpcmpeqq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6407 { "vmovntdqa", { XM
, Mx
}, PREFIX_DATA
},
6408 { "vpackusdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6409 { VEX_W_TABLE (VEX_W_0F382C
) },
6410 { VEX_W_TABLE (VEX_W_0F382D
) },
6411 { VEX_W_TABLE (VEX_W_0F382E
) },
6412 { VEX_W_TABLE (VEX_W_0F382F
) },
6414 { "vpmovzxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6415 { "vpmovzxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6416 { "vpmovzxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6417 { "vpmovzxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6418 { "vpmovzxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6419 { "vpmovzxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6420 { VEX_LEN_TABLE (VEX_LEN_0F3836
) },
6421 { "vpcmpgtq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6423 { "vpminsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6424 { "vpminsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6425 { "vpminuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6426 { "vpminud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6427 { "vpmaxsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6428 { "vpmaxsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6429 { "vpmaxuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6430 { "vpmaxud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6432 { "vpmulld", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6433 { VEX_LEN_TABLE (VEX_LEN_0F3841
) },
6437 { "vpsrlv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6438 { VEX_W_TABLE (VEX_W_0F3846
) },
6439 { "vpsllv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6442 { X86_64_TABLE (X86_64_VEX_0F3849
) },
6444 { X86_64_TABLE (X86_64_VEX_0F384B
) },
6450 { VEX_W_TABLE (VEX_W_0F3850
) },
6451 { VEX_W_TABLE (VEX_W_0F3851
) },
6452 { VEX_W_TABLE (VEX_W_0F3852
) },
6453 { VEX_W_TABLE (VEX_W_0F3853
) },
6459 { VEX_W_TABLE (VEX_W_0F3858
) },
6460 { VEX_W_TABLE (VEX_W_0F3859
) },
6461 { VEX_LEN_TABLE (VEX_LEN_0F385A
) },
6463 { X86_64_TABLE (X86_64_VEX_0F385C
) },
6465 { X86_64_TABLE (X86_64_VEX_0F385E
) },
6481 { X86_64_TABLE (X86_64_VEX_0F386C
) },
6488 { PREFIX_TABLE (PREFIX_VEX_0F3872
) },
6495 { VEX_W_TABLE (VEX_W_0F3878
) },
6496 { VEX_W_TABLE (VEX_W_0F3879
) },
6517 { "vpmaskmov%DQ", { XM
, Vex
, Mx
}, PREFIX_DATA
},
6519 { "vpmaskmov%DQ", { Mx
, Vex
, XM
}, PREFIX_DATA
},
6522 { "vpgatherd%DQ", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6523 { "vpgatherq%DQ", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6524 { "vgatherdp%XW", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6525 { "vgatherqp%XW", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6528 { "vfmaddsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6529 { "vfmsubadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6531 { "vfmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6532 { "vfmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6533 { "vfmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6534 { "vfmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6535 { "vfnmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6536 { "vfnmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6537 { "vfnmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6538 { "vfnmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6546 { "vfmaddsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6547 { "vfmsubadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6549 { "vfmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6550 { "vfmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6551 { "vfmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6552 { "vfmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6553 { "vfnmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6554 { "vfnmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6555 { "vfnmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6556 { "vfnmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6558 { VEX_W_TABLE (VEX_W_0F38B0
) },
6559 { VEX_W_TABLE (VEX_W_0F38B1
) },
6562 { VEX_W_TABLE (VEX_W_0F38B4
) },
6563 { VEX_W_TABLE (VEX_W_0F38B5
) },
6564 { "vfmaddsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6565 { "vfmsubadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6567 { "vfmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6568 { "vfmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6569 { "vfmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6570 { "vfmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6571 { "vfnmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6572 { "vfnmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6573 { "vfnmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6574 { "vfnmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6588 { PREFIX_TABLE (PREFIX_VEX_0F38CB
) },
6589 { PREFIX_TABLE (PREFIX_VEX_0F38CC
) },
6590 { PREFIX_TABLE (PREFIX_VEX_0F38CD
) },
6592 { VEX_W_TABLE (VEX_W_0F38CF
) },
6596 { VEX_W_TABLE (VEX_W_0F38D2
) },
6597 { VEX_W_TABLE (VEX_W_0F38D3
) },
6605 { VEX_W_TABLE (VEX_W_0F38DA
) },
6606 { VEX_LEN_TABLE (VEX_LEN_0F38DB
) },
6607 { "vaesenc", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6608 { "vaesenclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6609 { "vaesdec", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6610 { "vaesdeclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6612 { X86_64_TABLE (X86_64_VEX_0F38E0
) },
6613 { X86_64_TABLE (X86_64_VEX_0F38E1
) },
6614 { X86_64_TABLE (X86_64_VEX_0F38E2
) },
6615 { X86_64_TABLE (X86_64_VEX_0F38E3
) },
6616 { X86_64_TABLE (X86_64_VEX_0F38E4
) },
6617 { X86_64_TABLE (X86_64_VEX_0F38E5
) },
6618 { X86_64_TABLE (X86_64_VEX_0F38E6
) },
6619 { X86_64_TABLE (X86_64_VEX_0F38E7
) },
6621 { X86_64_TABLE (X86_64_VEX_0F38E8
) },
6622 { X86_64_TABLE (X86_64_VEX_0F38E9
) },
6623 { X86_64_TABLE (X86_64_VEX_0F38EA
) },
6624 { X86_64_TABLE (X86_64_VEX_0F38EB
) },
6625 { X86_64_TABLE (X86_64_VEX_0F38EC
) },
6626 { X86_64_TABLE (X86_64_VEX_0F38ED
) },
6627 { X86_64_TABLE (X86_64_VEX_0F38EE
) },
6628 { X86_64_TABLE (X86_64_VEX_0F38EF
) },
6632 { VEX_LEN_TABLE (VEX_LEN_0F38F2
) },
6633 { VEX_LEN_TABLE (VEX_LEN_0F38F3
) },
6635 { VEX_LEN_TABLE (VEX_LEN_0F38F5
) },
6636 { VEX_LEN_TABLE (VEX_LEN_0F38F6
) },
6637 { VEX_LEN_TABLE (VEX_LEN_0F38F7
) },
6651 { VEX_LEN_TABLE (VEX_LEN_0F3A00
) },
6652 { VEX_LEN_TABLE (VEX_LEN_0F3A01
) },
6653 { VEX_W_TABLE (VEX_W_0F3A02
) },
6655 { VEX_W_TABLE (VEX_W_0F3A04
) },
6656 { VEX_W_TABLE (VEX_W_0F3A05
) },
6657 { VEX_LEN_TABLE (VEX_LEN_0F3A06
) },
6660 { "vroundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6661 { "vroundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6662 { "vroundss", { XMScalar
, VexScalar
, EXd
, Ib
}, PREFIX_DATA
},
6663 { "vroundsd", { XMScalar
, VexScalar
, EXq
, Ib
}, PREFIX_DATA
},
6664 { "vblendps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6665 { "vblendpd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6666 { "vpblendw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6667 { "vpalignr", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6673 { VEX_LEN_TABLE (VEX_LEN_0F3A14
) },
6674 { VEX_LEN_TABLE (VEX_LEN_0F3A15
) },
6675 { VEX_LEN_TABLE (VEX_LEN_0F3A16
) },
6676 { VEX_LEN_TABLE (VEX_LEN_0F3A17
) },
6678 { VEX_LEN_TABLE (VEX_LEN_0F3A18
) },
6679 { VEX_LEN_TABLE (VEX_LEN_0F3A19
) },
6683 { VEX_W_TABLE (VEX_W_0F3A1D
) },
6687 { VEX_LEN_TABLE (VEX_LEN_0F3A20
) },
6688 { VEX_LEN_TABLE (VEX_LEN_0F3A21
) },
6689 { VEX_LEN_TABLE (VEX_LEN_0F3A22
) },
6705 { VEX_LEN_TABLE (VEX_LEN_0F3A30
) },
6706 { VEX_LEN_TABLE (VEX_LEN_0F3A31
) },
6707 { VEX_LEN_TABLE (VEX_LEN_0F3A32
) },
6708 { VEX_LEN_TABLE (VEX_LEN_0F3A33
) },
6714 { VEX_LEN_TABLE (VEX_LEN_0F3A38
) },
6715 { VEX_LEN_TABLE (VEX_LEN_0F3A39
) },
6723 { "vdpps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6724 { VEX_LEN_TABLE (VEX_LEN_0F3A41
) },
6725 { "vmpsadbw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6727 { "vpclmulqdq", { XM
, Vex
, EXx
, PCLMUL
}, PREFIX_DATA
},
6729 { VEX_LEN_TABLE (VEX_LEN_0F3A46
) },
6732 { "vpermil2ps", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6733 { "vpermil2pd", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6734 { VEX_W_TABLE (VEX_W_0F3A4A
) },
6735 { VEX_W_TABLE (VEX_W_0F3A4B
) },
6736 { VEX_W_TABLE (VEX_W_0F3A4C
) },
6754 { "vfmaddsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6755 { "vfmaddsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6756 { "vfmsubaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6757 { "vfmsubaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6759 { VEX_LEN_TABLE (VEX_LEN_0F3A60
) },
6760 { VEX_LEN_TABLE (VEX_LEN_0F3A61
) },
6761 { VEX_LEN_TABLE (VEX_LEN_0F3A62
) },
6762 { VEX_LEN_TABLE (VEX_LEN_0F3A63
) },
6768 { "vfmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6769 { "vfmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6770 { "vfmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6771 { "vfmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6772 { "vfmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6773 { "vfmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6774 { "vfmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6775 { "vfmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6786 { "vfnmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6787 { "vfnmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6788 { "vfnmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6789 { "vfnmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6790 { "vfnmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6791 { "vfnmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6792 { "vfnmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6793 { "vfnmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6882 { VEX_W_TABLE (VEX_W_0F3ACE
) },
6883 { VEX_W_TABLE (VEX_W_0F3ACF
) },
6900 { VEX_W_TABLE (VEX_W_0F3ADE
) },
6901 { VEX_LEN_TABLE (VEX_LEN_0F3ADF
) },
6921 { VEX_LEN_TABLE (VEX_LEN_0F3AF0
) },
6941 #include "i386-dis-evex.h"
6943 static const struct dis386 vex_len_table
[][2] = {
6944 /* VEX_LEN_0F12_P_0 */
6946 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
6949 /* VEX_LEN_0F12_P_2 */
6951 { "%XEVmovlpYX", { XM
, Vex
, Mq
}, 0 },
6956 { "%XEVmovlpYX", { Mq
, XM
}, PREFIX_OPCODE
},
6959 /* VEX_LEN_0F16_P_0 */
6961 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
6964 /* VEX_LEN_0F16_P_2 */
6966 { "%XEVmovhpYX", { XM
, Vex
, Mq
}, 0 },
6971 { "%XEVmovhpYX", { Mq
, XM
}, PREFIX_OPCODE
},
6977 { VEX_W_TABLE (VEX_W_0F41_L_1
) },
6983 { VEX_W_TABLE (VEX_W_0F42_L_1
) },
6988 { VEX_W_TABLE (VEX_W_0F44_L_0
) },
6994 { VEX_W_TABLE (VEX_W_0F45_L_1
) },
7000 { VEX_W_TABLE (VEX_W_0F46_L_1
) },
7006 { VEX_W_TABLE (VEX_W_0F47_L_1
) },
7012 { VEX_W_TABLE (VEX_W_0F4A_L_1
) },
7018 { VEX_W_TABLE (VEX_W_0F4B_L_1
) },
7023 { "%XEvmovYK", { XMScalar
, Edq
}, PREFIX_DATA
},
7028 { "vzeroupper", { XX
}, 0 },
7029 { "vzeroall", { XX
}, 0 },
7032 /* VEX_LEN_0F7E_P_1 */
7034 { "%XEvmovqY", { XMScalar
, EXq
}, 0 },
7037 /* VEX_LEN_0F7E_P_2 */
7039 { "%XEvmovK", { Edq
, XMScalar
}, 0 },
7044 { VEX_W_TABLE (VEX_W_0F90_L_0
) },
7049 { VEX_W_TABLE (VEX_W_0F91_L_0
) },
7054 { VEX_W_TABLE (VEX_W_0F92_L_0
) },
7059 { VEX_W_TABLE (VEX_W_0F93_L_0
) },
7064 { VEX_W_TABLE (VEX_W_0F98_L_0
) },
7069 { VEX_W_TABLE (VEX_W_0F99_L_0
) },
7072 /* VEX_LEN_0FAE_R_2 */
7074 { "vldmxcsr", { Md
}, 0 },
7077 /* VEX_LEN_0FAE_R_3 */
7079 { "vstmxcsr", { Md
}, 0 },
7084 { "%XEvpinsrwY", { XM
, Vex
, Edw
, Ib
}, PREFIX_DATA
},
7089 { "%XEvmovqY", { EXqS
, XMScalar
}, PREFIX_DATA
},
7092 /* VEX_LEN_0F3816 */
7095 { VEX_W_TABLE (VEX_W_0F3816_L_1
) },
7098 /* VEX_LEN_0F3819 */
7101 { VEX_W_TABLE (VEX_W_0F3819_L_1
) },
7104 /* VEX_LEN_0F381A */
7107 { VEX_W_TABLE (VEX_W_0F381A_L_1
) },
7110 /* VEX_LEN_0F3836 */
7113 { VEX_W_TABLE (VEX_W_0F3836
) },
7116 /* VEX_LEN_0F3841 */
7118 { "vphminposuw", { XM
, EXx
}, PREFIX_DATA
},
7121 /* VEX_LEN_0F3849_X86_64 */
7123 { VEX_W_TABLE (VEX_W_0F3849_X86_64_L_0
) },
7126 /* VEX_LEN_0F384B_X86_64 */
7128 { VEX_W_TABLE (VEX_W_0F384B_X86_64_L_0
) },
7131 /* VEX_LEN_0F385A */
7134 { VEX_W_TABLE (VEX_W_0F385A_L_0
) },
7137 /* VEX_LEN_0F385C_X86_64 */
7139 { VEX_W_TABLE (VEX_W_0F385C_X86_64_L_0
) },
7142 /* VEX_LEN_0F385E_X86_64 */
7144 { VEX_W_TABLE (VEX_W_0F385E_X86_64_L_0
) },
7147 /* VEX_LEN_0F386C_X86_64 */
7149 { VEX_W_TABLE (VEX_W_0F386C_X86_64_L_0
) },
7152 /* VEX_LEN_0F38CB_P_3_W_0 */
7155 { "vsha512rnds2", { XM
, Vex
, Rxmmq
}, 0 },
7158 /* VEX_LEN_0F38CC_P_3_W_0 */
7161 { "vsha512msg1", { XM
, Rxmmq
}, 0 },
7164 /* VEX_LEN_0F38CD_P_3_W_0 */
7167 { "vsha512msg2", { XM
, Rymm
}, 0 },
7170 /* VEX_LEN_0F38DA_W_0_P_0 */
7172 { "vsm3msg1", { XM
, Vex
, EXxmm
}, 0 },
7175 /* VEX_LEN_0F38DA_W_0_P_2 */
7177 { "vsm3msg2", { XM
, Vex
, EXxmm
}, 0 },
7180 /* VEX_LEN_0F38DB */
7182 { "vaesimc", { XM
, EXx
}, PREFIX_DATA
},
7185 /* VEX_LEN_0F38F2 */
7187 { PREFIX_TABLE (PREFIX_VEX_0F38F2_L_0
) },
7190 /* VEX_LEN_0F38F3 */
7192 { PREFIX_TABLE (PREFIX_VEX_0F38F3_L_0
) },
7195 /* VEX_LEN_0F38F5 */
7197 { PREFIX_TABLE(PREFIX_VEX_0F38F5_L_0
) },
7200 /* VEX_LEN_0F38F6 */
7202 { PREFIX_TABLE(PREFIX_VEX_0F38F6_L_0
) },
7205 /* VEX_LEN_0F38F7 */
7207 { PREFIX_TABLE(PREFIX_VEX_0F38F7_L_0
) },
7210 /* VEX_LEN_0F3A00 */
7213 { VEX_W_TABLE (VEX_W_0F3A00_L_1
) },
7216 /* VEX_LEN_0F3A01 */
7219 { VEX_W_TABLE (VEX_W_0F3A01_L_1
) },
7222 /* VEX_LEN_0F3A06 */
7225 { VEX_W_TABLE (VEX_W_0F3A06_L_1
) },
7228 /* VEX_LEN_0F3A14 */
7230 { "%XEvpextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
7233 /* VEX_LEN_0F3A15 */
7235 { "%XEvpextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
7238 /* VEX_LEN_0F3A16 */
7240 { "%XEvpextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
7243 /* VEX_LEN_0F3A17 */
7245 { "%XEvextractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
7248 /* VEX_LEN_0F3A18 */
7251 { VEX_W_TABLE (VEX_W_0F3A18_L_1
) },
7254 /* VEX_LEN_0F3A19 */
7257 { VEX_W_TABLE (VEX_W_0F3A19_L_1
) },
7260 /* VEX_LEN_0F3A20 */
7262 { "%XEvpinsrbY", { XM
, Vex
, Edb
, Ib
}, PREFIX_DATA
},
7265 /* VEX_LEN_0F3A21 */
7267 { "%XEvinsertpsY", { XM
, Vex
, EXd
, Ib
}, PREFIX_DATA
},
7270 /* VEX_LEN_0F3A22 */
7272 { "%XEvpinsrYK", { XM
, Vex
, Edq
, Ib
}, PREFIX_DATA
},
7275 /* VEX_LEN_0F3A30 */
7277 { "kshiftr%BW", { MaskG
, MaskR
, Ib
}, PREFIX_DATA
},
7280 /* VEX_LEN_0F3A31 */
7282 { "kshiftr%DQ", { MaskG
, MaskR
, Ib
}, PREFIX_DATA
},
7285 /* VEX_LEN_0F3A32 */
7287 { "kshiftl%BW", { MaskG
, MaskR
, Ib
}, PREFIX_DATA
},
7290 /* VEX_LEN_0F3A33 */
7292 { "kshiftl%DQ", { MaskG
, MaskR
, Ib
}, PREFIX_DATA
},
7295 /* VEX_LEN_0F3A38 */
7298 { VEX_W_TABLE (VEX_W_0F3A38_L_1
) },
7301 /* VEX_LEN_0F3A39 */
7304 { VEX_W_TABLE (VEX_W_0F3A39_L_1
) },
7307 /* VEX_LEN_0F3A41 */
7309 { "vdppd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7312 /* VEX_LEN_0F3A46 */
7315 { VEX_W_TABLE (VEX_W_0F3A46_L_1
) },
7318 /* VEX_LEN_0F3A60 */
7320 { "vpcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7323 /* VEX_LEN_0F3A61 */
7325 { "vpcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7328 /* VEX_LEN_0F3A62 */
7330 { "vpcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7333 /* VEX_LEN_0F3A63 */
7335 { "vpcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7338 /* VEX_LEN_0F3ADE_W_0 */
7340 { "vsm3rnds2", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7343 /* VEX_LEN_0F3ADF */
7345 { "vaeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7348 /* VEX_LEN_0F3AF0 */
7350 { PREFIX_TABLE (PREFIX_VEX_0F3AF0_L_0
) },
7353 /* VEX_LEN_MAP7_F8 */
7355 { VEX_W_TABLE (VEX_W_MAP7_F8_L_0
) },
7358 /* VEX_LEN_XOP_08_85 */
7360 { VEX_W_TABLE (VEX_W_XOP_08_85_L_0
) },
7363 /* VEX_LEN_XOP_08_86 */
7365 { VEX_W_TABLE (VEX_W_XOP_08_86_L_0
) },
7368 /* VEX_LEN_XOP_08_87 */
7370 { VEX_W_TABLE (VEX_W_XOP_08_87_L_0
) },
7373 /* VEX_LEN_XOP_08_8E */
7375 { VEX_W_TABLE (VEX_W_XOP_08_8E_L_0
) },
7378 /* VEX_LEN_XOP_08_8F */
7380 { VEX_W_TABLE (VEX_W_XOP_08_8F_L_0
) },
7383 /* VEX_LEN_XOP_08_95 */
7385 { VEX_W_TABLE (VEX_W_XOP_08_95_L_0
) },
7388 /* VEX_LEN_XOP_08_96 */
7390 { VEX_W_TABLE (VEX_W_XOP_08_96_L_0
) },
7393 /* VEX_LEN_XOP_08_97 */
7395 { VEX_W_TABLE (VEX_W_XOP_08_97_L_0
) },
7398 /* VEX_LEN_XOP_08_9E */
7400 { VEX_W_TABLE (VEX_W_XOP_08_9E_L_0
) },
7403 /* VEX_LEN_XOP_08_9F */
7405 { VEX_W_TABLE (VEX_W_XOP_08_9F_L_0
) },
7408 /* VEX_LEN_XOP_08_A3 */
7410 { "vpperm", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7413 /* VEX_LEN_XOP_08_A6 */
7415 { VEX_W_TABLE (VEX_W_XOP_08_A6_L_0
) },
7418 /* VEX_LEN_XOP_08_B6 */
7420 { VEX_W_TABLE (VEX_W_XOP_08_B6_L_0
) },
7423 /* VEX_LEN_XOP_08_C0 */
7425 { VEX_W_TABLE (VEX_W_XOP_08_C0_L_0
) },
7428 /* VEX_LEN_XOP_08_C1 */
7430 { VEX_W_TABLE (VEX_W_XOP_08_C1_L_0
) },
7433 /* VEX_LEN_XOP_08_C2 */
7435 { VEX_W_TABLE (VEX_W_XOP_08_C2_L_0
) },
7438 /* VEX_LEN_XOP_08_C3 */
7440 { VEX_W_TABLE (VEX_W_XOP_08_C3_L_0
) },
7443 /* VEX_LEN_XOP_08_CC */
7445 { VEX_W_TABLE (VEX_W_XOP_08_CC_L_0
) },
7448 /* VEX_LEN_XOP_08_CD */
7450 { VEX_W_TABLE (VEX_W_XOP_08_CD_L_0
) },
7453 /* VEX_LEN_XOP_08_CE */
7455 { VEX_W_TABLE (VEX_W_XOP_08_CE_L_0
) },
7458 /* VEX_LEN_XOP_08_CF */
7460 { VEX_W_TABLE (VEX_W_XOP_08_CF_L_0
) },
7463 /* VEX_LEN_XOP_08_EC */
7465 { VEX_W_TABLE (VEX_W_XOP_08_EC_L_0
) },
7468 /* VEX_LEN_XOP_08_ED */
7470 { VEX_W_TABLE (VEX_W_XOP_08_ED_L_0
) },
7473 /* VEX_LEN_XOP_08_EE */
7475 { VEX_W_TABLE (VEX_W_XOP_08_EE_L_0
) },
7478 /* VEX_LEN_XOP_08_EF */
7480 { VEX_W_TABLE (VEX_W_XOP_08_EF_L_0
) },
7483 /* VEX_LEN_XOP_09_01 */
7485 { REG_TABLE (REG_XOP_09_01_L_0
) },
7488 /* VEX_LEN_XOP_09_02 */
7490 { REG_TABLE (REG_XOP_09_02_L_0
) },
7493 /* VEX_LEN_XOP_09_12 */
7495 { REG_TABLE (REG_XOP_09_12_L_0
) },
7498 /* VEX_LEN_XOP_09_82_W_0 */
7500 { "vfrczss", { XM
, EXd
}, 0 },
7503 /* VEX_LEN_XOP_09_83_W_0 */
7505 { "vfrczsd", { XM
, EXq
}, 0 },
7508 /* VEX_LEN_XOP_09_90 */
7510 { "vprotb", { XM
, EXx
, VexW
}, 0 },
7513 /* VEX_LEN_XOP_09_91 */
7515 { "vprotw", { XM
, EXx
, VexW
}, 0 },
7518 /* VEX_LEN_XOP_09_92 */
7520 { "vprotd", { XM
, EXx
, VexW
}, 0 },
7523 /* VEX_LEN_XOP_09_93 */
7525 { "vprotq", { XM
, EXx
, VexW
}, 0 },
7528 /* VEX_LEN_XOP_09_94 */
7530 { "vpshlb", { XM
, EXx
, VexW
}, 0 },
7533 /* VEX_LEN_XOP_09_95 */
7535 { "vpshlw", { XM
, EXx
, VexW
}, 0 },
7538 /* VEX_LEN_XOP_09_96 */
7540 { "vpshld", { XM
, EXx
, VexW
}, 0 },
7543 /* VEX_LEN_XOP_09_97 */
7545 { "vpshlq", { XM
, EXx
, VexW
}, 0 },
7548 /* VEX_LEN_XOP_09_98 */
7550 { "vpshab", { XM
, EXx
, VexW
}, 0 },
7553 /* VEX_LEN_XOP_09_99 */
7555 { "vpshaw", { XM
, EXx
, VexW
}, 0 },
7558 /* VEX_LEN_XOP_09_9A */
7560 { "vpshad", { XM
, EXx
, VexW
}, 0 },
7563 /* VEX_LEN_XOP_09_9B */
7565 { "vpshaq", { XM
, EXx
, VexW
}, 0 },
7568 /* VEX_LEN_XOP_09_C1 */
7570 { VEX_W_TABLE (VEX_W_XOP_09_C1_L_0
) },
7573 /* VEX_LEN_XOP_09_C2 */
7575 { VEX_W_TABLE (VEX_W_XOP_09_C2_L_0
) },
7578 /* VEX_LEN_XOP_09_C3 */
7580 { VEX_W_TABLE (VEX_W_XOP_09_C3_L_0
) },
7583 /* VEX_LEN_XOP_09_C6 */
7585 { VEX_W_TABLE (VEX_W_XOP_09_C6_L_0
) },
7588 /* VEX_LEN_XOP_09_C7 */
7590 { VEX_W_TABLE (VEX_W_XOP_09_C7_L_0
) },
7593 /* VEX_LEN_XOP_09_CB */
7595 { VEX_W_TABLE (VEX_W_XOP_09_CB_L_0
) },
7598 /* VEX_LEN_XOP_09_D1 */
7600 { VEX_W_TABLE (VEX_W_XOP_09_D1_L_0
) },
7603 /* VEX_LEN_XOP_09_D2 */
7605 { VEX_W_TABLE (VEX_W_XOP_09_D2_L_0
) },
7608 /* VEX_LEN_XOP_09_D3 */
7610 { VEX_W_TABLE (VEX_W_XOP_09_D3_L_0
) },
7613 /* VEX_LEN_XOP_09_D6 */
7615 { VEX_W_TABLE (VEX_W_XOP_09_D6_L_0
) },
7618 /* VEX_LEN_XOP_09_D7 */
7620 { VEX_W_TABLE (VEX_W_XOP_09_D7_L_0
) },
7623 /* VEX_LEN_XOP_09_DB */
7625 { VEX_W_TABLE (VEX_W_XOP_09_DB_L_0
) },
7628 /* VEX_LEN_XOP_09_E1 */
7630 { VEX_W_TABLE (VEX_W_XOP_09_E1_L_0
) },
7633 /* VEX_LEN_XOP_09_E2 */
7635 { VEX_W_TABLE (VEX_W_XOP_09_E2_L_0
) },
7638 /* VEX_LEN_XOP_09_E3 */
7640 { VEX_W_TABLE (VEX_W_XOP_09_E3_L_0
) },
7643 /* VEX_LEN_XOP_0A_12 */
7645 { REG_TABLE (REG_XOP_0A_12_L_0
) },
7649 #include "i386-dis-evex-len.h"
7651 static const struct dis386 vex_w_table
[][2] = {
7653 /* VEX_W_0F41_L_1_M_1 */
7654 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_W_0
) },
7655 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_W_1
) },
7658 /* VEX_W_0F42_L_1_M_1 */
7659 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_W_0
) },
7660 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_W_1
) },
7663 /* VEX_W_0F44_L_0_M_1 */
7664 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_W_0
) },
7665 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_W_1
) },
7668 /* VEX_W_0F45_L_1_M_1 */
7669 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_W_0
) },
7670 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_W_1
) },
7673 /* VEX_W_0F46_L_1_M_1 */
7674 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_W_0
) },
7675 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_W_1
) },
7678 /* VEX_W_0F47_L_1_M_1 */
7679 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_W_0
) },
7680 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_W_1
) },
7683 /* VEX_W_0F4A_L_1_M_1 */
7684 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_W_0
) },
7685 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_W_1
) },
7688 /* VEX_W_0F4B_L_1_M_1 */
7689 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_W_0
) },
7690 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_W_1
) },
7693 /* VEX_W_0F90_L_0 */
7694 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_0
) },
7695 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_1
) },
7698 /* VEX_W_0F91_L_0_M_0 */
7699 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_W_0
) },
7700 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_W_1
) },
7703 /* VEX_W_0F92_L_0_M_1 */
7704 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_W_0
) },
7705 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_W_1
) },
7708 /* VEX_W_0F93_L_0_M_1 */
7709 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_W_0
) },
7710 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_W_1
) },
7713 /* VEX_W_0F98_L_0_M_1 */
7714 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_W_0
) },
7715 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_W_1
) },
7718 /* VEX_W_0F99_L_0_M_1 */
7719 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_W_0
) },
7720 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_W_1
) },
7724 { "%XEvpermilps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7728 { "vpermilpd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7732 { "vtestps", { XM
, EXx
}, PREFIX_DATA
},
7736 { "vtestpd", { XM
, EXx
}, PREFIX_DATA
},
7740 { "vcvtph2ps", { XM
, EXxmmq
}, PREFIX_DATA
},
7743 /* VEX_W_0F3816_L_1 */
7744 { "vpermps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7748 { "%XEvbroadcastss", { XM
, EXd
}, PREFIX_DATA
},
7751 /* VEX_W_0F3819_L_1 */
7752 { "vbroadcastsd", { XM
, EXq
}, PREFIX_DATA
},
7755 /* VEX_W_0F381A_L_1 */
7756 { "vbroadcastf128", { XM
, Mxmm
}, PREFIX_DATA
},
7760 { "vmaskmovps", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7764 { "vmaskmovpd", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7768 { "vmaskmovps", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7772 { "vmaskmovpd", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7776 { "vpermd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7780 { "vpsravd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7783 /* VEX_W_0F3849_X86_64_L_0 */
7784 { MOD_TABLE (MOD_VEX_0F3849_X86_64_L_0_W_0
) },
7787 /* VEX_W_0F384B_X86_64_L_0 */
7788 { PREFIX_TABLE (PREFIX_VEX_0F384B_X86_64_L_0_W_0
) },
7792 { PREFIX_TABLE (PREFIX_VEX_0F3850_W_0
) },
7796 { PREFIX_TABLE (PREFIX_VEX_0F3851_W_0
) },
7800 { "%XVvpdpwssd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7804 { "%XVvpdpwssds", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7808 { "%XEvpbroadcastd", { XM
, EXd
}, PREFIX_DATA
},
7812 { "vpbroadcastq", { XM
, EXq
}, PREFIX_DATA
},
7815 /* VEX_W_0F385A_L_0 */
7816 { "vbroadcasti128", { XM
, Mxmm
}, PREFIX_DATA
},
7819 /* VEX_W_0F385C_X86_64_L_0 */
7820 { PREFIX_TABLE (PREFIX_VEX_0F385C_X86_64_L_0_W_0
) },
7823 /* VEX_W_0F385E_X86_64_L_0 */
7824 { PREFIX_TABLE (PREFIX_VEX_0F385E_X86_64_L_0_W_0
) },
7827 /* VEX_W_0F386C_X86_64_L_0 */
7828 { PREFIX_TABLE (PREFIX_VEX_0F386C_X86_64_L_0_W_0
) },
7831 /* VEX_W_0F3872_P_1 */
7832 { "%XVvcvtneps2bf16%XY", { XMM
, EXx
}, 0 },
7836 { "%XEvpbroadcastb", { XM
, EXb
}, PREFIX_DATA
},
7840 { "%XEvpbroadcastw", { XM
, EXw
}, PREFIX_DATA
},
7844 { PREFIX_TABLE (PREFIX_VEX_0F38B0_W_0
) },
7848 { PREFIX_TABLE (PREFIX_VEX_0F38B1_W_0
) },
7853 { "%XVvpmadd52luq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7858 { "%XVvpmadd52huq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7861 /* VEX_W_0F38CB_P_3 */
7862 { VEX_LEN_TABLE (VEX_LEN_0F38CB_P_3_W_0
) },
7865 /* VEX_W_0F38CC_P_3 */
7866 { VEX_LEN_TABLE (VEX_LEN_0F38CC_P_3_W_0
) },
7869 /* VEX_W_0F38CD_P_3 */
7870 { VEX_LEN_TABLE (VEX_LEN_0F38CD_P_3_W_0
) },
7874 { "%XEvgf2p8mulb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7878 { PREFIX_TABLE (PREFIX_VEX_0F38D2_W_0
) },
7882 { PREFIX_TABLE (PREFIX_VEX_0F38D3_W_0
) },
7886 { PREFIX_TABLE (PREFIX_VEX_0F38DA_W_0
) },
7889 /* VEX_W_0F3A00_L_1 */
7891 { "%XEvpermq", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7894 /* VEX_W_0F3A01_L_1 */
7896 { "%XEvpermpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7900 { "vpblendd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7904 { "%XEvpermilps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7908 { "vpermilpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7911 /* VEX_W_0F3A06_L_1 */
7912 { "vperm2f128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7915 /* VEX_W_0F3A18_L_1 */
7916 { "vinsertf128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7919 /* VEX_W_0F3A19_L_1 */
7920 { "vextractf128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7924 { "%XEvcvtps2ph", { EXxmmq
, XM
, EXxEVexS
, Ib
}, PREFIX_DATA
},
7927 /* VEX_W_0F3A38_L_1 */
7928 { "vinserti128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7931 /* VEX_W_0F3A39_L_1 */
7932 { "vextracti128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7935 /* VEX_W_0F3A46_L_1 */
7936 { "vperm2i128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7940 { "vblendvps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7944 { "vblendvpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7948 { "vpblendvb", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7953 { "%XEvgf2p8affineqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7958 { "%XEvgf2p8affineinvqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7962 { VEX_LEN_TABLE (VEX_LEN_0F3ADE_W_0
) },
7965 /* VEX_W_MAP7_F8_L_0 */
7966 { REG_TABLE (REG_VEX_MAP7_F8_L_0_W_0
) },
7968 /* VEX_W_XOP_08_85_L_0 */
7970 { "vpmacssww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7972 /* VEX_W_XOP_08_86_L_0 */
7974 { "vpmacsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7976 /* VEX_W_XOP_08_87_L_0 */
7978 { "vpmacssdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7980 /* VEX_W_XOP_08_8E_L_0 */
7982 { "vpmacssdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7984 /* VEX_W_XOP_08_8F_L_0 */
7986 { "vpmacssdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7988 /* VEX_W_XOP_08_95_L_0 */
7990 { "vpmacsww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7992 /* VEX_W_XOP_08_96_L_0 */
7994 { "vpmacswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7996 /* VEX_W_XOP_08_97_L_0 */
7998 { "vpmacsdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8000 /* VEX_W_XOP_08_9E_L_0 */
8002 { "vpmacsdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8004 /* VEX_W_XOP_08_9F_L_0 */
8006 { "vpmacsdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8008 /* VEX_W_XOP_08_A6_L_0 */
8010 { "vpmadcsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8012 /* VEX_W_XOP_08_B6_L_0 */
8014 { "vpmadcswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
8016 /* VEX_W_XOP_08_C0_L_0 */
8018 { "vprotb", { XM
, EXx
, Ib
}, 0 },
8020 /* VEX_W_XOP_08_C1_L_0 */
8022 { "vprotw", { XM
, EXx
, Ib
}, 0 },
8024 /* VEX_W_XOP_08_C2_L_0 */
8026 { "vprotd", { XM
, EXx
, Ib
}, 0 },
8028 /* VEX_W_XOP_08_C3_L_0 */
8030 { "vprotq", { XM
, EXx
, Ib
}, 0 },
8032 /* VEX_W_XOP_08_CC_L_0 */
8034 { "vpcomb", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8036 /* VEX_W_XOP_08_CD_L_0 */
8038 { "vpcomw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8040 /* VEX_W_XOP_08_CE_L_0 */
8042 { "vpcomd", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8044 /* VEX_W_XOP_08_CF_L_0 */
8046 { "vpcomq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8048 /* VEX_W_XOP_08_EC_L_0 */
8050 { "vpcomub", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8052 /* VEX_W_XOP_08_ED_L_0 */
8054 { "vpcomuw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8056 /* VEX_W_XOP_08_EE_L_0 */
8058 { "vpcomud", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8060 /* VEX_W_XOP_08_EF_L_0 */
8062 { "vpcomuq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
8064 /* VEX_W_XOP_09_80 */
8066 { "vfrczps", { XM
, EXx
}, 0 },
8068 /* VEX_W_XOP_09_81 */
8070 { "vfrczpd", { XM
, EXx
}, 0 },
8072 /* VEX_W_XOP_09_82 */
8074 { VEX_LEN_TABLE (VEX_LEN_XOP_09_82_W_0
) },
8076 /* VEX_W_XOP_09_83 */
8078 { VEX_LEN_TABLE (VEX_LEN_XOP_09_83_W_0
) },
8080 /* VEX_W_XOP_09_C1_L_0 */
8082 { "vphaddbw", { XM
, EXxmm
}, 0 },
8084 /* VEX_W_XOP_09_C2_L_0 */
8086 { "vphaddbd", { XM
, EXxmm
}, 0 },
8088 /* VEX_W_XOP_09_C3_L_0 */
8090 { "vphaddbq", { XM
, EXxmm
}, 0 },
8092 /* VEX_W_XOP_09_C6_L_0 */
8094 { "vphaddwd", { XM
, EXxmm
}, 0 },
8096 /* VEX_W_XOP_09_C7_L_0 */
8098 { "vphaddwq", { XM
, EXxmm
}, 0 },
8100 /* VEX_W_XOP_09_CB_L_0 */
8102 { "vphadddq", { XM
, EXxmm
}, 0 },
8104 /* VEX_W_XOP_09_D1_L_0 */
8106 { "vphaddubw", { XM
, EXxmm
}, 0 },
8108 /* VEX_W_XOP_09_D2_L_0 */
8110 { "vphaddubd", { XM
, EXxmm
}, 0 },
8112 /* VEX_W_XOP_09_D3_L_0 */
8114 { "vphaddubq", { XM
, EXxmm
}, 0 },
8116 /* VEX_W_XOP_09_D6_L_0 */
8118 { "vphadduwd", { XM
, EXxmm
}, 0 },
8120 /* VEX_W_XOP_09_D7_L_0 */
8122 { "vphadduwq", { XM
, EXxmm
}, 0 },
8124 /* VEX_W_XOP_09_DB_L_0 */
8126 { "vphaddudq", { XM
, EXxmm
}, 0 },
8128 /* VEX_W_XOP_09_E1_L_0 */
8130 { "vphsubbw", { XM
, EXxmm
}, 0 },
8132 /* VEX_W_XOP_09_E2_L_0 */
8134 { "vphsubwd", { XM
, EXxmm
}, 0 },
8136 /* VEX_W_XOP_09_E3_L_0 */
8138 { "vphsubdq", { XM
, EXxmm
}, 0 },
8141 #include "i386-dis-evex-w.h"
8144 static const struct dis386 mod_table
[][2] = {
8147 { "bound{S|}", { Gv
, Ma
}, 0 },
8152 { "lesS", { Gv
, Mp
}, 0 },
8153 { VEX_C4_TABLE () },
8157 { "ldsS", { Gv
, Mp
}, 0 },
8158 { VEX_C5_TABLE () },
8161 /* MOD_0F01_REG_0 */
8162 { X86_64_TABLE (X86_64_0F01_REG_0
) },
8163 { RM_TABLE (RM_0F01_REG_0
) },
8166 /* MOD_0F01_REG_1 */
8167 { X86_64_TABLE (X86_64_0F01_REG_1
) },
8168 { RM_TABLE (RM_0F01_REG_1
) },
8171 /* MOD_0F01_REG_2 */
8172 { X86_64_TABLE (X86_64_0F01_REG_2
) },
8173 { RM_TABLE (RM_0F01_REG_2
) },
8176 /* MOD_0F01_REG_3 */
8177 { X86_64_TABLE (X86_64_0F01_REG_3
) },
8178 { RM_TABLE (RM_0F01_REG_3
) },
8181 /* MOD_0F01_REG_5 */
8182 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_0
) },
8183 { RM_TABLE (RM_0F01_REG_5_MOD_3
) },
8186 /* MOD_0F01_REG_7 */
8187 { "invlpg", { Mb
}, 0 },
8188 { RM_TABLE (RM_0F01_REG_7_MOD_3
) },
8191 /* MOD_0F12_PREFIX_0 */
8192 { "%XEVmovlpYX", { XM
, Vex
, EXq
}, 0 },
8193 { "%XEVmovhlpY%XS", { XM
, Vex
, EXq
}, 0 },
8196 /* MOD_0F16_PREFIX_0 */
8197 { "%XEVmovhpYX", { XM
, Vex
, EXq
}, 0 },
8198 { "%XEVmovlhpY%XS", { XM
, Vex
, EXq
}, 0 },
8201 /* MOD_0F18_REG_0 */
8202 { "prefetchnta", { Mb
}, 0 },
8203 { "nopQ", { Ev
}, 0 },
8206 /* MOD_0F18_REG_1 */
8207 { "prefetcht0", { Mb
}, 0 },
8208 { "nopQ", { Ev
}, 0 },
8211 /* MOD_0F18_REG_2 */
8212 { "prefetcht1", { Mb
}, 0 },
8213 { "nopQ", { Ev
}, 0 },
8216 /* MOD_0F18_REG_3 */
8217 { "prefetcht2", { Mb
}, 0 },
8218 { "nopQ", { Ev
}, 0 },
8221 /* MOD_0F18_REG_6 */
8222 { X86_64_TABLE (X86_64_0F18_REG_6_MOD_0
) },
8223 { "nopQ", { Ev
}, 0 },
8226 /* MOD_0F18_REG_7 */
8227 { X86_64_TABLE (X86_64_0F18_REG_7_MOD_0
) },
8228 { "nopQ", { Ev
}, 0 },
8231 /* MOD_0F1A_PREFIX_0 */
8232 { "bndldx", { Gbnd
, Mv_bnd
}, 0 },
8233 { "nopQ", { Ev
}, 0 },
8236 /* MOD_0F1B_PREFIX_0 */
8237 { "bndstx", { Mv_bnd
, Gbnd
}, 0 },
8238 { "nopQ", { Ev
}, 0 },
8241 /* MOD_0F1B_PREFIX_1 */
8242 { "bndmk", { Gbnd
, Mv_bnd
}, 0 },
8243 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8246 /* MOD_0F1C_PREFIX_0 */
8247 { REG_TABLE (REG_0F1C_P_0_MOD_0
) },
8248 { "nopQ", { Ev
}, 0 },
8251 /* MOD_0F1E_PREFIX_1 */
8252 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8253 { REG_TABLE (REG_0F1E_P_1_MOD_3
) },
8256 /* MOD_0FAE_REG_0 */
8257 { "fxsave", { FXSAVE
}, 0 },
8258 { PREFIX_TABLE (PREFIX_0FAE_REG_0_MOD_3
) },
8261 /* MOD_0FAE_REG_1 */
8262 { "fxrstor", { FXSAVE
}, 0 },
8263 { PREFIX_TABLE (PREFIX_0FAE_REG_1_MOD_3
) },
8266 /* MOD_0FAE_REG_2 */
8267 { "ldmxcsr", { Md
}, 0 },
8268 { PREFIX_TABLE (PREFIX_0FAE_REG_2_MOD_3
) },
8271 /* MOD_0FAE_REG_3 */
8272 { "stmxcsr", { Md
}, 0 },
8273 { PREFIX_TABLE (PREFIX_0FAE_REG_3_MOD_3
) },
8276 /* MOD_0FAE_REG_4 */
8277 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_0
) },
8278 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_3
) },
8281 /* MOD_0FAE_REG_5 */
8282 { "xrstor", { FXSAVE
}, PREFIX_OPCODE
| PREFIX_REX2_ILLEGAL
},
8283 { PREFIX_TABLE (PREFIX_0FAE_REG_5_MOD_3
) },
8286 /* MOD_0FAE_REG_6 */
8287 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_0
) },
8288 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_3
) },
8291 /* MOD_0FAE_REG_7 */
8292 { PREFIX_TABLE (PREFIX_0FAE_REG_7_MOD_0
) },
8293 { RM_TABLE (RM_0FAE_REG_7_MOD_3
) },
8296 /* MOD_0FC7_REG_6 */
8297 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_0
) },
8298 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_3
) }
8301 /* MOD_0FC7_REG_7 */
8302 { "vmptrst", { Mq
}, 0 },
8303 { PREFIX_TABLE (PREFIX_0FC7_REG_7_MOD_3
) }
8306 /* MOD_0F38DC_PREFIX_1 */
8307 { "aesenc128kl", { XM
, M
}, 0 },
8308 { "loadiwkey", { XM
, EXx
}, 0 },
8312 { PREFIX_TABLE (PREFIX_0F38F8_M_0
) },
8313 { X86_64_TABLE (X86_64_0F38F8_M_1
) },
8316 /* MOD_VEX_0F3849_X86_64_L_0_W_0 */
8317 { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_0
) },
8318 { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64_L_0_W_0_M_1
) },
8321 #include "i386-dis-evex-mod.h"
8324 static const struct dis386 rm_table
[][8] = {
8327 { "xabort", { Skip_MODRM
, Ib
}, 0 },
8331 { "xbeginT", { Skip_MODRM
, Jdqw
}, 0 },
8335 { "enclv", { Skip_MODRM
}, 0 },
8336 { "vmcall", { Skip_MODRM
}, 0 },
8337 { "vmlaunch", { Skip_MODRM
}, 0 },
8338 { "vmresume", { Skip_MODRM
}, 0 },
8339 { "vmxoff", { Skip_MODRM
}, 0 },
8340 { "pconfig", { Skip_MODRM
}, 0 },
8341 { PREFIX_TABLE (PREFIX_0F01_REG_0_MOD_3_RM_6
) },
8342 { PREFIX_TABLE (PREFIX_0F01_REG_0_MOD_3_RM_7
) },
8346 { "monitor", { { OP_Monitor
, 0 } }, 0 },
8347 { "mwait", { { OP_Mwait
, 0 } }, 0 },
8348 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_2
) },
8349 { "stac", { Skip_MODRM
}, 0 },
8350 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_4
) },
8351 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_5
) },
8352 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_6
) },
8353 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_7
) },
8357 { "xgetbv", { Skip_MODRM
}, 0 },
8358 { "xsetbv", { Skip_MODRM
}, 0 },
8361 { "vmfunc", { Skip_MODRM
}, 0 },
8362 { "xend", { Skip_MODRM
}, 0 },
8363 { "xtest", { Skip_MODRM
}, 0 },
8364 { "enclu", { Skip_MODRM
}, 0 },
8368 { "vmrun", { Skip_MODRM
}, 0 },
8369 { PREFIX_TABLE (PREFIX_0F01_REG_3_RM_1
) },
8370 { "vmload", { Skip_MODRM
}, 0 },
8371 { "vmsave", { Skip_MODRM
}, 0 },
8372 { "stgi", { Skip_MODRM
}, 0 },
8373 { "clgi", { Skip_MODRM
}, 0 },
8374 { "skinit", { Skip_MODRM
}, 0 },
8375 { "invlpga", { Skip_MODRM
}, 0 },
8378 /* RM_0F01_REG_5_MOD_3 */
8379 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_0
) },
8380 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_1
) },
8381 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_2
) },
8383 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_4
) },
8384 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_5
) },
8385 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_6
) },
8386 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_7
) },
8389 /* RM_0F01_REG_7_MOD_3 */
8390 { "swapgs", { Skip_MODRM
}, 0 },
8391 { "rdtscp", { Skip_MODRM
}, 0 },
8392 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_2
) },
8393 { "mwaitx", { { OP_Mwait
, eBX_reg
} }, PREFIX_OPCODE
},
8394 { "clzero", { Skip_MODRM
}, 0 },
8395 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_5
) },
8396 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_6
) },
8397 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_7
) },
8400 /* RM_0F1E_P_1_MOD_3_REG_7 */
8401 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8402 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8403 { "endbr64", { Skip_MODRM
}, 0 },
8404 { "endbr32", { Skip_MODRM
}, 0 },
8405 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8406 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8407 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8408 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8411 /* RM_0FAE_REG_6_MOD_3 */
8412 { "mfence", { Skip_MODRM
}, 0 },
8415 /* RM_0FAE_REG_7_MOD_3 */
8416 { "sfence", { Skip_MODRM
}, 0 },
8419 /* RM_0F3A0F_P_1_R_0 */
8420 { "hreset", { Skip_MODRM
, Ib
}, 0 },
8423 /* RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_0_R_0 */
8424 { "tilerelease", { Skip_MODRM
}, 0 },
8427 /* RM_VEX_0F3849_X86_64_L_0_W_0_M_1_P_3 */
8428 { "tilezero", { TMM
, Skip_MODRM
}, 0 },
8432 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
8434 /* The values used here must be non-zero, fit in 'unsigned char', and not be
8435 in conflict with actual prefix opcodes. */
8436 #define REP_PREFIX 0x01
8437 #define XACQUIRE_PREFIX 0x02
8438 #define XRELEASE_PREFIX 0x03
8439 #define BND_PREFIX 0x04
8440 #define NOTRACK_PREFIX 0x05
8447 ckprefix (instr_info
*ins
)
8454 /* The maximum instruction length is 15bytes. */
8455 while (length
< MAX_CODE_LENGTH
- 1)
8457 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
8458 return ckp_fetch_error
;
8460 switch (*ins
->codep
)
8462 /* REX prefixes family. */
8479 if (ins
->address_mode
== mode_64bit
)
8480 newrex
= *ins
->codep
;
8483 ins
->last_rex_prefix
= i
;
8485 /* REX2 must be the last prefix. */
8487 if (ins
->address_mode
== mode_64bit
)
8489 if (ins
->last_rex_prefix
>= 0)
8493 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
8494 return ckp_fetch_error
;
8495 ins
->rex2_payload
= *ins
->codep
;
8496 ins
->rex2
= ins
->rex2_payload
>> 4;
8497 ins
->rex
= (ins
->rex2_payload
& 0xf) | REX_OPCODE
;
8499 ins
->last_rex2_prefix
= i
;
8500 ins
->all_prefixes
[i
] = REX2_OPCODE
;
8504 ins
->prefixes
|= PREFIX_REPZ
;
8505 ins
->last_repz_prefix
= i
;
8508 ins
->prefixes
|= PREFIX_REPNZ
;
8509 ins
->last_repnz_prefix
= i
;
8512 ins
->prefixes
|= PREFIX_LOCK
;
8513 ins
->last_lock_prefix
= i
;
8516 ins
->prefixes
|= PREFIX_CS
;
8517 ins
->last_seg_prefix
= i
;
8518 if (ins
->address_mode
!= mode_64bit
)
8519 ins
->active_seg_prefix
= PREFIX_CS
;
8522 ins
->prefixes
|= PREFIX_SS
;
8523 ins
->last_seg_prefix
= i
;
8524 if (ins
->address_mode
!= mode_64bit
)
8525 ins
->active_seg_prefix
= PREFIX_SS
;
8528 ins
->prefixes
|= PREFIX_DS
;
8529 ins
->last_seg_prefix
= i
;
8530 if (ins
->address_mode
!= mode_64bit
)
8531 ins
->active_seg_prefix
= PREFIX_DS
;
8534 ins
->prefixes
|= PREFIX_ES
;
8535 ins
->last_seg_prefix
= i
;
8536 if (ins
->address_mode
!= mode_64bit
)
8537 ins
->active_seg_prefix
= PREFIX_ES
;
8540 ins
->prefixes
|= PREFIX_FS
;
8541 ins
->last_seg_prefix
= i
;
8542 ins
->active_seg_prefix
= PREFIX_FS
;
8545 ins
->prefixes
|= PREFIX_GS
;
8546 ins
->last_seg_prefix
= i
;
8547 ins
->active_seg_prefix
= PREFIX_GS
;
8550 ins
->prefixes
|= PREFIX_DATA
;
8551 ins
->last_data_prefix
= i
;
8554 ins
->prefixes
|= PREFIX_ADDR
;
8555 ins
->last_addr_prefix
= i
;
8558 /* fwait is really an instruction. If there are prefixes
8559 before the fwait, they belong to the fwait, *not* to the
8560 following instruction. */
8561 ins
->fwait_prefix
= i
;
8562 if (ins
->prefixes
|| ins
->rex
)
8564 ins
->prefixes
|= PREFIX_FWAIT
;
8566 /* This ensures that the previous REX prefixes are noticed
8567 as unused prefixes, as in the return case below. */
8568 return ins
->rex
? ckp_bogus
: ckp_okay
;
8570 ins
->prefixes
= PREFIX_FWAIT
;
8575 /* Rex is ignored when followed by another prefix. */
8578 if (*ins
->codep
!= FWAIT_OPCODE
)
8579 ins
->all_prefixes
[i
++] = *ins
->codep
;
8587 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
8591 prefix_name (enum address_mode mode
, uint8_t pref
, int sizeflag
)
8593 static const char *rexes
[16] =
8598 "rex.XB", /* 0x43 */
8600 "rex.RB", /* 0x45 */
8601 "rex.RX", /* 0x46 */
8602 "rex.RXB", /* 0x47 */
8604 "rex.WB", /* 0x49 */
8605 "rex.WX", /* 0x4a */
8606 "rex.WXB", /* 0x4b */
8607 "rex.WR", /* 0x4c */
8608 "rex.WRB", /* 0x4d */
8609 "rex.WRX", /* 0x4e */
8610 "rex.WRXB", /* 0x4f */
8615 /* REX prefixes family. */
8632 return rexes
[pref
- 0x40];
8652 return (sizeflag
& DFLAG
) ? "data16" : "data32";
8654 if (mode
== mode_64bit
)
8655 return (sizeflag
& AFLAG
) ? "addr32" : "addr64";
8657 return (sizeflag
& AFLAG
) ? "addr16" : "addr32";
8662 case XACQUIRE_PREFIX
:
8664 case XRELEASE_PREFIX
:
8668 case NOTRACK_PREFIX
:
8678 print_i386_disassembler_options (FILE *stream
)
8680 fprintf (stream
, _("\n\
8681 The following i386/x86-64 specific disassembler options are supported for use\n\
8682 with the -M switch (multiple options should be separated by commas):\n"));
8684 fprintf (stream
, _(" x86-64 Disassemble in 64bit mode\n"));
8685 fprintf (stream
, _(" i386 Disassemble in 32bit mode\n"));
8686 fprintf (stream
, _(" i8086 Disassemble in 16bit mode\n"));
8687 fprintf (stream
, _(" att Display instruction in AT&T syntax\n"));
8688 fprintf (stream
, _(" intel Display instruction in Intel syntax\n"));
8689 fprintf (stream
, _(" att-mnemonic (AT&T syntax only)\n"
8690 " Display instruction with AT&T mnemonic\n"));
8691 fprintf (stream
, _(" intel-mnemonic (AT&T syntax only)\n"
8692 " Display instruction with Intel mnemonic\n"));
8693 fprintf (stream
, _(" addr64 Assume 64bit address size\n"));
8694 fprintf (stream
, _(" addr32 Assume 32bit address size\n"));
8695 fprintf (stream
, _(" addr16 Assume 16bit address size\n"));
8696 fprintf (stream
, _(" data32 Assume 32bit data size\n"));
8697 fprintf (stream
, _(" data16 Assume 16bit data size\n"));
8698 fprintf (stream
, _(" suffix Always display instruction suffix in AT&T syntax\n"));
8699 fprintf (stream
, _(" amd64 Display instruction in AMD64 ISA\n"));
8700 fprintf (stream
, _(" intel64 Display instruction in Intel64 ISA\n"));
8704 static const struct dis386 bad_opcode
= { "(bad)", { XX
}, 0 };
8706 /* Fetch error indicator. */
8707 static const struct dis386 err_opcode
= { NULL
, { XX
}, 0 };
8709 static const struct dis386 map7_f8_opcode
= { VEX_LEN_TABLE (VEX_LEN_MAP7_F8
) };
8711 /* Get a pointer to struct dis386 with a valid name. */
8713 static const struct dis386
*
8714 get_valid_dis386 (const struct dis386
*dp
, instr_info
*ins
)
8716 int vindex
, vex_table_index
;
8718 if (dp
->name
!= NULL
)
8721 switch (dp
->op
[0].bytemode
)
8724 dp
= ®_table
[dp
->op
[1].bytemode
][ins
->modrm
.reg
];
8728 vindex
= ins
->modrm
.mod
== 0x3 ? 1 : 0;
8729 dp
= &mod_table
[dp
->op
[1].bytemode
][vindex
];
8733 dp
= &rm_table
[dp
->op
[1].bytemode
][ins
->modrm
.rm
];
8736 case USE_PREFIX_TABLE
:
8739 /* The prefix in VEX is implicit. */
8740 switch (ins
->vex
.prefix
)
8745 case REPE_PREFIX_OPCODE
:
8748 case DATA_PREFIX_OPCODE
:
8751 case REPNE_PREFIX_OPCODE
:
8761 int last_prefix
= -1;
8764 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
8765 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
8767 if ((ins
->prefixes
& (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
8769 if (ins
->last_repz_prefix
> ins
->last_repnz_prefix
)
8772 prefix
= PREFIX_REPZ
;
8773 last_prefix
= ins
->last_repz_prefix
;
8778 prefix
= PREFIX_REPNZ
;
8779 last_prefix
= ins
->last_repnz_prefix
;
8782 /* Check if prefix should be ignored. */
8783 if ((((prefix_table
[dp
->op
[1].bytemode
][vindex
].prefix_requirement
8784 & PREFIX_IGNORED
) >> PREFIX_IGNORED_SHIFT
)
8786 && !prefix_table
[dp
->op
[1].bytemode
][vindex
].name
)
8790 if (vindex
== 0 && (ins
->prefixes
& PREFIX_DATA
) != 0)
8793 prefix
= PREFIX_DATA
;
8794 last_prefix
= ins
->last_data_prefix
;
8799 ins
->used_prefixes
|= prefix
;
8800 ins
->all_prefixes
[last_prefix
] = 0;
8803 dp
= &prefix_table
[dp
->op
[1].bytemode
][vindex
];
8806 case USE_X86_64_EVEX_FROM_VEX_TABLE
:
8807 ins
->evex_type
= evex_from_vex
;
8808 /* EVEX from VEX instrucions require that EVEX.z, EVEX.L’L, EVEX.b and
8809 the lower 2 bits of EVEX.aaa must be 0. */
8810 if ((ins
->vex
.mask_register_specifier
& 0x3) != 0
8812 || ins
->vex
.zeroing
!= 0
8817 case USE_X86_64_TABLE
:
8818 vindex
= ins
->address_mode
== mode_64bit
? 1 : 0;
8819 dp
= &x86_64_table
[dp
->op
[1].bytemode
][vindex
];
8822 case USE_3BYTE_TABLE
:
8823 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
8825 vindex
= *ins
->codep
++;
8826 dp
= &three_byte_table
[dp
->op
[1].bytemode
][vindex
];
8827 ins
->end_codep
= ins
->codep
;
8828 if (!fetch_modrm (ins
))
8832 case USE_VEX_LEN_TABLE
:
8836 switch (ins
->vex
.length
)
8842 /* This allows re-using in particular table entries where only
8843 128-bit operand size (VEX.L=0 / EVEX.L'L=0) are valid. */
8856 dp
= &vex_len_table
[dp
->op
[1].bytemode
][vindex
];
8859 case USE_EVEX_LEN_TABLE
:
8863 switch (ins
->vex
.length
)
8879 dp
= &evex_len_table
[dp
->op
[1].bytemode
][vindex
];
8882 case USE_XOP_8F_TABLE
:
8883 if (!fetch_code (ins
->info
, ins
->codep
+ 3))
8885 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
8887 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
8888 switch ((*ins
->codep
& 0x1f))
8894 vex_table_index
= XOP_08
;
8897 vex_table_index
= XOP_09
;
8900 vex_table_index
= XOP_0A
;
8904 ins
->vex
.w
= *ins
->codep
& 0x80;
8905 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
8908 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
8909 if (ins
->address_mode
!= mode_64bit
)
8911 /* In 16/32-bit mode REX_B is silently ignored. */
8915 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
8916 switch ((*ins
->codep
& 0x3))
8921 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
8924 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
8927 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
8932 vindex
= *ins
->codep
++;
8933 dp
= &xop_table
[vex_table_index
][vindex
];
8935 ins
->end_codep
= ins
->codep
;
8936 if (!fetch_modrm (ins
))
8939 /* No XOP encoding so far allows for a non-zero embedded prefix. Avoid
8940 having to decode the bits for every otherwise valid encoding. */
8941 if (ins
->vex
.prefix
)
8945 case USE_VEX_C4_TABLE
:
8947 if (!fetch_code (ins
->info
, ins
->codep
+ 3))
8949 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
8950 switch ((*ins
->codep
& 0x1f))
8956 vex_table_index
= VEX_0F
;
8959 vex_table_index
= VEX_0F38
;
8962 vex_table_index
= VEX_0F3A
;
8965 vex_table_index
= VEX_MAP7
;
8969 ins
->vex
.w
= *ins
->codep
& 0x80;
8970 if (ins
->address_mode
== mode_64bit
)
8977 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
8978 is ignored, other REX bits are 0 and the highest bit in
8979 VEX.vvvv is also ignored (but we mustn't clear it here). */
8982 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
8983 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
8984 switch ((*ins
->codep
& 0x3))
8989 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
8992 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
8995 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9000 vindex
= *ins
->codep
++;
9001 if (vex_table_index
!= VEX_MAP7
)
9002 dp
= &vex_table
[vex_table_index
][vindex
];
9003 else if (vindex
== 0xf8)
9004 dp
= &map7_f8_opcode
;
9007 ins
->end_codep
= ins
->codep
;
9008 /* There is no MODRM byte for VEX0F 77. */
9009 if ((vex_table_index
!= VEX_0F
|| vindex
!= 0x77)
9010 && !fetch_modrm (ins
))
9014 case USE_VEX_C5_TABLE
:
9016 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
9018 ins
->rex
= (*ins
->codep
& 0x80) ? 0 : REX_R
;
9020 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
9022 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9023 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9024 switch ((*ins
->codep
& 0x3))
9029 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9032 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9035 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9040 vindex
= *ins
->codep
++;
9041 dp
= &vex_table
[VEX_0F
][vindex
];
9042 ins
->end_codep
= ins
->codep
;
9043 /* There is no MODRM byte for VEX 77. */
9044 if (vindex
!= 0x77 && !fetch_modrm (ins
))
9048 case USE_VEX_W_TABLE
:
9052 dp
= &vex_w_table
[dp
->op
[1].bytemode
][ins
->vex
.w
];
9055 case USE_EVEX_TABLE
:
9056 ins
->two_source_ops
= false;
9058 ins
->vex
.evex
= true;
9059 if (!fetch_code (ins
->info
, ins
->codep
+ 4))
9061 /* The first byte after 0x62. */
9062 if (*ins
->codep
& 0x8)
9064 if (!(*ins
->codep
& 0x10))
9067 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9068 switch (*ins
->codep
& 0x7)
9073 vex_table_index
= EVEX_0F
;
9076 vex_table_index
= EVEX_0F38
;
9079 vex_table_index
= EVEX_0F3A
;
9082 vex_table_index
= EVEX_MAP4
;
9083 ins
->evex_type
= evex_from_legacy
;
9084 if (ins
->address_mode
!= mode_64bit
)
9088 vex_table_index
= EVEX_MAP5
;
9091 vex_table_index
= EVEX_MAP6
;
9095 /* The second byte after 0x62. */
9097 ins
->vex
.w
= *ins
->codep
& 0x80;
9098 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9101 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9103 if (!(*ins
->codep
& 0x4))
9106 switch ((*ins
->codep
& 0x3))
9111 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9114 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9117 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9121 /* The third byte after 0x62. */
9124 /* Remember the static rounding bits. */
9125 ins
->vex
.ll
= (*ins
->codep
>> 5) & 3;
9126 ins
->vex
.b
= *ins
->codep
& 0x10;
9128 ins
->vex
.v
= *ins
->codep
& 0x8;
9129 ins
->vex
.mask_register_specifier
= *ins
->codep
& 0x7;
9130 ins
->vex
.zeroing
= *ins
->codep
& 0x80;
9132 if (ins
->address_mode
!= mode_64bit
)
9134 /* Report bad for !evex_default and when two fixed values of evex
9136 if (ins
->evex_type
!= evex_default
9137 || (ins
->rex2
& (REX_B
| REX_X
)))
9139 /* In 16/32-bit mode silently ignore following bits. */
9141 ins
->rex2
&= ~REX_R
;
9144 /* EVEX from legacy instructions, when the EVEX.ND bit is 0,
9145 all bits of EVEX.vvvv and EVEX.V' must be 1. */
9146 if (ins
->evex_type
== evex_from_legacy
&& !ins
->vex
.nd
9147 && (ins
->vex
.register_specifier
|| !ins
->vex
.v
))
9152 /* EVEX from legacy instructions require that EVEX.z, EVEX.L’L and the
9153 lower 2 bits of EVEX.aaa must be 0. */
9154 if (ins
->evex_type
== evex_from_legacy
9155 && ((ins
->vex
.mask_register_specifier
& 0x3) != 0
9157 || ins
->vex
.zeroing
!= 0))
9161 vindex
= *ins
->codep
++;
9162 dp
= &evex_table
[vex_table_index
][vindex
];
9163 ins
->end_codep
= ins
->codep
;
9164 if (!fetch_modrm (ins
))
9167 /* Set vector length. For EVEX-promoted instructions, evex.ll == 0b00,
9168 which has the same encoding as vex.length == 128 and they can share
9169 the same processing with vex.length in OP_VEX. */
9170 if (ins
->modrm
.mod
== 3 && ins
->vex
.b
&& ins
->evex_type
!= evex_from_legacy
)
9171 ins
->vex
.length
= 512;
9174 switch (ins
->vex
.ll
)
9177 ins
->vex
.length
= 128;
9180 ins
->vex
.length
= 256;
9183 ins
->vex
.length
= 512;
9199 if (dp
->name
!= NULL
)
9202 return get_valid_dis386 (dp
, ins
);
9206 get_sib (instr_info
*ins
, int sizeflag
)
9208 /* If modrm.mod == 3, operand must be register. */
9210 && ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
9211 && ins
->modrm
.mod
!= 3
9212 && ins
->modrm
.rm
== 4)
9214 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
9216 ins
->sib
.index
= (ins
->codep
[1] >> 3) & 7;
9217 ins
->sib
.scale
= (ins
->codep
[1] >> 6) & 3;
9218 ins
->sib
.base
= ins
->codep
[1] & 7;
9219 ins
->has_sib
= true;
9222 ins
->has_sib
= false;
9227 /* Like oappend_with_style (below) but always with text style. */
9230 oappend (instr_info
*ins
, const char *s
)
9232 oappend_with_style (ins
, s
, dis_style_text
);
9235 /* Like oappend (above), but S is a string starting with '%'. In
9236 Intel syntax, the '%' is elided. */
9239 oappend_register (instr_info
*ins
, const char *s
)
9241 oappend_with_style (ins
, s
+ ins
->intel_syntax
, dis_style_register
);
9244 /* Wrap around a call to INS->info->fprintf_styled_func, printing FMT.
9245 STYLE is the default style to use in the fprintf_styled_func calls,
9246 however, FMT might include embedded style markers (see oappend_style),
9247 these embedded markers are not printed, but instead change the style
9248 used in the next fprintf_styled_func call. */
9250 static void ATTRIBUTE_PRINTF_3
9251 i386_dis_printf (const disassemble_info
*info
, enum disassembler_style style
,
9252 const char *fmt
, ...)
9255 enum disassembler_style curr_style
= style
;
9256 const char *start
, *curr
;
9257 char staging_area
[40];
9260 /* In particular print_insn()'s processing of op_txt[] can hand rather long
9261 strings here. Bypass vsnprintf() in such cases to avoid capacity issues
9262 with the staging area. */
9263 if (strcmp (fmt
, "%s"))
9265 int res
= vsnprintf (staging_area
, sizeof (staging_area
), fmt
, ap
);
9272 if ((size_t) res
>= sizeof (staging_area
))
9275 start
= curr
= staging_area
;
9279 start
= curr
= va_arg (ap
, const char *);
9286 || (*curr
== STYLE_MARKER_CHAR
9287 && ISXDIGIT (*(curr
+ 1))
9288 && *(curr
+ 2) == STYLE_MARKER_CHAR
))
9290 /* Output content between our START position and CURR. */
9291 int len
= curr
- start
;
9292 int n
= (*info
->fprintf_styled_func
) (info
->stream
, curr_style
,
9293 "%.*s", len
, start
);
9300 /* Skip over the initial STYLE_MARKER_CHAR. */
9303 /* Update the CURR_STYLE. As there are less than 16 styles, it
9304 is possible, that if the input is corrupted in some way, that
9305 we might set CURR_STYLE to an invalid value. Don't worry
9306 though, we check for this situation. */
9307 if (*curr
>= '0' && *curr
<= '9')
9308 curr_style
= (enum disassembler_style
) (*curr
- '0');
9309 else if (*curr
>= 'a' && *curr
<= 'f')
9310 curr_style
= (enum disassembler_style
) (*curr
- 'a' + 10);
9312 curr_style
= dis_style_text
;
9314 /* Check for an invalid style having been selected. This should
9315 never happen, but it doesn't hurt to be a little paranoid. */
9316 if (curr_style
> dis_style_comment_start
)
9317 curr_style
= dis_style_text
;
9319 /* Skip the hex character, and the closing STYLE_MARKER_CHAR. */
9322 /* Reset the START to after the style marker. */
9332 print_insn (bfd_vma pc
, disassemble_info
*info
, int intel_syntax
)
9334 const struct dis386
*dp
;
9337 char *op_txt
[MAX_OPERANDS
];
9339 bool intel_swap_2_3
;
9340 int sizeflag
, orig_sizeflag
;
9342 struct dis_private priv
;
9347 .intel_syntax
= intel_syntax
>= 0
9349 : (info
->mach
& bfd_mach_i386_intel_syntax
) != 0,
9350 .intel_mnemonic
= !SYSV386_COMPAT
,
9351 .op_index
[0 ... MAX_OPERANDS
- 1] = -1,
9353 .start_codep
= priv
.the_buffer
,
9354 .codep
= priv
.the_buffer
,
9356 .last_lock_prefix
= -1,
9357 .last_repz_prefix
= -1,
9358 .last_repnz_prefix
= -1,
9359 .last_data_prefix
= -1,
9360 .last_addr_prefix
= -1,
9361 .last_rex_prefix
= -1,
9362 .last_rex2_prefix
= -1,
9363 .last_seg_prefix
= -1,
9366 char op_out
[MAX_OPERANDS
][MAX_OPERAND_BUFFER_SIZE
];
9368 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
9369 if ((info
->mach
& bfd_mach_i386_i386
) != 0)
9370 ins
.address_mode
= mode_32bit
;
9371 else if (info
->mach
== bfd_mach_i386_i8086
)
9373 ins
.address_mode
= mode_16bit
;
9374 priv
.orig_sizeflag
= 0;
9377 ins
.address_mode
= mode_64bit
;
9379 for (p
= info
->disassembler_options
; p
!= NULL
;)
9381 if (startswith (p
, "amd64"))
9383 else if (startswith (p
, "intel64"))
9384 ins
.isa64
= intel64
;
9385 else if (startswith (p
, "x86-64"))
9387 ins
.address_mode
= mode_64bit
;
9388 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9390 else if (startswith (p
, "i386"))
9392 ins
.address_mode
= mode_32bit
;
9393 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9395 else if (startswith (p
, "i8086"))
9397 ins
.address_mode
= mode_16bit
;
9398 priv
.orig_sizeflag
&= ~(AFLAG
| DFLAG
);
9400 else if (startswith (p
, "intel"))
9402 if (startswith (p
+ 5, "-mnemonic"))
9403 ins
.intel_mnemonic
= true;
9405 ins
.intel_syntax
= 1;
9407 else if (startswith (p
, "att"))
9409 ins
.intel_syntax
= 0;
9410 if (startswith (p
+ 3, "-mnemonic"))
9411 ins
.intel_mnemonic
= false;
9413 else if (startswith (p
, "addr"))
9415 if (ins
.address_mode
== mode_64bit
)
9417 if (p
[4] == '3' && p
[5] == '2')
9418 priv
.orig_sizeflag
&= ~AFLAG
;
9419 else if (p
[4] == '6' && p
[5] == '4')
9420 priv
.orig_sizeflag
|= AFLAG
;
9424 if (p
[4] == '1' && p
[5] == '6')
9425 priv
.orig_sizeflag
&= ~AFLAG
;
9426 else if (p
[4] == '3' && p
[5] == '2')
9427 priv
.orig_sizeflag
|= AFLAG
;
9430 else if (startswith (p
, "data"))
9432 if (p
[4] == '1' && p
[5] == '6')
9433 priv
.orig_sizeflag
&= ~DFLAG
;
9434 else if (p
[4] == '3' && p
[5] == '2')
9435 priv
.orig_sizeflag
|= DFLAG
;
9437 else if (startswith (p
, "suffix"))
9438 priv
.orig_sizeflag
|= SUFFIX_ALWAYS
;
9440 p
= strchr (p
, ',');
9445 if (ins
.address_mode
== mode_64bit
&& sizeof (bfd_vma
) < 8)
9447 i386_dis_printf (info
, dis_style_text
, _("64-bit address is disabled"));
9451 if (ins
.intel_syntax
)
9453 ins
.open_char
= '[';
9454 ins
.close_char
= ']';
9455 ins
.separator_char
= '+';
9456 ins
.scale_char
= '*';
9460 ins
.open_char
= '(';
9461 ins
.close_char
= ')';
9462 ins
.separator_char
= ',';
9463 ins
.scale_char
= ',';
9466 /* The output looks better if we put 7 bytes on a line, since that
9467 puts most long word instructions on a single line. */
9468 info
->bytes_per_line
= 7;
9470 info
->private_data
= &priv
;
9472 priv
.insn_start
= pc
;
9474 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9477 ins
.op_out
[i
] = op_out
[i
];
9480 sizeflag
= priv
.orig_sizeflag
;
9482 switch (ckprefix (&ins
))
9488 /* Too many prefixes or unused REX prefixes. */
9490 i
< (int) ARRAY_SIZE (ins
.all_prefixes
) && ins
.all_prefixes
[i
];
9492 i386_dis_printf (info
, dis_style_mnemonic
, "%s%s",
9493 (i
== 0 ? "" : " "),
9494 prefix_name (ins
.address_mode
, ins
.all_prefixes
[i
],
9499 case ckp_fetch_error
:
9500 goto fetch_error_out
;
9503 ins
.nr_prefixes
= ins
.codep
- ins
.start_codep
;
9505 if (!fetch_code (info
, ins
.codep
+ 1))
9508 ret
= fetch_error (&ins
);
9512 ins
.two_source_ops
= (*ins
.codep
== 0x62 || *ins
.codep
== 0xc8);
9514 if ((ins
.prefixes
& PREFIX_FWAIT
)
9515 && (*ins
.codep
< 0xd8 || *ins
.codep
> 0xdf))
9517 /* Handle ins.prefixes before fwait. */
9518 for (i
= 0; i
< ins
.fwait_prefix
&& ins
.all_prefixes
[i
];
9520 i386_dis_printf (info
, dis_style_mnemonic
, "%s ",
9521 prefix_name (ins
.address_mode
, ins
.all_prefixes
[i
],
9523 i386_dis_printf (info
, dis_style_mnemonic
, "fwait");
9528 /* REX2.M in rex2 prefix represents map0 or map1. */
9529 if (ins
.last_rex2_prefix
< 0 ? *ins
.codep
== 0x0f : (ins
.rex2
& REX2_M
))
9531 unsigned char threebyte
;
9536 if (!fetch_code (info
, ins
.codep
+ 1))
9537 goto fetch_error_out
;
9540 threebyte
= *ins
.codep
;
9541 dp
= &dis386_twobyte
[threebyte
];
9542 ins
.need_modrm
= twobyte_has_modrm
[threebyte
];
9547 dp
= &dis386
[*ins
.codep
];
9548 ins
.need_modrm
= onebyte_has_modrm
[*ins
.codep
];
9552 /* Save sizeflag for printing the extra ins.prefixes later before updating
9553 it for mnemonic and operand processing. The prefix names depend
9554 only on the address mode. */
9555 orig_sizeflag
= sizeflag
;
9556 if (ins
.prefixes
& PREFIX_ADDR
)
9558 if ((ins
.prefixes
& PREFIX_DATA
))
9561 ins
.end_codep
= ins
.codep
;
9562 if (ins
.need_modrm
&& !fetch_modrm (&ins
))
9563 goto fetch_error_out
;
9565 if (dp
->name
== NULL
&& dp
->op
[0].bytemode
== FLOATCODE
)
9567 if (!get_sib (&ins
, sizeflag
)
9568 || !dofloat (&ins
, sizeflag
))
9569 goto fetch_error_out
;
9573 dp
= get_valid_dis386 (dp
, &ins
);
9574 if (dp
== &err_opcode
)
9575 goto fetch_error_out
;
9577 /* For APX instructions promoted from legacy maps 0/1, embedded prefix
9578 is interpreted as the operand size override. */
9579 if (ins
.evex_type
== evex_from_legacy
9580 && ins
.vex
.prefix
== DATA_PREFIX_OPCODE
)
9583 if (dp
!= NULL
&& putop (&ins
, dp
->name
, sizeflag
) == 0)
9585 if (!get_sib (&ins
, sizeflag
))
9586 goto fetch_error_out
;
9587 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9589 ins
.obufp
= ins
.op_out
[i
];
9590 ins
.op_ad
= MAX_OPERANDS
- 1 - i
;
9592 && !dp
->op
[i
].rtn (&ins
, dp
->op
[i
].bytemode
, sizeflag
))
9593 goto fetch_error_out
;
9594 /* For EVEX instruction after the last operand masking
9595 should be printed. */
9596 if (i
== 0 && ins
.vex
.evex
)
9598 /* Don't print {%k0}. */
9599 if (ins
.vex
.mask_register_specifier
)
9601 const char *reg_name
9602 = att_names_mask
[ins
.vex
.mask_register_specifier
];
9604 oappend (&ins
, "{");
9605 oappend_register (&ins
, reg_name
);
9606 oappend (&ins
, "}");
9608 if (ins
.vex
.zeroing
)
9609 oappend (&ins
, "{z}");
9611 else if (ins
.vex
.zeroing
)
9613 oappend (&ins
, "{bad}");
9617 /* Instructions with a mask register destination allow for
9618 zeroing-masking only (if any masking at all), which is
9619 _not_ expressed by EVEX.z. */
9620 if (ins
.vex
.zeroing
&& dp
->op
[0].bytemode
== mask_mode
)
9621 ins
.illegal_masking
= true;
9623 /* S/G insns require a mask and don't allow
9625 if ((dp
->op
[0].bytemode
== vex_vsib_d_w_dq_mode
9626 || dp
->op
[0].bytemode
== vex_vsib_q_w_dq_mode
)
9627 && (ins
.vex
.mask_register_specifier
== 0
9628 || ins
.vex
.zeroing
))
9629 ins
.illegal_masking
= true;
9631 if (ins
.illegal_masking
)
9632 oappend (&ins
, "/(bad)");
9636 /* Check whether rounding control was enabled for an insn not
9637 supporting it, when evex.b is not treated as evex.nd. */
9638 if (ins
.modrm
.mod
== 3 && ins
.vex
.b
&& ins
.evex_type
== evex_default
9639 && !(ins
.evex_used
& EVEX_b_used
))
9641 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9643 ins
.obufp
= ins
.op_out
[i
];
9646 oappend (&ins
, names_rounding
[ins
.vex
.ll
]);
9647 oappend (&ins
, "bad}");
9654 /* Clear instruction information. */
9655 info
->insn_info_valid
= 0;
9656 info
->branch_delay_insns
= 0;
9657 info
->data_size
= 0;
9658 info
->insn_type
= dis_noninsn
;
9662 /* Reset jump operation indicator. */
9663 ins
.op_is_jump
= false;
9665 int jump_detection
= 0;
9667 /* Extract flags. */
9668 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9670 if ((dp
->op
[i
].rtn
== OP_J
)
9671 || (dp
->op
[i
].rtn
== OP_indirE
))
9672 jump_detection
|= 1;
9673 else if ((dp
->op
[i
].rtn
== BND_Fixup
)
9674 || (!dp
->op
[i
].rtn
&& !dp
->op
[i
].bytemode
))
9675 jump_detection
|= 2;
9676 else if ((dp
->op
[i
].bytemode
== cond_jump_mode
)
9677 || (dp
->op
[i
].bytemode
== loop_jcxz_mode
))
9678 jump_detection
|= 4;
9681 /* Determine if this is a jump or branch. */
9682 if ((jump_detection
& 0x3) == 0x3)
9684 ins
.op_is_jump
= true;
9685 if (jump_detection
& 0x4)
9686 info
->insn_type
= dis_condbranch
;
9688 info
->insn_type
= (dp
->name
&& !strncmp (dp
->name
, "call", 4))
9689 ? dis_jsr
: dis_branch
;
9693 /* If VEX.vvvv and EVEX.vvvv are unused, they must be all 1s, which
9694 are all 0s in inverted form. */
9695 if (ins
.need_vex
&& ins
.vex
.register_specifier
!= 0)
9697 i386_dis_printf (info
, dis_style_text
, "(bad)");
9698 ret
= ins
.end_codep
- priv
.the_buffer
;
9702 if ((dp
->prefix_requirement
& PREFIX_REX2_ILLEGAL
)
9703 && ins
.last_rex2_prefix
>= 0 && (ins
.rex2
& REX2_SPECIAL
) == 0)
9705 i386_dis_printf (info
, dis_style_text
, "(bad)");
9706 ret
= ins
.end_codep
- priv
.the_buffer
;
9710 switch (dp
->prefix_requirement
& ~PREFIX_REX2_ILLEGAL
)
9713 /* If only the data prefix is marked as mandatory, its absence renders
9714 the encoding invalid. Most other PREFIX_OPCODE rules still apply. */
9715 if (ins
.need_vex
? !ins
.vex
.prefix
: !(ins
.prefixes
& PREFIX_DATA
))
9717 i386_dis_printf (info
, dis_style_text
, "(bad)");
9718 ret
= ins
.end_codep
- priv
.the_buffer
;
9721 ins
.used_prefixes
|= PREFIX_DATA
;
9724 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
9725 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
9726 used by putop and MMX/SSE operand and may be overridden by the
9727 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
9730 ? ins
.vex
.prefix
== REPE_PREFIX_OPCODE
9731 || ins
.vex
.prefix
== REPNE_PREFIX_OPCODE
9733 & (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
9734 && (ins
.used_prefixes
9735 & (PREFIX_REPZ
| PREFIX_REPNZ
)) == 0)
9737 ? ins
.vex
.prefix
== DATA_PREFIX_OPCODE
9739 & (PREFIX_REPZ
| PREFIX_REPNZ
| PREFIX_DATA
))
9741 && (ins
.used_prefixes
& PREFIX_DATA
) == 0))
9742 || (ins
.vex
.evex
&& dp
->prefix_requirement
!= PREFIX_DATA
9743 && !ins
.vex
.w
!= !(ins
.used_prefixes
& PREFIX_DATA
)))
9745 i386_dis_printf (info
, dis_style_text
, "(bad)");
9746 ret
= ins
.end_codep
- priv
.the_buffer
;
9751 case PREFIX_IGNORED
:
9752 /* Zap data size and rep prefixes from used_prefixes and reinstate their
9753 origins in all_prefixes. */
9754 ins
.used_prefixes
&= ~PREFIX_OPCODE
;
9755 if (ins
.last_data_prefix
>= 0)
9756 ins
.all_prefixes
[ins
.last_data_prefix
] = 0x66;
9757 if (ins
.last_repz_prefix
>= 0)
9758 ins
.all_prefixes
[ins
.last_repz_prefix
] = 0xf3;
9759 if (ins
.last_repnz_prefix
>= 0)
9760 ins
.all_prefixes
[ins
.last_repnz_prefix
] = 0xf2;
9763 case PREFIX_NP_OR_DATA
:
9764 if (ins
.vex
.prefix
== REPE_PREFIX_OPCODE
9765 || ins
.vex
.prefix
== REPNE_PREFIX_OPCODE
)
9767 i386_dis_printf (info
, dis_style_text
, "(bad)");
9768 ret
= ins
.end_codep
- priv
.the_buffer
;
9776 i386_dis_printf (info
, dis_style_text
, "(bad)");
9777 ret
= ins
.end_codep
- priv
.the_buffer
;
9783 /* Check if the REX prefix is used. */
9784 if ((ins
.rex
^ ins
.rex_used
) == 0
9785 && !ins
.need_vex
&& ins
.last_rex_prefix
>= 0)
9786 ins
.all_prefixes
[ins
.last_rex_prefix
] = 0;
9788 /* Check if the REX2 prefix is used. */
9789 if (ins
.last_rex2_prefix
>= 0
9790 && ((ins
.rex2
& REX2_SPECIAL
)
9791 || (((ins
.rex2
& 7) ^ (ins
.rex2_used
& 7)) == 0
9792 && (ins
.rex
^ ins
.rex_used
) == 0
9793 && (ins
.rex2
& 7))))
9794 ins
.all_prefixes
[ins
.last_rex2_prefix
] = 0;
9796 /* Check if the SEG prefix is used. */
9797 if ((ins
.prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
| PREFIX_ES
9798 | PREFIX_FS
| PREFIX_GS
)) != 0
9799 && (ins
.used_prefixes
& ins
.active_seg_prefix
) != 0)
9800 ins
.all_prefixes
[ins
.last_seg_prefix
] = 0;
9802 /* Check if the ADDR prefix is used. */
9803 if ((ins
.prefixes
& PREFIX_ADDR
) != 0
9804 && (ins
.used_prefixes
& PREFIX_ADDR
) != 0)
9805 ins
.all_prefixes
[ins
.last_addr_prefix
] = 0;
9807 /* Check if the DATA prefix is used. */
9808 if ((ins
.prefixes
& PREFIX_DATA
) != 0
9809 && (ins
.used_prefixes
& PREFIX_DATA
) != 0
9811 ins
.all_prefixes
[ins
.last_data_prefix
] = 0;
9813 /* Print the extra ins.prefixes. */
9815 for (i
= 0; i
< (int) ARRAY_SIZE (ins
.all_prefixes
); i
++)
9816 if (ins
.all_prefixes
[i
])
9818 const char *name
= prefix_name (ins
.address_mode
, ins
.all_prefixes
[i
],
9823 prefix_length
+= strlen (name
) + 1;
9824 if (ins
.all_prefixes
[i
] == REX2_OPCODE
)
9825 i386_dis_printf (info
, dis_style_mnemonic
, "{%s 0x%x} ", name
,
9826 (unsigned int) ins
.rex2_payload
);
9828 i386_dis_printf (info
, dis_style_mnemonic
, "%s ", name
);
9831 /* Check maximum code length. */
9832 if ((ins
.codep
- ins
.start_codep
) > MAX_CODE_LENGTH
)
9834 i386_dis_printf (info
, dis_style_text
, "(bad)");
9835 ret
= MAX_CODE_LENGTH
;
9839 /* Calculate the number of operands this instruction has. */
9841 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9842 if (*ins
.op_out
[i
] != '\0')
9845 /* Calculate the number of spaces to print after the mnemonic. */
9846 ins
.obufp
= ins
.mnemonicendp
;
9849 i
= strlen (ins
.obuf
) + prefix_length
;
9858 /* Print the instruction mnemonic along with any trailing whitespace. */
9859 i386_dis_printf (info
, dis_style_mnemonic
, "%s%*s", ins
.obuf
, i
, "");
9861 /* The enter and bound instructions are printed with operands in the same
9862 order as the intel book; everything else is printed in reverse order. */
9863 intel_swap_2_3
= false;
9864 if (ins
.intel_syntax
|| ins
.two_source_ops
)
9866 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9867 op_txt
[i
] = ins
.op_out
[i
];
9869 if (ins
.intel_syntax
&& dp
&& dp
->op
[2].rtn
== OP_Rounding
9870 && dp
->op
[3].rtn
== OP_E
&& dp
->op
[4].rtn
== NULL
)
9872 op_txt
[2] = ins
.op_out
[3];
9873 op_txt
[3] = ins
.op_out
[2];
9874 intel_swap_2_3
= true;
9877 for (i
= 0; i
< (MAX_OPERANDS
>> 1); ++i
)
9881 ins
.op_ad
= ins
.op_index
[i
];
9882 ins
.op_index
[i
] = ins
.op_index
[MAX_OPERANDS
- 1 - i
];
9883 ins
.op_index
[MAX_OPERANDS
- 1 - i
] = ins
.op_ad
;
9884 riprel
= ins
.op_riprel
[i
];
9885 ins
.op_riprel
[i
] = ins
.op_riprel
[MAX_OPERANDS
- 1 - i
];
9886 ins
.op_riprel
[MAX_OPERANDS
- 1 - i
] = riprel
;
9891 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9892 op_txt
[MAX_OPERANDS
- 1 - i
] = ins
.op_out
[i
];
9896 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9899 /* In Intel syntax embedded rounding / SAE are not separate operands.
9900 Instead they're attached to the prior register operand. Simply
9901 suppress emission of the comma to achieve that effect. */
9902 switch (i
& -(ins
.intel_syntax
&& dp
))
9905 if (dp
->op
[2].rtn
== OP_Rounding
&& !intel_swap_2_3
)
9909 if (dp
->op
[3].rtn
== OP_Rounding
|| intel_swap_2_3
)
9914 i386_dis_printf (info
, dis_style_text
, ",");
9915 if (ins
.op_index
[i
] != -1 && !ins
.op_riprel
[i
])
9917 bfd_vma target
= (bfd_vma
) ins
.op_address
[ins
.op_index
[i
]];
9921 info
->insn_info_valid
= 1;
9922 info
->branch_delay_insns
= 0;
9923 info
->data_size
= 0;
9924 info
->target
= target
;
9927 (*info
->print_address_func
) (target
, info
);
9930 i386_dis_printf (info
, dis_style_text
, "%s", op_txt
[i
]);
9934 for (i
= 0; i
< MAX_OPERANDS
; i
++)
9935 if (ins
.op_index
[i
] != -1 && ins
.op_riprel
[i
])
9937 i386_dis_printf (info
, dis_style_comment_start
, " # ");
9938 (*info
->print_address_func
)
9939 ((bfd_vma
)(ins
.start_pc
+ (ins
.codep
- ins
.start_codep
)
9940 + ins
.op_address
[ins
.op_index
[i
]]),
9944 ret
= ins
.codep
- priv
.the_buffer
;
9946 info
->private_data
= NULL
;
9950 /* Here for backwards compatibility. When gdb stops using
9951 print_insn_i386_att and print_insn_i386_intel these functions can
9952 disappear, and print_insn_i386 be merged into print_insn. */
9954 print_insn_i386_att (bfd_vma pc
, disassemble_info
*info
)
9956 return print_insn (pc
, info
, 0);
9960 print_insn_i386_intel (bfd_vma pc
, disassemble_info
*info
)
9962 return print_insn (pc
, info
, 1);
9966 print_insn_i386 (bfd_vma pc
, disassemble_info
*info
)
9968 return print_insn (pc
, info
, -1);
9971 static const char *float_mem
[] = {
10046 static const unsigned char float_mem_mode
[] = {
10121 #define ST { OP_ST, 0 }
10122 #define STi { OP_STi, 0 }
10124 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
10125 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
10126 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
10127 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
10128 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
10129 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
10130 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
10131 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
10132 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
10134 static const struct dis386 float_reg
[][8] = {
10137 { "fadd", { ST
, STi
}, 0 },
10138 { "fmul", { ST
, STi
}, 0 },
10139 { "fcom", { STi
}, 0 },
10140 { "fcomp", { STi
}, 0 },
10141 { "fsub", { ST
, STi
}, 0 },
10142 { "fsubr", { ST
, STi
}, 0 },
10143 { "fdiv", { ST
, STi
}, 0 },
10144 { "fdivr", { ST
, STi
}, 0 },
10148 { "fld", { STi
}, 0 },
10149 { "fxch", { STi
}, 0 },
10159 { "fcmovb", { ST
, STi
}, 0 },
10160 { "fcmove", { ST
, STi
}, 0 },
10161 { "fcmovbe",{ ST
, STi
}, 0 },
10162 { "fcmovu", { ST
, STi
}, 0 },
10170 { "fcmovnb",{ ST
, STi
}, 0 },
10171 { "fcmovne",{ ST
, STi
}, 0 },
10172 { "fcmovnbe",{ ST
, STi
}, 0 },
10173 { "fcmovnu",{ ST
, STi
}, 0 },
10175 { "fucomi", { ST
, STi
}, 0 },
10176 { "fcomi", { ST
, STi
}, 0 },
10181 { "fadd", { STi
, ST
}, 0 },
10182 { "fmul", { STi
, ST
}, 0 },
10185 { "fsub{!M|r}", { STi
, ST
}, 0 },
10186 { "fsub{M|}", { STi
, ST
}, 0 },
10187 { "fdiv{!M|r}", { STi
, ST
}, 0 },
10188 { "fdiv{M|}", { STi
, ST
}, 0 },
10192 { "ffree", { STi
}, 0 },
10194 { "fst", { STi
}, 0 },
10195 { "fstp", { STi
}, 0 },
10196 { "fucom", { STi
}, 0 },
10197 { "fucomp", { STi
}, 0 },
10203 { "faddp", { STi
, ST
}, 0 },
10204 { "fmulp", { STi
, ST
}, 0 },
10207 { "fsub{!M|r}p", { STi
, ST
}, 0 },
10208 { "fsub{M|}p", { STi
, ST
}, 0 },
10209 { "fdiv{!M|r}p", { STi
, ST
}, 0 },
10210 { "fdiv{M|}p", { STi
, ST
}, 0 },
10214 { "ffreep", { STi
}, 0 },
10219 { "fucomip", { ST
, STi
}, 0 },
10220 { "fcomip", { ST
, STi
}, 0 },
10225 static const char *const fgrps
[][8] = {
10228 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10233 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10238 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
10243 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
10248 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
10253 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
10258 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10263 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
10264 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
10269 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10274 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10279 swap_operand (instr_info
*ins
)
10281 ins
->mnemonicendp
[0] = '.';
10282 ins
->mnemonicendp
[1] = 's';
10283 ins
->mnemonicendp
[2] = '\0';
10284 ins
->mnemonicendp
+= 2;
10288 dofloat (instr_info
*ins
, int sizeflag
)
10290 const struct dis386
*dp
;
10291 unsigned char floatop
= ins
->codep
[-1];
10293 if (ins
->modrm
.mod
!= 3)
10295 int fp_indx
= (floatop
- 0xd8) * 8 + ins
->modrm
.reg
;
10297 putop (ins
, float_mem
[fp_indx
], sizeflag
);
10298 ins
->obufp
= ins
->op_out
[0];
10300 return OP_E (ins
, float_mem_mode
[fp_indx
], sizeflag
);
10302 /* Skip mod/rm byte. */
10306 dp
= &float_reg
[floatop
- 0xd8][ins
->modrm
.reg
];
10307 if (dp
->name
== NULL
)
10309 putop (ins
, fgrps
[dp
->op
[0].bytemode
][ins
->modrm
.rm
], sizeflag
);
10311 /* Instruction fnstsw is only one with strange arg. */
10312 if (floatop
== 0xdf && ins
->codep
[-1] == 0xe0)
10313 strcpy (ins
->op_out
[0], att_names16
[0] + ins
->intel_syntax
);
10317 putop (ins
, dp
->name
, sizeflag
);
10319 ins
->obufp
= ins
->op_out
[0];
10322 && !dp
->op
[0].rtn (ins
, dp
->op
[0].bytemode
, sizeflag
))
10325 ins
->obufp
= ins
->op_out
[1];
10328 && !dp
->op
[1].rtn (ins
, dp
->op
[1].bytemode
, sizeflag
))
10335 OP_ST (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10336 int sizeflag ATTRIBUTE_UNUSED
)
10338 oappend_register (ins
, "%st");
10343 OP_STi (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10344 int sizeflag ATTRIBUTE_UNUSED
)
10347 int res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%st(%d)", ins
->modrm
.rm
);
10349 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
10351 oappend_register (ins
, scratch
);
10355 /* Capital letters in template are macros. */
10357 putop (instr_info
*ins
, const char *in_template
, int sizeflag
)
10362 unsigned int l
= 0, len
= 0;
10365 for (p
= in_template
; *p
; p
++)
10369 if (l
>= sizeof (last
) || !ISUPPER (*p
))
10377 *ins
->obufp
++ = *p
;
10386 if (ins
->intel_syntax
)
10388 while (*++p
!= '|')
10389 if (*p
== '}' || *p
== '\0')
10395 while (*++p
!= '}')
10405 if (ins
->intel_syntax
)
10407 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10408 || (sizeflag
& SUFFIX_ALWAYS
))
10409 *ins
->obufp
++ = 'b';
10415 if (ins
->intel_syntax
)
10417 if (sizeflag
& SUFFIX_ALWAYS
)
10418 *ins
->obufp
++ = 'b';
10420 else if (l
== 1 && last
[0] == 'L')
10422 if (ins
->address_mode
== mode_64bit
10423 && !(ins
->prefixes
& PREFIX_ADDR
))
10425 *ins
->obufp
++ = 'a';
10426 *ins
->obufp
++ = 'b';
10427 *ins
->obufp
++ = 's';
10436 if (ins
->intel_syntax
&& !alt
)
10438 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10440 if (sizeflag
& DFLAG
)
10441 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10443 *ins
->obufp
++ = ins
->intel_syntax
? 'w' : 's';
10444 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10453 if (!ins
->vex
.evex
|| ins
->vex
.w
)
10454 *ins
->obufp
++ = 'd';
10456 oappend (ins
, "{bad}");
10465 if (ins
->intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
10468 if (ins
->modrm
.mod
== 3)
10470 if (ins
->rex
& REX_W
)
10471 *ins
->obufp
++ = 'q';
10474 if (sizeflag
& DFLAG
)
10475 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10477 *ins
->obufp
++ = 'w';
10478 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10482 *ins
->obufp
++ = 'w';
10490 if (!ins
->vex
.evex
|| ins
->vex
.b
|| ins
->vex
.ll
>= 2
10492 || (ins
->modrm
.mod
== 3 && (ins
->rex
& REX_X
))
10493 || !ins
->vex
.v
|| ins
->vex
.mask_register_specifier
)
10495 /* AVX512 extends a number of V*D insns to also have V*Q variants,
10496 merely distinguished by EVEX.W. Look for a use of the
10497 respective macro. */
10500 const char *pct
= strchr (p
+ 1, '%');
10502 if (pct
!= NULL
&& pct
[1] == 'D' && pct
[2] == 'Q')
10505 *ins
->obufp
++ = '{';
10506 *ins
->obufp
++ = 'e';
10507 *ins
->obufp
++ = 'v';
10508 *ins
->obufp
++ = 'e';
10509 *ins
->obufp
++ = 'x';
10510 *ins
->obufp
++ = '}';
10511 *ins
->obufp
++ = ' ';
10518 /* For jcxz/jecxz */
10519 if (ins
->address_mode
== mode_64bit
)
10521 if (sizeflag
& AFLAG
)
10522 *ins
->obufp
++ = 'r';
10524 *ins
->obufp
++ = 'e';
10527 if (sizeflag
& AFLAG
)
10528 *ins
->obufp
++ = 'e';
10529 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10534 if (ins
->intel_syntax
)
10536 if ((ins
->prefixes
& PREFIX_ADDR
) || (sizeflag
& SUFFIX_ALWAYS
))
10538 if (sizeflag
& AFLAG
)
10539 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10541 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'l' : 'w';
10542 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10545 else if (l
== 1 && last
[0] == 'C')
10551 if (ins
->intel_syntax
|| (ins
->obufp
[-1] != 's'
10552 && !(sizeflag
& SUFFIX_ALWAYS
)))
10554 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
10555 *ins
->obufp
++ = 'l';
10557 *ins
->obufp
++ = 'w';
10558 if (!(ins
->rex
& REX_W
))
10559 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10564 if (ins
->intel_syntax
)
10566 if ((ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_CS
10567 || (ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_DS
)
10569 ins
->used_prefixes
|= ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
);
10570 *ins
->obufp
++ = ',';
10571 *ins
->obufp
++ = 'p';
10573 /* Set active_seg_prefix even if not set in 64-bit mode
10574 because here it is a valid branch hint. */
10575 if (ins
->prefixes
& PREFIX_DS
)
10577 ins
->active_seg_prefix
= PREFIX_DS
;
10578 *ins
->obufp
++ = 't';
10582 ins
->active_seg_prefix
= PREFIX_CS
;
10583 *ins
->obufp
++ = 'n';
10587 else if (l
== 1 && last
[0] == 'X')
10590 *ins
->obufp
++ = 'h';
10592 oappend (ins
, "{bad}");
10599 if (ins
->rex
& REX_W
)
10600 *ins
->obufp
++ = 'q';
10602 *ins
->obufp
++ = 'd';
10605 if (ins
->intel_syntax
)
10607 if (sizeflag
& SUFFIX_ALWAYS
)
10609 if (ins
->rex
& REX_W
)
10610 *ins
->obufp
++ = 'q';
10612 *ins
->obufp
++ = 'l';
10616 if (ins
->intel_mnemonic
!= cond
)
10617 *ins
->obufp
++ = 'r';
10620 if ((ins
->prefixes
& PREFIX_FWAIT
) == 0)
10621 *ins
->obufp
++ = 'n';
10623 ins
->used_prefixes
|= PREFIX_FWAIT
;
10627 if (ins
->rex
& REX_W
)
10628 *ins
->obufp
++ = 'o';
10629 else if (ins
->intel_syntax
&& (sizeflag
& DFLAG
))
10630 *ins
->obufp
++ = 'q';
10632 *ins
->obufp
++ = 'd';
10633 if (!(ins
->rex
& REX_W
))
10634 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10637 if (ins
->address_mode
== mode_64bit
10638 && (ins
->isa64
== intel64
|| (ins
->rex
& REX_W
)
10639 || !(ins
->prefixes
& PREFIX_DATA
)))
10641 if (sizeflag
& SUFFIX_ALWAYS
)
10642 *ins
->obufp
++ = 'q';
10645 /* Fall through. */
10649 if (!cond
&& ins
->last_rex2_prefix
>= 0 && (ins
->rex
& REX_W
))
10651 /* For pushp and popp, p is printed and do not print {rex2}
10653 *ins
->obufp
++ = 'p';
10654 ins
->rex2
|= REX2_SPECIAL
;
10658 /* For "!P" print nothing else in Intel syntax. */
10659 if (!cond
&& ins
->intel_syntax
)
10662 if ((ins
->modrm
.mod
== 3 || !cond
)
10663 && !(sizeflag
& SUFFIX_ALWAYS
))
10665 /* Fall through. */
10667 if ((!(ins
->rex
& REX_W
) && (ins
->prefixes
& PREFIX_DATA
))
10668 || ((sizeflag
& SUFFIX_ALWAYS
)
10669 && ins
->address_mode
!= mode_64bit
))
10671 *ins
->obufp
++ = (sizeflag
& DFLAG
)
10672 ? ins
->intel_syntax
? 'd' : 'l' : 'w';
10673 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10675 else if (sizeflag
& SUFFIX_ALWAYS
)
10676 *ins
->obufp
++ = 'q';
10678 else if (l
== 1 && last
[0] == 'L')
10680 if ((ins
->prefixes
& PREFIX_DATA
)
10681 || (ins
->rex
& REX_W
)
10682 || (sizeflag
& SUFFIX_ALWAYS
))
10685 if (ins
->rex
& REX_W
)
10686 *ins
->obufp
++ = 'q';
10689 if (sizeflag
& DFLAG
)
10690 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10692 *ins
->obufp
++ = 'w';
10693 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10703 if (ins
->intel_syntax
&& !alt
)
10706 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10707 || (sizeflag
& SUFFIX_ALWAYS
))
10709 if (ins
->rex
& REX_W
)
10710 *ins
->obufp
++ = 'q';
10713 if (sizeflag
& DFLAG
)
10714 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10716 *ins
->obufp
++ = 'w';
10717 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10721 else if (l
== 1 && last
[0] == 'D')
10722 *ins
->obufp
++ = ins
->vex
.w
? 'q' : 'd';
10723 else if (l
== 1 && last
[0] == 'L')
10725 if (cond
? ins
->modrm
.mod
== 3 && !(sizeflag
& SUFFIX_ALWAYS
)
10726 : ins
->address_mode
!= mode_64bit
)
10728 if ((ins
->rex
& REX_W
))
10731 *ins
->obufp
++ = 'q';
10733 else if ((ins
->address_mode
== mode_64bit
&& cond
)
10734 || (sizeflag
& SUFFIX_ALWAYS
))
10735 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10742 if (ins
->rex
& REX_W
)
10743 *ins
->obufp
++ = 'q';
10744 else if (sizeflag
& DFLAG
)
10746 if (ins
->intel_syntax
)
10747 *ins
->obufp
++ = 'd';
10749 *ins
->obufp
++ = 'l';
10752 *ins
->obufp
++ = 'w';
10753 if (ins
->intel_syntax
&& !p
[1]
10754 && ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
)))
10755 *ins
->obufp
++ = 'e';
10756 if (!(ins
->rex
& REX_W
))
10757 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10763 if (ins
->intel_syntax
)
10765 if (sizeflag
& SUFFIX_ALWAYS
)
10767 if (ins
->rex
& REX_W
)
10768 *ins
->obufp
++ = 'q';
10771 if (sizeflag
& DFLAG
)
10772 *ins
->obufp
++ = 'l';
10774 *ins
->obufp
++ = 'w';
10775 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10785 if (ins
->address_mode
== mode_64bit
10786 && !(ins
->prefixes
& PREFIX_ADDR
))
10788 *ins
->obufp
++ = 'a';
10789 *ins
->obufp
++ = 'b';
10790 *ins
->obufp
++ = 's';
10795 if (!ins
->vex
.evex
|| !ins
->vex
.w
)
10796 *ins
->obufp
++ = 's';
10798 oappend (ins
, "{bad}");
10808 *ins
->obufp
++ = 'v';
10817 *ins
->obufp
++ = '{';
10818 *ins
->obufp
++ = 'v';
10819 *ins
->obufp
++ = 'e';
10820 *ins
->obufp
++ = 'x';
10821 *ins
->obufp
++ = '}';
10822 *ins
->obufp
++ = ' ';
10825 if (ins
->rex
& REX_W
)
10827 *ins
->obufp
++ = 'a';
10828 *ins
->obufp
++ = 'b';
10829 *ins
->obufp
++ = 's';
10842 /* operand size flag for cwtl, cbtw */
10844 if (ins
->rex
& REX_W
)
10846 if (ins
->intel_syntax
)
10847 *ins
->obufp
++ = 'd';
10849 *ins
->obufp
++ = 'l';
10851 else if (sizeflag
& DFLAG
)
10852 *ins
->obufp
++ = 'w';
10854 *ins
->obufp
++ = 'b';
10855 if (!(ins
->rex
& REX_W
))
10856 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10860 if (!ins
->need_vex
)
10862 if (last
[0] == 'X')
10863 *ins
->obufp
++ = ins
->vex
.w
? 'd': 's';
10864 else if (last
[0] == 'B')
10865 *ins
->obufp
++ = ins
->vex
.w
? 'w': 'b';
10876 ? ins
->vex
.prefix
== DATA_PREFIX_OPCODE
10877 : ins
->prefixes
& PREFIX_DATA
)
10879 *ins
->obufp
++ = 'd';
10880 ins
->used_prefixes
|= PREFIX_DATA
;
10883 *ins
->obufp
++ = 's';
10888 if (ins
->vex
.mask_register_specifier
)
10889 ins
->illegal_masking
= true;
10891 else if (l
== 1 && last
[0] == 'X')
10893 if (!ins
->need_vex
)
10895 if (ins
->intel_syntax
10896 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
10897 && !(sizeflag
& SUFFIX_ALWAYS
)))
10899 switch (ins
->vex
.length
)
10902 *ins
->obufp
++ = 'x';
10905 *ins
->obufp
++ = 'y';
10908 if (!ins
->vex
.evex
)
10919 /* These insns ignore ModR/M.mod: Force it to 3 for OP_E(). */
10920 ins
->modrm
.mod
= 3;
10921 if (!ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
10922 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10924 else if (l
== 1 && last
[0] == 'X')
10926 if (!ins
->vex
.evex
)
10928 if (ins
->intel_syntax
10929 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
10930 && !(sizeflag
& SUFFIX_ALWAYS
)))
10932 switch (ins
->vex
.length
)
10935 *ins
->obufp
++ = 'x';
10938 *ins
->obufp
++ = 'y';
10941 *ins
->obufp
++ = 'z';
10951 if (ins
->intel_syntax
)
10953 if (ins
->isa64
== intel64
&& (ins
->rex
& REX_W
))
10956 *ins
->obufp
++ = 'q';
10959 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10961 if (sizeflag
& DFLAG
)
10962 *ins
->obufp
++ = 'l';
10964 *ins
->obufp
++ = 'w';
10965 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10974 ins
->mnemonicendp
= ins
->obufp
;
10978 /* Add a style marker to *INS->obufp that encodes STYLE. This assumes that
10979 the buffer pointed to by INS->obufp has space. A style marker is made
10980 from the STYLE_MARKER_CHAR followed by STYLE converted to a single hex
10981 digit, followed by another STYLE_MARKER_CHAR. This function assumes
10982 that the number of styles is not greater than 16. */
10985 oappend_insert_style (instr_info
*ins
, enum disassembler_style style
)
10987 unsigned num
= (unsigned) style
;
10989 /* We currently assume that STYLE can be encoded as a single hex
10990 character. If more styles are added then this might start to fail,
10991 and we'll need to expand this code. */
10995 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
10996 *ins
->obufp
++ = (num
< 10 ? ('0' + num
)
10997 : ((num
< 16) ? ('a' + (num
- 10)) : '0'));
10998 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
11000 /* This final null character is not strictly necessary, after inserting a
11001 style marker we should always be inserting some additional content.
11002 However, having the buffer null terminated doesn't cost much, and make
11003 it easier to debug what's going on. Also, if we do ever forget to add
11004 any additional content after this style marker, then the buffer will
11005 still be well formed. */
11006 *ins
->obufp
= '\0';
11010 oappend_with_style (instr_info
*ins
, const char *s
,
11011 enum disassembler_style style
)
11013 oappend_insert_style (ins
, style
);
11014 ins
->obufp
= stpcpy (ins
->obufp
, s
);
11017 /* Add a single character C to the buffer pointer to by INS->obufp, marking
11018 the style for the character as STYLE. */
11021 oappend_char_with_style (instr_info
*ins
, const char c
,
11022 enum disassembler_style style
)
11024 oappend_insert_style (ins
, style
);
11026 *ins
->obufp
= '\0';
11029 /* Like oappend_char_with_style, but always uses dis_style_text. */
11032 oappend_char (instr_info
*ins
, const char c
)
11034 oappend_char_with_style (ins
, c
, dis_style_text
);
11038 append_seg (instr_info
*ins
)
11040 /* Only print the active segment register. */
11041 if (!ins
->active_seg_prefix
)
11044 ins
->used_prefixes
|= ins
->active_seg_prefix
;
11045 switch (ins
->active_seg_prefix
)
11048 oappend_register (ins
, att_names_seg
[1]);
11051 oappend_register (ins
, att_names_seg
[3]);
11054 oappend_register (ins
, att_names_seg
[2]);
11057 oappend_register (ins
, att_names_seg
[0]);
11060 oappend_register (ins
, att_names_seg
[4]);
11063 oappend_register (ins
, att_names_seg
[5]);
11068 oappend_char (ins
, ':');
11072 print_operand_value (instr_info
*ins
, bfd_vma disp
,
11073 enum disassembler_style style
)
11077 if (ins
->address_mode
!= mode_64bit
)
11078 disp
&= 0xffffffff;
11079 sprintf (tmp
, "0x%" PRIx64
, (uint64_t) disp
);
11080 oappend_with_style (ins
, tmp
, style
);
11083 /* Like oappend, but called for immediate operands. */
11086 oappend_immediate (instr_info
*ins
, bfd_vma imm
)
11088 if (!ins
->intel_syntax
)
11089 oappend_char_with_style (ins
, '$', dis_style_immediate
);
11090 print_operand_value (ins
, imm
, dis_style_immediate
);
11093 /* Put DISP in BUF as signed hex number. */
11096 print_displacement (instr_info
*ins
, bfd_signed_vma val
)
11102 oappend_char_with_style (ins
, '-', dis_style_address_offset
);
11103 val
= (bfd_vma
) 0 - val
;
11105 /* Check for possible overflow. */
11108 switch (ins
->address_mode
)
11111 oappend_with_style (ins
, "0x8000000000000000",
11112 dis_style_address_offset
);
11115 oappend_with_style (ins
, "0x80000000",
11116 dis_style_address_offset
);
11119 oappend_with_style (ins
, "0x8000",
11120 dis_style_address_offset
);
11127 sprintf (tmp
, "0x%" PRIx64
, (int64_t) val
);
11128 oappend_with_style (ins
, tmp
, dis_style_address_offset
);
11132 intel_operand_size (instr_info
*ins
, int bytemode
, int sizeflag
)
11134 /* Check if there is a broadcast, when evex.b is not treated as evex.nd. */
11135 if (ins
->vex
.b
&& ins
->evex_type
== evex_default
)
11137 if (!ins
->vex
.no_broadcast
)
11141 case evex_half_bcst_xmmq_mode
:
11143 oappend (ins
, "QWORD BCST ");
11145 oappend (ins
, "DWORD BCST ");
11148 case evex_half_bcst_xmmqh_mode
:
11149 case evex_half_bcst_xmmqdh_mode
:
11150 oappend (ins
, "WORD BCST ");
11153 ins
->vex
.no_broadcast
= true;
11163 oappend (ins
, "BYTE PTR ");
11168 oappend (ins
, "WORD PTR ");
11171 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11173 oappend (ins
, "QWORD PTR ");
11176 /* Fall through. */
11178 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11179 || (ins
->rex
& REX_W
)))
11181 oappend (ins
, "QWORD PTR ");
11184 /* Fall through. */
11189 if (ins
->rex
& REX_W
)
11190 oappend (ins
, "QWORD PTR ");
11191 else if (bytemode
== dq_mode
)
11192 oappend (ins
, "DWORD PTR ");
11195 if (sizeflag
& DFLAG
)
11196 oappend (ins
, "DWORD PTR ");
11198 oappend (ins
, "WORD PTR ");
11199 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11203 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
11204 *ins
->obufp
++ = 'D';
11205 oappend (ins
, "WORD PTR ");
11206 if (!(ins
->rex
& REX_W
))
11207 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11210 if (sizeflag
& DFLAG
)
11211 oappend (ins
, "QWORD PTR ");
11213 oappend (ins
, "DWORD PTR ");
11214 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11217 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11218 oappend (ins
, "WORD PTR ");
11220 oappend (ins
, "DWORD PTR ");
11221 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11225 oappend (ins
, "DWORD PTR ");
11229 oappend (ins
, "QWORD PTR ");
11232 if (ins
->address_mode
== mode_64bit
)
11233 oappend (ins
, "QWORD PTR ");
11235 oappend (ins
, "DWORD PTR ");
11238 if (sizeflag
& DFLAG
)
11239 oappend (ins
, "FWORD PTR ");
11241 oappend (ins
, "DWORD PTR ");
11242 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11245 oappend (ins
, "TBYTE PTR ");
11250 case evex_x_gscat_mode
:
11251 case evex_x_nobcst_mode
:
11255 switch (ins
->vex
.length
)
11258 oappend (ins
, "XMMWORD PTR ");
11261 oappend (ins
, "YMMWORD PTR ");
11264 oappend (ins
, "ZMMWORD PTR ");
11271 oappend (ins
, "XMMWORD PTR ");
11274 oappend (ins
, "XMMWORD PTR ");
11277 oappend (ins
, "YMMWORD PTR ");
11280 case evex_half_bcst_xmmqh_mode
:
11281 case evex_half_bcst_xmmq_mode
:
11282 switch (ins
->vex
.length
)
11286 oappend (ins
, "QWORD PTR ");
11289 oappend (ins
, "XMMWORD PTR ");
11292 oappend (ins
, "YMMWORD PTR ");
11299 if (!ins
->need_vex
)
11302 switch (ins
->vex
.length
)
11305 oappend (ins
, "WORD PTR ");
11308 oappend (ins
, "DWORD PTR ");
11311 oappend (ins
, "QWORD PTR ");
11318 case evex_half_bcst_xmmqdh_mode
:
11319 if (!ins
->need_vex
)
11322 switch (ins
->vex
.length
)
11325 oappend (ins
, "DWORD PTR ");
11328 oappend (ins
, "QWORD PTR ");
11331 oappend (ins
, "XMMWORD PTR ");
11338 if (!ins
->need_vex
)
11341 switch (ins
->vex
.length
)
11344 oappend (ins
, "QWORD PTR ");
11347 oappend (ins
, "YMMWORD PTR ");
11350 oappend (ins
, "ZMMWORD PTR ");
11357 oappend (ins
, "OWORD PTR ");
11359 case vex_vsib_d_w_dq_mode
:
11360 case vex_vsib_q_w_dq_mode
:
11361 if (!ins
->need_vex
)
11364 oappend (ins
, "QWORD PTR ");
11366 oappend (ins
, "DWORD PTR ");
11369 if (!ins
->need_vex
|| ins
->vex
.length
!= 128)
11372 oappend (ins
, "DWORD PTR ");
11374 oappend (ins
, "BYTE PTR ");
11377 if (!ins
->need_vex
)
11380 oappend (ins
, "QWORD PTR ");
11382 oappend (ins
, "WORD PTR ");
11392 print_register (instr_info
*ins
, unsigned int reg
, unsigned int rexmask
,
11393 int bytemode
, int sizeflag
)
11395 const char (*names
)[8];
11397 /* Masking is invalid for insns with GPR destination. Set the flag uniformly,
11398 as the consumer will inspect it only for the destination operand. */
11399 if (bytemode
!= mask_mode
&& ins
->vex
.mask_register_specifier
)
11400 ins
->illegal_masking
= true;
11402 USED_REX (rexmask
);
11403 if (ins
->rex
& rexmask
)
11405 if (ins
->rex2
& rexmask
)
11414 if (ins
->rex
|| ins
->rex2
)
11415 names
= att_names8rex
;
11417 names
= att_names8
;
11420 names
= att_names16
;
11425 names
= att_names32
;
11428 names
= att_names64
;
11432 names
= ins
->address_mode
== mode_64bit
? att_names64
: att_names32
;
11435 case bnd_swap_mode
:
11438 oappend (ins
, "(bad)");
11441 names
= att_names_bnd
;
11444 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11446 names
= att_names64
;
11449 /* Fall through. */
11451 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11452 || (ins
->rex
& REX_W
)))
11454 names
= att_names64
;
11458 /* Fall through. */
11463 if (ins
->rex
& REX_W
)
11464 names
= att_names64
;
11465 else if (bytemode
!= v_mode
&& bytemode
!= v_swap_mode
)
11466 names
= att_names32
;
11469 if (sizeflag
& DFLAG
)
11470 names
= att_names32
;
11472 names
= att_names16
;
11473 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11477 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11478 names
= att_names16
;
11480 names
= att_names32
;
11481 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11484 names
= (ins
->address_mode
== mode_64bit
11485 ? att_names64
: att_names32
);
11486 if (!(ins
->prefixes
& PREFIX_ADDR
))
11487 names
= (ins
->address_mode
== mode_16bit
11488 ? att_names16
: names
);
11491 /* Remove "addr16/addr32". */
11492 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
11493 names
= (ins
->address_mode
!= mode_32bit
11494 ? att_names32
: att_names16
);
11495 ins
->used_prefixes
|= PREFIX_ADDR
;
11502 oappend (ins
, "(bad)");
11505 names
= att_names_mask
;
11510 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
11513 oappend_register (ins
, names
[reg
]);
11517 get8s (instr_info
*ins
, bfd_vma
*res
)
11519 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
11521 *res
= ((bfd_vma
) *ins
->codep
++ ^ 0x80) - 0x80;
11526 get16 (instr_info
*ins
, bfd_vma
*res
)
11528 if (!fetch_code (ins
->info
, ins
->codep
+ 2))
11530 *res
= *ins
->codep
++;
11531 *res
|= (bfd_vma
) *ins
->codep
++ << 8;
11536 get16s (instr_info
*ins
, bfd_vma
*res
)
11538 if (!get16 (ins
, res
))
11540 *res
= (*res
^ 0x8000) - 0x8000;
11545 get32 (instr_info
*ins
, bfd_vma
*res
)
11547 if (!fetch_code (ins
->info
, ins
->codep
+ 4))
11549 *res
= *ins
->codep
++;
11550 *res
|= (bfd_vma
) *ins
->codep
++ << 8;
11551 *res
|= (bfd_vma
) *ins
->codep
++ << 16;
11552 *res
|= (bfd_vma
) *ins
->codep
++ << 24;
11557 get32s (instr_info
*ins
, bfd_vma
*res
)
11559 if (!get32 (ins
, res
))
11562 *res
= (*res
^ ((bfd_vma
) 1 << 31)) - ((bfd_vma
) 1 << 31);
11568 get64 (instr_info
*ins
, uint64_t *res
)
11573 if (!fetch_code (ins
->info
, ins
->codep
+ 8))
11576 a
|= (unsigned int) *ins
->codep
++ << 8;
11577 a
|= (unsigned int) *ins
->codep
++ << 16;
11578 a
|= (unsigned int) *ins
->codep
++ << 24;
11580 b
|= (unsigned int) *ins
->codep
++ << 8;
11581 b
|= (unsigned int) *ins
->codep
++ << 16;
11582 b
|= (unsigned int) *ins
->codep
++ << 24;
11583 *res
= a
+ ((uint64_t) b
<< 32);
11588 set_op (instr_info
*ins
, bfd_vma op
, bool riprel
)
11590 ins
->op_index
[ins
->op_ad
] = ins
->op_ad
;
11591 if (ins
->address_mode
== mode_64bit
)
11592 ins
->op_address
[ins
->op_ad
] = op
;
11593 else /* Mask to get a 32-bit address. */
11594 ins
->op_address
[ins
->op_ad
] = op
& 0xffffffff;
11595 ins
->op_riprel
[ins
->op_ad
] = riprel
;
11599 BadOp (instr_info
*ins
)
11601 /* Throw away prefixes and 1st. opcode byte. */
11602 struct dis_private
*priv
= ins
->info
->private_data
;
11604 ins
->codep
= priv
->the_buffer
+ ins
->nr_prefixes
+ ins
->need_vex
+ 1;
11605 ins
->obufp
= stpcpy (ins
->obufp
, "(bad)");
11610 OP_Skip_MODRM (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
11611 int sizeflag ATTRIBUTE_UNUSED
)
11613 if (ins
->modrm
.mod
!= 3)
11614 return BadOp (ins
);
11616 /* Skip mod/rm byte. */
11619 ins
->has_skipped_modrm
= true;
11624 OP_E_memory (instr_info
*ins
, int bytemode
, int sizeflag
)
11626 int add
= (ins
->rex
& REX_B
) ? 8 : 0;
11630 add
+= (ins
->rex2
& REX_B
) ? 16 : 0;
11632 /* Handles EVEX other than APX EVEX-promoted instructions. */
11633 if (ins
->vex
.evex
&& ins
->evex_type
== evex_default
)
11636 /* Zeroing-masking is invalid for memory destinations. Set the flag
11637 uniformly, as the consumer will inspect it only for the destination
11639 if (ins
->vex
.zeroing
)
11640 ins
->illegal_masking
= true;
11654 if (ins
->address_mode
!= mode_64bit
)
11662 case vex_vsib_d_w_dq_mode
:
11663 case vex_vsib_q_w_dq_mode
:
11664 case evex_x_gscat_mode
:
11665 shift
= ins
->vex
.w
? 3 : 2;
11668 case evex_half_bcst_xmmqh_mode
:
11669 case evex_half_bcst_xmmqdh_mode
:
11672 shift
= ins
->vex
.w
? 2 : 1;
11675 /* Fall through. */
11677 case evex_half_bcst_xmmq_mode
:
11680 shift
= ins
->vex
.w
? 3 : 2;
11683 /* Fall through. */
11688 case evex_x_nobcst_mode
:
11690 switch (ins
->vex
.length
)
11704 /* Make necessary corrections to shift for modes that need it. */
11705 if (bytemode
== xmmq_mode
11706 || bytemode
== evex_half_bcst_xmmqh_mode
11707 || bytemode
== evex_half_bcst_xmmq_mode
11708 || (bytemode
== ymmq_mode
&& ins
->vex
.length
== 128))
11710 else if (bytemode
== xmmqd_mode
11711 || bytemode
== evex_half_bcst_xmmqdh_mode
)
11713 else if (bytemode
== xmmdw_mode
)
11727 shift
= ins
->vex
.w
? 1 : 0;
11737 if (ins
->intel_syntax
)
11738 intel_operand_size (ins
, bytemode
, sizeflag
);
11741 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
11743 /* 32/64 bit address mode */
11752 int addr32flag
= !((sizeflag
& AFLAG
)
11753 || bytemode
== v_bnd_mode
11754 || bytemode
== v_bndmk_mode
11755 || bytemode
== bnd_mode
11756 || bytemode
== bnd_swap_mode
);
11757 bool check_gather
= false;
11758 const char (*indexes
)[8] = NULL
;
11761 base
= ins
->modrm
.rm
;
11765 vindex
= ins
->sib
.index
;
11767 if (ins
->rex
& REX_X
)
11771 case vex_vsib_d_w_dq_mode
:
11772 case vex_vsib_q_w_dq_mode
:
11773 if (!ins
->need_vex
)
11777 /* S/G EVEX insns require EVEX.X4 not to be set. */
11778 if (ins
->rex2
& REX_X
)
11780 oappend (ins
, "(bad)");
11786 check_gather
= ins
->obufp
== ins
->op_out
[1];
11789 switch (ins
->vex
.length
)
11792 indexes
= att_names_xmm
;
11796 || bytemode
== vex_vsib_q_w_dq_mode
)
11797 indexes
= att_names_ymm
;
11799 indexes
= att_names_xmm
;
11803 || bytemode
== vex_vsib_q_w_dq_mode
)
11804 indexes
= att_names_zmm
;
11806 indexes
= att_names_ymm
;
11813 if (ins
->rex2
& REX_X
)
11817 indexes
= ins
->address_mode
== mode_64bit
&& !addr32flag
11818 ? att_names64
: att_names32
;
11821 scale
= ins
->sib
.scale
;
11822 base
= ins
->sib
.base
;
11827 /* Check for mandatory SIB. */
11828 if (bytemode
== vex_vsib_d_w_dq_mode
11829 || bytemode
== vex_vsib_q_w_dq_mode
11830 || bytemode
== vex_sibmem_mode
)
11832 oappend (ins
, "(bad)");
11836 rbase
= base
+ add
;
11838 switch (ins
->modrm
.mod
)
11844 if (ins
->address_mode
== mode_64bit
&& !ins
->has_sib
)
11846 if (!get32s (ins
, &disp
))
11848 if (riprel
&& bytemode
== v_bndmk_mode
)
11850 oappend (ins
, "(bad)");
11856 if (!get8s (ins
, &disp
))
11858 if (ins
->vex
.evex
&& shift
> 0)
11862 if (!get32s (ins
, &disp
))
11872 && ins
->address_mode
!= mode_16bit
)
11874 if (ins
->address_mode
== mode_64bit
)
11878 /* Without base nor index registers, zero-extend the
11879 lower 32-bit displacement to 64 bits. */
11880 disp
&= 0xffffffff;
11887 /* In 32-bit mode, we need index register to tell [offset]
11888 from [eiz*1 + offset]. */
11893 havedisp
= (havebase
11895 || (ins
->has_sib
&& (indexes
|| scale
!= 0)));
11897 if (!ins
->intel_syntax
)
11898 if (ins
->modrm
.mod
!= 0 || base
== 5)
11900 if (havedisp
|| riprel
)
11901 print_displacement (ins
, disp
);
11903 print_operand_value (ins
, disp
, dis_style_address_offset
);
11906 set_op (ins
, disp
, true);
11907 oappend_char (ins
, '(');
11908 oappend_with_style (ins
, !addr32flag
? "%rip" : "%eip",
11909 dis_style_register
);
11910 oappend_char (ins
, ')');
11914 if ((havebase
|| indexes
|| needindex
|| needaddr32
|| riprel
)
11915 && (ins
->address_mode
!= mode_64bit
11916 || ((bytemode
!= v_bnd_mode
)
11917 && (bytemode
!= v_bndmk_mode
)
11918 && (bytemode
!= bnd_mode
)
11919 && (bytemode
!= bnd_swap_mode
))))
11920 ins
->used_prefixes
|= PREFIX_ADDR
;
11922 if (havedisp
|| (ins
->intel_syntax
&& riprel
))
11924 oappend_char (ins
, ins
->open_char
);
11925 if (ins
->intel_syntax
&& riprel
)
11927 set_op (ins
, disp
, true);
11928 oappend_with_style (ins
, !addr32flag
? "rip" : "eip",
11929 dis_style_register
);
11934 (ins
->address_mode
== mode_64bit
&& !addr32flag
11935 ? att_names64
: att_names32
)[rbase
]);
11938 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
11939 print index to tell base + index from base. */
11943 || (havebase
&& base
!= ESP_REG_NUM
))
11945 if (!ins
->intel_syntax
|| havebase
)
11946 oappend_char (ins
, ins
->separator_char
);
11949 if (ins
->address_mode
== mode_64bit
|| vindex
< 16)
11950 oappend_register (ins
, indexes
[vindex
]);
11952 oappend (ins
, "(bad)");
11955 oappend_register (ins
,
11956 ins
->address_mode
== mode_64bit
11961 oappend_char (ins
, ins
->scale_char
);
11962 oappend_char_with_style (ins
, '0' + (1 << scale
),
11963 dis_style_immediate
);
11966 if (ins
->intel_syntax
11967 && (disp
|| ins
->modrm
.mod
!= 0 || base
== 5))
11969 if (!havedisp
|| (bfd_signed_vma
) disp
>= 0)
11970 oappend_char (ins
, '+');
11972 print_displacement (ins
, disp
);
11974 print_operand_value (ins
, disp
, dis_style_address_offset
);
11977 oappend_char (ins
, ins
->close_char
);
11981 /* Both XMM/YMM/ZMM registers must be distinct. */
11982 int modrm_reg
= ins
->modrm
.reg
;
11984 if (ins
->rex
& REX_R
)
11986 if (ins
->rex2
& REX_R
)
11988 if (vindex
== modrm_reg
)
11989 oappend (ins
, "/(bad)");
11992 else if (ins
->intel_syntax
)
11994 if (ins
->modrm
.mod
!= 0 || base
== 5)
11996 if (!ins
->active_seg_prefix
)
11998 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
11999 oappend (ins
, ":");
12001 print_operand_value (ins
, disp
, dis_style_text
);
12005 else if (bytemode
== v_bnd_mode
12006 || bytemode
== v_bndmk_mode
12007 || bytemode
== bnd_mode
12008 || bytemode
== bnd_swap_mode
12009 || bytemode
== vex_vsib_d_w_dq_mode
12010 || bytemode
== vex_vsib_q_w_dq_mode
)
12012 oappend (ins
, "(bad)");
12017 /* 16 bit address mode */
12020 ins
->used_prefixes
|= ins
->prefixes
& PREFIX_ADDR
;
12021 switch (ins
->modrm
.mod
)
12024 if (ins
->modrm
.rm
== 6)
12027 if (!get16s (ins
, &disp
))
12032 if (!get8s (ins
, &disp
))
12034 if (ins
->vex
.evex
&& shift
> 0)
12039 if (!ins
->intel_syntax
)
12040 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6)
12041 print_displacement (ins
, disp
);
12043 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 6)
12045 oappend_char (ins
, ins
->open_char
);
12046 oappend (ins
, ins
->intel_syntax
? intel_index16
[ins
->modrm
.rm
]
12047 : att_index16
[ins
->modrm
.rm
]);
12048 if (ins
->intel_syntax
12049 && (disp
|| ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6))
12051 if ((bfd_signed_vma
) disp
>= 0)
12052 oappend_char (ins
, '+');
12053 print_displacement (ins
, disp
);
12056 oappend_char (ins
, ins
->close_char
);
12058 else if (ins
->intel_syntax
)
12060 if (!ins
->active_seg_prefix
)
12062 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12063 oappend (ins
, ":");
12065 print_operand_value (ins
, disp
& 0xffff, dis_style_text
);
12068 if (ins
->vex
.b
&& ins
->evex_type
== evex_default
)
12070 ins
->evex_used
|= EVEX_b_used
;
12072 /* Broadcast can only ever be valid for memory sources. */
12073 if (ins
->obufp
== ins
->op_out
[0])
12074 ins
->vex
.no_broadcast
= true;
12076 if (!ins
->vex
.no_broadcast
12077 && (!ins
->intel_syntax
|| !(ins
->evex_used
& EVEX_len_used
)))
12079 if (bytemode
== xh_mode
)
12081 switch (ins
->vex
.length
)
12084 oappend (ins
, "{1to8}");
12087 oappend (ins
, "{1to16}");
12090 oappend (ins
, "{1to32}");
12096 else if (bytemode
== q_mode
12097 || bytemode
== ymmq_mode
)
12098 ins
->vex
.no_broadcast
= true;
12099 else if (ins
->vex
.w
12100 || bytemode
== evex_half_bcst_xmmqdh_mode
12101 || bytemode
== evex_half_bcst_xmmq_mode
)
12103 switch (ins
->vex
.length
)
12106 oappend (ins
, "{1to2}");
12109 oappend (ins
, "{1to4}");
12112 oappend (ins
, "{1to8}");
12118 else if (bytemode
== x_mode
12119 || bytemode
== evex_half_bcst_xmmqh_mode
)
12121 switch (ins
->vex
.length
)
12124 oappend (ins
, "{1to4}");
12127 oappend (ins
, "{1to8}");
12130 oappend (ins
, "{1to16}");
12137 ins
->vex
.no_broadcast
= true;
12139 if (ins
->vex
.no_broadcast
)
12140 oappend (ins
, "{bad}");
12147 OP_E (instr_info
*ins
, int bytemode
, int sizeflag
)
12149 /* Skip mod/rm byte. */
12151 if (!ins
->has_skipped_modrm
)
12154 ins
->has_skipped_modrm
= true;
12157 if (ins
->modrm
.mod
== 3)
12159 if ((sizeflag
& SUFFIX_ALWAYS
)
12160 && (bytemode
== b_swap_mode
12161 || bytemode
== bnd_swap_mode
12162 || bytemode
== v_swap_mode
))
12163 swap_operand (ins
);
12165 print_register (ins
, ins
->modrm
.rm
, REX_B
, bytemode
, sizeflag
);
12169 /* Masking is invalid for insns with GPR-like memory destination. Set the
12170 flag uniformly, as the consumer will inspect it only for the destination
12172 if (ins
->vex
.mask_register_specifier
)
12173 ins
->illegal_masking
= true;
12175 return OP_E_memory (ins
, bytemode
, sizeflag
);
12179 OP_indirE (instr_info
*ins
, int bytemode
, int sizeflag
)
12181 if (ins
->modrm
.mod
== 3 && bytemode
== f_mode
)
12182 /* bad lcall/ljmp */
12183 return BadOp (ins
);
12184 if (!ins
->intel_syntax
)
12185 oappend (ins
, "*");
12186 return OP_E (ins
, bytemode
, sizeflag
);
12190 OP_G (instr_info
*ins
, int bytemode
, int sizeflag
)
12192 print_register (ins
, ins
->modrm
.reg
, REX_R
, bytemode
, sizeflag
);
12197 OP_REG (instr_info
*ins
, int code
, int sizeflag
)
12204 case es_reg
: case ss_reg
: case cs_reg
:
12205 case ds_reg
: case fs_reg
: case gs_reg
:
12206 oappend_register (ins
, att_names_seg
[code
- es_reg
]);
12211 if (ins
->rex
& REX_B
)
12213 if (ins
->rex2
& REX_B
)
12218 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
12219 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
12220 s
= att_names16
[code
- ax_reg
+ add
];
12222 case ah_reg
: case ch_reg
: case dh_reg
: case bh_reg
:
12224 /* Fall through. */
12225 case al_reg
: case cl_reg
: case dl_reg
: case bl_reg
:
12227 s
= att_names8rex
[code
- al_reg
+ add
];
12229 s
= att_names8
[code
- al_reg
];
12231 case rAX_reg
: case rCX_reg
: case rDX_reg
: case rBX_reg
:
12232 case rSP_reg
: case rBP_reg
: case rSI_reg
: case rDI_reg
:
12233 if (ins
->address_mode
== mode_64bit
12234 && ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12236 s
= att_names64
[code
- rAX_reg
+ add
];
12239 code
+= eAX_reg
- rAX_reg
;
12240 /* Fall through. */
12241 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
12242 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
12244 if (ins
->rex
& REX_W
)
12245 s
= att_names64
[code
- eAX_reg
+ add
];
12248 if (sizeflag
& DFLAG
)
12249 s
= att_names32
[code
- eAX_reg
+ add
];
12251 s
= att_names16
[code
- eAX_reg
+ add
];
12252 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12256 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12259 oappend_register (ins
, s
);
12264 OP_IMREG (instr_info
*ins
, int code
, int sizeflag
)
12271 if (!ins
->intel_syntax
)
12273 oappend (ins
, "(%dx)");
12276 s
= att_names16
[dx_reg
- ax_reg
];
12278 case al_reg
: case cl_reg
:
12279 s
= att_names8
[code
- al_reg
];
12283 if (ins
->rex
& REX_W
)
12288 /* Fall through. */
12289 case z_mode_ax_reg
:
12290 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
12294 if (!(ins
->rex
& REX_W
))
12295 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12298 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12301 oappend_register (ins
, s
);
12306 OP_I (instr_info
*ins
, int bytemode
, int sizeflag
)
12313 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
12315 op
= *ins
->codep
++;
12319 if (ins
->rex
& REX_W
)
12321 if (!get32s (ins
, &op
))
12326 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12327 if (sizeflag
& DFLAG
)
12330 if (!get32 (ins
, &op
))
12335 /* Fall through. */
12337 if (!get16 (ins
, &op
))
12343 if (ins
->intel_syntax
)
12344 oappend (ins
, "1");
12346 oappend (ins
, "$1");
12349 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12353 oappend_immediate (ins
, op
);
12358 OP_I64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12362 if (bytemode
!= v_mode
|| ins
->address_mode
!= mode_64bit
12363 || !(ins
->rex
& REX_W
))
12364 return OP_I (ins
, bytemode
, sizeflag
);
12368 if (!get64 (ins
, &op
))
12371 oappend_immediate (ins
, op
);
12376 OP_sI (instr_info
*ins
, int bytemode
, int sizeflag
)
12384 if (!get8s (ins
, &op
))
12386 if (bytemode
== b_T_mode
)
12388 if (ins
->address_mode
!= mode_64bit
12389 || !((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12391 /* The operand-size prefix is overridden by a REX prefix. */
12392 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12400 if (!(ins
->rex
& REX_W
))
12402 if (sizeflag
& DFLAG
)
12410 /* The operand-size prefix is overridden by a REX prefix. */
12411 if (!(sizeflag
& DFLAG
) && !(ins
->rex
& REX_W
))
12413 if (!get16 (ins
, &op
))
12416 else if (!get32s (ins
, &op
))
12420 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12424 oappend_immediate (ins
, op
);
12429 OP_J (instr_info
*ins
, int bytemode
, int sizeflag
)
12433 bfd_vma segment
= 0;
12438 if (!get8s (ins
, &disp
))
12443 if ((sizeflag
& DFLAG
)
12444 || (ins
->address_mode
== mode_64bit
12445 && ((ins
->isa64
== intel64
&& bytemode
!= dqw_mode
)
12446 || (ins
->rex
& REX_W
))))
12448 if (!get32s (ins
, &disp
))
12453 if (!get16s (ins
, &disp
))
12455 /* In 16bit mode, address is wrapped around at 64k within
12456 the same segment. Otherwise, a data16 prefix on a jump
12457 instruction means that the pc is masked to 16 bits after
12458 the displacement is added! */
12460 if ((ins
->prefixes
& PREFIX_DATA
) == 0)
12461 segment
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
))
12462 & ~((bfd_vma
) 0xffff));
12464 if (ins
->address_mode
!= mode_64bit
12465 || (ins
->isa64
!= intel64
&& !(ins
->rex
& REX_W
)))
12466 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12469 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12472 disp
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
) + disp
) & mask
)
12474 set_op (ins
, disp
, false);
12475 print_operand_value (ins
, disp
, dis_style_text
);
12480 OP_SEG (instr_info
*ins
, int bytemode
, int sizeflag
)
12482 if (bytemode
== w_mode
)
12484 oappend_register (ins
, att_names_seg
[ins
->modrm
.reg
]);
12487 return OP_E (ins
, ins
->modrm
.mod
== 3 ? bytemode
: w_mode
, sizeflag
);
12491 OP_DIR (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
, int sizeflag
)
12493 bfd_vma seg
, offset
;
12497 if (sizeflag
& DFLAG
)
12499 if (!get32 (ins
, &offset
))
12502 else if (!get16 (ins
, &offset
))
12504 if (!get16 (ins
, &seg
))
12506 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12508 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12509 ins
->intel_syntax
? "0x%x:0x%x" : "$0x%x,$0x%x",
12510 (unsigned) seg
, (unsigned) offset
);
12511 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12513 oappend (ins
, scratch
);
12518 OP_OFF (instr_info
*ins
, int bytemode
, int sizeflag
)
12522 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12523 intel_operand_size (ins
, bytemode
, sizeflag
);
12526 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
12528 if (!get32 (ins
, &off
))
12533 if (!get16 (ins
, &off
))
12537 if (ins
->intel_syntax
)
12539 if (!ins
->active_seg_prefix
)
12541 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12542 oappend (ins
, ":");
12545 print_operand_value (ins
, off
, dis_style_address_offset
);
12550 OP_OFF64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12554 if (ins
->address_mode
!= mode_64bit
12555 || (ins
->prefixes
& PREFIX_ADDR
))
12556 return OP_OFF (ins
, bytemode
, sizeflag
);
12558 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12559 intel_operand_size (ins
, bytemode
, sizeflag
);
12562 if (!get64 (ins
, &off
))
12565 if (ins
->intel_syntax
)
12567 if (!ins
->active_seg_prefix
)
12569 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12570 oappend (ins
, ":");
12573 print_operand_value (ins
, off
, dis_style_address_offset
);
12578 ptr_reg (instr_info
*ins
, int code
, int sizeflag
)
12582 *ins
->obufp
++ = ins
->open_char
;
12583 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
12584 if (ins
->address_mode
== mode_64bit
)
12586 if (!(sizeflag
& AFLAG
))
12587 s
= att_names32
[code
- eAX_reg
];
12589 s
= att_names64
[code
- eAX_reg
];
12591 else if (sizeflag
& AFLAG
)
12592 s
= att_names32
[code
- eAX_reg
];
12594 s
= att_names16
[code
- eAX_reg
];
12595 oappend_register (ins
, s
);
12596 oappend_char (ins
, ins
->close_char
);
12600 OP_ESreg (instr_info
*ins
, int code
, int sizeflag
)
12602 if (ins
->intel_syntax
)
12604 switch (ins
->codep
[-1])
12606 case 0x6d: /* insw/insl */
12607 intel_operand_size (ins
, z_mode
, sizeflag
);
12609 case 0xa5: /* movsw/movsl/movsq */
12610 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12611 case 0xab: /* stosw/stosl */
12612 case 0xaf: /* scasw/scasl */
12613 intel_operand_size (ins
, v_mode
, sizeflag
);
12616 intel_operand_size (ins
, b_mode
, sizeflag
);
12619 oappend_register (ins
, att_names_seg
[0]);
12620 oappend_char (ins
, ':');
12621 ptr_reg (ins
, code
, sizeflag
);
12626 OP_DSreg (instr_info
*ins
, int code
, int sizeflag
)
12628 if (ins
->intel_syntax
)
12630 switch (ins
->codep
[-1])
12632 case 0x6f: /* outsw/outsl */
12633 intel_operand_size (ins
, z_mode
, sizeflag
);
12635 case 0xa5: /* movsw/movsl/movsq */
12636 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12637 case 0xad: /* lodsw/lodsl/lodsq */
12638 intel_operand_size (ins
, v_mode
, sizeflag
);
12641 intel_operand_size (ins
, b_mode
, sizeflag
);
12644 /* Set ins->active_seg_prefix to PREFIX_DS if it is unset so that the
12645 default segment register DS is printed. */
12646 if (!ins
->active_seg_prefix
)
12647 ins
->active_seg_prefix
= PREFIX_DS
;
12649 ptr_reg (ins
, code
, sizeflag
);
12654 OP_C (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12655 int sizeflag ATTRIBUTE_UNUSED
)
12660 if (ins
->rex
& REX_R
)
12665 else if (ins
->address_mode
!= mode_64bit
&& (ins
->prefixes
& PREFIX_LOCK
))
12667 ins
->all_prefixes
[ins
->last_lock_prefix
] = 0;
12668 ins
->used_prefixes
|= PREFIX_LOCK
;
12673 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%cr%d",
12674 ins
->modrm
.reg
+ add
);
12675 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12677 oappend_register (ins
, scratch
);
12682 OP_D (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12683 int sizeflag ATTRIBUTE_UNUSED
)
12689 if (ins
->rex
& REX_R
)
12693 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12694 ins
->intel_syntax
? "dr%d" : "%%db%d",
12695 ins
->modrm
.reg
+ add
);
12696 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12698 oappend (ins
, scratch
);
12703 OP_T (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12704 int sizeflag ATTRIBUTE_UNUSED
)
12709 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%tr%d", ins
->modrm
.reg
);
12710 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12712 oappend_register (ins
, scratch
);
12717 OP_MMX (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12718 int sizeflag ATTRIBUTE_UNUSED
)
12720 int reg
= ins
->modrm
.reg
;
12721 const char (*names
)[8];
12723 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12724 if (ins
->prefixes
& PREFIX_DATA
)
12726 names
= att_names_xmm
;
12728 if (ins
->rex
& REX_R
)
12732 names
= att_names_mm
;
12733 oappend_register (ins
, names
[reg
]);
12738 print_vector_reg (instr_info
*ins
, unsigned int reg
, int bytemode
)
12740 const char (*names
)[8];
12742 if (bytemode
== xmmq_mode
12743 || bytemode
== evex_half_bcst_xmmqh_mode
12744 || bytemode
== evex_half_bcst_xmmq_mode
)
12746 switch (ins
->vex
.length
)
12751 names
= att_names_xmm
;
12754 names
= att_names_ymm
;
12755 ins
->evex_used
|= EVEX_len_used
;
12761 else if (bytemode
== ymm_mode
)
12762 names
= att_names_ymm
;
12763 else if (bytemode
== tmm_mode
)
12767 oappend (ins
, "(bad)");
12770 names
= att_names_tmm
;
12772 else if (ins
->need_vex
12773 && bytemode
!= xmm_mode
12774 && bytemode
!= scalar_mode
12775 && bytemode
!= xmmdw_mode
12776 && bytemode
!= xmmqd_mode
12777 && bytemode
!= evex_half_bcst_xmmqdh_mode
12778 && bytemode
!= w_swap_mode
12779 && bytemode
!= b_mode
12780 && bytemode
!= w_mode
12781 && bytemode
!= d_mode
12782 && bytemode
!= q_mode
)
12784 ins
->evex_used
|= EVEX_len_used
;
12785 switch (ins
->vex
.length
)
12788 names
= att_names_xmm
;
12792 || bytemode
!= vex_vsib_q_w_dq_mode
)
12793 names
= att_names_ymm
;
12795 names
= att_names_xmm
;
12799 || bytemode
!= vex_vsib_q_w_dq_mode
)
12800 names
= att_names_zmm
;
12802 names
= att_names_ymm
;
12809 names
= att_names_xmm
;
12810 oappend_register (ins
, names
[reg
]);
12814 OP_XMM (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
12816 unsigned int reg
= ins
->modrm
.reg
;
12819 if (ins
->rex
& REX_R
)
12823 if (ins
->rex2
& REX_R
)
12827 if (bytemode
== tmm_mode
)
12828 ins
->modrm
.reg
= reg
;
12829 else if (bytemode
== scalar_mode
)
12830 ins
->vex
.no_broadcast
= true;
12832 print_vector_reg (ins
, reg
, bytemode
);
12837 OP_EM (instr_info
*ins
, int bytemode
, int sizeflag
)
12840 const char (*names
)[8];
12842 if (ins
->modrm
.mod
!= 3)
12844 if (ins
->intel_syntax
12845 && (bytemode
== v_mode
|| bytemode
== v_swap_mode
))
12847 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
12848 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12850 return OP_E (ins
, bytemode
, sizeflag
);
12853 if ((sizeflag
& SUFFIX_ALWAYS
) && bytemode
== v_swap_mode
)
12854 swap_operand (ins
);
12856 /* Skip mod/rm byte. */
12859 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12860 reg
= ins
->modrm
.rm
;
12861 if (ins
->prefixes
& PREFIX_DATA
)
12863 names
= att_names_xmm
;
12865 if (ins
->rex
& REX_B
)
12869 names
= att_names_mm
;
12870 oappend_register (ins
, names
[reg
]);
12874 /* cvt* are the only instructions in sse2 which have
12875 both SSE and MMX operands and also have 0x66 prefix
12876 in their opcode. 0x66 was originally used to differentiate
12877 between SSE and MMX instruction(operands). So we have to handle the
12878 cvt* separately using OP_EMC and OP_MXC */
12880 OP_EMC (instr_info
*ins
, int bytemode
, int sizeflag
)
12882 if (ins
->modrm
.mod
!= 3)
12884 if (ins
->intel_syntax
&& bytemode
== v_mode
)
12886 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
12887 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12889 return OP_E (ins
, bytemode
, sizeflag
);
12892 /* Skip mod/rm byte. */
12895 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12896 oappend_register (ins
, att_names_mm
[ins
->modrm
.rm
]);
12901 OP_MXC (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12902 int sizeflag ATTRIBUTE_UNUSED
)
12904 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12905 oappend_register (ins
, att_names_mm
[ins
->modrm
.reg
]);
12910 OP_EX (instr_info
*ins
, int bytemode
, int sizeflag
)
12914 /* Skip mod/rm byte. */
12918 if (bytemode
== dq_mode
)
12919 bytemode
= ins
->vex
.w
? q_mode
: d_mode
;
12921 if (ins
->modrm
.mod
!= 3)
12922 return OP_E_memory (ins
, bytemode
, sizeflag
);
12924 reg
= ins
->modrm
.rm
;
12926 if (ins
->rex
& REX_B
)
12928 if (ins
->rex2
& REX_B
)
12933 if ((ins
->rex
& REX_X
))
12937 if ((sizeflag
& SUFFIX_ALWAYS
)
12938 && (bytemode
== x_swap_mode
12939 || bytemode
== w_swap_mode
12940 || bytemode
== d_swap_mode
12941 || bytemode
== q_swap_mode
))
12942 swap_operand (ins
);
12944 if (bytemode
== tmm_mode
)
12945 ins
->modrm
.rm
= reg
;
12947 print_vector_reg (ins
, reg
, bytemode
);
12952 OP_R (instr_info
*ins
, int bytemode
, int sizeflag
)
12954 if (ins
->modrm
.mod
!= 3)
12955 return BadOp (ins
);
12963 return OP_E (ins
, bytemode
, sizeflag
);
12965 return OP_EM (ins
, x_mode
, sizeflag
);
12967 if (ins
->vex
.length
<= 128)
12969 return BadOp (ins
);
12972 return OP_EX (ins
, bytemode
, sizeflag
);
12976 OP_M (instr_info
*ins
, int bytemode
, int sizeflag
)
12978 /* Skip mod/rm byte. */
12982 if (ins
->modrm
.mod
== 3)
12983 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
12984 return BadOp (ins
);
12986 if (bytemode
== x_mode
)
12987 ins
->vex
.no_broadcast
= true;
12989 return OP_E_memory (ins
, bytemode
, sizeflag
);
12993 OP_0f07 (instr_info
*ins
, int bytemode
, int sizeflag
)
12995 if (ins
->modrm
.mod
!= 3 || ins
->modrm
.rm
!= 0)
12996 return BadOp (ins
);
12997 return OP_E (ins
, bytemode
, sizeflag
);
13000 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
13001 32bit mode and "xchg %rax,%rax" in 64bit mode. */
13004 NOP_Fixup (instr_info
*ins
, int opnd
, int sizeflag
)
13006 if ((ins
->prefixes
& PREFIX_DATA
) == 0 && (ins
->rex
& REX_B
) == 0)
13008 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop");
13012 return OP_REG (ins
, eAX_reg
, sizeflag
);
13013 return OP_IMREG (ins
, eAX_reg
, sizeflag
);
13016 static const char *const Suffix3DNow
[] = {
13017 /* 00 */ NULL
, NULL
, NULL
, NULL
,
13018 /* 04 */ NULL
, NULL
, NULL
, NULL
,
13019 /* 08 */ NULL
, NULL
, NULL
, NULL
,
13020 /* 0C */ "pi2fw", "pi2fd", NULL
, NULL
,
13021 /* 10 */ NULL
, NULL
, NULL
, NULL
,
13022 /* 14 */ NULL
, NULL
, NULL
, NULL
,
13023 /* 18 */ NULL
, NULL
, NULL
, NULL
,
13024 /* 1C */ "pf2iw", "pf2id", NULL
, NULL
,
13025 /* 20 */ NULL
, NULL
, NULL
, NULL
,
13026 /* 24 */ NULL
, NULL
, NULL
, NULL
,
13027 /* 28 */ NULL
, NULL
, NULL
, NULL
,
13028 /* 2C */ NULL
, NULL
, NULL
, NULL
,
13029 /* 30 */ NULL
, NULL
, NULL
, NULL
,
13030 /* 34 */ NULL
, NULL
, NULL
, NULL
,
13031 /* 38 */ NULL
, NULL
, NULL
, NULL
,
13032 /* 3C */ NULL
, NULL
, NULL
, NULL
,
13033 /* 40 */ NULL
, NULL
, NULL
, NULL
,
13034 /* 44 */ NULL
, NULL
, NULL
, NULL
,
13035 /* 48 */ NULL
, NULL
, NULL
, NULL
,
13036 /* 4C */ NULL
, NULL
, NULL
, NULL
,
13037 /* 50 */ NULL
, NULL
, NULL
, NULL
,
13038 /* 54 */ NULL
, NULL
, NULL
, NULL
,
13039 /* 58 */ NULL
, NULL
, NULL
, NULL
,
13040 /* 5C */ NULL
, NULL
, NULL
, NULL
,
13041 /* 60 */ NULL
, NULL
, NULL
, NULL
,
13042 /* 64 */ NULL
, NULL
, NULL
, NULL
,
13043 /* 68 */ NULL
, NULL
, NULL
, NULL
,
13044 /* 6C */ NULL
, NULL
, NULL
, NULL
,
13045 /* 70 */ NULL
, NULL
, NULL
, NULL
,
13046 /* 74 */ NULL
, NULL
, NULL
, NULL
,
13047 /* 78 */ NULL
, NULL
, NULL
, NULL
,
13048 /* 7C */ NULL
, NULL
, NULL
, NULL
,
13049 /* 80 */ NULL
, NULL
, NULL
, NULL
,
13050 /* 84 */ NULL
, NULL
, NULL
, NULL
,
13051 /* 88 */ NULL
, NULL
, "pfnacc", NULL
,
13052 /* 8C */ NULL
, NULL
, "pfpnacc", NULL
,
13053 /* 90 */ "pfcmpge", NULL
, NULL
, NULL
,
13054 /* 94 */ "pfmin", NULL
, "pfrcp", "pfrsqrt",
13055 /* 98 */ NULL
, NULL
, "pfsub", NULL
,
13056 /* 9C */ NULL
, NULL
, "pfadd", NULL
,
13057 /* A0 */ "pfcmpgt", NULL
, NULL
, NULL
,
13058 /* A4 */ "pfmax", NULL
, "pfrcpit1", "pfrsqit1",
13059 /* A8 */ NULL
, NULL
, "pfsubr", NULL
,
13060 /* AC */ NULL
, NULL
, "pfacc", NULL
,
13061 /* B0 */ "pfcmpeq", NULL
, NULL
, NULL
,
13062 /* B4 */ "pfmul", NULL
, "pfrcpit2", "pmulhrw",
13063 /* B8 */ NULL
, NULL
, NULL
, "pswapd",
13064 /* BC */ NULL
, NULL
, NULL
, "pavgusb",
13065 /* C0 */ NULL
, NULL
, NULL
, NULL
,
13066 /* C4 */ NULL
, NULL
, NULL
, NULL
,
13067 /* C8 */ NULL
, NULL
, NULL
, NULL
,
13068 /* CC */ NULL
, NULL
, NULL
, NULL
,
13069 /* D0 */ NULL
, NULL
, NULL
, NULL
,
13070 /* D4 */ NULL
, NULL
, NULL
, NULL
,
13071 /* D8 */ NULL
, NULL
, NULL
, NULL
,
13072 /* DC */ NULL
, NULL
, NULL
, NULL
,
13073 /* E0 */ NULL
, NULL
, NULL
, NULL
,
13074 /* E4 */ NULL
, NULL
, NULL
, NULL
,
13075 /* E8 */ NULL
, NULL
, NULL
, NULL
,
13076 /* EC */ NULL
, NULL
, NULL
, NULL
,
13077 /* F0 */ NULL
, NULL
, NULL
, NULL
,
13078 /* F4 */ NULL
, NULL
, NULL
, NULL
,
13079 /* F8 */ NULL
, NULL
, NULL
, NULL
,
13080 /* FC */ NULL
, NULL
, NULL
, NULL
,
13084 OP_3DNowSuffix (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13085 int sizeflag ATTRIBUTE_UNUSED
)
13087 const char *mnemonic
;
13089 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13091 /* AMD 3DNow! instructions are specified by an opcode suffix in the
13092 place where an 8-bit immediate would normally go. ie. the last
13093 byte of the instruction. */
13094 ins
->obufp
= ins
->mnemonicendp
;
13095 mnemonic
= Suffix3DNow
[*ins
->codep
++];
13097 ins
->obufp
= stpcpy (ins
->obufp
, mnemonic
);
13100 /* Since a variable sized ins->modrm/ins->sib chunk is between the start
13101 of the opcode (0x0f0f) and the opcode suffix, we need to do
13102 all the ins->modrm processing first, and don't know until now that
13103 we have a bad opcode. This necessitates some cleaning up. */
13104 ins
->op_out
[0][0] = '\0';
13105 ins
->op_out
[1][0] = '\0';
13108 ins
->mnemonicendp
= ins
->obufp
;
13112 static const struct op simd_cmp_op
[] =
13114 { STRING_COMMA_LEN ("eq") },
13115 { STRING_COMMA_LEN ("lt") },
13116 { STRING_COMMA_LEN ("le") },
13117 { STRING_COMMA_LEN ("unord") },
13118 { STRING_COMMA_LEN ("neq") },
13119 { STRING_COMMA_LEN ("nlt") },
13120 { STRING_COMMA_LEN ("nle") },
13121 { STRING_COMMA_LEN ("ord") }
13124 static const struct op vex_cmp_op
[] =
13126 { STRING_COMMA_LEN ("eq_uq") },
13127 { STRING_COMMA_LEN ("nge") },
13128 { STRING_COMMA_LEN ("ngt") },
13129 { STRING_COMMA_LEN ("false") },
13130 { STRING_COMMA_LEN ("neq_oq") },
13131 { STRING_COMMA_LEN ("ge") },
13132 { STRING_COMMA_LEN ("gt") },
13133 { STRING_COMMA_LEN ("true") },
13134 { STRING_COMMA_LEN ("eq_os") },
13135 { STRING_COMMA_LEN ("lt_oq") },
13136 { STRING_COMMA_LEN ("le_oq") },
13137 { STRING_COMMA_LEN ("unord_s") },
13138 { STRING_COMMA_LEN ("neq_us") },
13139 { STRING_COMMA_LEN ("nlt_uq") },
13140 { STRING_COMMA_LEN ("nle_uq") },
13141 { STRING_COMMA_LEN ("ord_s") },
13142 { STRING_COMMA_LEN ("eq_us") },
13143 { STRING_COMMA_LEN ("nge_uq") },
13144 { STRING_COMMA_LEN ("ngt_uq") },
13145 { STRING_COMMA_LEN ("false_os") },
13146 { STRING_COMMA_LEN ("neq_os") },
13147 { STRING_COMMA_LEN ("ge_oq") },
13148 { STRING_COMMA_LEN ("gt_oq") },
13149 { STRING_COMMA_LEN ("true_us") },
13153 CMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13154 int sizeflag ATTRIBUTE_UNUSED
)
13156 unsigned int cmp_type
;
13158 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13160 cmp_type
= *ins
->codep
++;
13161 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
))
13164 char *p
= ins
->mnemonicendp
- 2;
13168 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13169 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13171 else if (ins
->need_vex
13172 && cmp_type
< ARRAY_SIZE (simd_cmp_op
) + ARRAY_SIZE (vex_cmp_op
))
13175 char *p
= ins
->mnemonicendp
- 2;
13179 cmp_type
-= ARRAY_SIZE (simd_cmp_op
);
13180 sprintf (p
, "%s%s", vex_cmp_op
[cmp_type
].name
, suffix
);
13181 ins
->mnemonicendp
+= vex_cmp_op
[cmp_type
].len
;
13185 /* We have a reserved extension byte. Output it directly. */
13186 oappend_immediate (ins
, cmp_type
);
13192 OP_Mwait (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13194 /* mwait %eax,%ecx / mwaitx %eax,%ecx,%ebx */
13195 if (!ins
->intel_syntax
)
13197 strcpy (ins
->op_out
[0], att_names32
[0] + ins
->intel_syntax
);
13198 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13199 if (bytemode
== eBX_reg
)
13200 strcpy (ins
->op_out
[2], att_names32
[3] + ins
->intel_syntax
);
13201 ins
->two_source_ops
= true;
13203 /* Skip mod/rm byte. */
13210 OP_Monitor (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13211 int sizeflag ATTRIBUTE_UNUSED
)
13213 /* monitor %{e,r,}ax,%ecx,%edx" */
13214 if (!ins
->intel_syntax
)
13216 const char (*names
)[8] = (ins
->address_mode
== mode_64bit
13217 ? att_names64
: att_names32
);
13219 if (ins
->prefixes
& PREFIX_ADDR
)
13221 /* Remove "addr16/addr32". */
13222 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
13223 names
= (ins
->address_mode
!= mode_32bit
13224 ? att_names32
: att_names16
);
13225 ins
->used_prefixes
|= PREFIX_ADDR
;
13227 else if (ins
->address_mode
== mode_16bit
)
13228 names
= att_names16
;
13229 strcpy (ins
->op_out
[0], names
[0] + ins
->intel_syntax
);
13230 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13231 strcpy (ins
->op_out
[2], att_names32
[2] + ins
->intel_syntax
);
13232 ins
->two_source_ops
= true;
13234 /* Skip mod/rm byte. */
13241 REP_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13243 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
13245 if (ins
->prefixes
& PREFIX_REPZ
)
13246 ins
->all_prefixes
[ins
->last_repz_prefix
] = REP_PREFIX
;
13253 return OP_IMREG (ins
, bytemode
, sizeflag
);
13255 return OP_ESreg (ins
, bytemode
, sizeflag
);
13257 return OP_DSreg (ins
, bytemode
, sizeflag
);
13266 SEP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13267 int sizeflag ATTRIBUTE_UNUSED
)
13269 if (ins
->isa64
!= amd64
)
13272 ins
->obufp
= ins
->obuf
;
13274 ins
->mnemonicendp
= ins
->obufp
;
13279 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
13283 BND_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13284 int sizeflag ATTRIBUTE_UNUSED
)
13286 if (ins
->prefixes
& PREFIX_REPNZ
)
13287 ins
->all_prefixes
[ins
->last_repnz_prefix
] = BND_PREFIX
;
13291 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
13295 NOTRACK_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13296 int sizeflag ATTRIBUTE_UNUSED
)
13298 /* Since active_seg_prefix is not set in 64-bit mode, check whether
13299 we've seen a PREFIX_DS. */
13300 if ((ins
->prefixes
& PREFIX_DS
) != 0
13301 && (ins
->address_mode
!= mode_64bit
|| ins
->last_data_prefix
< 0))
13303 /* NOTRACK prefix is only valid on indirect branch instructions.
13304 NB: DATA prefix is unsupported for Intel64. */
13305 ins
->active_seg_prefix
= 0;
13306 ins
->all_prefixes
[ins
->last_seg_prefix
] = NOTRACK_PREFIX
;
13311 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13312 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
13316 HLE_Fixup1 (instr_info
*ins
, int bytemode
, int sizeflag
)
13318 if (ins
->modrm
.mod
!= 3
13319 && (ins
->prefixes
& PREFIX_LOCK
) != 0)
13321 if (ins
->prefixes
& PREFIX_REPZ
)
13322 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13323 if (ins
->prefixes
& PREFIX_REPNZ
)
13324 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13327 return OP_E (ins
, bytemode
, sizeflag
);
13330 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13331 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
13335 HLE_Fixup2 (instr_info
*ins
, int bytemode
, int sizeflag
)
13337 if (ins
->modrm
.mod
!= 3)
13339 if (ins
->prefixes
& PREFIX_REPZ
)
13340 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13341 if (ins
->prefixes
& PREFIX_REPNZ
)
13342 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13345 return OP_E (ins
, bytemode
, sizeflag
);
13348 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
13349 "xrelease" for memory operand. No check for LOCK prefix. */
13352 HLE_Fixup3 (instr_info
*ins
, int bytemode
, int sizeflag
)
13354 if (ins
->modrm
.mod
!= 3
13355 && ins
->last_repz_prefix
> ins
->last_repnz_prefix
13356 && (ins
->prefixes
& PREFIX_REPZ
) != 0)
13357 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13359 return OP_E (ins
, bytemode
, sizeflag
);
13363 CMPXCHG8B_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13366 if (ins
->rex
& REX_W
)
13368 /* Change cmpxchg8b to cmpxchg16b. */
13369 char *p
= ins
->mnemonicendp
- 2;
13370 ins
->mnemonicendp
= stpcpy (p
, "16b");
13373 else if ((ins
->prefixes
& PREFIX_LOCK
) != 0)
13375 if (ins
->prefixes
& PREFIX_REPZ
)
13376 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13377 if (ins
->prefixes
& PREFIX_REPNZ
)
13378 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13381 return OP_M (ins
, bytemode
, sizeflag
);
13385 XMM_Fixup (instr_info
*ins
, int reg
, int sizeflag ATTRIBUTE_UNUSED
)
13387 const char (*names
)[8] = att_names_xmm
;
13391 switch (ins
->vex
.length
)
13396 names
= att_names_ymm
;
13402 oappend_register (ins
, names
[reg
]);
13407 FXSAVE_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13409 /* Add proper suffix to "fxsave" and "fxrstor". */
13411 if (ins
->rex
& REX_W
)
13413 char *p
= ins
->mnemonicendp
;
13417 ins
->mnemonicendp
= p
;
13419 return OP_M (ins
, bytemode
, sizeflag
);
13422 /* Display the destination register operand for instructions with
13426 OP_VEX (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13428 int reg
, modrm_reg
, sib_index
= -1;
13429 const char (*names
)[8];
13431 if (!ins
->need_vex
)
13434 if (ins
->evex_type
== evex_from_legacy
)
13436 ins
->evex_used
|= EVEX_b_used
;
13441 reg
= ins
->vex
.register_specifier
;
13442 ins
->vex
.register_specifier
= 0;
13443 if (ins
->address_mode
!= mode_64bit
)
13445 if (ins
->vex
.evex
&& !ins
->vex
.v
)
13447 oappend (ins
, "(bad)");
13453 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13459 oappend_register (ins
, att_names_xmm
[reg
]);
13462 case vex_vsib_d_w_dq_mode
:
13463 case vex_vsib_q_w_dq_mode
:
13464 /* This must be the 3rd operand. */
13465 if (ins
->obufp
!= ins
->op_out
[2])
13467 if (ins
->vex
.length
== 128
13468 || (bytemode
!= vex_vsib_d_w_dq_mode
13470 oappend_register (ins
, att_names_xmm
[reg
]);
13472 oappend_register (ins
, att_names_ymm
[reg
]);
13474 /* All 3 XMM/YMM registers must be distinct. */
13475 modrm_reg
= ins
->modrm
.reg
;
13476 if (ins
->rex
& REX_R
)
13479 if (ins
->has_sib
&& ins
->modrm
.rm
== 4)
13481 sib_index
= ins
->sib
.index
;
13482 if (ins
->rex
& REX_X
)
13486 if (reg
== modrm_reg
|| reg
== sib_index
)
13487 strcpy (ins
->obufp
, "/(bad)");
13488 if (modrm_reg
== sib_index
|| modrm_reg
== reg
)
13489 strcat (ins
->op_out
[0], "/(bad)");
13490 if (sib_index
== modrm_reg
|| sib_index
== reg
)
13491 strcat (ins
->op_out
[1], "/(bad)");
13496 /* All 3 TMM registers must be distinct. */
13498 oappend (ins
, "(bad)");
13501 /* This must be the 3rd operand. */
13502 if (ins
->obufp
!= ins
->op_out
[2])
13504 oappend_register (ins
, att_names_tmm
[reg
]);
13505 if (reg
== ins
->modrm
.reg
|| reg
== ins
->modrm
.rm
)
13506 strcpy (ins
->obufp
, "/(bad)");
13509 if (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
13510 || ins
->modrm
.rm
== reg
)
13512 if (ins
->modrm
.reg
<= 8
13513 && (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
))
13514 strcat (ins
->op_out
[0], "/(bad)");
13515 if (ins
->modrm
.rm
<= 8
13516 && (ins
->modrm
.rm
== ins
->modrm
.reg
|| ins
->modrm
.rm
== reg
))
13517 strcat (ins
->op_out
[1], "/(bad)");
13523 switch (ins
->vex
.length
)
13529 names
= att_names_xmm
;
13530 ins
->evex_used
|= EVEX_len_used
;
13534 if (ins
->rex
& REX_W
)
13535 names
= att_names64
;
13536 else if (bytemode
== v_mode
13537 && !(sizeflag
& DFLAG
))
13538 names
= att_names16
;
13540 names
= att_names32
;
13543 names
= att_names8rex
;
13546 names
= att_names64
;
13552 oappend (ins
, "(bad)");
13555 names
= att_names_mask
;
13566 names
= att_names_ymm
;
13567 ins
->evex_used
|= EVEX_len_used
;
13573 names
= att_names_mask
;
13576 /* Fall through. */
13578 /* See PR binutils/20893 for a reproducer. */
13579 oappend (ins
, "(bad)");
13584 names
= att_names_zmm
;
13585 ins
->evex_used
|= EVEX_len_used
;
13591 oappend_register (ins
, names
[reg
]);
13596 OP_VexR (instr_info
*ins
, int bytemode
, int sizeflag
)
13598 if (ins
->modrm
.mod
== 3)
13599 return OP_VEX (ins
, bytemode
, sizeflag
);
13604 OP_VexW (instr_info
*ins
, int bytemode
, int sizeflag
)
13606 OP_VEX (ins
, bytemode
, sizeflag
);
13610 /* Swap 2nd and 3rd operands. */
13611 char *tmp
= ins
->op_out
[2];
13613 ins
->op_out
[2] = ins
->op_out
[1];
13614 ins
->op_out
[1] = tmp
;
13620 OP_REG_VexI4 (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13623 const char (*names
)[8] = att_names_xmm
;
13625 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13627 reg
= *ins
->codep
++;
13629 if (bytemode
!= x_mode
&& bytemode
!= scalar_mode
)
13633 if (ins
->address_mode
!= mode_64bit
)
13636 if (bytemode
== x_mode
&& ins
->vex
.length
== 256)
13637 names
= att_names_ymm
;
13639 oappend_register (ins
, names
[reg
]);
13643 /* Swap 3rd and 4th operands. */
13644 char *tmp
= ins
->op_out
[3];
13646 ins
->op_out
[3] = ins
->op_out
[2];
13647 ins
->op_out
[2] = tmp
;
13653 OP_VexI4 (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13654 int sizeflag ATTRIBUTE_UNUSED
)
13656 oappend_immediate (ins
, ins
->codep
[-1] & 0xf);
13661 VPCMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13662 int sizeflag ATTRIBUTE_UNUSED
)
13664 unsigned int cmp_type
;
13666 if (!ins
->vex
.evex
)
13669 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13671 cmp_type
= *ins
->codep
++;
13672 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
13673 If it's the case, print suffix, otherwise - print the immediate. */
13674 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
)
13679 char *p
= ins
->mnemonicendp
- 2;
13681 /* vpcmp* can have both one- and two-lettered suffix. */
13695 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13696 ins
->mnemonicendp
+= simd_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 xop_cmp_op
[] =
13708 { STRING_COMMA_LEN ("lt") },
13709 { STRING_COMMA_LEN ("le") },
13710 { STRING_COMMA_LEN ("gt") },
13711 { STRING_COMMA_LEN ("ge") },
13712 { STRING_COMMA_LEN ("eq") },
13713 { STRING_COMMA_LEN ("neq") },
13714 { STRING_COMMA_LEN ("false") },
13715 { STRING_COMMA_LEN ("true") }
13719 VPCOM_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13720 int sizeflag ATTRIBUTE_UNUSED
)
13722 unsigned int cmp_type
;
13724 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13726 cmp_type
= *ins
->codep
++;
13727 if (cmp_type
< ARRAY_SIZE (xop_cmp_op
))
13730 char *p
= ins
->mnemonicendp
- 2;
13732 /* vpcom* can have both one- and two-lettered suffix. */
13746 sprintf (p
, "%s%s", xop_cmp_op
[cmp_type
].name
, suffix
);
13747 ins
->mnemonicendp
+= xop_cmp_op
[cmp_type
].len
;
13751 /* We have a reserved extension byte. Output it directly. */
13752 oappend_immediate (ins
, cmp_type
);
13757 static const struct op pclmul_op
[] =
13759 { STRING_COMMA_LEN ("lql") },
13760 { STRING_COMMA_LEN ("hql") },
13761 { STRING_COMMA_LEN ("lqh") },
13762 { STRING_COMMA_LEN ("hqh") }
13766 PCLMUL_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13767 int sizeflag ATTRIBUTE_UNUSED
)
13769 unsigned int pclmul_type
;
13771 if (!fetch_code (ins
->info
, ins
->codep
+ 1))
13773 pclmul_type
= *ins
->codep
++;
13774 switch (pclmul_type
)
13785 if (pclmul_type
< ARRAY_SIZE (pclmul_op
))
13788 char *p
= ins
->mnemonicendp
- 3;
13793 sprintf (p
, "%s%s", pclmul_op
[pclmul_type
].name
, suffix
);
13794 ins
->mnemonicendp
+= pclmul_op
[pclmul_type
].len
;
13798 /* We have a reserved extension byte. Output it directly. */
13799 oappend_immediate (ins
, pclmul_type
);
13805 MOVSXD_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13807 /* Add proper suffix to "movsxd". */
13808 char *p
= ins
->mnemonicendp
;
13813 if (!ins
->intel_syntax
)
13816 if (ins
->rex
& REX_W
)
13828 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
13832 ins
->mnemonicendp
= p
;
13834 return OP_E (ins
, bytemode
, sizeflag
);
13838 DistinctDest_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13840 unsigned int reg
= ins
->vex
.register_specifier
;
13841 unsigned int modrm_reg
= ins
->modrm
.reg
;
13842 unsigned int modrm_rm
= ins
->modrm
.rm
;
13844 /* Calc destination register number. */
13845 if (ins
->rex
& REX_R
)
13847 if (ins
->rex2
& REX_R
)
13850 /* Calc src1 register number. */
13851 if (ins
->address_mode
!= mode_64bit
)
13853 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13856 /* Calc src2 register number. */
13857 if (ins
->modrm
.mod
== 3)
13859 if (ins
->rex
& REX_B
)
13861 if (ins
->rex
& REX_X
)
13865 /* Destination and source registers must be distinct, output bad if
13866 dest == src1 or dest == src2. */
13867 if (modrm_reg
== reg
13868 || (ins
->modrm
.mod
== 3
13869 && modrm_reg
== modrm_rm
))
13871 oappend (ins
, "(bad)");
13874 return OP_XMM (ins
, bytemode
, sizeflag
);
13878 OP_Rounding (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13880 if (ins
->modrm
.mod
!= 3 || !ins
->vex
.b
)
13885 case evex_rounding_64_mode
:
13886 if (ins
->address_mode
!= mode_64bit
|| !ins
->vex
.w
)
13888 /* Fall through. */
13889 case evex_rounding_mode
:
13890 ins
->evex_used
|= EVEX_b_used
;
13891 oappend (ins
, names_rounding
[ins
->vex
.ll
]);
13893 case evex_sae_mode
:
13894 ins
->evex_used
|= EVEX_b_used
;
13895 oappend (ins
, "{");
13900 oappend (ins
, "sae}");
13905 PREFETCHI_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13907 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 5)
13909 if (ins
->intel_syntax
)
13911 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop ");
13916 if (ins
->rex
& REX_W
)
13917 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopq ");
13920 if (sizeflag
& DFLAG
)
13921 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopl ");
13923 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nopw ");
13924 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
13930 return OP_M (ins
, bytemode
, sizeflag
);
13934 PUSH2_POP2_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13936 if (ins
->modrm
.mod
!= 3)
13939 unsigned int vvvv_reg
= ins
->vex
.register_specifier
13940 | (!ins
->vex
.v
<< 4);
13941 unsigned int rm_reg
= ins
->modrm
.rm
+ (ins
->rex
& REX_B
? 8 : 0)
13942 + (ins
->rex2
& REX_B
? 16 : 0);
13944 /* Push2/Pop2 cannot use RSP and Pop2 cannot pop two same registers. */
13945 if (!ins
->vex
.nd
|| vvvv_reg
== 0x4 || rm_reg
== 0x4
13946 || (!ins
->modrm
.reg
13947 && vvvv_reg
== rm_reg
))
13949 oappend (ins
, "(bad)");
13953 return OP_VEX (ins
, bytemode
, sizeflag
);
13957 JMPABS_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13959 if (ins
->last_rex2_prefix
>= 0)
13963 if ((ins
->prefixes
& (PREFIX_OPCODE
| PREFIX_ADDR
| PREFIX_LOCK
)) != 0x0
13964 || (ins
->rex
& REX_W
) != 0x0)
13966 oappend (ins
, "(bad)");
13970 if (bytemode
== eAX_reg
)
13973 if (!get64 (ins
, &op
))
13976 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "jmpabs");
13977 ins
->rex2
|= REX2_SPECIAL
;
13978 oappend_immediate (ins
, op
);
13983 if (bytemode
== eAX_reg
)
13984 return OP_IMREG (ins
, bytemode
, sizeflag
);
13985 return OP_OFF64 (ins
, bytemode
, sizeflag
);