1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2018 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 VZERO_Fixup (int, int);
99 static void VCMP_Fixup (int, int);
100 static void VPCMP_Fixup (int, int);
101 static void VPCOM_Fixup (int, int);
102 static void OP_0f07 (int, int);
103 static void OP_Monitor (int, int);
104 static void OP_Mwait (int, int);
105 static void OP_Mwaitx (int, int);
106 static void NOP_Fixup1 (int, int);
107 static void NOP_Fixup2 (int, int);
108 static void OP_3DNowSuffix (int, int);
109 static void CMP_Fixup (int, int);
110 static void BadOp (void);
111 static void REP_Fixup (int, int);
112 static void BND_Fixup (int, int);
113 static void NOTRACK_Fixup (int, int);
114 static void HLE_Fixup1 (int, int);
115 static void HLE_Fixup2 (int, int);
116 static void HLE_Fixup3 (int, int);
117 static void CMPXCHG8B_Fixup (int, int);
118 static void XMM_Fixup (int, int);
119 static void CRC32_Fixup (int, int);
120 static void FXSAVE_Fixup (int, int);
121 static void PCMPESTR_Fixup (int, int);
122 static void OP_LWPCB_E (int, int);
123 static void OP_LWP_E (int, int);
124 static void OP_Vex_2src_1 (int, int);
125 static void OP_Vex_2src_2 (int, int);
127 static void MOVBE_Fixup (int, int);
129 static void OP_Mask (int, int);
132 /* Points to first byte not fetched. */
133 bfd_byte *max_fetched;
134 bfd_byte the_buffer[MAX_MNEM_SIZE];
137 OPCODES_SIGJMP_BUF bailout;
147 enum address_mode address_mode;
149 /* Flags for the prefixes for the current instruction. See below. */
152 /* REX prefix the current instruction. See below. */
154 /* Bits of REX we've already used. */
156 /* REX bits in original REX prefix ignored. */
157 static int rex_ignored;
158 /* Mark parts used in the REX prefix. When we are testing for
159 empty prefix (for 8bit register REX extension), just mask it
160 out. Otherwise test for REX bit is excuse for existence of REX
161 only in case value is nonzero. */
162 #define USED_REX(value) \
167 rex_used |= (value) | REX_OPCODE; \
170 rex_used |= REX_OPCODE; \
173 /* Flags for prefixes which we somehow handled when printing the
174 current instruction. */
175 static int used_prefixes;
177 /* Flags stored in PREFIXES. */
178 #define PREFIX_REPZ 1
179 #define PREFIX_REPNZ 2
180 #define PREFIX_LOCK 4
182 #define PREFIX_SS 0x10
183 #define PREFIX_DS 0x20
184 #define PREFIX_ES 0x40
185 #define PREFIX_FS 0x80
186 #define PREFIX_GS 0x100
187 #define PREFIX_DATA 0x200
188 #define PREFIX_ADDR 0x400
189 #define PREFIX_FWAIT 0x800
191 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
192 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
194 #define FETCH_DATA(info, addr) \
195 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
196 ? 1 : fetch_data ((info), (addr)))
199 fetch_data (struct disassemble_info *info, bfd_byte *addr)
202 struct dis_private *priv = (struct dis_private *) info->private_data;
203 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
205 if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
206 status = (*info->read_memory_func) (start,
208 addr - priv->max_fetched,
214 /* If we did manage to read at least one byte, then
215 print_insn_i386 will do something sensible. Otherwise, print
216 an error. We do that here because this is where we know
218 if (priv->max_fetched == priv->the_buffer)
219 (*info->memory_error_func) (status, start, info);
220 OPCODES_SIGLONGJMP (priv->bailout, 1);
223 priv->max_fetched = addr;
227 /* Possible values for prefix requirement. */
228 #define PREFIX_IGNORED_SHIFT 16
229 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
230 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
231 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
232 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
233 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
235 /* Opcode prefixes. */
236 #define PREFIX_OPCODE (PREFIX_REPZ \
240 /* Prefixes ignored. */
241 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
242 | PREFIX_IGNORED_REPNZ \
243 | PREFIX_IGNORED_DATA)
245 #define XX { NULL, 0 }
246 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
248 #define Eb { OP_E, b_mode }
249 #define Ebnd { OP_E, bnd_mode }
250 #define EbS { OP_E, b_swap_mode }
251 #define EbndS { OP_E, bnd_swap_mode }
252 #define Ev { OP_E, v_mode }
253 #define Eva { OP_E, va_mode }
254 #define Ev_bnd { OP_E, v_bnd_mode }
255 #define EvS { OP_E, v_swap_mode }
256 #define Ed { OP_E, d_mode }
257 #define Edq { OP_E, dq_mode }
258 #define Edqw { OP_E, dqw_mode }
259 #define Edqb { OP_E, dqb_mode }
260 #define Edb { OP_E, db_mode }
261 #define Edw { OP_E, dw_mode }
262 #define Edqd { OP_E, dqd_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 Mx { OP_M, x_mode }
277 #define Mxmm { OP_M, xmm_mode }
278 #define Gb { OP_G, b_mode }
279 #define Gbnd { OP_G, bnd_mode }
280 #define Gv { OP_G, v_mode }
281 #define Gd { OP_G, d_mode }
282 #define Gdq { OP_G, dq_mode }
283 #define Gm { OP_G, m_mode }
284 #define Gw { OP_G, w_mode }
285 #define Rd { OP_R, d_mode }
286 #define Rdq { OP_R, dq_mode }
287 #define Rm { OP_R, m_mode }
288 #define Ib { OP_I, b_mode }
289 #define sIb { OP_sI, b_mode } /* sign extened byte */
290 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
291 #define Iv { OP_I, v_mode }
292 #define sIv { OP_sI, v_mode }
293 #define Iq { OP_I, q_mode }
294 #define Iv64 { OP_I64, v_mode }
295 #define Iw { OP_I, w_mode }
296 #define I1 { OP_I, const_1_mode }
297 #define Jb { OP_J, b_mode }
298 #define Jv { OP_J, v_mode }
299 #define Cm { OP_C, m_mode }
300 #define Dm { OP_D, m_mode }
301 #define Td { OP_T, d_mode }
302 #define Skip_MODRM { OP_Skip_MODRM, 0 }
304 #define RMeAX { OP_REG, eAX_reg }
305 #define RMeBX { OP_REG, eBX_reg }
306 #define RMeCX { OP_REG, eCX_reg }
307 #define RMeDX { OP_REG, eDX_reg }
308 #define RMeSP { OP_REG, eSP_reg }
309 #define RMeBP { OP_REG, eBP_reg }
310 #define RMeSI { OP_REG, eSI_reg }
311 #define RMeDI { OP_REG, eDI_reg }
312 #define RMrAX { OP_REG, rAX_reg }
313 #define RMrBX { OP_REG, rBX_reg }
314 #define RMrCX { OP_REG, rCX_reg }
315 #define RMrDX { OP_REG, rDX_reg }
316 #define RMrSP { OP_REG, rSP_reg }
317 #define RMrBP { OP_REG, rBP_reg }
318 #define RMrSI { OP_REG, rSI_reg }
319 #define RMrDI { OP_REG, rDI_reg }
320 #define RMAL { OP_REG, al_reg }
321 #define RMCL { OP_REG, cl_reg }
322 #define RMDL { OP_REG, dl_reg }
323 #define RMBL { OP_REG, bl_reg }
324 #define RMAH { OP_REG, ah_reg }
325 #define RMCH { OP_REG, ch_reg }
326 #define RMDH { OP_REG, dh_reg }
327 #define RMBH { OP_REG, bh_reg }
328 #define RMAX { OP_REG, ax_reg }
329 #define RMDX { OP_REG, dx_reg }
331 #define eAX { OP_IMREG, eAX_reg }
332 #define eBX { OP_IMREG, eBX_reg }
333 #define eCX { OP_IMREG, eCX_reg }
334 #define eDX { OP_IMREG, eDX_reg }
335 #define eSP { OP_IMREG, eSP_reg }
336 #define eBP { OP_IMREG, eBP_reg }
337 #define eSI { OP_IMREG, eSI_reg }
338 #define eDI { OP_IMREG, eDI_reg }
339 #define AL { OP_IMREG, al_reg }
340 #define CL { OP_IMREG, cl_reg }
341 #define DL { OP_IMREG, dl_reg }
342 #define BL { OP_IMREG, bl_reg }
343 #define AH { OP_IMREG, ah_reg }
344 #define CH { OP_IMREG, ch_reg }
345 #define DH { OP_IMREG, dh_reg }
346 #define BH { OP_IMREG, bh_reg }
347 #define AX { OP_IMREG, ax_reg }
348 #define DX { OP_IMREG, dx_reg }
349 #define zAX { OP_IMREG, z_mode_ax_reg }
350 #define indirDX { OP_IMREG, indir_dx_reg }
352 #define Sw { OP_SEG, w_mode }
353 #define Sv { OP_SEG, v_mode }
354 #define Ap { OP_DIR, 0 }
355 #define Ob { OP_OFF64, b_mode }
356 #define Ov { OP_OFF64, v_mode }
357 #define Xb { OP_DSreg, eSI_reg }
358 #define Xv { OP_DSreg, eSI_reg }
359 #define Xz { OP_DSreg, eSI_reg }
360 #define Yb { OP_ESreg, eDI_reg }
361 #define Yv { OP_ESreg, eDI_reg }
362 #define DSBX { OP_DSreg, eBX_reg }
364 #define es { OP_REG, es_reg }
365 #define ss { OP_REG, ss_reg }
366 #define cs { OP_REG, cs_reg }
367 #define ds { OP_REG, ds_reg }
368 #define fs { OP_REG, fs_reg }
369 #define gs { OP_REG, gs_reg }
371 #define MX { OP_MMX, 0 }
372 #define XM { OP_XMM, 0 }
373 #define XMScalar { OP_XMM, scalar_mode }
374 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
375 #define XMM { OP_XMM, xmm_mode }
376 #define XMxmmq { OP_XMM, xmmq_mode }
377 #define EM { OP_EM, v_mode }
378 #define EMS { OP_EM, v_swap_mode }
379 #define EMd { OP_EM, d_mode }
380 #define EMx { OP_EM, x_mode }
381 #define EXbScalar { OP_EX, b_scalar_mode }
382 #define EXw { OP_EX, w_mode }
383 #define EXwScalar { OP_EX, w_scalar_mode }
384 #define EXd { OP_EX, d_mode }
385 #define EXdScalar { OP_EX, d_scalar_mode }
386 #define EXdS { OP_EX, d_swap_mode }
387 #define EXdScalarS { OP_EX, d_scalar_swap_mode }
388 #define EXq { OP_EX, q_mode }
389 #define EXqScalar { OP_EX, q_scalar_mode }
390 #define EXqScalarS { OP_EX, q_scalar_swap_mode }
391 #define EXqS { OP_EX, q_swap_mode }
392 #define EXx { OP_EX, x_mode }
393 #define EXxS { OP_EX, x_swap_mode }
394 #define EXxmm { OP_EX, xmm_mode }
395 #define EXymm { OP_EX, ymm_mode }
396 #define EXxmmq { OP_EX, xmmq_mode }
397 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
398 #define EXxmm_mb { OP_EX, xmm_mb_mode }
399 #define EXxmm_mw { OP_EX, xmm_mw_mode }
400 #define EXxmm_md { OP_EX, xmm_md_mode }
401 #define EXxmm_mq { OP_EX, xmm_mq_mode }
402 #define EXxmm_mdq { OP_EX, xmm_mdq_mode }
403 #define EXxmmdw { OP_EX, xmmdw_mode }
404 #define EXxmmqd { OP_EX, xmmqd_mode }
405 #define EXymmq { OP_EX, ymmq_mode }
406 #define EXVexWdq { OP_EX, vex_w_dq_mode }
407 #define EXVexWdqScalar { OP_EX, vex_scalar_w_dq_mode }
408 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
409 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
410 #define MS { OP_MS, v_mode }
411 #define XS { OP_XS, v_mode }
412 #define EMCq { OP_EMC, q_mode }
413 #define MXC { OP_MXC, 0 }
414 #define OPSUF { OP_3DNowSuffix, 0 }
415 #define CMP { CMP_Fixup, 0 }
416 #define XMM0 { XMM_Fixup, 0 }
417 #define FXSAVE { FXSAVE_Fixup, 0 }
418 #define Vex_2src_1 { OP_Vex_2src_1, 0 }
419 #define Vex_2src_2 { OP_Vex_2src_2, 0 }
421 #define Vex { OP_VEX, vex_mode }
422 #define VexScalar { OP_VEX, vex_scalar_mode }
423 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
424 #define Vex128 { OP_VEX, vex128_mode }
425 #define Vex256 { OP_VEX, vex256_mode }
426 #define VexGdq { OP_VEX, dq_mode }
427 #define EXdVex { OP_EX_Vex, d_mode }
428 #define EXdVexS { OP_EX_Vex, d_swap_mode }
429 #define EXdVexScalarS { OP_EX_Vex, d_scalar_swap_mode }
430 #define EXqVex { OP_EX_Vex, q_mode }
431 #define EXqVexS { OP_EX_Vex, q_swap_mode }
432 #define EXqVexScalarS { OP_EX_Vex, q_scalar_swap_mode }
433 #define EXVexW { OP_EX_VexW, x_mode }
434 #define EXdVexW { OP_EX_VexW, d_mode }
435 #define EXqVexW { OP_EX_VexW, q_mode }
436 #define EXVexImmW { OP_EX_VexImmW, x_mode }
437 #define XMVex { OP_XMM_Vex, 0 }
438 #define XMVexScalar { OP_XMM_Vex, scalar_mode }
439 #define XMVexW { OP_XMM_VexW, 0 }
440 #define XMVexI4 { OP_REG_VexI4, x_mode }
441 #define PCLMUL { PCLMUL_Fixup, 0 }
442 #define VZERO { VZERO_Fixup, 0 }
443 #define VCMP { VCMP_Fixup, 0 }
444 #define VPCMP { VPCMP_Fixup, 0 }
445 #define VPCOM { VPCOM_Fixup, 0 }
447 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
448 #define EXxEVexS { OP_Rounding, evex_sae_mode }
450 #define XMask { OP_Mask, mask_mode }
451 #define MaskG { OP_G, mask_mode }
452 #define MaskE { OP_E, mask_mode }
453 #define MaskBDE { OP_E, mask_bd_mode }
454 #define MaskR { OP_R, mask_mode }
455 #define MaskVex { OP_VEX, mask_mode }
457 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
458 #define MVexVSIBDQWpX { OP_M, vex_vsib_d_w_d_mode }
459 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
460 #define MVexVSIBQDWpX { OP_M, vex_vsib_q_w_d_mode }
462 /* Used handle "rep" prefix for string instructions. */
463 #define Xbr { REP_Fixup, eSI_reg }
464 #define Xvr { REP_Fixup, eSI_reg }
465 #define Ybr { REP_Fixup, eDI_reg }
466 #define Yvr { REP_Fixup, eDI_reg }
467 #define Yzr { REP_Fixup, eDI_reg }
468 #define indirDXr { REP_Fixup, indir_dx_reg }
469 #define ALr { REP_Fixup, al_reg }
470 #define eAXr { REP_Fixup, eAX_reg }
472 /* Used handle HLE prefix for lockable instructions. */
473 #define Ebh1 { HLE_Fixup1, b_mode }
474 #define Evh1 { HLE_Fixup1, v_mode }
475 #define Ebh2 { HLE_Fixup2, b_mode }
476 #define Evh2 { HLE_Fixup2, v_mode }
477 #define Ebh3 { HLE_Fixup3, b_mode }
478 #define Evh3 { HLE_Fixup3, v_mode }
480 #define BND { BND_Fixup, 0 }
481 #define NOTRACK { NOTRACK_Fixup, 0 }
483 #define cond_jump_flag { NULL, cond_jump_mode }
484 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
486 /* bits in sizeflag */
487 #define SUFFIX_ALWAYS 4
495 /* byte operand with operand swapped */
497 /* byte operand, sign extend like 'T' suffix */
499 /* operand size depends on prefixes */
501 /* operand size depends on prefixes with operand swapped */
503 /* operand size depends on address prefix */
507 /* double word operand */
509 /* double word operand with operand swapped */
511 /* quad word operand */
513 /* quad word operand with operand swapped */
515 /* ten-byte operand */
517 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
518 broadcast enabled. */
520 /* Similar to x_mode, but with different EVEX mem shifts. */
522 /* Similar to x_mode, but with disabled broadcast. */
524 /* Similar to x_mode, but with operands swapped and disabled broadcast
527 /* 16-byte XMM operand */
529 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
530 memory operand (depending on vector length). Broadcast isn't
533 /* Same as xmmq_mode, but broadcast is allowed. */
534 evex_half_bcst_xmmq_mode,
535 /* XMM register or byte memory operand */
537 /* XMM register or word memory operand */
539 /* XMM register or double word memory operand */
541 /* XMM register or quad word memory operand */
543 /* XMM register or double/quad word memory operand, depending on
546 /* 16-byte XMM, word, double word or quad word operand. */
548 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
550 /* 32-byte YMM operand */
552 /* quad word, ymmword or zmmword memory operand. */
554 /* 32-byte YMM or 16-byte word operand */
556 /* d_mode in 32bit, q_mode in 64bit mode. */
558 /* pair of v_mode operands */
563 /* operand size depends on REX prefixes. */
565 /* registers like dq_mode, memory like w_mode. */
569 /* bounds operand with operand swapped */
571 /* 4- or 6-byte pointer operand */
574 /* v_mode for indirect branch opcodes. */
576 /* v_mode for stack-related opcodes. */
578 /* non-quad operand size depends on prefixes */
580 /* 16-byte operand */
582 /* registers like dq_mode, memory like b_mode. */
584 /* registers like d_mode, memory like b_mode. */
586 /* registers like d_mode, memory like w_mode. */
588 /* registers like dq_mode, memory like d_mode. */
590 /* normal vex mode */
592 /* 128bit vex mode */
594 /* 256bit vex mode */
596 /* operand size depends on the VEX.W bit. */
599 /* Similar to vex_w_dq_mode, with VSIB dword indices. */
600 vex_vsib_d_w_dq_mode,
601 /* Similar to vex_vsib_d_w_dq_mode, with smaller memory. */
603 /* Similar to vex_w_dq_mode, with VSIB qword indices. */
604 vex_vsib_q_w_dq_mode,
605 /* Similar to vex_vsib_q_w_dq_mode, with smaller memory. */
608 /* scalar, ignore vector length. */
610 /* like b_mode, ignore vector length. */
612 /* like w_mode, ignore vector length. */
614 /* like d_mode, ignore vector length. */
616 /* like d_swap_mode, ignore vector length. */
618 /* like q_mode, ignore vector length. */
620 /* like q_swap_mode, ignore vector length. */
622 /* like vex_mode, ignore vector length. */
624 /* like vex_w_dq_mode, ignore vector length. */
625 vex_scalar_w_dq_mode,
627 /* Static rounding. */
629 /* Supress all exceptions. */
632 /* Mask register operand. */
634 /* Mask register operand. */
701 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
703 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
704 #define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
705 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
706 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
707 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
708 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
709 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
710 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
711 #define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
712 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
713 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
714 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
715 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
716 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
717 #define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
839 MOD_VEX_0F12_PREFIX_0,
841 MOD_VEX_0F16_PREFIX_0,
844 MOD_VEX_W_0_0F41_P_0_LEN_1,
845 MOD_VEX_W_1_0F41_P_0_LEN_1,
846 MOD_VEX_W_0_0F41_P_2_LEN_1,
847 MOD_VEX_W_1_0F41_P_2_LEN_1,
848 MOD_VEX_W_0_0F42_P_0_LEN_1,
849 MOD_VEX_W_1_0F42_P_0_LEN_1,
850 MOD_VEX_W_0_0F42_P_2_LEN_1,
851 MOD_VEX_W_1_0F42_P_2_LEN_1,
852 MOD_VEX_W_0_0F44_P_0_LEN_1,
853 MOD_VEX_W_1_0F44_P_0_LEN_1,
854 MOD_VEX_W_0_0F44_P_2_LEN_1,
855 MOD_VEX_W_1_0F44_P_2_LEN_1,
856 MOD_VEX_W_0_0F45_P_0_LEN_1,
857 MOD_VEX_W_1_0F45_P_0_LEN_1,
858 MOD_VEX_W_0_0F45_P_2_LEN_1,
859 MOD_VEX_W_1_0F45_P_2_LEN_1,
860 MOD_VEX_W_0_0F46_P_0_LEN_1,
861 MOD_VEX_W_1_0F46_P_0_LEN_1,
862 MOD_VEX_W_0_0F46_P_2_LEN_1,
863 MOD_VEX_W_1_0F46_P_2_LEN_1,
864 MOD_VEX_W_0_0F47_P_0_LEN_1,
865 MOD_VEX_W_1_0F47_P_0_LEN_1,
866 MOD_VEX_W_0_0F47_P_2_LEN_1,
867 MOD_VEX_W_1_0F47_P_2_LEN_1,
868 MOD_VEX_W_0_0F4A_P_0_LEN_1,
869 MOD_VEX_W_1_0F4A_P_0_LEN_1,
870 MOD_VEX_W_0_0F4A_P_2_LEN_1,
871 MOD_VEX_W_1_0F4A_P_2_LEN_1,
872 MOD_VEX_W_0_0F4B_P_0_LEN_1,
873 MOD_VEX_W_1_0F4B_P_0_LEN_1,
874 MOD_VEX_W_0_0F4B_P_2_LEN_1,
886 MOD_VEX_W_0_0F91_P_0_LEN_0,
887 MOD_VEX_W_1_0F91_P_0_LEN_0,
888 MOD_VEX_W_0_0F91_P_2_LEN_0,
889 MOD_VEX_W_1_0F91_P_2_LEN_0,
890 MOD_VEX_W_0_0F92_P_0_LEN_0,
891 MOD_VEX_W_0_0F92_P_2_LEN_0,
892 MOD_VEX_W_0_0F92_P_3_LEN_0,
893 MOD_VEX_W_1_0F92_P_3_LEN_0,
894 MOD_VEX_W_0_0F93_P_0_LEN_0,
895 MOD_VEX_W_0_0F93_P_2_LEN_0,
896 MOD_VEX_W_0_0F93_P_3_LEN_0,
897 MOD_VEX_W_1_0F93_P_3_LEN_0,
898 MOD_VEX_W_0_0F98_P_0_LEN_0,
899 MOD_VEX_W_1_0F98_P_0_LEN_0,
900 MOD_VEX_W_0_0F98_P_2_LEN_0,
901 MOD_VEX_W_1_0F98_P_2_LEN_0,
902 MOD_VEX_W_0_0F99_P_0_LEN_0,
903 MOD_VEX_W_1_0F99_P_0_LEN_0,
904 MOD_VEX_W_0_0F99_P_2_LEN_0,
905 MOD_VEX_W_1_0F99_P_2_LEN_0,
908 MOD_VEX_0FD7_PREFIX_2,
909 MOD_VEX_0FE7_PREFIX_2,
910 MOD_VEX_0FF0_PREFIX_3,
911 MOD_VEX_0F381A_PREFIX_2,
912 MOD_VEX_0F382A_PREFIX_2,
913 MOD_VEX_0F382C_PREFIX_2,
914 MOD_VEX_0F382D_PREFIX_2,
915 MOD_VEX_0F382E_PREFIX_2,
916 MOD_VEX_0F382F_PREFIX_2,
917 MOD_VEX_0F385A_PREFIX_2,
918 MOD_VEX_0F388C_PREFIX_2,
919 MOD_VEX_0F388E_PREFIX_2,
920 MOD_VEX_W_0_0F3A30_P_2_LEN_0,
921 MOD_VEX_W_1_0F3A30_P_2_LEN_0,
922 MOD_VEX_W_0_0F3A31_P_2_LEN_0,
923 MOD_VEX_W_1_0F3A31_P_2_LEN_0,
924 MOD_VEX_W_0_0F3A32_P_2_LEN_0,
925 MOD_VEX_W_1_0F3A32_P_2_LEN_0,
926 MOD_VEX_W_0_0F3A33_P_2_LEN_0,
927 MOD_VEX_W_1_0F3A33_P_2_LEN_0,
929 MOD_EVEX_0F10_PREFIX_1,
930 MOD_EVEX_0F10_PREFIX_3,
931 MOD_EVEX_0F11_PREFIX_1,
932 MOD_EVEX_0F11_PREFIX_3,
933 MOD_EVEX_0F12_PREFIX_0,
934 MOD_EVEX_0F16_PREFIX_0,
935 MOD_EVEX_0F38C6_REG_1,
936 MOD_EVEX_0F38C6_REG_2,
937 MOD_EVEX_0F38C6_REG_5,
938 MOD_EVEX_0F38C6_REG_6,
939 MOD_EVEX_0F38C7_REG_1,
940 MOD_EVEX_0F38C7_REG_2,
941 MOD_EVEX_0F38C7_REG_5,
942 MOD_EVEX_0F38C7_REG_6
963 PREFIX_MOD_0_0F01_REG_5,
964 PREFIX_MOD_3_0F01_REG_5_RM_0,
965 PREFIX_MOD_3_0F01_REG_5_RM_2,
1010 PREFIX_MOD_0_0FAE_REG_4,
1011 PREFIX_MOD_3_0FAE_REG_4,
1012 PREFIX_MOD_0_0FAE_REG_5,
1013 PREFIX_MOD_3_0FAE_REG_5,
1014 PREFIX_MOD_0_0FAE_REG_6,
1015 PREFIX_MOD_1_0FAE_REG_6,
1022 PREFIX_MOD_0_0FC7_REG_6,
1023 PREFIX_MOD_3_0FC7_REG_6,
1024 PREFIX_MOD_3_0FC7_REG_7,
1152 PREFIX_VEX_0F71_REG_2,
1153 PREFIX_VEX_0F71_REG_4,
1154 PREFIX_VEX_0F71_REG_6,
1155 PREFIX_VEX_0F72_REG_2,
1156 PREFIX_VEX_0F72_REG_4,
1157 PREFIX_VEX_0F72_REG_6,
1158 PREFIX_VEX_0F73_REG_2,
1159 PREFIX_VEX_0F73_REG_3,
1160 PREFIX_VEX_0F73_REG_6,
1161 PREFIX_VEX_0F73_REG_7,
1334 PREFIX_VEX_0F38F3_REG_1,
1335 PREFIX_VEX_0F38F3_REG_2,
1336 PREFIX_VEX_0F38F3_REG_3,
1455 PREFIX_EVEX_0F71_REG_2,
1456 PREFIX_EVEX_0F71_REG_4,
1457 PREFIX_EVEX_0F71_REG_6,
1458 PREFIX_EVEX_0F72_REG_0,
1459 PREFIX_EVEX_0F72_REG_1,
1460 PREFIX_EVEX_0F72_REG_2,
1461 PREFIX_EVEX_0F72_REG_4,
1462 PREFIX_EVEX_0F72_REG_6,
1463 PREFIX_EVEX_0F73_REG_2,
1464 PREFIX_EVEX_0F73_REG_3,
1465 PREFIX_EVEX_0F73_REG_6,
1466 PREFIX_EVEX_0F73_REG_7,
1662 PREFIX_EVEX_0F38C6_REG_1,
1663 PREFIX_EVEX_0F38C6_REG_2,
1664 PREFIX_EVEX_0F38C6_REG_5,
1665 PREFIX_EVEX_0F38C6_REG_6,
1666 PREFIX_EVEX_0F38C7_REG_1,
1667 PREFIX_EVEX_0F38C7_REG_2,
1668 PREFIX_EVEX_0F38C7_REG_5,
1669 PREFIX_EVEX_0F38C7_REG_6,
1771 THREE_BYTE_0F38 = 0,
1798 VEX_LEN_0F10_P_1 = 0,
1802 VEX_LEN_0F12_P_0_M_0,
1803 VEX_LEN_0F12_P_0_M_1,
1806 VEX_LEN_0F16_P_0_M_0,
1807 VEX_LEN_0F16_P_0_M_1,
1871 VEX_LEN_0FAE_R_2_M_0,
1872 VEX_LEN_0FAE_R_3_M_0,
1881 VEX_LEN_0F381A_P_2_M_0,
1884 VEX_LEN_0F385A_P_2_M_0,
1887 VEX_LEN_0F38F3_R_1_P_0,
1888 VEX_LEN_0F38F3_R_2_P_0,
1889 VEX_LEN_0F38F3_R_3_P_0,
1934 VEX_LEN_0FXOP_08_CC,
1935 VEX_LEN_0FXOP_08_CD,
1936 VEX_LEN_0FXOP_08_CE,
1937 VEX_LEN_0FXOP_08_CF,
1938 VEX_LEN_0FXOP_08_EC,
1939 VEX_LEN_0FXOP_08_ED,
1940 VEX_LEN_0FXOP_08_EE,
1941 VEX_LEN_0FXOP_08_EF,
1942 VEX_LEN_0FXOP_09_80,
1976 VEX_W_0F41_P_0_LEN_1,
1977 VEX_W_0F41_P_2_LEN_1,
1978 VEX_W_0F42_P_0_LEN_1,
1979 VEX_W_0F42_P_2_LEN_1,
1980 VEX_W_0F44_P_0_LEN_0,
1981 VEX_W_0F44_P_2_LEN_0,
1982 VEX_W_0F45_P_0_LEN_1,
1983 VEX_W_0F45_P_2_LEN_1,
1984 VEX_W_0F46_P_0_LEN_1,
1985 VEX_W_0F46_P_2_LEN_1,
1986 VEX_W_0F47_P_0_LEN_1,
1987 VEX_W_0F47_P_2_LEN_1,
1988 VEX_W_0F4A_P_0_LEN_1,
1989 VEX_W_0F4A_P_2_LEN_1,
1990 VEX_W_0F4B_P_0_LEN_1,
1991 VEX_W_0F4B_P_2_LEN_1,
2071 VEX_W_0F90_P_0_LEN_0,
2072 VEX_W_0F90_P_2_LEN_0,
2073 VEX_W_0F91_P_0_LEN_0,
2074 VEX_W_0F91_P_2_LEN_0,
2075 VEX_W_0F92_P_0_LEN_0,
2076 VEX_W_0F92_P_2_LEN_0,
2077 VEX_W_0F92_P_3_LEN_0,
2078 VEX_W_0F93_P_0_LEN_0,
2079 VEX_W_0F93_P_2_LEN_0,
2080 VEX_W_0F93_P_3_LEN_0,
2081 VEX_W_0F98_P_0_LEN_0,
2082 VEX_W_0F98_P_2_LEN_0,
2083 VEX_W_0F99_P_0_LEN_0,
2084 VEX_W_0F99_P_2_LEN_0,
2163 VEX_W_0F381A_P_2_M_0,
2175 VEX_W_0F382A_P_2_M_0,
2177 VEX_W_0F382C_P_2_M_0,
2178 VEX_W_0F382D_P_2_M_0,
2179 VEX_W_0F382E_P_2_M_0,
2180 VEX_W_0F382F_P_2_M_0,
2202 VEX_W_0F385A_P_2_M_0,
2227 VEX_W_0F3A30_P_2_LEN_0,
2228 VEX_W_0F3A31_P_2_LEN_0,
2229 VEX_W_0F3A32_P_2_LEN_0,
2230 VEX_W_0F3A33_P_2_LEN_0,
2249 EVEX_W_0F10_P_1_M_0,
2250 EVEX_W_0F10_P_1_M_1,
2252 EVEX_W_0F10_P_3_M_0,
2253 EVEX_W_0F10_P_3_M_1,
2255 EVEX_W_0F11_P_1_M_0,
2256 EVEX_W_0F11_P_1_M_1,
2258 EVEX_W_0F11_P_3_M_0,
2259 EVEX_W_0F11_P_3_M_1,
2260 EVEX_W_0F12_P_0_M_0,
2261 EVEX_W_0F12_P_0_M_1,
2271 EVEX_W_0F16_P_0_M_0,
2272 EVEX_W_0F16_P_0_M_1,
2343 EVEX_W_0F72_R_2_P_2,
2344 EVEX_W_0F72_R_6_P_2,
2345 EVEX_W_0F73_R_2_P_2,
2346 EVEX_W_0F73_R_6_P_2,
2454 EVEX_W_0F38C7_R_1_P_2,
2455 EVEX_W_0F38C7_R_2_P_2,
2456 EVEX_W_0F38C7_R_5_P_2,
2457 EVEX_W_0F38C7_R_6_P_2,
2498 typedef void (*op_rtn) (int bytemode, int sizeflag);
2507 unsigned int prefix_requirement;
2510 /* Upper case letters in the instruction names here are macros.
2511 'A' => print 'b' if no register operands or suffix_always is true
2512 'B' => print 'b' if suffix_always is true
2513 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
2515 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
2516 suffix_always is true
2517 'E' => print 'e' if 32-bit form of jcxz
2518 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
2519 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
2520 'H' => print ",pt" or ",pn" branch hint
2521 'I' => honor following macro letter even in Intel mode (implemented only
2522 for some of the macro letters)
2524 'K' => print 'd' or 'q' if rex prefix is present.
2525 'L' => print 'l' if suffix_always is true
2526 'M' => print 'r' if intel_mnemonic is false.
2527 'N' => print 'n' if instruction has no wait "prefix"
2528 'O' => print 'd' or 'o' (or 'q' in Intel mode)
2529 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
2530 or suffix_always is true. print 'q' if rex prefix is present.
2531 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
2533 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
2534 'S' => print 'w', 'l' or 'q' if suffix_always is true
2535 'T' => print 'q' in 64bit mode if instruction has no operand size
2536 prefix and behave as 'P' otherwise
2537 'U' => print 'q' in 64bit mode if instruction has no operand size
2538 prefix and behave as 'Q' otherwise
2539 'V' => print 'q' in 64bit mode if instruction has no operand size
2540 prefix and behave as 'S' otherwise
2541 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
2542 'X' => print 's', 'd' depending on data16 prefix (for XMM)
2544 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
2545 '!' => change condition from true to false or from false to true.
2546 '%' => add 1 upper case letter to the macro.
2547 '^' => print 'w' or 'l' depending on operand size prefix or
2548 suffix_always is true (lcall/ljmp).
2549 '@' => print 'q' for Intel64 ISA, 'w' or 'q' for AMD64 ISA depending
2550 on operand size prefix.
2551 '&' => print 'q' in 64bit mode for Intel64 ISA or if instruction
2552 has no operand size prefix for AMD64 ISA, behave as 'P'
2555 2 upper case letter macros:
2556 "XY" => print 'x' or 'y' if suffix_always is true or no register
2557 operands and no broadcast.
2558 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
2559 register operands and no broadcast.
2560 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
2561 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand
2562 or suffix_always is true
2563 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
2564 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
2565 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
2566 "LW" => print 'd', 'q' depending on the VEX.W bit
2567 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
2568 an operand size prefix, or suffix_always is true. print
2569 'q' if rex prefix is present.
2571 Many of the above letters print nothing in Intel mode. See "putop"
2574 Braces '{' and '}', and vertical bars '|', indicate alternative
2575 mnemonic strings for AT&T and Intel. */
2577 static const struct dis386 dis386[] = {
2579 { "addB", { Ebh1, Gb }, 0 },
2580 { "addS", { Evh1, Gv }, 0 },
2581 { "addB", { Gb, EbS }, 0 },
2582 { "addS", { Gv, EvS }, 0 },
2583 { "addB", { AL, Ib }, 0 },
2584 { "addS", { eAX, Iv }, 0 },
2585 { X86_64_TABLE (X86_64_06) },
2586 { X86_64_TABLE (X86_64_07) },
2588 { "orB", { Ebh1, Gb }, 0 },
2589 { "orS", { Evh1, Gv }, 0 },
2590 { "orB", { Gb, EbS }, 0 },
2591 { "orS", { Gv, EvS }, 0 },
2592 { "orB", { AL, Ib }, 0 },
2593 { "orS", { eAX, Iv }, 0 },
2594 { X86_64_TABLE (X86_64_0D) },
2595 { Bad_Opcode }, /* 0x0f extended opcode escape */
2597 { "adcB", { Ebh1, Gb }, 0 },
2598 { "adcS", { Evh1, Gv }, 0 },
2599 { "adcB", { Gb, EbS }, 0 },
2600 { "adcS", { Gv, EvS }, 0 },
2601 { "adcB", { AL, Ib }, 0 },
2602 { "adcS", { eAX, Iv }, 0 },
2603 { X86_64_TABLE (X86_64_16) },
2604 { X86_64_TABLE (X86_64_17) },
2606 { "sbbB", { Ebh1, Gb }, 0 },
2607 { "sbbS", { Evh1, Gv }, 0 },
2608 { "sbbB", { Gb, EbS }, 0 },
2609 { "sbbS", { Gv, EvS }, 0 },
2610 { "sbbB", { AL, Ib }, 0 },
2611 { "sbbS", { eAX, Iv }, 0 },
2612 { X86_64_TABLE (X86_64_1E) },
2613 { X86_64_TABLE (X86_64_1F) },
2615 { "andB", { Ebh1, Gb }, 0 },
2616 { "andS", { Evh1, Gv }, 0 },
2617 { "andB", { Gb, EbS }, 0 },
2618 { "andS", { Gv, EvS }, 0 },
2619 { "andB", { AL, Ib }, 0 },
2620 { "andS", { eAX, Iv }, 0 },
2621 { Bad_Opcode }, /* SEG ES prefix */
2622 { X86_64_TABLE (X86_64_27) },
2624 { "subB", { Ebh1, Gb }, 0 },
2625 { "subS", { Evh1, Gv }, 0 },
2626 { "subB", { Gb, EbS }, 0 },
2627 { "subS", { Gv, EvS }, 0 },
2628 { "subB", { AL, Ib }, 0 },
2629 { "subS", { eAX, Iv }, 0 },
2630 { Bad_Opcode }, /* SEG CS prefix */
2631 { X86_64_TABLE (X86_64_2F) },
2633 { "xorB", { Ebh1, Gb }, 0 },
2634 { "xorS", { Evh1, Gv }, 0 },
2635 { "xorB", { Gb, EbS }, 0 },
2636 { "xorS", { Gv, EvS }, 0 },
2637 { "xorB", { AL, Ib }, 0 },
2638 { "xorS", { eAX, Iv }, 0 },
2639 { Bad_Opcode }, /* SEG SS prefix */
2640 { X86_64_TABLE (X86_64_37) },
2642 { "cmpB", { Eb, Gb }, 0 },
2643 { "cmpS", { Ev, Gv }, 0 },
2644 { "cmpB", { Gb, EbS }, 0 },
2645 { "cmpS", { Gv, EvS }, 0 },
2646 { "cmpB", { AL, Ib }, 0 },
2647 { "cmpS", { eAX, Iv }, 0 },
2648 { Bad_Opcode }, /* SEG DS prefix */
2649 { X86_64_TABLE (X86_64_3F) },
2651 { "inc{S|}", { RMeAX }, 0 },
2652 { "inc{S|}", { RMeCX }, 0 },
2653 { "inc{S|}", { RMeDX }, 0 },
2654 { "inc{S|}", { RMeBX }, 0 },
2655 { "inc{S|}", { RMeSP }, 0 },
2656 { "inc{S|}", { RMeBP }, 0 },
2657 { "inc{S|}", { RMeSI }, 0 },
2658 { "inc{S|}", { RMeDI }, 0 },
2660 { "dec{S|}", { RMeAX }, 0 },
2661 { "dec{S|}", { RMeCX }, 0 },
2662 { "dec{S|}", { RMeDX }, 0 },
2663 { "dec{S|}", { RMeBX }, 0 },
2664 { "dec{S|}", { RMeSP }, 0 },
2665 { "dec{S|}", { RMeBP }, 0 },
2666 { "dec{S|}", { RMeSI }, 0 },
2667 { "dec{S|}", { RMeDI }, 0 },
2669 { "pushV", { RMrAX }, 0 },
2670 { "pushV", { RMrCX }, 0 },
2671 { "pushV", { RMrDX }, 0 },
2672 { "pushV", { RMrBX }, 0 },
2673 { "pushV", { RMrSP }, 0 },
2674 { "pushV", { RMrBP }, 0 },
2675 { "pushV", { RMrSI }, 0 },
2676 { "pushV", { RMrDI }, 0 },
2678 { "popV", { RMrAX }, 0 },
2679 { "popV", { RMrCX }, 0 },
2680 { "popV", { RMrDX }, 0 },
2681 { "popV", { RMrBX }, 0 },
2682 { "popV", { RMrSP }, 0 },
2683 { "popV", { RMrBP }, 0 },
2684 { "popV", { RMrSI }, 0 },
2685 { "popV", { RMrDI }, 0 },
2687 { X86_64_TABLE (X86_64_60) },
2688 { X86_64_TABLE (X86_64_61) },
2689 { X86_64_TABLE (X86_64_62) },
2690 { X86_64_TABLE (X86_64_63) },
2691 { Bad_Opcode }, /* seg fs */
2692 { Bad_Opcode }, /* seg gs */
2693 { Bad_Opcode }, /* op size prefix */
2694 { Bad_Opcode }, /* adr size prefix */
2696 { "pushT", { sIv }, 0 },
2697 { "imulS", { Gv, Ev, Iv }, 0 },
2698 { "pushT", { sIbT }, 0 },
2699 { "imulS", { Gv, Ev, sIb }, 0 },
2700 { "ins{b|}", { Ybr, indirDX }, 0 },
2701 { X86_64_TABLE (X86_64_6D) },
2702 { "outs{b|}", { indirDXr, Xb }, 0 },
2703 { X86_64_TABLE (X86_64_6F) },
2705 { "joH", { Jb, BND, cond_jump_flag }, 0 },
2706 { "jnoH", { Jb, BND, cond_jump_flag }, 0 },
2707 { "jbH", { Jb, BND, cond_jump_flag }, 0 },
2708 { "jaeH", { Jb, BND, cond_jump_flag }, 0 },
2709 { "jeH", { Jb, BND, cond_jump_flag }, 0 },
2710 { "jneH", { Jb, BND, cond_jump_flag }, 0 },
2711 { "jbeH", { Jb, BND, cond_jump_flag }, 0 },
2712 { "jaH", { Jb, BND, cond_jump_flag }, 0 },
2714 { "jsH", { Jb, BND, cond_jump_flag }, 0 },
2715 { "jnsH", { Jb, BND, cond_jump_flag }, 0 },
2716 { "jpH", { Jb, BND, cond_jump_flag }, 0 },
2717 { "jnpH", { Jb, BND, cond_jump_flag }, 0 },
2718 { "jlH", { Jb, BND, cond_jump_flag }, 0 },
2719 { "jgeH", { Jb, BND, cond_jump_flag }, 0 },
2720 { "jleH", { Jb, BND, cond_jump_flag }, 0 },
2721 { "jgH", { Jb, BND, cond_jump_flag }, 0 },
2723 { REG_TABLE (REG_80) },
2724 { REG_TABLE (REG_81) },
2725 { X86_64_TABLE (X86_64_82) },
2726 { REG_TABLE (REG_83) },
2727 { "testB", { Eb, Gb }, 0 },
2728 { "testS", { Ev, Gv }, 0 },
2729 { "xchgB", { Ebh2, Gb }, 0 },
2730 { "xchgS", { Evh2, Gv }, 0 },
2732 { "movB", { Ebh3, Gb }, 0 },
2733 { "movS", { Evh3, Gv }, 0 },
2734 { "movB", { Gb, EbS }, 0 },
2735 { "movS", { Gv, EvS }, 0 },
2736 { "movD", { Sv, Sw }, 0 },
2737 { MOD_TABLE (MOD_8D) },
2738 { "movD", { Sw, Sv }, 0 },
2739 { REG_TABLE (REG_8F) },
2741 { PREFIX_TABLE (PREFIX_90) },
2742 { "xchgS", { RMeCX, eAX }, 0 },
2743 { "xchgS", { RMeDX, eAX }, 0 },
2744 { "xchgS", { RMeBX, eAX }, 0 },
2745 { "xchgS", { RMeSP, eAX }, 0 },
2746 { "xchgS", { RMeBP, eAX }, 0 },
2747 { "xchgS", { RMeSI, eAX }, 0 },
2748 { "xchgS", { RMeDI, eAX }, 0 },
2750 { "cW{t|}R", { XX }, 0 },
2751 { "cR{t|}O", { XX }, 0 },
2752 { X86_64_TABLE (X86_64_9A) },
2753 { Bad_Opcode }, /* fwait */
2754 { "pushfT", { XX }, 0 },
2755 { "popfT", { XX }, 0 },
2756 { "sahf", { XX }, 0 },
2757 { "lahf", { XX }, 0 },
2759 { "mov%LB", { AL, Ob }, 0 },
2760 { "mov%LS", { eAX, Ov }, 0 },
2761 { "mov%LB", { Ob, AL }, 0 },
2762 { "mov%LS", { Ov, eAX }, 0 },
2763 { "movs{b|}", { Ybr, Xb }, 0 },
2764 { "movs{R|}", { Yvr, Xv }, 0 },
2765 { "cmps{b|}", { Xb, Yb }, 0 },
2766 { "cmps{R|}", { Xv, Yv }, 0 },
2768 { "testB", { AL, Ib }, 0 },
2769 { "testS", { eAX, Iv }, 0 },
2770 { "stosB", { Ybr, AL }, 0 },
2771 { "stosS", { Yvr, eAX }, 0 },
2772 { "lodsB", { ALr, Xb }, 0 },
2773 { "lodsS", { eAXr, Xv }, 0 },
2774 { "scasB", { AL, Yb }, 0 },
2775 { "scasS", { eAX, Yv }, 0 },
2777 { "movB", { RMAL, Ib }, 0 },
2778 { "movB", { RMCL, Ib }, 0 },
2779 { "movB", { RMDL, Ib }, 0 },
2780 { "movB", { RMBL, Ib }, 0 },
2781 { "movB", { RMAH, Ib }, 0 },
2782 { "movB", { RMCH, Ib }, 0 },
2783 { "movB", { RMDH, Ib }, 0 },
2784 { "movB", { RMBH, Ib }, 0 },
2786 { "mov%LV", { RMeAX, Iv64 }, 0 },
2787 { "mov%LV", { RMeCX, Iv64 }, 0 },
2788 { "mov%LV", { RMeDX, Iv64 }, 0 },
2789 { "mov%LV", { RMeBX, Iv64 }, 0 },
2790 { "mov%LV", { RMeSP, Iv64 }, 0 },
2791 { "mov%LV", { RMeBP, Iv64 }, 0 },
2792 { "mov%LV", { RMeSI, Iv64 }, 0 },
2793 { "mov%LV", { RMeDI, Iv64 }, 0 },
2795 { REG_TABLE (REG_C0) },
2796 { REG_TABLE (REG_C1) },
2797 { "retT", { Iw, BND }, 0 },
2798 { "retT", { BND }, 0 },
2799 { X86_64_TABLE (X86_64_C4) },
2800 { X86_64_TABLE (X86_64_C5) },
2801 { REG_TABLE (REG_C6) },
2802 { REG_TABLE (REG_C7) },
2804 { "enterT", { Iw, Ib }, 0 },
2805 { "leaveT", { XX }, 0 },
2806 { "Jret{|f}P", { Iw }, 0 },
2807 { "Jret{|f}P", { XX }, 0 },
2808 { "int3", { XX }, 0 },
2809 { "int", { Ib }, 0 },
2810 { X86_64_TABLE (X86_64_CE) },
2811 { "iret%LP", { XX }, 0 },
2813 { REG_TABLE (REG_D0) },
2814 { REG_TABLE (REG_D1) },
2815 { REG_TABLE (REG_D2) },
2816 { REG_TABLE (REG_D3) },
2817 { X86_64_TABLE (X86_64_D4) },
2818 { X86_64_TABLE (X86_64_D5) },
2820 { "xlat", { DSBX }, 0 },
2831 { "loopneFH", { Jb, XX, loop_jcxz_flag }, 0 },
2832 { "loopeFH", { Jb, XX, loop_jcxz_flag }, 0 },
2833 { "loopFH", { Jb, XX, loop_jcxz_flag }, 0 },
2834 { "jEcxzH", { Jb, XX, loop_jcxz_flag }, 0 },
2835 { "inB", { AL, Ib }, 0 },
2836 { "inG", { zAX, Ib }, 0 },
2837 { "outB", { Ib, AL }, 0 },
2838 { "outG", { Ib, zAX }, 0 },
2840 { X86_64_TABLE (X86_64_E8) },
2841 { X86_64_TABLE (X86_64_E9) },
2842 { X86_64_TABLE (X86_64_EA) },
2843 { "jmp", { Jb, BND }, 0 },
2844 { "inB", { AL, indirDX }, 0 },
2845 { "inG", { zAX, indirDX }, 0 },
2846 { "outB", { indirDX, AL }, 0 },
2847 { "outG", { indirDX, zAX }, 0 },
2849 { Bad_Opcode }, /* lock prefix */
2850 { "icebp", { XX }, 0 },
2851 { Bad_Opcode }, /* repne */
2852 { Bad_Opcode }, /* repz */
2853 { "hlt", { XX }, 0 },
2854 { "cmc", { XX }, 0 },
2855 { REG_TABLE (REG_F6) },
2856 { REG_TABLE (REG_F7) },
2858 { "clc", { XX }, 0 },
2859 { "stc", { XX }, 0 },
2860 { "cli", { XX }, 0 },
2861 { "sti", { XX }, 0 },
2862 { "cld", { XX }, 0 },
2863 { "std", { XX }, 0 },
2864 { REG_TABLE (REG_FE) },
2865 { REG_TABLE (REG_FF) },
2868 static const struct dis386 dis386_twobyte[] = {
2870 { REG_TABLE (REG_0F00 ) },
2871 { REG_TABLE (REG_0F01 ) },
2872 { "larS", { Gv, Ew }, 0 },
2873 { "lslS", { Gv, Ew }, 0 },
2875 { "syscall", { XX }, 0 },
2876 { "clts", { XX }, 0 },
2877 { "sysret%LP", { XX }, 0 },
2879 { "invd", { XX }, 0 },
2880 { PREFIX_TABLE (PREFIX_0F09) },
2882 { "ud2", { XX }, 0 },
2884 { REG_TABLE (REG_0F0D) },
2885 { "femms", { XX }, 0 },
2886 { "", { MX, EM, OPSUF }, 0 }, /* See OP_3DNowSuffix. */
2888 { PREFIX_TABLE (PREFIX_0F10) },
2889 { PREFIX_TABLE (PREFIX_0F11) },
2890 { PREFIX_TABLE (PREFIX_0F12) },
2891 { MOD_TABLE (MOD_0F13) },
2892 { "unpcklpX", { XM, EXx }, PREFIX_OPCODE },
2893 { "unpckhpX", { XM, EXx }, PREFIX_OPCODE },
2894 { PREFIX_TABLE (PREFIX_0F16) },
2895 { MOD_TABLE (MOD_0F17) },
2897 { REG_TABLE (REG_0F18) },
2898 { "nopQ", { Ev }, 0 },
2899 { PREFIX_TABLE (PREFIX_0F1A) },
2900 { PREFIX_TABLE (PREFIX_0F1B) },
2901 { "nopQ", { Ev }, 0 },
2902 { "nopQ", { Ev }, 0 },
2903 { PREFIX_TABLE (PREFIX_0F1E) },
2904 { "nopQ", { Ev }, 0 },
2906 { "movZ", { Rm, Cm }, 0 },
2907 { "movZ", { Rm, Dm }, 0 },
2908 { "movZ", { Cm, Rm }, 0 },
2909 { "movZ", { Dm, Rm }, 0 },
2910 { MOD_TABLE (MOD_0F24) },
2912 { MOD_TABLE (MOD_0F26) },
2915 { "movapX", { XM, EXx }, PREFIX_OPCODE },
2916 { "movapX", { EXxS, XM }, PREFIX_OPCODE },
2917 { PREFIX_TABLE (PREFIX_0F2A) },
2918 { PREFIX_TABLE (PREFIX_0F2B) },
2919 { PREFIX_TABLE (PREFIX_0F2C) },
2920 { PREFIX_TABLE (PREFIX_0F2D) },
2921 { PREFIX_TABLE (PREFIX_0F2E) },
2922 { PREFIX_TABLE (PREFIX_0F2F) },
2924 { "wrmsr", { XX }, 0 },
2925 { "rdtsc", { XX }, 0 },
2926 { "rdmsr", { XX }, 0 },
2927 { "rdpmc", { XX }, 0 },
2928 { "sysenter", { XX }, 0 },
2929 { "sysexit", { XX }, 0 },
2931 { "getsec", { XX }, 0 },
2933 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38, PREFIX_OPCODE) },
2935 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A, PREFIX_OPCODE) },
2942 { "cmovoS", { Gv, Ev }, 0 },
2943 { "cmovnoS", { Gv, Ev }, 0 },
2944 { "cmovbS", { Gv, Ev }, 0 },
2945 { "cmovaeS", { Gv, Ev }, 0 },
2946 { "cmoveS", { Gv, Ev }, 0 },
2947 { "cmovneS", { Gv, Ev }, 0 },
2948 { "cmovbeS", { Gv, Ev }, 0 },
2949 { "cmovaS", { Gv, Ev }, 0 },
2951 { "cmovsS", { Gv, Ev }, 0 },
2952 { "cmovnsS", { Gv, Ev }, 0 },
2953 { "cmovpS", { Gv, Ev }, 0 },
2954 { "cmovnpS", { Gv, Ev }, 0 },
2955 { "cmovlS", { Gv, Ev }, 0 },
2956 { "cmovgeS", { Gv, Ev }, 0 },
2957 { "cmovleS", { Gv, Ev }, 0 },
2958 { "cmovgS", { Gv, Ev }, 0 },
2960 { MOD_TABLE (MOD_0F51) },
2961 { PREFIX_TABLE (PREFIX_0F51) },
2962 { PREFIX_TABLE (PREFIX_0F52) },
2963 { PREFIX_TABLE (PREFIX_0F53) },
2964 { "andpX", { XM, EXx }, PREFIX_OPCODE },
2965 { "andnpX", { XM, EXx }, PREFIX_OPCODE },
2966 { "orpX", { XM, EXx }, PREFIX_OPCODE },
2967 { "xorpX", { XM, EXx }, PREFIX_OPCODE },
2969 { PREFIX_TABLE (PREFIX_0F58) },
2970 { PREFIX_TABLE (PREFIX_0F59) },
2971 { PREFIX_TABLE (PREFIX_0F5A) },
2972 { PREFIX_TABLE (PREFIX_0F5B) },
2973 { PREFIX_TABLE (PREFIX_0F5C) },
2974 { PREFIX_TABLE (PREFIX_0F5D) },
2975 { PREFIX_TABLE (PREFIX_0F5E) },
2976 { PREFIX_TABLE (PREFIX_0F5F) },
2978 { PREFIX_TABLE (PREFIX_0F60) },
2979 { PREFIX_TABLE (PREFIX_0F61) },
2980 { PREFIX_TABLE (PREFIX_0F62) },
2981 { "packsswb", { MX, EM }, PREFIX_OPCODE },
2982 { "pcmpgtb", { MX, EM }, PREFIX_OPCODE },
2983 { "pcmpgtw", { MX, EM }, PREFIX_OPCODE },
2984 { "pcmpgtd", { MX, EM }, PREFIX_OPCODE },
2985 { "packuswb", { MX, EM }, PREFIX_OPCODE },
2987 { "punpckhbw", { MX, EM }, PREFIX_OPCODE },
2988 { "punpckhwd", { MX, EM }, PREFIX_OPCODE },
2989 { "punpckhdq", { MX, EM }, PREFIX_OPCODE },
2990 { "packssdw", { MX, EM }, PREFIX_OPCODE },
2991 { PREFIX_TABLE (PREFIX_0F6C) },
2992 { PREFIX_TABLE (PREFIX_0F6D) },
2993 { "movK", { MX, Edq }, PREFIX_OPCODE },
2994 { PREFIX_TABLE (PREFIX_0F6F) },
2996 { PREFIX_TABLE (PREFIX_0F70) },
2997 { REG_TABLE (REG_0F71) },
2998 { REG_TABLE (REG_0F72) },
2999 { REG_TABLE (REG_0F73) },
3000 { "pcmpeqb", { MX, EM }, PREFIX_OPCODE },
3001 { "pcmpeqw", { MX, EM }, PREFIX_OPCODE },
3002 { "pcmpeqd", { MX, EM }, PREFIX_OPCODE },
3003 { "emms", { XX }, PREFIX_OPCODE },
3005 { PREFIX_TABLE (PREFIX_0F78) },
3006 { PREFIX_TABLE (PREFIX_0F79) },
3009 { PREFIX_TABLE (PREFIX_0F7C) },
3010 { PREFIX_TABLE (PREFIX_0F7D) },
3011 { PREFIX_TABLE (PREFIX_0F7E) },
3012 { PREFIX_TABLE (PREFIX_0F7F) },
3014 { "joH", { Jv, BND, cond_jump_flag }, 0 },
3015 { "jnoH", { Jv, BND, cond_jump_flag }, 0 },
3016 { "jbH", { Jv, BND, cond_jump_flag }, 0 },
3017 { "jaeH", { Jv, BND, cond_jump_flag }, 0 },
3018 { "jeH", { Jv, BND, cond_jump_flag }, 0 },
3019 { "jneH", { Jv, BND, cond_jump_flag }, 0 },
3020 { "jbeH", { Jv, BND, cond_jump_flag }, 0 },
3021 { "jaH", { Jv, BND, cond_jump_flag }, 0 },
3023 { "jsH", { Jv, BND, cond_jump_flag }, 0 },
3024 { "jnsH", { Jv, BND, cond_jump_flag }, 0 },
3025 { "jpH", { Jv, BND, cond_jump_flag }, 0 },
3026 { "jnpH", { Jv, BND, cond_jump_flag }, 0 },
3027 { "jlH", { Jv, BND, cond_jump_flag }, 0 },
3028 { "jgeH", { Jv, BND, cond_jump_flag }, 0 },
3029 { "jleH", { Jv, BND, cond_jump_flag }, 0 },
3030 { "jgH", { Jv, BND, cond_jump_flag }, 0 },
3032 { "seto", { Eb }, 0 },
3033 { "setno", { Eb }, 0 },
3034 { "setb", { Eb }, 0 },
3035 { "setae", { Eb }, 0 },
3036 { "sete", { Eb }, 0 },
3037 { "setne", { Eb }, 0 },
3038 { "setbe", { Eb }, 0 },
3039 { "seta", { Eb }, 0 },
3041 { "sets", { Eb }, 0 },
3042 { "setns", { Eb }, 0 },
3043 { "setp", { Eb }, 0 },
3044 { "setnp", { Eb }, 0 },
3045 { "setl", { Eb }, 0 },
3046 { "setge", { Eb }, 0 },
3047 { "setle", { Eb }, 0 },
3048 { "setg", { Eb }, 0 },
3050 { "pushT", { fs }, 0 },
3051 { "popT", { fs }, 0 },
3052 { "cpuid", { XX }, 0 },
3053 { "btS", { Ev, Gv }, 0 },
3054 { "shldS", { Ev, Gv, Ib }, 0 },
3055 { "shldS", { Ev, Gv, CL }, 0 },
3056 { REG_TABLE (REG_0FA6) },
3057 { REG_TABLE (REG_0FA7) },
3059 { "pushT", { gs }, 0 },
3060 { "popT", { gs }, 0 },
3061 { "rsm", { XX }, 0 },
3062 { "btsS", { Evh1, Gv }, 0 },
3063 { "shrdS", { Ev, Gv, Ib }, 0 },
3064 { "shrdS", { Ev, Gv, CL }, 0 },
3065 { REG_TABLE (REG_0FAE) },
3066 { "imulS", { Gv, Ev }, 0 },
3068 { "cmpxchgB", { Ebh1, Gb }, 0 },
3069 { "cmpxchgS", { Evh1, Gv }, 0 },
3070 { MOD_TABLE (MOD_0FB2) },
3071 { "btrS", { Evh1, Gv }, 0 },
3072 { MOD_TABLE (MOD_0FB4) },
3073 { MOD_TABLE (MOD_0FB5) },
3074 { "movz{bR|x}", { Gv, Eb }, 0 },
3075 { "movz{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movzww ! */
3077 { PREFIX_TABLE (PREFIX_0FB8) },
3078 { "ud1S", { Gv, Ev }, 0 },
3079 { REG_TABLE (REG_0FBA) },
3080 { "btcS", { Evh1, Gv }, 0 },
3081 { PREFIX_TABLE (PREFIX_0FBC) },
3082 { PREFIX_TABLE (PREFIX_0FBD) },
3083 { "movs{bR|x}", { Gv, Eb }, 0 },
3084 { "movs{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movsww ! */
3086 { "xaddB", { Ebh1, Gb }, 0 },
3087 { "xaddS", { Evh1, Gv }, 0 },
3088 { PREFIX_TABLE (PREFIX_0FC2) },
3089 { MOD_TABLE (MOD_0FC3) },
3090 { "pinsrw", { MX, Edqw, Ib }, PREFIX_OPCODE },
3091 { "pextrw", { Gdq, MS, Ib }, PREFIX_OPCODE },
3092 { "shufpX", { XM, EXx, Ib }, PREFIX_OPCODE },
3093 { REG_TABLE (REG_0FC7) },
3095 { "bswap", { RMeAX }, 0 },
3096 { "bswap", { RMeCX }, 0 },
3097 { "bswap", { RMeDX }, 0 },
3098 { "bswap", { RMeBX }, 0 },
3099 { "bswap", { RMeSP }, 0 },
3100 { "bswap", { RMeBP }, 0 },
3101 { "bswap", { RMeSI }, 0 },
3102 { "bswap", { RMeDI }, 0 },
3104 { PREFIX_TABLE (PREFIX_0FD0) },
3105 { "psrlw", { MX, EM }, PREFIX_OPCODE },
3106 { "psrld", { MX, EM }, PREFIX_OPCODE },
3107 { "psrlq", { MX, EM }, PREFIX_OPCODE },
3108 { "paddq", { MX, EM }, PREFIX_OPCODE },
3109 { "pmullw", { MX, EM }, PREFIX_OPCODE },
3110 { PREFIX_TABLE (PREFIX_0FD6) },
3111 { MOD_TABLE (MOD_0FD7) },
3113 { "psubusb", { MX, EM }, PREFIX_OPCODE },
3114 { "psubusw", { MX, EM }, PREFIX_OPCODE },
3115 { "pminub", { MX, EM }, PREFIX_OPCODE },
3116 { "pand", { MX, EM }, PREFIX_OPCODE },
3117 { "paddusb", { MX, EM }, PREFIX_OPCODE },
3118 { "paddusw", { MX, EM }, PREFIX_OPCODE },
3119 { "pmaxub", { MX, EM }, PREFIX_OPCODE },
3120 { "pandn", { MX, EM }, PREFIX_OPCODE },
3122 { "pavgb", { MX, EM }, PREFIX_OPCODE },
3123 { "psraw", { MX, EM }, PREFIX_OPCODE },
3124 { "psrad", { MX, EM }, PREFIX_OPCODE },
3125 { "pavgw", { MX, EM }, PREFIX_OPCODE },
3126 { "pmulhuw", { MX, EM }, PREFIX_OPCODE },
3127 { "pmulhw", { MX, EM }, PREFIX_OPCODE },
3128 { PREFIX_TABLE (PREFIX_0FE6) },
3129 { PREFIX_TABLE (PREFIX_0FE7) },
3131 { "psubsb", { MX, EM }, PREFIX_OPCODE },
3132 { "psubsw", { MX, EM }, PREFIX_OPCODE },
3133 { "pminsw", { MX, EM }, PREFIX_OPCODE },
3134 { "por", { MX, EM }, PREFIX_OPCODE },
3135 { "paddsb", { MX, EM }, PREFIX_OPCODE },
3136 { "paddsw", { MX, EM }, PREFIX_OPCODE },
3137 { "pmaxsw", { MX, EM }, PREFIX_OPCODE },
3138 { "pxor", { MX, EM }, PREFIX_OPCODE },
3140 { PREFIX_TABLE (PREFIX_0FF0) },
3141 { "psllw", { MX, EM }, PREFIX_OPCODE },
3142 { "pslld", { MX, EM }, PREFIX_OPCODE },
3143 { "psllq", { MX, EM }, PREFIX_OPCODE },
3144 { "pmuludq", { MX, EM }, PREFIX_OPCODE },
3145 { "pmaddwd", { MX, EM }, PREFIX_OPCODE },
3146 { "psadbw", { MX, EM }, PREFIX_OPCODE },
3147 { PREFIX_TABLE (PREFIX_0FF7) },
3149 { "psubb", { MX, EM }, PREFIX_OPCODE },
3150 { "psubw", { MX, EM }, PREFIX_OPCODE },
3151 { "psubd", { MX, EM }, PREFIX_OPCODE },
3152 { "psubq", { MX, EM }, PREFIX_OPCODE },
3153 { "paddb", { MX, EM }, PREFIX_OPCODE },
3154 { "paddw", { MX, EM }, PREFIX_OPCODE },
3155 { "paddd", { MX, EM }, PREFIX_OPCODE },
3156 { "ud0S", { Gv, Ev }, 0 },
3159 static const unsigned char onebyte_has_modrm[256] = {
3160 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
3161 /* ------------------------------- */
3162 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
3163 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
3164 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
3165 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
3166 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
3167 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
3168 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
3169 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
3170 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
3171 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
3172 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
3173 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
3174 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
3175 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
3176 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
3177 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
3178 /* ------------------------------- */
3179 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
3182 static const unsigned char twobyte_has_modrm[256] = {
3183 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
3184 /* ------------------------------- */
3185 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
3186 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
3187 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
3188 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
3189 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
3190 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
3191 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
3192 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
3193 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
3194 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
3195 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
3196 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
3197 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
3198 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
3199 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
3200 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
3201 /* ------------------------------- */
3202 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
3205 static char obuf[100];
3207 static char *mnemonicendp;
3208 static char scratchbuf[100];
3209 static unsigned char *start_codep;
3210 static unsigned char *insn_codep;
3211 static unsigned char *codep;
3212 static unsigned char *end_codep;
3213 static int last_lock_prefix;
3214 static int last_repz_prefix;
3215 static int last_repnz_prefix;
3216 static int last_data_prefix;
3217 static int last_addr_prefix;
3218 static int last_rex_prefix;
3219 static int last_seg_prefix;
3220 static int fwait_prefix;
3221 /* The active segment register prefix. */
3222 static int active_seg_prefix;
3223 #define MAX_CODE_LENGTH 15
3224 /* We can up to 14 prefixes since the maximum instruction length is
3226 static int all_prefixes[MAX_CODE_LENGTH - 1];
3227 static disassemble_info *the_info;
3235 static unsigned char need_modrm;
3245 int register_specifier;
3252 int mask_register_specifier;
3258 static unsigned char need_vex;
3259 static unsigned char need_vex_reg;
3260 static unsigned char vex_w_done;
3268 /* If we are accessing mod/rm/reg without need_modrm set, then the
3269 values are stale. Hitting this abort likely indicates that you
3270 need to update onebyte_has_modrm or twobyte_has_modrm. */
3271 #define MODRM_CHECK if (!need_modrm) abort ()
3273 static const char **names64;
3274 static const char **names32;
3275 static const char **names16;
3276 static const char **names8;
3277 static const char **names8rex;
3278 static const char **names_seg;
3279 static const char *index64;
3280 static const char *index32;
3281 static const char **index16;
3282 static const char **names_bnd;
3284 static const char *intel_names64[] = {
3285 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
3286 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
3288 static const char *intel_names32[] = {
3289 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
3290 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
3292 static const char *intel_names16[] = {
3293 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
3294 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
3296 static const char *intel_names8[] = {
3297 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
3299 static const char *intel_names8rex[] = {
3300 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
3301 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
3303 static const char *intel_names_seg[] = {
3304 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
3306 static const char *intel_index64 = "riz";
3307 static const char *intel_index32 = "eiz";
3308 static const char *intel_index16[] = {
3309 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
3312 static const char *att_names64[] = {
3313 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
3314 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
3316 static const char *att_names32[] = {
3317 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
3318 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
3320 static const char *att_names16[] = {
3321 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
3322 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
3324 static const char *att_names8[] = {
3325 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
3327 static const char *att_names8rex[] = {
3328 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
3329 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
3331 static const char *att_names_seg[] = {
3332 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
3334 static const char *att_index64 = "%riz";
3335 static const char *att_index32 = "%eiz";
3336 static const char *att_index16[] = {
3337 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
3340 static const char **names_mm;
3341 static const char *intel_names_mm[] = {
3342 "mm0", "mm1", "mm2", "mm3",
3343 "mm4", "mm5", "mm6", "mm7"
3345 static const char *att_names_mm[] = {
3346 "%mm0", "%mm1", "%mm2", "%mm3",
3347 "%mm4", "%mm5", "%mm6", "%mm7"
3350 static const char *intel_names_bnd[] = {
3351 "bnd0", "bnd1", "bnd2", "bnd3"
3354 static const char *att_names_bnd[] = {
3355 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
3358 static const char **names_xmm;
3359 static const char *intel_names_xmm[] = {
3360 "xmm0", "xmm1", "xmm2", "xmm3",
3361 "xmm4", "xmm5", "xmm6", "xmm7",
3362 "xmm8", "xmm9", "xmm10", "xmm11",
3363 "xmm12", "xmm13", "xmm14", "xmm15",
3364 "xmm16", "xmm17", "xmm18", "xmm19",
3365 "xmm20", "xmm21", "xmm22", "xmm23",
3366 "xmm24", "xmm25", "xmm26", "xmm27",
3367 "xmm28", "xmm29", "xmm30", "xmm31"
3369 static const char *att_names_xmm[] = {
3370 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
3371 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
3372 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
3373 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
3374 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
3375 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
3376 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
3377 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
3380 static const char **names_ymm;
3381 static const char *intel_names_ymm[] = {
3382 "ymm0", "ymm1", "ymm2", "ymm3",
3383 "ymm4", "ymm5", "ymm6", "ymm7",
3384 "ymm8", "ymm9", "ymm10", "ymm11",
3385 "ymm12", "ymm13", "ymm14", "ymm15",
3386 "ymm16", "ymm17", "ymm18", "ymm19",
3387 "ymm20", "ymm21", "ymm22", "ymm23",
3388 "ymm24", "ymm25", "ymm26", "ymm27",
3389 "ymm28", "ymm29", "ymm30", "ymm31"
3391 static const char *att_names_ymm[] = {
3392 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
3393 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
3394 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
3395 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
3396 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
3397 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
3398 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
3399 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
3402 static const char **names_zmm;
3403 static const char *intel_names_zmm[] = {
3404 "zmm0", "zmm1", "zmm2", "zmm3",
3405 "zmm4", "zmm5", "zmm6", "zmm7",
3406 "zmm8", "zmm9", "zmm10", "zmm11",
3407 "zmm12", "zmm13", "zmm14", "zmm15",
3408 "zmm16", "zmm17", "zmm18", "zmm19",
3409 "zmm20", "zmm21", "zmm22", "zmm23",
3410 "zmm24", "zmm25", "zmm26", "zmm27",
3411 "zmm28", "zmm29", "zmm30", "zmm31"
3413 static const char *att_names_zmm[] = {
3414 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
3415 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
3416 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
3417 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
3418 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
3419 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
3420 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
3421 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
3424 static const char **names_mask;
3425 static const char *intel_names_mask[] = {
3426 "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7"
3428 static const char *att_names_mask[] = {
3429 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
3432 static const char *names_rounding[] =
3440 static const struct dis386 reg_table[][8] = {
3443 { "addA", { Ebh1, Ib }, 0 },
3444 { "orA", { Ebh1, Ib }, 0 },
3445 { "adcA", { Ebh1, Ib }, 0 },
3446 { "sbbA", { Ebh1, Ib }, 0 },
3447 { "andA", { Ebh1, Ib }, 0 },
3448 { "subA", { Ebh1, Ib }, 0 },
3449 { "xorA", { Ebh1, Ib }, 0 },
3450 { "cmpA", { Eb, Ib }, 0 },
3454 { "addQ", { Evh1, Iv }, 0 },
3455 { "orQ", { Evh1, Iv }, 0 },
3456 { "adcQ", { Evh1, Iv }, 0 },
3457 { "sbbQ", { Evh1, Iv }, 0 },
3458 { "andQ", { Evh1, Iv }, 0 },
3459 { "subQ", { Evh1, Iv }, 0 },
3460 { "xorQ", { Evh1, Iv }, 0 },
3461 { "cmpQ", { Ev, Iv }, 0 },
3465 { "addQ", { Evh1, sIb }, 0 },
3466 { "orQ", { Evh1, sIb }, 0 },
3467 { "adcQ", { Evh1, sIb }, 0 },
3468 { "sbbQ", { Evh1, sIb }, 0 },
3469 { "andQ", { Evh1, sIb }, 0 },
3470 { "subQ", { Evh1, sIb }, 0 },
3471 { "xorQ", { Evh1, sIb }, 0 },
3472 { "cmpQ", { Ev, sIb }, 0 },
3476 { "popU", { stackEv }, 0 },
3477 { XOP_8F_TABLE (XOP_09) },
3481 { XOP_8F_TABLE (XOP_09) },
3485 { "rolA", { Eb, Ib }, 0 },
3486 { "rorA", { Eb, Ib }, 0 },
3487 { "rclA", { Eb, Ib }, 0 },
3488 { "rcrA", { Eb, Ib }, 0 },
3489 { "shlA", { Eb, Ib }, 0 },
3490 { "shrA", { Eb, Ib }, 0 },
3491 { "shlA", { Eb, Ib }, 0 },
3492 { "sarA", { Eb, Ib }, 0 },
3496 { "rolQ", { Ev, Ib }, 0 },
3497 { "rorQ", { Ev, Ib }, 0 },
3498 { "rclQ", { Ev, Ib }, 0 },
3499 { "rcrQ", { Ev, Ib }, 0 },
3500 { "shlQ", { Ev, Ib }, 0 },
3501 { "shrQ", { Ev, Ib }, 0 },
3502 { "shlQ", { Ev, Ib }, 0 },
3503 { "sarQ", { Ev, Ib }, 0 },
3507 { "movA", { Ebh3, Ib }, 0 },
3514 { MOD_TABLE (MOD_C6_REG_7) },
3518 { "movQ", { Evh3, Iv }, 0 },
3525 { MOD_TABLE (MOD_C7_REG_7) },
3529 { "rolA", { Eb, I1 }, 0 },
3530 { "rorA", { Eb, I1 }, 0 },
3531 { "rclA", { Eb, I1 }, 0 },
3532 { "rcrA", { Eb, I1 }, 0 },
3533 { "shlA", { Eb, I1 }, 0 },
3534 { "shrA", { Eb, I1 }, 0 },
3535 { "shlA", { Eb, I1 }, 0 },
3536 { "sarA", { Eb, I1 }, 0 },
3540 { "rolQ", { Ev, I1 }, 0 },
3541 { "rorQ", { Ev, I1 }, 0 },
3542 { "rclQ", { Ev, I1 }, 0 },
3543 { "rcrQ", { Ev, I1 }, 0 },
3544 { "shlQ", { Ev, I1 }, 0 },
3545 { "shrQ", { Ev, I1 }, 0 },
3546 { "shlQ", { Ev, I1 }, 0 },
3547 { "sarQ", { Ev, I1 }, 0 },
3551 { "rolA", { Eb, CL }, 0 },
3552 { "rorA", { Eb, CL }, 0 },
3553 { "rclA", { Eb, CL }, 0 },
3554 { "rcrA", { Eb, CL }, 0 },
3555 { "shlA", { Eb, CL }, 0 },
3556 { "shrA", { Eb, CL }, 0 },
3557 { "shlA", { Eb, CL }, 0 },
3558 { "sarA", { Eb, CL }, 0 },
3562 { "rolQ", { Ev, CL }, 0 },
3563 { "rorQ", { Ev, CL }, 0 },
3564 { "rclQ", { Ev, CL }, 0 },
3565 { "rcrQ", { Ev, CL }, 0 },
3566 { "shlQ", { Ev, CL }, 0 },
3567 { "shrQ", { Ev, CL }, 0 },
3568 { "shlQ", { Ev, CL }, 0 },
3569 { "sarQ", { Ev, CL }, 0 },
3573 { "testA", { Eb, Ib }, 0 },
3574 { "testA", { Eb, Ib }, 0 },
3575 { "notA", { Ebh1 }, 0 },
3576 { "negA", { Ebh1 }, 0 },
3577 { "mulA", { Eb }, 0 }, /* Don't print the implicit %al register, */
3578 { "imulA", { Eb }, 0 }, /* to distinguish these opcodes from other */
3579 { "divA", { Eb }, 0 }, /* mul/imul opcodes. Do the same for div */
3580 { "idivA", { Eb }, 0 }, /* and idiv for consistency. */
3584 { "testQ", { Ev, Iv }, 0 },
3585 { "testQ", { Ev, Iv }, 0 },
3586 { "notQ", { Evh1 }, 0 },
3587 { "negQ", { Evh1 }, 0 },
3588 { "mulQ", { Ev }, 0 }, /* Don't print the implicit register. */
3589 { "imulQ", { Ev }, 0 },
3590 { "divQ", { Ev }, 0 },
3591 { "idivQ", { Ev }, 0 },
3595 { "incA", { Ebh1 }, 0 },
3596 { "decA", { Ebh1 }, 0 },
3600 { "incQ", { Evh1 }, 0 },
3601 { "decQ", { Evh1 }, 0 },
3602 { "call{&|}", { NOTRACK, indirEv, BND }, 0 },
3603 { MOD_TABLE (MOD_FF_REG_3) },
3604 { "jmp{&|}", { NOTRACK, indirEv, BND }, 0 },
3605 { MOD_TABLE (MOD_FF_REG_5) },
3606 { "pushU", { stackEv }, 0 },
3611 { "sldtD", { Sv }, 0 },
3612 { "strD", { Sv }, 0 },
3613 { "lldt", { Ew }, 0 },
3614 { "ltr", { Ew }, 0 },
3615 { "verr", { Ew }, 0 },
3616 { "verw", { Ew }, 0 },
3622 { MOD_TABLE (MOD_0F01_REG_0) },
3623 { MOD_TABLE (MOD_0F01_REG_1) },
3624 { MOD_TABLE (MOD_0F01_REG_2) },
3625 { MOD_TABLE (MOD_0F01_REG_3) },
3626 { "smswD", { Sv }, 0 },
3627 { MOD_TABLE (MOD_0F01_REG_5) },
3628 { "lmsw", { Ew }, 0 },
3629 { MOD_TABLE (MOD_0F01_REG_7) },
3633 { "prefetch", { Mb }, 0 },
3634 { "prefetchw", { Mb }, 0 },
3635 { "prefetchwt1", { Mb }, 0 },
3636 { "prefetch", { Mb }, 0 },
3637 { "prefetch", { Mb }, 0 },
3638 { "prefetch", { Mb }, 0 },
3639 { "prefetch", { Mb }, 0 },
3640 { "prefetch", { Mb }, 0 },
3644 { MOD_TABLE (MOD_0F18_REG_0) },
3645 { MOD_TABLE (MOD_0F18_REG_1) },
3646 { MOD_TABLE (MOD_0F18_REG_2) },
3647 { MOD_TABLE (MOD_0F18_REG_3) },
3648 { MOD_TABLE (MOD_0F18_REG_4) },
3649 { MOD_TABLE (MOD_0F18_REG_5) },
3650 { MOD_TABLE (MOD_0F18_REG_6) },
3651 { MOD_TABLE (MOD_0F18_REG_7) },
3653 /* REG_0F1E_MOD_3 */
3655 { "nopQ", { Ev }, 0 },
3656 { "rdsspK", { Rdq }, PREFIX_OPCODE },
3657 { "nopQ", { Ev }, 0 },
3658 { "nopQ", { Ev }, 0 },
3659 { "nopQ", { Ev }, 0 },
3660 { "nopQ", { Ev }, 0 },
3661 { "nopQ", { Ev }, 0 },
3662 { RM_TABLE (RM_0F1E_MOD_3_REG_7) },
3668 { MOD_TABLE (MOD_0F71_REG_2) },
3670 { MOD_TABLE (MOD_0F71_REG_4) },
3672 { MOD_TABLE (MOD_0F71_REG_6) },
3678 { MOD_TABLE (MOD_0F72_REG_2) },
3680 { MOD_TABLE (MOD_0F72_REG_4) },
3682 { MOD_TABLE (MOD_0F72_REG_6) },
3688 { MOD_TABLE (MOD_0F73_REG_2) },
3689 { MOD_TABLE (MOD_0F73_REG_3) },
3692 { MOD_TABLE (MOD_0F73_REG_6) },
3693 { MOD_TABLE (MOD_0F73_REG_7) },
3697 { "montmul", { { OP_0f07, 0 } }, 0 },
3698 { "xsha1", { { OP_0f07, 0 } }, 0 },
3699 { "xsha256", { { OP_0f07, 0 } }, 0 },
3703 { "xstore-rng", { { OP_0f07, 0 } }, 0 },
3704 { "xcrypt-ecb", { { OP_0f07, 0 } }, 0 },
3705 { "xcrypt-cbc", { { OP_0f07, 0 } }, 0 },
3706 { "xcrypt-ctr", { { OP_0f07, 0 } }, 0 },
3707 { "xcrypt-cfb", { { OP_0f07, 0 } }, 0 },
3708 { "xcrypt-ofb", { { OP_0f07, 0 } }, 0 },
3712 { MOD_TABLE (MOD_0FAE_REG_0) },
3713 { MOD_TABLE (MOD_0FAE_REG_1) },
3714 { MOD_TABLE (MOD_0FAE_REG_2) },
3715 { MOD_TABLE (MOD_0FAE_REG_3) },
3716 { MOD_TABLE (MOD_0FAE_REG_4) },
3717 { MOD_TABLE (MOD_0FAE_REG_5) },
3718 { MOD_TABLE (MOD_0FAE_REG_6) },
3719 { MOD_TABLE (MOD_0FAE_REG_7) },
3727 { "btQ", { Ev, Ib }, 0 },
3728 { "btsQ", { Evh1, Ib }, 0 },
3729 { "btrQ", { Evh1, Ib }, 0 },
3730 { "btcQ", { Evh1, Ib }, 0 },
3735 { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } }, 0 },
3737 { MOD_TABLE (MOD_0FC7_REG_3) },
3738 { MOD_TABLE (MOD_0FC7_REG_4) },
3739 { MOD_TABLE (MOD_0FC7_REG_5) },
3740 { MOD_TABLE (MOD_0FC7_REG_6) },
3741 { MOD_TABLE (MOD_0FC7_REG_7) },
3747 { MOD_TABLE (MOD_VEX_0F71_REG_2) },
3749 { MOD_TABLE (MOD_VEX_0F71_REG_4) },
3751 { MOD_TABLE (MOD_VEX_0F71_REG_6) },
3757 { MOD_TABLE (MOD_VEX_0F72_REG_2) },
3759 { MOD_TABLE (MOD_VEX_0F72_REG_4) },
3761 { MOD_TABLE (MOD_VEX_0F72_REG_6) },
3767 { MOD_TABLE (MOD_VEX_0F73_REG_2) },
3768 { MOD_TABLE (MOD_VEX_0F73_REG_3) },
3771 { MOD_TABLE (MOD_VEX_0F73_REG_6) },
3772 { MOD_TABLE (MOD_VEX_0F73_REG_7) },
3778 { MOD_TABLE (MOD_VEX_0FAE_REG_2) },
3779 { MOD_TABLE (MOD_VEX_0FAE_REG_3) },
3781 /* REG_VEX_0F38F3 */
3784 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_1) },
3785 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_2) },
3786 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_3) },
3790 { "llwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3791 { "slwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3795 { "lwpins", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3796 { "lwpval", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3798 /* REG_XOP_TBM_01 */
3801 { "blcfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3802 { "blsfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3803 { "blcs", { { OP_LWP_E, 0 }, Ev }, 0 },
3804 { "tzmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3805 { "blcic", { { OP_LWP_E, 0 }, Ev }, 0 },
3806 { "blsic", { { OP_LWP_E, 0 }, Ev }, 0 },
3807 { "t1mskc", { { OP_LWP_E, 0 }, Ev }, 0 },
3809 /* REG_XOP_TBM_02 */
3812 { "blcmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3817 { "blci", { { OP_LWP_E, 0 }, Ev }, 0 },
3819 #define NEED_REG_TABLE
3820 #include "i386-dis-evex.h"
3821 #undef NEED_REG_TABLE
3824 static const struct dis386 prefix_table[][4] = {
3827 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3828 { "pause", { XX }, 0 },
3829 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3830 { NULL, { { NULL, 0 } }, PREFIX_IGNORED }
3833 /* PREFIX_MOD_0_0F01_REG_5 */
3836 { "rstorssp", { Mq }, PREFIX_OPCODE },
3839 /* PREFIX_MOD_3_0F01_REG_5_RM_0 */
3842 { "setssbsy", { Skip_MODRM }, PREFIX_OPCODE },
3845 /* PREFIX_MOD_3_0F01_REG_5_RM_2 */
3848 { "saveprevssp", { Skip_MODRM }, PREFIX_OPCODE },
3853 { "wbinvd", { XX }, 0 },
3854 { "wbnoinvd", { XX }, 0 },
3859 { "movups", { XM, EXx }, PREFIX_OPCODE },
3860 { "movss", { XM, EXd }, PREFIX_OPCODE },
3861 { "movupd", { XM, EXx }, PREFIX_OPCODE },
3862 { "movsd", { XM, EXq }, PREFIX_OPCODE },
3867 { "movups", { EXxS, XM }, PREFIX_OPCODE },
3868 { "movss", { EXdS, XM }, PREFIX_OPCODE },
3869 { "movupd", { EXxS, XM }, PREFIX_OPCODE },
3870 { "movsd", { EXqS, XM }, PREFIX_OPCODE },
3875 { MOD_TABLE (MOD_0F12_PREFIX_0) },
3876 { "movsldup", { XM, EXx }, PREFIX_OPCODE },
3877 { "movlpd", { XM, EXq }, PREFIX_OPCODE },
3878 { "movddup", { XM, EXq }, PREFIX_OPCODE },
3883 { MOD_TABLE (MOD_0F16_PREFIX_0) },
3884 { "movshdup", { XM, EXx }, PREFIX_OPCODE },
3885 { "movhpd", { XM, EXq }, PREFIX_OPCODE },
3890 { MOD_TABLE (MOD_0F1A_PREFIX_0) },
3891 { "bndcl", { Gbnd, Ev_bnd }, 0 },
3892 { "bndmov", { Gbnd, Ebnd }, 0 },
3893 { "bndcu", { Gbnd, Ev_bnd }, 0 },
3898 { MOD_TABLE (MOD_0F1B_PREFIX_0) },
3899 { MOD_TABLE (MOD_0F1B_PREFIX_1) },
3900 { "bndmov", { EbndS, Gbnd }, 0 },
3901 { "bndcn", { Gbnd, Ev_bnd }, 0 },
3906 { "nopQ", { Ev }, PREFIX_OPCODE },
3907 { MOD_TABLE (MOD_0F1E_PREFIX_1) },
3908 { "nopQ", { Ev }, PREFIX_OPCODE },
3909 { "nopQ", { Ev }, PREFIX_OPCODE },
3914 { "cvtpi2ps", { XM, EMCq }, PREFIX_OPCODE },
3915 { "cvtsi2ss%LQ", { XM, Ev }, PREFIX_OPCODE },
3916 { "cvtpi2pd", { XM, EMCq }, PREFIX_OPCODE },
3917 { "cvtsi2sd%LQ", { XM, Ev }, 0 },
3922 { MOD_TABLE (MOD_0F2B_PREFIX_0) },
3923 { MOD_TABLE (MOD_0F2B_PREFIX_1) },
3924 { MOD_TABLE (MOD_0F2B_PREFIX_2) },
3925 { MOD_TABLE (MOD_0F2B_PREFIX_3) },
3930 { "cvttps2pi", { MXC, EXq }, PREFIX_OPCODE },
3931 { "cvttss2si", { Gv, EXd }, PREFIX_OPCODE },
3932 { "cvttpd2pi", { MXC, EXx }, PREFIX_OPCODE },
3933 { "cvttsd2si", { Gv, EXq }, PREFIX_OPCODE },
3938 { "cvtps2pi", { MXC, EXq }, PREFIX_OPCODE },
3939 { "cvtss2si", { Gv, EXd }, PREFIX_OPCODE },
3940 { "cvtpd2pi", { MXC, EXx }, PREFIX_OPCODE },
3941 { "cvtsd2si", { Gv, EXq }, PREFIX_OPCODE },
3946 { "ucomiss",{ XM, EXd }, 0 },
3948 { "ucomisd",{ XM, EXq }, 0 },
3953 { "comiss", { XM, EXd }, 0 },
3955 { "comisd", { XM, EXq }, 0 },
3960 { "sqrtps", { XM, EXx }, PREFIX_OPCODE },
3961 { "sqrtss", { XM, EXd }, PREFIX_OPCODE },
3962 { "sqrtpd", { XM, EXx }, PREFIX_OPCODE },
3963 { "sqrtsd", { XM, EXq }, PREFIX_OPCODE },
3968 { "rsqrtps",{ XM, EXx }, PREFIX_OPCODE },
3969 { "rsqrtss",{ XM, EXd }, PREFIX_OPCODE },
3974 { "rcpps", { XM, EXx }, PREFIX_OPCODE },
3975 { "rcpss", { XM, EXd }, PREFIX_OPCODE },
3980 { "addps", { XM, EXx }, PREFIX_OPCODE },
3981 { "addss", { XM, EXd }, PREFIX_OPCODE },
3982 { "addpd", { XM, EXx }, PREFIX_OPCODE },
3983 { "addsd", { XM, EXq }, PREFIX_OPCODE },
3988 { "mulps", { XM, EXx }, PREFIX_OPCODE },
3989 { "mulss", { XM, EXd }, PREFIX_OPCODE },
3990 { "mulpd", { XM, EXx }, PREFIX_OPCODE },
3991 { "mulsd", { XM, EXq }, PREFIX_OPCODE },
3996 { "cvtps2pd", { XM, EXq }, PREFIX_OPCODE },
3997 { "cvtss2sd", { XM, EXd }, PREFIX_OPCODE },
3998 { "cvtpd2ps", { XM, EXx }, PREFIX_OPCODE },
3999 { "cvtsd2ss", { XM, EXq }, PREFIX_OPCODE },
4004 { "cvtdq2ps", { XM, EXx }, PREFIX_OPCODE },
4005 { "cvttps2dq", { XM, EXx }, PREFIX_OPCODE },
4006 { "cvtps2dq", { XM, EXx }, PREFIX_OPCODE },
4011 { "subps", { XM, EXx }, PREFIX_OPCODE },
4012 { "subss", { XM, EXd }, PREFIX_OPCODE },
4013 { "subpd", { XM, EXx }, PREFIX_OPCODE },
4014 { "subsd", { XM, EXq }, PREFIX_OPCODE },
4019 { "minps", { XM, EXx }, PREFIX_OPCODE },
4020 { "minss", { XM, EXd }, PREFIX_OPCODE },
4021 { "minpd", { XM, EXx }, PREFIX_OPCODE },
4022 { "minsd", { XM, EXq }, PREFIX_OPCODE },
4027 { "divps", { XM, EXx }, PREFIX_OPCODE },
4028 { "divss", { XM, EXd }, PREFIX_OPCODE },
4029 { "divpd", { XM, EXx }, PREFIX_OPCODE },
4030 { "divsd", { XM, EXq }, PREFIX_OPCODE },
4035 { "maxps", { XM, EXx }, PREFIX_OPCODE },
4036 { "maxss", { XM, EXd }, PREFIX_OPCODE },
4037 { "maxpd", { XM, EXx }, PREFIX_OPCODE },
4038 { "maxsd", { XM, EXq }, PREFIX_OPCODE },
4043 { "punpcklbw",{ MX, EMd }, PREFIX_OPCODE },
4045 { "punpcklbw",{ MX, EMx }, PREFIX_OPCODE },
4050 { "punpcklwd",{ MX, EMd }, PREFIX_OPCODE },
4052 { "punpcklwd",{ MX, EMx }, PREFIX_OPCODE },
4057 { "punpckldq",{ MX, EMd }, PREFIX_OPCODE },
4059 { "punpckldq",{ MX, EMx }, PREFIX_OPCODE },
4066 { "punpcklqdq", { XM, EXx }, PREFIX_OPCODE },
4073 { "punpckhqdq", { XM, EXx }, PREFIX_OPCODE },
4078 { "movq", { MX, EM }, PREFIX_OPCODE },
4079 { "movdqu", { XM, EXx }, PREFIX_OPCODE },
4080 { "movdqa", { XM, EXx }, PREFIX_OPCODE },
4085 { "pshufw", { MX, EM, Ib }, PREFIX_OPCODE },
4086 { "pshufhw",{ XM, EXx, Ib }, PREFIX_OPCODE },
4087 { "pshufd", { XM, EXx, Ib }, PREFIX_OPCODE },
4088 { "pshuflw",{ XM, EXx, Ib }, PREFIX_OPCODE },
4091 /* PREFIX_0F73_REG_3 */
4095 { "psrldq", { XS, Ib }, 0 },
4098 /* PREFIX_0F73_REG_7 */
4102 { "pslldq", { XS, Ib }, 0 },
4107 {"vmread", { Em, Gm }, 0 },
4109 {"extrq", { XS, Ib, Ib }, 0 },
4110 {"insertq", { XM, XS, Ib, Ib }, 0 },
4115 {"vmwrite", { Gm, Em }, 0 },
4117 {"extrq", { XM, XS }, 0 },
4118 {"insertq", { XM, XS }, 0 },
4125 { "haddpd", { XM, EXx }, PREFIX_OPCODE },
4126 { "haddps", { XM, EXx }, PREFIX_OPCODE },
4133 { "hsubpd", { XM, EXx }, PREFIX_OPCODE },
4134 { "hsubps", { XM, EXx }, PREFIX_OPCODE },
4139 { "movK", { Edq, MX }, PREFIX_OPCODE },
4140 { "movq", { XM, EXq }, PREFIX_OPCODE },
4141 { "movK", { Edq, XM }, PREFIX_OPCODE },
4146 { "movq", { EMS, MX }, PREFIX_OPCODE },
4147 { "movdqu", { EXxS, XM }, PREFIX_OPCODE },
4148 { "movdqa", { EXxS, XM }, PREFIX_OPCODE },
4151 /* PREFIX_0FAE_REG_0 */
4154 { "rdfsbase", { Ev }, 0 },
4157 /* PREFIX_0FAE_REG_1 */
4160 { "rdgsbase", { Ev }, 0 },
4163 /* PREFIX_0FAE_REG_2 */
4166 { "wrfsbase", { Ev }, 0 },
4169 /* PREFIX_0FAE_REG_3 */
4172 { "wrgsbase", { Ev }, 0 },
4175 /* PREFIX_MOD_0_0FAE_REG_4 */
4177 { "xsave", { FXSAVE }, 0 },
4178 { "ptwrite%LQ", { Edq }, 0 },
4181 /* PREFIX_MOD_3_0FAE_REG_4 */
4184 { "ptwrite%LQ", { Edq }, 0 },
4187 /* PREFIX_MOD_0_0FAE_REG_5 */
4189 { "xrstor", { FXSAVE }, PREFIX_OPCODE },
4192 /* PREFIX_MOD_3_0FAE_REG_5 */
4194 { "lfence", { Skip_MODRM }, 0 },
4195 { "incsspK", { Rdq }, PREFIX_OPCODE },
4198 /* PREFIX_MOD_0_0FAE_REG_6 */
4200 { "xsaveopt", { FXSAVE }, PREFIX_OPCODE },
4201 { "clrssbsy", { Mq }, PREFIX_OPCODE },
4202 { "clwb", { Mb }, PREFIX_OPCODE },
4205 /* PREFIX_MOD_1_0FAE_REG_6 */
4207 { RM_TABLE (RM_0FAE_REG_6) },
4208 { "umonitor", { Eva }, PREFIX_OPCODE },
4209 { "tpause", { Edq }, PREFIX_OPCODE },
4210 { "umwait", { Edq }, PREFIX_OPCODE },
4213 /* PREFIX_0FAE_REG_7 */
4215 { "clflush", { Mb }, 0 },
4217 { "clflushopt", { Mb }, 0 },
4223 { "popcntS", { Gv, Ev }, 0 },
4228 { "bsfS", { Gv, Ev }, 0 },
4229 { "tzcntS", { Gv, Ev }, 0 },
4230 { "bsfS", { Gv, Ev }, 0 },
4235 { "bsrS", { Gv, Ev }, 0 },
4236 { "lzcntS", { Gv, Ev }, 0 },
4237 { "bsrS", { Gv, Ev }, 0 },
4242 { "cmpps", { XM, EXx, CMP }, PREFIX_OPCODE },
4243 { "cmpss", { XM, EXd, CMP }, PREFIX_OPCODE },
4244 { "cmppd", { XM, EXx, CMP }, PREFIX_OPCODE },
4245 { "cmpsd", { XM, EXq, CMP }, PREFIX_OPCODE },
4248 /* PREFIX_MOD_0_0FC3 */
4250 { "movntiS", { Ev, Gv }, PREFIX_OPCODE },
4253 /* PREFIX_MOD_0_0FC7_REG_6 */
4255 { "vmptrld",{ Mq }, 0 },
4256 { "vmxon", { Mq }, 0 },
4257 { "vmclear",{ Mq }, 0 },
4260 /* PREFIX_MOD_3_0FC7_REG_6 */
4262 { "rdrand", { Ev }, 0 },
4264 { "rdrand", { Ev }, 0 }
4267 /* PREFIX_MOD_3_0FC7_REG_7 */
4269 { "rdseed", { Ev }, 0 },
4270 { "rdpid", { Em }, 0 },
4271 { "rdseed", { Ev }, 0 },
4278 { "addsubpd", { XM, EXx }, 0 },
4279 { "addsubps", { XM, EXx }, 0 },
4285 { "movq2dq",{ XM, MS }, 0 },
4286 { "movq", { EXqS, XM }, 0 },
4287 { "movdq2q",{ MX, XS }, 0 },
4293 { "cvtdq2pd", { XM, EXq }, PREFIX_OPCODE },
4294 { "cvttpd2dq", { XM, EXx }, PREFIX_OPCODE },
4295 { "cvtpd2dq", { XM, EXx }, PREFIX_OPCODE },
4300 { "movntq", { Mq, MX }, PREFIX_OPCODE },
4302 { MOD_TABLE (MOD_0FE7_PREFIX_2) },
4310 { MOD_TABLE (MOD_0FF0_PREFIX_3) },
4315 { "maskmovq", { MX, MS }, PREFIX_OPCODE },
4317 { "maskmovdqu", { XM, XS }, PREFIX_OPCODE },
4324 { "pblendvb", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4331 { "blendvps", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4338 { "blendvpd", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4345 { "ptest", { XM, EXx }, PREFIX_OPCODE },
4352 { "pmovsxbw", { XM, EXq }, PREFIX_OPCODE },
4359 { "pmovsxbd", { XM, EXd }, PREFIX_OPCODE },
4366 { "pmovsxbq", { XM, EXw }, PREFIX_OPCODE },
4373 { "pmovsxwd", { XM, EXq }, PREFIX_OPCODE },
4380 { "pmovsxwq", { XM, EXd }, PREFIX_OPCODE },
4387 { "pmovsxdq", { XM, EXq }, PREFIX_OPCODE },
4394 { "pmuldq", { XM, EXx }, PREFIX_OPCODE },
4401 { "pcmpeqq", { XM, EXx }, PREFIX_OPCODE },
4408 { MOD_TABLE (MOD_0F382A_PREFIX_2) },
4415 { "packusdw", { XM, EXx }, PREFIX_OPCODE },
4422 { "pmovzxbw", { XM, EXq }, PREFIX_OPCODE },
4429 { "pmovzxbd", { XM, EXd }, PREFIX_OPCODE },
4436 { "pmovzxbq", { XM, EXw }, PREFIX_OPCODE },
4443 { "pmovzxwd", { XM, EXq }, PREFIX_OPCODE },
4450 { "pmovzxwq", { XM, EXd }, PREFIX_OPCODE },
4457 { "pmovzxdq", { XM, EXq }, PREFIX_OPCODE },
4464 { "pcmpgtq", { XM, EXx }, PREFIX_OPCODE },
4471 { "pminsb", { XM, EXx }, PREFIX_OPCODE },
4478 { "pminsd", { XM, EXx }, PREFIX_OPCODE },
4485 { "pminuw", { XM, EXx }, PREFIX_OPCODE },
4492 { "pminud", { XM, EXx }, PREFIX_OPCODE },
4499 { "pmaxsb", { XM, EXx }, PREFIX_OPCODE },
4506 { "pmaxsd", { XM, EXx }, PREFIX_OPCODE },
4513 { "pmaxuw", { XM, EXx }, PREFIX_OPCODE },
4520 { "pmaxud", { XM, EXx }, PREFIX_OPCODE },
4527 { "pmulld", { XM, EXx }, PREFIX_OPCODE },
4534 { "phminposuw", { XM, EXx }, PREFIX_OPCODE },
4541 { "invept", { Gm, Mo }, PREFIX_OPCODE },
4548 { "invvpid", { Gm, Mo }, PREFIX_OPCODE },
4555 { "invpcid", { Gm, M }, PREFIX_OPCODE },
4560 { "sha1nexte", { XM, EXxmm }, PREFIX_OPCODE },
4565 { "sha1msg1", { XM, EXxmm }, PREFIX_OPCODE },
4570 { "sha1msg2", { XM, EXxmm }, PREFIX_OPCODE },
4575 { "sha256rnds2", { XM, EXxmm, XMM0 }, PREFIX_OPCODE },
4580 { "sha256msg1", { XM, EXxmm }, PREFIX_OPCODE },
4585 { "sha256msg2", { XM, EXxmm }, PREFIX_OPCODE },
4592 { "gf2p8mulb", { XM, EXxmm }, PREFIX_OPCODE },
4599 { "aesimc", { XM, EXx }, PREFIX_OPCODE },
4606 { "aesenc", { XM, EXx }, PREFIX_OPCODE },
4613 { "aesenclast", { XM, EXx }, PREFIX_OPCODE },
4620 { "aesdec", { XM, EXx }, PREFIX_OPCODE },
4627 { "aesdeclast", { XM, EXx }, PREFIX_OPCODE },
4632 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4634 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4635 { "crc32", { Gdq, { CRC32_Fixup, b_mode } }, PREFIX_OPCODE },
4640 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4642 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4643 { "crc32", { Gdq, { CRC32_Fixup, v_mode } }, PREFIX_OPCODE },
4650 { MOD_TABLE (MOD_0F38F5_PREFIX_2) },
4655 { MOD_TABLE (MOD_0F38F6_PREFIX_0) },
4656 { "adoxS", { Gdq, Edq}, PREFIX_OPCODE },
4657 { "adcxS", { Gdq, Edq}, PREFIX_OPCODE },
4665 { "roundps", { XM, EXx, Ib }, PREFIX_OPCODE },
4672 { "roundpd", { XM, EXx, Ib }, PREFIX_OPCODE },
4679 { "roundss", { XM, EXd, Ib }, PREFIX_OPCODE },
4686 { "roundsd", { XM, EXq, Ib }, PREFIX_OPCODE },
4693 { "blendps", { XM, EXx, Ib }, PREFIX_OPCODE },
4700 { "blendpd", { XM, EXx, Ib }, PREFIX_OPCODE },
4707 { "pblendw", { XM, EXx, Ib }, PREFIX_OPCODE },
4714 { "pextrb", { Edqb, XM, Ib }, PREFIX_OPCODE },
4721 { "pextrw", { Edqw, XM, Ib }, PREFIX_OPCODE },
4728 { "pextrK", { Edq, XM, Ib }, PREFIX_OPCODE },
4735 { "extractps", { Edqd, XM, Ib }, PREFIX_OPCODE },
4742 { "pinsrb", { XM, Edqb, Ib }, PREFIX_OPCODE },
4749 { "insertps", { XM, EXd, Ib }, PREFIX_OPCODE },
4756 { "pinsrK", { XM, Edq, Ib }, PREFIX_OPCODE },
4763 { "dpps", { XM, EXx, Ib }, PREFIX_OPCODE },
4770 { "dppd", { XM, EXx, Ib }, PREFIX_OPCODE },
4777 { "mpsadbw", { XM, EXx, Ib }, PREFIX_OPCODE },
4784 { "pclmulqdq", { XM, EXx, PCLMUL }, PREFIX_OPCODE },
4791 { "pcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
4798 { "pcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
4805 { "pcmpistrm", { XM, EXx, Ib }, PREFIX_OPCODE },
4812 { "pcmpistri", { XM, EXx, Ib }, PREFIX_OPCODE },
4817 { "sha1rnds4", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4824 { "gf2p8affineqb", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4831 { "gf2p8affineinvqb", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4838 { "aeskeygenassist", { XM, EXx, Ib }, PREFIX_OPCODE },
4841 /* PREFIX_VEX_0F10 */
4843 { VEX_W_TABLE (VEX_W_0F10_P_0) },
4844 { VEX_LEN_TABLE (VEX_LEN_0F10_P_1) },
4845 { VEX_W_TABLE (VEX_W_0F10_P_2) },
4846 { VEX_LEN_TABLE (VEX_LEN_0F10_P_3) },
4849 /* PREFIX_VEX_0F11 */
4851 { VEX_W_TABLE (VEX_W_0F11_P_0) },
4852 { VEX_LEN_TABLE (VEX_LEN_0F11_P_1) },
4853 { VEX_W_TABLE (VEX_W_0F11_P_2) },
4854 { VEX_LEN_TABLE (VEX_LEN_0F11_P_3) },
4857 /* PREFIX_VEX_0F12 */
4859 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0) },
4860 { VEX_W_TABLE (VEX_W_0F12_P_1) },
4861 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2) },
4862 { VEX_W_TABLE (VEX_W_0F12_P_3) },
4865 /* PREFIX_VEX_0F16 */
4867 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0) },
4868 { VEX_W_TABLE (VEX_W_0F16_P_1) },
4869 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2) },
4872 /* PREFIX_VEX_0F2A */
4875 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_1) },
4877 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_3) },
4880 /* PREFIX_VEX_0F2C */
4883 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_1) },
4885 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_3) },
4888 /* PREFIX_VEX_0F2D */
4891 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_1) },
4893 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_3) },
4896 /* PREFIX_VEX_0F2E */
4898 { VEX_LEN_TABLE (VEX_LEN_0F2E_P_0) },
4900 { VEX_LEN_TABLE (VEX_LEN_0F2E_P_2) },
4903 /* PREFIX_VEX_0F2F */
4905 { VEX_LEN_TABLE (VEX_LEN_0F2F_P_0) },
4907 { VEX_LEN_TABLE (VEX_LEN_0F2F_P_2) },
4910 /* PREFIX_VEX_0F41 */
4912 { VEX_LEN_TABLE (VEX_LEN_0F41_P_0) },
4914 { VEX_LEN_TABLE (VEX_LEN_0F41_P_2) },
4917 /* PREFIX_VEX_0F42 */
4919 { VEX_LEN_TABLE (VEX_LEN_0F42_P_0) },
4921 { VEX_LEN_TABLE (VEX_LEN_0F42_P_2) },
4924 /* PREFIX_VEX_0F44 */
4926 { VEX_LEN_TABLE (VEX_LEN_0F44_P_0) },
4928 { VEX_LEN_TABLE (VEX_LEN_0F44_P_2) },
4931 /* PREFIX_VEX_0F45 */
4933 { VEX_LEN_TABLE (VEX_LEN_0F45_P_0) },
4935 { VEX_LEN_TABLE (VEX_LEN_0F45_P_2) },
4938 /* PREFIX_VEX_0F46 */
4940 { VEX_LEN_TABLE (VEX_LEN_0F46_P_0) },
4942 { VEX_LEN_TABLE (VEX_LEN_0F46_P_2) },
4945 /* PREFIX_VEX_0F47 */
4947 { VEX_LEN_TABLE (VEX_LEN_0F47_P_0) },
4949 { VEX_LEN_TABLE (VEX_LEN_0F47_P_2) },
4952 /* PREFIX_VEX_0F4A */
4954 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_0) },
4956 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_2) },
4959 /* PREFIX_VEX_0F4B */
4961 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_0) },
4963 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_2) },
4966 /* PREFIX_VEX_0F51 */
4968 { VEX_W_TABLE (VEX_W_0F51_P_0) },
4969 { VEX_LEN_TABLE (VEX_LEN_0F51_P_1) },
4970 { VEX_W_TABLE (VEX_W_0F51_P_2) },
4971 { VEX_LEN_TABLE (VEX_LEN_0F51_P_3) },
4974 /* PREFIX_VEX_0F52 */
4976 { VEX_W_TABLE (VEX_W_0F52_P_0) },
4977 { VEX_LEN_TABLE (VEX_LEN_0F52_P_1) },
4980 /* PREFIX_VEX_0F53 */
4982 { VEX_W_TABLE (VEX_W_0F53_P_0) },
4983 { VEX_LEN_TABLE (VEX_LEN_0F53_P_1) },
4986 /* PREFIX_VEX_0F58 */
4988 { VEX_W_TABLE (VEX_W_0F58_P_0) },
4989 { VEX_LEN_TABLE (VEX_LEN_0F58_P_1) },
4990 { VEX_W_TABLE (VEX_W_0F58_P_2) },
4991 { VEX_LEN_TABLE (VEX_LEN_0F58_P_3) },
4994 /* PREFIX_VEX_0F59 */
4996 { VEX_W_TABLE (VEX_W_0F59_P_0) },
4997 { VEX_LEN_TABLE (VEX_LEN_0F59_P_1) },
4998 { VEX_W_TABLE (VEX_W_0F59_P_2) },
4999 { VEX_LEN_TABLE (VEX_LEN_0F59_P_3) },
5002 /* PREFIX_VEX_0F5A */
5004 { VEX_W_TABLE (VEX_W_0F5A_P_0) },
5005 { VEX_LEN_TABLE (VEX_LEN_0F5A_P_1) },
5006 { "vcvtpd2ps%XY", { XMM, EXx }, 0 },
5007 { VEX_LEN_TABLE (VEX_LEN_0F5A_P_3) },
5010 /* PREFIX_VEX_0F5B */
5012 { VEX_W_TABLE (VEX_W_0F5B_P_0) },
5013 { VEX_W_TABLE (VEX_W_0F5B_P_1) },
5014 { VEX_W_TABLE (VEX_W_0F5B_P_2) },
5017 /* PREFIX_VEX_0F5C */
5019 { VEX_W_TABLE (VEX_W_0F5C_P_0) },
5020 { VEX_LEN_TABLE (VEX_LEN_0F5C_P_1) },
5021 { VEX_W_TABLE (VEX_W_0F5C_P_2) },
5022 { VEX_LEN_TABLE (VEX_LEN_0F5C_P_3) },
5025 /* PREFIX_VEX_0F5D */
5027 { VEX_W_TABLE (VEX_W_0F5D_P_0) },
5028 { VEX_LEN_TABLE (VEX_LEN_0F5D_P_1) },
5029 { VEX_W_TABLE (VEX_W_0F5D_P_2) },
5030 { VEX_LEN_TABLE (VEX_LEN_0F5D_P_3) },
5033 /* PREFIX_VEX_0F5E */
5035 { VEX_W_TABLE (VEX_W_0F5E_P_0) },
5036 { VEX_LEN_TABLE (VEX_LEN_0F5E_P_1) },
5037 { VEX_W_TABLE (VEX_W_0F5E_P_2) },
5038 { VEX_LEN_TABLE (VEX_LEN_0F5E_P_3) },
5041 /* PREFIX_VEX_0F5F */
5043 { VEX_W_TABLE (VEX_W_0F5F_P_0) },
5044 { VEX_LEN_TABLE (VEX_LEN_0F5F_P_1) },
5045 { VEX_W_TABLE (VEX_W_0F5F_P_2) },
5046 { VEX_LEN_TABLE (VEX_LEN_0F5F_P_3) },
5049 /* PREFIX_VEX_0F60 */
5053 { VEX_W_TABLE (VEX_W_0F60_P_2) },
5056 /* PREFIX_VEX_0F61 */
5060 { VEX_W_TABLE (VEX_W_0F61_P_2) },
5063 /* PREFIX_VEX_0F62 */
5067 { VEX_W_TABLE (VEX_W_0F62_P_2) },
5070 /* PREFIX_VEX_0F63 */
5074 { VEX_W_TABLE (VEX_W_0F63_P_2) },
5077 /* PREFIX_VEX_0F64 */
5081 { VEX_W_TABLE (VEX_W_0F64_P_2) },
5084 /* PREFIX_VEX_0F65 */
5088 { VEX_W_TABLE (VEX_W_0F65_P_2) },
5091 /* PREFIX_VEX_0F66 */
5095 { VEX_W_TABLE (VEX_W_0F66_P_2) },
5098 /* PREFIX_VEX_0F67 */
5102 { VEX_W_TABLE (VEX_W_0F67_P_2) },
5105 /* PREFIX_VEX_0F68 */
5109 { VEX_W_TABLE (VEX_W_0F68_P_2) },
5112 /* PREFIX_VEX_0F69 */
5116 { VEX_W_TABLE (VEX_W_0F69_P_2) },
5119 /* PREFIX_VEX_0F6A */
5123 { VEX_W_TABLE (VEX_W_0F6A_P_2) },
5126 /* PREFIX_VEX_0F6B */
5130 { VEX_W_TABLE (VEX_W_0F6B_P_2) },
5133 /* PREFIX_VEX_0F6C */
5137 { VEX_W_TABLE (VEX_W_0F6C_P_2) },
5140 /* PREFIX_VEX_0F6D */
5144 { VEX_W_TABLE (VEX_W_0F6D_P_2) },
5147 /* PREFIX_VEX_0F6E */
5151 { VEX_LEN_TABLE (VEX_LEN_0F6E_P_2) },
5154 /* PREFIX_VEX_0F6F */
5157 { VEX_W_TABLE (VEX_W_0F6F_P_1) },
5158 { VEX_W_TABLE (VEX_W_0F6F_P_2) },
5161 /* PREFIX_VEX_0F70 */
5164 { VEX_W_TABLE (VEX_W_0F70_P_1) },
5165 { VEX_W_TABLE (VEX_W_0F70_P_2) },
5166 { VEX_W_TABLE (VEX_W_0F70_P_3) },
5169 /* PREFIX_VEX_0F71_REG_2 */
5173 { VEX_W_TABLE (VEX_W_0F71_R_2_P_2) },
5176 /* PREFIX_VEX_0F71_REG_4 */
5180 { VEX_W_TABLE (VEX_W_0F71_R_4_P_2) },
5183 /* PREFIX_VEX_0F71_REG_6 */
5187 { VEX_W_TABLE (VEX_W_0F71_R_6_P_2) },
5190 /* PREFIX_VEX_0F72_REG_2 */
5194 { VEX_W_TABLE (VEX_W_0F72_R_2_P_2) },
5197 /* PREFIX_VEX_0F72_REG_4 */
5201 { VEX_W_TABLE (VEX_W_0F72_R_4_P_2) },
5204 /* PREFIX_VEX_0F72_REG_6 */
5208 { VEX_W_TABLE (VEX_W_0F72_R_6_P_2) },
5211 /* PREFIX_VEX_0F73_REG_2 */
5215 { VEX_W_TABLE (VEX_W_0F73_R_2_P_2) },
5218 /* PREFIX_VEX_0F73_REG_3 */
5222 { VEX_W_TABLE (VEX_W_0F73_R_3_P_2) },
5225 /* PREFIX_VEX_0F73_REG_6 */
5229 { VEX_W_TABLE (VEX_W_0F73_R_6_P_2) },
5232 /* PREFIX_VEX_0F73_REG_7 */
5236 { VEX_W_TABLE (VEX_W_0F73_R_7_P_2) },
5239 /* PREFIX_VEX_0F74 */
5243 { VEX_W_TABLE (VEX_W_0F74_P_2) },
5246 /* PREFIX_VEX_0F75 */
5250 { VEX_W_TABLE (VEX_W_0F75_P_2) },
5253 /* PREFIX_VEX_0F76 */
5257 { VEX_W_TABLE (VEX_W_0F76_P_2) },
5260 /* PREFIX_VEX_0F77 */
5262 { VEX_W_TABLE (VEX_W_0F77_P_0) },
5265 /* PREFIX_VEX_0F7C */
5269 { VEX_W_TABLE (VEX_W_0F7C_P_2) },
5270 { VEX_W_TABLE (VEX_W_0F7C_P_3) },
5273 /* PREFIX_VEX_0F7D */
5277 { VEX_W_TABLE (VEX_W_0F7D_P_2) },
5278 { VEX_W_TABLE (VEX_W_0F7D_P_3) },
5281 /* PREFIX_VEX_0F7E */
5284 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1) },
5285 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2) },
5288 /* PREFIX_VEX_0F7F */
5291 { VEX_W_TABLE (VEX_W_0F7F_P_1) },
5292 { VEX_W_TABLE (VEX_W_0F7F_P_2) },
5295 /* PREFIX_VEX_0F90 */
5297 { VEX_LEN_TABLE (VEX_LEN_0F90_P_0) },
5299 { VEX_LEN_TABLE (VEX_LEN_0F90_P_2) },
5302 /* PREFIX_VEX_0F91 */
5304 { VEX_LEN_TABLE (VEX_LEN_0F91_P_0) },
5306 { VEX_LEN_TABLE (VEX_LEN_0F91_P_2) },
5309 /* PREFIX_VEX_0F92 */
5311 { VEX_LEN_TABLE (VEX_LEN_0F92_P_0) },
5313 { VEX_LEN_TABLE (VEX_LEN_0F92_P_2) },
5314 { VEX_LEN_TABLE (VEX_LEN_0F92_P_3) },
5317 /* PREFIX_VEX_0F93 */
5319 { VEX_LEN_TABLE (VEX_LEN_0F93_P_0) },
5321 { VEX_LEN_TABLE (VEX_LEN_0F93_P_2) },
5322 { VEX_LEN_TABLE (VEX_LEN_0F93_P_3) },
5325 /* PREFIX_VEX_0F98 */
5327 { VEX_LEN_TABLE (VEX_LEN_0F98_P_0) },
5329 { VEX_LEN_TABLE (VEX_LEN_0F98_P_2) },
5332 /* PREFIX_VEX_0F99 */
5334 { VEX_LEN_TABLE (VEX_LEN_0F99_P_0) },
5336 { VEX_LEN_TABLE (VEX_LEN_0F99_P_2) },
5339 /* PREFIX_VEX_0FC2 */
5341 { VEX_W_TABLE (VEX_W_0FC2_P_0) },
5342 { VEX_LEN_TABLE (VEX_LEN_0FC2_P_1) },
5343 { VEX_W_TABLE (VEX_W_0FC2_P_2) },
5344 { VEX_LEN_TABLE (VEX_LEN_0FC2_P_3) },
5347 /* PREFIX_VEX_0FC4 */
5351 { VEX_LEN_TABLE (VEX_LEN_0FC4_P_2) },
5354 /* PREFIX_VEX_0FC5 */
5358 { VEX_LEN_TABLE (VEX_LEN_0FC5_P_2) },
5361 /* PREFIX_VEX_0FD0 */
5365 { VEX_W_TABLE (VEX_W_0FD0_P_2) },
5366 { VEX_W_TABLE (VEX_W_0FD0_P_3) },
5369 /* PREFIX_VEX_0FD1 */
5373 { VEX_W_TABLE (VEX_W_0FD1_P_2) },
5376 /* PREFIX_VEX_0FD2 */
5380 { VEX_W_TABLE (VEX_W_0FD2_P_2) },
5383 /* PREFIX_VEX_0FD3 */
5387 { VEX_W_TABLE (VEX_W_0FD3_P_2) },
5390 /* PREFIX_VEX_0FD4 */
5394 { VEX_W_TABLE (VEX_W_0FD4_P_2) },
5397 /* PREFIX_VEX_0FD5 */
5401 { VEX_W_TABLE (VEX_W_0FD5_P_2) },
5404 /* PREFIX_VEX_0FD6 */
5408 { VEX_LEN_TABLE (VEX_LEN_0FD6_P_2) },
5411 /* PREFIX_VEX_0FD7 */
5415 { MOD_TABLE (MOD_VEX_0FD7_PREFIX_2) },
5418 /* PREFIX_VEX_0FD8 */
5422 { VEX_W_TABLE (VEX_W_0FD8_P_2) },
5425 /* PREFIX_VEX_0FD9 */
5429 { VEX_W_TABLE (VEX_W_0FD9_P_2) },
5432 /* PREFIX_VEX_0FDA */
5436 { VEX_W_TABLE (VEX_W_0FDA_P_2) },
5439 /* PREFIX_VEX_0FDB */
5443 { VEX_W_TABLE (VEX_W_0FDB_P_2) },
5446 /* PREFIX_VEX_0FDC */
5450 { VEX_W_TABLE (VEX_W_0FDC_P_2) },
5453 /* PREFIX_VEX_0FDD */
5457 { VEX_W_TABLE (VEX_W_0FDD_P_2) },
5460 /* PREFIX_VEX_0FDE */
5464 { VEX_W_TABLE (VEX_W_0FDE_P_2) },
5467 /* PREFIX_VEX_0FDF */
5471 { VEX_W_TABLE (VEX_W_0FDF_P_2) },
5474 /* PREFIX_VEX_0FE0 */
5478 { VEX_W_TABLE (VEX_W_0FE0_P_2) },
5481 /* PREFIX_VEX_0FE1 */
5485 { VEX_W_TABLE (VEX_W_0FE1_P_2) },
5488 /* PREFIX_VEX_0FE2 */
5492 { VEX_W_TABLE (VEX_W_0FE2_P_2) },
5495 /* PREFIX_VEX_0FE3 */
5499 { VEX_W_TABLE (VEX_W_0FE3_P_2) },
5502 /* PREFIX_VEX_0FE4 */
5506 { VEX_W_TABLE (VEX_W_0FE4_P_2) },
5509 /* PREFIX_VEX_0FE5 */
5513 { VEX_W_TABLE (VEX_W_0FE5_P_2) },
5516 /* PREFIX_VEX_0FE6 */
5519 { VEX_W_TABLE (VEX_W_0FE6_P_1) },
5520 { VEX_W_TABLE (VEX_W_0FE6_P_2) },
5521 { VEX_W_TABLE (VEX_W_0FE6_P_3) },
5524 /* PREFIX_VEX_0FE7 */
5528 { MOD_TABLE (MOD_VEX_0FE7_PREFIX_2) },
5531 /* PREFIX_VEX_0FE8 */
5535 { VEX_W_TABLE (VEX_W_0FE8_P_2) },
5538 /* PREFIX_VEX_0FE9 */
5542 { VEX_W_TABLE (VEX_W_0FE9_P_2) },
5545 /* PREFIX_VEX_0FEA */
5549 { VEX_W_TABLE (VEX_W_0FEA_P_2) },
5552 /* PREFIX_VEX_0FEB */
5556 { VEX_W_TABLE (VEX_W_0FEB_P_2) },
5559 /* PREFIX_VEX_0FEC */
5563 { VEX_W_TABLE (VEX_W_0FEC_P_2) },
5566 /* PREFIX_VEX_0FED */
5570 { VEX_W_TABLE (VEX_W_0FED_P_2) },
5573 /* PREFIX_VEX_0FEE */
5577 { VEX_W_TABLE (VEX_W_0FEE_P_2) },
5580 /* PREFIX_VEX_0FEF */
5584 { VEX_W_TABLE (VEX_W_0FEF_P_2) },
5587 /* PREFIX_VEX_0FF0 */
5592 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3) },
5595 /* PREFIX_VEX_0FF1 */
5599 { VEX_W_TABLE (VEX_W_0FF1_P_2) },
5602 /* PREFIX_VEX_0FF2 */
5606 { VEX_W_TABLE (VEX_W_0FF2_P_2) },
5609 /* PREFIX_VEX_0FF3 */
5613 { VEX_W_TABLE (VEX_W_0FF3_P_2) },
5616 /* PREFIX_VEX_0FF4 */
5620 { VEX_W_TABLE (VEX_W_0FF4_P_2) },
5623 /* PREFIX_VEX_0FF5 */
5627 { VEX_W_TABLE (VEX_W_0FF5_P_2) },
5630 /* PREFIX_VEX_0FF6 */
5634 { VEX_W_TABLE (VEX_W_0FF6_P_2) },
5637 /* PREFIX_VEX_0FF7 */
5641 { VEX_LEN_TABLE (VEX_LEN_0FF7_P_2) },
5644 /* PREFIX_VEX_0FF8 */
5648 { VEX_W_TABLE (VEX_W_0FF8_P_2) },
5651 /* PREFIX_VEX_0FF9 */
5655 { VEX_W_TABLE (VEX_W_0FF9_P_2) },
5658 /* PREFIX_VEX_0FFA */
5662 { VEX_W_TABLE (VEX_W_0FFA_P_2) },
5665 /* PREFIX_VEX_0FFB */
5669 { VEX_W_TABLE (VEX_W_0FFB_P_2) },
5672 /* PREFIX_VEX_0FFC */
5676 { VEX_W_TABLE (VEX_W_0FFC_P_2) },
5679 /* PREFIX_VEX_0FFD */
5683 { VEX_W_TABLE (VEX_W_0FFD_P_2) },
5686 /* PREFIX_VEX_0FFE */
5690 { VEX_W_TABLE (VEX_W_0FFE_P_2) },
5693 /* PREFIX_VEX_0F3800 */
5697 { VEX_W_TABLE (VEX_W_0F3800_P_2) },
5700 /* PREFIX_VEX_0F3801 */
5704 { VEX_W_TABLE (VEX_W_0F3801_P_2) },
5707 /* PREFIX_VEX_0F3802 */
5711 { VEX_W_TABLE (VEX_W_0F3802_P_2) },
5714 /* PREFIX_VEX_0F3803 */
5718 { VEX_W_TABLE (VEX_W_0F3803_P_2) },
5721 /* PREFIX_VEX_0F3804 */
5725 { VEX_W_TABLE (VEX_W_0F3804_P_2) },
5728 /* PREFIX_VEX_0F3805 */
5732 { VEX_W_TABLE (VEX_W_0F3805_P_2) },
5735 /* PREFIX_VEX_0F3806 */
5739 { VEX_W_TABLE (VEX_W_0F3806_P_2) },
5742 /* PREFIX_VEX_0F3807 */
5746 { VEX_W_TABLE (VEX_W_0F3807_P_2) },
5749 /* PREFIX_VEX_0F3808 */
5753 { VEX_W_TABLE (VEX_W_0F3808_P_2) },
5756 /* PREFIX_VEX_0F3809 */
5760 { VEX_W_TABLE (VEX_W_0F3809_P_2) },
5763 /* PREFIX_VEX_0F380A */
5767 { VEX_W_TABLE (VEX_W_0F380A_P_2) },
5770 /* PREFIX_VEX_0F380B */
5774 { VEX_W_TABLE (VEX_W_0F380B_P_2) },
5777 /* PREFIX_VEX_0F380C */
5781 { VEX_W_TABLE (VEX_W_0F380C_P_2) },
5784 /* PREFIX_VEX_0F380D */
5788 { VEX_W_TABLE (VEX_W_0F380D_P_2) },
5791 /* PREFIX_VEX_0F380E */
5795 { VEX_W_TABLE (VEX_W_0F380E_P_2) },
5798 /* PREFIX_VEX_0F380F */
5802 { VEX_W_TABLE (VEX_W_0F380F_P_2) },
5805 /* PREFIX_VEX_0F3813 */
5809 { "vcvtph2ps", { XM, EXxmmq }, 0 },
5812 /* PREFIX_VEX_0F3816 */
5816 { VEX_LEN_TABLE (VEX_LEN_0F3816_P_2) },
5819 /* PREFIX_VEX_0F3817 */
5823 { VEX_W_TABLE (VEX_W_0F3817_P_2) },
5826 /* PREFIX_VEX_0F3818 */
5830 { VEX_W_TABLE (VEX_W_0F3818_P_2) },
5833 /* PREFIX_VEX_0F3819 */
5837 { VEX_LEN_TABLE (VEX_LEN_0F3819_P_2) },
5840 /* PREFIX_VEX_0F381A */
5844 { MOD_TABLE (MOD_VEX_0F381A_PREFIX_2) },
5847 /* PREFIX_VEX_0F381C */
5851 { VEX_W_TABLE (VEX_W_0F381C_P_2) },
5854 /* PREFIX_VEX_0F381D */
5858 { VEX_W_TABLE (VEX_W_0F381D_P_2) },
5861 /* PREFIX_VEX_0F381E */
5865 { VEX_W_TABLE (VEX_W_0F381E_P_2) },
5868 /* PREFIX_VEX_0F3820 */
5872 { VEX_W_TABLE (VEX_W_0F3820_P_2) },
5875 /* PREFIX_VEX_0F3821 */
5879 { VEX_W_TABLE (VEX_W_0F3821_P_2) },
5882 /* PREFIX_VEX_0F3822 */
5886 { VEX_W_TABLE (VEX_W_0F3822_P_2) },
5889 /* PREFIX_VEX_0F3823 */
5893 { VEX_W_TABLE (VEX_W_0F3823_P_2) },
5896 /* PREFIX_VEX_0F3824 */
5900 { VEX_W_TABLE (VEX_W_0F3824_P_2) },
5903 /* PREFIX_VEX_0F3825 */
5907 { VEX_W_TABLE (VEX_W_0F3825_P_2) },
5910 /* PREFIX_VEX_0F3828 */
5914 { VEX_W_TABLE (VEX_W_0F3828_P_2) },
5917 /* PREFIX_VEX_0F3829 */
5921 { VEX_W_TABLE (VEX_W_0F3829_P_2) },
5924 /* PREFIX_VEX_0F382A */
5928 { MOD_TABLE (MOD_VEX_0F382A_PREFIX_2) },
5931 /* PREFIX_VEX_0F382B */
5935 { VEX_W_TABLE (VEX_W_0F382B_P_2) },
5938 /* PREFIX_VEX_0F382C */
5942 { MOD_TABLE (MOD_VEX_0F382C_PREFIX_2) },
5945 /* PREFIX_VEX_0F382D */
5949 { MOD_TABLE (MOD_VEX_0F382D_PREFIX_2) },
5952 /* PREFIX_VEX_0F382E */
5956 { MOD_TABLE (MOD_VEX_0F382E_PREFIX_2) },
5959 /* PREFIX_VEX_0F382F */
5963 { MOD_TABLE (MOD_VEX_0F382F_PREFIX_2) },
5966 /* PREFIX_VEX_0F3830 */
5970 { VEX_W_TABLE (VEX_W_0F3830_P_2) },
5973 /* PREFIX_VEX_0F3831 */
5977 { VEX_W_TABLE (VEX_W_0F3831_P_2) },
5980 /* PREFIX_VEX_0F3832 */
5984 { VEX_W_TABLE (VEX_W_0F3832_P_2) },
5987 /* PREFIX_VEX_0F3833 */
5991 { VEX_W_TABLE (VEX_W_0F3833_P_2) },
5994 /* PREFIX_VEX_0F3834 */
5998 { VEX_W_TABLE (VEX_W_0F3834_P_2) },
6001 /* PREFIX_VEX_0F3835 */
6005 { VEX_W_TABLE (VEX_W_0F3835_P_2) },
6008 /* PREFIX_VEX_0F3836 */
6012 { VEX_LEN_TABLE (VEX_LEN_0F3836_P_2) },
6015 /* PREFIX_VEX_0F3837 */
6019 { VEX_W_TABLE (VEX_W_0F3837_P_2) },
6022 /* PREFIX_VEX_0F3838 */
6026 { VEX_W_TABLE (VEX_W_0F3838_P_2) },
6029 /* PREFIX_VEX_0F3839 */
6033 { VEX_W_TABLE (VEX_W_0F3839_P_2) },
6036 /* PREFIX_VEX_0F383A */
6040 { VEX_W_TABLE (VEX_W_0F383A_P_2) },
6043 /* PREFIX_VEX_0F383B */
6047 { VEX_W_TABLE (VEX_W_0F383B_P_2) },
6050 /* PREFIX_VEX_0F383C */
6054 { VEX_W_TABLE (VEX_W_0F383C_P_2) },
6057 /* PREFIX_VEX_0F383D */
6061 { VEX_W_TABLE (VEX_W_0F383D_P_2) },
6064 /* PREFIX_VEX_0F383E */
6068 { VEX_W_TABLE (VEX_W_0F383E_P_2) },
6071 /* PREFIX_VEX_0F383F */
6075 { VEX_W_TABLE (VEX_W_0F383F_P_2) },
6078 /* PREFIX_VEX_0F3840 */
6082 { VEX_W_TABLE (VEX_W_0F3840_P_2) },
6085 /* PREFIX_VEX_0F3841 */
6089 { VEX_LEN_TABLE (VEX_LEN_0F3841_P_2) },
6092 /* PREFIX_VEX_0F3845 */
6096 { "vpsrlv%LW", { XM, Vex, EXx }, 0 },
6099 /* PREFIX_VEX_0F3846 */
6103 { VEX_W_TABLE (VEX_W_0F3846_P_2) },
6106 /* PREFIX_VEX_0F3847 */
6110 { "vpsllv%LW", { XM, Vex, EXx }, 0 },
6113 /* PREFIX_VEX_0F3858 */
6117 { VEX_W_TABLE (VEX_W_0F3858_P_2) },
6120 /* PREFIX_VEX_0F3859 */
6124 { VEX_W_TABLE (VEX_W_0F3859_P_2) },
6127 /* PREFIX_VEX_0F385A */
6131 { MOD_TABLE (MOD_VEX_0F385A_PREFIX_2) },
6134 /* PREFIX_VEX_0F3878 */
6138 { VEX_W_TABLE (VEX_W_0F3878_P_2) },
6141 /* PREFIX_VEX_0F3879 */
6145 { VEX_W_TABLE (VEX_W_0F3879_P_2) },
6148 /* PREFIX_VEX_0F388C */
6152 { MOD_TABLE (MOD_VEX_0F388C_PREFIX_2) },
6155 /* PREFIX_VEX_0F388E */
6159 { MOD_TABLE (MOD_VEX_0F388E_PREFIX_2) },
6162 /* PREFIX_VEX_0F3890 */
6166 { "vpgatherd%LW", { XM, MVexVSIBDWpX, Vex }, 0 },
6169 /* PREFIX_VEX_0F3891 */
6173 { "vpgatherq%LW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
6176 /* PREFIX_VEX_0F3892 */
6180 { "vgatherdp%XW", { XM, MVexVSIBDWpX, Vex }, 0 },
6183 /* PREFIX_VEX_0F3893 */
6187 { "vgatherqp%XW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
6190 /* PREFIX_VEX_0F3896 */
6194 { "vfmaddsub132p%XW", { XM, Vex, EXx }, 0 },
6197 /* PREFIX_VEX_0F3897 */
6201 { "vfmsubadd132p%XW", { XM, Vex, EXx }, 0 },
6204 /* PREFIX_VEX_0F3898 */
6208 { "vfmadd132p%XW", { XM, Vex, EXx }, 0 },
6211 /* PREFIX_VEX_0F3899 */
6215 { "vfmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6218 /* PREFIX_VEX_0F389A */
6222 { "vfmsub132p%XW", { XM, Vex, EXx }, 0 },
6225 /* PREFIX_VEX_0F389B */
6229 { "vfmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6232 /* PREFIX_VEX_0F389C */
6236 { "vfnmadd132p%XW", { XM, Vex, EXx }, 0 },
6239 /* PREFIX_VEX_0F389D */
6243 { "vfnmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6246 /* PREFIX_VEX_0F389E */
6250 { "vfnmsub132p%XW", { XM, Vex, EXx }, 0 },
6253 /* PREFIX_VEX_0F389F */
6257 { "vfnmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6260 /* PREFIX_VEX_0F38A6 */
6264 { "vfmaddsub213p%XW", { XM, Vex, EXx }, 0 },
6268 /* PREFIX_VEX_0F38A7 */
6272 { "vfmsubadd213p%XW", { XM, Vex, EXx }, 0 },
6275 /* PREFIX_VEX_0F38A8 */
6279 { "vfmadd213p%XW", { XM, Vex, EXx }, 0 },
6282 /* PREFIX_VEX_0F38A9 */
6286 { "vfmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6289 /* PREFIX_VEX_0F38AA */
6293 { "vfmsub213p%XW", { XM, Vex, EXx }, 0 },
6296 /* PREFIX_VEX_0F38AB */
6300 { "vfmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6303 /* PREFIX_VEX_0F38AC */
6307 { "vfnmadd213p%XW", { XM, Vex, EXx }, 0 },
6310 /* PREFIX_VEX_0F38AD */
6314 { "vfnmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6317 /* PREFIX_VEX_0F38AE */
6321 { "vfnmsub213p%XW", { XM, Vex, EXx }, 0 },
6324 /* PREFIX_VEX_0F38AF */
6328 { "vfnmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6331 /* PREFIX_VEX_0F38B6 */
6335 { "vfmaddsub231p%XW", { XM, Vex, EXx }, 0 },
6338 /* PREFIX_VEX_0F38B7 */
6342 { "vfmsubadd231p%XW", { XM, Vex, EXx }, 0 },
6345 /* PREFIX_VEX_0F38B8 */
6349 { "vfmadd231p%XW", { XM, Vex, EXx }, 0 },
6352 /* PREFIX_VEX_0F38B9 */
6356 { "vfmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6359 /* PREFIX_VEX_0F38BA */
6363 { "vfmsub231p%XW", { XM, Vex, EXx }, 0 },
6366 /* PREFIX_VEX_0F38BB */
6370 { "vfmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6373 /* PREFIX_VEX_0F38BC */
6377 { "vfnmadd231p%XW", { XM, Vex, EXx }, 0 },
6380 /* PREFIX_VEX_0F38BD */
6384 { "vfnmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6387 /* PREFIX_VEX_0F38BE */
6391 { "vfnmsub231p%XW", { XM, Vex, EXx }, 0 },
6394 /* PREFIX_VEX_0F38BF */
6398 { "vfnmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6401 /* PREFIX_VEX_0F38CF */
6405 { VEX_W_TABLE (VEX_W_0F38CF_P_2) },
6408 /* PREFIX_VEX_0F38DB */
6412 { VEX_LEN_TABLE (VEX_LEN_0F38DB_P_2) },
6415 /* PREFIX_VEX_0F38DC */
6419 { "vaesenc", { XM, Vex, EXx }, 0 },
6422 /* PREFIX_VEX_0F38DD */
6426 { "vaesenclast", { XM, Vex, EXx }, 0 },
6429 /* PREFIX_VEX_0F38DE */
6433 { "vaesdec", { XM, Vex, EXx }, 0 },
6436 /* PREFIX_VEX_0F38DF */
6440 { "vaesdeclast", { XM, Vex, EXx }, 0 },
6443 /* PREFIX_VEX_0F38F2 */
6445 { VEX_LEN_TABLE (VEX_LEN_0F38F2_P_0) },
6448 /* PREFIX_VEX_0F38F3_REG_1 */
6450 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_1_P_0) },
6453 /* PREFIX_VEX_0F38F3_REG_2 */
6455 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_2_P_0) },
6458 /* PREFIX_VEX_0F38F3_REG_3 */
6460 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_3_P_0) },
6463 /* PREFIX_VEX_0F38F5 */
6465 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_0) },
6466 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_1) },
6468 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_3) },
6471 /* PREFIX_VEX_0F38F6 */
6476 { VEX_LEN_TABLE (VEX_LEN_0F38F6_P_3) },
6479 /* PREFIX_VEX_0F38F7 */
6481 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_0) },
6482 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_1) },
6483 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_2) },
6484 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_3) },
6487 /* PREFIX_VEX_0F3A00 */
6491 { VEX_LEN_TABLE (VEX_LEN_0F3A00_P_2) },
6494 /* PREFIX_VEX_0F3A01 */
6498 { VEX_LEN_TABLE (VEX_LEN_0F3A01_P_2) },
6501 /* PREFIX_VEX_0F3A02 */
6505 { VEX_W_TABLE (VEX_W_0F3A02_P_2) },
6508 /* PREFIX_VEX_0F3A04 */
6512 { VEX_W_TABLE (VEX_W_0F3A04_P_2) },
6515 /* PREFIX_VEX_0F3A05 */
6519 { VEX_W_TABLE (VEX_W_0F3A05_P_2) },
6522 /* PREFIX_VEX_0F3A06 */
6526 { VEX_LEN_TABLE (VEX_LEN_0F3A06_P_2) },
6529 /* PREFIX_VEX_0F3A08 */
6533 { VEX_W_TABLE (VEX_W_0F3A08_P_2) },
6536 /* PREFIX_VEX_0F3A09 */
6540 { VEX_W_TABLE (VEX_W_0F3A09_P_2) },
6543 /* PREFIX_VEX_0F3A0A */
6547 { VEX_LEN_TABLE (VEX_LEN_0F3A0A_P_2) },
6550 /* PREFIX_VEX_0F3A0B */
6554 { VEX_LEN_TABLE (VEX_LEN_0F3A0B_P_2) },
6557 /* PREFIX_VEX_0F3A0C */
6561 { VEX_W_TABLE (VEX_W_0F3A0C_P_2) },
6564 /* PREFIX_VEX_0F3A0D */
6568 { VEX_W_TABLE (VEX_W_0F3A0D_P_2) },
6571 /* PREFIX_VEX_0F3A0E */
6575 { VEX_W_TABLE (VEX_W_0F3A0E_P_2) },
6578 /* PREFIX_VEX_0F3A0F */
6582 { VEX_W_TABLE (VEX_W_0F3A0F_P_2) },
6585 /* PREFIX_VEX_0F3A14 */
6589 { VEX_LEN_TABLE (VEX_LEN_0F3A14_P_2) },
6592 /* PREFIX_VEX_0F3A15 */
6596 { VEX_LEN_TABLE (VEX_LEN_0F3A15_P_2) },
6599 /* PREFIX_VEX_0F3A16 */
6603 { VEX_LEN_TABLE (VEX_LEN_0F3A16_P_2) },
6606 /* PREFIX_VEX_0F3A17 */
6610 { VEX_LEN_TABLE (VEX_LEN_0F3A17_P_2) },
6613 /* PREFIX_VEX_0F3A18 */
6617 { VEX_LEN_TABLE (VEX_LEN_0F3A18_P_2) },
6620 /* PREFIX_VEX_0F3A19 */
6624 { VEX_LEN_TABLE (VEX_LEN_0F3A19_P_2) },
6627 /* PREFIX_VEX_0F3A1D */
6631 { "vcvtps2ph", { EXxmmq, XM, Ib }, 0 },
6634 /* PREFIX_VEX_0F3A20 */
6638 { VEX_LEN_TABLE (VEX_LEN_0F3A20_P_2) },
6641 /* PREFIX_VEX_0F3A21 */
6645 { VEX_LEN_TABLE (VEX_LEN_0F3A21_P_2) },
6648 /* PREFIX_VEX_0F3A22 */
6652 { VEX_LEN_TABLE (VEX_LEN_0F3A22_P_2) },
6655 /* PREFIX_VEX_0F3A30 */
6659 { VEX_LEN_TABLE (VEX_LEN_0F3A30_P_2) },
6662 /* PREFIX_VEX_0F3A31 */
6666 { VEX_LEN_TABLE (VEX_LEN_0F3A31_P_2) },
6669 /* PREFIX_VEX_0F3A32 */
6673 { VEX_LEN_TABLE (VEX_LEN_0F3A32_P_2) },
6676 /* PREFIX_VEX_0F3A33 */
6680 { VEX_LEN_TABLE (VEX_LEN_0F3A33_P_2) },
6683 /* PREFIX_VEX_0F3A38 */
6687 { VEX_LEN_TABLE (VEX_LEN_0F3A38_P_2) },
6690 /* PREFIX_VEX_0F3A39 */
6694 { VEX_LEN_TABLE (VEX_LEN_0F3A39_P_2) },
6697 /* PREFIX_VEX_0F3A40 */
6701 { VEX_W_TABLE (VEX_W_0F3A40_P_2) },
6704 /* PREFIX_VEX_0F3A41 */
6708 { VEX_LEN_TABLE (VEX_LEN_0F3A41_P_2) },
6711 /* PREFIX_VEX_0F3A42 */
6715 { VEX_W_TABLE (VEX_W_0F3A42_P_2) },
6718 /* PREFIX_VEX_0F3A44 */
6722 { "vpclmulqdq", { XM, Vex, EXx, PCLMUL }, 0 },
6725 /* PREFIX_VEX_0F3A46 */
6729 { VEX_LEN_TABLE (VEX_LEN_0F3A46_P_2) },
6732 /* PREFIX_VEX_0F3A48 */
6736 { VEX_W_TABLE (VEX_W_0F3A48_P_2) },
6739 /* PREFIX_VEX_0F3A49 */
6743 { VEX_W_TABLE (VEX_W_0F3A49_P_2) },
6746 /* PREFIX_VEX_0F3A4A */
6750 { VEX_W_TABLE (VEX_W_0F3A4A_P_2) },
6753 /* PREFIX_VEX_0F3A4B */
6757 { VEX_W_TABLE (VEX_W_0F3A4B_P_2) },
6760 /* PREFIX_VEX_0F3A4C */
6764 { VEX_W_TABLE (VEX_W_0F3A4C_P_2) },
6767 /* PREFIX_VEX_0F3A5C */
6771 { "vfmaddsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6774 /* PREFIX_VEX_0F3A5D */
6778 { "vfmaddsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6781 /* PREFIX_VEX_0F3A5E */
6785 { "vfmsubaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6788 /* PREFIX_VEX_0F3A5F */
6792 { "vfmsubaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6795 /* PREFIX_VEX_0F3A60 */
6799 { VEX_LEN_TABLE (VEX_LEN_0F3A60_P_2) },
6803 /* PREFIX_VEX_0F3A61 */
6807 { VEX_LEN_TABLE (VEX_LEN_0F3A61_P_2) },
6810 /* PREFIX_VEX_0F3A62 */
6814 { VEX_LEN_TABLE (VEX_LEN_0F3A62_P_2) },
6817 /* PREFIX_VEX_0F3A63 */
6821 { VEX_LEN_TABLE (VEX_LEN_0F3A63_P_2) },
6824 /* PREFIX_VEX_0F3A68 */
6828 { "vfmaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6831 /* PREFIX_VEX_0F3A69 */
6835 { "vfmaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6838 /* PREFIX_VEX_0F3A6A */
6842 { VEX_LEN_TABLE (VEX_LEN_0F3A6A_P_2) },
6845 /* PREFIX_VEX_0F3A6B */
6849 { VEX_LEN_TABLE (VEX_LEN_0F3A6B_P_2) },
6852 /* PREFIX_VEX_0F3A6C */
6856 { "vfmsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6859 /* PREFIX_VEX_0F3A6D */
6863 { "vfmsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6866 /* PREFIX_VEX_0F3A6E */
6870 { VEX_LEN_TABLE (VEX_LEN_0F3A6E_P_2) },
6873 /* PREFIX_VEX_0F3A6F */
6877 { VEX_LEN_TABLE (VEX_LEN_0F3A6F_P_2) },
6880 /* PREFIX_VEX_0F3A78 */
6884 { "vfnmaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6887 /* PREFIX_VEX_0F3A79 */
6891 { "vfnmaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6894 /* PREFIX_VEX_0F3A7A */
6898 { VEX_LEN_TABLE (VEX_LEN_0F3A7A_P_2) },
6901 /* PREFIX_VEX_0F3A7B */
6905 { VEX_LEN_TABLE (VEX_LEN_0F3A7B_P_2) },
6908 /* PREFIX_VEX_0F3A7C */
6912 { "vfnmsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6916 /* PREFIX_VEX_0F3A7D */
6920 { "vfnmsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6923 /* PREFIX_VEX_0F3A7E */
6927 { VEX_LEN_TABLE (VEX_LEN_0F3A7E_P_2) },
6930 /* PREFIX_VEX_0F3A7F */
6934 { VEX_LEN_TABLE (VEX_LEN_0F3A7F_P_2) },
6937 /* PREFIX_VEX_0F3ACE */
6941 { VEX_W_TABLE (VEX_W_0F3ACE_P_2) },
6944 /* PREFIX_VEX_0F3ACF */
6948 { VEX_W_TABLE (VEX_W_0F3ACF_P_2) },
6951 /* PREFIX_VEX_0F3ADF */
6955 { VEX_LEN_TABLE (VEX_LEN_0F3ADF_P_2) },
6958 /* PREFIX_VEX_0F3AF0 */
6963 { VEX_LEN_TABLE (VEX_LEN_0F3AF0_P_3) },
6966 #define NEED_PREFIX_TABLE
6967 #include "i386-dis-evex.h"
6968 #undef NEED_PREFIX_TABLE
6971 static const struct dis386 x86_64_table[][2] = {
6974 { "pushP", { es }, 0 },
6979 { "popP", { es }, 0 },
6984 { "pushP", { cs }, 0 },
6989 { "pushP", { ss }, 0 },
6994 { "popP", { ss }, 0 },
6999 { "pushP", { ds }, 0 },
7004 { "popP", { ds }, 0 },
7009 { "daa", { XX }, 0 },
7014 { "das", { XX }, 0 },
7019 { "aaa", { XX }, 0 },
7024 { "aas", { XX }, 0 },
7029 { "pushaP", { XX }, 0 },
7034 { "popaP", { XX }, 0 },
7039 { MOD_TABLE (MOD_62_32BIT) },
7040 { EVEX_TABLE (EVEX_0F) },
7045 { "arpl", { Ew, Gw }, 0 },
7046 { "movs{lq|xd}", { Gv, Ed }, 0 },
7051 { "ins{R|}", { Yzr, indirDX }, 0 },
7052 { "ins{G|}", { Yzr, indirDX }, 0 },
7057 { "outs{R|}", { indirDXr, Xz }, 0 },
7058 { "outs{G|}", { indirDXr, Xz }, 0 },
7063 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
7064 { REG_TABLE (REG_80) },
7069 { "Jcall{T|}", { Ap }, 0 },
7074 { MOD_TABLE (MOD_C4_32BIT) },
7075 { VEX_C4_TABLE (VEX_0F) },
7080 { MOD_TABLE (MOD_C5_32BIT) },
7081 { VEX_C5_TABLE (VEX_0F) },
7086 { "into", { XX }, 0 },
7091 { "aam", { Ib }, 0 },
7096 { "aad", { Ib }, 0 },
7101 { "callP", { Jv, BND }, 0 },
7102 { "call@", { Jv, BND }, 0 }
7107 { "jmpP", { Jv, BND }, 0 },
7108 { "jmp@", { Jv, BND }, 0 }
7113 { "Jjmp{T|}", { Ap }, 0 },
7116 /* X86_64_0F01_REG_0 */
7118 { "sgdt{Q|IQ}", { M }, 0 },
7119 { "sgdt", { M }, 0 },
7122 /* X86_64_0F01_REG_1 */
7124 { "sidt{Q|IQ}", { M }, 0 },
7125 { "sidt", { M }, 0 },
7128 /* X86_64_0F01_REG_2 */
7130 { "lgdt{Q|Q}", { M }, 0 },
7131 { "lgdt", { M }, 0 },
7134 /* X86_64_0F01_REG_3 */
7136 { "lidt{Q|Q}", { M }, 0 },
7137 { "lidt", { M }, 0 },
7141 static const struct dis386 three_byte_table[][256] = {
7143 /* THREE_BYTE_0F38 */
7146 { "pshufb", { MX, EM }, PREFIX_OPCODE },
7147 { "phaddw", { MX, EM }, PREFIX_OPCODE },
7148 { "phaddd", { MX, EM }, PREFIX_OPCODE },
7149 { "phaddsw", { MX, EM }, PREFIX_OPCODE },
7150 { "pmaddubsw", { MX, EM }, PREFIX_OPCODE },
7151 { "phsubw", { MX, EM }, PREFIX_OPCODE },
7152 { "phsubd", { MX, EM }, PREFIX_OPCODE },
7153 { "phsubsw", { MX, EM }, PREFIX_OPCODE },
7155 { "psignb", { MX, EM }, PREFIX_OPCODE },
7156 { "psignw", { MX, EM }, PREFIX_OPCODE },
7157 { "psignd", { MX, EM }, PREFIX_OPCODE },
7158 { "pmulhrsw", { MX, EM }, PREFIX_OPCODE },
7164 { PREFIX_TABLE (PREFIX_0F3810) },
7168 { PREFIX_TABLE (PREFIX_0F3814) },
7169 { PREFIX_TABLE (PREFIX_0F3815) },
7171 { PREFIX_TABLE (PREFIX_0F3817) },
7177 { "pabsb", { MX, EM }, PREFIX_OPCODE },
7178 { "pabsw", { MX, EM }, PREFIX_OPCODE },
7179 { "pabsd", { MX, EM }, PREFIX_OPCODE },
7182 { PREFIX_TABLE (PREFIX_0F3820) },
7183 { PREFIX_TABLE (PREFIX_0F3821) },
7184 { PREFIX_TABLE (PREFIX_0F3822) },
7185 { PREFIX_TABLE (PREFIX_0F3823) },
7186 { PREFIX_TABLE (PREFIX_0F3824) },
7187 { PREFIX_TABLE (PREFIX_0F3825) },
7191 { PREFIX_TABLE (PREFIX_0F3828) },
7192 { PREFIX_TABLE (PREFIX_0F3829) },
7193 { PREFIX_TABLE (PREFIX_0F382A) },
7194 { PREFIX_TABLE (PREFIX_0F382B) },
7200 { PREFIX_TABLE (PREFIX_0F3830) },
7201 { PREFIX_TABLE (PREFIX_0F3831) },
7202 { PREFIX_TABLE (PREFIX_0F3832) },
7203 { PREFIX_TABLE (PREFIX_0F3833) },
7204 { PREFIX_TABLE (PREFIX_0F3834) },
7205 { PREFIX_TABLE (PREFIX_0F3835) },
7207 { PREFIX_TABLE (PREFIX_0F3837) },
7209 { PREFIX_TABLE (PREFIX_0F3838) },
7210 { PREFIX_TABLE (PREFIX_0F3839) },
7211 { PREFIX_TABLE (PREFIX_0F383A) },
7212 { PREFIX_TABLE (PREFIX_0F383B) },
7213 { PREFIX_TABLE (PREFIX_0F383C) },
7214 { PREFIX_TABLE (PREFIX_0F383D) },
7215 { PREFIX_TABLE (PREFIX_0F383E) },
7216 { PREFIX_TABLE (PREFIX_0F383F) },
7218 { PREFIX_TABLE (PREFIX_0F3840) },
7219 { PREFIX_TABLE (PREFIX_0F3841) },
7290 { PREFIX_TABLE (PREFIX_0F3880) },
7291 { PREFIX_TABLE (PREFIX_0F3881) },
7292 { PREFIX_TABLE (PREFIX_0F3882) },
7371 { PREFIX_TABLE (PREFIX_0F38C8) },
7372 { PREFIX_TABLE (PREFIX_0F38C9) },
7373 { PREFIX_TABLE (PREFIX_0F38CA) },
7374 { PREFIX_TABLE (PREFIX_0F38CB) },
7375 { PREFIX_TABLE (PREFIX_0F38CC) },
7376 { PREFIX_TABLE (PREFIX_0F38CD) },
7378 { PREFIX_TABLE (PREFIX_0F38CF) },
7392 { PREFIX_TABLE (PREFIX_0F38DB) },
7393 { PREFIX_TABLE (PREFIX_0F38DC) },
7394 { PREFIX_TABLE (PREFIX_0F38DD) },
7395 { PREFIX_TABLE (PREFIX_0F38DE) },
7396 { PREFIX_TABLE (PREFIX_0F38DF) },
7416 { PREFIX_TABLE (PREFIX_0F38F0) },
7417 { PREFIX_TABLE (PREFIX_0F38F1) },
7421 { PREFIX_TABLE (PREFIX_0F38F5) },
7422 { PREFIX_TABLE (PREFIX_0F38F6) },
7434 /* THREE_BYTE_0F3A */
7446 { PREFIX_TABLE (PREFIX_0F3A08) },
7447 { PREFIX_TABLE (PREFIX_0F3A09) },
7448 { PREFIX_TABLE (PREFIX_0F3A0A) },
7449 { PREFIX_TABLE (PREFIX_0F3A0B) },
7450 { PREFIX_TABLE (PREFIX_0F3A0C) },
7451 { PREFIX_TABLE (PREFIX_0F3A0D) },
7452 { PREFIX_TABLE (PREFIX_0F3A0E) },
7453 { "palignr", { MX, EM, Ib }, PREFIX_OPCODE },
7459 { PREFIX_TABLE (PREFIX_0F3A14) },
7460 { PREFIX_TABLE (PREFIX_0F3A15) },
7461 { PREFIX_TABLE (PREFIX_0F3A16) },
7462 { PREFIX_TABLE (PREFIX_0F3A17) },
7473 { PREFIX_TABLE (PREFIX_0F3A20) },
7474 { PREFIX_TABLE (PREFIX_0F3A21) },
7475 { PREFIX_TABLE (PREFIX_0F3A22) },
7509 { PREFIX_TABLE (PREFIX_0F3A40) },
7510 { PREFIX_TABLE (PREFIX_0F3A41) },
7511 { PREFIX_TABLE (PREFIX_0F3A42) },
7513 { PREFIX_TABLE (PREFIX_0F3A44) },
7545 { PREFIX_TABLE (PREFIX_0F3A60) },
7546 { PREFIX_TABLE (PREFIX_0F3A61) },
7547 { PREFIX_TABLE (PREFIX_0F3A62) },
7548 { PREFIX_TABLE (PREFIX_0F3A63) },
7666 { PREFIX_TABLE (PREFIX_0F3ACC) },
7668 { PREFIX_TABLE (PREFIX_0F3ACE) },
7669 { PREFIX_TABLE (PREFIX_0F3ACF) },
7687 { PREFIX_TABLE (PREFIX_0F3ADF) },
7727 static const struct dis386 xop_table[][256] = {
7880 { "vpmacssww", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7881 { "vpmacsswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7882 { "vpmacssdql", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7890 { "vpmacssdd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7891 { "vpmacssdqh", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7898 { "vpmacsww", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7899 { "vpmacswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7900 { "vpmacsdql", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7908 { "vpmacsdd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7909 { "vpmacsdqh", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7913 { "vpcmov", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7914 { "vpperm", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7917 { "vpmadcsswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7935 { "vpmadcswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7947 { "vprotb", { XM, Vex_2src_1, Ib }, 0 },
7948 { "vprotw", { XM, Vex_2src_1, Ib }, 0 },
7949 { "vprotd", { XM, Vex_2src_1, Ib }, 0 },
7950 { "vprotq", { XM, Vex_2src_1, Ib }, 0 },
7960 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC) },
7961 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD) },
7962 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE) },
7963 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF) },
7996 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC) },
7997 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED) },
7998 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE) },
7999 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF) },
8023 { REG_TABLE (REG_XOP_TBM_01) },
8024 { REG_TABLE (REG_XOP_TBM_02) },
8042 { REG_TABLE (REG_XOP_LWPCB) },
8166 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_80) },
8167 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_81) },
8168 { "vfrczss", { XM, EXd }, 0 },
8169 { "vfrczsd", { XM, EXq }, 0 },
8184 { "vprotb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8185 { "vprotw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8186 { "vprotd", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8187 { "vprotq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8188 { "vpshlb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8189 { "vpshlw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8190 { "vpshld", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8191 { "vpshlq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8193 { "vpshab", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8194 { "vpshaw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8195 { "vpshad", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8196 { "vpshaq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8239 { "vphaddbw", { XM, EXxmm }, 0 },
8240 { "vphaddbd", { XM, EXxmm }, 0 },
8241 { "vphaddbq", { XM, EXxmm }, 0 },
8244 { "vphaddwd", { XM, EXxmm }, 0 },
8245 { "vphaddwq", { XM, EXxmm }, 0 },
8250 { "vphadddq", { XM, EXxmm }, 0 },
8257 { "vphaddubw", { XM, EXxmm }, 0 },
8258 { "vphaddubd", { XM, EXxmm }, 0 },
8259 { "vphaddubq", { XM, EXxmm }, 0 },
8262 { "vphadduwd", { XM, EXxmm }, 0 },
8263 { "vphadduwq", { XM, EXxmm }, 0 },
8268 { "vphaddudq", { XM, EXxmm }, 0 },
8275 { "vphsubbw", { XM, EXxmm }, 0 },
8276 { "vphsubwd", { XM, EXxmm }, 0 },
8277 { "vphsubdq", { XM, EXxmm }, 0 },
8331 { "bextr", { Gv, Ev, Iq }, 0 },
8333 { REG_TABLE (REG_XOP_LWP) },
8603 static const struct dis386 vex_table[][256] = {
8625 { PREFIX_TABLE (PREFIX_VEX_0F10) },
8626 { PREFIX_TABLE (PREFIX_VEX_0F11) },
8627 { PREFIX_TABLE (PREFIX_VEX_0F12) },
8628 { MOD_TABLE (MOD_VEX_0F13) },
8629 { VEX_W_TABLE (VEX_W_0F14) },
8630 { VEX_W_TABLE (VEX_W_0F15) },
8631 { PREFIX_TABLE (PREFIX_VEX_0F16) },
8632 { MOD_TABLE (MOD_VEX_0F17) },
8652 { VEX_W_TABLE (VEX_W_0F28) },
8653 { VEX_W_TABLE (VEX_W_0F29) },
8654 { PREFIX_TABLE (PREFIX_VEX_0F2A) },
8655 { MOD_TABLE (MOD_VEX_0F2B) },
8656 { PREFIX_TABLE (PREFIX_VEX_0F2C) },
8657 { PREFIX_TABLE (PREFIX_VEX_0F2D) },
8658 { PREFIX_TABLE (PREFIX_VEX_0F2E) },
8659 { PREFIX_TABLE (PREFIX_VEX_0F2F) },
8680 { PREFIX_TABLE (PREFIX_VEX_0F41) },
8681 { PREFIX_TABLE (PREFIX_VEX_0F42) },
8683 { PREFIX_TABLE (PREFIX_VEX_0F44) },
8684 { PREFIX_TABLE (PREFIX_VEX_0F45) },
8685 { PREFIX_TABLE (PREFIX_VEX_0F46) },
8686 { PREFIX_TABLE (PREFIX_VEX_0F47) },
8690 { PREFIX_TABLE (PREFIX_VEX_0F4A) },
8691 { PREFIX_TABLE (PREFIX_VEX_0F4B) },
8697 { MOD_TABLE (MOD_VEX_0F50) },
8698 { PREFIX_TABLE (PREFIX_VEX_0F51) },
8699 { PREFIX_TABLE (PREFIX_VEX_0F52) },
8700 { PREFIX_TABLE (PREFIX_VEX_0F53) },
8701 { "vandpX", { XM, Vex, EXx }, 0 },
8702 { "vandnpX", { XM, Vex, EXx }, 0 },
8703 { "vorpX", { XM, Vex, EXx }, 0 },
8704 { "vxorpX", { XM, Vex, EXx }, 0 },
8706 { PREFIX_TABLE (PREFIX_VEX_0F58) },
8707 { PREFIX_TABLE (PREFIX_VEX_0F59) },
8708 { PREFIX_TABLE (PREFIX_VEX_0F5A) },
8709 { PREFIX_TABLE (PREFIX_VEX_0F5B) },
8710 { PREFIX_TABLE (PREFIX_VEX_0F5C) },
8711 { PREFIX_TABLE (PREFIX_VEX_0F5D) },
8712 { PREFIX_TABLE (PREFIX_VEX_0F5E) },
8713 { PREFIX_TABLE (PREFIX_VEX_0F5F) },
8715 { PREFIX_TABLE (PREFIX_VEX_0F60) },
8716 { PREFIX_TABLE (PREFIX_VEX_0F61) },
8717 { PREFIX_TABLE (PREFIX_VEX_0F62) },
8718 { PREFIX_TABLE (PREFIX_VEX_0F63) },
8719 { PREFIX_TABLE (PREFIX_VEX_0F64) },
8720 { PREFIX_TABLE (PREFIX_VEX_0F65) },
8721 { PREFIX_TABLE (PREFIX_VEX_0F66) },
8722 { PREFIX_TABLE (PREFIX_VEX_0F67) },
8724 { PREFIX_TABLE (PREFIX_VEX_0F68) },
8725 { PREFIX_TABLE (PREFIX_VEX_0F69) },
8726 { PREFIX_TABLE (PREFIX_VEX_0F6A) },
8727 { PREFIX_TABLE (PREFIX_VEX_0F6B) },
8728 { PREFIX_TABLE (PREFIX_VEX_0F6C) },
8729 { PREFIX_TABLE (PREFIX_VEX_0F6D) },
8730 { PREFIX_TABLE (PREFIX_VEX_0F6E) },
8731 { PREFIX_TABLE (PREFIX_VEX_0F6F) },
8733 { PREFIX_TABLE (PREFIX_VEX_0F70) },
8734 { REG_TABLE (REG_VEX_0F71) },
8735 { REG_TABLE (REG_VEX_0F72) },
8736 { REG_TABLE (REG_VEX_0F73) },
8737 { PREFIX_TABLE (PREFIX_VEX_0F74) },
8738 { PREFIX_TABLE (PREFIX_VEX_0F75) },
8739 { PREFIX_TABLE (PREFIX_VEX_0F76) },
8740 { PREFIX_TABLE (PREFIX_VEX_0F77) },
8746 { PREFIX_TABLE (PREFIX_VEX_0F7C) },
8747 { PREFIX_TABLE (PREFIX_VEX_0F7D) },
8748 { PREFIX_TABLE (PREFIX_VEX_0F7E) },
8749 { PREFIX_TABLE (PREFIX_VEX_0F7F) },
8769 { PREFIX_TABLE (PREFIX_VEX_0F90) },
8770 { PREFIX_TABLE (PREFIX_VEX_0F91) },
8771 { PREFIX_TABLE (PREFIX_VEX_0F92) },
8772 { PREFIX_TABLE (PREFIX_VEX_0F93) },
8778 { PREFIX_TABLE (PREFIX_VEX_0F98) },
8779 { PREFIX_TABLE (PREFIX_VEX_0F99) },
8802 { REG_TABLE (REG_VEX_0FAE) },
8825 { PREFIX_TABLE (PREFIX_VEX_0FC2) },
8827 { PREFIX_TABLE (PREFIX_VEX_0FC4) },
8828 { PREFIX_TABLE (PREFIX_VEX_0FC5) },
8829 { "vshufpX", { XM, Vex, EXx, Ib }, 0 },
8841 { PREFIX_TABLE (PREFIX_VEX_0FD0) },
8842 { PREFIX_TABLE (PREFIX_VEX_0FD1) },
8843 { PREFIX_TABLE (PREFIX_VEX_0FD2) },
8844 { PREFIX_TABLE (PREFIX_VEX_0FD3) },
8845 { PREFIX_TABLE (PREFIX_VEX_0FD4) },
8846 { PREFIX_TABLE (PREFIX_VEX_0FD5) },
8847 { PREFIX_TABLE (PREFIX_VEX_0FD6) },
8848 { PREFIX_TABLE (PREFIX_VEX_0FD7) },
8850 { PREFIX_TABLE (PREFIX_VEX_0FD8) },
8851 { PREFIX_TABLE (PREFIX_VEX_0FD9) },
8852 { PREFIX_TABLE (PREFIX_VEX_0FDA) },
8853 { PREFIX_TABLE (PREFIX_VEX_0FDB) },
8854 { PREFIX_TABLE (PREFIX_VEX_0FDC) },
8855 { PREFIX_TABLE (PREFIX_VEX_0FDD) },
8856 { PREFIX_TABLE (PREFIX_VEX_0FDE) },
8857 { PREFIX_TABLE (PREFIX_VEX_0FDF) },
8859 { PREFIX_TABLE (PREFIX_VEX_0FE0) },
8860 { PREFIX_TABLE (PREFIX_VEX_0FE1) },
8861 { PREFIX_TABLE (PREFIX_VEX_0FE2) },
8862 { PREFIX_TABLE (PREFIX_VEX_0FE3) },
8863 { PREFIX_TABLE (PREFIX_VEX_0FE4) },
8864 { PREFIX_TABLE (PREFIX_VEX_0FE5) },
8865 { PREFIX_TABLE (PREFIX_VEX_0FE6) },
8866 { PREFIX_TABLE (PREFIX_VEX_0FE7) },
8868 { PREFIX_TABLE (PREFIX_VEX_0FE8) },
8869 { PREFIX_TABLE (PREFIX_VEX_0FE9) },
8870 { PREFIX_TABLE (PREFIX_VEX_0FEA) },
8871 { PREFIX_TABLE (PREFIX_VEX_0FEB) },
8872 { PREFIX_TABLE (PREFIX_VEX_0FEC) },
8873 { PREFIX_TABLE (PREFIX_VEX_0FED) },
8874 { PREFIX_TABLE (PREFIX_VEX_0FEE) },
8875 { PREFIX_TABLE (PREFIX_VEX_0FEF) },
8877 { PREFIX_TABLE (PREFIX_VEX_0FF0) },
8878 { PREFIX_TABLE (PREFIX_VEX_0FF1) },
8879 { PREFIX_TABLE (PREFIX_VEX_0FF2) },
8880 { PREFIX_TABLE (PREFIX_VEX_0FF3) },
8881 { PREFIX_TABLE (PREFIX_VEX_0FF4) },
8882 { PREFIX_TABLE (PREFIX_VEX_0FF5) },
8883 { PREFIX_TABLE (PREFIX_VEX_0FF6) },
8884 { PREFIX_TABLE (PREFIX_VEX_0FF7) },
8886 { PREFIX_TABLE (PREFIX_VEX_0FF8) },
8887 { PREFIX_TABLE (PREFIX_VEX_0FF9) },
8888 { PREFIX_TABLE (PREFIX_VEX_0FFA) },
8889 { PREFIX_TABLE (PREFIX_VEX_0FFB) },
8890 { PREFIX_TABLE (PREFIX_VEX_0FFC) },
8891 { PREFIX_TABLE (PREFIX_VEX_0FFD) },
8892 { PREFIX_TABLE (PREFIX_VEX_0FFE) },
8898 { PREFIX_TABLE (PREFIX_VEX_0F3800) },
8899 { PREFIX_TABLE (PREFIX_VEX_0F3801) },
8900 { PREFIX_TABLE (PREFIX_VEX_0F3802) },
8901 { PREFIX_TABLE (PREFIX_VEX_0F3803) },
8902 { PREFIX_TABLE (PREFIX_VEX_0F3804) },
8903 { PREFIX_TABLE (PREFIX_VEX_0F3805) },
8904 { PREFIX_TABLE (PREFIX_VEX_0F3806) },
8905 { PREFIX_TABLE (PREFIX_VEX_0F3807) },
8907 { PREFIX_TABLE (PREFIX_VEX_0F3808) },
8908 { PREFIX_TABLE (PREFIX_VEX_0F3809) },
8909 { PREFIX_TABLE (PREFIX_VEX_0F380A) },
8910 { PREFIX_TABLE (PREFIX_VEX_0F380B) },
8911 { PREFIX_TABLE (PREFIX_VEX_0F380C) },
8912 { PREFIX_TABLE (PREFIX_VEX_0F380D) },
8913 { PREFIX_TABLE (PREFIX_VEX_0F380E) },
8914 { PREFIX_TABLE (PREFIX_VEX_0F380F) },
8919 { PREFIX_TABLE (PREFIX_VEX_0F3813) },
8922 { PREFIX_TABLE (PREFIX_VEX_0F3816) },
8923 { PREFIX_TABLE (PREFIX_VEX_0F3817) },
8925 { PREFIX_TABLE (PREFIX_VEX_0F3818) },
8926 { PREFIX_TABLE (PREFIX_VEX_0F3819) },
8927 { PREFIX_TABLE (PREFIX_VEX_0F381A) },
8929 { PREFIX_TABLE (PREFIX_VEX_0F381C) },
8930 { PREFIX_TABLE (PREFIX_VEX_0F381D) },
8931 { PREFIX_TABLE (PREFIX_VEX_0F381E) },
8934 { PREFIX_TABLE (PREFIX_VEX_0F3820) },
8935 { PREFIX_TABLE (PREFIX_VEX_0F3821) },
8936 { PREFIX_TABLE (PREFIX_VEX_0F3822) },
8937 { PREFIX_TABLE (PREFIX_VEX_0F3823) },
8938 { PREFIX_TABLE (PREFIX_VEX_0F3824) },
8939 { PREFIX_TABLE (PREFIX_VEX_0F3825) },
8943 { PREFIX_TABLE (PREFIX_VEX_0F3828) },
8944 { PREFIX_TABLE (PREFIX_VEX_0F3829) },
8945 { PREFIX_TABLE (PREFIX_VEX_0F382A) },
8946 { PREFIX_TABLE (PREFIX_VEX_0F382B) },
8947 { PREFIX_TABLE (PREFIX_VEX_0F382C) },
8948 { PREFIX_TABLE (PREFIX_VEX_0F382D) },
8949 { PREFIX_TABLE (PREFIX_VEX_0F382E) },
8950 { PREFIX_TABLE (PREFIX_VEX_0F382F) },
8952 { PREFIX_TABLE (PREFIX_VEX_0F3830) },
8953 { PREFIX_TABLE (PREFIX_VEX_0F3831) },
8954 { PREFIX_TABLE (PREFIX_VEX_0F3832) },
8955 { PREFIX_TABLE (PREFIX_VEX_0F3833) },
8956 { PREFIX_TABLE (PREFIX_VEX_0F3834) },
8957 { PREFIX_TABLE (PREFIX_VEX_0F3835) },
8958 { PREFIX_TABLE (PREFIX_VEX_0F3836) },
8959 { PREFIX_TABLE (PREFIX_VEX_0F3837) },
8961 { PREFIX_TABLE (PREFIX_VEX_0F3838) },
8962 { PREFIX_TABLE (PREFIX_VEX_0F3839) },
8963 { PREFIX_TABLE (PREFIX_VEX_0F383A) },
8964 { PREFIX_TABLE (PREFIX_VEX_0F383B) },
8965 { PREFIX_TABLE (PREFIX_VEX_0F383C) },
8966 { PREFIX_TABLE (PREFIX_VEX_0F383D) },
8967 { PREFIX_TABLE (PREFIX_VEX_0F383E) },
8968 { PREFIX_TABLE (PREFIX_VEX_0F383F) },
8970 { PREFIX_TABLE (PREFIX_VEX_0F3840) },
8971 { PREFIX_TABLE (PREFIX_VEX_0F3841) },
8975 { PREFIX_TABLE (PREFIX_VEX_0F3845) },
8976 { PREFIX_TABLE (PREFIX_VEX_0F3846) },
8977 { PREFIX_TABLE (PREFIX_VEX_0F3847) },
8997 { PREFIX_TABLE (PREFIX_VEX_0F3858) },
8998 { PREFIX_TABLE (PREFIX_VEX_0F3859) },
8999 { PREFIX_TABLE (PREFIX_VEX_0F385A) },
9033 { PREFIX_TABLE (PREFIX_VEX_0F3878) },
9034 { PREFIX_TABLE (PREFIX_VEX_0F3879) },
9055 { PREFIX_TABLE (PREFIX_VEX_0F388C) },
9057 { PREFIX_TABLE (PREFIX_VEX_0F388E) },
9060 { PREFIX_TABLE (PREFIX_VEX_0F3890) },
9061 { PREFIX_TABLE (PREFIX_VEX_0F3891) },
9062 { PREFIX_TABLE (PREFIX_VEX_0F3892) },
9063 { PREFIX_TABLE (PREFIX_VEX_0F3893) },
9066 { PREFIX_TABLE (PREFIX_VEX_0F3896) },
9067 { PREFIX_TABLE (PREFIX_VEX_0F3897) },
9069 { PREFIX_TABLE (PREFIX_VEX_0F3898) },
9070 { PREFIX_TABLE (PREFIX_VEX_0F3899) },
9071 { PREFIX_TABLE (PREFIX_VEX_0F389A) },
9072 { PREFIX_TABLE (PREFIX_VEX_0F389B) },
9073 { PREFIX_TABLE (PREFIX_VEX_0F389C) },
9074 { PREFIX_TABLE (PREFIX_VEX_0F389D) },
9075 { PREFIX_TABLE (PREFIX_VEX_0F389E) },
9076 { PREFIX_TABLE (PREFIX_VEX_0F389F) },
9084 { PREFIX_TABLE (PREFIX_VEX_0F38A6) },
9085 { PREFIX_TABLE (PREFIX_VEX_0F38A7) },
9087 { PREFIX_TABLE (PREFIX_VEX_0F38A8) },
9088 { PREFIX_TABLE (PREFIX_VEX_0F38A9) },
9089 { PREFIX_TABLE (PREFIX_VEX_0F38AA) },
9090 { PREFIX_TABLE (PREFIX_VEX_0F38AB) },
9091 { PREFIX_TABLE (PREFIX_VEX_0F38AC) },
9092 { PREFIX_TABLE (PREFIX_VEX_0F38AD) },
9093 { PREFIX_TABLE (PREFIX_VEX_0F38AE) },
9094 { PREFIX_TABLE (PREFIX_VEX_0F38AF) },
9102 { PREFIX_TABLE (PREFIX_VEX_0F38B6) },
9103 { PREFIX_TABLE (PREFIX_VEX_0F38B7) },
9105 { PREFIX_TABLE (PREFIX_VEX_0F38B8) },
9106 { PREFIX_TABLE (PREFIX_VEX_0F38B9) },
9107 { PREFIX_TABLE (PREFIX_VEX_0F38BA) },
9108 { PREFIX_TABLE (PREFIX_VEX_0F38BB) },
9109 { PREFIX_TABLE (PREFIX_VEX_0F38BC) },
9110 { PREFIX_TABLE (PREFIX_VEX_0F38BD) },
9111 { PREFIX_TABLE (PREFIX_VEX_0F38BE) },
9112 { PREFIX_TABLE (PREFIX_VEX_0F38BF) },
9130 { PREFIX_TABLE (PREFIX_VEX_0F38CF) },
9144 { PREFIX_TABLE (PREFIX_VEX_0F38DB) },
9145 { PREFIX_TABLE (PREFIX_VEX_0F38DC) },
9146 { PREFIX_TABLE (PREFIX_VEX_0F38DD) },
9147 { PREFIX_TABLE (PREFIX_VEX_0F38DE) },
9148 { PREFIX_TABLE (PREFIX_VEX_0F38DF) },
9170 { PREFIX_TABLE (PREFIX_VEX_0F38F2) },
9171 { REG_TABLE (REG_VEX_0F38F3) },
9173 { PREFIX_TABLE (PREFIX_VEX_0F38F5) },
9174 { PREFIX_TABLE (PREFIX_VEX_0F38F6) },
9175 { PREFIX_TABLE (PREFIX_VEX_0F38F7) },
9189 { PREFIX_TABLE (PREFIX_VEX_0F3A00) },
9190 { PREFIX_TABLE (PREFIX_VEX_0F3A01) },
9191 { PREFIX_TABLE (PREFIX_VEX_0F3A02) },
9193 { PREFIX_TABLE (PREFIX_VEX_0F3A04) },
9194 { PREFIX_TABLE (PREFIX_VEX_0F3A05) },
9195 { PREFIX_TABLE (PREFIX_VEX_0F3A06) },
9198 { PREFIX_TABLE (PREFIX_VEX_0F3A08) },
9199 { PREFIX_TABLE (PREFIX_VEX_0F3A09) },
9200 { PREFIX_TABLE (PREFIX_VEX_0F3A0A) },
9201 { PREFIX_TABLE (PREFIX_VEX_0F3A0B) },
9202 { PREFIX_TABLE (PREFIX_VEX_0F3A0C) },
9203 { PREFIX_TABLE (PREFIX_VEX_0F3A0D) },
9204 { PREFIX_TABLE (PREFIX_VEX_0F3A0E) },
9205 { PREFIX_TABLE (PREFIX_VEX_0F3A0F) },
9211 { PREFIX_TABLE (PREFIX_VEX_0F3A14) },
9212 { PREFIX_TABLE (PREFIX_VEX_0F3A15) },
9213 { PREFIX_TABLE (PREFIX_VEX_0F3A16) },
9214 { PREFIX_TABLE (PREFIX_VEX_0F3A17) },
9216 { PREFIX_TABLE (PREFIX_VEX_0F3A18) },
9217 { PREFIX_TABLE (PREFIX_VEX_0F3A19) },
9221 { PREFIX_TABLE (PREFIX_VEX_0F3A1D) },
9225 { PREFIX_TABLE (PREFIX_VEX_0F3A20) },
9226 { PREFIX_TABLE (PREFIX_VEX_0F3A21) },
9227 { PREFIX_TABLE (PREFIX_VEX_0F3A22) },
9243 { PREFIX_TABLE (PREFIX_VEX_0F3A30) },
9244 { PREFIX_TABLE (PREFIX_VEX_0F3A31) },
9245 { PREFIX_TABLE (PREFIX_VEX_0F3A32) },
9246 { PREFIX_TABLE (PREFIX_VEX_0F3A33) },
9252 { PREFIX_TABLE (PREFIX_VEX_0F3A38) },
9253 { PREFIX_TABLE (PREFIX_VEX_0F3A39) },
9261 { PREFIX_TABLE (PREFIX_VEX_0F3A40) },
9262 { PREFIX_TABLE (PREFIX_VEX_0F3A41) },
9263 { PREFIX_TABLE (PREFIX_VEX_0F3A42) },
9265 { PREFIX_TABLE (PREFIX_VEX_0F3A44) },
9267 { PREFIX_TABLE (PREFIX_VEX_0F3A46) },
9270 { PREFIX_TABLE (PREFIX_VEX_0F3A48) },
9271 { PREFIX_TABLE (PREFIX_VEX_0F3A49) },
9272 { PREFIX_TABLE (PREFIX_VEX_0F3A4A) },
9273 { PREFIX_TABLE (PREFIX_VEX_0F3A4B) },
9274 { PREFIX_TABLE (PREFIX_VEX_0F3A4C) },
9292 { PREFIX_TABLE (PREFIX_VEX_0F3A5C) },
9293 { PREFIX_TABLE (PREFIX_VEX_0F3A5D) },
9294 { PREFIX_TABLE (PREFIX_VEX_0F3A5E) },
9295 { PREFIX_TABLE (PREFIX_VEX_0F3A5F) },
9297 { PREFIX_TABLE (PREFIX_VEX_0F3A60) },
9298 { PREFIX_TABLE (PREFIX_VEX_0F3A61) },
9299 { PREFIX_TABLE (PREFIX_VEX_0F3A62) },
9300 { PREFIX_TABLE (PREFIX_VEX_0F3A63) },
9306 { PREFIX_TABLE (PREFIX_VEX_0F3A68) },
9307 { PREFIX_TABLE (PREFIX_VEX_0F3A69) },
9308 { PREFIX_TABLE (PREFIX_VEX_0F3A6A) },
9309 { PREFIX_TABLE (PREFIX_VEX_0F3A6B) },
9310 { PREFIX_TABLE (PREFIX_VEX_0F3A6C) },
9311 { PREFIX_TABLE (PREFIX_VEX_0F3A6D) },
9312 { PREFIX_TABLE (PREFIX_VEX_0F3A6E) },
9313 { PREFIX_TABLE (PREFIX_VEX_0F3A6F) },
9324 { PREFIX_TABLE (PREFIX_VEX_0F3A78) },
9325 { PREFIX_TABLE (PREFIX_VEX_0F3A79) },
9326 { PREFIX_TABLE (PREFIX_VEX_0F3A7A) },
9327 { PREFIX_TABLE (PREFIX_VEX_0F3A7B) },
9328 { PREFIX_TABLE (PREFIX_VEX_0F3A7C) },
9329 { PREFIX_TABLE (PREFIX_VEX_0F3A7D) },
9330 { PREFIX_TABLE (PREFIX_VEX_0F3A7E) },
9331 { PREFIX_TABLE (PREFIX_VEX_0F3A7F) },
9420 { PREFIX_TABLE(PREFIX_VEX_0F3ACE) },
9421 { PREFIX_TABLE(PREFIX_VEX_0F3ACF) },
9439 { PREFIX_TABLE (PREFIX_VEX_0F3ADF) },
9459 { PREFIX_TABLE (PREFIX_VEX_0F3AF0) },
9479 #define NEED_OPCODE_TABLE
9480 #include "i386-dis-evex.h"
9481 #undef NEED_OPCODE_TABLE
9482 static const struct dis386 vex_len_table[][2] = {
9483 /* VEX_LEN_0F10_P_1 */
9485 { VEX_W_TABLE (VEX_W_0F10_P_1) },
9486 { VEX_W_TABLE (VEX_W_0F10_P_1) },
9489 /* VEX_LEN_0F10_P_3 */
9491 { VEX_W_TABLE (VEX_W_0F10_P_3) },
9492 { VEX_W_TABLE (VEX_W_0F10_P_3) },
9495 /* VEX_LEN_0F11_P_1 */
9497 { VEX_W_TABLE (VEX_W_0F11_P_1) },
9498 { VEX_W_TABLE (VEX_W_0F11_P_1) },
9501 /* VEX_LEN_0F11_P_3 */
9503 { VEX_W_TABLE (VEX_W_0F11_P_3) },
9504 { VEX_W_TABLE (VEX_W_0F11_P_3) },
9507 /* VEX_LEN_0F12_P_0_M_0 */
9509 { VEX_W_TABLE (VEX_W_0F12_P_0_M_0) },
9512 /* VEX_LEN_0F12_P_0_M_1 */
9514 { VEX_W_TABLE (VEX_W_0F12_P_0_M_1) },
9517 /* VEX_LEN_0F12_P_2 */
9519 { VEX_W_TABLE (VEX_W_0F12_P_2) },
9522 /* VEX_LEN_0F13_M_0 */
9524 { VEX_W_TABLE (VEX_W_0F13_M_0) },
9527 /* VEX_LEN_0F16_P_0_M_0 */
9529 { VEX_W_TABLE (VEX_W_0F16_P_0_M_0) },
9532 /* VEX_LEN_0F16_P_0_M_1 */
9534 { VEX_W_TABLE (VEX_W_0F16_P_0_M_1) },
9537 /* VEX_LEN_0F16_P_2 */
9539 { VEX_W_TABLE (VEX_W_0F16_P_2) },
9542 /* VEX_LEN_0F17_M_0 */
9544 { VEX_W_TABLE (VEX_W_0F17_M_0) },
9547 /* VEX_LEN_0F2A_P_1 */
9549 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9550 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9553 /* VEX_LEN_0F2A_P_3 */
9555 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9556 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9559 /* VEX_LEN_0F2C_P_1 */
9561 { "vcvttss2si", { Gv, EXdScalar }, 0 },
9562 { "vcvttss2si", { Gv, EXdScalar }, 0 },
9565 /* VEX_LEN_0F2C_P_3 */
9567 { "vcvttsd2si", { Gv, EXqScalar }, 0 },
9568 { "vcvttsd2si", { Gv, EXqScalar }, 0 },
9571 /* VEX_LEN_0F2D_P_1 */
9573 { "vcvtss2si", { Gv, EXdScalar }, 0 },
9574 { "vcvtss2si", { Gv, EXdScalar }, 0 },
9577 /* VEX_LEN_0F2D_P_3 */
9579 { "vcvtsd2si", { Gv, EXqScalar }, 0 },
9580 { "vcvtsd2si", { Gv, EXqScalar }, 0 },
9583 /* VEX_LEN_0F2E_P_0 */
9585 { VEX_W_TABLE (VEX_W_0F2E_P_0) },
9586 { VEX_W_TABLE (VEX_W_0F2E_P_0) },
9589 /* VEX_LEN_0F2E_P_2 */
9591 { VEX_W_TABLE (VEX_W_0F2E_P_2) },
9592 { VEX_W_TABLE (VEX_W_0F2E_P_2) },
9595 /* VEX_LEN_0F2F_P_0 */
9597 { VEX_W_TABLE (VEX_W_0F2F_P_0) },
9598 { VEX_W_TABLE (VEX_W_0F2F_P_0) },
9601 /* VEX_LEN_0F2F_P_2 */
9603 { VEX_W_TABLE (VEX_W_0F2F_P_2) },
9604 { VEX_W_TABLE (VEX_W_0F2F_P_2) },
9607 /* VEX_LEN_0F41_P_0 */
9610 { VEX_W_TABLE (VEX_W_0F41_P_0_LEN_1) },
9612 /* VEX_LEN_0F41_P_2 */
9615 { VEX_W_TABLE (VEX_W_0F41_P_2_LEN_1) },
9617 /* VEX_LEN_0F42_P_0 */
9620 { VEX_W_TABLE (VEX_W_0F42_P_0_LEN_1) },
9622 /* VEX_LEN_0F42_P_2 */
9625 { VEX_W_TABLE (VEX_W_0F42_P_2_LEN_1) },
9627 /* VEX_LEN_0F44_P_0 */
9629 { VEX_W_TABLE (VEX_W_0F44_P_0_LEN_0) },
9631 /* VEX_LEN_0F44_P_2 */
9633 { VEX_W_TABLE (VEX_W_0F44_P_2_LEN_0) },
9635 /* VEX_LEN_0F45_P_0 */
9638 { VEX_W_TABLE (VEX_W_0F45_P_0_LEN_1) },
9640 /* VEX_LEN_0F45_P_2 */
9643 { VEX_W_TABLE (VEX_W_0F45_P_2_LEN_1) },
9645 /* VEX_LEN_0F46_P_0 */
9648 { VEX_W_TABLE (VEX_W_0F46_P_0_LEN_1) },
9650 /* VEX_LEN_0F46_P_2 */
9653 { VEX_W_TABLE (VEX_W_0F46_P_2_LEN_1) },
9655 /* VEX_LEN_0F47_P_0 */
9658 { VEX_W_TABLE (VEX_W_0F47_P_0_LEN_1) },
9660 /* VEX_LEN_0F47_P_2 */
9663 { VEX_W_TABLE (VEX_W_0F47_P_2_LEN_1) },
9665 /* VEX_LEN_0F4A_P_0 */
9668 { VEX_W_TABLE (VEX_W_0F4A_P_0_LEN_1) },
9670 /* VEX_LEN_0F4A_P_2 */
9673 { VEX_W_TABLE (VEX_W_0F4A_P_2_LEN_1) },
9675 /* VEX_LEN_0F4B_P_0 */
9678 { VEX_W_TABLE (VEX_W_0F4B_P_0_LEN_1) },
9680 /* VEX_LEN_0F4B_P_2 */
9683 { VEX_W_TABLE (VEX_W_0F4B_P_2_LEN_1) },
9686 /* VEX_LEN_0F51_P_1 */
9688 { VEX_W_TABLE (VEX_W_0F51_P_1) },
9689 { VEX_W_TABLE (VEX_W_0F51_P_1) },
9692 /* VEX_LEN_0F51_P_3 */
9694 { VEX_W_TABLE (VEX_W_0F51_P_3) },
9695 { VEX_W_TABLE (VEX_W_0F51_P_3) },
9698 /* VEX_LEN_0F52_P_1 */
9700 { VEX_W_TABLE (VEX_W_0F52_P_1) },
9701 { VEX_W_TABLE (VEX_W_0F52_P_1) },
9704 /* VEX_LEN_0F53_P_1 */
9706 { VEX_W_TABLE (VEX_W_0F53_P_1) },
9707 { VEX_W_TABLE (VEX_W_0F53_P_1) },
9710 /* VEX_LEN_0F58_P_1 */
9712 { VEX_W_TABLE (VEX_W_0F58_P_1) },
9713 { VEX_W_TABLE (VEX_W_0F58_P_1) },
9716 /* VEX_LEN_0F58_P_3 */
9718 { VEX_W_TABLE (VEX_W_0F58_P_3) },
9719 { VEX_W_TABLE (VEX_W_0F58_P_3) },
9722 /* VEX_LEN_0F59_P_1 */
9724 { VEX_W_TABLE (VEX_W_0F59_P_1) },
9725 { VEX_W_TABLE (VEX_W_0F59_P_1) },
9728 /* VEX_LEN_0F59_P_3 */
9730 { VEX_W_TABLE (VEX_W_0F59_P_3) },
9731 { VEX_W_TABLE (VEX_W_0F59_P_3) },
9734 /* VEX_LEN_0F5A_P_1 */
9736 { VEX_W_TABLE (VEX_W_0F5A_P_1) },
9737 { VEX_W_TABLE (VEX_W_0F5A_P_1) },
9740 /* VEX_LEN_0F5A_P_3 */
9742 { VEX_W_TABLE (VEX_W_0F5A_P_3) },
9743 { VEX_W_TABLE (VEX_W_0F5A_P_3) },
9746 /* VEX_LEN_0F5C_P_1 */
9748 { VEX_W_TABLE (VEX_W_0F5C_P_1) },
9749 { VEX_W_TABLE (VEX_W_0F5C_P_1) },
9752 /* VEX_LEN_0F5C_P_3 */
9754 { VEX_W_TABLE (VEX_W_0F5C_P_3) },
9755 { VEX_W_TABLE (VEX_W_0F5C_P_3) },
9758 /* VEX_LEN_0F5D_P_1 */
9760 { VEX_W_TABLE (VEX_W_0F5D_P_1) },
9761 { VEX_W_TABLE (VEX_W_0F5D_P_1) },
9764 /* VEX_LEN_0F5D_P_3 */
9766 { VEX_W_TABLE (VEX_W_0F5D_P_3) },
9767 { VEX_W_TABLE (VEX_W_0F5D_P_3) },
9770 /* VEX_LEN_0F5E_P_1 */
9772 { VEX_W_TABLE (VEX_W_0F5E_P_1) },
9773 { VEX_W_TABLE (VEX_W_0F5E_P_1) },
9776 /* VEX_LEN_0F5E_P_3 */
9778 { VEX_W_TABLE (VEX_W_0F5E_P_3) },
9779 { VEX_W_TABLE (VEX_W_0F5E_P_3) },
9782 /* VEX_LEN_0F5F_P_1 */
9784 { VEX_W_TABLE (VEX_W_0F5F_P_1) },
9785 { VEX_W_TABLE (VEX_W_0F5F_P_1) },
9788 /* VEX_LEN_0F5F_P_3 */
9790 { VEX_W_TABLE (VEX_W_0F5F_P_3) },
9791 { VEX_W_TABLE (VEX_W_0F5F_P_3) },
9794 /* VEX_LEN_0F6E_P_2 */
9796 { "vmovK", { XMScalar, Edq }, 0 },
9797 { "vmovK", { XMScalar, Edq }, 0 },
9800 /* VEX_LEN_0F7E_P_1 */
9802 { VEX_W_TABLE (VEX_W_0F7E_P_1) },
9803 { VEX_W_TABLE (VEX_W_0F7E_P_1) },
9806 /* VEX_LEN_0F7E_P_2 */
9808 { "vmovK", { Edq, XMScalar }, 0 },
9809 { "vmovK", { Edq, XMScalar }, 0 },
9812 /* VEX_LEN_0F90_P_0 */
9814 { VEX_W_TABLE (VEX_W_0F90_P_0_LEN_0) },
9817 /* VEX_LEN_0F90_P_2 */
9819 { VEX_W_TABLE (VEX_W_0F90_P_2_LEN_0) },
9822 /* VEX_LEN_0F91_P_0 */
9824 { VEX_W_TABLE (VEX_W_0F91_P_0_LEN_0) },
9827 /* VEX_LEN_0F91_P_2 */
9829 { VEX_W_TABLE (VEX_W_0F91_P_2_LEN_0) },
9832 /* VEX_LEN_0F92_P_0 */
9834 { VEX_W_TABLE (VEX_W_0F92_P_0_LEN_0) },
9837 /* VEX_LEN_0F92_P_2 */
9839 { VEX_W_TABLE (VEX_W_0F92_P_2_LEN_0) },
9842 /* VEX_LEN_0F92_P_3 */
9844 { VEX_W_TABLE (VEX_W_0F92_P_3_LEN_0) },
9847 /* VEX_LEN_0F93_P_0 */
9849 { VEX_W_TABLE (VEX_W_0F93_P_0_LEN_0) },
9852 /* VEX_LEN_0F93_P_2 */
9854 { VEX_W_TABLE (VEX_W_0F93_P_2_LEN_0) },
9857 /* VEX_LEN_0F93_P_3 */
9859 { VEX_W_TABLE (VEX_W_0F93_P_3_LEN_0) },
9862 /* VEX_LEN_0F98_P_0 */
9864 { VEX_W_TABLE (VEX_W_0F98_P_0_LEN_0) },
9867 /* VEX_LEN_0F98_P_2 */
9869 { VEX_W_TABLE (VEX_W_0F98_P_2_LEN_0) },
9872 /* VEX_LEN_0F99_P_0 */
9874 { VEX_W_TABLE (VEX_W_0F99_P_0_LEN_0) },
9877 /* VEX_LEN_0F99_P_2 */
9879 { VEX_W_TABLE (VEX_W_0F99_P_2_LEN_0) },
9882 /* VEX_LEN_0FAE_R_2_M_0 */
9884 { VEX_W_TABLE (VEX_W_0FAE_R_2_M_0) },
9887 /* VEX_LEN_0FAE_R_3_M_0 */
9889 { VEX_W_TABLE (VEX_W_0FAE_R_3_M_0) },
9892 /* VEX_LEN_0FC2_P_1 */
9894 { VEX_W_TABLE (VEX_W_0FC2_P_1) },
9895 { VEX_W_TABLE (VEX_W_0FC2_P_1) },
9898 /* VEX_LEN_0FC2_P_3 */
9900 { VEX_W_TABLE (VEX_W_0FC2_P_3) },
9901 { VEX_W_TABLE (VEX_W_0FC2_P_3) },
9904 /* VEX_LEN_0FC4_P_2 */
9906 { VEX_W_TABLE (VEX_W_0FC4_P_2) },
9909 /* VEX_LEN_0FC5_P_2 */
9911 { VEX_W_TABLE (VEX_W_0FC5_P_2) },
9914 /* VEX_LEN_0FD6_P_2 */
9916 { VEX_W_TABLE (VEX_W_0FD6_P_2) },
9917 { VEX_W_TABLE (VEX_W_0FD6_P_2) },
9920 /* VEX_LEN_0FF7_P_2 */
9922 { VEX_W_TABLE (VEX_W_0FF7_P_2) },
9925 /* VEX_LEN_0F3816_P_2 */
9928 { VEX_W_TABLE (VEX_W_0F3816_P_2) },
9931 /* VEX_LEN_0F3819_P_2 */
9934 { VEX_W_TABLE (VEX_W_0F3819_P_2) },
9937 /* VEX_LEN_0F381A_P_2_M_0 */
9940 { VEX_W_TABLE (VEX_W_0F381A_P_2_M_0) },
9943 /* VEX_LEN_0F3836_P_2 */
9946 { VEX_W_TABLE (VEX_W_0F3836_P_2) },
9949 /* VEX_LEN_0F3841_P_2 */
9951 { VEX_W_TABLE (VEX_W_0F3841_P_2) },
9954 /* VEX_LEN_0F385A_P_2_M_0 */
9957 { VEX_W_TABLE (VEX_W_0F385A_P_2_M_0) },
9960 /* VEX_LEN_0F38DB_P_2 */
9962 { VEX_W_TABLE (VEX_W_0F38DB_P_2) },
9965 /* VEX_LEN_0F38F2_P_0 */
9967 { "andnS", { Gdq, VexGdq, Edq }, 0 },
9970 /* VEX_LEN_0F38F3_R_1_P_0 */
9972 { "blsrS", { VexGdq, Edq }, 0 },
9975 /* VEX_LEN_0F38F3_R_2_P_0 */
9977 { "blsmskS", { VexGdq, Edq }, 0 },
9980 /* VEX_LEN_0F38F3_R_3_P_0 */
9982 { "blsiS", { VexGdq, Edq }, 0 },
9985 /* VEX_LEN_0F38F5_P_0 */
9987 { "bzhiS", { Gdq, Edq, VexGdq }, 0 },
9990 /* VEX_LEN_0F38F5_P_1 */
9992 { "pextS", { Gdq, VexGdq, Edq }, 0 },
9995 /* VEX_LEN_0F38F5_P_3 */
9997 { "pdepS", { Gdq, VexGdq, Edq }, 0 },
10000 /* VEX_LEN_0F38F6_P_3 */
10002 { "mulxS", { Gdq, VexGdq, Edq }, 0 },
10005 /* VEX_LEN_0F38F7_P_0 */
10007 { "bextrS", { Gdq, Edq, VexGdq }, 0 },
10010 /* VEX_LEN_0F38F7_P_1 */
10012 { "sarxS", { Gdq, Edq, VexGdq }, 0 },
10015 /* VEX_LEN_0F38F7_P_2 */
10017 { "shlxS", { Gdq, Edq, VexGdq }, 0 },
10020 /* VEX_LEN_0F38F7_P_3 */
10022 { "shrxS", { Gdq, Edq, VexGdq }, 0 },
10025 /* VEX_LEN_0F3A00_P_2 */
10028 { VEX_W_TABLE (VEX_W_0F3A00_P_2) },
10031 /* VEX_LEN_0F3A01_P_2 */
10034 { VEX_W_TABLE (VEX_W_0F3A01_P_2) },
10037 /* VEX_LEN_0F3A06_P_2 */
10040 { VEX_W_TABLE (VEX_W_0F3A06_P_2) },
10043 /* VEX_LEN_0F3A0A_P_2 */
10045 { VEX_W_TABLE (VEX_W_0F3A0A_P_2) },
10046 { VEX_W_TABLE (VEX_W_0F3A0A_P_2) },
10049 /* VEX_LEN_0F3A0B_P_2 */
10051 { VEX_W_TABLE (VEX_W_0F3A0B_P_2) },
10052 { VEX_W_TABLE (VEX_W_0F3A0B_P_2) },
10055 /* VEX_LEN_0F3A14_P_2 */
10057 { VEX_W_TABLE (VEX_W_0F3A14_P_2) },
10060 /* VEX_LEN_0F3A15_P_2 */
10062 { VEX_W_TABLE (VEX_W_0F3A15_P_2) },
10065 /* VEX_LEN_0F3A16_P_2 */
10067 { "vpextrK", { Edq, XM, Ib }, 0 },
10070 /* VEX_LEN_0F3A17_P_2 */
10072 { "vextractps", { Edqd, XM, Ib }, 0 },
10075 /* VEX_LEN_0F3A18_P_2 */
10078 { VEX_W_TABLE (VEX_W_0F3A18_P_2) },
10081 /* VEX_LEN_0F3A19_P_2 */
10084 { VEX_W_TABLE (VEX_W_0F3A19_P_2) },
10087 /* VEX_LEN_0F3A20_P_2 */
10089 { VEX_W_TABLE (VEX_W_0F3A20_P_2) },
10092 /* VEX_LEN_0F3A21_P_2 */
10094 { VEX_W_TABLE (VEX_W_0F3A21_P_2) },
10097 /* VEX_LEN_0F3A22_P_2 */
10099 { "vpinsrK", { XM, Vex128, Edq, Ib }, 0 },
10102 /* VEX_LEN_0F3A30_P_2 */
10104 { VEX_W_TABLE (VEX_W_0F3A30_P_2_LEN_0) },
10107 /* VEX_LEN_0F3A31_P_2 */
10109 { VEX_W_TABLE (VEX_W_0F3A31_P_2_LEN_0) },
10112 /* VEX_LEN_0F3A32_P_2 */
10114 { VEX_W_TABLE (VEX_W_0F3A32_P_2_LEN_0) },
10117 /* VEX_LEN_0F3A33_P_2 */
10119 { VEX_W_TABLE (VEX_W_0F3A33_P_2_LEN_0) },
10122 /* VEX_LEN_0F3A38_P_2 */
10125 { VEX_W_TABLE (VEX_W_0F3A38_P_2) },
10128 /* VEX_LEN_0F3A39_P_2 */
10131 { VEX_W_TABLE (VEX_W_0F3A39_P_2) },
10134 /* VEX_LEN_0F3A41_P_2 */
10136 { VEX_W_TABLE (VEX_W_0F3A41_P_2) },
10139 /* VEX_LEN_0F3A46_P_2 */
10142 { VEX_W_TABLE (VEX_W_0F3A46_P_2) },
10145 /* VEX_LEN_0F3A60_P_2 */
10147 { "vpcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
10150 /* VEX_LEN_0F3A61_P_2 */
10152 { "vpcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
10155 /* VEX_LEN_0F3A62_P_2 */
10157 { VEX_W_TABLE (VEX_W_0F3A62_P_2) },
10160 /* VEX_LEN_0F3A63_P_2 */
10162 { VEX_W_TABLE (VEX_W_0F3A63_P_2) },
10165 /* VEX_LEN_0F3A6A_P_2 */
10167 { "vfmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
10170 /* VEX_LEN_0F3A6B_P_2 */
10172 { "vfmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
10175 /* VEX_LEN_0F3A6E_P_2 */
10177 { "vfmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
10180 /* VEX_LEN_0F3A6F_P_2 */
10182 { "vfmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
10185 /* VEX_LEN_0F3A7A_P_2 */
10187 { "vfnmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
10190 /* VEX_LEN_0F3A7B_P_2 */
10192 { "vfnmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
10195 /* VEX_LEN_0F3A7E_P_2 */
10197 { "vfnmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
10200 /* VEX_LEN_0F3A7F_P_2 */
10202 { "vfnmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
10205 /* VEX_LEN_0F3ADF_P_2 */
10207 { VEX_W_TABLE (VEX_W_0F3ADF_P_2) },
10210 /* VEX_LEN_0F3AF0_P_3 */
10212 { "rorxS", { Gdq, Edq, Ib }, 0 },
10215 /* VEX_LEN_0FXOP_08_CC */
10217 { "vpcomb", { XM, Vex128, EXx, VPCOM }, 0 },
10220 /* VEX_LEN_0FXOP_08_CD */
10222 { "vpcomw", { XM, Vex128, EXx, VPCOM }, 0 },
10225 /* VEX_LEN_0FXOP_08_CE */
10227 { "vpcomd", { XM, Vex128, EXx, VPCOM }, 0 },
10230 /* VEX_LEN_0FXOP_08_CF */
10232 { "vpcomq", { XM, Vex128, EXx, VPCOM }, 0 },
10235 /* VEX_LEN_0FXOP_08_EC */
10237 { "vpcomub", { XM, Vex128, EXx, VPCOM }, 0 },
10240 /* VEX_LEN_0FXOP_08_ED */
10242 { "vpcomuw", { XM, Vex128, EXx, VPCOM }, 0 },
10245 /* VEX_LEN_0FXOP_08_EE */
10247 { "vpcomud", { XM, Vex128, EXx, VPCOM }, 0 },
10250 /* VEX_LEN_0FXOP_08_EF */
10252 { "vpcomuq", { XM, Vex128, EXx, VPCOM }, 0 },
10255 /* VEX_LEN_0FXOP_09_80 */
10257 { "vfrczps", { XM, EXxmm }, 0 },
10258 { "vfrczps", { XM, EXymmq }, 0 },
10261 /* VEX_LEN_0FXOP_09_81 */
10263 { "vfrczpd", { XM, EXxmm }, 0 },
10264 { "vfrczpd", { XM, EXymmq }, 0 },
10268 static const struct dis386 vex_w_table[][2] = {
10270 /* VEX_W_0F10_P_0 */
10271 { "vmovups", { XM, EXx }, 0 },
10274 /* VEX_W_0F10_P_1 */
10275 { "vmovss", { XMVexScalar, VexScalar, EXdScalar }, 0 },
10278 /* VEX_W_0F10_P_2 */
10279 { "vmovupd", { XM, EXx }, 0 },
10282 /* VEX_W_0F10_P_3 */
10283 { "vmovsd", { XMVexScalar, VexScalar, EXqScalar }, 0 },
10286 /* VEX_W_0F11_P_0 */
10287 { "vmovups", { EXxS, XM }, 0 },
10290 /* VEX_W_0F11_P_1 */
10291 { "vmovss", { EXdVexScalarS, VexScalar, XMScalar }, 0 },
10294 /* VEX_W_0F11_P_2 */
10295 { "vmovupd", { EXxS, XM }, 0 },
10298 /* VEX_W_0F11_P_3 */
10299 { "vmovsd", { EXqVexScalarS, VexScalar, XMScalar }, 0 },
10302 /* VEX_W_0F12_P_0_M_0 */
10303 { "vmovlps", { XM, Vex128, EXq }, 0 },
10306 /* VEX_W_0F12_P_0_M_1 */
10307 { "vmovhlps", { XM, Vex128, EXq }, 0 },
10310 /* VEX_W_0F12_P_1 */
10311 { "vmovsldup", { XM, EXx }, 0 },
10314 /* VEX_W_0F12_P_2 */
10315 { "vmovlpd", { XM, Vex128, EXq }, 0 },
10318 /* VEX_W_0F12_P_3 */
10319 { "vmovddup", { XM, EXymmq }, 0 },
10322 /* VEX_W_0F13_M_0 */
10323 { "vmovlpX", { EXq, XM }, 0 },
10327 { "vunpcklpX", { XM, Vex, EXx }, 0 },
10331 { "vunpckhpX", { XM, Vex, EXx }, 0 },
10334 /* VEX_W_0F16_P_0_M_0 */
10335 { "vmovhps", { XM, Vex128, EXq }, 0 },
10338 /* VEX_W_0F16_P_0_M_1 */
10339 { "vmovlhps", { XM, Vex128, EXq }, 0 },
10342 /* VEX_W_0F16_P_1 */
10343 { "vmovshdup", { XM, EXx }, 0 },
10346 /* VEX_W_0F16_P_2 */
10347 { "vmovhpd", { XM, Vex128, EXq }, 0 },
10350 /* VEX_W_0F17_M_0 */
10351 { "vmovhpX", { EXq, XM }, 0 },
10355 { "vmovapX", { XM, EXx }, 0 },
10359 { "vmovapX", { EXxS, XM }, 0 },
10362 /* VEX_W_0F2B_M_0 */
10363 { "vmovntpX", { Mx, XM }, 0 },
10366 /* VEX_W_0F2E_P_0 */
10367 { "vucomiss", { XMScalar, EXdScalar }, 0 },
10370 /* VEX_W_0F2E_P_2 */
10371 { "vucomisd", { XMScalar, EXqScalar }, 0 },
10374 /* VEX_W_0F2F_P_0 */
10375 { "vcomiss", { XMScalar, EXdScalar }, 0 },
10378 /* VEX_W_0F2F_P_2 */
10379 { "vcomisd", { XMScalar, EXqScalar }, 0 },
10382 /* VEX_W_0F41_P_0_LEN_1 */
10383 { MOD_TABLE (MOD_VEX_W_0_0F41_P_0_LEN_1) },
10384 { MOD_TABLE (MOD_VEX_W_1_0F41_P_0_LEN_1) },
10387 /* VEX_W_0F41_P_2_LEN_1 */
10388 { MOD_TABLE (MOD_VEX_W_0_0F41_P_2_LEN_1) },
10389 { MOD_TABLE (MOD_VEX_W_1_0F41_P_2_LEN_1) }
10392 /* VEX_W_0F42_P_0_LEN_1 */
10393 { MOD_TABLE (MOD_VEX_W_0_0F42_P_0_LEN_1) },
10394 { MOD_TABLE (MOD_VEX_W_1_0F42_P_0_LEN_1) },
10397 /* VEX_W_0F42_P_2_LEN_1 */
10398 { MOD_TABLE (MOD_VEX_W_0_0F42_P_2_LEN_1) },
10399 { MOD_TABLE (MOD_VEX_W_1_0F42_P_2_LEN_1) },
10402 /* VEX_W_0F44_P_0_LEN_0 */
10403 { MOD_TABLE (MOD_VEX_W_0_0F44_P_0_LEN_1) },
10404 { MOD_TABLE (MOD_VEX_W_1_0F44_P_0_LEN_1) },
10407 /* VEX_W_0F44_P_2_LEN_0 */
10408 { MOD_TABLE (MOD_VEX_W_0_0F44_P_2_LEN_1) },
10409 { MOD_TABLE (MOD_VEX_W_1_0F44_P_2_LEN_1) },
10412 /* VEX_W_0F45_P_0_LEN_1 */
10413 { MOD_TABLE (MOD_VEX_W_0_0F45_P_0_LEN_1) },
10414 { MOD_TABLE (MOD_VEX_W_1_0F45_P_0_LEN_1) },
10417 /* VEX_W_0F45_P_2_LEN_1 */
10418 { MOD_TABLE (MOD_VEX_W_0_0F45_P_2_LEN_1) },
10419 { MOD_TABLE (MOD_VEX_W_1_0F45_P_2_LEN_1) },
10422 /* VEX_W_0F46_P_0_LEN_1 */
10423 { MOD_TABLE (MOD_VEX_W_0_0F46_P_0_LEN_1) },
10424 { MOD_TABLE (MOD_VEX_W_1_0F46_P_0_LEN_1) },
10427 /* VEX_W_0F46_P_2_LEN_1 */
10428 { MOD_TABLE (MOD_VEX_W_0_0F46_P_2_LEN_1) },
10429 { MOD_TABLE (MOD_VEX_W_1_0F46_P_2_LEN_1) },
10432 /* VEX_W_0F47_P_0_LEN_1 */
10433 { MOD_TABLE (MOD_VEX_W_0_0F47_P_0_LEN_1) },
10434 { MOD_TABLE (MOD_VEX_W_1_0F47_P_0_LEN_1) },
10437 /* VEX_W_0F47_P_2_LEN_1 */
10438 { MOD_TABLE (MOD_VEX_W_0_0F47_P_2_LEN_1) },
10439 { MOD_TABLE (MOD_VEX_W_1_0F47_P_2_LEN_1) },
10442 /* VEX_W_0F4A_P_0_LEN_1 */
10443 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_0_LEN_1) },
10444 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_0_LEN_1) },
10447 /* VEX_W_0F4A_P_2_LEN_1 */
10448 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_2_LEN_1) },
10449 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_2_LEN_1) },
10452 /* VEX_W_0F4B_P_0_LEN_1 */
10453 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_0_LEN_1) },
10454 { MOD_TABLE (MOD_VEX_W_1_0F4B_P_0_LEN_1) },
10457 /* VEX_W_0F4B_P_2_LEN_1 */
10458 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_2_LEN_1) },
10461 /* VEX_W_0F50_M_0 */
10462 { "vmovmskpX", { Gdq, XS }, 0 },
10465 /* VEX_W_0F51_P_0 */
10466 { "vsqrtps", { XM, EXx }, 0 },
10469 /* VEX_W_0F51_P_1 */
10470 { "vsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
10473 /* VEX_W_0F51_P_2 */
10474 { "vsqrtpd", { XM, EXx }, 0 },
10477 /* VEX_W_0F51_P_3 */
10478 { "vsqrtsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10481 /* VEX_W_0F52_P_0 */
10482 { "vrsqrtps", { XM, EXx }, 0 },
10485 /* VEX_W_0F52_P_1 */
10486 { "vrsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
10489 /* VEX_W_0F53_P_0 */
10490 { "vrcpps", { XM, EXx }, 0 },
10493 /* VEX_W_0F53_P_1 */
10494 { "vrcpss", { XMScalar, VexScalar, EXdScalar }, 0 },
10497 /* VEX_W_0F58_P_0 */
10498 { "vaddps", { XM, Vex, EXx }, 0 },
10501 /* VEX_W_0F58_P_1 */
10502 { "vaddss", { XMScalar, VexScalar, EXdScalar }, 0 },
10505 /* VEX_W_0F58_P_2 */
10506 { "vaddpd", { XM, Vex, EXx }, 0 },
10509 /* VEX_W_0F58_P_3 */
10510 { "vaddsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10513 /* VEX_W_0F59_P_0 */
10514 { "vmulps", { XM, Vex, EXx }, 0 },
10517 /* VEX_W_0F59_P_1 */
10518 { "vmulss", { XMScalar, VexScalar, EXdScalar }, 0 },
10521 /* VEX_W_0F59_P_2 */
10522 { "vmulpd", { XM, Vex, EXx }, 0 },
10525 /* VEX_W_0F59_P_3 */
10526 { "vmulsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10529 /* VEX_W_0F5A_P_0 */
10530 { "vcvtps2pd", { XM, EXxmmq }, 0 },
10533 /* VEX_W_0F5A_P_1 */
10534 { "vcvtss2sd", { XMScalar, VexScalar, EXdScalar }, 0 },
10537 /* VEX_W_0F5A_P_3 */
10538 { "vcvtsd2ss", { XMScalar, VexScalar, EXqScalar }, 0 },
10541 /* VEX_W_0F5B_P_0 */
10542 { "vcvtdq2ps", { XM, EXx }, 0 },
10545 /* VEX_W_0F5B_P_1 */
10546 { "vcvttps2dq", { XM, EXx }, 0 },
10549 /* VEX_W_0F5B_P_2 */
10550 { "vcvtps2dq", { XM, EXx }, 0 },
10553 /* VEX_W_0F5C_P_0 */
10554 { "vsubps", { XM, Vex, EXx }, 0 },
10557 /* VEX_W_0F5C_P_1 */
10558 { "vsubss", { XMScalar, VexScalar, EXdScalar }, 0 },
10561 /* VEX_W_0F5C_P_2 */
10562 { "vsubpd", { XM, Vex, EXx }, 0 },
10565 /* VEX_W_0F5C_P_3 */
10566 { "vsubsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10569 /* VEX_W_0F5D_P_0 */
10570 { "vminps", { XM, Vex, EXx }, 0 },
10573 /* VEX_W_0F5D_P_1 */
10574 { "vminss", { XMScalar, VexScalar, EXdScalar }, 0 },
10577 /* VEX_W_0F5D_P_2 */
10578 { "vminpd", { XM, Vex, EXx }, 0 },
10581 /* VEX_W_0F5D_P_3 */
10582 { "vminsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10585 /* VEX_W_0F5E_P_0 */
10586 { "vdivps", { XM, Vex, EXx }, 0 },
10589 /* VEX_W_0F5E_P_1 */
10590 { "vdivss", { XMScalar, VexScalar, EXdScalar }, 0 },
10593 /* VEX_W_0F5E_P_2 */
10594 { "vdivpd", { XM, Vex, EXx }, 0 },
10597 /* VEX_W_0F5E_P_3 */
10598 { "vdivsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10601 /* VEX_W_0F5F_P_0 */
10602 { "vmaxps", { XM, Vex, EXx }, 0 },
10605 /* VEX_W_0F5F_P_1 */
10606 { "vmaxss", { XMScalar, VexScalar, EXdScalar }, 0 },
10609 /* VEX_W_0F5F_P_2 */
10610 { "vmaxpd", { XM, Vex, EXx }, 0 },
10613 /* VEX_W_0F5F_P_3 */
10614 { "vmaxsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10617 /* VEX_W_0F60_P_2 */
10618 { "vpunpcklbw", { XM, Vex, EXx }, 0 },
10621 /* VEX_W_0F61_P_2 */
10622 { "vpunpcklwd", { XM, Vex, EXx }, 0 },
10625 /* VEX_W_0F62_P_2 */
10626 { "vpunpckldq", { XM, Vex, EXx }, 0 },
10629 /* VEX_W_0F63_P_2 */
10630 { "vpacksswb", { XM, Vex, EXx }, 0 },
10633 /* VEX_W_0F64_P_2 */
10634 { "vpcmpgtb", { XM, Vex, EXx }, 0 },
10637 /* VEX_W_0F65_P_2 */
10638 { "vpcmpgtw", { XM, Vex, EXx }, 0 },
10641 /* VEX_W_0F66_P_2 */
10642 { "vpcmpgtd", { XM, Vex, EXx }, 0 },
10645 /* VEX_W_0F67_P_2 */
10646 { "vpackuswb", { XM, Vex, EXx }, 0 },
10649 /* VEX_W_0F68_P_2 */
10650 { "vpunpckhbw", { XM, Vex, EXx }, 0 },
10653 /* VEX_W_0F69_P_2 */
10654 { "vpunpckhwd", { XM, Vex, EXx }, 0 },
10657 /* VEX_W_0F6A_P_2 */
10658 { "vpunpckhdq", { XM, Vex, EXx }, 0 },
10661 /* VEX_W_0F6B_P_2 */
10662 { "vpackssdw", { XM, Vex, EXx }, 0 },
10665 /* VEX_W_0F6C_P_2 */
10666 { "vpunpcklqdq", { XM, Vex, EXx }, 0 },
10669 /* VEX_W_0F6D_P_2 */
10670 { "vpunpckhqdq", { XM, Vex, EXx }, 0 },
10673 /* VEX_W_0F6F_P_1 */
10674 { "vmovdqu", { XM, EXx }, 0 },
10677 /* VEX_W_0F6F_P_2 */
10678 { "vmovdqa", { XM, EXx }, 0 },
10681 /* VEX_W_0F70_P_1 */
10682 { "vpshufhw", { XM, EXx, Ib }, 0 },
10685 /* VEX_W_0F70_P_2 */
10686 { "vpshufd", { XM, EXx, Ib }, 0 },
10689 /* VEX_W_0F70_P_3 */
10690 { "vpshuflw", { XM, EXx, Ib }, 0 },
10693 /* VEX_W_0F71_R_2_P_2 */
10694 { "vpsrlw", { Vex, XS, Ib }, 0 },
10697 /* VEX_W_0F71_R_4_P_2 */
10698 { "vpsraw", { Vex, XS, Ib }, 0 },
10701 /* VEX_W_0F71_R_6_P_2 */
10702 { "vpsllw", { Vex, XS, Ib }, 0 },
10705 /* VEX_W_0F72_R_2_P_2 */
10706 { "vpsrld", { Vex, XS, Ib }, 0 },
10709 /* VEX_W_0F72_R_4_P_2 */
10710 { "vpsrad", { Vex, XS, Ib }, 0 },
10713 /* VEX_W_0F72_R_6_P_2 */
10714 { "vpslld", { Vex, XS, Ib }, 0 },
10717 /* VEX_W_0F73_R_2_P_2 */
10718 { "vpsrlq", { Vex, XS, Ib }, 0 },
10721 /* VEX_W_0F73_R_3_P_2 */
10722 { "vpsrldq", { Vex, XS, Ib }, 0 },
10725 /* VEX_W_0F73_R_6_P_2 */
10726 { "vpsllq", { Vex, XS, Ib }, 0 },
10729 /* VEX_W_0F73_R_7_P_2 */
10730 { "vpslldq", { Vex, XS, Ib }, 0 },
10733 /* VEX_W_0F74_P_2 */
10734 { "vpcmpeqb", { XM, Vex, EXx }, 0 },
10737 /* VEX_W_0F75_P_2 */
10738 { "vpcmpeqw", { XM, Vex, EXx }, 0 },
10741 /* VEX_W_0F76_P_2 */
10742 { "vpcmpeqd", { XM, Vex, EXx }, 0 },
10745 /* VEX_W_0F77_P_0 */
10746 { "", { VZERO }, 0 },
10749 /* VEX_W_0F7C_P_2 */
10750 { "vhaddpd", { XM, Vex, EXx }, 0 },
10753 /* VEX_W_0F7C_P_3 */
10754 { "vhaddps", { XM, Vex, EXx }, 0 },
10757 /* VEX_W_0F7D_P_2 */
10758 { "vhsubpd", { XM, Vex, EXx }, 0 },
10761 /* VEX_W_0F7D_P_3 */
10762 { "vhsubps", { XM, Vex, EXx }, 0 },
10765 /* VEX_W_0F7E_P_1 */
10766 { "vmovq", { XMScalar, EXqScalar }, 0 },
10769 /* VEX_W_0F7F_P_1 */
10770 { "vmovdqu", { EXxS, XM }, 0 },
10773 /* VEX_W_0F7F_P_2 */
10774 { "vmovdqa", { EXxS, XM }, 0 },
10777 /* VEX_W_0F90_P_0_LEN_0 */
10778 { "kmovw", { MaskG, MaskE }, 0 },
10779 { "kmovq", { MaskG, MaskE }, 0 },
10782 /* VEX_W_0F90_P_2_LEN_0 */
10783 { "kmovb", { MaskG, MaskBDE }, 0 },
10784 { "kmovd", { MaskG, MaskBDE }, 0 },
10787 /* VEX_W_0F91_P_0_LEN_0 */
10788 { MOD_TABLE (MOD_VEX_W_0_0F91_P_0_LEN_0) },
10789 { MOD_TABLE (MOD_VEX_W_1_0F91_P_0_LEN_0) },
10792 /* VEX_W_0F91_P_2_LEN_0 */
10793 { MOD_TABLE (MOD_VEX_W_0_0F91_P_2_LEN_0) },
10794 { MOD_TABLE (MOD_VEX_W_1_0F91_P_2_LEN_0) },
10797 /* VEX_W_0F92_P_0_LEN_0 */
10798 { MOD_TABLE (MOD_VEX_W_0_0F92_P_0_LEN_0) },
10801 /* VEX_W_0F92_P_2_LEN_0 */
10802 { MOD_TABLE (MOD_VEX_W_0_0F92_P_2_LEN_0) },
10805 /* VEX_W_0F92_P_3_LEN_0 */
10806 { MOD_TABLE (MOD_VEX_W_0_0F92_P_3_LEN_0) },
10807 { MOD_TABLE (MOD_VEX_W_1_0F92_P_3_LEN_0) },
10810 /* VEX_W_0F93_P_0_LEN_0 */
10811 { MOD_TABLE (MOD_VEX_W_0_0F93_P_0_LEN_0) },
10814 /* VEX_W_0F93_P_2_LEN_0 */
10815 { MOD_TABLE (MOD_VEX_W_0_0F93_P_2_LEN_0) },
10818 /* VEX_W_0F93_P_3_LEN_0 */
10819 { MOD_TABLE (MOD_VEX_W_0_0F93_P_3_LEN_0) },
10820 { MOD_TABLE (MOD_VEX_W_1_0F93_P_3_LEN_0) },
10823 /* VEX_W_0F98_P_0_LEN_0 */
10824 { MOD_TABLE (MOD_VEX_W_0_0F98_P_0_LEN_0) },
10825 { MOD_TABLE (MOD_VEX_W_1_0F98_P_0_LEN_0) },
10828 /* VEX_W_0F98_P_2_LEN_0 */
10829 { MOD_TABLE (MOD_VEX_W_0_0F98_P_2_LEN_0) },
10830 { MOD_TABLE (MOD_VEX_W_1_0F98_P_2_LEN_0) },
10833 /* VEX_W_0F99_P_0_LEN_0 */
10834 { MOD_TABLE (MOD_VEX_W_0_0F99_P_0_LEN_0) },
10835 { MOD_TABLE (MOD_VEX_W_1_0F99_P_0_LEN_0) },
10838 /* VEX_W_0F99_P_2_LEN_0 */
10839 { MOD_TABLE (MOD_VEX_W_0_0F99_P_2_LEN_0) },
10840 { MOD_TABLE (MOD_VEX_W_1_0F99_P_2_LEN_0) },
10843 /* VEX_W_0FAE_R_2_M_0 */
10844 { "vldmxcsr", { Md }, 0 },
10847 /* VEX_W_0FAE_R_3_M_0 */
10848 { "vstmxcsr", { Md }, 0 },
10851 /* VEX_W_0FC2_P_0 */
10852 { "vcmpps", { XM, Vex, EXx, VCMP }, 0 },
10855 /* VEX_W_0FC2_P_1 */
10856 { "vcmpss", { XMScalar, VexScalar, EXdScalar, VCMP }, 0 },
10859 /* VEX_W_0FC2_P_2 */
10860 { "vcmppd", { XM, Vex, EXx, VCMP }, 0 },
10863 /* VEX_W_0FC2_P_3 */
10864 { "vcmpsd", { XMScalar, VexScalar, EXqScalar, VCMP }, 0 },
10867 /* VEX_W_0FC4_P_2 */
10868 { "vpinsrw", { XM, Vex128, Edqw, Ib }, 0 },
10871 /* VEX_W_0FC5_P_2 */
10872 { "vpextrw", { Gdq, XS, Ib }, 0 },
10875 /* VEX_W_0FD0_P_2 */
10876 { "vaddsubpd", { XM, Vex, EXx }, 0 },
10879 /* VEX_W_0FD0_P_3 */
10880 { "vaddsubps", { XM, Vex, EXx }, 0 },
10883 /* VEX_W_0FD1_P_2 */
10884 { "vpsrlw", { XM, Vex, EXxmm }, 0 },
10887 /* VEX_W_0FD2_P_2 */
10888 { "vpsrld", { XM, Vex, EXxmm }, 0 },
10891 /* VEX_W_0FD3_P_2 */
10892 { "vpsrlq", { XM, Vex, EXxmm }, 0 },
10895 /* VEX_W_0FD4_P_2 */
10896 { "vpaddq", { XM, Vex, EXx }, 0 },
10899 /* VEX_W_0FD5_P_2 */
10900 { "vpmullw", { XM, Vex, EXx }, 0 },
10903 /* VEX_W_0FD6_P_2 */
10904 { "vmovq", { EXqScalarS, XMScalar }, 0 },
10907 /* VEX_W_0FD7_P_2_M_1 */
10908 { "vpmovmskb", { Gdq, XS }, 0 },
10911 /* VEX_W_0FD8_P_2 */
10912 { "vpsubusb", { XM, Vex, EXx }, 0 },
10915 /* VEX_W_0FD9_P_2 */
10916 { "vpsubusw", { XM, Vex, EXx }, 0 },
10919 /* VEX_W_0FDA_P_2 */
10920 { "vpminub", { XM, Vex, EXx }, 0 },
10923 /* VEX_W_0FDB_P_2 */
10924 { "vpand", { XM, Vex, EXx }, 0 },
10927 /* VEX_W_0FDC_P_2 */
10928 { "vpaddusb", { XM, Vex, EXx }, 0 },
10931 /* VEX_W_0FDD_P_2 */
10932 { "vpaddusw", { XM, Vex, EXx }, 0 },
10935 /* VEX_W_0FDE_P_2 */
10936 { "vpmaxub", { XM, Vex, EXx }, 0 },
10939 /* VEX_W_0FDF_P_2 */
10940 { "vpandn", { XM, Vex, EXx }, 0 },
10943 /* VEX_W_0FE0_P_2 */
10944 { "vpavgb", { XM, Vex, EXx }, 0 },
10947 /* VEX_W_0FE1_P_2 */
10948 { "vpsraw", { XM, Vex, EXxmm }, 0 },
10951 /* VEX_W_0FE2_P_2 */
10952 { "vpsrad", { XM, Vex, EXxmm }, 0 },
10955 /* VEX_W_0FE3_P_2 */
10956 { "vpavgw", { XM, Vex, EXx }, 0 },
10959 /* VEX_W_0FE4_P_2 */
10960 { "vpmulhuw", { XM, Vex, EXx }, 0 },
10963 /* VEX_W_0FE5_P_2 */
10964 { "vpmulhw", { XM, Vex, EXx }, 0 },
10967 /* VEX_W_0FE6_P_1 */
10968 { "vcvtdq2pd", { XM, EXxmmq }, 0 },
10971 /* VEX_W_0FE6_P_2 */
10972 { "vcvttpd2dq%XY", { XMM, EXx }, 0 },
10975 /* VEX_W_0FE6_P_3 */
10976 { "vcvtpd2dq%XY", { XMM, EXx }, 0 },
10979 /* VEX_W_0FE7_P_2_M_0 */
10980 { "vmovntdq", { Mx, XM }, 0 },
10983 /* VEX_W_0FE8_P_2 */
10984 { "vpsubsb", { XM, Vex, EXx }, 0 },
10987 /* VEX_W_0FE9_P_2 */
10988 { "vpsubsw", { XM, Vex, EXx }, 0 },
10991 /* VEX_W_0FEA_P_2 */
10992 { "vpminsw", { XM, Vex, EXx }, 0 },
10995 /* VEX_W_0FEB_P_2 */
10996 { "vpor", { XM, Vex, EXx }, 0 },
10999 /* VEX_W_0FEC_P_2 */
11000 { "vpaddsb", { XM, Vex, EXx }, 0 },
11003 /* VEX_W_0FED_P_2 */
11004 { "vpaddsw", { XM, Vex, EXx }, 0 },
11007 /* VEX_W_0FEE_P_2 */
11008 { "vpmaxsw", { XM, Vex, EXx }, 0 },
11011 /* VEX_W_0FEF_P_2 */
11012 { "vpxor", { XM, Vex, EXx }, 0 },
11015 /* VEX_W_0FF0_P_3_M_0 */
11016 { "vlddqu", { XM, M }, 0 },
11019 /* VEX_W_0FF1_P_2 */
11020 { "vpsllw", { XM, Vex, EXxmm }, 0 },
11023 /* VEX_W_0FF2_P_2 */
11024 { "vpslld", { XM, Vex, EXxmm }, 0 },
11027 /* VEX_W_0FF3_P_2 */
11028 { "vpsllq", { XM, Vex, EXxmm }, 0 },
11031 /* VEX_W_0FF4_P_2 */
11032 { "vpmuludq", { XM, Vex, EXx }, 0 },
11035 /* VEX_W_0FF5_P_2 */
11036 { "vpmaddwd", { XM, Vex, EXx }, 0 },
11039 /* VEX_W_0FF6_P_2 */
11040 { "vpsadbw", { XM, Vex, EXx }, 0 },
11043 /* VEX_W_0FF7_P_2 */
11044 { "vmaskmovdqu", { XM, XS }, 0 },
11047 /* VEX_W_0FF8_P_2 */
11048 { "vpsubb", { XM, Vex, EXx }, 0 },
11051 /* VEX_W_0FF9_P_2 */
11052 { "vpsubw", { XM, Vex, EXx }, 0 },
11055 /* VEX_W_0FFA_P_2 */
11056 { "vpsubd", { XM, Vex, EXx }, 0 },
11059 /* VEX_W_0FFB_P_2 */
11060 { "vpsubq", { XM, Vex, EXx }, 0 },
11063 /* VEX_W_0FFC_P_2 */
11064 { "vpaddb", { XM, Vex, EXx }, 0 },
11067 /* VEX_W_0FFD_P_2 */
11068 { "vpaddw", { XM, Vex, EXx }, 0 },
11071 /* VEX_W_0FFE_P_2 */
11072 { "vpaddd", { XM, Vex, EXx }, 0 },
11075 /* VEX_W_0F3800_P_2 */
11076 { "vpshufb", { XM, Vex, EXx }, 0 },
11079 /* VEX_W_0F3801_P_2 */
11080 { "vphaddw", { XM, Vex, EXx }, 0 },
11083 /* VEX_W_0F3802_P_2 */
11084 { "vphaddd", { XM, Vex, EXx }, 0 },
11087 /* VEX_W_0F3803_P_2 */
11088 { "vphaddsw", { XM, Vex, EXx }, 0 },
11091 /* VEX_W_0F3804_P_2 */
11092 { "vpmaddubsw", { XM, Vex, EXx }, 0 },
11095 /* VEX_W_0F3805_P_2 */
11096 { "vphsubw", { XM, Vex, EXx }, 0 },
11099 /* VEX_W_0F3806_P_2 */
11100 { "vphsubd", { XM, Vex, EXx }, 0 },
11103 /* VEX_W_0F3807_P_2 */
11104 { "vphsubsw", { XM, Vex, EXx }, 0 },
11107 /* VEX_W_0F3808_P_2 */
11108 { "vpsignb", { XM, Vex, EXx }, 0 },
11111 /* VEX_W_0F3809_P_2 */
11112 { "vpsignw", { XM, Vex, EXx }, 0 },
11115 /* VEX_W_0F380A_P_2 */
11116 { "vpsignd", { XM, Vex, EXx }, 0 },
11119 /* VEX_W_0F380B_P_2 */
11120 { "vpmulhrsw", { XM, Vex, EXx }, 0 },
11123 /* VEX_W_0F380C_P_2 */
11124 { "vpermilps", { XM, Vex, EXx }, 0 },
11127 /* VEX_W_0F380D_P_2 */
11128 { "vpermilpd", { XM, Vex, EXx }, 0 },
11131 /* VEX_W_0F380E_P_2 */
11132 { "vtestps", { XM, EXx }, 0 },
11135 /* VEX_W_0F380F_P_2 */
11136 { "vtestpd", { XM, EXx }, 0 },
11139 /* VEX_W_0F3816_P_2 */
11140 { "vpermps", { XM, Vex, EXx }, 0 },
11143 /* VEX_W_0F3817_P_2 */
11144 { "vptest", { XM, EXx }, 0 },
11147 /* VEX_W_0F3818_P_2 */
11148 { "vbroadcastss", { XM, EXxmm_md }, 0 },
11151 /* VEX_W_0F3819_P_2 */
11152 { "vbroadcastsd", { XM, EXxmm_mq }, 0 },
11155 /* VEX_W_0F381A_P_2_M_0 */
11156 { "vbroadcastf128", { XM, Mxmm }, 0 },
11159 /* VEX_W_0F381C_P_2 */
11160 { "vpabsb", { XM, EXx }, 0 },
11163 /* VEX_W_0F381D_P_2 */
11164 { "vpabsw", { XM, EXx }, 0 },
11167 /* VEX_W_0F381E_P_2 */
11168 { "vpabsd", { XM, EXx }, 0 },
11171 /* VEX_W_0F3820_P_2 */
11172 { "vpmovsxbw", { XM, EXxmmq }, 0 },
11175 /* VEX_W_0F3821_P_2 */
11176 { "vpmovsxbd", { XM, EXxmmqd }, 0 },
11179 /* VEX_W_0F3822_P_2 */
11180 { "vpmovsxbq", { XM, EXxmmdw }, 0 },
11183 /* VEX_W_0F3823_P_2 */
11184 { "vpmovsxwd", { XM, EXxmmq }, 0 },
11187 /* VEX_W_0F3824_P_2 */
11188 { "vpmovsxwq", { XM, EXxmmqd }, 0 },
11191 /* VEX_W_0F3825_P_2 */
11192 { "vpmovsxdq", { XM, EXxmmq }, 0 },
11195 /* VEX_W_0F3828_P_2 */
11196 { "vpmuldq", { XM, Vex, EXx }, 0 },
11199 /* VEX_W_0F3829_P_2 */
11200 { "vpcmpeqq", { XM, Vex, EXx }, 0 },
11203 /* VEX_W_0F382A_P_2_M_0 */
11204 { "vmovntdqa", { XM, Mx }, 0 },
11207 /* VEX_W_0F382B_P_2 */
11208 { "vpackusdw", { XM, Vex, EXx }, 0 },
11211 /* VEX_W_0F382C_P_2_M_0 */
11212 { "vmaskmovps", { XM, Vex, Mx }, 0 },
11215 /* VEX_W_0F382D_P_2_M_0 */
11216 { "vmaskmovpd", { XM, Vex, Mx }, 0 },
11219 /* VEX_W_0F382E_P_2_M_0 */
11220 { "vmaskmovps", { Mx, Vex, XM }, 0 },
11223 /* VEX_W_0F382F_P_2_M_0 */
11224 { "vmaskmovpd", { Mx, Vex, XM }, 0 },
11227 /* VEX_W_0F3830_P_2 */
11228 { "vpmovzxbw", { XM, EXxmmq }, 0 },
11231 /* VEX_W_0F3831_P_2 */
11232 { "vpmovzxbd", { XM, EXxmmqd }, 0 },
11235 /* VEX_W_0F3832_P_2 */
11236 { "vpmovzxbq", { XM, EXxmmdw }, 0 },
11239 /* VEX_W_0F3833_P_2 */
11240 { "vpmovzxwd", { XM, EXxmmq }, 0 },
11243 /* VEX_W_0F3834_P_2 */
11244 { "vpmovzxwq", { XM, EXxmmqd }, 0 },
11247 /* VEX_W_0F3835_P_2 */
11248 { "vpmovzxdq", { XM, EXxmmq }, 0 },
11251 /* VEX_W_0F3836_P_2 */
11252 { "vpermd", { XM, Vex, EXx }, 0 },
11255 /* VEX_W_0F3837_P_2 */
11256 { "vpcmpgtq", { XM, Vex, EXx }, 0 },
11259 /* VEX_W_0F3838_P_2 */
11260 { "vpminsb", { XM, Vex, EXx }, 0 },
11263 /* VEX_W_0F3839_P_2 */
11264 { "vpminsd", { XM, Vex, EXx }, 0 },
11267 /* VEX_W_0F383A_P_2 */
11268 { "vpminuw", { XM, Vex, EXx }, 0 },
11271 /* VEX_W_0F383B_P_2 */
11272 { "vpminud", { XM, Vex, EXx }, 0 },
11275 /* VEX_W_0F383C_P_2 */
11276 { "vpmaxsb", { XM, Vex, EXx }, 0 },
11279 /* VEX_W_0F383D_P_2 */
11280 { "vpmaxsd", { XM, Vex, EXx }, 0 },
11283 /* VEX_W_0F383E_P_2 */
11284 { "vpmaxuw", { XM, Vex, EXx }, 0 },
11287 /* VEX_W_0F383F_P_2 */
11288 { "vpmaxud", { XM, Vex, EXx }, 0 },
11291 /* VEX_W_0F3840_P_2 */
11292 { "vpmulld", { XM, Vex, EXx }, 0 },
11295 /* VEX_W_0F3841_P_2 */
11296 { "vphminposuw", { XM, EXx }, 0 },
11299 /* VEX_W_0F3846_P_2 */
11300 { "vpsravd", { XM, Vex, EXx }, 0 },
11303 /* VEX_W_0F3858_P_2 */
11304 { "vpbroadcastd", { XM, EXxmm_md }, 0 },
11307 /* VEX_W_0F3859_P_2 */
11308 { "vpbroadcastq", { XM, EXxmm_mq }, 0 },
11311 /* VEX_W_0F385A_P_2_M_0 */
11312 { "vbroadcasti128", { XM, Mxmm }, 0 },
11315 /* VEX_W_0F3878_P_2 */
11316 { "vpbroadcastb", { XM, EXxmm_mb }, 0 },
11319 /* VEX_W_0F3879_P_2 */
11320 { "vpbroadcastw", { XM, EXxmm_mw }, 0 },
11323 /* VEX_W_0F38CF_P_2 */
11324 { "vgf2p8mulb", { XM, Vex, EXx }, 0 },
11327 /* VEX_W_0F38DB_P_2 */
11328 { "vaesimc", { XM, EXx }, 0 },
11331 /* VEX_W_0F3A00_P_2 */
11333 { "vpermq", { XM, EXx, Ib }, 0 },
11336 /* VEX_W_0F3A01_P_2 */
11338 { "vpermpd", { XM, EXx, Ib }, 0 },
11341 /* VEX_W_0F3A02_P_2 */
11342 { "vpblendd", { XM, Vex, EXx, Ib }, 0 },
11345 /* VEX_W_0F3A04_P_2 */
11346 { "vpermilps", { XM, EXx, Ib }, 0 },
11349 /* VEX_W_0F3A05_P_2 */
11350 { "vpermilpd", { XM, EXx, Ib }, 0 },
11353 /* VEX_W_0F3A06_P_2 */
11354 { "vperm2f128", { XM, Vex256, EXx, Ib }, 0 },
11357 /* VEX_W_0F3A08_P_2 */
11358 { "vroundps", { XM, EXx, Ib }, 0 },
11361 /* VEX_W_0F3A09_P_2 */
11362 { "vroundpd", { XM, EXx, Ib }, 0 },
11365 /* VEX_W_0F3A0A_P_2 */
11366 { "vroundss", { XMScalar, VexScalar, EXdScalar, Ib }, 0 },
11369 /* VEX_W_0F3A0B_P_2 */
11370 { "vroundsd", { XMScalar, VexScalar, EXqScalar, Ib }, 0 },
11373 /* VEX_W_0F3A0C_P_2 */
11374 { "vblendps", { XM, Vex, EXx, Ib }, 0 },
11377 /* VEX_W_0F3A0D_P_2 */
11378 { "vblendpd", { XM, Vex, EXx, Ib }, 0 },
11381 /* VEX_W_0F3A0E_P_2 */
11382 { "vpblendw", { XM, Vex, EXx, Ib }, 0 },
11385 /* VEX_W_0F3A0F_P_2 */
11386 { "vpalignr", { XM, Vex, EXx, Ib }, 0 },
11389 /* VEX_W_0F3A14_P_2 */
11390 { "vpextrb", { Edqb, XM, Ib }, 0 },
11393 /* VEX_W_0F3A15_P_2 */
11394 { "vpextrw", { Edqw, XM, Ib }, 0 },
11397 /* VEX_W_0F3A18_P_2 */
11398 { "vinsertf128", { XM, Vex256, EXxmm, Ib }, 0 },
11401 /* VEX_W_0F3A19_P_2 */
11402 { "vextractf128", { EXxmm, XM, Ib }, 0 },
11405 /* VEX_W_0F3A20_P_2 */
11406 { "vpinsrb", { XM, Vex128, Edqb, Ib }, 0 },
11409 /* VEX_W_0F3A21_P_2 */
11410 { "vinsertps", { XM, Vex128, EXd, Ib }, 0 },
11413 /* VEX_W_0F3A30_P_2_LEN_0 */
11414 { MOD_TABLE (MOD_VEX_W_0_0F3A30_P_2_LEN_0) },
11415 { MOD_TABLE (MOD_VEX_W_1_0F3A30_P_2_LEN_0) },
11418 /* VEX_W_0F3A31_P_2_LEN_0 */
11419 { MOD_TABLE (MOD_VEX_W_0_0F3A31_P_2_LEN_0) },
11420 { MOD_TABLE (MOD_VEX_W_1_0F3A31_P_2_LEN_0) },
11423 /* VEX_W_0F3A32_P_2_LEN_0 */
11424 { MOD_TABLE (MOD_VEX_W_0_0F3A32_P_2_LEN_0) },
11425 { MOD_TABLE (MOD_VEX_W_1_0F3A32_P_2_LEN_0) },
11428 /* VEX_W_0F3A33_P_2_LEN_0 */
11429 { MOD_TABLE (MOD_VEX_W_0_0F3A33_P_2_LEN_0) },
11430 { MOD_TABLE (MOD_VEX_W_1_0F3A33_P_2_LEN_0) },
11433 /* VEX_W_0F3A38_P_2 */
11434 { "vinserti128", { XM, Vex256, EXxmm, Ib }, 0 },
11437 /* VEX_W_0F3A39_P_2 */
11438 { "vextracti128", { EXxmm, XM, Ib }, 0 },
11441 /* VEX_W_0F3A40_P_2 */
11442 { "vdpps", { XM, Vex, EXx, Ib }, 0 },
11445 /* VEX_W_0F3A41_P_2 */
11446 { "vdppd", { XM, Vex128, EXx, Ib }, 0 },
11449 /* VEX_W_0F3A42_P_2 */
11450 { "vmpsadbw", { XM, Vex, EXx, Ib }, 0 },
11453 /* VEX_W_0F3A46_P_2 */
11454 { "vperm2i128", { XM, Vex256, EXx, Ib }, 0 },
11457 /* VEX_W_0F3A48_P_2 */
11458 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
11459 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
11462 /* VEX_W_0F3A49_P_2 */
11463 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
11464 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
11467 /* VEX_W_0F3A4A_P_2 */
11468 { "vblendvps", { XM, Vex, EXx, XMVexI4 }, 0 },
11471 /* VEX_W_0F3A4B_P_2 */
11472 { "vblendvpd", { XM, Vex, EXx, XMVexI4 }, 0 },
11475 /* VEX_W_0F3A4C_P_2 */
11476 { "vpblendvb", { XM, Vex, EXx, XMVexI4 }, 0 },
11479 /* VEX_W_0F3A62_P_2 */
11480 { "vpcmpistrm", { XM, EXx, Ib }, 0 },
11483 /* VEX_W_0F3A63_P_2 */
11484 { "vpcmpistri", { XM, EXx, Ib }, 0 },
11487 /* VEX_W_0F3ACE_P_2 */
11489 { "vgf2p8affineqb", { XM, Vex, EXx, Ib }, 0 },
11492 /* VEX_W_0F3ACF_P_2 */
11494 { "vgf2p8affineinvqb", { XM, Vex, EXx, Ib }, 0 },
11497 /* VEX_W_0F3ADF_P_2 */
11498 { "vaeskeygenassist", { XM, EXx, Ib }, 0 },
11500 #define NEED_VEX_W_TABLE
11501 #include "i386-dis-evex.h"
11502 #undef NEED_VEX_W_TABLE
11505 static const struct dis386 mod_table[][2] = {
11508 { "leaS", { Gv, M }, 0 },
11513 { RM_TABLE (RM_C6_REG_7) },
11518 { RM_TABLE (RM_C7_REG_7) },
11522 { "Jcall^", { indirEp }, 0 },
11526 { "Jjmp^", { indirEp }, 0 },
11529 /* MOD_0F01_REG_0 */
11530 { X86_64_TABLE (X86_64_0F01_REG_0) },
11531 { RM_TABLE (RM_0F01_REG_0) },
11534 /* MOD_0F01_REG_1 */
11535 { X86_64_TABLE (X86_64_0F01_REG_1) },
11536 { RM_TABLE (RM_0F01_REG_1) },
11539 /* MOD_0F01_REG_2 */
11540 { X86_64_TABLE (X86_64_0F01_REG_2) },
11541 { RM_TABLE (RM_0F01_REG_2) },
11544 /* MOD_0F01_REG_3 */
11545 { X86_64_TABLE (X86_64_0F01_REG_3) },
11546 { RM_TABLE (RM_0F01_REG_3) },
11549 /* MOD_0F01_REG_5 */
11550 { PREFIX_TABLE (PREFIX_MOD_0_0F01_REG_5) },
11551 { RM_TABLE (RM_0F01_REG_5) },
11554 /* MOD_0F01_REG_7 */
11555 { "invlpg", { Mb }, 0 },
11556 { RM_TABLE (RM_0F01_REG_7) },
11559 /* MOD_0F12_PREFIX_0 */
11560 { "movlps", { XM, EXq }, PREFIX_OPCODE },
11561 { "movhlps", { XM, EXq }, PREFIX_OPCODE },
11565 { "movlpX", { EXq, XM }, PREFIX_OPCODE },
11568 /* MOD_0F16_PREFIX_0 */
11569 { "movhps", { XM, EXq }, 0 },
11570 { "movlhps", { XM, EXq }, 0 },
11574 { "movhpX", { EXq, XM }, PREFIX_OPCODE },
11577 /* MOD_0F18_REG_0 */
11578 { "prefetchnta", { Mb }, 0 },
11581 /* MOD_0F18_REG_1 */
11582 { "prefetcht0", { Mb }, 0 },
11585 /* MOD_0F18_REG_2 */
11586 { "prefetcht1", { Mb }, 0 },
11589 /* MOD_0F18_REG_3 */
11590 { "prefetcht2", { Mb }, 0 },
11593 /* MOD_0F18_REG_4 */
11594 { "nop/reserved", { Mb }, 0 },
11597 /* MOD_0F18_REG_5 */
11598 { "nop/reserved", { Mb }, 0 },
11601 /* MOD_0F18_REG_6 */
11602 { "nop/reserved", { Mb }, 0 },
11605 /* MOD_0F18_REG_7 */
11606 { "nop/reserved", { Mb }, 0 },
11609 /* MOD_0F1A_PREFIX_0 */
11610 { "bndldx", { Gbnd, Ev_bnd }, 0 },
11611 { "nopQ", { Ev }, 0 },
11614 /* MOD_0F1B_PREFIX_0 */
11615 { "bndstx", { Ev_bnd, Gbnd }, 0 },
11616 { "nopQ", { Ev }, 0 },
11619 /* MOD_0F1B_PREFIX_1 */
11620 { "bndmk", { Gbnd, Ev_bnd }, 0 },
11621 { "nopQ", { Ev }, 0 },
11624 /* MOD_0F1E_PREFIX_1 */
11625 { "nopQ", { Ev }, 0 },
11626 { REG_TABLE (REG_0F1E_MOD_3) },
11631 { "movL", { Rd, Td }, 0 },
11636 { "movL", { Td, Rd }, 0 },
11639 /* MOD_0F2B_PREFIX_0 */
11640 {"movntps", { Mx, XM }, PREFIX_OPCODE },
11643 /* MOD_0F2B_PREFIX_1 */
11644 {"movntss", { Md, XM }, PREFIX_OPCODE },
11647 /* MOD_0F2B_PREFIX_2 */
11648 {"movntpd", { Mx, XM }, PREFIX_OPCODE },
11651 /* MOD_0F2B_PREFIX_3 */
11652 {"movntsd", { Mq, XM }, PREFIX_OPCODE },
11657 { "movmskpX", { Gdq, XS }, PREFIX_OPCODE },
11660 /* MOD_0F71_REG_2 */
11662 { "psrlw", { MS, Ib }, 0 },
11665 /* MOD_0F71_REG_4 */
11667 { "psraw", { MS, Ib }, 0 },
11670 /* MOD_0F71_REG_6 */
11672 { "psllw", { MS, Ib }, 0 },
11675 /* MOD_0F72_REG_2 */
11677 { "psrld", { MS, Ib }, 0 },
11680 /* MOD_0F72_REG_4 */
11682 { "psrad", { MS, Ib }, 0 },
11685 /* MOD_0F72_REG_6 */
11687 { "pslld", { MS, Ib }, 0 },
11690 /* MOD_0F73_REG_2 */
11692 { "psrlq", { MS, Ib }, 0 },
11695 /* MOD_0F73_REG_3 */
11697 { PREFIX_TABLE (PREFIX_0F73_REG_3) },
11700 /* MOD_0F73_REG_6 */
11702 { "psllq", { MS, Ib }, 0 },
11705 /* MOD_0F73_REG_7 */
11707 { PREFIX_TABLE (PREFIX_0F73_REG_7) },
11710 /* MOD_0FAE_REG_0 */
11711 { "fxsave", { FXSAVE }, 0 },
11712 { PREFIX_TABLE (PREFIX_0FAE_REG_0) },
11715 /* MOD_0FAE_REG_1 */
11716 { "fxrstor", { FXSAVE }, 0 },
11717 { PREFIX_TABLE (PREFIX_0FAE_REG_1) },
11720 /* MOD_0FAE_REG_2 */
11721 { "ldmxcsr", { Md }, 0 },
11722 { PREFIX_TABLE (PREFIX_0FAE_REG_2) },
11725 /* MOD_0FAE_REG_3 */
11726 { "stmxcsr", { Md }, 0 },
11727 { PREFIX_TABLE (PREFIX_0FAE_REG_3) },
11730 /* MOD_0FAE_REG_4 */
11731 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_4) },
11732 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_4) },
11735 /* MOD_0FAE_REG_5 */
11736 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_5) },
11737 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_5) },
11740 /* MOD_0FAE_REG_6 */
11741 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_6) },
11742 { PREFIX_TABLE (PREFIX_MOD_1_0FAE_REG_6) },
11745 /* MOD_0FAE_REG_7 */
11746 { PREFIX_TABLE (PREFIX_0FAE_REG_7) },
11747 { RM_TABLE (RM_0FAE_REG_7) },
11751 { "lssS", { Gv, Mp }, 0 },
11755 { "lfsS", { Gv, Mp }, 0 },
11759 { "lgsS", { Gv, Mp }, 0 },
11763 { PREFIX_TABLE (PREFIX_MOD_0_0FC3) },
11766 /* MOD_0FC7_REG_3 */
11767 { "xrstors", { FXSAVE }, 0 },
11770 /* MOD_0FC7_REG_4 */
11771 { "xsavec", { FXSAVE }, 0 },
11774 /* MOD_0FC7_REG_5 */
11775 { "xsaves", { FXSAVE }, 0 },
11778 /* MOD_0FC7_REG_6 */
11779 { PREFIX_TABLE (PREFIX_MOD_0_0FC7_REG_6) },
11780 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_6) }
11783 /* MOD_0FC7_REG_7 */
11784 { "vmptrst", { Mq }, 0 },
11785 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_7) }
11790 { "pmovmskb", { Gdq, MS }, 0 },
11793 /* MOD_0FE7_PREFIX_2 */
11794 { "movntdq", { Mx, XM }, 0 },
11797 /* MOD_0FF0_PREFIX_3 */
11798 { "lddqu", { XM, M }, 0 },
11801 /* MOD_0F382A_PREFIX_2 */
11802 { "movntdqa", { XM, Mx }, 0 },
11805 /* MOD_0F38F5_PREFIX_2 */
11806 { "wrussK", { M, Gdq }, PREFIX_OPCODE },
11809 /* MOD_0F38F6_PREFIX_0 */
11810 { "wrssK", { M, Gdq }, PREFIX_OPCODE },
11814 { "bound{S|}", { Gv, Ma }, 0 },
11815 { EVEX_TABLE (EVEX_0F) },
11819 { "lesS", { Gv, Mp }, 0 },
11820 { VEX_C4_TABLE (VEX_0F) },
11824 { "ldsS", { Gv, Mp }, 0 },
11825 { VEX_C5_TABLE (VEX_0F) },
11828 /* MOD_VEX_0F12_PREFIX_0 */
11829 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0) },
11830 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1) },
11834 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0) },
11837 /* MOD_VEX_0F16_PREFIX_0 */
11838 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0) },
11839 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1) },
11843 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0) },
11847 { VEX_W_TABLE (VEX_W_0F2B_M_0) },
11850 /* MOD_VEX_W_0_0F41_P_0_LEN_1 */
11852 { "kandw", { MaskG, MaskVex, MaskR }, 0 },
11855 /* MOD_VEX_W_1_0F41_P_0_LEN_1 */
11857 { "kandq", { MaskG, MaskVex, MaskR }, 0 },
11860 /* MOD_VEX_W_0_0F41_P_2_LEN_1 */
11862 { "kandb", { MaskG, MaskVex, MaskR }, 0 },
11865 /* MOD_VEX_W_1_0F41_P_2_LEN_1 */
11867 { "kandd", { MaskG, MaskVex, MaskR }, 0 },
11870 /* MOD_VEX_W_0_0F42_P_0_LEN_1 */
11872 { "kandnw", { MaskG, MaskVex, MaskR }, 0 },
11875 /* MOD_VEX_W_1_0F42_P_0_LEN_1 */
11877 { "kandnq", { MaskG, MaskVex, MaskR }, 0 },
11880 /* MOD_VEX_W_0_0F42_P_2_LEN_1 */
11882 { "kandnb", { MaskG, MaskVex, MaskR }, 0 },
11885 /* MOD_VEX_W_1_0F42_P_2_LEN_1 */
11887 { "kandnd", { MaskG, MaskVex, MaskR }, 0 },
11890 /* MOD_VEX_W_0_0F44_P_0_LEN_0 */
11892 { "knotw", { MaskG, MaskR }, 0 },
11895 /* MOD_VEX_W_1_0F44_P_0_LEN_0 */
11897 { "knotq", { MaskG, MaskR }, 0 },
11900 /* MOD_VEX_W_0_0F44_P_2_LEN_0 */
11902 { "knotb", { MaskG, MaskR }, 0 },
11905 /* MOD_VEX_W_1_0F44_P_2_LEN_0 */
11907 { "knotd", { MaskG, MaskR }, 0 },
11910 /* MOD_VEX_W_0_0F45_P_0_LEN_1 */
11912 { "korw", { MaskG, MaskVex, MaskR }, 0 },
11915 /* MOD_VEX_W_1_0F45_P_0_LEN_1 */
11917 { "korq", { MaskG, MaskVex, MaskR }, 0 },
11920 /* MOD_VEX_W_0_0F45_P_2_LEN_1 */
11922 { "korb", { MaskG, MaskVex, MaskR }, 0 },
11925 /* MOD_VEX_W_1_0F45_P_2_LEN_1 */
11927 { "kord", { MaskG, MaskVex, MaskR }, 0 },
11930 /* MOD_VEX_W_0_0F46_P_0_LEN_1 */
11932 { "kxnorw", { MaskG, MaskVex, MaskR }, 0 },
11935 /* MOD_VEX_W_1_0F46_P_0_LEN_1 */
11937 { "kxnorq", { MaskG, MaskVex, MaskR }, 0 },
11940 /* MOD_VEX_W_0_0F46_P_2_LEN_1 */
11942 { "kxnorb", { MaskG, MaskVex, MaskR }, 0 },
11945 /* MOD_VEX_W_1_0F46_P_2_LEN_1 */
11947 { "kxnord", { MaskG, MaskVex, MaskR }, 0 },
11950 /* MOD_VEX_W_0_0F47_P_0_LEN_1 */
11952 { "kxorw", { MaskG, MaskVex, MaskR }, 0 },
11955 /* MOD_VEX_W_1_0F47_P_0_LEN_1 */
11957 { "kxorq", { MaskG, MaskVex, MaskR }, 0 },
11960 /* MOD_VEX_W_0_0F47_P_2_LEN_1 */
11962 { "kxorb", { MaskG, MaskVex, MaskR }, 0 },
11965 /* MOD_VEX_W_1_0F47_P_2_LEN_1 */
11967 { "kxord", { MaskG, MaskVex, MaskR }, 0 },
11970 /* MOD_VEX_W_0_0F4A_P_0_LEN_1 */
11972 { "kaddw", { MaskG, MaskVex, MaskR }, 0 },
11975 /* MOD_VEX_W_1_0F4A_P_0_LEN_1 */
11977 { "kaddq", { MaskG, MaskVex, MaskR }, 0 },
11980 /* MOD_VEX_W_0_0F4A_P_2_LEN_1 */
11982 { "kaddb", { MaskG, MaskVex, MaskR }, 0 },
11985 /* MOD_VEX_W_1_0F4A_P_2_LEN_1 */
11987 { "kaddd", { MaskG, MaskVex, MaskR }, 0 },
11990 /* MOD_VEX_W_0_0F4B_P_0_LEN_1 */
11992 { "kunpckwd", { MaskG, MaskVex, MaskR }, 0 },
11995 /* MOD_VEX_W_1_0F4B_P_0_LEN_1 */
11997 { "kunpckdq", { MaskG, MaskVex, MaskR }, 0 },
12000 /* MOD_VEX_W_0_0F4B_P_2_LEN_1 */
12002 { "kunpckbw", { MaskG, MaskVex, MaskR }, 0 },
12007 { VEX_W_TABLE (VEX_W_0F50_M_0) },
12010 /* MOD_VEX_0F71_REG_2 */
12012 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_2) },
12015 /* MOD_VEX_0F71_REG_4 */
12017 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_4) },
12020 /* MOD_VEX_0F71_REG_6 */
12022 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_6) },
12025 /* MOD_VEX_0F72_REG_2 */
12027 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_2) },
12030 /* MOD_VEX_0F72_REG_4 */
12032 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_4) },
12035 /* MOD_VEX_0F72_REG_6 */
12037 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_6) },
12040 /* MOD_VEX_0F73_REG_2 */
12042 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_2) },
12045 /* MOD_VEX_0F73_REG_3 */
12047 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_3) },
12050 /* MOD_VEX_0F73_REG_6 */
12052 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_6) },
12055 /* MOD_VEX_0F73_REG_7 */
12057 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_7) },
12060 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
12061 { "kmovw", { Ew, MaskG }, 0 },
12065 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
12066 { "kmovq", { Eq, MaskG }, 0 },
12070 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
12071 { "kmovb", { Eb, MaskG }, 0 },
12075 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
12076 { "kmovd", { Ed, MaskG }, 0 },
12080 /* MOD_VEX_W_0_0F92_P_0_LEN_0 */
12082 { "kmovw", { MaskG, Rdq }, 0 },
12085 /* MOD_VEX_W_0_0F92_P_2_LEN_0 */
12087 { "kmovb", { MaskG, Rdq }, 0 },
12090 /* MOD_VEX_W_0_0F92_P_3_LEN_0 */
12092 { "kmovd", { MaskG, Rdq }, 0 },
12095 /* MOD_VEX_W_1_0F92_P_3_LEN_0 */
12097 { "kmovq", { MaskG, Rdq }, 0 },
12100 /* MOD_VEX_W_0_0F93_P_0_LEN_0 */
12102 { "kmovw", { Gdq, MaskR }, 0 },
12105 /* MOD_VEX_W_0_0F93_P_2_LEN_0 */
12107 { "kmovb", { Gdq, MaskR }, 0 },
12110 /* MOD_VEX_W_0_0F93_P_3_LEN_0 */
12112 { "kmovd", { Gdq, MaskR }, 0 },
12115 /* MOD_VEX_W_1_0F93_P_3_LEN_0 */
12117 { "kmovq", { Gdq, MaskR }, 0 },
12120 /* MOD_VEX_W_0_0F98_P_0_LEN_0 */
12122 { "kortestw", { MaskG, MaskR }, 0 },
12125 /* MOD_VEX_W_1_0F98_P_0_LEN_0 */
12127 { "kortestq", { MaskG, MaskR }, 0 },
12130 /* MOD_VEX_W_0_0F98_P_2_LEN_0 */
12132 { "kortestb", { MaskG, MaskR }, 0 },
12135 /* MOD_VEX_W_1_0F98_P_2_LEN_0 */
12137 { "kortestd", { MaskG, MaskR }, 0 },
12140 /* MOD_VEX_W_0_0F99_P_0_LEN_0 */
12142 { "ktestw", { MaskG, MaskR }, 0 },
12145 /* MOD_VEX_W_1_0F99_P_0_LEN_0 */
12147 { "ktestq", { MaskG, MaskR }, 0 },
12150 /* MOD_VEX_W_0_0F99_P_2_LEN_0 */
12152 { "ktestb", { MaskG, MaskR }, 0 },
12155 /* MOD_VEX_W_1_0F99_P_2_LEN_0 */
12157 { "ktestd", { MaskG, MaskR }, 0 },
12160 /* MOD_VEX_0FAE_REG_2 */
12161 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0) },
12164 /* MOD_VEX_0FAE_REG_3 */
12165 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0) },
12168 /* MOD_VEX_0FD7_PREFIX_2 */
12170 { VEX_W_TABLE (VEX_W_0FD7_P_2_M_1) },
12173 /* MOD_VEX_0FE7_PREFIX_2 */
12174 { VEX_W_TABLE (VEX_W_0FE7_P_2_M_0) },
12177 /* MOD_VEX_0FF0_PREFIX_3 */
12178 { VEX_W_TABLE (VEX_W_0FF0_P_3_M_0) },
12181 /* MOD_VEX_0F381A_PREFIX_2 */
12182 { VEX_LEN_TABLE (VEX_LEN_0F381A_P_2_M_0) },
12185 /* MOD_VEX_0F382A_PREFIX_2 */
12186 { VEX_W_TABLE (VEX_W_0F382A_P_2_M_0) },
12189 /* MOD_VEX_0F382C_PREFIX_2 */
12190 { VEX_W_TABLE (VEX_W_0F382C_P_2_M_0) },
12193 /* MOD_VEX_0F382D_PREFIX_2 */
12194 { VEX_W_TABLE (VEX_W_0F382D_P_2_M_0) },
12197 /* MOD_VEX_0F382E_PREFIX_2 */
12198 { VEX_W_TABLE (VEX_W_0F382E_P_2_M_0) },
12201 /* MOD_VEX_0F382F_PREFIX_2 */
12202 { VEX_W_TABLE (VEX_W_0F382F_P_2_M_0) },
12205 /* MOD_VEX_0F385A_PREFIX_2 */
12206 { VEX_LEN_TABLE (VEX_LEN_0F385A_P_2_M_0) },
12209 /* MOD_VEX_0F388C_PREFIX_2 */
12210 { "vpmaskmov%LW", { XM, Vex, Mx }, 0 },
12213 /* MOD_VEX_0F388E_PREFIX_2 */
12214 { "vpmaskmov%LW", { Mx, Vex, XM }, 0 },
12217 /* MOD_VEX_W_0_0F3A30_P_2_LEN_0 */
12219 { "kshiftrb", { MaskG, MaskR, Ib }, 0 },
12222 /* MOD_VEX_W_1_0F3A30_P_2_LEN_0 */
12224 { "kshiftrw", { MaskG, MaskR, Ib }, 0 },
12227 /* MOD_VEX_W_0_0F3A31_P_2_LEN_0 */
12229 { "kshiftrd", { MaskG, MaskR, Ib }, 0 },
12232 /* MOD_VEX_W_1_0F3A31_P_2_LEN_0 */
12234 { "kshiftrq", { MaskG, MaskR, Ib }, 0 },
12237 /* MOD_VEX_W_0_0F3A32_P_2_LEN_0 */
12239 { "kshiftlb", { MaskG, MaskR, Ib }, 0 },
12242 /* MOD_VEX_W_1_0F3A32_P_2_LEN_0 */
12244 { "kshiftlw", { MaskG, MaskR, Ib }, 0 },
12247 /* MOD_VEX_W_0_0F3A33_P_2_LEN_0 */
12249 { "kshiftld", { MaskG, MaskR, Ib }, 0 },
12252 /* MOD_VEX_W_1_0F3A33_P_2_LEN_0 */
12254 { "kshiftlq", { MaskG, MaskR, Ib }, 0 },
12256 #define NEED_MOD_TABLE
12257 #include "i386-dis-evex.h"
12258 #undef NEED_MOD_TABLE
12261 static const struct dis386 rm_table[][8] = {
12264 { "xabort", { Skip_MODRM, Ib }, 0 },
12268 { "xbeginT", { Skip_MODRM, Jv }, 0 },
12271 /* RM_0F01_REG_0 */
12273 { "vmcall", { Skip_MODRM }, 0 },
12274 { "vmlaunch", { Skip_MODRM }, 0 },
12275 { "vmresume", { Skip_MODRM }, 0 },
12276 { "vmxoff", { Skip_MODRM }, 0 },
12277 { "pconfig", { Skip_MODRM }, 0 },
12280 /* RM_0F01_REG_1 */
12281 { "monitor", { { OP_Monitor, 0 } }, 0 },
12282 { "mwait", { { OP_Mwait, 0 } }, 0 },
12283 { "clac", { Skip_MODRM }, 0 },
12284 { "stac", { Skip_MODRM }, 0 },
12288 { "encls", { Skip_MODRM }, 0 },
12291 /* RM_0F01_REG_2 */
12292 { "xgetbv", { Skip_MODRM }, 0 },
12293 { "xsetbv", { Skip_MODRM }, 0 },
12296 { "vmfunc", { Skip_MODRM }, 0 },
12297 { "xend", { Skip_MODRM }, 0 },
12298 { "xtest", { Skip_MODRM }, 0 },
12299 { "enclu", { Skip_MODRM }, 0 },
12302 /* RM_0F01_REG_3 */
12303 { "vmrun", { Skip_MODRM }, 0 },
12304 { "vmmcall", { Skip_MODRM }, 0 },
12305 { "vmload", { Skip_MODRM }, 0 },
12306 { "vmsave", { Skip_MODRM }, 0 },
12307 { "stgi", { Skip_MODRM }, 0 },
12308 { "clgi", { Skip_MODRM }, 0 },
12309 { "skinit", { Skip_MODRM }, 0 },
12310 { "invlpga", { Skip_MODRM }, 0 },
12313 /* RM_0F01_REG_5 */
12314 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_0) },
12316 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_2) },
12320 { "rdpkru", { Skip_MODRM }, 0 },
12321 { "wrpkru", { Skip_MODRM }, 0 },
12324 /* RM_0F01_REG_7 */
12325 { "swapgs", { Skip_MODRM }, 0 },
12326 { "rdtscp", { Skip_MODRM }, 0 },
12327 { "monitorx", { { OP_Monitor, 0 } }, 0 },
12328 { "mwaitx", { { OP_Mwaitx, 0 } }, 0 },
12329 { "clzero", { Skip_MODRM }, 0 },
12332 /* RM_0F1E_MOD_3_REG_7 */
12333 { "nopQ", { Ev }, 0 },
12334 { "nopQ", { Ev }, 0 },
12335 { "endbr64", { Skip_MODRM }, PREFIX_OPCODE },
12336 { "endbr32", { Skip_MODRM }, PREFIX_OPCODE },
12337 { "nopQ", { Ev }, 0 },
12338 { "nopQ", { Ev }, 0 },
12339 { "nopQ", { Ev }, 0 },
12340 { "nopQ", { Ev }, 0 },
12343 /* RM_0FAE_REG_6 */
12344 { "mfence", { Skip_MODRM }, 0 },
12347 /* RM_0FAE_REG_7 */
12348 { "sfence", { Skip_MODRM }, 0 },
12353 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
12355 /* We use the high bit to indicate different name for the same
12357 #define REP_PREFIX (0xf3 | 0x100)
12358 #define XACQUIRE_PREFIX (0xf2 | 0x200)
12359 #define XRELEASE_PREFIX (0xf3 | 0x400)
12360 #define BND_PREFIX (0xf2 | 0x400)
12361 #define NOTRACK_PREFIX (0x3e | 0x100)
12366 int newrex, i, length;
12372 last_lock_prefix = -1;
12373 last_repz_prefix = -1;
12374 last_repnz_prefix = -1;
12375 last_data_prefix = -1;
12376 last_addr_prefix = -1;
12377 last_rex_prefix = -1;
12378 last_seg_prefix = -1;
12380 active_seg_prefix = 0;
12381 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
12382 all_prefixes[i] = 0;
12385 /* The maximum instruction length is 15bytes. */
12386 while (length < MAX_CODE_LENGTH - 1)
12388 FETCH_DATA (the_info, codep + 1);
12392 /* REX prefixes family. */
12409 if (address_mode == mode_64bit)
12413 last_rex_prefix = i;
12416 prefixes |= PREFIX_REPZ;
12417 last_repz_prefix = i;
12420 prefixes |= PREFIX_REPNZ;
12421 last_repnz_prefix = i;
12424 prefixes |= PREFIX_LOCK;
12425 last_lock_prefix = i;
12428 prefixes |= PREFIX_CS;
12429 last_seg_prefix = i;
12430 active_seg_prefix = PREFIX_CS;
12433 prefixes |= PREFIX_SS;
12434 last_seg_prefix = i;
12435 active_seg_prefix = PREFIX_SS;
12438 prefixes |= PREFIX_DS;
12439 last_seg_prefix = i;
12440 active_seg_prefix = PREFIX_DS;
12443 prefixes |= PREFIX_ES;
12444 last_seg_prefix = i;
12445 active_seg_prefix = PREFIX_ES;
12448 prefixes |= PREFIX_FS;
12449 last_seg_prefix = i;
12450 active_seg_prefix = PREFIX_FS;
12453 prefixes |= PREFIX_GS;
12454 last_seg_prefix = i;
12455 active_seg_prefix = PREFIX_GS;
12458 prefixes |= PREFIX_DATA;
12459 last_data_prefix = i;
12462 prefixes |= PREFIX_ADDR;
12463 last_addr_prefix = i;
12466 /* fwait is really an instruction. If there are prefixes
12467 before the fwait, they belong to the fwait, *not* to the
12468 following instruction. */
12470 if (prefixes || rex)
12472 prefixes |= PREFIX_FWAIT;
12474 /* This ensures that the previous REX prefixes are noticed
12475 as unused prefixes, as in the return case below. */
12479 prefixes = PREFIX_FWAIT;
12484 /* Rex is ignored when followed by another prefix. */
12490 if (*codep != FWAIT_OPCODE)
12491 all_prefixes[i++] = *codep;
12499 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
12502 static const char *
12503 prefix_name (int pref, int sizeflag)
12505 static const char *rexes [16] =
12508 "rex.B", /* 0x41 */
12509 "rex.X", /* 0x42 */
12510 "rex.XB", /* 0x43 */
12511 "rex.R", /* 0x44 */
12512 "rex.RB", /* 0x45 */
12513 "rex.RX", /* 0x46 */
12514 "rex.RXB", /* 0x47 */
12515 "rex.W", /* 0x48 */
12516 "rex.WB", /* 0x49 */
12517 "rex.WX", /* 0x4a */
12518 "rex.WXB", /* 0x4b */
12519 "rex.WR", /* 0x4c */
12520 "rex.WRB", /* 0x4d */
12521 "rex.WRX", /* 0x4e */
12522 "rex.WRXB", /* 0x4f */
12527 /* REX prefixes family. */
12544 return rexes [pref - 0x40];
12564 return (sizeflag & DFLAG) ? "data16" : "data32";
12566 if (address_mode == mode_64bit)
12567 return (sizeflag & AFLAG) ? "addr32" : "addr64";
12569 return (sizeflag & AFLAG) ? "addr16" : "addr32";
12574 case XACQUIRE_PREFIX:
12576 case XRELEASE_PREFIX:
12580 case NOTRACK_PREFIX:
12587 static char op_out[MAX_OPERANDS][100];
12588 static int op_ad, op_index[MAX_OPERANDS];
12589 static int two_source_ops;
12590 static bfd_vma op_address[MAX_OPERANDS];
12591 static bfd_vma op_riprel[MAX_OPERANDS];
12592 static bfd_vma start_pc;
12595 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
12596 * (see topic "Redundant prefixes" in the "Differences from 8086"
12597 * section of the "Virtual 8086 Mode" chapter.)
12598 * 'pc' should be the address of this instruction, it will
12599 * be used to print the target address if this is a relative jump or call
12600 * The function returns the length of this instruction in bytes.
12603 static char intel_syntax;
12604 static char intel_mnemonic = !SYSV386_COMPAT;
12605 static char open_char;
12606 static char close_char;
12607 static char separator_char;
12608 static char scale_char;
12616 static enum x86_64_isa isa64;
12618 /* Here for backwards compatibility. When gdb stops using
12619 print_insn_i386_att and print_insn_i386_intel these functions can
12620 disappear, and print_insn_i386 be merged into print_insn. */
12622 print_insn_i386_att (bfd_vma pc, disassemble_info *info)
12626 return print_insn (pc, info);
12630 print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
12634 return print_insn (pc, info);
12638 print_insn_i386 (bfd_vma pc, disassemble_info *info)
12642 return print_insn (pc, info);
12646 print_i386_disassembler_options (FILE *stream)
12648 fprintf (stream, _("\n\
12649 The following i386/x86-64 specific disassembler options are supported for use\n\
12650 with the -M switch (multiple options should be separated by commas):\n"));
12652 fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n"));
12653 fprintf (stream, _(" i386 Disassemble in 32bit mode\n"));
12654 fprintf (stream, _(" i8086 Disassemble in 16bit mode\n"));
12655 fprintf (stream, _(" att Display instruction in AT&T syntax\n"));
12656 fprintf (stream, _(" intel Display instruction in Intel syntax\n"));
12657 fprintf (stream, _(" att-mnemonic\n"
12658 " Display instruction in AT&T mnemonic\n"));
12659 fprintf (stream, _(" intel-mnemonic\n"
12660 " Display instruction in Intel mnemonic\n"));
12661 fprintf (stream, _(" addr64 Assume 64bit address size\n"));
12662 fprintf (stream, _(" addr32 Assume 32bit address size\n"));
12663 fprintf (stream, _(" addr16 Assume 16bit address size\n"));
12664 fprintf (stream, _(" data32 Assume 32bit data size\n"));
12665 fprintf (stream, _(" data16 Assume 16bit data size\n"));
12666 fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n"));
12667 fprintf (stream, _(" amd64 Display instruction in AMD64 ISA\n"));
12668 fprintf (stream, _(" intel64 Display instruction in Intel64 ISA\n"));
12672 static const struct dis386 bad_opcode = { "(bad)", { XX }, 0 };
12674 /* Get a pointer to struct dis386 with a valid name. */
12676 static const struct dis386 *
12677 get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
12679 int vindex, vex_table_index;
12681 if (dp->name != NULL)
12684 switch (dp->op[0].bytemode)
12686 case USE_REG_TABLE:
12687 dp = ®_table[dp->op[1].bytemode][modrm.reg];
12690 case USE_MOD_TABLE:
12691 vindex = modrm.mod == 0x3 ? 1 : 0;
12692 dp = &mod_table[dp->op[1].bytemode][vindex];
12696 dp = &rm_table[dp->op[1].bytemode][modrm.rm];
12699 case USE_PREFIX_TABLE:
12702 /* The prefix in VEX is implicit. */
12703 switch (vex.prefix)
12708 case REPE_PREFIX_OPCODE:
12711 case DATA_PREFIX_OPCODE:
12714 case REPNE_PREFIX_OPCODE:
12724 int last_prefix = -1;
12727 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
12728 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
12730 if ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) != 0)
12732 if (last_repz_prefix > last_repnz_prefix)
12735 prefix = PREFIX_REPZ;
12736 last_prefix = last_repz_prefix;
12741 prefix = PREFIX_REPNZ;
12742 last_prefix = last_repnz_prefix;
12745 /* Check if prefix should be ignored. */
12746 if ((((prefix_table[dp->op[1].bytemode][vindex].prefix_requirement
12747 & PREFIX_IGNORED) >> PREFIX_IGNORED_SHIFT)
12752 if (vindex == 0 && (prefixes & PREFIX_DATA) != 0)
12755 prefix = PREFIX_DATA;
12756 last_prefix = last_data_prefix;
12761 used_prefixes |= prefix;
12762 all_prefixes[last_prefix] = 0;
12765 dp = &prefix_table[dp->op[1].bytemode][vindex];
12768 case USE_X86_64_TABLE:
12769 vindex = address_mode == mode_64bit ? 1 : 0;
12770 dp = &x86_64_table[dp->op[1].bytemode][vindex];
12773 case USE_3BYTE_TABLE:
12774 FETCH_DATA (info, codep + 2);
12776 dp = &three_byte_table[dp->op[1].bytemode][vindex];
12778 modrm.mod = (*codep >> 6) & 3;
12779 modrm.reg = (*codep >> 3) & 7;
12780 modrm.rm = *codep & 7;
12783 case USE_VEX_LEN_TABLE:
12787 switch (vex.length)
12800 dp = &vex_len_table[dp->op[1].bytemode][vindex];
12803 case USE_XOP_8F_TABLE:
12804 FETCH_DATA (info, codep + 3);
12805 /* All bits in the REX prefix are ignored. */
12807 rex = ~(*codep >> 5) & 0x7;
12809 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
12810 switch ((*codep & 0x1f))
12816 vex_table_index = XOP_08;
12819 vex_table_index = XOP_09;
12822 vex_table_index = XOP_0A;
12826 vex.w = *codep & 0x80;
12827 if (vex.w && address_mode == mode_64bit)
12830 vex.register_specifier = (~(*codep >> 3)) & 0xf;
12831 if (address_mode != mode_64bit)
12833 /* In 16/32-bit mode REX_B is silently ignored. */
12837 vex.length = (*codep & 0x4) ? 256 : 128;
12838 switch ((*codep & 0x3))
12843 vex.prefix = DATA_PREFIX_OPCODE;
12846 vex.prefix = REPE_PREFIX_OPCODE;
12849 vex.prefix = REPNE_PREFIX_OPCODE;
12856 dp = &xop_table[vex_table_index][vindex];
12859 FETCH_DATA (info, codep + 1);
12860 modrm.mod = (*codep >> 6) & 3;
12861 modrm.reg = (*codep >> 3) & 7;
12862 modrm.rm = *codep & 7;
12865 case USE_VEX_C4_TABLE:
12867 FETCH_DATA (info, codep + 3);
12868 /* All bits in the REX prefix are ignored. */
12870 rex = ~(*codep >> 5) & 0x7;
12871 switch ((*codep & 0x1f))
12877 vex_table_index = VEX_0F;
12880 vex_table_index = VEX_0F38;
12883 vex_table_index = VEX_0F3A;
12887 vex.w = *codep & 0x80;
12888 if (address_mode == mode_64bit)
12895 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
12896 is ignored, other REX bits are 0 and the highest bit in
12897 VEX.vvvv is also ignored (but we mustn't clear it here). */
12900 vex.register_specifier = (~(*codep >> 3)) & 0xf;
12901 vex.length = (*codep & 0x4) ? 256 : 128;
12902 switch ((*codep & 0x3))
12907 vex.prefix = DATA_PREFIX_OPCODE;
12910 vex.prefix = REPE_PREFIX_OPCODE;
12913 vex.prefix = REPNE_PREFIX_OPCODE;
12920 dp = &vex_table[vex_table_index][vindex];
12922 /* There is no MODRM byte for VEX0F 77. */
12923 if (vex_table_index != VEX_0F || vindex != 0x77)
12925 FETCH_DATA (info, codep + 1);
12926 modrm.mod = (*codep >> 6) & 3;
12927 modrm.reg = (*codep >> 3) & 7;
12928 modrm.rm = *codep & 7;
12932 case USE_VEX_C5_TABLE:
12934 FETCH_DATA (info, codep + 2);
12935 /* All bits in the REX prefix are ignored. */
12937 rex = (*codep & 0x80) ? 0 : REX_R;
12939 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
12941 vex.register_specifier = (~(*codep >> 3)) & 0xf;
12942 vex.length = (*codep & 0x4) ? 256 : 128;
12943 switch ((*codep & 0x3))
12948 vex.prefix = DATA_PREFIX_OPCODE;
12951 vex.prefix = REPE_PREFIX_OPCODE;
12954 vex.prefix = REPNE_PREFIX_OPCODE;
12961 dp = &vex_table[dp->op[1].bytemode][vindex];
12963 /* There is no MODRM byte for VEX 77. */
12964 if (vindex != 0x77)
12966 FETCH_DATA (info, codep + 1);
12967 modrm.mod = (*codep >> 6) & 3;
12968 modrm.reg = (*codep >> 3) & 7;
12969 modrm.rm = *codep & 7;
12973 case USE_VEX_W_TABLE:
12977 dp = &vex_w_table[dp->op[1].bytemode][vex.w ? 1 : 0];
12980 case USE_EVEX_TABLE:
12981 two_source_ops = 0;
12984 FETCH_DATA (info, codep + 4);
12985 /* All bits in the REX prefix are ignored. */
12987 /* The first byte after 0x62. */
12988 rex = ~(*codep >> 5) & 0x7;
12989 vex.r = *codep & 0x10;
12990 switch ((*codep & 0xf))
12993 return &bad_opcode;
12995 vex_table_index = EVEX_0F;
12998 vex_table_index = EVEX_0F38;
13001 vex_table_index = EVEX_0F3A;
13005 /* The second byte after 0x62. */
13007 vex.w = *codep & 0x80;
13008 if (vex.w && address_mode == mode_64bit)
13011 vex.register_specifier = (~(*codep >> 3)) & 0xf;
13014 if (!(*codep & 0x4))
13015 return &bad_opcode;
13017 switch ((*codep & 0x3))
13022 vex.prefix = DATA_PREFIX_OPCODE;
13025 vex.prefix = REPE_PREFIX_OPCODE;
13028 vex.prefix = REPNE_PREFIX_OPCODE;
13032 /* The third byte after 0x62. */
13035 /* Remember the static rounding bits. */
13036 vex.ll = (*codep >> 5) & 3;
13037 vex.b = (*codep & 0x10) != 0;
13039 vex.v = *codep & 0x8;
13040 vex.mask_register_specifier = *codep & 0x7;
13041 vex.zeroing = *codep & 0x80;
13043 if (address_mode != mode_64bit)
13045 /* In 16/32-bit mode silently ignore following bits. */
13055 dp = &evex_table[vex_table_index][vindex];
13057 FETCH_DATA (info, codep + 1);
13058 modrm.mod = (*codep >> 6) & 3;
13059 modrm.reg = (*codep >> 3) & 7;
13060 modrm.rm = *codep & 7;
13062 /* Set vector length. */
13063 if (modrm.mod == 3 && vex.b)
13079 return &bad_opcode;
13092 if (dp->name != NULL)
13095 return get_valid_dis386 (dp, info);
13099 get_sib (disassemble_info *info, int sizeflag)
13101 /* If modrm.mod == 3, operand must be register. */
13103 && ((sizeflag & AFLAG) || address_mode == mode_64bit)
13107 FETCH_DATA (info, codep + 2);
13108 sib.index = (codep [1] >> 3) & 7;
13109 sib.scale = (codep [1] >> 6) & 3;
13110 sib.base = codep [1] & 7;
13115 print_insn (bfd_vma pc, disassemble_info *info)
13117 const struct dis386 *dp;
13119 char *op_txt[MAX_OPERANDS];
13121 int sizeflag, orig_sizeflag;
13123 struct dis_private priv;
13126 priv.orig_sizeflag = AFLAG | DFLAG;
13127 if ((info->mach & bfd_mach_i386_i386) != 0)
13128 address_mode = mode_32bit;
13129 else if (info->mach == bfd_mach_i386_i8086)
13131 address_mode = mode_16bit;
13132 priv.orig_sizeflag = 0;
13135 address_mode = mode_64bit;
13137 if (intel_syntax == (char) -1)
13138 intel_syntax = (info->mach & bfd_mach_i386_intel_syntax) != 0;
13140 for (p = info->disassembler_options; p != NULL; )
13142 if (CONST_STRNEQ (p, "amd64"))
13144 else if (CONST_STRNEQ (p, "intel64"))
13146 else if (CONST_STRNEQ (p, "x86-64"))
13148 address_mode = mode_64bit;
13149 priv.orig_sizeflag = AFLAG | DFLAG;
13151 else if (CONST_STRNEQ (p, "i386"))
13153 address_mode = mode_32bit;
13154 priv.orig_sizeflag = AFLAG | DFLAG;
13156 else if (CONST_STRNEQ (p, "i8086"))
13158 address_mode = mode_16bit;
13159 priv.orig_sizeflag = 0;
13161 else if (CONST_STRNEQ (p, "intel"))
13164 if (CONST_STRNEQ (p + 5, "-mnemonic"))
13165 intel_mnemonic = 1;
13167 else if (CONST_STRNEQ (p, "att"))
13170 if (CONST_STRNEQ (p + 3, "-mnemonic"))
13171 intel_mnemonic = 0;
13173 else if (CONST_STRNEQ (p, "addr"))
13175 if (address_mode == mode_64bit)
13177 if (p[4] == '3' && p[5] == '2')
13178 priv.orig_sizeflag &= ~AFLAG;
13179 else if (p[4] == '6' && p[5] == '4')
13180 priv.orig_sizeflag |= AFLAG;
13184 if (p[4] == '1' && p[5] == '6')
13185 priv.orig_sizeflag &= ~AFLAG;
13186 else if (p[4] == '3' && p[5] == '2')
13187 priv.orig_sizeflag |= AFLAG;
13190 else if (CONST_STRNEQ (p, "data"))
13192 if (p[4] == '1' && p[5] == '6')
13193 priv.orig_sizeflag &= ~DFLAG;
13194 else if (p[4] == '3' && p[5] == '2')
13195 priv.orig_sizeflag |= DFLAG;
13197 else if (CONST_STRNEQ (p, "suffix"))
13198 priv.orig_sizeflag |= SUFFIX_ALWAYS;
13200 p = strchr (p, ',');
13205 if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
13207 (*info->fprintf_func) (info->stream,
13208 _("64-bit address is disabled"));
13214 names64 = intel_names64;
13215 names32 = intel_names32;
13216 names16 = intel_names16;
13217 names8 = intel_names8;
13218 names8rex = intel_names8rex;
13219 names_seg = intel_names_seg;
13220 names_mm = intel_names_mm;
13221 names_bnd = intel_names_bnd;
13222 names_xmm = intel_names_xmm;
13223 names_ymm = intel_names_ymm;
13224 names_zmm = intel_names_zmm;
13225 index64 = intel_index64;
13226 index32 = intel_index32;
13227 names_mask = intel_names_mask;
13228 index16 = intel_index16;
13231 separator_char = '+';
13236 names64 = att_names64;
13237 names32 = att_names32;
13238 names16 = att_names16;
13239 names8 = att_names8;
13240 names8rex = att_names8rex;
13241 names_seg = att_names_seg;
13242 names_mm = att_names_mm;
13243 names_bnd = att_names_bnd;
13244 names_xmm = att_names_xmm;
13245 names_ymm = att_names_ymm;
13246 names_zmm = att_names_zmm;
13247 index64 = att_index64;
13248 index32 = att_index32;
13249 names_mask = att_names_mask;
13250 index16 = att_index16;
13253 separator_char = ',';
13257 /* The output looks better if we put 7 bytes on a line, since that
13258 puts most long word instructions on a single line. Use 8 bytes
13260 if ((info->mach & bfd_mach_l1om) != 0)
13261 info->bytes_per_line = 8;
13263 info->bytes_per_line = 7;
13265 info->private_data = &priv;
13266 priv.max_fetched = priv.the_buffer;
13267 priv.insn_start = pc;
13270 for (i = 0; i < MAX_OPERANDS; ++i)
13278 start_codep = priv.the_buffer;
13279 codep = priv.the_buffer;
13281 if (OPCODES_SIGSETJMP (priv.bailout) != 0)
13285 /* Getting here means we tried for data but didn't get it. That
13286 means we have an incomplete instruction of some sort. Just
13287 print the first byte as a prefix or a .byte pseudo-op. */
13288 if (codep > priv.the_buffer)
13290 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
13292 (*info->fprintf_func) (info->stream, "%s", name);
13295 /* Just print the first byte as a .byte instruction. */
13296 (*info->fprintf_func) (info->stream, ".byte 0x%x",
13297 (unsigned int) priv.the_buffer[0]);
13307 sizeflag = priv.orig_sizeflag;
13309 if (!ckprefix () || rex_used)
13311 /* Too many prefixes or unused REX prefixes. */
13313 i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i];
13315 (*info->fprintf_func) (info->stream, "%s%s",
13317 prefix_name (all_prefixes[i], sizeflag));
13321 insn_codep = codep;
13323 FETCH_DATA (info, codep + 1);
13324 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
13326 if (((prefixes & PREFIX_FWAIT)
13327 && ((*codep < 0xd8) || (*codep > 0xdf))))
13329 /* Handle prefixes before fwait. */
13330 for (i = 0; i < fwait_prefix && all_prefixes[i];
13332 (*info->fprintf_func) (info->stream, "%s ",
13333 prefix_name (all_prefixes[i], sizeflag));
13334 (*info->fprintf_func) (info->stream, "fwait");
13338 if (*codep == 0x0f)
13340 unsigned char threebyte;
13343 FETCH_DATA (info, codep + 1);
13344 threebyte = *codep;
13345 dp = &dis386_twobyte[threebyte];
13346 need_modrm = twobyte_has_modrm[*codep];
13351 dp = &dis386[*codep];
13352 need_modrm = onebyte_has_modrm[*codep];
13356 /* Save sizeflag for printing the extra prefixes later before updating
13357 it for mnemonic and operand processing. The prefix names depend
13358 only on the address mode. */
13359 orig_sizeflag = sizeflag;
13360 if (prefixes & PREFIX_ADDR)
13362 if ((prefixes & PREFIX_DATA))
13368 FETCH_DATA (info, codep + 1);
13369 modrm.mod = (*codep >> 6) & 3;
13370 modrm.reg = (*codep >> 3) & 7;
13371 modrm.rm = *codep & 7;
13377 memset (&vex, 0, sizeof (vex));
13379 if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
13381 get_sib (info, sizeflag);
13382 dofloat (sizeflag);
13386 dp = get_valid_dis386 (dp, info);
13387 if (dp != NULL && putop (dp->name, sizeflag) == 0)
13389 get_sib (info, sizeflag);
13390 for (i = 0; i < MAX_OPERANDS; ++i)
13393 op_ad = MAX_OPERANDS - 1 - i;
13395 (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
13396 /* For EVEX instruction after the last operand masking
13397 should be printed. */
13398 if (i == 0 && vex.evex)
13400 /* Don't print {%k0}. */
13401 if (vex.mask_register_specifier)
13404 oappend (names_mask[vex.mask_register_specifier]);
13414 /* Check if the REX prefix is used. */
13415 if (rex_ignored == 0 && (rex ^ rex_used) == 0 && last_rex_prefix >= 0)
13416 all_prefixes[last_rex_prefix] = 0;
13418 /* Check if the SEG prefix is used. */
13419 if ((prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES
13420 | PREFIX_FS | PREFIX_GS)) != 0
13421 && (used_prefixes & active_seg_prefix) != 0)
13422 all_prefixes[last_seg_prefix] = 0;
13424 /* Check if the ADDR prefix is used. */
13425 if ((prefixes & PREFIX_ADDR) != 0
13426 && (used_prefixes & PREFIX_ADDR) != 0)
13427 all_prefixes[last_addr_prefix] = 0;
13429 /* Check if the DATA prefix is used. */
13430 if ((prefixes & PREFIX_DATA) != 0
13431 && (used_prefixes & PREFIX_DATA) != 0)
13432 all_prefixes[last_data_prefix] = 0;
13434 /* Print the extra prefixes. */
13436 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
13437 if (all_prefixes[i])
13440 name = prefix_name (all_prefixes[i], orig_sizeflag);
13443 prefix_length += strlen (name) + 1;
13444 (*info->fprintf_func) (info->stream, "%s ", name);
13447 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
13448 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
13449 used by putop and MMX/SSE operand and may be overriden by the
13450 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
13452 if (dp->prefix_requirement == PREFIX_OPCODE
13453 && dp != &bad_opcode
13455 & (PREFIX_REPZ | PREFIX_REPNZ)) != 0
13457 & (PREFIX_REPZ | PREFIX_REPNZ)) == 0)
13459 & (PREFIX_REPZ | PREFIX_REPNZ | PREFIX_DATA))
13461 && (used_prefixes & PREFIX_DATA) == 0))))
13463 (*info->fprintf_func) (info->stream, "(bad)");
13464 return end_codep - priv.the_buffer;
13467 /* Check maximum code length. */
13468 if ((codep - start_codep) > MAX_CODE_LENGTH)
13470 (*info->fprintf_func) (info->stream, "(bad)");
13471 return MAX_CODE_LENGTH;
13474 obufp = mnemonicendp;
13475 for (i = strlen (obuf) + prefix_length; i < 6; i++)
13478 (*info->fprintf_func) (info->stream, "%s", obuf);
13480 /* The enter and bound instructions are printed with operands in the same
13481 order as the intel book; everything else is printed in reverse order. */
13482 if (intel_syntax || two_source_ops)
13486 for (i = 0; i < MAX_OPERANDS; ++i)
13487 op_txt[i] = op_out[i];
13489 if (intel_syntax && dp && dp->op[2].rtn == OP_Rounding
13490 && dp->op[3].rtn == OP_E && dp->op[4].rtn == NULL)
13492 op_txt[2] = op_out[3];
13493 op_txt[3] = op_out[2];
13496 for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
13498 op_ad = op_index[i];
13499 op_index[i] = op_index[MAX_OPERANDS - 1 - i];
13500 op_index[MAX_OPERANDS - 1 - i] = op_ad;
13501 riprel = op_riprel[i];
13502 op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
13503 op_riprel[MAX_OPERANDS - 1 - i] = riprel;
13508 for (i = 0; i < MAX_OPERANDS; ++i)
13509 op_txt[MAX_OPERANDS - 1 - i] = op_out[i];
13513 for (i = 0; i < MAX_OPERANDS; ++i)
13517 (*info->fprintf_func) (info->stream, ",");
13518 if (op_index[i] != -1 && !op_riprel[i])
13519 (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info);
13521 (*info->fprintf_func) (info->stream, "%s", op_txt[i]);
13525 for (i = 0; i < MAX_OPERANDS; i++)
13526 if (op_index[i] != -1 && op_riprel[i])
13528 (*info->fprintf_func) (info->stream, " # ");
13529 (*info->print_address_func) ((bfd_vma) (start_pc + (codep - start_codep)
13530 + op_address[op_index[i]]), info);
13533 return codep - priv.the_buffer;
13536 static const char *float_mem[] = {
13611 static const unsigned char float_mem_mode[] = {
13686 #define ST { OP_ST, 0 }
13687 #define STi { OP_STi, 0 }
13689 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
13690 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
13691 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
13692 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
13693 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
13694 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
13695 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
13696 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
13697 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
13699 static const struct dis386 float_reg[][8] = {
13702 { "fadd", { ST, STi }, 0 },
13703 { "fmul", { ST, STi }, 0 },
13704 { "fcom", { STi }, 0 },
13705 { "fcomp", { STi }, 0 },
13706 { "fsub", { ST, STi }, 0 },
13707 { "fsubr", { ST, STi }, 0 },
13708 { "fdiv", { ST, STi }, 0 },
13709 { "fdivr", { ST, STi }, 0 },
13713 { "fld", { STi }, 0 },
13714 { "fxch", { STi }, 0 },
13724 { "fcmovb", { ST, STi }, 0 },
13725 { "fcmove", { ST, STi }, 0 },
13726 { "fcmovbe",{ ST, STi }, 0 },
13727 { "fcmovu", { ST, STi }, 0 },
13735 { "fcmovnb",{ ST, STi }, 0 },
13736 { "fcmovne",{ ST, STi }, 0 },
13737 { "fcmovnbe",{ ST, STi }, 0 },
13738 { "fcmovnu",{ ST, STi }, 0 },
13740 { "fucomi", { ST, STi }, 0 },
13741 { "fcomi", { ST, STi }, 0 },
13746 { "fadd", { STi, ST }, 0 },
13747 { "fmul", { STi, ST }, 0 },
13750 { "fsub{!M|r}", { STi, ST }, 0 },
13751 { "fsub{M|}", { STi, ST }, 0 },
13752 { "fdiv{!M|r}", { STi, ST }, 0 },
13753 { "fdiv{M|}", { STi, ST }, 0 },
13757 { "ffree", { STi }, 0 },
13759 { "fst", { STi }, 0 },
13760 { "fstp", { STi }, 0 },
13761 { "fucom", { STi }, 0 },
13762 { "fucomp", { STi }, 0 },
13768 { "faddp", { STi, ST }, 0 },
13769 { "fmulp", { STi, ST }, 0 },
13772 { "fsub{!M|r}p", { STi, ST }, 0 },
13773 { "fsub{M|}p", { STi, ST }, 0 },
13774 { "fdiv{!M|r}p", { STi, ST }, 0 },
13775 { "fdiv{M|}p", { STi, ST }, 0 },
13779 { "ffreep", { STi }, 0 },
13784 { "fucomip", { ST, STi }, 0 },
13785 { "fcomip", { ST, STi }, 0 },
13790 static char *fgrps[][8] = {
13793 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13798 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13803 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
13808 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
13813 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
13818 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
13823 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13828 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
13829 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
13834 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13839 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13844 swap_operand (void)
13846 mnemonicendp[0] = '.';
13847 mnemonicendp[1] = 's';
13852 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
13853 int sizeflag ATTRIBUTE_UNUSED)
13855 /* Skip mod/rm byte. */
13861 dofloat (int sizeflag)
13863 const struct dis386 *dp;
13864 unsigned char floatop;
13866 floatop = codep[-1];
13868 if (modrm.mod != 3)
13870 int fp_indx = (floatop - 0xd8) * 8 + modrm.reg;
13872 putop (float_mem[fp_indx], sizeflag);
13875 OP_E (float_mem_mode[fp_indx], sizeflag);
13878 /* Skip mod/rm byte. */
13882 dp = &float_reg[floatop - 0xd8][modrm.reg];
13883 if (dp->name == NULL)
13885 putop (fgrps[dp->op[0].bytemode][modrm.rm], sizeflag);
13887 /* Instruction fnstsw is only one with strange arg. */
13888 if (floatop == 0xdf && codep[-1] == 0xe0)
13889 strcpy (op_out[0], names16[0]);
13893 putop (dp->name, sizeflag);
13898 (*dp->op[0].rtn) (dp->op[0].bytemode, sizeflag);
13903 (*dp->op[1].rtn) (dp->op[1].bytemode, sizeflag);
13907 /* Like oappend (below), but S is a string starting with '%'.
13908 In Intel syntax, the '%' is elided. */
13910 oappend_maybe_intel (const char *s)
13912 oappend (s + intel_syntax);
13916 OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
13918 oappend_maybe_intel ("%st");
13922 OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
13924 sprintf (scratchbuf, "%%st(%d)", modrm.rm);
13925 oappend_maybe_intel (scratchbuf);
13928 /* Capital letters in template are macros. */
13930 putop (const char *in_template, int sizeflag)
13935 unsigned int l = 0, len = 1;
13938 #define SAVE_LAST(c) \
13939 if (l < len && l < sizeof (last)) \
13944 for (p = in_template; *p; p++)
13960 while (*++p != '|')
13961 if (*p == '}' || *p == '\0')
13964 /* Fall through. */
13969 while (*++p != '}')
13980 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
13984 if (l == 0 && len == 1)
13989 if (sizeflag & SUFFIX_ALWAYS)
14002 if (address_mode == mode_64bit
14003 && !(prefixes & PREFIX_ADDR))
14014 if (intel_syntax && !alt)
14016 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
14018 if (sizeflag & DFLAG)
14019 *obufp++ = intel_syntax ? 'd' : 'l';
14021 *obufp++ = intel_syntax ? 'w' : 's';
14022 used_prefixes |= (prefixes & PREFIX_DATA);
14026 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
14029 if (modrm.mod == 3)
14035 if (sizeflag & DFLAG)
14036 *obufp++ = intel_syntax ? 'd' : 'l';
14039 used_prefixes |= (prefixes & PREFIX_DATA);
14045 case 'E': /* For jcxz/jecxz */
14046 if (address_mode == mode_64bit)
14048 if (sizeflag & AFLAG)
14054 if (sizeflag & AFLAG)
14056 used_prefixes |= (prefixes & PREFIX_ADDR);
14061 if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))
14063 if (sizeflag & AFLAG)
14064 *obufp++ = address_mode == mode_64bit ? 'q' : 'l';
14066 *obufp++ = address_mode == mode_64bit ? 'l' : 'w';
14067 used_prefixes |= (prefixes & PREFIX_ADDR);
14071 if (intel_syntax || (obufp[-1] != 's' && !(sizeflag & SUFFIX_ALWAYS)))
14073 if ((rex & REX_W) || (sizeflag & DFLAG))
14077 if (!(rex & REX_W))
14078 used_prefixes |= (prefixes & PREFIX_DATA);
14083 if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS
14084 || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)
14086 used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);
14089 if (prefixes & PREFIX_DS)
14108 if (l != 0 || len != 1)
14110 if (l != 1 || len != 2 || last[0] != 'X')
14115 if (!need_vex || !vex.evex)
14118 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
14120 switch (vex.length)
14138 if (address_mode == mode_64bit && (sizeflag & SUFFIX_ALWAYS))
14143 /* Fall through. */
14146 if (l != 0 || len != 1)
14154 if (sizeflag & SUFFIX_ALWAYS)
14158 if (intel_mnemonic != cond)
14162 if ((prefixes & PREFIX_FWAIT) == 0)
14165 used_prefixes |= PREFIX_FWAIT;
14171 else if (intel_syntax && (sizeflag & DFLAG))
14175 if (!(rex & REX_W))
14176 used_prefixes |= (prefixes & PREFIX_DATA);
14180 && address_mode == mode_64bit
14181 && isa64 == intel64)
14186 /* Fall through. */
14189 && address_mode == mode_64bit
14190 && ((sizeflag & DFLAG) || (rex & REX_W)))
14195 /* Fall through. */
14198 if (l == 0 && len == 1)
14203 if ((rex & REX_W) == 0
14204 && (prefixes & PREFIX_DATA))
14206 if ((sizeflag & DFLAG) == 0)
14208 used_prefixes |= (prefixes & PREFIX_DATA);
14212 if ((prefixes & PREFIX_DATA)
14214 || (sizeflag & SUFFIX_ALWAYS))
14221 if (sizeflag & DFLAG)
14225 used_prefixes |= (prefixes & PREFIX_DATA);
14231 if (l != 1 || len != 2 || last[0] != 'L')
14237 if ((prefixes & PREFIX_DATA)
14239 || (sizeflag & SUFFIX_ALWAYS))
14246 if (sizeflag & DFLAG)
14247 *obufp++ = intel_syntax ? 'd' : 'l';
14250 used_prefixes |= (prefixes & PREFIX_DATA);
14258 if (address_mode == mode_64bit
14259 && ((sizeflag & DFLAG) || (rex & REX_W)))
14261 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
14265 /* Fall through. */
14268 if (l == 0 && len == 1)
14271 if (intel_syntax && !alt)
14274 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
14280 if (sizeflag & DFLAG)
14281 *obufp++ = intel_syntax ? 'd' : 'l';
14284 used_prefixes |= (prefixes & PREFIX_DATA);
14290 if (l != 1 || len != 2 || last[0] != 'L')
14296 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
14311 else if (sizeflag & DFLAG)
14320 if (intel_syntax && !p[1]
14321 && ((rex & REX_W) || (sizeflag & DFLAG)))
14323 if (!(rex & REX_W))
14324 used_prefixes |= (prefixes & PREFIX_DATA);
14327 if (l == 0 && len == 1)
14331 if (address_mode == mode_64bit
14332 && ((sizeflag & DFLAG) || (rex & REX_W)))
14334 if (sizeflag & SUFFIX_ALWAYS)
14356 /* Fall through. */
14359 if (l == 0 && len == 1)
14364 if (sizeflag & SUFFIX_ALWAYS)
14370 if (sizeflag & DFLAG)
14374 used_prefixes |= (prefixes & PREFIX_DATA);
14388 if (address_mode == mode_64bit
14389 && !(prefixes & PREFIX_ADDR))
14400 if (l != 0 || len != 1)
14405 if (need_vex && vex.prefix)
14407 if (vex.prefix == DATA_PREFIX_OPCODE)
14414 if (prefixes & PREFIX_DATA)
14418 used_prefixes |= (prefixes & PREFIX_DATA);
14422 if (l == 0 && len == 1)
14426 if (l != 1 || len != 2 || last[0] != 'X')
14434 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
14436 switch (vex.length)
14452 if (l == 0 && len == 1)
14454 /* operand size flag for cwtl, cbtw */
14463 else if (sizeflag & DFLAG)
14467 if (!(rex & REX_W))
14468 used_prefixes |= (prefixes & PREFIX_DATA);
14475 && last[0] != 'L'))
14482 if (last[0] == 'X')
14483 *obufp++ = vex.w ? 'd': 's';
14485 *obufp++ = vex.w ? 'q': 'd';
14491 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
14493 if (sizeflag & DFLAG)
14497 used_prefixes |= (prefixes & PREFIX_DATA);
14503 if (address_mode == mode_64bit
14504 && (isa64 == intel64
14505 || ((sizeflag & DFLAG) || (rex & REX_W))))
14507 else if ((prefixes & PREFIX_DATA))
14509 if (!(sizeflag & DFLAG))
14511 used_prefixes |= (prefixes & PREFIX_DATA);
14518 mnemonicendp = obufp;
14523 oappend (const char *s)
14525 obufp = stpcpy (obufp, s);
14531 /* Only print the active segment register. */
14532 if (!active_seg_prefix)
14535 used_prefixes |= active_seg_prefix;
14536 switch (active_seg_prefix)
14539 oappend_maybe_intel ("%cs:");
14542 oappend_maybe_intel ("%ds:");
14545 oappend_maybe_intel ("%ss:");
14548 oappend_maybe_intel ("%es:");
14551 oappend_maybe_intel ("%fs:");
14554 oappend_maybe_intel ("%gs:");
14562 OP_indirE (int bytemode, int sizeflag)
14566 OP_E (bytemode, sizeflag);
14570 print_operand_value (char *buf, int hex, bfd_vma disp)
14572 if (address_mode == mode_64bit)
14580 sprintf_vma (tmp, disp);
14581 for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
14582 strcpy (buf + 2, tmp + i);
14586 bfd_signed_vma v = disp;
14593 /* Check for possible overflow on 0x8000000000000000. */
14596 strcpy (buf, "9223372036854775808");
14610 tmp[28 - i] = (v % 10) + '0';
14614 strcpy (buf, tmp + 29 - i);
14620 sprintf (buf, "0x%x", (unsigned int) disp);
14622 sprintf (buf, "%d", (int) disp);
14626 /* Put DISP in BUF as signed hex number. */
14629 print_displacement (char *buf, bfd_vma disp)
14631 bfd_signed_vma val = disp;
14640 /* Check for possible overflow. */
14643 switch (address_mode)
14646 strcpy (buf + j, "0x8000000000000000");
14649 strcpy (buf + j, "0x80000000");
14652 strcpy (buf + j, "0x8000");
14662 sprintf_vma (tmp, (bfd_vma) val);
14663 for (i = 0; tmp[i] == '0'; i++)
14665 if (tmp[i] == '\0')
14667 strcpy (buf + j, tmp + i);
14671 intel_operand_size (int bytemode, int sizeflag)
14675 && (bytemode == x_mode
14676 || bytemode == evex_half_bcst_xmmq_mode))
14679 oappend ("QWORD PTR ");
14681 oappend ("DWORD PTR ");
14690 oappend ("BYTE PTR ");
14695 oappend ("WORD PTR ");
14698 if (address_mode == mode_64bit && isa64 == intel64)
14700 oappend ("QWORD PTR ");
14703 /* Fall through. */
14705 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
14707 oappend ("QWORD PTR ");
14710 /* Fall through. */
14716 oappend ("QWORD PTR ");
14719 if ((sizeflag & DFLAG) || bytemode == dq_mode)
14720 oappend ("DWORD PTR ");
14722 oappend ("WORD PTR ");
14723 used_prefixes |= (prefixes & PREFIX_DATA);
14727 if ((rex & REX_W) || (sizeflag & DFLAG))
14729 oappend ("WORD PTR ");
14730 if (!(rex & REX_W))
14731 used_prefixes |= (prefixes & PREFIX_DATA);
14734 if (sizeflag & DFLAG)
14735 oappend ("QWORD PTR ");
14737 oappend ("DWORD PTR ");
14738 used_prefixes |= (prefixes & PREFIX_DATA);
14741 case d_scalar_mode:
14742 case d_scalar_swap_mode:
14745 oappend ("DWORD PTR ");
14748 case q_scalar_mode:
14749 case q_scalar_swap_mode:
14751 oappend ("QWORD PTR ");
14754 if (address_mode == mode_64bit)
14755 oappend ("QWORD PTR ");
14757 oappend ("DWORD PTR ");
14760 if (sizeflag & DFLAG)
14761 oappend ("FWORD PTR ");
14763 oappend ("DWORD PTR ");
14764 used_prefixes |= (prefixes & PREFIX_DATA);
14767 oappend ("TBYTE PTR ");
14771 case evex_x_gscat_mode:
14772 case evex_x_nobcst_mode:
14773 case b_scalar_mode:
14774 case w_scalar_mode:
14777 switch (vex.length)
14780 oappend ("XMMWORD PTR ");
14783 oappend ("YMMWORD PTR ");
14786 oappend ("ZMMWORD PTR ");
14793 oappend ("XMMWORD PTR ");
14796 oappend ("XMMWORD PTR ");
14799 oappend ("YMMWORD PTR ");
14802 case evex_half_bcst_xmmq_mode:
14806 switch (vex.length)
14809 oappend ("QWORD PTR ");
14812 oappend ("XMMWORD PTR ");
14815 oappend ("YMMWORD PTR ");
14825 switch (vex.length)
14830 oappend ("BYTE PTR ");
14840 switch (vex.length)
14845 oappend ("WORD PTR ");
14855 switch (vex.length)
14860 oappend ("DWORD PTR ");
14870 switch (vex.length)
14875 oappend ("QWORD PTR ");
14885 switch (vex.length)
14888 oappend ("WORD PTR ");
14891 oappend ("DWORD PTR ");
14894 oappend ("QWORD PTR ");
14904 switch (vex.length)
14907 oappend ("DWORD PTR ");
14910 oappend ("QWORD PTR ");
14913 oappend ("XMMWORD PTR ");
14923 switch (vex.length)
14926 oappend ("QWORD PTR ");
14929 oappend ("YMMWORD PTR ");
14932 oappend ("ZMMWORD PTR ");
14942 switch (vex.length)
14946 oappend ("XMMWORD PTR ");
14953 oappend ("OWORD PTR ");
14956 case vex_w_dq_mode:
14957 case vex_scalar_w_dq_mode:
14962 oappend ("QWORD PTR ");
14964 oappend ("DWORD PTR ");
14966 case vex_vsib_d_w_dq_mode:
14967 case vex_vsib_q_w_dq_mode:
14974 oappend ("QWORD PTR ");
14976 oappend ("DWORD PTR ");
14980 switch (vex.length)
14983 oappend ("XMMWORD PTR ");
14986 oappend ("YMMWORD PTR ");
14989 oappend ("ZMMWORD PTR ");
14996 case vex_vsib_q_w_d_mode:
14997 case vex_vsib_d_w_d_mode:
14998 if (!need_vex || !vex.evex)
15001 switch (vex.length)
15004 oappend ("QWORD PTR ");
15007 oappend ("XMMWORD PTR ");
15010 oappend ("YMMWORD PTR ");
15018 if (!need_vex || vex.length != 128)
15021 oappend ("DWORD PTR ");
15023 oappend ("BYTE PTR ");
15029 oappend ("QWORD PTR ");
15031 oappend ("WORD PTR ");
15040 OP_E_register (int bytemode, int sizeflag)
15042 int reg = modrm.rm;
15043 const char **names;
15049 if ((sizeflag & SUFFIX_ALWAYS)
15050 && (bytemode == b_swap_mode
15051 || bytemode == bnd_swap_mode
15052 || bytemode == v_swap_mode))
15078 names = address_mode == mode_64bit ? names64 : names32;
15081 case bnd_swap_mode:
15090 if (address_mode == mode_64bit && isa64 == intel64)
15095 /* Fall through. */
15097 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
15103 /* Fall through. */
15115 if ((sizeflag & DFLAG)
15116 || (bytemode != v_mode
15117 && bytemode != v_swap_mode))
15121 used_prefixes |= (prefixes & PREFIX_DATA);
15125 names = (address_mode == mode_64bit
15126 ? names64 : names32);
15127 if (!(prefixes & PREFIX_ADDR))
15128 names = (address_mode == mode_16bit
15129 ? names16 : names);
15132 /* Remove "addr16/addr32". */
15133 all_prefixes[last_addr_prefix] = 0;
15134 names = (address_mode != mode_32bit
15135 ? names32 : names16);
15136 used_prefixes |= PREFIX_ADDR;
15146 names = names_mask;
15151 oappend (INTERNAL_DISASSEMBLER_ERROR);
15154 oappend (names[reg]);
15158 OP_E_memory (int bytemode, int sizeflag)
15161 int add = (rex & REX_B) ? 8 : 0;
15167 /* In EVEX, if operand doesn't allow broadcast, vex.b should be 0. */
15169 && bytemode != x_mode
15170 && bytemode != xmmq_mode
15171 && bytemode != evex_half_bcst_xmmq_mode)
15186 case vex_vsib_d_w_dq_mode:
15187 case vex_vsib_d_w_d_mode:
15188 case vex_vsib_q_w_dq_mode:
15189 case vex_vsib_q_w_d_mode:
15190 case evex_x_gscat_mode:
15192 shift = vex.w ? 3 : 2;
15195 case evex_half_bcst_xmmq_mode:
15199 shift = vex.w ? 3 : 2;
15202 /* Fall through. */
15206 case evex_x_nobcst_mode:
15208 switch (vex.length)
15231 case q_scalar_mode:
15233 case q_scalar_swap_mode:
15239 case d_scalar_mode:
15241 case d_scalar_swap_mode:
15244 case w_scalar_mode:
15248 case b_scalar_mode:
15255 /* Make necessary corrections to shift for modes that need it.
15256 For these modes we currently have shift 4, 5 or 6 depending on
15257 vex.length (it corresponds to xmmword, ymmword or zmmword
15258 operand). We might want to make it 3, 4 or 5 (e.g. for
15259 xmmq_mode). In case of broadcast enabled the corrections
15260 aren't needed, as element size is always 32 or 64 bits. */
15262 && (bytemode == xmmq_mode
15263 || bytemode == evex_half_bcst_xmmq_mode))
15265 else if (bytemode == xmmqd_mode)
15267 else if (bytemode == xmmdw_mode)
15269 else if (bytemode == ymmq_mode && vex.length == 128)
15277 intel_operand_size (bytemode, sizeflag);
15280 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
15282 /* 32/64 bit address mode */
15291 int addr32flag = !((sizeflag & AFLAG)
15292 || bytemode == v_bnd_mode
15293 || bytemode == bnd_mode
15294 || bytemode == bnd_swap_mode);
15295 const char **indexes64 = names64;
15296 const char **indexes32 = names32;
15306 vindex = sib.index;
15312 case vex_vsib_d_w_dq_mode:
15313 case vex_vsib_d_w_d_mode:
15314 case vex_vsib_q_w_dq_mode:
15315 case vex_vsib_q_w_d_mode:
15325 switch (vex.length)
15328 indexes64 = indexes32 = names_xmm;
15332 || bytemode == vex_vsib_q_w_dq_mode
15333 || bytemode == vex_vsib_q_w_d_mode)
15334 indexes64 = indexes32 = names_ymm;
15336 indexes64 = indexes32 = names_xmm;
15340 || bytemode == vex_vsib_q_w_dq_mode
15341 || bytemode == vex_vsib_q_w_d_mode)
15342 indexes64 = indexes32 = names_zmm;
15344 indexes64 = indexes32 = names_ymm;
15351 haveindex = vindex != 4;
15358 rbase = base + add;
15366 if (address_mode == mode_64bit && !havesib)
15372 FETCH_DATA (the_info, codep + 1);
15374 if ((disp & 0x80) != 0)
15376 if (vex.evex && shift > 0)
15384 /* In 32bit mode, we need index register to tell [offset] from
15385 [eiz*1 + offset]. */
15386 needindex = (havesib
15389 && address_mode == mode_32bit);
15390 havedisp = (havebase
15392 || (havesib && (haveindex || scale != 0)));
15395 if (modrm.mod != 0 || base == 5)
15397 if (havedisp || riprel)
15398 print_displacement (scratchbuf, disp);
15400 print_operand_value (scratchbuf, 1, disp);
15401 oappend (scratchbuf);
15405 oappend (!addr32flag ? "(%rip)" : "(%eip)");
15409 if ((havebase || haveindex || riprel)
15410 && (bytemode != v_bnd_mode)
15411 && (bytemode != bnd_mode)
15412 && (bytemode != bnd_swap_mode))
15413 used_prefixes |= PREFIX_ADDR;
15415 if (havedisp || (intel_syntax && riprel))
15417 *obufp++ = open_char;
15418 if (intel_syntax && riprel)
15421 oappend (!addr32flag ? "rip" : "eip");
15425 oappend (address_mode == mode_64bit && !addr32flag
15426 ? names64[rbase] : names32[rbase]);
15429 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
15430 print index to tell base + index from base. */
15434 || (havebase && base != ESP_REG_NUM))
15436 if (!intel_syntax || havebase)
15438 *obufp++ = separator_char;
15442 oappend (address_mode == mode_64bit && !addr32flag
15443 ? indexes64[vindex] : indexes32[vindex]);
15445 oappend (address_mode == mode_64bit && !addr32flag
15446 ? index64 : index32);
15448 *obufp++ = scale_char;
15450 sprintf (scratchbuf, "%d", 1 << scale);
15451 oappend (scratchbuf);
15455 && (disp || modrm.mod != 0 || base == 5))
15457 if (!havedisp || (bfd_signed_vma) disp >= 0)
15462 else if (modrm.mod != 1 && disp != -disp)
15466 disp = - (bfd_signed_vma) disp;
15470 print_displacement (scratchbuf, disp);
15472 print_operand_value (scratchbuf, 1, disp);
15473 oappend (scratchbuf);
15476 *obufp++ = close_char;
15479 else if (intel_syntax)
15481 if (modrm.mod != 0 || base == 5)
15483 if (!active_seg_prefix)
15485 oappend (names_seg[ds_reg - es_reg]);
15488 print_operand_value (scratchbuf, 1, disp);
15489 oappend (scratchbuf);
15495 /* 16 bit address mode */
15496 used_prefixes |= prefixes & PREFIX_ADDR;
15503 if ((disp & 0x8000) != 0)
15508 FETCH_DATA (the_info, codep + 1);
15510 if ((disp & 0x80) != 0)
15512 if (vex.evex && shift > 0)
15517 if ((disp & 0x8000) != 0)
15523 if (modrm.mod != 0 || modrm.rm == 6)
15525 print_displacement (scratchbuf, disp);
15526 oappend (scratchbuf);
15529 if (modrm.mod != 0 || modrm.rm != 6)
15531 *obufp++ = open_char;
15533 oappend (index16[modrm.rm]);
15535 && (disp || modrm.mod != 0 || modrm.rm == 6))
15537 if ((bfd_signed_vma) disp >= 0)
15542 else if (modrm.mod != 1)
15546 disp = - (bfd_signed_vma) disp;
15549 print_displacement (scratchbuf, disp);
15550 oappend (scratchbuf);
15553 *obufp++ = close_char;
15556 else if (intel_syntax)
15558 if (!active_seg_prefix)
15560 oappend (names_seg[ds_reg - es_reg]);
15563 print_operand_value (scratchbuf, 1, disp & 0xffff);
15564 oappend (scratchbuf);
15567 if (vex.evex && vex.b
15568 && (bytemode == x_mode
15569 || bytemode == xmmq_mode
15570 || bytemode == evex_half_bcst_xmmq_mode))
15573 || bytemode == xmmq_mode
15574 || bytemode == evex_half_bcst_xmmq_mode)
15576 switch (vex.length)
15579 oappend ("{1to2}");
15582 oappend ("{1to4}");
15585 oappend ("{1to8}");
15593 switch (vex.length)
15596 oappend ("{1to4}");
15599 oappend ("{1to8}");
15602 oappend ("{1to16}");
15612 OP_E (int bytemode, int sizeflag)
15614 /* Skip mod/rm byte. */
15618 if (modrm.mod == 3)
15619 OP_E_register (bytemode, sizeflag);
15621 OP_E_memory (bytemode, sizeflag);
15625 OP_G (int bytemode, int sizeflag)
15636 oappend (names8rex[modrm.reg + add]);
15638 oappend (names8[modrm.reg + add]);
15641 oappend (names16[modrm.reg + add]);
15646 oappend (names32[modrm.reg + add]);
15649 oappend (names64[modrm.reg + add]);
15652 if (modrm.reg > 0x3)
15657 oappend (names_bnd[modrm.reg]);
15666 oappend (names64[modrm.reg + add]);
15669 if ((sizeflag & DFLAG) || bytemode != v_mode)
15670 oappend (names32[modrm.reg + add]);
15672 oappend (names16[modrm.reg + add]);
15673 used_prefixes |= (prefixes & PREFIX_DATA);
15677 if (address_mode == mode_64bit)
15678 oappend (names64[modrm.reg + add]);
15680 oappend (names32[modrm.reg + add]);
15684 if ((modrm.reg + add) > 0x7)
15689 oappend (names_mask[modrm.reg + add]);
15692 oappend (INTERNAL_DISASSEMBLER_ERROR);
15705 FETCH_DATA (the_info, codep + 8);
15706 a = *codep++ & 0xff;
15707 a |= (*codep++ & 0xff) << 8;
15708 a |= (*codep++ & 0xff) << 16;
15709 a |= (*codep++ & 0xffu) << 24;
15710 b = *codep++ & 0xff;
15711 b |= (*codep++ & 0xff) << 8;
15712 b |= (*codep++ & 0xff) << 16;
15713 b |= (*codep++ & 0xffu) << 24;
15714 x = a + ((bfd_vma) b << 32);
15722 static bfd_signed_vma
15725 bfd_signed_vma x = 0;
15727 FETCH_DATA (the_info, codep + 4);
15728 x = *codep++ & (bfd_signed_vma) 0xff;
15729 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
15730 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
15731 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
15735 static bfd_signed_vma
15738 bfd_signed_vma x = 0;
15740 FETCH_DATA (the_info, codep + 4);
15741 x = *codep++ & (bfd_signed_vma) 0xff;
15742 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
15743 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
15744 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
15746 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
15756 FETCH_DATA (the_info, codep + 2);
15757 x = *codep++ & 0xff;
15758 x |= (*codep++ & 0xff) << 8;
15763 set_op (bfd_vma op, int riprel)
15765 op_index[op_ad] = op_ad;
15766 if (address_mode == mode_64bit)
15768 op_address[op_ad] = op;
15769 op_riprel[op_ad] = riprel;
15773 /* Mask to get a 32-bit address. */
15774 op_address[op_ad] = op & 0xffffffff;
15775 op_riprel[op_ad] = riprel & 0xffffffff;
15780 OP_REG (int code, int sizeflag)
15787 case es_reg: case ss_reg: case cs_reg:
15788 case ds_reg: case fs_reg: case gs_reg:
15789 oappend (names_seg[code - es_reg]);
15801 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
15802 case sp_reg: case bp_reg: case si_reg: case di_reg:
15803 s = names16[code - ax_reg + add];
15805 case al_reg: case ah_reg: case cl_reg: case ch_reg:
15806 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
15809 s = names8rex[code - al_reg + add];
15811 s = names8[code - al_reg];
15813 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
15814 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
15815 if (address_mode == mode_64bit
15816 && ((sizeflag & DFLAG) || (rex & REX_W)))
15818 s = names64[code - rAX_reg + add];
15821 code += eAX_reg - rAX_reg;
15822 /* Fall through. */
15823 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
15824 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
15827 s = names64[code - eAX_reg + add];
15830 if (sizeflag & DFLAG)
15831 s = names32[code - eAX_reg + add];
15833 s = names16[code - eAX_reg + add];
15834 used_prefixes |= (prefixes & PREFIX_DATA);
15838 s = INTERNAL_DISASSEMBLER_ERROR;
15845 OP_IMREG (int code, int sizeflag)
15857 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
15858 case sp_reg: case bp_reg: case si_reg: case di_reg:
15859 s = names16[code - ax_reg];
15861 case es_reg: case ss_reg: case cs_reg:
15862 case ds_reg: case fs_reg: case gs_reg:
15863 s = names_seg[code - es_reg];
15865 case al_reg: case ah_reg: case cl_reg: case ch_reg:
15866 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
15869 s = names8rex[code - al_reg];
15871 s = names8[code - al_reg];
15873 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
15874 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
15877 s = names64[code - eAX_reg];
15880 if (sizeflag & DFLAG)
15881 s = names32[code - eAX_reg];
15883 s = names16[code - eAX_reg];
15884 used_prefixes |= (prefixes & PREFIX_DATA);
15887 case z_mode_ax_reg:
15888 if ((rex & REX_W) || (sizeflag & DFLAG))
15892 if (!(rex & REX_W))
15893 used_prefixes |= (prefixes & PREFIX_DATA);
15896 s = INTERNAL_DISASSEMBLER_ERROR;
15903 OP_I (int bytemode, int sizeflag)
15906 bfd_signed_vma mask = -1;
15911 FETCH_DATA (the_info, codep + 1);
15916 if (address_mode == mode_64bit)
15921 /* Fall through. */
15928 if (sizeflag & DFLAG)
15938 used_prefixes |= (prefixes & PREFIX_DATA);
15950 oappend (INTERNAL_DISASSEMBLER_ERROR);
15955 scratchbuf[0] = '$';
15956 print_operand_value (scratchbuf + 1, 1, op);
15957 oappend_maybe_intel (scratchbuf);
15958 scratchbuf[0] = '\0';
15962 OP_I64 (int bytemode, int sizeflag)
15965 bfd_signed_vma mask = -1;
15967 if (address_mode != mode_64bit)
15969 OP_I (bytemode, sizeflag);
15976 FETCH_DATA (the_info, codep + 1);
15986 if (sizeflag & DFLAG)
15996 used_prefixes |= (prefixes & PREFIX_DATA);
16004 oappend (INTERNAL_DISASSEMBLER_ERROR);
16009 scratchbuf[0] = '$';
16010 print_operand_value (scratchbuf + 1, 1, op);
16011 oappend_maybe_intel (scratchbuf);
16012 scratchbuf[0] = '\0';
16016 OP_sI (int bytemode, int sizeflag)
16024 FETCH_DATA (the_info, codep + 1);
16026 if ((op & 0x80) != 0)
16028 if (bytemode == b_T_mode)
16030 if (address_mode != mode_64bit
16031 || !((sizeflag & DFLAG) || (rex & REX_W)))
16033 /* The operand-size prefix is overridden by a REX prefix. */
16034 if ((sizeflag & DFLAG) || (rex & REX_W))
16042 if (!(rex & REX_W))
16044 if (sizeflag & DFLAG)
16052 /* The operand-size prefix is overridden by a REX prefix. */
16053 if ((sizeflag & DFLAG) || (rex & REX_W))
16059 oappend (INTERNAL_DISASSEMBLER_ERROR);
16063 scratchbuf[0] = '$';
16064 print_operand_value (scratchbuf + 1, 1, op);
16065 oappend_maybe_intel (scratchbuf);
16069 OP_J (int bytemode, int sizeflag)
16073 bfd_vma segment = 0;
16078 FETCH_DATA (the_info, codep + 1);
16080 if ((disp & 0x80) != 0)
16084 if (isa64 == amd64)
16086 if ((sizeflag & DFLAG)
16087 || (address_mode == mode_64bit
16088 && (isa64 != amd64 || (rex & REX_W))))
16093 if ((disp & 0x8000) != 0)
16095 /* In 16bit mode, address is wrapped around at 64k within
16096 the same segment. Otherwise, a data16 prefix on a jump
16097 instruction means that the pc is masked to 16 bits after
16098 the displacement is added! */
16100 if ((prefixes & PREFIX_DATA) == 0)
16101 segment = ((start_pc + (codep - start_codep))
16102 & ~((bfd_vma) 0xffff));
16104 if (address_mode != mode_64bit
16105 || (isa64 == amd64 && !(rex & REX_W)))
16106 used_prefixes |= (prefixes & PREFIX_DATA);
16109 oappend (INTERNAL_DISASSEMBLER_ERROR);
16112 disp = ((start_pc + (codep - start_codep) + disp) & mask) | segment;
16114 print_operand_value (scratchbuf, 1, disp);
16115 oappend (scratchbuf);
16119 OP_SEG (int bytemode, int sizeflag)
16121 if (bytemode == w_mode)
16122 oappend (names_seg[modrm.reg]);
16124 OP_E (modrm.mod == 3 ? bytemode : w_mode, sizeflag);
16128 OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
16132 if (sizeflag & DFLAG)
16142 used_prefixes |= (prefixes & PREFIX_DATA);
16144 sprintf (scratchbuf, "0x%x:0x%x", seg, offset);
16146 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
16147 oappend (scratchbuf);
16151 OP_OFF (int bytemode, int sizeflag)
16155 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
16156 intel_operand_size (bytemode, sizeflag);
16159 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
16166 if (!active_seg_prefix)
16168 oappend (names_seg[ds_reg - es_reg]);
16172 print_operand_value (scratchbuf, 1, off);
16173 oappend (scratchbuf);
16177 OP_OFF64 (int bytemode, int sizeflag)
16181 if (address_mode != mode_64bit
16182 || (prefixes & PREFIX_ADDR))
16184 OP_OFF (bytemode, sizeflag);
16188 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
16189 intel_operand_size (bytemode, sizeflag);
16196 if (!active_seg_prefix)
16198 oappend (names_seg[ds_reg - es_reg]);
16202 print_operand_value (scratchbuf, 1, off);
16203 oappend (scratchbuf);
16207 ptr_reg (int code, int sizeflag)
16211 *obufp++ = open_char;
16212 used_prefixes |= (prefixes & PREFIX_ADDR);
16213 if (address_mode == mode_64bit)
16215 if (!(sizeflag & AFLAG))
16216 s = names32[code - eAX_reg];
16218 s = names64[code - eAX_reg];
16220 else if (sizeflag & AFLAG)
16221 s = names32[code - eAX_reg];
16223 s = names16[code - eAX_reg];
16225 *obufp++ = close_char;
16230 OP_ESreg (int code, int sizeflag)
16236 case 0x6d: /* insw/insl */
16237 intel_operand_size (z_mode, sizeflag);
16239 case 0xa5: /* movsw/movsl/movsq */
16240 case 0xa7: /* cmpsw/cmpsl/cmpsq */
16241 case 0xab: /* stosw/stosl */
16242 case 0xaf: /* scasw/scasl */
16243 intel_operand_size (v_mode, sizeflag);
16246 intel_operand_size (b_mode, sizeflag);
16249 oappend_maybe_intel ("%es:");
16250 ptr_reg (code, sizeflag);
16254 OP_DSreg (int code, int sizeflag)
16260 case 0x6f: /* outsw/outsl */
16261 intel_operand_size (z_mode, sizeflag);
16263 case 0xa5: /* movsw/movsl/movsq */
16264 case 0xa7: /* cmpsw/cmpsl/cmpsq */
16265 case 0xad: /* lodsw/lodsl/lodsq */
16266 intel_operand_size (v_mode, sizeflag);
16269 intel_operand_size (b_mode, sizeflag);
16272 /* Set active_seg_prefix to PREFIX_DS if it is unset so that the
16273 default segment register DS is printed. */
16274 if (!active_seg_prefix)
16275 active_seg_prefix = PREFIX_DS;
16277 ptr_reg (code, sizeflag);
16281 OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16289 else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
16291 all_prefixes[last_lock_prefix] = 0;
16292 used_prefixes |= PREFIX_LOCK;
16297 sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
16298 oappend_maybe_intel (scratchbuf);
16302 OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16311 sprintf (scratchbuf, "db%d", modrm.reg + add);
16313 sprintf (scratchbuf, "%%db%d", modrm.reg + add);
16314 oappend (scratchbuf);
16318 OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16320 sprintf (scratchbuf, "%%tr%d", modrm.reg);
16321 oappend_maybe_intel (scratchbuf);
16325 OP_R (int bytemode, int sizeflag)
16327 /* Skip mod/rm byte. */
16330 OP_E_register (bytemode, sizeflag);
16334 OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16336 int reg = modrm.reg;
16337 const char **names;
16339 used_prefixes |= (prefixes & PREFIX_DATA);
16340 if (prefixes & PREFIX_DATA)
16349 oappend (names[reg]);
16353 OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16355 int reg = modrm.reg;
16356 const char **names;
16368 && bytemode != xmm_mode
16369 && bytemode != xmmq_mode
16370 && bytemode != evex_half_bcst_xmmq_mode
16371 && bytemode != ymm_mode
16372 && bytemode != scalar_mode)
16374 switch (vex.length)
16381 || (bytemode != vex_vsib_q_w_dq_mode
16382 && bytemode != vex_vsib_q_w_d_mode))
16394 else if (bytemode == xmmq_mode
16395 || bytemode == evex_half_bcst_xmmq_mode)
16397 switch (vex.length)
16410 else if (bytemode == ymm_mode)
16414 oappend (names[reg]);
16418 OP_EM (int bytemode, int sizeflag)
16421 const char **names;
16423 if (modrm.mod != 3)
16426 && (bytemode == v_mode || bytemode == v_swap_mode))
16428 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
16429 used_prefixes |= (prefixes & PREFIX_DATA);
16431 OP_E (bytemode, sizeflag);
16435 if ((sizeflag & SUFFIX_ALWAYS) && bytemode == v_swap_mode)
16438 /* Skip mod/rm byte. */
16441 used_prefixes |= (prefixes & PREFIX_DATA);
16443 if (prefixes & PREFIX_DATA)
16452 oappend (names[reg]);
16455 /* cvt* are the only instructions in sse2 which have
16456 both SSE and MMX operands and also have 0x66 prefix
16457 in their opcode. 0x66 was originally used to differentiate
16458 between SSE and MMX instruction(operands). So we have to handle the
16459 cvt* separately using OP_EMC and OP_MXC */
16461 OP_EMC (int bytemode, int sizeflag)
16463 if (modrm.mod != 3)
16465 if (intel_syntax && bytemode == v_mode)
16467 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
16468 used_prefixes |= (prefixes & PREFIX_DATA);
16470 OP_E (bytemode, sizeflag);
16474 /* Skip mod/rm byte. */
16477 used_prefixes |= (prefixes & PREFIX_DATA);
16478 oappend (names_mm[modrm.rm]);
16482 OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16484 used_prefixes |= (prefixes & PREFIX_DATA);
16485 oappend (names_mm[modrm.reg]);
16489 OP_EX (int bytemode, int sizeflag)
16492 const char **names;
16494 /* Skip mod/rm byte. */
16498 if (modrm.mod != 3)
16500 OP_E_memory (bytemode, sizeflag);
16515 if ((sizeflag & SUFFIX_ALWAYS)
16516 && (bytemode == x_swap_mode
16517 || bytemode == d_swap_mode
16518 || bytemode == d_scalar_swap_mode
16519 || bytemode == q_swap_mode
16520 || bytemode == q_scalar_swap_mode))
16524 && bytemode != xmm_mode
16525 && bytemode != xmmdw_mode
16526 && bytemode != xmmqd_mode
16527 && bytemode != xmm_mb_mode
16528 && bytemode != xmm_mw_mode
16529 && bytemode != xmm_md_mode
16530 && bytemode != xmm_mq_mode
16531 && bytemode != xmm_mdq_mode
16532 && bytemode != xmmq_mode
16533 && bytemode != evex_half_bcst_xmmq_mode
16534 && bytemode != ymm_mode
16535 && bytemode != d_scalar_mode
16536 && bytemode != d_scalar_swap_mode
16537 && bytemode != q_scalar_mode
16538 && bytemode != q_scalar_swap_mode
16539 && bytemode != vex_scalar_w_dq_mode)
16541 switch (vex.length)
16556 else if (bytemode == xmmq_mode
16557 || bytemode == evex_half_bcst_xmmq_mode)
16559 switch (vex.length)
16572 else if (bytemode == ymm_mode)
16576 oappend (names[reg]);
16580 OP_MS (int bytemode, int sizeflag)
16582 if (modrm.mod == 3)
16583 OP_EM (bytemode, sizeflag);
16589 OP_XS (int bytemode, int sizeflag)
16591 if (modrm.mod == 3)
16592 OP_EX (bytemode, sizeflag);
16598 OP_M (int bytemode, int sizeflag)
16600 if (modrm.mod == 3)
16601 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
16604 OP_E (bytemode, sizeflag);
16608 OP_0f07 (int bytemode, int sizeflag)
16610 if (modrm.mod != 3 || modrm.rm != 0)
16613 OP_E (bytemode, sizeflag);
16616 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
16617 32bit mode and "xchg %rax,%rax" in 64bit mode. */
16620 NOP_Fixup1 (int bytemode, int sizeflag)
16622 if ((prefixes & PREFIX_DATA) != 0
16625 && address_mode == mode_64bit))
16626 OP_REG (bytemode, sizeflag);
16628 strcpy (obuf, "nop");
16632 NOP_Fixup2 (int bytemode, int sizeflag)
16634 if ((prefixes & PREFIX_DATA) != 0
16637 && address_mode == mode_64bit))
16638 OP_IMREG (bytemode, sizeflag);
16641 static const char *const Suffix3DNow[] = {
16642 /* 00 */ NULL, NULL, NULL, NULL,
16643 /* 04 */ NULL, NULL, NULL, NULL,
16644 /* 08 */ NULL, NULL, NULL, NULL,
16645 /* 0C */ "pi2fw", "pi2fd", NULL, NULL,
16646 /* 10 */ NULL, NULL, NULL, NULL,
16647 /* 14 */ NULL, NULL, NULL, NULL,
16648 /* 18 */ NULL, NULL, NULL, NULL,
16649 /* 1C */ "pf2iw", "pf2id", NULL, NULL,
16650 /* 20 */ NULL, NULL, NULL, NULL,
16651 /* 24 */ NULL, NULL, NULL, NULL,
16652 /* 28 */ NULL, NULL, NULL, NULL,
16653 /* 2C */ NULL, NULL, NULL, NULL,
16654 /* 30 */ NULL, NULL, NULL, NULL,
16655 /* 34 */ NULL, NULL, NULL, NULL,
16656 /* 38 */ NULL, NULL, NULL, NULL,
16657 /* 3C */ NULL, NULL, NULL, NULL,
16658 /* 40 */ NULL, NULL, NULL, NULL,
16659 /* 44 */ NULL, NULL, NULL, NULL,
16660 /* 48 */ NULL, NULL, NULL, NULL,
16661 /* 4C */ NULL, NULL, NULL, NULL,
16662 /* 50 */ NULL, NULL, NULL, NULL,
16663 /* 54 */ NULL, NULL, NULL, NULL,
16664 /* 58 */ NULL, NULL, NULL, NULL,
16665 /* 5C */ NULL, NULL, NULL, NULL,
16666 /* 60 */ NULL, NULL, NULL, NULL,
16667 /* 64 */ NULL, NULL, NULL, NULL,
16668 /* 68 */ NULL, NULL, NULL, NULL,
16669 /* 6C */ NULL, NULL, NULL, NULL,
16670 /* 70 */ NULL, NULL, NULL, NULL,
16671 /* 74 */ NULL, NULL, NULL, NULL,
16672 /* 78 */ NULL, NULL, NULL, NULL,
16673 /* 7C */ NULL, NULL, NULL, NULL,
16674 /* 80 */ NULL, NULL, NULL, NULL,
16675 /* 84 */ NULL, NULL, NULL, NULL,
16676 /* 88 */ NULL, NULL, "pfnacc", NULL,
16677 /* 8C */ NULL, NULL, "pfpnacc", NULL,
16678 /* 90 */ "pfcmpge", NULL, NULL, NULL,
16679 /* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",
16680 /* 98 */ NULL, NULL, "pfsub", NULL,
16681 /* 9C */ NULL, NULL, "pfadd", NULL,
16682 /* A0 */ "pfcmpgt", NULL, NULL, NULL,
16683 /* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",
16684 /* A8 */ NULL, NULL, "pfsubr", NULL,
16685 /* AC */ NULL, NULL, "pfacc", NULL,
16686 /* B0 */ "pfcmpeq", NULL, NULL, NULL,
16687 /* B4 */ "pfmul", NULL, "pfrcpit2", "pmulhrw",
16688 /* B8 */ NULL, NULL, NULL, "pswapd",
16689 /* BC */ NULL, NULL, NULL, "pavgusb",
16690 /* C0 */ NULL, NULL, NULL, NULL,
16691 /* C4 */ NULL, NULL, NULL, NULL,
16692 /* C8 */ NULL, NULL, NULL, NULL,
16693 /* CC */ NULL, NULL, NULL, NULL,
16694 /* D0 */ NULL, NULL, NULL, NULL,
16695 /* D4 */ NULL, NULL, NULL, NULL,
16696 /* D8 */ NULL, NULL, NULL, NULL,
16697 /* DC */ NULL, NULL, NULL, NULL,
16698 /* E0 */ NULL, NULL, NULL, NULL,
16699 /* E4 */ NULL, NULL, NULL, NULL,
16700 /* E8 */ NULL, NULL, NULL, NULL,
16701 /* EC */ NULL, NULL, NULL, NULL,
16702 /* F0 */ NULL, NULL, NULL, NULL,
16703 /* F4 */ NULL, NULL, NULL, NULL,
16704 /* F8 */ NULL, NULL, NULL, NULL,
16705 /* FC */ NULL, NULL, NULL, NULL,
16709 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16711 const char *mnemonic;
16713 FETCH_DATA (the_info, codep + 1);
16714 /* AMD 3DNow! instructions are specified by an opcode suffix in the
16715 place where an 8-bit immediate would normally go. ie. the last
16716 byte of the instruction. */
16717 obufp = mnemonicendp;
16718 mnemonic = Suffix3DNow[*codep++ & 0xff];
16720 oappend (mnemonic);
16723 /* Since a variable sized modrm/sib chunk is between the start
16724 of the opcode (0x0f0f) and the opcode suffix, we need to do
16725 all the modrm processing first, and don't know until now that
16726 we have a bad opcode. This necessitates some cleaning up. */
16727 op_out[0][0] = '\0';
16728 op_out[1][0] = '\0';
16731 mnemonicendp = obufp;
16734 static struct op simd_cmp_op[] =
16736 { STRING_COMMA_LEN ("eq") },
16737 { STRING_COMMA_LEN ("lt") },
16738 { STRING_COMMA_LEN ("le") },
16739 { STRING_COMMA_LEN ("unord") },
16740 { STRING_COMMA_LEN ("neq") },
16741 { STRING_COMMA_LEN ("nlt") },
16742 { STRING_COMMA_LEN ("nle") },
16743 { STRING_COMMA_LEN ("ord") }
16747 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16749 unsigned int cmp_type;
16751 FETCH_DATA (the_info, codep + 1);
16752 cmp_type = *codep++ & 0xff;
16753 if (cmp_type < ARRAY_SIZE (simd_cmp_op))
16756 char *p = mnemonicendp - 2;
16760 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
16761 mnemonicendp += simd_cmp_op[cmp_type].len;
16765 /* We have a reserved extension byte. Output it directly. */
16766 scratchbuf[0] = '$';
16767 print_operand_value (scratchbuf + 1, 1, cmp_type);
16768 oappend_maybe_intel (scratchbuf);
16769 scratchbuf[0] = '\0';
16774 OP_Mwaitx (int bytemode ATTRIBUTE_UNUSED,
16775 int sizeflag ATTRIBUTE_UNUSED)
16777 /* mwaitx %eax,%ecx,%ebx */
16780 const char **names = (address_mode == mode_64bit
16781 ? names64 : names32);
16782 strcpy (op_out[0], names[0]);
16783 strcpy (op_out[1], names[1]);
16784 strcpy (op_out[2], names[3]);
16785 two_source_ops = 1;
16787 /* Skip mod/rm byte. */
16793 OP_Mwait (int bytemode ATTRIBUTE_UNUSED,
16794 int sizeflag ATTRIBUTE_UNUSED)
16796 /* mwait %eax,%ecx */
16799 const char **names = (address_mode == mode_64bit
16800 ? names64 : names32);
16801 strcpy (op_out[0], names[0]);
16802 strcpy (op_out[1], names[1]);
16803 two_source_ops = 1;
16805 /* Skip mod/rm byte. */
16811 OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
16812 int sizeflag ATTRIBUTE_UNUSED)
16814 /* monitor %eax,%ecx,%edx" */
16817 const char **op1_names;
16818 const char **names = (address_mode == mode_64bit
16819 ? names64 : names32);
16821 if (!(prefixes & PREFIX_ADDR))
16822 op1_names = (address_mode == mode_16bit
16823 ? names16 : names);
16826 /* Remove "addr16/addr32". */
16827 all_prefixes[last_addr_prefix] = 0;
16828 op1_names = (address_mode != mode_32bit
16829 ? names32 : names16);
16830 used_prefixes |= PREFIX_ADDR;
16832 strcpy (op_out[0], op1_names[0]);
16833 strcpy (op_out[1], names[1]);
16834 strcpy (op_out[2], names[2]);
16835 two_source_ops = 1;
16837 /* Skip mod/rm byte. */
16845 /* Throw away prefixes and 1st. opcode byte. */
16846 codep = insn_codep + 1;
16851 REP_Fixup (int bytemode, int sizeflag)
16853 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
16855 if (prefixes & PREFIX_REPZ)
16856 all_prefixes[last_repz_prefix] = REP_PREFIX;
16863 OP_IMREG (bytemode, sizeflag);
16866 OP_ESreg (bytemode, sizeflag);
16869 OP_DSreg (bytemode, sizeflag);
16877 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
16881 BND_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16883 if (prefixes & PREFIX_REPNZ)
16884 all_prefixes[last_repnz_prefix] = BND_PREFIX;
16887 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
16891 NOTRACK_Fixup (int bytemode ATTRIBUTE_UNUSED,
16892 int sizeflag ATTRIBUTE_UNUSED)
16894 if (active_seg_prefix == PREFIX_DS
16895 && (address_mode != mode_64bit || last_data_prefix < 0))
16897 /* NOTRACK prefix is only valid on indirect branch instructions.
16898 NB: DATA prefix is unsupported for Intel64. */
16899 active_seg_prefix = 0;
16900 all_prefixes[last_seg_prefix] = NOTRACK_PREFIX;
16904 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
16905 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
16909 HLE_Fixup1 (int bytemode, int sizeflag)
16912 && (prefixes & PREFIX_LOCK) != 0)
16914 if (prefixes & PREFIX_REPZ)
16915 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
16916 if (prefixes & PREFIX_REPNZ)
16917 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
16920 OP_E (bytemode, sizeflag);
16923 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
16924 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
16928 HLE_Fixup2 (int bytemode, int sizeflag)
16930 if (modrm.mod != 3)
16932 if (prefixes & PREFIX_REPZ)
16933 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
16934 if (prefixes & PREFIX_REPNZ)
16935 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
16938 OP_E (bytemode, sizeflag);
16941 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
16942 "xrelease" for memory operand. No check for LOCK prefix. */
16945 HLE_Fixup3 (int bytemode, int sizeflag)
16948 && last_repz_prefix > last_repnz_prefix
16949 && (prefixes & PREFIX_REPZ) != 0)
16950 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
16952 OP_E (bytemode, sizeflag);
16956 CMPXCHG8B_Fixup (int bytemode, int sizeflag)
16961 /* Change cmpxchg8b to cmpxchg16b. */
16962 char *p = mnemonicendp - 2;
16963 mnemonicendp = stpcpy (p, "16b");
16966 else if ((prefixes & PREFIX_LOCK) != 0)
16968 if (prefixes & PREFIX_REPZ)
16969 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
16970 if (prefixes & PREFIX_REPNZ)
16971 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
16974 OP_M (bytemode, sizeflag);
16978 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
16980 const char **names;
16984 switch (vex.length)
16998 oappend (names[reg]);
17002 CRC32_Fixup (int bytemode, int sizeflag)
17004 /* Add proper suffix to "crc32". */
17005 char *p = mnemonicendp;
17024 if (sizeflag & DFLAG)
17028 used_prefixes |= (prefixes & PREFIX_DATA);
17032 oappend (INTERNAL_DISASSEMBLER_ERROR);
17039 if (modrm.mod == 3)
17043 /* Skip mod/rm byte. */
17048 add = (rex & REX_B) ? 8 : 0;
17049 if (bytemode == b_mode)
17053 oappend (names8rex[modrm.rm + add]);
17055 oappend (names8[modrm.rm + add]);
17061 oappend (names64[modrm.rm + add]);
17062 else if ((prefixes & PREFIX_DATA))
17063 oappend (names16[modrm.rm + add]);
17065 oappend (names32[modrm.rm + add]);
17069 OP_E (bytemode, sizeflag);
17073 FXSAVE_Fixup (int bytemode, int sizeflag)
17075 /* Add proper suffix to "fxsave" and "fxrstor". */
17079 char *p = mnemonicendp;
17085 OP_M (bytemode, sizeflag);
17089 PCMPESTR_Fixup (int bytemode, int sizeflag)
17091 /* Add proper suffix to "{,v}pcmpestr{i,m}". */
17094 char *p = mnemonicendp;
17099 else if (sizeflag & SUFFIX_ALWAYS)
17106 OP_EX (bytemode, sizeflag);
17109 /* Display the destination register operand for instructions with
17113 OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
17116 const char **names;
17124 reg = vex.register_specifier;
17125 if (address_mode != mode_64bit)
17127 else if (vex.evex && !vex.v)
17130 if (bytemode == vex_scalar_mode)
17132 oappend (names_xmm[reg]);
17136 switch (vex.length)
17143 case vex_vsib_q_w_dq_mode:
17144 case vex_vsib_q_w_d_mode:
17160 names = names_mask;
17174 case vex_vsib_q_w_dq_mode:
17175 case vex_vsib_q_w_d_mode:
17176 names = vex.w ? names_ymm : names_xmm;
17185 names = names_mask;
17188 /* See PR binutils/20893 for a reproducer. */
17200 oappend (names[reg]);
17203 /* Get the VEX immediate byte without moving codep. */
17205 static unsigned char
17206 get_vex_imm8 (int sizeflag, int opnum)
17208 int bytes_before_imm = 0;
17210 if (modrm.mod != 3)
17212 /* There are SIB/displacement bytes. */
17213 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
17215 /* 32/64 bit address mode */
17216 int base = modrm.rm;
17218 /* Check SIB byte. */
17221 FETCH_DATA (the_info, codep + 1);
17223 /* When decoding the third source, don't increase
17224 bytes_before_imm as this has already been incremented
17225 by one in OP_E_memory while decoding the second
17228 bytes_before_imm++;
17231 /* Don't increase bytes_before_imm when decoding the third source,
17232 it has already been incremented by OP_E_memory while decoding
17233 the second source operand. */
17239 /* When modrm.rm == 5 or modrm.rm == 4 and base in
17240 SIB == 5, there is a 4 byte displacement. */
17242 /* No displacement. */
17244 /* Fall through. */
17246 /* 4 byte displacement. */
17247 bytes_before_imm += 4;
17250 /* 1 byte displacement. */
17251 bytes_before_imm++;
17258 /* 16 bit address mode */
17259 /* Don't increase bytes_before_imm when decoding the third source,
17260 it has already been incremented by OP_E_memory while decoding
17261 the second source operand. */
17267 /* When modrm.rm == 6, there is a 2 byte displacement. */
17269 /* No displacement. */
17271 /* Fall through. */
17273 /* 2 byte displacement. */
17274 bytes_before_imm += 2;
17277 /* 1 byte displacement: when decoding the third source,
17278 don't increase bytes_before_imm as this has already
17279 been incremented by one in OP_E_memory while decoding
17280 the second source operand. */
17282 bytes_before_imm++;
17290 FETCH_DATA (the_info, codep + bytes_before_imm + 1);
17291 return codep [bytes_before_imm];
17295 OP_EX_VexReg (int bytemode, int sizeflag, int reg)
17297 const char **names;
17299 if (reg == -1 && modrm.mod != 3)
17301 OP_E_memory (bytemode, sizeflag);
17313 if (address_mode != mode_64bit)
17317 switch (vex.length)
17328 oappend (names[reg]);
17332 OP_EX_VexImmW (int bytemode, int sizeflag)
17335 static unsigned char vex_imm8;
17337 if (vex_w_done == 0)
17341 /* Skip mod/rm byte. */
17345 vex_imm8 = get_vex_imm8 (sizeflag, 0);
17348 reg = vex_imm8 >> 4;
17350 OP_EX_VexReg (bytemode, sizeflag, reg);
17352 else if (vex_w_done == 1)
17357 reg = vex_imm8 >> 4;
17359 OP_EX_VexReg (bytemode, sizeflag, reg);
17363 /* Output the imm8 directly. */
17364 scratchbuf[0] = '$';
17365 print_operand_value (scratchbuf + 1, 1, vex_imm8 & 0xf);
17366 oappend_maybe_intel (scratchbuf);
17367 scratchbuf[0] = '\0';
17373 OP_Vex_2src (int bytemode, int sizeflag)
17375 if (modrm.mod == 3)
17377 int reg = modrm.rm;
17381 oappend (names_xmm[reg]);
17386 && (bytemode == v_mode || bytemode == v_swap_mode))
17388 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
17389 used_prefixes |= (prefixes & PREFIX_DATA);
17391 OP_E (bytemode, sizeflag);
17396 OP_Vex_2src_1 (int bytemode, int sizeflag)
17398 if (modrm.mod == 3)
17400 /* Skip mod/rm byte. */
17407 unsigned int reg = vex.register_specifier;
17409 if (address_mode != mode_64bit)
17411 oappend (names_xmm[reg]);
17414 OP_Vex_2src (bytemode, sizeflag);
17418 OP_Vex_2src_2 (int bytemode, int sizeflag)
17421 OP_Vex_2src (bytemode, sizeflag);
17424 unsigned int reg = vex.register_specifier;
17426 if (address_mode != mode_64bit)
17428 oappend (names_xmm[reg]);
17433 OP_EX_VexW (int bytemode, int sizeflag)
17439 /* Skip mod/rm byte. */
17444 reg = get_vex_imm8 (sizeflag, 0) >> 4;
17449 reg = get_vex_imm8 (sizeflag, 1) >> 4;
17452 OP_EX_VexReg (bytemode, sizeflag, reg);
17460 OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
17463 const char **names;
17465 FETCH_DATA (the_info, codep + 1);
17468 if (bytemode != x_mode)
17472 if (address_mode != mode_64bit)
17475 switch (vex.length)
17486 oappend (names[reg]);
17490 OP_XMM_VexW (int bytemode, int sizeflag)
17492 /* Turn off the REX.W bit since it is used for swapping operands
17495 OP_XMM (bytemode, sizeflag);
17499 OP_EX_Vex (int bytemode, int sizeflag)
17501 if (modrm.mod != 3)
17503 if (vex.register_specifier != 0)
17507 OP_EX (bytemode, sizeflag);
17511 OP_XMM_Vex (int bytemode, int sizeflag)
17513 if (modrm.mod != 3)
17515 if (vex.register_specifier != 0)
17519 OP_XMM (bytemode, sizeflag);
17523 VZERO_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
17525 switch (vex.length)
17528 mnemonicendp = stpcpy (obuf, "vzeroupper");
17531 mnemonicendp = stpcpy (obuf, "vzeroall");
17538 static struct op vex_cmp_op[] =
17540 { STRING_COMMA_LEN ("eq") },
17541 { STRING_COMMA_LEN ("lt") },
17542 { STRING_COMMA_LEN ("le") },
17543 { STRING_COMMA_LEN ("unord") },
17544 { STRING_COMMA_LEN ("neq") },
17545 { STRING_COMMA_LEN ("nlt") },
17546 { STRING_COMMA_LEN ("nle") },
17547 { STRING_COMMA_LEN ("ord") },
17548 { STRING_COMMA_LEN ("eq_uq") },
17549 { STRING_COMMA_LEN ("nge") },
17550 { STRING_COMMA_LEN ("ngt") },
17551 { STRING_COMMA_LEN ("false") },
17552 { STRING_COMMA_LEN ("neq_oq") },
17553 { STRING_COMMA_LEN ("ge") },
17554 { STRING_COMMA_LEN ("gt") },
17555 { STRING_COMMA_LEN ("true") },
17556 { STRING_COMMA_LEN ("eq_os") },
17557 { STRING_COMMA_LEN ("lt_oq") },
17558 { STRING_COMMA_LEN ("le_oq") },
17559 { STRING_COMMA_LEN ("unord_s") },
17560 { STRING_COMMA_LEN ("neq_us") },
17561 { STRING_COMMA_LEN ("nlt_uq") },
17562 { STRING_COMMA_LEN ("nle_uq") },
17563 { STRING_COMMA_LEN ("ord_s") },
17564 { STRING_COMMA_LEN ("eq_us") },
17565 { STRING_COMMA_LEN ("nge_uq") },
17566 { STRING_COMMA_LEN ("ngt_uq") },
17567 { STRING_COMMA_LEN ("false_os") },
17568 { STRING_COMMA_LEN ("neq_os") },
17569 { STRING_COMMA_LEN ("ge_oq") },
17570 { STRING_COMMA_LEN ("gt_oq") },
17571 { STRING_COMMA_LEN ("true_us") },
17575 VCMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
17577 unsigned int cmp_type;
17579 FETCH_DATA (the_info, codep + 1);
17580 cmp_type = *codep++ & 0xff;
17581 if (cmp_type < ARRAY_SIZE (vex_cmp_op))
17584 char *p = mnemonicendp - 2;
17588 sprintf (p, "%s%s", vex_cmp_op[cmp_type].name, suffix);
17589 mnemonicendp += vex_cmp_op[cmp_type].len;
17593 /* We have a reserved extension byte. Output it directly. */
17594 scratchbuf[0] = '$';
17595 print_operand_value (scratchbuf + 1, 1, cmp_type);
17596 oappend_maybe_intel (scratchbuf);
17597 scratchbuf[0] = '\0';
17602 VPCMP_Fixup (int bytemode ATTRIBUTE_UNUSED,
17603 int sizeflag ATTRIBUTE_UNUSED)
17605 unsigned int cmp_type;
17610 FETCH_DATA (the_info, codep + 1);
17611 cmp_type = *codep++ & 0xff;
17612 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
17613 If it's the case, print suffix, otherwise - print the immediate. */
17614 if (cmp_type < ARRAY_SIZE (simd_cmp_op)
17619 char *p = mnemonicendp - 2;
17621 /* vpcmp* can have both one- and two-lettered suffix. */
17635 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
17636 mnemonicendp += simd_cmp_op[cmp_type].len;
17640 /* We have a reserved extension byte. Output it directly. */
17641 scratchbuf[0] = '$';
17642 print_operand_value (scratchbuf + 1, 1, cmp_type);
17643 oappend_maybe_intel (scratchbuf);
17644 scratchbuf[0] = '\0';
17648 static const struct op xop_cmp_op[] =
17650 { STRING_COMMA_LEN ("lt") },
17651 { STRING_COMMA_LEN ("le") },
17652 { STRING_COMMA_LEN ("gt") },
17653 { STRING_COMMA_LEN ("ge") },
17654 { STRING_COMMA_LEN ("eq") },
17655 { STRING_COMMA_LEN ("neq") },
17656 { STRING_COMMA_LEN ("false") },
17657 { STRING_COMMA_LEN ("true") }
17661 VPCOM_Fixup (int bytemode ATTRIBUTE_UNUSED,
17662 int sizeflag ATTRIBUTE_UNUSED)
17664 unsigned int cmp_type;
17666 FETCH_DATA (the_info, codep + 1);
17667 cmp_type = *codep++ & 0xff;
17668 if (cmp_type < ARRAY_SIZE (xop_cmp_op))
17671 char *p = mnemonicendp - 2;
17673 /* vpcom* can have both one- and two-lettered suffix. */
17687 sprintf (p, "%s%s", xop_cmp_op[cmp_type].name, suffix);
17688 mnemonicendp += xop_cmp_op[cmp_type].len;
17692 /* We have a reserved extension byte. Output it directly. */
17693 scratchbuf[0] = '$';
17694 print_operand_value (scratchbuf + 1, 1, cmp_type);
17695 oappend_maybe_intel (scratchbuf);
17696 scratchbuf[0] = '\0';
17700 static const struct op pclmul_op[] =
17702 { STRING_COMMA_LEN ("lql") },
17703 { STRING_COMMA_LEN ("hql") },
17704 { STRING_COMMA_LEN ("lqh") },
17705 { STRING_COMMA_LEN ("hqh") }
17709 PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
17710 int sizeflag ATTRIBUTE_UNUSED)
17712 unsigned int pclmul_type;
17714 FETCH_DATA (the_info, codep + 1);
17715 pclmul_type = *codep++ & 0xff;
17716 switch (pclmul_type)
17727 if (pclmul_type < ARRAY_SIZE (pclmul_op))
17730 char *p = mnemonicendp - 3;
17735 sprintf (p, "%s%s", pclmul_op[pclmul_type].name, suffix);
17736 mnemonicendp += pclmul_op[pclmul_type].len;
17740 /* We have a reserved extension byte. Output it directly. */
17741 scratchbuf[0] = '$';
17742 print_operand_value (scratchbuf + 1, 1, pclmul_type);
17743 oappend_maybe_intel (scratchbuf);
17744 scratchbuf[0] = '\0';
17749 MOVBE_Fixup (int bytemode, int sizeflag)
17751 /* Add proper suffix to "movbe". */
17752 char *p = mnemonicendp;
17761 if (sizeflag & SUFFIX_ALWAYS)
17767 if (sizeflag & DFLAG)
17771 used_prefixes |= (prefixes & PREFIX_DATA);
17776 oappend (INTERNAL_DISASSEMBLER_ERROR);
17783 OP_M (bytemode, sizeflag);
17787 OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
17790 const char **names;
17792 /* Skip mod/rm byte. */
17806 oappend (names[reg]);
17810 OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
17812 const char **names;
17813 unsigned int reg = vex.register_specifier;
17820 if (address_mode != mode_64bit)
17822 oappend (names[reg]);
17826 OP_Mask (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
17829 || (bytemode != mask_mode && bytemode != mask_bd_mode))
17833 if ((rex & REX_R) != 0 || !vex.r)
17839 oappend (names_mask [modrm.reg]);
17843 OP_Rounding (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
17846 || (bytemode != evex_rounding_mode
17847 && bytemode != evex_sae_mode))
17849 if (modrm.mod == 3 && vex.b)
17852 case evex_rounding_mode:
17853 oappend (names_rounding[vex.ll]);
17855 case evex_sae_mode: