1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2022 Free Software Foundation, Inc.
4 This file is part of the GNU opcodes library.
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 It is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
22 /* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
24 modified by John Hassey (hassey@dg-rtp.dg.com)
25 x86-64 support added by Jan Hubicka (jh@suse.cz)
26 VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */
28 /* The main tables describing the instructions is essentially a copy
29 of the "Opcode Map" chapter (Appendix A) of the Intel 80386
30 Programmers Manual. Usually, there is a capital letter, followed
31 by a small letter. The capital letter tell the addressing mode,
32 and the small letter tells about the operand size. Refer to
33 the Intel manual for details. */
36 #include "disassemble.h"
38 #include "opcode/i386.h"
39 #include "libiberty.h"
40 #include "safe-ctype.h"
43 typedef struct instr_info instr_info
;
45 static void dofloat (instr_info
*, int);
46 static void OP_ST (instr_info
*, int, int);
47 static void OP_STi (instr_info
*, int, int);
48 static int putop (instr_info
*, const char *, int);
49 static void oappend_with_style (instr_info
*, const char *,
50 enum disassembler_style
);
51 static void oappend (instr_info
*, const char *);
52 static void append_seg (instr_info
*);
53 static void OP_indirE (instr_info
*, int, int);
54 static void OP_E_memory (instr_info
*, int, int);
55 static void OP_E (instr_info
*, int, int);
56 static void OP_G (instr_info
*, int, int);
57 static bfd_vma
get64 (instr_info
*);
58 static bfd_signed_vma
get32 (instr_info
*);
59 static bfd_signed_vma
get32s (instr_info
*);
60 static int get16 (instr_info
*);
61 static void set_op (instr_info
*, bfd_vma
, bool);
62 static void OP_Skip_MODRM (instr_info
*, int, int);
63 static void OP_REG (instr_info
*, int, int);
64 static void OP_IMREG (instr_info
*, int, int);
65 static void OP_I (instr_info
*, int, int);
66 static void OP_I64 (instr_info
*, int, int);
67 static void OP_sI (instr_info
*, int, int);
68 static void OP_J (instr_info
*, int, int);
69 static void OP_SEG (instr_info
*, int, int);
70 static void OP_DIR (instr_info
*, int, int);
71 static void OP_OFF (instr_info
*, int, int);
72 static void OP_OFF64 (instr_info
*, int, int);
73 static void ptr_reg (instr_info
*, int, int);
74 static void OP_ESreg (instr_info
*, int, int);
75 static void OP_DSreg (instr_info
*, int, int);
76 static void OP_C (instr_info
*, int, int);
77 static void OP_D (instr_info
*, int, int);
78 static void OP_T (instr_info
*, int, int);
79 static void OP_MMX (instr_info
*, int, int);
80 static void OP_XMM (instr_info
*, int, int);
81 static void OP_EM (instr_info
*, int, int);
82 static void OP_EX (instr_info
*, int, int);
83 static void OP_EMC (instr_info
*, int,int);
84 static void OP_MXC (instr_info
*, int,int);
85 static void OP_MS (instr_info
*, int, int);
86 static void OP_XS (instr_info
*, int, int);
87 static void OP_M (instr_info
*, int, int);
88 static void OP_VEX (instr_info
*, int, int);
89 static void OP_VexR (instr_info
*, int, int);
90 static void OP_VexW (instr_info
*, int, int);
91 static void OP_Rounding (instr_info
*, int, int);
92 static void OP_REG_VexI4 (instr_info
*, int, int);
93 static void OP_VexI4 (instr_info
*, int, int);
94 static void PCLMUL_Fixup (instr_info
*, int, int);
95 static void VPCMP_Fixup (instr_info
*, int, int);
96 static void VPCOM_Fixup (instr_info
*, int, int);
97 static void OP_0f07 (instr_info
*, int, int);
98 static void OP_Monitor (instr_info
*, int, int);
99 static void OP_Mwait (instr_info
*, int, int);
100 static void NOP_Fixup (instr_info
*, int, int);
101 static void OP_3DNowSuffix (instr_info
*, int, int);
102 static void CMP_Fixup (instr_info
*, int, int);
103 static void BadOp (instr_info
*);
104 static void REP_Fixup (instr_info
*, int, int);
105 static void SEP_Fixup (instr_info
*, int, int);
106 static void BND_Fixup (instr_info
*, int, int);
107 static void NOTRACK_Fixup (instr_info
*, int, int);
108 static void HLE_Fixup1 (instr_info
*, int, int);
109 static void HLE_Fixup2 (instr_info
*, int, int);
110 static void HLE_Fixup3 (instr_info
*, int, int);
111 static void CMPXCHG8B_Fixup (instr_info
*, int, int);
112 static void XMM_Fixup (instr_info
*, int, int);
113 static void FXSAVE_Fixup (instr_info
*, int, int);
115 static void MOVSXD_Fixup (instr_info
*, int, int);
116 static void DistinctDest_Fixup (instr_info
*, int, int);
118 /* This character is used to encode style information within the output
119 buffers. See oappend_insert_style for more details. */
120 #define STYLE_MARKER_CHAR '\002'
122 /* The maximum operand buffer size. */
123 #define MAX_OPERAND_BUFFER_SIZE 128
126 /* Points to first byte not fetched. */
127 bfd_byte
*max_fetched
;
128 bfd_byte the_buffer
[MAX_MNEM_SIZE
];
131 OPCODES_SIGJMP_BUF bailout
;
149 enum address_mode address_mode
;
151 /* Flags for the prefixes for the current instruction. See below. */
154 /* REX prefix the current instruction. See below. */
156 /* Bits of REX we've already used. */
157 unsigned char rex_used
;
163 /* Flags for ins->prefixes which we somehow handled when printing the
164 current instruction. */
167 /* Flags for EVEX bits which we somehow handled when printing the
168 current instruction. */
171 char obuf
[MAX_OPERAND_BUFFER_SIZE
];
174 unsigned char *start_codep
;
175 unsigned char *insn_codep
;
176 unsigned char *codep
;
177 unsigned char *end_codep
;
178 signed char last_lock_prefix
;
179 signed char last_repz_prefix
;
180 signed char last_repnz_prefix
;
181 signed char last_data_prefix
;
182 signed char last_addr_prefix
;
183 signed char last_rex_prefix
;
184 signed char last_seg_prefix
;
185 signed char fwait_prefix
;
186 /* The active segment register prefix. */
187 unsigned char active_seg_prefix
;
189 #define MAX_CODE_LENGTH 15
190 /* We can up to 14 ins->prefixes since the maximum instruction length is
192 unsigned char all_prefixes
[MAX_CODE_LENGTH
- 1];
193 disassemble_info
*info
;
213 int register_specifier
;
216 int mask_register_specifier
;
228 /* Remember if the current op is a jump instruction. */
234 signed char op_index
[MAX_OPERANDS
];
235 bool op_riprel
[MAX_OPERANDS
];
236 char *op_out
[MAX_OPERANDS
];
237 bfd_vma op_address
[MAX_OPERANDS
];
240 /* On the 386's of 1988, the maximum length of an instruction is 15 bytes.
241 * (see topic "Redundant ins->prefixes" in the "Differences from 8086"
242 * section of the "Virtual 8086 Mode" chapter.)
243 * 'pc' should be the address of this instruction, it will
244 * be used to print the target address if this is a relative jump or call
245 * The function returns the length of this instruction in bytes.
254 enum x86_64_isa isa64
;
257 /* Mark parts used in the REX prefix. When we are testing for
258 empty prefix (for 8bit register REX extension), just mask it
259 out. Otherwise test for REX bit is excuse for existence of REX
260 only in case value is nonzero. */
261 #define USED_REX(value) \
265 if ((ins->rex & value)) \
266 ins->rex_used |= (value) | REX_OPCODE; \
269 ins->rex_used |= REX_OPCODE; \
273 #define EVEX_b_used 1
274 #define EVEX_len_used 2
276 /* Flags stored in PREFIXES. */
277 #define PREFIX_REPZ 1
278 #define PREFIX_REPNZ 2
281 #define PREFIX_DS 0x10
282 #define PREFIX_ES 0x20
283 #define PREFIX_FS 0x40
284 #define PREFIX_GS 0x80
285 #define PREFIX_LOCK 0x100
286 #define PREFIX_DATA 0x200
287 #define PREFIX_ADDR 0x400
288 #define PREFIX_FWAIT 0x800
290 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
291 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
293 #define FETCH_DATA(info, addr) \
294 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
295 ? 1 : fetch_data ((info), (addr)))
298 fetch_data (struct disassemble_info
*info
, bfd_byte
*addr
)
301 struct dis_private
*priv
= (struct dis_private
*) info
->private_data
;
302 bfd_vma start
= priv
->insn_start
+ (priv
->max_fetched
- priv
->the_buffer
);
304 if (addr
<= priv
->the_buffer
+ MAX_MNEM_SIZE
)
305 status
= (*info
->read_memory_func
) (start
,
307 addr
- priv
->max_fetched
,
313 /* If we did manage to read at least one byte, then
314 print_insn_i386 will do something sensible. Otherwise, print
315 an error. We do that here because this is where we know
317 if (priv
->max_fetched
== priv
->the_buffer
)
318 (*info
->memory_error_func
) (status
, start
, info
);
319 OPCODES_SIGLONGJMP (priv
->bailout
, 1);
322 priv
->max_fetched
= addr
;
326 /* Possible values for prefix requirement. */
327 #define PREFIX_IGNORED_SHIFT 16
328 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
329 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
330 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
331 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
332 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
334 /* Opcode prefixes. */
335 #define PREFIX_OPCODE (PREFIX_REPZ \
339 /* Prefixes ignored. */
340 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
341 | PREFIX_IGNORED_REPNZ \
342 | PREFIX_IGNORED_DATA)
344 #define XX { NULL, 0 }
345 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
347 #define Eb { OP_E, b_mode }
348 #define Ebnd { OP_E, bnd_mode }
349 #define EbS { OP_E, b_swap_mode }
350 #define EbndS { OP_E, bnd_swap_mode }
351 #define Ev { OP_E, v_mode }
352 #define Eva { OP_E, va_mode }
353 #define Ev_bnd { OP_E, v_bnd_mode }
354 #define EvS { OP_E, v_swap_mode }
355 #define Ed { OP_E, d_mode }
356 #define Edq { OP_E, dq_mode }
357 #define Edb { OP_E, db_mode }
358 #define Edw { OP_E, dw_mode }
359 #define Eq { OP_E, q_mode }
360 #define indirEv { OP_indirE, indir_v_mode }
361 #define indirEp { OP_indirE, f_mode }
362 #define stackEv { OP_E, stack_v_mode }
363 #define Em { OP_E, m_mode }
364 #define Ew { OP_E, w_mode }
365 #define M { OP_M, 0 } /* lea, lgdt, etc. */
366 #define Ma { OP_M, a_mode }
367 #define Mb { OP_M, b_mode }
368 #define Md { OP_M, d_mode }
369 #define Mo { OP_M, o_mode }
370 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
371 #define Mq { OP_M, q_mode }
372 #define Mv { OP_M, v_mode }
373 #define Mv_bnd { OP_M, v_bndmk_mode }
374 #define Mx { OP_M, x_mode }
375 #define Mxmm { OP_M, xmm_mode }
376 #define Gb { OP_G, b_mode }
377 #define Gbnd { OP_G, bnd_mode }
378 #define Gv { OP_G, v_mode }
379 #define Gd { OP_G, d_mode }
380 #define Gdq { OP_G, dq_mode }
381 #define Gm { OP_G, m_mode }
382 #define Gva { OP_G, va_mode }
383 #define Gw { OP_G, w_mode }
384 #define Ib { OP_I, b_mode }
385 #define sIb { OP_sI, b_mode } /* sign extened byte */
386 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
387 #define Iv { OP_I, v_mode }
388 #define sIv { OP_sI, v_mode }
389 #define Iv64 { OP_I64, v_mode }
390 #define Id { OP_I, d_mode }
391 #define Iw { OP_I, w_mode }
392 #define I1 { OP_I, const_1_mode }
393 #define Jb { OP_J, b_mode }
394 #define Jv { OP_J, v_mode }
395 #define Jdqw { OP_J, dqw_mode }
396 #define Cm { OP_C, m_mode }
397 #define Dm { OP_D, m_mode }
398 #define Td { OP_T, d_mode }
399 #define Skip_MODRM { OP_Skip_MODRM, 0 }
401 #define RMeAX { OP_REG, eAX_reg }
402 #define RMeBX { OP_REG, eBX_reg }
403 #define RMeCX { OP_REG, eCX_reg }
404 #define RMeDX { OP_REG, eDX_reg }
405 #define RMeSP { OP_REG, eSP_reg }
406 #define RMeBP { OP_REG, eBP_reg }
407 #define RMeSI { OP_REG, eSI_reg }
408 #define RMeDI { OP_REG, eDI_reg }
409 #define RMrAX { OP_REG, rAX_reg }
410 #define RMrBX { OP_REG, rBX_reg }
411 #define RMrCX { OP_REG, rCX_reg }
412 #define RMrDX { OP_REG, rDX_reg }
413 #define RMrSP { OP_REG, rSP_reg }
414 #define RMrBP { OP_REG, rBP_reg }
415 #define RMrSI { OP_REG, rSI_reg }
416 #define RMrDI { OP_REG, rDI_reg }
417 #define RMAL { OP_REG, al_reg }
418 #define RMCL { OP_REG, cl_reg }
419 #define RMDL { OP_REG, dl_reg }
420 #define RMBL { OP_REG, bl_reg }
421 #define RMAH { OP_REG, ah_reg }
422 #define RMCH { OP_REG, ch_reg }
423 #define RMDH { OP_REG, dh_reg }
424 #define RMBH { OP_REG, bh_reg }
425 #define RMAX { OP_REG, ax_reg }
426 #define RMDX { OP_REG, dx_reg }
428 #define eAX { OP_IMREG, eAX_reg }
429 #define AL { OP_IMREG, al_reg }
430 #define CL { OP_IMREG, cl_reg }
431 #define zAX { OP_IMREG, z_mode_ax_reg }
432 #define indirDX { OP_IMREG, indir_dx_reg }
434 #define Sw { OP_SEG, w_mode }
435 #define Sv { OP_SEG, v_mode }
436 #define Ap { OP_DIR, 0 }
437 #define Ob { OP_OFF64, b_mode }
438 #define Ov { OP_OFF64, v_mode }
439 #define Xb { OP_DSreg, eSI_reg }
440 #define Xv { OP_DSreg, eSI_reg }
441 #define Xz { OP_DSreg, eSI_reg }
442 #define Yb { OP_ESreg, eDI_reg }
443 #define Yv { OP_ESreg, eDI_reg }
444 #define DSBX { OP_DSreg, eBX_reg }
446 #define es { OP_REG, es_reg }
447 #define ss { OP_REG, ss_reg }
448 #define cs { OP_REG, cs_reg }
449 #define ds { OP_REG, ds_reg }
450 #define fs { OP_REG, fs_reg }
451 #define gs { OP_REG, gs_reg }
453 #define MX { OP_MMX, 0 }
454 #define XM { OP_XMM, 0 }
455 #define XMScalar { OP_XMM, scalar_mode }
456 #define XMGatherD { OP_XMM, vex_vsib_d_w_dq_mode }
457 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
458 #define XMM { OP_XMM, xmm_mode }
459 #define TMM { OP_XMM, tmm_mode }
460 #define XMxmmq { OP_XMM, xmmq_mode }
461 #define EM { OP_EM, v_mode }
462 #define EMS { OP_EM, v_swap_mode }
463 #define EMd { OP_EM, d_mode }
464 #define EMx { OP_EM, x_mode }
465 #define EXbwUnit { OP_EX, bw_unit_mode }
466 #define EXb { OP_EX, b_mode }
467 #define EXw { OP_EX, w_mode }
468 #define EXd { OP_EX, d_mode }
469 #define EXdS { OP_EX, d_swap_mode }
470 #define EXwS { OP_EX, w_swap_mode }
471 #define EXq { OP_EX, q_mode }
472 #define EXqS { OP_EX, q_swap_mode }
473 #define EXdq { OP_EX, dq_mode }
474 #define EXx { OP_EX, x_mode }
475 #define EXxh { OP_EX, xh_mode }
476 #define EXxS { OP_EX, x_swap_mode }
477 #define EXxmm { OP_EX, xmm_mode }
478 #define EXymm { OP_EX, ymm_mode }
479 #define EXtmm { OP_EX, tmm_mode }
480 #define EXxmmq { OP_EX, xmmq_mode }
481 #define EXxmmqh { OP_EX, evex_half_bcst_xmmqh_mode }
482 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
483 #define EXxmmdw { OP_EX, xmmdw_mode }
484 #define EXxmmqd { OP_EX, xmmqd_mode }
485 #define EXxmmqdh { OP_EX, evex_half_bcst_xmmqdh_mode }
486 #define EXymmq { OP_EX, ymmq_mode }
487 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
488 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
489 #define MS { OP_MS, v_mode }
490 #define XS { OP_XS, v_mode }
491 #define EMCq { OP_EMC, q_mode }
492 #define MXC { OP_MXC, 0 }
493 #define OPSUF { OP_3DNowSuffix, 0 }
494 #define SEP { SEP_Fixup, 0 }
495 #define CMP { CMP_Fixup, 0 }
496 #define XMM0 { XMM_Fixup, 0 }
497 #define FXSAVE { FXSAVE_Fixup, 0 }
499 #define Vex { OP_VEX, x_mode }
500 #define VexW { OP_VexW, x_mode }
501 #define VexScalar { OP_VEX, scalar_mode }
502 #define VexScalarR { OP_VexR, scalar_mode }
503 #define VexGatherD { OP_VEX, vex_vsib_d_w_dq_mode }
504 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
505 #define VexGdq { OP_VEX, dq_mode }
506 #define VexTmm { OP_VEX, tmm_mode }
507 #define XMVexI4 { OP_REG_VexI4, x_mode }
508 #define XMVexScalarI4 { OP_REG_VexI4, scalar_mode }
509 #define VexI4 { OP_VexI4, 0 }
510 #define PCLMUL { PCLMUL_Fixup, 0 }
511 #define VPCMP { VPCMP_Fixup, 0 }
512 #define VPCOM { VPCOM_Fixup, 0 }
514 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
515 #define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
516 #define EXxEVexS { OP_Rounding, evex_sae_mode }
518 #define MaskG { OP_G, mask_mode }
519 #define MaskE { OP_E, mask_mode }
520 #define MaskBDE { OP_E, mask_bd_mode }
521 #define MaskVex { OP_VEX, mask_mode }
523 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
524 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
526 #define MVexSIBMEM { OP_M, vex_sibmem_mode }
528 /* Used handle "rep" prefix for string instructions. */
529 #define Xbr { REP_Fixup, eSI_reg }
530 #define Xvr { REP_Fixup, eSI_reg }
531 #define Ybr { REP_Fixup, eDI_reg }
532 #define Yvr { REP_Fixup, eDI_reg }
533 #define Yzr { REP_Fixup, eDI_reg }
534 #define indirDXr { REP_Fixup, indir_dx_reg }
535 #define ALr { REP_Fixup, al_reg }
536 #define eAXr { REP_Fixup, eAX_reg }
538 /* Used handle HLE prefix for lockable instructions. */
539 #define Ebh1 { HLE_Fixup1, b_mode }
540 #define Evh1 { HLE_Fixup1, v_mode }
541 #define Ebh2 { HLE_Fixup2, b_mode }
542 #define Evh2 { HLE_Fixup2, v_mode }
543 #define Ebh3 { HLE_Fixup3, b_mode }
544 #define Evh3 { HLE_Fixup3, v_mode }
546 #define BND { BND_Fixup, 0 }
547 #define NOTRACK { NOTRACK_Fixup, 0 }
549 #define cond_jump_flag { NULL, cond_jump_mode }
550 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
552 /* bits in sizeflag */
553 #define SUFFIX_ALWAYS 4
561 /* byte operand with operand swapped */
563 /* byte operand, sign extend like 'T' suffix */
565 /* operand size depends on prefixes */
567 /* operand size depends on prefixes with operand swapped */
569 /* operand size depends on address prefix */
573 /* double word operand */
575 /* word operand with operand swapped */
577 /* double word operand with operand swapped */
579 /* quad word operand */
581 /* quad word operand with operand swapped */
583 /* ten-byte operand */
585 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
586 broadcast enabled. */
588 /* Similar to x_mode, but with different EVEX mem shifts. */
590 /* Similar to x_mode, but with yet different EVEX mem shifts. */
592 /* Similar to x_mode, but with disabled broadcast. */
594 /* Similar to x_mode, but with operands swapped and disabled broadcast
597 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
598 broadcast of 16bit enabled. */
600 /* 16-byte XMM operand */
602 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
603 memory operand (depending on vector length). Broadcast isn't
606 /* Same as xmmq_mode, but broadcast is allowed. */
607 evex_half_bcst_xmmq_mode
,
608 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
609 memory operand (depending on vector length). 16bit broadcast. */
610 evex_half_bcst_xmmqh_mode
,
611 /* 16-byte XMM, word, double word or quad word operand. */
613 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
615 /* 16-byte XMM, double word, quad word operand or xmm word operand.
617 evex_half_bcst_xmmqdh_mode
,
618 /* 32-byte YMM operand */
620 /* quad word, ymmword or zmmword memory operand. */
624 /* d_mode in 32bit, q_mode in 64bit mode. */
626 /* pair of v_mode operands */
632 /* like v_bnd_mode in 32bit, no RIP-rel in 64bit mode. */
634 /* operand size depends on REX.W / VEX.W. */
636 /* Displacements like v_mode without considering Intel64 ISA. */
640 /* bounds operand with operand swapped */
642 /* 4- or 6-byte pointer operand */
645 /* v_mode for indirect branch opcodes. */
647 /* v_mode for stack-related opcodes. */
649 /* non-quad operand size depends on prefixes */
651 /* 16-byte operand */
653 /* registers like d_mode, memory like b_mode. */
655 /* registers like d_mode, memory like w_mode. */
658 /* Operand size depends on the VEX.W bit, with VSIB dword indices. */
659 vex_vsib_d_w_dq_mode
,
660 /* Operand size depends on the VEX.W bit, with VSIB qword indices. */
661 vex_vsib_q_w_dq_mode
,
662 /* mandatory non-vector SIB. */
665 /* scalar, ignore vector length. */
668 /* Static rounding. */
670 /* Static rounding, 64-bit mode only. */
671 evex_rounding_64_mode
,
672 /* Supress all exceptions. */
675 /* Mask register operand. */
677 /* Mask register operand. */
745 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
747 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
748 #define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
749 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
750 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
751 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
752 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
753 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
754 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
755 #define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
756 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
757 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
758 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
759 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
760 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
761 #define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
762 #define EVEX_LEN_TABLE(I) DIS386 (USE_EVEX_LEN_TABLE, (I))
789 REG_0F3A0F_PREFIX_1_MOD_3
,
802 REG_VEX_0F3849_X86_64_P_0_W_0_M_1
,
807 REG_XOP_09_12_M_1_L_0
,
813 REG_EVEX_0F38C6_M_0_L_2
,
814 REG_EVEX_0F38C7_M_0_L_2
891 MOD_VEX_0F12_PREFIX_0
,
892 MOD_VEX_0F12_PREFIX_2
,
894 MOD_VEX_0F16_PREFIX_0
,
895 MOD_VEX_0F16_PREFIX_2
,
919 MOD_VEX_0FF0_PREFIX_3
,
926 MOD_VEX_0F3849_X86_64_P_0_W_0
,
927 MOD_VEX_0F3849_X86_64_P_2_W_0
,
928 MOD_VEX_0F3849_X86_64_P_3_W_0
,
929 MOD_VEX_0F384B_X86_64_P_1_W_0
,
930 MOD_VEX_0F384B_X86_64_P_2_W_0
,
931 MOD_VEX_0F384B_X86_64_P_3_W_0
,
933 MOD_VEX_0F385C_X86_64_P_1_W_0
,
934 MOD_VEX_0F385C_X86_64_P_3_W_0
,
935 MOD_VEX_0F385E_X86_64_P_0_W_0
,
936 MOD_VEX_0F385E_X86_64_P_1_W_0
,
937 MOD_VEX_0F385E_X86_64_P_2_W_0
,
938 MOD_VEX_0F385E_X86_64_P_3_W_0
,
951 MOD_EVEX_0F382A_P_1_W_1
,
953 MOD_EVEX_0F383A_P_1_W_0
,
973 RM_0F1E_P_1_MOD_3_REG_7
,
974 RM_0FAE_REG_6_MOD_3_P_0
,
976 RM_0F3A0F_P_1_MOD_3_REG_0
,
978 RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0
984 PREFIX_0F01_REG_1_RM_4
,
985 PREFIX_0F01_REG_1_RM_5
,
986 PREFIX_0F01_REG_1_RM_6
,
987 PREFIX_0F01_REG_1_RM_7
,
988 PREFIX_0F01_REG_3_RM_1
,
989 PREFIX_0F01_REG_5_MOD_0
,
990 PREFIX_0F01_REG_5_MOD_3_RM_0
,
991 PREFIX_0F01_REG_5_MOD_3_RM_1
,
992 PREFIX_0F01_REG_5_MOD_3_RM_2
,
993 PREFIX_0F01_REG_5_MOD_3_RM_4
,
994 PREFIX_0F01_REG_5_MOD_3_RM_5
,
995 PREFIX_0F01_REG_5_MOD_3_RM_6
,
996 PREFIX_0F01_REG_5_MOD_3_RM_7
,
997 PREFIX_0F01_REG_7_MOD_3_RM_2
,
998 PREFIX_0F01_REG_7_MOD_3_RM_6
,
999 PREFIX_0F01_REG_7_MOD_3_RM_7
,
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
,
1081 PREFIX_VEX_0F41_L_1_M_1_W_0
,
1082 PREFIX_VEX_0F41_L_1_M_1_W_1
,
1083 PREFIX_VEX_0F42_L_1_M_1_W_0
,
1084 PREFIX_VEX_0F42_L_1_M_1_W_1
,
1085 PREFIX_VEX_0F44_L_0_M_1_W_0
,
1086 PREFIX_VEX_0F44_L_0_M_1_W_1
,
1087 PREFIX_VEX_0F45_L_1_M_1_W_0
,
1088 PREFIX_VEX_0F45_L_1_M_1_W_1
,
1089 PREFIX_VEX_0F46_L_1_M_1_W_0
,
1090 PREFIX_VEX_0F46_L_1_M_1_W_1
,
1091 PREFIX_VEX_0F47_L_1_M_1_W_0
,
1092 PREFIX_VEX_0F47_L_1_M_1_W_1
,
1093 PREFIX_VEX_0F4A_L_1_M_1_W_0
,
1094 PREFIX_VEX_0F4A_L_1_M_1_W_1
,
1095 PREFIX_VEX_0F4B_L_1_M_1_W_0
,
1096 PREFIX_VEX_0F4B_L_1_M_1_W_1
,
1114 PREFIX_VEX_0F90_L_0_W_0
,
1115 PREFIX_VEX_0F90_L_0_W_1
,
1116 PREFIX_VEX_0F91_L_0_M_0_W_0
,
1117 PREFIX_VEX_0F91_L_0_M_0_W_1
,
1118 PREFIX_VEX_0F92_L_0_M_1_W_0
,
1119 PREFIX_VEX_0F92_L_0_M_1_W_1
,
1120 PREFIX_VEX_0F93_L_0_M_1_W_0
,
1121 PREFIX_VEX_0F93_L_0_M_1_W_1
,
1122 PREFIX_VEX_0F98_L_0_M_1_W_0
,
1123 PREFIX_VEX_0F98_L_0_M_1_W_1
,
1124 PREFIX_VEX_0F99_L_0_M_1_W_0
,
1125 PREFIX_VEX_0F99_L_0_M_1_W_1
,
1130 PREFIX_VEX_0F3849_X86_64
,
1131 PREFIX_VEX_0F384B_X86_64
,
1132 PREFIX_VEX_0F385C_X86_64
,
1133 PREFIX_VEX_0F385E_X86_64
,
1134 PREFIX_VEX_0F38F5_L_0
,
1135 PREFIX_VEX_0F38F6_L_0
,
1136 PREFIX_VEX_0F38F7_L_0
,
1137 PREFIX_VEX_0F3AF0_L_0
,
1195 PREFIX_EVEX_MAP5_10
,
1196 PREFIX_EVEX_MAP5_11
,
1197 PREFIX_EVEX_MAP5_1D
,
1198 PREFIX_EVEX_MAP5_2A
,
1199 PREFIX_EVEX_MAP5_2C
,
1200 PREFIX_EVEX_MAP5_2D
,
1201 PREFIX_EVEX_MAP5_2E
,
1202 PREFIX_EVEX_MAP5_2F
,
1203 PREFIX_EVEX_MAP5_51
,
1204 PREFIX_EVEX_MAP5_58
,
1205 PREFIX_EVEX_MAP5_59
,
1206 PREFIX_EVEX_MAP5_5A
,
1207 PREFIX_EVEX_MAP5_5B
,
1208 PREFIX_EVEX_MAP5_5C
,
1209 PREFIX_EVEX_MAP5_5D
,
1210 PREFIX_EVEX_MAP5_5E
,
1211 PREFIX_EVEX_MAP5_5F
,
1212 PREFIX_EVEX_MAP5_78
,
1213 PREFIX_EVEX_MAP5_79
,
1214 PREFIX_EVEX_MAP5_7A
,
1215 PREFIX_EVEX_MAP5_7B
,
1216 PREFIX_EVEX_MAP5_7C
,
1217 PREFIX_EVEX_MAP5_7D
,
1219 PREFIX_EVEX_MAP6_13
,
1220 PREFIX_EVEX_MAP6_56
,
1221 PREFIX_EVEX_MAP6_57
,
1222 PREFIX_EVEX_MAP6_D6
,
1223 PREFIX_EVEX_MAP6_D7
,
1259 X86_64_0F01_REG_1_RM_5_PREFIX_2
,
1260 X86_64_0F01_REG_1_RM_6_PREFIX_2
,
1261 X86_64_0F01_REG_1_RM_7_PREFIX_2
,
1264 X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
,
1265 X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
,
1266 X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
,
1267 X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
,
1268 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
,
1269 X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
,
1270 X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
,
1273 X86_64_0FC7_REG_6_MOD_3_PREFIX_1
,
1283 THREE_BYTE_0F38
= 0,
1312 VEX_LEN_0F12_P_0_M_0
= 0,
1313 VEX_LEN_0F12_P_0_M_1
,
1314 #define VEX_LEN_0F12_P_2_M_0 VEX_LEN_0F12_P_0_M_0
1316 VEX_LEN_0F16_P_0_M_0
,
1317 VEX_LEN_0F16_P_0_M_1
,
1318 #define VEX_LEN_0F16_P_2_M_0 VEX_LEN_0F16_P_0_M_0
1338 VEX_LEN_0FAE_R_2_M_0
,
1339 VEX_LEN_0FAE_R_3_M_0
,
1349 VEX_LEN_0F3849_X86_64_P_0_W_0_M_0
,
1350 VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0
,
1351 VEX_LEN_0F3849_X86_64_P_2_W_0_M_0
,
1352 VEX_LEN_0F3849_X86_64_P_3_W_0_M_0
,
1353 VEX_LEN_0F384B_X86_64_P_1_W_0_M_0
,
1354 VEX_LEN_0F384B_X86_64_P_2_W_0_M_0
,
1355 VEX_LEN_0F384B_X86_64_P_3_W_0_M_0
,
1357 VEX_LEN_0F385C_X86_64_P_1_W_0_M_0
,
1358 VEX_LEN_0F385C_X86_64_P_3_W_0_M_0
,
1359 VEX_LEN_0F385E_X86_64_P_0_W_0_M_0
,
1360 VEX_LEN_0F385E_X86_64_P_1_W_0_M_0
,
1361 VEX_LEN_0F385E_X86_64_P_2_W_0_M_0
,
1362 VEX_LEN_0F385E_X86_64_P_3_W_0_M_0
,
1395 VEX_LEN_0FXOP_08_85
,
1396 VEX_LEN_0FXOP_08_86
,
1397 VEX_LEN_0FXOP_08_87
,
1398 VEX_LEN_0FXOP_08_8E
,
1399 VEX_LEN_0FXOP_08_8F
,
1400 VEX_LEN_0FXOP_08_95
,
1401 VEX_LEN_0FXOP_08_96
,
1402 VEX_LEN_0FXOP_08_97
,
1403 VEX_LEN_0FXOP_08_9E
,
1404 VEX_LEN_0FXOP_08_9F
,
1405 VEX_LEN_0FXOP_08_A3
,
1406 VEX_LEN_0FXOP_08_A6
,
1407 VEX_LEN_0FXOP_08_B6
,
1408 VEX_LEN_0FXOP_08_C0
,
1409 VEX_LEN_0FXOP_08_C1
,
1410 VEX_LEN_0FXOP_08_C2
,
1411 VEX_LEN_0FXOP_08_C3
,
1412 VEX_LEN_0FXOP_08_CC
,
1413 VEX_LEN_0FXOP_08_CD
,
1414 VEX_LEN_0FXOP_08_CE
,
1415 VEX_LEN_0FXOP_08_CF
,
1416 VEX_LEN_0FXOP_08_EC
,
1417 VEX_LEN_0FXOP_08_ED
,
1418 VEX_LEN_0FXOP_08_EE
,
1419 VEX_LEN_0FXOP_08_EF
,
1420 VEX_LEN_0FXOP_09_01
,
1421 VEX_LEN_0FXOP_09_02
,
1422 VEX_LEN_0FXOP_09_12_M_1
,
1423 VEX_LEN_0FXOP_09_82_W_0
,
1424 VEX_LEN_0FXOP_09_83_W_0
,
1425 VEX_LEN_0FXOP_09_90
,
1426 VEX_LEN_0FXOP_09_91
,
1427 VEX_LEN_0FXOP_09_92
,
1428 VEX_LEN_0FXOP_09_93
,
1429 VEX_LEN_0FXOP_09_94
,
1430 VEX_LEN_0FXOP_09_95
,
1431 VEX_LEN_0FXOP_09_96
,
1432 VEX_LEN_0FXOP_09_97
,
1433 VEX_LEN_0FXOP_09_98
,
1434 VEX_LEN_0FXOP_09_99
,
1435 VEX_LEN_0FXOP_09_9A
,
1436 VEX_LEN_0FXOP_09_9B
,
1437 VEX_LEN_0FXOP_09_C1
,
1438 VEX_LEN_0FXOP_09_C2
,
1439 VEX_LEN_0FXOP_09_C3
,
1440 VEX_LEN_0FXOP_09_C6
,
1441 VEX_LEN_0FXOP_09_C7
,
1442 VEX_LEN_0FXOP_09_CB
,
1443 VEX_LEN_0FXOP_09_D1
,
1444 VEX_LEN_0FXOP_09_D2
,
1445 VEX_LEN_0FXOP_09_D3
,
1446 VEX_LEN_0FXOP_09_D6
,
1447 VEX_LEN_0FXOP_09_D7
,
1448 VEX_LEN_0FXOP_09_DB
,
1449 VEX_LEN_0FXOP_09_E1
,
1450 VEX_LEN_0FXOP_09_E2
,
1451 VEX_LEN_0FXOP_09_E3
,
1452 VEX_LEN_0FXOP_0A_12
,
1457 EVEX_LEN_0F3816
= 0,
1459 EVEX_LEN_0F381A_M_0
,
1460 EVEX_LEN_0F381B_M_0
,
1462 EVEX_LEN_0F385A_M_0
,
1463 EVEX_LEN_0F385B_M_0
,
1464 EVEX_LEN_0F38C6_M_0
,
1465 EVEX_LEN_0F38C7_M_0
,
1482 VEX_W_0F41_L_1_M_1
= 0,
1504 VEX_W_0F381A_M_0_L_1
,
1511 VEX_W_0F3849_X86_64_P_0
,
1512 VEX_W_0F3849_X86_64_P_2
,
1513 VEX_W_0F3849_X86_64_P_3
,
1514 VEX_W_0F384B_X86_64_P_1
,
1515 VEX_W_0F384B_X86_64_P_2
,
1516 VEX_W_0F384B_X86_64_P_3
,
1523 VEX_W_0F385A_M_0_L_0
,
1524 VEX_W_0F385C_X86_64_P_1
,
1525 VEX_W_0F385C_X86_64_P_3
,
1526 VEX_W_0F385E_X86_64_P_0
,
1527 VEX_W_0F385E_X86_64_P_1
,
1528 VEX_W_0F385E_X86_64_P_2
,
1529 VEX_W_0F385E_X86_64_P_3
,
1551 VEX_W_0FXOP_08_85_L_0
,
1552 VEX_W_0FXOP_08_86_L_0
,
1553 VEX_W_0FXOP_08_87_L_0
,
1554 VEX_W_0FXOP_08_8E_L_0
,
1555 VEX_W_0FXOP_08_8F_L_0
,
1556 VEX_W_0FXOP_08_95_L_0
,
1557 VEX_W_0FXOP_08_96_L_0
,
1558 VEX_W_0FXOP_08_97_L_0
,
1559 VEX_W_0FXOP_08_9E_L_0
,
1560 VEX_W_0FXOP_08_9F_L_0
,
1561 VEX_W_0FXOP_08_A6_L_0
,
1562 VEX_W_0FXOP_08_B6_L_0
,
1563 VEX_W_0FXOP_08_C0_L_0
,
1564 VEX_W_0FXOP_08_C1_L_0
,
1565 VEX_W_0FXOP_08_C2_L_0
,
1566 VEX_W_0FXOP_08_C3_L_0
,
1567 VEX_W_0FXOP_08_CC_L_0
,
1568 VEX_W_0FXOP_08_CD_L_0
,
1569 VEX_W_0FXOP_08_CE_L_0
,
1570 VEX_W_0FXOP_08_CF_L_0
,
1571 VEX_W_0FXOP_08_EC_L_0
,
1572 VEX_W_0FXOP_08_ED_L_0
,
1573 VEX_W_0FXOP_08_EE_L_0
,
1574 VEX_W_0FXOP_08_EF_L_0
,
1580 VEX_W_0FXOP_09_C1_L_0
,
1581 VEX_W_0FXOP_09_C2_L_0
,
1582 VEX_W_0FXOP_09_C3_L_0
,
1583 VEX_W_0FXOP_09_C6_L_0
,
1584 VEX_W_0FXOP_09_C7_L_0
,
1585 VEX_W_0FXOP_09_CB_L_0
,
1586 VEX_W_0FXOP_09_D1_L_0
,
1587 VEX_W_0FXOP_09_D2_L_0
,
1588 VEX_W_0FXOP_09_D3_L_0
,
1589 VEX_W_0FXOP_09_D6_L_0
,
1590 VEX_W_0FXOP_09_D7_L_0
,
1591 VEX_W_0FXOP_09_DB_L_0
,
1592 VEX_W_0FXOP_09_E1_L_0
,
1593 VEX_W_0FXOP_09_E2_L_0
,
1594 VEX_W_0FXOP_09_E3_L_0
,
1647 EVEX_W_0F381A_M_0_L_n
,
1648 EVEX_W_0F381B_M_0_L_2
,
1673 EVEX_W_0F385A_M_0_L_n
,
1674 EVEX_W_0F385B_M_0_L_2
,
1700 typedef void (*op_rtn
) (instr_info
*ins
, int bytemode
, int sizeflag
);
1709 unsigned int prefix_requirement
;
1712 /* Upper case letters in the instruction names here are macros.
1713 'A' => print 'b' if no register operands or suffix_always is true
1714 'B' => print 'b' if suffix_always is true
1715 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
1717 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
1718 suffix_always is true
1719 'E' => print 'e' if 32-bit form of jcxz
1720 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
1721 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
1722 'H' => print ",pt" or ",pn" branch hint
1725 'K' => print 'd' or 'q' if rex prefix is present.
1727 'M' => print 'r' if intel_mnemonic is false.
1728 'N' => print 'n' if instruction has no wait "prefix"
1729 'O' => print 'd' or 'o' (or 'q' in Intel mode)
1730 'P' => behave as 'T' except with register operand outside of suffix_always
1732 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
1734 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
1735 'S' => print 'w', 'l' or 'q' if suffix_always is true
1736 'T' => print 'w', 'l'/'d', or 'q' if instruction has an operand size
1737 prefix or if suffix_always is true.
1740 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
1741 'X' => print 's', 'd' depending on data16 prefix (for XMM)
1743 'Z' => print 'q' in 64bit mode and 'l' otherwise, if suffix_always is true.
1744 '!' => change condition from true to false or from false to true.
1745 '%' => add 1 upper case letter to the macro.
1746 '^' => print 'w', 'l', or 'q' (Intel64 ISA only) depending on operand size
1747 prefix or suffix_always is true (lcall/ljmp).
1748 '@' => in 64bit mode for Intel64 ISA or if instruction
1749 has no operand sizing prefix, print 'q' if suffix_always is true or
1750 nothing otherwise; behave as 'P' in all other cases
1752 2 upper case letter macros:
1753 "XY" => print 'x' or 'y' if suffix_always is true or no register
1754 operands and no broadcast.
1755 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
1756 register operands and no broadcast.
1757 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
1758 "XD" => print 'd' if !EVEX or EVEX.W=1, EVEX.W=0 is not a valid encoding
1759 "XH" => print 'h' if EVEX.W=0, EVEX.W=1 is not a valid encoding (for FP16)
1760 "XS" => print 's' if !EVEX or EVEX.W=0, EVEX.W=1 is not a valid encoding
1761 "XV" => print "{vex} " pseudo prefix
1762 "XE" => print "{evex} " pseudo prefix if no EVEX-specific functionality is
1763 is used by an EVEX-encoded (AVX512VL) instruction.
1764 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand, cond
1765 being false, or no operand at all in 64bit mode, or if suffix_always
1767 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
1768 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
1769 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
1770 "DQ" => print 'd' or 'q' depending on the VEX.W bit
1771 "BW" => print 'b' or 'w' depending on the VEX.W bit
1772 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
1773 an operand size prefix, or suffix_always is true. print
1774 'q' if rex prefix is present.
1776 Many of the above letters print nothing in Intel mode. See "putop"
1779 Braces '{' and '}', and vertical bars '|', indicate alternative
1780 mnemonic strings for AT&T and Intel. */
1782 static const struct dis386 dis386
[] = {
1784 { "addB", { Ebh1
, Gb
}, 0 },
1785 { "addS", { Evh1
, Gv
}, 0 },
1786 { "addB", { Gb
, EbS
}, 0 },
1787 { "addS", { Gv
, EvS
}, 0 },
1788 { "addB", { AL
, Ib
}, 0 },
1789 { "addS", { eAX
, Iv
}, 0 },
1790 { X86_64_TABLE (X86_64_06
) },
1791 { X86_64_TABLE (X86_64_07
) },
1793 { "orB", { Ebh1
, Gb
}, 0 },
1794 { "orS", { Evh1
, Gv
}, 0 },
1795 { "orB", { Gb
, EbS
}, 0 },
1796 { "orS", { Gv
, EvS
}, 0 },
1797 { "orB", { AL
, Ib
}, 0 },
1798 { "orS", { eAX
, Iv
}, 0 },
1799 { X86_64_TABLE (X86_64_0E
) },
1800 { Bad_Opcode
}, /* 0x0f extended opcode escape */
1802 { "adcB", { Ebh1
, Gb
}, 0 },
1803 { "adcS", { Evh1
, Gv
}, 0 },
1804 { "adcB", { Gb
, EbS
}, 0 },
1805 { "adcS", { Gv
, EvS
}, 0 },
1806 { "adcB", { AL
, Ib
}, 0 },
1807 { "adcS", { eAX
, Iv
}, 0 },
1808 { X86_64_TABLE (X86_64_16
) },
1809 { X86_64_TABLE (X86_64_17
) },
1811 { "sbbB", { Ebh1
, Gb
}, 0 },
1812 { "sbbS", { Evh1
, Gv
}, 0 },
1813 { "sbbB", { Gb
, EbS
}, 0 },
1814 { "sbbS", { Gv
, EvS
}, 0 },
1815 { "sbbB", { AL
, Ib
}, 0 },
1816 { "sbbS", { eAX
, Iv
}, 0 },
1817 { X86_64_TABLE (X86_64_1E
) },
1818 { X86_64_TABLE (X86_64_1F
) },
1820 { "andB", { Ebh1
, Gb
}, 0 },
1821 { "andS", { Evh1
, Gv
}, 0 },
1822 { "andB", { Gb
, EbS
}, 0 },
1823 { "andS", { Gv
, EvS
}, 0 },
1824 { "andB", { AL
, Ib
}, 0 },
1825 { "andS", { eAX
, Iv
}, 0 },
1826 { Bad_Opcode
}, /* SEG ES prefix */
1827 { X86_64_TABLE (X86_64_27
) },
1829 { "subB", { Ebh1
, Gb
}, 0 },
1830 { "subS", { Evh1
, Gv
}, 0 },
1831 { "subB", { Gb
, EbS
}, 0 },
1832 { "subS", { Gv
, EvS
}, 0 },
1833 { "subB", { AL
, Ib
}, 0 },
1834 { "subS", { eAX
, Iv
}, 0 },
1835 { Bad_Opcode
}, /* SEG CS prefix */
1836 { X86_64_TABLE (X86_64_2F
) },
1838 { "xorB", { Ebh1
, Gb
}, 0 },
1839 { "xorS", { Evh1
, Gv
}, 0 },
1840 { "xorB", { Gb
, EbS
}, 0 },
1841 { "xorS", { Gv
, EvS
}, 0 },
1842 { "xorB", { AL
, Ib
}, 0 },
1843 { "xorS", { eAX
, Iv
}, 0 },
1844 { Bad_Opcode
}, /* SEG SS prefix */
1845 { X86_64_TABLE (X86_64_37
) },
1847 { "cmpB", { Eb
, Gb
}, 0 },
1848 { "cmpS", { Ev
, Gv
}, 0 },
1849 { "cmpB", { Gb
, EbS
}, 0 },
1850 { "cmpS", { Gv
, EvS
}, 0 },
1851 { "cmpB", { AL
, Ib
}, 0 },
1852 { "cmpS", { eAX
, Iv
}, 0 },
1853 { Bad_Opcode
}, /* SEG DS prefix */
1854 { X86_64_TABLE (X86_64_3F
) },
1856 { "inc{S|}", { RMeAX
}, 0 },
1857 { "inc{S|}", { RMeCX
}, 0 },
1858 { "inc{S|}", { RMeDX
}, 0 },
1859 { "inc{S|}", { RMeBX
}, 0 },
1860 { "inc{S|}", { RMeSP
}, 0 },
1861 { "inc{S|}", { RMeBP
}, 0 },
1862 { "inc{S|}", { RMeSI
}, 0 },
1863 { "inc{S|}", { RMeDI
}, 0 },
1865 { "dec{S|}", { RMeAX
}, 0 },
1866 { "dec{S|}", { RMeCX
}, 0 },
1867 { "dec{S|}", { RMeDX
}, 0 },
1868 { "dec{S|}", { RMeBX
}, 0 },
1869 { "dec{S|}", { RMeSP
}, 0 },
1870 { "dec{S|}", { RMeBP
}, 0 },
1871 { "dec{S|}", { RMeSI
}, 0 },
1872 { "dec{S|}", { RMeDI
}, 0 },
1874 { "push{!P|}", { RMrAX
}, 0 },
1875 { "push{!P|}", { RMrCX
}, 0 },
1876 { "push{!P|}", { RMrDX
}, 0 },
1877 { "push{!P|}", { RMrBX
}, 0 },
1878 { "push{!P|}", { RMrSP
}, 0 },
1879 { "push{!P|}", { RMrBP
}, 0 },
1880 { "push{!P|}", { RMrSI
}, 0 },
1881 { "push{!P|}", { RMrDI
}, 0 },
1883 { "pop{!P|}", { RMrAX
}, 0 },
1884 { "pop{!P|}", { RMrCX
}, 0 },
1885 { "pop{!P|}", { RMrDX
}, 0 },
1886 { "pop{!P|}", { RMrBX
}, 0 },
1887 { "pop{!P|}", { RMrSP
}, 0 },
1888 { "pop{!P|}", { RMrBP
}, 0 },
1889 { "pop{!P|}", { RMrSI
}, 0 },
1890 { "pop{!P|}", { RMrDI
}, 0 },
1892 { X86_64_TABLE (X86_64_60
) },
1893 { X86_64_TABLE (X86_64_61
) },
1894 { X86_64_TABLE (X86_64_62
) },
1895 { X86_64_TABLE (X86_64_63
) },
1896 { Bad_Opcode
}, /* seg fs */
1897 { Bad_Opcode
}, /* seg gs */
1898 { Bad_Opcode
}, /* op size prefix */
1899 { Bad_Opcode
}, /* adr size prefix */
1901 { "pushP", { sIv
}, 0 },
1902 { "imulS", { Gv
, Ev
, Iv
}, 0 },
1903 { "pushP", { sIbT
}, 0 },
1904 { "imulS", { Gv
, Ev
, sIb
}, 0 },
1905 { "ins{b|}", { Ybr
, indirDX
}, 0 },
1906 { X86_64_TABLE (X86_64_6D
) },
1907 { "outs{b|}", { indirDXr
, Xb
}, 0 },
1908 { X86_64_TABLE (X86_64_6F
) },
1910 { "joH", { Jb
, BND
, cond_jump_flag
}, 0 },
1911 { "jnoH", { Jb
, BND
, cond_jump_flag
}, 0 },
1912 { "jbH", { Jb
, BND
, cond_jump_flag
}, 0 },
1913 { "jaeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1914 { "jeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1915 { "jneH", { Jb
, BND
, cond_jump_flag
}, 0 },
1916 { "jbeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1917 { "jaH", { Jb
, BND
, cond_jump_flag
}, 0 },
1919 { "jsH", { Jb
, BND
, cond_jump_flag
}, 0 },
1920 { "jnsH", { Jb
, BND
, cond_jump_flag
}, 0 },
1921 { "jpH", { Jb
, BND
, cond_jump_flag
}, 0 },
1922 { "jnpH", { Jb
, BND
, cond_jump_flag
}, 0 },
1923 { "jlH", { Jb
, BND
, cond_jump_flag
}, 0 },
1924 { "jgeH", { Jb
, BND
, cond_jump_flag
}, 0 },
1925 { "jleH", { Jb
, BND
, cond_jump_flag
}, 0 },
1926 { "jgH", { Jb
, BND
, cond_jump_flag
}, 0 },
1928 { REG_TABLE (REG_80
) },
1929 { REG_TABLE (REG_81
) },
1930 { X86_64_TABLE (X86_64_82
) },
1931 { REG_TABLE (REG_83
) },
1932 { "testB", { Eb
, Gb
}, 0 },
1933 { "testS", { Ev
, Gv
}, 0 },
1934 { "xchgB", { Ebh2
, Gb
}, 0 },
1935 { "xchgS", { Evh2
, Gv
}, 0 },
1937 { "movB", { Ebh3
, Gb
}, 0 },
1938 { "movS", { Evh3
, Gv
}, 0 },
1939 { "movB", { Gb
, EbS
}, 0 },
1940 { "movS", { Gv
, EvS
}, 0 },
1941 { "movD", { Sv
, Sw
}, 0 },
1942 { MOD_TABLE (MOD_8D
) },
1943 { "movD", { Sw
, Sv
}, 0 },
1944 { REG_TABLE (REG_8F
) },
1946 { PREFIX_TABLE (PREFIX_90
) },
1947 { "xchgS", { RMeCX
, eAX
}, 0 },
1948 { "xchgS", { RMeDX
, eAX
}, 0 },
1949 { "xchgS", { RMeBX
, eAX
}, 0 },
1950 { "xchgS", { RMeSP
, eAX
}, 0 },
1951 { "xchgS", { RMeBP
, eAX
}, 0 },
1952 { "xchgS", { RMeSI
, eAX
}, 0 },
1953 { "xchgS", { RMeDI
, eAX
}, 0 },
1955 { "cW{t|}R", { XX
}, 0 },
1956 { "cR{t|}O", { XX
}, 0 },
1957 { X86_64_TABLE (X86_64_9A
) },
1958 { Bad_Opcode
}, /* fwait */
1959 { "pushfP", { XX
}, 0 },
1960 { "popfP", { XX
}, 0 },
1961 { "sahf", { XX
}, 0 },
1962 { "lahf", { XX
}, 0 },
1964 { "mov%LB", { AL
, Ob
}, 0 },
1965 { "mov%LS", { eAX
, Ov
}, 0 },
1966 { "mov%LB", { Ob
, AL
}, 0 },
1967 { "mov%LS", { Ov
, eAX
}, 0 },
1968 { "movs{b|}", { Ybr
, Xb
}, 0 },
1969 { "movs{R|}", { Yvr
, Xv
}, 0 },
1970 { "cmps{b|}", { Xb
, Yb
}, 0 },
1971 { "cmps{R|}", { Xv
, Yv
}, 0 },
1973 { "testB", { AL
, Ib
}, 0 },
1974 { "testS", { eAX
, Iv
}, 0 },
1975 { "stosB", { Ybr
, AL
}, 0 },
1976 { "stosS", { Yvr
, eAX
}, 0 },
1977 { "lodsB", { ALr
, Xb
}, 0 },
1978 { "lodsS", { eAXr
, Xv
}, 0 },
1979 { "scasB", { AL
, Yb
}, 0 },
1980 { "scasS", { eAX
, Yv
}, 0 },
1982 { "movB", { RMAL
, Ib
}, 0 },
1983 { "movB", { RMCL
, Ib
}, 0 },
1984 { "movB", { RMDL
, Ib
}, 0 },
1985 { "movB", { RMBL
, Ib
}, 0 },
1986 { "movB", { RMAH
, Ib
}, 0 },
1987 { "movB", { RMCH
, Ib
}, 0 },
1988 { "movB", { RMDH
, Ib
}, 0 },
1989 { "movB", { RMBH
, Ib
}, 0 },
1991 { "mov%LV", { RMeAX
, Iv64
}, 0 },
1992 { "mov%LV", { RMeCX
, Iv64
}, 0 },
1993 { "mov%LV", { RMeDX
, Iv64
}, 0 },
1994 { "mov%LV", { RMeBX
, Iv64
}, 0 },
1995 { "mov%LV", { RMeSP
, Iv64
}, 0 },
1996 { "mov%LV", { RMeBP
, Iv64
}, 0 },
1997 { "mov%LV", { RMeSI
, Iv64
}, 0 },
1998 { "mov%LV", { RMeDI
, Iv64
}, 0 },
2000 { REG_TABLE (REG_C0
) },
2001 { REG_TABLE (REG_C1
) },
2002 { X86_64_TABLE (X86_64_C2
) },
2003 { X86_64_TABLE (X86_64_C3
) },
2004 { X86_64_TABLE (X86_64_C4
) },
2005 { X86_64_TABLE (X86_64_C5
) },
2006 { REG_TABLE (REG_C6
) },
2007 { REG_TABLE (REG_C7
) },
2009 { "enterP", { Iw
, Ib
}, 0 },
2010 { "leaveP", { XX
}, 0 },
2011 { "{l|}ret{|f}%LP", { Iw
}, 0 },
2012 { "{l|}ret{|f}%LP", { XX
}, 0 },
2013 { "int3", { XX
}, 0 },
2014 { "int", { Ib
}, 0 },
2015 { X86_64_TABLE (X86_64_CE
) },
2016 { "iret%LP", { XX
}, 0 },
2018 { REG_TABLE (REG_D0
) },
2019 { REG_TABLE (REG_D1
) },
2020 { REG_TABLE (REG_D2
) },
2021 { REG_TABLE (REG_D3
) },
2022 { X86_64_TABLE (X86_64_D4
) },
2023 { X86_64_TABLE (X86_64_D5
) },
2025 { "xlat", { DSBX
}, 0 },
2036 { "loopneFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2037 { "loopeFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2038 { "loopFH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2039 { "jEcxzH", { Jb
, XX
, loop_jcxz_flag
}, 0 },
2040 { "inB", { AL
, Ib
}, 0 },
2041 { "inG", { zAX
, Ib
}, 0 },
2042 { "outB", { Ib
, AL
}, 0 },
2043 { "outG", { Ib
, zAX
}, 0 },
2045 { X86_64_TABLE (X86_64_E8
) },
2046 { X86_64_TABLE (X86_64_E9
) },
2047 { X86_64_TABLE (X86_64_EA
) },
2048 { "jmp", { Jb
, BND
}, 0 },
2049 { "inB", { AL
, indirDX
}, 0 },
2050 { "inG", { zAX
, indirDX
}, 0 },
2051 { "outB", { indirDX
, AL
}, 0 },
2052 { "outG", { indirDX
, zAX
}, 0 },
2054 { Bad_Opcode
}, /* lock prefix */
2055 { "int1", { XX
}, 0 },
2056 { Bad_Opcode
}, /* repne */
2057 { Bad_Opcode
}, /* repz */
2058 { "hlt", { XX
}, 0 },
2059 { "cmc", { XX
}, 0 },
2060 { REG_TABLE (REG_F6
) },
2061 { REG_TABLE (REG_F7
) },
2063 { "clc", { XX
}, 0 },
2064 { "stc", { XX
}, 0 },
2065 { "cli", { XX
}, 0 },
2066 { "sti", { XX
}, 0 },
2067 { "cld", { XX
}, 0 },
2068 { "std", { XX
}, 0 },
2069 { REG_TABLE (REG_FE
) },
2070 { REG_TABLE (REG_FF
) },
2073 static const struct dis386 dis386_twobyte
[] = {
2075 { REG_TABLE (REG_0F00
) },
2076 { REG_TABLE (REG_0F01
) },
2077 { "larS", { Gv
, Ew
}, 0 },
2078 { "lslS", { Gv
, Ew
}, 0 },
2080 { "syscall", { XX
}, 0 },
2081 { "clts", { XX
}, 0 },
2082 { "sysret%LQ", { XX
}, 0 },
2084 { "invd", { XX
}, 0 },
2085 { PREFIX_TABLE (PREFIX_0F09
) },
2087 { "ud2", { XX
}, 0 },
2089 { REG_TABLE (REG_0F0D
) },
2090 { "femms", { XX
}, 0 },
2091 { "", { MX
, EM
, OPSUF
}, 0 }, /* See OP_3DNowSuffix. */
2093 { PREFIX_TABLE (PREFIX_0F10
) },
2094 { PREFIX_TABLE (PREFIX_0F11
) },
2095 { PREFIX_TABLE (PREFIX_0F12
) },
2096 { MOD_TABLE (MOD_0F13
) },
2097 { "unpcklpX", { XM
, EXx
}, PREFIX_OPCODE
},
2098 { "unpckhpX", { XM
, EXx
}, PREFIX_OPCODE
},
2099 { PREFIX_TABLE (PREFIX_0F16
) },
2100 { MOD_TABLE (MOD_0F17
) },
2102 { REG_TABLE (REG_0F18
) },
2103 { "nopQ", { Ev
}, 0 },
2104 { PREFIX_TABLE (PREFIX_0F1A
) },
2105 { PREFIX_TABLE (PREFIX_0F1B
) },
2106 { PREFIX_TABLE (PREFIX_0F1C
) },
2107 { "nopQ", { Ev
}, 0 },
2108 { PREFIX_TABLE (PREFIX_0F1E
) },
2109 { "nopQ", { Ev
}, 0 },
2111 { "movZ", { Em
, Cm
}, 0 },
2112 { "movZ", { Em
, Dm
}, 0 },
2113 { "movZ", { Cm
, Em
}, 0 },
2114 { "movZ", { Dm
, Em
}, 0 },
2115 { X86_64_TABLE (X86_64_0F24
) },
2117 { X86_64_TABLE (X86_64_0F26
) },
2120 { "movapX", { XM
, EXx
}, PREFIX_OPCODE
},
2121 { "movapX", { EXxS
, XM
}, PREFIX_OPCODE
},
2122 { PREFIX_TABLE (PREFIX_0F2A
) },
2123 { PREFIX_TABLE (PREFIX_0F2B
) },
2124 { PREFIX_TABLE (PREFIX_0F2C
) },
2125 { PREFIX_TABLE (PREFIX_0F2D
) },
2126 { PREFIX_TABLE (PREFIX_0F2E
) },
2127 { PREFIX_TABLE (PREFIX_0F2F
) },
2129 { "wrmsr", { XX
}, 0 },
2130 { "rdtsc", { XX
}, 0 },
2131 { "rdmsr", { XX
}, 0 },
2132 { "rdpmc", { XX
}, 0 },
2133 { "sysenter", { SEP
}, 0 },
2134 { "sysexit%LQ", { SEP
}, 0 },
2136 { "getsec", { XX
}, 0 },
2138 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38
, PREFIX_OPCODE
) },
2140 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A
, PREFIX_OPCODE
) },
2147 { "cmovoS", { Gv
, Ev
}, 0 },
2148 { "cmovnoS", { Gv
, Ev
}, 0 },
2149 { "cmovbS", { Gv
, Ev
}, 0 },
2150 { "cmovaeS", { Gv
, Ev
}, 0 },
2151 { "cmoveS", { Gv
, Ev
}, 0 },
2152 { "cmovneS", { Gv
, Ev
}, 0 },
2153 { "cmovbeS", { Gv
, Ev
}, 0 },
2154 { "cmovaS", { Gv
, Ev
}, 0 },
2156 { "cmovsS", { Gv
, Ev
}, 0 },
2157 { "cmovnsS", { Gv
, Ev
}, 0 },
2158 { "cmovpS", { Gv
, Ev
}, 0 },
2159 { "cmovnpS", { Gv
, Ev
}, 0 },
2160 { "cmovlS", { Gv
, Ev
}, 0 },
2161 { "cmovgeS", { Gv
, Ev
}, 0 },
2162 { "cmovleS", { Gv
, Ev
}, 0 },
2163 { "cmovgS", { Gv
, Ev
}, 0 },
2165 { MOD_TABLE (MOD_0F50
) },
2166 { PREFIX_TABLE (PREFIX_0F51
) },
2167 { PREFIX_TABLE (PREFIX_0F52
) },
2168 { PREFIX_TABLE (PREFIX_0F53
) },
2169 { "andpX", { XM
, EXx
}, PREFIX_OPCODE
},
2170 { "andnpX", { XM
, EXx
}, PREFIX_OPCODE
},
2171 { "orpX", { XM
, EXx
}, PREFIX_OPCODE
},
2172 { "xorpX", { XM
, EXx
}, PREFIX_OPCODE
},
2174 { PREFIX_TABLE (PREFIX_0F58
) },
2175 { PREFIX_TABLE (PREFIX_0F59
) },
2176 { PREFIX_TABLE (PREFIX_0F5A
) },
2177 { PREFIX_TABLE (PREFIX_0F5B
) },
2178 { PREFIX_TABLE (PREFIX_0F5C
) },
2179 { PREFIX_TABLE (PREFIX_0F5D
) },
2180 { PREFIX_TABLE (PREFIX_0F5E
) },
2181 { PREFIX_TABLE (PREFIX_0F5F
) },
2183 { PREFIX_TABLE (PREFIX_0F60
) },
2184 { PREFIX_TABLE (PREFIX_0F61
) },
2185 { PREFIX_TABLE (PREFIX_0F62
) },
2186 { "packsswb", { MX
, EM
}, PREFIX_OPCODE
},
2187 { "pcmpgtb", { MX
, EM
}, PREFIX_OPCODE
},
2188 { "pcmpgtw", { MX
, EM
}, PREFIX_OPCODE
},
2189 { "pcmpgtd", { MX
, EM
}, PREFIX_OPCODE
},
2190 { "packuswb", { MX
, EM
}, PREFIX_OPCODE
},
2192 { "punpckhbw", { MX
, EM
}, PREFIX_OPCODE
},
2193 { "punpckhwd", { MX
, EM
}, PREFIX_OPCODE
},
2194 { "punpckhdq", { MX
, EM
}, PREFIX_OPCODE
},
2195 { "packssdw", { MX
, EM
}, PREFIX_OPCODE
},
2196 { "punpcklqdq", { XM
, EXx
}, PREFIX_DATA
},
2197 { "punpckhqdq", { XM
, EXx
}, PREFIX_DATA
},
2198 { "movK", { MX
, Edq
}, PREFIX_OPCODE
},
2199 { PREFIX_TABLE (PREFIX_0F6F
) },
2201 { PREFIX_TABLE (PREFIX_0F70
) },
2202 { MOD_TABLE (MOD_0F71
) },
2203 { MOD_TABLE (MOD_0F72
) },
2204 { MOD_TABLE (MOD_0F73
) },
2205 { "pcmpeqb", { MX
, EM
}, PREFIX_OPCODE
},
2206 { "pcmpeqw", { MX
, EM
}, PREFIX_OPCODE
},
2207 { "pcmpeqd", { MX
, EM
}, PREFIX_OPCODE
},
2208 { "emms", { XX
}, PREFIX_OPCODE
},
2210 { PREFIX_TABLE (PREFIX_0F78
) },
2211 { PREFIX_TABLE (PREFIX_0F79
) },
2214 { PREFIX_TABLE (PREFIX_0F7C
) },
2215 { PREFIX_TABLE (PREFIX_0F7D
) },
2216 { PREFIX_TABLE (PREFIX_0F7E
) },
2217 { PREFIX_TABLE (PREFIX_0F7F
) },
2219 { "joH", { Jv
, BND
, cond_jump_flag
}, 0 },
2220 { "jnoH", { Jv
, BND
, cond_jump_flag
}, 0 },
2221 { "jbH", { Jv
, BND
, cond_jump_flag
}, 0 },
2222 { "jaeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2223 { "jeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2224 { "jneH", { Jv
, BND
, cond_jump_flag
}, 0 },
2225 { "jbeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2226 { "jaH", { Jv
, BND
, cond_jump_flag
}, 0 },
2228 { "jsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2229 { "jnsH", { Jv
, BND
, cond_jump_flag
}, 0 },
2230 { "jpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2231 { "jnpH", { Jv
, BND
, cond_jump_flag
}, 0 },
2232 { "jlH", { Jv
, BND
, cond_jump_flag
}, 0 },
2233 { "jgeH", { Jv
, BND
, cond_jump_flag
}, 0 },
2234 { "jleH", { Jv
, BND
, cond_jump_flag
}, 0 },
2235 { "jgH", { Jv
, BND
, cond_jump_flag
}, 0 },
2237 { "seto", { Eb
}, 0 },
2238 { "setno", { Eb
}, 0 },
2239 { "setb", { Eb
}, 0 },
2240 { "setae", { Eb
}, 0 },
2241 { "sete", { Eb
}, 0 },
2242 { "setne", { Eb
}, 0 },
2243 { "setbe", { Eb
}, 0 },
2244 { "seta", { Eb
}, 0 },
2246 { "sets", { Eb
}, 0 },
2247 { "setns", { Eb
}, 0 },
2248 { "setp", { Eb
}, 0 },
2249 { "setnp", { Eb
}, 0 },
2250 { "setl", { Eb
}, 0 },
2251 { "setge", { Eb
}, 0 },
2252 { "setle", { Eb
}, 0 },
2253 { "setg", { Eb
}, 0 },
2255 { "pushP", { fs
}, 0 },
2256 { "popP", { fs
}, 0 },
2257 { "cpuid", { XX
}, 0 },
2258 { "btS", { Ev
, Gv
}, 0 },
2259 { "shldS", { Ev
, Gv
, Ib
}, 0 },
2260 { "shldS", { Ev
, Gv
, CL
}, 0 },
2261 { REG_TABLE (REG_0FA6
) },
2262 { REG_TABLE (REG_0FA7
) },
2264 { "pushP", { gs
}, 0 },
2265 { "popP", { gs
}, 0 },
2266 { "rsm", { XX
}, 0 },
2267 { "btsS", { Evh1
, Gv
}, 0 },
2268 { "shrdS", { Ev
, Gv
, Ib
}, 0 },
2269 { "shrdS", { Ev
, Gv
, CL
}, 0 },
2270 { REG_TABLE (REG_0FAE
) },
2271 { "imulS", { Gv
, Ev
}, 0 },
2273 { "cmpxchgB", { Ebh1
, Gb
}, 0 },
2274 { "cmpxchgS", { Evh1
, Gv
}, 0 },
2275 { MOD_TABLE (MOD_0FB2
) },
2276 { "btrS", { Evh1
, Gv
}, 0 },
2277 { MOD_TABLE (MOD_0FB4
) },
2278 { MOD_TABLE (MOD_0FB5
) },
2279 { "movz{bR|x}", { Gv
, Eb
}, 0 },
2280 { "movz{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movzww ! */
2282 { PREFIX_TABLE (PREFIX_0FB8
) },
2283 { "ud1S", { Gv
, Ev
}, 0 },
2284 { REG_TABLE (REG_0FBA
) },
2285 { "btcS", { Evh1
, Gv
}, 0 },
2286 { PREFIX_TABLE (PREFIX_0FBC
) },
2287 { PREFIX_TABLE (PREFIX_0FBD
) },
2288 { "movs{bR|x}", { Gv
, Eb
}, 0 },
2289 { "movs{wR|x}", { Gv
, Ew
}, 0 }, /* yes, there really is movsww ! */
2291 { "xaddB", { Ebh1
, Gb
}, 0 },
2292 { "xaddS", { Evh1
, Gv
}, 0 },
2293 { PREFIX_TABLE (PREFIX_0FC2
) },
2294 { MOD_TABLE (MOD_0FC3
) },
2295 { "pinsrw", { MX
, Edw
, Ib
}, PREFIX_OPCODE
},
2296 { "pextrw", { Gd
, MS
, Ib
}, PREFIX_OPCODE
},
2297 { "shufpX", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
2298 { REG_TABLE (REG_0FC7
) },
2300 { "bswap", { RMeAX
}, 0 },
2301 { "bswap", { RMeCX
}, 0 },
2302 { "bswap", { RMeDX
}, 0 },
2303 { "bswap", { RMeBX
}, 0 },
2304 { "bswap", { RMeSP
}, 0 },
2305 { "bswap", { RMeBP
}, 0 },
2306 { "bswap", { RMeSI
}, 0 },
2307 { "bswap", { RMeDI
}, 0 },
2309 { PREFIX_TABLE (PREFIX_0FD0
) },
2310 { "psrlw", { MX
, EM
}, PREFIX_OPCODE
},
2311 { "psrld", { MX
, EM
}, PREFIX_OPCODE
},
2312 { "psrlq", { MX
, EM
}, PREFIX_OPCODE
},
2313 { "paddq", { MX
, EM
}, PREFIX_OPCODE
},
2314 { "pmullw", { MX
, EM
}, PREFIX_OPCODE
},
2315 { PREFIX_TABLE (PREFIX_0FD6
) },
2316 { MOD_TABLE (MOD_0FD7
) },
2318 { "psubusb", { MX
, EM
}, PREFIX_OPCODE
},
2319 { "psubusw", { MX
, EM
}, PREFIX_OPCODE
},
2320 { "pminub", { MX
, EM
}, PREFIX_OPCODE
},
2321 { "pand", { MX
, EM
}, PREFIX_OPCODE
},
2322 { "paddusb", { MX
, EM
}, PREFIX_OPCODE
},
2323 { "paddusw", { MX
, EM
}, PREFIX_OPCODE
},
2324 { "pmaxub", { MX
, EM
}, PREFIX_OPCODE
},
2325 { "pandn", { MX
, EM
}, PREFIX_OPCODE
},
2327 { "pavgb", { MX
, EM
}, PREFIX_OPCODE
},
2328 { "psraw", { MX
, EM
}, PREFIX_OPCODE
},
2329 { "psrad", { MX
, EM
}, PREFIX_OPCODE
},
2330 { "pavgw", { MX
, EM
}, PREFIX_OPCODE
},
2331 { "pmulhuw", { MX
, EM
}, PREFIX_OPCODE
},
2332 { "pmulhw", { MX
, EM
}, PREFIX_OPCODE
},
2333 { PREFIX_TABLE (PREFIX_0FE6
) },
2334 { PREFIX_TABLE (PREFIX_0FE7
) },
2336 { "psubsb", { MX
, EM
}, PREFIX_OPCODE
},
2337 { "psubsw", { MX
, EM
}, PREFIX_OPCODE
},
2338 { "pminsw", { MX
, EM
}, PREFIX_OPCODE
},
2339 { "por", { MX
, EM
}, PREFIX_OPCODE
},
2340 { "paddsb", { MX
, EM
}, PREFIX_OPCODE
},
2341 { "paddsw", { MX
, EM
}, PREFIX_OPCODE
},
2342 { "pmaxsw", { MX
, EM
}, PREFIX_OPCODE
},
2343 { "pxor", { MX
, EM
}, PREFIX_OPCODE
},
2345 { PREFIX_TABLE (PREFIX_0FF0
) },
2346 { "psllw", { MX
, EM
}, PREFIX_OPCODE
},
2347 { "pslld", { MX
, EM
}, PREFIX_OPCODE
},
2348 { "psllq", { MX
, EM
}, PREFIX_OPCODE
},
2349 { "pmuludq", { MX
, EM
}, PREFIX_OPCODE
},
2350 { "pmaddwd", { MX
, EM
}, PREFIX_OPCODE
},
2351 { "psadbw", { MX
, EM
}, PREFIX_OPCODE
},
2352 { PREFIX_TABLE (PREFIX_0FF7
) },
2354 { "psubb", { MX
, EM
}, PREFIX_OPCODE
},
2355 { "psubw", { MX
, EM
}, PREFIX_OPCODE
},
2356 { "psubd", { MX
, EM
}, PREFIX_OPCODE
},
2357 { "psubq", { MX
, EM
}, PREFIX_OPCODE
},
2358 { "paddb", { MX
, EM
}, PREFIX_OPCODE
},
2359 { "paddw", { MX
, EM
}, PREFIX_OPCODE
},
2360 { "paddd", { MX
, EM
}, PREFIX_OPCODE
},
2361 { "ud0S", { Gv
, Ev
}, 0 },
2364 static const bool onebyte_has_modrm
[256] = {
2365 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2366 /* ------------------------------- */
2367 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2368 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2369 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2370 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2371 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2372 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2373 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2374 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2375 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2376 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2377 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2378 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2379 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2380 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2381 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2382 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2383 /* ------------------------------- */
2384 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2387 static const bool twobyte_has_modrm
[256] = {
2388 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2389 /* ------------------------------- */
2390 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2391 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2392 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2393 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2394 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2395 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2396 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2397 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2398 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2399 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2400 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2401 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
2402 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2403 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2404 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2405 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
2406 /* ------------------------------- */
2407 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2417 /* If we are accessing mod/rm/reg without need_modrm set, then the
2418 values are stale. Hitting this abort likely indicates that you
2419 need to update onebyte_has_modrm or twobyte_has_modrm. */
2420 #define MODRM_CHECK if (!ins->need_modrm) abort ()
2422 static const char *const intel_index16
[] = {
2423 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
2426 static const char *const att_names64
[] = {
2427 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
2428 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
2430 static const char *const att_names32
[] = {
2431 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
2432 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
2434 static const char *const att_names16
[] = {
2435 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
2436 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
2438 static const char *const att_names8
[] = {
2439 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
2441 static const char *const att_names8rex
[] = {
2442 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
2443 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
2445 static const char *const att_names_seg
[] = {
2446 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
2448 static const char att_index64
[] = "%riz";
2449 static const char att_index32
[] = "%eiz";
2450 static const char *const att_index16
[] = {
2451 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
2454 static const char *const att_names_mm
[] = {
2455 "%mm0", "%mm1", "%mm2", "%mm3",
2456 "%mm4", "%mm5", "%mm6", "%mm7"
2459 static const char *const att_names_bnd
[] = {
2460 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
2463 static const char *const att_names_xmm
[] = {
2464 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
2465 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
2466 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
2467 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
2468 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
2469 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
2470 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
2471 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
2474 static const char *const att_names_ymm
[] = {
2475 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
2476 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
2477 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
2478 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
2479 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
2480 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
2481 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
2482 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
2485 static const char *const att_names_zmm
[] = {
2486 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
2487 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
2488 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
2489 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
2490 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
2491 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
2492 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
2493 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
2496 static const char *const att_names_tmm
[] = {
2497 "%tmm0", "%tmm1", "%tmm2", "%tmm3",
2498 "%tmm4", "%tmm5", "%tmm6", "%tmm7"
2501 static const char *const att_names_mask
[] = {
2502 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
2505 static const char *const names_rounding
[] =
2513 static const struct dis386 reg_table
[][8] = {
2516 { "addA", { Ebh1
, Ib
}, 0 },
2517 { "orA", { Ebh1
, Ib
}, 0 },
2518 { "adcA", { Ebh1
, Ib
}, 0 },
2519 { "sbbA", { Ebh1
, Ib
}, 0 },
2520 { "andA", { Ebh1
, Ib
}, 0 },
2521 { "subA", { Ebh1
, Ib
}, 0 },
2522 { "xorA", { Ebh1
, Ib
}, 0 },
2523 { "cmpA", { Eb
, Ib
}, 0 },
2527 { "addQ", { Evh1
, Iv
}, 0 },
2528 { "orQ", { Evh1
, Iv
}, 0 },
2529 { "adcQ", { Evh1
, Iv
}, 0 },
2530 { "sbbQ", { Evh1
, Iv
}, 0 },
2531 { "andQ", { Evh1
, Iv
}, 0 },
2532 { "subQ", { Evh1
, Iv
}, 0 },
2533 { "xorQ", { Evh1
, Iv
}, 0 },
2534 { "cmpQ", { Ev
, Iv
}, 0 },
2538 { "addQ", { Evh1
, sIb
}, 0 },
2539 { "orQ", { Evh1
, sIb
}, 0 },
2540 { "adcQ", { Evh1
, sIb
}, 0 },
2541 { "sbbQ", { Evh1
, sIb
}, 0 },
2542 { "andQ", { Evh1
, sIb
}, 0 },
2543 { "subQ", { Evh1
, sIb
}, 0 },
2544 { "xorQ", { Evh1
, sIb
}, 0 },
2545 { "cmpQ", { Ev
, sIb
}, 0 },
2549 { "pop{P|}", { stackEv
}, 0 },
2550 { XOP_8F_TABLE (XOP_09
) },
2554 { XOP_8F_TABLE (XOP_09
) },
2558 { "rolA", { Eb
, Ib
}, 0 },
2559 { "rorA", { Eb
, Ib
}, 0 },
2560 { "rclA", { Eb
, Ib
}, 0 },
2561 { "rcrA", { Eb
, Ib
}, 0 },
2562 { "shlA", { Eb
, Ib
}, 0 },
2563 { "shrA", { Eb
, Ib
}, 0 },
2564 { "shlA", { Eb
, Ib
}, 0 },
2565 { "sarA", { Eb
, Ib
}, 0 },
2569 { "rolQ", { Ev
, Ib
}, 0 },
2570 { "rorQ", { Ev
, Ib
}, 0 },
2571 { "rclQ", { Ev
, Ib
}, 0 },
2572 { "rcrQ", { Ev
, Ib
}, 0 },
2573 { "shlQ", { Ev
, Ib
}, 0 },
2574 { "shrQ", { Ev
, Ib
}, 0 },
2575 { "shlQ", { Ev
, Ib
}, 0 },
2576 { "sarQ", { Ev
, Ib
}, 0 },
2580 { "movA", { Ebh3
, Ib
}, 0 },
2587 { MOD_TABLE (MOD_C6_REG_7
) },
2591 { "movQ", { Evh3
, Iv
}, 0 },
2598 { MOD_TABLE (MOD_C7_REG_7
) },
2602 { "rolA", { Eb
, I1
}, 0 },
2603 { "rorA", { Eb
, I1
}, 0 },
2604 { "rclA", { Eb
, I1
}, 0 },
2605 { "rcrA", { Eb
, I1
}, 0 },
2606 { "shlA", { Eb
, I1
}, 0 },
2607 { "shrA", { Eb
, I1
}, 0 },
2608 { "shlA", { Eb
, I1
}, 0 },
2609 { "sarA", { Eb
, I1
}, 0 },
2613 { "rolQ", { Ev
, I1
}, 0 },
2614 { "rorQ", { Ev
, I1
}, 0 },
2615 { "rclQ", { Ev
, I1
}, 0 },
2616 { "rcrQ", { Ev
, I1
}, 0 },
2617 { "shlQ", { Ev
, I1
}, 0 },
2618 { "shrQ", { Ev
, I1
}, 0 },
2619 { "shlQ", { Ev
, I1
}, 0 },
2620 { "sarQ", { Ev
, I1
}, 0 },
2624 { "rolA", { Eb
, CL
}, 0 },
2625 { "rorA", { Eb
, CL
}, 0 },
2626 { "rclA", { Eb
, CL
}, 0 },
2627 { "rcrA", { Eb
, CL
}, 0 },
2628 { "shlA", { Eb
, CL
}, 0 },
2629 { "shrA", { Eb
, CL
}, 0 },
2630 { "shlA", { Eb
, CL
}, 0 },
2631 { "sarA", { Eb
, CL
}, 0 },
2635 { "rolQ", { Ev
, CL
}, 0 },
2636 { "rorQ", { Ev
, CL
}, 0 },
2637 { "rclQ", { Ev
, CL
}, 0 },
2638 { "rcrQ", { Ev
, CL
}, 0 },
2639 { "shlQ", { Ev
, CL
}, 0 },
2640 { "shrQ", { Ev
, CL
}, 0 },
2641 { "shlQ", { Ev
, CL
}, 0 },
2642 { "sarQ", { Ev
, CL
}, 0 },
2646 { "testA", { Eb
, Ib
}, 0 },
2647 { "testA", { Eb
, Ib
}, 0 },
2648 { "notA", { Ebh1
}, 0 },
2649 { "negA", { Ebh1
}, 0 },
2650 { "mulA", { Eb
}, 0 }, /* Don't print the implicit %al register, */
2651 { "imulA", { Eb
}, 0 }, /* to distinguish these opcodes from other */
2652 { "divA", { Eb
}, 0 }, /* mul/imul opcodes. Do the same for div */
2653 { "idivA", { Eb
}, 0 }, /* and idiv for consistency. */
2657 { "testQ", { Ev
, Iv
}, 0 },
2658 { "testQ", { Ev
, Iv
}, 0 },
2659 { "notQ", { Evh1
}, 0 },
2660 { "negQ", { Evh1
}, 0 },
2661 { "mulQ", { Ev
}, 0 }, /* Don't print the implicit register. */
2662 { "imulQ", { Ev
}, 0 },
2663 { "divQ", { Ev
}, 0 },
2664 { "idivQ", { Ev
}, 0 },
2668 { "incA", { Ebh1
}, 0 },
2669 { "decA", { Ebh1
}, 0 },
2673 { "incQ", { Evh1
}, 0 },
2674 { "decQ", { Evh1
}, 0 },
2675 { "call{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2676 { MOD_TABLE (MOD_FF_REG_3
) },
2677 { "jmp{@|}", { NOTRACK
, indirEv
, BND
}, 0 },
2678 { MOD_TABLE (MOD_FF_REG_5
) },
2679 { "push{P|}", { stackEv
}, 0 },
2684 { "sldtD", { Sv
}, 0 },
2685 { "strD", { Sv
}, 0 },
2686 { "lldt", { Ew
}, 0 },
2687 { "ltr", { Ew
}, 0 },
2688 { "verr", { Ew
}, 0 },
2689 { "verw", { Ew
}, 0 },
2695 { MOD_TABLE (MOD_0F01_REG_0
) },
2696 { MOD_TABLE (MOD_0F01_REG_1
) },
2697 { MOD_TABLE (MOD_0F01_REG_2
) },
2698 { MOD_TABLE (MOD_0F01_REG_3
) },
2699 { "smswD", { Sv
}, 0 },
2700 { MOD_TABLE (MOD_0F01_REG_5
) },
2701 { "lmsw", { Ew
}, 0 },
2702 { MOD_TABLE (MOD_0F01_REG_7
) },
2706 { "prefetch", { Mb
}, 0 },
2707 { "prefetchw", { Mb
}, 0 },
2708 { "prefetchwt1", { Mb
}, 0 },
2709 { "prefetch", { Mb
}, 0 },
2710 { "prefetch", { Mb
}, 0 },
2711 { "prefetch", { Mb
}, 0 },
2712 { "prefetch", { Mb
}, 0 },
2713 { "prefetch", { Mb
}, 0 },
2717 { MOD_TABLE (MOD_0F18_REG_0
) },
2718 { MOD_TABLE (MOD_0F18_REG_1
) },
2719 { MOD_TABLE (MOD_0F18_REG_2
) },
2720 { MOD_TABLE (MOD_0F18_REG_3
) },
2721 { "nopQ", { Ev
}, 0 },
2722 { "nopQ", { Ev
}, 0 },
2723 { "nopQ", { Ev
}, 0 },
2724 { "nopQ", { Ev
}, 0 },
2726 /* REG_0F1C_P_0_MOD_0 */
2728 { "cldemote", { Mb
}, 0 },
2729 { "nopQ", { Ev
}, 0 },
2730 { "nopQ", { Ev
}, 0 },
2731 { "nopQ", { Ev
}, 0 },
2732 { "nopQ", { Ev
}, 0 },
2733 { "nopQ", { Ev
}, 0 },
2734 { "nopQ", { Ev
}, 0 },
2735 { "nopQ", { Ev
}, 0 },
2737 /* REG_0F1E_P_1_MOD_3 */
2739 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2740 { "rdsspK", { Edq
}, 0 },
2741 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2742 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2743 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2744 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2745 { "nopQ", { Ev
}, PREFIX_IGNORED
},
2746 { RM_TABLE (RM_0F1E_P_1_MOD_3_REG_7
) },
2748 /* REG_0F38D8_PREFIX_1 */
2750 { "aesencwide128kl", { M
}, 0 },
2751 { "aesdecwide128kl", { M
}, 0 },
2752 { "aesencwide256kl", { M
}, 0 },
2753 { "aesdecwide256kl", { M
}, 0 },
2755 /* REG_0F3A0F_PREFIX_1_MOD_3 */
2757 { RM_TABLE (RM_0F3A0F_P_1_MOD_3_REG_0
) },
2759 /* REG_0F71_MOD_0 */
2763 { "psrlw", { MS
, Ib
}, PREFIX_OPCODE
},
2765 { "psraw", { MS
, Ib
}, PREFIX_OPCODE
},
2767 { "psllw", { MS
, Ib
}, PREFIX_OPCODE
},
2769 /* REG_0F72_MOD_0 */
2773 { "psrld", { MS
, Ib
}, PREFIX_OPCODE
},
2775 { "psrad", { MS
, Ib
}, PREFIX_OPCODE
},
2777 { "pslld", { MS
, Ib
}, PREFIX_OPCODE
},
2779 /* REG_0F73_MOD_0 */
2783 { "psrlq", { MS
, Ib
}, PREFIX_OPCODE
},
2784 { "psrldq", { XS
, Ib
}, PREFIX_DATA
},
2787 { "psllq", { MS
, Ib
}, PREFIX_OPCODE
},
2788 { "pslldq", { XS
, Ib
}, PREFIX_DATA
},
2792 { "montmul", { { OP_0f07
, 0 } }, 0 },
2793 { "xsha1", { { OP_0f07
, 0 } }, 0 },
2794 { "xsha256", { { OP_0f07
, 0 } }, 0 },
2798 { "xstore-rng", { { OP_0f07
, 0 } }, 0 },
2799 { "xcrypt-ecb", { { OP_0f07
, 0 } }, 0 },
2800 { "xcrypt-cbc", { { OP_0f07
, 0 } }, 0 },
2801 { "xcrypt-ctr", { { OP_0f07
, 0 } }, 0 },
2802 { "xcrypt-cfb", { { OP_0f07
, 0 } }, 0 },
2803 { "xcrypt-ofb", { { OP_0f07
, 0 } }, 0 },
2807 { MOD_TABLE (MOD_0FAE_REG_0
) },
2808 { MOD_TABLE (MOD_0FAE_REG_1
) },
2809 { MOD_TABLE (MOD_0FAE_REG_2
) },
2810 { MOD_TABLE (MOD_0FAE_REG_3
) },
2811 { MOD_TABLE (MOD_0FAE_REG_4
) },
2812 { MOD_TABLE (MOD_0FAE_REG_5
) },
2813 { MOD_TABLE (MOD_0FAE_REG_6
) },
2814 { MOD_TABLE (MOD_0FAE_REG_7
) },
2822 { "btQ", { Ev
, Ib
}, 0 },
2823 { "btsQ", { Evh1
, Ib
}, 0 },
2824 { "btrQ", { Evh1
, Ib
}, 0 },
2825 { "btcQ", { Evh1
, Ib
}, 0 },
2830 { "cmpxchg8b", { { CMPXCHG8B_Fixup
, q_mode
} }, 0 },
2832 { MOD_TABLE (MOD_0FC7_REG_3
) },
2833 { MOD_TABLE (MOD_0FC7_REG_4
) },
2834 { MOD_TABLE (MOD_0FC7_REG_5
) },
2835 { MOD_TABLE (MOD_0FC7_REG_6
) },
2836 { MOD_TABLE (MOD_0FC7_REG_7
) },
2838 /* REG_VEX_0F71_M_0 */
2842 { "vpsrlw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2844 { "vpsraw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2846 { "vpsllw", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2848 /* REG_VEX_0F72_M_0 */
2852 { "vpsrld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2854 { "vpsrad", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2856 { "vpslld", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2858 /* REG_VEX_0F73_M_0 */
2862 { "vpsrlq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2863 { "vpsrldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2866 { "vpsllq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2867 { "vpslldq", { Vex
, XS
, Ib
}, PREFIX_DATA
},
2873 { MOD_TABLE (MOD_VEX_0FAE_REG_2
) },
2874 { MOD_TABLE (MOD_VEX_0FAE_REG_3
) },
2876 /* REG_VEX_0F3849_X86_64_P_0_W_0_M_1 */
2878 { RM_TABLE (RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0
) },
2880 /* REG_VEX_0F38F3_L_0 */
2883 { "blsrS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2884 { "blsmskS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2885 { "blsiS", { VexGdq
, Edq
}, PREFIX_OPCODE
},
2887 /* REG_XOP_09_01_L_0 */
2890 { "blcfill", { VexGdq
, Edq
}, 0 },
2891 { "blsfill", { VexGdq
, Edq
}, 0 },
2892 { "blcs", { VexGdq
, Edq
}, 0 },
2893 { "tzmsk", { VexGdq
, Edq
}, 0 },
2894 { "blcic", { VexGdq
, Edq
}, 0 },
2895 { "blsic", { VexGdq
, Edq
}, 0 },
2896 { "t1mskc", { VexGdq
, Edq
}, 0 },
2898 /* REG_XOP_09_02_L_0 */
2901 { "blcmsk", { VexGdq
, Edq
}, 0 },
2906 { "blci", { VexGdq
, Edq
}, 0 },
2908 /* REG_XOP_09_12_M_1_L_0 */
2910 { "llwpcb", { Edq
}, 0 },
2911 { "slwpcb", { Edq
}, 0 },
2913 /* REG_XOP_0A_12_L_0 */
2915 { "lwpins", { VexGdq
, Ed
, Id
}, 0 },
2916 { "lwpval", { VexGdq
, Ed
, Id
}, 0 },
2919 #include "i386-dis-evex-reg.h"
2922 static const struct dis386 prefix_table
[][4] = {
2925 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2926 { "pause", { XX
}, 0 },
2927 { "xchgS", { { NOP_Fixup
, 0 }, { NOP_Fixup
, 1 } }, 0 },
2928 { NULL
, { { NULL
, 0 } }, PREFIX_IGNORED
}
2931 /* PREFIX_0F01_REG_1_RM_4 */
2935 { "tdcall", { Skip_MODRM
}, 0 },
2939 /* PREFIX_0F01_REG_1_RM_5 */
2943 { X86_64_TABLE (X86_64_0F01_REG_1_RM_5_PREFIX_2
) },
2947 /* PREFIX_0F01_REG_1_RM_6 */
2951 { X86_64_TABLE (X86_64_0F01_REG_1_RM_6_PREFIX_2
) },
2955 /* PREFIX_0F01_REG_1_RM_7 */
2957 { "encls", { Skip_MODRM
}, 0 },
2959 { X86_64_TABLE (X86_64_0F01_REG_1_RM_7_PREFIX_2
) },
2963 /* PREFIX_0F01_REG_3_RM_1 */
2965 { "vmmcall", { Skip_MODRM
}, 0 },
2966 { "vmgexit", { Skip_MODRM
}, 0 },
2968 { "vmgexit", { Skip_MODRM
}, 0 },
2971 /* PREFIX_0F01_REG_5_MOD_0 */
2974 { "rstorssp", { Mq
}, PREFIX_OPCODE
},
2977 /* PREFIX_0F01_REG_5_MOD_3_RM_0 */
2979 { "serialize", { Skip_MODRM
}, PREFIX_OPCODE
},
2980 { "setssbsy", { Skip_MODRM
}, PREFIX_OPCODE
},
2982 { "xsusldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
2985 /* PREFIX_0F01_REG_5_MOD_3_RM_1 */
2990 { "xresldtrk", { Skip_MODRM
}, PREFIX_OPCODE
},
2993 /* PREFIX_0F01_REG_5_MOD_3_RM_2 */
2996 { "saveprevssp", { Skip_MODRM
}, PREFIX_OPCODE
},
2999 /* PREFIX_0F01_REG_5_MOD_3_RM_4 */
3002 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1
) },
3005 /* PREFIX_0F01_REG_5_MOD_3_RM_5 */
3008 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1
) },
3011 /* PREFIX_0F01_REG_5_MOD_3_RM_6 */
3013 { "rdpkru", { Skip_MODRM
}, 0 },
3014 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1
) },
3017 /* PREFIX_0F01_REG_5_MOD_3_RM_7 */
3019 { "wrpkru", { Skip_MODRM
}, 0 },
3020 { X86_64_TABLE (X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1
) },
3023 /* PREFIX_0F01_REG_7_MOD_3_RM_2 */
3025 { "monitorx", { { OP_Monitor
, 0 } }, 0 },
3026 { "mcommit", { Skip_MODRM
}, 0 },
3029 /* PREFIX_0F01_REG_7_MOD_3_RM_6 */
3031 { "invlpgb", { Skip_MODRM
}, 0 },
3032 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1
) },
3034 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3
) },
3037 /* PREFIX_0F01_REG_7_MOD_3_RM_7 */
3039 { "tlbsync", { Skip_MODRM
}, 0 },
3040 { X86_64_TABLE (X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1
) },
3042 { "pvalidate", { Skip_MODRM
}, 0 },
3047 { "wbinvd", { XX
}, 0 },
3048 { "wbnoinvd", { XX
}, 0 },
3053 { "movups", { XM
, EXx
}, PREFIX_OPCODE
},
3054 { "movss", { XM
, EXd
}, PREFIX_OPCODE
},
3055 { "movupd", { XM
, EXx
}, PREFIX_OPCODE
},
3056 { "movsd", { XM
, EXq
}, PREFIX_OPCODE
},
3061 { "movups", { EXxS
, XM
}, PREFIX_OPCODE
},
3062 { "movss", { EXdS
, XM
}, PREFIX_OPCODE
},
3063 { "movupd", { EXxS
, XM
}, PREFIX_OPCODE
},
3064 { "movsd", { EXqS
, XM
}, PREFIX_OPCODE
},
3069 { MOD_TABLE (MOD_0F12_PREFIX_0
) },
3070 { "movsldup", { XM
, EXx
}, PREFIX_OPCODE
},
3071 { MOD_TABLE (MOD_0F12_PREFIX_2
) },
3072 { "movddup", { XM
, EXq
}, PREFIX_OPCODE
},
3077 { MOD_TABLE (MOD_0F16_PREFIX_0
) },
3078 { "movshdup", { XM
, EXx
}, PREFIX_OPCODE
},
3079 { MOD_TABLE (MOD_0F16_PREFIX_2
) },
3084 { MOD_TABLE (MOD_0F1A_PREFIX_0
) },
3085 { "bndcl", { Gbnd
, Ev_bnd
}, 0 },
3086 { "bndmov", { Gbnd
, Ebnd
}, 0 },
3087 { "bndcu", { Gbnd
, Ev_bnd
}, 0 },
3092 { MOD_TABLE (MOD_0F1B_PREFIX_0
) },
3093 { MOD_TABLE (MOD_0F1B_PREFIX_1
) },
3094 { "bndmov", { EbndS
, Gbnd
}, 0 },
3095 { "bndcn", { Gbnd
, Ev_bnd
}, 0 },
3100 { MOD_TABLE (MOD_0F1C_PREFIX_0
) },
3101 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3102 { "nopQ", { Ev
}, 0 },
3103 { "nopQ", { Ev
}, PREFIX_IGNORED
},
3108 { "nopQ", { Ev
}, 0 },
3109 { MOD_TABLE (MOD_0F1E_PREFIX_1
) },
3110 { "nopQ", { Ev
}, 0 },
3111 { NULL
, { XX
}, PREFIX_IGNORED
},
3116 { "cvtpi2ps", { XM
, EMCq
}, PREFIX_OPCODE
},
3117 { "cvtsi2ss{%LQ|}", { XM
, Edq
}, PREFIX_OPCODE
},
3118 { "cvtpi2pd", { XM
, EMCq
}, PREFIX_OPCODE
},
3119 { "cvtsi2sd{%LQ|}", { XM
, Edq
}, 0 },
3124 { MOD_TABLE (MOD_0F2B_PREFIX_0
) },
3125 { MOD_TABLE (MOD_0F2B_PREFIX_1
) },
3126 { MOD_TABLE (MOD_0F2B_PREFIX_2
) },
3127 { MOD_TABLE (MOD_0F2B_PREFIX_3
) },
3132 { "cvttps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3133 { "cvttss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3134 { "cvttpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3135 { "cvttsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3140 { "cvtps2pi", { MXC
, EXq
}, PREFIX_OPCODE
},
3141 { "cvtss2si", { Gdq
, EXd
}, PREFIX_OPCODE
},
3142 { "cvtpd2pi", { MXC
, EXx
}, PREFIX_OPCODE
},
3143 { "cvtsd2si", { Gdq
, EXq
}, PREFIX_OPCODE
},
3148 { "ucomiss",{ XM
, EXd
}, 0 },
3150 { "ucomisd",{ XM
, EXq
}, 0 },
3155 { "comiss", { XM
, EXd
}, 0 },
3157 { "comisd", { XM
, EXq
}, 0 },
3162 { "sqrtps", { XM
, EXx
}, PREFIX_OPCODE
},
3163 { "sqrtss", { XM
, EXd
}, PREFIX_OPCODE
},
3164 { "sqrtpd", { XM
, EXx
}, PREFIX_OPCODE
},
3165 { "sqrtsd", { XM
, EXq
}, PREFIX_OPCODE
},
3170 { "rsqrtps",{ XM
, EXx
}, PREFIX_OPCODE
},
3171 { "rsqrtss",{ XM
, EXd
}, PREFIX_OPCODE
},
3176 { "rcpps", { XM
, EXx
}, PREFIX_OPCODE
},
3177 { "rcpss", { XM
, EXd
}, PREFIX_OPCODE
},
3182 { "addps", { XM
, EXx
}, PREFIX_OPCODE
},
3183 { "addss", { XM
, EXd
}, PREFIX_OPCODE
},
3184 { "addpd", { XM
, EXx
}, PREFIX_OPCODE
},
3185 { "addsd", { XM
, EXq
}, PREFIX_OPCODE
},
3190 { "mulps", { XM
, EXx
}, PREFIX_OPCODE
},
3191 { "mulss", { XM
, EXd
}, PREFIX_OPCODE
},
3192 { "mulpd", { XM
, EXx
}, PREFIX_OPCODE
},
3193 { "mulsd", { XM
, EXq
}, PREFIX_OPCODE
},
3198 { "cvtps2pd", { XM
, EXq
}, PREFIX_OPCODE
},
3199 { "cvtss2sd", { XM
, EXd
}, PREFIX_OPCODE
},
3200 { "cvtpd2ps", { XM
, EXx
}, PREFIX_OPCODE
},
3201 { "cvtsd2ss", { XM
, EXq
}, PREFIX_OPCODE
},
3206 { "cvtdq2ps", { XM
, EXx
}, PREFIX_OPCODE
},
3207 { "cvttps2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3208 { "cvtps2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3213 { "subps", { XM
, EXx
}, PREFIX_OPCODE
},
3214 { "subss", { XM
, EXd
}, PREFIX_OPCODE
},
3215 { "subpd", { XM
, EXx
}, PREFIX_OPCODE
},
3216 { "subsd", { XM
, EXq
}, PREFIX_OPCODE
},
3221 { "minps", { XM
, EXx
}, PREFIX_OPCODE
},
3222 { "minss", { XM
, EXd
}, PREFIX_OPCODE
},
3223 { "minpd", { XM
, EXx
}, PREFIX_OPCODE
},
3224 { "minsd", { XM
, EXq
}, PREFIX_OPCODE
},
3229 { "divps", { XM
, EXx
}, PREFIX_OPCODE
},
3230 { "divss", { XM
, EXd
}, PREFIX_OPCODE
},
3231 { "divpd", { XM
, EXx
}, PREFIX_OPCODE
},
3232 { "divsd", { XM
, EXq
}, PREFIX_OPCODE
},
3237 { "maxps", { XM
, EXx
}, PREFIX_OPCODE
},
3238 { "maxss", { XM
, EXd
}, PREFIX_OPCODE
},
3239 { "maxpd", { XM
, EXx
}, PREFIX_OPCODE
},
3240 { "maxsd", { XM
, EXq
}, PREFIX_OPCODE
},
3245 { "punpcklbw",{ MX
, EMd
}, PREFIX_OPCODE
},
3247 { "punpcklbw",{ MX
, EMx
}, PREFIX_OPCODE
},
3252 { "punpcklwd",{ MX
, EMd
}, PREFIX_OPCODE
},
3254 { "punpcklwd",{ MX
, EMx
}, PREFIX_OPCODE
},
3259 { "punpckldq",{ MX
, EMd
}, PREFIX_OPCODE
},
3261 { "punpckldq",{ MX
, EMx
}, PREFIX_OPCODE
},
3266 { "movq", { MX
, EM
}, PREFIX_OPCODE
},
3267 { "movdqu", { XM
, EXx
}, PREFIX_OPCODE
},
3268 { "movdqa", { XM
, EXx
}, PREFIX_OPCODE
},
3273 { "pshufw", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
3274 { "pshufhw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3275 { "pshufd", { XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3276 { "pshuflw",{ XM
, EXx
, Ib
}, PREFIX_OPCODE
},
3281 {"vmread", { Em
, Gm
}, 0 },
3283 {"extrq", { XS
, Ib
, Ib
}, 0 },
3284 {"insertq", { XM
, XS
, Ib
, Ib
}, 0 },
3289 {"vmwrite", { Gm
, Em
}, 0 },
3291 {"extrq", { XM
, XS
}, 0 },
3292 {"insertq", { XM
, XS
}, 0 },
3299 { "haddpd", { XM
, EXx
}, PREFIX_OPCODE
},
3300 { "haddps", { XM
, EXx
}, PREFIX_OPCODE
},
3307 { "hsubpd", { XM
, EXx
}, PREFIX_OPCODE
},
3308 { "hsubps", { XM
, EXx
}, PREFIX_OPCODE
},
3313 { "movK", { Edq
, MX
}, PREFIX_OPCODE
},
3314 { "movq", { XM
, EXq
}, PREFIX_OPCODE
},
3315 { "movK", { Edq
, XM
}, PREFIX_OPCODE
},
3320 { "movq", { EMS
, MX
}, PREFIX_OPCODE
},
3321 { "movdqu", { EXxS
, XM
}, PREFIX_OPCODE
},
3322 { "movdqa", { EXxS
, XM
}, PREFIX_OPCODE
},
3325 /* PREFIX_0FAE_REG_0_MOD_3 */
3328 { "rdfsbase", { Ev
}, 0 },
3331 /* PREFIX_0FAE_REG_1_MOD_3 */
3334 { "rdgsbase", { Ev
}, 0 },
3337 /* PREFIX_0FAE_REG_2_MOD_3 */
3340 { "wrfsbase", { Ev
}, 0 },
3343 /* PREFIX_0FAE_REG_3_MOD_3 */
3346 { "wrgsbase", { Ev
}, 0 },
3349 /* PREFIX_0FAE_REG_4_MOD_0 */
3351 { "xsave", { FXSAVE
}, 0 },
3352 { "ptwrite{%LQ|}", { Edq
}, 0 },
3355 /* PREFIX_0FAE_REG_4_MOD_3 */
3358 { "ptwrite{%LQ|}", { Edq
}, 0 },
3361 /* PREFIX_0FAE_REG_5_MOD_3 */
3363 { "lfence", { Skip_MODRM
}, 0 },
3364 { "incsspK", { Edq
}, PREFIX_OPCODE
},
3367 /* PREFIX_0FAE_REG_6_MOD_0 */
3369 { "xsaveopt", { FXSAVE
}, PREFIX_OPCODE
},
3370 { "clrssbsy", { Mq
}, PREFIX_OPCODE
},
3371 { "clwb", { Mb
}, PREFIX_OPCODE
},
3374 /* PREFIX_0FAE_REG_6_MOD_3 */
3376 { RM_TABLE (RM_0FAE_REG_6_MOD_3_P_0
) },
3377 { "umonitor", { Eva
}, PREFIX_OPCODE
},
3378 { "tpause", { Edq
}, PREFIX_OPCODE
},
3379 { "umwait", { Edq
}, PREFIX_OPCODE
},
3382 /* PREFIX_0FAE_REG_7_MOD_0 */
3384 { "clflush", { Mb
}, 0 },
3386 { "clflushopt", { Mb
}, 0 },
3392 { "popcntS", { Gv
, Ev
}, 0 },
3397 { "bsfS", { Gv
, Ev
}, 0 },
3398 { "tzcntS", { Gv
, Ev
}, 0 },
3399 { "bsfS", { Gv
, Ev
}, 0 },
3404 { "bsrS", { Gv
, Ev
}, 0 },
3405 { "lzcntS", { Gv
, Ev
}, 0 },
3406 { "bsrS", { Gv
, Ev
}, 0 },
3411 { "cmpps", { XM
, EXx
, CMP
}, PREFIX_OPCODE
},
3412 { "cmpss", { XM
, EXd
, CMP
}, PREFIX_OPCODE
},
3413 { "cmppd", { XM
, EXx
, CMP
}, PREFIX_OPCODE
},
3414 { "cmpsd", { XM
, EXq
, CMP
}, PREFIX_OPCODE
},
3417 /* PREFIX_0FC7_REG_6_MOD_0 */
3419 { "vmptrld",{ Mq
}, 0 },
3420 { "vmxon", { Mq
}, 0 },
3421 { "vmclear",{ Mq
}, 0 },
3424 /* PREFIX_0FC7_REG_6_MOD_3 */
3426 { "rdrand", { Ev
}, 0 },
3427 { X86_64_TABLE (X86_64_0FC7_REG_6_MOD_3_PREFIX_1
) },
3428 { "rdrand", { Ev
}, 0 }
3431 /* PREFIX_0FC7_REG_7_MOD_3 */
3433 { "rdseed", { Ev
}, 0 },
3434 { "rdpid", { Em
}, 0 },
3435 { "rdseed", { Ev
}, 0 },
3442 { "addsubpd", { XM
, EXx
}, 0 },
3443 { "addsubps", { XM
, EXx
}, 0 },
3449 { "movq2dq",{ XM
, MS
}, 0 },
3450 { "movq", { EXqS
, XM
}, 0 },
3451 { "movdq2q",{ MX
, XS
}, 0 },
3457 { "cvtdq2pd", { XM
, EXq
}, PREFIX_OPCODE
},
3458 { "cvttpd2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3459 { "cvtpd2dq", { XM
, EXx
}, PREFIX_OPCODE
},
3464 { "movntq", { Mq
, MX
}, PREFIX_OPCODE
},
3466 { MOD_TABLE (MOD_0FE7_PREFIX_2
) },
3474 { MOD_TABLE (MOD_0FF0_PREFIX_3
) },
3479 { "maskmovq", { MX
, MS
}, PREFIX_OPCODE
},
3481 { "maskmovdqu", { XM
, XS
}, PREFIX_OPCODE
},
3487 { REG_TABLE (REG_0F38D8_PREFIX_1
) },
3493 { MOD_TABLE (MOD_0F38DC_PREFIX_1
) },
3494 { "aesenc", { XM
, EXx
}, 0 },
3500 { MOD_TABLE (MOD_0F38DD_PREFIX_1
) },
3501 { "aesenclast", { XM
, EXx
}, 0 },
3507 { MOD_TABLE (MOD_0F38DE_PREFIX_1
) },
3508 { "aesdec", { XM
, EXx
}, 0 },
3514 { MOD_TABLE (MOD_0F38DF_PREFIX_1
) },
3515 { "aesdeclast", { XM
, EXx
}, 0 },
3520 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3522 { "movbeS", { Gv
, Mv
}, PREFIX_OPCODE
},
3523 { "crc32A", { Gdq
, Eb
}, PREFIX_OPCODE
},
3528 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3530 { "movbeS", { Mv
, Gv
}, PREFIX_OPCODE
},
3531 { "crc32Q", { Gdq
, Ev
}, PREFIX_OPCODE
},
3536 { MOD_TABLE (MOD_0F38F6_PREFIX_0
) },
3537 { "adoxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3538 { "adcxS", { Gdq
, Edq
}, PREFIX_OPCODE
},
3545 { MOD_TABLE (MOD_0F38F8_PREFIX_1
) },
3546 { MOD_TABLE (MOD_0F38F8_PREFIX_2
) },
3547 { MOD_TABLE (MOD_0F38F8_PREFIX_3
) },
3552 { MOD_TABLE (MOD_0F38FA_PREFIX_1
) },
3558 { MOD_TABLE (MOD_0F38FB_PREFIX_1
) },
3564 { MOD_TABLE (MOD_0F3A0F_PREFIX_1
)},
3567 /* PREFIX_VEX_0F10 */
3569 { "%XEvmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3570 { "%XEvmovs%XS", { XMScalar
, VexScalarR
, EXd
}, 0 },
3571 { "%XEvmovupX", { XM
, EXEvexXNoBcst
}, 0 },
3572 { "%XEvmovs%XD", { XMScalar
, VexScalarR
, EXq
}, 0 },
3575 /* PREFIX_VEX_0F11 */
3577 { "%XEvmovupX", { EXxS
, XM
}, 0 },
3578 { "%XEvmovs%XS", { EXdS
, VexScalarR
, XMScalar
}, 0 },
3579 { "%XEvmovupX", { EXxS
, XM
}, 0 },
3580 { "%XEvmovs%XD", { EXqS
, VexScalarR
, XMScalar
}, 0 },
3583 /* PREFIX_VEX_0F12 */
3585 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0
) },
3586 { "%XEvmov%XSldup", { XM
, EXEvexXNoBcst
}, 0 },
3587 { MOD_TABLE (MOD_VEX_0F12_PREFIX_2
) },
3588 { "%XEvmov%XDdup", { XM
, EXymmq
}, 0 },
3591 /* PREFIX_VEX_0F16 */
3593 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0
) },
3594 { "%XEvmov%XShdup", { XM
, EXEvexXNoBcst
}, 0 },
3595 { MOD_TABLE (MOD_VEX_0F16_PREFIX_2
) },
3598 /* PREFIX_VEX_0F2A */
3601 { "%XEvcvtsi2ss{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR
, Edq
}, 0 },
3603 { "%XEvcvtsi2sd{%LQ|}", { XMScalar
, VexScalar
, EXxEVexR64
, Edq
}, 0 },
3606 /* PREFIX_VEX_0F2C */
3609 { "%XEvcvttss2si", { Gdq
, EXd
, EXxEVexS
}, 0 },
3611 { "%XEvcvttsd2si", { Gdq
, EXq
, EXxEVexS
}, 0 },
3614 /* PREFIX_VEX_0F2D */
3617 { "%XEvcvtss2si", { Gdq
, EXd
, EXxEVexR
}, 0 },
3619 { "%XEvcvtsd2si", { Gdq
, EXq
, EXxEVexR
}, 0 },
3622 /* PREFIX_VEX_0F2E */
3624 { "%XEvucomisX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3626 { "%XEvucomisX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3629 /* PREFIX_VEX_0F2F */
3631 { "%XEvcomisX", { XMScalar
, EXd
, EXxEVexS
}, 0 },
3633 { "%XEvcomisX", { XMScalar
, EXq
, EXxEVexS
}, 0 },
3636 /* PREFIX_VEX_0F41_L_1_M_1_W_0 */
3638 { "kandw", { MaskG
, MaskVex
, MaskE
}, 0 },
3640 { "kandb", { MaskG
, MaskVex
, MaskE
}, 0 },
3643 /* PREFIX_VEX_0F41_L_1_M_1_W_1 */
3645 { "kandq", { MaskG
, MaskVex
, MaskE
}, 0 },
3647 { "kandd", { MaskG
, MaskVex
, MaskE
}, 0 },
3650 /* PREFIX_VEX_0F42_L_1_M_1_W_0 */
3652 { "kandnw", { MaskG
, MaskVex
, MaskE
}, 0 },
3654 { "kandnb", { MaskG
, MaskVex
, MaskE
}, 0 },
3657 /* PREFIX_VEX_0F42_L_1_M_1_W_1 */
3659 { "kandnq", { MaskG
, MaskVex
, MaskE
}, 0 },
3661 { "kandnd", { MaskG
, MaskVex
, MaskE
}, 0 },
3664 /* PREFIX_VEX_0F44_L_0_M_1_W_0 */
3666 { "knotw", { MaskG
, MaskE
}, 0 },
3668 { "knotb", { MaskG
, MaskE
}, 0 },
3671 /* PREFIX_VEX_0F44_L_0_M_1_W_1 */
3673 { "knotq", { MaskG
, MaskE
}, 0 },
3675 { "knotd", { MaskG
, MaskE
}, 0 },
3678 /* PREFIX_VEX_0F45_L_1_M_1_W_0 */
3680 { "korw", { MaskG
, MaskVex
, MaskE
}, 0 },
3682 { "korb", { MaskG
, MaskVex
, MaskE
}, 0 },
3685 /* PREFIX_VEX_0F45_L_1_M_1_W_1 */
3687 { "korq", { MaskG
, MaskVex
, MaskE
}, 0 },
3689 { "kord", { MaskG
, MaskVex
, MaskE
}, 0 },
3692 /* PREFIX_VEX_0F46_L_1_M_1_W_0 */
3694 { "kxnorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3696 { "kxnorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3699 /* PREFIX_VEX_0F46_L_1_M_1_W_1 */
3701 { "kxnorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3703 { "kxnord", { MaskG
, MaskVex
, MaskE
}, 0 },
3706 /* PREFIX_VEX_0F47_L_1_M_1_W_0 */
3708 { "kxorw", { MaskG
, MaskVex
, MaskE
}, 0 },
3710 { "kxorb", { MaskG
, MaskVex
, MaskE
}, 0 },
3713 /* PREFIX_VEX_0F47_L_1_M_1_W_1 */
3715 { "kxorq", { MaskG
, MaskVex
, MaskE
}, 0 },
3717 { "kxord", { MaskG
, MaskVex
, MaskE
}, 0 },
3720 /* PREFIX_VEX_0F4A_L_1_M_1_W_0 */
3722 { "kaddw", { MaskG
, MaskVex
, MaskE
}, 0 },
3724 { "kaddb", { MaskG
, MaskVex
, MaskE
}, 0 },
3727 /* PREFIX_VEX_0F4A_L_1_M_1_W_1 */
3729 { "kaddq", { MaskG
, MaskVex
, MaskE
}, 0 },
3731 { "kaddd", { MaskG
, MaskVex
, MaskE
}, 0 },
3734 /* PREFIX_VEX_0F4B_L_1_M_1_W_0 */
3736 { "kunpckwd", { MaskG
, MaskVex
, MaskE
}, 0 },
3738 { "kunpckbw", { MaskG
, MaskVex
, MaskE
}, 0 },
3741 /* PREFIX_VEX_0F4B_L_1_M_1_W_1 */
3743 { "kunpckdq", { MaskG
, MaskVex
, MaskE
}, 0 },
3746 /* PREFIX_VEX_0F51 */
3748 { "%XEvsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3749 { "%XEvsqrts%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3750 { "%XEvsqrtpX", { XM
, EXx
, EXxEVexR
}, 0 },
3751 { "%XEvsqrts%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3754 /* PREFIX_VEX_0F52 */
3756 { "vrsqrtps", { XM
, EXx
}, 0 },
3757 { "vrsqrtss", { XMScalar
, VexScalar
, EXd
}, 0 },
3760 /* PREFIX_VEX_0F53 */
3762 { "vrcpps", { XM
, EXx
}, 0 },
3763 { "vrcpss", { XMScalar
, VexScalar
, EXd
}, 0 },
3766 /* PREFIX_VEX_0F58 */
3768 { "%XEvaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3769 { "%XEvadds%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3770 { "%XEvaddpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3771 { "%XEvadds%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3774 /* PREFIX_VEX_0F59 */
3776 { "%XEvmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3777 { "%XEvmuls%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3778 { "%XEvmulpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3779 { "%XEvmuls%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3782 /* PREFIX_VEX_0F5A */
3784 { "%XEvcvtp%XS2pd", { XM
, EXEvexHalfBcstXmmq
, EXxEVexS
}, 0 },
3785 { "%XEvcvts%XS2sd", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3786 { "%XEvcvtp%XD2ps%XY", { XMxmmq
, EXx
, EXxEVexR
}, 0 },
3787 { "%XEvcvts%XD2ss", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3790 /* PREFIX_VEX_0F5B */
3792 { "vcvtdq2ps", { XM
, EXx
}, 0 },
3793 { "vcvttps2dq", { XM
, EXx
}, 0 },
3794 { "vcvtps2dq", { XM
, EXx
}, 0 },
3797 /* PREFIX_VEX_0F5C */
3799 { "%XEvsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3800 { "%XEvsubs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3801 { "%XEvsubpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3802 { "%XEvsubs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3805 /* PREFIX_VEX_0F5D */
3807 { "%XEvminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3808 { "%XEvmins%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3809 { "%XEvminpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3810 { "%XEvmins%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3813 /* PREFIX_VEX_0F5E */
3815 { "%XEvdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3816 { "%XEvdivs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexR
}, 0 },
3817 { "%XEvdivpX", { XM
, Vex
, EXx
, EXxEVexR
}, 0 },
3818 { "%XEvdivs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexR
}, 0 },
3821 /* PREFIX_VEX_0F5F */
3823 { "%XEvmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3824 { "%XEvmaxs%XS", { XMScalar
, VexScalar
, EXd
, EXxEVexS
}, 0 },
3825 { "%XEvmaxpX", { XM
, Vex
, EXx
, EXxEVexS
}, 0 },
3826 { "%XEvmaxs%XD", { XMScalar
, VexScalar
, EXq
, EXxEVexS
}, 0 },
3829 /* PREFIX_VEX_0F6F */
3832 { "vmovdqu", { XM
, EXx
}, 0 },
3833 { "vmovdqa", { XM
, EXx
}, 0 },
3836 /* PREFIX_VEX_0F70 */
3839 { "vpshufhw", { XM
, EXx
, Ib
}, 0 },
3840 { "vpshufd", { XM
, EXx
, Ib
}, 0 },
3841 { "vpshuflw", { XM
, EXx
, Ib
}, 0 },
3844 /* PREFIX_VEX_0F7C */
3848 { "vhaddpd", { XM
, Vex
, EXx
}, 0 },
3849 { "vhaddps", { XM
, Vex
, EXx
}, 0 },
3852 /* PREFIX_VEX_0F7D */
3856 { "vhsubpd", { XM
, Vex
, EXx
}, 0 },
3857 { "vhsubps", { XM
, Vex
, EXx
}, 0 },
3860 /* PREFIX_VEX_0F7E */
3863 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1
) },
3864 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2
) },
3867 /* PREFIX_VEX_0F7F */
3870 { "vmovdqu", { EXxS
, XM
}, 0 },
3871 { "vmovdqa", { EXxS
, XM
}, 0 },
3874 /* PREFIX_VEX_0F90_L_0_W_0 */
3876 { "kmovw", { MaskG
, MaskE
}, 0 },
3878 { "kmovb", { MaskG
, MaskBDE
}, 0 },
3881 /* PREFIX_VEX_0F90_L_0_W_1 */
3883 { "kmovq", { MaskG
, MaskE
}, 0 },
3885 { "kmovd", { MaskG
, MaskBDE
}, 0 },
3888 /* PREFIX_VEX_0F91_L_0_M_0_W_0 */
3890 { "kmovw", { Ew
, MaskG
}, 0 },
3892 { "kmovb", { Eb
, MaskG
}, 0 },
3895 /* PREFIX_VEX_0F91_L_0_M_0_W_1 */
3897 { "kmovq", { Eq
, MaskG
}, 0 },
3899 { "kmovd", { Ed
, MaskG
}, 0 },
3902 /* PREFIX_VEX_0F92_L_0_M_1_W_0 */
3904 { "kmovw", { MaskG
, Edq
}, 0 },
3906 { "kmovb", { MaskG
, Edq
}, 0 },
3907 { "kmovd", { MaskG
, Edq
}, 0 },
3910 /* PREFIX_VEX_0F92_L_0_M_1_W_1 */
3915 { "kmovK", { MaskG
, Edq
}, 0 },
3918 /* PREFIX_VEX_0F93_L_0_M_1_W_0 */
3920 { "kmovw", { Gdq
, MaskE
}, 0 },
3922 { "kmovb", { Gdq
, MaskE
}, 0 },
3923 { "kmovd", { Gdq
, MaskE
}, 0 },
3926 /* PREFIX_VEX_0F93_L_0_M_1_W_1 */
3931 { "kmovK", { Gdq
, MaskE
}, 0 },
3934 /* PREFIX_VEX_0F98_L_0_M_1_W_0 */
3936 { "kortestw", { MaskG
, MaskE
}, 0 },
3938 { "kortestb", { MaskG
, MaskE
}, 0 },
3941 /* PREFIX_VEX_0F98_L_0_M_1_W_1 */
3943 { "kortestq", { MaskG
, MaskE
}, 0 },
3945 { "kortestd", { MaskG
, MaskE
}, 0 },
3948 /* PREFIX_VEX_0F99_L_0_M_1_W_0 */
3950 { "ktestw", { MaskG
, MaskE
}, 0 },
3952 { "ktestb", { MaskG
, MaskE
}, 0 },
3955 /* PREFIX_VEX_0F99_L_0_M_1_W_1 */
3957 { "ktestq", { MaskG
, MaskE
}, 0 },
3959 { "ktestd", { MaskG
, MaskE
}, 0 },
3962 /* PREFIX_VEX_0FC2 */
3964 { "vcmpps", { XM
, Vex
, EXx
, CMP
}, 0 },
3965 { "vcmpss", { XMScalar
, VexScalar
, EXd
, CMP
}, 0 },
3966 { "vcmppd", { XM
, Vex
, EXx
, CMP
}, 0 },
3967 { "vcmpsd", { XMScalar
, VexScalar
, EXq
, CMP
}, 0 },
3970 /* PREFIX_VEX_0FD0 */
3974 { "vaddsubpd", { XM
, Vex
, EXx
}, 0 },
3975 { "vaddsubps", { XM
, Vex
, EXx
}, 0 },
3978 /* PREFIX_VEX_0FE6 */
3981 { "vcvtdq2pd", { XM
, EXxmmq
}, 0 },
3982 { "vcvttpd2dq%XY", { XMM
, EXx
}, 0 },
3983 { "vcvtpd2dq%XY", { XMM
, EXx
}, 0 },
3986 /* PREFIX_VEX_0FF0 */
3991 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3
) },
3994 /* PREFIX_VEX_0F3849_X86_64 */
3996 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_0
) },
3998 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_2
) },
3999 { VEX_W_TABLE (VEX_W_0F3849_X86_64_P_3
) },
4002 /* PREFIX_VEX_0F384B_X86_64 */
4005 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_1
) },
4006 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_2
) },
4007 { VEX_W_TABLE (VEX_W_0F384B_X86_64_P_3
) },
4010 /* PREFIX_VEX_0F385C_X86_64 */
4013 { VEX_W_TABLE (VEX_W_0F385C_X86_64_P_1
) },
4015 { VEX_W_TABLE (VEX_W_0F385C_X86_64_P_3
) },
4018 /* PREFIX_VEX_0F385E_X86_64 */
4020 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_0
) },
4021 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_1
) },
4022 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_2
) },
4023 { VEX_W_TABLE (VEX_W_0F385E_X86_64_P_3
) },
4026 /* PREFIX_VEX_0F38F5_L_0 */
4028 { "bzhiS", { Gdq
, Edq
, VexGdq
}, 0 },
4029 { "pextS", { Gdq
, VexGdq
, Edq
}, 0 },
4031 { "pdepS", { Gdq
, VexGdq
, Edq
}, 0 },
4034 /* PREFIX_VEX_0F38F6_L_0 */
4039 { "mulxS", { Gdq
, VexGdq
, Edq
}, 0 },
4042 /* PREFIX_VEX_0F38F7_L_0 */
4044 { "bextrS", { Gdq
, Edq
, VexGdq
}, 0 },
4045 { "sarxS", { Gdq
, Edq
, VexGdq
}, 0 },
4046 { "shlxS", { Gdq
, Edq
, VexGdq
}, 0 },
4047 { "shrxS", { Gdq
, Edq
, VexGdq
}, 0 },
4050 /* PREFIX_VEX_0F3AF0_L_0 */
4055 { "rorxS", { Gdq
, Edq
, Ib
}, 0 },
4058 #include "i386-dis-evex-prefix.h"
4061 static const struct dis386 x86_64_table
[][2] = {
4064 { "pushP", { es
}, 0 },
4069 { "popP", { es
}, 0 },
4074 { "pushP", { cs
}, 0 },
4079 { "pushP", { ss
}, 0 },
4084 { "popP", { ss
}, 0 },
4089 { "pushP", { ds
}, 0 },
4094 { "popP", { ds
}, 0 },
4099 { "daa", { XX
}, 0 },
4104 { "das", { XX
}, 0 },
4109 { "aaa", { XX
}, 0 },
4114 { "aas", { XX
}, 0 },
4119 { "pushaP", { XX
}, 0 },
4124 { "popaP", { XX
}, 0 },
4129 { MOD_TABLE (MOD_62_32BIT
) },
4130 { EVEX_TABLE (EVEX_0F
) },
4135 { "arpl", { Ew
, Gw
}, 0 },
4136 { "movs", { Gv
, { MOVSXD_Fixup
, movsxd_mode
} }, 0 },
4141 { "ins{R|}", { Yzr
, indirDX
}, 0 },
4142 { "ins{G|}", { Yzr
, indirDX
}, 0 },
4147 { "outs{R|}", { indirDXr
, Xz
}, 0 },
4148 { "outs{G|}", { indirDXr
, Xz
}, 0 },
4153 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
4154 { REG_TABLE (REG_80
) },
4159 { "{l|}call{P|}", { Ap
}, 0 },
4164 { "retP", { Iw
, BND
}, 0 },
4165 { "ret@", { Iw
, BND
}, 0 },
4170 { "retP", { BND
}, 0 },
4171 { "ret@", { BND
}, 0 },
4176 { MOD_TABLE (MOD_C4_32BIT
) },
4177 { VEX_C4_TABLE (VEX_0F
) },
4182 { MOD_TABLE (MOD_C5_32BIT
) },
4183 { VEX_C5_TABLE (VEX_0F
) },
4188 { "into", { XX
}, 0 },
4193 { "aam", { Ib
}, 0 },
4198 { "aad", { Ib
}, 0 },
4203 { "callP", { Jv
, BND
}, 0 },
4204 { "call@", { Jv
, BND
}, 0 }
4209 { "jmpP", { Jv
, BND
}, 0 },
4210 { "jmp@", { Jv
, BND
}, 0 }
4215 { "{l|}jmp{P|}", { Ap
}, 0 },
4218 /* X86_64_0F01_REG_0 */
4220 { "sgdt{Q|Q}", { M
}, 0 },
4221 { "sgdt", { M
}, 0 },
4224 /* X86_64_0F01_REG_1 */
4226 { "sidt{Q|Q}", { M
}, 0 },
4227 { "sidt", { M
}, 0 },
4230 /* X86_64_0F01_REG_1_RM_5_PREFIX_2 */
4233 { "seamret", { Skip_MODRM
}, 0 },
4236 /* X86_64_0F01_REG_1_RM_6_PREFIX_2 */
4239 { "seamops", { Skip_MODRM
}, 0 },
4242 /* X86_64_0F01_REG_1_RM_7_PREFIX_2 */
4245 { "seamcall", { Skip_MODRM
}, 0 },
4248 /* X86_64_0F01_REG_2 */
4250 { "lgdt{Q|Q}", { M
}, 0 },
4251 { "lgdt", { M
}, 0 },
4254 /* X86_64_0F01_REG_3 */
4256 { "lidt{Q|Q}", { M
}, 0 },
4257 { "lidt", { M
}, 0 },
4260 /* X86_64_0F01_REG_5_MOD_3_RM_4_PREFIX_1 */
4263 { "uiret", { Skip_MODRM
}, 0 },
4266 /* X86_64_0F01_REG_5_MOD_3_RM_5_PREFIX_1 */
4269 { "testui", { Skip_MODRM
}, 0 },
4272 /* X86_64_0F01_REG_5_MOD_3_RM_6_PREFIX_1 */
4275 { "clui", { Skip_MODRM
}, 0 },
4278 /* X86_64_0F01_REG_5_MOD_3_RM_7_PREFIX_1 */
4281 { "stui", { Skip_MODRM
}, 0 },
4284 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_1 */
4287 { "rmpadjust", { Skip_MODRM
}, 0 },
4290 /* X86_64_0F01_REG_7_MOD_3_RM_6_PREFIX_3 */
4293 { "rmpupdate", { Skip_MODRM
}, 0 },
4296 /* X86_64_0F01_REG_7_MOD_3_RM_7_PREFIX_1 */
4299 { "psmash", { Skip_MODRM
}, 0 },
4304 { "movZ", { Em
, Td
}, 0 },
4309 { "movZ", { Td
, Em
}, 0 },
4312 /* X86_64_0FC7_REG_6_MOD_3_PREFIX_1 */
4315 { "senduipi", { Eq
}, 0 },
4318 /* X86_64_VEX_0F3849 */
4321 { PREFIX_TABLE (PREFIX_VEX_0F3849_X86_64
) },
4324 /* X86_64_VEX_0F384B */
4327 { PREFIX_TABLE (PREFIX_VEX_0F384B_X86_64
) },
4330 /* X86_64_VEX_0F385C */
4333 { PREFIX_TABLE (PREFIX_VEX_0F385C_X86_64
) },
4336 /* X86_64_VEX_0F385E */
4339 { PREFIX_TABLE (PREFIX_VEX_0F385E_X86_64
) },
4343 static const struct dis386 three_byte_table
[][256] = {
4345 /* THREE_BYTE_0F38 */
4348 { "pshufb", { MX
, EM
}, PREFIX_OPCODE
},
4349 { "phaddw", { MX
, EM
}, PREFIX_OPCODE
},
4350 { "phaddd", { MX
, EM
}, PREFIX_OPCODE
},
4351 { "phaddsw", { MX
, EM
}, PREFIX_OPCODE
},
4352 { "pmaddubsw", { MX
, EM
}, PREFIX_OPCODE
},
4353 { "phsubw", { MX
, EM
}, PREFIX_OPCODE
},
4354 { "phsubd", { MX
, EM
}, PREFIX_OPCODE
},
4355 { "phsubsw", { MX
, EM
}, PREFIX_OPCODE
},
4357 { "psignb", { MX
, EM
}, PREFIX_OPCODE
},
4358 { "psignw", { MX
, EM
}, PREFIX_OPCODE
},
4359 { "psignd", { MX
, EM
}, PREFIX_OPCODE
},
4360 { "pmulhrsw", { MX
, EM
}, PREFIX_OPCODE
},
4366 { "pblendvb", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4370 { "blendvps", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4371 { "blendvpd", { XM
, EXx
, XMM0
}, PREFIX_DATA
},
4373 { "ptest", { XM
, EXx
}, PREFIX_DATA
},
4379 { "pabsb", { MX
, EM
}, PREFIX_OPCODE
},
4380 { "pabsw", { MX
, EM
}, PREFIX_OPCODE
},
4381 { "pabsd", { MX
, EM
}, PREFIX_OPCODE
},
4384 { "pmovsxbw", { XM
, EXq
}, PREFIX_DATA
},
4385 { "pmovsxbd", { XM
, EXd
}, PREFIX_DATA
},
4386 { "pmovsxbq", { XM
, EXw
}, PREFIX_DATA
},
4387 { "pmovsxwd", { XM
, EXq
}, PREFIX_DATA
},
4388 { "pmovsxwq", { XM
, EXd
}, PREFIX_DATA
},
4389 { "pmovsxdq", { XM
, EXq
}, PREFIX_DATA
},
4393 { "pmuldq", { XM
, EXx
}, PREFIX_DATA
},
4394 { "pcmpeqq", { XM
, EXx
}, PREFIX_DATA
},
4395 { MOD_TABLE (MOD_0F382A
) },
4396 { "packusdw", { XM
, EXx
}, PREFIX_DATA
},
4402 { "pmovzxbw", { XM
, EXq
}, PREFIX_DATA
},
4403 { "pmovzxbd", { XM
, EXd
}, PREFIX_DATA
},
4404 { "pmovzxbq", { XM
, EXw
}, PREFIX_DATA
},
4405 { "pmovzxwd", { XM
, EXq
}, PREFIX_DATA
},
4406 { "pmovzxwq", { XM
, EXd
}, PREFIX_DATA
},
4407 { "pmovzxdq", { XM
, EXq
}, PREFIX_DATA
},
4409 { "pcmpgtq", { XM
, EXx
}, PREFIX_DATA
},
4411 { "pminsb", { XM
, EXx
}, PREFIX_DATA
},
4412 { "pminsd", { XM
, EXx
}, PREFIX_DATA
},
4413 { "pminuw", { XM
, EXx
}, PREFIX_DATA
},
4414 { "pminud", { XM
, EXx
}, PREFIX_DATA
},
4415 { "pmaxsb", { XM
, EXx
}, PREFIX_DATA
},
4416 { "pmaxsd", { XM
, EXx
}, PREFIX_DATA
},
4417 { "pmaxuw", { XM
, EXx
}, PREFIX_DATA
},
4418 { "pmaxud", { XM
, EXx
}, PREFIX_DATA
},
4420 { "pmulld", { XM
, EXx
}, PREFIX_DATA
},
4421 { "phminposuw", { XM
, EXx
}, PREFIX_DATA
},
4492 { "invept", { Gm
, Mo
}, PREFIX_DATA
},
4493 { "invvpid", { Gm
, Mo
}, PREFIX_DATA
},
4494 { "invpcid", { Gm
, M
}, PREFIX_DATA
},
4573 { "sha1nexte", { XM
, EXxmm
}, PREFIX_OPCODE
},
4574 { "sha1msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4575 { "sha1msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4576 { "sha256rnds2", { XM
, EXxmm
, XMM0
}, PREFIX_OPCODE
},
4577 { "sha256msg1", { XM
, EXxmm
}, PREFIX_OPCODE
},
4578 { "sha256msg2", { XM
, EXxmm
}, PREFIX_OPCODE
},
4580 { "gf2p8mulb", { XM
, EXxmm
}, PREFIX_DATA
},
4591 { PREFIX_TABLE (PREFIX_0F38D8
) },
4594 { "aesimc", { XM
, EXx
}, PREFIX_DATA
},
4595 { PREFIX_TABLE (PREFIX_0F38DC
) },
4596 { PREFIX_TABLE (PREFIX_0F38DD
) },
4597 { PREFIX_TABLE (PREFIX_0F38DE
) },
4598 { PREFIX_TABLE (PREFIX_0F38DF
) },
4618 { PREFIX_TABLE (PREFIX_0F38F0
) },
4619 { PREFIX_TABLE (PREFIX_0F38F1
) },
4623 { MOD_TABLE (MOD_0F38F5
) },
4624 { PREFIX_TABLE (PREFIX_0F38F6
) },
4627 { PREFIX_TABLE (PREFIX_0F38F8
) },
4628 { MOD_TABLE (MOD_0F38F9
) },
4629 { PREFIX_TABLE (PREFIX_0F38FA
) },
4630 { PREFIX_TABLE (PREFIX_0F38FB
) },
4636 /* THREE_BYTE_0F3A */
4648 { "roundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4649 { "roundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4650 { "roundss", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4651 { "roundsd", { XM
, EXq
, Ib
}, PREFIX_DATA
},
4652 { "blendps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4653 { "blendpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4654 { "pblendw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4655 { "palignr", { MX
, EM
, Ib
}, PREFIX_OPCODE
},
4661 { "pextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
4662 { "pextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
4663 { "pextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
4664 { "extractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
4675 { "pinsrb", { XM
, Edb
, Ib
}, PREFIX_DATA
},
4676 { "insertps", { XM
, EXd
, Ib
}, PREFIX_DATA
},
4677 { "pinsrK", { XM
, Edq
, Ib
}, PREFIX_DATA
},
4711 { "dpps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4712 { "dppd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4713 { "mpsadbw", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4715 { "pclmulqdq", { XM
, EXx
, PCLMUL
}, PREFIX_DATA
},
4747 { "pcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4748 { "pcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4749 { "pcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4750 { "pcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4868 { "sha1rnds4", { XM
, EXxmm
, Ib
}, PREFIX_OPCODE
},
4870 { "gf2p8affineqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
4871 { "gf2p8affineinvqb", { XM
, EXxmm
, Ib
}, PREFIX_DATA
},
4889 { "aeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
4909 { PREFIX_TABLE (PREFIX_0F3A0F
) },
4929 static const struct dis386 xop_table
[][256] = {
5082 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_85
) },
5083 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_86
) },
5084 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_87
) },
5092 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8E
) },
5093 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_8F
) },
5100 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_95
) },
5101 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_96
) },
5102 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_97
) },
5110 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9E
) },
5111 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_9F
) },
5115 { "vpcmov", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
5116 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A3
) },
5119 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_A6
) },
5137 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_B6
) },
5149 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C0
) },
5150 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C1
) },
5151 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C2
) },
5152 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_C3
) },
5162 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC
) },
5163 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD
) },
5164 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE
) },
5165 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF
) },
5198 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC
) },
5199 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED
) },
5200 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE
) },
5201 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF
) },
5225 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_01
) },
5226 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_02
) },
5244 { MOD_TABLE (MOD_XOP_09_12
) },
5368 { VEX_W_TABLE (VEX_W_0FXOP_09_80
) },
5369 { VEX_W_TABLE (VEX_W_0FXOP_09_81
) },
5370 { VEX_W_TABLE (VEX_W_0FXOP_09_82
) },
5371 { VEX_W_TABLE (VEX_W_0FXOP_09_83
) },
5386 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_90
) },
5387 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_91
) },
5388 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_92
) },
5389 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_93
) },
5390 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_94
) },
5391 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_95
) },
5392 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_96
) },
5393 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_97
) },
5395 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_98
) },
5396 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_99
) },
5397 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9A
) },
5398 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_9B
) },
5441 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C1
) },
5442 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C2
) },
5443 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C3
) },
5446 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C6
) },
5447 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_C7
) },
5452 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_CB
) },
5459 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D1
) },
5460 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D2
) },
5461 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D3
) },
5464 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D6
) },
5465 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_D7
) },
5470 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_DB
) },
5477 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E1
) },
5478 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E2
) },
5479 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_E3
) },
5533 { "bextrS", { Gdq
, Edq
, Id
}, 0 },
5535 { VEX_LEN_TABLE (VEX_LEN_0FXOP_0A_12
) },
5805 static const struct dis386 vex_table
[][256] = {
5827 { PREFIX_TABLE (PREFIX_VEX_0F10
) },
5828 { PREFIX_TABLE (PREFIX_VEX_0F11
) },
5829 { PREFIX_TABLE (PREFIX_VEX_0F12
) },
5830 { MOD_TABLE (MOD_VEX_0F13
) },
5831 { "vunpcklpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
5832 { "vunpckhpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
5833 { PREFIX_TABLE (PREFIX_VEX_0F16
) },
5834 { MOD_TABLE (MOD_VEX_0F17
) },
5854 { "vmovapX", { XM
, EXx
}, PREFIX_OPCODE
},
5855 { "vmovapX", { EXxS
, XM
}, PREFIX_OPCODE
},
5856 { PREFIX_TABLE (PREFIX_VEX_0F2A
) },
5857 { MOD_TABLE (MOD_VEX_0F2B
) },
5858 { PREFIX_TABLE (PREFIX_VEX_0F2C
) },
5859 { PREFIX_TABLE (PREFIX_VEX_0F2D
) },
5860 { PREFIX_TABLE (PREFIX_VEX_0F2E
) },
5861 { PREFIX_TABLE (PREFIX_VEX_0F2F
) },
5882 { VEX_LEN_TABLE (VEX_LEN_0F41
) },
5883 { VEX_LEN_TABLE (VEX_LEN_0F42
) },
5885 { VEX_LEN_TABLE (VEX_LEN_0F44
) },
5886 { VEX_LEN_TABLE (VEX_LEN_0F45
) },
5887 { VEX_LEN_TABLE (VEX_LEN_0F46
) },
5888 { VEX_LEN_TABLE (VEX_LEN_0F47
) },
5892 { VEX_LEN_TABLE (VEX_LEN_0F4A
) },
5893 { VEX_LEN_TABLE (VEX_LEN_0F4B
) },
5899 { MOD_TABLE (MOD_VEX_0F50
) },
5900 { PREFIX_TABLE (PREFIX_VEX_0F51
) },
5901 { PREFIX_TABLE (PREFIX_VEX_0F52
) },
5902 { PREFIX_TABLE (PREFIX_VEX_0F53
) },
5903 { "vandpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
5904 { "vandnpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
5905 { "vorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
5906 { "vxorpX", { XM
, Vex
, EXx
}, PREFIX_OPCODE
},
5908 { PREFIX_TABLE (PREFIX_VEX_0F58
) },
5909 { PREFIX_TABLE (PREFIX_VEX_0F59
) },
5910 { PREFIX_TABLE (PREFIX_VEX_0F5A
) },
5911 { PREFIX_TABLE (PREFIX_VEX_0F5B
) },
5912 { PREFIX_TABLE (PREFIX_VEX_0F5C
) },
5913 { PREFIX_TABLE (PREFIX_VEX_0F5D
) },
5914 { PREFIX_TABLE (PREFIX_VEX_0F5E
) },
5915 { PREFIX_TABLE (PREFIX_VEX_0F5F
) },
5917 { "vpunpcklbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5918 { "vpunpcklwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5919 { "vpunpckldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5920 { "vpacksswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5921 { "vpcmpgtb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5922 { "vpcmpgtw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5923 { "vpcmpgtd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5924 { "vpackuswb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5926 { "vpunpckhbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5927 { "vpunpckhwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5928 { "vpunpckhdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5929 { "vpackssdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5930 { "vpunpcklqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5931 { "vpunpckhqdq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5932 { VEX_LEN_TABLE (VEX_LEN_0F6E
) },
5933 { PREFIX_TABLE (PREFIX_VEX_0F6F
) },
5935 { PREFIX_TABLE (PREFIX_VEX_0F70
) },
5936 { MOD_TABLE (MOD_VEX_0F71
) },
5937 { MOD_TABLE (MOD_VEX_0F72
) },
5938 { MOD_TABLE (MOD_VEX_0F73
) },
5939 { "vpcmpeqb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5940 { "vpcmpeqw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5941 { "vpcmpeqd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
5942 { VEX_LEN_TABLE (VEX_LEN_0F77
) },
5948 { PREFIX_TABLE (PREFIX_VEX_0F7C
) },
5949 { PREFIX_TABLE (PREFIX_VEX_0F7D
) },
5950 { PREFIX_TABLE (PREFIX_VEX_0F7E
) },
5951 { PREFIX_TABLE (PREFIX_VEX_0F7F
) },
5971 { VEX_LEN_TABLE (VEX_LEN_0F90
) },
5972 { VEX_LEN_TABLE (VEX_LEN_0F91
) },
5973 { VEX_LEN_TABLE (VEX_LEN_0F92
) },
5974 { VEX_LEN_TABLE (VEX_LEN_0F93
) },
5980 { VEX_LEN_TABLE (VEX_LEN_0F98
) },
5981 { VEX_LEN_TABLE (VEX_LEN_0F99
) },
6004 { REG_TABLE (REG_VEX_0FAE
) },
6027 { PREFIX_TABLE (PREFIX_VEX_0FC2
) },
6029 { VEX_LEN_TABLE (VEX_LEN_0FC4
) },
6030 { VEX_LEN_TABLE (VEX_LEN_0FC5
) },
6031 { "vshufpX", { XM
, Vex
, EXx
, Ib
}, PREFIX_OPCODE
},
6043 { PREFIX_TABLE (PREFIX_VEX_0FD0
) },
6044 { "vpsrlw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6045 { "vpsrld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6046 { "vpsrlq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6047 { "vpaddq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6048 { "vpmullw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6049 { VEX_LEN_TABLE (VEX_LEN_0FD6
) },
6050 { MOD_TABLE (MOD_VEX_0FD7
) },
6052 { "vpsubusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6053 { "vpsubusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6054 { "vpminub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6055 { "vpand", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6056 { "vpaddusb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6057 { "vpaddusw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6058 { "vpmaxub", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6059 { "vpandn", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6061 { "vpavgb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6062 { "vpsraw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6063 { "vpsrad", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6064 { "vpavgw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6065 { "vpmulhuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6066 { "vpmulhw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6067 { PREFIX_TABLE (PREFIX_VEX_0FE6
) },
6068 { MOD_TABLE (MOD_VEX_0FE7
) },
6070 { "vpsubsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6071 { "vpsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6072 { "vpminsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6073 { "vpor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6074 { "vpaddsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6075 { "vpaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6076 { "vpmaxsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6077 { "vpxor", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6079 { PREFIX_TABLE (PREFIX_VEX_0FF0
) },
6080 { "vpsllw", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6081 { "vpslld", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6082 { "vpsllq", { XM
, Vex
, EXxmm
}, PREFIX_DATA
},
6083 { "vpmuludq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6084 { "vpmaddwd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6085 { "vpsadbw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6086 { VEX_LEN_TABLE (VEX_LEN_0FF7
) },
6088 { "vpsubb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6089 { "vpsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6090 { "vpsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6091 { "vpsubq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6092 { "vpaddb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6093 { "vpaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6094 { "vpaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6100 { "vpshufb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6101 { "vphaddw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6102 { "vphaddd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6103 { "vphaddsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6104 { "vpmaddubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6105 { "vphsubw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6106 { "vphsubd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6107 { "vphsubsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6109 { "vpsignb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6110 { "vpsignw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6111 { "vpsignd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6112 { "vpmulhrsw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6113 { VEX_W_TABLE (VEX_W_0F380C
) },
6114 { VEX_W_TABLE (VEX_W_0F380D
) },
6115 { VEX_W_TABLE (VEX_W_0F380E
) },
6116 { VEX_W_TABLE (VEX_W_0F380F
) },
6121 { VEX_W_TABLE (VEX_W_0F3813
) },
6124 { VEX_LEN_TABLE (VEX_LEN_0F3816
) },
6125 { "vptest", { XM
, EXx
}, PREFIX_DATA
},
6127 { VEX_W_TABLE (VEX_W_0F3818
) },
6128 { VEX_LEN_TABLE (VEX_LEN_0F3819
) },
6129 { MOD_TABLE (MOD_VEX_0F381A
) },
6131 { "vpabsb", { XM
, EXx
}, PREFIX_DATA
},
6132 { "vpabsw", { XM
, EXx
}, PREFIX_DATA
},
6133 { "vpabsd", { XM
, EXx
}, PREFIX_DATA
},
6136 { "vpmovsxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6137 { "vpmovsxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6138 { "vpmovsxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6139 { "vpmovsxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6140 { "vpmovsxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6141 { "vpmovsxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6145 { "vpmuldq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6146 { "vpcmpeqq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6147 { MOD_TABLE (MOD_VEX_0F382A
) },
6148 { "vpackusdw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6149 { MOD_TABLE (MOD_VEX_0F382C
) },
6150 { MOD_TABLE (MOD_VEX_0F382D
) },
6151 { MOD_TABLE (MOD_VEX_0F382E
) },
6152 { MOD_TABLE (MOD_VEX_0F382F
) },
6154 { "vpmovzxbw", { XM
, EXxmmq
}, PREFIX_DATA
},
6155 { "vpmovzxbd", { XM
, EXxmmqd
}, PREFIX_DATA
},
6156 { "vpmovzxbq", { XM
, EXxmmdw
}, PREFIX_DATA
},
6157 { "vpmovzxwd", { XM
, EXxmmq
}, PREFIX_DATA
},
6158 { "vpmovzxwq", { XM
, EXxmmqd
}, PREFIX_DATA
},
6159 { "vpmovzxdq", { XM
, EXxmmq
}, PREFIX_DATA
},
6160 { VEX_LEN_TABLE (VEX_LEN_0F3836
) },
6161 { "vpcmpgtq", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6163 { "vpminsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6164 { "vpminsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6165 { "vpminuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6166 { "vpminud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6167 { "vpmaxsb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6168 { "vpmaxsd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6169 { "vpmaxuw", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6170 { "vpmaxud", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6172 { "vpmulld", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6173 { VEX_LEN_TABLE (VEX_LEN_0F3841
) },
6177 { "vpsrlv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6178 { VEX_W_TABLE (VEX_W_0F3846
) },
6179 { "vpsllv%DQ", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6182 { X86_64_TABLE (X86_64_VEX_0F3849
) },
6184 { X86_64_TABLE (X86_64_VEX_0F384B
) },
6190 { VEX_W_TABLE (VEX_W_0F3850
) },
6191 { VEX_W_TABLE (VEX_W_0F3851
) },
6192 { VEX_W_TABLE (VEX_W_0F3852
) },
6193 { VEX_W_TABLE (VEX_W_0F3853
) },
6199 { VEX_W_TABLE (VEX_W_0F3858
) },
6200 { VEX_W_TABLE (VEX_W_0F3859
) },
6201 { MOD_TABLE (MOD_VEX_0F385A
) },
6203 { X86_64_TABLE (X86_64_VEX_0F385C
) },
6205 { X86_64_TABLE (X86_64_VEX_0F385E
) },
6235 { VEX_W_TABLE (VEX_W_0F3878
) },
6236 { VEX_W_TABLE (VEX_W_0F3879
) },
6257 { MOD_TABLE (MOD_VEX_0F388C
) },
6259 { MOD_TABLE (MOD_VEX_0F388E
) },
6262 { "vpgatherd%DQ", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6263 { "vpgatherq%DQ", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6264 { "vgatherdp%XW", { XM
, MVexVSIBDWpX
, VexGatherD
}, PREFIX_DATA
},
6265 { "vgatherqp%XW", { XMGatherQ
, MVexVSIBQWpX
, VexGatherQ
}, PREFIX_DATA
},
6268 { "vfmaddsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6269 { "vfmsubadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6271 { "vfmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6272 { "vfmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6273 { "vfmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6274 { "vfmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6275 { "vfnmadd132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6276 { "vfnmadd132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6277 { "vfnmsub132p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6278 { "vfnmsub132s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6286 { "vfmaddsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6287 { "vfmsubadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6289 { "vfmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6290 { "vfmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6291 { "vfmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6292 { "vfmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6293 { "vfnmadd213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6294 { "vfnmadd213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6295 { "vfnmsub213p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6296 { "vfnmsub213s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6304 { "vfmaddsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6305 { "vfmsubadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6307 { "vfmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6308 { "vfmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6309 { "vfmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6310 { "vfmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6311 { "vfnmadd231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6312 { "vfnmadd231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6313 { "vfnmsub231p%XW", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6314 { "vfnmsub231s%XW", { XMScalar
, VexScalar
, EXdq
}, PREFIX_DATA
},
6332 { VEX_W_TABLE (VEX_W_0F38CF
) },
6346 { VEX_LEN_TABLE (VEX_LEN_0F38DB
) },
6347 { "vaesenc", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6348 { "vaesenclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6349 { "vaesdec", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6350 { "vaesdeclast", { XM
, Vex
, EXx
}, PREFIX_DATA
},
6372 { VEX_LEN_TABLE (VEX_LEN_0F38F2
) },
6373 { VEX_LEN_TABLE (VEX_LEN_0F38F3
) },
6375 { VEX_LEN_TABLE (VEX_LEN_0F38F5
) },
6376 { VEX_LEN_TABLE (VEX_LEN_0F38F6
) },
6377 { VEX_LEN_TABLE (VEX_LEN_0F38F7
) },
6391 { VEX_LEN_TABLE (VEX_LEN_0F3A00
) },
6392 { VEX_LEN_TABLE (VEX_LEN_0F3A01
) },
6393 { VEX_W_TABLE (VEX_W_0F3A02
) },
6395 { VEX_W_TABLE (VEX_W_0F3A04
) },
6396 { VEX_W_TABLE (VEX_W_0F3A05
) },
6397 { VEX_LEN_TABLE (VEX_LEN_0F3A06
) },
6400 { "vroundps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6401 { "vroundpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
6402 { "vroundss", { XMScalar
, VexScalar
, EXd
, Ib
}, PREFIX_DATA
},
6403 { "vroundsd", { XMScalar
, VexScalar
, EXq
, Ib
}, PREFIX_DATA
},
6404 { "vblendps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6405 { "vblendpd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6406 { "vpblendw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6407 { "vpalignr", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6413 { VEX_LEN_TABLE (VEX_LEN_0F3A14
) },
6414 { VEX_LEN_TABLE (VEX_LEN_0F3A15
) },
6415 { VEX_LEN_TABLE (VEX_LEN_0F3A16
) },
6416 { VEX_LEN_TABLE (VEX_LEN_0F3A17
) },
6418 { VEX_LEN_TABLE (VEX_LEN_0F3A18
) },
6419 { VEX_LEN_TABLE (VEX_LEN_0F3A19
) },
6423 { VEX_W_TABLE (VEX_W_0F3A1D
) },
6427 { VEX_LEN_TABLE (VEX_LEN_0F3A20
) },
6428 { VEX_LEN_TABLE (VEX_LEN_0F3A21
) },
6429 { VEX_LEN_TABLE (VEX_LEN_0F3A22
) },
6445 { VEX_LEN_TABLE (VEX_LEN_0F3A30
) },
6446 { VEX_LEN_TABLE (VEX_LEN_0F3A31
) },
6447 { VEX_LEN_TABLE (VEX_LEN_0F3A32
) },
6448 { VEX_LEN_TABLE (VEX_LEN_0F3A33
) },
6454 { VEX_LEN_TABLE (VEX_LEN_0F3A38
) },
6455 { VEX_LEN_TABLE (VEX_LEN_0F3A39
) },
6463 { "vdpps", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6464 { VEX_LEN_TABLE (VEX_LEN_0F3A41
) },
6465 { "vmpsadbw", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
6467 { "vpclmulqdq", { XM
, Vex
, EXx
, PCLMUL
}, PREFIX_DATA
},
6469 { VEX_LEN_TABLE (VEX_LEN_0F3A46
) },
6472 { "vpermil2ps", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6473 { "vpermil2pd", { XM
, Vex
, EXx
, XMVexI4
, VexI4
}, PREFIX_DATA
},
6474 { VEX_W_TABLE (VEX_W_0F3A4A
) },
6475 { VEX_W_TABLE (VEX_W_0F3A4B
) },
6476 { VEX_W_TABLE (VEX_W_0F3A4C
) },
6494 { "vfmaddsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6495 { "vfmaddsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6496 { "vfmsubaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6497 { "vfmsubaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6499 { VEX_LEN_TABLE (VEX_LEN_0F3A60
) },
6500 { VEX_LEN_TABLE (VEX_LEN_0F3A61
) },
6501 { VEX_LEN_TABLE (VEX_LEN_0F3A62
) },
6502 { VEX_LEN_TABLE (VEX_LEN_0F3A63
) },
6508 { "vfmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6509 { "vfmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6510 { "vfmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6511 { "vfmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6512 { "vfmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6513 { "vfmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6514 { "vfmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6515 { "vfmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6526 { "vfnmaddps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6527 { "vfnmaddpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6528 { "vfnmaddss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6529 { "vfnmaddsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6530 { "vfnmsubps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6531 { "vfnmsubpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
6532 { "vfnmsubss", { XMScalar
, VexScalar
, EXd
, XMVexScalarI4
}, PREFIX_DATA
},
6533 { "vfnmsubsd", { XMScalar
, VexScalar
, EXq
, XMVexScalarI4
}, PREFIX_DATA
},
6622 { VEX_W_TABLE (VEX_W_0F3ACE
) },
6623 { VEX_W_TABLE (VEX_W_0F3ACF
) },
6641 { VEX_LEN_TABLE (VEX_LEN_0F3ADF
) },
6661 { VEX_LEN_TABLE (VEX_LEN_0F3AF0
) },
6681 #include "i386-dis-evex.h"
6683 static const struct dis386 vex_len_table
[][2] = {
6684 /* VEX_LEN_0F12_P_0_M_0 / VEX_LEN_0F12_P_2_M_0 */
6686 { "%XEvmovlpX", { XM
, Vex
, EXq
}, 0 },
6689 /* VEX_LEN_0F12_P_0_M_1 */
6691 { "%XEvmovhlp%XS", { XM
, Vex
, EXq
}, 0 },
6694 /* VEX_LEN_0F13_M_0 */
6696 { "%XEvmovlpX", { EXq
, XM
}, PREFIX_OPCODE
},
6699 /* VEX_LEN_0F16_P_0_M_0 / VEX_LEN_0F16_P_2_M_0 */
6701 { "%XEvmovhpX", { XM
, Vex
, EXq
}, 0 },
6704 /* VEX_LEN_0F16_P_0_M_1 */
6706 { "%XEvmovlhp%XS", { XM
, Vex
, EXq
}, 0 },
6709 /* VEX_LEN_0F17_M_0 */
6711 { "%XEvmovhpX", { EXq
, XM
}, PREFIX_OPCODE
},
6717 { MOD_TABLE (MOD_VEX_0F41_L_1
) },
6723 { MOD_TABLE (MOD_VEX_0F42_L_1
) },
6728 { MOD_TABLE (MOD_VEX_0F44_L_0
) },
6734 { MOD_TABLE (MOD_VEX_0F45_L_1
) },
6740 { MOD_TABLE (MOD_VEX_0F46_L_1
) },
6746 { MOD_TABLE (MOD_VEX_0F47_L_1
) },
6752 { MOD_TABLE (MOD_VEX_0F4A_L_1
) },
6758 { MOD_TABLE (MOD_VEX_0F4B_L_1
) },
6763 { "%XEvmovK", { XMScalar
, Edq
}, PREFIX_DATA
},
6768 { "vzeroupper", { XX
}, 0 },
6769 { "vzeroall", { XX
}, 0 },
6772 /* VEX_LEN_0F7E_P_1 */
6774 { "%XEvmovq", { XMScalar
, EXq
}, 0 },
6777 /* VEX_LEN_0F7E_P_2 */
6779 { "%XEvmovK", { Edq
, XMScalar
}, 0 },
6784 { VEX_W_TABLE (VEX_W_0F90_L_0
) },
6789 { MOD_TABLE (MOD_VEX_0F91_L_0
) },
6794 { MOD_TABLE (MOD_VEX_0F92_L_0
) },
6799 { MOD_TABLE (MOD_VEX_0F93_L_0
) },
6804 { MOD_TABLE (MOD_VEX_0F98_L_0
) },
6809 { MOD_TABLE (MOD_VEX_0F99_L_0
) },
6812 /* VEX_LEN_0FAE_R_2_M_0 */
6814 { "vldmxcsr", { Md
}, 0 },
6817 /* VEX_LEN_0FAE_R_3_M_0 */
6819 { "vstmxcsr", { Md
}, 0 },
6824 { "%XEvpinsrw", { XM
, Vex
, Edw
, Ib
}, PREFIX_DATA
},
6829 { "%XEvpextrw", { Gd
, XS
, Ib
}, PREFIX_DATA
},
6834 { "%XEvmovq", { EXqS
, XMScalar
}, PREFIX_DATA
},
6839 { "vmaskmovdqu", { XM
, XS
}, PREFIX_DATA
},
6842 /* VEX_LEN_0F3816 */
6845 { VEX_W_TABLE (VEX_W_0F3816_L_1
) },
6848 /* VEX_LEN_0F3819 */
6851 { VEX_W_TABLE (VEX_W_0F3819_L_1
) },
6854 /* VEX_LEN_0F381A_M_0 */
6857 { VEX_W_TABLE (VEX_W_0F381A_M_0_L_1
) },
6860 /* VEX_LEN_0F3836 */
6863 { VEX_W_TABLE (VEX_W_0F3836
) },
6866 /* VEX_LEN_0F3841 */
6868 { "vphminposuw", { XM
, EXx
}, PREFIX_DATA
},
6871 /* VEX_LEN_0F3849_X86_64_P_0_W_0_M_0 */
6873 { "ldtilecfg", { M
}, 0 },
6876 /* VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0 */
6878 { "tilerelease", { Skip_MODRM
}, 0 },
6881 /* VEX_LEN_0F3849_X86_64_P_2_W_0_M_0 */
6883 { "sttilecfg", { M
}, 0 },
6886 /* VEX_LEN_0F3849_X86_64_P_3_W_0_M_0 */
6888 { "tilezero", { TMM
, Skip_MODRM
}, 0 },
6891 /* VEX_LEN_0F384B_X86_64_P_1_W_0_M_0 */
6893 { "tilestored", { MVexSIBMEM
, TMM
}, 0 },
6895 /* VEX_LEN_0F384B_X86_64_P_2_W_0_M_0 */
6897 { "tileloaddt1", { TMM
, MVexSIBMEM
}, 0 },
6900 /* VEX_LEN_0F384B_X86_64_P_3_W_0_M_0 */
6902 { "tileloadd", { TMM
, MVexSIBMEM
}, 0 },
6905 /* VEX_LEN_0F385A_M_0 */
6908 { VEX_W_TABLE (VEX_W_0F385A_M_0_L_0
) },
6911 /* VEX_LEN_0F385C_X86_64_P_1_W_0_M_0 */
6913 { "tdpbf16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
6916 /* VEX_LEN_0F385C_X86_64_P_3_W_0_M_0 */
6918 { "tdpfp16ps", { TMM
, EXtmm
, VexTmm
}, 0 },
6921 /* VEX_LEN_0F385E_X86_64_P_0_W_0_M_0 */
6923 { "tdpbuud", {TMM
, EXtmm
, VexTmm
}, 0 },
6926 /* VEX_LEN_0F385E_X86_64_P_1_W_0_M_0 */
6928 { "tdpbsud", {TMM
, EXtmm
, VexTmm
}, 0 },
6931 /* VEX_LEN_0F385E_X86_64_P_2_W_0_M_0 */
6933 { "tdpbusd", {TMM
, EXtmm
, VexTmm
}, 0 },
6936 /* VEX_LEN_0F385E_X86_64_P_3_W_0_M_0 */
6938 { "tdpbssd", {TMM
, EXtmm
, VexTmm
}, 0 },
6941 /* VEX_LEN_0F38DB */
6943 { "vaesimc", { XM
, EXx
}, PREFIX_DATA
},
6946 /* VEX_LEN_0F38F2 */
6948 { "andnS", { Gdq
, VexGdq
, Edq
}, PREFIX_OPCODE
},
6951 /* VEX_LEN_0F38F3 */
6953 { REG_TABLE(REG_VEX_0F38F3_L_0
) },
6956 /* VEX_LEN_0F38F5 */
6958 { PREFIX_TABLE(PREFIX_VEX_0F38F5_L_0
) },
6961 /* VEX_LEN_0F38F6 */
6963 { PREFIX_TABLE(PREFIX_VEX_0F38F6_L_0
) },
6966 /* VEX_LEN_0F38F7 */
6968 { PREFIX_TABLE(PREFIX_VEX_0F38F7_L_0
) },
6971 /* VEX_LEN_0F3A00 */
6974 { VEX_W_TABLE (VEX_W_0F3A00_L_1
) },
6977 /* VEX_LEN_0F3A01 */
6980 { VEX_W_TABLE (VEX_W_0F3A01_L_1
) },
6983 /* VEX_LEN_0F3A06 */
6986 { VEX_W_TABLE (VEX_W_0F3A06_L_1
) },
6989 /* VEX_LEN_0F3A14 */
6991 { "%XEvpextrb", { Edb
, XM
, Ib
}, PREFIX_DATA
},
6994 /* VEX_LEN_0F3A15 */
6996 { "%XEvpextrw", { Edw
, XM
, Ib
}, PREFIX_DATA
},
6999 /* VEX_LEN_0F3A16 */
7001 { "%XEvpextrK", { Edq
, XM
, Ib
}, PREFIX_DATA
},
7004 /* VEX_LEN_0F3A17 */
7006 { "%XEvextractps", { Ed
, XM
, Ib
}, PREFIX_DATA
},
7009 /* VEX_LEN_0F3A18 */
7012 { VEX_W_TABLE (VEX_W_0F3A18_L_1
) },
7015 /* VEX_LEN_0F3A19 */
7018 { VEX_W_TABLE (VEX_W_0F3A19_L_1
) },
7021 /* VEX_LEN_0F3A20 */
7023 { "%XEvpinsrb", { XM
, Vex
, Edb
, Ib
}, PREFIX_DATA
},
7026 /* VEX_LEN_0F3A21 */
7028 { "%XEvinsertps", { XM
, Vex
, EXd
, Ib
}, PREFIX_DATA
},
7031 /* VEX_LEN_0F3A22 */
7033 { "%XEvpinsrK", { XM
, Vex
, Edq
, Ib
}, PREFIX_DATA
},
7036 /* VEX_LEN_0F3A30 */
7038 { MOD_TABLE (MOD_VEX_0F3A30_L_0
) },
7041 /* VEX_LEN_0F3A31 */
7043 { MOD_TABLE (MOD_VEX_0F3A31_L_0
) },
7046 /* VEX_LEN_0F3A32 */
7048 { MOD_TABLE (MOD_VEX_0F3A32_L_0
) },
7051 /* VEX_LEN_0F3A33 */
7053 { MOD_TABLE (MOD_VEX_0F3A33_L_0
) },
7056 /* VEX_LEN_0F3A38 */
7059 { VEX_W_TABLE (VEX_W_0F3A38_L_1
) },
7062 /* VEX_LEN_0F3A39 */
7065 { VEX_W_TABLE (VEX_W_0F3A39_L_1
) },
7068 /* VEX_LEN_0F3A41 */
7070 { "vdppd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7073 /* VEX_LEN_0F3A46 */
7076 { VEX_W_TABLE (VEX_W_0F3A46_L_1
) },
7079 /* VEX_LEN_0F3A60 */
7081 { "vpcmpestrm!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7084 /* VEX_LEN_0F3A61 */
7086 { "vpcmpestri!%LQ", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7089 /* VEX_LEN_0F3A62 */
7091 { "vpcmpistrm", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7094 /* VEX_LEN_0F3A63 */
7096 { "vpcmpistri", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7099 /* VEX_LEN_0F3ADF */
7101 { "vaeskeygenassist", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7104 /* VEX_LEN_0F3AF0 */
7106 { PREFIX_TABLE (PREFIX_VEX_0F3AF0_L_0
) },
7109 /* VEX_LEN_0FXOP_08_85 */
7111 { VEX_W_TABLE (VEX_W_0FXOP_08_85_L_0
) },
7114 /* VEX_LEN_0FXOP_08_86 */
7116 { VEX_W_TABLE (VEX_W_0FXOP_08_86_L_0
) },
7119 /* VEX_LEN_0FXOP_08_87 */
7121 { VEX_W_TABLE (VEX_W_0FXOP_08_87_L_0
) },
7124 /* VEX_LEN_0FXOP_08_8E */
7126 { VEX_W_TABLE (VEX_W_0FXOP_08_8E_L_0
) },
7129 /* VEX_LEN_0FXOP_08_8F */
7131 { VEX_W_TABLE (VEX_W_0FXOP_08_8F_L_0
) },
7134 /* VEX_LEN_0FXOP_08_95 */
7136 { VEX_W_TABLE (VEX_W_0FXOP_08_95_L_0
) },
7139 /* VEX_LEN_0FXOP_08_96 */
7141 { VEX_W_TABLE (VEX_W_0FXOP_08_96_L_0
) },
7144 /* VEX_LEN_0FXOP_08_97 */
7146 { VEX_W_TABLE (VEX_W_0FXOP_08_97_L_0
) },
7149 /* VEX_LEN_0FXOP_08_9E */
7151 { VEX_W_TABLE (VEX_W_0FXOP_08_9E_L_0
) },
7154 /* VEX_LEN_0FXOP_08_9F */
7156 { VEX_W_TABLE (VEX_W_0FXOP_08_9F_L_0
) },
7159 /* VEX_LEN_0FXOP_08_A3 */
7161 { "vpperm", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7164 /* VEX_LEN_0FXOP_08_A6 */
7166 { VEX_W_TABLE (VEX_W_0FXOP_08_A6_L_0
) },
7169 /* VEX_LEN_0FXOP_08_B6 */
7171 { VEX_W_TABLE (VEX_W_0FXOP_08_B6_L_0
) },
7174 /* VEX_LEN_0FXOP_08_C0 */
7176 { VEX_W_TABLE (VEX_W_0FXOP_08_C0_L_0
) },
7179 /* VEX_LEN_0FXOP_08_C1 */
7181 { VEX_W_TABLE (VEX_W_0FXOP_08_C1_L_0
) },
7184 /* VEX_LEN_0FXOP_08_C2 */
7186 { VEX_W_TABLE (VEX_W_0FXOP_08_C2_L_0
) },
7189 /* VEX_LEN_0FXOP_08_C3 */
7191 { VEX_W_TABLE (VEX_W_0FXOP_08_C3_L_0
) },
7194 /* VEX_LEN_0FXOP_08_CC */
7196 { VEX_W_TABLE (VEX_W_0FXOP_08_CC_L_0
) },
7199 /* VEX_LEN_0FXOP_08_CD */
7201 { VEX_W_TABLE (VEX_W_0FXOP_08_CD_L_0
) },
7204 /* VEX_LEN_0FXOP_08_CE */
7206 { VEX_W_TABLE (VEX_W_0FXOP_08_CE_L_0
) },
7209 /* VEX_LEN_0FXOP_08_CF */
7211 { VEX_W_TABLE (VEX_W_0FXOP_08_CF_L_0
) },
7214 /* VEX_LEN_0FXOP_08_EC */
7216 { VEX_W_TABLE (VEX_W_0FXOP_08_EC_L_0
) },
7219 /* VEX_LEN_0FXOP_08_ED */
7221 { VEX_W_TABLE (VEX_W_0FXOP_08_ED_L_0
) },
7224 /* VEX_LEN_0FXOP_08_EE */
7226 { VEX_W_TABLE (VEX_W_0FXOP_08_EE_L_0
) },
7229 /* VEX_LEN_0FXOP_08_EF */
7231 { VEX_W_TABLE (VEX_W_0FXOP_08_EF_L_0
) },
7234 /* VEX_LEN_0FXOP_09_01 */
7236 { REG_TABLE (REG_XOP_09_01_L_0
) },
7239 /* VEX_LEN_0FXOP_09_02 */
7241 { REG_TABLE (REG_XOP_09_02_L_0
) },
7244 /* VEX_LEN_0FXOP_09_12_M_1 */
7246 { REG_TABLE (REG_XOP_09_12_M_1_L_0
) },
7249 /* VEX_LEN_0FXOP_09_82_W_0 */
7251 { "vfrczss", { XM
, EXd
}, 0 },
7254 /* VEX_LEN_0FXOP_09_83_W_0 */
7256 { "vfrczsd", { XM
, EXq
}, 0 },
7259 /* VEX_LEN_0FXOP_09_90 */
7261 { "vprotb", { XM
, EXx
, VexW
}, 0 },
7264 /* VEX_LEN_0FXOP_09_91 */
7266 { "vprotw", { XM
, EXx
, VexW
}, 0 },
7269 /* VEX_LEN_0FXOP_09_92 */
7271 { "vprotd", { XM
, EXx
, VexW
}, 0 },
7274 /* VEX_LEN_0FXOP_09_93 */
7276 { "vprotq", { XM
, EXx
, VexW
}, 0 },
7279 /* VEX_LEN_0FXOP_09_94 */
7281 { "vpshlb", { XM
, EXx
, VexW
}, 0 },
7284 /* VEX_LEN_0FXOP_09_95 */
7286 { "vpshlw", { XM
, EXx
, VexW
}, 0 },
7289 /* VEX_LEN_0FXOP_09_96 */
7291 { "vpshld", { XM
, EXx
, VexW
}, 0 },
7294 /* VEX_LEN_0FXOP_09_97 */
7296 { "vpshlq", { XM
, EXx
, VexW
}, 0 },
7299 /* VEX_LEN_0FXOP_09_98 */
7301 { "vpshab", { XM
, EXx
, VexW
}, 0 },
7304 /* VEX_LEN_0FXOP_09_99 */
7306 { "vpshaw", { XM
, EXx
, VexW
}, 0 },
7309 /* VEX_LEN_0FXOP_09_9A */
7311 { "vpshad", { XM
, EXx
, VexW
}, 0 },
7314 /* VEX_LEN_0FXOP_09_9B */
7316 { "vpshaq", { XM
, EXx
, VexW
}, 0 },
7319 /* VEX_LEN_0FXOP_09_C1 */
7321 { VEX_W_TABLE (VEX_W_0FXOP_09_C1_L_0
) },
7324 /* VEX_LEN_0FXOP_09_C2 */
7326 { VEX_W_TABLE (VEX_W_0FXOP_09_C2_L_0
) },
7329 /* VEX_LEN_0FXOP_09_C3 */
7331 { VEX_W_TABLE (VEX_W_0FXOP_09_C3_L_0
) },
7334 /* VEX_LEN_0FXOP_09_C6 */
7336 { VEX_W_TABLE (VEX_W_0FXOP_09_C6_L_0
) },
7339 /* VEX_LEN_0FXOP_09_C7 */
7341 { VEX_W_TABLE (VEX_W_0FXOP_09_C7_L_0
) },
7344 /* VEX_LEN_0FXOP_09_CB */
7346 { VEX_W_TABLE (VEX_W_0FXOP_09_CB_L_0
) },
7349 /* VEX_LEN_0FXOP_09_D1 */
7351 { VEX_W_TABLE (VEX_W_0FXOP_09_D1_L_0
) },
7354 /* VEX_LEN_0FXOP_09_D2 */
7356 { VEX_W_TABLE (VEX_W_0FXOP_09_D2_L_0
) },
7359 /* VEX_LEN_0FXOP_09_D3 */
7361 { VEX_W_TABLE (VEX_W_0FXOP_09_D3_L_0
) },
7364 /* VEX_LEN_0FXOP_09_D6 */
7366 { VEX_W_TABLE (VEX_W_0FXOP_09_D6_L_0
) },
7369 /* VEX_LEN_0FXOP_09_D7 */
7371 { VEX_W_TABLE (VEX_W_0FXOP_09_D7_L_0
) },
7374 /* VEX_LEN_0FXOP_09_DB */
7376 { VEX_W_TABLE (VEX_W_0FXOP_09_DB_L_0
) },
7379 /* VEX_LEN_0FXOP_09_E1 */
7381 { VEX_W_TABLE (VEX_W_0FXOP_09_E1_L_0
) },
7384 /* VEX_LEN_0FXOP_09_E2 */
7386 { VEX_W_TABLE (VEX_W_0FXOP_09_E2_L_0
) },
7389 /* VEX_LEN_0FXOP_09_E3 */
7391 { VEX_W_TABLE (VEX_W_0FXOP_09_E3_L_0
) },
7394 /* VEX_LEN_0FXOP_0A_12 */
7396 { REG_TABLE (REG_XOP_0A_12_L_0
) },
7400 #include "i386-dis-evex-len.h"
7402 static const struct dis386 vex_w_table
[][2] = {
7404 /* VEX_W_0F41_L_1_M_1 */
7405 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_0
) },
7406 { PREFIX_TABLE (PREFIX_VEX_0F41_L_1_M_1_W_1
) },
7409 /* VEX_W_0F42_L_1_M_1 */
7410 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_0
) },
7411 { PREFIX_TABLE (PREFIX_VEX_0F42_L_1_M_1_W_1
) },
7414 /* VEX_W_0F44_L_0_M_1 */
7415 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_0
) },
7416 { PREFIX_TABLE (PREFIX_VEX_0F44_L_0_M_1_W_1
) },
7419 /* VEX_W_0F45_L_1_M_1 */
7420 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_0
) },
7421 { PREFIX_TABLE (PREFIX_VEX_0F45_L_1_M_1_W_1
) },
7424 /* VEX_W_0F46_L_1_M_1 */
7425 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_0
) },
7426 { PREFIX_TABLE (PREFIX_VEX_0F46_L_1_M_1_W_1
) },
7429 /* VEX_W_0F47_L_1_M_1 */
7430 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_0
) },
7431 { PREFIX_TABLE (PREFIX_VEX_0F47_L_1_M_1_W_1
) },
7434 /* VEX_W_0F4A_L_1_M_1 */
7435 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_0
) },
7436 { PREFIX_TABLE (PREFIX_VEX_0F4A_L_1_M_1_W_1
) },
7439 /* VEX_W_0F4B_L_1_M_1 */
7440 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_0
) },
7441 { PREFIX_TABLE (PREFIX_VEX_0F4B_L_1_M_1_W_1
) },
7444 /* VEX_W_0F90_L_0 */
7445 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_0
) },
7446 { PREFIX_TABLE (PREFIX_VEX_0F90_L_0_W_1
) },
7449 /* VEX_W_0F91_L_0_M_0 */
7450 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_0
) },
7451 { PREFIX_TABLE (PREFIX_VEX_0F91_L_0_M_0_W_1
) },
7454 /* VEX_W_0F92_L_0_M_1 */
7455 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_0
) },
7456 { PREFIX_TABLE (PREFIX_VEX_0F92_L_0_M_1_W_1
) },
7459 /* VEX_W_0F93_L_0_M_1 */
7460 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_0
) },
7461 { PREFIX_TABLE (PREFIX_VEX_0F93_L_0_M_1_W_1
) },
7464 /* VEX_W_0F98_L_0_M_1 */
7465 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_0
) },
7466 { PREFIX_TABLE (PREFIX_VEX_0F98_L_0_M_1_W_1
) },
7469 /* VEX_W_0F99_L_0_M_1 */
7470 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_0
) },
7471 { PREFIX_TABLE (PREFIX_VEX_0F99_L_0_M_1_W_1
) },
7475 { "%XEvpermilps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7479 { "vpermilpd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7483 { "vtestps", { XM
, EXx
}, PREFIX_DATA
},
7487 { "vtestpd", { XM
, EXx
}, PREFIX_DATA
},
7491 { "vcvtph2ps", { XM
, EXxmmq
}, PREFIX_DATA
},
7494 /* VEX_W_0F3816_L_1 */
7495 { "vpermps", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7499 { "%XEvbroadcastss", { XM
, EXd
}, PREFIX_DATA
},
7502 /* VEX_W_0F3819_L_1 */
7503 { "vbroadcastsd", { XM
, EXq
}, PREFIX_DATA
},
7506 /* VEX_W_0F381A_M_0_L_1 */
7507 { "vbroadcastf128", { XM
, Mxmm
}, PREFIX_DATA
},
7510 /* VEX_W_0F382C_M_0 */
7511 { "vmaskmovps", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7514 /* VEX_W_0F382D_M_0 */
7515 { "vmaskmovpd", { XM
, Vex
, Mx
}, PREFIX_DATA
},
7518 /* VEX_W_0F382E_M_0 */
7519 { "vmaskmovps", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7522 /* VEX_W_0F382F_M_0 */
7523 { "vmaskmovpd", { Mx
, Vex
, XM
}, PREFIX_DATA
},
7527 { "vpermd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7531 { "vpsravd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7534 /* VEX_W_0F3849_X86_64_P_0 */
7535 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_0_W_0
) },
7538 /* VEX_W_0F3849_X86_64_P_2 */
7539 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_2_W_0
) },
7542 /* VEX_W_0F3849_X86_64_P_3 */
7543 { MOD_TABLE (MOD_VEX_0F3849_X86_64_P_3_W_0
) },
7546 /* VEX_W_0F384B_X86_64_P_1 */
7547 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_1_W_0
) },
7550 /* VEX_W_0F384B_X86_64_P_2 */
7551 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_2_W_0
) },
7554 /* VEX_W_0F384B_X86_64_P_3 */
7555 { MOD_TABLE (MOD_VEX_0F384B_X86_64_P_3_W_0
) },
7559 { "%XVvpdpbusd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7563 { "%XVvpdpbusds", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7567 { "%XVvpdpwssd", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7571 { "%XVvpdpwssds", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7575 { "%XEvpbroadcastd", { XM
, EXd
}, PREFIX_DATA
},
7579 { "vpbroadcastq", { XM
, EXq
}, PREFIX_DATA
},
7582 /* VEX_W_0F385A_M_0_L_0 */
7583 { "vbroadcasti128", { XM
, Mxmm
}, PREFIX_DATA
},
7586 /* VEX_W_0F385C_X86_64_P_1 */
7587 { MOD_TABLE (MOD_VEX_0F385C_X86_64_P_1_W_0
) },
7590 /* VEX_W_0F385C_X86_64_P_3 */
7591 { MOD_TABLE (MOD_VEX_0F385C_X86_64_P_3_W_0
) },
7594 /* VEX_W_0F385E_X86_64_P_0 */
7595 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_0_W_0
) },
7598 /* VEX_W_0F385E_X86_64_P_1 */
7599 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_1_W_0
) },
7602 /* VEX_W_0F385E_X86_64_P_2 */
7603 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_2_W_0
) },
7606 /* VEX_W_0F385E_X86_64_P_3 */
7607 { MOD_TABLE (MOD_VEX_0F385E_X86_64_P_3_W_0
) },
7611 { "%XEvpbroadcastb", { XM
, EXb
}, PREFIX_DATA
},
7615 { "%XEvpbroadcastw", { XM
, EXw
}, PREFIX_DATA
},
7619 { "%XEvgf2p8mulb", { XM
, Vex
, EXx
}, PREFIX_DATA
},
7622 /* VEX_W_0F3A00_L_1 */
7624 { "%XEvpermq", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7627 /* VEX_W_0F3A01_L_1 */
7629 { "%XEvpermpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7633 { "vpblendd", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7637 { "%XEvpermilps", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7641 { "vpermilpd", { XM
, EXx
, Ib
}, PREFIX_DATA
},
7644 /* VEX_W_0F3A06_L_1 */
7645 { "vperm2f128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7648 /* VEX_W_0F3A18_L_1 */
7649 { "vinsertf128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7652 /* VEX_W_0F3A19_L_1 */
7653 { "vextractf128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7657 { "%XEvcvtps2ph", { EXxmmq
, XM
, EXxEVexS
, Ib
}, PREFIX_DATA
},
7660 /* VEX_W_0F3A38_L_1 */
7661 { "vinserti128", { XM
, Vex
, EXxmm
, Ib
}, PREFIX_DATA
},
7664 /* VEX_W_0F3A39_L_1 */
7665 { "vextracti128", { EXxmm
, XM
, Ib
}, PREFIX_DATA
},
7668 /* VEX_W_0F3A46_L_1 */
7669 { "vperm2i128", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7673 { "vblendvps", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7677 { "vblendvpd", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7681 { "vpblendvb", { XM
, Vex
, EXx
, XMVexI4
}, PREFIX_DATA
},
7686 { "%XEvgf2p8affineqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7691 { "%XEvgf2p8affineinvqb", { XM
, Vex
, EXx
, Ib
}, PREFIX_DATA
},
7693 /* VEX_W_0FXOP_08_85_L_0 */
7695 { "vpmacssww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7697 /* VEX_W_0FXOP_08_86_L_0 */
7699 { "vpmacsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7701 /* VEX_W_0FXOP_08_87_L_0 */
7703 { "vpmacssdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7705 /* VEX_W_0FXOP_08_8E_L_0 */
7707 { "vpmacssdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7709 /* VEX_W_0FXOP_08_8F_L_0 */
7711 { "vpmacssdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7713 /* VEX_W_0FXOP_08_95_L_0 */
7715 { "vpmacsww", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7717 /* VEX_W_0FXOP_08_96_L_0 */
7719 { "vpmacswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7721 /* VEX_W_0FXOP_08_97_L_0 */
7723 { "vpmacsdql", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7725 /* VEX_W_0FXOP_08_9E_L_0 */
7727 { "vpmacsdd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7729 /* VEX_W_0FXOP_08_9F_L_0 */
7731 { "vpmacsdqh", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7733 /* VEX_W_0FXOP_08_A6_L_0 */
7735 { "vpmadcsswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7737 /* VEX_W_0FXOP_08_B6_L_0 */
7739 { "vpmadcswd", { XM
, Vex
, EXx
, XMVexI4
}, 0 },
7741 /* VEX_W_0FXOP_08_C0_L_0 */
7743 { "vprotb", { XM
, EXx
, Ib
}, 0 },
7745 /* VEX_W_0FXOP_08_C1_L_0 */
7747 { "vprotw", { XM
, EXx
, Ib
}, 0 },
7749 /* VEX_W_0FXOP_08_C2_L_0 */
7751 { "vprotd", { XM
, EXx
, Ib
}, 0 },
7753 /* VEX_W_0FXOP_08_C3_L_0 */
7755 { "vprotq", { XM
, EXx
, Ib
}, 0 },
7757 /* VEX_W_0FXOP_08_CC_L_0 */
7759 { "vpcomb", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7761 /* VEX_W_0FXOP_08_CD_L_0 */
7763 { "vpcomw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7765 /* VEX_W_0FXOP_08_CE_L_0 */
7767 { "vpcomd", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7769 /* VEX_W_0FXOP_08_CF_L_0 */
7771 { "vpcomq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7773 /* VEX_W_0FXOP_08_EC_L_0 */
7775 { "vpcomub", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7777 /* VEX_W_0FXOP_08_ED_L_0 */
7779 { "vpcomuw", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7781 /* VEX_W_0FXOP_08_EE_L_0 */
7783 { "vpcomud", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7785 /* VEX_W_0FXOP_08_EF_L_0 */
7787 { "vpcomuq", { XM
, Vex
, EXx
, VPCOM
}, 0 },
7789 /* VEX_W_0FXOP_09_80 */
7791 { "vfrczps", { XM
, EXx
}, 0 },
7793 /* VEX_W_0FXOP_09_81 */
7795 { "vfrczpd", { XM
, EXx
}, 0 },
7797 /* VEX_W_0FXOP_09_82 */
7799 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_82_W_0
) },
7801 /* VEX_W_0FXOP_09_83 */
7803 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_83_W_0
) },
7805 /* VEX_W_0FXOP_09_C1_L_0 */
7807 { "vphaddbw", { XM
, EXxmm
}, 0 },
7809 /* VEX_W_0FXOP_09_C2_L_0 */
7811 { "vphaddbd", { XM
, EXxmm
}, 0 },
7813 /* VEX_W_0FXOP_09_C3_L_0 */
7815 { "vphaddbq", { XM
, EXxmm
}, 0 },
7817 /* VEX_W_0FXOP_09_C6_L_0 */
7819 { "vphaddwd", { XM
, EXxmm
}, 0 },
7821 /* VEX_W_0FXOP_09_C7_L_0 */
7823 { "vphaddwq", { XM
, EXxmm
}, 0 },
7825 /* VEX_W_0FXOP_09_CB_L_0 */
7827 { "vphadddq", { XM
, EXxmm
}, 0 },
7829 /* VEX_W_0FXOP_09_D1_L_0 */
7831 { "vphaddubw", { XM
, EXxmm
}, 0 },
7833 /* VEX_W_0FXOP_09_D2_L_0 */
7835 { "vphaddubd", { XM
, EXxmm
}, 0 },
7837 /* VEX_W_0FXOP_09_D3_L_0 */
7839 { "vphaddubq", { XM
, EXxmm
}, 0 },
7841 /* VEX_W_0FXOP_09_D6_L_0 */
7843 { "vphadduwd", { XM
, EXxmm
}, 0 },
7845 /* VEX_W_0FXOP_09_D7_L_0 */
7847 { "vphadduwq", { XM
, EXxmm
}, 0 },
7849 /* VEX_W_0FXOP_09_DB_L_0 */
7851 { "vphaddudq", { XM
, EXxmm
}, 0 },
7853 /* VEX_W_0FXOP_09_E1_L_0 */
7855 { "vphsubbw", { XM
, EXxmm
}, 0 },
7857 /* VEX_W_0FXOP_09_E2_L_0 */
7859 { "vphsubwd", { XM
, EXxmm
}, 0 },
7861 /* VEX_W_0FXOP_09_E3_L_0 */
7863 { "vphsubdq", { XM
, EXxmm
}, 0 },
7866 #include "i386-dis-evex-w.h"
7869 static const struct dis386 mod_table
[][2] = {
7872 { "bound{S|}", { Gv
, Ma
}, 0 },
7873 { EVEX_TABLE (EVEX_0F
) },
7877 { "leaS", { Gv
, M
}, 0 },
7881 { "lesS", { Gv
, Mp
}, 0 },
7882 { VEX_C4_TABLE (VEX_0F
) },
7886 { "ldsS", { Gv
, Mp
}, 0 },
7887 { VEX_C5_TABLE (VEX_0F
) },
7892 { RM_TABLE (RM_C6_REG_7
) },
7897 { RM_TABLE (RM_C7_REG_7
) },
7901 { "{l|}call^", { indirEp
}, 0 },
7905 { "{l|}jmp^", { indirEp
}, 0 },
7908 /* MOD_0F01_REG_0 */
7909 { X86_64_TABLE (X86_64_0F01_REG_0
) },
7910 { RM_TABLE (RM_0F01_REG_0
) },
7913 /* MOD_0F01_REG_1 */
7914 { X86_64_TABLE (X86_64_0F01_REG_1
) },
7915 { RM_TABLE (RM_0F01_REG_1
) },
7918 /* MOD_0F01_REG_2 */
7919 { X86_64_TABLE (X86_64_0F01_REG_2
) },
7920 { RM_TABLE (RM_0F01_REG_2
) },
7923 /* MOD_0F01_REG_3 */
7924 { X86_64_TABLE (X86_64_0F01_REG_3
) },
7925 { RM_TABLE (RM_0F01_REG_3
) },
7928 /* MOD_0F01_REG_5 */
7929 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_0
) },
7930 { RM_TABLE (RM_0F01_REG_5_MOD_3
) },
7933 /* MOD_0F01_REG_7 */
7934 { "invlpg", { Mb
}, 0 },
7935 { RM_TABLE (RM_0F01_REG_7_MOD_3
) },
7938 /* MOD_0F12_PREFIX_0 */
7939 { "movlpX", { XM
, EXq
}, 0 },
7940 { "movhlps", { XM
, EXq
}, 0 },
7943 /* MOD_0F12_PREFIX_2 */
7944 { "movlpX", { XM
, EXq
}, 0 },
7948 { "movlpX", { EXq
, XM
}, PREFIX_OPCODE
},
7951 /* MOD_0F16_PREFIX_0 */
7952 { "movhpX", { XM
, EXq
}, 0 },
7953 { "movlhps", { XM
, EXq
}, 0 },
7956 /* MOD_0F16_PREFIX_2 */
7957 { "movhpX", { XM
, EXq
}, 0 },
7961 { "movhpX", { EXq
, XM
}, PREFIX_OPCODE
},
7964 /* MOD_0F18_REG_0 */
7965 { "prefetchnta", { Mb
}, 0 },
7966 { "nopQ", { Ev
}, 0 },
7969 /* MOD_0F18_REG_1 */
7970 { "prefetcht0", { Mb
}, 0 },
7971 { "nopQ", { Ev
}, 0 },
7974 /* MOD_0F18_REG_2 */
7975 { "prefetcht1", { Mb
}, 0 },
7976 { "nopQ", { Ev
}, 0 },
7979 /* MOD_0F18_REG_3 */
7980 { "prefetcht2", { Mb
}, 0 },
7981 { "nopQ", { Ev
}, 0 },
7984 /* MOD_0F1A_PREFIX_0 */
7985 { "bndldx", { Gbnd
, Mv_bnd
}, 0 },
7986 { "nopQ", { Ev
}, 0 },
7989 /* MOD_0F1B_PREFIX_0 */
7990 { "bndstx", { Mv_bnd
, Gbnd
}, 0 },
7991 { "nopQ", { Ev
}, 0 },
7994 /* MOD_0F1B_PREFIX_1 */
7995 { "bndmk", { Gbnd
, Mv_bnd
}, 0 },
7996 { "nopQ", { Ev
}, PREFIX_IGNORED
},
7999 /* MOD_0F1C_PREFIX_0 */
8000 { REG_TABLE (REG_0F1C_P_0_MOD_0
) },
8001 { "nopQ", { Ev
}, 0 },
8004 /* MOD_0F1E_PREFIX_1 */
8005 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8006 { REG_TABLE (REG_0F1E_P_1_MOD_3
) },
8009 /* MOD_0F2B_PREFIX_0 */
8010 {"movntps", { Mx
, XM
}, PREFIX_OPCODE
},
8013 /* MOD_0F2B_PREFIX_1 */
8014 {"movntss", { Md
, XM
}, PREFIX_OPCODE
},
8017 /* MOD_0F2B_PREFIX_2 */
8018 {"movntpd", { Mx
, XM
}, PREFIX_OPCODE
},
8021 /* MOD_0F2B_PREFIX_3 */
8022 {"movntsd", { Mq
, XM
}, PREFIX_OPCODE
},
8027 { "movmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8032 { REG_TABLE (REG_0F71_MOD_0
) },
8037 { REG_TABLE (REG_0F72_MOD_0
) },
8042 { REG_TABLE (REG_0F73_MOD_0
) },
8045 /* MOD_0FAE_REG_0 */
8046 { "fxsave", { FXSAVE
}, 0 },
8047 { PREFIX_TABLE (PREFIX_0FAE_REG_0_MOD_3
) },
8050 /* MOD_0FAE_REG_1 */
8051 { "fxrstor", { FXSAVE
}, 0 },
8052 { PREFIX_TABLE (PREFIX_0FAE_REG_1_MOD_3
) },
8055 /* MOD_0FAE_REG_2 */
8056 { "ldmxcsr", { Md
}, 0 },
8057 { PREFIX_TABLE (PREFIX_0FAE_REG_2_MOD_3
) },
8060 /* MOD_0FAE_REG_3 */
8061 { "stmxcsr", { Md
}, 0 },
8062 { PREFIX_TABLE (PREFIX_0FAE_REG_3_MOD_3
) },
8065 /* MOD_0FAE_REG_4 */
8066 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_0
) },
8067 { PREFIX_TABLE (PREFIX_0FAE_REG_4_MOD_3
) },
8070 /* MOD_0FAE_REG_5 */
8071 { "xrstor", { FXSAVE
}, PREFIX_OPCODE
},
8072 { PREFIX_TABLE (PREFIX_0FAE_REG_5_MOD_3
) },
8075 /* MOD_0FAE_REG_6 */
8076 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_0
) },
8077 { PREFIX_TABLE (PREFIX_0FAE_REG_6_MOD_3
) },
8080 /* MOD_0FAE_REG_7 */
8081 { PREFIX_TABLE (PREFIX_0FAE_REG_7_MOD_0
) },
8082 { RM_TABLE (RM_0FAE_REG_7_MOD_3
) },
8086 { "lssS", { Gv
, Mp
}, 0 },
8090 { "lfsS", { Gv
, Mp
}, 0 },
8094 { "lgsS", { Gv
, Mp
}, 0 },
8098 { "movntiS", { Edq
, Gdq
}, PREFIX_OPCODE
},
8101 /* MOD_0FC7_REG_3 */
8102 { "xrstors", { FXSAVE
}, 0 },
8105 /* MOD_0FC7_REG_4 */
8106 { "xsavec", { FXSAVE
}, 0 },
8109 /* MOD_0FC7_REG_5 */
8110 { "xsaves", { FXSAVE
}, 0 },
8113 /* MOD_0FC7_REG_6 */
8114 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_0
) },
8115 { PREFIX_TABLE (PREFIX_0FC7_REG_6_MOD_3
) }
8118 /* MOD_0FC7_REG_7 */
8119 { "vmptrst", { Mq
}, 0 },
8120 { PREFIX_TABLE (PREFIX_0FC7_REG_7_MOD_3
) }
8125 { "pmovmskb", { Gdq
, MS
}, 0 },
8128 /* MOD_0FE7_PREFIX_2 */
8129 { "movntdq", { Mx
, XM
}, 0 },
8132 /* MOD_0FF0_PREFIX_3 */
8133 { "lddqu", { XM
, M
}, 0 },
8137 { "movntdqa", { XM
, Mx
}, PREFIX_DATA
},
8140 /* MOD_0F38DC_PREFIX_1 */
8141 { "aesenc128kl", { XM
, M
}, 0 },
8142 { "loadiwkey", { XM
, EXx
}, 0 },
8145 /* MOD_0F38DD_PREFIX_1 */
8146 { "aesdec128kl", { XM
, M
}, 0 },
8149 /* MOD_0F38DE_PREFIX_1 */
8150 { "aesenc256kl", { XM
, M
}, 0 },
8153 /* MOD_0F38DF_PREFIX_1 */
8154 { "aesdec256kl", { XM
, M
}, 0 },
8158 { "wrussK", { M
, Gdq
}, PREFIX_DATA
},
8161 /* MOD_0F38F6_PREFIX_0 */
8162 { "wrssK", { M
, Gdq
}, PREFIX_OPCODE
},
8165 /* MOD_0F38F8_PREFIX_1 */
8166 { "enqcmds", { Gva
, M
}, PREFIX_OPCODE
},
8169 /* MOD_0F38F8_PREFIX_2 */
8170 { "movdir64b", { Gva
, M
}, PREFIX_OPCODE
},
8173 /* MOD_0F38F8_PREFIX_3 */
8174 { "enqcmd", { Gva
, M
}, PREFIX_OPCODE
},
8178 { "movdiri", { Edq
, Gdq
}, PREFIX_OPCODE
},
8181 /* MOD_0F38FA_PREFIX_1 */
8183 { "encodekey128", { Gd
, Ed
}, 0 },
8186 /* MOD_0F38FB_PREFIX_1 */
8188 { "encodekey256", { Gd
, Ed
}, 0 },
8191 /* MOD_0F3A0F_PREFIX_1 */
8193 { REG_TABLE (REG_0F3A0F_PREFIX_1_MOD_3
) },
8196 /* MOD_VEX_0F12_PREFIX_0 */
8197 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0
) },
8198 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1
) },
8201 /* MOD_VEX_0F12_PREFIX_2 */
8202 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2_M_0
) },
8206 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0
) },
8209 /* MOD_VEX_0F16_PREFIX_0 */
8210 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0
) },
8211 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1
) },
8214 /* MOD_VEX_0F16_PREFIX_2 */
8215 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2_M_0
) },
8219 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0
) },
8223 { "%XEvmovntpX", { Mx
, XM
}, PREFIX_OPCODE
},
8226 /* MOD_VEX_0F41_L_1 */
8228 { VEX_W_TABLE (VEX_W_0F41_L_1_M_1
) },
8231 /* MOD_VEX_0F42_L_1 */
8233 { VEX_W_TABLE (VEX_W_0F42_L_1_M_1
) },
8236 /* MOD_VEX_0F44_L_0 */
8238 { VEX_W_TABLE (VEX_W_0F44_L_0_M_1
) },
8241 /* MOD_VEX_0F45_L_1 */
8243 { VEX_W_TABLE (VEX_W_0F45_L_1_M_1
) },
8246 /* MOD_VEX_0F46_L_1 */
8248 { VEX_W_TABLE (VEX_W_0F46_L_1_M_1
) },
8251 /* MOD_VEX_0F47_L_1 */
8253 { VEX_W_TABLE (VEX_W_0F47_L_1_M_1
) },
8256 /* MOD_VEX_0F4A_L_1 */
8258 { VEX_W_TABLE (VEX_W_0F4A_L_1_M_1
) },
8261 /* MOD_VEX_0F4B_L_1 */
8263 { VEX_W_TABLE (VEX_W_0F4B_L_1_M_1
) },
8268 { "vmovmskpX", { Gdq
, XS
}, PREFIX_OPCODE
},
8273 { REG_TABLE (REG_VEX_0F71_M_0
) },
8278 { REG_TABLE (REG_VEX_0F72_M_0
) },
8283 { REG_TABLE (REG_VEX_0F73_M_0
) },
8286 /* MOD_VEX_0F91_L_0 */
8287 { VEX_W_TABLE (VEX_W_0F91_L_0_M_0
) },
8290 /* MOD_VEX_0F92_L_0 */
8292 { VEX_W_TABLE (VEX_W_0F92_L_0_M_1
) },
8295 /* MOD_VEX_0F93_L_0 */
8297 { VEX_W_TABLE (VEX_W_0F93_L_0_M_1
) },
8300 /* MOD_VEX_0F98_L_0 */
8302 { VEX_W_TABLE (VEX_W_0F98_L_0_M_1
) },
8305 /* MOD_VEX_0F99_L_0 */
8307 { VEX_W_TABLE (VEX_W_0F99_L_0_M_1
) },
8310 /* MOD_VEX_0FAE_REG_2 */
8311 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0
) },
8314 /* MOD_VEX_0FAE_REG_3 */
8315 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0
) },
8320 { "vpmovmskb", { Gdq
, XS
}, PREFIX_DATA
},
8324 { "vmovntdq", { Mx
, XM
}, PREFIX_DATA
},
8327 /* MOD_VEX_0FF0_PREFIX_3 */
8328 { "vlddqu", { XM
, M
}, 0 },
8331 /* MOD_VEX_0F381A */
8332 { VEX_LEN_TABLE (VEX_LEN_0F381A_M_0
) },
8335 /* MOD_VEX_0F382A */
8336 { "vmovntdqa", { XM
, Mx
}, PREFIX_DATA
},
8339 /* MOD_VEX_0F382C */
8340 { VEX_W_TABLE (VEX_W_0F382C_M_0
) },
8343 /* MOD_VEX_0F382D */
8344 { VEX_W_TABLE (VEX_W_0F382D_M_0
) },
8347 /* MOD_VEX_0F382E */
8348 { VEX_W_TABLE (VEX_W_0F382E_M_0
) },
8351 /* MOD_VEX_0F382F */
8352 { VEX_W_TABLE (VEX_W_0F382F_M_0
) },
8355 /* MOD_VEX_0F3849_X86_64_P_0_W_0 */
8356 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_0_W_0_M_0
) },
8357 { REG_TABLE (REG_VEX_0F3849_X86_64_P_0_W_0_M_1
) },
8360 /* MOD_VEX_0F3849_X86_64_P_2_W_0 */
8361 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_2_W_0_M_0
) },
8364 /* MOD_VEX_0F3849_X86_64_P_3_W_0 */
8366 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_3_W_0_M_0
) },
8369 /* MOD_VEX_0F384B_X86_64_P_1_W_0 */
8370 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_1_W_0_M_0
) },
8373 /* MOD_VEX_0F384B_X86_64_P_2_W_0 */
8374 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_2_W_0_M_0
) },
8377 /* MOD_VEX_0F384B_X86_64_P_3_W_0 */
8378 { VEX_LEN_TABLE (VEX_LEN_0F384B_X86_64_P_3_W_0_M_0
) },
8381 /* MOD_VEX_0F385A */
8382 { VEX_LEN_TABLE (VEX_LEN_0F385A_M_0
) },
8385 /* MOD_VEX_0F385C_X86_64_P_1_W_0 */
8387 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_P_1_W_0_M_0
) },
8390 /* MOD_VEX_0F385C_X86_64_P_3_W_0 */
8392 { VEX_LEN_TABLE (VEX_LEN_0F385C_X86_64_P_3_W_0_M_0
) },
8395 /* MOD_VEX_0F385E_X86_64_P_0_W_0 */
8397 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_0_W_0_M_0
) },
8400 /* MOD_VEX_0F385E_X86_64_P_1_W_0 */
8402 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_1_W_0_M_0
) },
8405 /* MOD_VEX_0F385E_X86_64_P_2_W_0 */
8407 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_2_W_0_M_0
) },
8410 /* MOD_VEX_0F385E_X86_64_P_3_W_0 */
8412 { VEX_LEN_TABLE (VEX_LEN_0F385E_X86_64_P_3_W_0_M_0
) },
8415 /* MOD_VEX_0F388C */
8416 { "vpmaskmov%DQ", { XM
, Vex
, Mx
}, PREFIX_DATA
},
8419 /* MOD_VEX_0F388E */
8420 { "vpmaskmov%DQ", { Mx
, Vex
, XM
}, PREFIX_DATA
},
8423 /* MOD_VEX_0F3A30_L_0 */
8425 { "kshiftr%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8428 /* MOD_VEX_0F3A31_L_0 */
8430 { "kshiftr%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8433 /* MOD_VEX_0F3A32_L_0 */
8435 { "kshiftl%BW", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8438 /* MOD_VEX_0F3A33_L_0 */
8440 { "kshiftl%DQ", { MaskG
, MaskE
, Ib
}, PREFIX_DATA
},
8445 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_12_M_1
) },
8448 #include "i386-dis-evex-mod.h"
8451 static const struct dis386 rm_table
[][8] = {
8454 { "xabort", { Skip_MODRM
, Ib
}, 0 },
8458 { "xbeginT", { Skip_MODRM
, Jdqw
}, 0 },
8462 { "enclv", { Skip_MODRM
}, 0 },
8463 { "vmcall", { Skip_MODRM
}, 0 },
8464 { "vmlaunch", { Skip_MODRM
}, 0 },
8465 { "vmresume", { Skip_MODRM
}, 0 },
8466 { "vmxoff", { Skip_MODRM
}, 0 },
8467 { "pconfig", { Skip_MODRM
}, 0 },
8471 { "monitor", { { OP_Monitor
, 0 } }, 0 },
8472 { "mwait", { { OP_Mwait
, 0 } }, 0 },
8473 { "clac", { Skip_MODRM
}, 0 },
8474 { "stac", { Skip_MODRM
}, 0 },
8475 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_4
) },
8476 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_5
) },
8477 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_6
) },
8478 { PREFIX_TABLE (PREFIX_0F01_REG_1_RM_7
) },
8482 { "xgetbv", { Skip_MODRM
}, 0 },
8483 { "xsetbv", { Skip_MODRM
}, 0 },
8486 { "vmfunc", { Skip_MODRM
}, 0 },
8487 { "xend", { Skip_MODRM
}, 0 },
8488 { "xtest", { Skip_MODRM
}, 0 },
8489 { "enclu", { Skip_MODRM
}, 0 },
8493 { "vmrun", { Skip_MODRM
}, 0 },
8494 { PREFIX_TABLE (PREFIX_0F01_REG_3_RM_1
) },
8495 { "vmload", { Skip_MODRM
}, 0 },
8496 { "vmsave", { Skip_MODRM
}, 0 },
8497 { "stgi", { Skip_MODRM
}, 0 },
8498 { "clgi", { Skip_MODRM
}, 0 },
8499 { "skinit", { Skip_MODRM
}, 0 },
8500 { "invlpga", { Skip_MODRM
}, 0 },
8503 /* RM_0F01_REG_5_MOD_3 */
8504 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_0
) },
8505 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_1
) },
8506 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_2
) },
8508 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_4
) },
8509 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_5
) },
8510 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_6
) },
8511 { PREFIX_TABLE (PREFIX_0F01_REG_5_MOD_3_RM_7
) },
8514 /* RM_0F01_REG_7_MOD_3 */
8515 { "swapgs", { Skip_MODRM
}, 0 },
8516 { "rdtscp", { Skip_MODRM
}, 0 },
8517 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_2
) },
8518 { "mwaitx", { { OP_Mwait
, eBX_reg
} }, PREFIX_OPCODE
},
8519 { "clzero", { Skip_MODRM
}, 0 },
8520 { "rdpru", { Skip_MODRM
}, 0 },
8521 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_6
) },
8522 { PREFIX_TABLE (PREFIX_0F01_REG_7_MOD_3_RM_7
) },
8525 /* RM_0F1E_P_1_MOD_3_REG_7 */
8526 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8527 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8528 { "endbr64", { Skip_MODRM
}, 0 },
8529 { "endbr32", { Skip_MODRM
}, 0 },
8530 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8531 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8532 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8533 { "nopQ", { Ev
}, PREFIX_IGNORED
},
8536 /* RM_0FAE_REG_6_MOD_3 */
8537 { "mfence", { Skip_MODRM
}, 0 },
8540 /* RM_0FAE_REG_7_MOD_3 */
8541 { "sfence", { Skip_MODRM
}, 0 },
8544 /* RM_0F3A0F_P_1_MOD_3_REG_0 */
8545 { "hreset", { Skip_MODRM
, Ib
}, 0 },
8548 /* RM_VEX_0F3849_X86_64_P_0_W_0_M_1_R_0 */
8549 { VEX_LEN_TABLE (VEX_LEN_0F3849_X86_64_P_0_W_0_M_1_REG_0_RM_0
) },
8553 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
8555 /* The values used here must be non-zero, fit in 'unsigned char', and not be
8556 in conflict with actual prefix opcodes. */
8557 #define REP_PREFIX 0x01
8558 #define XACQUIRE_PREFIX 0x02
8559 #define XRELEASE_PREFIX 0x03
8560 #define BND_PREFIX 0x04
8561 #define NOTRACK_PREFIX 0x05
8564 ckprefix (instr_info
*ins
)
8566 int newrex
, i
, length
;
8570 /* The maximum instruction length is 15bytes. */
8571 while (length
< MAX_CODE_LENGTH
- 1)
8573 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
8575 switch (*ins
->codep
)
8577 /* REX prefixes family. */
8594 if (ins
->address_mode
== mode_64bit
)
8595 newrex
= *ins
->codep
;
8598 ins
->last_rex_prefix
= i
;
8601 ins
->prefixes
|= PREFIX_REPZ
;
8602 ins
->last_repz_prefix
= i
;
8605 ins
->prefixes
|= PREFIX_REPNZ
;
8606 ins
->last_repnz_prefix
= i
;
8609 ins
->prefixes
|= PREFIX_LOCK
;
8610 ins
->last_lock_prefix
= i
;
8613 ins
->prefixes
|= PREFIX_CS
;
8614 ins
->last_seg_prefix
= i
;
8615 if (ins
->address_mode
!= mode_64bit
)
8616 ins
->active_seg_prefix
= PREFIX_CS
;
8619 ins
->prefixes
|= PREFIX_SS
;
8620 ins
->last_seg_prefix
= i
;
8621 if (ins
->address_mode
!= mode_64bit
)
8622 ins
->active_seg_prefix
= PREFIX_SS
;
8625 ins
->prefixes
|= PREFIX_DS
;
8626 ins
->last_seg_prefix
= i
;
8627 if (ins
->address_mode
!= mode_64bit
)
8628 ins
->active_seg_prefix
= PREFIX_DS
;
8631 ins
->prefixes
|= PREFIX_ES
;
8632 ins
->last_seg_prefix
= i
;
8633 if (ins
->address_mode
!= mode_64bit
)
8634 ins
->active_seg_prefix
= PREFIX_ES
;
8637 ins
->prefixes
|= PREFIX_FS
;
8638 ins
->last_seg_prefix
= i
;
8639 ins
->active_seg_prefix
= PREFIX_FS
;
8642 ins
->prefixes
|= PREFIX_GS
;
8643 ins
->last_seg_prefix
= i
;
8644 ins
->active_seg_prefix
= PREFIX_GS
;
8647 ins
->prefixes
|= PREFIX_DATA
;
8648 ins
->last_data_prefix
= i
;
8651 ins
->prefixes
|= PREFIX_ADDR
;
8652 ins
->last_addr_prefix
= i
;
8655 /* fwait is really an instruction. If there are prefixes
8656 before the fwait, they belong to the fwait, *not* to the
8657 following instruction. */
8658 ins
->fwait_prefix
= i
;
8659 if (ins
->prefixes
|| ins
->rex
)
8661 ins
->prefixes
|= PREFIX_FWAIT
;
8663 /* This ensures that the previous REX prefixes are noticed
8664 as unused prefixes, as in the return case below. */
8665 ins
->rex_used
= ins
->rex
;
8668 ins
->prefixes
= PREFIX_FWAIT
;
8673 /* Rex is ignored when followed by another prefix. */
8676 ins
->rex_used
= ins
->rex
;
8679 if (*ins
->codep
!= FWAIT_OPCODE
)
8680 ins
->all_prefixes
[i
++] = *ins
->codep
;
8688 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
8692 prefix_name (instr_info
*ins
, int pref
, int sizeflag
)
8694 static const char *rexes
[16] =
8699 "rex.XB", /* 0x43 */
8701 "rex.RB", /* 0x45 */
8702 "rex.RX", /* 0x46 */
8703 "rex.RXB", /* 0x47 */
8705 "rex.WB", /* 0x49 */
8706 "rex.WX", /* 0x4a */
8707 "rex.WXB", /* 0x4b */
8708 "rex.WR", /* 0x4c */
8709 "rex.WRB", /* 0x4d */
8710 "rex.WRX", /* 0x4e */
8711 "rex.WRXB", /* 0x4f */
8716 /* REX prefixes family. */
8733 return rexes
[pref
- 0x40];
8753 return (sizeflag
& DFLAG
) ? "data16" : "data32";
8755 if (ins
->address_mode
== mode_64bit
)
8756 return (sizeflag
& AFLAG
) ? "addr32" : "addr64";
8758 return (sizeflag
& AFLAG
) ? "addr16" : "addr32";
8763 case XACQUIRE_PREFIX
:
8765 case XRELEASE_PREFIX
:
8769 case NOTRACK_PREFIX
:
8777 print_i386_disassembler_options (FILE *stream
)
8779 fprintf (stream
, _("\n\
8780 The following i386/x86-64 specific disassembler options are supported for use\n\
8781 with the -M switch (multiple options should be separated by commas):\n"));
8783 fprintf (stream
, _(" x86-64 Disassemble in 64bit mode\n"));
8784 fprintf (stream
, _(" i386 Disassemble in 32bit mode\n"));
8785 fprintf (stream
, _(" i8086 Disassemble in 16bit mode\n"));
8786 fprintf (stream
, _(" att Display instruction in AT&T syntax\n"));
8787 fprintf (stream
, _(" intel Display instruction in Intel syntax\n"));
8788 fprintf (stream
, _(" att-mnemonic\n"
8789 " Display instruction in AT&T mnemonic\n"));
8790 fprintf (stream
, _(" intel-mnemonic\n"
8791 " Display instruction in Intel mnemonic\n"));
8792 fprintf (stream
, _(" addr64 Assume 64bit address size\n"));
8793 fprintf (stream
, _(" addr32 Assume 32bit address size\n"));
8794 fprintf (stream
, _(" addr16 Assume 16bit address size\n"));
8795 fprintf (stream
, _(" data32 Assume 32bit data size\n"));
8796 fprintf (stream
, _(" data16 Assume 16bit data size\n"));
8797 fprintf (stream
, _(" suffix Always display instruction suffix in AT&T syntax\n"));
8798 fprintf (stream
, _(" amd64 Display instruction in AMD64 ISA\n"));
8799 fprintf (stream
, _(" intel64 Display instruction in Intel64 ISA\n"));
8803 static const struct dis386 bad_opcode
= { "(bad)", { XX
}, 0 };
8805 /* Get a pointer to struct dis386 with a valid name. */
8807 static const struct dis386
*
8808 get_valid_dis386 (const struct dis386
*dp
, instr_info
*ins
)
8810 int vindex
, vex_table_index
;
8812 if (dp
->name
!= NULL
)
8815 switch (dp
->op
[0].bytemode
)
8818 dp
= ®_table
[dp
->op
[1].bytemode
][ins
->modrm
.reg
];
8822 vindex
= ins
->modrm
.mod
== 0x3 ? 1 : 0;
8823 dp
= &mod_table
[dp
->op
[1].bytemode
][vindex
];
8827 dp
= &rm_table
[dp
->op
[1].bytemode
][ins
->modrm
.rm
];
8830 case USE_PREFIX_TABLE
:
8833 /* The prefix in VEX is implicit. */
8834 switch (ins
->vex
.prefix
)
8839 case REPE_PREFIX_OPCODE
:
8842 case DATA_PREFIX_OPCODE
:
8845 case REPNE_PREFIX_OPCODE
:
8855 int last_prefix
= -1;
8858 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
8859 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
8861 if ((ins
->prefixes
& (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
8863 if (ins
->last_repz_prefix
> ins
->last_repnz_prefix
)
8866 prefix
= PREFIX_REPZ
;
8867 last_prefix
= ins
->last_repz_prefix
;
8872 prefix
= PREFIX_REPNZ
;
8873 last_prefix
= ins
->last_repnz_prefix
;
8876 /* Check if prefix should be ignored. */
8877 if ((((prefix_table
[dp
->op
[1].bytemode
][vindex
].prefix_requirement
8878 & PREFIX_IGNORED
) >> PREFIX_IGNORED_SHIFT
)
8880 && !prefix_table
[dp
->op
[1].bytemode
][vindex
].name
)
8884 if (vindex
== 0 && (ins
->prefixes
& PREFIX_DATA
) != 0)
8887 prefix
= PREFIX_DATA
;
8888 last_prefix
= ins
->last_data_prefix
;
8893 ins
->used_prefixes
|= prefix
;
8894 ins
->all_prefixes
[last_prefix
] = 0;
8897 dp
= &prefix_table
[dp
->op
[1].bytemode
][vindex
];
8900 case USE_X86_64_TABLE
:
8901 vindex
= ins
->address_mode
== mode_64bit
? 1 : 0;
8902 dp
= &x86_64_table
[dp
->op
[1].bytemode
][vindex
];
8905 case USE_3BYTE_TABLE
:
8906 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
8907 vindex
= *ins
->codep
++;
8908 dp
= &three_byte_table
[dp
->op
[1].bytemode
][vindex
];
8909 ins
->end_codep
= ins
->codep
;
8910 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
8911 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
8912 ins
->modrm
.rm
= *ins
->codep
& 7;
8915 case USE_VEX_LEN_TABLE
:
8919 switch (ins
->vex
.length
)
8925 /* This allows re-using in particular table entries where only
8926 128-bit operand size (VEX.L=0 / EVEX.L'L=0) are valid. */
8939 dp
= &vex_len_table
[dp
->op
[1].bytemode
][vindex
];
8942 case USE_EVEX_LEN_TABLE
:
8946 switch (ins
->vex
.length
)
8962 dp
= &evex_len_table
[dp
->op
[1].bytemode
][vindex
];
8965 case USE_XOP_8F_TABLE
:
8966 FETCH_DATA (ins
->info
, ins
->codep
+ 3);
8967 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
8969 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
8970 switch ((*ins
->codep
& 0x1f))
8976 vex_table_index
= XOP_08
;
8979 vex_table_index
= XOP_09
;
8982 vex_table_index
= XOP_0A
;
8986 ins
->vex
.w
= *ins
->codep
& 0x80;
8987 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
8990 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
8991 if (ins
->address_mode
!= mode_64bit
)
8993 /* In 16/32-bit mode REX_B is silently ignored. */
8997 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
8998 switch ((*ins
->codep
& 0x3))
9003 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9006 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9009 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9012 ins
->need_vex
= true;
9014 vindex
= *ins
->codep
++;
9015 dp
= &xop_table
[vex_table_index
][vindex
];
9017 ins
->end_codep
= ins
->codep
;
9018 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9019 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9020 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9021 ins
->modrm
.rm
= *ins
->codep
& 7;
9023 /* No XOP encoding so far allows for a non-zero embedded prefix. Avoid
9024 having to decode the bits for every otherwise valid encoding. */
9025 if (ins
->vex
.prefix
)
9029 case USE_VEX_C4_TABLE
:
9031 FETCH_DATA (ins
->info
, ins
->codep
+ 3);
9032 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9033 switch ((*ins
->codep
& 0x1f))
9039 vex_table_index
= VEX_0F
;
9042 vex_table_index
= VEX_0F38
;
9045 vex_table_index
= VEX_0F3A
;
9049 ins
->vex
.w
= *ins
->codep
& 0x80;
9050 if (ins
->address_mode
== mode_64bit
)
9057 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
9058 is ignored, other REX bits are 0 and the highest bit in
9059 VEX.vvvv is also ignored (but we mustn't clear it here). */
9062 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9063 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9064 switch ((*ins
->codep
& 0x3))
9069 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9072 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9075 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9078 ins
->need_vex
= true;
9080 vindex
= *ins
->codep
++;
9081 dp
= &vex_table
[vex_table_index
][vindex
];
9082 ins
->end_codep
= ins
->codep
;
9083 /* There is no MODRM byte for VEX0F 77. */
9084 if (vex_table_index
!= VEX_0F
|| vindex
!= 0x77)
9086 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9087 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9088 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9089 ins
->modrm
.rm
= *ins
->codep
& 7;
9093 case USE_VEX_C5_TABLE
:
9095 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
9096 ins
->rex
= (*ins
->codep
& 0x80) ? 0 : REX_R
;
9098 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
9100 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9101 ins
->vex
.length
= (*ins
->codep
& 0x4) ? 256 : 128;
9102 switch ((*ins
->codep
& 0x3))
9107 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9110 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9113 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9116 ins
->need_vex
= true;
9118 vindex
= *ins
->codep
++;
9119 dp
= &vex_table
[dp
->op
[1].bytemode
][vindex
];
9120 ins
->end_codep
= ins
->codep
;
9121 /* There is no MODRM byte for VEX 77. */
9124 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9125 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9126 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9127 ins
->modrm
.rm
= *ins
->codep
& 7;
9131 case USE_VEX_W_TABLE
:
9135 dp
= &vex_w_table
[dp
->op
[1].bytemode
][ins
->vex
.w
];
9138 case USE_EVEX_TABLE
:
9139 ins
->two_source_ops
= false;
9141 ins
->vex
.evex
= true;
9142 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
9143 /* The first byte after 0x62. */
9144 ins
->rex
= ~(*ins
->codep
>> 5) & 0x7;
9145 ins
->vex
.r
= *ins
->codep
& 0x10;
9146 switch ((*ins
->codep
& 0xf))
9151 vex_table_index
= EVEX_0F
;
9154 vex_table_index
= EVEX_0F38
;
9157 vex_table_index
= EVEX_0F3A
;
9160 vex_table_index
= EVEX_MAP5
;
9163 vex_table_index
= EVEX_MAP6
;
9167 /* The second byte after 0x62. */
9169 ins
->vex
.w
= *ins
->codep
& 0x80;
9170 if (ins
->vex
.w
&& ins
->address_mode
== mode_64bit
)
9173 ins
->vex
.register_specifier
= (~(*ins
->codep
>> 3)) & 0xf;
9176 if (!(*ins
->codep
& 0x4))
9179 switch ((*ins
->codep
& 0x3))
9184 ins
->vex
.prefix
= DATA_PREFIX_OPCODE
;
9187 ins
->vex
.prefix
= REPE_PREFIX_OPCODE
;
9190 ins
->vex
.prefix
= REPNE_PREFIX_OPCODE
;
9194 /* The third byte after 0x62. */
9197 /* Remember the static rounding bits. */
9198 ins
->vex
.ll
= (*ins
->codep
>> 5) & 3;
9199 ins
->vex
.b
= *ins
->codep
& 0x10;
9201 ins
->vex
.v
= *ins
->codep
& 0x8;
9202 ins
->vex
.mask_register_specifier
= *ins
->codep
& 0x7;
9203 ins
->vex
.zeroing
= *ins
->codep
& 0x80;
9205 if (ins
->address_mode
!= mode_64bit
)
9207 /* In 16/32-bit mode silently ignore following bits. */
9212 ins
->need_vex
= true;
9214 vindex
= *ins
->codep
++;
9215 dp
= &evex_table
[vex_table_index
][vindex
];
9216 ins
->end_codep
= ins
->codep
;
9217 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
9218 ins
->modrm
.mod
= (*ins
->codep
>> 6) & 3;
9219 ins
->modrm
.reg
= (*ins
->codep
>> 3) & 7;
9220 ins
->modrm
.rm
= *ins
->codep
& 7;
9222 /* Set vector length. */
9223 if (ins
->modrm
.mod
== 3 && ins
->vex
.b
)
9224 ins
->vex
.length
= 512;
9227 switch (ins
->vex
.ll
)
9230 ins
->vex
.length
= 128;
9233 ins
->vex
.length
= 256;
9236 ins
->vex
.length
= 512;
9252 if (dp
->name
!= NULL
)
9255 return get_valid_dis386 (dp
, ins
);
9259 get_sib (instr_info
*ins
, int sizeflag
)
9261 /* If modrm.mod == 3, operand must be register. */
9263 && ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
9264 && ins
->modrm
.mod
!= 3
9265 && ins
->modrm
.rm
== 4)
9267 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
9268 ins
->sib
.index
= (ins
->codep
[1] >> 3) & 7;
9269 ins
->sib
.scale
= (ins
->codep
[1] >> 6) & 3;
9270 ins
->sib
.base
= ins
->codep
[1] & 7;
9271 ins
->has_sib
= true;
9274 ins
->has_sib
= false;
9277 /* Like oappend (below), but S is a string starting with '%'. In
9278 Intel syntax, the '%' is elided. */
9281 oappend_register (instr_info
*ins
, const char *s
)
9283 oappend_with_style (ins
, s
+ ins
->intel_syntax
, dis_style_register
);
9286 /* Wrap around a call to INS->info->fprintf_styled_func, printing FMT.
9287 STYLE is the default style to use in the fprintf_styled_func calls,
9288 however, FMT might include embedded style markers (see oappend_style),
9289 these embedded markers are not printed, but instead change the style
9290 used in the next fprintf_styled_func call. */
9292 static void ATTRIBUTE_PRINTF_3
9293 i386_dis_printf (instr_info
*ins
, enum disassembler_style style
,
9294 const char *fmt
, ...)
9297 enum disassembler_style curr_style
= style
;
9298 const char *start
, *curr
;
9299 char staging_area
[40];
9302 /* In particular print_insn()'s processing of op_txt[] can hand rather long
9303 strings here. Bypass vsnprintf() in such cases to avoid capacity issues
9304 with the staging area. */
9305 if (strcmp (fmt
, "%s"))
9307 int res
= vsnprintf (staging_area
, sizeof (staging_area
), fmt
, ap
);
9314 if ((size_t) res
>= sizeof (staging_area
))
9317 start
= curr
= staging_area
;
9321 start
= curr
= va_arg (ap
, const char *);
9328 || (*curr
== STYLE_MARKER_CHAR
9329 && ISXDIGIT (*(curr
+ 1))
9330 && *(curr
+ 2) == STYLE_MARKER_CHAR
))
9332 /* Output content between our START position and CURR. */
9333 int len
= curr
- start
;
9334 int n
= (*ins
->info
->fprintf_styled_func
) (ins
->info
->stream
,
9336 "%.*s", len
, start
);
9343 /* Skip over the initial STYLE_MARKER_CHAR. */
9346 /* Update the CURR_STYLE. As there are less than 16 styles, it
9347 is possible, that if the input is corrupted in some way, that
9348 we might set CURR_STYLE to an invalid value. Don't worry
9349 though, we check for this situation. */
9350 if (*curr
>= '0' && *curr
<= '9')
9351 curr_style
= (enum disassembler_style
) (*curr
- '0');
9352 else if (*curr
>= 'a' && *curr
<= 'f')
9353 curr_style
= (enum disassembler_style
) (*curr
- 'a' + 10);
9355 curr_style
= dis_style_text
;
9357 /* Check for an invalid style having been selected. This should
9358 never happen, but it doesn't hurt to be a little paranoid. */
9359 if (curr_style
> dis_style_comment_start
)
9360 curr_style
= dis_style_text
;
9362 /* Skip the hex character, and the closing STYLE_MARKER_CHAR. */
9365 /* Reset the START to after the style marker. */
9375 print_insn (bfd_vma pc
, disassemble_info
*info
, int intel_syntax
)
9377 const struct dis386
*dp
;
9379 char *op_txt
[MAX_OPERANDS
];
9381 bool intel_swap_2_3
;
9382 int sizeflag
, orig_sizeflag
;
9384 struct dis_private priv
;
9389 .intel_syntax
= intel_syntax
>= 0
9391 : (info
->mach
& bfd_mach_i386_intel_syntax
) != 0,
9392 .intel_mnemonic
= !SYSV386_COMPAT
,
9393 .op_index
[0 ... MAX_OPERANDS
- 1] = -1,
9395 .start_codep
= priv
.the_buffer
,
9396 .codep
= priv
.the_buffer
,
9398 .last_lock_prefix
= -1,
9399 .last_repz_prefix
= -1,
9400 .last_repnz_prefix
= -1,
9401 .last_data_prefix
= -1,
9402 .last_addr_prefix
= -1,
9403 .last_rex_prefix
= -1,
9404 .last_seg_prefix
= -1,
9407 char op_out
[MAX_OPERANDS
][MAX_OPERAND_BUFFER_SIZE
];
9409 priv
.orig_sizeflag
= AFLAG
| DFLAG
;
9410 if ((info
->mach
& bfd_mach_i386_i386
) != 0)
9411 ins
.address_mode
= mode_32bit
;
9412 else if (info
->mach
== bfd_mach_i386_i8086
)
9414 ins
.address_mode
= mode_16bit
;
9415 priv
.orig_sizeflag
= 0;
9418 ins
.address_mode
= mode_64bit
;
9420 for (p
= info
->disassembler_options
; p
!= NULL
;)
9422 if (startswith (p
, "amd64"))
9424 else if (startswith (p
, "intel64"))
9425 ins
.isa64
= intel64
;
9426 else if (startswith (p
, "x86-64"))
9428 ins
.address_mode
= mode_64bit
;
9429 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9431 else if (startswith (p
, "i386"))
9433 ins
.address_mode
= mode_32bit
;
9434 priv
.orig_sizeflag
|= AFLAG
| DFLAG
;
9436 else if (startswith (p
, "i8086"))
9438 ins
.address_mode
= mode_16bit
;
9439 priv
.orig_sizeflag
&= ~(AFLAG
| DFLAG
);
9441 else if (startswith (p
, "intel"))
9443 ins
.intel_syntax
= 1;
9444 if (startswith (p
+ 5, "-mnemonic"))
9445 ins
.intel_mnemonic
= true;
9447 else if (startswith (p
, "att"))
9449 ins
.intel_syntax
= 0;
9450 if (startswith (p
+ 3, "-mnemonic"))
9451 ins
.intel_mnemonic
= false;
9453 else if (startswith (p
, "addr"))
9455 if (ins
.address_mode
== mode_64bit
)
9457 if (p
[4] == '3' && p
[5] == '2')
9458 priv
.orig_sizeflag
&= ~AFLAG
;
9459 else if (p
[4] == '6' && p
[5] == '4')
9460 priv
.orig_sizeflag
|= AFLAG
;
9464 if (p
[4] == '1' && p
[5] == '6')
9465 priv
.orig_sizeflag
&= ~AFLAG
;
9466 else if (p
[4] == '3' && p
[5] == '2')
9467 priv
.orig_sizeflag
|= AFLAG
;
9470 else if (startswith (p
, "data"))
9472 if (p
[4] == '1' && p
[5] == '6')
9473 priv
.orig_sizeflag
&= ~DFLAG
;
9474 else if (p
[4] == '3' && p
[5] == '2')
9475 priv
.orig_sizeflag
|= DFLAG
;
9477 else if (startswith (p
, "suffix"))
9478 priv
.orig_sizeflag
|= SUFFIX_ALWAYS
;
9480 p
= strchr (p
, ',');
9485 if (ins
.address_mode
== mode_64bit
&& sizeof (bfd_vma
) < 8)
9487 i386_dis_printf (&ins
, dis_style_text
, _("64-bit address is disabled"));
9491 if (ins
.intel_syntax
)
9493 ins
.open_char
= '[';
9494 ins
.close_char
= ']';
9495 ins
.separator_char
= '+';
9496 ins
.scale_char
= '*';
9500 ins
.open_char
= '(';
9501 ins
.close_char
= ')';
9502 ins
.separator_char
= ',';
9503 ins
.scale_char
= ',';
9506 /* The output looks better if we put 7 bytes on a line, since that
9507 puts most long word instructions on a single line. */
9508 info
->bytes_per_line
= 7;
9510 info
->private_data
= &priv
;
9511 priv
.max_fetched
= priv
.the_buffer
;
9512 priv
.insn_start
= pc
;
9514 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9517 ins
.op_out
[i
] = op_out
[i
];
9520 if (OPCODES_SIGSETJMP (priv
.bailout
) != 0)
9522 /* Getting here means we tried for data but didn't get it. That
9523 means we have an incomplete instruction of some sort. Just
9524 print the first byte as a prefix or a .byte pseudo-op. */
9525 if (ins
.codep
> priv
.the_buffer
)
9527 const char *name
= NULL
;
9529 if (ins
.prefixes
|| ins
.fwait_prefix
>= 0 || (ins
.rex
& REX_OPCODE
))
9530 name
= prefix_name (&ins
, priv
.the_buffer
[0], priv
.orig_sizeflag
);
9532 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s", name
);
9535 /* Just print the first byte as a .byte instruction. */
9536 i386_dis_printf (&ins
, dis_style_assembler_directive
,
9538 i386_dis_printf (&ins
, dis_style_immediate
, "0x%x",
9539 (unsigned int) priv
.the_buffer
[0]);
9548 sizeflag
= priv
.orig_sizeflag
;
9550 if (!ckprefix (&ins
) || ins
.rex_used
)
9552 /* Too many prefixes or unused REX prefixes. */
9554 i
< (int) ARRAY_SIZE (ins
.all_prefixes
) && ins
.all_prefixes
[i
];
9556 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s%s",
9557 (i
== 0 ? "" : " "),
9558 prefix_name (&ins
, ins
.all_prefixes
[i
], sizeflag
));
9562 ins
.insn_codep
= ins
.codep
;
9564 FETCH_DATA (info
, ins
.codep
+ 1);
9565 ins
.two_source_ops
= (*ins
.codep
== 0x62) || (*ins
.codep
== 0xc8);
9567 if (((ins
.prefixes
& PREFIX_FWAIT
)
9568 && ((*ins
.codep
< 0xd8) || (*ins
.codep
> 0xdf))))
9570 /* Handle ins.prefixes before fwait. */
9571 for (i
= 0; i
< ins
.fwait_prefix
&& ins
.all_prefixes
[i
];
9573 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s ",
9574 prefix_name (&ins
, ins
.all_prefixes
[i
], sizeflag
));
9575 i386_dis_printf (&ins
, dis_style_mnemonic
, "fwait");
9579 if (*ins
.codep
== 0x0f)
9581 unsigned char threebyte
;
9584 FETCH_DATA (info
, ins
.codep
+ 1);
9585 threebyte
= *ins
.codep
;
9586 dp
= &dis386_twobyte
[threebyte
];
9587 ins
.need_modrm
= twobyte_has_modrm
[threebyte
];
9592 dp
= &dis386
[*ins
.codep
];
9593 ins
.need_modrm
= onebyte_has_modrm
[*ins
.codep
];
9597 /* Save sizeflag for printing the extra ins.prefixes later before updating
9598 it for mnemonic and operand processing. The prefix names depend
9599 only on the address mode. */
9600 orig_sizeflag
= sizeflag
;
9601 if (ins
.prefixes
& PREFIX_ADDR
)
9603 if ((ins
.prefixes
& PREFIX_DATA
))
9606 ins
.end_codep
= ins
.codep
;
9609 FETCH_DATA (info
, ins
.codep
+ 1);
9610 ins
.modrm
.mod
= (*ins
.codep
>> 6) & 3;
9611 ins
.modrm
.reg
= (*ins
.codep
>> 3) & 7;
9612 ins
.modrm
.rm
= *ins
.codep
& 7;
9615 if (dp
->name
== NULL
&& dp
->op
[0].bytemode
== FLOATCODE
)
9617 get_sib (&ins
, sizeflag
);
9618 dofloat (&ins
, sizeflag
);
9622 dp
= get_valid_dis386 (dp
, &ins
);
9623 if (dp
!= NULL
&& putop (&ins
, dp
->name
, sizeflag
) == 0)
9625 get_sib (&ins
, sizeflag
);
9626 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9628 ins
.obufp
= ins
.op_out
[i
];
9629 ins
.op_ad
= MAX_OPERANDS
- 1 - i
;
9631 (*dp
->op
[i
].rtn
) (&ins
, dp
->op
[i
].bytemode
, sizeflag
);
9632 /* For EVEX instruction after the last operand masking
9633 should be printed. */
9634 if (i
== 0 && ins
.vex
.evex
)
9636 /* Don't print {%k0}. */
9637 if (ins
.vex
.mask_register_specifier
)
9639 const char *reg_name
9640 = att_names_mask
[ins
.vex
.mask_register_specifier
];
9642 oappend (&ins
, "{");
9643 oappend_register (&ins
, reg_name
);
9644 oappend (&ins
, "}");
9646 if (ins
.vex
.zeroing
)
9647 oappend (&ins
, "{z}");
9649 /* S/G insns require a mask and don't allow
9651 if ((dp
->op
[0].bytemode
== vex_vsib_d_w_dq_mode
9652 || dp
->op
[0].bytemode
== vex_vsib_q_w_dq_mode
)
9653 && (ins
.vex
.mask_register_specifier
== 0
9654 || ins
.vex
.zeroing
))
9655 oappend (&ins
, "/(bad)");
9659 /* Check whether rounding control was enabled for an insn not
9661 if (ins
.modrm
.mod
== 3 && ins
.vex
.b
9662 && !(ins
.evex_used
& EVEX_b_used
))
9664 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9666 ins
.obufp
= ins
.op_out
[i
];
9669 oappend (&ins
, names_rounding
[ins
.vex
.ll
]);
9670 oappend (&ins
, "bad}");
9677 /* Clear instruction information. */
9678 info
->insn_info_valid
= 0;
9679 info
->branch_delay_insns
= 0;
9680 info
->data_size
= 0;
9681 info
->insn_type
= dis_noninsn
;
9685 /* Reset jump operation indicator. */
9686 ins
.op_is_jump
= false;
9688 int jump_detection
= 0;
9690 /* Extract flags. */
9691 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9693 if ((dp
->op
[i
].rtn
== OP_J
)
9694 || (dp
->op
[i
].rtn
== OP_indirE
))
9695 jump_detection
|= 1;
9696 else if ((dp
->op
[i
].rtn
== BND_Fixup
)
9697 || (!dp
->op
[i
].rtn
&& !dp
->op
[i
].bytemode
))
9698 jump_detection
|= 2;
9699 else if ((dp
->op
[i
].bytemode
== cond_jump_mode
)
9700 || (dp
->op
[i
].bytemode
== loop_jcxz_mode
))
9701 jump_detection
|= 4;
9704 /* Determine if this is a jump or branch. */
9705 if ((jump_detection
& 0x3) == 0x3)
9707 ins
.op_is_jump
= true;
9708 if (jump_detection
& 0x4)
9709 info
->insn_type
= dis_condbranch
;
9711 info
->insn_type
= (dp
->name
&& !strncmp (dp
->name
, "call", 4))
9712 ? dis_jsr
: dis_branch
;
9716 /* If VEX.vvvv and EVEX.vvvv are unused, they must be all 1s, which
9717 are all 0s in inverted form. */
9718 if (ins
.need_vex
&& ins
.vex
.register_specifier
!= 0)
9720 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
9721 return ins
.end_codep
- priv
.the_buffer
;
9724 /* If EVEX.z is set, there must be an actual mask register in use. */
9725 if (ins
.vex
.zeroing
&& ins
.vex
.mask_register_specifier
== 0)
9727 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
9728 return ins
.end_codep
- priv
.the_buffer
;
9731 switch (dp
->prefix_requirement
)
9734 /* If only the data prefix is marked as mandatory, its absence renders
9735 the encoding invalid. Most other PREFIX_OPCODE rules still apply. */
9736 if (ins
.need_vex
? !ins
.vex
.prefix
: !(ins
.prefixes
& PREFIX_DATA
))
9738 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
9739 return ins
.end_codep
- priv
.the_buffer
;
9741 ins
.used_prefixes
|= PREFIX_DATA
;
9744 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
9745 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
9746 used by putop and MMX/SSE operand and may be overridden by the
9747 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
9750 ? ins
.vex
.prefix
== REPE_PREFIX_OPCODE
9751 || ins
.vex
.prefix
== REPNE_PREFIX_OPCODE
9753 & (PREFIX_REPZ
| PREFIX_REPNZ
)) != 0)
9754 && (ins
.used_prefixes
9755 & (PREFIX_REPZ
| PREFIX_REPNZ
)) == 0)
9757 ? ins
.vex
.prefix
== DATA_PREFIX_OPCODE
9759 & (PREFIX_REPZ
| PREFIX_REPNZ
| PREFIX_DATA
))
9761 && (ins
.used_prefixes
& PREFIX_DATA
) == 0))
9762 || (ins
.vex
.evex
&& dp
->prefix_requirement
!= PREFIX_DATA
9763 && !ins
.vex
.w
!= !(ins
.used_prefixes
& PREFIX_DATA
)))
9765 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
9766 return ins
.end_codep
- priv
.the_buffer
;
9770 case PREFIX_IGNORED
:
9771 /* Zap data size and rep prefixes from used_prefixes and reinstate their
9772 origins in all_prefixes. */
9773 ins
.used_prefixes
&= ~PREFIX_OPCODE
;
9774 if (ins
.last_data_prefix
>= 0)
9775 ins
.all_prefixes
[ins
.last_data_prefix
] = 0x66;
9776 if (ins
.last_repz_prefix
>= 0)
9777 ins
.all_prefixes
[ins
.last_repz_prefix
] = 0xf3;
9778 if (ins
.last_repnz_prefix
>= 0)
9779 ins
.all_prefixes
[ins
.last_repnz_prefix
] = 0xf2;
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 SEG prefix is used. */
9789 if ((ins
.prefixes
& (PREFIX_CS
| PREFIX_SS
| PREFIX_DS
| PREFIX_ES
9790 | PREFIX_FS
| PREFIX_GS
)) != 0
9791 && (ins
.used_prefixes
& ins
.active_seg_prefix
) != 0)
9792 ins
.all_prefixes
[ins
.last_seg_prefix
] = 0;
9794 /* Check if the ADDR prefix is used. */
9795 if ((ins
.prefixes
& PREFIX_ADDR
) != 0
9796 && (ins
.used_prefixes
& PREFIX_ADDR
) != 0)
9797 ins
.all_prefixes
[ins
.last_addr_prefix
] = 0;
9799 /* Check if the DATA prefix is used. */
9800 if ((ins
.prefixes
& PREFIX_DATA
) != 0
9801 && (ins
.used_prefixes
& PREFIX_DATA
) != 0
9803 ins
.all_prefixes
[ins
.last_data_prefix
] = 0;
9805 /* Print the extra ins.prefixes. */
9807 for (i
= 0; i
< (int) ARRAY_SIZE (ins
.all_prefixes
); i
++)
9808 if (ins
.all_prefixes
[i
])
9811 name
= prefix_name (&ins
, ins
.all_prefixes
[i
], orig_sizeflag
);
9814 prefix_length
+= strlen (name
) + 1;
9815 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s ", name
);
9818 /* Check maximum code length. */
9819 if ((ins
.codep
- ins
.start_codep
) > MAX_CODE_LENGTH
)
9821 i386_dis_printf (&ins
, dis_style_text
, "(bad)");
9822 return MAX_CODE_LENGTH
;
9825 /* Calculate the number of operands this instruction has. */
9827 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9828 if (*ins
.op_out
[i
] != '\0')
9831 /* Calculate the number of spaces to print after the mnemonic. */
9832 ins
.obufp
= ins
.mnemonicendp
;
9835 i
= strlen (ins
.obuf
) + prefix_length
;
9844 /* Print the instruction mnemonic along with any trailing whitespace. */
9845 i386_dis_printf (&ins
, dis_style_mnemonic
, "%s%*s", ins
.obuf
, i
, "");
9847 /* The enter and bound instructions are printed with operands in the same
9848 order as the intel book; everything else is printed in reverse order. */
9849 intel_swap_2_3
= false;
9850 if (ins
.intel_syntax
|| ins
.two_source_ops
)
9852 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9853 op_txt
[i
] = ins
.op_out
[i
];
9855 if (ins
.intel_syntax
&& dp
&& dp
->op
[2].rtn
== OP_Rounding
9856 && dp
->op
[3].rtn
== OP_E
&& dp
->op
[4].rtn
== NULL
)
9858 op_txt
[2] = ins
.op_out
[3];
9859 op_txt
[3] = ins
.op_out
[2];
9860 intel_swap_2_3
= true;
9863 for (i
= 0; i
< (MAX_OPERANDS
>> 1); ++i
)
9867 ins
.op_ad
= ins
.op_index
[i
];
9868 ins
.op_index
[i
] = ins
.op_index
[MAX_OPERANDS
- 1 - i
];
9869 ins
.op_index
[MAX_OPERANDS
- 1 - i
] = ins
.op_ad
;
9870 riprel
= ins
.op_riprel
[i
];
9871 ins
.op_riprel
[i
] = ins
.op_riprel
[MAX_OPERANDS
- 1 - i
];
9872 ins
.op_riprel
[MAX_OPERANDS
- 1 - i
] = riprel
;
9877 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9878 op_txt
[MAX_OPERANDS
- 1 - i
] = ins
.op_out
[i
];
9882 for (i
= 0; i
< MAX_OPERANDS
; ++i
)
9885 /* In Intel syntax embedded rounding / SAE are not separate operands.
9886 Instead they're attached to the prior register operand. Simply
9887 suppress emission of the comma to achieve that effect. */
9888 switch (i
& -(ins
.intel_syntax
&& dp
))
9891 if (dp
->op
[2].rtn
== OP_Rounding
&& !intel_swap_2_3
)
9895 if (dp
->op
[3].rtn
== OP_Rounding
|| intel_swap_2_3
)
9900 i386_dis_printf (&ins
, dis_style_text
, ",");
9901 if (ins
.op_index
[i
] != -1 && !ins
.op_riprel
[i
])
9903 bfd_vma target
= (bfd_vma
) ins
.op_address
[ins
.op_index
[i
]];
9907 info
->insn_info_valid
= 1;
9908 info
->branch_delay_insns
= 0;
9909 info
->data_size
= 0;
9910 info
->target
= target
;
9913 (*info
->print_address_func
) (target
, info
);
9916 i386_dis_printf (&ins
, dis_style_text
, "%s", op_txt
[i
]);
9920 for (i
= 0; i
< MAX_OPERANDS
; i
++)
9921 if (ins
.op_index
[i
] != -1 && ins
.op_riprel
[i
])
9923 i386_dis_printf (&ins
, dis_style_comment_start
, " # ");
9924 (*info
->print_address_func
)
9925 ((bfd_vma
)(ins
.start_pc
+ (ins
.codep
- ins
.start_codep
)
9926 + ins
.op_address
[ins
.op_index
[i
]]),
9930 return ins
.codep
- priv
.the_buffer
;
9933 /* Here for backwards compatibility. When gdb stops using
9934 print_insn_i386_att and print_insn_i386_intel these functions can
9935 disappear, and print_insn_i386 be merged into print_insn. */
9937 print_insn_i386_att (bfd_vma pc
, disassemble_info
*info
)
9939 return print_insn (pc
, info
, 0);
9943 print_insn_i386_intel (bfd_vma pc
, disassemble_info
*info
)
9945 return print_insn (pc
, info
, 1);
9949 print_insn_i386 (bfd_vma pc
, disassemble_info
*info
)
9951 return print_insn (pc
, info
, -1);
9954 static const char *float_mem
[] = {
10029 static const unsigned char float_mem_mode
[] = {
10104 #define ST { OP_ST, 0 }
10105 #define STi { OP_STi, 0 }
10107 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
10108 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
10109 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
10110 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
10111 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
10112 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
10113 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
10114 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
10115 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
10117 static const struct dis386 float_reg
[][8] = {
10120 { "fadd", { ST
, STi
}, 0 },
10121 { "fmul", { ST
, STi
}, 0 },
10122 { "fcom", { STi
}, 0 },
10123 { "fcomp", { STi
}, 0 },
10124 { "fsub", { ST
, STi
}, 0 },
10125 { "fsubr", { ST
, STi
}, 0 },
10126 { "fdiv", { ST
, STi
}, 0 },
10127 { "fdivr", { ST
, STi
}, 0 },
10131 { "fld", { STi
}, 0 },
10132 { "fxch", { STi
}, 0 },
10142 { "fcmovb", { ST
, STi
}, 0 },
10143 { "fcmove", { ST
, STi
}, 0 },
10144 { "fcmovbe",{ ST
, STi
}, 0 },
10145 { "fcmovu", { ST
, STi
}, 0 },
10153 { "fcmovnb",{ ST
, STi
}, 0 },
10154 { "fcmovne",{ ST
, STi
}, 0 },
10155 { "fcmovnbe",{ ST
, STi
}, 0 },
10156 { "fcmovnu",{ ST
, STi
}, 0 },
10158 { "fucomi", { ST
, STi
}, 0 },
10159 { "fcomi", { ST
, STi
}, 0 },
10164 { "fadd", { STi
, ST
}, 0 },
10165 { "fmul", { STi
, ST
}, 0 },
10168 { "fsub{!M|r}", { STi
, ST
}, 0 },
10169 { "fsub{M|}", { STi
, ST
}, 0 },
10170 { "fdiv{!M|r}", { STi
, ST
}, 0 },
10171 { "fdiv{M|}", { STi
, ST
}, 0 },
10175 { "ffree", { STi
}, 0 },
10177 { "fst", { STi
}, 0 },
10178 { "fstp", { STi
}, 0 },
10179 { "fucom", { STi
}, 0 },
10180 { "fucomp", { STi
}, 0 },
10186 { "faddp", { STi
, ST
}, 0 },
10187 { "fmulp", { STi
, ST
}, 0 },
10190 { "fsub{!M|r}p", { STi
, ST
}, 0 },
10191 { "fsub{M|}p", { STi
, ST
}, 0 },
10192 { "fdiv{!M|r}p", { STi
, ST
}, 0 },
10193 { "fdiv{M|}p", { STi
, ST
}, 0 },
10197 { "ffreep", { STi
}, 0 },
10202 { "fucomip", { ST
, STi
}, 0 },
10203 { "fcomip", { ST
, STi
}, 0 },
10208 static const char *const fgrps
[][8] = {
10211 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10216 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10221 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
10226 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
10231 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
10236 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
10241 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10246 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
10247 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
10252 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10257 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
10262 swap_operand (instr_info
*ins
)
10264 ins
->mnemonicendp
[0] = '.';
10265 ins
->mnemonicendp
[1] = 's';
10266 ins
->mnemonicendp
[2] = '\0';
10267 ins
->mnemonicendp
+= 2;
10271 OP_Skip_MODRM (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10272 int sizeflag ATTRIBUTE_UNUSED
)
10274 /* Skip mod/rm byte. */
10280 dofloat (instr_info
*ins
, int sizeflag
)
10282 const struct dis386
*dp
;
10283 unsigned char floatop
;
10285 floatop
= ins
->codep
[-1];
10287 if (ins
->modrm
.mod
!= 3)
10289 int fp_indx
= (floatop
- 0xd8) * 8 + ins
->modrm
.reg
;
10291 putop (ins
, float_mem
[fp_indx
], sizeflag
);
10292 ins
->obufp
= ins
->op_out
[0];
10294 OP_E (ins
, float_mem_mode
[fp_indx
], sizeflag
);
10297 /* Skip mod/rm byte. */
10301 dp
= &float_reg
[floatop
- 0xd8][ins
->modrm
.reg
];
10302 if (dp
->name
== NULL
)
10304 putop (ins
, fgrps
[dp
->op
[0].bytemode
][ins
->modrm
.rm
], sizeflag
);
10306 /* Instruction fnstsw is only one with strange arg. */
10307 if (floatop
== 0xdf && ins
->codep
[-1] == 0xe0)
10308 strcpy (ins
->op_out
[0], att_names16
[0] + ins
->intel_syntax
);
10312 putop (ins
, dp
->name
, sizeflag
);
10314 ins
->obufp
= ins
->op_out
[0];
10317 (*dp
->op
[0].rtn
) (ins
, dp
->op
[0].bytemode
, sizeflag
);
10319 ins
->obufp
= ins
->op_out
[1];
10322 (*dp
->op
[1].rtn
) (ins
, dp
->op
[1].bytemode
, sizeflag
);
10327 OP_ST (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10328 int sizeflag ATTRIBUTE_UNUSED
)
10330 oappend_register (ins
, "%st");
10334 OP_STi (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
10335 int sizeflag ATTRIBUTE_UNUSED
)
10338 int res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%st(%d)", ins
->modrm
.rm
);
10340 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
10342 oappend_register (ins
, scratch
);
10345 /* Capital letters in template are macros. */
10347 putop (instr_info
*ins
, const char *in_template
, int sizeflag
)
10352 unsigned int l
= 0, len
= 0;
10355 for (p
= in_template
; *p
; p
++)
10359 if (l
>= sizeof (last
) || !ISUPPER (*p
))
10367 *ins
->obufp
++ = *p
;
10376 if (ins
->intel_syntax
)
10378 while (*++p
!= '|')
10379 if (*p
== '}' || *p
== '\0')
10385 while (*++p
!= '}')
10395 if (ins
->intel_syntax
)
10397 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10398 || (sizeflag
& SUFFIX_ALWAYS
))
10399 *ins
->obufp
++ = 'b';
10405 if (ins
->intel_syntax
)
10407 if (sizeflag
& SUFFIX_ALWAYS
)
10408 *ins
->obufp
++ = 'b';
10410 else if (l
== 1 && last
[0] == 'L')
10412 if (ins
->address_mode
== mode_64bit
10413 && !(ins
->prefixes
& PREFIX_ADDR
))
10415 *ins
->obufp
++ = 'a';
10416 *ins
->obufp
++ = 'b';
10417 *ins
->obufp
++ = 's';
10426 if (ins
->intel_syntax
&& !alt
)
10428 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10430 if (sizeflag
& DFLAG
)
10431 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10433 *ins
->obufp
++ = ins
->intel_syntax
? 'w' : 's';
10434 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10443 if (!ins
->vex
.evex
|| ins
->vex
.w
)
10444 *ins
->obufp
++ = 'd';
10446 oappend (ins
, "{bad}");
10455 if (ins
->intel_syntax
|| !(sizeflag
& SUFFIX_ALWAYS
))
10458 if (ins
->modrm
.mod
== 3)
10460 if (ins
->rex
& REX_W
)
10461 *ins
->obufp
++ = 'q';
10464 if (sizeflag
& DFLAG
)
10465 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10467 *ins
->obufp
++ = 'w';
10468 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10472 *ins
->obufp
++ = 'w';
10480 if (!ins
->vex
.evex
|| ins
->vex
.b
|| ins
->vex
.ll
>= 2
10482 || (ins
->modrm
.mod
== 3 && (ins
->rex
& REX_X
))
10483 || !ins
->vex
.v
|| ins
->vex
.mask_register_specifier
)
10485 /* AVX512 extends a number of V*D insns to also have V*Q variants,
10486 merely distinguished by EVEX.W. Look for a use of the
10487 respective macro. */
10490 const char *pct
= strchr (p
+ 1, '%');
10492 if (pct
!= NULL
&& pct
[1] == 'D' && pct
[2] == 'Q')
10495 *ins
->obufp
++ = '{';
10496 *ins
->obufp
++ = 'e';
10497 *ins
->obufp
++ = 'v';
10498 *ins
->obufp
++ = 'e';
10499 *ins
->obufp
++ = 'x';
10500 *ins
->obufp
++ = '}';
10501 *ins
->obufp
++ = ' ';
10508 /* For jcxz/jecxz */
10509 if (ins
->address_mode
== mode_64bit
)
10511 if (sizeflag
& AFLAG
)
10512 *ins
->obufp
++ = 'r';
10514 *ins
->obufp
++ = 'e';
10517 if (sizeflag
& AFLAG
)
10518 *ins
->obufp
++ = 'e';
10519 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10522 if (ins
->intel_syntax
)
10524 if ((ins
->prefixes
& PREFIX_ADDR
) || (sizeflag
& SUFFIX_ALWAYS
))
10526 if (sizeflag
& AFLAG
)
10527 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10529 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'l' : 'w';
10530 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
10534 if (ins
->intel_syntax
|| (ins
->obufp
[-1] != 's'
10535 && !(sizeflag
& SUFFIX_ALWAYS
)))
10537 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
10538 *ins
->obufp
++ = 'l';
10540 *ins
->obufp
++ = 'w';
10541 if (!(ins
->rex
& REX_W
))
10542 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10547 if (ins
->intel_syntax
)
10549 if ((ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_CS
10550 || (ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
)) == PREFIX_DS
)
10552 ins
->used_prefixes
|= ins
->prefixes
& (PREFIX_CS
| PREFIX_DS
);
10553 *ins
->obufp
++ = ',';
10554 *ins
->obufp
++ = 'p';
10556 /* Set active_seg_prefix even if not set in 64-bit mode
10557 because here it is a valid branch hint. */
10558 if (ins
->prefixes
& PREFIX_DS
)
10560 ins
->active_seg_prefix
= PREFIX_DS
;
10561 *ins
->obufp
++ = 't';
10565 ins
->active_seg_prefix
= PREFIX_CS
;
10566 *ins
->obufp
++ = 'n';
10570 else if (l
== 1 && last
[0] == 'X')
10573 *ins
->obufp
++ = 'h';
10575 oappend (ins
, "{bad}");
10582 if (ins
->rex
& REX_W
)
10583 *ins
->obufp
++ = 'q';
10585 *ins
->obufp
++ = 'd';
10590 if (ins
->intel_mnemonic
!= cond
)
10591 *ins
->obufp
++ = 'r';
10594 if ((ins
->prefixes
& PREFIX_FWAIT
) == 0)
10595 *ins
->obufp
++ = 'n';
10597 ins
->used_prefixes
|= PREFIX_FWAIT
;
10601 if (ins
->rex
& REX_W
)
10602 *ins
->obufp
++ = 'o';
10603 else if (ins
->intel_syntax
&& (sizeflag
& DFLAG
))
10604 *ins
->obufp
++ = 'q';
10606 *ins
->obufp
++ = 'd';
10607 if (!(ins
->rex
& REX_W
))
10608 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10611 if (ins
->address_mode
== mode_64bit
10612 && (ins
->isa64
== intel64
|| (ins
->rex
& REX_W
)
10613 || !(ins
->prefixes
& PREFIX_DATA
)))
10615 if (sizeflag
& SUFFIX_ALWAYS
)
10616 *ins
->obufp
++ = 'q';
10619 /* Fall through. */
10623 if ((ins
->modrm
.mod
== 3 || !cond
)
10624 && !(sizeflag
& SUFFIX_ALWAYS
))
10626 /* Fall through. */
10628 if ((!(ins
->rex
& REX_W
) && (ins
->prefixes
& PREFIX_DATA
))
10629 || ((sizeflag
& SUFFIX_ALWAYS
)
10630 && ins
->address_mode
!= mode_64bit
))
10632 *ins
->obufp
++ = (sizeflag
& DFLAG
)
10633 ? ins
->intel_syntax
? 'd' : 'l' : 'w';
10634 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10636 else if (sizeflag
& SUFFIX_ALWAYS
)
10637 *ins
->obufp
++ = 'q';
10639 else if (l
== 1 && last
[0] == 'L')
10641 if ((ins
->prefixes
& PREFIX_DATA
)
10642 || (ins
->rex
& REX_W
)
10643 || (sizeflag
& SUFFIX_ALWAYS
))
10646 if (ins
->rex
& REX_W
)
10647 *ins
->obufp
++ = 'q';
10650 if (sizeflag
& DFLAG
)
10651 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10653 *ins
->obufp
++ = 'w';
10654 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10664 if (ins
->intel_syntax
&& !alt
)
10667 if ((ins
->need_modrm
&& ins
->modrm
.mod
!= 3)
10668 || (sizeflag
& SUFFIX_ALWAYS
))
10670 if (ins
->rex
& REX_W
)
10671 *ins
->obufp
++ = 'q';
10674 if (sizeflag
& DFLAG
)
10675 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10677 *ins
->obufp
++ = 'w';
10678 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10682 else if (l
== 1 && last
[0] == 'D')
10683 *ins
->obufp
++ = ins
->vex
.w
? 'q' : 'd';
10684 else if (l
== 1 && last
[0] == 'L')
10686 if (cond
? ins
->modrm
.mod
== 3 && !(sizeflag
& SUFFIX_ALWAYS
)
10687 : ins
->address_mode
!= mode_64bit
)
10689 if ((ins
->rex
& REX_W
))
10692 *ins
->obufp
++ = 'q';
10694 else if ((ins
->address_mode
== mode_64bit
&& cond
)
10695 || (sizeflag
& SUFFIX_ALWAYS
))
10696 *ins
->obufp
++ = ins
->intel_syntax
? 'd' : 'l';
10703 if (ins
->rex
& REX_W
)
10704 *ins
->obufp
++ = 'q';
10705 else if (sizeflag
& DFLAG
)
10707 if (ins
->intel_syntax
)
10708 *ins
->obufp
++ = 'd';
10710 *ins
->obufp
++ = 'l';
10713 *ins
->obufp
++ = 'w';
10714 if (ins
->intel_syntax
&& !p
[1]
10715 && ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
)))
10716 *ins
->obufp
++ = 'e';
10717 if (!(ins
->rex
& REX_W
))
10718 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10724 if (ins
->intel_syntax
)
10726 if (sizeflag
& SUFFIX_ALWAYS
)
10728 if (ins
->rex
& REX_W
)
10729 *ins
->obufp
++ = 'q';
10732 if (sizeflag
& DFLAG
)
10733 *ins
->obufp
++ = 'l';
10735 *ins
->obufp
++ = 'w';
10736 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10746 if (ins
->address_mode
== mode_64bit
10747 && !(ins
->prefixes
& PREFIX_ADDR
))
10749 *ins
->obufp
++ = 'a';
10750 *ins
->obufp
++ = 'b';
10751 *ins
->obufp
++ = 's';
10756 if (!ins
->vex
.evex
|| !ins
->vex
.w
)
10757 *ins
->obufp
++ = 's';
10759 oappend (ins
, "{bad}");
10775 *ins
->obufp
++ = '{';
10776 *ins
->obufp
++ = 'v';
10777 *ins
->obufp
++ = 'e';
10778 *ins
->obufp
++ = 'x';
10779 *ins
->obufp
++ = '}';
10780 *ins
->obufp
++ = ' ';
10783 if (!(ins
->rex
& REX_W
))
10785 *ins
->obufp
++ = 'a';
10786 *ins
->obufp
++ = 'b';
10787 *ins
->obufp
++ = 's';
10799 /* operand size flag for cwtl, cbtw */
10801 if (ins
->rex
& REX_W
)
10803 if (ins
->intel_syntax
)
10804 *ins
->obufp
++ = 'd';
10806 *ins
->obufp
++ = 'l';
10808 else if (sizeflag
& DFLAG
)
10809 *ins
->obufp
++ = 'w';
10811 *ins
->obufp
++ = 'b';
10812 if (!(ins
->rex
& REX_W
))
10813 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10817 if (!ins
->need_vex
)
10819 if (last
[0] == 'X')
10820 *ins
->obufp
++ = ins
->vex
.w
? 'd': 's';
10821 else if (last
[0] == 'B')
10822 *ins
->obufp
++ = ins
->vex
.w
? 'w': 'b';
10833 ? ins
->vex
.prefix
== DATA_PREFIX_OPCODE
10834 : ins
->prefixes
& PREFIX_DATA
)
10836 *ins
->obufp
++ = 'd';
10837 ins
->used_prefixes
|= PREFIX_DATA
;
10840 *ins
->obufp
++ = 's';
10843 if (l
== 1 && last
[0] == 'X')
10845 if (!ins
->need_vex
)
10847 if (ins
->intel_syntax
10848 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
10849 && !(sizeflag
& SUFFIX_ALWAYS
)))
10851 switch (ins
->vex
.length
)
10854 *ins
->obufp
++ = 'x';
10857 *ins
->obufp
++ = 'y';
10860 if (!ins
->vex
.evex
)
10871 /* These insns ignore ModR/M.mod: Force it to 3 for OP_E(). */
10872 ins
->modrm
.mod
= 3;
10873 if (!ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
10874 *ins
->obufp
++ = ins
->address_mode
== mode_64bit
? 'q' : 'l';
10876 else if (l
== 1 && last
[0] == 'X')
10878 if (!ins
->vex
.evex
)
10880 if (ins
->intel_syntax
10881 || ((ins
->modrm
.mod
== 3 || ins
->vex
.b
)
10882 && !(sizeflag
& SUFFIX_ALWAYS
)))
10884 switch (ins
->vex
.length
)
10887 *ins
->obufp
++ = 'x';
10890 *ins
->obufp
++ = 'y';
10893 *ins
->obufp
++ = 'z';
10903 if (ins
->intel_syntax
)
10905 if (ins
->isa64
== intel64
&& (ins
->rex
& REX_W
))
10908 *ins
->obufp
++ = 'q';
10911 if ((ins
->prefixes
& PREFIX_DATA
) || (sizeflag
& SUFFIX_ALWAYS
))
10913 if (sizeflag
& DFLAG
)
10914 *ins
->obufp
++ = 'l';
10916 *ins
->obufp
++ = 'w';
10917 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
10926 ins
->mnemonicendp
= ins
->obufp
;
10930 /* Add a style marker to *INS->obufp that encodes STYLE. This assumes that
10931 the buffer pointed to by INS->obufp has space. A style marker is made
10932 from the STYLE_MARKER_CHAR followed by STYLE converted to a single hex
10933 digit, followed by another STYLE_MARKER_CHAR. This function assumes
10934 that the number of styles is not greater than 16. */
10937 oappend_insert_style (instr_info
*ins
, enum disassembler_style style
)
10939 unsigned num
= (unsigned) style
;
10941 /* We currently assume that STYLE can be encoded as a single hex
10942 character. If more styles are added then this might start to fail,
10943 and we'll need to expand this code. */
10947 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
10948 *ins
->obufp
++ = (num
< 10 ? ('0' + num
)
10949 : ((num
< 16) ? ('a' + (num
- 10)) : '0'));
10950 *ins
->obufp
++ = STYLE_MARKER_CHAR
;
10952 /* This final null character is not strictly necessary, after inserting a
10953 style marker we should always be inserting some additional content.
10954 However, having the buffer null terminated doesn't cost much, and make
10955 it easier to debug what's going on. Also, if we do ever forget to add
10956 any additional content after this style marker, then the buffer will
10957 still be well formed. */
10958 *ins
->obufp
= '\0';
10962 oappend_with_style (instr_info
*ins
, const char *s
,
10963 enum disassembler_style style
)
10965 oappend_insert_style (ins
, style
);
10966 ins
->obufp
= stpcpy (ins
->obufp
, s
);
10969 /* Like oappend_with_style but always with text style. */
10972 oappend (instr_info
*ins
, const char *s
)
10974 oappend_with_style (ins
, s
, dis_style_text
);
10977 /* Add a single character C to the buffer pointer to by INS->obufp, marking
10978 the style for the character as STYLE. */
10981 oappend_char_with_style (instr_info
*ins
, const char c
,
10982 enum disassembler_style style
)
10984 oappend_insert_style (ins
, style
);
10986 *ins
->obufp
= '\0';
10989 /* Like oappend_char_with_style, but always uses dis_style_text. */
10992 oappend_char (instr_info
*ins
, const char c
)
10994 oappend_char_with_style (ins
, c
, dis_style_text
);
10998 append_seg (instr_info
*ins
)
11000 /* Only print the active segment register. */
11001 if (!ins
->active_seg_prefix
)
11004 ins
->used_prefixes
|= ins
->active_seg_prefix
;
11005 switch (ins
->active_seg_prefix
)
11008 oappend_register (ins
, "%cs");
11011 oappend_register (ins
, "%ds");
11014 oappend_register (ins
, "%ss");
11017 oappend_register (ins
, "%es");
11020 oappend_register (ins
, "%fs");
11023 oappend_register (ins
, "%gs");
11028 oappend_char (ins
, ':');
11032 OP_indirE (instr_info
*ins
, int bytemode
, int sizeflag
)
11034 if (!ins
->intel_syntax
)
11035 oappend (ins
, "*");
11036 OP_E (ins
, bytemode
, sizeflag
);
11040 print_operand_value (instr_info
*ins
, bfd_vma disp
,
11041 enum disassembler_style style
)
11045 if (ins
->address_mode
== mode_64bit
)
11046 sprintf (tmp
, "0x%" PRIx64
, (uint64_t) disp
);
11048 sprintf (tmp
, "0x%x", (unsigned int) disp
);
11049 oappend_with_style (ins
, tmp
, style
);
11052 /* Like oappend, but called for immediate operands. */
11055 oappend_immediate (instr_info
*ins
, bfd_vma imm
)
11057 if (!ins
->intel_syntax
)
11058 oappend_char_with_style (ins
, '$', dis_style_immediate
);
11059 print_operand_value (ins
, imm
, dis_style_immediate
);
11062 /* Put DISP in BUF as signed hex number. */
11065 print_displacement (instr_info
*ins
, bfd_vma disp
)
11067 bfd_signed_vma val
= disp
;
11072 oappend_char_with_style (ins
, '-', dis_style_address_offset
);
11075 /* Check for possible overflow. */
11078 switch (ins
->address_mode
)
11081 oappend_with_style (ins
, "0x8000000000000000",
11082 dis_style_address_offset
);
11085 oappend_with_style (ins
, "0x80000000",
11086 dis_style_address_offset
);
11089 oappend_with_style (ins
, "0x8000",
11090 dis_style_address_offset
);
11097 sprintf (tmp
, "0x%" PRIx64
, (int64_t) val
);
11098 oappend_with_style (ins
, tmp
, dis_style_address_offset
);
11102 intel_operand_size (instr_info
*ins
, int bytemode
, int sizeflag
)
11106 if (!ins
->vex
.no_broadcast
)
11110 case evex_half_bcst_xmmq_mode
:
11112 oappend (ins
, "QWORD BCST ");
11114 oappend (ins
, "DWORD BCST ");
11117 case evex_half_bcst_xmmqh_mode
:
11118 case evex_half_bcst_xmmqdh_mode
:
11119 oappend (ins
, "WORD BCST ");
11122 ins
->vex
.no_broadcast
= true;
11132 oappend (ins
, "BYTE PTR ");
11137 oappend (ins
, "WORD PTR ");
11140 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11142 oappend (ins
, "QWORD PTR ");
11145 /* Fall through. */
11147 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11148 || (ins
->rex
& REX_W
)))
11150 oappend (ins
, "QWORD PTR ");
11153 /* Fall through. */
11158 if (ins
->rex
& REX_W
)
11159 oappend (ins
, "QWORD PTR ");
11160 else if (bytemode
== dq_mode
)
11161 oappend (ins
, "DWORD PTR ");
11164 if (sizeflag
& DFLAG
)
11165 oappend (ins
, "DWORD PTR ");
11167 oappend (ins
, "WORD PTR ");
11168 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11172 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
11173 *ins
->obufp
++ = 'D';
11174 oappend (ins
, "WORD PTR ");
11175 if (!(ins
->rex
& REX_W
))
11176 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11179 if (sizeflag
& DFLAG
)
11180 oappend (ins
, "QWORD PTR ");
11182 oappend (ins
, "DWORD PTR ");
11183 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11186 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11187 oappend (ins
, "WORD PTR ");
11189 oappend (ins
, "DWORD PTR ");
11190 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11194 oappend (ins
, "DWORD PTR ");
11198 oappend (ins
, "QWORD PTR ");
11201 if (ins
->address_mode
== mode_64bit
)
11202 oappend (ins
, "QWORD PTR ");
11204 oappend (ins
, "DWORD PTR ");
11207 if (sizeflag
& DFLAG
)
11208 oappend (ins
, "FWORD PTR ");
11210 oappend (ins
, "DWORD PTR ");
11211 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11214 oappend (ins
, "TBYTE PTR ");
11219 case evex_x_gscat_mode
:
11220 case evex_x_nobcst_mode
:
11224 switch (ins
->vex
.length
)
11227 oappend (ins
, "XMMWORD PTR ");
11230 oappend (ins
, "YMMWORD PTR ");
11233 oappend (ins
, "ZMMWORD PTR ");
11240 oappend (ins
, "XMMWORD PTR ");
11243 oappend (ins
, "XMMWORD PTR ");
11246 oappend (ins
, "YMMWORD PTR ");
11249 case evex_half_bcst_xmmqh_mode
:
11250 case evex_half_bcst_xmmq_mode
:
11251 if (!ins
->need_vex
)
11254 switch (ins
->vex
.length
)
11257 oappend (ins
, "QWORD PTR ");
11260 oappend (ins
, "XMMWORD PTR ");
11263 oappend (ins
, "YMMWORD PTR ");
11270 if (!ins
->need_vex
)
11273 switch (ins
->vex
.length
)
11276 oappend (ins
, "WORD PTR ");
11279 oappend (ins
, "DWORD PTR ");
11282 oappend (ins
, "QWORD PTR ");
11289 case evex_half_bcst_xmmqdh_mode
:
11290 if (!ins
->need_vex
)
11293 switch (ins
->vex
.length
)
11296 oappend (ins
, "DWORD PTR ");
11299 oappend (ins
, "QWORD PTR ");
11302 oappend (ins
, "XMMWORD PTR ");
11309 if (!ins
->need_vex
)
11312 switch (ins
->vex
.length
)
11315 oappend (ins
, "QWORD PTR ");
11318 oappend (ins
, "YMMWORD PTR ");
11321 oappend (ins
, "ZMMWORD PTR ");
11328 oappend (ins
, "OWORD PTR ");
11330 case vex_vsib_d_w_dq_mode
:
11331 case vex_vsib_q_w_dq_mode
:
11332 if (!ins
->need_vex
)
11335 oappend (ins
, "QWORD PTR ");
11337 oappend (ins
, "DWORD PTR ");
11340 if (!ins
->need_vex
|| ins
->vex
.length
!= 128)
11343 oappend (ins
, "DWORD PTR ");
11345 oappend (ins
, "BYTE PTR ");
11348 if (!ins
->need_vex
)
11351 oappend (ins
, "QWORD PTR ");
11353 oappend (ins
, "WORD PTR ");
11363 print_register (instr_info
*ins
, unsigned int reg
, unsigned int rexmask
,
11364 int bytemode
, int sizeflag
)
11366 const char *const *names
;
11368 USED_REX (rexmask
);
11369 if (ins
->rex
& rexmask
)
11379 names
= att_names8rex
;
11381 names
= att_names8
;
11384 names
= att_names16
;
11389 names
= att_names32
;
11392 names
= att_names64
;
11396 names
= ins
->address_mode
== mode_64bit
? att_names64
: att_names32
;
11399 case bnd_swap_mode
:
11402 oappend (ins
, "(bad)");
11405 names
= att_names_bnd
;
11408 if (ins
->address_mode
== mode_64bit
&& ins
->isa64
== intel64
)
11410 names
= att_names64
;
11413 /* Fall through. */
11415 if (ins
->address_mode
== mode_64bit
&& ((sizeflag
& DFLAG
)
11416 || (ins
->rex
& REX_W
)))
11418 names
= att_names64
;
11422 /* Fall through. */
11427 if (ins
->rex
& REX_W
)
11428 names
= att_names64
;
11429 else if (bytemode
!= v_mode
&& bytemode
!= v_swap_mode
)
11430 names
= att_names32
;
11433 if (sizeflag
& DFLAG
)
11434 names
= att_names32
;
11436 names
= att_names16
;
11437 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11441 if (!(sizeflag
& DFLAG
) && ins
->isa64
== intel64
)
11442 names
= att_names16
;
11444 names
= att_names32
;
11445 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
11448 names
= (ins
->address_mode
== mode_64bit
11449 ? att_names64
: att_names32
);
11450 if (!(ins
->prefixes
& PREFIX_ADDR
))
11451 names
= (ins
->address_mode
== mode_16bit
11452 ? att_names16
: names
);
11455 /* Remove "addr16/addr32". */
11456 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
11457 names
= (ins
->address_mode
!= mode_32bit
11458 ? att_names32
: att_names16
);
11459 ins
->used_prefixes
|= PREFIX_ADDR
;
11466 oappend (ins
, "(bad)");
11469 names
= att_names_mask
;
11474 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
11477 oappend_register (ins
, names
[reg
]);
11481 OP_E_memory (instr_info
*ins
, int bytemode
, int sizeflag
)
11484 int add
= (ins
->rex
& REX_B
) ? 8 : 0;
11502 if (ins
->address_mode
!= mode_64bit
)
11510 case vex_vsib_d_w_dq_mode
:
11511 case vex_vsib_q_w_dq_mode
:
11512 case evex_x_gscat_mode
:
11513 shift
= ins
->vex
.w
? 3 : 2;
11516 case evex_half_bcst_xmmqh_mode
:
11517 case evex_half_bcst_xmmqdh_mode
:
11520 shift
= ins
->vex
.w
? 2 : 1;
11523 /* Fall through. */
11525 case evex_half_bcst_xmmq_mode
:
11528 shift
= ins
->vex
.w
? 3 : 2;
11531 /* Fall through. */
11536 case evex_x_nobcst_mode
:
11538 switch (ins
->vex
.length
)
11552 /* Make necessary corrections to shift for modes that need it. */
11553 if (bytemode
== xmmq_mode
11554 || bytemode
== evex_half_bcst_xmmqh_mode
11555 || bytemode
== evex_half_bcst_xmmq_mode
11556 || (bytemode
== ymmq_mode
&& ins
->vex
.length
== 128))
11558 else if (bytemode
== xmmqd_mode
11559 || bytemode
== evex_half_bcst_xmmqdh_mode
)
11561 else if (bytemode
== xmmdw_mode
)
11575 shift
= ins
->vex
.w
? 1 : 0;
11585 if (ins
->intel_syntax
)
11586 intel_operand_size (ins
, bytemode
, sizeflag
);
11589 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
11591 /* 32/64 bit address mode */
11599 int addr32flag
= !((sizeflag
& AFLAG
)
11600 || bytemode
== v_bnd_mode
11601 || bytemode
== v_bndmk_mode
11602 || bytemode
== bnd_mode
11603 || bytemode
== bnd_swap_mode
);
11604 bool check_gather
= false;
11605 const char *const *indexes
= NULL
;
11608 base
= ins
->modrm
.rm
;
11612 vindex
= ins
->sib
.index
;
11614 if (ins
->rex
& REX_X
)
11618 case vex_vsib_d_w_dq_mode
:
11619 case vex_vsib_q_w_dq_mode
:
11620 if (!ins
->need_vex
)
11626 check_gather
= ins
->obufp
== ins
->op_out
[1];
11629 switch (ins
->vex
.length
)
11632 indexes
= att_names_xmm
;
11636 || bytemode
== vex_vsib_q_w_dq_mode
)
11637 indexes
= att_names_ymm
;
11639 indexes
= att_names_xmm
;
11643 || bytemode
== vex_vsib_q_w_dq_mode
)
11644 indexes
= att_names_zmm
;
11646 indexes
= att_names_ymm
;
11654 indexes
= ins
->address_mode
== mode_64bit
&& !addr32flag
11655 ? att_names64
: att_names32
;
11658 scale
= ins
->sib
.scale
;
11659 base
= ins
->sib
.base
;
11664 /* Check for mandatory SIB. */
11665 if (bytemode
== vex_vsib_d_w_dq_mode
11666 || bytemode
== vex_vsib_q_w_dq_mode
11667 || bytemode
== vex_sibmem_mode
)
11669 oappend (ins
, "(bad)");
11673 rbase
= base
+ add
;
11675 switch (ins
->modrm
.mod
)
11681 if (ins
->address_mode
== mode_64bit
&& !ins
->has_sib
)
11683 disp
= get32s (ins
);
11684 if (riprel
&& bytemode
== v_bndmk_mode
)
11686 oappend (ins
, "(bad)");
11692 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
11693 disp
= *ins
->codep
++;
11694 if ((disp
& 0x80) != 0)
11696 if (ins
->vex
.evex
&& shift
> 0)
11700 disp
= get32s (ins
);
11709 && ins
->address_mode
!= mode_16bit
)
11711 if (ins
->address_mode
== mode_64bit
)
11715 /* Without base nor index registers, zero-extend the
11716 lower 32-bit displacement to 64 bits. */
11717 disp
= (unsigned int) disp
;
11724 /* In 32-bit mode, we need index register to tell [offset]
11725 from [eiz*1 + offset]. */
11730 havedisp
= (havebase
11732 || (ins
->has_sib
&& (indexes
|| scale
!= 0)));
11734 if (!ins
->intel_syntax
)
11735 if (ins
->modrm
.mod
!= 0 || base
== 5)
11737 if (havedisp
|| riprel
)
11738 print_displacement (ins
, disp
);
11740 print_operand_value (ins
, disp
, dis_style_address_offset
);
11743 set_op (ins
, disp
, true);
11744 oappend_char (ins
, '(');
11745 oappend_with_style (ins
, !addr32flag
? "%rip" : "%eip",
11746 dis_style_register
);
11747 oappend_char (ins
, ')');
11751 if ((havebase
|| indexes
|| needindex
|| needaddr32
|| riprel
)
11752 && (ins
->address_mode
!= mode_64bit
11753 || ((bytemode
!= v_bnd_mode
)
11754 && (bytemode
!= v_bndmk_mode
)
11755 && (bytemode
!= bnd_mode
)
11756 && (bytemode
!= bnd_swap_mode
))))
11757 ins
->used_prefixes
|= PREFIX_ADDR
;
11759 if (havedisp
|| (ins
->intel_syntax
&& riprel
))
11761 oappend_char (ins
, ins
->open_char
);
11762 if (ins
->intel_syntax
&& riprel
)
11764 set_op (ins
, disp
, true);
11765 oappend_with_style (ins
, !addr32flag
? "rip" : "eip",
11766 dis_style_register
);
11771 (ins
->address_mode
== mode_64bit
&& !addr32flag
11772 ? att_names64
: att_names32
)[rbase
]);
11775 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
11776 print index to tell base + index from base. */
11780 || (havebase
&& base
!= ESP_REG_NUM
))
11782 if (!ins
->intel_syntax
|| havebase
)
11783 oappend_char (ins
, ins
->separator_char
);
11786 if (ins
->address_mode
== mode_64bit
|| vindex
< 16)
11787 oappend_register (ins
, indexes
[vindex
]);
11789 oappend (ins
, "(bad)");
11792 oappend_register (ins
,
11793 ins
->address_mode
== mode_64bit
11798 oappend_char (ins
, ins
->scale_char
);
11799 oappend_char_with_style (ins
, '0' + (1 << scale
),
11800 dis_style_immediate
);
11803 if (ins
->intel_syntax
11804 && (disp
|| ins
->modrm
.mod
!= 0 || base
== 5))
11806 if (!havedisp
|| (bfd_signed_vma
) disp
>= 0)
11807 oappend_char (ins
, '+');
11808 else if (ins
->modrm
.mod
!= 1 && disp
!= -disp
)
11810 oappend_char (ins
, '-');
11815 print_displacement (ins
, disp
);
11817 print_operand_value (ins
, disp
, dis_style_address_offset
);
11820 oappend_char (ins
, ins
->close_char
);
11824 /* Both XMM/YMM/ZMM registers must be distinct. */
11825 int modrm_reg
= ins
->modrm
.reg
;
11827 if (ins
->rex
& REX_R
)
11831 if (vindex
== modrm_reg
)
11832 oappend (ins
, "/(bad)");
11835 else if (ins
->intel_syntax
)
11837 if (ins
->modrm
.mod
!= 0 || base
== 5)
11839 if (!ins
->active_seg_prefix
)
11841 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
11842 oappend (ins
, ":");
11844 print_operand_value (ins
, disp
, dis_style_text
);
11848 else if (bytemode
== v_bnd_mode
11849 || bytemode
== v_bndmk_mode
11850 || bytemode
== bnd_mode
11851 || bytemode
== bnd_swap_mode
11852 || bytemode
== vex_vsib_d_w_dq_mode
11853 || bytemode
== vex_vsib_q_w_dq_mode
)
11855 oappend (ins
, "(bad)");
11860 /* 16 bit address mode */
11861 ins
->used_prefixes
|= ins
->prefixes
& PREFIX_ADDR
;
11862 switch (ins
->modrm
.mod
)
11865 if (ins
->modrm
.rm
== 6)
11867 disp
= get16 (ins
);
11868 if ((disp
& 0x8000) != 0)
11873 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
11874 disp
= *ins
->codep
++;
11875 if ((disp
& 0x80) != 0)
11877 if (ins
->vex
.evex
&& shift
> 0)
11881 disp
= get16 (ins
);
11882 if ((disp
& 0x8000) != 0)
11887 if (!ins
->intel_syntax
)
11888 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6)
11889 print_displacement (ins
, disp
);
11891 if (ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
!= 6)
11893 oappend_char (ins
, ins
->open_char
);
11894 oappend (ins
, (ins
->intel_syntax
? intel_index16
11895 : att_index16
)[ins
->modrm
.rm
]);
11896 if (ins
->intel_syntax
11897 && (disp
|| ins
->modrm
.mod
!= 0 || ins
->modrm
.rm
== 6))
11899 if ((bfd_signed_vma
) disp
>= 0)
11900 oappend_char (ins
, '+');
11901 else if (ins
->modrm
.mod
!= 1)
11903 oappend_char (ins
, '-');
11907 print_displacement (ins
, disp
);
11910 oappend_char (ins
, ins
->close_char
);
11912 else if (ins
->intel_syntax
)
11914 if (!ins
->active_seg_prefix
)
11916 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
11917 oappend (ins
, ":");
11919 print_operand_value (ins
, disp
& 0xffff, dis_style_text
);
11924 ins
->evex_used
|= EVEX_b_used
;
11926 /* Broadcast can only ever be valid for memory sources. */
11927 if (ins
->obufp
== ins
->op_out
[0])
11928 ins
->vex
.no_broadcast
= true;
11930 if (!ins
->vex
.no_broadcast
11931 && (!ins
->intel_syntax
|| !(ins
->evex_used
& EVEX_len_used
)))
11933 if (bytemode
== xh_mode
)
11936 oappend (ins
, "{bad}");
11939 switch (ins
->vex
.length
)
11942 oappend (ins
, "{1to8}");
11945 oappend (ins
, "{1to16}");
11948 oappend (ins
, "{1to32}");
11955 else if (bytemode
== q_mode
11956 || bytemode
== ymmq_mode
)
11957 ins
->vex
.no_broadcast
= true;
11958 else if (ins
->vex
.w
11959 || bytemode
== evex_half_bcst_xmmqdh_mode
11960 || bytemode
== evex_half_bcst_xmmq_mode
)
11962 switch (ins
->vex
.length
)
11965 oappend (ins
, "{1to2}");
11968 oappend (ins
, "{1to4}");
11971 oappend (ins
, "{1to8}");
11977 else if (bytemode
== x_mode
11978 || bytemode
== evex_half_bcst_xmmqh_mode
)
11980 switch (ins
->vex
.length
)
11983 oappend (ins
, "{1to4}");
11986 oappend (ins
, "{1to8}");
11989 oappend (ins
, "{1to16}");
11996 ins
->vex
.no_broadcast
= true;
11998 if (ins
->vex
.no_broadcast
)
11999 oappend (ins
, "{bad}");
12004 OP_E (instr_info
*ins
, int bytemode
, int sizeflag
)
12006 /* Skip mod/rm byte. */
12010 if (ins
->modrm
.mod
== 3)
12012 if ((sizeflag
& SUFFIX_ALWAYS
)
12013 && (bytemode
== b_swap_mode
12014 || bytemode
== bnd_swap_mode
12015 || bytemode
== v_swap_mode
))
12016 swap_operand (ins
);
12018 print_register (ins
, ins
->modrm
.rm
, REX_B
, bytemode
, sizeflag
);
12021 OP_E_memory (ins
, bytemode
, sizeflag
);
12025 OP_G (instr_info
*ins
, int bytemode
, int sizeflag
)
12027 if (ins
->vex
.evex
&& !ins
->vex
.r
&& ins
->address_mode
== mode_64bit
)
12029 oappend (ins
, "(bad)");
12033 print_register (ins
, ins
->modrm
.reg
, REX_R
, bytemode
, sizeflag
);
12038 get64 (instr_info
*ins
)
12044 FETCH_DATA (ins
->info
, ins
->codep
+ 8);
12045 a
= *ins
->codep
++ & 0xff;
12046 a
|= (*ins
->codep
++ & 0xff) << 8;
12047 a
|= (*ins
->codep
++ & 0xff) << 16;
12048 a
|= (*ins
->codep
++ & 0xffu
) << 24;
12049 b
= *ins
->codep
++ & 0xff;
12050 b
|= (*ins
->codep
++ & 0xff) << 8;
12051 b
|= (*ins
->codep
++ & 0xff) << 16;
12052 b
|= (*ins
->codep
++ & 0xffu
) << 24;
12053 x
= a
+ ((bfd_vma
) b
<< 32);
12058 get64 (instr_info
*ins ATTRIBUTE_UNUSED
)
12065 static bfd_signed_vma
12066 get32 (instr_info
*ins
)
12070 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
12071 x
= *ins
->codep
++ & (bfd_vma
) 0xff;
12072 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 8;
12073 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 16;
12074 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 24;
12078 static bfd_signed_vma
12079 get32s (instr_info
*ins
)
12083 FETCH_DATA (ins
->info
, ins
->codep
+ 4);
12084 x
= *ins
->codep
++ & (bfd_vma
) 0xff;
12085 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 8;
12086 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 16;
12087 x
|= (*ins
->codep
++ & (bfd_vma
) 0xff) << 24;
12089 x
= (x
^ ((bfd_vma
) 1 << 31)) - ((bfd_vma
) 1 << 31);
12095 get16 (instr_info
*ins
)
12099 FETCH_DATA (ins
->info
, ins
->codep
+ 2);
12100 x
= *ins
->codep
++ & 0xff;
12101 x
|= (*ins
->codep
++ & 0xff) << 8;
12106 set_op (instr_info
*ins
, bfd_vma op
, bool riprel
)
12108 ins
->op_index
[ins
->op_ad
] = ins
->op_ad
;
12109 if (ins
->address_mode
== mode_64bit
)
12110 ins
->op_address
[ins
->op_ad
] = op
;
12111 else /* Mask to get a 32-bit address. */
12112 ins
->op_address
[ins
->op_ad
] = op
& 0xffffffff;
12113 ins
->op_riprel
[ins
->op_ad
] = riprel
;
12117 OP_REG (instr_info
*ins
, int code
, int sizeflag
)
12124 case es_reg
: case ss_reg
: case cs_reg
:
12125 case ds_reg
: case fs_reg
: case gs_reg
:
12126 oappend_register (ins
, att_names_seg
[code
- es_reg
]);
12131 if (ins
->rex
& REX_B
)
12138 case ax_reg
: case cx_reg
: case dx_reg
: case bx_reg
:
12139 case sp_reg
: case bp_reg
: case si_reg
: case di_reg
:
12140 s
= att_names16
[code
- ax_reg
+ add
];
12142 case ah_reg
: case ch_reg
: case dh_reg
: case bh_reg
:
12144 /* Fall through. */
12145 case al_reg
: case cl_reg
: case dl_reg
: case bl_reg
:
12147 s
= att_names8rex
[code
- al_reg
+ add
];
12149 s
= att_names8
[code
- al_reg
];
12151 case rAX_reg
: case rCX_reg
: case rDX_reg
: case rBX_reg
:
12152 case rSP_reg
: case rBP_reg
: case rSI_reg
: case rDI_reg
:
12153 if (ins
->address_mode
== mode_64bit
12154 && ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12156 s
= att_names64
[code
- rAX_reg
+ add
];
12159 code
+= eAX_reg
- rAX_reg
;
12160 /* Fall through. */
12161 case eAX_reg
: case eCX_reg
: case eDX_reg
: case eBX_reg
:
12162 case eSP_reg
: case eBP_reg
: case eSI_reg
: case eDI_reg
:
12164 if (ins
->rex
& REX_W
)
12165 s
= att_names64
[code
- eAX_reg
+ add
];
12168 if (sizeflag
& DFLAG
)
12169 s
= att_names32
[code
- eAX_reg
+ add
];
12171 s
= att_names16
[code
- eAX_reg
+ add
];
12172 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12176 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12179 oappend_register (ins
, s
);
12183 OP_IMREG (instr_info
*ins
, int code
, int sizeflag
)
12190 if (!ins
->intel_syntax
)
12192 oappend (ins
, "(%dx)");
12195 s
= att_names16
[dx_reg
- ax_reg
];
12197 case al_reg
: case cl_reg
:
12198 s
= att_names8
[code
- al_reg
];
12202 if (ins
->rex
& REX_W
)
12207 /* Fall through. */
12208 case z_mode_ax_reg
:
12209 if ((ins
->rex
& REX_W
) || (sizeflag
& DFLAG
))
12213 if (!(ins
->rex
& REX_W
))
12214 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12217 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12220 oappend_register (ins
, s
);
12224 OP_I (instr_info
*ins
, int bytemode
, int sizeflag
)
12227 bfd_signed_vma mask
= -1;
12232 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12233 op
= *ins
->codep
++;
12238 if (ins
->rex
& REX_W
)
12242 if (sizeflag
& DFLAG
)
12252 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12264 if (ins
->intel_syntax
)
12265 oappend (ins
, "1");
12268 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12273 oappend_immediate (ins
, op
);
12277 OP_I64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12279 if (bytemode
!= v_mode
|| ins
->address_mode
!= mode_64bit
12280 || !(ins
->rex
& REX_W
))
12282 OP_I (ins
, bytemode
, sizeflag
);
12288 oappend_immediate (ins
, get64 (ins
));
12292 OP_sI (instr_info
*ins
, int bytemode
, int sizeflag
)
12300 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12301 op
= *ins
->codep
++;
12302 if ((op
& 0x80) != 0)
12304 if (bytemode
== b_T_mode
)
12306 if (ins
->address_mode
!= mode_64bit
12307 || !((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
)))
12309 /* The operand-size prefix is overridden by a REX prefix. */
12310 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12318 if (!(ins
->rex
& REX_W
))
12320 if (sizeflag
& DFLAG
)
12328 /* The operand-size prefix is overridden by a REX prefix. */
12329 if ((sizeflag
& DFLAG
) || (ins
->rex
& REX_W
))
12335 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12339 oappend_immediate (ins
, op
);
12343 OP_J (instr_info
*ins
, int bytemode
, int sizeflag
)
12347 bfd_vma segment
= 0;
12352 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12353 disp
= *ins
->codep
++;
12354 if ((disp
& 0x80) != 0)
12359 if ((sizeflag
& DFLAG
)
12360 || (ins
->address_mode
== mode_64bit
12361 && ((ins
->isa64
== intel64
&& bytemode
!= dqw_mode
)
12362 || (ins
->rex
& REX_W
))))
12363 disp
= get32s (ins
);
12366 disp
= get16 (ins
);
12367 if ((disp
& 0x8000) != 0)
12369 /* In 16bit mode, address is wrapped around at 64k within
12370 the same segment. Otherwise, a data16 prefix on a jump
12371 instruction means that the pc is masked to 16 bits after
12372 the displacement is added! */
12374 if ((ins
->prefixes
& PREFIX_DATA
) == 0)
12375 segment
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
))
12376 & ~((bfd_vma
) 0xffff));
12378 if (ins
->address_mode
!= mode_64bit
12379 || (ins
->isa64
!= intel64
&& !(ins
->rex
& REX_W
)))
12380 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12383 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
12386 disp
= ((ins
->start_pc
+ (ins
->codep
- ins
->start_codep
) + disp
) & mask
)
12388 set_op (ins
, disp
, false);
12389 print_operand_value (ins
, disp
, dis_style_text
);
12393 OP_SEG (instr_info
*ins
, int bytemode
, int sizeflag
)
12395 if (bytemode
== w_mode
)
12396 oappend_register (ins
, att_names_seg
[ins
->modrm
.reg
]);
12398 OP_E (ins
, ins
->modrm
.mod
== 3 ? bytemode
: w_mode
, sizeflag
);
12402 OP_DIR (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
, int sizeflag
)
12404 int seg
, offset
, res
;
12407 if (sizeflag
& DFLAG
)
12409 offset
= get32 (ins
);
12414 offset
= get16 (ins
);
12417 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12419 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12420 ins
->intel_syntax
? "0x%x:0x%x" : "$0x%x,$0x%x",
12422 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12424 oappend (ins
, scratch
);
12428 OP_OFF (instr_info
*ins
, int bytemode
, int sizeflag
)
12432 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12433 intel_operand_size (ins
, bytemode
, sizeflag
);
12436 if ((sizeflag
& AFLAG
) || ins
->address_mode
== mode_64bit
)
12441 if (ins
->intel_syntax
)
12443 if (!ins
->active_seg_prefix
)
12445 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12446 oappend (ins
, ":");
12449 print_operand_value (ins
, off
, dis_style_address_offset
);
12453 OP_OFF64 (instr_info
*ins
, int bytemode
, int sizeflag
)
12457 if (ins
->address_mode
!= mode_64bit
12458 || (ins
->prefixes
& PREFIX_ADDR
))
12460 OP_OFF (ins
, bytemode
, sizeflag
);
12464 if (ins
->intel_syntax
&& (sizeflag
& SUFFIX_ALWAYS
))
12465 intel_operand_size (ins
, bytemode
, sizeflag
);
12470 if (ins
->intel_syntax
)
12472 if (!ins
->active_seg_prefix
)
12474 oappend_register (ins
, att_names_seg
[ds_reg
- es_reg
]);
12475 oappend (ins
, ":");
12478 print_operand_value (ins
, off
, dis_style_address_offset
);
12482 ptr_reg (instr_info
*ins
, int code
, int sizeflag
)
12486 *ins
->obufp
++ = ins
->open_char
;
12487 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_ADDR
);
12488 if (ins
->address_mode
== mode_64bit
)
12490 if (!(sizeflag
& AFLAG
))
12491 s
= att_names32
[code
- eAX_reg
];
12493 s
= att_names64
[code
- eAX_reg
];
12495 else if (sizeflag
& AFLAG
)
12496 s
= att_names32
[code
- eAX_reg
];
12498 s
= att_names16
[code
- eAX_reg
];
12499 oappend_register (ins
, s
);
12500 oappend_char (ins
, ins
->close_char
);
12504 OP_ESreg (instr_info
*ins
, int code
, int sizeflag
)
12506 if (ins
->intel_syntax
)
12508 switch (ins
->codep
[-1])
12510 case 0x6d: /* insw/insl */
12511 intel_operand_size (ins
, z_mode
, sizeflag
);
12513 case 0xa5: /* movsw/movsl/movsq */
12514 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12515 case 0xab: /* stosw/stosl */
12516 case 0xaf: /* scasw/scasl */
12517 intel_operand_size (ins
, v_mode
, sizeflag
);
12520 intel_operand_size (ins
, b_mode
, sizeflag
);
12523 oappend_register (ins
, "%es");
12524 oappend_char (ins
, ':');
12525 ptr_reg (ins
, code
, sizeflag
);
12529 OP_DSreg (instr_info
*ins
, int code
, int sizeflag
)
12531 if (ins
->intel_syntax
)
12533 switch (ins
->codep
[-1])
12535 case 0x6f: /* outsw/outsl */
12536 intel_operand_size (ins
, z_mode
, sizeflag
);
12538 case 0xa5: /* movsw/movsl/movsq */
12539 case 0xa7: /* cmpsw/cmpsl/cmpsq */
12540 case 0xad: /* lodsw/lodsl/lodsq */
12541 intel_operand_size (ins
, v_mode
, sizeflag
);
12544 intel_operand_size (ins
, b_mode
, sizeflag
);
12547 /* Set ins->active_seg_prefix to PREFIX_DS if it is unset so that the
12548 default segment register DS is printed. */
12549 if (!ins
->active_seg_prefix
)
12550 ins
->active_seg_prefix
= PREFIX_DS
;
12552 ptr_reg (ins
, code
, sizeflag
);
12556 OP_C (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12557 int sizeflag ATTRIBUTE_UNUSED
)
12562 if (ins
->rex
& REX_R
)
12567 else if (ins
->address_mode
!= mode_64bit
&& (ins
->prefixes
& PREFIX_LOCK
))
12569 ins
->all_prefixes
[ins
->last_lock_prefix
] = 0;
12570 ins
->used_prefixes
|= PREFIX_LOCK
;
12575 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%cr%d",
12576 ins
->modrm
.reg
+ add
);
12577 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12579 oappend_register (ins
, scratch
);
12583 OP_D (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12584 int sizeflag ATTRIBUTE_UNUSED
)
12590 if (ins
->rex
& REX_R
)
12594 res
= snprintf (scratch
, ARRAY_SIZE (scratch
),
12595 ins
->intel_syntax
? "dr%d" : "%%db%d",
12596 ins
->modrm
.reg
+ add
);
12597 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12599 oappend (ins
, scratch
);
12603 OP_T (instr_info
*ins
, int dummy ATTRIBUTE_UNUSED
,
12604 int sizeflag ATTRIBUTE_UNUSED
)
12609 res
= snprintf (scratch
, ARRAY_SIZE (scratch
), "%%tr%d", ins
->modrm
.reg
);
12610 if (res
< 0 || (size_t) res
>= ARRAY_SIZE (scratch
))
12612 oappend_register (ins
, scratch
);
12616 OP_MMX (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12617 int sizeflag ATTRIBUTE_UNUSED
)
12619 int reg
= ins
->modrm
.reg
;
12620 const char *const *names
;
12622 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12623 if (ins
->prefixes
& PREFIX_DATA
)
12625 names
= att_names_xmm
;
12627 if (ins
->rex
& REX_R
)
12631 names
= att_names_mm
;
12632 oappend_register (ins
, names
[reg
]);
12636 print_vector_reg (instr_info
*ins
, unsigned int reg
, int bytemode
)
12638 const char *const *names
;
12640 if (bytemode
== xmmq_mode
12641 || bytemode
== evex_half_bcst_xmmqh_mode
12642 || bytemode
== evex_half_bcst_xmmq_mode
)
12644 switch (ins
->vex
.length
)
12648 names
= att_names_xmm
;
12651 names
= att_names_ymm
;
12652 ins
->evex_used
|= EVEX_len_used
;
12658 else if (bytemode
== ymm_mode
)
12659 names
= att_names_ymm
;
12660 else if (bytemode
== tmm_mode
)
12664 oappend (ins
, "(bad)");
12667 names
= att_names_tmm
;
12669 else if (ins
->need_vex
12670 && bytemode
!= xmm_mode
12671 && bytemode
!= scalar_mode
12672 && bytemode
!= xmmdw_mode
12673 && bytemode
!= xmmqd_mode
12674 && bytemode
!= evex_half_bcst_xmmqdh_mode
12675 && bytemode
!= w_swap_mode
12676 && bytemode
!= b_mode
12677 && bytemode
!= w_mode
12678 && bytemode
!= d_mode
12679 && bytemode
!= q_mode
)
12681 ins
->evex_used
|= EVEX_len_used
;
12682 switch (ins
->vex
.length
)
12685 names
= att_names_xmm
;
12689 || bytemode
!= vex_vsib_q_w_dq_mode
)
12690 names
= att_names_ymm
;
12692 names
= att_names_xmm
;
12696 || bytemode
!= vex_vsib_q_w_dq_mode
)
12697 names
= att_names_zmm
;
12699 names
= att_names_ymm
;
12706 names
= att_names_xmm
;
12707 oappend_register (ins
, names
[reg
]);
12711 OP_XMM (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
12713 unsigned int reg
= ins
->modrm
.reg
;
12716 if (ins
->rex
& REX_R
)
12724 if (bytemode
== tmm_mode
)
12725 ins
->modrm
.reg
= reg
;
12726 else if (bytemode
== scalar_mode
)
12727 ins
->vex
.no_broadcast
= true;
12729 print_vector_reg (ins
, reg
, bytemode
);
12733 OP_EM (instr_info
*ins
, int bytemode
, int sizeflag
)
12736 const char *const *names
;
12738 if (ins
->modrm
.mod
!= 3)
12740 if (ins
->intel_syntax
12741 && (bytemode
== v_mode
|| bytemode
== v_swap_mode
))
12743 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
12744 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12746 OP_E (ins
, bytemode
, sizeflag
);
12750 if ((sizeflag
& SUFFIX_ALWAYS
) && bytemode
== v_swap_mode
)
12751 swap_operand (ins
);
12753 /* Skip mod/rm byte. */
12756 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12757 reg
= ins
->modrm
.rm
;
12758 if (ins
->prefixes
& PREFIX_DATA
)
12760 names
= att_names_xmm
;
12762 if (ins
->rex
& REX_B
)
12766 names
= att_names_mm
;
12767 oappend_register (ins
, names
[reg
]);
12770 /* cvt* are the only instructions in sse2 which have
12771 both SSE and MMX operands and also have 0x66 prefix
12772 in their opcode. 0x66 was originally used to differentiate
12773 between SSE and MMX instruction(operands). So we have to handle the
12774 cvt* separately using OP_EMC and OP_MXC */
12776 OP_EMC (instr_info
*ins
, int bytemode
, int sizeflag
)
12778 if (ins
->modrm
.mod
!= 3)
12780 if (ins
->intel_syntax
&& bytemode
== v_mode
)
12782 bytemode
= (ins
->prefixes
& PREFIX_DATA
) ? x_mode
: q_mode
;
12783 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12785 OP_E (ins
, bytemode
, sizeflag
);
12789 /* Skip mod/rm byte. */
12792 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12793 oappend_register (ins
, att_names_mm
[ins
->modrm
.rm
]);
12797 OP_MXC (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12798 int sizeflag ATTRIBUTE_UNUSED
)
12800 ins
->used_prefixes
|= (ins
->prefixes
& PREFIX_DATA
);
12801 oappend_register (ins
, att_names_mm
[ins
->modrm
.reg
]);
12805 OP_EX (instr_info
*ins
, int bytemode
, int sizeflag
)
12809 /* Skip mod/rm byte. */
12813 if (bytemode
== dq_mode
)
12814 bytemode
= ins
->vex
.w
? q_mode
: d_mode
;
12816 if (ins
->modrm
.mod
!= 3)
12818 OP_E_memory (ins
, bytemode
, sizeflag
);
12822 reg
= ins
->modrm
.rm
;
12824 if (ins
->rex
& REX_B
)
12829 if ((ins
->rex
& REX_X
))
12833 if ((sizeflag
& SUFFIX_ALWAYS
)
12834 && (bytemode
== x_swap_mode
12835 || bytemode
== w_swap_mode
12836 || bytemode
== d_swap_mode
12837 || bytemode
== q_swap_mode
))
12838 swap_operand (ins
);
12840 if (bytemode
== tmm_mode
)
12841 ins
->modrm
.rm
= reg
;
12843 print_vector_reg (ins
, reg
, bytemode
);
12847 OP_MS (instr_info
*ins
, int bytemode
, int sizeflag
)
12849 if (ins
->modrm
.mod
== 3)
12850 OP_EM (ins
, bytemode
, sizeflag
);
12856 OP_XS (instr_info
*ins
, int bytemode
, int sizeflag
)
12858 if (ins
->modrm
.mod
== 3)
12859 OP_EX (ins
, bytemode
, sizeflag
);
12865 OP_M (instr_info
*ins
, int bytemode
, int sizeflag
)
12867 if (ins
->modrm
.mod
== 3)
12868 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
12871 OP_E (ins
, bytemode
, sizeflag
);
12875 OP_0f07 (instr_info
*ins
, int bytemode
, int sizeflag
)
12877 if (ins
->modrm
.mod
!= 3 || ins
->modrm
.rm
!= 0)
12880 OP_E (ins
, bytemode
, sizeflag
);
12883 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
12884 32bit mode and "xchg %rax,%rax" in 64bit mode. */
12887 NOP_Fixup (instr_info
*ins
, int opnd
, int sizeflag
)
12889 if ((ins
->prefixes
& PREFIX_DATA
) == 0 && (ins
->rex
& REX_B
) == 0)
12890 ins
->mnemonicendp
= stpcpy (ins
->obuf
, "nop");
12891 else if (opnd
== 0)
12892 OP_REG (ins
, eAX_reg
, sizeflag
);
12894 OP_IMREG (ins
, eAX_reg
, sizeflag
);
12897 static const char *const Suffix3DNow
[] = {
12898 /* 00 */ NULL
, NULL
, NULL
, NULL
,
12899 /* 04 */ NULL
, NULL
, NULL
, NULL
,
12900 /* 08 */ NULL
, NULL
, NULL
, NULL
,
12901 /* 0C */ "pi2fw", "pi2fd", NULL
, NULL
,
12902 /* 10 */ NULL
, NULL
, NULL
, NULL
,
12903 /* 14 */ NULL
, NULL
, NULL
, NULL
,
12904 /* 18 */ NULL
, NULL
, NULL
, NULL
,
12905 /* 1C */ "pf2iw", "pf2id", NULL
, NULL
,
12906 /* 20 */ NULL
, NULL
, NULL
, NULL
,
12907 /* 24 */ NULL
, NULL
, NULL
, NULL
,
12908 /* 28 */ NULL
, NULL
, NULL
, NULL
,
12909 /* 2C */ NULL
, NULL
, NULL
, NULL
,
12910 /* 30 */ NULL
, NULL
, NULL
, NULL
,
12911 /* 34 */ NULL
, NULL
, NULL
, NULL
,
12912 /* 38 */ NULL
, NULL
, NULL
, NULL
,
12913 /* 3C */ NULL
, NULL
, NULL
, NULL
,
12914 /* 40 */ NULL
, NULL
, NULL
, NULL
,
12915 /* 44 */ NULL
, NULL
, NULL
, NULL
,
12916 /* 48 */ NULL
, NULL
, NULL
, NULL
,
12917 /* 4C */ NULL
, NULL
, NULL
, NULL
,
12918 /* 50 */ NULL
, NULL
, NULL
, NULL
,
12919 /* 54 */ NULL
, NULL
, NULL
, NULL
,
12920 /* 58 */ NULL
, NULL
, NULL
, NULL
,
12921 /* 5C */ NULL
, NULL
, NULL
, NULL
,
12922 /* 60 */ NULL
, NULL
, NULL
, NULL
,
12923 /* 64 */ NULL
, NULL
, NULL
, NULL
,
12924 /* 68 */ NULL
, NULL
, NULL
, NULL
,
12925 /* 6C */ NULL
, NULL
, NULL
, NULL
,
12926 /* 70 */ NULL
, NULL
, NULL
, NULL
,
12927 /* 74 */ NULL
, NULL
, NULL
, NULL
,
12928 /* 78 */ NULL
, NULL
, NULL
, NULL
,
12929 /* 7C */ NULL
, NULL
, NULL
, NULL
,
12930 /* 80 */ NULL
, NULL
, NULL
, NULL
,
12931 /* 84 */ NULL
, NULL
, NULL
, NULL
,
12932 /* 88 */ NULL
, NULL
, "pfnacc", NULL
,
12933 /* 8C */ NULL
, NULL
, "pfpnacc", NULL
,
12934 /* 90 */ "pfcmpge", NULL
, NULL
, NULL
,
12935 /* 94 */ "pfmin", NULL
, "pfrcp", "pfrsqrt",
12936 /* 98 */ NULL
, NULL
, "pfsub", NULL
,
12937 /* 9C */ NULL
, NULL
, "pfadd", NULL
,
12938 /* A0 */ "pfcmpgt", NULL
, NULL
, NULL
,
12939 /* A4 */ "pfmax", NULL
, "pfrcpit1", "pfrsqit1",
12940 /* A8 */ NULL
, NULL
, "pfsubr", NULL
,
12941 /* AC */ NULL
, NULL
, "pfacc", NULL
,
12942 /* B0 */ "pfcmpeq", NULL
, NULL
, NULL
,
12943 /* B4 */ "pfmul", NULL
, "pfrcpit2", "pmulhrw",
12944 /* B8 */ NULL
, NULL
, NULL
, "pswapd",
12945 /* BC */ NULL
, NULL
, NULL
, "pavgusb",
12946 /* C0 */ NULL
, NULL
, NULL
, NULL
,
12947 /* C4 */ NULL
, NULL
, NULL
, NULL
,
12948 /* C8 */ NULL
, NULL
, NULL
, NULL
,
12949 /* CC */ NULL
, NULL
, NULL
, NULL
,
12950 /* D0 */ NULL
, NULL
, NULL
, NULL
,
12951 /* D4 */ NULL
, NULL
, NULL
, NULL
,
12952 /* D8 */ NULL
, NULL
, NULL
, NULL
,
12953 /* DC */ NULL
, NULL
, NULL
, NULL
,
12954 /* E0 */ NULL
, NULL
, NULL
, NULL
,
12955 /* E4 */ NULL
, NULL
, NULL
, NULL
,
12956 /* E8 */ NULL
, NULL
, NULL
, NULL
,
12957 /* EC */ NULL
, NULL
, NULL
, NULL
,
12958 /* F0 */ NULL
, NULL
, NULL
, NULL
,
12959 /* F4 */ NULL
, NULL
, NULL
, NULL
,
12960 /* F8 */ NULL
, NULL
, NULL
, NULL
,
12961 /* FC */ NULL
, NULL
, NULL
, NULL
,
12965 OP_3DNowSuffix (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
12966 int sizeflag ATTRIBUTE_UNUSED
)
12968 const char *mnemonic
;
12970 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
12971 /* AMD 3DNow! instructions are specified by an opcode suffix in the
12972 place where an 8-bit immediate would normally go. ie. the last
12973 byte of the instruction. */
12974 ins
->obufp
= ins
->mnemonicendp
;
12975 mnemonic
= Suffix3DNow
[*ins
->codep
++ & 0xff];
12977 ins
->obufp
= stpcpy (ins
->obufp
, mnemonic
);
12980 /* Since a variable sized ins->modrm/ins->sib chunk is between the start
12981 of the opcode (0x0f0f) and the opcode suffix, we need to do
12982 all the ins->modrm processing first, and don't know until now that
12983 we have a bad opcode. This necessitates some cleaning up. */
12984 ins
->op_out
[0][0] = '\0';
12985 ins
->op_out
[1][0] = '\0';
12988 ins
->mnemonicendp
= ins
->obufp
;
12991 static const struct op simd_cmp_op
[] =
12993 { STRING_COMMA_LEN ("eq") },
12994 { STRING_COMMA_LEN ("lt") },
12995 { STRING_COMMA_LEN ("le") },
12996 { STRING_COMMA_LEN ("unord") },
12997 { STRING_COMMA_LEN ("neq") },
12998 { STRING_COMMA_LEN ("nlt") },
12999 { STRING_COMMA_LEN ("nle") },
13000 { STRING_COMMA_LEN ("ord") }
13003 static const struct op vex_cmp_op
[] =
13005 { STRING_COMMA_LEN ("eq_uq") },
13006 { STRING_COMMA_LEN ("nge") },
13007 { STRING_COMMA_LEN ("ngt") },
13008 { STRING_COMMA_LEN ("false") },
13009 { STRING_COMMA_LEN ("neq_oq") },
13010 { STRING_COMMA_LEN ("ge") },
13011 { STRING_COMMA_LEN ("gt") },
13012 { STRING_COMMA_LEN ("true") },
13013 { STRING_COMMA_LEN ("eq_os") },
13014 { STRING_COMMA_LEN ("lt_oq") },
13015 { STRING_COMMA_LEN ("le_oq") },
13016 { STRING_COMMA_LEN ("unord_s") },
13017 { STRING_COMMA_LEN ("neq_us") },
13018 { STRING_COMMA_LEN ("nlt_uq") },
13019 { STRING_COMMA_LEN ("nle_uq") },
13020 { STRING_COMMA_LEN ("ord_s") },
13021 { STRING_COMMA_LEN ("eq_us") },
13022 { STRING_COMMA_LEN ("nge_uq") },
13023 { STRING_COMMA_LEN ("ngt_uq") },
13024 { STRING_COMMA_LEN ("false_os") },
13025 { STRING_COMMA_LEN ("neq_os") },
13026 { STRING_COMMA_LEN ("ge_oq") },
13027 { STRING_COMMA_LEN ("gt_oq") },
13028 { STRING_COMMA_LEN ("true_us") },
13032 CMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13033 int sizeflag ATTRIBUTE_UNUSED
)
13035 unsigned int cmp_type
;
13037 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13038 cmp_type
= *ins
->codep
++ & 0xff;
13039 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
))
13042 char *p
= ins
->mnemonicendp
- 2;
13046 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13047 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13049 else if (ins
->need_vex
13050 && cmp_type
< ARRAY_SIZE (simd_cmp_op
) + ARRAY_SIZE (vex_cmp_op
))
13053 char *p
= ins
->mnemonicendp
- 2;
13057 cmp_type
-= ARRAY_SIZE (simd_cmp_op
);
13058 sprintf (p
, "%s%s", vex_cmp_op
[cmp_type
].name
, suffix
);
13059 ins
->mnemonicendp
+= vex_cmp_op
[cmp_type
].len
;
13063 /* We have a reserved extension byte. Output it directly. */
13064 oappend_immediate (ins
, cmp_type
);
13069 OP_Mwait (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13071 /* mwait %eax,%ecx / mwaitx %eax,%ecx,%ebx */
13072 if (!ins
->intel_syntax
)
13074 strcpy (ins
->op_out
[0], att_names32
[0] + ins
->intel_syntax
);
13075 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13076 if (bytemode
== eBX_reg
)
13077 strcpy (ins
->op_out
[2], att_names32
[3] + ins
->intel_syntax
);
13078 ins
->two_source_ops
= true;
13080 /* Skip mod/rm byte. */
13086 OP_Monitor (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13087 int sizeflag ATTRIBUTE_UNUSED
)
13089 /* monitor %{e,r,}ax,%ecx,%edx" */
13090 if (!ins
->intel_syntax
)
13092 const char *const *names
= (ins
->address_mode
== mode_64bit
13093 ? att_names64
: att_names32
);
13095 if (ins
->prefixes
& PREFIX_ADDR
)
13097 /* Remove "addr16/addr32". */
13098 ins
->all_prefixes
[ins
->last_addr_prefix
] = 0;
13099 names
= (ins
->address_mode
!= mode_32bit
13100 ? att_names32
: att_names16
);
13101 ins
->used_prefixes
|= PREFIX_ADDR
;
13103 else if (ins
->address_mode
== mode_16bit
)
13104 names
= att_names16
;
13105 strcpy (ins
->op_out
[0], names
[0] + ins
->intel_syntax
);
13106 strcpy (ins
->op_out
[1], att_names32
[1] + ins
->intel_syntax
);
13107 strcpy (ins
->op_out
[2], att_names32
[2] + ins
->intel_syntax
);
13108 ins
->two_source_ops
= true;
13110 /* Skip mod/rm byte. */
13116 BadOp (instr_info
*ins
)
13118 /* Throw away prefixes and 1st. opcode byte. */
13119 ins
->codep
= ins
->insn_codep
+ 1;
13120 ins
->obufp
= stpcpy (ins
->obufp
, "(bad)");
13124 REP_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13126 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
13128 if (ins
->prefixes
& PREFIX_REPZ
)
13129 ins
->all_prefixes
[ins
->last_repz_prefix
] = REP_PREFIX
;
13136 OP_IMREG (ins
, bytemode
, sizeflag
);
13139 OP_ESreg (ins
, bytemode
, sizeflag
);
13142 OP_DSreg (ins
, bytemode
, sizeflag
);
13151 SEP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13152 int sizeflag ATTRIBUTE_UNUSED
)
13154 if (ins
->isa64
!= amd64
)
13157 ins
->obufp
= ins
->obuf
;
13159 ins
->mnemonicendp
= ins
->obufp
;
13163 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
13167 BND_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13168 int sizeflag ATTRIBUTE_UNUSED
)
13170 if (ins
->prefixes
& PREFIX_REPNZ
)
13171 ins
->all_prefixes
[ins
->last_repnz_prefix
] = BND_PREFIX
;
13174 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
13178 NOTRACK_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13179 int sizeflag ATTRIBUTE_UNUSED
)
13181 /* Since active_seg_prefix is not set in 64-bit mode, check whether
13182 we've seen a PREFIX_DS. */
13183 if ((ins
->prefixes
& PREFIX_DS
) != 0
13184 && (ins
->address_mode
!= mode_64bit
|| ins
->last_data_prefix
< 0))
13186 /* NOTRACK prefix is only valid on indirect branch instructions.
13187 NB: DATA prefix is unsupported for Intel64. */
13188 ins
->active_seg_prefix
= 0;
13189 ins
->all_prefixes
[ins
->last_seg_prefix
] = NOTRACK_PREFIX
;
13193 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13194 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
13198 HLE_Fixup1 (instr_info
*ins
, int bytemode
, int sizeflag
)
13200 if (ins
->modrm
.mod
!= 3
13201 && (ins
->prefixes
& PREFIX_LOCK
) != 0)
13203 if (ins
->prefixes
& PREFIX_REPZ
)
13204 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13205 if (ins
->prefixes
& PREFIX_REPNZ
)
13206 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13209 OP_E (ins
, bytemode
, sizeflag
);
13212 /* Similar to OP_E. But the 0xf2/0xf3 ins->prefixes should be displayed as
13213 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
13217 HLE_Fixup2 (instr_info
*ins
, int bytemode
, int sizeflag
)
13219 if (ins
->modrm
.mod
!= 3)
13221 if (ins
->prefixes
& PREFIX_REPZ
)
13222 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13223 if (ins
->prefixes
& PREFIX_REPNZ
)
13224 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13227 OP_E (ins
, bytemode
, sizeflag
);
13230 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
13231 "xrelease" for memory operand. No check for LOCK prefix. */
13234 HLE_Fixup3 (instr_info
*ins
, int bytemode
, int sizeflag
)
13236 if (ins
->modrm
.mod
!= 3
13237 && ins
->last_repz_prefix
> ins
->last_repnz_prefix
13238 && (ins
->prefixes
& PREFIX_REPZ
) != 0)
13239 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13241 OP_E (ins
, bytemode
, sizeflag
);
13245 CMPXCHG8B_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13248 if (ins
->rex
& REX_W
)
13250 /* Change cmpxchg8b to cmpxchg16b. */
13251 char *p
= ins
->mnemonicendp
- 2;
13252 ins
->mnemonicendp
= stpcpy (p
, "16b");
13255 else if ((ins
->prefixes
& PREFIX_LOCK
) != 0)
13257 if (ins
->prefixes
& PREFIX_REPZ
)
13258 ins
->all_prefixes
[ins
->last_repz_prefix
] = XRELEASE_PREFIX
;
13259 if (ins
->prefixes
& PREFIX_REPNZ
)
13260 ins
->all_prefixes
[ins
->last_repnz_prefix
] = XACQUIRE_PREFIX
;
13263 OP_M (ins
, bytemode
, sizeflag
);
13267 XMM_Fixup (instr_info
*ins
, int reg
, int sizeflag ATTRIBUTE_UNUSED
)
13269 const char *const *names
= att_names_xmm
;
13273 switch (ins
->vex
.length
)
13278 names
= att_names_ymm
;
13284 oappend_register (ins
, names
[reg
]);
13288 FXSAVE_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13290 /* Add proper suffix to "fxsave" and "fxrstor". */
13292 if (ins
->rex
& REX_W
)
13294 char *p
= ins
->mnemonicendp
;
13298 ins
->mnemonicendp
= p
;
13300 OP_M (ins
, bytemode
, sizeflag
);
13303 /* Display the destination register operand for instructions with
13307 OP_VEX (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13309 int reg
, modrm_reg
, sib_index
= -1;
13310 const char *const *names
;
13312 if (!ins
->need_vex
)
13315 reg
= ins
->vex
.register_specifier
;
13316 ins
->vex
.register_specifier
= 0;
13317 if (ins
->address_mode
!= mode_64bit
)
13319 if (ins
->vex
.evex
&& !ins
->vex
.v
)
13321 oappend (ins
, "(bad)");
13327 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13333 oappend_register (ins
, att_names_xmm
[reg
]);
13336 case vex_vsib_d_w_dq_mode
:
13337 case vex_vsib_q_w_dq_mode
:
13338 /* This must be the 3rd operand. */
13339 if (ins
->obufp
!= ins
->op_out
[2])
13341 if (ins
->vex
.length
== 128
13342 || (bytemode
!= vex_vsib_d_w_dq_mode
13344 oappend_register (ins
, att_names_xmm
[reg
]);
13346 oappend_register (ins
, att_names_ymm
[reg
]);
13348 /* All 3 XMM/YMM registers must be distinct. */
13349 modrm_reg
= ins
->modrm
.reg
;
13350 if (ins
->rex
& REX_R
)
13353 if (ins
->has_sib
&& ins
->modrm
.rm
== 4)
13355 sib_index
= ins
->sib
.index
;
13356 if (ins
->rex
& REX_X
)
13360 if (reg
== modrm_reg
|| reg
== sib_index
)
13361 strcpy (ins
->obufp
, "/(bad)");
13362 if (modrm_reg
== sib_index
|| modrm_reg
== reg
)
13363 strcat (ins
->op_out
[0], "/(bad)");
13364 if (sib_index
== modrm_reg
|| sib_index
== reg
)
13365 strcat (ins
->op_out
[1], "/(bad)");
13370 /* All 3 TMM registers must be distinct. */
13372 oappend (ins
, "(bad)");
13375 /* This must be the 3rd operand. */
13376 if (ins
->obufp
!= ins
->op_out
[2])
13378 oappend_register (ins
, att_names_tmm
[reg
]);
13379 if (reg
== ins
->modrm
.reg
|| reg
== ins
->modrm
.rm
)
13380 strcpy (ins
->obufp
, "/(bad)");
13383 if (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
13384 || ins
->modrm
.rm
== reg
)
13386 if (ins
->modrm
.reg
<= 8
13387 && (ins
->modrm
.reg
== ins
->modrm
.rm
|| ins
->modrm
.reg
== reg
))
13388 strcat (ins
->op_out
[0], "/(bad)");
13389 if (ins
->modrm
.rm
<= 8
13390 && (ins
->modrm
.rm
== ins
->modrm
.reg
|| ins
->modrm
.rm
== reg
))
13391 strcat (ins
->op_out
[1], "/(bad)");
13397 switch (ins
->vex
.length
)
13403 names
= att_names_xmm
;
13404 ins
->evex_used
|= EVEX_len_used
;
13407 if (ins
->rex
& REX_W
)
13408 names
= att_names64
;
13410 names
= att_names32
;
13416 oappend (ins
, "(bad)");
13419 names
= att_names_mask
;
13430 names
= att_names_ymm
;
13431 ins
->evex_used
|= EVEX_len_used
;
13437 oappend (ins
, "(bad)");
13440 names
= att_names_mask
;
13443 /* See PR binutils/20893 for a reproducer. */
13444 oappend (ins
, "(bad)");
13449 names
= att_names_zmm
;
13450 ins
->evex_used
|= EVEX_len_used
;
13456 oappend_register (ins
, names
[reg
]);
13460 OP_VexR (instr_info
*ins
, int bytemode
, int sizeflag
)
13462 if (ins
->modrm
.mod
== 3)
13463 OP_VEX (ins
, bytemode
, sizeflag
);
13467 OP_VexW (instr_info
*ins
, int bytemode
, int sizeflag
)
13469 OP_VEX (ins
, bytemode
, sizeflag
);
13473 /* Swap 2nd and 3rd operands. */
13474 char *tmp
= ins
->op_out
[2];
13476 ins
->op_out
[2] = ins
->op_out
[1];
13477 ins
->op_out
[1] = tmp
;
13482 OP_REG_VexI4 (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13485 const char *const *names
= att_names_xmm
;
13487 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13488 reg
= *ins
->codep
++;
13490 if (bytemode
!= x_mode
&& bytemode
!= scalar_mode
)
13494 if (ins
->address_mode
!= mode_64bit
)
13497 if (bytemode
== x_mode
&& ins
->vex
.length
== 256)
13498 names
= att_names_ymm
;
13500 oappend_register (ins
, names
[reg
]);
13504 /* Swap 3rd and 4th operands. */
13505 char *tmp
= ins
->op_out
[3];
13507 ins
->op_out
[3] = ins
->op_out
[2];
13508 ins
->op_out
[2] = tmp
;
13513 OP_VexI4 (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13514 int sizeflag ATTRIBUTE_UNUSED
)
13516 oappend_immediate (ins
, ins
->codep
[-1] & 0xf);
13520 VPCMP_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13521 int sizeflag ATTRIBUTE_UNUSED
)
13523 unsigned int cmp_type
;
13525 if (!ins
->vex
.evex
)
13528 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13529 cmp_type
= *ins
->codep
++ & 0xff;
13530 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
13531 If it's the case, print suffix, otherwise - print the immediate. */
13532 if (cmp_type
< ARRAY_SIZE (simd_cmp_op
)
13537 char *p
= ins
->mnemonicendp
- 2;
13539 /* vpcmp* can have both one- and two-lettered suffix. */
13553 sprintf (p
, "%s%s", simd_cmp_op
[cmp_type
].name
, suffix
);
13554 ins
->mnemonicendp
+= simd_cmp_op
[cmp_type
].len
;
13558 /* We have a reserved extension byte. Output it directly. */
13559 oappend_immediate (ins
, cmp_type
);
13563 static const struct op xop_cmp_op
[] =
13565 { STRING_COMMA_LEN ("lt") },
13566 { STRING_COMMA_LEN ("le") },
13567 { STRING_COMMA_LEN ("gt") },
13568 { STRING_COMMA_LEN ("ge") },
13569 { STRING_COMMA_LEN ("eq") },
13570 { STRING_COMMA_LEN ("neq") },
13571 { STRING_COMMA_LEN ("false") },
13572 { STRING_COMMA_LEN ("true") }
13576 VPCOM_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13577 int sizeflag ATTRIBUTE_UNUSED
)
13579 unsigned int cmp_type
;
13581 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13582 cmp_type
= *ins
->codep
++ & 0xff;
13583 if (cmp_type
< ARRAY_SIZE (xop_cmp_op
))
13586 char *p
= ins
->mnemonicendp
- 2;
13588 /* vpcom* can have both one- and two-lettered suffix. */
13602 sprintf (p
, "%s%s", xop_cmp_op
[cmp_type
].name
, suffix
);
13603 ins
->mnemonicendp
+= xop_cmp_op
[cmp_type
].len
;
13607 /* We have a reserved extension byte. Output it directly. */
13608 oappend_immediate (ins
, cmp_type
);
13612 static const struct op pclmul_op
[] =
13614 { STRING_COMMA_LEN ("lql") },
13615 { STRING_COMMA_LEN ("hql") },
13616 { STRING_COMMA_LEN ("lqh") },
13617 { STRING_COMMA_LEN ("hqh") }
13621 PCLMUL_Fixup (instr_info
*ins
, int bytemode ATTRIBUTE_UNUSED
,
13622 int sizeflag ATTRIBUTE_UNUSED
)
13624 unsigned int pclmul_type
;
13626 FETCH_DATA (ins
->info
, ins
->codep
+ 1);
13627 pclmul_type
= *ins
->codep
++ & 0xff;
13628 switch (pclmul_type
)
13639 if (pclmul_type
< ARRAY_SIZE (pclmul_op
))
13642 char *p
= ins
->mnemonicendp
- 3;
13647 sprintf (p
, "%s%s", pclmul_op
[pclmul_type
].name
, suffix
);
13648 ins
->mnemonicendp
+= pclmul_op
[pclmul_type
].len
;
13652 /* We have a reserved extension byte. Output it directly. */
13653 oappend_immediate (ins
, pclmul_type
);
13658 MOVSXD_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13660 /* Add proper suffix to "movsxd". */
13661 char *p
= ins
->mnemonicendp
;
13666 if (!ins
->intel_syntax
)
13669 if (ins
->rex
& REX_W
)
13681 oappend (ins
, INTERNAL_DISASSEMBLER_ERROR
);
13685 ins
->mnemonicendp
= p
;
13687 OP_E (ins
, bytemode
, sizeflag
);
13691 DistinctDest_Fixup (instr_info
*ins
, int bytemode
, int sizeflag
)
13693 unsigned int reg
= ins
->vex
.register_specifier
;
13694 unsigned int modrm_reg
= ins
->modrm
.reg
;
13695 unsigned int modrm_rm
= ins
->modrm
.rm
;
13697 /* Calc destination register number. */
13698 if (ins
->rex
& REX_R
)
13703 /* Calc src1 register number. */
13704 if (ins
->address_mode
!= mode_64bit
)
13706 else if (ins
->vex
.evex
&& !ins
->vex
.v
)
13709 /* Calc src2 register number. */
13710 if (ins
->modrm
.mod
== 3)
13712 if (ins
->rex
& REX_B
)
13714 if (ins
->rex
& REX_X
)
13718 /* Destination and source registers must be distinct, output bad if
13719 dest == src1 or dest == src2. */
13720 if (modrm_reg
== reg
13721 || (ins
->modrm
.mod
== 3
13722 && modrm_reg
== modrm_rm
))
13724 oappend (ins
, "(bad)");
13727 OP_XMM (ins
, bytemode
, sizeflag
);
13731 OP_Rounding (instr_info
*ins
, int bytemode
, int sizeflag ATTRIBUTE_UNUSED
)
13733 if (ins
->modrm
.mod
!= 3 || !ins
->vex
.b
)
13738 case evex_rounding_64_mode
:
13739 if (ins
->address_mode
!= mode_64bit
|| !ins
->vex
.w
)
13741 /* Fall through. */
13742 case evex_rounding_mode
:
13743 ins
->evex_used
|= EVEX_b_used
;
13744 oappend (ins
, names_rounding
[ins
->vex
.ll
]);
13746 case evex_sae_mode
:
13747 ins
->evex_used
|= EVEX_b_used
;
13748 oappend (ins
, "{");
13753 oappend (ins
, "sae}");