1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2019 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"
43 static int print_insn (bfd_vma, disassemble_info *);
44 static void dofloat (int);
45 static void OP_ST (int, int);
46 static void OP_STi (int, int);
47 static int putop (const char *, int);
48 static void oappend (const char *);
49 static void append_seg (void);
50 static void OP_indirE (int, int);
51 static void print_operand_value (char *, int, bfd_vma);
52 static void OP_E_register (int, int);
53 static void OP_E_memory (int, int);
54 static void print_displacement (char *, bfd_vma);
55 static void OP_E (int, int);
56 static void OP_G (int, int);
57 static bfd_vma get64 (void);
58 static bfd_signed_vma get32 (void);
59 static bfd_signed_vma get32s (void);
60 static int get16 (void);
61 static void set_op (bfd_vma, int);
62 static void OP_Skip_MODRM (int, int);
63 static void OP_REG (int, int);
64 static void OP_IMREG (int, int);
65 static void OP_I (int, int);
66 static void OP_I64 (int, int);
67 static void OP_sI (int, int);
68 static void OP_J (int, int);
69 static void OP_SEG (int, int);
70 static void OP_DIR (int, int);
71 static void OP_OFF (int, int);
72 static void OP_OFF64 (int, int);
73 static void ptr_reg (int, int);
74 static void OP_ESreg (int, int);
75 static void OP_DSreg (int, int);
76 static void OP_C (int, int);
77 static void OP_D (int, int);
78 static void OP_T (int, int);
79 static void OP_R (int, int);
80 static void OP_MMX (int, int);
81 static void OP_XMM (int, int);
82 static void OP_EM (int, int);
83 static void OP_EX (int, int);
84 static void OP_EMC (int,int);
85 static void OP_MXC (int,int);
86 static void OP_MS (int, int);
87 static void OP_XS (int, int);
88 static void OP_M (int, int);
89 static void OP_VEX (int, int);
90 static void OP_EX_Vex (int, int);
91 static void OP_EX_VexW (int, int);
92 static void OP_EX_VexImmW (int, int);
93 static void OP_XMM_Vex (int, int);
94 static void OP_XMM_VexW (int, int);
95 static void OP_Rounding (int, int);
96 static void OP_REG_VexI4 (int, int);
97 static void PCLMUL_Fixup (int, int);
98 static void VCMP_Fixup (int, int);
99 static void VPCMP_Fixup (int, int);
100 static void VPCOM_Fixup (int, int);
101 static void OP_0f07 (int, int);
102 static void OP_Monitor (int, int);
103 static void OP_Mwait (int, int);
104 static void OP_Mwaitx (int, int);
105 static void NOP_Fixup1 (int, int);
106 static void NOP_Fixup2 (int, int);
107 static void OP_3DNowSuffix (int, int);
108 static void CMP_Fixup (int, int);
109 static void BadOp (void);
110 static void REP_Fixup (int, int);
111 static void BND_Fixup (int, int);
112 static void NOTRACK_Fixup (int, int);
113 static void HLE_Fixup1 (int, int);
114 static void HLE_Fixup2 (int, int);
115 static void HLE_Fixup3 (int, int);
116 static void CMPXCHG8B_Fixup (int, int);
117 static void XMM_Fixup (int, int);
118 static void CRC32_Fixup (int, int);
119 static void FXSAVE_Fixup (int, int);
120 static void PCMPESTR_Fixup (int, int);
121 static void OP_LWPCB_E (int, int);
122 static void OP_LWP_E (int, int);
123 static void OP_Vex_2src_1 (int, int);
124 static void OP_Vex_2src_2 (int, int);
126 static void MOVBE_Fixup (int, int);
128 static void OP_Mask (int, int);
131 /* Points to first byte not fetched. */
132 bfd_byte *max_fetched;
133 bfd_byte the_buffer[MAX_MNEM_SIZE];
136 OPCODES_SIGJMP_BUF bailout;
146 enum address_mode address_mode;
148 /* Flags for the prefixes for the current instruction. See below. */
151 /* REX prefix the current instruction. See below. */
153 /* Bits of REX we've already used. */
155 /* REX bits in original REX prefix ignored. */
156 static int rex_ignored;
157 /* Mark parts used in the REX prefix. When we are testing for
158 empty prefix (for 8bit register REX extension), just mask it
159 out. Otherwise test for REX bit is excuse for existence of REX
160 only in case value is nonzero. */
161 #define USED_REX(value) \
166 rex_used |= (value) | REX_OPCODE; \
169 rex_used |= REX_OPCODE; \
172 /* Flags for prefixes which we somehow handled when printing the
173 current instruction. */
174 static int used_prefixes;
176 /* Flags stored in PREFIXES. */
177 #define PREFIX_REPZ 1
178 #define PREFIX_REPNZ 2
179 #define PREFIX_LOCK 4
181 #define PREFIX_SS 0x10
182 #define PREFIX_DS 0x20
183 #define PREFIX_ES 0x40
184 #define PREFIX_FS 0x80
185 #define PREFIX_GS 0x100
186 #define PREFIX_DATA 0x200
187 #define PREFIX_ADDR 0x400
188 #define PREFIX_FWAIT 0x800
190 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
191 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
193 #define FETCH_DATA(info, addr) \
194 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
195 ? 1 : fetch_data ((info), (addr)))
198 fetch_data (struct disassemble_info *info, bfd_byte *addr)
201 struct dis_private *priv = (struct dis_private *) info->private_data;
202 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
204 if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
205 status = (*info->read_memory_func) (start,
207 addr - priv->max_fetched,
213 /* If we did manage to read at least one byte, then
214 print_insn_i386 will do something sensible. Otherwise, print
215 an error. We do that here because this is where we know
217 if (priv->max_fetched == priv->the_buffer)
218 (*info->memory_error_func) (status, start, info);
219 OPCODES_SIGLONGJMP (priv->bailout, 1);
222 priv->max_fetched = addr;
226 /* Possible values for prefix requirement. */
227 #define PREFIX_IGNORED_SHIFT 16
228 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
229 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
230 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
231 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
232 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
234 /* Opcode prefixes. */
235 #define PREFIX_OPCODE (PREFIX_REPZ \
239 /* Prefixes ignored. */
240 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
241 | PREFIX_IGNORED_REPNZ \
242 | PREFIX_IGNORED_DATA)
244 #define XX { NULL, 0 }
245 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
247 #define Eb { OP_E, b_mode }
248 #define Ebnd { OP_E, bnd_mode }
249 #define EbS { OP_E, b_swap_mode }
250 #define EbndS { OP_E, bnd_swap_mode }
251 #define Ev { OP_E, v_mode }
252 #define Eva { OP_E, va_mode }
253 #define Ev_bnd { OP_E, v_bnd_mode }
254 #define EvS { OP_E, v_swap_mode }
255 #define Ed { OP_E, d_mode }
256 #define Edq { OP_E, dq_mode }
257 #define Edqw { OP_E, dqw_mode }
258 #define Edqb { OP_E, dqb_mode }
259 #define Edb { OP_E, db_mode }
260 #define Edw { OP_E, dw_mode }
261 #define Edqd { OP_E, dqd_mode }
262 #define Edqa { OP_E, dqa_mode }
263 #define Eq { OP_E, q_mode }
264 #define indirEv { OP_indirE, indir_v_mode }
265 #define indirEp { OP_indirE, f_mode }
266 #define stackEv { OP_E, stack_v_mode }
267 #define Em { OP_E, m_mode }
268 #define Ew { OP_E, w_mode }
269 #define M { OP_M, 0 } /* lea, lgdt, etc. */
270 #define Ma { OP_M, a_mode }
271 #define Mb { OP_M, b_mode }
272 #define Md { OP_M, d_mode }
273 #define Mo { OP_M, o_mode }
274 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
275 #define Mq { OP_M, q_mode }
276 #define Mv_bnd { OP_M, v_bndmk_mode }
277 #define Mx { OP_M, x_mode }
278 #define Mxmm { OP_M, xmm_mode }
279 #define Gb { OP_G, b_mode }
280 #define Gbnd { OP_G, bnd_mode }
281 #define Gv { OP_G, v_mode }
282 #define Gd { OP_G, d_mode }
283 #define Gdq { OP_G, dq_mode }
284 #define Gm { OP_G, m_mode }
285 #define Gva { OP_G, va_mode }
286 #define Gw { OP_G, w_mode }
287 #define Rd { OP_R, d_mode }
288 #define Rdq { OP_R, dq_mode }
289 #define Rm { OP_R, m_mode }
290 #define Ib { OP_I, b_mode }
291 #define sIb { OP_sI, b_mode } /* sign extened byte */
292 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
293 #define Iv { OP_I, v_mode }
294 #define sIv { OP_sI, v_mode }
295 #define Iq { OP_I, q_mode }
296 #define Iv64 { OP_I64, v_mode }
297 #define Iw { OP_I, w_mode }
298 #define I1 { OP_I, const_1_mode }
299 #define Jb { OP_J, b_mode }
300 #define Jv { OP_J, v_mode }
301 #define Cm { OP_C, m_mode }
302 #define Dm { OP_D, m_mode }
303 #define Td { OP_T, d_mode }
304 #define Skip_MODRM { OP_Skip_MODRM, 0 }
306 #define RMeAX { OP_REG, eAX_reg }
307 #define RMeBX { OP_REG, eBX_reg }
308 #define RMeCX { OP_REG, eCX_reg }
309 #define RMeDX { OP_REG, eDX_reg }
310 #define RMeSP { OP_REG, eSP_reg }
311 #define RMeBP { OP_REG, eBP_reg }
312 #define RMeSI { OP_REG, eSI_reg }
313 #define RMeDI { OP_REG, eDI_reg }
314 #define RMrAX { OP_REG, rAX_reg }
315 #define RMrBX { OP_REG, rBX_reg }
316 #define RMrCX { OP_REG, rCX_reg }
317 #define RMrDX { OP_REG, rDX_reg }
318 #define RMrSP { OP_REG, rSP_reg }
319 #define RMrBP { OP_REG, rBP_reg }
320 #define RMrSI { OP_REG, rSI_reg }
321 #define RMrDI { OP_REG, rDI_reg }
322 #define RMAL { OP_REG, al_reg }
323 #define RMCL { OP_REG, cl_reg }
324 #define RMDL { OP_REG, dl_reg }
325 #define RMBL { OP_REG, bl_reg }
326 #define RMAH { OP_REG, ah_reg }
327 #define RMCH { OP_REG, ch_reg }
328 #define RMDH { OP_REG, dh_reg }
329 #define RMBH { OP_REG, bh_reg }
330 #define RMAX { OP_REG, ax_reg }
331 #define RMDX { OP_REG, dx_reg }
333 #define eAX { OP_IMREG, eAX_reg }
334 #define eBX { OP_IMREG, eBX_reg }
335 #define eCX { OP_IMREG, eCX_reg }
336 #define eDX { OP_IMREG, eDX_reg }
337 #define eSP { OP_IMREG, eSP_reg }
338 #define eBP { OP_IMREG, eBP_reg }
339 #define eSI { OP_IMREG, eSI_reg }
340 #define eDI { OP_IMREG, eDI_reg }
341 #define AL { OP_IMREG, al_reg }
342 #define CL { OP_IMREG, cl_reg }
343 #define DL { OP_IMREG, dl_reg }
344 #define BL { OP_IMREG, bl_reg }
345 #define AH { OP_IMREG, ah_reg }
346 #define CH { OP_IMREG, ch_reg }
347 #define DH { OP_IMREG, dh_reg }
348 #define BH { OP_IMREG, bh_reg }
349 #define AX { OP_IMREG, ax_reg }
350 #define DX { OP_IMREG, dx_reg }
351 #define zAX { OP_IMREG, z_mode_ax_reg }
352 #define indirDX { OP_IMREG, indir_dx_reg }
354 #define Sw { OP_SEG, w_mode }
355 #define Sv { OP_SEG, v_mode }
356 #define Ap { OP_DIR, 0 }
357 #define Ob { OP_OFF64, b_mode }
358 #define Ov { OP_OFF64, v_mode }
359 #define Xb { OP_DSreg, eSI_reg }
360 #define Xv { OP_DSreg, eSI_reg }
361 #define Xz { OP_DSreg, eSI_reg }
362 #define Yb { OP_ESreg, eDI_reg }
363 #define Yv { OP_ESreg, eDI_reg }
364 #define DSBX { OP_DSreg, eBX_reg }
366 #define es { OP_REG, es_reg }
367 #define ss { OP_REG, ss_reg }
368 #define cs { OP_REG, cs_reg }
369 #define ds { OP_REG, ds_reg }
370 #define fs { OP_REG, fs_reg }
371 #define gs { OP_REG, gs_reg }
373 #define MX { OP_MMX, 0 }
374 #define XM { OP_XMM, 0 }
375 #define XMScalar { OP_XMM, scalar_mode }
376 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
377 #define XMM { OP_XMM, xmm_mode }
378 #define XMxmmq { OP_XMM, xmmq_mode }
379 #define EM { OP_EM, v_mode }
380 #define EMS { OP_EM, v_swap_mode }
381 #define EMd { OP_EM, d_mode }
382 #define EMx { OP_EM, x_mode }
383 #define EXbScalar { OP_EX, b_scalar_mode }
384 #define EXw { OP_EX, w_mode }
385 #define EXwScalar { OP_EX, w_scalar_mode }
386 #define EXd { OP_EX, d_mode }
387 #define EXdScalar { OP_EX, d_scalar_mode }
388 #define EXdS { OP_EX, d_swap_mode }
389 #define EXdScalarS { OP_EX, d_scalar_swap_mode }
390 #define EXq { OP_EX, q_mode }
391 #define EXqScalar { OP_EX, q_scalar_mode }
392 #define EXqScalarS { OP_EX, q_scalar_swap_mode }
393 #define EXqS { OP_EX, q_swap_mode }
394 #define EXx { OP_EX, x_mode }
395 #define EXxS { OP_EX, x_swap_mode }
396 #define EXxmm { OP_EX, xmm_mode }
397 #define EXymm { OP_EX, ymm_mode }
398 #define EXxmmq { OP_EX, xmmq_mode }
399 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
400 #define EXxmm_mb { OP_EX, xmm_mb_mode }
401 #define EXxmm_mw { OP_EX, xmm_mw_mode }
402 #define EXxmm_md { OP_EX, xmm_md_mode }
403 #define EXxmm_mq { OP_EX, xmm_mq_mode }
404 #define EXxmm_mdq { OP_EX, xmm_mdq_mode }
405 #define EXxmmdw { OP_EX, xmmdw_mode }
406 #define EXxmmqd { OP_EX, xmmqd_mode }
407 #define EXymmq { OP_EX, ymmq_mode }
408 #define EXVexWdq { OP_EX, vex_w_dq_mode }
409 #define EXVexWdqScalar { OP_EX, vex_scalar_w_dq_mode }
410 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
411 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
412 #define MS { OP_MS, v_mode }
413 #define XS { OP_XS, v_mode }
414 #define EMCq { OP_EMC, q_mode }
415 #define MXC { OP_MXC, 0 }
416 #define OPSUF { OP_3DNowSuffix, 0 }
417 #define CMP { CMP_Fixup, 0 }
418 #define XMM0 { XMM_Fixup, 0 }
419 #define FXSAVE { FXSAVE_Fixup, 0 }
420 #define Vex_2src_1 { OP_Vex_2src_1, 0 }
421 #define Vex_2src_2 { OP_Vex_2src_2, 0 }
423 #define Vex { OP_VEX, vex_mode }
424 #define VexScalar { OP_VEX, vex_scalar_mode }
425 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
426 #define Vex128 { OP_VEX, vex128_mode }
427 #define Vex256 { OP_VEX, vex256_mode }
428 #define VexGdq { OP_VEX, dq_mode }
429 #define EXdVex { OP_EX_Vex, d_mode }
430 #define EXdVexS { OP_EX_Vex, d_swap_mode }
431 #define EXdVexScalarS { OP_EX_Vex, d_scalar_swap_mode }
432 #define EXqVex { OP_EX_Vex, q_mode }
433 #define EXqVexS { OP_EX_Vex, q_swap_mode }
434 #define EXqVexScalarS { OP_EX_Vex, q_scalar_swap_mode }
435 #define EXVexW { OP_EX_VexW, x_mode }
436 #define EXdVexW { OP_EX_VexW, d_mode }
437 #define EXqVexW { OP_EX_VexW, q_mode }
438 #define EXVexImmW { OP_EX_VexImmW, x_mode }
439 #define XMVex { OP_XMM_Vex, 0 }
440 #define XMVexScalar { OP_XMM_Vex, scalar_mode }
441 #define XMVexW { OP_XMM_VexW, 0 }
442 #define XMVexI4 { OP_REG_VexI4, x_mode }
443 #define PCLMUL { PCLMUL_Fixup, 0 }
444 #define VCMP { VCMP_Fixup, 0 }
445 #define VPCMP { VPCMP_Fixup, 0 }
446 #define VPCOM { VPCOM_Fixup, 0 }
448 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
449 #define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
450 #define EXxEVexS { OP_Rounding, evex_sae_mode }
452 #define XMask { OP_Mask, mask_mode }
453 #define MaskG { OP_G, mask_mode }
454 #define MaskE { OP_E, mask_mode }
455 #define MaskBDE { OP_E, mask_bd_mode }
456 #define MaskR { OP_R, mask_mode }
457 #define MaskVex { OP_VEX, mask_mode }
459 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
460 #define MVexVSIBDQWpX { OP_M, vex_vsib_d_w_d_mode }
461 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
462 #define MVexVSIBQDWpX { OP_M, vex_vsib_q_w_d_mode }
464 /* Used handle "rep" prefix for string instructions. */
465 #define Xbr { REP_Fixup, eSI_reg }
466 #define Xvr { REP_Fixup, eSI_reg }
467 #define Ybr { REP_Fixup, eDI_reg }
468 #define Yvr { REP_Fixup, eDI_reg }
469 #define Yzr { REP_Fixup, eDI_reg }
470 #define indirDXr { REP_Fixup, indir_dx_reg }
471 #define ALr { REP_Fixup, al_reg }
472 #define eAXr { REP_Fixup, eAX_reg }
474 /* Used handle HLE prefix for lockable instructions. */
475 #define Ebh1 { HLE_Fixup1, b_mode }
476 #define Evh1 { HLE_Fixup1, v_mode }
477 #define Ebh2 { HLE_Fixup2, b_mode }
478 #define Evh2 { HLE_Fixup2, v_mode }
479 #define Ebh3 { HLE_Fixup3, b_mode }
480 #define Evh3 { HLE_Fixup3, v_mode }
482 #define BND { BND_Fixup, 0 }
483 #define NOTRACK { NOTRACK_Fixup, 0 }
485 #define cond_jump_flag { NULL, cond_jump_mode }
486 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
488 /* bits in sizeflag */
489 #define SUFFIX_ALWAYS 4
497 /* byte operand with operand swapped */
499 /* byte operand, sign extend like 'T' suffix */
501 /* operand size depends on prefixes */
503 /* operand size depends on prefixes with operand swapped */
505 /* operand size depends on address prefix */
509 /* double word operand */
511 /* double word operand with operand swapped */
513 /* quad word operand */
515 /* quad word operand with operand swapped */
517 /* ten-byte operand */
519 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
520 broadcast enabled. */
522 /* Similar to x_mode, but with different EVEX mem shifts. */
524 /* Similar to x_mode, but with disabled broadcast. */
526 /* Similar to x_mode, but with operands swapped and disabled broadcast
529 /* 16-byte XMM operand */
531 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
532 memory operand (depending on vector length). Broadcast isn't
535 /* Same as xmmq_mode, but broadcast is allowed. */
536 evex_half_bcst_xmmq_mode,
537 /* XMM register or byte memory operand */
539 /* XMM register or word memory operand */
541 /* XMM register or double word memory operand */
543 /* XMM register or quad word memory operand */
545 /* XMM register or double/quad word memory operand, depending on
548 /* 16-byte XMM, word, double word or quad word operand. */
550 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
552 /* 32-byte YMM operand */
554 /* quad word, ymmword or zmmword memory operand. */
556 /* 32-byte YMM or 16-byte word operand */
558 /* d_mode in 32bit, q_mode in 64bit mode. */
560 /* pair of v_mode operands */
565 /* like v_bnd_mode in 32bit, no RIP-rel in 64bit mode. */
567 /* operand size depends on REX prefixes. */
569 /* registers like dq_mode, memory like w_mode. */
573 /* bounds operand with operand swapped */
575 /* 4- or 6-byte pointer operand */
578 /* v_mode for indirect branch opcodes. */
580 /* v_mode for stack-related opcodes. */
582 /* non-quad operand size depends on prefixes */
584 /* 16-byte operand */
586 /* registers like dq_mode, memory like b_mode. */
588 /* registers like d_mode, memory like b_mode. */
590 /* registers like d_mode, memory like w_mode. */
592 /* registers like dq_mode, memory like d_mode. */
594 /* operand size depends on the W bit as well as address mode. */
596 /* normal vex mode */
598 /* 128bit vex mode */
600 /* 256bit vex mode */
602 /* operand size depends on the VEX.W bit. */
605 /* Similar to vex_w_dq_mode, with VSIB dword indices. */
606 vex_vsib_d_w_dq_mode,
607 /* Similar to vex_vsib_d_w_dq_mode, with smaller memory. */
609 /* Similar to vex_w_dq_mode, with VSIB qword indices. */
610 vex_vsib_q_w_dq_mode,
611 /* Similar to vex_vsib_q_w_dq_mode, with smaller memory. */
614 /* scalar, ignore vector length. */
616 /* like b_mode, ignore vector length. */
618 /* like w_mode, ignore vector length. */
620 /* like d_mode, ignore vector length. */
622 /* like d_swap_mode, ignore vector length. */
624 /* like q_mode, ignore vector length. */
626 /* like q_swap_mode, ignore vector length. */
628 /* like vex_mode, ignore vector length. */
630 /* like vex_w_dq_mode, ignore vector length. */
631 vex_scalar_w_dq_mode,
633 /* Static rounding. */
635 /* Static rounding, 64-bit mode only. */
636 evex_rounding_64_mode,
637 /* Supress all exceptions. */
640 /* Mask register operand. */
642 /* Mask register operand. */
710 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
712 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
713 #define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
714 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
715 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
716 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
717 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
718 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
719 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
720 #define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
721 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
722 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
723 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
724 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
725 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
726 #define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
727 #define EVEX_LEN_TABLE(I) DIS386 (USE_EVEX_LEN_TABLE, (I))
855 MOD_VEX_0F12_PREFIX_0,
857 MOD_VEX_0F16_PREFIX_0,
860 MOD_VEX_W_0_0F41_P_0_LEN_1,
861 MOD_VEX_W_1_0F41_P_0_LEN_1,
862 MOD_VEX_W_0_0F41_P_2_LEN_1,
863 MOD_VEX_W_1_0F41_P_2_LEN_1,
864 MOD_VEX_W_0_0F42_P_0_LEN_1,
865 MOD_VEX_W_1_0F42_P_0_LEN_1,
866 MOD_VEX_W_0_0F42_P_2_LEN_1,
867 MOD_VEX_W_1_0F42_P_2_LEN_1,
868 MOD_VEX_W_0_0F44_P_0_LEN_1,
869 MOD_VEX_W_1_0F44_P_0_LEN_1,
870 MOD_VEX_W_0_0F44_P_2_LEN_1,
871 MOD_VEX_W_1_0F44_P_2_LEN_1,
872 MOD_VEX_W_0_0F45_P_0_LEN_1,
873 MOD_VEX_W_1_0F45_P_0_LEN_1,
874 MOD_VEX_W_0_0F45_P_2_LEN_1,
875 MOD_VEX_W_1_0F45_P_2_LEN_1,
876 MOD_VEX_W_0_0F46_P_0_LEN_1,
877 MOD_VEX_W_1_0F46_P_0_LEN_1,
878 MOD_VEX_W_0_0F46_P_2_LEN_1,
879 MOD_VEX_W_1_0F46_P_2_LEN_1,
880 MOD_VEX_W_0_0F47_P_0_LEN_1,
881 MOD_VEX_W_1_0F47_P_0_LEN_1,
882 MOD_VEX_W_0_0F47_P_2_LEN_1,
883 MOD_VEX_W_1_0F47_P_2_LEN_1,
884 MOD_VEX_W_0_0F4A_P_0_LEN_1,
885 MOD_VEX_W_1_0F4A_P_0_LEN_1,
886 MOD_VEX_W_0_0F4A_P_2_LEN_1,
887 MOD_VEX_W_1_0F4A_P_2_LEN_1,
888 MOD_VEX_W_0_0F4B_P_0_LEN_1,
889 MOD_VEX_W_1_0F4B_P_0_LEN_1,
890 MOD_VEX_W_0_0F4B_P_2_LEN_1,
902 MOD_VEX_W_0_0F91_P_0_LEN_0,
903 MOD_VEX_W_1_0F91_P_0_LEN_0,
904 MOD_VEX_W_0_0F91_P_2_LEN_0,
905 MOD_VEX_W_1_0F91_P_2_LEN_0,
906 MOD_VEX_W_0_0F92_P_0_LEN_0,
907 MOD_VEX_W_0_0F92_P_2_LEN_0,
908 MOD_VEX_0F92_P_3_LEN_0,
909 MOD_VEX_W_0_0F93_P_0_LEN_0,
910 MOD_VEX_W_0_0F93_P_2_LEN_0,
911 MOD_VEX_0F93_P_3_LEN_0,
912 MOD_VEX_W_0_0F98_P_0_LEN_0,
913 MOD_VEX_W_1_0F98_P_0_LEN_0,
914 MOD_VEX_W_0_0F98_P_2_LEN_0,
915 MOD_VEX_W_1_0F98_P_2_LEN_0,
916 MOD_VEX_W_0_0F99_P_0_LEN_0,
917 MOD_VEX_W_1_0F99_P_0_LEN_0,
918 MOD_VEX_W_0_0F99_P_2_LEN_0,
919 MOD_VEX_W_1_0F99_P_2_LEN_0,
922 MOD_VEX_0FD7_PREFIX_2,
923 MOD_VEX_0FE7_PREFIX_2,
924 MOD_VEX_0FF0_PREFIX_3,
925 MOD_VEX_0F381A_PREFIX_2,
926 MOD_VEX_0F382A_PREFIX_2,
927 MOD_VEX_0F382C_PREFIX_2,
928 MOD_VEX_0F382D_PREFIX_2,
929 MOD_VEX_0F382E_PREFIX_2,
930 MOD_VEX_0F382F_PREFIX_2,
931 MOD_VEX_0F385A_PREFIX_2,
932 MOD_VEX_0F388C_PREFIX_2,
933 MOD_VEX_0F388E_PREFIX_2,
934 MOD_VEX_W_0_0F3A30_P_2_LEN_0,
935 MOD_VEX_W_1_0F3A30_P_2_LEN_0,
936 MOD_VEX_W_0_0F3A31_P_2_LEN_0,
937 MOD_VEX_W_1_0F3A31_P_2_LEN_0,
938 MOD_VEX_W_0_0F3A32_P_2_LEN_0,
939 MOD_VEX_W_1_0F3A32_P_2_LEN_0,
940 MOD_VEX_W_0_0F3A33_P_2_LEN_0,
941 MOD_VEX_W_1_0F3A33_P_2_LEN_0,
943 MOD_EVEX_0F10_PREFIX_1,
944 MOD_EVEX_0F10_PREFIX_3,
945 MOD_EVEX_0F11_PREFIX_1,
946 MOD_EVEX_0F11_PREFIX_3,
947 MOD_EVEX_0F12_PREFIX_0,
948 MOD_EVEX_0F16_PREFIX_0,
949 MOD_EVEX_0F38C6_REG_1,
950 MOD_EVEX_0F38C6_REG_2,
951 MOD_EVEX_0F38C6_REG_5,
952 MOD_EVEX_0F38C6_REG_6,
953 MOD_EVEX_0F38C7_REG_1,
954 MOD_EVEX_0F38C7_REG_2,
955 MOD_EVEX_0F38C7_REG_5,
956 MOD_EVEX_0F38C7_REG_6
977 PREFIX_MOD_0_0F01_REG_5,
978 PREFIX_MOD_3_0F01_REG_5_RM_0,
979 PREFIX_MOD_3_0F01_REG_5_RM_2,
1025 PREFIX_MOD_0_0FAE_REG_4,
1026 PREFIX_MOD_3_0FAE_REG_4,
1027 PREFIX_MOD_0_0FAE_REG_5,
1028 PREFIX_MOD_3_0FAE_REG_5,
1029 PREFIX_MOD_0_0FAE_REG_6,
1030 PREFIX_MOD_1_0FAE_REG_6,
1037 PREFIX_MOD_0_0FC7_REG_6,
1038 PREFIX_MOD_3_0FC7_REG_6,
1039 PREFIX_MOD_3_0FC7_REG_7,
1169 PREFIX_VEX_0F71_REG_2,
1170 PREFIX_VEX_0F71_REG_4,
1171 PREFIX_VEX_0F71_REG_6,
1172 PREFIX_VEX_0F72_REG_2,
1173 PREFIX_VEX_0F72_REG_4,
1174 PREFIX_VEX_0F72_REG_6,
1175 PREFIX_VEX_0F73_REG_2,
1176 PREFIX_VEX_0F73_REG_3,
1177 PREFIX_VEX_0F73_REG_6,
1178 PREFIX_VEX_0F73_REG_7,
1351 PREFIX_VEX_0F38F3_REG_1,
1352 PREFIX_VEX_0F38F3_REG_2,
1353 PREFIX_VEX_0F38F3_REG_3,
1472 PREFIX_EVEX_0F71_REG_2,
1473 PREFIX_EVEX_0F71_REG_4,
1474 PREFIX_EVEX_0F71_REG_6,
1475 PREFIX_EVEX_0F72_REG_0,
1476 PREFIX_EVEX_0F72_REG_1,
1477 PREFIX_EVEX_0F72_REG_2,
1478 PREFIX_EVEX_0F72_REG_4,
1479 PREFIX_EVEX_0F72_REG_6,
1480 PREFIX_EVEX_0F73_REG_2,
1481 PREFIX_EVEX_0F73_REG_3,
1482 PREFIX_EVEX_0F73_REG_6,
1483 PREFIX_EVEX_0F73_REG_7,
1679 PREFIX_EVEX_0F38C6_REG_1,
1680 PREFIX_EVEX_0F38C6_REG_2,
1681 PREFIX_EVEX_0F38C6_REG_5,
1682 PREFIX_EVEX_0F38C6_REG_6,
1683 PREFIX_EVEX_0F38C7_REG_1,
1684 PREFIX_EVEX_0F38C7_REG_2,
1685 PREFIX_EVEX_0F38C7_REG_5,
1686 PREFIX_EVEX_0F38C7_REG_6,
1788 THREE_BYTE_0F38 = 0,
1815 VEX_LEN_0F12_P_0_M_0 = 0,
1816 VEX_LEN_0F12_P_0_M_1,
1819 VEX_LEN_0F16_P_0_M_0,
1820 VEX_LEN_0F16_P_0_M_1,
1863 VEX_LEN_0FAE_R_2_M_0,
1864 VEX_LEN_0FAE_R_3_M_0,
1871 VEX_LEN_0F381A_P_2_M_0,
1874 VEX_LEN_0F385A_P_2_M_0,
1877 VEX_LEN_0F38F3_R_1_P_0,
1878 VEX_LEN_0F38F3_R_2_P_0,
1879 VEX_LEN_0F38F3_R_3_P_0,
1922 VEX_LEN_0FXOP_08_CC,
1923 VEX_LEN_0FXOP_08_CD,
1924 VEX_LEN_0FXOP_08_CE,
1925 VEX_LEN_0FXOP_08_CF,
1926 VEX_LEN_0FXOP_08_EC,
1927 VEX_LEN_0FXOP_08_ED,
1928 VEX_LEN_0FXOP_08_EE,
1929 VEX_LEN_0FXOP_08_EF,
1930 VEX_LEN_0FXOP_09_80,
1936 EVEX_LEN_0F6E_P_2 = 0,
1944 VEX_W_0F41_P_0_LEN_1 = 0,
1945 VEX_W_0F41_P_2_LEN_1,
1946 VEX_W_0F42_P_0_LEN_1,
1947 VEX_W_0F42_P_2_LEN_1,
1948 VEX_W_0F44_P_0_LEN_0,
1949 VEX_W_0F44_P_2_LEN_0,
1950 VEX_W_0F45_P_0_LEN_1,
1951 VEX_W_0F45_P_2_LEN_1,
1952 VEX_W_0F46_P_0_LEN_1,
1953 VEX_W_0F46_P_2_LEN_1,
1954 VEX_W_0F47_P_0_LEN_1,
1955 VEX_W_0F47_P_2_LEN_1,
1956 VEX_W_0F4A_P_0_LEN_1,
1957 VEX_W_0F4A_P_2_LEN_1,
1958 VEX_W_0F4B_P_0_LEN_1,
1959 VEX_W_0F4B_P_2_LEN_1,
1960 VEX_W_0F90_P_0_LEN_0,
1961 VEX_W_0F90_P_2_LEN_0,
1962 VEX_W_0F91_P_0_LEN_0,
1963 VEX_W_0F91_P_2_LEN_0,
1964 VEX_W_0F92_P_0_LEN_0,
1965 VEX_W_0F92_P_2_LEN_0,
1966 VEX_W_0F93_P_0_LEN_0,
1967 VEX_W_0F93_P_2_LEN_0,
1968 VEX_W_0F98_P_0_LEN_0,
1969 VEX_W_0F98_P_2_LEN_0,
1970 VEX_W_0F99_P_0_LEN_0,
1971 VEX_W_0F99_P_2_LEN_0,
1979 VEX_W_0F381A_P_2_M_0,
1980 VEX_W_0F382C_P_2_M_0,
1981 VEX_W_0F382D_P_2_M_0,
1982 VEX_W_0F382E_P_2_M_0,
1983 VEX_W_0F382F_P_2_M_0,
1988 VEX_W_0F385A_P_2_M_0,
2000 VEX_W_0F3A30_P_2_LEN_0,
2001 VEX_W_0F3A31_P_2_LEN_0,
2002 VEX_W_0F3A32_P_2_LEN_0,
2003 VEX_W_0F3A33_P_2_LEN_0,
2016 EVEX_W_0F10_P_1_M_0,
2017 EVEX_W_0F10_P_1_M_1,
2019 EVEX_W_0F10_P_3_M_0,
2020 EVEX_W_0F10_P_3_M_1,
2022 EVEX_W_0F11_P_1_M_0,
2023 EVEX_W_0F11_P_1_M_1,
2025 EVEX_W_0F11_P_3_M_0,
2026 EVEX_W_0F11_P_3_M_1,
2027 EVEX_W_0F12_P_0_M_0,
2028 EVEX_W_0F12_P_0_M_1,
2038 EVEX_W_0F16_P_0_M_0,
2039 EVEX_W_0F16_P_0_M_1,
2109 EVEX_W_0F72_R_2_P_2,
2110 EVEX_W_0F72_R_6_P_2,
2111 EVEX_W_0F73_R_2_P_2,
2112 EVEX_W_0F73_R_6_P_2,
2222 EVEX_W_0F38C7_R_1_P_2,
2223 EVEX_W_0F38C7_R_2_P_2,
2224 EVEX_W_0F38C7_R_5_P_2,
2225 EVEX_W_0F38C7_R_6_P_2,
2264 typedef void (*op_rtn) (int bytemode, int sizeflag);
2273 unsigned int prefix_requirement;
2276 /* Upper case letters in the instruction names here are macros.
2277 'A' => print 'b' if no register operands or suffix_always is true
2278 'B' => print 'b' if suffix_always is true
2279 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
2281 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
2282 suffix_always is true
2283 'E' => print 'e' if 32-bit form of jcxz
2284 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
2285 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
2286 'H' => print ",pt" or ",pn" branch hint
2287 'I' => honor following macro letter even in Intel mode (implemented only
2288 for some of the macro letters)
2290 'K' => print 'd' or 'q' if rex prefix is present.
2291 'L' => print 'l' if suffix_always is true
2292 'M' => print 'r' if intel_mnemonic is false.
2293 'N' => print 'n' if instruction has no wait "prefix"
2294 'O' => print 'd' or 'o' (or 'q' in Intel mode)
2295 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
2296 or suffix_always is true. print 'q' if rex prefix is present.
2297 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
2299 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
2300 'S' => print 'w', 'l' or 'q' if suffix_always is true
2301 'T' => print 'q' in 64bit mode if instruction has no operand size
2302 prefix and behave as 'P' otherwise
2303 'U' => print 'q' in 64bit mode if instruction has no operand size
2304 prefix and behave as 'Q' otherwise
2305 'V' => print 'q' in 64bit mode if instruction has no operand size
2306 prefix and behave as 'S' otherwise
2307 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
2308 'X' => print 's', 'd' depending on data16 prefix (for XMM)
2310 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
2311 '!' => change condition from true to false or from false to true.
2312 '%' => add 1 upper case letter to the macro.
2313 '^' => print 'w' or 'l' depending on operand size prefix or
2314 suffix_always is true (lcall/ljmp).
2315 '@' => print 'q' for Intel64 ISA, 'w' or 'q' for AMD64 ISA depending
2316 on operand size prefix.
2317 '&' => print 'q' in 64bit mode for Intel64 ISA or if instruction
2318 has no operand size prefix for AMD64 ISA, behave as 'P'
2321 2 upper case letter macros:
2322 "XY" => print 'x' or 'y' if suffix_always is true or no register
2323 operands and no broadcast.
2324 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
2325 register operands and no broadcast.
2326 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
2327 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand
2328 or suffix_always is true
2329 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
2330 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
2331 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
2332 "LW" => print 'd', 'q' depending on the VEX.W bit
2333 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
2334 an operand size prefix, or suffix_always is true. print
2335 'q' if rex prefix is present.
2337 Many of the above letters print nothing in Intel mode. See "putop"
2340 Braces '{' and '}', and vertical bars '|', indicate alternative
2341 mnemonic strings for AT&T and Intel. */
2343 static const struct dis386 dis386[] = {
2345 { "addB", { Ebh1, Gb }, 0 },
2346 { "addS", { Evh1, Gv }, 0 },
2347 { "addB", { Gb, EbS }, 0 },
2348 { "addS", { Gv, EvS }, 0 },
2349 { "addB", { AL, Ib }, 0 },
2350 { "addS", { eAX, Iv }, 0 },
2351 { X86_64_TABLE (X86_64_06) },
2352 { X86_64_TABLE (X86_64_07) },
2354 { "orB", { Ebh1, Gb }, 0 },
2355 { "orS", { Evh1, Gv }, 0 },
2356 { "orB", { Gb, EbS }, 0 },
2357 { "orS", { Gv, EvS }, 0 },
2358 { "orB", { AL, Ib }, 0 },
2359 { "orS", { eAX, Iv }, 0 },
2360 { X86_64_TABLE (X86_64_0D) },
2361 { Bad_Opcode }, /* 0x0f extended opcode escape */
2363 { "adcB", { Ebh1, Gb }, 0 },
2364 { "adcS", { Evh1, Gv }, 0 },
2365 { "adcB", { Gb, EbS }, 0 },
2366 { "adcS", { Gv, EvS }, 0 },
2367 { "adcB", { AL, Ib }, 0 },
2368 { "adcS", { eAX, Iv }, 0 },
2369 { X86_64_TABLE (X86_64_16) },
2370 { X86_64_TABLE (X86_64_17) },
2372 { "sbbB", { Ebh1, Gb }, 0 },
2373 { "sbbS", { Evh1, Gv }, 0 },
2374 { "sbbB", { Gb, EbS }, 0 },
2375 { "sbbS", { Gv, EvS }, 0 },
2376 { "sbbB", { AL, Ib }, 0 },
2377 { "sbbS", { eAX, Iv }, 0 },
2378 { X86_64_TABLE (X86_64_1E) },
2379 { X86_64_TABLE (X86_64_1F) },
2381 { "andB", { Ebh1, Gb }, 0 },
2382 { "andS", { Evh1, Gv }, 0 },
2383 { "andB", { Gb, EbS }, 0 },
2384 { "andS", { Gv, EvS }, 0 },
2385 { "andB", { AL, Ib }, 0 },
2386 { "andS", { eAX, Iv }, 0 },
2387 { Bad_Opcode }, /* SEG ES prefix */
2388 { X86_64_TABLE (X86_64_27) },
2390 { "subB", { Ebh1, Gb }, 0 },
2391 { "subS", { Evh1, Gv }, 0 },
2392 { "subB", { Gb, EbS }, 0 },
2393 { "subS", { Gv, EvS }, 0 },
2394 { "subB", { AL, Ib }, 0 },
2395 { "subS", { eAX, Iv }, 0 },
2396 { Bad_Opcode }, /* SEG CS prefix */
2397 { X86_64_TABLE (X86_64_2F) },
2399 { "xorB", { Ebh1, Gb }, 0 },
2400 { "xorS", { Evh1, Gv }, 0 },
2401 { "xorB", { Gb, EbS }, 0 },
2402 { "xorS", { Gv, EvS }, 0 },
2403 { "xorB", { AL, Ib }, 0 },
2404 { "xorS", { eAX, Iv }, 0 },
2405 { Bad_Opcode }, /* SEG SS prefix */
2406 { X86_64_TABLE (X86_64_37) },
2408 { "cmpB", { Eb, Gb }, 0 },
2409 { "cmpS", { Ev, Gv }, 0 },
2410 { "cmpB", { Gb, EbS }, 0 },
2411 { "cmpS", { Gv, EvS }, 0 },
2412 { "cmpB", { AL, Ib }, 0 },
2413 { "cmpS", { eAX, Iv }, 0 },
2414 { Bad_Opcode }, /* SEG DS prefix */
2415 { X86_64_TABLE (X86_64_3F) },
2417 { "inc{S|}", { RMeAX }, 0 },
2418 { "inc{S|}", { RMeCX }, 0 },
2419 { "inc{S|}", { RMeDX }, 0 },
2420 { "inc{S|}", { RMeBX }, 0 },
2421 { "inc{S|}", { RMeSP }, 0 },
2422 { "inc{S|}", { RMeBP }, 0 },
2423 { "inc{S|}", { RMeSI }, 0 },
2424 { "inc{S|}", { RMeDI }, 0 },
2426 { "dec{S|}", { RMeAX }, 0 },
2427 { "dec{S|}", { RMeCX }, 0 },
2428 { "dec{S|}", { RMeDX }, 0 },
2429 { "dec{S|}", { RMeBX }, 0 },
2430 { "dec{S|}", { RMeSP }, 0 },
2431 { "dec{S|}", { RMeBP }, 0 },
2432 { "dec{S|}", { RMeSI }, 0 },
2433 { "dec{S|}", { RMeDI }, 0 },
2435 { "pushV", { RMrAX }, 0 },
2436 { "pushV", { RMrCX }, 0 },
2437 { "pushV", { RMrDX }, 0 },
2438 { "pushV", { RMrBX }, 0 },
2439 { "pushV", { RMrSP }, 0 },
2440 { "pushV", { RMrBP }, 0 },
2441 { "pushV", { RMrSI }, 0 },
2442 { "pushV", { RMrDI }, 0 },
2444 { "popV", { RMrAX }, 0 },
2445 { "popV", { RMrCX }, 0 },
2446 { "popV", { RMrDX }, 0 },
2447 { "popV", { RMrBX }, 0 },
2448 { "popV", { RMrSP }, 0 },
2449 { "popV", { RMrBP }, 0 },
2450 { "popV", { RMrSI }, 0 },
2451 { "popV", { RMrDI }, 0 },
2453 { X86_64_TABLE (X86_64_60) },
2454 { X86_64_TABLE (X86_64_61) },
2455 { X86_64_TABLE (X86_64_62) },
2456 { X86_64_TABLE (X86_64_63) },
2457 { Bad_Opcode }, /* seg fs */
2458 { Bad_Opcode }, /* seg gs */
2459 { Bad_Opcode }, /* op size prefix */
2460 { Bad_Opcode }, /* adr size prefix */
2462 { "pushT", { sIv }, 0 },
2463 { "imulS", { Gv, Ev, Iv }, 0 },
2464 { "pushT", { sIbT }, 0 },
2465 { "imulS", { Gv, Ev, sIb }, 0 },
2466 { "ins{b|}", { Ybr, indirDX }, 0 },
2467 { X86_64_TABLE (X86_64_6D) },
2468 { "outs{b|}", { indirDXr, Xb }, 0 },
2469 { X86_64_TABLE (X86_64_6F) },
2471 { "joH", { Jb, BND, cond_jump_flag }, 0 },
2472 { "jnoH", { Jb, BND, cond_jump_flag }, 0 },
2473 { "jbH", { Jb, BND, cond_jump_flag }, 0 },
2474 { "jaeH", { Jb, BND, cond_jump_flag }, 0 },
2475 { "jeH", { Jb, BND, cond_jump_flag }, 0 },
2476 { "jneH", { Jb, BND, cond_jump_flag }, 0 },
2477 { "jbeH", { Jb, BND, cond_jump_flag }, 0 },
2478 { "jaH", { Jb, BND, cond_jump_flag }, 0 },
2480 { "jsH", { Jb, BND, cond_jump_flag }, 0 },
2481 { "jnsH", { Jb, BND, cond_jump_flag }, 0 },
2482 { "jpH", { Jb, BND, cond_jump_flag }, 0 },
2483 { "jnpH", { Jb, BND, cond_jump_flag }, 0 },
2484 { "jlH", { Jb, BND, cond_jump_flag }, 0 },
2485 { "jgeH", { Jb, BND, cond_jump_flag }, 0 },
2486 { "jleH", { Jb, BND, cond_jump_flag }, 0 },
2487 { "jgH", { Jb, BND, cond_jump_flag }, 0 },
2489 { REG_TABLE (REG_80) },
2490 { REG_TABLE (REG_81) },
2491 { X86_64_TABLE (X86_64_82) },
2492 { REG_TABLE (REG_83) },
2493 { "testB", { Eb, Gb }, 0 },
2494 { "testS", { Ev, Gv }, 0 },
2495 { "xchgB", { Ebh2, Gb }, 0 },
2496 { "xchgS", { Evh2, Gv }, 0 },
2498 { "movB", { Ebh3, Gb }, 0 },
2499 { "movS", { Evh3, Gv }, 0 },
2500 { "movB", { Gb, EbS }, 0 },
2501 { "movS", { Gv, EvS }, 0 },
2502 { "movD", { Sv, Sw }, 0 },
2503 { MOD_TABLE (MOD_8D) },
2504 { "movD", { Sw, Sv }, 0 },
2505 { REG_TABLE (REG_8F) },
2507 { PREFIX_TABLE (PREFIX_90) },
2508 { "xchgS", { RMeCX, eAX }, 0 },
2509 { "xchgS", { RMeDX, eAX }, 0 },
2510 { "xchgS", { RMeBX, eAX }, 0 },
2511 { "xchgS", { RMeSP, eAX }, 0 },
2512 { "xchgS", { RMeBP, eAX }, 0 },
2513 { "xchgS", { RMeSI, eAX }, 0 },
2514 { "xchgS", { RMeDI, eAX }, 0 },
2516 { "cW{t|}R", { XX }, 0 },
2517 { "cR{t|}O", { XX }, 0 },
2518 { X86_64_TABLE (X86_64_9A) },
2519 { Bad_Opcode }, /* fwait */
2520 { "pushfT", { XX }, 0 },
2521 { "popfT", { XX }, 0 },
2522 { "sahf", { XX }, 0 },
2523 { "lahf", { XX }, 0 },
2525 { "mov%LB", { AL, Ob }, 0 },
2526 { "mov%LS", { eAX, Ov }, 0 },
2527 { "mov%LB", { Ob, AL }, 0 },
2528 { "mov%LS", { Ov, eAX }, 0 },
2529 { "movs{b|}", { Ybr, Xb }, 0 },
2530 { "movs{R|}", { Yvr, Xv }, 0 },
2531 { "cmps{b|}", { Xb, Yb }, 0 },
2532 { "cmps{R|}", { Xv, Yv }, 0 },
2534 { "testB", { AL, Ib }, 0 },
2535 { "testS", { eAX, Iv }, 0 },
2536 { "stosB", { Ybr, AL }, 0 },
2537 { "stosS", { Yvr, eAX }, 0 },
2538 { "lodsB", { ALr, Xb }, 0 },
2539 { "lodsS", { eAXr, Xv }, 0 },
2540 { "scasB", { AL, Yb }, 0 },
2541 { "scasS", { eAX, Yv }, 0 },
2543 { "movB", { RMAL, Ib }, 0 },
2544 { "movB", { RMCL, Ib }, 0 },
2545 { "movB", { RMDL, Ib }, 0 },
2546 { "movB", { RMBL, Ib }, 0 },
2547 { "movB", { RMAH, Ib }, 0 },
2548 { "movB", { RMCH, Ib }, 0 },
2549 { "movB", { RMDH, Ib }, 0 },
2550 { "movB", { RMBH, Ib }, 0 },
2552 { "mov%LV", { RMeAX, Iv64 }, 0 },
2553 { "mov%LV", { RMeCX, Iv64 }, 0 },
2554 { "mov%LV", { RMeDX, Iv64 }, 0 },
2555 { "mov%LV", { RMeBX, Iv64 }, 0 },
2556 { "mov%LV", { RMeSP, Iv64 }, 0 },
2557 { "mov%LV", { RMeBP, Iv64 }, 0 },
2558 { "mov%LV", { RMeSI, Iv64 }, 0 },
2559 { "mov%LV", { RMeDI, Iv64 }, 0 },
2561 { REG_TABLE (REG_C0) },
2562 { REG_TABLE (REG_C1) },
2563 { "retT", { Iw, BND }, 0 },
2564 { "retT", { BND }, 0 },
2565 { X86_64_TABLE (X86_64_C4) },
2566 { X86_64_TABLE (X86_64_C5) },
2567 { REG_TABLE (REG_C6) },
2568 { REG_TABLE (REG_C7) },
2570 { "enterT", { Iw, Ib }, 0 },
2571 { "leaveT", { XX }, 0 },
2572 { "Jret{|f}P", { Iw }, 0 },
2573 { "Jret{|f}P", { XX }, 0 },
2574 { "int3", { XX }, 0 },
2575 { "int", { Ib }, 0 },
2576 { X86_64_TABLE (X86_64_CE) },
2577 { "iret%LP", { XX }, 0 },
2579 { REG_TABLE (REG_D0) },
2580 { REG_TABLE (REG_D1) },
2581 { REG_TABLE (REG_D2) },
2582 { REG_TABLE (REG_D3) },
2583 { X86_64_TABLE (X86_64_D4) },
2584 { X86_64_TABLE (X86_64_D5) },
2586 { "xlat", { DSBX }, 0 },
2597 { "loopneFH", { Jb, XX, loop_jcxz_flag }, 0 },
2598 { "loopeFH", { Jb, XX, loop_jcxz_flag }, 0 },
2599 { "loopFH", { Jb, XX, loop_jcxz_flag }, 0 },
2600 { "jEcxzH", { Jb, XX, loop_jcxz_flag }, 0 },
2601 { "inB", { AL, Ib }, 0 },
2602 { "inG", { zAX, Ib }, 0 },
2603 { "outB", { Ib, AL }, 0 },
2604 { "outG", { Ib, zAX }, 0 },
2606 { X86_64_TABLE (X86_64_E8) },
2607 { X86_64_TABLE (X86_64_E9) },
2608 { X86_64_TABLE (X86_64_EA) },
2609 { "jmp", { Jb, BND }, 0 },
2610 { "inB", { AL, indirDX }, 0 },
2611 { "inG", { zAX, indirDX }, 0 },
2612 { "outB", { indirDX, AL }, 0 },
2613 { "outG", { indirDX, zAX }, 0 },
2615 { Bad_Opcode }, /* lock prefix */
2616 { "icebp", { XX }, 0 },
2617 { Bad_Opcode }, /* repne */
2618 { Bad_Opcode }, /* repz */
2619 { "hlt", { XX }, 0 },
2620 { "cmc", { XX }, 0 },
2621 { REG_TABLE (REG_F6) },
2622 { REG_TABLE (REG_F7) },
2624 { "clc", { XX }, 0 },
2625 { "stc", { XX }, 0 },
2626 { "cli", { XX }, 0 },
2627 { "sti", { XX }, 0 },
2628 { "cld", { XX }, 0 },
2629 { "std", { XX }, 0 },
2630 { REG_TABLE (REG_FE) },
2631 { REG_TABLE (REG_FF) },
2634 static const struct dis386 dis386_twobyte[] = {
2636 { REG_TABLE (REG_0F00 ) },
2637 { REG_TABLE (REG_0F01 ) },
2638 { "larS", { Gv, Ew }, 0 },
2639 { "lslS", { Gv, Ew }, 0 },
2641 { "syscall", { XX }, 0 },
2642 { "clts", { XX }, 0 },
2643 { "sysret%LP", { XX }, 0 },
2645 { "invd", { XX }, 0 },
2646 { PREFIX_TABLE (PREFIX_0F09) },
2648 { "ud2", { XX }, 0 },
2650 { REG_TABLE (REG_0F0D) },
2651 { "femms", { XX }, 0 },
2652 { "", { MX, EM, OPSUF }, 0 }, /* See OP_3DNowSuffix. */
2654 { PREFIX_TABLE (PREFIX_0F10) },
2655 { PREFIX_TABLE (PREFIX_0F11) },
2656 { PREFIX_TABLE (PREFIX_0F12) },
2657 { MOD_TABLE (MOD_0F13) },
2658 { "unpcklpX", { XM, EXx }, PREFIX_OPCODE },
2659 { "unpckhpX", { XM, EXx }, PREFIX_OPCODE },
2660 { PREFIX_TABLE (PREFIX_0F16) },
2661 { MOD_TABLE (MOD_0F17) },
2663 { REG_TABLE (REG_0F18) },
2664 { "nopQ", { Ev }, 0 },
2665 { PREFIX_TABLE (PREFIX_0F1A) },
2666 { PREFIX_TABLE (PREFIX_0F1B) },
2667 { PREFIX_TABLE (PREFIX_0F1C) },
2668 { "nopQ", { Ev }, 0 },
2669 { PREFIX_TABLE (PREFIX_0F1E) },
2670 { "nopQ", { Ev }, 0 },
2672 { "movZ", { Rm, Cm }, 0 },
2673 { "movZ", { Rm, Dm }, 0 },
2674 { "movZ", { Cm, Rm }, 0 },
2675 { "movZ", { Dm, Rm }, 0 },
2676 { MOD_TABLE (MOD_0F24) },
2678 { MOD_TABLE (MOD_0F26) },
2681 { "movapX", { XM, EXx }, PREFIX_OPCODE },
2682 { "movapX", { EXxS, XM }, PREFIX_OPCODE },
2683 { PREFIX_TABLE (PREFIX_0F2A) },
2684 { PREFIX_TABLE (PREFIX_0F2B) },
2685 { PREFIX_TABLE (PREFIX_0F2C) },
2686 { PREFIX_TABLE (PREFIX_0F2D) },
2687 { PREFIX_TABLE (PREFIX_0F2E) },
2688 { PREFIX_TABLE (PREFIX_0F2F) },
2690 { "wrmsr", { XX }, 0 },
2691 { "rdtsc", { XX }, 0 },
2692 { "rdmsr", { XX }, 0 },
2693 { "rdpmc", { XX }, 0 },
2694 { "sysenter", { XX }, 0 },
2695 { "sysexit", { XX }, 0 },
2697 { "getsec", { XX }, 0 },
2699 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38, PREFIX_OPCODE) },
2701 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A, PREFIX_OPCODE) },
2708 { "cmovoS", { Gv, Ev }, 0 },
2709 { "cmovnoS", { Gv, Ev }, 0 },
2710 { "cmovbS", { Gv, Ev }, 0 },
2711 { "cmovaeS", { Gv, Ev }, 0 },
2712 { "cmoveS", { Gv, Ev }, 0 },
2713 { "cmovneS", { Gv, Ev }, 0 },
2714 { "cmovbeS", { Gv, Ev }, 0 },
2715 { "cmovaS", { Gv, Ev }, 0 },
2717 { "cmovsS", { Gv, Ev }, 0 },
2718 { "cmovnsS", { Gv, Ev }, 0 },
2719 { "cmovpS", { Gv, Ev }, 0 },
2720 { "cmovnpS", { Gv, Ev }, 0 },
2721 { "cmovlS", { Gv, Ev }, 0 },
2722 { "cmovgeS", { Gv, Ev }, 0 },
2723 { "cmovleS", { Gv, Ev }, 0 },
2724 { "cmovgS", { Gv, Ev }, 0 },
2726 { MOD_TABLE (MOD_0F51) },
2727 { PREFIX_TABLE (PREFIX_0F51) },
2728 { PREFIX_TABLE (PREFIX_0F52) },
2729 { PREFIX_TABLE (PREFIX_0F53) },
2730 { "andpX", { XM, EXx }, PREFIX_OPCODE },
2731 { "andnpX", { XM, EXx }, PREFIX_OPCODE },
2732 { "orpX", { XM, EXx }, PREFIX_OPCODE },
2733 { "xorpX", { XM, EXx }, PREFIX_OPCODE },
2735 { PREFIX_TABLE (PREFIX_0F58) },
2736 { PREFIX_TABLE (PREFIX_0F59) },
2737 { PREFIX_TABLE (PREFIX_0F5A) },
2738 { PREFIX_TABLE (PREFIX_0F5B) },
2739 { PREFIX_TABLE (PREFIX_0F5C) },
2740 { PREFIX_TABLE (PREFIX_0F5D) },
2741 { PREFIX_TABLE (PREFIX_0F5E) },
2742 { PREFIX_TABLE (PREFIX_0F5F) },
2744 { PREFIX_TABLE (PREFIX_0F60) },
2745 { PREFIX_TABLE (PREFIX_0F61) },
2746 { PREFIX_TABLE (PREFIX_0F62) },
2747 { "packsswb", { MX, EM }, PREFIX_OPCODE },
2748 { "pcmpgtb", { MX, EM }, PREFIX_OPCODE },
2749 { "pcmpgtw", { MX, EM }, PREFIX_OPCODE },
2750 { "pcmpgtd", { MX, EM }, PREFIX_OPCODE },
2751 { "packuswb", { MX, EM }, PREFIX_OPCODE },
2753 { "punpckhbw", { MX, EM }, PREFIX_OPCODE },
2754 { "punpckhwd", { MX, EM }, PREFIX_OPCODE },
2755 { "punpckhdq", { MX, EM }, PREFIX_OPCODE },
2756 { "packssdw", { MX, EM }, PREFIX_OPCODE },
2757 { PREFIX_TABLE (PREFIX_0F6C) },
2758 { PREFIX_TABLE (PREFIX_0F6D) },
2759 { "movK", { MX, Edq }, PREFIX_OPCODE },
2760 { PREFIX_TABLE (PREFIX_0F6F) },
2762 { PREFIX_TABLE (PREFIX_0F70) },
2763 { REG_TABLE (REG_0F71) },
2764 { REG_TABLE (REG_0F72) },
2765 { REG_TABLE (REG_0F73) },
2766 { "pcmpeqb", { MX, EM }, PREFIX_OPCODE },
2767 { "pcmpeqw", { MX, EM }, PREFIX_OPCODE },
2768 { "pcmpeqd", { MX, EM }, PREFIX_OPCODE },
2769 { "emms", { XX }, PREFIX_OPCODE },
2771 { PREFIX_TABLE (PREFIX_0F78) },
2772 { PREFIX_TABLE (PREFIX_0F79) },
2775 { PREFIX_TABLE (PREFIX_0F7C) },
2776 { PREFIX_TABLE (PREFIX_0F7D) },
2777 { PREFIX_TABLE (PREFIX_0F7E) },
2778 { PREFIX_TABLE (PREFIX_0F7F) },
2780 { "joH", { Jv, BND, cond_jump_flag }, 0 },
2781 { "jnoH", { Jv, BND, cond_jump_flag }, 0 },
2782 { "jbH", { Jv, BND, cond_jump_flag }, 0 },
2783 { "jaeH", { Jv, BND, cond_jump_flag }, 0 },
2784 { "jeH", { Jv, BND, cond_jump_flag }, 0 },
2785 { "jneH", { Jv, BND, cond_jump_flag }, 0 },
2786 { "jbeH", { Jv, BND, cond_jump_flag }, 0 },
2787 { "jaH", { Jv, BND, cond_jump_flag }, 0 },
2789 { "jsH", { Jv, BND, cond_jump_flag }, 0 },
2790 { "jnsH", { Jv, BND, cond_jump_flag }, 0 },
2791 { "jpH", { Jv, BND, cond_jump_flag }, 0 },
2792 { "jnpH", { Jv, BND, cond_jump_flag }, 0 },
2793 { "jlH", { Jv, BND, cond_jump_flag }, 0 },
2794 { "jgeH", { Jv, BND, cond_jump_flag }, 0 },
2795 { "jleH", { Jv, BND, cond_jump_flag }, 0 },
2796 { "jgH", { Jv, BND, cond_jump_flag }, 0 },
2798 { "seto", { Eb }, 0 },
2799 { "setno", { Eb }, 0 },
2800 { "setb", { Eb }, 0 },
2801 { "setae", { Eb }, 0 },
2802 { "sete", { Eb }, 0 },
2803 { "setne", { Eb }, 0 },
2804 { "setbe", { Eb }, 0 },
2805 { "seta", { Eb }, 0 },
2807 { "sets", { Eb }, 0 },
2808 { "setns", { Eb }, 0 },
2809 { "setp", { Eb }, 0 },
2810 { "setnp", { Eb }, 0 },
2811 { "setl", { Eb }, 0 },
2812 { "setge", { Eb }, 0 },
2813 { "setle", { Eb }, 0 },
2814 { "setg", { Eb }, 0 },
2816 { "pushT", { fs }, 0 },
2817 { "popT", { fs }, 0 },
2818 { "cpuid", { XX }, 0 },
2819 { "btS", { Ev, Gv }, 0 },
2820 { "shldS", { Ev, Gv, Ib }, 0 },
2821 { "shldS", { Ev, Gv, CL }, 0 },
2822 { REG_TABLE (REG_0FA6) },
2823 { REG_TABLE (REG_0FA7) },
2825 { "pushT", { gs }, 0 },
2826 { "popT", { gs }, 0 },
2827 { "rsm", { XX }, 0 },
2828 { "btsS", { Evh1, Gv }, 0 },
2829 { "shrdS", { Ev, Gv, Ib }, 0 },
2830 { "shrdS", { Ev, Gv, CL }, 0 },
2831 { REG_TABLE (REG_0FAE) },
2832 { "imulS", { Gv, Ev }, 0 },
2834 { "cmpxchgB", { Ebh1, Gb }, 0 },
2835 { "cmpxchgS", { Evh1, Gv }, 0 },
2836 { MOD_TABLE (MOD_0FB2) },
2837 { "btrS", { Evh1, Gv }, 0 },
2838 { MOD_TABLE (MOD_0FB4) },
2839 { MOD_TABLE (MOD_0FB5) },
2840 { "movz{bR|x}", { Gv, Eb }, 0 },
2841 { "movz{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movzww ! */
2843 { PREFIX_TABLE (PREFIX_0FB8) },
2844 { "ud1S", { Gv, Ev }, 0 },
2845 { REG_TABLE (REG_0FBA) },
2846 { "btcS", { Evh1, Gv }, 0 },
2847 { PREFIX_TABLE (PREFIX_0FBC) },
2848 { PREFIX_TABLE (PREFIX_0FBD) },
2849 { "movs{bR|x}", { Gv, Eb }, 0 },
2850 { "movs{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movsww ! */
2852 { "xaddB", { Ebh1, Gb }, 0 },
2853 { "xaddS", { Evh1, Gv }, 0 },
2854 { PREFIX_TABLE (PREFIX_0FC2) },
2855 { MOD_TABLE (MOD_0FC3) },
2856 { "pinsrw", { MX, Edqw, Ib }, PREFIX_OPCODE },
2857 { "pextrw", { Gdq, MS, Ib }, PREFIX_OPCODE },
2858 { "shufpX", { XM, EXx, Ib }, PREFIX_OPCODE },
2859 { REG_TABLE (REG_0FC7) },
2861 { "bswap", { RMeAX }, 0 },
2862 { "bswap", { RMeCX }, 0 },
2863 { "bswap", { RMeDX }, 0 },
2864 { "bswap", { RMeBX }, 0 },
2865 { "bswap", { RMeSP }, 0 },
2866 { "bswap", { RMeBP }, 0 },
2867 { "bswap", { RMeSI }, 0 },
2868 { "bswap", { RMeDI }, 0 },
2870 { PREFIX_TABLE (PREFIX_0FD0) },
2871 { "psrlw", { MX, EM }, PREFIX_OPCODE },
2872 { "psrld", { MX, EM }, PREFIX_OPCODE },
2873 { "psrlq", { MX, EM }, PREFIX_OPCODE },
2874 { "paddq", { MX, EM }, PREFIX_OPCODE },
2875 { "pmullw", { MX, EM }, PREFIX_OPCODE },
2876 { PREFIX_TABLE (PREFIX_0FD6) },
2877 { MOD_TABLE (MOD_0FD7) },
2879 { "psubusb", { MX, EM }, PREFIX_OPCODE },
2880 { "psubusw", { MX, EM }, PREFIX_OPCODE },
2881 { "pminub", { MX, EM }, PREFIX_OPCODE },
2882 { "pand", { MX, EM }, PREFIX_OPCODE },
2883 { "paddusb", { MX, EM }, PREFIX_OPCODE },
2884 { "paddusw", { MX, EM }, PREFIX_OPCODE },
2885 { "pmaxub", { MX, EM }, PREFIX_OPCODE },
2886 { "pandn", { MX, EM }, PREFIX_OPCODE },
2888 { "pavgb", { MX, EM }, PREFIX_OPCODE },
2889 { "psraw", { MX, EM }, PREFIX_OPCODE },
2890 { "psrad", { MX, EM }, PREFIX_OPCODE },
2891 { "pavgw", { MX, EM }, PREFIX_OPCODE },
2892 { "pmulhuw", { MX, EM }, PREFIX_OPCODE },
2893 { "pmulhw", { MX, EM }, PREFIX_OPCODE },
2894 { PREFIX_TABLE (PREFIX_0FE6) },
2895 { PREFIX_TABLE (PREFIX_0FE7) },
2897 { "psubsb", { MX, EM }, PREFIX_OPCODE },
2898 { "psubsw", { MX, EM }, PREFIX_OPCODE },
2899 { "pminsw", { MX, EM }, PREFIX_OPCODE },
2900 { "por", { MX, EM }, PREFIX_OPCODE },
2901 { "paddsb", { MX, EM }, PREFIX_OPCODE },
2902 { "paddsw", { MX, EM }, PREFIX_OPCODE },
2903 { "pmaxsw", { MX, EM }, PREFIX_OPCODE },
2904 { "pxor", { MX, EM }, PREFIX_OPCODE },
2906 { PREFIX_TABLE (PREFIX_0FF0) },
2907 { "psllw", { MX, EM }, PREFIX_OPCODE },
2908 { "pslld", { MX, EM }, PREFIX_OPCODE },
2909 { "psllq", { MX, EM }, PREFIX_OPCODE },
2910 { "pmuludq", { MX, EM }, PREFIX_OPCODE },
2911 { "pmaddwd", { MX, EM }, PREFIX_OPCODE },
2912 { "psadbw", { MX, EM }, PREFIX_OPCODE },
2913 { PREFIX_TABLE (PREFIX_0FF7) },
2915 { "psubb", { MX, EM }, PREFIX_OPCODE },
2916 { "psubw", { MX, EM }, PREFIX_OPCODE },
2917 { "psubd", { MX, EM }, PREFIX_OPCODE },
2918 { "psubq", { MX, EM }, PREFIX_OPCODE },
2919 { "paddb", { MX, EM }, PREFIX_OPCODE },
2920 { "paddw", { MX, EM }, PREFIX_OPCODE },
2921 { "paddd", { MX, EM }, PREFIX_OPCODE },
2922 { "ud0S", { Gv, Ev }, 0 },
2925 static const unsigned char onebyte_has_modrm[256] = {
2926 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2927 /* ------------------------------- */
2928 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2929 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2930 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2931 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2932 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2933 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2934 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2935 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2936 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2937 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2938 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2939 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2940 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2941 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2942 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2943 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2944 /* ------------------------------- */
2945 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2948 static const unsigned char twobyte_has_modrm[256] = {
2949 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2950 /* ------------------------------- */
2951 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2952 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2953 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2954 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2955 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2956 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2957 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2958 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2959 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2960 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2961 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2962 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
2963 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2964 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2965 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2966 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
2967 /* ------------------------------- */
2968 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2971 static char obuf[100];
2973 static char *mnemonicendp;
2974 static char scratchbuf[100];
2975 static unsigned char *start_codep;
2976 static unsigned char *insn_codep;
2977 static unsigned char *codep;
2978 static unsigned char *end_codep;
2979 static int last_lock_prefix;
2980 static int last_repz_prefix;
2981 static int last_repnz_prefix;
2982 static int last_data_prefix;
2983 static int last_addr_prefix;
2984 static int last_rex_prefix;
2985 static int last_seg_prefix;
2986 static int fwait_prefix;
2987 /* The active segment register prefix. */
2988 static int active_seg_prefix;
2989 #define MAX_CODE_LENGTH 15
2990 /* We can up to 14 prefixes since the maximum instruction length is
2992 static int all_prefixes[MAX_CODE_LENGTH - 1];
2993 static disassemble_info *the_info;
3001 static unsigned char need_modrm;
3011 int register_specifier;
3018 int mask_register_specifier;
3024 static unsigned char need_vex;
3025 static unsigned char need_vex_reg;
3026 static unsigned char vex_w_done;
3034 /* If we are accessing mod/rm/reg without need_modrm set, then the
3035 values are stale. Hitting this abort likely indicates that you
3036 need to update onebyte_has_modrm or twobyte_has_modrm. */
3037 #define MODRM_CHECK if (!need_modrm) abort ()
3039 static const char **names64;
3040 static const char **names32;
3041 static const char **names16;
3042 static const char **names8;
3043 static const char **names8rex;
3044 static const char **names_seg;
3045 static const char *index64;
3046 static const char *index32;
3047 static const char **index16;
3048 static const char **names_bnd;
3050 static const char *intel_names64[] = {
3051 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
3052 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
3054 static const char *intel_names32[] = {
3055 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
3056 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
3058 static const char *intel_names16[] = {
3059 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
3060 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
3062 static const char *intel_names8[] = {
3063 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
3065 static const char *intel_names8rex[] = {
3066 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
3067 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
3069 static const char *intel_names_seg[] = {
3070 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
3072 static const char *intel_index64 = "riz";
3073 static const char *intel_index32 = "eiz";
3074 static const char *intel_index16[] = {
3075 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
3078 static const char *att_names64[] = {
3079 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
3080 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
3082 static const char *att_names32[] = {
3083 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
3084 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
3086 static const char *att_names16[] = {
3087 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
3088 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
3090 static const char *att_names8[] = {
3091 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
3093 static const char *att_names8rex[] = {
3094 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
3095 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
3097 static const char *att_names_seg[] = {
3098 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
3100 static const char *att_index64 = "%riz";
3101 static const char *att_index32 = "%eiz";
3102 static const char *att_index16[] = {
3103 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
3106 static const char **names_mm;
3107 static const char *intel_names_mm[] = {
3108 "mm0", "mm1", "mm2", "mm3",
3109 "mm4", "mm5", "mm6", "mm7"
3111 static const char *att_names_mm[] = {
3112 "%mm0", "%mm1", "%mm2", "%mm3",
3113 "%mm4", "%mm5", "%mm6", "%mm7"
3116 static const char *intel_names_bnd[] = {
3117 "bnd0", "bnd1", "bnd2", "bnd3"
3120 static const char *att_names_bnd[] = {
3121 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
3124 static const char **names_xmm;
3125 static const char *intel_names_xmm[] = {
3126 "xmm0", "xmm1", "xmm2", "xmm3",
3127 "xmm4", "xmm5", "xmm6", "xmm7",
3128 "xmm8", "xmm9", "xmm10", "xmm11",
3129 "xmm12", "xmm13", "xmm14", "xmm15",
3130 "xmm16", "xmm17", "xmm18", "xmm19",
3131 "xmm20", "xmm21", "xmm22", "xmm23",
3132 "xmm24", "xmm25", "xmm26", "xmm27",
3133 "xmm28", "xmm29", "xmm30", "xmm31"
3135 static const char *att_names_xmm[] = {
3136 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
3137 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
3138 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
3139 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
3140 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
3141 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
3142 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
3143 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
3146 static const char **names_ymm;
3147 static const char *intel_names_ymm[] = {
3148 "ymm0", "ymm1", "ymm2", "ymm3",
3149 "ymm4", "ymm5", "ymm6", "ymm7",
3150 "ymm8", "ymm9", "ymm10", "ymm11",
3151 "ymm12", "ymm13", "ymm14", "ymm15",
3152 "ymm16", "ymm17", "ymm18", "ymm19",
3153 "ymm20", "ymm21", "ymm22", "ymm23",
3154 "ymm24", "ymm25", "ymm26", "ymm27",
3155 "ymm28", "ymm29", "ymm30", "ymm31"
3157 static const char *att_names_ymm[] = {
3158 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
3159 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
3160 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
3161 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
3162 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
3163 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
3164 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
3165 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
3168 static const char **names_zmm;
3169 static const char *intel_names_zmm[] = {
3170 "zmm0", "zmm1", "zmm2", "zmm3",
3171 "zmm4", "zmm5", "zmm6", "zmm7",
3172 "zmm8", "zmm9", "zmm10", "zmm11",
3173 "zmm12", "zmm13", "zmm14", "zmm15",
3174 "zmm16", "zmm17", "zmm18", "zmm19",
3175 "zmm20", "zmm21", "zmm22", "zmm23",
3176 "zmm24", "zmm25", "zmm26", "zmm27",
3177 "zmm28", "zmm29", "zmm30", "zmm31"
3179 static const char *att_names_zmm[] = {
3180 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
3181 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
3182 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
3183 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
3184 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
3185 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
3186 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
3187 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
3190 static const char **names_mask;
3191 static const char *intel_names_mask[] = {
3192 "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7"
3194 static const char *att_names_mask[] = {
3195 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
3198 static const char *names_rounding[] =
3206 static const struct dis386 reg_table[][8] = {
3209 { "addA", { Ebh1, Ib }, 0 },
3210 { "orA", { Ebh1, Ib }, 0 },
3211 { "adcA", { Ebh1, Ib }, 0 },
3212 { "sbbA", { Ebh1, Ib }, 0 },
3213 { "andA", { Ebh1, Ib }, 0 },
3214 { "subA", { Ebh1, Ib }, 0 },
3215 { "xorA", { Ebh1, Ib }, 0 },
3216 { "cmpA", { Eb, Ib }, 0 },
3220 { "addQ", { Evh1, Iv }, 0 },
3221 { "orQ", { Evh1, Iv }, 0 },
3222 { "adcQ", { Evh1, Iv }, 0 },
3223 { "sbbQ", { Evh1, Iv }, 0 },
3224 { "andQ", { Evh1, Iv }, 0 },
3225 { "subQ", { Evh1, Iv }, 0 },
3226 { "xorQ", { Evh1, Iv }, 0 },
3227 { "cmpQ", { Ev, Iv }, 0 },
3231 { "addQ", { Evh1, sIb }, 0 },
3232 { "orQ", { Evh1, sIb }, 0 },
3233 { "adcQ", { Evh1, sIb }, 0 },
3234 { "sbbQ", { Evh1, sIb }, 0 },
3235 { "andQ", { Evh1, sIb }, 0 },
3236 { "subQ", { Evh1, sIb }, 0 },
3237 { "xorQ", { Evh1, sIb }, 0 },
3238 { "cmpQ", { Ev, sIb }, 0 },
3242 { "popU", { stackEv }, 0 },
3243 { XOP_8F_TABLE (XOP_09) },
3247 { XOP_8F_TABLE (XOP_09) },
3251 { "rolA", { Eb, Ib }, 0 },
3252 { "rorA", { Eb, Ib }, 0 },
3253 { "rclA", { Eb, Ib }, 0 },
3254 { "rcrA", { Eb, Ib }, 0 },
3255 { "shlA", { Eb, Ib }, 0 },
3256 { "shrA", { Eb, Ib }, 0 },
3257 { "shlA", { Eb, Ib }, 0 },
3258 { "sarA", { Eb, Ib }, 0 },
3262 { "rolQ", { Ev, Ib }, 0 },
3263 { "rorQ", { Ev, Ib }, 0 },
3264 { "rclQ", { Ev, Ib }, 0 },
3265 { "rcrQ", { Ev, Ib }, 0 },
3266 { "shlQ", { Ev, Ib }, 0 },
3267 { "shrQ", { Ev, Ib }, 0 },
3268 { "shlQ", { Ev, Ib }, 0 },
3269 { "sarQ", { Ev, Ib }, 0 },
3273 { "movA", { Ebh3, Ib }, 0 },
3280 { MOD_TABLE (MOD_C6_REG_7) },
3284 { "movQ", { Evh3, Iv }, 0 },
3291 { MOD_TABLE (MOD_C7_REG_7) },
3295 { "rolA", { Eb, I1 }, 0 },
3296 { "rorA", { Eb, I1 }, 0 },
3297 { "rclA", { Eb, I1 }, 0 },
3298 { "rcrA", { Eb, I1 }, 0 },
3299 { "shlA", { Eb, I1 }, 0 },
3300 { "shrA", { Eb, I1 }, 0 },
3301 { "shlA", { Eb, I1 }, 0 },
3302 { "sarA", { Eb, I1 }, 0 },
3306 { "rolQ", { Ev, I1 }, 0 },
3307 { "rorQ", { Ev, I1 }, 0 },
3308 { "rclQ", { Ev, I1 }, 0 },
3309 { "rcrQ", { Ev, I1 }, 0 },
3310 { "shlQ", { Ev, I1 }, 0 },
3311 { "shrQ", { Ev, I1 }, 0 },
3312 { "shlQ", { Ev, I1 }, 0 },
3313 { "sarQ", { Ev, I1 }, 0 },
3317 { "rolA", { Eb, CL }, 0 },
3318 { "rorA", { Eb, CL }, 0 },
3319 { "rclA", { Eb, CL }, 0 },
3320 { "rcrA", { Eb, CL }, 0 },
3321 { "shlA", { Eb, CL }, 0 },
3322 { "shrA", { Eb, CL }, 0 },
3323 { "shlA", { Eb, CL }, 0 },
3324 { "sarA", { Eb, CL }, 0 },
3328 { "rolQ", { Ev, CL }, 0 },
3329 { "rorQ", { Ev, CL }, 0 },
3330 { "rclQ", { Ev, CL }, 0 },
3331 { "rcrQ", { Ev, CL }, 0 },
3332 { "shlQ", { Ev, CL }, 0 },
3333 { "shrQ", { Ev, CL }, 0 },
3334 { "shlQ", { Ev, CL }, 0 },
3335 { "sarQ", { Ev, CL }, 0 },
3339 { "testA", { Eb, Ib }, 0 },
3340 { "testA", { Eb, Ib }, 0 },
3341 { "notA", { Ebh1 }, 0 },
3342 { "negA", { Ebh1 }, 0 },
3343 { "mulA", { Eb }, 0 }, /* Don't print the implicit %al register, */
3344 { "imulA", { Eb }, 0 }, /* to distinguish these opcodes from other */
3345 { "divA", { Eb }, 0 }, /* mul/imul opcodes. Do the same for div */
3346 { "idivA", { Eb }, 0 }, /* and idiv for consistency. */
3350 { "testQ", { Ev, Iv }, 0 },
3351 { "testQ", { Ev, Iv }, 0 },
3352 { "notQ", { Evh1 }, 0 },
3353 { "negQ", { Evh1 }, 0 },
3354 { "mulQ", { Ev }, 0 }, /* Don't print the implicit register. */
3355 { "imulQ", { Ev }, 0 },
3356 { "divQ", { Ev }, 0 },
3357 { "idivQ", { Ev }, 0 },
3361 { "incA", { Ebh1 }, 0 },
3362 { "decA", { Ebh1 }, 0 },
3366 { "incQ", { Evh1 }, 0 },
3367 { "decQ", { Evh1 }, 0 },
3368 { "call{&|}", { NOTRACK, indirEv, BND }, 0 },
3369 { MOD_TABLE (MOD_FF_REG_3) },
3370 { "jmp{&|}", { NOTRACK, indirEv, BND }, 0 },
3371 { MOD_TABLE (MOD_FF_REG_5) },
3372 { "pushU", { stackEv }, 0 },
3377 { "sldtD", { Sv }, 0 },
3378 { "strD", { Sv }, 0 },
3379 { "lldt", { Ew }, 0 },
3380 { "ltr", { Ew }, 0 },
3381 { "verr", { Ew }, 0 },
3382 { "verw", { Ew }, 0 },
3388 { MOD_TABLE (MOD_0F01_REG_0) },
3389 { MOD_TABLE (MOD_0F01_REG_1) },
3390 { MOD_TABLE (MOD_0F01_REG_2) },
3391 { MOD_TABLE (MOD_0F01_REG_3) },
3392 { "smswD", { Sv }, 0 },
3393 { MOD_TABLE (MOD_0F01_REG_5) },
3394 { "lmsw", { Ew }, 0 },
3395 { MOD_TABLE (MOD_0F01_REG_7) },
3399 { "prefetch", { Mb }, 0 },
3400 { "prefetchw", { Mb }, 0 },
3401 { "prefetchwt1", { Mb }, 0 },
3402 { "prefetch", { Mb }, 0 },
3403 { "prefetch", { Mb }, 0 },
3404 { "prefetch", { Mb }, 0 },
3405 { "prefetch", { Mb }, 0 },
3406 { "prefetch", { Mb }, 0 },
3410 { MOD_TABLE (MOD_0F18_REG_0) },
3411 { MOD_TABLE (MOD_0F18_REG_1) },
3412 { MOD_TABLE (MOD_0F18_REG_2) },
3413 { MOD_TABLE (MOD_0F18_REG_3) },
3414 { MOD_TABLE (MOD_0F18_REG_4) },
3415 { MOD_TABLE (MOD_0F18_REG_5) },
3416 { MOD_TABLE (MOD_0F18_REG_6) },
3417 { MOD_TABLE (MOD_0F18_REG_7) },
3419 /* REG_0F1C_MOD_0 */
3421 { "cldemote", { Mb }, 0 },
3422 { "nopQ", { Ev }, 0 },
3423 { "nopQ", { Ev }, 0 },
3424 { "nopQ", { Ev }, 0 },
3425 { "nopQ", { Ev }, 0 },
3426 { "nopQ", { Ev }, 0 },
3427 { "nopQ", { Ev }, 0 },
3428 { "nopQ", { Ev }, 0 },
3430 /* REG_0F1E_MOD_3 */
3432 { "nopQ", { Ev }, 0 },
3433 { "rdsspK", { Rdq }, PREFIX_OPCODE },
3434 { "nopQ", { Ev }, 0 },
3435 { "nopQ", { Ev }, 0 },
3436 { "nopQ", { Ev }, 0 },
3437 { "nopQ", { Ev }, 0 },
3438 { "nopQ", { Ev }, 0 },
3439 { RM_TABLE (RM_0F1E_MOD_3_REG_7) },
3445 { MOD_TABLE (MOD_0F71_REG_2) },
3447 { MOD_TABLE (MOD_0F71_REG_4) },
3449 { MOD_TABLE (MOD_0F71_REG_6) },
3455 { MOD_TABLE (MOD_0F72_REG_2) },
3457 { MOD_TABLE (MOD_0F72_REG_4) },
3459 { MOD_TABLE (MOD_0F72_REG_6) },
3465 { MOD_TABLE (MOD_0F73_REG_2) },
3466 { MOD_TABLE (MOD_0F73_REG_3) },
3469 { MOD_TABLE (MOD_0F73_REG_6) },
3470 { MOD_TABLE (MOD_0F73_REG_7) },
3474 { "montmul", { { OP_0f07, 0 } }, 0 },
3475 { "xsha1", { { OP_0f07, 0 } }, 0 },
3476 { "xsha256", { { OP_0f07, 0 } }, 0 },
3480 { "xstore-rng", { { OP_0f07, 0 } }, 0 },
3481 { "xcrypt-ecb", { { OP_0f07, 0 } }, 0 },
3482 { "xcrypt-cbc", { { OP_0f07, 0 } }, 0 },
3483 { "xcrypt-ctr", { { OP_0f07, 0 } }, 0 },
3484 { "xcrypt-cfb", { { OP_0f07, 0 } }, 0 },
3485 { "xcrypt-ofb", { { OP_0f07, 0 } }, 0 },
3489 { MOD_TABLE (MOD_0FAE_REG_0) },
3490 { MOD_TABLE (MOD_0FAE_REG_1) },
3491 { MOD_TABLE (MOD_0FAE_REG_2) },
3492 { MOD_TABLE (MOD_0FAE_REG_3) },
3493 { MOD_TABLE (MOD_0FAE_REG_4) },
3494 { MOD_TABLE (MOD_0FAE_REG_5) },
3495 { MOD_TABLE (MOD_0FAE_REG_6) },
3496 { MOD_TABLE (MOD_0FAE_REG_7) },
3504 { "btQ", { Ev, Ib }, 0 },
3505 { "btsQ", { Evh1, Ib }, 0 },
3506 { "btrQ", { Evh1, Ib }, 0 },
3507 { "btcQ", { Evh1, Ib }, 0 },
3512 { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } }, 0 },
3514 { MOD_TABLE (MOD_0FC7_REG_3) },
3515 { MOD_TABLE (MOD_0FC7_REG_4) },
3516 { MOD_TABLE (MOD_0FC7_REG_5) },
3517 { MOD_TABLE (MOD_0FC7_REG_6) },
3518 { MOD_TABLE (MOD_0FC7_REG_7) },
3524 { MOD_TABLE (MOD_VEX_0F71_REG_2) },
3526 { MOD_TABLE (MOD_VEX_0F71_REG_4) },
3528 { MOD_TABLE (MOD_VEX_0F71_REG_6) },
3534 { MOD_TABLE (MOD_VEX_0F72_REG_2) },
3536 { MOD_TABLE (MOD_VEX_0F72_REG_4) },
3538 { MOD_TABLE (MOD_VEX_0F72_REG_6) },
3544 { MOD_TABLE (MOD_VEX_0F73_REG_2) },
3545 { MOD_TABLE (MOD_VEX_0F73_REG_3) },
3548 { MOD_TABLE (MOD_VEX_0F73_REG_6) },
3549 { MOD_TABLE (MOD_VEX_0F73_REG_7) },
3555 { MOD_TABLE (MOD_VEX_0FAE_REG_2) },
3556 { MOD_TABLE (MOD_VEX_0FAE_REG_3) },
3558 /* REG_VEX_0F38F3 */
3561 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_1) },
3562 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_2) },
3563 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_3) },
3567 { "llwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3568 { "slwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3572 { "lwpins", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3573 { "lwpval", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3575 /* REG_XOP_TBM_01 */
3578 { "blcfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3579 { "blsfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3580 { "blcs", { { OP_LWP_E, 0 }, Ev }, 0 },
3581 { "tzmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3582 { "blcic", { { OP_LWP_E, 0 }, Ev }, 0 },
3583 { "blsic", { { OP_LWP_E, 0 }, Ev }, 0 },
3584 { "t1mskc", { { OP_LWP_E, 0 }, Ev }, 0 },
3586 /* REG_XOP_TBM_02 */
3589 { "blcmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3594 { "blci", { { OP_LWP_E, 0 }, Ev }, 0 },
3596 #define NEED_REG_TABLE
3597 #include "i386-dis-evex.h"
3598 #undef NEED_REG_TABLE
3601 static const struct dis386 prefix_table[][4] = {
3604 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3605 { "pause", { XX }, 0 },
3606 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3607 { NULL, { { NULL, 0 } }, PREFIX_IGNORED }
3610 /* PREFIX_MOD_0_0F01_REG_5 */
3613 { "rstorssp", { Mq }, PREFIX_OPCODE },
3616 /* PREFIX_MOD_3_0F01_REG_5_RM_0 */
3619 { "setssbsy", { Skip_MODRM }, PREFIX_OPCODE },
3622 /* PREFIX_MOD_3_0F01_REG_5_RM_2 */
3625 { "saveprevssp", { Skip_MODRM }, PREFIX_OPCODE },
3630 { "wbinvd", { XX }, 0 },
3631 { "wbnoinvd", { XX }, 0 },
3636 { "movups", { XM, EXx }, PREFIX_OPCODE },
3637 { "movss", { XM, EXd }, PREFIX_OPCODE },
3638 { "movupd", { XM, EXx }, PREFIX_OPCODE },
3639 { "movsd", { XM, EXq }, PREFIX_OPCODE },
3644 { "movups", { EXxS, XM }, PREFIX_OPCODE },
3645 { "movss", { EXdS, XM }, PREFIX_OPCODE },
3646 { "movupd", { EXxS, XM }, PREFIX_OPCODE },
3647 { "movsd", { EXqS, XM }, PREFIX_OPCODE },
3652 { MOD_TABLE (MOD_0F12_PREFIX_0) },
3653 { "movsldup", { XM, EXx }, PREFIX_OPCODE },
3654 { "movlpd", { XM, EXq }, PREFIX_OPCODE },
3655 { "movddup", { XM, EXq }, PREFIX_OPCODE },
3660 { MOD_TABLE (MOD_0F16_PREFIX_0) },
3661 { "movshdup", { XM, EXx }, PREFIX_OPCODE },
3662 { "movhpd", { XM, EXq }, PREFIX_OPCODE },
3667 { MOD_TABLE (MOD_0F1A_PREFIX_0) },
3668 { "bndcl", { Gbnd, Ev_bnd }, 0 },
3669 { "bndmov", { Gbnd, Ebnd }, 0 },
3670 { "bndcu", { Gbnd, Ev_bnd }, 0 },
3675 { MOD_TABLE (MOD_0F1B_PREFIX_0) },
3676 { MOD_TABLE (MOD_0F1B_PREFIX_1) },
3677 { "bndmov", { EbndS, Gbnd }, 0 },
3678 { "bndcn", { Gbnd, Ev_bnd }, 0 },
3683 { MOD_TABLE (MOD_0F1C_PREFIX_0) },
3684 { "nopQ", { Ev }, PREFIX_OPCODE },
3685 { "nopQ", { Ev }, PREFIX_OPCODE },
3686 { "nopQ", { Ev }, PREFIX_OPCODE },
3691 { "nopQ", { Ev }, PREFIX_OPCODE },
3692 { MOD_TABLE (MOD_0F1E_PREFIX_1) },
3693 { "nopQ", { Ev }, PREFIX_OPCODE },
3694 { "nopQ", { Ev }, PREFIX_OPCODE },
3699 { "cvtpi2ps", { XM, EMCq }, PREFIX_OPCODE },
3700 { "cvtsi2ss%LQ", { XM, Ev }, PREFIX_OPCODE },
3701 { "cvtpi2pd", { XM, EMCq }, PREFIX_OPCODE },
3702 { "cvtsi2sd%LQ", { XM, Ev }, 0 },
3707 { MOD_TABLE (MOD_0F2B_PREFIX_0) },
3708 { MOD_TABLE (MOD_0F2B_PREFIX_1) },
3709 { MOD_TABLE (MOD_0F2B_PREFIX_2) },
3710 { MOD_TABLE (MOD_0F2B_PREFIX_3) },
3715 { "cvttps2pi", { MXC, EXq }, PREFIX_OPCODE },
3716 { "cvttss2si", { Gv, EXd }, PREFIX_OPCODE },
3717 { "cvttpd2pi", { MXC, EXx }, PREFIX_OPCODE },
3718 { "cvttsd2si", { Gv, EXq }, PREFIX_OPCODE },
3723 { "cvtps2pi", { MXC, EXq }, PREFIX_OPCODE },
3724 { "cvtss2si", { Gv, EXd }, PREFIX_OPCODE },
3725 { "cvtpd2pi", { MXC, EXx }, PREFIX_OPCODE },
3726 { "cvtsd2si", { Gv, EXq }, PREFIX_OPCODE },
3731 { "ucomiss",{ XM, EXd }, 0 },
3733 { "ucomisd",{ XM, EXq }, 0 },
3738 { "comiss", { XM, EXd }, 0 },
3740 { "comisd", { XM, EXq }, 0 },
3745 { "sqrtps", { XM, EXx }, PREFIX_OPCODE },
3746 { "sqrtss", { XM, EXd }, PREFIX_OPCODE },
3747 { "sqrtpd", { XM, EXx }, PREFIX_OPCODE },
3748 { "sqrtsd", { XM, EXq }, PREFIX_OPCODE },
3753 { "rsqrtps",{ XM, EXx }, PREFIX_OPCODE },
3754 { "rsqrtss",{ XM, EXd }, PREFIX_OPCODE },
3759 { "rcpps", { XM, EXx }, PREFIX_OPCODE },
3760 { "rcpss", { XM, EXd }, PREFIX_OPCODE },
3765 { "addps", { XM, EXx }, PREFIX_OPCODE },
3766 { "addss", { XM, EXd }, PREFIX_OPCODE },
3767 { "addpd", { XM, EXx }, PREFIX_OPCODE },
3768 { "addsd", { XM, EXq }, PREFIX_OPCODE },
3773 { "mulps", { XM, EXx }, PREFIX_OPCODE },
3774 { "mulss", { XM, EXd }, PREFIX_OPCODE },
3775 { "mulpd", { XM, EXx }, PREFIX_OPCODE },
3776 { "mulsd", { XM, EXq }, PREFIX_OPCODE },
3781 { "cvtps2pd", { XM, EXq }, PREFIX_OPCODE },
3782 { "cvtss2sd", { XM, EXd }, PREFIX_OPCODE },
3783 { "cvtpd2ps", { XM, EXx }, PREFIX_OPCODE },
3784 { "cvtsd2ss", { XM, EXq }, PREFIX_OPCODE },
3789 { "cvtdq2ps", { XM, EXx }, PREFIX_OPCODE },
3790 { "cvttps2dq", { XM, EXx }, PREFIX_OPCODE },
3791 { "cvtps2dq", { XM, EXx }, PREFIX_OPCODE },
3796 { "subps", { XM, EXx }, PREFIX_OPCODE },
3797 { "subss", { XM, EXd }, PREFIX_OPCODE },
3798 { "subpd", { XM, EXx }, PREFIX_OPCODE },
3799 { "subsd", { XM, EXq }, PREFIX_OPCODE },
3804 { "minps", { XM, EXx }, PREFIX_OPCODE },
3805 { "minss", { XM, EXd }, PREFIX_OPCODE },
3806 { "minpd", { XM, EXx }, PREFIX_OPCODE },
3807 { "minsd", { XM, EXq }, PREFIX_OPCODE },
3812 { "divps", { XM, EXx }, PREFIX_OPCODE },
3813 { "divss", { XM, EXd }, PREFIX_OPCODE },
3814 { "divpd", { XM, EXx }, PREFIX_OPCODE },
3815 { "divsd", { XM, EXq }, PREFIX_OPCODE },
3820 { "maxps", { XM, EXx }, PREFIX_OPCODE },
3821 { "maxss", { XM, EXd }, PREFIX_OPCODE },
3822 { "maxpd", { XM, EXx }, PREFIX_OPCODE },
3823 { "maxsd", { XM, EXq }, PREFIX_OPCODE },
3828 { "punpcklbw",{ MX, EMd }, PREFIX_OPCODE },
3830 { "punpcklbw",{ MX, EMx }, PREFIX_OPCODE },
3835 { "punpcklwd",{ MX, EMd }, PREFIX_OPCODE },
3837 { "punpcklwd",{ MX, EMx }, PREFIX_OPCODE },
3842 { "punpckldq",{ MX, EMd }, PREFIX_OPCODE },
3844 { "punpckldq",{ MX, EMx }, PREFIX_OPCODE },
3851 { "punpcklqdq", { XM, EXx }, PREFIX_OPCODE },
3858 { "punpckhqdq", { XM, EXx }, PREFIX_OPCODE },
3863 { "movq", { MX, EM }, PREFIX_OPCODE },
3864 { "movdqu", { XM, EXx }, PREFIX_OPCODE },
3865 { "movdqa", { XM, EXx }, PREFIX_OPCODE },
3870 { "pshufw", { MX, EM, Ib }, PREFIX_OPCODE },
3871 { "pshufhw",{ XM, EXx, Ib }, PREFIX_OPCODE },
3872 { "pshufd", { XM, EXx, Ib }, PREFIX_OPCODE },
3873 { "pshuflw",{ XM, EXx, Ib }, PREFIX_OPCODE },
3876 /* PREFIX_0F73_REG_3 */
3880 { "psrldq", { XS, Ib }, 0 },
3883 /* PREFIX_0F73_REG_7 */
3887 { "pslldq", { XS, Ib }, 0 },
3892 {"vmread", { Em, Gm }, 0 },
3894 {"extrq", { XS, Ib, Ib }, 0 },
3895 {"insertq", { XM, XS, Ib, Ib }, 0 },
3900 {"vmwrite", { Gm, Em }, 0 },
3902 {"extrq", { XM, XS }, 0 },
3903 {"insertq", { XM, XS }, 0 },
3910 { "haddpd", { XM, EXx }, PREFIX_OPCODE },
3911 { "haddps", { XM, EXx }, PREFIX_OPCODE },
3918 { "hsubpd", { XM, EXx }, PREFIX_OPCODE },
3919 { "hsubps", { XM, EXx }, PREFIX_OPCODE },
3924 { "movK", { Edq, MX }, PREFIX_OPCODE },
3925 { "movq", { XM, EXq }, PREFIX_OPCODE },
3926 { "movK", { Edq, XM }, PREFIX_OPCODE },
3931 { "movq", { EMS, MX }, PREFIX_OPCODE },
3932 { "movdqu", { EXxS, XM }, PREFIX_OPCODE },
3933 { "movdqa", { EXxS, XM }, PREFIX_OPCODE },
3936 /* PREFIX_0FAE_REG_0 */
3939 { "rdfsbase", { Ev }, 0 },
3942 /* PREFIX_0FAE_REG_1 */
3945 { "rdgsbase", { Ev }, 0 },
3948 /* PREFIX_0FAE_REG_2 */
3951 { "wrfsbase", { Ev }, 0 },
3954 /* PREFIX_0FAE_REG_3 */
3957 { "wrgsbase", { Ev }, 0 },
3960 /* PREFIX_MOD_0_0FAE_REG_4 */
3962 { "xsave", { FXSAVE }, 0 },
3963 { "ptwrite%LQ", { Edq }, 0 },
3966 /* PREFIX_MOD_3_0FAE_REG_4 */
3969 { "ptwrite%LQ", { Edq }, 0 },
3972 /* PREFIX_MOD_0_0FAE_REG_5 */
3974 { "xrstor", { FXSAVE }, PREFIX_OPCODE },
3977 /* PREFIX_MOD_3_0FAE_REG_5 */
3979 { "lfence", { Skip_MODRM }, 0 },
3980 { "incsspK", { Rdq }, PREFIX_OPCODE },
3983 /* PREFIX_MOD_0_0FAE_REG_6 */
3985 { "xsaveopt", { FXSAVE }, PREFIX_OPCODE },
3986 { "clrssbsy", { Mq }, PREFIX_OPCODE },
3987 { "clwb", { Mb }, PREFIX_OPCODE },
3990 /* PREFIX_MOD_1_0FAE_REG_6 */
3992 { RM_TABLE (RM_0FAE_REG_6) },
3993 { "umonitor", { Eva }, PREFIX_OPCODE },
3994 { "tpause", { Edq }, PREFIX_OPCODE },
3995 { "umwait", { Edq }, PREFIX_OPCODE },
3998 /* PREFIX_0FAE_REG_7 */
4000 { "clflush", { Mb }, 0 },
4002 { "clflushopt", { Mb }, 0 },
4008 { "popcntS", { Gv, Ev }, 0 },
4013 { "bsfS", { Gv, Ev }, 0 },
4014 { "tzcntS", { Gv, Ev }, 0 },
4015 { "bsfS", { Gv, Ev }, 0 },
4020 { "bsrS", { Gv, Ev }, 0 },
4021 { "lzcntS", { Gv, Ev }, 0 },
4022 { "bsrS", { Gv, Ev }, 0 },
4027 { "cmpps", { XM, EXx, CMP }, PREFIX_OPCODE },
4028 { "cmpss", { XM, EXd, CMP }, PREFIX_OPCODE },
4029 { "cmppd", { XM, EXx, CMP }, PREFIX_OPCODE },
4030 { "cmpsd", { XM, EXq, CMP }, PREFIX_OPCODE },
4033 /* PREFIX_MOD_0_0FC3 */
4035 { "movntiS", { Ev, Gv }, PREFIX_OPCODE },
4038 /* PREFIX_MOD_0_0FC7_REG_6 */
4040 { "vmptrld",{ Mq }, 0 },
4041 { "vmxon", { Mq }, 0 },
4042 { "vmclear",{ Mq }, 0 },
4045 /* PREFIX_MOD_3_0FC7_REG_6 */
4047 { "rdrand", { Ev }, 0 },
4049 { "rdrand", { Ev }, 0 }
4052 /* PREFIX_MOD_3_0FC7_REG_7 */
4054 { "rdseed", { Ev }, 0 },
4055 { "rdpid", { Em }, 0 },
4056 { "rdseed", { Ev }, 0 },
4063 { "addsubpd", { XM, EXx }, 0 },
4064 { "addsubps", { XM, EXx }, 0 },
4070 { "movq2dq",{ XM, MS }, 0 },
4071 { "movq", { EXqS, XM }, 0 },
4072 { "movdq2q",{ MX, XS }, 0 },
4078 { "cvtdq2pd", { XM, EXq }, PREFIX_OPCODE },
4079 { "cvttpd2dq", { XM, EXx }, PREFIX_OPCODE },
4080 { "cvtpd2dq", { XM, EXx }, PREFIX_OPCODE },
4085 { "movntq", { Mq, MX }, PREFIX_OPCODE },
4087 { MOD_TABLE (MOD_0FE7_PREFIX_2) },
4095 { MOD_TABLE (MOD_0FF0_PREFIX_3) },
4100 { "maskmovq", { MX, MS }, PREFIX_OPCODE },
4102 { "maskmovdqu", { XM, XS }, PREFIX_OPCODE },
4109 { "pblendvb", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4116 { "blendvps", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4123 { "blendvpd", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4130 { "ptest", { XM, EXx }, PREFIX_OPCODE },
4137 { "pmovsxbw", { XM, EXq }, PREFIX_OPCODE },
4144 { "pmovsxbd", { XM, EXd }, PREFIX_OPCODE },
4151 { "pmovsxbq", { XM, EXw }, PREFIX_OPCODE },
4158 { "pmovsxwd", { XM, EXq }, PREFIX_OPCODE },
4165 { "pmovsxwq", { XM, EXd }, PREFIX_OPCODE },
4172 { "pmovsxdq", { XM, EXq }, PREFIX_OPCODE },
4179 { "pmuldq", { XM, EXx }, PREFIX_OPCODE },
4186 { "pcmpeqq", { XM, EXx }, PREFIX_OPCODE },
4193 { MOD_TABLE (MOD_0F382A_PREFIX_2) },
4200 { "packusdw", { XM, EXx }, PREFIX_OPCODE },
4207 { "pmovzxbw", { XM, EXq }, PREFIX_OPCODE },
4214 { "pmovzxbd", { XM, EXd }, PREFIX_OPCODE },
4221 { "pmovzxbq", { XM, EXw }, PREFIX_OPCODE },
4228 { "pmovzxwd", { XM, EXq }, PREFIX_OPCODE },
4235 { "pmovzxwq", { XM, EXd }, PREFIX_OPCODE },
4242 { "pmovzxdq", { XM, EXq }, PREFIX_OPCODE },
4249 { "pcmpgtq", { XM, EXx }, PREFIX_OPCODE },
4256 { "pminsb", { XM, EXx }, PREFIX_OPCODE },
4263 { "pminsd", { XM, EXx }, PREFIX_OPCODE },
4270 { "pminuw", { XM, EXx }, PREFIX_OPCODE },
4277 { "pminud", { XM, EXx }, PREFIX_OPCODE },
4284 { "pmaxsb", { XM, EXx }, PREFIX_OPCODE },
4291 { "pmaxsd", { XM, EXx }, PREFIX_OPCODE },
4298 { "pmaxuw", { XM, EXx }, PREFIX_OPCODE },
4305 { "pmaxud", { XM, EXx }, PREFIX_OPCODE },
4312 { "pmulld", { XM, EXx }, PREFIX_OPCODE },
4319 { "phminposuw", { XM, EXx }, PREFIX_OPCODE },
4326 { "invept", { Gm, Mo }, PREFIX_OPCODE },
4333 { "invvpid", { Gm, Mo }, PREFIX_OPCODE },
4340 { "invpcid", { Gm, M }, PREFIX_OPCODE },
4345 { "sha1nexte", { XM, EXxmm }, PREFIX_OPCODE },
4350 { "sha1msg1", { XM, EXxmm }, PREFIX_OPCODE },
4355 { "sha1msg2", { XM, EXxmm }, PREFIX_OPCODE },
4360 { "sha256rnds2", { XM, EXxmm, XMM0 }, PREFIX_OPCODE },
4365 { "sha256msg1", { XM, EXxmm }, PREFIX_OPCODE },
4370 { "sha256msg2", { XM, EXxmm }, PREFIX_OPCODE },
4377 { "gf2p8mulb", { XM, EXxmm }, PREFIX_OPCODE },
4384 { "aesimc", { XM, EXx }, PREFIX_OPCODE },
4391 { "aesenc", { XM, EXx }, PREFIX_OPCODE },
4398 { "aesenclast", { XM, EXx }, PREFIX_OPCODE },
4405 { "aesdec", { XM, EXx }, PREFIX_OPCODE },
4412 { "aesdeclast", { XM, EXx }, PREFIX_OPCODE },
4417 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4419 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4420 { "crc32", { Gdq, { CRC32_Fixup, b_mode } }, PREFIX_OPCODE },
4425 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4427 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4428 { "crc32", { Gdq, { CRC32_Fixup, v_mode } }, PREFIX_OPCODE },
4435 { MOD_TABLE (MOD_0F38F5_PREFIX_2) },
4440 { MOD_TABLE (MOD_0F38F6_PREFIX_0) },
4441 { "adoxS", { Gdq, Edq}, PREFIX_OPCODE },
4442 { "adcxS", { Gdq, Edq}, PREFIX_OPCODE },
4449 { MOD_TABLE (MOD_0F38F8_PREFIX_1) },
4450 { MOD_TABLE (MOD_0F38F8_PREFIX_2) },
4451 { MOD_TABLE (MOD_0F38F8_PREFIX_3) },
4456 { MOD_TABLE (MOD_0F38F9_PREFIX_0) },
4463 { "roundps", { XM, EXx, Ib }, PREFIX_OPCODE },
4470 { "roundpd", { XM, EXx, Ib }, PREFIX_OPCODE },
4477 { "roundss", { XM, EXd, Ib }, PREFIX_OPCODE },
4484 { "roundsd", { XM, EXq, Ib }, PREFIX_OPCODE },
4491 { "blendps", { XM, EXx, Ib }, PREFIX_OPCODE },
4498 { "blendpd", { XM, EXx, Ib }, PREFIX_OPCODE },
4505 { "pblendw", { XM, EXx, Ib }, PREFIX_OPCODE },
4512 { "pextrb", { Edqb, XM, Ib }, PREFIX_OPCODE },
4519 { "pextrw", { Edqw, XM, Ib }, PREFIX_OPCODE },
4526 { "pextrK", { Edq, XM, Ib }, PREFIX_OPCODE },
4533 { "extractps", { Edqd, XM, Ib }, PREFIX_OPCODE },
4540 { "pinsrb", { XM, Edqb, Ib }, PREFIX_OPCODE },
4547 { "insertps", { XM, EXd, Ib }, PREFIX_OPCODE },
4554 { "pinsrK", { XM, Edq, Ib }, PREFIX_OPCODE },
4561 { "dpps", { XM, EXx, Ib }, PREFIX_OPCODE },
4568 { "dppd", { XM, EXx, Ib }, PREFIX_OPCODE },
4575 { "mpsadbw", { XM, EXx, Ib }, PREFIX_OPCODE },
4582 { "pclmulqdq", { XM, EXx, PCLMUL }, PREFIX_OPCODE },
4589 { "pcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
4596 { "pcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
4603 { "pcmpistrm", { XM, EXx, Ib }, PREFIX_OPCODE },
4610 { "pcmpistri", { XM, EXx, Ib }, PREFIX_OPCODE },
4615 { "sha1rnds4", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4622 { "gf2p8affineqb", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4629 { "gf2p8affineinvqb", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4636 { "aeskeygenassist", { XM, EXx, Ib }, PREFIX_OPCODE },
4639 /* PREFIX_VEX_0F10 */
4641 { "vmovups", { XM, EXx }, 0 },
4642 { "vmovss", { XMVexScalar, VexScalar, EXdScalar }, 0 },
4643 { "vmovupd", { XM, EXx }, 0 },
4644 { "vmovsd", { XMVexScalar, VexScalar, EXqScalar }, 0 },
4647 /* PREFIX_VEX_0F11 */
4649 { "vmovups", { EXxS, XM }, 0 },
4650 { "vmovss", { EXdVexScalarS, VexScalar, XMScalar }, 0 },
4651 { "vmovupd", { EXxS, XM }, 0 },
4652 { "vmovsd", { EXqVexScalarS, VexScalar, XMScalar }, 0 },
4655 /* PREFIX_VEX_0F12 */
4657 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0) },
4658 { "vmovsldup", { XM, EXx }, 0 },
4659 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2) },
4660 { "vmovddup", { XM, EXymmq }, 0 },
4663 /* PREFIX_VEX_0F16 */
4665 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0) },
4666 { "vmovshdup", { XM, EXx }, 0 },
4667 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2) },
4670 /* PREFIX_VEX_0F2A */
4673 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_1) },
4675 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_3) },
4678 /* PREFIX_VEX_0F2C */
4681 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_1) },
4683 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_3) },
4686 /* PREFIX_VEX_0F2D */
4689 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_1) },
4691 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_3) },
4694 /* PREFIX_VEX_0F2E */
4696 { "vucomiss", { XMScalar, EXdScalar }, 0 },
4698 { "vucomisd", { XMScalar, EXqScalar }, 0 },
4701 /* PREFIX_VEX_0F2F */
4703 { "vcomiss", { XMScalar, EXdScalar }, 0 },
4705 { "vcomisd", { XMScalar, EXqScalar }, 0 },
4708 /* PREFIX_VEX_0F41 */
4710 { VEX_LEN_TABLE (VEX_LEN_0F41_P_0) },
4712 { VEX_LEN_TABLE (VEX_LEN_0F41_P_2) },
4715 /* PREFIX_VEX_0F42 */
4717 { VEX_LEN_TABLE (VEX_LEN_0F42_P_0) },
4719 { VEX_LEN_TABLE (VEX_LEN_0F42_P_2) },
4722 /* PREFIX_VEX_0F44 */
4724 { VEX_LEN_TABLE (VEX_LEN_0F44_P_0) },
4726 { VEX_LEN_TABLE (VEX_LEN_0F44_P_2) },
4729 /* PREFIX_VEX_0F45 */
4731 { VEX_LEN_TABLE (VEX_LEN_0F45_P_0) },
4733 { VEX_LEN_TABLE (VEX_LEN_0F45_P_2) },
4736 /* PREFIX_VEX_0F46 */
4738 { VEX_LEN_TABLE (VEX_LEN_0F46_P_0) },
4740 { VEX_LEN_TABLE (VEX_LEN_0F46_P_2) },
4743 /* PREFIX_VEX_0F47 */
4745 { VEX_LEN_TABLE (VEX_LEN_0F47_P_0) },
4747 { VEX_LEN_TABLE (VEX_LEN_0F47_P_2) },
4750 /* PREFIX_VEX_0F4A */
4752 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_0) },
4754 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_2) },
4757 /* PREFIX_VEX_0F4B */
4759 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_0) },
4761 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_2) },
4764 /* PREFIX_VEX_0F51 */
4766 { "vsqrtps", { XM, EXx }, 0 },
4767 { "vsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
4768 { "vsqrtpd", { XM, EXx }, 0 },
4769 { "vsqrtsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4772 /* PREFIX_VEX_0F52 */
4774 { "vrsqrtps", { XM, EXx }, 0 },
4775 { "vrsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
4778 /* PREFIX_VEX_0F53 */
4780 { "vrcpps", { XM, EXx }, 0 },
4781 { "vrcpss", { XMScalar, VexScalar, EXdScalar }, 0 },
4784 /* PREFIX_VEX_0F58 */
4786 { "vaddps", { XM, Vex, EXx }, 0 },
4787 { "vaddss", { XMScalar, VexScalar, EXdScalar }, 0 },
4788 { "vaddpd", { XM, Vex, EXx }, 0 },
4789 { "vaddsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4792 /* PREFIX_VEX_0F59 */
4794 { "vmulps", { XM, Vex, EXx }, 0 },
4795 { "vmulss", { XMScalar, VexScalar, EXdScalar }, 0 },
4796 { "vmulpd", { XM, Vex, EXx }, 0 },
4797 { "vmulsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4800 /* PREFIX_VEX_0F5A */
4802 { "vcvtps2pd", { XM, EXxmmq }, 0 },
4803 { "vcvtss2sd", { XMScalar, VexScalar, EXdScalar }, 0 },
4804 { "vcvtpd2ps%XY",{ XMM, EXx }, 0 },
4805 { "vcvtsd2ss", { XMScalar, VexScalar, EXqScalar }, 0 },
4808 /* PREFIX_VEX_0F5B */
4810 { "vcvtdq2ps", { XM, EXx }, 0 },
4811 { "vcvttps2dq", { XM, EXx }, 0 },
4812 { "vcvtps2dq", { XM, EXx }, 0 },
4815 /* PREFIX_VEX_0F5C */
4817 { "vsubps", { XM, Vex, EXx }, 0 },
4818 { "vsubss", { XMScalar, VexScalar, EXdScalar }, 0 },
4819 { "vsubpd", { XM, Vex, EXx }, 0 },
4820 { "vsubsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4823 /* PREFIX_VEX_0F5D */
4825 { "vminps", { XM, Vex, EXx }, 0 },
4826 { "vminss", { XMScalar, VexScalar, EXdScalar }, 0 },
4827 { "vminpd", { XM, Vex, EXx }, 0 },
4828 { "vminsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4831 /* PREFIX_VEX_0F5E */
4833 { "vdivps", { XM, Vex, EXx }, 0 },
4834 { "vdivss", { XMScalar, VexScalar, EXdScalar }, 0 },
4835 { "vdivpd", { XM, Vex, EXx }, 0 },
4836 { "vdivsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4839 /* PREFIX_VEX_0F5F */
4841 { "vmaxps", { XM, Vex, EXx }, 0 },
4842 { "vmaxss", { XMScalar, VexScalar, EXdScalar }, 0 },
4843 { "vmaxpd", { XM, Vex, EXx }, 0 },
4844 { "vmaxsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4847 /* PREFIX_VEX_0F60 */
4851 { "vpunpcklbw", { XM, Vex, EXx }, 0 },
4854 /* PREFIX_VEX_0F61 */
4858 { "vpunpcklwd", { XM, Vex, EXx }, 0 },
4861 /* PREFIX_VEX_0F62 */
4865 { "vpunpckldq", { XM, Vex, EXx }, 0 },
4868 /* PREFIX_VEX_0F63 */
4872 { "vpacksswb", { XM, Vex, EXx }, 0 },
4875 /* PREFIX_VEX_0F64 */
4879 { "vpcmpgtb", { XM, Vex, EXx }, 0 },
4882 /* PREFIX_VEX_0F65 */
4886 { "vpcmpgtw", { XM, Vex, EXx }, 0 },
4889 /* PREFIX_VEX_0F66 */
4893 { "vpcmpgtd", { XM, Vex, EXx }, 0 },
4896 /* PREFIX_VEX_0F67 */
4900 { "vpackuswb", { XM, Vex, EXx }, 0 },
4903 /* PREFIX_VEX_0F68 */
4907 { "vpunpckhbw", { XM, Vex, EXx }, 0 },
4910 /* PREFIX_VEX_0F69 */
4914 { "vpunpckhwd", { XM, Vex, EXx }, 0 },
4917 /* PREFIX_VEX_0F6A */
4921 { "vpunpckhdq", { XM, Vex, EXx }, 0 },
4924 /* PREFIX_VEX_0F6B */
4928 { "vpackssdw", { XM, Vex, EXx }, 0 },
4931 /* PREFIX_VEX_0F6C */
4935 { "vpunpcklqdq", { XM, Vex, EXx }, 0 },
4938 /* PREFIX_VEX_0F6D */
4942 { "vpunpckhqdq", { XM, Vex, EXx }, 0 },
4945 /* PREFIX_VEX_0F6E */
4949 { VEX_LEN_TABLE (VEX_LEN_0F6E_P_2) },
4952 /* PREFIX_VEX_0F6F */
4955 { "vmovdqu", { XM, EXx }, 0 },
4956 { "vmovdqa", { XM, EXx }, 0 },
4959 /* PREFIX_VEX_0F70 */
4962 { "vpshufhw", { XM, EXx, Ib }, 0 },
4963 { "vpshufd", { XM, EXx, Ib }, 0 },
4964 { "vpshuflw", { XM, EXx, Ib }, 0 },
4967 /* PREFIX_VEX_0F71_REG_2 */
4971 { "vpsrlw", { Vex, XS, Ib }, 0 },
4974 /* PREFIX_VEX_0F71_REG_4 */
4978 { "vpsraw", { Vex, XS, Ib }, 0 },
4981 /* PREFIX_VEX_0F71_REG_6 */
4985 { "vpsllw", { Vex, XS, Ib }, 0 },
4988 /* PREFIX_VEX_0F72_REG_2 */
4992 { "vpsrld", { Vex, XS, Ib }, 0 },
4995 /* PREFIX_VEX_0F72_REG_4 */
4999 { "vpsrad", { Vex, XS, Ib }, 0 },
5002 /* PREFIX_VEX_0F72_REG_6 */
5006 { "vpslld", { Vex, XS, Ib }, 0 },
5009 /* PREFIX_VEX_0F73_REG_2 */
5013 { "vpsrlq", { Vex, XS, Ib }, 0 },
5016 /* PREFIX_VEX_0F73_REG_3 */
5020 { "vpsrldq", { Vex, XS, Ib }, 0 },
5023 /* PREFIX_VEX_0F73_REG_6 */
5027 { "vpsllq", { Vex, XS, Ib }, 0 },
5030 /* PREFIX_VEX_0F73_REG_7 */
5034 { "vpslldq", { Vex, XS, Ib }, 0 },
5037 /* PREFIX_VEX_0F74 */
5041 { "vpcmpeqb", { XM, Vex, EXx }, 0 },
5044 /* PREFIX_VEX_0F75 */
5048 { "vpcmpeqw", { XM, Vex, EXx }, 0 },
5051 /* PREFIX_VEX_0F76 */
5055 { "vpcmpeqd", { XM, Vex, EXx }, 0 },
5058 /* PREFIX_VEX_0F77 */
5060 { VEX_LEN_TABLE (VEX_LEN_0F77_P_0) },
5063 /* PREFIX_VEX_0F7C */
5067 { "vhaddpd", { XM, Vex, EXx }, 0 },
5068 { "vhaddps", { XM, Vex, EXx }, 0 },
5071 /* PREFIX_VEX_0F7D */
5075 { "vhsubpd", { XM, Vex, EXx }, 0 },
5076 { "vhsubps", { XM, Vex, EXx }, 0 },
5079 /* PREFIX_VEX_0F7E */
5082 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1) },
5083 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2) },
5086 /* PREFIX_VEX_0F7F */
5089 { "vmovdqu", { EXxS, XM }, 0 },
5090 { "vmovdqa", { EXxS, XM }, 0 },
5093 /* PREFIX_VEX_0F90 */
5095 { VEX_LEN_TABLE (VEX_LEN_0F90_P_0) },
5097 { VEX_LEN_TABLE (VEX_LEN_0F90_P_2) },
5100 /* PREFIX_VEX_0F91 */
5102 { VEX_LEN_TABLE (VEX_LEN_0F91_P_0) },
5104 { VEX_LEN_TABLE (VEX_LEN_0F91_P_2) },
5107 /* PREFIX_VEX_0F92 */
5109 { VEX_LEN_TABLE (VEX_LEN_0F92_P_0) },
5111 { VEX_LEN_TABLE (VEX_LEN_0F92_P_2) },
5112 { VEX_LEN_TABLE (VEX_LEN_0F92_P_3) },
5115 /* PREFIX_VEX_0F93 */
5117 { VEX_LEN_TABLE (VEX_LEN_0F93_P_0) },
5119 { VEX_LEN_TABLE (VEX_LEN_0F93_P_2) },
5120 { VEX_LEN_TABLE (VEX_LEN_0F93_P_3) },
5123 /* PREFIX_VEX_0F98 */
5125 { VEX_LEN_TABLE (VEX_LEN_0F98_P_0) },
5127 { VEX_LEN_TABLE (VEX_LEN_0F98_P_2) },
5130 /* PREFIX_VEX_0F99 */
5132 { VEX_LEN_TABLE (VEX_LEN_0F99_P_0) },
5134 { VEX_LEN_TABLE (VEX_LEN_0F99_P_2) },
5137 /* PREFIX_VEX_0FC2 */
5139 { "vcmpps", { XM, Vex, EXx, VCMP }, 0 },
5140 { "vcmpss", { XMScalar, VexScalar, EXdScalar, VCMP }, 0 },
5141 { "vcmppd", { XM, Vex, EXx, VCMP }, 0 },
5142 { "vcmpsd", { XMScalar, VexScalar, EXqScalar, VCMP }, 0 },
5145 /* PREFIX_VEX_0FC4 */
5149 { VEX_LEN_TABLE (VEX_LEN_0FC4_P_2) },
5152 /* PREFIX_VEX_0FC5 */
5156 { VEX_LEN_TABLE (VEX_LEN_0FC5_P_2) },
5159 /* PREFIX_VEX_0FD0 */
5163 { "vaddsubpd", { XM, Vex, EXx }, 0 },
5164 { "vaddsubps", { XM, Vex, EXx }, 0 },
5167 /* PREFIX_VEX_0FD1 */
5171 { "vpsrlw", { XM, Vex, EXxmm }, 0 },
5174 /* PREFIX_VEX_0FD2 */
5178 { "vpsrld", { XM, Vex, EXxmm }, 0 },
5181 /* PREFIX_VEX_0FD3 */
5185 { "vpsrlq", { XM, Vex, EXxmm }, 0 },
5188 /* PREFIX_VEX_0FD4 */
5192 { "vpaddq", { XM, Vex, EXx }, 0 },
5195 /* PREFIX_VEX_0FD5 */
5199 { "vpmullw", { XM, Vex, EXx }, 0 },
5202 /* PREFIX_VEX_0FD6 */
5206 { VEX_LEN_TABLE (VEX_LEN_0FD6_P_2) },
5209 /* PREFIX_VEX_0FD7 */
5213 { MOD_TABLE (MOD_VEX_0FD7_PREFIX_2) },
5216 /* PREFIX_VEX_0FD8 */
5220 { "vpsubusb", { XM, Vex, EXx }, 0 },
5223 /* PREFIX_VEX_0FD9 */
5227 { "vpsubusw", { XM, Vex, EXx }, 0 },
5230 /* PREFIX_VEX_0FDA */
5234 { "vpminub", { XM, Vex, EXx }, 0 },
5237 /* PREFIX_VEX_0FDB */
5241 { "vpand", { XM, Vex, EXx }, 0 },
5244 /* PREFIX_VEX_0FDC */
5248 { "vpaddusb", { XM, Vex, EXx }, 0 },
5251 /* PREFIX_VEX_0FDD */
5255 { "vpaddusw", { XM, Vex, EXx }, 0 },
5258 /* PREFIX_VEX_0FDE */
5262 { "vpmaxub", { XM, Vex, EXx }, 0 },
5265 /* PREFIX_VEX_0FDF */
5269 { "vpandn", { XM, Vex, EXx }, 0 },
5272 /* PREFIX_VEX_0FE0 */
5276 { "vpavgb", { XM, Vex, EXx }, 0 },
5279 /* PREFIX_VEX_0FE1 */
5283 { "vpsraw", { XM, Vex, EXxmm }, 0 },
5286 /* PREFIX_VEX_0FE2 */
5290 { "vpsrad", { XM, Vex, EXxmm }, 0 },
5293 /* PREFIX_VEX_0FE3 */
5297 { "vpavgw", { XM, Vex, EXx }, 0 },
5300 /* PREFIX_VEX_0FE4 */
5304 { "vpmulhuw", { XM, Vex, EXx }, 0 },
5307 /* PREFIX_VEX_0FE5 */
5311 { "vpmulhw", { XM, Vex, EXx }, 0 },
5314 /* PREFIX_VEX_0FE6 */
5317 { "vcvtdq2pd", { XM, EXxmmq }, 0 },
5318 { "vcvttpd2dq%XY", { XMM, EXx }, 0 },
5319 { "vcvtpd2dq%XY", { XMM, EXx }, 0 },
5322 /* PREFIX_VEX_0FE7 */
5326 { MOD_TABLE (MOD_VEX_0FE7_PREFIX_2) },
5329 /* PREFIX_VEX_0FE8 */
5333 { "vpsubsb", { XM, Vex, EXx }, 0 },
5336 /* PREFIX_VEX_0FE9 */
5340 { "vpsubsw", { XM, Vex, EXx }, 0 },
5343 /* PREFIX_VEX_0FEA */
5347 { "vpminsw", { XM, Vex, EXx }, 0 },
5350 /* PREFIX_VEX_0FEB */
5354 { "vpor", { XM, Vex, EXx }, 0 },
5357 /* PREFIX_VEX_0FEC */
5361 { "vpaddsb", { XM, Vex, EXx }, 0 },
5364 /* PREFIX_VEX_0FED */
5368 { "vpaddsw", { XM, Vex, EXx }, 0 },
5371 /* PREFIX_VEX_0FEE */
5375 { "vpmaxsw", { XM, Vex, EXx }, 0 },
5378 /* PREFIX_VEX_0FEF */
5382 { "vpxor", { XM, Vex, EXx }, 0 },
5385 /* PREFIX_VEX_0FF0 */
5390 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3) },
5393 /* PREFIX_VEX_0FF1 */
5397 { "vpsllw", { XM, Vex, EXxmm }, 0 },
5400 /* PREFIX_VEX_0FF2 */
5404 { "vpslld", { XM, Vex, EXxmm }, 0 },
5407 /* PREFIX_VEX_0FF3 */
5411 { "vpsllq", { XM, Vex, EXxmm }, 0 },
5414 /* PREFIX_VEX_0FF4 */
5418 { "vpmuludq", { XM, Vex, EXx }, 0 },
5421 /* PREFIX_VEX_0FF5 */
5425 { "vpmaddwd", { XM, Vex, EXx }, 0 },
5428 /* PREFIX_VEX_0FF6 */
5432 { "vpsadbw", { XM, Vex, EXx }, 0 },
5435 /* PREFIX_VEX_0FF7 */
5439 { VEX_LEN_TABLE (VEX_LEN_0FF7_P_2) },
5442 /* PREFIX_VEX_0FF8 */
5446 { "vpsubb", { XM, Vex, EXx }, 0 },
5449 /* PREFIX_VEX_0FF9 */
5453 { "vpsubw", { XM, Vex, EXx }, 0 },
5456 /* PREFIX_VEX_0FFA */
5460 { "vpsubd", { XM, Vex, EXx }, 0 },
5463 /* PREFIX_VEX_0FFB */
5467 { "vpsubq", { XM, Vex, EXx }, 0 },
5470 /* PREFIX_VEX_0FFC */
5474 { "vpaddb", { XM, Vex, EXx }, 0 },
5477 /* PREFIX_VEX_0FFD */
5481 { "vpaddw", { XM, Vex, EXx }, 0 },
5484 /* PREFIX_VEX_0FFE */
5488 { "vpaddd", { XM, Vex, EXx }, 0 },
5491 /* PREFIX_VEX_0F3800 */
5495 { "vpshufb", { XM, Vex, EXx }, 0 },
5498 /* PREFIX_VEX_0F3801 */
5502 { "vphaddw", { XM, Vex, EXx }, 0 },
5505 /* PREFIX_VEX_0F3802 */
5509 { "vphaddd", { XM, Vex, EXx }, 0 },
5512 /* PREFIX_VEX_0F3803 */
5516 { "vphaddsw", { XM, Vex, EXx }, 0 },
5519 /* PREFIX_VEX_0F3804 */
5523 { "vpmaddubsw", { XM, Vex, EXx }, 0 },
5526 /* PREFIX_VEX_0F3805 */
5530 { "vphsubw", { XM, Vex, EXx }, 0 },
5533 /* PREFIX_VEX_0F3806 */
5537 { "vphsubd", { XM, Vex, EXx }, 0 },
5540 /* PREFIX_VEX_0F3807 */
5544 { "vphsubsw", { XM, Vex, EXx }, 0 },
5547 /* PREFIX_VEX_0F3808 */
5551 { "vpsignb", { XM, Vex, EXx }, 0 },
5554 /* PREFIX_VEX_0F3809 */
5558 { "vpsignw", { XM, Vex, EXx }, 0 },
5561 /* PREFIX_VEX_0F380A */
5565 { "vpsignd", { XM, Vex, EXx }, 0 },
5568 /* PREFIX_VEX_0F380B */
5572 { "vpmulhrsw", { XM, Vex, EXx }, 0 },
5575 /* PREFIX_VEX_0F380C */
5579 { VEX_W_TABLE (VEX_W_0F380C_P_2) },
5582 /* PREFIX_VEX_0F380D */
5586 { VEX_W_TABLE (VEX_W_0F380D_P_2) },
5589 /* PREFIX_VEX_0F380E */
5593 { VEX_W_TABLE (VEX_W_0F380E_P_2) },
5596 /* PREFIX_VEX_0F380F */
5600 { VEX_W_TABLE (VEX_W_0F380F_P_2) },
5603 /* PREFIX_VEX_0F3813 */
5607 { "vcvtph2ps", { XM, EXxmmq }, 0 },
5610 /* PREFIX_VEX_0F3816 */
5614 { VEX_LEN_TABLE (VEX_LEN_0F3816_P_2) },
5617 /* PREFIX_VEX_0F3817 */
5621 { "vptest", { XM, EXx }, 0 },
5624 /* PREFIX_VEX_0F3818 */
5628 { VEX_W_TABLE (VEX_W_0F3818_P_2) },
5631 /* PREFIX_VEX_0F3819 */
5635 { VEX_LEN_TABLE (VEX_LEN_0F3819_P_2) },
5638 /* PREFIX_VEX_0F381A */
5642 { MOD_TABLE (MOD_VEX_0F381A_PREFIX_2) },
5645 /* PREFIX_VEX_0F381C */
5649 { "vpabsb", { XM, EXx }, 0 },
5652 /* PREFIX_VEX_0F381D */
5656 { "vpabsw", { XM, EXx }, 0 },
5659 /* PREFIX_VEX_0F381E */
5663 { "vpabsd", { XM, EXx }, 0 },
5666 /* PREFIX_VEX_0F3820 */
5670 { "vpmovsxbw", { XM, EXxmmq }, 0 },
5673 /* PREFIX_VEX_0F3821 */
5677 { "vpmovsxbd", { XM, EXxmmqd }, 0 },
5680 /* PREFIX_VEX_0F3822 */
5684 { "vpmovsxbq", { XM, EXxmmdw }, 0 },
5687 /* PREFIX_VEX_0F3823 */
5691 { "vpmovsxwd", { XM, EXxmmq }, 0 },
5694 /* PREFIX_VEX_0F3824 */
5698 { "vpmovsxwq", { XM, EXxmmqd }, 0 },
5701 /* PREFIX_VEX_0F3825 */
5705 { "vpmovsxdq", { XM, EXxmmq }, 0 },
5708 /* PREFIX_VEX_0F3828 */
5712 { "vpmuldq", { XM, Vex, EXx }, 0 },
5715 /* PREFIX_VEX_0F3829 */
5719 { "vpcmpeqq", { XM, Vex, EXx }, 0 },
5722 /* PREFIX_VEX_0F382A */
5726 { MOD_TABLE (MOD_VEX_0F382A_PREFIX_2) },
5729 /* PREFIX_VEX_0F382B */
5733 { "vpackusdw", { XM, Vex, EXx }, 0 },
5736 /* PREFIX_VEX_0F382C */
5740 { MOD_TABLE (MOD_VEX_0F382C_PREFIX_2) },
5743 /* PREFIX_VEX_0F382D */
5747 { MOD_TABLE (MOD_VEX_0F382D_PREFIX_2) },
5750 /* PREFIX_VEX_0F382E */
5754 { MOD_TABLE (MOD_VEX_0F382E_PREFIX_2) },
5757 /* PREFIX_VEX_0F382F */
5761 { MOD_TABLE (MOD_VEX_0F382F_PREFIX_2) },
5764 /* PREFIX_VEX_0F3830 */
5768 { "vpmovzxbw", { XM, EXxmmq }, 0 },
5771 /* PREFIX_VEX_0F3831 */
5775 { "vpmovzxbd", { XM, EXxmmqd }, 0 },
5778 /* PREFIX_VEX_0F3832 */
5782 { "vpmovzxbq", { XM, EXxmmdw }, 0 },
5785 /* PREFIX_VEX_0F3833 */
5789 { "vpmovzxwd", { XM, EXxmmq }, 0 },
5792 /* PREFIX_VEX_0F3834 */
5796 { "vpmovzxwq", { XM, EXxmmqd }, 0 },
5799 /* PREFIX_VEX_0F3835 */
5803 { "vpmovzxdq", { XM, EXxmmq }, 0 },
5806 /* PREFIX_VEX_0F3836 */
5810 { VEX_LEN_TABLE (VEX_LEN_0F3836_P_2) },
5813 /* PREFIX_VEX_0F3837 */
5817 { "vpcmpgtq", { XM, Vex, EXx }, 0 },
5820 /* PREFIX_VEX_0F3838 */
5824 { "vpminsb", { XM, Vex, EXx }, 0 },
5827 /* PREFIX_VEX_0F3839 */
5831 { "vpminsd", { XM, Vex, EXx }, 0 },
5834 /* PREFIX_VEX_0F383A */
5838 { "vpminuw", { XM, Vex, EXx }, 0 },
5841 /* PREFIX_VEX_0F383B */
5845 { "vpminud", { XM, Vex, EXx }, 0 },
5848 /* PREFIX_VEX_0F383C */
5852 { "vpmaxsb", { XM, Vex, EXx }, 0 },
5855 /* PREFIX_VEX_0F383D */
5859 { "vpmaxsd", { XM, Vex, EXx }, 0 },
5862 /* PREFIX_VEX_0F383E */
5866 { "vpmaxuw", { XM, Vex, EXx }, 0 },
5869 /* PREFIX_VEX_0F383F */
5873 { "vpmaxud", { XM, Vex, EXx }, 0 },
5876 /* PREFIX_VEX_0F3840 */
5880 { "vpmulld", { XM, Vex, EXx }, 0 },
5883 /* PREFIX_VEX_0F3841 */
5887 { VEX_LEN_TABLE (VEX_LEN_0F3841_P_2) },
5890 /* PREFIX_VEX_0F3845 */
5894 { "vpsrlv%LW", { XM, Vex, EXx }, 0 },
5897 /* PREFIX_VEX_0F3846 */
5901 { VEX_W_TABLE (VEX_W_0F3846_P_2) },
5904 /* PREFIX_VEX_0F3847 */
5908 { "vpsllv%LW", { XM, Vex, EXx }, 0 },
5911 /* PREFIX_VEX_0F3858 */
5915 { VEX_W_TABLE (VEX_W_0F3858_P_2) },
5918 /* PREFIX_VEX_0F3859 */
5922 { VEX_W_TABLE (VEX_W_0F3859_P_2) },
5925 /* PREFIX_VEX_0F385A */
5929 { MOD_TABLE (MOD_VEX_0F385A_PREFIX_2) },
5932 /* PREFIX_VEX_0F3878 */
5936 { VEX_W_TABLE (VEX_W_0F3878_P_2) },
5939 /* PREFIX_VEX_0F3879 */
5943 { VEX_W_TABLE (VEX_W_0F3879_P_2) },
5946 /* PREFIX_VEX_0F388C */
5950 { MOD_TABLE (MOD_VEX_0F388C_PREFIX_2) },
5953 /* PREFIX_VEX_0F388E */
5957 { MOD_TABLE (MOD_VEX_0F388E_PREFIX_2) },
5960 /* PREFIX_VEX_0F3890 */
5964 { "vpgatherd%LW", { XM, MVexVSIBDWpX, Vex }, 0 },
5967 /* PREFIX_VEX_0F3891 */
5971 { "vpgatherq%LW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
5974 /* PREFIX_VEX_0F3892 */
5978 { "vgatherdp%XW", { XM, MVexVSIBDWpX, Vex }, 0 },
5981 /* PREFIX_VEX_0F3893 */
5985 { "vgatherqp%XW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
5988 /* PREFIX_VEX_0F3896 */
5992 { "vfmaddsub132p%XW", { XM, Vex, EXx }, 0 },
5995 /* PREFIX_VEX_0F3897 */
5999 { "vfmsubadd132p%XW", { XM, Vex, EXx }, 0 },
6002 /* PREFIX_VEX_0F3898 */
6006 { "vfmadd132p%XW", { XM, Vex, EXx }, 0 },
6009 /* PREFIX_VEX_0F3899 */
6013 { "vfmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6016 /* PREFIX_VEX_0F389A */
6020 { "vfmsub132p%XW", { XM, Vex, EXx }, 0 },
6023 /* PREFIX_VEX_0F389B */
6027 { "vfmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6030 /* PREFIX_VEX_0F389C */
6034 { "vfnmadd132p%XW", { XM, Vex, EXx }, 0 },
6037 /* PREFIX_VEX_0F389D */
6041 { "vfnmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6044 /* PREFIX_VEX_0F389E */
6048 { "vfnmsub132p%XW", { XM, Vex, EXx }, 0 },
6051 /* PREFIX_VEX_0F389F */
6055 { "vfnmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6058 /* PREFIX_VEX_0F38A6 */
6062 { "vfmaddsub213p%XW", { XM, Vex, EXx }, 0 },
6066 /* PREFIX_VEX_0F38A7 */
6070 { "vfmsubadd213p%XW", { XM, Vex, EXx }, 0 },
6073 /* PREFIX_VEX_0F38A8 */
6077 { "vfmadd213p%XW", { XM, Vex, EXx }, 0 },
6080 /* PREFIX_VEX_0F38A9 */
6084 { "vfmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6087 /* PREFIX_VEX_0F38AA */
6091 { "vfmsub213p%XW", { XM, Vex, EXx }, 0 },
6094 /* PREFIX_VEX_0F38AB */
6098 { "vfmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6101 /* PREFIX_VEX_0F38AC */
6105 { "vfnmadd213p%XW", { XM, Vex, EXx }, 0 },
6108 /* PREFIX_VEX_0F38AD */
6112 { "vfnmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6115 /* PREFIX_VEX_0F38AE */
6119 { "vfnmsub213p%XW", { XM, Vex, EXx }, 0 },
6122 /* PREFIX_VEX_0F38AF */
6126 { "vfnmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6129 /* PREFIX_VEX_0F38B6 */
6133 { "vfmaddsub231p%XW", { XM, Vex, EXx }, 0 },
6136 /* PREFIX_VEX_0F38B7 */
6140 { "vfmsubadd231p%XW", { XM, Vex, EXx }, 0 },
6143 /* PREFIX_VEX_0F38B8 */
6147 { "vfmadd231p%XW", { XM, Vex, EXx }, 0 },
6150 /* PREFIX_VEX_0F38B9 */
6154 { "vfmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6157 /* PREFIX_VEX_0F38BA */
6161 { "vfmsub231p%XW", { XM, Vex, EXx }, 0 },
6164 /* PREFIX_VEX_0F38BB */
6168 { "vfmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6171 /* PREFIX_VEX_0F38BC */
6175 { "vfnmadd231p%XW", { XM, Vex, EXx }, 0 },
6178 /* PREFIX_VEX_0F38BD */
6182 { "vfnmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6185 /* PREFIX_VEX_0F38BE */
6189 { "vfnmsub231p%XW", { XM, Vex, EXx }, 0 },
6192 /* PREFIX_VEX_0F38BF */
6196 { "vfnmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6199 /* PREFIX_VEX_0F38CF */
6203 { VEX_W_TABLE (VEX_W_0F38CF_P_2) },
6206 /* PREFIX_VEX_0F38DB */
6210 { VEX_LEN_TABLE (VEX_LEN_0F38DB_P_2) },
6213 /* PREFIX_VEX_0F38DC */
6217 { "vaesenc", { XM, Vex, EXx }, 0 },
6220 /* PREFIX_VEX_0F38DD */
6224 { "vaesenclast", { XM, Vex, EXx }, 0 },
6227 /* PREFIX_VEX_0F38DE */
6231 { "vaesdec", { XM, Vex, EXx }, 0 },
6234 /* PREFIX_VEX_0F38DF */
6238 { "vaesdeclast", { XM, Vex, EXx }, 0 },
6241 /* PREFIX_VEX_0F38F2 */
6243 { VEX_LEN_TABLE (VEX_LEN_0F38F2_P_0) },
6246 /* PREFIX_VEX_0F38F3_REG_1 */
6248 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_1_P_0) },
6251 /* PREFIX_VEX_0F38F3_REG_2 */
6253 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_2_P_0) },
6256 /* PREFIX_VEX_0F38F3_REG_3 */
6258 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_3_P_0) },
6261 /* PREFIX_VEX_0F38F5 */
6263 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_0) },
6264 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_1) },
6266 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_3) },
6269 /* PREFIX_VEX_0F38F6 */
6274 { VEX_LEN_TABLE (VEX_LEN_0F38F6_P_3) },
6277 /* PREFIX_VEX_0F38F7 */
6279 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_0) },
6280 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_1) },
6281 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_2) },
6282 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_3) },
6285 /* PREFIX_VEX_0F3A00 */
6289 { VEX_LEN_TABLE (VEX_LEN_0F3A00_P_2) },
6292 /* PREFIX_VEX_0F3A01 */
6296 { VEX_LEN_TABLE (VEX_LEN_0F3A01_P_2) },
6299 /* PREFIX_VEX_0F3A02 */
6303 { VEX_W_TABLE (VEX_W_0F3A02_P_2) },
6306 /* PREFIX_VEX_0F3A04 */
6310 { VEX_W_TABLE (VEX_W_0F3A04_P_2) },
6313 /* PREFIX_VEX_0F3A05 */
6317 { VEX_W_TABLE (VEX_W_0F3A05_P_2) },
6320 /* PREFIX_VEX_0F3A06 */
6324 { VEX_LEN_TABLE (VEX_LEN_0F3A06_P_2) },
6327 /* PREFIX_VEX_0F3A08 */
6331 { "vroundps", { XM, EXx, Ib }, 0 },
6334 /* PREFIX_VEX_0F3A09 */
6338 { "vroundpd", { XM, EXx, Ib }, 0 },
6341 /* PREFIX_VEX_0F3A0A */
6345 { "vroundss", { XMScalar, VexScalar, EXdScalar, Ib }, 0 },
6348 /* PREFIX_VEX_0F3A0B */
6352 { "vroundsd", { XMScalar, VexScalar, EXqScalar, Ib }, 0 },
6355 /* PREFIX_VEX_0F3A0C */
6359 { "vblendps", { XM, Vex, EXx, Ib }, 0 },
6362 /* PREFIX_VEX_0F3A0D */
6366 { "vblendpd", { XM, Vex, EXx, Ib }, 0 },
6369 /* PREFIX_VEX_0F3A0E */
6373 { "vpblendw", { XM, Vex, EXx, Ib }, 0 },
6376 /* PREFIX_VEX_0F3A0F */
6380 { "vpalignr", { XM, Vex, EXx, Ib }, 0 },
6383 /* PREFIX_VEX_0F3A14 */
6387 { VEX_LEN_TABLE (VEX_LEN_0F3A14_P_2) },
6390 /* PREFIX_VEX_0F3A15 */
6394 { VEX_LEN_TABLE (VEX_LEN_0F3A15_P_2) },
6397 /* PREFIX_VEX_0F3A16 */
6401 { VEX_LEN_TABLE (VEX_LEN_0F3A16_P_2) },
6404 /* PREFIX_VEX_0F3A17 */
6408 { VEX_LEN_TABLE (VEX_LEN_0F3A17_P_2) },
6411 /* PREFIX_VEX_0F3A18 */
6415 { VEX_LEN_TABLE (VEX_LEN_0F3A18_P_2) },
6418 /* PREFIX_VEX_0F3A19 */
6422 { VEX_LEN_TABLE (VEX_LEN_0F3A19_P_2) },
6425 /* PREFIX_VEX_0F3A1D */
6429 { "vcvtps2ph", { EXxmmq, XM, Ib }, 0 },
6432 /* PREFIX_VEX_0F3A20 */
6436 { VEX_LEN_TABLE (VEX_LEN_0F3A20_P_2) },
6439 /* PREFIX_VEX_0F3A21 */
6443 { VEX_LEN_TABLE (VEX_LEN_0F3A21_P_2) },
6446 /* PREFIX_VEX_0F3A22 */
6450 { VEX_LEN_TABLE (VEX_LEN_0F3A22_P_2) },
6453 /* PREFIX_VEX_0F3A30 */
6457 { VEX_LEN_TABLE (VEX_LEN_0F3A30_P_2) },
6460 /* PREFIX_VEX_0F3A31 */
6464 { VEX_LEN_TABLE (VEX_LEN_0F3A31_P_2) },
6467 /* PREFIX_VEX_0F3A32 */
6471 { VEX_LEN_TABLE (VEX_LEN_0F3A32_P_2) },
6474 /* PREFIX_VEX_0F3A33 */
6478 { VEX_LEN_TABLE (VEX_LEN_0F3A33_P_2) },
6481 /* PREFIX_VEX_0F3A38 */
6485 { VEX_LEN_TABLE (VEX_LEN_0F3A38_P_2) },
6488 /* PREFIX_VEX_0F3A39 */
6492 { VEX_LEN_TABLE (VEX_LEN_0F3A39_P_2) },
6495 /* PREFIX_VEX_0F3A40 */
6499 { "vdpps", { XM, Vex, EXx, Ib }, 0 },
6502 /* PREFIX_VEX_0F3A41 */
6506 { VEX_LEN_TABLE (VEX_LEN_0F3A41_P_2) },
6509 /* PREFIX_VEX_0F3A42 */
6513 { "vmpsadbw", { XM, Vex, EXx, Ib }, 0 },
6516 /* PREFIX_VEX_0F3A44 */
6520 { "vpclmulqdq", { XM, Vex, EXx, PCLMUL }, 0 },
6523 /* PREFIX_VEX_0F3A46 */
6527 { VEX_LEN_TABLE (VEX_LEN_0F3A46_P_2) },
6530 /* PREFIX_VEX_0F3A48 */
6534 { VEX_W_TABLE (VEX_W_0F3A48_P_2) },
6537 /* PREFIX_VEX_0F3A49 */
6541 { VEX_W_TABLE (VEX_W_0F3A49_P_2) },
6544 /* PREFIX_VEX_0F3A4A */
6548 { VEX_W_TABLE (VEX_W_0F3A4A_P_2) },
6551 /* PREFIX_VEX_0F3A4B */
6555 { VEX_W_TABLE (VEX_W_0F3A4B_P_2) },
6558 /* PREFIX_VEX_0F3A4C */
6562 { VEX_W_TABLE (VEX_W_0F3A4C_P_2) },
6565 /* PREFIX_VEX_0F3A5C */
6569 { "vfmaddsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6572 /* PREFIX_VEX_0F3A5D */
6576 { "vfmaddsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6579 /* PREFIX_VEX_0F3A5E */
6583 { "vfmsubaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6586 /* PREFIX_VEX_0F3A5F */
6590 { "vfmsubaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6593 /* PREFIX_VEX_0F3A60 */
6597 { VEX_LEN_TABLE (VEX_LEN_0F3A60_P_2) },
6601 /* PREFIX_VEX_0F3A61 */
6605 { VEX_LEN_TABLE (VEX_LEN_0F3A61_P_2) },
6608 /* PREFIX_VEX_0F3A62 */
6612 { VEX_LEN_TABLE (VEX_LEN_0F3A62_P_2) },
6615 /* PREFIX_VEX_0F3A63 */
6619 { VEX_LEN_TABLE (VEX_LEN_0F3A63_P_2) },
6622 /* PREFIX_VEX_0F3A68 */
6626 { "vfmaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6629 /* PREFIX_VEX_0F3A69 */
6633 { "vfmaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6636 /* PREFIX_VEX_0F3A6A */
6640 { VEX_LEN_TABLE (VEX_LEN_0F3A6A_P_2) },
6643 /* PREFIX_VEX_0F3A6B */
6647 { VEX_LEN_TABLE (VEX_LEN_0F3A6B_P_2) },
6650 /* PREFIX_VEX_0F3A6C */
6654 { "vfmsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6657 /* PREFIX_VEX_0F3A6D */
6661 { "vfmsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6664 /* PREFIX_VEX_0F3A6E */
6668 { VEX_LEN_TABLE (VEX_LEN_0F3A6E_P_2) },
6671 /* PREFIX_VEX_0F3A6F */
6675 { VEX_LEN_TABLE (VEX_LEN_0F3A6F_P_2) },
6678 /* PREFIX_VEX_0F3A78 */
6682 { "vfnmaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6685 /* PREFIX_VEX_0F3A79 */
6689 { "vfnmaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6692 /* PREFIX_VEX_0F3A7A */
6696 { VEX_LEN_TABLE (VEX_LEN_0F3A7A_P_2) },
6699 /* PREFIX_VEX_0F3A7B */
6703 { VEX_LEN_TABLE (VEX_LEN_0F3A7B_P_2) },
6706 /* PREFIX_VEX_0F3A7C */
6710 { "vfnmsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6714 /* PREFIX_VEX_0F3A7D */
6718 { "vfnmsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6721 /* PREFIX_VEX_0F3A7E */
6725 { VEX_LEN_TABLE (VEX_LEN_0F3A7E_P_2) },
6728 /* PREFIX_VEX_0F3A7F */
6732 { VEX_LEN_TABLE (VEX_LEN_0F3A7F_P_2) },
6735 /* PREFIX_VEX_0F3ACE */
6739 { VEX_W_TABLE (VEX_W_0F3ACE_P_2) },
6742 /* PREFIX_VEX_0F3ACF */
6746 { VEX_W_TABLE (VEX_W_0F3ACF_P_2) },
6749 /* PREFIX_VEX_0F3ADF */
6753 { VEX_LEN_TABLE (VEX_LEN_0F3ADF_P_2) },
6756 /* PREFIX_VEX_0F3AF0 */
6761 { VEX_LEN_TABLE (VEX_LEN_0F3AF0_P_3) },
6764 #define NEED_PREFIX_TABLE
6765 #include "i386-dis-evex.h"
6766 #undef NEED_PREFIX_TABLE
6769 static const struct dis386 x86_64_table[][2] = {
6772 { "pushP", { es }, 0 },
6777 { "popP", { es }, 0 },
6782 { "pushP", { cs }, 0 },
6787 { "pushP", { ss }, 0 },
6792 { "popP", { ss }, 0 },
6797 { "pushP", { ds }, 0 },
6802 { "popP", { ds }, 0 },
6807 { "daa", { XX }, 0 },
6812 { "das", { XX }, 0 },
6817 { "aaa", { XX }, 0 },
6822 { "aas", { XX }, 0 },
6827 { "pushaP", { XX }, 0 },
6832 { "popaP", { XX }, 0 },
6837 { MOD_TABLE (MOD_62_32BIT) },
6838 { EVEX_TABLE (EVEX_0F) },
6843 { "arpl", { Ew, Gw }, 0 },
6844 { "movs{lq|xd}", { Gv, Ed }, 0 },
6849 { "ins{R|}", { Yzr, indirDX }, 0 },
6850 { "ins{G|}", { Yzr, indirDX }, 0 },
6855 { "outs{R|}", { indirDXr, Xz }, 0 },
6856 { "outs{G|}", { indirDXr, Xz }, 0 },
6861 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
6862 { REG_TABLE (REG_80) },
6867 { "Jcall{T|}", { Ap }, 0 },
6872 { MOD_TABLE (MOD_C4_32BIT) },
6873 { VEX_C4_TABLE (VEX_0F) },
6878 { MOD_TABLE (MOD_C5_32BIT) },
6879 { VEX_C5_TABLE (VEX_0F) },
6884 { "into", { XX }, 0 },
6889 { "aam", { Ib }, 0 },
6894 { "aad", { Ib }, 0 },
6899 { "callP", { Jv, BND }, 0 },
6900 { "call@", { Jv, BND }, 0 }
6905 { "jmpP", { Jv, BND }, 0 },
6906 { "jmp@", { Jv, BND }, 0 }
6911 { "Jjmp{T|}", { Ap }, 0 },
6914 /* X86_64_0F01_REG_0 */
6916 { "sgdt{Q|IQ}", { M }, 0 },
6917 { "sgdt", { M }, 0 },
6920 /* X86_64_0F01_REG_1 */
6922 { "sidt{Q|IQ}", { M }, 0 },
6923 { "sidt", { M }, 0 },
6926 /* X86_64_0F01_REG_2 */
6928 { "lgdt{Q|Q}", { M }, 0 },
6929 { "lgdt", { M }, 0 },
6932 /* X86_64_0F01_REG_3 */
6934 { "lidt{Q|Q}", { M }, 0 },
6935 { "lidt", { M }, 0 },
6939 static const struct dis386 three_byte_table[][256] = {
6941 /* THREE_BYTE_0F38 */
6944 { "pshufb", { MX, EM }, PREFIX_OPCODE },
6945 { "phaddw", { MX, EM }, PREFIX_OPCODE },
6946 { "phaddd", { MX, EM }, PREFIX_OPCODE },
6947 { "phaddsw", { MX, EM }, PREFIX_OPCODE },
6948 { "pmaddubsw", { MX, EM }, PREFIX_OPCODE },
6949 { "phsubw", { MX, EM }, PREFIX_OPCODE },
6950 { "phsubd", { MX, EM }, PREFIX_OPCODE },
6951 { "phsubsw", { MX, EM }, PREFIX_OPCODE },
6953 { "psignb", { MX, EM }, PREFIX_OPCODE },
6954 { "psignw", { MX, EM }, PREFIX_OPCODE },
6955 { "psignd", { MX, EM }, PREFIX_OPCODE },
6956 { "pmulhrsw", { MX, EM }, PREFIX_OPCODE },
6962 { PREFIX_TABLE (PREFIX_0F3810) },
6966 { PREFIX_TABLE (PREFIX_0F3814) },
6967 { PREFIX_TABLE (PREFIX_0F3815) },
6969 { PREFIX_TABLE (PREFIX_0F3817) },
6975 { "pabsb", { MX, EM }, PREFIX_OPCODE },
6976 { "pabsw", { MX, EM }, PREFIX_OPCODE },
6977 { "pabsd", { MX, EM }, PREFIX_OPCODE },
6980 { PREFIX_TABLE (PREFIX_0F3820) },
6981 { PREFIX_TABLE (PREFIX_0F3821) },
6982 { PREFIX_TABLE (PREFIX_0F3822) },
6983 { PREFIX_TABLE (PREFIX_0F3823) },
6984 { PREFIX_TABLE (PREFIX_0F3824) },
6985 { PREFIX_TABLE (PREFIX_0F3825) },
6989 { PREFIX_TABLE (PREFIX_0F3828) },
6990 { PREFIX_TABLE (PREFIX_0F3829) },
6991 { PREFIX_TABLE (PREFIX_0F382A) },
6992 { PREFIX_TABLE (PREFIX_0F382B) },
6998 { PREFIX_TABLE (PREFIX_0F3830) },
6999 { PREFIX_TABLE (PREFIX_0F3831) },
7000 { PREFIX_TABLE (PREFIX_0F3832) },
7001 { PREFIX_TABLE (PREFIX_0F3833) },
7002 { PREFIX_TABLE (PREFIX_0F3834) },
7003 { PREFIX_TABLE (PREFIX_0F3835) },
7005 { PREFIX_TABLE (PREFIX_0F3837) },
7007 { PREFIX_TABLE (PREFIX_0F3838) },
7008 { PREFIX_TABLE (PREFIX_0F3839) },
7009 { PREFIX_TABLE (PREFIX_0F383A) },
7010 { PREFIX_TABLE (PREFIX_0F383B) },
7011 { PREFIX_TABLE (PREFIX_0F383C) },
7012 { PREFIX_TABLE (PREFIX_0F383D) },
7013 { PREFIX_TABLE (PREFIX_0F383E) },
7014 { PREFIX_TABLE (PREFIX_0F383F) },
7016 { PREFIX_TABLE (PREFIX_0F3840) },
7017 { PREFIX_TABLE (PREFIX_0F3841) },
7088 { PREFIX_TABLE (PREFIX_0F3880) },
7089 { PREFIX_TABLE (PREFIX_0F3881) },
7090 { PREFIX_TABLE (PREFIX_0F3882) },
7169 { PREFIX_TABLE (PREFIX_0F38C8) },
7170 { PREFIX_TABLE (PREFIX_0F38C9) },
7171 { PREFIX_TABLE (PREFIX_0F38CA) },
7172 { PREFIX_TABLE (PREFIX_0F38CB) },
7173 { PREFIX_TABLE (PREFIX_0F38CC) },
7174 { PREFIX_TABLE (PREFIX_0F38CD) },
7176 { PREFIX_TABLE (PREFIX_0F38CF) },
7190 { PREFIX_TABLE (PREFIX_0F38DB) },
7191 { PREFIX_TABLE (PREFIX_0F38DC) },
7192 { PREFIX_TABLE (PREFIX_0F38DD) },
7193 { PREFIX_TABLE (PREFIX_0F38DE) },
7194 { PREFIX_TABLE (PREFIX_0F38DF) },
7214 { PREFIX_TABLE (PREFIX_0F38F0) },
7215 { PREFIX_TABLE (PREFIX_0F38F1) },
7219 { PREFIX_TABLE (PREFIX_0F38F5) },
7220 { PREFIX_TABLE (PREFIX_0F38F6) },
7223 { PREFIX_TABLE (PREFIX_0F38F8) },
7224 { PREFIX_TABLE (PREFIX_0F38F9) },
7232 /* THREE_BYTE_0F3A */
7244 { PREFIX_TABLE (PREFIX_0F3A08) },
7245 { PREFIX_TABLE (PREFIX_0F3A09) },
7246 { PREFIX_TABLE (PREFIX_0F3A0A) },
7247 { PREFIX_TABLE (PREFIX_0F3A0B) },
7248 { PREFIX_TABLE (PREFIX_0F3A0C) },
7249 { PREFIX_TABLE (PREFIX_0F3A0D) },
7250 { PREFIX_TABLE (PREFIX_0F3A0E) },
7251 { "palignr", { MX, EM, Ib }, PREFIX_OPCODE },
7257 { PREFIX_TABLE (PREFIX_0F3A14) },
7258 { PREFIX_TABLE (PREFIX_0F3A15) },
7259 { PREFIX_TABLE (PREFIX_0F3A16) },
7260 { PREFIX_TABLE (PREFIX_0F3A17) },
7271 { PREFIX_TABLE (PREFIX_0F3A20) },
7272 { PREFIX_TABLE (PREFIX_0F3A21) },
7273 { PREFIX_TABLE (PREFIX_0F3A22) },
7307 { PREFIX_TABLE (PREFIX_0F3A40) },
7308 { PREFIX_TABLE (PREFIX_0F3A41) },
7309 { PREFIX_TABLE (PREFIX_0F3A42) },
7311 { PREFIX_TABLE (PREFIX_0F3A44) },
7343 { PREFIX_TABLE (PREFIX_0F3A60) },
7344 { PREFIX_TABLE (PREFIX_0F3A61) },
7345 { PREFIX_TABLE (PREFIX_0F3A62) },
7346 { PREFIX_TABLE (PREFIX_0F3A63) },
7464 { PREFIX_TABLE (PREFIX_0F3ACC) },
7466 { PREFIX_TABLE (PREFIX_0F3ACE) },
7467 { PREFIX_TABLE (PREFIX_0F3ACF) },
7485 { PREFIX_TABLE (PREFIX_0F3ADF) },
7525 static const struct dis386 xop_table[][256] = {
7678 { "vpmacssww", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7679 { "vpmacsswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7680 { "vpmacssdql", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7688 { "vpmacssdd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7689 { "vpmacssdqh", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7696 { "vpmacsww", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7697 { "vpmacswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7698 { "vpmacsdql", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7706 { "vpmacsdd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7707 { "vpmacsdqh", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7711 { "vpcmov", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7712 { "vpperm", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7715 { "vpmadcsswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7733 { "vpmadcswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7745 { "vprotb", { XM, Vex_2src_1, Ib }, 0 },
7746 { "vprotw", { XM, Vex_2src_1, Ib }, 0 },
7747 { "vprotd", { XM, Vex_2src_1, Ib }, 0 },
7748 { "vprotq", { XM, Vex_2src_1, Ib }, 0 },
7758 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC) },
7759 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD) },
7760 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE) },
7761 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF) },
7794 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC) },
7795 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED) },
7796 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE) },
7797 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF) },
7821 { REG_TABLE (REG_XOP_TBM_01) },
7822 { REG_TABLE (REG_XOP_TBM_02) },
7840 { REG_TABLE (REG_XOP_LWPCB) },
7964 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_80) },
7965 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_81) },
7966 { "vfrczss", { XM, EXd }, 0 },
7967 { "vfrczsd", { XM, EXq }, 0 },
7982 { "vprotb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7983 { "vprotw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7984 { "vprotd", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7985 { "vprotq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7986 { "vpshlb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7987 { "vpshlw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7988 { "vpshld", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7989 { "vpshlq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7991 { "vpshab", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7992 { "vpshaw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7993 { "vpshad", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
7994 { "vpshaq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8037 { "vphaddbw", { XM, EXxmm }, 0 },
8038 { "vphaddbd", { XM, EXxmm }, 0 },
8039 { "vphaddbq", { XM, EXxmm }, 0 },
8042 { "vphaddwd", { XM, EXxmm }, 0 },
8043 { "vphaddwq", { XM, EXxmm }, 0 },
8048 { "vphadddq", { XM, EXxmm }, 0 },
8055 { "vphaddubw", { XM, EXxmm }, 0 },
8056 { "vphaddubd", { XM, EXxmm }, 0 },
8057 { "vphaddubq", { XM, EXxmm }, 0 },
8060 { "vphadduwd", { XM, EXxmm }, 0 },
8061 { "vphadduwq", { XM, EXxmm }, 0 },
8066 { "vphaddudq", { XM, EXxmm }, 0 },
8073 { "vphsubbw", { XM, EXxmm }, 0 },
8074 { "vphsubwd", { XM, EXxmm }, 0 },
8075 { "vphsubdq", { XM, EXxmm }, 0 },
8129 { "bextr", { Gv, Ev, Iq }, 0 },
8131 { REG_TABLE (REG_XOP_LWP) },
8401 static const struct dis386 vex_table[][256] = {
8423 { PREFIX_TABLE (PREFIX_VEX_0F10) },
8424 { PREFIX_TABLE (PREFIX_VEX_0F11) },
8425 { PREFIX_TABLE (PREFIX_VEX_0F12) },
8426 { MOD_TABLE (MOD_VEX_0F13) },
8427 { "vunpcklpX", { XM, Vex, EXx }, 0 },
8428 { "vunpckhpX", { XM, Vex, EXx }, 0 },
8429 { PREFIX_TABLE (PREFIX_VEX_0F16) },
8430 { MOD_TABLE (MOD_VEX_0F17) },
8450 { "vmovapX", { XM, EXx }, 0 },
8451 { "vmovapX", { EXxS, XM }, 0 },
8452 { PREFIX_TABLE (PREFIX_VEX_0F2A) },
8453 { MOD_TABLE (MOD_VEX_0F2B) },
8454 { PREFIX_TABLE (PREFIX_VEX_0F2C) },
8455 { PREFIX_TABLE (PREFIX_VEX_0F2D) },
8456 { PREFIX_TABLE (PREFIX_VEX_0F2E) },
8457 { PREFIX_TABLE (PREFIX_VEX_0F2F) },
8478 { PREFIX_TABLE (PREFIX_VEX_0F41) },
8479 { PREFIX_TABLE (PREFIX_VEX_0F42) },
8481 { PREFIX_TABLE (PREFIX_VEX_0F44) },
8482 { PREFIX_TABLE (PREFIX_VEX_0F45) },
8483 { PREFIX_TABLE (PREFIX_VEX_0F46) },
8484 { PREFIX_TABLE (PREFIX_VEX_0F47) },
8488 { PREFIX_TABLE (PREFIX_VEX_0F4A) },
8489 { PREFIX_TABLE (PREFIX_VEX_0F4B) },
8495 { MOD_TABLE (MOD_VEX_0F50) },
8496 { PREFIX_TABLE (PREFIX_VEX_0F51) },
8497 { PREFIX_TABLE (PREFIX_VEX_0F52) },
8498 { PREFIX_TABLE (PREFIX_VEX_0F53) },
8499 { "vandpX", { XM, Vex, EXx }, 0 },
8500 { "vandnpX", { XM, Vex, EXx }, 0 },
8501 { "vorpX", { XM, Vex, EXx }, 0 },
8502 { "vxorpX", { XM, Vex, EXx }, 0 },
8504 { PREFIX_TABLE (PREFIX_VEX_0F58) },
8505 { PREFIX_TABLE (PREFIX_VEX_0F59) },
8506 { PREFIX_TABLE (PREFIX_VEX_0F5A) },
8507 { PREFIX_TABLE (PREFIX_VEX_0F5B) },
8508 { PREFIX_TABLE (PREFIX_VEX_0F5C) },
8509 { PREFIX_TABLE (PREFIX_VEX_0F5D) },
8510 { PREFIX_TABLE (PREFIX_VEX_0F5E) },
8511 { PREFIX_TABLE (PREFIX_VEX_0F5F) },
8513 { PREFIX_TABLE (PREFIX_VEX_0F60) },
8514 { PREFIX_TABLE (PREFIX_VEX_0F61) },
8515 { PREFIX_TABLE (PREFIX_VEX_0F62) },
8516 { PREFIX_TABLE (PREFIX_VEX_0F63) },
8517 { PREFIX_TABLE (PREFIX_VEX_0F64) },
8518 { PREFIX_TABLE (PREFIX_VEX_0F65) },
8519 { PREFIX_TABLE (PREFIX_VEX_0F66) },
8520 { PREFIX_TABLE (PREFIX_VEX_0F67) },
8522 { PREFIX_TABLE (PREFIX_VEX_0F68) },
8523 { PREFIX_TABLE (PREFIX_VEX_0F69) },
8524 { PREFIX_TABLE (PREFIX_VEX_0F6A) },
8525 { PREFIX_TABLE (PREFIX_VEX_0F6B) },
8526 { PREFIX_TABLE (PREFIX_VEX_0F6C) },
8527 { PREFIX_TABLE (PREFIX_VEX_0F6D) },
8528 { PREFIX_TABLE (PREFIX_VEX_0F6E) },
8529 { PREFIX_TABLE (PREFIX_VEX_0F6F) },
8531 { PREFIX_TABLE (PREFIX_VEX_0F70) },
8532 { REG_TABLE (REG_VEX_0F71) },
8533 { REG_TABLE (REG_VEX_0F72) },
8534 { REG_TABLE (REG_VEX_0F73) },
8535 { PREFIX_TABLE (PREFIX_VEX_0F74) },
8536 { PREFIX_TABLE (PREFIX_VEX_0F75) },
8537 { PREFIX_TABLE (PREFIX_VEX_0F76) },
8538 { PREFIX_TABLE (PREFIX_VEX_0F77) },
8544 { PREFIX_TABLE (PREFIX_VEX_0F7C) },
8545 { PREFIX_TABLE (PREFIX_VEX_0F7D) },
8546 { PREFIX_TABLE (PREFIX_VEX_0F7E) },
8547 { PREFIX_TABLE (PREFIX_VEX_0F7F) },
8567 { PREFIX_TABLE (PREFIX_VEX_0F90) },
8568 { PREFIX_TABLE (PREFIX_VEX_0F91) },
8569 { PREFIX_TABLE (PREFIX_VEX_0F92) },
8570 { PREFIX_TABLE (PREFIX_VEX_0F93) },
8576 { PREFIX_TABLE (PREFIX_VEX_0F98) },
8577 { PREFIX_TABLE (PREFIX_VEX_0F99) },
8600 { REG_TABLE (REG_VEX_0FAE) },
8623 { PREFIX_TABLE (PREFIX_VEX_0FC2) },
8625 { PREFIX_TABLE (PREFIX_VEX_0FC4) },
8626 { PREFIX_TABLE (PREFIX_VEX_0FC5) },
8627 { "vshufpX", { XM, Vex, EXx, Ib }, 0 },
8639 { PREFIX_TABLE (PREFIX_VEX_0FD0) },
8640 { PREFIX_TABLE (PREFIX_VEX_0FD1) },
8641 { PREFIX_TABLE (PREFIX_VEX_0FD2) },
8642 { PREFIX_TABLE (PREFIX_VEX_0FD3) },
8643 { PREFIX_TABLE (PREFIX_VEX_0FD4) },
8644 { PREFIX_TABLE (PREFIX_VEX_0FD5) },
8645 { PREFIX_TABLE (PREFIX_VEX_0FD6) },
8646 { PREFIX_TABLE (PREFIX_VEX_0FD7) },
8648 { PREFIX_TABLE (PREFIX_VEX_0FD8) },
8649 { PREFIX_TABLE (PREFIX_VEX_0FD9) },
8650 { PREFIX_TABLE (PREFIX_VEX_0FDA) },
8651 { PREFIX_TABLE (PREFIX_VEX_0FDB) },
8652 { PREFIX_TABLE (PREFIX_VEX_0FDC) },
8653 { PREFIX_TABLE (PREFIX_VEX_0FDD) },
8654 { PREFIX_TABLE (PREFIX_VEX_0FDE) },
8655 { PREFIX_TABLE (PREFIX_VEX_0FDF) },
8657 { PREFIX_TABLE (PREFIX_VEX_0FE0) },
8658 { PREFIX_TABLE (PREFIX_VEX_0FE1) },
8659 { PREFIX_TABLE (PREFIX_VEX_0FE2) },
8660 { PREFIX_TABLE (PREFIX_VEX_0FE3) },
8661 { PREFIX_TABLE (PREFIX_VEX_0FE4) },
8662 { PREFIX_TABLE (PREFIX_VEX_0FE5) },
8663 { PREFIX_TABLE (PREFIX_VEX_0FE6) },
8664 { PREFIX_TABLE (PREFIX_VEX_0FE7) },
8666 { PREFIX_TABLE (PREFIX_VEX_0FE8) },
8667 { PREFIX_TABLE (PREFIX_VEX_0FE9) },
8668 { PREFIX_TABLE (PREFIX_VEX_0FEA) },
8669 { PREFIX_TABLE (PREFIX_VEX_0FEB) },
8670 { PREFIX_TABLE (PREFIX_VEX_0FEC) },
8671 { PREFIX_TABLE (PREFIX_VEX_0FED) },
8672 { PREFIX_TABLE (PREFIX_VEX_0FEE) },
8673 { PREFIX_TABLE (PREFIX_VEX_0FEF) },
8675 { PREFIX_TABLE (PREFIX_VEX_0FF0) },
8676 { PREFIX_TABLE (PREFIX_VEX_0FF1) },
8677 { PREFIX_TABLE (PREFIX_VEX_0FF2) },
8678 { PREFIX_TABLE (PREFIX_VEX_0FF3) },
8679 { PREFIX_TABLE (PREFIX_VEX_0FF4) },
8680 { PREFIX_TABLE (PREFIX_VEX_0FF5) },
8681 { PREFIX_TABLE (PREFIX_VEX_0FF6) },
8682 { PREFIX_TABLE (PREFIX_VEX_0FF7) },
8684 { PREFIX_TABLE (PREFIX_VEX_0FF8) },
8685 { PREFIX_TABLE (PREFIX_VEX_0FF9) },
8686 { PREFIX_TABLE (PREFIX_VEX_0FFA) },
8687 { PREFIX_TABLE (PREFIX_VEX_0FFB) },
8688 { PREFIX_TABLE (PREFIX_VEX_0FFC) },
8689 { PREFIX_TABLE (PREFIX_VEX_0FFD) },
8690 { PREFIX_TABLE (PREFIX_VEX_0FFE) },
8696 { PREFIX_TABLE (PREFIX_VEX_0F3800) },
8697 { PREFIX_TABLE (PREFIX_VEX_0F3801) },
8698 { PREFIX_TABLE (PREFIX_VEX_0F3802) },
8699 { PREFIX_TABLE (PREFIX_VEX_0F3803) },
8700 { PREFIX_TABLE (PREFIX_VEX_0F3804) },
8701 { PREFIX_TABLE (PREFIX_VEX_0F3805) },
8702 { PREFIX_TABLE (PREFIX_VEX_0F3806) },
8703 { PREFIX_TABLE (PREFIX_VEX_0F3807) },
8705 { PREFIX_TABLE (PREFIX_VEX_0F3808) },
8706 { PREFIX_TABLE (PREFIX_VEX_0F3809) },
8707 { PREFIX_TABLE (PREFIX_VEX_0F380A) },
8708 { PREFIX_TABLE (PREFIX_VEX_0F380B) },
8709 { PREFIX_TABLE (PREFIX_VEX_0F380C) },
8710 { PREFIX_TABLE (PREFIX_VEX_0F380D) },
8711 { PREFIX_TABLE (PREFIX_VEX_0F380E) },
8712 { PREFIX_TABLE (PREFIX_VEX_0F380F) },
8717 { PREFIX_TABLE (PREFIX_VEX_0F3813) },
8720 { PREFIX_TABLE (PREFIX_VEX_0F3816) },
8721 { PREFIX_TABLE (PREFIX_VEX_0F3817) },
8723 { PREFIX_TABLE (PREFIX_VEX_0F3818) },
8724 { PREFIX_TABLE (PREFIX_VEX_0F3819) },
8725 { PREFIX_TABLE (PREFIX_VEX_0F381A) },
8727 { PREFIX_TABLE (PREFIX_VEX_0F381C) },
8728 { PREFIX_TABLE (PREFIX_VEX_0F381D) },
8729 { PREFIX_TABLE (PREFIX_VEX_0F381E) },
8732 { PREFIX_TABLE (PREFIX_VEX_0F3820) },
8733 { PREFIX_TABLE (PREFIX_VEX_0F3821) },
8734 { PREFIX_TABLE (PREFIX_VEX_0F3822) },
8735 { PREFIX_TABLE (PREFIX_VEX_0F3823) },
8736 { PREFIX_TABLE (PREFIX_VEX_0F3824) },
8737 { PREFIX_TABLE (PREFIX_VEX_0F3825) },
8741 { PREFIX_TABLE (PREFIX_VEX_0F3828) },
8742 { PREFIX_TABLE (PREFIX_VEX_0F3829) },
8743 { PREFIX_TABLE (PREFIX_VEX_0F382A) },
8744 { PREFIX_TABLE (PREFIX_VEX_0F382B) },
8745 { PREFIX_TABLE (PREFIX_VEX_0F382C) },
8746 { PREFIX_TABLE (PREFIX_VEX_0F382D) },
8747 { PREFIX_TABLE (PREFIX_VEX_0F382E) },
8748 { PREFIX_TABLE (PREFIX_VEX_0F382F) },
8750 { PREFIX_TABLE (PREFIX_VEX_0F3830) },
8751 { PREFIX_TABLE (PREFIX_VEX_0F3831) },
8752 { PREFIX_TABLE (PREFIX_VEX_0F3832) },
8753 { PREFIX_TABLE (PREFIX_VEX_0F3833) },
8754 { PREFIX_TABLE (PREFIX_VEX_0F3834) },
8755 { PREFIX_TABLE (PREFIX_VEX_0F3835) },
8756 { PREFIX_TABLE (PREFIX_VEX_0F3836) },
8757 { PREFIX_TABLE (PREFIX_VEX_0F3837) },
8759 { PREFIX_TABLE (PREFIX_VEX_0F3838) },
8760 { PREFIX_TABLE (PREFIX_VEX_0F3839) },
8761 { PREFIX_TABLE (PREFIX_VEX_0F383A) },
8762 { PREFIX_TABLE (PREFIX_VEX_0F383B) },
8763 { PREFIX_TABLE (PREFIX_VEX_0F383C) },
8764 { PREFIX_TABLE (PREFIX_VEX_0F383D) },
8765 { PREFIX_TABLE (PREFIX_VEX_0F383E) },
8766 { PREFIX_TABLE (PREFIX_VEX_0F383F) },
8768 { PREFIX_TABLE (PREFIX_VEX_0F3840) },
8769 { PREFIX_TABLE (PREFIX_VEX_0F3841) },
8773 { PREFIX_TABLE (PREFIX_VEX_0F3845) },
8774 { PREFIX_TABLE (PREFIX_VEX_0F3846) },
8775 { PREFIX_TABLE (PREFIX_VEX_0F3847) },
8795 { PREFIX_TABLE (PREFIX_VEX_0F3858) },
8796 { PREFIX_TABLE (PREFIX_VEX_0F3859) },
8797 { PREFIX_TABLE (PREFIX_VEX_0F385A) },
8831 { PREFIX_TABLE (PREFIX_VEX_0F3878) },
8832 { PREFIX_TABLE (PREFIX_VEX_0F3879) },
8853 { PREFIX_TABLE (PREFIX_VEX_0F388C) },
8855 { PREFIX_TABLE (PREFIX_VEX_0F388E) },
8858 { PREFIX_TABLE (PREFIX_VEX_0F3890) },
8859 { PREFIX_TABLE (PREFIX_VEX_0F3891) },
8860 { PREFIX_TABLE (PREFIX_VEX_0F3892) },
8861 { PREFIX_TABLE (PREFIX_VEX_0F3893) },
8864 { PREFIX_TABLE (PREFIX_VEX_0F3896) },
8865 { PREFIX_TABLE (PREFIX_VEX_0F3897) },
8867 { PREFIX_TABLE (PREFIX_VEX_0F3898) },
8868 { PREFIX_TABLE (PREFIX_VEX_0F3899) },
8869 { PREFIX_TABLE (PREFIX_VEX_0F389A) },
8870 { PREFIX_TABLE (PREFIX_VEX_0F389B) },
8871 { PREFIX_TABLE (PREFIX_VEX_0F389C) },
8872 { PREFIX_TABLE (PREFIX_VEX_0F389D) },
8873 { PREFIX_TABLE (PREFIX_VEX_0F389E) },
8874 { PREFIX_TABLE (PREFIX_VEX_0F389F) },
8882 { PREFIX_TABLE (PREFIX_VEX_0F38A6) },
8883 { PREFIX_TABLE (PREFIX_VEX_0F38A7) },
8885 { PREFIX_TABLE (PREFIX_VEX_0F38A8) },
8886 { PREFIX_TABLE (PREFIX_VEX_0F38A9) },
8887 { PREFIX_TABLE (PREFIX_VEX_0F38AA) },
8888 { PREFIX_TABLE (PREFIX_VEX_0F38AB) },
8889 { PREFIX_TABLE (PREFIX_VEX_0F38AC) },
8890 { PREFIX_TABLE (PREFIX_VEX_0F38AD) },
8891 { PREFIX_TABLE (PREFIX_VEX_0F38AE) },
8892 { PREFIX_TABLE (PREFIX_VEX_0F38AF) },
8900 { PREFIX_TABLE (PREFIX_VEX_0F38B6) },
8901 { PREFIX_TABLE (PREFIX_VEX_0F38B7) },
8903 { PREFIX_TABLE (PREFIX_VEX_0F38B8) },
8904 { PREFIX_TABLE (PREFIX_VEX_0F38B9) },
8905 { PREFIX_TABLE (PREFIX_VEX_0F38BA) },
8906 { PREFIX_TABLE (PREFIX_VEX_0F38BB) },
8907 { PREFIX_TABLE (PREFIX_VEX_0F38BC) },
8908 { PREFIX_TABLE (PREFIX_VEX_0F38BD) },
8909 { PREFIX_TABLE (PREFIX_VEX_0F38BE) },
8910 { PREFIX_TABLE (PREFIX_VEX_0F38BF) },
8928 { PREFIX_TABLE (PREFIX_VEX_0F38CF) },
8942 { PREFIX_TABLE (PREFIX_VEX_0F38DB) },
8943 { PREFIX_TABLE (PREFIX_VEX_0F38DC) },
8944 { PREFIX_TABLE (PREFIX_VEX_0F38DD) },
8945 { PREFIX_TABLE (PREFIX_VEX_0F38DE) },
8946 { PREFIX_TABLE (PREFIX_VEX_0F38DF) },
8968 { PREFIX_TABLE (PREFIX_VEX_0F38F2) },
8969 { REG_TABLE (REG_VEX_0F38F3) },
8971 { PREFIX_TABLE (PREFIX_VEX_0F38F5) },
8972 { PREFIX_TABLE (PREFIX_VEX_0F38F6) },
8973 { PREFIX_TABLE (PREFIX_VEX_0F38F7) },
8987 { PREFIX_TABLE (PREFIX_VEX_0F3A00) },
8988 { PREFIX_TABLE (PREFIX_VEX_0F3A01) },
8989 { PREFIX_TABLE (PREFIX_VEX_0F3A02) },
8991 { PREFIX_TABLE (PREFIX_VEX_0F3A04) },
8992 { PREFIX_TABLE (PREFIX_VEX_0F3A05) },
8993 { PREFIX_TABLE (PREFIX_VEX_0F3A06) },
8996 { PREFIX_TABLE (PREFIX_VEX_0F3A08) },
8997 { PREFIX_TABLE (PREFIX_VEX_0F3A09) },
8998 { PREFIX_TABLE (PREFIX_VEX_0F3A0A) },
8999 { PREFIX_TABLE (PREFIX_VEX_0F3A0B) },
9000 { PREFIX_TABLE (PREFIX_VEX_0F3A0C) },
9001 { PREFIX_TABLE (PREFIX_VEX_0F3A0D) },
9002 { PREFIX_TABLE (PREFIX_VEX_0F3A0E) },
9003 { PREFIX_TABLE (PREFIX_VEX_0F3A0F) },
9009 { PREFIX_TABLE (PREFIX_VEX_0F3A14) },
9010 { PREFIX_TABLE (PREFIX_VEX_0F3A15) },
9011 { PREFIX_TABLE (PREFIX_VEX_0F3A16) },
9012 { PREFIX_TABLE (PREFIX_VEX_0F3A17) },
9014 { PREFIX_TABLE (PREFIX_VEX_0F3A18) },
9015 { PREFIX_TABLE (PREFIX_VEX_0F3A19) },
9019 { PREFIX_TABLE (PREFIX_VEX_0F3A1D) },
9023 { PREFIX_TABLE (PREFIX_VEX_0F3A20) },
9024 { PREFIX_TABLE (PREFIX_VEX_0F3A21) },
9025 { PREFIX_TABLE (PREFIX_VEX_0F3A22) },
9041 { PREFIX_TABLE (PREFIX_VEX_0F3A30) },
9042 { PREFIX_TABLE (PREFIX_VEX_0F3A31) },
9043 { PREFIX_TABLE (PREFIX_VEX_0F3A32) },
9044 { PREFIX_TABLE (PREFIX_VEX_0F3A33) },
9050 { PREFIX_TABLE (PREFIX_VEX_0F3A38) },
9051 { PREFIX_TABLE (PREFIX_VEX_0F3A39) },
9059 { PREFIX_TABLE (PREFIX_VEX_0F3A40) },
9060 { PREFIX_TABLE (PREFIX_VEX_0F3A41) },
9061 { PREFIX_TABLE (PREFIX_VEX_0F3A42) },
9063 { PREFIX_TABLE (PREFIX_VEX_0F3A44) },
9065 { PREFIX_TABLE (PREFIX_VEX_0F3A46) },
9068 { PREFIX_TABLE (PREFIX_VEX_0F3A48) },
9069 { PREFIX_TABLE (PREFIX_VEX_0F3A49) },
9070 { PREFIX_TABLE (PREFIX_VEX_0F3A4A) },
9071 { PREFIX_TABLE (PREFIX_VEX_0F3A4B) },
9072 { PREFIX_TABLE (PREFIX_VEX_0F3A4C) },
9090 { PREFIX_TABLE (PREFIX_VEX_0F3A5C) },
9091 { PREFIX_TABLE (PREFIX_VEX_0F3A5D) },
9092 { PREFIX_TABLE (PREFIX_VEX_0F3A5E) },
9093 { PREFIX_TABLE (PREFIX_VEX_0F3A5F) },
9095 { PREFIX_TABLE (PREFIX_VEX_0F3A60) },
9096 { PREFIX_TABLE (PREFIX_VEX_0F3A61) },
9097 { PREFIX_TABLE (PREFIX_VEX_0F3A62) },
9098 { PREFIX_TABLE (PREFIX_VEX_0F3A63) },
9104 { PREFIX_TABLE (PREFIX_VEX_0F3A68) },
9105 { PREFIX_TABLE (PREFIX_VEX_0F3A69) },
9106 { PREFIX_TABLE (PREFIX_VEX_0F3A6A) },
9107 { PREFIX_TABLE (PREFIX_VEX_0F3A6B) },
9108 { PREFIX_TABLE (PREFIX_VEX_0F3A6C) },
9109 { PREFIX_TABLE (PREFIX_VEX_0F3A6D) },
9110 { PREFIX_TABLE (PREFIX_VEX_0F3A6E) },
9111 { PREFIX_TABLE (PREFIX_VEX_0F3A6F) },
9122 { PREFIX_TABLE (PREFIX_VEX_0F3A78) },
9123 { PREFIX_TABLE (PREFIX_VEX_0F3A79) },
9124 { PREFIX_TABLE (PREFIX_VEX_0F3A7A) },
9125 { PREFIX_TABLE (PREFIX_VEX_0F3A7B) },
9126 { PREFIX_TABLE (PREFIX_VEX_0F3A7C) },
9127 { PREFIX_TABLE (PREFIX_VEX_0F3A7D) },
9128 { PREFIX_TABLE (PREFIX_VEX_0F3A7E) },
9129 { PREFIX_TABLE (PREFIX_VEX_0F3A7F) },
9218 { PREFIX_TABLE(PREFIX_VEX_0F3ACE) },
9219 { PREFIX_TABLE(PREFIX_VEX_0F3ACF) },
9237 { PREFIX_TABLE (PREFIX_VEX_0F3ADF) },
9257 { PREFIX_TABLE (PREFIX_VEX_0F3AF0) },
9277 #define NEED_OPCODE_TABLE
9278 #include "i386-dis-evex.h"
9279 #undef NEED_OPCODE_TABLE
9280 static const struct dis386 vex_len_table[][2] = {
9281 /* VEX_LEN_0F12_P_0_M_0 */
9283 { "vmovlps", { XM, Vex128, EXq }, 0 },
9286 /* VEX_LEN_0F12_P_0_M_1 */
9288 { "vmovhlps", { XM, Vex128, EXq }, 0 },
9291 /* VEX_LEN_0F12_P_2 */
9293 { "vmovlpd", { XM, Vex128, EXq }, 0 },
9296 /* VEX_LEN_0F13_M_0 */
9298 { "vmovlpX", { EXq, XM }, 0 },
9301 /* VEX_LEN_0F16_P_0_M_0 */
9303 { "vmovhps", { XM, Vex128, EXq }, 0 },
9306 /* VEX_LEN_0F16_P_0_M_1 */
9308 { "vmovlhps", { XM, Vex128, EXq }, 0 },
9311 /* VEX_LEN_0F16_P_2 */
9313 { "vmovhpd", { XM, Vex128, EXq }, 0 },
9316 /* VEX_LEN_0F17_M_0 */
9318 { "vmovhpX", { EXq, XM }, 0 },
9321 /* VEX_LEN_0F2A_P_1 */
9323 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9324 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9327 /* VEX_LEN_0F2A_P_3 */
9329 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9330 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9333 /* VEX_LEN_0F2C_P_1 */
9335 { "vcvttss2si", { Gv, EXdScalar }, 0 },
9336 { "vcvttss2si", { Gv, EXdScalar }, 0 },
9339 /* VEX_LEN_0F2C_P_3 */
9341 { "vcvttsd2si", { Gv, EXqScalar }, 0 },
9342 { "vcvttsd2si", { Gv, EXqScalar }, 0 },
9345 /* VEX_LEN_0F2D_P_1 */
9347 { "vcvtss2si", { Gv, EXdScalar }, 0 },
9348 { "vcvtss2si", { Gv, EXdScalar }, 0 },
9351 /* VEX_LEN_0F2D_P_3 */
9353 { "vcvtsd2si", { Gv, EXqScalar }, 0 },
9354 { "vcvtsd2si", { Gv, EXqScalar }, 0 },
9357 /* VEX_LEN_0F41_P_0 */
9360 { VEX_W_TABLE (VEX_W_0F41_P_0_LEN_1) },
9362 /* VEX_LEN_0F41_P_2 */
9365 { VEX_W_TABLE (VEX_W_0F41_P_2_LEN_1) },
9367 /* VEX_LEN_0F42_P_0 */
9370 { VEX_W_TABLE (VEX_W_0F42_P_0_LEN_1) },
9372 /* VEX_LEN_0F42_P_2 */
9375 { VEX_W_TABLE (VEX_W_0F42_P_2_LEN_1) },
9377 /* VEX_LEN_0F44_P_0 */
9379 { VEX_W_TABLE (VEX_W_0F44_P_0_LEN_0) },
9381 /* VEX_LEN_0F44_P_2 */
9383 { VEX_W_TABLE (VEX_W_0F44_P_2_LEN_0) },
9385 /* VEX_LEN_0F45_P_0 */
9388 { VEX_W_TABLE (VEX_W_0F45_P_0_LEN_1) },
9390 /* VEX_LEN_0F45_P_2 */
9393 { VEX_W_TABLE (VEX_W_0F45_P_2_LEN_1) },
9395 /* VEX_LEN_0F46_P_0 */
9398 { VEX_W_TABLE (VEX_W_0F46_P_0_LEN_1) },
9400 /* VEX_LEN_0F46_P_2 */
9403 { VEX_W_TABLE (VEX_W_0F46_P_2_LEN_1) },
9405 /* VEX_LEN_0F47_P_0 */
9408 { VEX_W_TABLE (VEX_W_0F47_P_0_LEN_1) },
9410 /* VEX_LEN_0F47_P_2 */
9413 { VEX_W_TABLE (VEX_W_0F47_P_2_LEN_1) },
9415 /* VEX_LEN_0F4A_P_0 */
9418 { VEX_W_TABLE (VEX_W_0F4A_P_0_LEN_1) },
9420 /* VEX_LEN_0F4A_P_2 */
9423 { VEX_W_TABLE (VEX_W_0F4A_P_2_LEN_1) },
9425 /* VEX_LEN_0F4B_P_0 */
9428 { VEX_W_TABLE (VEX_W_0F4B_P_0_LEN_1) },
9430 /* VEX_LEN_0F4B_P_2 */
9433 { VEX_W_TABLE (VEX_W_0F4B_P_2_LEN_1) },
9436 /* VEX_LEN_0F6E_P_2 */
9438 { "vmovK", { XMScalar, Edq }, 0 },
9441 /* VEX_LEN_0F77_P_1 */
9443 { "vzeroupper", { XX }, 0 },
9444 { "vzeroall", { XX }, 0 },
9447 /* VEX_LEN_0F7E_P_1 */
9449 { "vmovq", { XMScalar, EXqScalar }, 0 },
9452 /* VEX_LEN_0F7E_P_2 */
9454 { "vmovK", { Edq, XMScalar }, 0 },
9457 /* VEX_LEN_0F90_P_0 */
9459 { VEX_W_TABLE (VEX_W_0F90_P_0_LEN_0) },
9462 /* VEX_LEN_0F90_P_2 */
9464 { VEX_W_TABLE (VEX_W_0F90_P_2_LEN_0) },
9467 /* VEX_LEN_0F91_P_0 */
9469 { VEX_W_TABLE (VEX_W_0F91_P_0_LEN_0) },
9472 /* VEX_LEN_0F91_P_2 */
9474 { VEX_W_TABLE (VEX_W_0F91_P_2_LEN_0) },
9477 /* VEX_LEN_0F92_P_0 */
9479 { VEX_W_TABLE (VEX_W_0F92_P_0_LEN_0) },
9482 /* VEX_LEN_0F92_P_2 */
9484 { VEX_W_TABLE (VEX_W_0F92_P_2_LEN_0) },
9487 /* VEX_LEN_0F92_P_3 */
9489 { MOD_TABLE (MOD_VEX_0F92_P_3_LEN_0) },
9492 /* VEX_LEN_0F93_P_0 */
9494 { VEX_W_TABLE (VEX_W_0F93_P_0_LEN_0) },
9497 /* VEX_LEN_0F93_P_2 */
9499 { VEX_W_TABLE (VEX_W_0F93_P_2_LEN_0) },
9502 /* VEX_LEN_0F93_P_3 */
9504 { MOD_TABLE (MOD_VEX_0F93_P_3_LEN_0) },
9507 /* VEX_LEN_0F98_P_0 */
9509 { VEX_W_TABLE (VEX_W_0F98_P_0_LEN_0) },
9512 /* VEX_LEN_0F98_P_2 */
9514 { VEX_W_TABLE (VEX_W_0F98_P_2_LEN_0) },
9517 /* VEX_LEN_0F99_P_0 */
9519 { VEX_W_TABLE (VEX_W_0F99_P_0_LEN_0) },
9522 /* VEX_LEN_0F99_P_2 */
9524 { VEX_W_TABLE (VEX_W_0F99_P_2_LEN_0) },
9527 /* VEX_LEN_0FAE_R_2_M_0 */
9529 { "vldmxcsr", { Md }, 0 },
9532 /* VEX_LEN_0FAE_R_3_M_0 */
9534 { "vstmxcsr", { Md }, 0 },
9537 /* VEX_LEN_0FC4_P_2 */
9539 { "vpinsrw", { XM, Vex128, Edqw, Ib }, 0 },
9542 /* VEX_LEN_0FC5_P_2 */
9544 { "vpextrw", { Gdq, XS, Ib }, 0 },
9547 /* VEX_LEN_0FD6_P_2 */
9549 { "vmovq", { EXqScalarS, XMScalar }, 0 },
9552 /* VEX_LEN_0FF7_P_2 */
9554 { "vmaskmovdqu", { XM, XS }, 0 },
9557 /* VEX_LEN_0F3816_P_2 */
9560 { VEX_W_TABLE (VEX_W_0F3816_P_2) },
9563 /* VEX_LEN_0F3819_P_2 */
9566 { VEX_W_TABLE (VEX_W_0F3819_P_2) },
9569 /* VEX_LEN_0F381A_P_2_M_0 */
9572 { VEX_W_TABLE (VEX_W_0F381A_P_2_M_0) },
9575 /* VEX_LEN_0F3836_P_2 */
9578 { VEX_W_TABLE (VEX_W_0F3836_P_2) },
9581 /* VEX_LEN_0F3841_P_2 */
9583 { "vphminposuw", { XM, EXx }, 0 },
9586 /* VEX_LEN_0F385A_P_2_M_0 */
9589 { VEX_W_TABLE (VEX_W_0F385A_P_2_M_0) },
9592 /* VEX_LEN_0F38DB_P_2 */
9594 { "vaesimc", { XM, EXx }, 0 },
9597 /* VEX_LEN_0F38F2_P_0 */
9599 { "andnS", { Gdq, VexGdq, Edq }, 0 },
9602 /* VEX_LEN_0F38F3_R_1_P_0 */
9604 { "blsrS", { VexGdq, Edq }, 0 },
9607 /* VEX_LEN_0F38F3_R_2_P_0 */
9609 { "blsmskS", { VexGdq, Edq }, 0 },
9612 /* VEX_LEN_0F38F3_R_3_P_0 */
9614 { "blsiS", { VexGdq, Edq }, 0 },
9617 /* VEX_LEN_0F38F5_P_0 */
9619 { "bzhiS", { Gdq, Edq, VexGdq }, 0 },
9622 /* VEX_LEN_0F38F5_P_1 */
9624 { "pextS", { Gdq, VexGdq, Edq }, 0 },
9627 /* VEX_LEN_0F38F5_P_3 */
9629 { "pdepS", { Gdq, VexGdq, Edq }, 0 },
9632 /* VEX_LEN_0F38F6_P_3 */
9634 { "mulxS", { Gdq, VexGdq, Edq }, 0 },
9637 /* VEX_LEN_0F38F7_P_0 */
9639 { "bextrS", { Gdq, Edq, VexGdq }, 0 },
9642 /* VEX_LEN_0F38F7_P_1 */
9644 { "sarxS", { Gdq, Edq, VexGdq }, 0 },
9647 /* VEX_LEN_0F38F7_P_2 */
9649 { "shlxS", { Gdq, Edq, VexGdq }, 0 },
9652 /* VEX_LEN_0F38F7_P_3 */
9654 { "shrxS", { Gdq, Edq, VexGdq }, 0 },
9657 /* VEX_LEN_0F3A00_P_2 */
9660 { VEX_W_TABLE (VEX_W_0F3A00_P_2) },
9663 /* VEX_LEN_0F3A01_P_2 */
9666 { VEX_W_TABLE (VEX_W_0F3A01_P_2) },
9669 /* VEX_LEN_0F3A06_P_2 */
9672 { VEX_W_TABLE (VEX_W_0F3A06_P_2) },
9675 /* VEX_LEN_0F3A14_P_2 */
9677 { "vpextrb", { Edqb, XM, Ib }, 0 },
9680 /* VEX_LEN_0F3A15_P_2 */
9682 { "vpextrw", { Edqw, XM, Ib }, 0 },
9685 /* VEX_LEN_0F3A16_P_2 */
9687 { "vpextrK", { Edq, XM, Ib }, 0 },
9690 /* VEX_LEN_0F3A17_P_2 */
9692 { "vextractps", { Edqd, XM, Ib }, 0 },
9695 /* VEX_LEN_0F3A18_P_2 */
9698 { VEX_W_TABLE (VEX_W_0F3A18_P_2) },
9701 /* VEX_LEN_0F3A19_P_2 */
9704 { VEX_W_TABLE (VEX_W_0F3A19_P_2) },
9707 /* VEX_LEN_0F3A20_P_2 */
9709 { "vpinsrb", { XM, Vex128, Edqb, Ib }, 0 },
9712 /* VEX_LEN_0F3A21_P_2 */
9714 { "vinsertps", { XM, Vex128, EXd, Ib }, 0 },
9717 /* VEX_LEN_0F3A22_P_2 */
9719 { "vpinsrK", { XM, Vex128, Edq, Ib }, 0 },
9722 /* VEX_LEN_0F3A30_P_2 */
9724 { VEX_W_TABLE (VEX_W_0F3A30_P_2_LEN_0) },
9727 /* VEX_LEN_0F3A31_P_2 */
9729 { VEX_W_TABLE (VEX_W_0F3A31_P_2_LEN_0) },
9732 /* VEX_LEN_0F3A32_P_2 */
9734 { VEX_W_TABLE (VEX_W_0F3A32_P_2_LEN_0) },
9737 /* VEX_LEN_0F3A33_P_2 */
9739 { VEX_W_TABLE (VEX_W_0F3A33_P_2_LEN_0) },
9742 /* VEX_LEN_0F3A38_P_2 */
9745 { VEX_W_TABLE (VEX_W_0F3A38_P_2) },
9748 /* VEX_LEN_0F3A39_P_2 */
9751 { VEX_W_TABLE (VEX_W_0F3A39_P_2) },
9754 /* VEX_LEN_0F3A41_P_2 */
9756 { "vdppd", { XM, Vex128, EXx, Ib }, 0 },
9759 /* VEX_LEN_0F3A46_P_2 */
9762 { VEX_W_TABLE (VEX_W_0F3A46_P_2) },
9765 /* VEX_LEN_0F3A60_P_2 */
9767 { "vpcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
9770 /* VEX_LEN_0F3A61_P_2 */
9772 { "vpcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
9775 /* VEX_LEN_0F3A62_P_2 */
9777 { "vpcmpistrm", { XM, EXx, Ib }, 0 },
9780 /* VEX_LEN_0F3A63_P_2 */
9782 { "vpcmpistri", { XM, EXx, Ib }, 0 },
9785 /* VEX_LEN_0F3A6A_P_2 */
9787 { "vfmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
9790 /* VEX_LEN_0F3A6B_P_2 */
9792 { "vfmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
9795 /* VEX_LEN_0F3A6E_P_2 */
9797 { "vfmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
9800 /* VEX_LEN_0F3A6F_P_2 */
9802 { "vfmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
9805 /* VEX_LEN_0F3A7A_P_2 */
9807 { "vfnmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
9810 /* VEX_LEN_0F3A7B_P_2 */
9812 { "vfnmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
9815 /* VEX_LEN_0F3A7E_P_2 */
9817 { "vfnmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
9820 /* VEX_LEN_0F3A7F_P_2 */
9822 { "vfnmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
9825 /* VEX_LEN_0F3ADF_P_2 */
9827 { "vaeskeygenassist", { XM, EXx, Ib }, 0 },
9830 /* VEX_LEN_0F3AF0_P_3 */
9832 { "rorxS", { Gdq, Edq, Ib }, 0 },
9835 /* VEX_LEN_0FXOP_08_CC */
9837 { "vpcomb", { XM, Vex128, EXx, VPCOM }, 0 },
9840 /* VEX_LEN_0FXOP_08_CD */
9842 { "vpcomw", { XM, Vex128, EXx, VPCOM }, 0 },
9845 /* VEX_LEN_0FXOP_08_CE */
9847 { "vpcomd", { XM, Vex128, EXx, VPCOM }, 0 },
9850 /* VEX_LEN_0FXOP_08_CF */
9852 { "vpcomq", { XM, Vex128, EXx, VPCOM }, 0 },
9855 /* VEX_LEN_0FXOP_08_EC */
9857 { "vpcomub", { XM, Vex128, EXx, VPCOM }, 0 },
9860 /* VEX_LEN_0FXOP_08_ED */
9862 { "vpcomuw", { XM, Vex128, EXx, VPCOM }, 0 },
9865 /* VEX_LEN_0FXOP_08_EE */
9867 { "vpcomud", { XM, Vex128, EXx, VPCOM }, 0 },
9870 /* VEX_LEN_0FXOP_08_EF */
9872 { "vpcomuq", { XM, Vex128, EXx, VPCOM }, 0 },
9875 /* VEX_LEN_0FXOP_09_80 */
9877 { "vfrczps", { XM, EXxmm }, 0 },
9878 { "vfrczps", { XM, EXymmq }, 0 },
9881 /* VEX_LEN_0FXOP_09_81 */
9883 { "vfrczpd", { XM, EXxmm }, 0 },
9884 { "vfrczpd", { XM, EXymmq }, 0 },
9888 static const struct dis386 evex_len_table[][3] = {
9889 #define NEED_EVEX_LEN_TABLE
9890 #include "i386-dis-evex.h"
9891 #undef NEED_EVEX_LEN_TABLE
9894 static const struct dis386 vex_w_table[][2] = {
9896 /* VEX_W_0F41_P_0_LEN_1 */
9897 { MOD_TABLE (MOD_VEX_W_0_0F41_P_0_LEN_1) },
9898 { MOD_TABLE (MOD_VEX_W_1_0F41_P_0_LEN_1) },
9901 /* VEX_W_0F41_P_2_LEN_1 */
9902 { MOD_TABLE (MOD_VEX_W_0_0F41_P_2_LEN_1) },
9903 { MOD_TABLE (MOD_VEX_W_1_0F41_P_2_LEN_1) }
9906 /* VEX_W_0F42_P_0_LEN_1 */
9907 { MOD_TABLE (MOD_VEX_W_0_0F42_P_0_LEN_1) },
9908 { MOD_TABLE (MOD_VEX_W_1_0F42_P_0_LEN_1) },
9911 /* VEX_W_0F42_P_2_LEN_1 */
9912 { MOD_TABLE (MOD_VEX_W_0_0F42_P_2_LEN_1) },
9913 { MOD_TABLE (MOD_VEX_W_1_0F42_P_2_LEN_1) },
9916 /* VEX_W_0F44_P_0_LEN_0 */
9917 { MOD_TABLE (MOD_VEX_W_0_0F44_P_0_LEN_1) },
9918 { MOD_TABLE (MOD_VEX_W_1_0F44_P_0_LEN_1) },
9921 /* VEX_W_0F44_P_2_LEN_0 */
9922 { MOD_TABLE (MOD_VEX_W_0_0F44_P_2_LEN_1) },
9923 { MOD_TABLE (MOD_VEX_W_1_0F44_P_2_LEN_1) },
9926 /* VEX_W_0F45_P_0_LEN_1 */
9927 { MOD_TABLE (MOD_VEX_W_0_0F45_P_0_LEN_1) },
9928 { MOD_TABLE (MOD_VEX_W_1_0F45_P_0_LEN_1) },
9931 /* VEX_W_0F45_P_2_LEN_1 */
9932 { MOD_TABLE (MOD_VEX_W_0_0F45_P_2_LEN_1) },
9933 { MOD_TABLE (MOD_VEX_W_1_0F45_P_2_LEN_1) },
9936 /* VEX_W_0F46_P_0_LEN_1 */
9937 { MOD_TABLE (MOD_VEX_W_0_0F46_P_0_LEN_1) },
9938 { MOD_TABLE (MOD_VEX_W_1_0F46_P_0_LEN_1) },
9941 /* VEX_W_0F46_P_2_LEN_1 */
9942 { MOD_TABLE (MOD_VEX_W_0_0F46_P_2_LEN_1) },
9943 { MOD_TABLE (MOD_VEX_W_1_0F46_P_2_LEN_1) },
9946 /* VEX_W_0F47_P_0_LEN_1 */
9947 { MOD_TABLE (MOD_VEX_W_0_0F47_P_0_LEN_1) },
9948 { MOD_TABLE (MOD_VEX_W_1_0F47_P_0_LEN_1) },
9951 /* VEX_W_0F47_P_2_LEN_1 */
9952 { MOD_TABLE (MOD_VEX_W_0_0F47_P_2_LEN_1) },
9953 { MOD_TABLE (MOD_VEX_W_1_0F47_P_2_LEN_1) },
9956 /* VEX_W_0F4A_P_0_LEN_1 */
9957 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_0_LEN_1) },
9958 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_0_LEN_1) },
9961 /* VEX_W_0F4A_P_2_LEN_1 */
9962 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_2_LEN_1) },
9963 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_2_LEN_1) },
9966 /* VEX_W_0F4B_P_0_LEN_1 */
9967 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_0_LEN_1) },
9968 { MOD_TABLE (MOD_VEX_W_1_0F4B_P_0_LEN_1) },
9971 /* VEX_W_0F4B_P_2_LEN_1 */
9972 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_2_LEN_1) },
9975 /* VEX_W_0F90_P_0_LEN_0 */
9976 { "kmovw", { MaskG, MaskE }, 0 },
9977 { "kmovq", { MaskG, MaskE }, 0 },
9980 /* VEX_W_0F90_P_2_LEN_0 */
9981 { "kmovb", { MaskG, MaskBDE }, 0 },
9982 { "kmovd", { MaskG, MaskBDE }, 0 },
9985 /* VEX_W_0F91_P_0_LEN_0 */
9986 { MOD_TABLE (MOD_VEX_W_0_0F91_P_0_LEN_0) },
9987 { MOD_TABLE (MOD_VEX_W_1_0F91_P_0_LEN_0) },
9990 /* VEX_W_0F91_P_2_LEN_0 */
9991 { MOD_TABLE (MOD_VEX_W_0_0F91_P_2_LEN_0) },
9992 { MOD_TABLE (MOD_VEX_W_1_0F91_P_2_LEN_0) },
9995 /* VEX_W_0F92_P_0_LEN_0 */
9996 { MOD_TABLE (MOD_VEX_W_0_0F92_P_0_LEN_0) },
9999 /* VEX_W_0F92_P_2_LEN_0 */
10000 { MOD_TABLE (MOD_VEX_W_0_0F92_P_2_LEN_0) },
10003 /* VEX_W_0F93_P_0_LEN_0 */
10004 { MOD_TABLE (MOD_VEX_W_0_0F93_P_0_LEN_0) },
10007 /* VEX_W_0F93_P_2_LEN_0 */
10008 { MOD_TABLE (MOD_VEX_W_0_0F93_P_2_LEN_0) },
10011 /* VEX_W_0F98_P_0_LEN_0 */
10012 { MOD_TABLE (MOD_VEX_W_0_0F98_P_0_LEN_0) },
10013 { MOD_TABLE (MOD_VEX_W_1_0F98_P_0_LEN_0) },
10016 /* VEX_W_0F98_P_2_LEN_0 */
10017 { MOD_TABLE (MOD_VEX_W_0_0F98_P_2_LEN_0) },
10018 { MOD_TABLE (MOD_VEX_W_1_0F98_P_2_LEN_0) },
10021 /* VEX_W_0F99_P_0_LEN_0 */
10022 { MOD_TABLE (MOD_VEX_W_0_0F99_P_0_LEN_0) },
10023 { MOD_TABLE (MOD_VEX_W_1_0F99_P_0_LEN_0) },
10026 /* VEX_W_0F99_P_2_LEN_0 */
10027 { MOD_TABLE (MOD_VEX_W_0_0F99_P_2_LEN_0) },
10028 { MOD_TABLE (MOD_VEX_W_1_0F99_P_2_LEN_0) },
10031 /* VEX_W_0F380C_P_2 */
10032 { "vpermilps", { XM, Vex, EXx }, 0 },
10035 /* VEX_W_0F380D_P_2 */
10036 { "vpermilpd", { XM, Vex, EXx }, 0 },
10039 /* VEX_W_0F380E_P_2 */
10040 { "vtestps", { XM, EXx }, 0 },
10043 /* VEX_W_0F380F_P_2 */
10044 { "vtestpd", { XM, EXx }, 0 },
10047 /* VEX_W_0F3816_P_2 */
10048 { "vpermps", { XM, Vex, EXx }, 0 },
10051 /* VEX_W_0F3818_P_2 */
10052 { "vbroadcastss", { XM, EXxmm_md }, 0 },
10055 /* VEX_W_0F3819_P_2 */
10056 { "vbroadcastsd", { XM, EXxmm_mq }, 0 },
10059 /* VEX_W_0F381A_P_2_M_0 */
10060 { "vbroadcastf128", { XM, Mxmm }, 0 },
10063 /* VEX_W_0F382C_P_2_M_0 */
10064 { "vmaskmovps", { XM, Vex, Mx }, 0 },
10067 /* VEX_W_0F382D_P_2_M_0 */
10068 { "vmaskmovpd", { XM, Vex, Mx }, 0 },
10071 /* VEX_W_0F382E_P_2_M_0 */
10072 { "vmaskmovps", { Mx, Vex, XM }, 0 },
10075 /* VEX_W_0F382F_P_2_M_0 */
10076 { "vmaskmovpd", { Mx, Vex, XM }, 0 },
10079 /* VEX_W_0F3836_P_2 */
10080 { "vpermd", { XM, Vex, EXx }, 0 },
10083 /* VEX_W_0F3846_P_2 */
10084 { "vpsravd", { XM, Vex, EXx }, 0 },
10087 /* VEX_W_0F3858_P_2 */
10088 { "vpbroadcastd", { XM, EXxmm_md }, 0 },
10091 /* VEX_W_0F3859_P_2 */
10092 { "vpbroadcastq", { XM, EXxmm_mq }, 0 },
10095 /* VEX_W_0F385A_P_2_M_0 */
10096 { "vbroadcasti128", { XM, Mxmm }, 0 },
10099 /* VEX_W_0F3878_P_2 */
10100 { "vpbroadcastb", { XM, EXxmm_mb }, 0 },
10103 /* VEX_W_0F3879_P_2 */
10104 { "vpbroadcastw", { XM, EXxmm_mw }, 0 },
10107 /* VEX_W_0F38CF_P_2 */
10108 { "vgf2p8mulb", { XM, Vex, EXx }, 0 },
10111 /* VEX_W_0F3A00_P_2 */
10113 { "vpermq", { XM, EXx, Ib }, 0 },
10116 /* VEX_W_0F3A01_P_2 */
10118 { "vpermpd", { XM, EXx, Ib }, 0 },
10121 /* VEX_W_0F3A02_P_2 */
10122 { "vpblendd", { XM, Vex, EXx, Ib }, 0 },
10125 /* VEX_W_0F3A04_P_2 */
10126 { "vpermilps", { XM, EXx, Ib }, 0 },
10129 /* VEX_W_0F3A05_P_2 */
10130 { "vpermilpd", { XM, EXx, Ib }, 0 },
10133 /* VEX_W_0F3A06_P_2 */
10134 { "vperm2f128", { XM, Vex256, EXx, Ib }, 0 },
10137 /* VEX_W_0F3A18_P_2 */
10138 { "vinsertf128", { XM, Vex256, EXxmm, Ib }, 0 },
10141 /* VEX_W_0F3A19_P_2 */
10142 { "vextractf128", { EXxmm, XM, Ib }, 0 },
10145 /* VEX_W_0F3A30_P_2_LEN_0 */
10146 { MOD_TABLE (MOD_VEX_W_0_0F3A30_P_2_LEN_0) },
10147 { MOD_TABLE (MOD_VEX_W_1_0F3A30_P_2_LEN_0) },
10150 /* VEX_W_0F3A31_P_2_LEN_0 */
10151 { MOD_TABLE (MOD_VEX_W_0_0F3A31_P_2_LEN_0) },
10152 { MOD_TABLE (MOD_VEX_W_1_0F3A31_P_2_LEN_0) },
10155 /* VEX_W_0F3A32_P_2_LEN_0 */
10156 { MOD_TABLE (MOD_VEX_W_0_0F3A32_P_2_LEN_0) },
10157 { MOD_TABLE (MOD_VEX_W_1_0F3A32_P_2_LEN_0) },
10160 /* VEX_W_0F3A33_P_2_LEN_0 */
10161 { MOD_TABLE (MOD_VEX_W_0_0F3A33_P_2_LEN_0) },
10162 { MOD_TABLE (MOD_VEX_W_1_0F3A33_P_2_LEN_0) },
10165 /* VEX_W_0F3A38_P_2 */
10166 { "vinserti128", { XM, Vex256, EXxmm, Ib }, 0 },
10169 /* VEX_W_0F3A39_P_2 */
10170 { "vextracti128", { EXxmm, XM, Ib }, 0 },
10173 /* VEX_W_0F3A46_P_2 */
10174 { "vperm2i128", { XM, Vex256, EXx, Ib }, 0 },
10177 /* VEX_W_0F3A48_P_2 */
10178 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10179 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10182 /* VEX_W_0F3A49_P_2 */
10183 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10184 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10187 /* VEX_W_0F3A4A_P_2 */
10188 { "vblendvps", { XM, Vex, EXx, XMVexI4 }, 0 },
10191 /* VEX_W_0F3A4B_P_2 */
10192 { "vblendvpd", { XM, Vex, EXx, XMVexI4 }, 0 },
10195 /* VEX_W_0F3A4C_P_2 */
10196 { "vpblendvb", { XM, Vex, EXx, XMVexI4 }, 0 },
10199 /* VEX_W_0F3ACE_P_2 */
10201 { "vgf2p8affineqb", { XM, Vex, EXx, Ib }, 0 },
10204 /* VEX_W_0F3ACF_P_2 */
10206 { "vgf2p8affineinvqb", { XM, Vex, EXx, Ib }, 0 },
10208 #define NEED_VEX_W_TABLE
10209 #include "i386-dis-evex.h"
10210 #undef NEED_VEX_W_TABLE
10213 static const struct dis386 mod_table[][2] = {
10216 { "leaS", { Gv, M }, 0 },
10221 { RM_TABLE (RM_C6_REG_7) },
10226 { RM_TABLE (RM_C7_REG_7) },
10230 { "Jcall^", { indirEp }, 0 },
10234 { "Jjmp^", { indirEp }, 0 },
10237 /* MOD_0F01_REG_0 */
10238 { X86_64_TABLE (X86_64_0F01_REG_0) },
10239 { RM_TABLE (RM_0F01_REG_0) },
10242 /* MOD_0F01_REG_1 */
10243 { X86_64_TABLE (X86_64_0F01_REG_1) },
10244 { RM_TABLE (RM_0F01_REG_1) },
10247 /* MOD_0F01_REG_2 */
10248 { X86_64_TABLE (X86_64_0F01_REG_2) },
10249 { RM_TABLE (RM_0F01_REG_2) },
10252 /* MOD_0F01_REG_3 */
10253 { X86_64_TABLE (X86_64_0F01_REG_3) },
10254 { RM_TABLE (RM_0F01_REG_3) },
10257 /* MOD_0F01_REG_5 */
10258 { PREFIX_TABLE (PREFIX_MOD_0_0F01_REG_5) },
10259 { RM_TABLE (RM_0F01_REG_5) },
10262 /* MOD_0F01_REG_7 */
10263 { "invlpg", { Mb }, 0 },
10264 { RM_TABLE (RM_0F01_REG_7) },
10267 /* MOD_0F12_PREFIX_0 */
10268 { "movlps", { XM, EXq }, PREFIX_OPCODE },
10269 { "movhlps", { XM, EXq }, PREFIX_OPCODE },
10273 { "movlpX", { EXq, XM }, PREFIX_OPCODE },
10276 /* MOD_0F16_PREFIX_0 */
10277 { "movhps", { XM, EXq }, 0 },
10278 { "movlhps", { XM, EXq }, 0 },
10282 { "movhpX", { EXq, XM }, PREFIX_OPCODE },
10285 /* MOD_0F18_REG_0 */
10286 { "prefetchnta", { Mb }, 0 },
10289 /* MOD_0F18_REG_1 */
10290 { "prefetcht0", { Mb }, 0 },
10293 /* MOD_0F18_REG_2 */
10294 { "prefetcht1", { Mb }, 0 },
10297 /* MOD_0F18_REG_3 */
10298 { "prefetcht2", { Mb }, 0 },
10301 /* MOD_0F18_REG_4 */
10302 { "nop/reserved", { Mb }, 0 },
10305 /* MOD_0F18_REG_5 */
10306 { "nop/reserved", { Mb }, 0 },
10309 /* MOD_0F18_REG_6 */
10310 { "nop/reserved", { Mb }, 0 },
10313 /* MOD_0F18_REG_7 */
10314 { "nop/reserved", { Mb }, 0 },
10317 /* MOD_0F1A_PREFIX_0 */
10318 { "bndldx", { Gbnd, Mv_bnd }, 0 },
10319 { "nopQ", { Ev }, 0 },
10322 /* MOD_0F1B_PREFIX_0 */
10323 { "bndstx", { Mv_bnd, Gbnd }, 0 },
10324 { "nopQ", { Ev }, 0 },
10327 /* MOD_0F1B_PREFIX_1 */
10328 { "bndmk", { Gbnd, Mv_bnd }, 0 },
10329 { "nopQ", { Ev }, 0 },
10332 /* MOD_0F1C_PREFIX_0 */
10333 { REG_TABLE (REG_0F1C_MOD_0) },
10334 { "nopQ", { Ev }, 0 },
10337 /* MOD_0F1E_PREFIX_1 */
10338 { "nopQ", { Ev }, 0 },
10339 { REG_TABLE (REG_0F1E_MOD_3) },
10344 { "movL", { Rd, Td }, 0 },
10349 { "movL", { Td, Rd }, 0 },
10352 /* MOD_0F2B_PREFIX_0 */
10353 {"movntps", { Mx, XM }, PREFIX_OPCODE },
10356 /* MOD_0F2B_PREFIX_1 */
10357 {"movntss", { Md, XM }, PREFIX_OPCODE },
10360 /* MOD_0F2B_PREFIX_2 */
10361 {"movntpd", { Mx, XM }, PREFIX_OPCODE },
10364 /* MOD_0F2B_PREFIX_3 */
10365 {"movntsd", { Mq, XM }, PREFIX_OPCODE },
10370 { "movmskpX", { Gdq, XS }, PREFIX_OPCODE },
10373 /* MOD_0F71_REG_2 */
10375 { "psrlw", { MS, Ib }, 0 },
10378 /* MOD_0F71_REG_4 */
10380 { "psraw", { MS, Ib }, 0 },
10383 /* MOD_0F71_REG_6 */
10385 { "psllw", { MS, Ib }, 0 },
10388 /* MOD_0F72_REG_2 */
10390 { "psrld", { MS, Ib }, 0 },
10393 /* MOD_0F72_REG_4 */
10395 { "psrad", { MS, Ib }, 0 },
10398 /* MOD_0F72_REG_6 */
10400 { "pslld", { MS, Ib }, 0 },
10403 /* MOD_0F73_REG_2 */
10405 { "psrlq", { MS, Ib }, 0 },
10408 /* MOD_0F73_REG_3 */
10410 { PREFIX_TABLE (PREFIX_0F73_REG_3) },
10413 /* MOD_0F73_REG_6 */
10415 { "psllq", { MS, Ib }, 0 },
10418 /* MOD_0F73_REG_7 */
10420 { PREFIX_TABLE (PREFIX_0F73_REG_7) },
10423 /* MOD_0FAE_REG_0 */
10424 { "fxsave", { FXSAVE }, 0 },
10425 { PREFIX_TABLE (PREFIX_0FAE_REG_0) },
10428 /* MOD_0FAE_REG_1 */
10429 { "fxrstor", { FXSAVE }, 0 },
10430 { PREFIX_TABLE (PREFIX_0FAE_REG_1) },
10433 /* MOD_0FAE_REG_2 */
10434 { "ldmxcsr", { Md }, 0 },
10435 { PREFIX_TABLE (PREFIX_0FAE_REG_2) },
10438 /* MOD_0FAE_REG_3 */
10439 { "stmxcsr", { Md }, 0 },
10440 { PREFIX_TABLE (PREFIX_0FAE_REG_3) },
10443 /* MOD_0FAE_REG_4 */
10444 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_4) },
10445 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_4) },
10448 /* MOD_0FAE_REG_5 */
10449 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_5) },
10450 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_5) },
10453 /* MOD_0FAE_REG_6 */
10454 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_6) },
10455 { PREFIX_TABLE (PREFIX_MOD_1_0FAE_REG_6) },
10458 /* MOD_0FAE_REG_7 */
10459 { PREFIX_TABLE (PREFIX_0FAE_REG_7) },
10460 { RM_TABLE (RM_0FAE_REG_7) },
10464 { "lssS", { Gv, Mp }, 0 },
10468 { "lfsS", { Gv, Mp }, 0 },
10472 { "lgsS", { Gv, Mp }, 0 },
10476 { PREFIX_TABLE (PREFIX_MOD_0_0FC3) },
10479 /* MOD_0FC7_REG_3 */
10480 { "xrstors", { FXSAVE }, 0 },
10483 /* MOD_0FC7_REG_4 */
10484 { "xsavec", { FXSAVE }, 0 },
10487 /* MOD_0FC7_REG_5 */
10488 { "xsaves", { FXSAVE }, 0 },
10491 /* MOD_0FC7_REG_6 */
10492 { PREFIX_TABLE (PREFIX_MOD_0_0FC7_REG_6) },
10493 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_6) }
10496 /* MOD_0FC7_REG_7 */
10497 { "vmptrst", { Mq }, 0 },
10498 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_7) }
10503 { "pmovmskb", { Gdq, MS }, 0 },
10506 /* MOD_0FE7_PREFIX_2 */
10507 { "movntdq", { Mx, XM }, 0 },
10510 /* MOD_0FF0_PREFIX_3 */
10511 { "lddqu", { XM, M }, 0 },
10514 /* MOD_0F382A_PREFIX_2 */
10515 { "movntdqa", { XM, Mx }, 0 },
10518 /* MOD_0F38F5_PREFIX_2 */
10519 { "wrussK", { M, Gdq }, PREFIX_OPCODE },
10522 /* MOD_0F38F6_PREFIX_0 */
10523 { "wrssK", { M, Gdq }, PREFIX_OPCODE },
10526 /* MOD_0F38F8_PREFIX_1 */
10527 { "enqcmds", { Gva, M }, PREFIX_OPCODE },
10530 /* MOD_0F38F8_PREFIX_2 */
10531 { "movdir64b", { Gva, M }, PREFIX_OPCODE },
10534 /* MOD_0F38F8_PREFIX_3 */
10535 { "enqcmd", { Gva, M }, PREFIX_OPCODE },
10538 /* MOD_0F38F9_PREFIX_0 */
10539 { "movdiri", { Em, Gv }, PREFIX_OPCODE },
10543 { "bound{S|}", { Gv, Ma }, 0 },
10544 { EVEX_TABLE (EVEX_0F) },
10548 { "lesS", { Gv, Mp }, 0 },
10549 { VEX_C4_TABLE (VEX_0F) },
10553 { "ldsS", { Gv, Mp }, 0 },
10554 { VEX_C5_TABLE (VEX_0F) },
10557 /* MOD_VEX_0F12_PREFIX_0 */
10558 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0) },
10559 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1) },
10563 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0) },
10566 /* MOD_VEX_0F16_PREFIX_0 */
10567 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0) },
10568 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1) },
10572 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0) },
10576 { "vmovntpX", { Mx, XM }, 0 },
10579 /* MOD_VEX_W_0_0F41_P_0_LEN_1 */
10581 { "kandw", { MaskG, MaskVex, MaskR }, 0 },
10584 /* MOD_VEX_W_1_0F41_P_0_LEN_1 */
10586 { "kandq", { MaskG, MaskVex, MaskR }, 0 },
10589 /* MOD_VEX_W_0_0F41_P_2_LEN_1 */
10591 { "kandb", { MaskG, MaskVex, MaskR }, 0 },
10594 /* MOD_VEX_W_1_0F41_P_2_LEN_1 */
10596 { "kandd", { MaskG, MaskVex, MaskR }, 0 },
10599 /* MOD_VEX_W_0_0F42_P_0_LEN_1 */
10601 { "kandnw", { MaskG, MaskVex, MaskR }, 0 },
10604 /* MOD_VEX_W_1_0F42_P_0_LEN_1 */
10606 { "kandnq", { MaskG, MaskVex, MaskR }, 0 },
10609 /* MOD_VEX_W_0_0F42_P_2_LEN_1 */
10611 { "kandnb", { MaskG, MaskVex, MaskR }, 0 },
10614 /* MOD_VEX_W_1_0F42_P_2_LEN_1 */
10616 { "kandnd", { MaskG, MaskVex, MaskR }, 0 },
10619 /* MOD_VEX_W_0_0F44_P_0_LEN_0 */
10621 { "knotw", { MaskG, MaskR }, 0 },
10624 /* MOD_VEX_W_1_0F44_P_0_LEN_0 */
10626 { "knotq", { MaskG, MaskR }, 0 },
10629 /* MOD_VEX_W_0_0F44_P_2_LEN_0 */
10631 { "knotb", { MaskG, MaskR }, 0 },
10634 /* MOD_VEX_W_1_0F44_P_2_LEN_0 */
10636 { "knotd", { MaskG, MaskR }, 0 },
10639 /* MOD_VEX_W_0_0F45_P_0_LEN_1 */
10641 { "korw", { MaskG, MaskVex, MaskR }, 0 },
10644 /* MOD_VEX_W_1_0F45_P_0_LEN_1 */
10646 { "korq", { MaskG, MaskVex, MaskR }, 0 },
10649 /* MOD_VEX_W_0_0F45_P_2_LEN_1 */
10651 { "korb", { MaskG, MaskVex, MaskR }, 0 },
10654 /* MOD_VEX_W_1_0F45_P_2_LEN_1 */
10656 { "kord", { MaskG, MaskVex, MaskR }, 0 },
10659 /* MOD_VEX_W_0_0F46_P_0_LEN_1 */
10661 { "kxnorw", { MaskG, MaskVex, MaskR }, 0 },
10664 /* MOD_VEX_W_1_0F46_P_0_LEN_1 */
10666 { "kxnorq", { MaskG, MaskVex, MaskR }, 0 },
10669 /* MOD_VEX_W_0_0F46_P_2_LEN_1 */
10671 { "kxnorb", { MaskG, MaskVex, MaskR }, 0 },
10674 /* MOD_VEX_W_1_0F46_P_2_LEN_1 */
10676 { "kxnord", { MaskG, MaskVex, MaskR }, 0 },
10679 /* MOD_VEX_W_0_0F47_P_0_LEN_1 */
10681 { "kxorw", { MaskG, MaskVex, MaskR }, 0 },
10684 /* MOD_VEX_W_1_0F47_P_0_LEN_1 */
10686 { "kxorq", { MaskG, MaskVex, MaskR }, 0 },
10689 /* MOD_VEX_W_0_0F47_P_2_LEN_1 */
10691 { "kxorb", { MaskG, MaskVex, MaskR }, 0 },
10694 /* MOD_VEX_W_1_0F47_P_2_LEN_1 */
10696 { "kxord", { MaskG, MaskVex, MaskR }, 0 },
10699 /* MOD_VEX_W_0_0F4A_P_0_LEN_1 */
10701 { "kaddw", { MaskG, MaskVex, MaskR }, 0 },
10704 /* MOD_VEX_W_1_0F4A_P_0_LEN_1 */
10706 { "kaddq", { MaskG, MaskVex, MaskR }, 0 },
10709 /* MOD_VEX_W_0_0F4A_P_2_LEN_1 */
10711 { "kaddb", { MaskG, MaskVex, MaskR }, 0 },
10714 /* MOD_VEX_W_1_0F4A_P_2_LEN_1 */
10716 { "kaddd", { MaskG, MaskVex, MaskR }, 0 },
10719 /* MOD_VEX_W_0_0F4B_P_0_LEN_1 */
10721 { "kunpckwd", { MaskG, MaskVex, MaskR }, 0 },
10724 /* MOD_VEX_W_1_0F4B_P_0_LEN_1 */
10726 { "kunpckdq", { MaskG, MaskVex, MaskR }, 0 },
10729 /* MOD_VEX_W_0_0F4B_P_2_LEN_1 */
10731 { "kunpckbw", { MaskG, MaskVex, MaskR }, 0 },
10736 { "vmovmskpX", { Gdq, XS }, 0 },
10739 /* MOD_VEX_0F71_REG_2 */
10741 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_2) },
10744 /* MOD_VEX_0F71_REG_4 */
10746 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_4) },
10749 /* MOD_VEX_0F71_REG_6 */
10751 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_6) },
10754 /* MOD_VEX_0F72_REG_2 */
10756 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_2) },
10759 /* MOD_VEX_0F72_REG_4 */
10761 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_4) },
10764 /* MOD_VEX_0F72_REG_6 */
10766 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_6) },
10769 /* MOD_VEX_0F73_REG_2 */
10771 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_2) },
10774 /* MOD_VEX_0F73_REG_3 */
10776 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_3) },
10779 /* MOD_VEX_0F73_REG_6 */
10781 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_6) },
10784 /* MOD_VEX_0F73_REG_7 */
10786 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_7) },
10789 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
10790 { "kmovw", { Ew, MaskG }, 0 },
10794 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
10795 { "kmovq", { Eq, MaskG }, 0 },
10799 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
10800 { "kmovb", { Eb, MaskG }, 0 },
10804 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
10805 { "kmovd", { Ed, MaskG }, 0 },
10809 /* MOD_VEX_W_0_0F92_P_0_LEN_0 */
10811 { "kmovw", { MaskG, Rdq }, 0 },
10814 /* MOD_VEX_W_0_0F92_P_2_LEN_0 */
10816 { "kmovb", { MaskG, Rdq }, 0 },
10819 /* MOD_VEX_0F92_P_3_LEN_0 */
10821 { "kmovK", { MaskG, Rdq }, 0 },
10824 /* MOD_VEX_W_0_0F93_P_0_LEN_0 */
10826 { "kmovw", { Gdq, MaskR }, 0 },
10829 /* MOD_VEX_W_0_0F93_P_2_LEN_0 */
10831 { "kmovb", { Gdq, MaskR }, 0 },
10834 /* MOD_VEX_0F93_P_3_LEN_0 */
10836 { "kmovK", { Gdq, MaskR }, 0 },
10839 /* MOD_VEX_W_0_0F98_P_0_LEN_0 */
10841 { "kortestw", { MaskG, MaskR }, 0 },
10844 /* MOD_VEX_W_1_0F98_P_0_LEN_0 */
10846 { "kortestq", { MaskG, MaskR }, 0 },
10849 /* MOD_VEX_W_0_0F98_P_2_LEN_0 */
10851 { "kortestb", { MaskG, MaskR }, 0 },
10854 /* MOD_VEX_W_1_0F98_P_2_LEN_0 */
10856 { "kortestd", { MaskG, MaskR }, 0 },
10859 /* MOD_VEX_W_0_0F99_P_0_LEN_0 */
10861 { "ktestw", { MaskG, MaskR }, 0 },
10864 /* MOD_VEX_W_1_0F99_P_0_LEN_0 */
10866 { "ktestq", { MaskG, MaskR }, 0 },
10869 /* MOD_VEX_W_0_0F99_P_2_LEN_0 */
10871 { "ktestb", { MaskG, MaskR }, 0 },
10874 /* MOD_VEX_W_1_0F99_P_2_LEN_0 */
10876 { "ktestd", { MaskG, MaskR }, 0 },
10879 /* MOD_VEX_0FAE_REG_2 */
10880 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0) },
10883 /* MOD_VEX_0FAE_REG_3 */
10884 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0) },
10887 /* MOD_VEX_0FD7_PREFIX_2 */
10889 { "vpmovmskb", { Gdq, XS }, 0 },
10892 /* MOD_VEX_0FE7_PREFIX_2 */
10893 { "vmovntdq", { Mx, XM }, 0 },
10896 /* MOD_VEX_0FF0_PREFIX_3 */
10897 { "vlddqu", { XM, M }, 0 },
10900 /* MOD_VEX_0F381A_PREFIX_2 */
10901 { VEX_LEN_TABLE (VEX_LEN_0F381A_P_2_M_0) },
10904 /* MOD_VEX_0F382A_PREFIX_2 */
10905 { "vmovntdqa", { XM, Mx }, 0 },
10908 /* MOD_VEX_0F382C_PREFIX_2 */
10909 { VEX_W_TABLE (VEX_W_0F382C_P_2_M_0) },
10912 /* MOD_VEX_0F382D_PREFIX_2 */
10913 { VEX_W_TABLE (VEX_W_0F382D_P_2_M_0) },
10916 /* MOD_VEX_0F382E_PREFIX_2 */
10917 { VEX_W_TABLE (VEX_W_0F382E_P_2_M_0) },
10920 /* MOD_VEX_0F382F_PREFIX_2 */
10921 { VEX_W_TABLE (VEX_W_0F382F_P_2_M_0) },
10924 /* MOD_VEX_0F385A_PREFIX_2 */
10925 { VEX_LEN_TABLE (VEX_LEN_0F385A_P_2_M_0) },
10928 /* MOD_VEX_0F388C_PREFIX_2 */
10929 { "vpmaskmov%LW", { XM, Vex, Mx }, 0 },
10932 /* MOD_VEX_0F388E_PREFIX_2 */
10933 { "vpmaskmov%LW", { Mx, Vex, XM }, 0 },
10936 /* MOD_VEX_W_0_0F3A30_P_2_LEN_0 */
10938 { "kshiftrb", { MaskG, MaskR, Ib }, 0 },
10941 /* MOD_VEX_W_1_0F3A30_P_2_LEN_0 */
10943 { "kshiftrw", { MaskG, MaskR, Ib }, 0 },
10946 /* MOD_VEX_W_0_0F3A31_P_2_LEN_0 */
10948 { "kshiftrd", { MaskG, MaskR, Ib }, 0 },
10951 /* MOD_VEX_W_1_0F3A31_P_2_LEN_0 */
10953 { "kshiftrq", { MaskG, MaskR, Ib }, 0 },
10956 /* MOD_VEX_W_0_0F3A32_P_2_LEN_0 */
10958 { "kshiftlb", { MaskG, MaskR, Ib }, 0 },
10961 /* MOD_VEX_W_1_0F3A32_P_2_LEN_0 */
10963 { "kshiftlw", { MaskG, MaskR, Ib }, 0 },
10966 /* MOD_VEX_W_0_0F3A33_P_2_LEN_0 */
10968 { "kshiftld", { MaskG, MaskR, Ib }, 0 },
10971 /* MOD_VEX_W_1_0F3A33_P_2_LEN_0 */
10973 { "kshiftlq", { MaskG, MaskR, Ib }, 0 },
10975 #define NEED_MOD_TABLE
10976 #include "i386-dis-evex.h"
10977 #undef NEED_MOD_TABLE
10980 static const struct dis386 rm_table[][8] = {
10983 { "xabort", { Skip_MODRM, Ib }, 0 },
10987 { "xbeginT", { Skip_MODRM, Jv }, 0 },
10990 /* RM_0F01_REG_0 */
10991 { "enclv", { Skip_MODRM }, 0 },
10992 { "vmcall", { Skip_MODRM }, 0 },
10993 { "vmlaunch", { Skip_MODRM }, 0 },
10994 { "vmresume", { Skip_MODRM }, 0 },
10995 { "vmxoff", { Skip_MODRM }, 0 },
10996 { "pconfig", { Skip_MODRM }, 0 },
10999 /* RM_0F01_REG_1 */
11000 { "monitor", { { OP_Monitor, 0 } }, 0 },
11001 { "mwait", { { OP_Mwait, 0 } }, 0 },
11002 { "clac", { Skip_MODRM }, 0 },
11003 { "stac", { Skip_MODRM }, 0 },
11007 { "encls", { Skip_MODRM }, 0 },
11010 /* RM_0F01_REG_2 */
11011 { "xgetbv", { Skip_MODRM }, 0 },
11012 { "xsetbv", { Skip_MODRM }, 0 },
11015 { "vmfunc", { Skip_MODRM }, 0 },
11016 { "xend", { Skip_MODRM }, 0 },
11017 { "xtest", { Skip_MODRM }, 0 },
11018 { "enclu", { Skip_MODRM }, 0 },
11021 /* RM_0F01_REG_3 */
11022 { "vmrun", { Skip_MODRM }, 0 },
11023 { "vmmcall", { Skip_MODRM }, 0 },
11024 { "vmload", { Skip_MODRM }, 0 },
11025 { "vmsave", { Skip_MODRM }, 0 },
11026 { "stgi", { Skip_MODRM }, 0 },
11027 { "clgi", { Skip_MODRM }, 0 },
11028 { "skinit", { Skip_MODRM }, 0 },
11029 { "invlpga", { Skip_MODRM }, 0 },
11032 /* RM_0F01_REG_5 */
11033 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_0) },
11035 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_2) },
11039 { "rdpkru", { Skip_MODRM }, 0 },
11040 { "wrpkru", { Skip_MODRM }, 0 },
11043 /* RM_0F01_REG_7 */
11044 { "swapgs", { Skip_MODRM }, 0 },
11045 { "rdtscp", { Skip_MODRM }, 0 },
11046 { "monitorx", { { OP_Monitor, 0 } }, 0 },
11047 { "mwaitx", { { OP_Mwaitx, 0 } }, 0 },
11048 { "clzero", { Skip_MODRM }, 0 },
11051 /* RM_0F1E_MOD_3_REG_7 */
11052 { "nopQ", { Ev }, 0 },
11053 { "nopQ", { Ev }, 0 },
11054 { "endbr64", { Skip_MODRM }, PREFIX_OPCODE },
11055 { "endbr32", { Skip_MODRM }, PREFIX_OPCODE },
11056 { "nopQ", { Ev }, 0 },
11057 { "nopQ", { Ev }, 0 },
11058 { "nopQ", { Ev }, 0 },
11059 { "nopQ", { Ev }, 0 },
11062 /* RM_0FAE_REG_6 */
11063 { "mfence", { Skip_MODRM }, 0 },
11066 /* RM_0FAE_REG_7 */
11067 { "sfence", { Skip_MODRM }, 0 },
11072 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
11074 /* We use the high bit to indicate different name for the same
11076 #define REP_PREFIX (0xf3 | 0x100)
11077 #define XACQUIRE_PREFIX (0xf2 | 0x200)
11078 #define XRELEASE_PREFIX (0xf3 | 0x400)
11079 #define BND_PREFIX (0xf2 | 0x400)
11080 #define NOTRACK_PREFIX (0x3e | 0x100)
11085 int newrex, i, length;
11091 last_lock_prefix = -1;
11092 last_repz_prefix = -1;
11093 last_repnz_prefix = -1;
11094 last_data_prefix = -1;
11095 last_addr_prefix = -1;
11096 last_rex_prefix = -1;
11097 last_seg_prefix = -1;
11099 active_seg_prefix = 0;
11100 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
11101 all_prefixes[i] = 0;
11104 /* The maximum instruction length is 15bytes. */
11105 while (length < MAX_CODE_LENGTH - 1)
11107 FETCH_DATA (the_info, codep + 1);
11111 /* REX prefixes family. */
11128 if (address_mode == mode_64bit)
11132 last_rex_prefix = i;
11135 prefixes |= PREFIX_REPZ;
11136 last_repz_prefix = i;
11139 prefixes |= PREFIX_REPNZ;
11140 last_repnz_prefix = i;
11143 prefixes |= PREFIX_LOCK;
11144 last_lock_prefix = i;
11147 prefixes |= PREFIX_CS;
11148 last_seg_prefix = i;
11149 active_seg_prefix = PREFIX_CS;
11152 prefixes |= PREFIX_SS;
11153 last_seg_prefix = i;
11154 active_seg_prefix = PREFIX_SS;
11157 prefixes |= PREFIX_DS;
11158 last_seg_prefix = i;
11159 active_seg_prefix = PREFIX_DS;
11162 prefixes |= PREFIX_ES;
11163 last_seg_prefix = i;
11164 active_seg_prefix = PREFIX_ES;
11167 prefixes |= PREFIX_FS;
11168 last_seg_prefix = i;
11169 active_seg_prefix = PREFIX_FS;
11172 prefixes |= PREFIX_GS;
11173 last_seg_prefix = i;
11174 active_seg_prefix = PREFIX_GS;
11177 prefixes |= PREFIX_DATA;
11178 last_data_prefix = i;
11181 prefixes |= PREFIX_ADDR;
11182 last_addr_prefix = i;
11185 /* fwait is really an instruction. If there are prefixes
11186 before the fwait, they belong to the fwait, *not* to the
11187 following instruction. */
11189 if (prefixes || rex)
11191 prefixes |= PREFIX_FWAIT;
11193 /* This ensures that the previous REX prefixes are noticed
11194 as unused prefixes, as in the return case below. */
11198 prefixes = PREFIX_FWAIT;
11203 /* Rex is ignored when followed by another prefix. */
11209 if (*codep != FWAIT_OPCODE)
11210 all_prefixes[i++] = *codep;
11218 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
11221 static const char *
11222 prefix_name (int pref, int sizeflag)
11224 static const char *rexes [16] =
11227 "rex.B", /* 0x41 */
11228 "rex.X", /* 0x42 */
11229 "rex.XB", /* 0x43 */
11230 "rex.R", /* 0x44 */
11231 "rex.RB", /* 0x45 */
11232 "rex.RX", /* 0x46 */
11233 "rex.RXB", /* 0x47 */
11234 "rex.W", /* 0x48 */
11235 "rex.WB", /* 0x49 */
11236 "rex.WX", /* 0x4a */
11237 "rex.WXB", /* 0x4b */
11238 "rex.WR", /* 0x4c */
11239 "rex.WRB", /* 0x4d */
11240 "rex.WRX", /* 0x4e */
11241 "rex.WRXB", /* 0x4f */
11246 /* REX prefixes family. */
11263 return rexes [pref - 0x40];
11283 return (sizeflag & DFLAG) ? "data16" : "data32";
11285 if (address_mode == mode_64bit)
11286 return (sizeflag & AFLAG) ? "addr32" : "addr64";
11288 return (sizeflag & AFLAG) ? "addr16" : "addr32";
11293 case XACQUIRE_PREFIX:
11295 case XRELEASE_PREFIX:
11299 case NOTRACK_PREFIX:
11306 static char op_out[MAX_OPERANDS][100];
11307 static int op_ad, op_index[MAX_OPERANDS];
11308 static int two_source_ops;
11309 static bfd_vma op_address[MAX_OPERANDS];
11310 static bfd_vma op_riprel[MAX_OPERANDS];
11311 static bfd_vma start_pc;
11314 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
11315 * (see topic "Redundant prefixes" in the "Differences from 8086"
11316 * section of the "Virtual 8086 Mode" chapter.)
11317 * 'pc' should be the address of this instruction, it will
11318 * be used to print the target address if this is a relative jump or call
11319 * The function returns the length of this instruction in bytes.
11322 static char intel_syntax;
11323 static char intel_mnemonic = !SYSV386_COMPAT;
11324 static char open_char;
11325 static char close_char;
11326 static char separator_char;
11327 static char scale_char;
11335 static enum x86_64_isa isa64;
11337 /* Here for backwards compatibility. When gdb stops using
11338 print_insn_i386_att and print_insn_i386_intel these functions can
11339 disappear, and print_insn_i386 be merged into print_insn. */
11341 print_insn_i386_att (bfd_vma pc, disassemble_info *info)
11345 return print_insn (pc, info);
11349 print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
11353 return print_insn (pc, info);
11357 print_insn_i386 (bfd_vma pc, disassemble_info *info)
11361 return print_insn (pc, info);
11365 print_i386_disassembler_options (FILE *stream)
11367 fprintf (stream, _("\n\
11368 The following i386/x86-64 specific disassembler options are supported for use\n\
11369 with the -M switch (multiple options should be separated by commas):\n"));
11371 fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n"));
11372 fprintf (stream, _(" i386 Disassemble in 32bit mode\n"));
11373 fprintf (stream, _(" i8086 Disassemble in 16bit mode\n"));
11374 fprintf (stream, _(" att Display instruction in AT&T syntax\n"));
11375 fprintf (stream, _(" intel Display instruction in Intel syntax\n"));
11376 fprintf (stream, _(" att-mnemonic\n"
11377 " Display instruction in AT&T mnemonic\n"));
11378 fprintf (stream, _(" intel-mnemonic\n"
11379 " Display instruction in Intel mnemonic\n"));
11380 fprintf (stream, _(" addr64 Assume 64bit address size\n"));
11381 fprintf (stream, _(" addr32 Assume 32bit address size\n"));
11382 fprintf (stream, _(" addr16 Assume 16bit address size\n"));
11383 fprintf (stream, _(" data32 Assume 32bit data size\n"));
11384 fprintf (stream, _(" data16 Assume 16bit data size\n"));
11385 fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n"));
11386 fprintf (stream, _(" amd64 Display instruction in AMD64 ISA\n"));
11387 fprintf (stream, _(" intel64 Display instruction in Intel64 ISA\n"));
11391 static const struct dis386 bad_opcode = { "(bad)", { XX }, 0 };
11393 /* Get a pointer to struct dis386 with a valid name. */
11395 static const struct dis386 *
11396 get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
11398 int vindex, vex_table_index;
11400 if (dp->name != NULL)
11403 switch (dp->op[0].bytemode)
11405 case USE_REG_TABLE:
11406 dp = ®_table[dp->op[1].bytemode][modrm.reg];
11409 case USE_MOD_TABLE:
11410 vindex = modrm.mod == 0x3 ? 1 : 0;
11411 dp = &mod_table[dp->op[1].bytemode][vindex];
11415 dp = &rm_table[dp->op[1].bytemode][modrm.rm];
11418 case USE_PREFIX_TABLE:
11421 /* The prefix in VEX is implicit. */
11422 switch (vex.prefix)
11427 case REPE_PREFIX_OPCODE:
11430 case DATA_PREFIX_OPCODE:
11433 case REPNE_PREFIX_OPCODE:
11443 int last_prefix = -1;
11446 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
11447 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
11449 if ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) != 0)
11451 if (last_repz_prefix > last_repnz_prefix)
11454 prefix = PREFIX_REPZ;
11455 last_prefix = last_repz_prefix;
11460 prefix = PREFIX_REPNZ;
11461 last_prefix = last_repnz_prefix;
11464 /* Check if prefix should be ignored. */
11465 if ((((prefix_table[dp->op[1].bytemode][vindex].prefix_requirement
11466 & PREFIX_IGNORED) >> PREFIX_IGNORED_SHIFT)
11471 if (vindex == 0 && (prefixes & PREFIX_DATA) != 0)
11474 prefix = PREFIX_DATA;
11475 last_prefix = last_data_prefix;
11480 used_prefixes |= prefix;
11481 all_prefixes[last_prefix] = 0;
11484 dp = &prefix_table[dp->op[1].bytemode][vindex];
11487 case USE_X86_64_TABLE:
11488 vindex = address_mode == mode_64bit ? 1 : 0;
11489 dp = &x86_64_table[dp->op[1].bytemode][vindex];
11492 case USE_3BYTE_TABLE:
11493 FETCH_DATA (info, codep + 2);
11495 dp = &three_byte_table[dp->op[1].bytemode][vindex];
11497 modrm.mod = (*codep >> 6) & 3;
11498 modrm.reg = (*codep >> 3) & 7;
11499 modrm.rm = *codep & 7;
11502 case USE_VEX_LEN_TABLE:
11506 switch (vex.length)
11519 dp = &vex_len_table[dp->op[1].bytemode][vindex];
11522 case USE_EVEX_LEN_TABLE:
11526 switch (vex.length)
11542 dp = &evex_len_table[dp->op[1].bytemode][vindex];
11545 case USE_XOP_8F_TABLE:
11546 FETCH_DATA (info, codep + 3);
11547 /* All bits in the REX prefix are ignored. */
11549 rex = ~(*codep >> 5) & 0x7;
11551 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
11552 switch ((*codep & 0x1f))
11558 vex_table_index = XOP_08;
11561 vex_table_index = XOP_09;
11564 vex_table_index = XOP_0A;
11568 vex.w = *codep & 0x80;
11569 if (vex.w && address_mode == mode_64bit)
11572 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11573 if (address_mode != mode_64bit)
11575 /* In 16/32-bit mode REX_B is silently ignored. */
11579 vex.length = (*codep & 0x4) ? 256 : 128;
11580 switch ((*codep & 0x3))
11585 vex.prefix = DATA_PREFIX_OPCODE;
11588 vex.prefix = REPE_PREFIX_OPCODE;
11591 vex.prefix = REPNE_PREFIX_OPCODE;
11598 dp = &xop_table[vex_table_index][vindex];
11601 FETCH_DATA (info, codep + 1);
11602 modrm.mod = (*codep >> 6) & 3;
11603 modrm.reg = (*codep >> 3) & 7;
11604 modrm.rm = *codep & 7;
11607 case USE_VEX_C4_TABLE:
11609 FETCH_DATA (info, codep + 3);
11610 /* All bits in the REX prefix are ignored. */
11612 rex = ~(*codep >> 5) & 0x7;
11613 switch ((*codep & 0x1f))
11619 vex_table_index = VEX_0F;
11622 vex_table_index = VEX_0F38;
11625 vex_table_index = VEX_0F3A;
11629 vex.w = *codep & 0x80;
11630 if (address_mode == mode_64bit)
11637 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
11638 is ignored, other REX bits are 0 and the highest bit in
11639 VEX.vvvv is also ignored (but we mustn't clear it here). */
11642 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11643 vex.length = (*codep & 0x4) ? 256 : 128;
11644 switch ((*codep & 0x3))
11649 vex.prefix = DATA_PREFIX_OPCODE;
11652 vex.prefix = REPE_PREFIX_OPCODE;
11655 vex.prefix = REPNE_PREFIX_OPCODE;
11662 dp = &vex_table[vex_table_index][vindex];
11664 /* There is no MODRM byte for VEX0F 77. */
11665 if (vex_table_index != VEX_0F || vindex != 0x77)
11667 FETCH_DATA (info, codep + 1);
11668 modrm.mod = (*codep >> 6) & 3;
11669 modrm.reg = (*codep >> 3) & 7;
11670 modrm.rm = *codep & 7;
11674 case USE_VEX_C5_TABLE:
11676 FETCH_DATA (info, codep + 2);
11677 /* All bits in the REX prefix are ignored. */
11679 rex = (*codep & 0x80) ? 0 : REX_R;
11681 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
11683 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11684 vex.length = (*codep & 0x4) ? 256 : 128;
11685 switch ((*codep & 0x3))
11690 vex.prefix = DATA_PREFIX_OPCODE;
11693 vex.prefix = REPE_PREFIX_OPCODE;
11696 vex.prefix = REPNE_PREFIX_OPCODE;
11703 dp = &vex_table[dp->op[1].bytemode][vindex];
11705 /* There is no MODRM byte for VEX 77. */
11706 if (vindex != 0x77)
11708 FETCH_DATA (info, codep + 1);
11709 modrm.mod = (*codep >> 6) & 3;
11710 modrm.reg = (*codep >> 3) & 7;
11711 modrm.rm = *codep & 7;
11715 case USE_VEX_W_TABLE:
11719 dp = &vex_w_table[dp->op[1].bytemode][vex.w ? 1 : 0];
11722 case USE_EVEX_TABLE:
11723 two_source_ops = 0;
11726 FETCH_DATA (info, codep + 4);
11727 /* All bits in the REX prefix are ignored. */
11729 /* The first byte after 0x62. */
11730 rex = ~(*codep >> 5) & 0x7;
11731 vex.r = *codep & 0x10;
11732 switch ((*codep & 0xf))
11735 return &bad_opcode;
11737 vex_table_index = EVEX_0F;
11740 vex_table_index = EVEX_0F38;
11743 vex_table_index = EVEX_0F3A;
11747 /* The second byte after 0x62. */
11749 vex.w = *codep & 0x80;
11750 if (vex.w && address_mode == mode_64bit)
11753 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11756 if (!(*codep & 0x4))
11757 return &bad_opcode;
11759 switch ((*codep & 0x3))
11764 vex.prefix = DATA_PREFIX_OPCODE;
11767 vex.prefix = REPE_PREFIX_OPCODE;
11770 vex.prefix = REPNE_PREFIX_OPCODE;
11774 /* The third byte after 0x62. */
11777 /* Remember the static rounding bits. */
11778 vex.ll = (*codep >> 5) & 3;
11779 vex.b = (*codep & 0x10) != 0;
11781 vex.v = *codep & 0x8;
11782 vex.mask_register_specifier = *codep & 0x7;
11783 vex.zeroing = *codep & 0x80;
11785 if (address_mode != mode_64bit)
11787 /* In 16/32-bit mode silently ignore following bits. */
11797 dp = &evex_table[vex_table_index][vindex];
11799 FETCH_DATA (info, codep + 1);
11800 modrm.mod = (*codep >> 6) & 3;
11801 modrm.reg = (*codep >> 3) & 7;
11802 modrm.rm = *codep & 7;
11804 /* Set vector length. */
11805 if (modrm.mod == 3 && vex.b)
11821 return &bad_opcode;
11834 if (dp->name != NULL)
11837 return get_valid_dis386 (dp, info);
11841 get_sib (disassemble_info *info, int sizeflag)
11843 /* If modrm.mod == 3, operand must be register. */
11845 && ((sizeflag & AFLAG) || address_mode == mode_64bit)
11849 FETCH_DATA (info, codep + 2);
11850 sib.index = (codep [1] >> 3) & 7;
11851 sib.scale = (codep [1] >> 6) & 3;
11852 sib.base = codep [1] & 7;
11857 print_insn (bfd_vma pc, disassemble_info *info)
11859 const struct dis386 *dp;
11861 char *op_txt[MAX_OPERANDS];
11863 int sizeflag, orig_sizeflag;
11865 struct dis_private priv;
11868 priv.orig_sizeflag = AFLAG | DFLAG;
11869 if ((info->mach & bfd_mach_i386_i386) != 0)
11870 address_mode = mode_32bit;
11871 else if (info->mach == bfd_mach_i386_i8086)
11873 address_mode = mode_16bit;
11874 priv.orig_sizeflag = 0;
11877 address_mode = mode_64bit;
11879 if (intel_syntax == (char) -1)
11880 intel_syntax = (info->mach & bfd_mach_i386_intel_syntax) != 0;
11882 for (p = info->disassembler_options; p != NULL; )
11884 if (CONST_STRNEQ (p, "amd64"))
11886 else if (CONST_STRNEQ (p, "intel64"))
11888 else if (CONST_STRNEQ (p, "x86-64"))
11890 address_mode = mode_64bit;
11891 priv.orig_sizeflag = AFLAG | DFLAG;
11893 else if (CONST_STRNEQ (p, "i386"))
11895 address_mode = mode_32bit;
11896 priv.orig_sizeflag = AFLAG | DFLAG;
11898 else if (CONST_STRNEQ (p, "i8086"))
11900 address_mode = mode_16bit;
11901 priv.orig_sizeflag = 0;
11903 else if (CONST_STRNEQ (p, "intel"))
11906 if (CONST_STRNEQ (p + 5, "-mnemonic"))
11907 intel_mnemonic = 1;
11909 else if (CONST_STRNEQ (p, "att"))
11912 if (CONST_STRNEQ (p + 3, "-mnemonic"))
11913 intel_mnemonic = 0;
11915 else if (CONST_STRNEQ (p, "addr"))
11917 if (address_mode == mode_64bit)
11919 if (p[4] == '3' && p[5] == '2')
11920 priv.orig_sizeflag &= ~AFLAG;
11921 else if (p[4] == '6' && p[5] == '4')
11922 priv.orig_sizeflag |= AFLAG;
11926 if (p[4] == '1' && p[5] == '6')
11927 priv.orig_sizeflag &= ~AFLAG;
11928 else if (p[4] == '3' && p[5] == '2')
11929 priv.orig_sizeflag |= AFLAG;
11932 else if (CONST_STRNEQ (p, "data"))
11934 if (p[4] == '1' && p[5] == '6')
11935 priv.orig_sizeflag &= ~DFLAG;
11936 else if (p[4] == '3' && p[5] == '2')
11937 priv.orig_sizeflag |= DFLAG;
11939 else if (CONST_STRNEQ (p, "suffix"))
11940 priv.orig_sizeflag |= SUFFIX_ALWAYS;
11942 p = strchr (p, ',');
11947 if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
11949 (*info->fprintf_func) (info->stream,
11950 _("64-bit address is disabled"));
11956 names64 = intel_names64;
11957 names32 = intel_names32;
11958 names16 = intel_names16;
11959 names8 = intel_names8;
11960 names8rex = intel_names8rex;
11961 names_seg = intel_names_seg;
11962 names_mm = intel_names_mm;
11963 names_bnd = intel_names_bnd;
11964 names_xmm = intel_names_xmm;
11965 names_ymm = intel_names_ymm;
11966 names_zmm = intel_names_zmm;
11967 index64 = intel_index64;
11968 index32 = intel_index32;
11969 names_mask = intel_names_mask;
11970 index16 = intel_index16;
11973 separator_char = '+';
11978 names64 = att_names64;
11979 names32 = att_names32;
11980 names16 = att_names16;
11981 names8 = att_names8;
11982 names8rex = att_names8rex;
11983 names_seg = att_names_seg;
11984 names_mm = att_names_mm;
11985 names_bnd = att_names_bnd;
11986 names_xmm = att_names_xmm;
11987 names_ymm = att_names_ymm;
11988 names_zmm = att_names_zmm;
11989 index64 = att_index64;
11990 index32 = att_index32;
11991 names_mask = att_names_mask;
11992 index16 = att_index16;
11995 separator_char = ',';
11999 /* The output looks better if we put 7 bytes on a line, since that
12000 puts most long word instructions on a single line. Use 8 bytes
12002 if ((info->mach & bfd_mach_l1om) != 0)
12003 info->bytes_per_line = 8;
12005 info->bytes_per_line = 7;
12007 info->private_data = &priv;
12008 priv.max_fetched = priv.the_buffer;
12009 priv.insn_start = pc;
12012 for (i = 0; i < MAX_OPERANDS; ++i)
12020 start_codep = priv.the_buffer;
12021 codep = priv.the_buffer;
12023 if (OPCODES_SIGSETJMP (priv.bailout) != 0)
12027 /* Getting here means we tried for data but didn't get it. That
12028 means we have an incomplete instruction of some sort. Just
12029 print the first byte as a prefix or a .byte pseudo-op. */
12030 if (codep > priv.the_buffer)
12032 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
12034 (*info->fprintf_func) (info->stream, "%s", name);
12037 /* Just print the first byte as a .byte instruction. */
12038 (*info->fprintf_func) (info->stream, ".byte 0x%x",
12039 (unsigned int) priv.the_buffer[0]);
12049 sizeflag = priv.orig_sizeflag;
12051 if (!ckprefix () || rex_used)
12053 /* Too many prefixes or unused REX prefixes. */
12055 i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i];
12057 (*info->fprintf_func) (info->stream, "%s%s",
12059 prefix_name (all_prefixes[i], sizeflag));
12063 insn_codep = codep;
12065 FETCH_DATA (info, codep + 1);
12066 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
12068 if (((prefixes & PREFIX_FWAIT)
12069 && ((*codep < 0xd8) || (*codep > 0xdf))))
12071 /* Handle prefixes before fwait. */
12072 for (i = 0; i < fwait_prefix && all_prefixes[i];
12074 (*info->fprintf_func) (info->stream, "%s ",
12075 prefix_name (all_prefixes[i], sizeflag));
12076 (*info->fprintf_func) (info->stream, "fwait");
12080 if (*codep == 0x0f)
12082 unsigned char threebyte;
12085 FETCH_DATA (info, codep + 1);
12086 threebyte = *codep;
12087 dp = &dis386_twobyte[threebyte];
12088 need_modrm = twobyte_has_modrm[*codep];
12093 dp = &dis386[*codep];
12094 need_modrm = onebyte_has_modrm[*codep];
12098 /* Save sizeflag for printing the extra prefixes later before updating
12099 it for mnemonic and operand processing. The prefix names depend
12100 only on the address mode. */
12101 orig_sizeflag = sizeflag;
12102 if (prefixes & PREFIX_ADDR)
12104 if ((prefixes & PREFIX_DATA))
12110 FETCH_DATA (info, codep + 1);
12111 modrm.mod = (*codep >> 6) & 3;
12112 modrm.reg = (*codep >> 3) & 7;
12113 modrm.rm = *codep & 7;
12119 memset (&vex, 0, sizeof (vex));
12121 if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
12123 get_sib (info, sizeflag);
12124 dofloat (sizeflag);
12128 dp = get_valid_dis386 (dp, info);
12129 if (dp != NULL && putop (dp->name, sizeflag) == 0)
12131 get_sib (info, sizeflag);
12132 for (i = 0; i < MAX_OPERANDS; ++i)
12135 op_ad = MAX_OPERANDS - 1 - i;
12137 (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
12138 /* For EVEX instruction after the last operand masking
12139 should be printed. */
12140 if (i == 0 && vex.evex)
12142 /* Don't print {%k0}. */
12143 if (vex.mask_register_specifier)
12146 oappend (names_mask[vex.mask_register_specifier]);
12156 /* Check if the REX prefix is used. */
12157 if (rex_ignored == 0 && (rex ^ rex_used) == 0 && last_rex_prefix >= 0)
12158 all_prefixes[last_rex_prefix] = 0;
12160 /* Check if the SEG prefix is used. */
12161 if ((prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES
12162 | PREFIX_FS | PREFIX_GS)) != 0
12163 && (used_prefixes & active_seg_prefix) != 0)
12164 all_prefixes[last_seg_prefix] = 0;
12166 /* Check if the ADDR prefix is used. */
12167 if ((prefixes & PREFIX_ADDR) != 0
12168 && (used_prefixes & PREFIX_ADDR) != 0)
12169 all_prefixes[last_addr_prefix] = 0;
12171 /* Check if the DATA prefix is used. */
12172 if ((prefixes & PREFIX_DATA) != 0
12173 && (used_prefixes & PREFIX_DATA) != 0)
12174 all_prefixes[last_data_prefix] = 0;
12176 /* Print the extra prefixes. */
12178 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
12179 if (all_prefixes[i])
12182 name = prefix_name (all_prefixes[i], orig_sizeflag);
12185 prefix_length += strlen (name) + 1;
12186 (*info->fprintf_func) (info->stream, "%s ", name);
12189 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
12190 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
12191 used by putop and MMX/SSE operand and may be overriden by the
12192 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
12194 if (dp->prefix_requirement == PREFIX_OPCODE
12195 && dp != &bad_opcode
12197 & (PREFIX_REPZ | PREFIX_REPNZ)) != 0
12199 & (PREFIX_REPZ | PREFIX_REPNZ)) == 0)
12201 & (PREFIX_REPZ | PREFIX_REPNZ | PREFIX_DATA))
12203 && (used_prefixes & PREFIX_DATA) == 0))))
12205 (*info->fprintf_func) (info->stream, "(bad)");
12206 return end_codep - priv.the_buffer;
12209 /* Check maximum code length. */
12210 if ((codep - start_codep) > MAX_CODE_LENGTH)
12212 (*info->fprintf_func) (info->stream, "(bad)");
12213 return MAX_CODE_LENGTH;
12216 obufp = mnemonicendp;
12217 for (i = strlen (obuf) + prefix_length; i < 6; i++)
12220 (*info->fprintf_func) (info->stream, "%s", obuf);
12222 /* The enter and bound instructions are printed with operands in the same
12223 order as the intel book; everything else is printed in reverse order. */
12224 if (intel_syntax || two_source_ops)
12228 for (i = 0; i < MAX_OPERANDS; ++i)
12229 op_txt[i] = op_out[i];
12231 if (intel_syntax && dp && dp->op[2].rtn == OP_Rounding
12232 && dp->op[3].rtn == OP_E && dp->op[4].rtn == NULL)
12234 op_txt[2] = op_out[3];
12235 op_txt[3] = op_out[2];
12238 for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
12240 op_ad = op_index[i];
12241 op_index[i] = op_index[MAX_OPERANDS - 1 - i];
12242 op_index[MAX_OPERANDS - 1 - i] = op_ad;
12243 riprel = op_riprel[i];
12244 op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
12245 op_riprel[MAX_OPERANDS - 1 - i] = riprel;
12250 for (i = 0; i < MAX_OPERANDS; ++i)
12251 op_txt[MAX_OPERANDS - 1 - i] = op_out[i];
12255 for (i = 0; i < MAX_OPERANDS; ++i)
12259 (*info->fprintf_func) (info->stream, ",");
12260 if (op_index[i] != -1 && !op_riprel[i])
12261 (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info);
12263 (*info->fprintf_func) (info->stream, "%s", op_txt[i]);
12267 for (i = 0; i < MAX_OPERANDS; i++)
12268 if (op_index[i] != -1 && op_riprel[i])
12270 (*info->fprintf_func) (info->stream, " # ");
12271 (*info->print_address_func) ((bfd_vma) (start_pc + (codep - start_codep)
12272 + op_address[op_index[i]]), info);
12275 return codep - priv.the_buffer;
12278 static const char *float_mem[] = {
12353 static const unsigned char float_mem_mode[] = {
12428 #define ST { OP_ST, 0 }
12429 #define STi { OP_STi, 0 }
12431 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
12432 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
12433 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
12434 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
12435 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
12436 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
12437 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
12438 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
12439 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
12441 static const struct dis386 float_reg[][8] = {
12444 { "fadd", { ST, STi }, 0 },
12445 { "fmul", { ST, STi }, 0 },
12446 { "fcom", { STi }, 0 },
12447 { "fcomp", { STi }, 0 },
12448 { "fsub", { ST, STi }, 0 },
12449 { "fsubr", { ST, STi }, 0 },
12450 { "fdiv", { ST, STi }, 0 },
12451 { "fdivr", { ST, STi }, 0 },
12455 { "fld", { STi }, 0 },
12456 { "fxch", { STi }, 0 },
12466 { "fcmovb", { ST, STi }, 0 },
12467 { "fcmove", { ST, STi }, 0 },
12468 { "fcmovbe",{ ST, STi }, 0 },
12469 { "fcmovu", { ST, STi }, 0 },
12477 { "fcmovnb",{ ST, STi }, 0 },
12478 { "fcmovne",{ ST, STi }, 0 },
12479 { "fcmovnbe",{ ST, STi }, 0 },
12480 { "fcmovnu",{ ST, STi }, 0 },
12482 { "fucomi", { ST, STi }, 0 },
12483 { "fcomi", { ST, STi }, 0 },
12488 { "fadd", { STi, ST }, 0 },
12489 { "fmul", { STi, ST }, 0 },
12492 { "fsub{!M|r}", { STi, ST }, 0 },
12493 { "fsub{M|}", { STi, ST }, 0 },
12494 { "fdiv{!M|r}", { STi, ST }, 0 },
12495 { "fdiv{M|}", { STi, ST }, 0 },
12499 { "ffree", { STi }, 0 },
12501 { "fst", { STi }, 0 },
12502 { "fstp", { STi }, 0 },
12503 { "fucom", { STi }, 0 },
12504 { "fucomp", { STi }, 0 },
12510 { "faddp", { STi, ST }, 0 },
12511 { "fmulp", { STi, ST }, 0 },
12514 { "fsub{!M|r}p", { STi, ST }, 0 },
12515 { "fsub{M|}p", { STi, ST }, 0 },
12516 { "fdiv{!M|r}p", { STi, ST }, 0 },
12517 { "fdiv{M|}p", { STi, ST }, 0 },
12521 { "ffreep", { STi }, 0 },
12526 { "fucomip", { ST, STi }, 0 },
12527 { "fcomip", { ST, STi }, 0 },
12532 static char *fgrps[][8] = {
12535 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12540 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12545 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
12550 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
12555 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
12560 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
12565 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12570 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
12571 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
12576 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12581 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12586 swap_operand (void)
12588 mnemonicendp[0] = '.';
12589 mnemonicendp[1] = 's';
12594 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
12595 int sizeflag ATTRIBUTE_UNUSED)
12597 /* Skip mod/rm byte. */
12603 dofloat (int sizeflag)
12605 const struct dis386 *dp;
12606 unsigned char floatop;
12608 floatop = codep[-1];
12610 if (modrm.mod != 3)
12612 int fp_indx = (floatop - 0xd8) * 8 + modrm.reg;
12614 putop (float_mem[fp_indx], sizeflag);
12617 OP_E (float_mem_mode[fp_indx], sizeflag);
12620 /* Skip mod/rm byte. */
12624 dp = &float_reg[floatop - 0xd8][modrm.reg];
12625 if (dp->name == NULL)
12627 putop (fgrps[dp->op[0].bytemode][modrm.rm], sizeflag);
12629 /* Instruction fnstsw is only one with strange arg. */
12630 if (floatop == 0xdf && codep[-1] == 0xe0)
12631 strcpy (op_out[0], names16[0]);
12635 putop (dp->name, sizeflag);
12640 (*dp->op[0].rtn) (dp->op[0].bytemode, sizeflag);
12645 (*dp->op[1].rtn) (dp->op[1].bytemode, sizeflag);
12649 /* Like oappend (below), but S is a string starting with '%'.
12650 In Intel syntax, the '%' is elided. */
12652 oappend_maybe_intel (const char *s)
12654 oappend (s + intel_syntax);
12658 OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
12660 oappend_maybe_intel ("%st");
12664 OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
12666 sprintf (scratchbuf, "%%st(%d)", modrm.rm);
12667 oappend_maybe_intel (scratchbuf);
12670 /* Capital letters in template are macros. */
12672 putop (const char *in_template, int sizeflag)
12677 unsigned int l = 0, len = 1;
12680 #define SAVE_LAST(c) \
12681 if (l < len && l < sizeof (last)) \
12686 for (p = in_template; *p; p++)
12702 while (*++p != '|')
12703 if (*p == '}' || *p == '\0')
12706 /* Fall through. */
12711 while (*++p != '}')
12722 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
12726 if (l == 0 && len == 1)
12731 if (sizeflag & SUFFIX_ALWAYS)
12744 if (address_mode == mode_64bit
12745 && !(prefixes & PREFIX_ADDR))
12756 if (intel_syntax && !alt)
12758 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
12760 if (sizeflag & DFLAG)
12761 *obufp++ = intel_syntax ? 'd' : 'l';
12763 *obufp++ = intel_syntax ? 'w' : 's';
12764 used_prefixes |= (prefixes & PREFIX_DATA);
12768 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
12771 if (modrm.mod == 3)
12777 if (sizeflag & DFLAG)
12778 *obufp++ = intel_syntax ? 'd' : 'l';
12781 used_prefixes |= (prefixes & PREFIX_DATA);
12787 case 'E': /* For jcxz/jecxz */
12788 if (address_mode == mode_64bit)
12790 if (sizeflag & AFLAG)
12796 if (sizeflag & AFLAG)
12798 used_prefixes |= (prefixes & PREFIX_ADDR);
12803 if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))
12805 if (sizeflag & AFLAG)
12806 *obufp++ = address_mode == mode_64bit ? 'q' : 'l';
12808 *obufp++ = address_mode == mode_64bit ? 'l' : 'w';
12809 used_prefixes |= (prefixes & PREFIX_ADDR);
12813 if (intel_syntax || (obufp[-1] != 's' && !(sizeflag & SUFFIX_ALWAYS)))
12815 if ((rex & REX_W) || (sizeflag & DFLAG))
12819 if (!(rex & REX_W))
12820 used_prefixes |= (prefixes & PREFIX_DATA);
12825 if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS
12826 || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)
12828 used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);
12831 if (prefixes & PREFIX_DS)
12850 if (l != 0 || len != 1)
12852 if (l != 1 || len != 2 || last[0] != 'X')
12857 if (!need_vex || !vex.evex)
12860 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
12862 switch (vex.length)
12880 if (address_mode == mode_64bit && (sizeflag & SUFFIX_ALWAYS))
12885 /* Fall through. */
12888 if (l != 0 || len != 1)
12896 if (sizeflag & SUFFIX_ALWAYS)
12900 if (intel_mnemonic != cond)
12904 if ((prefixes & PREFIX_FWAIT) == 0)
12907 used_prefixes |= PREFIX_FWAIT;
12913 else if (intel_syntax && (sizeflag & DFLAG))
12917 if (!(rex & REX_W))
12918 used_prefixes |= (prefixes & PREFIX_DATA);
12922 && address_mode == mode_64bit
12923 && isa64 == intel64)
12928 /* Fall through. */
12931 && address_mode == mode_64bit
12932 && ((sizeflag & DFLAG) || (rex & REX_W)))
12937 /* Fall through. */
12940 if (l == 0 && len == 1)
12945 if ((rex & REX_W) == 0
12946 && (prefixes & PREFIX_DATA))
12948 if ((sizeflag & DFLAG) == 0)
12950 used_prefixes |= (prefixes & PREFIX_DATA);
12954 if ((prefixes & PREFIX_DATA)
12956 || (sizeflag & SUFFIX_ALWAYS))
12963 if (sizeflag & DFLAG)
12967 used_prefixes |= (prefixes & PREFIX_DATA);
12973 if (l != 1 || len != 2 || last[0] != 'L')
12979 if ((prefixes & PREFIX_DATA)
12981 || (sizeflag & SUFFIX_ALWAYS))
12988 if (sizeflag & DFLAG)
12989 *obufp++ = intel_syntax ? 'd' : 'l';
12992 used_prefixes |= (prefixes & PREFIX_DATA);
13000 if (address_mode == mode_64bit
13001 && ((sizeflag & DFLAG) || (rex & REX_W)))
13003 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
13007 /* Fall through. */
13010 if (l == 0 && len == 1)
13013 if (intel_syntax && !alt)
13016 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
13022 if (sizeflag & DFLAG)
13023 *obufp++ = intel_syntax ? 'd' : 'l';
13026 used_prefixes |= (prefixes & PREFIX_DATA);
13032 if (l != 1 || len != 2 || last[0] != 'L')
13038 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
13053 else if (sizeflag & DFLAG)
13062 if (intel_syntax && !p[1]
13063 && ((rex & REX_W) || (sizeflag & DFLAG)))
13065 if (!(rex & REX_W))
13066 used_prefixes |= (prefixes & PREFIX_DATA);
13069 if (l == 0 && len == 1)
13073 if (address_mode == mode_64bit
13074 && ((sizeflag & DFLAG) || (rex & REX_W)))
13076 if (sizeflag & SUFFIX_ALWAYS)
13098 /* Fall through. */
13101 if (l == 0 && len == 1)
13106 if (sizeflag & SUFFIX_ALWAYS)
13112 if (sizeflag & DFLAG)
13116 used_prefixes |= (prefixes & PREFIX_DATA);
13130 if (address_mode == mode_64bit
13131 && !(prefixes & PREFIX_ADDR))
13142 if (l != 0 || len != 1)
13147 if (need_vex && vex.prefix)
13149 if (vex.prefix == DATA_PREFIX_OPCODE)
13156 if (prefixes & PREFIX_DATA)
13160 used_prefixes |= (prefixes & PREFIX_DATA);
13164 if (l == 0 && len == 1)
13168 if (l != 1 || len != 2 || last[0] != 'X')
13176 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
13178 switch (vex.length)
13194 if (l == 0 && len == 1)
13196 /* operand size flag for cwtl, cbtw */
13205 else if (sizeflag & DFLAG)
13209 if (!(rex & REX_W))
13210 used_prefixes |= (prefixes & PREFIX_DATA);
13217 && last[0] != 'L'))
13224 if (last[0] == 'X')
13225 *obufp++ = vex.w ? 'd': 's';
13227 *obufp++ = vex.w ? 'q': 'd';
13233 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
13235 if (sizeflag & DFLAG)
13239 used_prefixes |= (prefixes & PREFIX_DATA);
13245 if (address_mode == mode_64bit
13246 && (isa64 == intel64
13247 || ((sizeflag & DFLAG) || (rex & REX_W))))
13249 else if ((prefixes & PREFIX_DATA))
13251 if (!(sizeflag & DFLAG))
13253 used_prefixes |= (prefixes & PREFIX_DATA);
13260 mnemonicendp = obufp;
13265 oappend (const char *s)
13267 obufp = stpcpy (obufp, s);
13273 /* Only print the active segment register. */
13274 if (!active_seg_prefix)
13277 used_prefixes |= active_seg_prefix;
13278 switch (active_seg_prefix)
13281 oappend_maybe_intel ("%cs:");
13284 oappend_maybe_intel ("%ds:");
13287 oappend_maybe_intel ("%ss:");
13290 oappend_maybe_intel ("%es:");
13293 oappend_maybe_intel ("%fs:");
13296 oappend_maybe_intel ("%gs:");
13304 OP_indirE (int bytemode, int sizeflag)
13308 OP_E (bytemode, sizeflag);
13312 print_operand_value (char *buf, int hex, bfd_vma disp)
13314 if (address_mode == mode_64bit)
13322 sprintf_vma (tmp, disp);
13323 for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
13324 strcpy (buf + 2, tmp + i);
13328 bfd_signed_vma v = disp;
13335 /* Check for possible overflow on 0x8000000000000000. */
13338 strcpy (buf, "9223372036854775808");
13352 tmp[28 - i] = (v % 10) + '0';
13356 strcpy (buf, tmp + 29 - i);
13362 sprintf (buf, "0x%x", (unsigned int) disp);
13364 sprintf (buf, "%d", (int) disp);
13368 /* Put DISP in BUF as signed hex number. */
13371 print_displacement (char *buf, bfd_vma disp)
13373 bfd_signed_vma val = disp;
13382 /* Check for possible overflow. */
13385 switch (address_mode)
13388 strcpy (buf + j, "0x8000000000000000");
13391 strcpy (buf + j, "0x80000000");
13394 strcpy (buf + j, "0x8000");
13404 sprintf_vma (tmp, (bfd_vma) val);
13405 for (i = 0; tmp[i] == '0'; i++)
13407 if (tmp[i] == '\0')
13409 strcpy (buf + j, tmp + i);
13413 intel_operand_size (int bytemode, int sizeflag)
13417 && (bytemode == x_mode
13418 || bytemode == evex_half_bcst_xmmq_mode))
13421 oappend ("QWORD PTR ");
13423 oappend ("DWORD PTR ");
13432 oappend ("BYTE PTR ");
13437 oappend ("WORD PTR ");
13440 if (address_mode == mode_64bit && isa64 == intel64)
13442 oappend ("QWORD PTR ");
13445 /* Fall through. */
13447 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
13449 oappend ("QWORD PTR ");
13452 /* Fall through. */
13458 oappend ("QWORD PTR ");
13461 if ((sizeflag & DFLAG) || bytemode == dq_mode)
13462 oappend ("DWORD PTR ");
13464 oappend ("WORD PTR ");
13465 used_prefixes |= (prefixes & PREFIX_DATA);
13469 if ((rex & REX_W) || (sizeflag & DFLAG))
13471 oappend ("WORD PTR ");
13472 if (!(rex & REX_W))
13473 used_prefixes |= (prefixes & PREFIX_DATA);
13476 if (sizeflag & DFLAG)
13477 oappend ("QWORD PTR ");
13479 oappend ("DWORD PTR ");
13480 used_prefixes |= (prefixes & PREFIX_DATA);
13483 case d_scalar_mode:
13484 case d_scalar_swap_mode:
13487 oappend ("DWORD PTR ");
13490 case q_scalar_mode:
13491 case q_scalar_swap_mode:
13493 oappend ("QWORD PTR ");
13497 if (address_mode == mode_64bit)
13498 oappend ("QWORD PTR ");
13500 oappend ("DWORD PTR ");
13503 if (sizeflag & DFLAG)
13504 oappend ("FWORD PTR ");
13506 oappend ("DWORD PTR ");
13507 used_prefixes |= (prefixes & PREFIX_DATA);
13510 oappend ("TBYTE PTR ");
13514 case evex_x_gscat_mode:
13515 case evex_x_nobcst_mode:
13516 case b_scalar_mode:
13517 case w_scalar_mode:
13520 switch (vex.length)
13523 oappend ("XMMWORD PTR ");
13526 oappend ("YMMWORD PTR ");
13529 oappend ("ZMMWORD PTR ");
13536 oappend ("XMMWORD PTR ");
13539 oappend ("XMMWORD PTR ");
13542 oappend ("YMMWORD PTR ");
13545 case evex_half_bcst_xmmq_mode:
13549 switch (vex.length)
13552 oappend ("QWORD PTR ");
13555 oappend ("XMMWORD PTR ");
13558 oappend ("YMMWORD PTR ");
13568 switch (vex.length)
13573 oappend ("BYTE PTR ");
13583 switch (vex.length)
13588 oappend ("WORD PTR ");
13598 switch (vex.length)
13603 oappend ("DWORD PTR ");
13613 switch (vex.length)
13618 oappend ("QWORD PTR ");
13628 switch (vex.length)
13631 oappend ("WORD PTR ");
13634 oappend ("DWORD PTR ");
13637 oappend ("QWORD PTR ");
13647 switch (vex.length)
13650 oappend ("DWORD PTR ");
13653 oappend ("QWORD PTR ");
13656 oappend ("XMMWORD PTR ");
13666 switch (vex.length)
13669 oappend ("QWORD PTR ");
13672 oappend ("YMMWORD PTR ");
13675 oappend ("ZMMWORD PTR ");
13685 switch (vex.length)
13689 oappend ("XMMWORD PTR ");
13696 oappend ("OWORD PTR ");
13699 case vex_w_dq_mode:
13700 case vex_scalar_w_dq_mode:
13705 oappend ("QWORD PTR ");
13707 oappend ("DWORD PTR ");
13709 case vex_vsib_d_w_dq_mode:
13710 case vex_vsib_q_w_dq_mode:
13717 oappend ("QWORD PTR ");
13719 oappend ("DWORD PTR ");
13723 switch (vex.length)
13726 oappend ("XMMWORD PTR ");
13729 oappend ("YMMWORD PTR ");
13732 oappend ("ZMMWORD PTR ");
13739 case vex_vsib_q_w_d_mode:
13740 case vex_vsib_d_w_d_mode:
13741 if (!need_vex || !vex.evex)
13744 switch (vex.length)
13747 oappend ("QWORD PTR ");
13750 oappend ("XMMWORD PTR ");
13753 oappend ("YMMWORD PTR ");
13761 if (!need_vex || vex.length != 128)
13764 oappend ("DWORD PTR ");
13766 oappend ("BYTE PTR ");
13772 oappend ("QWORD PTR ");
13774 oappend ("WORD PTR ");
13784 OP_E_register (int bytemode, int sizeflag)
13786 int reg = modrm.rm;
13787 const char **names;
13793 if ((sizeflag & SUFFIX_ALWAYS)
13794 && (bytemode == b_swap_mode
13795 || bytemode == bnd_swap_mode
13796 || bytemode == v_swap_mode))
13822 names = address_mode == mode_64bit ? names64 : names32;
13825 case bnd_swap_mode:
13834 if (address_mode == mode_64bit && isa64 == intel64)
13839 /* Fall through. */
13841 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
13847 /* Fall through. */
13860 if ((sizeflag & DFLAG)
13861 || (bytemode != v_mode
13862 && bytemode != v_swap_mode))
13866 used_prefixes |= (prefixes & PREFIX_DATA);
13870 names = (address_mode == mode_64bit
13871 ? names64 : names32);
13872 if (!(prefixes & PREFIX_ADDR))
13873 names = (address_mode == mode_16bit
13874 ? names16 : names);
13877 /* Remove "addr16/addr32". */
13878 all_prefixes[last_addr_prefix] = 0;
13879 names = (address_mode != mode_32bit
13880 ? names32 : names16);
13881 used_prefixes |= PREFIX_ADDR;
13891 names = names_mask;
13896 oappend (INTERNAL_DISASSEMBLER_ERROR);
13899 oappend (names[reg]);
13903 OP_E_memory (int bytemode, int sizeflag)
13906 int add = (rex & REX_B) ? 8 : 0;
13912 /* In EVEX, if operand doesn't allow broadcast, vex.b should be 0. */
13914 && bytemode != x_mode
13915 && bytemode != xmmq_mode
13916 && bytemode != evex_half_bcst_xmmq_mode)
13932 if (address_mode != mode_64bit)
13938 case vex_vsib_d_w_dq_mode:
13939 case vex_vsib_d_w_d_mode:
13940 case vex_vsib_q_w_dq_mode:
13941 case vex_vsib_q_w_d_mode:
13942 case evex_x_gscat_mode:
13944 shift = vex.w ? 3 : 2;
13947 case evex_half_bcst_xmmq_mode:
13951 shift = vex.w ? 3 : 2;
13954 /* Fall through. */
13958 case evex_x_nobcst_mode:
13960 switch (vex.length)
13983 case q_scalar_mode:
13985 case q_scalar_swap_mode:
13991 case d_scalar_mode:
13993 case d_scalar_swap_mode:
13996 case w_scalar_mode:
14000 case b_scalar_mode:
14005 shift = address_mode == mode_64bit ? 3 : 2;
14010 /* Make necessary corrections to shift for modes that need it.
14011 For these modes we currently have shift 4, 5 or 6 depending on
14012 vex.length (it corresponds to xmmword, ymmword or zmmword
14013 operand). We might want to make it 3, 4 or 5 (e.g. for
14014 xmmq_mode). In case of broadcast enabled the corrections
14015 aren't needed, as element size is always 32 or 64 bits. */
14017 && (bytemode == xmmq_mode
14018 || bytemode == evex_half_bcst_xmmq_mode))
14020 else if (bytemode == xmmqd_mode)
14022 else if (bytemode == xmmdw_mode)
14024 else if (bytemode == ymmq_mode && vex.length == 128)
14032 intel_operand_size (bytemode, sizeflag);
14035 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
14037 /* 32/64 bit address mode */
14047 int addr32flag = !((sizeflag & AFLAG)
14048 || bytemode == v_bnd_mode
14049 || bytemode == v_bndmk_mode
14050 || bytemode == bnd_mode
14051 || bytemode == bnd_swap_mode);
14052 const char **indexes64 = names64;
14053 const char **indexes32 = names32;
14063 vindex = sib.index;
14069 case vex_vsib_d_w_dq_mode:
14070 case vex_vsib_d_w_d_mode:
14071 case vex_vsib_q_w_dq_mode:
14072 case vex_vsib_q_w_d_mode:
14082 switch (vex.length)
14085 indexes64 = indexes32 = names_xmm;
14089 || bytemode == vex_vsib_q_w_dq_mode
14090 || bytemode == vex_vsib_q_w_d_mode)
14091 indexes64 = indexes32 = names_ymm;
14093 indexes64 = indexes32 = names_xmm;
14097 || bytemode == vex_vsib_q_w_dq_mode
14098 || bytemode == vex_vsib_q_w_d_mode)
14099 indexes64 = indexes32 = names_zmm;
14101 indexes64 = indexes32 = names_ymm;
14108 haveindex = vindex != 4;
14115 rbase = base + add;
14123 if (address_mode == mode_64bit && !havesib)
14126 if (riprel && bytemode == v_bndmk_mode)
14134 FETCH_DATA (the_info, codep + 1);
14136 if ((disp & 0x80) != 0)
14138 if (vex.evex && shift > 0)
14151 && address_mode != mode_16bit)
14153 if (address_mode == mode_64bit)
14155 /* Display eiz instead of addr32. */
14156 needindex = addr32flag;
14161 /* In 32-bit mode, we need index register to tell [offset]
14162 from [eiz*1 + offset]. */
14167 havedisp = (havebase
14169 || (havesib && (haveindex || scale != 0)));
14172 if (modrm.mod != 0 || base == 5)
14174 if (havedisp || riprel)
14175 print_displacement (scratchbuf, disp);
14177 print_operand_value (scratchbuf, 1, disp);
14178 oappend (scratchbuf);
14182 oappend (!addr32flag ? "(%rip)" : "(%eip)");
14186 if ((havebase || haveindex || needaddr32 || riprel)
14187 && (bytemode != v_bnd_mode)
14188 && (bytemode != v_bndmk_mode)
14189 && (bytemode != bnd_mode)
14190 && (bytemode != bnd_swap_mode))
14191 used_prefixes |= PREFIX_ADDR;
14193 if (havedisp || (intel_syntax && riprel))
14195 *obufp++ = open_char;
14196 if (intel_syntax && riprel)
14199 oappend (!addr32flag ? "rip" : "eip");
14203 oappend (address_mode == mode_64bit && !addr32flag
14204 ? names64[rbase] : names32[rbase]);
14207 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
14208 print index to tell base + index from base. */
14212 || (havebase && base != ESP_REG_NUM))
14214 if (!intel_syntax || havebase)
14216 *obufp++ = separator_char;
14220 oappend (address_mode == mode_64bit && !addr32flag
14221 ? indexes64[vindex] : indexes32[vindex]);
14223 oappend (address_mode == mode_64bit && !addr32flag
14224 ? index64 : index32);
14226 *obufp++ = scale_char;
14228 sprintf (scratchbuf, "%d", 1 << scale);
14229 oappend (scratchbuf);
14233 && (disp || modrm.mod != 0 || base == 5))
14235 if (!havedisp || (bfd_signed_vma) disp >= 0)
14240 else if (modrm.mod != 1 && disp != -disp)
14244 disp = - (bfd_signed_vma) disp;
14248 print_displacement (scratchbuf, disp);
14250 print_operand_value (scratchbuf, 1, disp);
14251 oappend (scratchbuf);
14254 *obufp++ = close_char;
14257 else if (intel_syntax)
14259 if (modrm.mod != 0 || base == 5)
14261 if (!active_seg_prefix)
14263 oappend (names_seg[ds_reg - es_reg]);
14266 print_operand_value (scratchbuf, 1, disp);
14267 oappend (scratchbuf);
14273 /* 16 bit address mode */
14274 used_prefixes |= prefixes & PREFIX_ADDR;
14281 if ((disp & 0x8000) != 0)
14286 FETCH_DATA (the_info, codep + 1);
14288 if ((disp & 0x80) != 0)
14290 if (vex.evex && shift > 0)
14295 if ((disp & 0x8000) != 0)
14301 if (modrm.mod != 0 || modrm.rm == 6)
14303 print_displacement (scratchbuf, disp);
14304 oappend (scratchbuf);
14307 if (modrm.mod != 0 || modrm.rm != 6)
14309 *obufp++ = open_char;
14311 oappend (index16[modrm.rm]);
14313 && (disp || modrm.mod != 0 || modrm.rm == 6))
14315 if ((bfd_signed_vma) disp >= 0)
14320 else if (modrm.mod != 1)
14324 disp = - (bfd_signed_vma) disp;
14327 print_displacement (scratchbuf, disp);
14328 oappend (scratchbuf);
14331 *obufp++ = close_char;
14334 else if (intel_syntax)
14336 if (!active_seg_prefix)
14338 oappend (names_seg[ds_reg - es_reg]);
14341 print_operand_value (scratchbuf, 1, disp & 0xffff);
14342 oappend (scratchbuf);
14345 if (vex.evex && vex.b
14346 && (bytemode == x_mode
14347 || bytemode == xmmq_mode
14348 || bytemode == evex_half_bcst_xmmq_mode))
14351 || bytemode == xmmq_mode
14352 || bytemode == evex_half_bcst_xmmq_mode)
14354 switch (vex.length)
14357 oappend ("{1to2}");
14360 oappend ("{1to4}");
14363 oappend ("{1to8}");
14371 switch (vex.length)
14374 oappend ("{1to4}");
14377 oappend ("{1to8}");
14380 oappend ("{1to16}");
14390 OP_E (int bytemode, int sizeflag)
14392 /* Skip mod/rm byte. */
14396 if (modrm.mod == 3)
14397 OP_E_register (bytemode, sizeflag);
14399 OP_E_memory (bytemode, sizeflag);
14403 OP_G (int bytemode, int sizeflag)
14406 const char **names;
14415 oappend (names8rex[modrm.reg + add]);
14417 oappend (names8[modrm.reg + add]);
14420 oappend (names16[modrm.reg + add]);
14425 oappend (names32[modrm.reg + add]);
14428 oappend (names64[modrm.reg + add]);
14431 if (modrm.reg > 0x3)
14436 oappend (names_bnd[modrm.reg]);
14445 oappend (names64[modrm.reg + add]);
14448 if ((sizeflag & DFLAG) || bytemode != v_mode)
14449 oappend (names32[modrm.reg + add]);
14451 oappend (names16[modrm.reg + add]);
14452 used_prefixes |= (prefixes & PREFIX_DATA);
14456 names = (address_mode == mode_64bit
14457 ? names64 : names32);
14458 if (!(prefixes & PREFIX_ADDR))
14460 if (address_mode == mode_16bit)
14465 /* Remove "addr16/addr32". */
14466 all_prefixes[last_addr_prefix] = 0;
14467 names = (address_mode != mode_32bit
14468 ? names32 : names16);
14469 used_prefixes |= PREFIX_ADDR;
14471 oappend (names[modrm.reg + add]);
14474 if (address_mode == mode_64bit)
14475 oappend (names64[modrm.reg + add]);
14477 oappend (names32[modrm.reg + add]);
14481 if ((modrm.reg + add) > 0x7)
14486 oappend (names_mask[modrm.reg + add]);
14489 oappend (INTERNAL_DISASSEMBLER_ERROR);
14502 FETCH_DATA (the_info, codep + 8);
14503 a = *codep++ & 0xff;
14504 a |= (*codep++ & 0xff) << 8;
14505 a |= (*codep++ & 0xff) << 16;
14506 a |= (*codep++ & 0xffu) << 24;
14507 b = *codep++ & 0xff;
14508 b |= (*codep++ & 0xff) << 8;
14509 b |= (*codep++ & 0xff) << 16;
14510 b |= (*codep++ & 0xffu) << 24;
14511 x = a + ((bfd_vma) b << 32);
14519 static bfd_signed_vma
14522 bfd_signed_vma x = 0;
14524 FETCH_DATA (the_info, codep + 4);
14525 x = *codep++ & (bfd_signed_vma) 0xff;
14526 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
14527 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
14528 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
14532 static bfd_signed_vma
14535 bfd_signed_vma x = 0;
14537 FETCH_DATA (the_info, codep + 4);
14538 x = *codep++ & (bfd_signed_vma) 0xff;
14539 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
14540 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
14541 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
14543 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
14553 FETCH_DATA (the_info, codep + 2);
14554 x = *codep++ & 0xff;
14555 x |= (*codep++ & 0xff) << 8;
14560 set_op (bfd_vma op, int riprel)
14562 op_index[op_ad] = op_ad;
14563 if (address_mode == mode_64bit)
14565 op_address[op_ad] = op;
14566 op_riprel[op_ad] = riprel;
14570 /* Mask to get a 32-bit address. */
14571 op_address[op_ad] = op & 0xffffffff;
14572 op_riprel[op_ad] = riprel & 0xffffffff;
14577 OP_REG (int code, int sizeflag)
14584 case es_reg: case ss_reg: case cs_reg:
14585 case ds_reg: case fs_reg: case gs_reg:
14586 oappend (names_seg[code - es_reg]);
14598 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
14599 case sp_reg: case bp_reg: case si_reg: case di_reg:
14600 s = names16[code - ax_reg + add];
14602 case al_reg: case ah_reg: case cl_reg: case ch_reg:
14603 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
14606 s = names8rex[code - al_reg + add];
14608 s = names8[code - al_reg];
14610 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
14611 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
14612 if (address_mode == mode_64bit
14613 && ((sizeflag & DFLAG) || (rex & REX_W)))
14615 s = names64[code - rAX_reg + add];
14618 code += eAX_reg - rAX_reg;
14619 /* Fall through. */
14620 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
14621 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
14624 s = names64[code - eAX_reg + add];
14627 if (sizeflag & DFLAG)
14628 s = names32[code - eAX_reg + add];
14630 s = names16[code - eAX_reg + add];
14631 used_prefixes |= (prefixes & PREFIX_DATA);
14635 s = INTERNAL_DISASSEMBLER_ERROR;
14642 OP_IMREG (int code, int sizeflag)
14654 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
14655 case sp_reg: case bp_reg: case si_reg: case di_reg:
14656 s = names16[code - ax_reg];
14658 case es_reg: case ss_reg: case cs_reg:
14659 case ds_reg: case fs_reg: case gs_reg:
14660 s = names_seg[code - es_reg];
14662 case al_reg: case ah_reg: case cl_reg: case ch_reg:
14663 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
14666 s = names8rex[code - al_reg];
14668 s = names8[code - al_reg];
14670 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
14671 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
14674 s = names64[code - eAX_reg];
14677 if (sizeflag & DFLAG)
14678 s = names32[code - eAX_reg];
14680 s = names16[code - eAX_reg];
14681 used_prefixes |= (prefixes & PREFIX_DATA);
14684 case z_mode_ax_reg:
14685 if ((rex & REX_W) || (sizeflag & DFLAG))
14689 if (!(rex & REX_W))
14690 used_prefixes |= (prefixes & PREFIX_DATA);
14693 s = INTERNAL_DISASSEMBLER_ERROR;
14700 OP_I (int bytemode, int sizeflag)
14703 bfd_signed_vma mask = -1;
14708 FETCH_DATA (the_info, codep + 1);
14713 if (address_mode == mode_64bit)
14718 /* Fall through. */
14725 if (sizeflag & DFLAG)
14735 used_prefixes |= (prefixes & PREFIX_DATA);
14747 oappend (INTERNAL_DISASSEMBLER_ERROR);
14752 scratchbuf[0] = '$';
14753 print_operand_value (scratchbuf + 1, 1, op);
14754 oappend_maybe_intel (scratchbuf);
14755 scratchbuf[0] = '\0';
14759 OP_I64 (int bytemode, int sizeflag)
14762 bfd_signed_vma mask = -1;
14764 if (address_mode != mode_64bit)
14766 OP_I (bytemode, sizeflag);
14773 FETCH_DATA (the_info, codep + 1);
14783 if (sizeflag & DFLAG)
14793 used_prefixes |= (prefixes & PREFIX_DATA);
14801 oappend (INTERNAL_DISASSEMBLER_ERROR);
14806 scratchbuf[0] = '$';
14807 print_operand_value (scratchbuf + 1, 1, op);
14808 oappend_maybe_intel (scratchbuf);
14809 scratchbuf[0] = '\0';
14813 OP_sI (int bytemode, int sizeflag)
14821 FETCH_DATA (the_info, codep + 1);
14823 if ((op & 0x80) != 0)
14825 if (bytemode == b_T_mode)
14827 if (address_mode != mode_64bit
14828 || !((sizeflag & DFLAG) || (rex & REX_W)))
14830 /* The operand-size prefix is overridden by a REX prefix. */
14831 if ((sizeflag & DFLAG) || (rex & REX_W))
14839 if (!(rex & REX_W))
14841 if (sizeflag & DFLAG)
14849 /* The operand-size prefix is overridden by a REX prefix. */
14850 if ((sizeflag & DFLAG) || (rex & REX_W))
14856 oappend (INTERNAL_DISASSEMBLER_ERROR);
14860 scratchbuf[0] = '$';
14861 print_operand_value (scratchbuf + 1, 1, op);
14862 oappend_maybe_intel (scratchbuf);
14866 OP_J (int bytemode, int sizeflag)
14870 bfd_vma segment = 0;
14875 FETCH_DATA (the_info, codep + 1);
14877 if ((disp & 0x80) != 0)
14881 if (isa64 == amd64)
14883 if ((sizeflag & DFLAG)
14884 || (address_mode == mode_64bit
14885 && (isa64 != amd64 || (rex & REX_W))))
14890 if ((disp & 0x8000) != 0)
14892 /* In 16bit mode, address is wrapped around at 64k within
14893 the same segment. Otherwise, a data16 prefix on a jump
14894 instruction means that the pc is masked to 16 bits after
14895 the displacement is added! */
14897 if ((prefixes & PREFIX_DATA) == 0)
14898 segment = ((start_pc + (codep - start_codep))
14899 & ~((bfd_vma) 0xffff));
14901 if (address_mode != mode_64bit
14902 || (isa64 == amd64 && !(rex & REX_W)))
14903 used_prefixes |= (prefixes & PREFIX_DATA);
14906 oappend (INTERNAL_DISASSEMBLER_ERROR);
14909 disp = ((start_pc + (codep - start_codep) + disp) & mask) | segment;
14911 print_operand_value (scratchbuf, 1, disp);
14912 oappend (scratchbuf);
14916 OP_SEG (int bytemode, int sizeflag)
14918 if (bytemode == w_mode)
14919 oappend (names_seg[modrm.reg]);
14921 OP_E (modrm.mod == 3 ? bytemode : w_mode, sizeflag);
14925 OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
14929 if (sizeflag & DFLAG)
14939 used_prefixes |= (prefixes & PREFIX_DATA);
14941 sprintf (scratchbuf, "0x%x:0x%x", seg, offset);
14943 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
14944 oappend (scratchbuf);
14948 OP_OFF (int bytemode, int sizeflag)
14952 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
14953 intel_operand_size (bytemode, sizeflag);
14956 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
14963 if (!active_seg_prefix)
14965 oappend (names_seg[ds_reg - es_reg]);
14969 print_operand_value (scratchbuf, 1, off);
14970 oappend (scratchbuf);
14974 OP_OFF64 (int bytemode, int sizeflag)
14978 if (address_mode != mode_64bit
14979 || (prefixes & PREFIX_ADDR))
14981 OP_OFF (bytemode, sizeflag);
14985 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
14986 intel_operand_size (bytemode, sizeflag);
14993 if (!active_seg_prefix)
14995 oappend (names_seg[ds_reg - es_reg]);
14999 print_operand_value (scratchbuf, 1, off);
15000 oappend (scratchbuf);
15004 ptr_reg (int code, int sizeflag)
15008 *obufp++ = open_char;
15009 used_prefixes |= (prefixes & PREFIX_ADDR);
15010 if (address_mode == mode_64bit)
15012 if (!(sizeflag & AFLAG))
15013 s = names32[code - eAX_reg];
15015 s = names64[code - eAX_reg];
15017 else if (sizeflag & AFLAG)
15018 s = names32[code - eAX_reg];
15020 s = names16[code - eAX_reg];
15022 *obufp++ = close_char;
15027 OP_ESreg (int code, int sizeflag)
15033 case 0x6d: /* insw/insl */
15034 intel_operand_size (z_mode, sizeflag);
15036 case 0xa5: /* movsw/movsl/movsq */
15037 case 0xa7: /* cmpsw/cmpsl/cmpsq */
15038 case 0xab: /* stosw/stosl */
15039 case 0xaf: /* scasw/scasl */
15040 intel_operand_size (v_mode, sizeflag);
15043 intel_operand_size (b_mode, sizeflag);
15046 oappend_maybe_intel ("%es:");
15047 ptr_reg (code, sizeflag);
15051 OP_DSreg (int code, int sizeflag)
15057 case 0x6f: /* outsw/outsl */
15058 intel_operand_size (z_mode, sizeflag);
15060 case 0xa5: /* movsw/movsl/movsq */
15061 case 0xa7: /* cmpsw/cmpsl/cmpsq */
15062 case 0xad: /* lodsw/lodsl/lodsq */
15063 intel_operand_size (v_mode, sizeflag);
15066 intel_operand_size (b_mode, sizeflag);
15069 /* Set active_seg_prefix to PREFIX_DS if it is unset so that the
15070 default segment register DS is printed. */
15071 if (!active_seg_prefix)
15072 active_seg_prefix = PREFIX_DS;
15074 ptr_reg (code, sizeflag);
15078 OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15086 else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
15088 all_prefixes[last_lock_prefix] = 0;
15089 used_prefixes |= PREFIX_LOCK;
15094 sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
15095 oappend_maybe_intel (scratchbuf);
15099 OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15108 sprintf (scratchbuf, "db%d", modrm.reg + add);
15110 sprintf (scratchbuf, "%%db%d", modrm.reg + add);
15111 oappend (scratchbuf);
15115 OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15117 sprintf (scratchbuf, "%%tr%d", modrm.reg);
15118 oappend_maybe_intel (scratchbuf);
15122 OP_R (int bytemode, int sizeflag)
15124 /* Skip mod/rm byte. */
15127 OP_E_register (bytemode, sizeflag);
15131 OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15133 int reg = modrm.reg;
15134 const char **names;
15136 used_prefixes |= (prefixes & PREFIX_DATA);
15137 if (prefixes & PREFIX_DATA)
15146 oappend (names[reg]);
15150 OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
15152 int reg = modrm.reg;
15153 const char **names;
15165 && bytemode != xmm_mode
15166 && bytemode != xmmq_mode
15167 && bytemode != evex_half_bcst_xmmq_mode
15168 && bytemode != ymm_mode
15169 && bytemode != scalar_mode)
15171 switch (vex.length)
15178 || (bytemode != vex_vsib_q_w_dq_mode
15179 && bytemode != vex_vsib_q_w_d_mode))
15191 else if (bytemode == xmmq_mode
15192 || bytemode == evex_half_bcst_xmmq_mode)
15194 switch (vex.length)
15207 else if (bytemode == ymm_mode)
15211 oappend (names[reg]);
15215 OP_EM (int bytemode, int sizeflag)
15218 const char **names;
15220 if (modrm.mod != 3)
15223 && (bytemode == v_mode || bytemode == v_swap_mode))
15225 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
15226 used_prefixes |= (prefixes & PREFIX_DATA);
15228 OP_E (bytemode, sizeflag);
15232 if ((sizeflag & SUFFIX_ALWAYS) && bytemode == v_swap_mode)
15235 /* Skip mod/rm byte. */
15238 used_prefixes |= (prefixes & PREFIX_DATA);
15240 if (prefixes & PREFIX_DATA)
15249 oappend (names[reg]);
15252 /* cvt* are the only instructions in sse2 which have
15253 both SSE and MMX operands and also have 0x66 prefix
15254 in their opcode. 0x66 was originally used to differentiate
15255 between SSE and MMX instruction(operands). So we have to handle the
15256 cvt* separately using OP_EMC and OP_MXC */
15258 OP_EMC (int bytemode, int sizeflag)
15260 if (modrm.mod != 3)
15262 if (intel_syntax && bytemode == v_mode)
15264 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
15265 used_prefixes |= (prefixes & PREFIX_DATA);
15267 OP_E (bytemode, sizeflag);
15271 /* Skip mod/rm byte. */
15274 used_prefixes |= (prefixes & PREFIX_DATA);
15275 oappend (names_mm[modrm.rm]);
15279 OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15281 used_prefixes |= (prefixes & PREFIX_DATA);
15282 oappend (names_mm[modrm.reg]);
15286 OP_EX (int bytemode, int sizeflag)
15289 const char **names;
15291 /* Skip mod/rm byte. */
15295 if (modrm.mod != 3)
15297 OP_E_memory (bytemode, sizeflag);
15312 if ((sizeflag & SUFFIX_ALWAYS)
15313 && (bytemode == x_swap_mode
15314 || bytemode == d_swap_mode
15315 || bytemode == d_scalar_swap_mode
15316 || bytemode == q_swap_mode
15317 || bytemode == q_scalar_swap_mode))
15321 && bytemode != xmm_mode
15322 && bytemode != xmmdw_mode
15323 && bytemode != xmmqd_mode
15324 && bytemode != xmm_mb_mode
15325 && bytemode != xmm_mw_mode
15326 && bytemode != xmm_md_mode
15327 && bytemode != xmm_mq_mode
15328 && bytemode != xmm_mdq_mode
15329 && bytemode != xmmq_mode
15330 && bytemode != evex_half_bcst_xmmq_mode
15331 && bytemode != ymm_mode
15332 && bytemode != d_scalar_mode
15333 && bytemode != d_scalar_swap_mode
15334 && bytemode != q_scalar_mode
15335 && bytemode != q_scalar_swap_mode
15336 && bytemode != vex_scalar_w_dq_mode)
15338 switch (vex.length)
15353 else if (bytemode == xmmq_mode
15354 || bytemode == evex_half_bcst_xmmq_mode)
15356 switch (vex.length)
15369 else if (bytemode == ymm_mode)
15373 oappend (names[reg]);
15377 OP_MS (int bytemode, int sizeflag)
15379 if (modrm.mod == 3)
15380 OP_EM (bytemode, sizeflag);
15386 OP_XS (int bytemode, int sizeflag)
15388 if (modrm.mod == 3)
15389 OP_EX (bytemode, sizeflag);
15395 OP_M (int bytemode, int sizeflag)
15397 if (modrm.mod == 3)
15398 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
15401 OP_E (bytemode, sizeflag);
15405 OP_0f07 (int bytemode, int sizeflag)
15407 if (modrm.mod != 3 || modrm.rm != 0)
15410 OP_E (bytemode, sizeflag);
15413 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
15414 32bit mode and "xchg %rax,%rax" in 64bit mode. */
15417 NOP_Fixup1 (int bytemode, int sizeflag)
15419 if ((prefixes & PREFIX_DATA) != 0
15422 && address_mode == mode_64bit))
15423 OP_REG (bytemode, sizeflag);
15425 strcpy (obuf, "nop");
15429 NOP_Fixup2 (int bytemode, int sizeflag)
15431 if ((prefixes & PREFIX_DATA) != 0
15434 && address_mode == mode_64bit))
15435 OP_IMREG (bytemode, sizeflag);
15438 static const char *const Suffix3DNow[] = {
15439 /* 00 */ NULL, NULL, NULL, NULL,
15440 /* 04 */ NULL, NULL, NULL, NULL,
15441 /* 08 */ NULL, NULL, NULL, NULL,
15442 /* 0C */ "pi2fw", "pi2fd", NULL, NULL,
15443 /* 10 */ NULL, NULL, NULL, NULL,
15444 /* 14 */ NULL, NULL, NULL, NULL,
15445 /* 18 */ NULL, NULL, NULL, NULL,
15446 /* 1C */ "pf2iw", "pf2id", NULL, NULL,
15447 /* 20 */ NULL, NULL, NULL, NULL,
15448 /* 24 */ NULL, NULL, NULL, NULL,
15449 /* 28 */ NULL, NULL, NULL, NULL,
15450 /* 2C */ NULL, NULL, NULL, NULL,
15451 /* 30 */ NULL, NULL, NULL, NULL,
15452 /* 34 */ NULL, NULL, NULL, NULL,
15453 /* 38 */ NULL, NULL, NULL, NULL,
15454 /* 3C */ NULL, NULL, NULL, NULL,
15455 /* 40 */ NULL, NULL, NULL, NULL,
15456 /* 44 */ NULL, NULL, NULL, NULL,
15457 /* 48 */ NULL, NULL, NULL, NULL,
15458 /* 4C */ NULL, NULL, NULL, NULL,
15459 /* 50 */ NULL, NULL, NULL, NULL,
15460 /* 54 */ NULL, NULL, NULL, NULL,
15461 /* 58 */ NULL, NULL, NULL, NULL,
15462 /* 5C */ NULL, NULL, NULL, NULL,
15463 /* 60 */ NULL, NULL, NULL, NULL,
15464 /* 64 */ NULL, NULL, NULL, NULL,
15465 /* 68 */ NULL, NULL, NULL, NULL,
15466 /* 6C */ NULL, NULL, NULL, NULL,
15467 /* 70 */ NULL, NULL, NULL, NULL,
15468 /* 74 */ NULL, NULL, NULL, NULL,
15469 /* 78 */ NULL, NULL, NULL, NULL,
15470 /* 7C */ NULL, NULL, NULL, NULL,
15471 /* 80 */ NULL, NULL, NULL, NULL,
15472 /* 84 */ NULL, NULL, NULL, NULL,
15473 /* 88 */ NULL, NULL, "pfnacc", NULL,
15474 /* 8C */ NULL, NULL, "pfpnacc", NULL,
15475 /* 90 */ "pfcmpge", NULL, NULL, NULL,
15476 /* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",
15477 /* 98 */ NULL, NULL, "pfsub", NULL,
15478 /* 9C */ NULL, NULL, "pfadd", NULL,
15479 /* A0 */ "pfcmpgt", NULL, NULL, NULL,
15480 /* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",
15481 /* A8 */ NULL, NULL, "pfsubr", NULL,
15482 /* AC */ NULL, NULL, "pfacc", NULL,
15483 /* B0 */ "pfcmpeq", NULL, NULL, NULL,
15484 /* B4 */ "pfmul", NULL, "pfrcpit2", "pmulhrw",
15485 /* B8 */ NULL, NULL, NULL, "pswapd",
15486 /* BC */ NULL, NULL, NULL, "pavgusb",
15487 /* C0 */ NULL, NULL, NULL, NULL,
15488 /* C4 */ NULL, NULL, NULL, NULL,
15489 /* C8 */ NULL, NULL, NULL, NULL,
15490 /* CC */ NULL, NULL, NULL, NULL,
15491 /* D0 */ NULL, NULL, NULL, NULL,
15492 /* D4 */ NULL, NULL, NULL, NULL,
15493 /* D8 */ NULL, NULL, NULL, NULL,
15494 /* DC */ NULL, NULL, NULL, NULL,
15495 /* E0 */ NULL, NULL, NULL, NULL,
15496 /* E4 */ NULL, NULL, NULL, NULL,
15497 /* E8 */ NULL, NULL, NULL, NULL,
15498 /* EC */ NULL, NULL, NULL, NULL,
15499 /* F0 */ NULL, NULL, NULL, NULL,
15500 /* F4 */ NULL, NULL, NULL, NULL,
15501 /* F8 */ NULL, NULL, NULL, NULL,
15502 /* FC */ NULL, NULL, NULL, NULL,
15506 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15508 const char *mnemonic;
15510 FETCH_DATA (the_info, codep + 1);
15511 /* AMD 3DNow! instructions are specified by an opcode suffix in the
15512 place where an 8-bit immediate would normally go. ie. the last
15513 byte of the instruction. */
15514 obufp = mnemonicendp;
15515 mnemonic = Suffix3DNow[*codep++ & 0xff];
15517 oappend (mnemonic);
15520 /* Since a variable sized modrm/sib chunk is between the start
15521 of the opcode (0x0f0f) and the opcode suffix, we need to do
15522 all the modrm processing first, and don't know until now that
15523 we have a bad opcode. This necessitates some cleaning up. */
15524 op_out[0][0] = '\0';
15525 op_out[1][0] = '\0';
15528 mnemonicendp = obufp;
15531 static struct op simd_cmp_op[] =
15533 { STRING_COMMA_LEN ("eq") },
15534 { STRING_COMMA_LEN ("lt") },
15535 { STRING_COMMA_LEN ("le") },
15536 { STRING_COMMA_LEN ("unord") },
15537 { STRING_COMMA_LEN ("neq") },
15538 { STRING_COMMA_LEN ("nlt") },
15539 { STRING_COMMA_LEN ("nle") },
15540 { STRING_COMMA_LEN ("ord") }
15544 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15546 unsigned int cmp_type;
15548 FETCH_DATA (the_info, codep + 1);
15549 cmp_type = *codep++ & 0xff;
15550 if (cmp_type < ARRAY_SIZE (simd_cmp_op))
15553 char *p = mnemonicendp - 2;
15557 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
15558 mnemonicendp += simd_cmp_op[cmp_type].len;
15562 /* We have a reserved extension byte. Output it directly. */
15563 scratchbuf[0] = '$';
15564 print_operand_value (scratchbuf + 1, 1, cmp_type);
15565 oappend_maybe_intel (scratchbuf);
15566 scratchbuf[0] = '\0';
15571 OP_Mwaitx (int bytemode ATTRIBUTE_UNUSED,
15572 int sizeflag ATTRIBUTE_UNUSED)
15574 /* mwaitx %eax,%ecx,%ebx */
15577 const char **names = (address_mode == mode_64bit
15578 ? names64 : names32);
15579 strcpy (op_out[0], names[0]);
15580 strcpy (op_out[1], names[1]);
15581 strcpy (op_out[2], names[3]);
15582 two_source_ops = 1;
15584 /* Skip mod/rm byte. */
15590 OP_Mwait (int bytemode ATTRIBUTE_UNUSED,
15591 int sizeflag ATTRIBUTE_UNUSED)
15593 /* mwait %eax,%ecx */
15596 const char **names = (address_mode == mode_64bit
15597 ? names64 : names32);
15598 strcpy (op_out[0], names[0]);
15599 strcpy (op_out[1], names[1]);
15600 two_source_ops = 1;
15602 /* Skip mod/rm byte. */
15608 OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
15609 int sizeflag ATTRIBUTE_UNUSED)
15611 /* monitor %eax,%ecx,%edx" */
15614 const char **op1_names;
15615 const char **names = (address_mode == mode_64bit
15616 ? names64 : names32);
15618 if (!(prefixes & PREFIX_ADDR))
15619 op1_names = (address_mode == mode_16bit
15620 ? names16 : names);
15623 /* Remove "addr16/addr32". */
15624 all_prefixes[last_addr_prefix] = 0;
15625 op1_names = (address_mode != mode_32bit
15626 ? names32 : names16);
15627 used_prefixes |= PREFIX_ADDR;
15629 strcpy (op_out[0], op1_names[0]);
15630 strcpy (op_out[1], names[1]);
15631 strcpy (op_out[2], names[2]);
15632 two_source_ops = 1;
15634 /* Skip mod/rm byte. */
15642 /* Throw away prefixes and 1st. opcode byte. */
15643 codep = insn_codep + 1;
15648 REP_Fixup (int bytemode, int sizeflag)
15650 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
15652 if (prefixes & PREFIX_REPZ)
15653 all_prefixes[last_repz_prefix] = REP_PREFIX;
15660 OP_IMREG (bytemode, sizeflag);
15663 OP_ESreg (bytemode, sizeflag);
15666 OP_DSreg (bytemode, sizeflag);
15674 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
15678 BND_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15680 if (prefixes & PREFIX_REPNZ)
15681 all_prefixes[last_repnz_prefix] = BND_PREFIX;
15684 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
15688 NOTRACK_Fixup (int bytemode ATTRIBUTE_UNUSED,
15689 int sizeflag ATTRIBUTE_UNUSED)
15691 if (active_seg_prefix == PREFIX_DS
15692 && (address_mode != mode_64bit || last_data_prefix < 0))
15694 /* NOTRACK prefix is only valid on indirect branch instructions.
15695 NB: DATA prefix is unsupported for Intel64. */
15696 active_seg_prefix = 0;
15697 all_prefixes[last_seg_prefix] = NOTRACK_PREFIX;
15701 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
15702 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
15706 HLE_Fixup1 (int bytemode, int sizeflag)
15709 && (prefixes & PREFIX_LOCK) != 0)
15711 if (prefixes & PREFIX_REPZ)
15712 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15713 if (prefixes & PREFIX_REPNZ)
15714 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15717 OP_E (bytemode, sizeflag);
15720 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
15721 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
15725 HLE_Fixup2 (int bytemode, int sizeflag)
15727 if (modrm.mod != 3)
15729 if (prefixes & PREFIX_REPZ)
15730 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15731 if (prefixes & PREFIX_REPNZ)
15732 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15735 OP_E (bytemode, sizeflag);
15738 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
15739 "xrelease" for memory operand. No check for LOCK prefix. */
15742 HLE_Fixup3 (int bytemode, int sizeflag)
15745 && last_repz_prefix > last_repnz_prefix
15746 && (prefixes & PREFIX_REPZ) != 0)
15747 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15749 OP_E (bytemode, sizeflag);
15753 CMPXCHG8B_Fixup (int bytemode, int sizeflag)
15758 /* Change cmpxchg8b to cmpxchg16b. */
15759 char *p = mnemonicendp - 2;
15760 mnemonicendp = stpcpy (p, "16b");
15763 else if ((prefixes & PREFIX_LOCK) != 0)
15765 if (prefixes & PREFIX_REPZ)
15766 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15767 if (prefixes & PREFIX_REPNZ)
15768 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15771 OP_M (bytemode, sizeflag);
15775 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
15777 const char **names;
15781 switch (vex.length)
15795 oappend (names[reg]);
15799 CRC32_Fixup (int bytemode, int sizeflag)
15801 /* Add proper suffix to "crc32". */
15802 char *p = mnemonicendp;
15821 if (sizeflag & DFLAG)
15825 used_prefixes |= (prefixes & PREFIX_DATA);
15829 oappend (INTERNAL_DISASSEMBLER_ERROR);
15836 if (modrm.mod == 3)
15840 /* Skip mod/rm byte. */
15845 add = (rex & REX_B) ? 8 : 0;
15846 if (bytemode == b_mode)
15850 oappend (names8rex[modrm.rm + add]);
15852 oappend (names8[modrm.rm + add]);
15858 oappend (names64[modrm.rm + add]);
15859 else if ((prefixes & PREFIX_DATA))
15860 oappend (names16[modrm.rm + add]);
15862 oappend (names32[modrm.rm + add]);
15866 OP_E (bytemode, sizeflag);
15870 FXSAVE_Fixup (int bytemode, int sizeflag)
15872 /* Add proper suffix to "fxsave" and "fxrstor". */
15876 char *p = mnemonicendp;
15882 OP_M (bytemode, sizeflag);
15886 PCMPESTR_Fixup (int bytemode, int sizeflag)
15888 /* Add proper suffix to "{,v}pcmpestr{i,m}". */
15891 char *p = mnemonicendp;
15896 else if (sizeflag & SUFFIX_ALWAYS)
15903 OP_EX (bytemode, sizeflag);
15906 /* Display the destination register operand for instructions with
15910 OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
15913 const char **names;
15921 reg = vex.register_specifier;
15922 if (address_mode != mode_64bit)
15924 else if (vex.evex && !vex.v)
15927 if (bytemode == vex_scalar_mode)
15929 oappend (names_xmm[reg]);
15933 switch (vex.length)
15940 case vex_vsib_q_w_dq_mode:
15941 case vex_vsib_q_w_d_mode:
15957 names = names_mask;
15971 case vex_vsib_q_w_dq_mode:
15972 case vex_vsib_q_w_d_mode:
15973 names = vex.w ? names_ymm : names_xmm;
15982 names = names_mask;
15985 /* See PR binutils/20893 for a reproducer. */
15997 oappend (names[reg]);
16000 /* Get the VEX immediate byte without moving codep. */
16002 static unsigned char
16003 get_vex_imm8 (int sizeflag, int opnum)
16005 int bytes_before_imm = 0;
16007 if (modrm.mod != 3)
16009 /* There are SIB/displacement bytes. */
16010 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
16012 /* 32/64 bit address mode */
16013 int base = modrm.rm;
16015 /* Check SIB byte. */
16018 FETCH_DATA (the_info, codep + 1);
16020 /* When decoding the third source, don't increase
16021 bytes_before_imm as this has already been incremented
16022 by one in OP_E_memory while decoding the second
16025 bytes_before_imm++;
16028 /* Don't increase bytes_before_imm when decoding the third source,
16029 it has already been incremented by OP_E_memory while decoding
16030 the second source operand. */
16036 /* When modrm.rm == 5 or modrm.rm == 4 and base in
16037 SIB == 5, there is a 4 byte displacement. */
16039 /* No displacement. */
16041 /* Fall through. */
16043 /* 4 byte displacement. */
16044 bytes_before_imm += 4;
16047 /* 1 byte displacement. */
16048 bytes_before_imm++;
16055 /* 16 bit address mode */
16056 /* Don't increase bytes_before_imm when decoding the third source,
16057 it has already been incremented by OP_E_memory while decoding
16058 the second source operand. */
16064 /* When modrm.rm == 6, there is a 2 byte displacement. */
16066 /* No displacement. */
16068 /* Fall through. */
16070 /* 2 byte displacement. */
16071 bytes_before_imm += 2;
16074 /* 1 byte displacement: when decoding the third source,
16075 don't increase bytes_before_imm as this has already
16076 been incremented by one in OP_E_memory while decoding
16077 the second source operand. */
16079 bytes_before_imm++;
16087 FETCH_DATA (the_info, codep + bytes_before_imm + 1);
16088 return codep [bytes_before_imm];
16092 OP_EX_VexReg (int bytemode, int sizeflag, int reg)
16094 const char **names;
16096 if (reg == -1 && modrm.mod != 3)
16098 OP_E_memory (bytemode, sizeflag);
16110 if (address_mode != mode_64bit)
16114 switch (vex.length)
16125 oappend (names[reg]);
16129 OP_EX_VexImmW (int bytemode, int sizeflag)
16132 static unsigned char vex_imm8;
16134 if (vex_w_done == 0)
16138 /* Skip mod/rm byte. */
16142 vex_imm8 = get_vex_imm8 (sizeflag, 0);
16145 reg = vex_imm8 >> 4;
16147 OP_EX_VexReg (bytemode, sizeflag, reg);
16149 else if (vex_w_done == 1)
16154 reg = vex_imm8 >> 4;
16156 OP_EX_VexReg (bytemode, sizeflag, reg);
16160 /* Output the imm8 directly. */
16161 scratchbuf[0] = '$';
16162 print_operand_value (scratchbuf + 1, 1, vex_imm8 & 0xf);
16163 oappend_maybe_intel (scratchbuf);
16164 scratchbuf[0] = '\0';
16170 OP_Vex_2src (int bytemode, int sizeflag)
16172 if (modrm.mod == 3)
16174 int reg = modrm.rm;
16178 oappend (names_xmm[reg]);
16183 && (bytemode == v_mode || bytemode == v_swap_mode))
16185 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
16186 used_prefixes |= (prefixes & PREFIX_DATA);
16188 OP_E (bytemode, sizeflag);
16193 OP_Vex_2src_1 (int bytemode, int sizeflag)
16195 if (modrm.mod == 3)
16197 /* Skip mod/rm byte. */
16204 unsigned int reg = vex.register_specifier;
16206 if (address_mode != mode_64bit)
16208 oappend (names_xmm[reg]);
16211 OP_Vex_2src (bytemode, sizeflag);
16215 OP_Vex_2src_2 (int bytemode, int sizeflag)
16218 OP_Vex_2src (bytemode, sizeflag);
16221 unsigned int reg = vex.register_specifier;
16223 if (address_mode != mode_64bit)
16225 oappend (names_xmm[reg]);
16230 OP_EX_VexW (int bytemode, int sizeflag)
16236 /* Skip mod/rm byte. */
16241 reg = get_vex_imm8 (sizeflag, 0) >> 4;
16246 reg = get_vex_imm8 (sizeflag, 1) >> 4;
16249 OP_EX_VexReg (bytemode, sizeflag, reg);
16257 OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16260 const char **names;
16262 FETCH_DATA (the_info, codep + 1);
16265 if (bytemode != x_mode)
16269 if (address_mode != mode_64bit)
16272 switch (vex.length)
16283 oappend (names[reg]);
16287 OP_XMM_VexW (int bytemode, int sizeflag)
16289 /* Turn off the REX.W bit since it is used for swapping operands
16292 OP_XMM (bytemode, sizeflag);
16296 OP_EX_Vex (int bytemode, int sizeflag)
16298 if (modrm.mod != 3)
16300 if (vex.register_specifier != 0)
16304 OP_EX (bytemode, sizeflag);
16308 OP_XMM_Vex (int bytemode, int sizeflag)
16310 if (modrm.mod != 3)
16312 if (vex.register_specifier != 0)
16316 OP_XMM (bytemode, sizeflag);
16319 static struct op vex_cmp_op[] =
16321 { STRING_COMMA_LEN ("eq") },
16322 { STRING_COMMA_LEN ("lt") },
16323 { STRING_COMMA_LEN ("le") },
16324 { STRING_COMMA_LEN ("unord") },
16325 { STRING_COMMA_LEN ("neq") },
16326 { STRING_COMMA_LEN ("nlt") },
16327 { STRING_COMMA_LEN ("nle") },
16328 { STRING_COMMA_LEN ("ord") },
16329 { STRING_COMMA_LEN ("eq_uq") },
16330 { STRING_COMMA_LEN ("nge") },
16331 { STRING_COMMA_LEN ("ngt") },
16332 { STRING_COMMA_LEN ("false") },
16333 { STRING_COMMA_LEN ("neq_oq") },
16334 { STRING_COMMA_LEN ("ge") },
16335 { STRING_COMMA_LEN ("gt") },
16336 { STRING_COMMA_LEN ("true") },
16337 { STRING_COMMA_LEN ("eq_os") },
16338 { STRING_COMMA_LEN ("lt_oq") },
16339 { STRING_COMMA_LEN ("le_oq") },
16340 { STRING_COMMA_LEN ("unord_s") },
16341 { STRING_COMMA_LEN ("neq_us") },
16342 { STRING_COMMA_LEN ("nlt_uq") },
16343 { STRING_COMMA_LEN ("nle_uq") },
16344 { STRING_COMMA_LEN ("ord_s") },
16345 { STRING_COMMA_LEN ("eq_us") },
16346 { STRING_COMMA_LEN ("nge_uq") },
16347 { STRING_COMMA_LEN ("ngt_uq") },
16348 { STRING_COMMA_LEN ("false_os") },
16349 { STRING_COMMA_LEN ("neq_os") },
16350 { STRING_COMMA_LEN ("ge_oq") },
16351 { STRING_COMMA_LEN ("gt_oq") },
16352 { STRING_COMMA_LEN ("true_us") },
16356 VCMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16358 unsigned int cmp_type;
16360 FETCH_DATA (the_info, codep + 1);
16361 cmp_type = *codep++ & 0xff;
16362 if (cmp_type < ARRAY_SIZE (vex_cmp_op))
16365 char *p = mnemonicendp - 2;
16369 sprintf (p, "%s%s", vex_cmp_op[cmp_type].name, suffix);
16370 mnemonicendp += vex_cmp_op[cmp_type].len;
16374 /* We have a reserved extension byte. Output it directly. */
16375 scratchbuf[0] = '$';
16376 print_operand_value (scratchbuf + 1, 1, cmp_type);
16377 oappend_maybe_intel (scratchbuf);
16378 scratchbuf[0] = '\0';
16383 VPCMP_Fixup (int bytemode ATTRIBUTE_UNUSED,
16384 int sizeflag ATTRIBUTE_UNUSED)
16386 unsigned int cmp_type;
16391 FETCH_DATA (the_info, codep + 1);
16392 cmp_type = *codep++ & 0xff;
16393 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
16394 If it's the case, print suffix, otherwise - print the immediate. */
16395 if (cmp_type < ARRAY_SIZE (simd_cmp_op)
16400 char *p = mnemonicendp - 2;
16402 /* vpcmp* can have both one- and two-lettered suffix. */
16416 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
16417 mnemonicendp += simd_cmp_op[cmp_type].len;
16421 /* We have a reserved extension byte. Output it directly. */
16422 scratchbuf[0] = '$';
16423 print_operand_value (scratchbuf + 1, 1, cmp_type);
16424 oappend_maybe_intel (scratchbuf);
16425 scratchbuf[0] = '\0';
16429 static const struct op xop_cmp_op[] =
16431 { STRING_COMMA_LEN ("lt") },
16432 { STRING_COMMA_LEN ("le") },
16433 { STRING_COMMA_LEN ("gt") },
16434 { STRING_COMMA_LEN ("ge") },
16435 { STRING_COMMA_LEN ("eq") },
16436 { STRING_COMMA_LEN ("neq") },
16437 { STRING_COMMA_LEN ("false") },
16438 { STRING_COMMA_LEN ("true") }
16442 VPCOM_Fixup (int bytemode ATTRIBUTE_UNUSED,
16443 int sizeflag ATTRIBUTE_UNUSED)
16445 unsigned int cmp_type;
16447 FETCH_DATA (the_info, codep + 1);
16448 cmp_type = *codep++ & 0xff;
16449 if (cmp_type < ARRAY_SIZE (xop_cmp_op))
16452 char *p = mnemonicendp - 2;
16454 /* vpcom* can have both one- and two-lettered suffix. */
16468 sprintf (p, "%s%s", xop_cmp_op[cmp_type].name, suffix);
16469 mnemonicendp += xop_cmp_op[cmp_type].len;
16473 /* We have a reserved extension byte. Output it directly. */
16474 scratchbuf[0] = '$';
16475 print_operand_value (scratchbuf + 1, 1, cmp_type);
16476 oappend_maybe_intel (scratchbuf);
16477 scratchbuf[0] = '\0';
16481 static const struct op pclmul_op[] =
16483 { STRING_COMMA_LEN ("lql") },
16484 { STRING_COMMA_LEN ("hql") },
16485 { STRING_COMMA_LEN ("lqh") },
16486 { STRING_COMMA_LEN ("hqh") }
16490 PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
16491 int sizeflag ATTRIBUTE_UNUSED)
16493 unsigned int pclmul_type;
16495 FETCH_DATA (the_info, codep + 1);
16496 pclmul_type = *codep++ & 0xff;
16497 switch (pclmul_type)
16508 if (pclmul_type < ARRAY_SIZE (pclmul_op))
16511 char *p = mnemonicendp - 3;
16516 sprintf (p, "%s%s", pclmul_op[pclmul_type].name, suffix);
16517 mnemonicendp += pclmul_op[pclmul_type].len;
16521 /* We have a reserved extension byte. Output it directly. */
16522 scratchbuf[0] = '$';
16523 print_operand_value (scratchbuf + 1, 1, pclmul_type);
16524 oappend_maybe_intel (scratchbuf);
16525 scratchbuf[0] = '\0';
16530 MOVBE_Fixup (int bytemode, int sizeflag)
16532 /* Add proper suffix to "movbe". */
16533 char *p = mnemonicendp;
16542 if (sizeflag & SUFFIX_ALWAYS)
16548 if (sizeflag & DFLAG)
16552 used_prefixes |= (prefixes & PREFIX_DATA);
16557 oappend (INTERNAL_DISASSEMBLER_ERROR);
16564 OP_M (bytemode, sizeflag);
16568 OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16571 const char **names;
16573 /* Skip mod/rm byte. */
16587 oappend (names[reg]);
16591 OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16593 const char **names;
16594 unsigned int reg = vex.register_specifier;
16601 if (address_mode != mode_64bit)
16603 oappend (names[reg]);
16607 OP_Mask (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16610 || (bytemode != mask_mode && bytemode != mask_bd_mode))
16614 if ((rex & REX_R) != 0 || !vex.r)
16620 oappend (names_mask [modrm.reg]);
16624 OP_Rounding (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16627 || (bytemode != evex_rounding_mode
16628 && bytemode != evex_rounding_64_mode
16629 && bytemode != evex_sae_mode))
16631 if (modrm.mod == 3 && vex.b)
16634 case evex_rounding_64_mode:
16635 if (address_mode != mode_64bit)
16640 /* Fall through. */
16641 case evex_rounding_mode:
16642 oappend (names_rounding[vex.ll]);
16644 case evex_sae_mode: