1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2017 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. */
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 VEXI4_Fixup (int, int);
99 static void VZERO_Fixup (int, int);
100 static void VCMP_Fixup (int, int);
101 static void VPCMP_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 HLE_Fixup1 (int, int);
114 static void HLE_Fixup2 (int, int);
115 static void HLE_Fixup3 (int, int);
116 static void CMPXCHG8B_Fixup (int, int);
117 static void XMM_Fixup (int, int);
118 static void CRC32_Fixup (int, int);
119 static void FXSAVE_Fixup (int, int);
120 static void PCMPESTR_Fixup (int, int);
121 static void OP_LWPCB_E (int, int);
122 static void OP_LWP_E (int, int);
123 static void OP_Vex_2src_1 (int, int);
124 static void OP_Vex_2src_2 (int, int);
126 static void MOVBE_Fixup (int, int);
128 static void OP_Mask (int, int);
131 /* Points to first byte not fetched. */
132 bfd_byte *max_fetched;
133 bfd_byte the_buffer[MAX_MNEM_SIZE];
136 OPCODES_SIGJMP_BUF bailout;
146 enum address_mode address_mode;
148 /* Flags for the prefixes for the current instruction. See below. */
151 /* REX prefix the current instruction. See below. */
153 /* Bits of REX we've already used. */
155 /* REX bits in original REX prefix ignored. */
156 static int rex_ignored;
157 /* Mark parts used in the REX prefix. When we are testing for
158 empty prefix (for 8bit register REX extension), just mask it
159 out. Otherwise test for REX bit is excuse for existence of REX
160 only in case value is nonzero. */
161 #define USED_REX(value) \
166 rex_used |= (value) | REX_OPCODE; \
169 rex_used |= REX_OPCODE; \
172 /* Flags for prefixes which we somehow handled when printing the
173 current instruction. */
174 static int used_prefixes;
176 /* Flags stored in PREFIXES. */
177 #define PREFIX_REPZ 1
178 #define PREFIX_REPNZ 2
179 #define PREFIX_LOCK 4
181 #define PREFIX_SS 0x10
182 #define PREFIX_DS 0x20
183 #define PREFIX_ES 0x40
184 #define PREFIX_FS 0x80
185 #define PREFIX_GS 0x100
186 #define PREFIX_DATA 0x200
187 #define PREFIX_ADDR 0x400
188 #define PREFIX_FWAIT 0x800
190 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
191 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
193 #define FETCH_DATA(info, addr) \
194 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
195 ? 1 : fetch_data ((info), (addr)))
198 fetch_data (struct disassemble_info *info, bfd_byte *addr)
201 struct dis_private *priv = (struct dis_private *) info->private_data;
202 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
204 if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
205 status = (*info->read_memory_func) (start,
207 addr - priv->max_fetched,
213 /* If we did manage to read at least one byte, then
214 print_insn_i386 will do something sensible. Otherwise, print
215 an error. We do that here because this is where we know
217 if (priv->max_fetched == priv->the_buffer)
218 (*info->memory_error_func) (status, start, info);
219 OPCODES_SIGLONGJMP (priv->bailout, 1);
222 priv->max_fetched = addr;
226 /* Possible values for prefix requirement. */
227 #define PREFIX_IGNORED_SHIFT 16
228 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
229 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
230 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
231 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
232 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
234 /* Opcode prefixes. */
235 #define PREFIX_OPCODE (PREFIX_REPZ \
239 /* Prefixes ignored. */
240 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
241 | PREFIX_IGNORED_REPNZ \
242 | PREFIX_IGNORED_DATA)
244 #define XX { NULL, 0 }
245 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
247 #define Eb { OP_E, b_mode }
248 #define Ebnd { OP_E, bnd_mode }
249 #define EbS { OP_E, b_swap_mode }
250 #define Ev { OP_E, v_mode }
251 #define Ev_bnd { OP_E, v_bnd_mode }
252 #define EvS { OP_E, v_swap_mode }
253 #define Ed { OP_E, d_mode }
254 #define Edq { OP_E, dq_mode }
255 #define Edqw { OP_E, dqw_mode }
256 #define Edqb { OP_E, dqb_mode }
257 #define Edb { OP_E, db_mode }
258 #define Edw { OP_E, dw_mode }
259 #define Edqd { OP_E, dqd_mode }
260 #define Eq { OP_E, q_mode }
261 #define indirEv { OP_indirE, indir_v_mode }
262 #define indirEp { OP_indirE, f_mode }
263 #define stackEv { OP_E, stack_v_mode }
264 #define Em { OP_E, m_mode }
265 #define Ew { OP_E, w_mode }
266 #define M { OP_M, 0 } /* lea, lgdt, etc. */
267 #define Ma { OP_M, a_mode }
268 #define Mb { OP_M, b_mode }
269 #define Md { OP_M, d_mode }
270 #define Mo { OP_M, o_mode }
271 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
272 #define Mq { OP_M, q_mode }
273 #define Mx { OP_M, x_mode }
274 #define Mxmm { OP_M, xmm_mode }
275 #define Gb { OP_G, b_mode }
276 #define Gbnd { OP_G, bnd_mode }
277 #define Gv { OP_G, v_mode }
278 #define Gd { OP_G, d_mode }
279 #define Gdq { OP_G, dq_mode }
280 #define Gm { OP_G, m_mode }
281 #define Gw { OP_G, w_mode }
282 #define Rd { OP_R, d_mode }
283 #define Rdq { OP_R, dq_mode }
284 #define Rm { OP_R, m_mode }
285 #define Ib { OP_I, b_mode }
286 #define sIb { OP_sI, b_mode } /* sign extened byte */
287 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
288 #define Iv { OP_I, v_mode }
289 #define sIv { OP_sI, v_mode }
290 #define Iq { OP_I, q_mode }
291 #define Iv64 { OP_I64, v_mode }
292 #define Iw { OP_I, w_mode }
293 #define I1 { OP_I, const_1_mode }
294 #define Jb { OP_J, b_mode }
295 #define Jv { OP_J, v_mode }
296 #define Cm { OP_C, m_mode }
297 #define Dm { OP_D, m_mode }
298 #define Td { OP_T, d_mode }
299 #define Skip_MODRM { OP_Skip_MODRM, 0 }
301 #define RMeAX { OP_REG, eAX_reg }
302 #define RMeBX { OP_REG, eBX_reg }
303 #define RMeCX { OP_REG, eCX_reg }
304 #define RMeDX { OP_REG, eDX_reg }
305 #define RMeSP { OP_REG, eSP_reg }
306 #define RMeBP { OP_REG, eBP_reg }
307 #define RMeSI { OP_REG, eSI_reg }
308 #define RMeDI { OP_REG, eDI_reg }
309 #define RMrAX { OP_REG, rAX_reg }
310 #define RMrBX { OP_REG, rBX_reg }
311 #define RMrCX { OP_REG, rCX_reg }
312 #define RMrDX { OP_REG, rDX_reg }
313 #define RMrSP { OP_REG, rSP_reg }
314 #define RMrBP { OP_REG, rBP_reg }
315 #define RMrSI { OP_REG, rSI_reg }
316 #define RMrDI { OP_REG, rDI_reg }
317 #define RMAL { OP_REG, al_reg }
318 #define RMCL { OP_REG, cl_reg }
319 #define RMDL { OP_REG, dl_reg }
320 #define RMBL { OP_REG, bl_reg }
321 #define RMAH { OP_REG, ah_reg }
322 #define RMCH { OP_REG, ch_reg }
323 #define RMDH { OP_REG, dh_reg }
324 #define RMBH { OP_REG, bh_reg }
325 #define RMAX { OP_REG, ax_reg }
326 #define RMDX { OP_REG, dx_reg }
328 #define eAX { OP_IMREG, eAX_reg }
329 #define eBX { OP_IMREG, eBX_reg }
330 #define eCX { OP_IMREG, eCX_reg }
331 #define eDX { OP_IMREG, eDX_reg }
332 #define eSP { OP_IMREG, eSP_reg }
333 #define eBP { OP_IMREG, eBP_reg }
334 #define eSI { OP_IMREG, eSI_reg }
335 #define eDI { OP_IMREG, eDI_reg }
336 #define AL { OP_IMREG, al_reg }
337 #define CL { OP_IMREG, cl_reg }
338 #define DL { OP_IMREG, dl_reg }
339 #define BL { OP_IMREG, bl_reg }
340 #define AH { OP_IMREG, ah_reg }
341 #define CH { OP_IMREG, ch_reg }
342 #define DH { OP_IMREG, dh_reg }
343 #define BH { OP_IMREG, bh_reg }
344 #define AX { OP_IMREG, ax_reg }
345 #define DX { OP_IMREG, dx_reg }
346 #define zAX { OP_IMREG, z_mode_ax_reg }
347 #define indirDX { OP_IMREG, indir_dx_reg }
349 #define Sw { OP_SEG, w_mode }
350 #define Sv { OP_SEG, v_mode }
351 #define Ap { OP_DIR, 0 }
352 #define Ob { OP_OFF64, b_mode }
353 #define Ov { OP_OFF64, v_mode }
354 #define Xb { OP_DSreg, eSI_reg }
355 #define Xv { OP_DSreg, eSI_reg }
356 #define Xz { OP_DSreg, eSI_reg }
357 #define Yb { OP_ESreg, eDI_reg }
358 #define Yv { OP_ESreg, eDI_reg }
359 #define DSBX { OP_DSreg, eBX_reg }
361 #define es { OP_REG, es_reg }
362 #define ss { OP_REG, ss_reg }
363 #define cs { OP_REG, cs_reg }
364 #define ds { OP_REG, ds_reg }
365 #define fs { OP_REG, fs_reg }
366 #define gs { OP_REG, gs_reg }
368 #define MX { OP_MMX, 0 }
369 #define XM { OP_XMM, 0 }
370 #define XMScalar { OP_XMM, scalar_mode }
371 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
372 #define XMM { OP_XMM, xmm_mode }
373 #define XMxmmq { OP_XMM, xmmq_mode }
374 #define EM { OP_EM, v_mode }
375 #define EMS { OP_EM, v_swap_mode }
376 #define EMd { OP_EM, d_mode }
377 #define EMx { OP_EM, x_mode }
378 #define EXw { OP_EX, w_mode }
379 #define EXd { OP_EX, d_mode }
380 #define EXdScalar { OP_EX, d_scalar_mode }
381 #define EXdS { OP_EX, d_swap_mode }
382 #define EXdScalarS { OP_EX, d_scalar_swap_mode }
383 #define EXq { OP_EX, q_mode }
384 #define EXqScalar { OP_EX, q_scalar_mode }
385 #define EXqScalarS { OP_EX, q_scalar_swap_mode }
386 #define EXqS { OP_EX, q_swap_mode }
387 #define EXx { OP_EX, x_mode }
388 #define EXxS { OP_EX, x_swap_mode }
389 #define EXxmm { OP_EX, xmm_mode }
390 #define EXymm { OP_EX, ymm_mode }
391 #define EXxmmq { OP_EX, xmmq_mode }
392 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
393 #define EXxmm_mb { OP_EX, xmm_mb_mode }
394 #define EXxmm_mw { OP_EX, xmm_mw_mode }
395 #define EXxmm_md { OP_EX, xmm_md_mode }
396 #define EXxmm_mq { OP_EX, xmm_mq_mode }
397 #define EXxmm_mdq { OP_EX, xmm_mdq_mode }
398 #define EXxmmdw { OP_EX, xmmdw_mode }
399 #define EXxmmqd { OP_EX, xmmqd_mode }
400 #define EXymmq { OP_EX, ymmq_mode }
401 #define EXVexWdq { OP_EX, vex_w_dq_mode }
402 #define EXVexWdqScalar { OP_EX, vex_scalar_w_dq_mode }
403 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
404 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
405 #define MS { OP_MS, v_mode }
406 #define XS { OP_XS, v_mode }
407 #define EMCq { OP_EMC, q_mode }
408 #define MXC { OP_MXC, 0 }
409 #define OPSUF { OP_3DNowSuffix, 0 }
410 #define CMP { CMP_Fixup, 0 }
411 #define XMM0 { XMM_Fixup, 0 }
412 #define FXSAVE { FXSAVE_Fixup, 0 }
413 #define Vex_2src_1 { OP_Vex_2src_1, 0 }
414 #define Vex_2src_2 { OP_Vex_2src_2, 0 }
416 #define Vex { OP_VEX, vex_mode }
417 #define VexScalar { OP_VEX, vex_scalar_mode }
418 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
419 #define Vex128 { OP_VEX, vex128_mode }
420 #define Vex256 { OP_VEX, vex256_mode }
421 #define VexGdq { OP_VEX, dq_mode }
422 #define VexI4 { VEXI4_Fixup, 0}
423 #define EXdVex { OP_EX_Vex, d_mode }
424 #define EXdVexS { OP_EX_Vex, d_swap_mode }
425 #define EXdVexScalarS { OP_EX_Vex, d_scalar_swap_mode }
426 #define EXqVex { OP_EX_Vex, q_mode }
427 #define EXqVexS { OP_EX_Vex, q_swap_mode }
428 #define EXqVexScalarS { OP_EX_Vex, q_scalar_swap_mode }
429 #define EXVexW { OP_EX_VexW, x_mode }
430 #define EXdVexW { OP_EX_VexW, d_mode }
431 #define EXqVexW { OP_EX_VexW, q_mode }
432 #define EXVexImmW { OP_EX_VexImmW, x_mode }
433 #define XMVex { OP_XMM_Vex, 0 }
434 #define XMVexScalar { OP_XMM_Vex, scalar_mode }
435 #define XMVexW { OP_XMM_VexW, 0 }
436 #define XMVexI4 { OP_REG_VexI4, x_mode }
437 #define PCLMUL { PCLMUL_Fixup, 0 }
438 #define VZERO { VZERO_Fixup, 0 }
439 #define VCMP { VCMP_Fixup, 0 }
440 #define VPCMP { VPCMP_Fixup, 0 }
442 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
443 #define EXxEVexS { OP_Rounding, evex_sae_mode }
445 #define XMask { OP_Mask, mask_mode }
446 #define MaskG { OP_G, mask_mode }
447 #define MaskE { OP_E, mask_mode }
448 #define MaskBDE { OP_E, mask_bd_mode }
449 #define MaskR { OP_R, mask_mode }
450 #define MaskVex { OP_VEX, mask_mode }
452 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
453 #define MVexVSIBDQWpX { OP_M, vex_vsib_d_w_d_mode }
454 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
455 #define MVexVSIBQDWpX { OP_M, vex_vsib_q_w_d_mode }
457 /* Used handle "rep" prefix for string instructions. */
458 #define Xbr { REP_Fixup, eSI_reg }
459 #define Xvr { REP_Fixup, eSI_reg }
460 #define Ybr { REP_Fixup, eDI_reg }
461 #define Yvr { REP_Fixup, eDI_reg }
462 #define Yzr { REP_Fixup, eDI_reg }
463 #define indirDXr { REP_Fixup, indir_dx_reg }
464 #define ALr { REP_Fixup, al_reg }
465 #define eAXr { REP_Fixup, eAX_reg }
467 /* Used handle HLE prefix for lockable instructions. */
468 #define Ebh1 { HLE_Fixup1, b_mode }
469 #define Evh1 { HLE_Fixup1, v_mode }
470 #define Ebh2 { HLE_Fixup2, b_mode }
471 #define Evh2 { HLE_Fixup2, v_mode }
472 #define Ebh3 { HLE_Fixup3, b_mode }
473 #define Evh3 { HLE_Fixup3, v_mode }
475 #define BND { BND_Fixup, 0 }
477 #define cond_jump_flag { NULL, cond_jump_mode }
478 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
480 /* bits in sizeflag */
481 #define SUFFIX_ALWAYS 4
489 /* byte operand with operand swapped */
491 /* byte operand, sign extend like 'T' suffix */
493 /* operand size depends on prefixes */
495 /* operand size depends on prefixes with operand swapped */
499 /* double word operand */
501 /* double word operand with operand swapped */
503 /* quad word operand */
505 /* quad word operand with operand swapped */
507 /* ten-byte operand */
509 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
510 broadcast enabled. */
512 /* Similar to x_mode, but with different EVEX mem shifts. */
514 /* Similar to x_mode, but with disabled broadcast. */
516 /* Similar to x_mode, but with operands swapped and disabled broadcast
519 /* 16-byte XMM operand */
521 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
522 memory operand (depending on vector length). Broadcast isn't
525 /* Same as xmmq_mode, but broadcast is allowed. */
526 evex_half_bcst_xmmq_mode,
527 /* XMM register or byte memory operand */
529 /* XMM register or word memory operand */
531 /* XMM register or double word memory operand */
533 /* XMM register or quad word memory operand */
535 /* XMM register or double/quad word memory operand, depending on
538 /* 16-byte XMM, word, double word or quad word operand. */
540 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
542 /* 32-byte YMM operand */
544 /* quad word, ymmword or zmmword memory operand. */
546 /* 32-byte YMM or 16-byte word operand */
548 /* d_mode in 32bit, q_mode in 64bit mode. */
550 /* pair of v_mode operands */
555 /* operand size depends on REX prefixes. */
557 /* registers like dq_mode, memory like w_mode. */
560 /* 4- or 6-byte pointer operand */
563 /* v_mode for indirect branch opcodes. */
565 /* v_mode for stack-related opcodes. */
567 /* non-quad operand size depends on prefixes */
569 /* 16-byte operand */
571 /* registers like dq_mode, memory like b_mode. */
573 /* registers like d_mode, memory like b_mode. */
575 /* registers like d_mode, memory like w_mode. */
577 /* registers like dq_mode, memory like d_mode. */
579 /* normal vex mode */
581 /* 128bit vex mode */
583 /* 256bit vex mode */
585 /* operand size depends on the VEX.W bit. */
588 /* Similar to vex_w_dq_mode, with VSIB dword indices. */
589 vex_vsib_d_w_dq_mode,
590 /* Similar to vex_vsib_d_w_dq_mode, with smaller memory. */
592 /* Similar to vex_w_dq_mode, with VSIB qword indices. */
593 vex_vsib_q_w_dq_mode,
594 /* Similar to vex_vsib_q_w_dq_mode, with smaller memory. */
597 /* scalar, ignore vector length. */
599 /* like d_mode, ignore vector length. */
601 /* like d_swap_mode, ignore vector length. */
603 /* like q_mode, ignore vector length. */
605 /* like q_swap_mode, ignore vector length. */
607 /* like vex_mode, ignore vector length. */
609 /* like vex_w_dq_mode, ignore vector length. */
610 vex_scalar_w_dq_mode,
612 /* Static rounding. */
614 /* Supress all exceptions. */
617 /* Mask register operand. */
619 /* Mask register operand. */
686 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
688 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
689 #define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
690 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
691 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
692 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
693 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
694 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
695 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
696 #define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
697 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
698 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
699 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
700 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
701 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
702 #define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
824 MOD_VEX_0F12_PREFIX_0,
826 MOD_VEX_0F16_PREFIX_0,
829 MOD_VEX_W_0_0F41_P_0_LEN_1,
830 MOD_VEX_W_1_0F41_P_0_LEN_1,
831 MOD_VEX_W_0_0F41_P_2_LEN_1,
832 MOD_VEX_W_1_0F41_P_2_LEN_1,
833 MOD_VEX_W_0_0F42_P_0_LEN_1,
834 MOD_VEX_W_1_0F42_P_0_LEN_1,
835 MOD_VEX_W_0_0F42_P_2_LEN_1,
836 MOD_VEX_W_1_0F42_P_2_LEN_1,
837 MOD_VEX_W_0_0F44_P_0_LEN_1,
838 MOD_VEX_W_1_0F44_P_0_LEN_1,
839 MOD_VEX_W_0_0F44_P_2_LEN_1,
840 MOD_VEX_W_1_0F44_P_2_LEN_1,
841 MOD_VEX_W_0_0F45_P_0_LEN_1,
842 MOD_VEX_W_1_0F45_P_0_LEN_1,
843 MOD_VEX_W_0_0F45_P_2_LEN_1,
844 MOD_VEX_W_1_0F45_P_2_LEN_1,
845 MOD_VEX_W_0_0F46_P_0_LEN_1,
846 MOD_VEX_W_1_0F46_P_0_LEN_1,
847 MOD_VEX_W_0_0F46_P_2_LEN_1,
848 MOD_VEX_W_1_0F46_P_2_LEN_1,
849 MOD_VEX_W_0_0F47_P_0_LEN_1,
850 MOD_VEX_W_1_0F47_P_0_LEN_1,
851 MOD_VEX_W_0_0F47_P_2_LEN_1,
852 MOD_VEX_W_1_0F47_P_2_LEN_1,
853 MOD_VEX_W_0_0F4A_P_0_LEN_1,
854 MOD_VEX_W_1_0F4A_P_0_LEN_1,
855 MOD_VEX_W_0_0F4A_P_2_LEN_1,
856 MOD_VEX_W_1_0F4A_P_2_LEN_1,
857 MOD_VEX_W_0_0F4B_P_0_LEN_1,
858 MOD_VEX_W_1_0F4B_P_0_LEN_1,
859 MOD_VEX_W_0_0F4B_P_2_LEN_1,
871 MOD_VEX_W_0_0F91_P_0_LEN_0,
872 MOD_VEX_W_1_0F91_P_0_LEN_0,
873 MOD_VEX_W_0_0F91_P_2_LEN_0,
874 MOD_VEX_W_1_0F91_P_2_LEN_0,
875 MOD_VEX_W_0_0F92_P_0_LEN_0,
876 MOD_VEX_W_0_0F92_P_2_LEN_0,
877 MOD_VEX_W_0_0F92_P_3_LEN_0,
878 MOD_VEX_W_1_0F92_P_3_LEN_0,
879 MOD_VEX_W_0_0F93_P_0_LEN_0,
880 MOD_VEX_W_0_0F93_P_2_LEN_0,
881 MOD_VEX_W_0_0F93_P_3_LEN_0,
882 MOD_VEX_W_1_0F93_P_3_LEN_0,
883 MOD_VEX_W_0_0F98_P_0_LEN_0,
884 MOD_VEX_W_1_0F98_P_0_LEN_0,
885 MOD_VEX_W_0_0F98_P_2_LEN_0,
886 MOD_VEX_W_1_0F98_P_2_LEN_0,
887 MOD_VEX_W_0_0F99_P_0_LEN_0,
888 MOD_VEX_W_1_0F99_P_0_LEN_0,
889 MOD_VEX_W_0_0F99_P_2_LEN_0,
890 MOD_VEX_W_1_0F99_P_2_LEN_0,
893 MOD_VEX_0FD7_PREFIX_2,
894 MOD_VEX_0FE7_PREFIX_2,
895 MOD_VEX_0FF0_PREFIX_3,
896 MOD_VEX_0F381A_PREFIX_2,
897 MOD_VEX_0F382A_PREFIX_2,
898 MOD_VEX_0F382C_PREFIX_2,
899 MOD_VEX_0F382D_PREFIX_2,
900 MOD_VEX_0F382E_PREFIX_2,
901 MOD_VEX_0F382F_PREFIX_2,
902 MOD_VEX_0F385A_PREFIX_2,
903 MOD_VEX_0F388C_PREFIX_2,
904 MOD_VEX_0F388E_PREFIX_2,
905 MOD_VEX_W_0_0F3A30_P_2_LEN_0,
906 MOD_VEX_W_1_0F3A30_P_2_LEN_0,
907 MOD_VEX_W_0_0F3A31_P_2_LEN_0,
908 MOD_VEX_W_1_0F3A31_P_2_LEN_0,
909 MOD_VEX_W_0_0F3A32_P_2_LEN_0,
910 MOD_VEX_W_1_0F3A32_P_2_LEN_0,
911 MOD_VEX_W_0_0F3A33_P_2_LEN_0,
912 MOD_VEX_W_1_0F3A33_P_2_LEN_0,
914 MOD_EVEX_0F10_PREFIX_1,
915 MOD_EVEX_0F10_PREFIX_3,
916 MOD_EVEX_0F11_PREFIX_1,
917 MOD_EVEX_0F11_PREFIX_3,
918 MOD_EVEX_0F12_PREFIX_0,
919 MOD_EVEX_0F16_PREFIX_0,
920 MOD_EVEX_0F38C6_REG_1,
921 MOD_EVEX_0F38C6_REG_2,
922 MOD_EVEX_0F38C6_REG_5,
923 MOD_EVEX_0F38C6_REG_6,
924 MOD_EVEX_0F38C7_REG_1,
925 MOD_EVEX_0F38C7_REG_2,
926 MOD_EVEX_0F38C7_REG_5,
927 MOD_EVEX_0F38C7_REG_6
949 PREFIX_MOD_0_0F01_REG_5,
950 PREFIX_MOD_3_0F01_REG_5_RM_1,
951 PREFIX_MOD_3_0F01_REG_5_RM_2,
995 PREFIX_MOD_0_0FAE_REG_4,
996 PREFIX_MOD_3_0FAE_REG_4,
997 PREFIX_MOD_0_0FAE_REG_5,
1005 PREFIX_MOD_0_0FC7_REG_6,
1006 PREFIX_MOD_3_0FC7_REG_6,
1007 PREFIX_MOD_3_0FC7_REG_7,
1132 PREFIX_VEX_0F71_REG_2,
1133 PREFIX_VEX_0F71_REG_4,
1134 PREFIX_VEX_0F71_REG_6,
1135 PREFIX_VEX_0F72_REG_2,
1136 PREFIX_VEX_0F72_REG_4,
1137 PREFIX_VEX_0F72_REG_6,
1138 PREFIX_VEX_0F73_REG_2,
1139 PREFIX_VEX_0F73_REG_3,
1140 PREFIX_VEX_0F73_REG_6,
1141 PREFIX_VEX_0F73_REG_7,
1313 PREFIX_VEX_0F38F3_REG_1,
1314 PREFIX_VEX_0F38F3_REG_2,
1315 PREFIX_VEX_0F38F3_REG_3,
1432 PREFIX_EVEX_0F71_REG_2,
1433 PREFIX_EVEX_0F71_REG_4,
1434 PREFIX_EVEX_0F71_REG_6,
1435 PREFIX_EVEX_0F72_REG_0,
1436 PREFIX_EVEX_0F72_REG_1,
1437 PREFIX_EVEX_0F72_REG_2,
1438 PREFIX_EVEX_0F72_REG_4,
1439 PREFIX_EVEX_0F72_REG_6,
1440 PREFIX_EVEX_0F73_REG_2,
1441 PREFIX_EVEX_0F73_REG_3,
1442 PREFIX_EVEX_0F73_REG_6,
1443 PREFIX_EVEX_0F73_REG_7,
1629 PREFIX_EVEX_0F38C6_REG_1,
1630 PREFIX_EVEX_0F38C6_REG_2,
1631 PREFIX_EVEX_0F38C6_REG_5,
1632 PREFIX_EVEX_0F38C6_REG_6,
1633 PREFIX_EVEX_0F38C7_REG_1,
1634 PREFIX_EVEX_0F38C7_REG_2,
1635 PREFIX_EVEX_0F38C7_REG_5,
1636 PREFIX_EVEX_0F38C7_REG_6,
1726 THREE_BYTE_0F38 = 0,
1753 VEX_LEN_0F10_P_1 = 0,
1757 VEX_LEN_0F12_P_0_M_0,
1758 VEX_LEN_0F12_P_0_M_1,
1761 VEX_LEN_0F16_P_0_M_0,
1762 VEX_LEN_0F16_P_0_M_1,
1826 VEX_LEN_0FAE_R_2_M_0,
1827 VEX_LEN_0FAE_R_3_M_0,
1836 VEX_LEN_0F381A_P_2_M_0,
1839 VEX_LEN_0F385A_P_2_M_0,
1846 VEX_LEN_0F38F3_R_1_P_0,
1847 VEX_LEN_0F38F3_R_2_P_0,
1848 VEX_LEN_0F38F3_R_3_P_0,
1894 VEX_LEN_0FXOP_08_CC,
1895 VEX_LEN_0FXOP_08_CD,
1896 VEX_LEN_0FXOP_08_CE,
1897 VEX_LEN_0FXOP_08_CF,
1898 VEX_LEN_0FXOP_08_EC,
1899 VEX_LEN_0FXOP_08_ED,
1900 VEX_LEN_0FXOP_08_EE,
1901 VEX_LEN_0FXOP_08_EF,
1902 VEX_LEN_0FXOP_09_80,
1936 VEX_W_0F41_P_0_LEN_1,
1937 VEX_W_0F41_P_2_LEN_1,
1938 VEX_W_0F42_P_0_LEN_1,
1939 VEX_W_0F42_P_2_LEN_1,
1940 VEX_W_0F44_P_0_LEN_0,
1941 VEX_W_0F44_P_2_LEN_0,
1942 VEX_W_0F45_P_0_LEN_1,
1943 VEX_W_0F45_P_2_LEN_1,
1944 VEX_W_0F46_P_0_LEN_1,
1945 VEX_W_0F46_P_2_LEN_1,
1946 VEX_W_0F47_P_0_LEN_1,
1947 VEX_W_0F47_P_2_LEN_1,
1948 VEX_W_0F4A_P_0_LEN_1,
1949 VEX_W_0F4A_P_2_LEN_1,
1950 VEX_W_0F4B_P_0_LEN_1,
1951 VEX_W_0F4B_P_2_LEN_1,
2031 VEX_W_0F90_P_0_LEN_0,
2032 VEX_W_0F90_P_2_LEN_0,
2033 VEX_W_0F91_P_0_LEN_0,
2034 VEX_W_0F91_P_2_LEN_0,
2035 VEX_W_0F92_P_0_LEN_0,
2036 VEX_W_0F92_P_2_LEN_0,
2037 VEX_W_0F92_P_3_LEN_0,
2038 VEX_W_0F93_P_0_LEN_0,
2039 VEX_W_0F93_P_2_LEN_0,
2040 VEX_W_0F93_P_3_LEN_0,
2041 VEX_W_0F98_P_0_LEN_0,
2042 VEX_W_0F98_P_2_LEN_0,
2043 VEX_W_0F99_P_0_LEN_0,
2044 VEX_W_0F99_P_2_LEN_0,
2123 VEX_W_0F381A_P_2_M_0,
2135 VEX_W_0F382A_P_2_M_0,
2137 VEX_W_0F382C_P_2_M_0,
2138 VEX_W_0F382D_P_2_M_0,
2139 VEX_W_0F382E_P_2_M_0,
2140 VEX_W_0F382F_P_2_M_0,
2162 VEX_W_0F385A_P_2_M_0,
2190 VEX_W_0F3A30_P_2_LEN_0,
2191 VEX_W_0F3A31_P_2_LEN_0,
2192 VEX_W_0F3A32_P_2_LEN_0,
2193 VEX_W_0F3A33_P_2_LEN_0,
2211 EVEX_W_0F10_P_1_M_0,
2212 EVEX_W_0F10_P_1_M_1,
2214 EVEX_W_0F10_P_3_M_0,
2215 EVEX_W_0F10_P_3_M_1,
2217 EVEX_W_0F11_P_1_M_0,
2218 EVEX_W_0F11_P_1_M_1,
2220 EVEX_W_0F11_P_3_M_0,
2221 EVEX_W_0F11_P_3_M_1,
2222 EVEX_W_0F12_P_0_M_0,
2223 EVEX_W_0F12_P_0_M_1,
2233 EVEX_W_0F16_P_0_M_0,
2234 EVEX_W_0F16_P_0_M_1,
2305 EVEX_W_0F72_R_2_P_2,
2306 EVEX_W_0F72_R_6_P_2,
2307 EVEX_W_0F73_R_2_P_2,
2308 EVEX_W_0F73_R_6_P_2,
2409 EVEX_W_0F38C7_R_1_P_2,
2410 EVEX_W_0F38C7_R_2_P_2,
2411 EVEX_W_0F38C7_R_5_P_2,
2412 EVEX_W_0F38C7_R_6_P_2,
2447 typedef void (*op_rtn) (int bytemode, int sizeflag);
2456 unsigned int prefix_requirement;
2459 /* Upper case letters in the instruction names here are macros.
2460 'A' => print 'b' if no register operands or suffix_always is true
2461 'B' => print 'b' if suffix_always is true
2462 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
2464 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
2465 suffix_always is true
2466 'E' => print 'e' if 32-bit form of jcxz
2467 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
2468 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
2469 'H' => print ",pt" or ",pn" branch hint
2470 'I' => honor following macro letter even in Intel mode (implemented only
2471 for some of the macro letters)
2473 'K' => print 'd' or 'q' if rex prefix is present.
2474 'L' => print 'l' if suffix_always is true
2475 'M' => print 'r' if intel_mnemonic is false.
2476 'N' => print 'n' if instruction has no wait "prefix"
2477 'O' => print 'd' or 'o' (or 'q' in Intel mode)
2478 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
2479 or suffix_always is true. print 'q' if rex prefix is present.
2480 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
2482 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
2483 'S' => print 'w', 'l' or 'q' if suffix_always is true
2484 'T' => print 'q' in 64bit mode if instruction has no operand size
2485 prefix and behave as 'P' otherwise
2486 'U' => print 'q' in 64bit mode if instruction has no operand size
2487 prefix and behave as 'Q' otherwise
2488 'V' => print 'q' in 64bit mode if instruction has no operand size
2489 prefix and behave as 'S' otherwise
2490 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
2491 'X' => print 's', 'd' depending on data16 prefix (for XMM)
2492 'Y' => 'q' if instruction has an REX 64bit overwrite prefix and
2493 suffix_always is true.
2494 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
2495 '!' => change condition from true to false or from false to true.
2496 '%' => add 1 upper case letter to the macro.
2497 '^' => print 'w' or 'l' depending on operand size prefix or
2498 suffix_always is true (lcall/ljmp).
2499 '@' => print 'q' for Intel64 ISA, 'w' or 'q' for AMD64 ISA depending
2500 on operand size prefix.
2501 '&' => print 'q' in 64bit mode for Intel64 ISA or if instruction
2502 has no operand size prefix for AMD64 ISA, behave as 'P'
2505 2 upper case letter macros:
2506 "XY" => print 'x' or 'y' if suffix_always is true or no register
2507 operands and no broadcast.
2508 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
2509 register operands and no broadcast.
2510 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
2511 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand
2512 or suffix_always is true
2513 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
2514 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
2515 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
2516 "LW" => print 'd', 'q' depending on the VEX.W bit
2517 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
2518 an operand size prefix, or suffix_always is true. print
2519 'q' if rex prefix is present.
2521 Many of the above letters print nothing in Intel mode. See "putop"
2524 Braces '{' and '}', and vertical bars '|', indicate alternative
2525 mnemonic strings for AT&T and Intel. */
2527 static const struct dis386 dis386[] = {
2529 { "addB", { Ebh1, Gb }, 0 },
2530 { "addS", { Evh1, Gv }, 0 },
2531 { "addB", { Gb, EbS }, 0 },
2532 { "addS", { Gv, EvS }, 0 },
2533 { "addB", { AL, Ib }, 0 },
2534 { "addS", { eAX, Iv }, 0 },
2535 { X86_64_TABLE (X86_64_06) },
2536 { X86_64_TABLE (X86_64_07) },
2538 { "orB", { Ebh1, Gb }, 0 },
2539 { "orS", { Evh1, Gv }, 0 },
2540 { "orB", { Gb, EbS }, 0 },
2541 { "orS", { Gv, EvS }, 0 },
2542 { "orB", { AL, Ib }, 0 },
2543 { "orS", { eAX, Iv }, 0 },
2544 { X86_64_TABLE (X86_64_0D) },
2545 { Bad_Opcode }, /* 0x0f extended opcode escape */
2547 { "adcB", { Ebh1, Gb }, 0 },
2548 { "adcS", { Evh1, Gv }, 0 },
2549 { "adcB", { Gb, EbS }, 0 },
2550 { "adcS", { Gv, EvS }, 0 },
2551 { "adcB", { AL, Ib }, 0 },
2552 { "adcS", { eAX, Iv }, 0 },
2553 { X86_64_TABLE (X86_64_16) },
2554 { X86_64_TABLE (X86_64_17) },
2556 { "sbbB", { Ebh1, Gb }, 0 },
2557 { "sbbS", { Evh1, Gv }, 0 },
2558 { "sbbB", { Gb, EbS }, 0 },
2559 { "sbbS", { Gv, EvS }, 0 },
2560 { "sbbB", { AL, Ib }, 0 },
2561 { "sbbS", { eAX, Iv }, 0 },
2562 { X86_64_TABLE (X86_64_1E) },
2563 { X86_64_TABLE (X86_64_1F) },
2565 { "andB", { Ebh1, Gb }, 0 },
2566 { "andS", { Evh1, Gv }, 0 },
2567 { "andB", { Gb, EbS }, 0 },
2568 { "andS", { Gv, EvS }, 0 },
2569 { "andB", { AL, Ib }, 0 },
2570 { "andS", { eAX, Iv }, 0 },
2571 { Bad_Opcode }, /* SEG ES prefix */
2572 { X86_64_TABLE (X86_64_27) },
2574 { "subB", { Ebh1, Gb }, 0 },
2575 { "subS", { Evh1, Gv }, 0 },
2576 { "subB", { Gb, EbS }, 0 },
2577 { "subS", { Gv, EvS }, 0 },
2578 { "subB", { AL, Ib }, 0 },
2579 { "subS", { eAX, Iv }, 0 },
2580 { Bad_Opcode }, /* SEG CS prefix */
2581 { X86_64_TABLE (X86_64_2F) },
2583 { "xorB", { Ebh1, Gb }, 0 },
2584 { "xorS", { Evh1, Gv }, 0 },
2585 { "xorB", { Gb, EbS }, 0 },
2586 { "xorS", { Gv, EvS }, 0 },
2587 { "xorB", { AL, Ib }, 0 },
2588 { "xorS", { eAX, Iv }, 0 },
2589 { Bad_Opcode }, /* SEG SS prefix */
2590 { X86_64_TABLE (X86_64_37) },
2592 { "cmpB", { Eb, Gb }, 0 },
2593 { "cmpS", { Ev, Gv }, 0 },
2594 { "cmpB", { Gb, EbS }, 0 },
2595 { "cmpS", { Gv, EvS }, 0 },
2596 { "cmpB", { AL, Ib }, 0 },
2597 { "cmpS", { eAX, Iv }, 0 },
2598 { Bad_Opcode }, /* SEG DS prefix */
2599 { X86_64_TABLE (X86_64_3F) },
2601 { "inc{S|}", { RMeAX }, 0 },
2602 { "inc{S|}", { RMeCX }, 0 },
2603 { "inc{S|}", { RMeDX }, 0 },
2604 { "inc{S|}", { RMeBX }, 0 },
2605 { "inc{S|}", { RMeSP }, 0 },
2606 { "inc{S|}", { RMeBP }, 0 },
2607 { "inc{S|}", { RMeSI }, 0 },
2608 { "inc{S|}", { RMeDI }, 0 },
2610 { "dec{S|}", { RMeAX }, 0 },
2611 { "dec{S|}", { RMeCX }, 0 },
2612 { "dec{S|}", { RMeDX }, 0 },
2613 { "dec{S|}", { RMeBX }, 0 },
2614 { "dec{S|}", { RMeSP }, 0 },
2615 { "dec{S|}", { RMeBP }, 0 },
2616 { "dec{S|}", { RMeSI }, 0 },
2617 { "dec{S|}", { RMeDI }, 0 },
2619 { "pushV", { RMrAX }, 0 },
2620 { "pushV", { RMrCX }, 0 },
2621 { "pushV", { RMrDX }, 0 },
2622 { "pushV", { RMrBX }, 0 },
2623 { "pushV", { RMrSP }, 0 },
2624 { "pushV", { RMrBP }, 0 },
2625 { "pushV", { RMrSI }, 0 },
2626 { "pushV", { RMrDI }, 0 },
2628 { "popV", { RMrAX }, 0 },
2629 { "popV", { RMrCX }, 0 },
2630 { "popV", { RMrDX }, 0 },
2631 { "popV", { RMrBX }, 0 },
2632 { "popV", { RMrSP }, 0 },
2633 { "popV", { RMrBP }, 0 },
2634 { "popV", { RMrSI }, 0 },
2635 { "popV", { RMrDI }, 0 },
2637 { X86_64_TABLE (X86_64_60) },
2638 { X86_64_TABLE (X86_64_61) },
2639 { X86_64_TABLE (X86_64_62) },
2640 { X86_64_TABLE (X86_64_63) },
2641 { Bad_Opcode }, /* seg fs */
2642 { Bad_Opcode }, /* seg gs */
2643 { Bad_Opcode }, /* op size prefix */
2644 { Bad_Opcode }, /* adr size prefix */
2646 { "pushT", { sIv }, 0 },
2647 { "imulS", { Gv, Ev, Iv }, 0 },
2648 { "pushT", { sIbT }, 0 },
2649 { "imulS", { Gv, Ev, sIb }, 0 },
2650 { "ins{b|}", { Ybr, indirDX }, 0 },
2651 { X86_64_TABLE (X86_64_6D) },
2652 { "outs{b|}", { indirDXr, Xb }, 0 },
2653 { X86_64_TABLE (X86_64_6F) },
2655 { "joH", { Jb, BND, cond_jump_flag }, 0 },
2656 { "jnoH", { Jb, BND, cond_jump_flag }, 0 },
2657 { "jbH", { Jb, BND, cond_jump_flag }, 0 },
2658 { "jaeH", { Jb, BND, cond_jump_flag }, 0 },
2659 { "jeH", { Jb, BND, cond_jump_flag }, 0 },
2660 { "jneH", { Jb, BND, cond_jump_flag }, 0 },
2661 { "jbeH", { Jb, BND, cond_jump_flag }, 0 },
2662 { "jaH", { Jb, BND, cond_jump_flag }, 0 },
2664 { "jsH", { Jb, BND, cond_jump_flag }, 0 },
2665 { "jnsH", { Jb, BND, cond_jump_flag }, 0 },
2666 { "jpH", { Jb, BND, cond_jump_flag }, 0 },
2667 { "jnpH", { Jb, BND, cond_jump_flag }, 0 },
2668 { "jlH", { Jb, BND, cond_jump_flag }, 0 },
2669 { "jgeH", { Jb, BND, cond_jump_flag }, 0 },
2670 { "jleH", { Jb, BND, cond_jump_flag }, 0 },
2671 { "jgH", { Jb, BND, cond_jump_flag }, 0 },
2673 { REG_TABLE (REG_80) },
2674 { REG_TABLE (REG_81) },
2675 { X86_64_TABLE (X86_64_82) },
2676 { REG_TABLE (REG_83) },
2677 { "testB", { Eb, Gb }, 0 },
2678 { "testS", { Ev, Gv }, 0 },
2679 { "xchgB", { Ebh2, Gb }, 0 },
2680 { "xchgS", { Evh2, Gv }, 0 },
2682 { "movB", { Ebh3, Gb }, 0 },
2683 { "movS", { Evh3, Gv }, 0 },
2684 { "movB", { Gb, EbS }, 0 },
2685 { "movS", { Gv, EvS }, 0 },
2686 { "movD", { Sv, Sw }, 0 },
2687 { MOD_TABLE (MOD_8D) },
2688 { "movD", { Sw, Sv }, 0 },
2689 { REG_TABLE (REG_8F) },
2691 { PREFIX_TABLE (PREFIX_90) },
2692 { "xchgS", { RMeCX, eAX }, 0 },
2693 { "xchgS", { RMeDX, eAX }, 0 },
2694 { "xchgS", { RMeBX, eAX }, 0 },
2695 { "xchgS", { RMeSP, eAX }, 0 },
2696 { "xchgS", { RMeBP, eAX }, 0 },
2697 { "xchgS", { RMeSI, eAX }, 0 },
2698 { "xchgS", { RMeDI, eAX }, 0 },
2700 { "cW{t|}R", { XX }, 0 },
2701 { "cR{t|}O", { XX }, 0 },
2702 { X86_64_TABLE (X86_64_9A) },
2703 { Bad_Opcode }, /* fwait */
2704 { "pushfT", { XX }, 0 },
2705 { "popfT", { XX }, 0 },
2706 { "sahf", { XX }, 0 },
2707 { "lahf", { XX }, 0 },
2709 { "mov%LB", { AL, Ob }, 0 },
2710 { "mov%LS", { eAX, Ov }, 0 },
2711 { "mov%LB", { Ob, AL }, 0 },
2712 { "mov%LS", { Ov, eAX }, 0 },
2713 { "movs{b|}", { Ybr, Xb }, 0 },
2714 { "movs{R|}", { Yvr, Xv }, 0 },
2715 { "cmps{b|}", { Xb, Yb }, 0 },
2716 { "cmps{R|}", { Xv, Yv }, 0 },
2718 { "testB", { AL, Ib }, 0 },
2719 { "testS", { eAX, Iv }, 0 },
2720 { "stosB", { Ybr, AL }, 0 },
2721 { "stosS", { Yvr, eAX }, 0 },
2722 { "lodsB", { ALr, Xb }, 0 },
2723 { "lodsS", { eAXr, Xv }, 0 },
2724 { "scasB", { AL, Yb }, 0 },
2725 { "scasS", { eAX, Yv }, 0 },
2727 { "movB", { RMAL, Ib }, 0 },
2728 { "movB", { RMCL, Ib }, 0 },
2729 { "movB", { RMDL, Ib }, 0 },
2730 { "movB", { RMBL, Ib }, 0 },
2731 { "movB", { RMAH, Ib }, 0 },
2732 { "movB", { RMCH, Ib }, 0 },
2733 { "movB", { RMDH, Ib }, 0 },
2734 { "movB", { RMBH, Ib }, 0 },
2736 { "mov%LV", { RMeAX, Iv64 }, 0 },
2737 { "mov%LV", { RMeCX, Iv64 }, 0 },
2738 { "mov%LV", { RMeDX, Iv64 }, 0 },
2739 { "mov%LV", { RMeBX, Iv64 }, 0 },
2740 { "mov%LV", { RMeSP, Iv64 }, 0 },
2741 { "mov%LV", { RMeBP, Iv64 }, 0 },
2742 { "mov%LV", { RMeSI, Iv64 }, 0 },
2743 { "mov%LV", { RMeDI, Iv64 }, 0 },
2745 { REG_TABLE (REG_C0) },
2746 { REG_TABLE (REG_C1) },
2747 { "retT", { Iw, BND }, 0 },
2748 { "retT", { BND }, 0 },
2749 { X86_64_TABLE (X86_64_C4) },
2750 { X86_64_TABLE (X86_64_C5) },
2751 { REG_TABLE (REG_C6) },
2752 { REG_TABLE (REG_C7) },
2754 { "enterT", { Iw, Ib }, 0 },
2755 { "leaveT", { XX }, 0 },
2756 { "Jret{|f}P", { Iw }, 0 },
2757 { "Jret{|f}P", { XX }, 0 },
2758 { "int3", { XX }, 0 },
2759 { "int", { Ib }, 0 },
2760 { X86_64_TABLE (X86_64_CE) },
2761 { "iret%LP", { XX }, 0 },
2763 { REG_TABLE (REG_D0) },
2764 { REG_TABLE (REG_D1) },
2765 { REG_TABLE (REG_D2) },
2766 { REG_TABLE (REG_D3) },
2767 { X86_64_TABLE (X86_64_D4) },
2768 { X86_64_TABLE (X86_64_D5) },
2770 { "xlat", { DSBX }, 0 },
2781 { "loopneFH", { Jb, XX, loop_jcxz_flag }, 0 },
2782 { "loopeFH", { Jb, XX, loop_jcxz_flag }, 0 },
2783 { "loopFH", { Jb, XX, loop_jcxz_flag }, 0 },
2784 { "jEcxzH", { Jb, XX, loop_jcxz_flag }, 0 },
2785 { "inB", { AL, Ib }, 0 },
2786 { "inG", { zAX, Ib }, 0 },
2787 { "outB", { Ib, AL }, 0 },
2788 { "outG", { Ib, zAX }, 0 },
2790 { X86_64_TABLE (X86_64_E8) },
2791 { X86_64_TABLE (X86_64_E9) },
2792 { X86_64_TABLE (X86_64_EA) },
2793 { "jmp", { Jb, BND }, 0 },
2794 { "inB", { AL, indirDX }, 0 },
2795 { "inG", { zAX, indirDX }, 0 },
2796 { "outB", { indirDX, AL }, 0 },
2797 { "outG", { indirDX, zAX }, 0 },
2799 { Bad_Opcode }, /* lock prefix */
2800 { "icebp", { XX }, 0 },
2801 { Bad_Opcode }, /* repne */
2802 { Bad_Opcode }, /* repz */
2803 { "hlt", { XX }, 0 },
2804 { "cmc", { XX }, 0 },
2805 { REG_TABLE (REG_F6) },
2806 { REG_TABLE (REG_F7) },
2808 { "clc", { XX }, 0 },
2809 { "stc", { XX }, 0 },
2810 { "cli", { XX }, 0 },
2811 { "sti", { XX }, 0 },
2812 { "cld", { XX }, 0 },
2813 { "std", { XX }, 0 },
2814 { REG_TABLE (REG_FE) },
2815 { REG_TABLE (REG_FF) },
2818 static const struct dis386 dis386_twobyte[] = {
2820 { REG_TABLE (REG_0F00 ) },
2821 { REG_TABLE (REG_0F01 ) },
2822 { "larS", { Gv, Ew }, 0 },
2823 { "lslS", { Gv, Ew }, 0 },
2825 { "syscall", { XX }, 0 },
2826 { "clts", { XX }, 0 },
2827 { "sysret%LP", { XX }, 0 },
2829 { "invd", { XX }, 0 },
2830 { "wbinvd", { XX }, 0 },
2832 { "ud2", { XX }, 0 },
2834 { REG_TABLE (REG_0F0D) },
2835 { "femms", { XX }, 0 },
2836 { "", { MX, EM, OPSUF }, 0 }, /* See OP_3DNowSuffix. */
2838 { PREFIX_TABLE (PREFIX_0F10) },
2839 { PREFIX_TABLE (PREFIX_0F11) },
2840 { PREFIX_TABLE (PREFIX_0F12) },
2841 { MOD_TABLE (MOD_0F13) },
2842 { "unpcklpX", { XM, EXx }, PREFIX_OPCODE },
2843 { "unpckhpX", { XM, EXx }, PREFIX_OPCODE },
2844 { PREFIX_TABLE (PREFIX_0F16) },
2845 { MOD_TABLE (MOD_0F17) },
2847 { REG_TABLE (REG_0F18) },
2848 { "nopQ", { Ev }, 0 },
2849 { PREFIX_TABLE (PREFIX_0F1A) },
2850 { PREFIX_TABLE (PREFIX_0F1B) },
2851 { "nopQ", { Ev }, 0 },
2852 { "nopQ", { Ev }, 0 },
2853 { PREFIX_TABLE (PREFIX_0F1E) },
2854 { "nopQ", { Ev }, 0 },
2856 { "movZ", { Rm, Cm }, 0 },
2857 { "movZ", { Rm, Dm }, 0 },
2858 { "movZ", { Cm, Rm }, 0 },
2859 { "movZ", { Dm, Rm }, 0 },
2860 { MOD_TABLE (MOD_0F24) },
2862 { MOD_TABLE (MOD_0F26) },
2865 { "movapX", { XM, EXx }, PREFIX_OPCODE },
2866 { "movapX", { EXxS, XM }, PREFIX_OPCODE },
2867 { PREFIX_TABLE (PREFIX_0F2A) },
2868 { PREFIX_TABLE (PREFIX_0F2B) },
2869 { PREFIX_TABLE (PREFIX_0F2C) },
2870 { PREFIX_TABLE (PREFIX_0F2D) },
2871 { PREFIX_TABLE (PREFIX_0F2E) },
2872 { PREFIX_TABLE (PREFIX_0F2F) },
2874 { "wrmsr", { XX }, 0 },
2875 { "rdtsc", { XX }, 0 },
2876 { "rdmsr", { XX }, 0 },
2877 { "rdpmc", { XX }, 0 },
2878 { "sysenter", { XX }, 0 },
2879 { "sysexit", { XX }, 0 },
2881 { "getsec", { XX }, 0 },
2883 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38, PREFIX_OPCODE) },
2885 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A, PREFIX_OPCODE) },
2892 { "cmovoS", { Gv, Ev }, 0 },
2893 { "cmovnoS", { Gv, Ev }, 0 },
2894 { "cmovbS", { Gv, Ev }, 0 },
2895 { "cmovaeS", { Gv, Ev }, 0 },
2896 { "cmoveS", { Gv, Ev }, 0 },
2897 { "cmovneS", { Gv, Ev }, 0 },
2898 { "cmovbeS", { Gv, Ev }, 0 },
2899 { "cmovaS", { Gv, Ev }, 0 },
2901 { "cmovsS", { Gv, Ev }, 0 },
2902 { "cmovnsS", { Gv, Ev }, 0 },
2903 { "cmovpS", { Gv, Ev }, 0 },
2904 { "cmovnpS", { Gv, Ev }, 0 },
2905 { "cmovlS", { Gv, Ev }, 0 },
2906 { "cmovgeS", { Gv, Ev }, 0 },
2907 { "cmovleS", { Gv, Ev }, 0 },
2908 { "cmovgS", { Gv, Ev }, 0 },
2910 { MOD_TABLE (MOD_0F51) },
2911 { PREFIX_TABLE (PREFIX_0F51) },
2912 { PREFIX_TABLE (PREFIX_0F52) },
2913 { PREFIX_TABLE (PREFIX_0F53) },
2914 { "andpX", { XM, EXx }, PREFIX_OPCODE },
2915 { "andnpX", { XM, EXx }, PREFIX_OPCODE },
2916 { "orpX", { XM, EXx }, PREFIX_OPCODE },
2917 { "xorpX", { XM, EXx }, PREFIX_OPCODE },
2919 { PREFIX_TABLE (PREFIX_0F58) },
2920 { PREFIX_TABLE (PREFIX_0F59) },
2921 { PREFIX_TABLE (PREFIX_0F5A) },
2922 { PREFIX_TABLE (PREFIX_0F5B) },
2923 { PREFIX_TABLE (PREFIX_0F5C) },
2924 { PREFIX_TABLE (PREFIX_0F5D) },
2925 { PREFIX_TABLE (PREFIX_0F5E) },
2926 { PREFIX_TABLE (PREFIX_0F5F) },
2928 { PREFIX_TABLE (PREFIX_0F60) },
2929 { PREFIX_TABLE (PREFIX_0F61) },
2930 { PREFIX_TABLE (PREFIX_0F62) },
2931 { "packsswb", { MX, EM }, PREFIX_OPCODE },
2932 { "pcmpgtb", { MX, EM }, PREFIX_OPCODE },
2933 { "pcmpgtw", { MX, EM }, PREFIX_OPCODE },
2934 { "pcmpgtd", { MX, EM }, PREFIX_OPCODE },
2935 { "packuswb", { MX, EM }, PREFIX_OPCODE },
2937 { "punpckhbw", { MX, EM }, PREFIX_OPCODE },
2938 { "punpckhwd", { MX, EM }, PREFIX_OPCODE },
2939 { "punpckhdq", { MX, EM }, PREFIX_OPCODE },
2940 { "packssdw", { MX, EM }, PREFIX_OPCODE },
2941 { PREFIX_TABLE (PREFIX_0F6C) },
2942 { PREFIX_TABLE (PREFIX_0F6D) },
2943 { "movK", { MX, Edq }, PREFIX_OPCODE },
2944 { PREFIX_TABLE (PREFIX_0F6F) },
2946 { PREFIX_TABLE (PREFIX_0F70) },
2947 { REG_TABLE (REG_0F71) },
2948 { REG_TABLE (REG_0F72) },
2949 { REG_TABLE (REG_0F73) },
2950 { "pcmpeqb", { MX, EM }, PREFIX_OPCODE },
2951 { "pcmpeqw", { MX, EM }, PREFIX_OPCODE },
2952 { "pcmpeqd", { MX, EM }, PREFIX_OPCODE },
2953 { "emms", { XX }, PREFIX_OPCODE },
2955 { PREFIX_TABLE (PREFIX_0F78) },
2956 { PREFIX_TABLE (PREFIX_0F79) },
2959 { PREFIX_TABLE (PREFIX_0F7C) },
2960 { PREFIX_TABLE (PREFIX_0F7D) },
2961 { PREFIX_TABLE (PREFIX_0F7E) },
2962 { PREFIX_TABLE (PREFIX_0F7F) },
2964 { "joH", { Jv, BND, cond_jump_flag }, 0 },
2965 { "jnoH", { Jv, BND, cond_jump_flag }, 0 },
2966 { "jbH", { Jv, BND, cond_jump_flag }, 0 },
2967 { "jaeH", { Jv, BND, cond_jump_flag }, 0 },
2968 { "jeH", { Jv, BND, cond_jump_flag }, 0 },
2969 { "jneH", { Jv, BND, cond_jump_flag }, 0 },
2970 { "jbeH", { Jv, BND, cond_jump_flag }, 0 },
2971 { "jaH", { Jv, BND, cond_jump_flag }, 0 },
2973 { "jsH", { Jv, BND, cond_jump_flag }, 0 },
2974 { "jnsH", { Jv, BND, cond_jump_flag }, 0 },
2975 { "jpH", { Jv, BND, cond_jump_flag }, 0 },
2976 { "jnpH", { Jv, BND, cond_jump_flag }, 0 },
2977 { "jlH", { Jv, BND, cond_jump_flag }, 0 },
2978 { "jgeH", { Jv, BND, cond_jump_flag }, 0 },
2979 { "jleH", { Jv, BND, cond_jump_flag }, 0 },
2980 { "jgH", { Jv, BND, cond_jump_flag }, 0 },
2982 { "seto", { Eb }, 0 },
2983 { "setno", { Eb }, 0 },
2984 { "setb", { Eb }, 0 },
2985 { "setae", { Eb }, 0 },
2986 { "sete", { Eb }, 0 },
2987 { "setne", { Eb }, 0 },
2988 { "setbe", { Eb }, 0 },
2989 { "seta", { Eb }, 0 },
2991 { "sets", { Eb }, 0 },
2992 { "setns", { Eb }, 0 },
2993 { "setp", { Eb }, 0 },
2994 { "setnp", { Eb }, 0 },
2995 { "setl", { Eb }, 0 },
2996 { "setge", { Eb }, 0 },
2997 { "setle", { Eb }, 0 },
2998 { "setg", { Eb }, 0 },
3000 { "pushT", { fs }, 0 },
3001 { "popT", { fs }, 0 },
3002 { "cpuid", { XX }, 0 },
3003 { "btS", { Ev, Gv }, 0 },
3004 { "shldS", { Ev, Gv, Ib }, 0 },
3005 { "shldS", { Ev, Gv, CL }, 0 },
3006 { REG_TABLE (REG_0FA6) },
3007 { REG_TABLE (REG_0FA7) },
3009 { "pushT", { gs }, 0 },
3010 { "popT", { gs }, 0 },
3011 { "rsm", { XX }, 0 },
3012 { "btsS", { Evh1, Gv }, 0 },
3013 { "shrdS", { Ev, Gv, Ib }, 0 },
3014 { "shrdS", { Ev, Gv, CL }, 0 },
3015 { REG_TABLE (REG_0FAE) },
3016 { "imulS", { Gv, Ev }, 0 },
3018 { "cmpxchgB", { Ebh1, Gb }, 0 },
3019 { "cmpxchgS", { Evh1, Gv }, 0 },
3020 { MOD_TABLE (MOD_0FB2) },
3021 { "btrS", { Evh1, Gv }, 0 },
3022 { MOD_TABLE (MOD_0FB4) },
3023 { MOD_TABLE (MOD_0FB5) },
3024 { "movz{bR|x}", { Gv, Eb }, 0 },
3025 { "movz{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movzww ! */
3027 { PREFIX_TABLE (PREFIX_0FB8) },
3028 { "ud1", { XX }, 0 },
3029 { REG_TABLE (REG_0FBA) },
3030 { "btcS", { Evh1, Gv }, 0 },
3031 { PREFIX_TABLE (PREFIX_0FBC) },
3032 { PREFIX_TABLE (PREFIX_0FBD) },
3033 { "movs{bR|x}", { Gv, Eb }, 0 },
3034 { "movs{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movsww ! */
3036 { "xaddB", { Ebh1, Gb }, 0 },
3037 { "xaddS", { Evh1, Gv }, 0 },
3038 { PREFIX_TABLE (PREFIX_0FC2) },
3039 { MOD_TABLE (MOD_0FC3) },
3040 { "pinsrw", { MX, Edqw, Ib }, PREFIX_OPCODE },
3041 { "pextrw", { Gdq, MS, Ib }, PREFIX_OPCODE },
3042 { "shufpX", { XM, EXx, Ib }, PREFIX_OPCODE },
3043 { REG_TABLE (REG_0FC7) },
3045 { "bswap", { RMeAX }, 0 },
3046 { "bswap", { RMeCX }, 0 },
3047 { "bswap", { RMeDX }, 0 },
3048 { "bswap", { RMeBX }, 0 },
3049 { "bswap", { RMeSP }, 0 },
3050 { "bswap", { RMeBP }, 0 },
3051 { "bswap", { RMeSI }, 0 },
3052 { "bswap", { RMeDI }, 0 },
3054 { PREFIX_TABLE (PREFIX_0FD0) },
3055 { "psrlw", { MX, EM }, PREFIX_OPCODE },
3056 { "psrld", { MX, EM }, PREFIX_OPCODE },
3057 { "psrlq", { MX, EM }, PREFIX_OPCODE },
3058 { "paddq", { MX, EM }, PREFIX_OPCODE },
3059 { "pmullw", { MX, EM }, PREFIX_OPCODE },
3060 { PREFIX_TABLE (PREFIX_0FD6) },
3061 { MOD_TABLE (MOD_0FD7) },
3063 { "psubusb", { MX, EM }, PREFIX_OPCODE },
3064 { "psubusw", { MX, EM }, PREFIX_OPCODE },
3065 { "pminub", { MX, EM }, PREFIX_OPCODE },
3066 { "pand", { MX, EM }, PREFIX_OPCODE },
3067 { "paddusb", { MX, EM }, PREFIX_OPCODE },
3068 { "paddusw", { MX, EM }, PREFIX_OPCODE },
3069 { "pmaxub", { MX, EM }, PREFIX_OPCODE },
3070 { "pandn", { MX, EM }, PREFIX_OPCODE },
3072 { "pavgb", { MX, EM }, PREFIX_OPCODE },
3073 { "psraw", { MX, EM }, PREFIX_OPCODE },
3074 { "psrad", { MX, EM }, PREFIX_OPCODE },
3075 { "pavgw", { MX, EM }, PREFIX_OPCODE },
3076 { "pmulhuw", { MX, EM }, PREFIX_OPCODE },
3077 { "pmulhw", { MX, EM }, PREFIX_OPCODE },
3078 { PREFIX_TABLE (PREFIX_0FE6) },
3079 { PREFIX_TABLE (PREFIX_0FE7) },
3081 { "psubsb", { MX, EM }, PREFIX_OPCODE },
3082 { "psubsw", { MX, EM }, PREFIX_OPCODE },
3083 { "pminsw", { MX, EM }, PREFIX_OPCODE },
3084 { "por", { MX, EM }, PREFIX_OPCODE },
3085 { "paddsb", { MX, EM }, PREFIX_OPCODE },
3086 { "paddsw", { MX, EM }, PREFIX_OPCODE },
3087 { "pmaxsw", { MX, EM }, PREFIX_OPCODE },
3088 { "pxor", { MX, EM }, PREFIX_OPCODE },
3090 { PREFIX_TABLE (PREFIX_0FF0) },
3091 { "psllw", { MX, EM }, PREFIX_OPCODE },
3092 { "pslld", { MX, EM }, PREFIX_OPCODE },
3093 { "psllq", { MX, EM }, PREFIX_OPCODE },
3094 { "pmuludq", { MX, EM }, PREFIX_OPCODE },
3095 { "pmaddwd", { MX, EM }, PREFIX_OPCODE },
3096 { "psadbw", { MX, EM }, PREFIX_OPCODE },
3097 { PREFIX_TABLE (PREFIX_0FF7) },
3099 { "psubb", { MX, EM }, PREFIX_OPCODE },
3100 { "psubw", { MX, EM }, PREFIX_OPCODE },
3101 { "psubd", { MX, EM }, PREFIX_OPCODE },
3102 { "psubq", { MX, EM }, PREFIX_OPCODE },
3103 { "paddb", { MX, EM }, PREFIX_OPCODE },
3104 { "paddw", { MX, EM }, PREFIX_OPCODE },
3105 { "paddd", { MX, EM }, PREFIX_OPCODE },
3109 static const unsigned char onebyte_has_modrm[256] = {
3110 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
3111 /* ------------------------------- */
3112 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
3113 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
3114 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
3115 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
3116 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
3117 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
3118 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
3119 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
3120 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
3121 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
3122 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
3123 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
3124 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
3125 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
3126 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
3127 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
3128 /* ------------------------------- */
3129 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
3132 static const unsigned char twobyte_has_modrm[256] = {
3133 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
3134 /* ------------------------------- */
3135 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
3136 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
3137 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
3138 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
3139 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
3140 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
3141 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
3142 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
3143 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
3144 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
3145 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
3146 /* b0 */ 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, /* bf */
3147 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
3148 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
3149 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
3150 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */
3151 /* ------------------------------- */
3152 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
3155 static char obuf[100];
3157 static char *mnemonicendp;
3158 static char scratchbuf[100];
3159 static unsigned char *start_codep;
3160 static unsigned char *insn_codep;
3161 static unsigned char *codep;
3162 static unsigned char *end_codep;
3163 static int last_lock_prefix;
3164 static int last_repz_prefix;
3165 static int last_repnz_prefix;
3166 static int last_data_prefix;
3167 static int last_addr_prefix;
3168 static int last_rex_prefix;
3169 static int last_seg_prefix;
3170 static int fwait_prefix;
3171 /* The active segment register prefix. */
3172 static int active_seg_prefix;
3173 #define MAX_CODE_LENGTH 15
3174 /* We can up to 14 prefixes since the maximum instruction length is
3176 static int all_prefixes[MAX_CODE_LENGTH - 1];
3177 static disassemble_info *the_info;
3185 static unsigned char need_modrm;
3195 int register_specifier;
3202 int mask_register_specifier;
3208 static unsigned char need_vex;
3209 static unsigned char need_vex_reg;
3210 static unsigned char vex_w_done;
3218 /* If we are accessing mod/rm/reg without need_modrm set, then the
3219 values are stale. Hitting this abort likely indicates that you
3220 need to update onebyte_has_modrm or twobyte_has_modrm. */
3221 #define MODRM_CHECK if (!need_modrm) abort ()
3223 static const char **names64;
3224 static const char **names32;
3225 static const char **names16;
3226 static const char **names8;
3227 static const char **names8rex;
3228 static const char **names_seg;
3229 static const char *index64;
3230 static const char *index32;
3231 static const char **index16;
3232 static const char **names_bnd;
3234 static const char *intel_names64[] = {
3235 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
3236 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
3238 static const char *intel_names32[] = {
3239 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
3240 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
3242 static const char *intel_names16[] = {
3243 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
3244 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
3246 static const char *intel_names8[] = {
3247 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
3249 static const char *intel_names8rex[] = {
3250 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
3251 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
3253 static const char *intel_names_seg[] = {
3254 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
3256 static const char *intel_index64 = "riz";
3257 static const char *intel_index32 = "eiz";
3258 static const char *intel_index16[] = {
3259 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
3262 static const char *att_names64[] = {
3263 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
3264 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
3266 static const char *att_names32[] = {
3267 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
3268 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
3270 static const char *att_names16[] = {
3271 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
3272 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
3274 static const char *att_names8[] = {
3275 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
3277 static const char *att_names8rex[] = {
3278 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
3279 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
3281 static const char *att_names_seg[] = {
3282 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
3284 static const char *att_index64 = "%riz";
3285 static const char *att_index32 = "%eiz";
3286 static const char *att_index16[] = {
3287 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
3290 static const char **names_mm;
3291 static const char *intel_names_mm[] = {
3292 "mm0", "mm1", "mm2", "mm3",
3293 "mm4", "mm5", "mm6", "mm7"
3295 static const char *att_names_mm[] = {
3296 "%mm0", "%mm1", "%mm2", "%mm3",
3297 "%mm4", "%mm5", "%mm6", "%mm7"
3300 static const char *intel_names_bnd[] = {
3301 "bnd0", "bnd1", "bnd2", "bnd3"
3304 static const char *att_names_bnd[] = {
3305 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
3308 static const char **names_xmm;
3309 static const char *intel_names_xmm[] = {
3310 "xmm0", "xmm1", "xmm2", "xmm3",
3311 "xmm4", "xmm5", "xmm6", "xmm7",
3312 "xmm8", "xmm9", "xmm10", "xmm11",
3313 "xmm12", "xmm13", "xmm14", "xmm15",
3314 "xmm16", "xmm17", "xmm18", "xmm19",
3315 "xmm20", "xmm21", "xmm22", "xmm23",
3316 "xmm24", "xmm25", "xmm26", "xmm27",
3317 "xmm28", "xmm29", "xmm30", "xmm31"
3319 static const char *att_names_xmm[] = {
3320 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
3321 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
3322 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
3323 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
3324 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
3325 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
3326 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
3327 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
3330 static const char **names_ymm;
3331 static const char *intel_names_ymm[] = {
3332 "ymm0", "ymm1", "ymm2", "ymm3",
3333 "ymm4", "ymm5", "ymm6", "ymm7",
3334 "ymm8", "ymm9", "ymm10", "ymm11",
3335 "ymm12", "ymm13", "ymm14", "ymm15",
3336 "ymm16", "ymm17", "ymm18", "ymm19",
3337 "ymm20", "ymm21", "ymm22", "ymm23",
3338 "ymm24", "ymm25", "ymm26", "ymm27",
3339 "ymm28", "ymm29", "ymm30", "ymm31"
3341 static const char *att_names_ymm[] = {
3342 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
3343 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
3344 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
3345 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
3346 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
3347 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
3348 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
3349 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
3352 static const char **names_zmm;
3353 static const char *intel_names_zmm[] = {
3354 "zmm0", "zmm1", "zmm2", "zmm3",
3355 "zmm4", "zmm5", "zmm6", "zmm7",
3356 "zmm8", "zmm9", "zmm10", "zmm11",
3357 "zmm12", "zmm13", "zmm14", "zmm15",
3358 "zmm16", "zmm17", "zmm18", "zmm19",
3359 "zmm20", "zmm21", "zmm22", "zmm23",
3360 "zmm24", "zmm25", "zmm26", "zmm27",
3361 "zmm28", "zmm29", "zmm30", "zmm31"
3363 static const char *att_names_zmm[] = {
3364 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
3365 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
3366 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
3367 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
3368 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
3369 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
3370 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
3371 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
3374 static const char **names_mask;
3375 static const char *intel_names_mask[] = {
3376 "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7"
3378 static const char *att_names_mask[] = {
3379 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
3382 static const char *names_rounding[] =
3390 static const struct dis386 reg_table[][8] = {
3393 { "addA", { Ebh1, Ib }, 0 },
3394 { "orA", { Ebh1, Ib }, 0 },
3395 { "adcA", { Ebh1, Ib }, 0 },
3396 { "sbbA", { Ebh1, Ib }, 0 },
3397 { "andA", { Ebh1, Ib }, 0 },
3398 { "subA", { Ebh1, Ib }, 0 },
3399 { "xorA", { Ebh1, Ib }, 0 },
3400 { "cmpA", { Eb, Ib }, 0 },
3404 { "addQ", { Evh1, Iv }, 0 },
3405 { "orQ", { Evh1, Iv }, 0 },
3406 { "adcQ", { Evh1, Iv }, 0 },
3407 { "sbbQ", { Evh1, Iv }, 0 },
3408 { "andQ", { Evh1, Iv }, 0 },
3409 { "subQ", { Evh1, Iv }, 0 },
3410 { "xorQ", { Evh1, Iv }, 0 },
3411 { "cmpQ", { Ev, Iv }, 0 },
3415 { "addQ", { Evh1, sIb }, 0 },
3416 { "orQ", { Evh1, sIb }, 0 },
3417 { "adcQ", { Evh1, sIb }, 0 },
3418 { "sbbQ", { Evh1, sIb }, 0 },
3419 { "andQ", { Evh1, sIb }, 0 },
3420 { "subQ", { Evh1, sIb }, 0 },
3421 { "xorQ", { Evh1, sIb }, 0 },
3422 { "cmpQ", { Ev, sIb }, 0 },
3426 { "popU", { stackEv }, 0 },
3427 { XOP_8F_TABLE (XOP_09) },
3431 { XOP_8F_TABLE (XOP_09) },
3435 { "rolA", { Eb, Ib }, 0 },
3436 { "rorA", { Eb, Ib }, 0 },
3437 { "rclA", { Eb, Ib }, 0 },
3438 { "rcrA", { Eb, Ib }, 0 },
3439 { "shlA", { Eb, Ib }, 0 },
3440 { "shrA", { Eb, Ib }, 0 },
3442 { "sarA", { Eb, Ib }, 0 },
3446 { "rolQ", { Ev, Ib }, 0 },
3447 { "rorQ", { Ev, Ib }, 0 },
3448 { "rclQ", { Ev, Ib }, 0 },
3449 { "rcrQ", { Ev, Ib }, 0 },
3450 { "shlQ", { Ev, Ib }, 0 },
3451 { "shrQ", { Ev, Ib }, 0 },
3453 { "sarQ", { Ev, Ib }, 0 },
3457 { "movA", { Ebh3, Ib }, 0 },
3464 { MOD_TABLE (MOD_C6_REG_7) },
3468 { "movQ", { Evh3, Iv }, 0 },
3475 { MOD_TABLE (MOD_C7_REG_7) },
3479 { "rolA", { Eb, I1 }, 0 },
3480 { "rorA", { Eb, I1 }, 0 },
3481 { "rclA", { Eb, I1 }, 0 },
3482 { "rcrA", { Eb, I1 }, 0 },
3483 { "shlA", { Eb, I1 }, 0 },
3484 { "shrA", { Eb, I1 }, 0 },
3486 { "sarA", { Eb, I1 }, 0 },
3490 { "rolQ", { Ev, I1 }, 0 },
3491 { "rorQ", { Ev, I1 }, 0 },
3492 { "rclQ", { Ev, I1 }, 0 },
3493 { "rcrQ", { Ev, I1 }, 0 },
3494 { "shlQ", { Ev, I1 }, 0 },
3495 { "shrQ", { Ev, I1 }, 0 },
3497 { "sarQ", { Ev, I1 }, 0 },
3501 { "rolA", { Eb, CL }, 0 },
3502 { "rorA", { Eb, CL }, 0 },
3503 { "rclA", { Eb, CL }, 0 },
3504 { "rcrA", { Eb, CL }, 0 },
3505 { "shlA", { Eb, CL }, 0 },
3506 { "shrA", { Eb, CL }, 0 },
3508 { "sarA", { Eb, CL }, 0 },
3512 { "rolQ", { Ev, CL }, 0 },
3513 { "rorQ", { Ev, CL }, 0 },
3514 { "rclQ", { Ev, CL }, 0 },
3515 { "rcrQ", { Ev, CL }, 0 },
3516 { "shlQ", { Ev, CL }, 0 },
3517 { "shrQ", { Ev, CL }, 0 },
3519 { "sarQ", { Ev, CL }, 0 },
3523 { "testA", { Eb, Ib }, 0 },
3524 { "testA", { Eb, Ib }, 0 },
3525 { "notA", { Ebh1 }, 0 },
3526 { "negA", { Ebh1 }, 0 },
3527 { "mulA", { Eb }, 0 }, /* Don't print the implicit %al register, */
3528 { "imulA", { Eb }, 0 }, /* to distinguish these opcodes from other */
3529 { "divA", { Eb }, 0 }, /* mul/imul opcodes. Do the same for div */
3530 { "idivA", { Eb }, 0 }, /* and idiv for consistency. */
3534 { "testQ", { Ev, Iv }, 0 },
3535 { "testQ", { Ev, Iv }, 0 },
3536 { "notQ", { Evh1 }, 0 },
3537 { "negQ", { Evh1 }, 0 },
3538 { "mulQ", { Ev }, 0 }, /* Don't print the implicit register. */
3539 { "imulQ", { Ev }, 0 },
3540 { "divQ", { Ev }, 0 },
3541 { "idivQ", { Ev }, 0 },
3545 { "incA", { Ebh1 }, 0 },
3546 { "decA", { Ebh1 }, 0 },
3550 { "incQ", { Evh1 }, 0 },
3551 { "decQ", { Evh1 }, 0 },
3552 { "call{&|}", { indirEv, BND }, 0 },
3553 { MOD_TABLE (MOD_FF_REG_3) },
3554 { "jmp{&|}", { indirEv, BND }, 0 },
3555 { MOD_TABLE (MOD_FF_REG_5) },
3556 { "pushU", { stackEv }, 0 },
3561 { "sldtD", { Sv }, 0 },
3562 { "strD", { Sv }, 0 },
3563 { "lldt", { Ew }, 0 },
3564 { "ltr", { Ew }, 0 },
3565 { "verr", { Ew }, 0 },
3566 { "verw", { Ew }, 0 },
3572 { MOD_TABLE (MOD_0F01_REG_0) },
3573 { MOD_TABLE (MOD_0F01_REG_1) },
3574 { MOD_TABLE (MOD_0F01_REG_2) },
3575 { MOD_TABLE (MOD_0F01_REG_3) },
3576 { "smswD", { Sv }, 0 },
3577 { MOD_TABLE (MOD_0F01_REG_5) },
3578 { "lmsw", { Ew }, 0 },
3579 { MOD_TABLE (MOD_0F01_REG_7) },
3583 { "prefetch", { Mb }, 0 },
3584 { "prefetchw", { Mb }, 0 },
3585 { "prefetchwt1", { Mb }, 0 },
3586 { "prefetch", { Mb }, 0 },
3587 { "prefetch", { Mb }, 0 },
3588 { "prefetch", { Mb }, 0 },
3589 { "prefetch", { Mb }, 0 },
3590 { "prefetch", { Mb }, 0 },
3594 { MOD_TABLE (MOD_0F18_REG_0) },
3595 { MOD_TABLE (MOD_0F18_REG_1) },
3596 { MOD_TABLE (MOD_0F18_REG_2) },
3597 { MOD_TABLE (MOD_0F18_REG_3) },
3598 { MOD_TABLE (MOD_0F18_REG_4) },
3599 { MOD_TABLE (MOD_0F18_REG_5) },
3600 { MOD_TABLE (MOD_0F18_REG_6) },
3601 { MOD_TABLE (MOD_0F18_REG_7) },
3603 /* REG_0F1E_MOD_3 */
3605 { "nopQ", { Ev }, 0 },
3606 { "rdsspK", { Rdq }, PREFIX_OPCODE },
3607 { "nopQ", { Ev }, 0 },
3608 { "nopQ", { Ev }, 0 },
3609 { "nopQ", { Ev }, 0 },
3610 { "nopQ", { Ev }, 0 },
3611 { "nopQ", { Ev }, 0 },
3612 { RM_TABLE (RM_0F1E_MOD_3_REG_7) },
3618 { MOD_TABLE (MOD_0F71_REG_2) },
3620 { MOD_TABLE (MOD_0F71_REG_4) },
3622 { MOD_TABLE (MOD_0F71_REG_6) },
3628 { MOD_TABLE (MOD_0F72_REG_2) },
3630 { MOD_TABLE (MOD_0F72_REG_4) },
3632 { MOD_TABLE (MOD_0F72_REG_6) },
3638 { MOD_TABLE (MOD_0F73_REG_2) },
3639 { MOD_TABLE (MOD_0F73_REG_3) },
3642 { MOD_TABLE (MOD_0F73_REG_6) },
3643 { MOD_TABLE (MOD_0F73_REG_7) },
3647 { "montmul", { { OP_0f07, 0 } }, 0 },
3648 { "xsha1", { { OP_0f07, 0 } }, 0 },
3649 { "xsha256", { { OP_0f07, 0 } }, 0 },
3653 { "xstore-rng", { { OP_0f07, 0 } }, 0 },
3654 { "xcrypt-ecb", { { OP_0f07, 0 } }, 0 },
3655 { "xcrypt-cbc", { { OP_0f07, 0 } }, 0 },
3656 { "xcrypt-ctr", { { OP_0f07, 0 } }, 0 },
3657 { "xcrypt-cfb", { { OP_0f07, 0 } }, 0 },
3658 { "xcrypt-ofb", { { OP_0f07, 0 } }, 0 },
3662 { MOD_TABLE (MOD_0FAE_REG_0) },
3663 { MOD_TABLE (MOD_0FAE_REG_1) },
3664 { MOD_TABLE (MOD_0FAE_REG_2) },
3665 { MOD_TABLE (MOD_0FAE_REG_3) },
3666 { MOD_TABLE (MOD_0FAE_REG_4) },
3667 { MOD_TABLE (MOD_0FAE_REG_5) },
3668 { MOD_TABLE (MOD_0FAE_REG_6) },
3669 { MOD_TABLE (MOD_0FAE_REG_7) },
3677 { "btQ", { Ev, Ib }, 0 },
3678 { "btsQ", { Evh1, Ib }, 0 },
3679 { "btrQ", { Evh1, Ib }, 0 },
3680 { "btcQ", { Evh1, Ib }, 0 },
3685 { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } }, 0 },
3687 { MOD_TABLE (MOD_0FC7_REG_3) },
3688 { MOD_TABLE (MOD_0FC7_REG_4) },
3689 { MOD_TABLE (MOD_0FC7_REG_5) },
3690 { MOD_TABLE (MOD_0FC7_REG_6) },
3691 { MOD_TABLE (MOD_0FC7_REG_7) },
3697 { MOD_TABLE (MOD_VEX_0F71_REG_2) },
3699 { MOD_TABLE (MOD_VEX_0F71_REG_4) },
3701 { MOD_TABLE (MOD_VEX_0F71_REG_6) },
3707 { MOD_TABLE (MOD_VEX_0F72_REG_2) },
3709 { MOD_TABLE (MOD_VEX_0F72_REG_4) },
3711 { MOD_TABLE (MOD_VEX_0F72_REG_6) },
3717 { MOD_TABLE (MOD_VEX_0F73_REG_2) },
3718 { MOD_TABLE (MOD_VEX_0F73_REG_3) },
3721 { MOD_TABLE (MOD_VEX_0F73_REG_6) },
3722 { MOD_TABLE (MOD_VEX_0F73_REG_7) },
3728 { MOD_TABLE (MOD_VEX_0FAE_REG_2) },
3729 { MOD_TABLE (MOD_VEX_0FAE_REG_3) },
3731 /* REG_VEX_0F38F3 */
3734 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_1) },
3735 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_2) },
3736 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_3) },
3740 { "llwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3741 { "slwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3745 { "lwpins", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3746 { "lwpval", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3748 /* REG_XOP_TBM_01 */
3751 { "blcfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3752 { "blsfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3753 { "blcs", { { OP_LWP_E, 0 }, Ev }, 0 },
3754 { "tzmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3755 { "blcic", { { OP_LWP_E, 0 }, Ev }, 0 },
3756 { "blsic", { { OP_LWP_E, 0 }, Ev }, 0 },
3757 { "t1mskc", { { OP_LWP_E, 0 }, Ev }, 0 },
3759 /* REG_XOP_TBM_02 */
3762 { "blcmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3767 { "blci", { { OP_LWP_E, 0 }, Ev }, 0 },
3769 #define NEED_REG_TABLE
3770 #include "i386-dis-evex.h"
3771 #undef NEED_REG_TABLE
3774 static const struct dis386 prefix_table[][4] = {
3777 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3778 { "pause", { XX }, 0 },
3779 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3780 { NULL, { { NULL, 0 } }, PREFIX_IGNORED }
3783 /* PREFIX_MOD_0_0F01_REG_5 */
3786 { "rstorssp", { Mq }, PREFIX_OPCODE },
3789 /* PREFIX_MOD_3_0F01_REG_5_RM_1 */
3792 { "incsspK", { Skip_MODRM }, PREFIX_OPCODE },
3795 /* PREFIX_MOD_3_0F01_REG_5_RM_2 */
3798 { "savessp", { Skip_MODRM }, PREFIX_OPCODE },
3803 { "movups", { XM, EXx }, PREFIX_OPCODE },
3804 { "movss", { XM, EXd }, PREFIX_OPCODE },
3805 { "movupd", { XM, EXx }, PREFIX_OPCODE },
3806 { "movsd", { XM, EXq }, PREFIX_OPCODE },
3811 { "movups", { EXxS, XM }, PREFIX_OPCODE },
3812 { "movss", { EXdS, XM }, PREFIX_OPCODE },
3813 { "movupd", { EXxS, XM }, PREFIX_OPCODE },
3814 { "movsd", { EXqS, XM }, PREFIX_OPCODE },
3819 { MOD_TABLE (MOD_0F12_PREFIX_0) },
3820 { "movsldup", { XM, EXx }, PREFIX_OPCODE },
3821 { "movlpd", { XM, EXq }, PREFIX_OPCODE },
3822 { "movddup", { XM, EXq }, PREFIX_OPCODE },
3827 { MOD_TABLE (MOD_0F16_PREFIX_0) },
3828 { "movshdup", { XM, EXx }, PREFIX_OPCODE },
3829 { "movhpd", { XM, EXq }, PREFIX_OPCODE },
3834 { MOD_TABLE (MOD_0F1A_PREFIX_0) },
3835 { "bndcl", { Gbnd, Ev_bnd }, 0 },
3836 { "bndmov", { Gbnd, Ebnd }, 0 },
3837 { "bndcu", { Gbnd, Ev_bnd }, 0 },
3842 { MOD_TABLE (MOD_0F1B_PREFIX_0) },
3843 { MOD_TABLE (MOD_0F1B_PREFIX_1) },
3844 { "bndmov", { Ebnd, Gbnd }, 0 },
3845 { "bndcn", { Gbnd, Ev_bnd }, 0 },
3850 { "nopQ", { Ev }, PREFIX_OPCODE },
3851 { MOD_TABLE (MOD_0F1E_PREFIX_1) },
3852 { "nopQ", { Ev }, PREFIX_OPCODE },
3853 { "nopQ", { Ev }, PREFIX_OPCODE },
3858 { "cvtpi2ps", { XM, EMCq }, PREFIX_OPCODE },
3859 { "cvtsi2ss%LQ", { XM, Ev }, PREFIX_OPCODE },
3860 { "cvtpi2pd", { XM, EMCq }, PREFIX_OPCODE },
3861 { "cvtsi2sd%LQ", { XM, Ev }, 0 },
3866 { MOD_TABLE (MOD_0F2B_PREFIX_0) },
3867 { MOD_TABLE (MOD_0F2B_PREFIX_1) },
3868 { MOD_TABLE (MOD_0F2B_PREFIX_2) },
3869 { MOD_TABLE (MOD_0F2B_PREFIX_3) },
3874 { "cvttps2pi", { MXC, EXq }, PREFIX_OPCODE },
3875 { "cvttss2siY", { Gv, EXd }, PREFIX_OPCODE },
3876 { "cvttpd2pi", { MXC, EXx }, PREFIX_OPCODE },
3877 { "cvttsd2siY", { Gv, EXq }, PREFIX_OPCODE },
3882 { "cvtps2pi", { MXC, EXq }, PREFIX_OPCODE },
3883 { "cvtss2siY", { Gv, EXd }, PREFIX_OPCODE },
3884 { "cvtpd2pi", { MXC, EXx }, PREFIX_OPCODE },
3885 { "cvtsd2siY", { Gv, EXq }, PREFIX_OPCODE },
3890 { "ucomiss",{ XM, EXd }, 0 },
3892 { "ucomisd",{ XM, EXq }, 0 },
3897 { "comiss", { XM, EXd }, 0 },
3899 { "comisd", { XM, EXq }, 0 },
3904 { "sqrtps", { XM, EXx }, PREFIX_OPCODE },
3905 { "sqrtss", { XM, EXd }, PREFIX_OPCODE },
3906 { "sqrtpd", { XM, EXx }, PREFIX_OPCODE },
3907 { "sqrtsd", { XM, EXq }, PREFIX_OPCODE },
3912 { "rsqrtps",{ XM, EXx }, PREFIX_OPCODE },
3913 { "rsqrtss",{ XM, EXd }, PREFIX_OPCODE },
3918 { "rcpps", { XM, EXx }, PREFIX_OPCODE },
3919 { "rcpss", { XM, EXd }, PREFIX_OPCODE },
3924 { "addps", { XM, EXx }, PREFIX_OPCODE },
3925 { "addss", { XM, EXd }, PREFIX_OPCODE },
3926 { "addpd", { XM, EXx }, PREFIX_OPCODE },
3927 { "addsd", { XM, EXq }, PREFIX_OPCODE },
3932 { "mulps", { XM, EXx }, PREFIX_OPCODE },
3933 { "mulss", { XM, EXd }, PREFIX_OPCODE },
3934 { "mulpd", { XM, EXx }, PREFIX_OPCODE },
3935 { "mulsd", { XM, EXq }, PREFIX_OPCODE },
3940 { "cvtps2pd", { XM, EXq }, PREFIX_OPCODE },
3941 { "cvtss2sd", { XM, EXd }, PREFIX_OPCODE },
3942 { "cvtpd2ps", { XM, EXx }, PREFIX_OPCODE },
3943 { "cvtsd2ss", { XM, EXq }, PREFIX_OPCODE },
3948 { "cvtdq2ps", { XM, EXx }, PREFIX_OPCODE },
3949 { "cvttps2dq", { XM, EXx }, PREFIX_OPCODE },
3950 { "cvtps2dq", { XM, EXx }, PREFIX_OPCODE },
3955 { "subps", { XM, EXx }, PREFIX_OPCODE },
3956 { "subss", { XM, EXd }, PREFIX_OPCODE },
3957 { "subpd", { XM, EXx }, PREFIX_OPCODE },
3958 { "subsd", { XM, EXq }, PREFIX_OPCODE },
3963 { "minps", { XM, EXx }, PREFIX_OPCODE },
3964 { "minss", { XM, EXd }, PREFIX_OPCODE },
3965 { "minpd", { XM, EXx }, PREFIX_OPCODE },
3966 { "minsd", { XM, EXq }, PREFIX_OPCODE },
3971 { "divps", { XM, EXx }, PREFIX_OPCODE },
3972 { "divss", { XM, EXd }, PREFIX_OPCODE },
3973 { "divpd", { XM, EXx }, PREFIX_OPCODE },
3974 { "divsd", { XM, EXq }, PREFIX_OPCODE },
3979 { "maxps", { XM, EXx }, PREFIX_OPCODE },
3980 { "maxss", { XM, EXd }, PREFIX_OPCODE },
3981 { "maxpd", { XM, EXx }, PREFIX_OPCODE },
3982 { "maxsd", { XM, EXq }, PREFIX_OPCODE },
3987 { "punpcklbw",{ MX, EMd }, PREFIX_OPCODE },
3989 { "punpcklbw",{ MX, EMx }, PREFIX_OPCODE },
3994 { "punpcklwd",{ MX, EMd }, PREFIX_OPCODE },
3996 { "punpcklwd",{ MX, EMx }, PREFIX_OPCODE },
4001 { "punpckldq",{ MX, EMd }, PREFIX_OPCODE },
4003 { "punpckldq",{ MX, EMx }, PREFIX_OPCODE },
4010 { "punpcklqdq", { XM, EXx }, PREFIX_OPCODE },
4017 { "punpckhqdq", { XM, EXx }, PREFIX_OPCODE },
4022 { "movq", { MX, EM }, PREFIX_OPCODE },
4023 { "movdqu", { XM, EXx }, PREFIX_OPCODE },
4024 { "movdqa", { XM, EXx }, PREFIX_OPCODE },
4029 { "pshufw", { MX, EM, Ib }, PREFIX_OPCODE },
4030 { "pshufhw",{ XM, EXx, Ib }, PREFIX_OPCODE },
4031 { "pshufd", { XM, EXx, Ib }, PREFIX_OPCODE },
4032 { "pshuflw",{ XM, EXx, Ib }, PREFIX_OPCODE },
4035 /* PREFIX_0F73_REG_3 */
4039 { "psrldq", { XS, Ib }, 0 },
4042 /* PREFIX_0F73_REG_7 */
4046 { "pslldq", { XS, Ib }, 0 },
4051 {"vmread", { Em, Gm }, 0 },
4053 {"extrq", { XS, Ib, Ib }, 0 },
4054 {"insertq", { XM, XS, Ib, Ib }, 0 },
4059 {"vmwrite", { Gm, Em }, 0 },
4061 {"extrq", { XM, XS }, 0 },
4062 {"insertq", { XM, XS }, 0 },
4069 { "haddpd", { XM, EXx }, PREFIX_OPCODE },
4070 { "haddps", { XM, EXx }, PREFIX_OPCODE },
4077 { "hsubpd", { XM, EXx }, PREFIX_OPCODE },
4078 { "hsubps", { XM, EXx }, PREFIX_OPCODE },
4083 { "movK", { Edq, MX }, PREFIX_OPCODE },
4084 { "movq", { XM, EXq }, PREFIX_OPCODE },
4085 { "movK", { Edq, XM }, PREFIX_OPCODE },
4090 { "movq", { EMS, MX }, PREFIX_OPCODE },
4091 { "movdqu", { EXxS, XM }, PREFIX_OPCODE },
4092 { "movdqa", { EXxS, XM }, PREFIX_OPCODE },
4095 /* PREFIX_0FAE_REG_0 */
4098 { "rdfsbase", { Ev }, 0 },
4101 /* PREFIX_0FAE_REG_1 */
4104 { "rdgsbase", { Ev }, 0 },
4107 /* PREFIX_0FAE_REG_2 */
4110 { "wrfsbase", { Ev }, 0 },
4113 /* PREFIX_0FAE_REG_3 */
4116 { "wrgsbase", { Ev }, 0 },
4119 /* PREFIX_MOD_0_0FAE_REG_4 */
4121 { "xsave", { FXSAVE }, 0 },
4122 { "ptwrite%LQ", { Edq }, 0 },
4125 /* PREFIX_MOD_3_0FAE_REG_4 */
4128 { "ptwrite%LQ", { Edq }, 0 },
4131 /* PREFIX_MOD_0_0FAE_REG_5 */
4133 { "xrstor", { FXSAVE }, PREFIX_OPCODE },
4134 { "setssbsy", { Mq }, PREFIX_OPCODE },
4137 /* PREFIX_0FAE_REG_6 */
4139 { "xsaveopt", { FXSAVE }, PREFIX_OPCODE },
4140 { "clrssbsy", { Mq }, PREFIX_OPCODE },
4141 { "clwb", { Mb }, PREFIX_OPCODE },
4144 /* PREFIX_0FAE_REG_7 */
4146 { "clflush", { Mb }, 0 },
4148 { "clflushopt", { Mb }, 0 },
4154 { "popcntS", { Gv, Ev }, 0 },
4159 { "bsfS", { Gv, Ev }, 0 },
4160 { "tzcntS", { Gv, Ev }, 0 },
4161 { "bsfS", { Gv, Ev }, 0 },
4166 { "bsrS", { Gv, Ev }, 0 },
4167 { "lzcntS", { Gv, Ev }, 0 },
4168 { "bsrS", { Gv, Ev }, 0 },
4173 { "cmpps", { XM, EXx, CMP }, PREFIX_OPCODE },
4174 { "cmpss", { XM, EXd, CMP }, PREFIX_OPCODE },
4175 { "cmppd", { XM, EXx, CMP }, PREFIX_OPCODE },
4176 { "cmpsd", { XM, EXq, CMP }, PREFIX_OPCODE },
4179 /* PREFIX_MOD_0_0FC3 */
4181 { "movntiS", { Ev, Gv }, PREFIX_OPCODE },
4184 /* PREFIX_MOD_0_0FC7_REG_6 */
4186 { "vmptrld",{ Mq }, 0 },
4187 { "vmxon", { Mq }, 0 },
4188 { "vmclear",{ Mq }, 0 },
4191 /* PREFIX_MOD_3_0FC7_REG_6 */
4193 { "rdrand", { Ev }, 0 },
4195 { "rdrand", { Ev }, 0 }
4198 /* PREFIX_MOD_3_0FC7_REG_7 */
4200 { "rdseed", { Ev }, 0 },
4201 { "rdpid", { Em }, 0 },
4202 { "rdseed", { Ev }, 0 },
4209 { "addsubpd", { XM, EXx }, 0 },
4210 { "addsubps", { XM, EXx }, 0 },
4216 { "movq2dq",{ XM, MS }, 0 },
4217 { "movq", { EXqS, XM }, 0 },
4218 { "movdq2q",{ MX, XS }, 0 },
4224 { "cvtdq2pd", { XM, EXq }, PREFIX_OPCODE },
4225 { "cvttpd2dq", { XM, EXx }, PREFIX_OPCODE },
4226 { "cvtpd2dq", { XM, EXx }, PREFIX_OPCODE },
4231 { "movntq", { Mq, MX }, PREFIX_OPCODE },
4233 { MOD_TABLE (MOD_0FE7_PREFIX_2) },
4241 { MOD_TABLE (MOD_0FF0_PREFIX_3) },
4246 { "maskmovq", { MX, MS }, PREFIX_OPCODE },
4248 { "maskmovdqu", { XM, XS }, PREFIX_OPCODE },
4255 { "pblendvb", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4262 { "blendvps", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4269 { "blendvpd", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4276 { "ptest", { XM, EXx }, PREFIX_OPCODE },
4283 { "pmovsxbw", { XM, EXq }, PREFIX_OPCODE },
4290 { "pmovsxbd", { XM, EXd }, PREFIX_OPCODE },
4297 { "pmovsxbq", { XM, EXw }, PREFIX_OPCODE },
4304 { "pmovsxwd", { XM, EXq }, PREFIX_OPCODE },
4311 { "pmovsxwq", { XM, EXd }, PREFIX_OPCODE },
4318 { "pmovsxdq", { XM, EXq }, PREFIX_OPCODE },
4325 { "pmuldq", { XM, EXx }, PREFIX_OPCODE },
4332 { "pcmpeqq", { XM, EXx }, PREFIX_OPCODE },
4339 { MOD_TABLE (MOD_0F382A_PREFIX_2) },
4346 { "packusdw", { XM, EXx }, PREFIX_OPCODE },
4353 { "pmovzxbw", { XM, EXq }, PREFIX_OPCODE },
4360 { "pmovzxbd", { XM, EXd }, PREFIX_OPCODE },
4367 { "pmovzxbq", { XM, EXw }, PREFIX_OPCODE },
4374 { "pmovzxwd", { XM, EXq }, PREFIX_OPCODE },
4381 { "pmovzxwq", { XM, EXd }, PREFIX_OPCODE },
4388 { "pmovzxdq", { XM, EXq }, PREFIX_OPCODE },
4395 { "pcmpgtq", { XM, EXx }, PREFIX_OPCODE },
4402 { "pminsb", { XM, EXx }, PREFIX_OPCODE },
4409 { "pminsd", { XM, EXx }, PREFIX_OPCODE },
4416 { "pminuw", { XM, EXx }, PREFIX_OPCODE },
4423 { "pminud", { XM, EXx }, PREFIX_OPCODE },
4430 { "pmaxsb", { XM, EXx }, PREFIX_OPCODE },
4437 { "pmaxsd", { XM, EXx }, PREFIX_OPCODE },
4444 { "pmaxuw", { XM, EXx }, PREFIX_OPCODE },
4451 { "pmaxud", { XM, EXx }, PREFIX_OPCODE },
4458 { "pmulld", { XM, EXx }, PREFIX_OPCODE },
4465 { "phminposuw", { XM, EXx }, PREFIX_OPCODE },
4472 { "invept", { Gm, Mo }, PREFIX_OPCODE },
4479 { "invvpid", { Gm, Mo }, PREFIX_OPCODE },
4486 { "invpcid", { Gm, M }, PREFIX_OPCODE },
4491 { "sha1nexte", { XM, EXxmm }, PREFIX_OPCODE },
4496 { "sha1msg1", { XM, EXxmm }, PREFIX_OPCODE },
4501 { "sha1msg2", { XM, EXxmm }, PREFIX_OPCODE },
4506 { "sha256rnds2", { XM, EXxmm, XMM0 }, PREFIX_OPCODE },
4511 { "sha256msg1", { XM, EXxmm }, PREFIX_OPCODE },
4516 { "sha256msg2", { XM, EXxmm }, PREFIX_OPCODE },
4523 { "aesimc", { XM, EXx }, PREFIX_OPCODE },
4530 { "aesenc", { XM, EXx }, PREFIX_OPCODE },
4537 { "aesenclast", { XM, EXx }, PREFIX_OPCODE },
4544 { "aesdec", { XM, EXx }, PREFIX_OPCODE },
4551 { "aesdeclast", { XM, EXx }, PREFIX_OPCODE },
4556 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4558 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4559 { "crc32", { Gdq, { CRC32_Fixup, b_mode } }, PREFIX_OPCODE },
4564 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4566 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4567 { "crc32", { Gdq, { CRC32_Fixup, v_mode } }, PREFIX_OPCODE },
4574 { MOD_TABLE (MOD_0F38F5_PREFIX_2) },
4579 { MOD_TABLE (MOD_0F38F6_PREFIX_0) },
4580 { "adoxS", { Gdq, Edq}, PREFIX_OPCODE },
4581 { "adcxS", { Gdq, Edq}, PREFIX_OPCODE },
4589 { "roundps", { XM, EXx, Ib }, PREFIX_OPCODE },
4596 { "roundpd", { XM, EXx, Ib }, PREFIX_OPCODE },
4603 { "roundss", { XM, EXd, Ib }, PREFIX_OPCODE },
4610 { "roundsd", { XM, EXq, Ib }, PREFIX_OPCODE },
4617 { "blendps", { XM, EXx, Ib }, PREFIX_OPCODE },
4624 { "blendpd", { XM, EXx, Ib }, PREFIX_OPCODE },
4631 { "pblendw", { XM, EXx, Ib }, PREFIX_OPCODE },
4638 { "pextrb", { Edqb, XM, Ib }, PREFIX_OPCODE },
4645 { "pextrw", { Edqw, XM, Ib }, PREFIX_OPCODE },
4652 { "pextrK", { Edq, XM, Ib }, PREFIX_OPCODE },
4659 { "extractps", { Edqd, XM, Ib }, PREFIX_OPCODE },
4666 { "pinsrb", { XM, Edqb, Ib }, PREFIX_OPCODE },
4673 { "insertps", { XM, EXd, Ib }, PREFIX_OPCODE },
4680 { "pinsrK", { XM, Edq, Ib }, PREFIX_OPCODE },
4687 { "dpps", { XM, EXx, Ib }, PREFIX_OPCODE },
4694 { "dppd", { XM, EXx, Ib }, PREFIX_OPCODE },
4701 { "mpsadbw", { XM, EXx, Ib }, PREFIX_OPCODE },
4708 { "pclmulqdq", { XM, EXx, PCLMUL }, PREFIX_OPCODE },
4715 { "pcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
4722 { "pcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
4729 { "pcmpistrm", { XM, EXx, Ib }, PREFIX_OPCODE },
4736 { "pcmpistri", { XM, EXx, Ib }, PREFIX_OPCODE },
4741 { "sha1rnds4", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4748 { "aeskeygenassist", { XM, EXx, Ib }, PREFIX_OPCODE },
4751 /* PREFIX_VEX_0F10 */
4753 { VEX_W_TABLE (VEX_W_0F10_P_0) },
4754 { VEX_LEN_TABLE (VEX_LEN_0F10_P_1) },
4755 { VEX_W_TABLE (VEX_W_0F10_P_2) },
4756 { VEX_LEN_TABLE (VEX_LEN_0F10_P_3) },
4759 /* PREFIX_VEX_0F11 */
4761 { VEX_W_TABLE (VEX_W_0F11_P_0) },
4762 { VEX_LEN_TABLE (VEX_LEN_0F11_P_1) },
4763 { VEX_W_TABLE (VEX_W_0F11_P_2) },
4764 { VEX_LEN_TABLE (VEX_LEN_0F11_P_3) },
4767 /* PREFIX_VEX_0F12 */
4769 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0) },
4770 { VEX_W_TABLE (VEX_W_0F12_P_1) },
4771 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2) },
4772 { VEX_W_TABLE (VEX_W_0F12_P_3) },
4775 /* PREFIX_VEX_0F16 */
4777 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0) },
4778 { VEX_W_TABLE (VEX_W_0F16_P_1) },
4779 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2) },
4782 /* PREFIX_VEX_0F2A */
4785 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_1) },
4787 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_3) },
4790 /* PREFIX_VEX_0F2C */
4793 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_1) },
4795 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_3) },
4798 /* PREFIX_VEX_0F2D */
4801 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_1) },
4803 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_3) },
4806 /* PREFIX_VEX_0F2E */
4808 { VEX_LEN_TABLE (VEX_LEN_0F2E_P_0) },
4810 { VEX_LEN_TABLE (VEX_LEN_0F2E_P_2) },
4813 /* PREFIX_VEX_0F2F */
4815 { VEX_LEN_TABLE (VEX_LEN_0F2F_P_0) },
4817 { VEX_LEN_TABLE (VEX_LEN_0F2F_P_2) },
4820 /* PREFIX_VEX_0F41 */
4822 { VEX_LEN_TABLE (VEX_LEN_0F41_P_0) },
4824 { VEX_LEN_TABLE (VEX_LEN_0F41_P_2) },
4827 /* PREFIX_VEX_0F42 */
4829 { VEX_LEN_TABLE (VEX_LEN_0F42_P_0) },
4831 { VEX_LEN_TABLE (VEX_LEN_0F42_P_2) },
4834 /* PREFIX_VEX_0F44 */
4836 { VEX_LEN_TABLE (VEX_LEN_0F44_P_0) },
4838 { VEX_LEN_TABLE (VEX_LEN_0F44_P_2) },
4841 /* PREFIX_VEX_0F45 */
4843 { VEX_LEN_TABLE (VEX_LEN_0F45_P_0) },
4845 { VEX_LEN_TABLE (VEX_LEN_0F45_P_2) },
4848 /* PREFIX_VEX_0F46 */
4850 { VEX_LEN_TABLE (VEX_LEN_0F46_P_0) },
4852 { VEX_LEN_TABLE (VEX_LEN_0F46_P_2) },
4855 /* PREFIX_VEX_0F47 */
4857 { VEX_LEN_TABLE (VEX_LEN_0F47_P_0) },
4859 { VEX_LEN_TABLE (VEX_LEN_0F47_P_2) },
4862 /* PREFIX_VEX_0F4A */
4864 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_0) },
4866 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_2) },
4869 /* PREFIX_VEX_0F4B */
4871 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_0) },
4873 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_2) },
4876 /* PREFIX_VEX_0F51 */
4878 { VEX_W_TABLE (VEX_W_0F51_P_0) },
4879 { VEX_LEN_TABLE (VEX_LEN_0F51_P_1) },
4880 { VEX_W_TABLE (VEX_W_0F51_P_2) },
4881 { VEX_LEN_TABLE (VEX_LEN_0F51_P_3) },
4884 /* PREFIX_VEX_0F52 */
4886 { VEX_W_TABLE (VEX_W_0F52_P_0) },
4887 { VEX_LEN_TABLE (VEX_LEN_0F52_P_1) },
4890 /* PREFIX_VEX_0F53 */
4892 { VEX_W_TABLE (VEX_W_0F53_P_0) },
4893 { VEX_LEN_TABLE (VEX_LEN_0F53_P_1) },
4896 /* PREFIX_VEX_0F58 */
4898 { VEX_W_TABLE (VEX_W_0F58_P_0) },
4899 { VEX_LEN_TABLE (VEX_LEN_0F58_P_1) },
4900 { VEX_W_TABLE (VEX_W_0F58_P_2) },
4901 { VEX_LEN_TABLE (VEX_LEN_0F58_P_3) },
4904 /* PREFIX_VEX_0F59 */
4906 { VEX_W_TABLE (VEX_W_0F59_P_0) },
4907 { VEX_LEN_TABLE (VEX_LEN_0F59_P_1) },
4908 { VEX_W_TABLE (VEX_W_0F59_P_2) },
4909 { VEX_LEN_TABLE (VEX_LEN_0F59_P_3) },
4912 /* PREFIX_VEX_0F5A */
4914 { VEX_W_TABLE (VEX_W_0F5A_P_0) },
4915 { VEX_LEN_TABLE (VEX_LEN_0F5A_P_1) },
4916 { "vcvtpd2ps%XY", { XMM, EXx }, 0 },
4917 { VEX_LEN_TABLE (VEX_LEN_0F5A_P_3) },
4920 /* PREFIX_VEX_0F5B */
4922 { VEX_W_TABLE (VEX_W_0F5B_P_0) },
4923 { VEX_W_TABLE (VEX_W_0F5B_P_1) },
4924 { VEX_W_TABLE (VEX_W_0F5B_P_2) },
4927 /* PREFIX_VEX_0F5C */
4929 { VEX_W_TABLE (VEX_W_0F5C_P_0) },
4930 { VEX_LEN_TABLE (VEX_LEN_0F5C_P_1) },
4931 { VEX_W_TABLE (VEX_W_0F5C_P_2) },
4932 { VEX_LEN_TABLE (VEX_LEN_0F5C_P_3) },
4935 /* PREFIX_VEX_0F5D */
4937 { VEX_W_TABLE (VEX_W_0F5D_P_0) },
4938 { VEX_LEN_TABLE (VEX_LEN_0F5D_P_1) },
4939 { VEX_W_TABLE (VEX_W_0F5D_P_2) },
4940 { VEX_LEN_TABLE (VEX_LEN_0F5D_P_3) },
4943 /* PREFIX_VEX_0F5E */
4945 { VEX_W_TABLE (VEX_W_0F5E_P_0) },
4946 { VEX_LEN_TABLE (VEX_LEN_0F5E_P_1) },
4947 { VEX_W_TABLE (VEX_W_0F5E_P_2) },
4948 { VEX_LEN_TABLE (VEX_LEN_0F5E_P_3) },
4951 /* PREFIX_VEX_0F5F */
4953 { VEX_W_TABLE (VEX_W_0F5F_P_0) },
4954 { VEX_LEN_TABLE (VEX_LEN_0F5F_P_1) },
4955 { VEX_W_TABLE (VEX_W_0F5F_P_2) },
4956 { VEX_LEN_TABLE (VEX_LEN_0F5F_P_3) },
4959 /* PREFIX_VEX_0F60 */
4963 { VEX_W_TABLE (VEX_W_0F60_P_2) },
4966 /* PREFIX_VEX_0F61 */
4970 { VEX_W_TABLE (VEX_W_0F61_P_2) },
4973 /* PREFIX_VEX_0F62 */
4977 { VEX_W_TABLE (VEX_W_0F62_P_2) },
4980 /* PREFIX_VEX_0F63 */
4984 { VEX_W_TABLE (VEX_W_0F63_P_2) },
4987 /* PREFIX_VEX_0F64 */
4991 { VEX_W_TABLE (VEX_W_0F64_P_2) },
4994 /* PREFIX_VEX_0F65 */
4998 { VEX_W_TABLE (VEX_W_0F65_P_2) },
5001 /* PREFIX_VEX_0F66 */
5005 { VEX_W_TABLE (VEX_W_0F66_P_2) },
5008 /* PREFIX_VEX_0F67 */
5012 { VEX_W_TABLE (VEX_W_0F67_P_2) },
5015 /* PREFIX_VEX_0F68 */
5019 { VEX_W_TABLE (VEX_W_0F68_P_2) },
5022 /* PREFIX_VEX_0F69 */
5026 { VEX_W_TABLE (VEX_W_0F69_P_2) },
5029 /* PREFIX_VEX_0F6A */
5033 { VEX_W_TABLE (VEX_W_0F6A_P_2) },
5036 /* PREFIX_VEX_0F6B */
5040 { VEX_W_TABLE (VEX_W_0F6B_P_2) },
5043 /* PREFIX_VEX_0F6C */
5047 { VEX_W_TABLE (VEX_W_0F6C_P_2) },
5050 /* PREFIX_VEX_0F6D */
5054 { VEX_W_TABLE (VEX_W_0F6D_P_2) },
5057 /* PREFIX_VEX_0F6E */
5061 { VEX_LEN_TABLE (VEX_LEN_0F6E_P_2) },
5064 /* PREFIX_VEX_0F6F */
5067 { VEX_W_TABLE (VEX_W_0F6F_P_1) },
5068 { VEX_W_TABLE (VEX_W_0F6F_P_2) },
5071 /* PREFIX_VEX_0F70 */
5074 { VEX_W_TABLE (VEX_W_0F70_P_1) },
5075 { VEX_W_TABLE (VEX_W_0F70_P_2) },
5076 { VEX_W_TABLE (VEX_W_0F70_P_3) },
5079 /* PREFIX_VEX_0F71_REG_2 */
5083 { VEX_W_TABLE (VEX_W_0F71_R_2_P_2) },
5086 /* PREFIX_VEX_0F71_REG_4 */
5090 { VEX_W_TABLE (VEX_W_0F71_R_4_P_2) },
5093 /* PREFIX_VEX_0F71_REG_6 */
5097 { VEX_W_TABLE (VEX_W_0F71_R_6_P_2) },
5100 /* PREFIX_VEX_0F72_REG_2 */
5104 { VEX_W_TABLE (VEX_W_0F72_R_2_P_2) },
5107 /* PREFIX_VEX_0F72_REG_4 */
5111 { VEX_W_TABLE (VEX_W_0F72_R_4_P_2) },
5114 /* PREFIX_VEX_0F72_REG_6 */
5118 { VEX_W_TABLE (VEX_W_0F72_R_6_P_2) },
5121 /* PREFIX_VEX_0F73_REG_2 */
5125 { VEX_W_TABLE (VEX_W_0F73_R_2_P_2) },
5128 /* PREFIX_VEX_0F73_REG_3 */
5132 { VEX_W_TABLE (VEX_W_0F73_R_3_P_2) },
5135 /* PREFIX_VEX_0F73_REG_6 */
5139 { VEX_W_TABLE (VEX_W_0F73_R_6_P_2) },
5142 /* PREFIX_VEX_0F73_REG_7 */
5146 { VEX_W_TABLE (VEX_W_0F73_R_7_P_2) },
5149 /* PREFIX_VEX_0F74 */
5153 { VEX_W_TABLE (VEX_W_0F74_P_2) },
5156 /* PREFIX_VEX_0F75 */
5160 { VEX_W_TABLE (VEX_W_0F75_P_2) },
5163 /* PREFIX_VEX_0F76 */
5167 { VEX_W_TABLE (VEX_W_0F76_P_2) },
5170 /* PREFIX_VEX_0F77 */
5172 { VEX_W_TABLE (VEX_W_0F77_P_0) },
5175 /* PREFIX_VEX_0F7C */
5179 { VEX_W_TABLE (VEX_W_0F7C_P_2) },
5180 { VEX_W_TABLE (VEX_W_0F7C_P_3) },
5183 /* PREFIX_VEX_0F7D */
5187 { VEX_W_TABLE (VEX_W_0F7D_P_2) },
5188 { VEX_W_TABLE (VEX_W_0F7D_P_3) },
5191 /* PREFIX_VEX_0F7E */
5194 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1) },
5195 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2) },
5198 /* PREFIX_VEX_0F7F */
5201 { VEX_W_TABLE (VEX_W_0F7F_P_1) },
5202 { VEX_W_TABLE (VEX_W_0F7F_P_2) },
5205 /* PREFIX_VEX_0F90 */
5207 { VEX_LEN_TABLE (VEX_LEN_0F90_P_0) },
5209 { VEX_LEN_TABLE (VEX_LEN_0F90_P_2) },
5212 /* PREFIX_VEX_0F91 */
5214 { VEX_LEN_TABLE (VEX_LEN_0F91_P_0) },
5216 { VEX_LEN_TABLE (VEX_LEN_0F91_P_2) },
5219 /* PREFIX_VEX_0F92 */
5221 { VEX_LEN_TABLE (VEX_LEN_0F92_P_0) },
5223 { VEX_LEN_TABLE (VEX_LEN_0F92_P_2) },
5224 { VEX_LEN_TABLE (VEX_LEN_0F92_P_3) },
5227 /* PREFIX_VEX_0F93 */
5229 { VEX_LEN_TABLE (VEX_LEN_0F93_P_0) },
5231 { VEX_LEN_TABLE (VEX_LEN_0F93_P_2) },
5232 { VEX_LEN_TABLE (VEX_LEN_0F93_P_3) },
5235 /* PREFIX_VEX_0F98 */
5237 { VEX_LEN_TABLE (VEX_LEN_0F98_P_0) },
5239 { VEX_LEN_TABLE (VEX_LEN_0F98_P_2) },
5242 /* PREFIX_VEX_0F99 */
5244 { VEX_LEN_TABLE (VEX_LEN_0F99_P_0) },
5246 { VEX_LEN_TABLE (VEX_LEN_0F99_P_2) },
5249 /* PREFIX_VEX_0FC2 */
5251 { VEX_W_TABLE (VEX_W_0FC2_P_0) },
5252 { VEX_LEN_TABLE (VEX_LEN_0FC2_P_1) },
5253 { VEX_W_TABLE (VEX_W_0FC2_P_2) },
5254 { VEX_LEN_TABLE (VEX_LEN_0FC2_P_3) },
5257 /* PREFIX_VEX_0FC4 */
5261 { VEX_LEN_TABLE (VEX_LEN_0FC4_P_2) },
5264 /* PREFIX_VEX_0FC5 */
5268 { VEX_LEN_TABLE (VEX_LEN_0FC5_P_2) },
5271 /* PREFIX_VEX_0FD0 */
5275 { VEX_W_TABLE (VEX_W_0FD0_P_2) },
5276 { VEX_W_TABLE (VEX_W_0FD0_P_3) },
5279 /* PREFIX_VEX_0FD1 */
5283 { VEX_W_TABLE (VEX_W_0FD1_P_2) },
5286 /* PREFIX_VEX_0FD2 */
5290 { VEX_W_TABLE (VEX_W_0FD2_P_2) },
5293 /* PREFIX_VEX_0FD3 */
5297 { VEX_W_TABLE (VEX_W_0FD3_P_2) },
5300 /* PREFIX_VEX_0FD4 */
5304 { VEX_W_TABLE (VEX_W_0FD4_P_2) },
5307 /* PREFIX_VEX_0FD5 */
5311 { VEX_W_TABLE (VEX_W_0FD5_P_2) },
5314 /* PREFIX_VEX_0FD6 */
5318 { VEX_LEN_TABLE (VEX_LEN_0FD6_P_2) },
5321 /* PREFIX_VEX_0FD7 */
5325 { MOD_TABLE (MOD_VEX_0FD7_PREFIX_2) },
5328 /* PREFIX_VEX_0FD8 */
5332 { VEX_W_TABLE (VEX_W_0FD8_P_2) },
5335 /* PREFIX_VEX_0FD9 */
5339 { VEX_W_TABLE (VEX_W_0FD9_P_2) },
5342 /* PREFIX_VEX_0FDA */
5346 { VEX_W_TABLE (VEX_W_0FDA_P_2) },
5349 /* PREFIX_VEX_0FDB */
5353 { VEX_W_TABLE (VEX_W_0FDB_P_2) },
5356 /* PREFIX_VEX_0FDC */
5360 { VEX_W_TABLE (VEX_W_0FDC_P_2) },
5363 /* PREFIX_VEX_0FDD */
5367 { VEX_W_TABLE (VEX_W_0FDD_P_2) },
5370 /* PREFIX_VEX_0FDE */
5374 { VEX_W_TABLE (VEX_W_0FDE_P_2) },
5377 /* PREFIX_VEX_0FDF */
5381 { VEX_W_TABLE (VEX_W_0FDF_P_2) },
5384 /* PREFIX_VEX_0FE0 */
5388 { VEX_W_TABLE (VEX_W_0FE0_P_2) },
5391 /* PREFIX_VEX_0FE1 */
5395 { VEX_W_TABLE (VEX_W_0FE1_P_2) },
5398 /* PREFIX_VEX_0FE2 */
5402 { VEX_W_TABLE (VEX_W_0FE2_P_2) },
5405 /* PREFIX_VEX_0FE3 */
5409 { VEX_W_TABLE (VEX_W_0FE3_P_2) },
5412 /* PREFIX_VEX_0FE4 */
5416 { VEX_W_TABLE (VEX_W_0FE4_P_2) },
5419 /* PREFIX_VEX_0FE5 */
5423 { VEX_W_TABLE (VEX_W_0FE5_P_2) },
5426 /* PREFIX_VEX_0FE6 */
5429 { VEX_W_TABLE (VEX_W_0FE6_P_1) },
5430 { VEX_W_TABLE (VEX_W_0FE6_P_2) },
5431 { VEX_W_TABLE (VEX_W_0FE6_P_3) },
5434 /* PREFIX_VEX_0FE7 */
5438 { MOD_TABLE (MOD_VEX_0FE7_PREFIX_2) },
5441 /* PREFIX_VEX_0FE8 */
5445 { VEX_W_TABLE (VEX_W_0FE8_P_2) },
5448 /* PREFIX_VEX_0FE9 */
5452 { VEX_W_TABLE (VEX_W_0FE9_P_2) },
5455 /* PREFIX_VEX_0FEA */
5459 { VEX_W_TABLE (VEX_W_0FEA_P_2) },
5462 /* PREFIX_VEX_0FEB */
5466 { VEX_W_TABLE (VEX_W_0FEB_P_2) },
5469 /* PREFIX_VEX_0FEC */
5473 { VEX_W_TABLE (VEX_W_0FEC_P_2) },
5476 /* PREFIX_VEX_0FED */
5480 { VEX_W_TABLE (VEX_W_0FED_P_2) },
5483 /* PREFIX_VEX_0FEE */
5487 { VEX_W_TABLE (VEX_W_0FEE_P_2) },
5490 /* PREFIX_VEX_0FEF */
5494 { VEX_W_TABLE (VEX_W_0FEF_P_2) },
5497 /* PREFIX_VEX_0FF0 */
5502 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3) },
5505 /* PREFIX_VEX_0FF1 */
5509 { VEX_W_TABLE (VEX_W_0FF1_P_2) },
5512 /* PREFIX_VEX_0FF2 */
5516 { VEX_W_TABLE (VEX_W_0FF2_P_2) },
5519 /* PREFIX_VEX_0FF3 */
5523 { VEX_W_TABLE (VEX_W_0FF3_P_2) },
5526 /* PREFIX_VEX_0FF4 */
5530 { VEX_W_TABLE (VEX_W_0FF4_P_2) },
5533 /* PREFIX_VEX_0FF5 */
5537 { VEX_W_TABLE (VEX_W_0FF5_P_2) },
5540 /* PREFIX_VEX_0FF6 */
5544 { VEX_W_TABLE (VEX_W_0FF6_P_2) },
5547 /* PREFIX_VEX_0FF7 */
5551 { VEX_LEN_TABLE (VEX_LEN_0FF7_P_2) },
5554 /* PREFIX_VEX_0FF8 */
5558 { VEX_W_TABLE (VEX_W_0FF8_P_2) },
5561 /* PREFIX_VEX_0FF9 */
5565 { VEX_W_TABLE (VEX_W_0FF9_P_2) },
5568 /* PREFIX_VEX_0FFA */
5572 { VEX_W_TABLE (VEX_W_0FFA_P_2) },
5575 /* PREFIX_VEX_0FFB */
5579 { VEX_W_TABLE (VEX_W_0FFB_P_2) },
5582 /* PREFIX_VEX_0FFC */
5586 { VEX_W_TABLE (VEX_W_0FFC_P_2) },
5589 /* PREFIX_VEX_0FFD */
5593 { VEX_W_TABLE (VEX_W_0FFD_P_2) },
5596 /* PREFIX_VEX_0FFE */
5600 { VEX_W_TABLE (VEX_W_0FFE_P_2) },
5603 /* PREFIX_VEX_0F3800 */
5607 { VEX_W_TABLE (VEX_W_0F3800_P_2) },
5610 /* PREFIX_VEX_0F3801 */
5614 { VEX_W_TABLE (VEX_W_0F3801_P_2) },
5617 /* PREFIX_VEX_0F3802 */
5621 { VEX_W_TABLE (VEX_W_0F3802_P_2) },
5624 /* PREFIX_VEX_0F3803 */
5628 { VEX_W_TABLE (VEX_W_0F3803_P_2) },
5631 /* PREFIX_VEX_0F3804 */
5635 { VEX_W_TABLE (VEX_W_0F3804_P_2) },
5638 /* PREFIX_VEX_0F3805 */
5642 { VEX_W_TABLE (VEX_W_0F3805_P_2) },
5645 /* PREFIX_VEX_0F3806 */
5649 { VEX_W_TABLE (VEX_W_0F3806_P_2) },
5652 /* PREFIX_VEX_0F3807 */
5656 { VEX_W_TABLE (VEX_W_0F3807_P_2) },
5659 /* PREFIX_VEX_0F3808 */
5663 { VEX_W_TABLE (VEX_W_0F3808_P_2) },
5666 /* PREFIX_VEX_0F3809 */
5670 { VEX_W_TABLE (VEX_W_0F3809_P_2) },
5673 /* PREFIX_VEX_0F380A */
5677 { VEX_W_TABLE (VEX_W_0F380A_P_2) },
5680 /* PREFIX_VEX_0F380B */
5684 { VEX_W_TABLE (VEX_W_0F380B_P_2) },
5687 /* PREFIX_VEX_0F380C */
5691 { VEX_W_TABLE (VEX_W_0F380C_P_2) },
5694 /* PREFIX_VEX_0F380D */
5698 { VEX_W_TABLE (VEX_W_0F380D_P_2) },
5701 /* PREFIX_VEX_0F380E */
5705 { VEX_W_TABLE (VEX_W_0F380E_P_2) },
5708 /* PREFIX_VEX_0F380F */
5712 { VEX_W_TABLE (VEX_W_0F380F_P_2) },
5715 /* PREFIX_VEX_0F3813 */
5719 { "vcvtph2ps", { XM, EXxmmq }, 0 },
5722 /* PREFIX_VEX_0F3816 */
5726 { VEX_LEN_TABLE (VEX_LEN_0F3816_P_2) },
5729 /* PREFIX_VEX_0F3817 */
5733 { VEX_W_TABLE (VEX_W_0F3817_P_2) },
5736 /* PREFIX_VEX_0F3818 */
5740 { VEX_W_TABLE (VEX_W_0F3818_P_2) },
5743 /* PREFIX_VEX_0F3819 */
5747 { VEX_LEN_TABLE (VEX_LEN_0F3819_P_2) },
5750 /* PREFIX_VEX_0F381A */
5754 { MOD_TABLE (MOD_VEX_0F381A_PREFIX_2) },
5757 /* PREFIX_VEX_0F381C */
5761 { VEX_W_TABLE (VEX_W_0F381C_P_2) },
5764 /* PREFIX_VEX_0F381D */
5768 { VEX_W_TABLE (VEX_W_0F381D_P_2) },
5771 /* PREFIX_VEX_0F381E */
5775 { VEX_W_TABLE (VEX_W_0F381E_P_2) },
5778 /* PREFIX_VEX_0F3820 */
5782 { VEX_W_TABLE (VEX_W_0F3820_P_2) },
5785 /* PREFIX_VEX_0F3821 */
5789 { VEX_W_TABLE (VEX_W_0F3821_P_2) },
5792 /* PREFIX_VEX_0F3822 */
5796 { VEX_W_TABLE (VEX_W_0F3822_P_2) },
5799 /* PREFIX_VEX_0F3823 */
5803 { VEX_W_TABLE (VEX_W_0F3823_P_2) },
5806 /* PREFIX_VEX_0F3824 */
5810 { VEX_W_TABLE (VEX_W_0F3824_P_2) },
5813 /* PREFIX_VEX_0F3825 */
5817 { VEX_W_TABLE (VEX_W_0F3825_P_2) },
5820 /* PREFIX_VEX_0F3828 */
5824 { VEX_W_TABLE (VEX_W_0F3828_P_2) },
5827 /* PREFIX_VEX_0F3829 */
5831 { VEX_W_TABLE (VEX_W_0F3829_P_2) },
5834 /* PREFIX_VEX_0F382A */
5838 { MOD_TABLE (MOD_VEX_0F382A_PREFIX_2) },
5841 /* PREFIX_VEX_0F382B */
5845 { VEX_W_TABLE (VEX_W_0F382B_P_2) },
5848 /* PREFIX_VEX_0F382C */
5852 { MOD_TABLE (MOD_VEX_0F382C_PREFIX_2) },
5855 /* PREFIX_VEX_0F382D */
5859 { MOD_TABLE (MOD_VEX_0F382D_PREFIX_2) },
5862 /* PREFIX_VEX_0F382E */
5866 { MOD_TABLE (MOD_VEX_0F382E_PREFIX_2) },
5869 /* PREFIX_VEX_0F382F */
5873 { MOD_TABLE (MOD_VEX_0F382F_PREFIX_2) },
5876 /* PREFIX_VEX_0F3830 */
5880 { VEX_W_TABLE (VEX_W_0F3830_P_2) },
5883 /* PREFIX_VEX_0F3831 */
5887 { VEX_W_TABLE (VEX_W_0F3831_P_2) },
5890 /* PREFIX_VEX_0F3832 */
5894 { VEX_W_TABLE (VEX_W_0F3832_P_2) },
5897 /* PREFIX_VEX_0F3833 */
5901 { VEX_W_TABLE (VEX_W_0F3833_P_2) },
5904 /* PREFIX_VEX_0F3834 */
5908 { VEX_W_TABLE (VEX_W_0F3834_P_2) },
5911 /* PREFIX_VEX_0F3835 */
5915 { VEX_W_TABLE (VEX_W_0F3835_P_2) },
5918 /* PREFIX_VEX_0F3836 */
5922 { VEX_LEN_TABLE (VEX_LEN_0F3836_P_2) },
5925 /* PREFIX_VEX_0F3837 */
5929 { VEX_W_TABLE (VEX_W_0F3837_P_2) },
5932 /* PREFIX_VEX_0F3838 */
5936 { VEX_W_TABLE (VEX_W_0F3838_P_2) },
5939 /* PREFIX_VEX_0F3839 */
5943 { VEX_W_TABLE (VEX_W_0F3839_P_2) },
5946 /* PREFIX_VEX_0F383A */
5950 { VEX_W_TABLE (VEX_W_0F383A_P_2) },
5953 /* PREFIX_VEX_0F383B */
5957 { VEX_W_TABLE (VEX_W_0F383B_P_2) },
5960 /* PREFIX_VEX_0F383C */
5964 { VEX_W_TABLE (VEX_W_0F383C_P_2) },
5967 /* PREFIX_VEX_0F383D */
5971 { VEX_W_TABLE (VEX_W_0F383D_P_2) },
5974 /* PREFIX_VEX_0F383E */
5978 { VEX_W_TABLE (VEX_W_0F383E_P_2) },
5981 /* PREFIX_VEX_0F383F */
5985 { VEX_W_TABLE (VEX_W_0F383F_P_2) },
5988 /* PREFIX_VEX_0F3840 */
5992 { VEX_W_TABLE (VEX_W_0F3840_P_2) },
5995 /* PREFIX_VEX_0F3841 */
5999 { VEX_LEN_TABLE (VEX_LEN_0F3841_P_2) },
6002 /* PREFIX_VEX_0F3845 */
6006 { "vpsrlv%LW", { XM, Vex, EXx }, 0 },
6009 /* PREFIX_VEX_0F3846 */
6013 { VEX_W_TABLE (VEX_W_0F3846_P_2) },
6016 /* PREFIX_VEX_0F3847 */
6020 { "vpsllv%LW", { XM, Vex, EXx }, 0 },
6023 /* PREFIX_VEX_0F3858 */
6027 { VEX_W_TABLE (VEX_W_0F3858_P_2) },
6030 /* PREFIX_VEX_0F3859 */
6034 { VEX_W_TABLE (VEX_W_0F3859_P_2) },
6037 /* PREFIX_VEX_0F385A */
6041 { MOD_TABLE (MOD_VEX_0F385A_PREFIX_2) },
6044 /* PREFIX_VEX_0F3878 */
6048 { VEX_W_TABLE (VEX_W_0F3878_P_2) },
6051 /* PREFIX_VEX_0F3879 */
6055 { VEX_W_TABLE (VEX_W_0F3879_P_2) },
6058 /* PREFIX_VEX_0F388C */
6062 { MOD_TABLE (MOD_VEX_0F388C_PREFIX_2) },
6065 /* PREFIX_VEX_0F388E */
6069 { MOD_TABLE (MOD_VEX_0F388E_PREFIX_2) },
6072 /* PREFIX_VEX_0F3890 */
6076 { "vpgatherd%LW", { XM, MVexVSIBDWpX, Vex }, 0 },
6079 /* PREFIX_VEX_0F3891 */
6083 { "vpgatherq%LW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
6086 /* PREFIX_VEX_0F3892 */
6090 { "vgatherdp%XW", { XM, MVexVSIBDWpX, Vex }, 0 },
6093 /* PREFIX_VEX_0F3893 */
6097 { "vgatherqp%XW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
6100 /* PREFIX_VEX_0F3896 */
6104 { "vfmaddsub132p%XW", { XM, Vex, EXx }, 0 },
6107 /* PREFIX_VEX_0F3897 */
6111 { "vfmsubadd132p%XW", { XM, Vex, EXx }, 0 },
6114 /* PREFIX_VEX_0F3898 */
6118 { "vfmadd132p%XW", { XM, Vex, EXx }, 0 },
6121 /* PREFIX_VEX_0F3899 */
6125 { "vfmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6128 /* PREFIX_VEX_0F389A */
6132 { "vfmsub132p%XW", { XM, Vex, EXx }, 0 },
6135 /* PREFIX_VEX_0F389B */
6139 { "vfmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6142 /* PREFIX_VEX_0F389C */
6146 { "vfnmadd132p%XW", { XM, Vex, EXx }, 0 },
6149 /* PREFIX_VEX_0F389D */
6153 { "vfnmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6156 /* PREFIX_VEX_0F389E */
6160 { "vfnmsub132p%XW", { XM, Vex, EXx }, 0 },
6163 /* PREFIX_VEX_0F389F */
6167 { "vfnmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6170 /* PREFIX_VEX_0F38A6 */
6174 { "vfmaddsub213p%XW", { XM, Vex, EXx }, 0 },
6178 /* PREFIX_VEX_0F38A7 */
6182 { "vfmsubadd213p%XW", { XM, Vex, EXx }, 0 },
6185 /* PREFIX_VEX_0F38A8 */
6189 { "vfmadd213p%XW", { XM, Vex, EXx }, 0 },
6192 /* PREFIX_VEX_0F38A9 */
6196 { "vfmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6199 /* PREFIX_VEX_0F38AA */
6203 { "vfmsub213p%XW", { XM, Vex, EXx }, 0 },
6206 /* PREFIX_VEX_0F38AB */
6210 { "vfmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6213 /* PREFIX_VEX_0F38AC */
6217 { "vfnmadd213p%XW", { XM, Vex, EXx }, 0 },
6220 /* PREFIX_VEX_0F38AD */
6224 { "vfnmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6227 /* PREFIX_VEX_0F38AE */
6231 { "vfnmsub213p%XW", { XM, Vex, EXx }, 0 },
6234 /* PREFIX_VEX_0F38AF */
6238 { "vfnmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6241 /* PREFIX_VEX_0F38B6 */
6245 { "vfmaddsub231p%XW", { XM, Vex, EXx }, 0 },
6248 /* PREFIX_VEX_0F38B7 */
6252 { "vfmsubadd231p%XW", { XM, Vex, EXx }, 0 },
6255 /* PREFIX_VEX_0F38B8 */
6259 { "vfmadd231p%XW", { XM, Vex, EXx }, 0 },
6262 /* PREFIX_VEX_0F38B9 */
6266 { "vfmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6269 /* PREFIX_VEX_0F38BA */
6273 { "vfmsub231p%XW", { XM, Vex, EXx }, 0 },
6276 /* PREFIX_VEX_0F38BB */
6280 { "vfmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6283 /* PREFIX_VEX_0F38BC */
6287 { "vfnmadd231p%XW", { XM, Vex, EXx }, 0 },
6290 /* PREFIX_VEX_0F38BD */
6294 { "vfnmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6297 /* PREFIX_VEX_0F38BE */
6301 { "vfnmsub231p%XW", { XM, Vex, EXx }, 0 },
6304 /* PREFIX_VEX_0F38BF */
6308 { "vfnmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6311 /* PREFIX_VEX_0F38DB */
6315 { VEX_LEN_TABLE (VEX_LEN_0F38DB_P_2) },
6318 /* PREFIX_VEX_0F38DC */
6322 { VEX_LEN_TABLE (VEX_LEN_0F38DC_P_2) },
6325 /* PREFIX_VEX_0F38DD */
6329 { VEX_LEN_TABLE (VEX_LEN_0F38DD_P_2) },
6332 /* PREFIX_VEX_0F38DE */
6336 { VEX_LEN_TABLE (VEX_LEN_0F38DE_P_2) },
6339 /* PREFIX_VEX_0F38DF */
6343 { VEX_LEN_TABLE (VEX_LEN_0F38DF_P_2) },
6346 /* PREFIX_VEX_0F38F2 */
6348 { VEX_LEN_TABLE (VEX_LEN_0F38F2_P_0) },
6351 /* PREFIX_VEX_0F38F3_REG_1 */
6353 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_1_P_0) },
6356 /* PREFIX_VEX_0F38F3_REG_2 */
6358 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_2_P_0) },
6361 /* PREFIX_VEX_0F38F3_REG_3 */
6363 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_3_P_0) },
6366 /* PREFIX_VEX_0F38F5 */
6368 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_0) },
6369 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_1) },
6371 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_3) },
6374 /* PREFIX_VEX_0F38F6 */
6379 { VEX_LEN_TABLE (VEX_LEN_0F38F6_P_3) },
6382 /* PREFIX_VEX_0F38F7 */
6384 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_0) },
6385 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_1) },
6386 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_2) },
6387 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_3) },
6390 /* PREFIX_VEX_0F3A00 */
6394 { VEX_LEN_TABLE (VEX_LEN_0F3A00_P_2) },
6397 /* PREFIX_VEX_0F3A01 */
6401 { VEX_LEN_TABLE (VEX_LEN_0F3A01_P_2) },
6404 /* PREFIX_VEX_0F3A02 */
6408 { VEX_W_TABLE (VEX_W_0F3A02_P_2) },
6411 /* PREFIX_VEX_0F3A04 */
6415 { VEX_W_TABLE (VEX_W_0F3A04_P_2) },
6418 /* PREFIX_VEX_0F3A05 */
6422 { VEX_W_TABLE (VEX_W_0F3A05_P_2) },
6425 /* PREFIX_VEX_0F3A06 */
6429 { VEX_LEN_TABLE (VEX_LEN_0F3A06_P_2) },
6432 /* PREFIX_VEX_0F3A08 */
6436 { VEX_W_TABLE (VEX_W_0F3A08_P_2) },
6439 /* PREFIX_VEX_0F3A09 */
6443 { VEX_W_TABLE (VEX_W_0F3A09_P_2) },
6446 /* PREFIX_VEX_0F3A0A */
6450 { VEX_LEN_TABLE (VEX_LEN_0F3A0A_P_2) },
6453 /* PREFIX_VEX_0F3A0B */
6457 { VEX_LEN_TABLE (VEX_LEN_0F3A0B_P_2) },
6460 /* PREFIX_VEX_0F3A0C */
6464 { VEX_W_TABLE (VEX_W_0F3A0C_P_2) },
6467 /* PREFIX_VEX_0F3A0D */
6471 { VEX_W_TABLE (VEX_W_0F3A0D_P_2) },
6474 /* PREFIX_VEX_0F3A0E */
6478 { VEX_W_TABLE (VEX_W_0F3A0E_P_2) },
6481 /* PREFIX_VEX_0F3A0F */
6485 { VEX_W_TABLE (VEX_W_0F3A0F_P_2) },
6488 /* PREFIX_VEX_0F3A14 */
6492 { VEX_LEN_TABLE (VEX_LEN_0F3A14_P_2) },
6495 /* PREFIX_VEX_0F3A15 */
6499 { VEX_LEN_TABLE (VEX_LEN_0F3A15_P_2) },
6502 /* PREFIX_VEX_0F3A16 */
6506 { VEX_LEN_TABLE (VEX_LEN_0F3A16_P_2) },
6509 /* PREFIX_VEX_0F3A17 */
6513 { VEX_LEN_TABLE (VEX_LEN_0F3A17_P_2) },
6516 /* PREFIX_VEX_0F3A18 */
6520 { VEX_LEN_TABLE (VEX_LEN_0F3A18_P_2) },
6523 /* PREFIX_VEX_0F3A19 */
6527 { VEX_LEN_TABLE (VEX_LEN_0F3A19_P_2) },
6530 /* PREFIX_VEX_0F3A1D */
6534 { "vcvtps2ph", { EXxmmq, XM, Ib }, 0 },
6537 /* PREFIX_VEX_0F3A20 */
6541 { VEX_LEN_TABLE (VEX_LEN_0F3A20_P_2) },
6544 /* PREFIX_VEX_0F3A21 */
6548 { VEX_LEN_TABLE (VEX_LEN_0F3A21_P_2) },
6551 /* PREFIX_VEX_0F3A22 */
6555 { VEX_LEN_TABLE (VEX_LEN_0F3A22_P_2) },
6558 /* PREFIX_VEX_0F3A30 */
6562 { VEX_LEN_TABLE (VEX_LEN_0F3A30_P_2) },
6565 /* PREFIX_VEX_0F3A31 */
6569 { VEX_LEN_TABLE (VEX_LEN_0F3A31_P_2) },
6572 /* PREFIX_VEX_0F3A32 */
6576 { VEX_LEN_TABLE (VEX_LEN_0F3A32_P_2) },
6579 /* PREFIX_VEX_0F3A33 */
6583 { VEX_LEN_TABLE (VEX_LEN_0F3A33_P_2) },
6586 /* PREFIX_VEX_0F3A38 */
6590 { VEX_LEN_TABLE (VEX_LEN_0F3A38_P_2) },
6593 /* PREFIX_VEX_0F3A39 */
6597 { VEX_LEN_TABLE (VEX_LEN_0F3A39_P_2) },
6600 /* PREFIX_VEX_0F3A40 */
6604 { VEX_W_TABLE (VEX_W_0F3A40_P_2) },
6607 /* PREFIX_VEX_0F3A41 */
6611 { VEX_LEN_TABLE (VEX_LEN_0F3A41_P_2) },
6614 /* PREFIX_VEX_0F3A42 */
6618 { VEX_W_TABLE (VEX_W_0F3A42_P_2) },
6621 /* PREFIX_VEX_0F3A44 */
6625 { VEX_LEN_TABLE (VEX_LEN_0F3A44_P_2) },
6628 /* PREFIX_VEX_0F3A46 */
6632 { VEX_LEN_TABLE (VEX_LEN_0F3A46_P_2) },
6635 /* PREFIX_VEX_0F3A48 */
6639 { VEX_W_TABLE (VEX_W_0F3A48_P_2) },
6642 /* PREFIX_VEX_0F3A49 */
6646 { VEX_W_TABLE (VEX_W_0F3A49_P_2) },
6649 /* PREFIX_VEX_0F3A4A */
6653 { VEX_W_TABLE (VEX_W_0F3A4A_P_2) },
6656 /* PREFIX_VEX_0F3A4B */
6660 { VEX_W_TABLE (VEX_W_0F3A4B_P_2) },
6663 /* PREFIX_VEX_0F3A4C */
6667 { VEX_W_TABLE (VEX_W_0F3A4C_P_2) },
6670 /* PREFIX_VEX_0F3A5C */
6674 { "vfmaddsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6677 /* PREFIX_VEX_0F3A5D */
6681 { "vfmaddsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6684 /* PREFIX_VEX_0F3A5E */
6688 { "vfmsubaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6691 /* PREFIX_VEX_0F3A5F */
6695 { "vfmsubaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6698 /* PREFIX_VEX_0F3A60 */
6702 { VEX_LEN_TABLE (VEX_LEN_0F3A60_P_2) },
6706 /* PREFIX_VEX_0F3A61 */
6710 { VEX_LEN_TABLE (VEX_LEN_0F3A61_P_2) },
6713 /* PREFIX_VEX_0F3A62 */
6717 { VEX_LEN_TABLE (VEX_LEN_0F3A62_P_2) },
6720 /* PREFIX_VEX_0F3A63 */
6724 { VEX_LEN_TABLE (VEX_LEN_0F3A63_P_2) },
6727 /* PREFIX_VEX_0F3A68 */
6731 { "vfmaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6734 /* PREFIX_VEX_0F3A69 */
6738 { "vfmaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6741 /* PREFIX_VEX_0F3A6A */
6745 { VEX_LEN_TABLE (VEX_LEN_0F3A6A_P_2) },
6748 /* PREFIX_VEX_0F3A6B */
6752 { VEX_LEN_TABLE (VEX_LEN_0F3A6B_P_2) },
6755 /* PREFIX_VEX_0F3A6C */
6759 { "vfmsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6762 /* PREFIX_VEX_0F3A6D */
6766 { "vfmsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6769 /* PREFIX_VEX_0F3A6E */
6773 { VEX_LEN_TABLE (VEX_LEN_0F3A6E_P_2) },
6776 /* PREFIX_VEX_0F3A6F */
6780 { VEX_LEN_TABLE (VEX_LEN_0F3A6F_P_2) },
6783 /* PREFIX_VEX_0F3A78 */
6787 { "vfnmaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6790 /* PREFIX_VEX_0F3A79 */
6794 { "vfnmaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6797 /* PREFIX_VEX_0F3A7A */
6801 { VEX_LEN_TABLE (VEX_LEN_0F3A7A_P_2) },
6804 /* PREFIX_VEX_0F3A7B */
6808 { VEX_LEN_TABLE (VEX_LEN_0F3A7B_P_2) },
6811 /* PREFIX_VEX_0F3A7C */
6815 { "vfnmsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6819 /* PREFIX_VEX_0F3A7D */
6823 { "vfnmsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
6826 /* PREFIX_VEX_0F3A7E */
6830 { VEX_LEN_TABLE (VEX_LEN_0F3A7E_P_2) },
6833 /* PREFIX_VEX_0F3A7F */
6837 { VEX_LEN_TABLE (VEX_LEN_0F3A7F_P_2) },
6840 /* PREFIX_VEX_0F3ADF */
6844 { VEX_LEN_TABLE (VEX_LEN_0F3ADF_P_2) },
6847 /* PREFIX_VEX_0F3AF0 */
6852 { VEX_LEN_TABLE (VEX_LEN_0F3AF0_P_3) },
6855 #define NEED_PREFIX_TABLE
6856 #include "i386-dis-evex.h"
6857 #undef NEED_PREFIX_TABLE
6860 static const struct dis386 x86_64_table[][2] = {
6863 { "pushP", { es }, 0 },
6868 { "popP", { es }, 0 },
6873 { "pushP", { cs }, 0 },
6878 { "pushP", { ss }, 0 },
6883 { "popP", { ss }, 0 },
6888 { "pushP", { ds }, 0 },
6893 { "popP", { ds }, 0 },
6898 { "daa", { XX }, 0 },
6903 { "das", { XX }, 0 },
6908 { "aaa", { XX }, 0 },
6913 { "aas", { XX }, 0 },
6918 { "pushaP", { XX }, 0 },
6923 { "popaP", { XX }, 0 },
6928 { MOD_TABLE (MOD_62_32BIT) },
6929 { EVEX_TABLE (EVEX_0F) },
6934 { "arpl", { Ew, Gw }, 0 },
6935 { "movs{lq|xd}", { Gv, Ed }, 0 },
6940 { "ins{R|}", { Yzr, indirDX }, 0 },
6941 { "ins{G|}", { Yzr, indirDX }, 0 },
6946 { "outs{R|}", { indirDXr, Xz }, 0 },
6947 { "outs{G|}", { indirDXr, Xz }, 0 },
6952 /* Opcode 0x82 is an alias of of opcode 0x80 in 32-bit mode. */
6953 { REG_TABLE (REG_80) },
6958 { "Jcall{T|}", { Ap }, 0 },
6963 { MOD_TABLE (MOD_C4_32BIT) },
6964 { VEX_C4_TABLE (VEX_0F) },
6969 { MOD_TABLE (MOD_C5_32BIT) },
6970 { VEX_C5_TABLE (VEX_0F) },
6975 { "into", { XX }, 0 },
6980 { "aam", { Ib }, 0 },
6985 { "aad", { Ib }, 0 },
6990 { "callP", { Jv, BND }, 0 },
6991 { "call@", { Jv, BND }, 0 }
6996 { "jmpP", { Jv, BND }, 0 },
6997 { "jmp@", { Jv, BND }, 0 }
7002 { "Jjmp{T|}", { Ap }, 0 },
7005 /* X86_64_0F01_REG_0 */
7007 { "sgdt{Q|IQ}", { M }, 0 },
7008 { "sgdt", { M }, 0 },
7011 /* X86_64_0F01_REG_1 */
7013 { "sidt{Q|IQ}", { M }, 0 },
7014 { "sidt", { M }, 0 },
7017 /* X86_64_0F01_REG_2 */
7019 { "lgdt{Q|Q}", { M }, 0 },
7020 { "lgdt", { M }, 0 },
7023 /* X86_64_0F01_REG_3 */
7025 { "lidt{Q|Q}", { M }, 0 },
7026 { "lidt", { M }, 0 },
7030 static const struct dis386 three_byte_table[][256] = {
7032 /* THREE_BYTE_0F38 */
7035 { "pshufb", { MX, EM }, PREFIX_OPCODE },
7036 { "phaddw", { MX, EM }, PREFIX_OPCODE },
7037 { "phaddd", { MX, EM }, PREFIX_OPCODE },
7038 { "phaddsw", { MX, EM }, PREFIX_OPCODE },
7039 { "pmaddubsw", { MX, EM }, PREFIX_OPCODE },
7040 { "phsubw", { MX, EM }, PREFIX_OPCODE },
7041 { "phsubd", { MX, EM }, PREFIX_OPCODE },
7042 { "phsubsw", { MX, EM }, PREFIX_OPCODE },
7044 { "psignb", { MX, EM }, PREFIX_OPCODE },
7045 { "psignw", { MX, EM }, PREFIX_OPCODE },
7046 { "psignd", { MX, EM }, PREFIX_OPCODE },
7047 { "pmulhrsw", { MX, EM }, PREFIX_OPCODE },
7053 { PREFIX_TABLE (PREFIX_0F3810) },
7057 { PREFIX_TABLE (PREFIX_0F3814) },
7058 { PREFIX_TABLE (PREFIX_0F3815) },
7060 { PREFIX_TABLE (PREFIX_0F3817) },
7066 { "pabsb", { MX, EM }, PREFIX_OPCODE },
7067 { "pabsw", { MX, EM }, PREFIX_OPCODE },
7068 { "pabsd", { MX, EM }, PREFIX_OPCODE },
7071 { PREFIX_TABLE (PREFIX_0F3820) },
7072 { PREFIX_TABLE (PREFIX_0F3821) },
7073 { PREFIX_TABLE (PREFIX_0F3822) },
7074 { PREFIX_TABLE (PREFIX_0F3823) },
7075 { PREFIX_TABLE (PREFIX_0F3824) },
7076 { PREFIX_TABLE (PREFIX_0F3825) },
7080 { PREFIX_TABLE (PREFIX_0F3828) },
7081 { PREFIX_TABLE (PREFIX_0F3829) },
7082 { PREFIX_TABLE (PREFIX_0F382A) },
7083 { PREFIX_TABLE (PREFIX_0F382B) },
7089 { PREFIX_TABLE (PREFIX_0F3830) },
7090 { PREFIX_TABLE (PREFIX_0F3831) },
7091 { PREFIX_TABLE (PREFIX_0F3832) },
7092 { PREFIX_TABLE (PREFIX_0F3833) },
7093 { PREFIX_TABLE (PREFIX_0F3834) },
7094 { PREFIX_TABLE (PREFIX_0F3835) },
7096 { PREFIX_TABLE (PREFIX_0F3837) },
7098 { PREFIX_TABLE (PREFIX_0F3838) },
7099 { PREFIX_TABLE (PREFIX_0F3839) },
7100 { PREFIX_TABLE (PREFIX_0F383A) },
7101 { PREFIX_TABLE (PREFIX_0F383B) },
7102 { PREFIX_TABLE (PREFIX_0F383C) },
7103 { PREFIX_TABLE (PREFIX_0F383D) },
7104 { PREFIX_TABLE (PREFIX_0F383E) },
7105 { PREFIX_TABLE (PREFIX_0F383F) },
7107 { PREFIX_TABLE (PREFIX_0F3840) },
7108 { PREFIX_TABLE (PREFIX_0F3841) },
7179 { PREFIX_TABLE (PREFIX_0F3880) },
7180 { PREFIX_TABLE (PREFIX_0F3881) },
7181 { PREFIX_TABLE (PREFIX_0F3882) },
7260 { PREFIX_TABLE (PREFIX_0F38C8) },
7261 { PREFIX_TABLE (PREFIX_0F38C9) },
7262 { PREFIX_TABLE (PREFIX_0F38CA) },
7263 { PREFIX_TABLE (PREFIX_0F38CB) },
7264 { PREFIX_TABLE (PREFIX_0F38CC) },
7265 { PREFIX_TABLE (PREFIX_0F38CD) },
7281 { PREFIX_TABLE (PREFIX_0F38DB) },
7282 { PREFIX_TABLE (PREFIX_0F38DC) },
7283 { PREFIX_TABLE (PREFIX_0F38DD) },
7284 { PREFIX_TABLE (PREFIX_0F38DE) },
7285 { PREFIX_TABLE (PREFIX_0F38DF) },
7305 { PREFIX_TABLE (PREFIX_0F38F0) },
7306 { PREFIX_TABLE (PREFIX_0F38F1) },
7310 { PREFIX_TABLE (PREFIX_0F38F5) },
7311 { PREFIX_TABLE (PREFIX_0F38F6) },
7323 /* THREE_BYTE_0F3A */
7335 { PREFIX_TABLE (PREFIX_0F3A08) },
7336 { PREFIX_TABLE (PREFIX_0F3A09) },
7337 { PREFIX_TABLE (PREFIX_0F3A0A) },
7338 { PREFIX_TABLE (PREFIX_0F3A0B) },
7339 { PREFIX_TABLE (PREFIX_0F3A0C) },
7340 { PREFIX_TABLE (PREFIX_0F3A0D) },
7341 { PREFIX_TABLE (PREFIX_0F3A0E) },
7342 { "palignr", { MX, EM, Ib }, PREFIX_OPCODE },
7348 { PREFIX_TABLE (PREFIX_0F3A14) },
7349 { PREFIX_TABLE (PREFIX_0F3A15) },
7350 { PREFIX_TABLE (PREFIX_0F3A16) },
7351 { PREFIX_TABLE (PREFIX_0F3A17) },
7362 { PREFIX_TABLE (PREFIX_0F3A20) },
7363 { PREFIX_TABLE (PREFIX_0F3A21) },
7364 { PREFIX_TABLE (PREFIX_0F3A22) },
7398 { PREFIX_TABLE (PREFIX_0F3A40) },
7399 { PREFIX_TABLE (PREFIX_0F3A41) },
7400 { PREFIX_TABLE (PREFIX_0F3A42) },
7402 { PREFIX_TABLE (PREFIX_0F3A44) },
7434 { PREFIX_TABLE (PREFIX_0F3A60) },
7435 { PREFIX_TABLE (PREFIX_0F3A61) },
7436 { PREFIX_TABLE (PREFIX_0F3A62) },
7437 { PREFIX_TABLE (PREFIX_0F3A63) },
7555 { PREFIX_TABLE (PREFIX_0F3ACC) },
7576 { PREFIX_TABLE (PREFIX_0F3ADF) },
7616 static const struct dis386 xop_table[][256] = {
7769 { "vpmacssww", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7770 { "vpmacsswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7771 { "vpmacssdql", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7779 { "vpmacssdd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7780 { "vpmacssdqh", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7787 { "vpmacsww", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7788 { "vpmacswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7789 { "vpmacsdql", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7797 { "vpmacsdd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7798 { "vpmacsdqh", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7802 { "vpcmov", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7803 { "vpperm", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7806 { "vpmadcsswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7824 { "vpmadcswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 }, 0 },
7836 { "vprotb", { XM, Vex_2src_1, Ib }, 0 },
7837 { "vprotw", { XM, Vex_2src_1, Ib }, 0 },
7838 { "vprotd", { XM, Vex_2src_1, Ib }, 0 },
7839 { "vprotq", { XM, Vex_2src_1, Ib }, 0 },
7849 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC) },
7850 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD) },
7851 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE) },
7852 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF) },
7885 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC) },
7886 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED) },
7887 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE) },
7888 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF) },
7912 { REG_TABLE (REG_XOP_TBM_01) },
7913 { REG_TABLE (REG_XOP_TBM_02) },
7931 { REG_TABLE (REG_XOP_LWPCB) },
8055 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_80) },
8056 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_81) },
8057 { "vfrczss", { XM, EXd }, 0 },
8058 { "vfrczsd", { XM, EXq }, 0 },
8073 { "vprotb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8074 { "vprotw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8075 { "vprotd", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8076 { "vprotq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8077 { "vpshlb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8078 { "vpshlw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8079 { "vpshld", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8080 { "vpshlq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8082 { "vpshab", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8083 { "vpshaw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8084 { "vpshad", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8085 { "vpshaq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8128 { "vphaddbw", { XM, EXxmm }, 0 },
8129 { "vphaddbd", { XM, EXxmm }, 0 },
8130 { "vphaddbq", { XM, EXxmm }, 0 },
8133 { "vphaddwd", { XM, EXxmm }, 0 },
8134 { "vphaddwq", { XM, EXxmm }, 0 },
8139 { "vphadddq", { XM, EXxmm }, 0 },
8146 { "vphaddubw", { XM, EXxmm }, 0 },
8147 { "vphaddubd", { XM, EXxmm }, 0 },
8148 { "vphaddubq", { XM, EXxmm }, 0 },
8151 { "vphadduwd", { XM, EXxmm }, 0 },
8152 { "vphadduwq", { XM, EXxmm }, 0 },
8157 { "vphaddudq", { XM, EXxmm }, 0 },
8164 { "vphsubbw", { XM, EXxmm }, 0 },
8165 { "vphsubwd", { XM, EXxmm }, 0 },
8166 { "vphsubdq", { XM, EXxmm }, 0 },
8220 { "bextr", { Gv, Ev, Iq }, 0 },
8222 { REG_TABLE (REG_XOP_LWP) },
8492 static const struct dis386 vex_table[][256] = {
8514 { PREFIX_TABLE (PREFIX_VEX_0F10) },
8515 { PREFIX_TABLE (PREFIX_VEX_0F11) },
8516 { PREFIX_TABLE (PREFIX_VEX_0F12) },
8517 { MOD_TABLE (MOD_VEX_0F13) },
8518 { VEX_W_TABLE (VEX_W_0F14) },
8519 { VEX_W_TABLE (VEX_W_0F15) },
8520 { PREFIX_TABLE (PREFIX_VEX_0F16) },
8521 { MOD_TABLE (MOD_VEX_0F17) },
8541 { VEX_W_TABLE (VEX_W_0F28) },
8542 { VEX_W_TABLE (VEX_W_0F29) },
8543 { PREFIX_TABLE (PREFIX_VEX_0F2A) },
8544 { MOD_TABLE (MOD_VEX_0F2B) },
8545 { PREFIX_TABLE (PREFIX_VEX_0F2C) },
8546 { PREFIX_TABLE (PREFIX_VEX_0F2D) },
8547 { PREFIX_TABLE (PREFIX_VEX_0F2E) },
8548 { PREFIX_TABLE (PREFIX_VEX_0F2F) },
8569 { PREFIX_TABLE (PREFIX_VEX_0F41) },
8570 { PREFIX_TABLE (PREFIX_VEX_0F42) },
8572 { PREFIX_TABLE (PREFIX_VEX_0F44) },
8573 { PREFIX_TABLE (PREFIX_VEX_0F45) },
8574 { PREFIX_TABLE (PREFIX_VEX_0F46) },
8575 { PREFIX_TABLE (PREFIX_VEX_0F47) },
8579 { PREFIX_TABLE (PREFIX_VEX_0F4A) },
8580 { PREFIX_TABLE (PREFIX_VEX_0F4B) },
8586 { MOD_TABLE (MOD_VEX_0F50) },
8587 { PREFIX_TABLE (PREFIX_VEX_0F51) },
8588 { PREFIX_TABLE (PREFIX_VEX_0F52) },
8589 { PREFIX_TABLE (PREFIX_VEX_0F53) },
8590 { "vandpX", { XM, Vex, EXx }, 0 },
8591 { "vandnpX", { XM, Vex, EXx }, 0 },
8592 { "vorpX", { XM, Vex, EXx }, 0 },
8593 { "vxorpX", { XM, Vex, EXx }, 0 },
8595 { PREFIX_TABLE (PREFIX_VEX_0F58) },
8596 { PREFIX_TABLE (PREFIX_VEX_0F59) },
8597 { PREFIX_TABLE (PREFIX_VEX_0F5A) },
8598 { PREFIX_TABLE (PREFIX_VEX_0F5B) },
8599 { PREFIX_TABLE (PREFIX_VEX_0F5C) },
8600 { PREFIX_TABLE (PREFIX_VEX_0F5D) },
8601 { PREFIX_TABLE (PREFIX_VEX_0F5E) },
8602 { PREFIX_TABLE (PREFIX_VEX_0F5F) },
8604 { PREFIX_TABLE (PREFIX_VEX_0F60) },
8605 { PREFIX_TABLE (PREFIX_VEX_0F61) },
8606 { PREFIX_TABLE (PREFIX_VEX_0F62) },
8607 { PREFIX_TABLE (PREFIX_VEX_0F63) },
8608 { PREFIX_TABLE (PREFIX_VEX_0F64) },
8609 { PREFIX_TABLE (PREFIX_VEX_0F65) },
8610 { PREFIX_TABLE (PREFIX_VEX_0F66) },
8611 { PREFIX_TABLE (PREFIX_VEX_0F67) },
8613 { PREFIX_TABLE (PREFIX_VEX_0F68) },
8614 { PREFIX_TABLE (PREFIX_VEX_0F69) },
8615 { PREFIX_TABLE (PREFIX_VEX_0F6A) },
8616 { PREFIX_TABLE (PREFIX_VEX_0F6B) },
8617 { PREFIX_TABLE (PREFIX_VEX_0F6C) },
8618 { PREFIX_TABLE (PREFIX_VEX_0F6D) },
8619 { PREFIX_TABLE (PREFIX_VEX_0F6E) },
8620 { PREFIX_TABLE (PREFIX_VEX_0F6F) },
8622 { PREFIX_TABLE (PREFIX_VEX_0F70) },
8623 { REG_TABLE (REG_VEX_0F71) },
8624 { REG_TABLE (REG_VEX_0F72) },
8625 { REG_TABLE (REG_VEX_0F73) },
8626 { PREFIX_TABLE (PREFIX_VEX_0F74) },
8627 { PREFIX_TABLE (PREFIX_VEX_0F75) },
8628 { PREFIX_TABLE (PREFIX_VEX_0F76) },
8629 { PREFIX_TABLE (PREFIX_VEX_0F77) },
8635 { PREFIX_TABLE (PREFIX_VEX_0F7C) },
8636 { PREFIX_TABLE (PREFIX_VEX_0F7D) },
8637 { PREFIX_TABLE (PREFIX_VEX_0F7E) },
8638 { PREFIX_TABLE (PREFIX_VEX_0F7F) },
8658 { PREFIX_TABLE (PREFIX_VEX_0F90) },
8659 { PREFIX_TABLE (PREFIX_VEX_0F91) },
8660 { PREFIX_TABLE (PREFIX_VEX_0F92) },
8661 { PREFIX_TABLE (PREFIX_VEX_0F93) },
8667 { PREFIX_TABLE (PREFIX_VEX_0F98) },
8668 { PREFIX_TABLE (PREFIX_VEX_0F99) },
8691 { REG_TABLE (REG_VEX_0FAE) },
8714 { PREFIX_TABLE (PREFIX_VEX_0FC2) },
8716 { PREFIX_TABLE (PREFIX_VEX_0FC4) },
8717 { PREFIX_TABLE (PREFIX_VEX_0FC5) },
8718 { "vshufpX", { XM, Vex, EXx, Ib }, 0 },
8730 { PREFIX_TABLE (PREFIX_VEX_0FD0) },
8731 { PREFIX_TABLE (PREFIX_VEX_0FD1) },
8732 { PREFIX_TABLE (PREFIX_VEX_0FD2) },
8733 { PREFIX_TABLE (PREFIX_VEX_0FD3) },
8734 { PREFIX_TABLE (PREFIX_VEX_0FD4) },
8735 { PREFIX_TABLE (PREFIX_VEX_0FD5) },
8736 { PREFIX_TABLE (PREFIX_VEX_0FD6) },
8737 { PREFIX_TABLE (PREFIX_VEX_0FD7) },
8739 { PREFIX_TABLE (PREFIX_VEX_0FD8) },
8740 { PREFIX_TABLE (PREFIX_VEX_0FD9) },
8741 { PREFIX_TABLE (PREFIX_VEX_0FDA) },
8742 { PREFIX_TABLE (PREFIX_VEX_0FDB) },
8743 { PREFIX_TABLE (PREFIX_VEX_0FDC) },
8744 { PREFIX_TABLE (PREFIX_VEX_0FDD) },
8745 { PREFIX_TABLE (PREFIX_VEX_0FDE) },
8746 { PREFIX_TABLE (PREFIX_VEX_0FDF) },
8748 { PREFIX_TABLE (PREFIX_VEX_0FE0) },
8749 { PREFIX_TABLE (PREFIX_VEX_0FE1) },
8750 { PREFIX_TABLE (PREFIX_VEX_0FE2) },
8751 { PREFIX_TABLE (PREFIX_VEX_0FE3) },
8752 { PREFIX_TABLE (PREFIX_VEX_0FE4) },
8753 { PREFIX_TABLE (PREFIX_VEX_0FE5) },
8754 { PREFIX_TABLE (PREFIX_VEX_0FE6) },
8755 { PREFIX_TABLE (PREFIX_VEX_0FE7) },
8757 { PREFIX_TABLE (PREFIX_VEX_0FE8) },
8758 { PREFIX_TABLE (PREFIX_VEX_0FE9) },
8759 { PREFIX_TABLE (PREFIX_VEX_0FEA) },
8760 { PREFIX_TABLE (PREFIX_VEX_0FEB) },
8761 { PREFIX_TABLE (PREFIX_VEX_0FEC) },
8762 { PREFIX_TABLE (PREFIX_VEX_0FED) },
8763 { PREFIX_TABLE (PREFIX_VEX_0FEE) },
8764 { PREFIX_TABLE (PREFIX_VEX_0FEF) },
8766 { PREFIX_TABLE (PREFIX_VEX_0FF0) },
8767 { PREFIX_TABLE (PREFIX_VEX_0FF1) },
8768 { PREFIX_TABLE (PREFIX_VEX_0FF2) },
8769 { PREFIX_TABLE (PREFIX_VEX_0FF3) },
8770 { PREFIX_TABLE (PREFIX_VEX_0FF4) },
8771 { PREFIX_TABLE (PREFIX_VEX_0FF5) },
8772 { PREFIX_TABLE (PREFIX_VEX_0FF6) },
8773 { PREFIX_TABLE (PREFIX_VEX_0FF7) },
8775 { PREFIX_TABLE (PREFIX_VEX_0FF8) },
8776 { PREFIX_TABLE (PREFIX_VEX_0FF9) },
8777 { PREFIX_TABLE (PREFIX_VEX_0FFA) },
8778 { PREFIX_TABLE (PREFIX_VEX_0FFB) },
8779 { PREFIX_TABLE (PREFIX_VEX_0FFC) },
8780 { PREFIX_TABLE (PREFIX_VEX_0FFD) },
8781 { PREFIX_TABLE (PREFIX_VEX_0FFE) },
8787 { PREFIX_TABLE (PREFIX_VEX_0F3800) },
8788 { PREFIX_TABLE (PREFIX_VEX_0F3801) },
8789 { PREFIX_TABLE (PREFIX_VEX_0F3802) },
8790 { PREFIX_TABLE (PREFIX_VEX_0F3803) },
8791 { PREFIX_TABLE (PREFIX_VEX_0F3804) },
8792 { PREFIX_TABLE (PREFIX_VEX_0F3805) },
8793 { PREFIX_TABLE (PREFIX_VEX_0F3806) },
8794 { PREFIX_TABLE (PREFIX_VEX_0F3807) },
8796 { PREFIX_TABLE (PREFIX_VEX_0F3808) },
8797 { PREFIX_TABLE (PREFIX_VEX_0F3809) },
8798 { PREFIX_TABLE (PREFIX_VEX_0F380A) },
8799 { PREFIX_TABLE (PREFIX_VEX_0F380B) },
8800 { PREFIX_TABLE (PREFIX_VEX_0F380C) },
8801 { PREFIX_TABLE (PREFIX_VEX_0F380D) },
8802 { PREFIX_TABLE (PREFIX_VEX_0F380E) },
8803 { PREFIX_TABLE (PREFIX_VEX_0F380F) },
8808 { PREFIX_TABLE (PREFIX_VEX_0F3813) },
8811 { PREFIX_TABLE (PREFIX_VEX_0F3816) },
8812 { PREFIX_TABLE (PREFIX_VEX_0F3817) },
8814 { PREFIX_TABLE (PREFIX_VEX_0F3818) },
8815 { PREFIX_TABLE (PREFIX_VEX_0F3819) },
8816 { PREFIX_TABLE (PREFIX_VEX_0F381A) },
8818 { PREFIX_TABLE (PREFIX_VEX_0F381C) },
8819 { PREFIX_TABLE (PREFIX_VEX_0F381D) },
8820 { PREFIX_TABLE (PREFIX_VEX_0F381E) },
8823 { PREFIX_TABLE (PREFIX_VEX_0F3820) },
8824 { PREFIX_TABLE (PREFIX_VEX_0F3821) },
8825 { PREFIX_TABLE (PREFIX_VEX_0F3822) },
8826 { PREFIX_TABLE (PREFIX_VEX_0F3823) },
8827 { PREFIX_TABLE (PREFIX_VEX_0F3824) },
8828 { PREFIX_TABLE (PREFIX_VEX_0F3825) },
8832 { PREFIX_TABLE (PREFIX_VEX_0F3828) },
8833 { PREFIX_TABLE (PREFIX_VEX_0F3829) },
8834 { PREFIX_TABLE (PREFIX_VEX_0F382A) },
8835 { PREFIX_TABLE (PREFIX_VEX_0F382B) },
8836 { PREFIX_TABLE (PREFIX_VEX_0F382C) },
8837 { PREFIX_TABLE (PREFIX_VEX_0F382D) },
8838 { PREFIX_TABLE (PREFIX_VEX_0F382E) },
8839 { PREFIX_TABLE (PREFIX_VEX_0F382F) },
8841 { PREFIX_TABLE (PREFIX_VEX_0F3830) },
8842 { PREFIX_TABLE (PREFIX_VEX_0F3831) },
8843 { PREFIX_TABLE (PREFIX_VEX_0F3832) },
8844 { PREFIX_TABLE (PREFIX_VEX_0F3833) },
8845 { PREFIX_TABLE (PREFIX_VEX_0F3834) },
8846 { PREFIX_TABLE (PREFIX_VEX_0F3835) },
8847 { PREFIX_TABLE (PREFIX_VEX_0F3836) },
8848 { PREFIX_TABLE (PREFIX_VEX_0F3837) },
8850 { PREFIX_TABLE (PREFIX_VEX_0F3838) },
8851 { PREFIX_TABLE (PREFIX_VEX_0F3839) },
8852 { PREFIX_TABLE (PREFIX_VEX_0F383A) },
8853 { PREFIX_TABLE (PREFIX_VEX_0F383B) },
8854 { PREFIX_TABLE (PREFIX_VEX_0F383C) },
8855 { PREFIX_TABLE (PREFIX_VEX_0F383D) },
8856 { PREFIX_TABLE (PREFIX_VEX_0F383E) },
8857 { PREFIX_TABLE (PREFIX_VEX_0F383F) },
8859 { PREFIX_TABLE (PREFIX_VEX_0F3840) },
8860 { PREFIX_TABLE (PREFIX_VEX_0F3841) },
8864 { PREFIX_TABLE (PREFIX_VEX_0F3845) },
8865 { PREFIX_TABLE (PREFIX_VEX_0F3846) },
8866 { PREFIX_TABLE (PREFIX_VEX_0F3847) },
8886 { PREFIX_TABLE (PREFIX_VEX_0F3858) },
8887 { PREFIX_TABLE (PREFIX_VEX_0F3859) },
8888 { PREFIX_TABLE (PREFIX_VEX_0F385A) },
8922 { PREFIX_TABLE (PREFIX_VEX_0F3878) },
8923 { PREFIX_TABLE (PREFIX_VEX_0F3879) },
8944 { PREFIX_TABLE (PREFIX_VEX_0F388C) },
8946 { PREFIX_TABLE (PREFIX_VEX_0F388E) },
8949 { PREFIX_TABLE (PREFIX_VEX_0F3890) },
8950 { PREFIX_TABLE (PREFIX_VEX_0F3891) },
8951 { PREFIX_TABLE (PREFIX_VEX_0F3892) },
8952 { PREFIX_TABLE (PREFIX_VEX_0F3893) },
8955 { PREFIX_TABLE (PREFIX_VEX_0F3896) },
8956 { PREFIX_TABLE (PREFIX_VEX_0F3897) },
8958 { PREFIX_TABLE (PREFIX_VEX_0F3898) },
8959 { PREFIX_TABLE (PREFIX_VEX_0F3899) },
8960 { PREFIX_TABLE (PREFIX_VEX_0F389A) },
8961 { PREFIX_TABLE (PREFIX_VEX_0F389B) },
8962 { PREFIX_TABLE (PREFIX_VEX_0F389C) },
8963 { PREFIX_TABLE (PREFIX_VEX_0F389D) },
8964 { PREFIX_TABLE (PREFIX_VEX_0F389E) },
8965 { PREFIX_TABLE (PREFIX_VEX_0F389F) },
8973 { PREFIX_TABLE (PREFIX_VEX_0F38A6) },
8974 { PREFIX_TABLE (PREFIX_VEX_0F38A7) },
8976 { PREFIX_TABLE (PREFIX_VEX_0F38A8) },
8977 { PREFIX_TABLE (PREFIX_VEX_0F38A9) },
8978 { PREFIX_TABLE (PREFIX_VEX_0F38AA) },
8979 { PREFIX_TABLE (PREFIX_VEX_0F38AB) },
8980 { PREFIX_TABLE (PREFIX_VEX_0F38AC) },
8981 { PREFIX_TABLE (PREFIX_VEX_0F38AD) },
8982 { PREFIX_TABLE (PREFIX_VEX_0F38AE) },
8983 { PREFIX_TABLE (PREFIX_VEX_0F38AF) },
8991 { PREFIX_TABLE (PREFIX_VEX_0F38B6) },
8992 { PREFIX_TABLE (PREFIX_VEX_0F38B7) },
8994 { PREFIX_TABLE (PREFIX_VEX_0F38B8) },
8995 { PREFIX_TABLE (PREFIX_VEX_0F38B9) },
8996 { PREFIX_TABLE (PREFIX_VEX_0F38BA) },
8997 { PREFIX_TABLE (PREFIX_VEX_0F38BB) },
8998 { PREFIX_TABLE (PREFIX_VEX_0F38BC) },
8999 { PREFIX_TABLE (PREFIX_VEX_0F38BD) },
9000 { PREFIX_TABLE (PREFIX_VEX_0F38BE) },
9001 { PREFIX_TABLE (PREFIX_VEX_0F38BF) },
9033 { PREFIX_TABLE (PREFIX_VEX_0F38DB) },
9034 { PREFIX_TABLE (PREFIX_VEX_0F38DC) },
9035 { PREFIX_TABLE (PREFIX_VEX_0F38DD) },
9036 { PREFIX_TABLE (PREFIX_VEX_0F38DE) },
9037 { PREFIX_TABLE (PREFIX_VEX_0F38DF) },
9059 { PREFIX_TABLE (PREFIX_VEX_0F38F2) },
9060 { REG_TABLE (REG_VEX_0F38F3) },
9062 { PREFIX_TABLE (PREFIX_VEX_0F38F5) },
9063 { PREFIX_TABLE (PREFIX_VEX_0F38F6) },
9064 { PREFIX_TABLE (PREFIX_VEX_0F38F7) },
9078 { PREFIX_TABLE (PREFIX_VEX_0F3A00) },
9079 { PREFIX_TABLE (PREFIX_VEX_0F3A01) },
9080 { PREFIX_TABLE (PREFIX_VEX_0F3A02) },
9082 { PREFIX_TABLE (PREFIX_VEX_0F3A04) },
9083 { PREFIX_TABLE (PREFIX_VEX_0F3A05) },
9084 { PREFIX_TABLE (PREFIX_VEX_0F3A06) },
9087 { PREFIX_TABLE (PREFIX_VEX_0F3A08) },
9088 { PREFIX_TABLE (PREFIX_VEX_0F3A09) },
9089 { PREFIX_TABLE (PREFIX_VEX_0F3A0A) },
9090 { PREFIX_TABLE (PREFIX_VEX_0F3A0B) },
9091 { PREFIX_TABLE (PREFIX_VEX_0F3A0C) },
9092 { PREFIX_TABLE (PREFIX_VEX_0F3A0D) },
9093 { PREFIX_TABLE (PREFIX_VEX_0F3A0E) },
9094 { PREFIX_TABLE (PREFIX_VEX_0F3A0F) },
9100 { PREFIX_TABLE (PREFIX_VEX_0F3A14) },
9101 { PREFIX_TABLE (PREFIX_VEX_0F3A15) },
9102 { PREFIX_TABLE (PREFIX_VEX_0F3A16) },
9103 { PREFIX_TABLE (PREFIX_VEX_0F3A17) },
9105 { PREFIX_TABLE (PREFIX_VEX_0F3A18) },
9106 { PREFIX_TABLE (PREFIX_VEX_0F3A19) },
9110 { PREFIX_TABLE (PREFIX_VEX_0F3A1D) },
9114 { PREFIX_TABLE (PREFIX_VEX_0F3A20) },
9115 { PREFIX_TABLE (PREFIX_VEX_0F3A21) },
9116 { PREFIX_TABLE (PREFIX_VEX_0F3A22) },
9132 { PREFIX_TABLE (PREFIX_VEX_0F3A30) },
9133 { PREFIX_TABLE (PREFIX_VEX_0F3A31) },
9134 { PREFIX_TABLE (PREFIX_VEX_0F3A32) },
9135 { PREFIX_TABLE (PREFIX_VEX_0F3A33) },
9141 { PREFIX_TABLE (PREFIX_VEX_0F3A38) },
9142 { PREFIX_TABLE (PREFIX_VEX_0F3A39) },
9150 { PREFIX_TABLE (PREFIX_VEX_0F3A40) },
9151 { PREFIX_TABLE (PREFIX_VEX_0F3A41) },
9152 { PREFIX_TABLE (PREFIX_VEX_0F3A42) },
9154 { PREFIX_TABLE (PREFIX_VEX_0F3A44) },
9156 { PREFIX_TABLE (PREFIX_VEX_0F3A46) },
9159 { PREFIX_TABLE (PREFIX_VEX_0F3A48) },
9160 { PREFIX_TABLE (PREFIX_VEX_0F3A49) },
9161 { PREFIX_TABLE (PREFIX_VEX_0F3A4A) },
9162 { PREFIX_TABLE (PREFIX_VEX_0F3A4B) },
9163 { PREFIX_TABLE (PREFIX_VEX_0F3A4C) },
9181 { PREFIX_TABLE (PREFIX_VEX_0F3A5C) },
9182 { PREFIX_TABLE (PREFIX_VEX_0F3A5D) },
9183 { PREFIX_TABLE (PREFIX_VEX_0F3A5E) },
9184 { PREFIX_TABLE (PREFIX_VEX_0F3A5F) },
9186 { PREFIX_TABLE (PREFIX_VEX_0F3A60) },
9187 { PREFIX_TABLE (PREFIX_VEX_0F3A61) },
9188 { PREFIX_TABLE (PREFIX_VEX_0F3A62) },
9189 { PREFIX_TABLE (PREFIX_VEX_0F3A63) },
9195 { PREFIX_TABLE (PREFIX_VEX_0F3A68) },
9196 { PREFIX_TABLE (PREFIX_VEX_0F3A69) },
9197 { PREFIX_TABLE (PREFIX_VEX_0F3A6A) },
9198 { PREFIX_TABLE (PREFIX_VEX_0F3A6B) },
9199 { PREFIX_TABLE (PREFIX_VEX_0F3A6C) },
9200 { PREFIX_TABLE (PREFIX_VEX_0F3A6D) },
9201 { PREFIX_TABLE (PREFIX_VEX_0F3A6E) },
9202 { PREFIX_TABLE (PREFIX_VEX_0F3A6F) },
9213 { PREFIX_TABLE (PREFIX_VEX_0F3A78) },
9214 { PREFIX_TABLE (PREFIX_VEX_0F3A79) },
9215 { PREFIX_TABLE (PREFIX_VEX_0F3A7A) },
9216 { PREFIX_TABLE (PREFIX_VEX_0F3A7B) },
9217 { PREFIX_TABLE (PREFIX_VEX_0F3A7C) },
9218 { PREFIX_TABLE (PREFIX_VEX_0F3A7D) },
9219 { PREFIX_TABLE (PREFIX_VEX_0F3A7E) },
9220 { PREFIX_TABLE (PREFIX_VEX_0F3A7F) },
9328 { PREFIX_TABLE (PREFIX_VEX_0F3ADF) },
9348 { PREFIX_TABLE (PREFIX_VEX_0F3AF0) },
9368 #define NEED_OPCODE_TABLE
9369 #include "i386-dis-evex.h"
9370 #undef NEED_OPCODE_TABLE
9371 static const struct dis386 vex_len_table[][2] = {
9372 /* VEX_LEN_0F10_P_1 */
9374 { VEX_W_TABLE (VEX_W_0F10_P_1) },
9375 { VEX_W_TABLE (VEX_W_0F10_P_1) },
9378 /* VEX_LEN_0F10_P_3 */
9380 { VEX_W_TABLE (VEX_W_0F10_P_3) },
9381 { VEX_W_TABLE (VEX_W_0F10_P_3) },
9384 /* VEX_LEN_0F11_P_1 */
9386 { VEX_W_TABLE (VEX_W_0F11_P_1) },
9387 { VEX_W_TABLE (VEX_W_0F11_P_1) },
9390 /* VEX_LEN_0F11_P_3 */
9392 { VEX_W_TABLE (VEX_W_0F11_P_3) },
9393 { VEX_W_TABLE (VEX_W_0F11_P_3) },
9396 /* VEX_LEN_0F12_P_0_M_0 */
9398 { VEX_W_TABLE (VEX_W_0F12_P_0_M_0) },
9401 /* VEX_LEN_0F12_P_0_M_1 */
9403 { VEX_W_TABLE (VEX_W_0F12_P_0_M_1) },
9406 /* VEX_LEN_0F12_P_2 */
9408 { VEX_W_TABLE (VEX_W_0F12_P_2) },
9411 /* VEX_LEN_0F13_M_0 */
9413 { VEX_W_TABLE (VEX_W_0F13_M_0) },
9416 /* VEX_LEN_0F16_P_0_M_0 */
9418 { VEX_W_TABLE (VEX_W_0F16_P_0_M_0) },
9421 /* VEX_LEN_0F16_P_0_M_1 */
9423 { VEX_W_TABLE (VEX_W_0F16_P_0_M_1) },
9426 /* VEX_LEN_0F16_P_2 */
9428 { VEX_W_TABLE (VEX_W_0F16_P_2) },
9431 /* VEX_LEN_0F17_M_0 */
9433 { VEX_W_TABLE (VEX_W_0F17_M_0) },
9436 /* VEX_LEN_0F2A_P_1 */
9438 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9439 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9442 /* VEX_LEN_0F2A_P_3 */
9444 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9445 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9448 /* VEX_LEN_0F2C_P_1 */
9450 { "vcvttss2siY", { Gv, EXdScalar }, 0 },
9451 { "vcvttss2siY", { Gv, EXdScalar }, 0 },
9454 /* VEX_LEN_0F2C_P_3 */
9456 { "vcvttsd2siY", { Gv, EXqScalar }, 0 },
9457 { "vcvttsd2siY", { Gv, EXqScalar }, 0 },
9460 /* VEX_LEN_0F2D_P_1 */
9462 { "vcvtss2siY", { Gv, EXdScalar }, 0 },
9463 { "vcvtss2siY", { Gv, EXdScalar }, 0 },
9466 /* VEX_LEN_0F2D_P_3 */
9468 { "vcvtsd2siY", { Gv, EXqScalar }, 0 },
9469 { "vcvtsd2siY", { Gv, EXqScalar }, 0 },
9472 /* VEX_LEN_0F2E_P_0 */
9474 { VEX_W_TABLE (VEX_W_0F2E_P_0) },
9475 { VEX_W_TABLE (VEX_W_0F2E_P_0) },
9478 /* VEX_LEN_0F2E_P_2 */
9480 { VEX_W_TABLE (VEX_W_0F2E_P_2) },
9481 { VEX_W_TABLE (VEX_W_0F2E_P_2) },
9484 /* VEX_LEN_0F2F_P_0 */
9486 { VEX_W_TABLE (VEX_W_0F2F_P_0) },
9487 { VEX_W_TABLE (VEX_W_0F2F_P_0) },
9490 /* VEX_LEN_0F2F_P_2 */
9492 { VEX_W_TABLE (VEX_W_0F2F_P_2) },
9493 { VEX_W_TABLE (VEX_W_0F2F_P_2) },
9496 /* VEX_LEN_0F41_P_0 */
9499 { VEX_W_TABLE (VEX_W_0F41_P_0_LEN_1) },
9501 /* VEX_LEN_0F41_P_2 */
9504 { VEX_W_TABLE (VEX_W_0F41_P_2_LEN_1) },
9506 /* VEX_LEN_0F42_P_0 */
9509 { VEX_W_TABLE (VEX_W_0F42_P_0_LEN_1) },
9511 /* VEX_LEN_0F42_P_2 */
9514 { VEX_W_TABLE (VEX_W_0F42_P_2_LEN_1) },
9516 /* VEX_LEN_0F44_P_0 */
9518 { VEX_W_TABLE (VEX_W_0F44_P_0_LEN_0) },
9520 /* VEX_LEN_0F44_P_2 */
9522 { VEX_W_TABLE (VEX_W_0F44_P_2_LEN_0) },
9524 /* VEX_LEN_0F45_P_0 */
9527 { VEX_W_TABLE (VEX_W_0F45_P_0_LEN_1) },
9529 /* VEX_LEN_0F45_P_2 */
9532 { VEX_W_TABLE (VEX_W_0F45_P_2_LEN_1) },
9534 /* VEX_LEN_0F46_P_0 */
9537 { VEX_W_TABLE (VEX_W_0F46_P_0_LEN_1) },
9539 /* VEX_LEN_0F46_P_2 */
9542 { VEX_W_TABLE (VEX_W_0F46_P_2_LEN_1) },
9544 /* VEX_LEN_0F47_P_0 */
9547 { VEX_W_TABLE (VEX_W_0F47_P_0_LEN_1) },
9549 /* VEX_LEN_0F47_P_2 */
9552 { VEX_W_TABLE (VEX_W_0F47_P_2_LEN_1) },
9554 /* VEX_LEN_0F4A_P_0 */
9557 { VEX_W_TABLE (VEX_W_0F4A_P_0_LEN_1) },
9559 /* VEX_LEN_0F4A_P_2 */
9562 { VEX_W_TABLE (VEX_W_0F4A_P_2_LEN_1) },
9564 /* VEX_LEN_0F4B_P_0 */
9567 { VEX_W_TABLE (VEX_W_0F4B_P_0_LEN_1) },
9569 /* VEX_LEN_0F4B_P_2 */
9572 { VEX_W_TABLE (VEX_W_0F4B_P_2_LEN_1) },
9575 /* VEX_LEN_0F51_P_1 */
9577 { VEX_W_TABLE (VEX_W_0F51_P_1) },
9578 { VEX_W_TABLE (VEX_W_0F51_P_1) },
9581 /* VEX_LEN_0F51_P_3 */
9583 { VEX_W_TABLE (VEX_W_0F51_P_3) },
9584 { VEX_W_TABLE (VEX_W_0F51_P_3) },
9587 /* VEX_LEN_0F52_P_1 */
9589 { VEX_W_TABLE (VEX_W_0F52_P_1) },
9590 { VEX_W_TABLE (VEX_W_0F52_P_1) },
9593 /* VEX_LEN_0F53_P_1 */
9595 { VEX_W_TABLE (VEX_W_0F53_P_1) },
9596 { VEX_W_TABLE (VEX_W_0F53_P_1) },
9599 /* VEX_LEN_0F58_P_1 */
9601 { VEX_W_TABLE (VEX_W_0F58_P_1) },
9602 { VEX_W_TABLE (VEX_W_0F58_P_1) },
9605 /* VEX_LEN_0F58_P_3 */
9607 { VEX_W_TABLE (VEX_W_0F58_P_3) },
9608 { VEX_W_TABLE (VEX_W_0F58_P_3) },
9611 /* VEX_LEN_0F59_P_1 */
9613 { VEX_W_TABLE (VEX_W_0F59_P_1) },
9614 { VEX_W_TABLE (VEX_W_0F59_P_1) },
9617 /* VEX_LEN_0F59_P_3 */
9619 { VEX_W_TABLE (VEX_W_0F59_P_3) },
9620 { VEX_W_TABLE (VEX_W_0F59_P_3) },
9623 /* VEX_LEN_0F5A_P_1 */
9625 { VEX_W_TABLE (VEX_W_0F5A_P_1) },
9626 { VEX_W_TABLE (VEX_W_0F5A_P_1) },
9629 /* VEX_LEN_0F5A_P_3 */
9631 { VEX_W_TABLE (VEX_W_0F5A_P_3) },
9632 { VEX_W_TABLE (VEX_W_0F5A_P_3) },
9635 /* VEX_LEN_0F5C_P_1 */
9637 { VEX_W_TABLE (VEX_W_0F5C_P_1) },
9638 { VEX_W_TABLE (VEX_W_0F5C_P_1) },
9641 /* VEX_LEN_0F5C_P_3 */
9643 { VEX_W_TABLE (VEX_W_0F5C_P_3) },
9644 { VEX_W_TABLE (VEX_W_0F5C_P_3) },
9647 /* VEX_LEN_0F5D_P_1 */
9649 { VEX_W_TABLE (VEX_W_0F5D_P_1) },
9650 { VEX_W_TABLE (VEX_W_0F5D_P_1) },
9653 /* VEX_LEN_0F5D_P_3 */
9655 { VEX_W_TABLE (VEX_W_0F5D_P_3) },
9656 { VEX_W_TABLE (VEX_W_0F5D_P_3) },
9659 /* VEX_LEN_0F5E_P_1 */
9661 { VEX_W_TABLE (VEX_W_0F5E_P_1) },
9662 { VEX_W_TABLE (VEX_W_0F5E_P_1) },
9665 /* VEX_LEN_0F5E_P_3 */
9667 { VEX_W_TABLE (VEX_W_0F5E_P_3) },
9668 { VEX_W_TABLE (VEX_W_0F5E_P_3) },
9671 /* VEX_LEN_0F5F_P_1 */
9673 { VEX_W_TABLE (VEX_W_0F5F_P_1) },
9674 { VEX_W_TABLE (VEX_W_0F5F_P_1) },
9677 /* VEX_LEN_0F5F_P_3 */
9679 { VEX_W_TABLE (VEX_W_0F5F_P_3) },
9680 { VEX_W_TABLE (VEX_W_0F5F_P_3) },
9683 /* VEX_LEN_0F6E_P_2 */
9685 { "vmovK", { XMScalar, Edq }, 0 },
9686 { "vmovK", { XMScalar, Edq }, 0 },
9689 /* VEX_LEN_0F7E_P_1 */
9691 { VEX_W_TABLE (VEX_W_0F7E_P_1) },
9692 { VEX_W_TABLE (VEX_W_0F7E_P_1) },
9695 /* VEX_LEN_0F7E_P_2 */
9697 { "vmovK", { Edq, XMScalar }, 0 },
9698 { "vmovK", { Edq, XMScalar }, 0 },
9701 /* VEX_LEN_0F90_P_0 */
9703 { VEX_W_TABLE (VEX_W_0F90_P_0_LEN_0) },
9706 /* VEX_LEN_0F90_P_2 */
9708 { VEX_W_TABLE (VEX_W_0F90_P_2_LEN_0) },
9711 /* VEX_LEN_0F91_P_0 */
9713 { VEX_W_TABLE (VEX_W_0F91_P_0_LEN_0) },
9716 /* VEX_LEN_0F91_P_2 */
9718 { VEX_W_TABLE (VEX_W_0F91_P_2_LEN_0) },
9721 /* VEX_LEN_0F92_P_0 */
9723 { VEX_W_TABLE (VEX_W_0F92_P_0_LEN_0) },
9726 /* VEX_LEN_0F92_P_2 */
9728 { VEX_W_TABLE (VEX_W_0F92_P_2_LEN_0) },
9731 /* VEX_LEN_0F92_P_3 */
9733 { VEX_W_TABLE (VEX_W_0F92_P_3_LEN_0) },
9736 /* VEX_LEN_0F93_P_0 */
9738 { VEX_W_TABLE (VEX_W_0F93_P_0_LEN_0) },
9741 /* VEX_LEN_0F93_P_2 */
9743 { VEX_W_TABLE (VEX_W_0F93_P_2_LEN_0) },
9746 /* VEX_LEN_0F93_P_3 */
9748 { VEX_W_TABLE (VEX_W_0F93_P_3_LEN_0) },
9751 /* VEX_LEN_0F98_P_0 */
9753 { VEX_W_TABLE (VEX_W_0F98_P_0_LEN_0) },
9756 /* VEX_LEN_0F98_P_2 */
9758 { VEX_W_TABLE (VEX_W_0F98_P_2_LEN_0) },
9761 /* VEX_LEN_0F99_P_0 */
9763 { VEX_W_TABLE (VEX_W_0F99_P_0_LEN_0) },
9766 /* VEX_LEN_0F99_P_2 */
9768 { VEX_W_TABLE (VEX_W_0F99_P_2_LEN_0) },
9771 /* VEX_LEN_0FAE_R_2_M_0 */
9773 { VEX_W_TABLE (VEX_W_0FAE_R_2_M_0) },
9776 /* VEX_LEN_0FAE_R_3_M_0 */
9778 { VEX_W_TABLE (VEX_W_0FAE_R_3_M_0) },
9781 /* VEX_LEN_0FC2_P_1 */
9783 { VEX_W_TABLE (VEX_W_0FC2_P_1) },
9784 { VEX_W_TABLE (VEX_W_0FC2_P_1) },
9787 /* VEX_LEN_0FC2_P_3 */
9789 { VEX_W_TABLE (VEX_W_0FC2_P_3) },
9790 { VEX_W_TABLE (VEX_W_0FC2_P_3) },
9793 /* VEX_LEN_0FC4_P_2 */
9795 { VEX_W_TABLE (VEX_W_0FC4_P_2) },
9798 /* VEX_LEN_0FC5_P_2 */
9800 { VEX_W_TABLE (VEX_W_0FC5_P_2) },
9803 /* VEX_LEN_0FD6_P_2 */
9805 { VEX_W_TABLE (VEX_W_0FD6_P_2) },
9806 { VEX_W_TABLE (VEX_W_0FD6_P_2) },
9809 /* VEX_LEN_0FF7_P_2 */
9811 { VEX_W_TABLE (VEX_W_0FF7_P_2) },
9814 /* VEX_LEN_0F3816_P_2 */
9817 { VEX_W_TABLE (VEX_W_0F3816_P_2) },
9820 /* VEX_LEN_0F3819_P_2 */
9823 { VEX_W_TABLE (VEX_W_0F3819_P_2) },
9826 /* VEX_LEN_0F381A_P_2_M_0 */
9829 { VEX_W_TABLE (VEX_W_0F381A_P_2_M_0) },
9832 /* VEX_LEN_0F3836_P_2 */
9835 { VEX_W_TABLE (VEX_W_0F3836_P_2) },
9838 /* VEX_LEN_0F3841_P_2 */
9840 { VEX_W_TABLE (VEX_W_0F3841_P_2) },
9843 /* VEX_LEN_0F385A_P_2_M_0 */
9846 { VEX_W_TABLE (VEX_W_0F385A_P_2_M_0) },
9849 /* VEX_LEN_0F38DB_P_2 */
9851 { VEX_W_TABLE (VEX_W_0F38DB_P_2) },
9854 /* VEX_LEN_0F38DC_P_2 */
9856 { VEX_W_TABLE (VEX_W_0F38DC_P_2) },
9859 /* VEX_LEN_0F38DD_P_2 */
9861 { VEX_W_TABLE (VEX_W_0F38DD_P_2) },
9864 /* VEX_LEN_0F38DE_P_2 */
9866 { VEX_W_TABLE (VEX_W_0F38DE_P_2) },
9869 /* VEX_LEN_0F38DF_P_2 */
9871 { VEX_W_TABLE (VEX_W_0F38DF_P_2) },
9874 /* VEX_LEN_0F38F2_P_0 */
9876 { "andnS", { Gdq, VexGdq, Edq }, 0 },
9879 /* VEX_LEN_0F38F3_R_1_P_0 */
9881 { "blsrS", { VexGdq, Edq }, 0 },
9884 /* VEX_LEN_0F38F3_R_2_P_0 */
9886 { "blsmskS", { VexGdq, Edq }, 0 },
9889 /* VEX_LEN_0F38F3_R_3_P_0 */
9891 { "blsiS", { VexGdq, Edq }, 0 },
9894 /* VEX_LEN_0F38F5_P_0 */
9896 { "bzhiS", { Gdq, Edq, VexGdq }, 0 },
9899 /* VEX_LEN_0F38F5_P_1 */
9901 { "pextS", { Gdq, VexGdq, Edq }, 0 },
9904 /* VEX_LEN_0F38F5_P_3 */
9906 { "pdepS", { Gdq, VexGdq, Edq }, 0 },
9909 /* VEX_LEN_0F38F6_P_3 */
9911 { "mulxS", { Gdq, VexGdq, Edq }, 0 },
9914 /* VEX_LEN_0F38F7_P_0 */
9916 { "bextrS", { Gdq, Edq, VexGdq }, 0 },
9919 /* VEX_LEN_0F38F7_P_1 */
9921 { "sarxS", { Gdq, Edq, VexGdq }, 0 },
9924 /* VEX_LEN_0F38F7_P_2 */
9926 { "shlxS", { Gdq, Edq, VexGdq }, 0 },
9929 /* VEX_LEN_0F38F7_P_3 */
9931 { "shrxS", { Gdq, Edq, VexGdq }, 0 },
9934 /* VEX_LEN_0F3A00_P_2 */
9937 { VEX_W_TABLE (VEX_W_0F3A00_P_2) },
9940 /* VEX_LEN_0F3A01_P_2 */
9943 { VEX_W_TABLE (VEX_W_0F3A01_P_2) },
9946 /* VEX_LEN_0F3A06_P_2 */
9949 { VEX_W_TABLE (VEX_W_0F3A06_P_2) },
9952 /* VEX_LEN_0F3A0A_P_2 */
9954 { VEX_W_TABLE (VEX_W_0F3A0A_P_2) },
9955 { VEX_W_TABLE (VEX_W_0F3A0A_P_2) },
9958 /* VEX_LEN_0F3A0B_P_2 */
9960 { VEX_W_TABLE (VEX_W_0F3A0B_P_2) },
9961 { VEX_W_TABLE (VEX_W_0F3A0B_P_2) },
9964 /* VEX_LEN_0F3A14_P_2 */
9966 { VEX_W_TABLE (VEX_W_0F3A14_P_2) },
9969 /* VEX_LEN_0F3A15_P_2 */
9971 { VEX_W_TABLE (VEX_W_0F3A15_P_2) },
9974 /* VEX_LEN_0F3A16_P_2 */
9976 { "vpextrK", { Edq, XM, Ib }, 0 },
9979 /* VEX_LEN_0F3A17_P_2 */
9981 { "vextractps", { Edqd, XM, Ib }, 0 },
9984 /* VEX_LEN_0F3A18_P_2 */
9987 { VEX_W_TABLE (VEX_W_0F3A18_P_2) },
9990 /* VEX_LEN_0F3A19_P_2 */
9993 { VEX_W_TABLE (VEX_W_0F3A19_P_2) },
9996 /* VEX_LEN_0F3A20_P_2 */
9998 { VEX_W_TABLE (VEX_W_0F3A20_P_2) },
10001 /* VEX_LEN_0F3A21_P_2 */
10003 { VEX_W_TABLE (VEX_W_0F3A21_P_2) },
10006 /* VEX_LEN_0F3A22_P_2 */
10008 { "vpinsrK", { XM, Vex128, Edq, Ib }, 0 },
10011 /* VEX_LEN_0F3A30_P_2 */
10013 { VEX_W_TABLE (VEX_W_0F3A30_P_2_LEN_0) },
10016 /* VEX_LEN_0F3A31_P_2 */
10018 { VEX_W_TABLE (VEX_W_0F3A31_P_2_LEN_0) },
10021 /* VEX_LEN_0F3A32_P_2 */
10023 { VEX_W_TABLE (VEX_W_0F3A32_P_2_LEN_0) },
10026 /* VEX_LEN_0F3A33_P_2 */
10028 { VEX_W_TABLE (VEX_W_0F3A33_P_2_LEN_0) },
10031 /* VEX_LEN_0F3A38_P_2 */
10034 { VEX_W_TABLE (VEX_W_0F3A38_P_2) },
10037 /* VEX_LEN_0F3A39_P_2 */
10040 { VEX_W_TABLE (VEX_W_0F3A39_P_2) },
10043 /* VEX_LEN_0F3A41_P_2 */
10045 { VEX_W_TABLE (VEX_W_0F3A41_P_2) },
10048 /* VEX_LEN_0F3A44_P_2 */
10050 { VEX_W_TABLE (VEX_W_0F3A44_P_2) },
10053 /* VEX_LEN_0F3A46_P_2 */
10056 { VEX_W_TABLE (VEX_W_0F3A46_P_2) },
10059 /* VEX_LEN_0F3A60_P_2 */
10061 { "vpcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
10064 /* VEX_LEN_0F3A61_P_2 */
10066 { "vpcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
10069 /* VEX_LEN_0F3A62_P_2 */
10071 { VEX_W_TABLE (VEX_W_0F3A62_P_2) },
10074 /* VEX_LEN_0F3A63_P_2 */
10076 { VEX_W_TABLE (VEX_W_0F3A63_P_2) },
10079 /* VEX_LEN_0F3A6A_P_2 */
10081 { "vfmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 }, 0 },
10084 /* VEX_LEN_0F3A6B_P_2 */
10086 { "vfmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 }, 0 },
10089 /* VEX_LEN_0F3A6E_P_2 */
10091 { "vfmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 }, 0 },
10094 /* VEX_LEN_0F3A6F_P_2 */
10096 { "vfmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 }, 0 },
10099 /* VEX_LEN_0F3A7A_P_2 */
10101 { "vfnmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 }, 0 },
10104 /* VEX_LEN_0F3A7B_P_2 */
10106 { "vfnmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 }, 0 },
10109 /* VEX_LEN_0F3A7E_P_2 */
10111 { "vfnmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 }, 0 },
10114 /* VEX_LEN_0F3A7F_P_2 */
10116 { "vfnmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 }, 0 },
10119 /* VEX_LEN_0F3ADF_P_2 */
10121 { VEX_W_TABLE (VEX_W_0F3ADF_P_2) },
10124 /* VEX_LEN_0F3AF0_P_3 */
10126 { "rorxS", { Gdq, Edq, Ib }, 0 },
10129 /* VEX_LEN_0FXOP_08_CC */
10131 { "vpcomb", { XM, Vex128, EXx, Ib }, 0 },
10134 /* VEX_LEN_0FXOP_08_CD */
10136 { "vpcomw", { XM, Vex128, EXx, Ib }, 0 },
10139 /* VEX_LEN_0FXOP_08_CE */
10141 { "vpcomd", { XM, Vex128, EXx, Ib }, 0 },
10144 /* VEX_LEN_0FXOP_08_CF */
10146 { "vpcomq", { XM, Vex128, EXx, Ib }, 0 },
10149 /* VEX_LEN_0FXOP_08_EC */
10151 { "vpcomub", { XM, Vex128, EXx, Ib }, 0 },
10154 /* VEX_LEN_0FXOP_08_ED */
10156 { "vpcomuw", { XM, Vex128, EXx, Ib }, 0 },
10159 /* VEX_LEN_0FXOP_08_EE */
10161 { "vpcomud", { XM, Vex128, EXx, Ib }, 0 },
10164 /* VEX_LEN_0FXOP_08_EF */
10166 { "vpcomuq", { XM, Vex128, EXx, Ib }, 0 },
10169 /* VEX_LEN_0FXOP_09_80 */
10171 { "vfrczps", { XM, EXxmm }, 0 },
10172 { "vfrczps", { XM, EXymmq }, 0 },
10175 /* VEX_LEN_0FXOP_09_81 */
10177 { "vfrczpd", { XM, EXxmm }, 0 },
10178 { "vfrczpd", { XM, EXymmq }, 0 },
10182 static const struct dis386 vex_w_table[][2] = {
10184 /* VEX_W_0F10_P_0 */
10185 { "vmovups", { XM, EXx }, 0 },
10188 /* VEX_W_0F10_P_1 */
10189 { "vmovss", { XMVexScalar, VexScalar, EXdScalar }, 0 },
10192 /* VEX_W_0F10_P_2 */
10193 { "vmovupd", { XM, EXx }, 0 },
10196 /* VEX_W_0F10_P_3 */
10197 { "vmovsd", { XMVexScalar, VexScalar, EXqScalar }, 0 },
10200 /* VEX_W_0F11_P_0 */
10201 { "vmovups", { EXxS, XM }, 0 },
10204 /* VEX_W_0F11_P_1 */
10205 { "vmovss", { EXdVexScalarS, VexScalar, XMScalar }, 0 },
10208 /* VEX_W_0F11_P_2 */
10209 { "vmovupd", { EXxS, XM }, 0 },
10212 /* VEX_W_0F11_P_3 */
10213 { "vmovsd", { EXqVexScalarS, VexScalar, XMScalar }, 0 },
10216 /* VEX_W_0F12_P_0_M_0 */
10217 { "vmovlps", { XM, Vex128, EXq }, 0 },
10220 /* VEX_W_0F12_P_0_M_1 */
10221 { "vmovhlps", { XM, Vex128, EXq }, 0 },
10224 /* VEX_W_0F12_P_1 */
10225 { "vmovsldup", { XM, EXx }, 0 },
10228 /* VEX_W_0F12_P_2 */
10229 { "vmovlpd", { XM, Vex128, EXq }, 0 },
10232 /* VEX_W_0F12_P_3 */
10233 { "vmovddup", { XM, EXymmq }, 0 },
10236 /* VEX_W_0F13_M_0 */
10237 { "vmovlpX", { EXq, XM }, 0 },
10241 { "vunpcklpX", { XM, Vex, EXx }, 0 },
10245 { "vunpckhpX", { XM, Vex, EXx }, 0 },
10248 /* VEX_W_0F16_P_0_M_0 */
10249 { "vmovhps", { XM, Vex128, EXq }, 0 },
10252 /* VEX_W_0F16_P_0_M_1 */
10253 { "vmovlhps", { XM, Vex128, EXq }, 0 },
10256 /* VEX_W_0F16_P_1 */
10257 { "vmovshdup", { XM, EXx }, 0 },
10260 /* VEX_W_0F16_P_2 */
10261 { "vmovhpd", { XM, Vex128, EXq }, 0 },
10264 /* VEX_W_0F17_M_0 */
10265 { "vmovhpX", { EXq, XM }, 0 },
10269 { "vmovapX", { XM, EXx }, 0 },
10273 { "vmovapX", { EXxS, XM }, 0 },
10276 /* VEX_W_0F2B_M_0 */
10277 { "vmovntpX", { Mx, XM }, 0 },
10280 /* VEX_W_0F2E_P_0 */
10281 { "vucomiss", { XMScalar, EXdScalar }, 0 },
10284 /* VEX_W_0F2E_P_2 */
10285 { "vucomisd", { XMScalar, EXqScalar }, 0 },
10288 /* VEX_W_0F2F_P_0 */
10289 { "vcomiss", { XMScalar, EXdScalar }, 0 },
10292 /* VEX_W_0F2F_P_2 */
10293 { "vcomisd", { XMScalar, EXqScalar }, 0 },
10296 /* VEX_W_0F41_P_0_LEN_1 */
10297 { MOD_TABLE (MOD_VEX_W_0_0F41_P_0_LEN_1) },
10298 { MOD_TABLE (MOD_VEX_W_1_0F41_P_0_LEN_1) },
10301 /* VEX_W_0F41_P_2_LEN_1 */
10302 { MOD_TABLE (MOD_VEX_W_0_0F41_P_2_LEN_1) },
10303 { MOD_TABLE (MOD_VEX_W_1_0F41_P_2_LEN_1) }
10306 /* VEX_W_0F42_P_0_LEN_1 */
10307 { MOD_TABLE (MOD_VEX_W_0_0F42_P_0_LEN_1) },
10308 { MOD_TABLE (MOD_VEX_W_1_0F42_P_0_LEN_1) },
10311 /* VEX_W_0F42_P_2_LEN_1 */
10312 { MOD_TABLE (MOD_VEX_W_0_0F42_P_2_LEN_1) },
10313 { MOD_TABLE (MOD_VEX_W_1_0F42_P_2_LEN_1) },
10316 /* VEX_W_0F44_P_0_LEN_0 */
10317 { MOD_TABLE (MOD_VEX_W_0_0F44_P_0_LEN_1) },
10318 { MOD_TABLE (MOD_VEX_W_1_0F44_P_0_LEN_1) },
10321 /* VEX_W_0F44_P_2_LEN_0 */
10322 { MOD_TABLE (MOD_VEX_W_0_0F44_P_2_LEN_1) },
10323 { MOD_TABLE (MOD_VEX_W_1_0F44_P_2_LEN_1) },
10326 /* VEX_W_0F45_P_0_LEN_1 */
10327 { MOD_TABLE (MOD_VEX_W_0_0F45_P_0_LEN_1) },
10328 { MOD_TABLE (MOD_VEX_W_1_0F45_P_0_LEN_1) },
10331 /* VEX_W_0F45_P_2_LEN_1 */
10332 { MOD_TABLE (MOD_VEX_W_0_0F45_P_2_LEN_1) },
10333 { MOD_TABLE (MOD_VEX_W_1_0F45_P_2_LEN_1) },
10336 /* VEX_W_0F46_P_0_LEN_1 */
10337 { MOD_TABLE (MOD_VEX_W_0_0F46_P_0_LEN_1) },
10338 { MOD_TABLE (MOD_VEX_W_1_0F46_P_0_LEN_1) },
10341 /* VEX_W_0F46_P_2_LEN_1 */
10342 { MOD_TABLE (MOD_VEX_W_0_0F46_P_2_LEN_1) },
10343 { MOD_TABLE (MOD_VEX_W_1_0F46_P_2_LEN_1) },
10346 /* VEX_W_0F47_P_0_LEN_1 */
10347 { MOD_TABLE (MOD_VEX_W_0_0F47_P_0_LEN_1) },
10348 { MOD_TABLE (MOD_VEX_W_1_0F47_P_0_LEN_1) },
10351 /* VEX_W_0F47_P_2_LEN_1 */
10352 { MOD_TABLE (MOD_VEX_W_0_0F47_P_2_LEN_1) },
10353 { MOD_TABLE (MOD_VEX_W_1_0F47_P_2_LEN_1) },
10356 /* VEX_W_0F4A_P_0_LEN_1 */
10357 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_0_LEN_1) },
10358 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_0_LEN_1) },
10361 /* VEX_W_0F4A_P_2_LEN_1 */
10362 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_2_LEN_1) },
10363 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_2_LEN_1) },
10366 /* VEX_W_0F4B_P_0_LEN_1 */
10367 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_0_LEN_1) },
10368 { MOD_TABLE (MOD_VEX_W_1_0F4B_P_0_LEN_1) },
10371 /* VEX_W_0F4B_P_2_LEN_1 */
10372 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_2_LEN_1) },
10375 /* VEX_W_0F50_M_0 */
10376 { "vmovmskpX", { Gdq, XS }, 0 },
10379 /* VEX_W_0F51_P_0 */
10380 { "vsqrtps", { XM, EXx }, 0 },
10383 /* VEX_W_0F51_P_1 */
10384 { "vsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
10387 /* VEX_W_0F51_P_2 */
10388 { "vsqrtpd", { XM, EXx }, 0 },
10391 /* VEX_W_0F51_P_3 */
10392 { "vsqrtsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10395 /* VEX_W_0F52_P_0 */
10396 { "vrsqrtps", { XM, EXx }, 0 },
10399 /* VEX_W_0F52_P_1 */
10400 { "vrsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
10403 /* VEX_W_0F53_P_0 */
10404 { "vrcpps", { XM, EXx }, 0 },
10407 /* VEX_W_0F53_P_1 */
10408 { "vrcpss", { XMScalar, VexScalar, EXdScalar }, 0 },
10411 /* VEX_W_0F58_P_0 */
10412 { "vaddps", { XM, Vex, EXx }, 0 },
10415 /* VEX_W_0F58_P_1 */
10416 { "vaddss", { XMScalar, VexScalar, EXdScalar }, 0 },
10419 /* VEX_W_0F58_P_2 */
10420 { "vaddpd", { XM, Vex, EXx }, 0 },
10423 /* VEX_W_0F58_P_3 */
10424 { "vaddsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10427 /* VEX_W_0F59_P_0 */
10428 { "vmulps", { XM, Vex, EXx }, 0 },
10431 /* VEX_W_0F59_P_1 */
10432 { "vmulss", { XMScalar, VexScalar, EXdScalar }, 0 },
10435 /* VEX_W_0F59_P_2 */
10436 { "vmulpd", { XM, Vex, EXx }, 0 },
10439 /* VEX_W_0F59_P_3 */
10440 { "vmulsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10443 /* VEX_W_0F5A_P_0 */
10444 { "vcvtps2pd", { XM, EXxmmq }, 0 },
10447 /* VEX_W_0F5A_P_1 */
10448 { "vcvtss2sd", { XMScalar, VexScalar, EXdScalar }, 0 },
10451 /* VEX_W_0F5A_P_3 */
10452 { "vcvtsd2ss", { XMScalar, VexScalar, EXqScalar }, 0 },
10455 /* VEX_W_0F5B_P_0 */
10456 { "vcvtdq2ps", { XM, EXx }, 0 },
10459 /* VEX_W_0F5B_P_1 */
10460 { "vcvttps2dq", { XM, EXx }, 0 },
10463 /* VEX_W_0F5B_P_2 */
10464 { "vcvtps2dq", { XM, EXx }, 0 },
10467 /* VEX_W_0F5C_P_0 */
10468 { "vsubps", { XM, Vex, EXx }, 0 },
10471 /* VEX_W_0F5C_P_1 */
10472 { "vsubss", { XMScalar, VexScalar, EXdScalar }, 0 },
10475 /* VEX_W_0F5C_P_2 */
10476 { "vsubpd", { XM, Vex, EXx }, 0 },
10479 /* VEX_W_0F5C_P_3 */
10480 { "vsubsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10483 /* VEX_W_0F5D_P_0 */
10484 { "vminps", { XM, Vex, EXx }, 0 },
10487 /* VEX_W_0F5D_P_1 */
10488 { "vminss", { XMScalar, VexScalar, EXdScalar }, 0 },
10491 /* VEX_W_0F5D_P_2 */
10492 { "vminpd", { XM, Vex, EXx }, 0 },
10495 /* VEX_W_0F5D_P_3 */
10496 { "vminsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10499 /* VEX_W_0F5E_P_0 */
10500 { "vdivps", { XM, Vex, EXx }, 0 },
10503 /* VEX_W_0F5E_P_1 */
10504 { "vdivss", { XMScalar, VexScalar, EXdScalar }, 0 },
10507 /* VEX_W_0F5E_P_2 */
10508 { "vdivpd", { XM, Vex, EXx }, 0 },
10511 /* VEX_W_0F5E_P_3 */
10512 { "vdivsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10515 /* VEX_W_0F5F_P_0 */
10516 { "vmaxps", { XM, Vex, EXx }, 0 },
10519 /* VEX_W_0F5F_P_1 */
10520 { "vmaxss", { XMScalar, VexScalar, EXdScalar }, 0 },
10523 /* VEX_W_0F5F_P_2 */
10524 { "vmaxpd", { XM, Vex, EXx }, 0 },
10527 /* VEX_W_0F5F_P_3 */
10528 { "vmaxsd", { XMScalar, VexScalar, EXqScalar }, 0 },
10531 /* VEX_W_0F60_P_2 */
10532 { "vpunpcklbw", { XM, Vex, EXx }, 0 },
10535 /* VEX_W_0F61_P_2 */
10536 { "vpunpcklwd", { XM, Vex, EXx }, 0 },
10539 /* VEX_W_0F62_P_2 */
10540 { "vpunpckldq", { XM, Vex, EXx }, 0 },
10543 /* VEX_W_0F63_P_2 */
10544 { "vpacksswb", { XM, Vex, EXx }, 0 },
10547 /* VEX_W_0F64_P_2 */
10548 { "vpcmpgtb", { XM, Vex, EXx }, 0 },
10551 /* VEX_W_0F65_P_2 */
10552 { "vpcmpgtw", { XM, Vex, EXx }, 0 },
10555 /* VEX_W_0F66_P_2 */
10556 { "vpcmpgtd", { XM, Vex, EXx }, 0 },
10559 /* VEX_W_0F67_P_2 */
10560 { "vpackuswb", { XM, Vex, EXx }, 0 },
10563 /* VEX_W_0F68_P_2 */
10564 { "vpunpckhbw", { XM, Vex, EXx }, 0 },
10567 /* VEX_W_0F69_P_2 */
10568 { "vpunpckhwd", { XM, Vex, EXx }, 0 },
10571 /* VEX_W_0F6A_P_2 */
10572 { "vpunpckhdq", { XM, Vex, EXx }, 0 },
10575 /* VEX_W_0F6B_P_2 */
10576 { "vpackssdw", { XM, Vex, EXx }, 0 },
10579 /* VEX_W_0F6C_P_2 */
10580 { "vpunpcklqdq", { XM, Vex, EXx }, 0 },
10583 /* VEX_W_0F6D_P_2 */
10584 { "vpunpckhqdq", { XM, Vex, EXx }, 0 },
10587 /* VEX_W_0F6F_P_1 */
10588 { "vmovdqu", { XM, EXx }, 0 },
10591 /* VEX_W_0F6F_P_2 */
10592 { "vmovdqa", { XM, EXx }, 0 },
10595 /* VEX_W_0F70_P_1 */
10596 { "vpshufhw", { XM, EXx, Ib }, 0 },
10599 /* VEX_W_0F70_P_2 */
10600 { "vpshufd", { XM, EXx, Ib }, 0 },
10603 /* VEX_W_0F70_P_3 */
10604 { "vpshuflw", { XM, EXx, Ib }, 0 },
10607 /* VEX_W_0F71_R_2_P_2 */
10608 { "vpsrlw", { Vex, XS, Ib }, 0 },
10611 /* VEX_W_0F71_R_4_P_2 */
10612 { "vpsraw", { Vex, XS, Ib }, 0 },
10615 /* VEX_W_0F71_R_6_P_2 */
10616 { "vpsllw", { Vex, XS, Ib }, 0 },
10619 /* VEX_W_0F72_R_2_P_2 */
10620 { "vpsrld", { Vex, XS, Ib }, 0 },
10623 /* VEX_W_0F72_R_4_P_2 */
10624 { "vpsrad", { Vex, XS, Ib }, 0 },
10627 /* VEX_W_0F72_R_6_P_2 */
10628 { "vpslld", { Vex, XS, Ib }, 0 },
10631 /* VEX_W_0F73_R_2_P_2 */
10632 { "vpsrlq", { Vex, XS, Ib }, 0 },
10635 /* VEX_W_0F73_R_3_P_2 */
10636 { "vpsrldq", { Vex, XS, Ib }, 0 },
10639 /* VEX_W_0F73_R_6_P_2 */
10640 { "vpsllq", { Vex, XS, Ib }, 0 },
10643 /* VEX_W_0F73_R_7_P_2 */
10644 { "vpslldq", { Vex, XS, Ib }, 0 },
10647 /* VEX_W_0F74_P_2 */
10648 { "vpcmpeqb", { XM, Vex, EXx }, 0 },
10651 /* VEX_W_0F75_P_2 */
10652 { "vpcmpeqw", { XM, Vex, EXx }, 0 },
10655 /* VEX_W_0F76_P_2 */
10656 { "vpcmpeqd", { XM, Vex, EXx }, 0 },
10659 /* VEX_W_0F77_P_0 */
10660 { "", { VZERO }, 0 },
10663 /* VEX_W_0F7C_P_2 */
10664 { "vhaddpd", { XM, Vex, EXx }, 0 },
10667 /* VEX_W_0F7C_P_3 */
10668 { "vhaddps", { XM, Vex, EXx }, 0 },
10671 /* VEX_W_0F7D_P_2 */
10672 { "vhsubpd", { XM, Vex, EXx }, 0 },
10675 /* VEX_W_0F7D_P_3 */
10676 { "vhsubps", { XM, Vex, EXx }, 0 },
10679 /* VEX_W_0F7E_P_1 */
10680 { "vmovq", { XMScalar, EXqScalar }, 0 },
10683 /* VEX_W_0F7F_P_1 */
10684 { "vmovdqu", { EXxS, XM }, 0 },
10687 /* VEX_W_0F7F_P_2 */
10688 { "vmovdqa", { EXxS, XM }, 0 },
10691 /* VEX_W_0F90_P_0_LEN_0 */
10692 { "kmovw", { MaskG, MaskE }, 0 },
10693 { "kmovq", { MaskG, MaskE }, 0 },
10696 /* VEX_W_0F90_P_2_LEN_0 */
10697 { "kmovb", { MaskG, MaskBDE }, 0 },
10698 { "kmovd", { MaskG, MaskBDE }, 0 },
10701 /* VEX_W_0F91_P_0_LEN_0 */
10702 { MOD_TABLE (MOD_VEX_W_0_0F91_P_0_LEN_0) },
10703 { MOD_TABLE (MOD_VEX_W_1_0F91_P_0_LEN_0) },
10706 /* VEX_W_0F91_P_2_LEN_0 */
10707 { MOD_TABLE (MOD_VEX_W_0_0F91_P_2_LEN_0) },
10708 { MOD_TABLE (MOD_VEX_W_1_0F91_P_2_LEN_0) },
10711 /* VEX_W_0F92_P_0_LEN_0 */
10712 { MOD_TABLE (MOD_VEX_W_0_0F92_P_0_LEN_0) },
10715 /* VEX_W_0F92_P_2_LEN_0 */
10716 { MOD_TABLE (MOD_VEX_W_0_0F92_P_2_LEN_0) },
10719 /* VEX_W_0F92_P_3_LEN_0 */
10720 { MOD_TABLE (MOD_VEX_W_0_0F92_P_3_LEN_0) },
10721 { MOD_TABLE (MOD_VEX_W_1_0F92_P_3_LEN_0) },
10724 /* VEX_W_0F93_P_0_LEN_0 */
10725 { MOD_TABLE (MOD_VEX_W_0_0F93_P_0_LEN_0) },
10728 /* VEX_W_0F93_P_2_LEN_0 */
10729 { MOD_TABLE (MOD_VEX_W_0_0F93_P_2_LEN_0) },
10732 /* VEX_W_0F93_P_3_LEN_0 */
10733 { MOD_TABLE (MOD_VEX_W_0_0F93_P_3_LEN_0) },
10734 { MOD_TABLE (MOD_VEX_W_1_0F93_P_3_LEN_0) },
10737 /* VEX_W_0F98_P_0_LEN_0 */
10738 { MOD_TABLE (MOD_VEX_W_0_0F98_P_0_LEN_0) },
10739 { MOD_TABLE (MOD_VEX_W_1_0F98_P_0_LEN_0) },
10742 /* VEX_W_0F98_P_2_LEN_0 */
10743 { MOD_TABLE (MOD_VEX_W_0_0F98_P_2_LEN_0) },
10744 { MOD_TABLE (MOD_VEX_W_1_0F98_P_2_LEN_0) },
10747 /* VEX_W_0F99_P_0_LEN_0 */
10748 { MOD_TABLE (MOD_VEX_W_0_0F99_P_0_LEN_0) },
10749 { MOD_TABLE (MOD_VEX_W_1_0F99_P_0_LEN_0) },
10752 /* VEX_W_0F99_P_2_LEN_0 */
10753 { MOD_TABLE (MOD_VEX_W_0_0F99_P_2_LEN_0) },
10754 { MOD_TABLE (MOD_VEX_W_1_0F99_P_2_LEN_0) },
10757 /* VEX_W_0FAE_R_2_M_0 */
10758 { "vldmxcsr", { Md }, 0 },
10761 /* VEX_W_0FAE_R_3_M_0 */
10762 { "vstmxcsr", { Md }, 0 },
10765 /* VEX_W_0FC2_P_0 */
10766 { "vcmpps", { XM, Vex, EXx, VCMP }, 0 },
10769 /* VEX_W_0FC2_P_1 */
10770 { "vcmpss", { XMScalar, VexScalar, EXdScalar, VCMP }, 0 },
10773 /* VEX_W_0FC2_P_2 */
10774 { "vcmppd", { XM, Vex, EXx, VCMP }, 0 },
10777 /* VEX_W_0FC2_P_3 */
10778 { "vcmpsd", { XMScalar, VexScalar, EXqScalar, VCMP }, 0 },
10781 /* VEX_W_0FC4_P_2 */
10782 { "vpinsrw", { XM, Vex128, Edqw, Ib }, 0 },
10785 /* VEX_W_0FC5_P_2 */
10786 { "vpextrw", { Gdq, XS, Ib }, 0 },
10789 /* VEX_W_0FD0_P_2 */
10790 { "vaddsubpd", { XM, Vex, EXx }, 0 },
10793 /* VEX_W_0FD0_P_3 */
10794 { "vaddsubps", { XM, Vex, EXx }, 0 },
10797 /* VEX_W_0FD1_P_2 */
10798 { "vpsrlw", { XM, Vex, EXxmm }, 0 },
10801 /* VEX_W_0FD2_P_2 */
10802 { "vpsrld", { XM, Vex, EXxmm }, 0 },
10805 /* VEX_W_0FD3_P_2 */
10806 { "vpsrlq", { XM, Vex, EXxmm }, 0 },
10809 /* VEX_W_0FD4_P_2 */
10810 { "vpaddq", { XM, Vex, EXx }, 0 },
10813 /* VEX_W_0FD5_P_2 */
10814 { "vpmullw", { XM, Vex, EXx }, 0 },
10817 /* VEX_W_0FD6_P_2 */
10818 { "vmovq", { EXqScalarS, XMScalar }, 0 },
10821 /* VEX_W_0FD7_P_2_M_1 */
10822 { "vpmovmskb", { Gdq, XS }, 0 },
10825 /* VEX_W_0FD8_P_2 */
10826 { "vpsubusb", { XM, Vex, EXx }, 0 },
10829 /* VEX_W_0FD9_P_2 */
10830 { "vpsubusw", { XM, Vex, EXx }, 0 },
10833 /* VEX_W_0FDA_P_2 */
10834 { "vpminub", { XM, Vex, EXx }, 0 },
10837 /* VEX_W_0FDB_P_2 */
10838 { "vpand", { XM, Vex, EXx }, 0 },
10841 /* VEX_W_0FDC_P_2 */
10842 { "vpaddusb", { XM, Vex, EXx }, 0 },
10845 /* VEX_W_0FDD_P_2 */
10846 { "vpaddusw", { XM, Vex, EXx }, 0 },
10849 /* VEX_W_0FDE_P_2 */
10850 { "vpmaxub", { XM, Vex, EXx }, 0 },
10853 /* VEX_W_0FDF_P_2 */
10854 { "vpandn", { XM, Vex, EXx }, 0 },
10857 /* VEX_W_0FE0_P_2 */
10858 { "vpavgb", { XM, Vex, EXx }, 0 },
10861 /* VEX_W_0FE1_P_2 */
10862 { "vpsraw", { XM, Vex, EXxmm }, 0 },
10865 /* VEX_W_0FE2_P_2 */
10866 { "vpsrad", { XM, Vex, EXxmm }, 0 },
10869 /* VEX_W_0FE3_P_2 */
10870 { "vpavgw", { XM, Vex, EXx }, 0 },
10873 /* VEX_W_0FE4_P_2 */
10874 { "vpmulhuw", { XM, Vex, EXx }, 0 },
10877 /* VEX_W_0FE5_P_2 */
10878 { "vpmulhw", { XM, Vex, EXx }, 0 },
10881 /* VEX_W_0FE6_P_1 */
10882 { "vcvtdq2pd", { XM, EXxmmq }, 0 },
10885 /* VEX_W_0FE6_P_2 */
10886 { "vcvttpd2dq%XY", { XMM, EXx }, 0 },
10889 /* VEX_W_0FE6_P_3 */
10890 { "vcvtpd2dq%XY", { XMM, EXx }, 0 },
10893 /* VEX_W_0FE7_P_2_M_0 */
10894 { "vmovntdq", { Mx, XM }, 0 },
10897 /* VEX_W_0FE8_P_2 */
10898 { "vpsubsb", { XM, Vex, EXx }, 0 },
10901 /* VEX_W_0FE9_P_2 */
10902 { "vpsubsw", { XM, Vex, EXx }, 0 },
10905 /* VEX_W_0FEA_P_2 */
10906 { "vpminsw", { XM, Vex, EXx }, 0 },
10909 /* VEX_W_0FEB_P_2 */
10910 { "vpor", { XM, Vex, EXx }, 0 },
10913 /* VEX_W_0FEC_P_2 */
10914 { "vpaddsb", { XM, Vex, EXx }, 0 },
10917 /* VEX_W_0FED_P_2 */
10918 { "vpaddsw", { XM, Vex, EXx }, 0 },
10921 /* VEX_W_0FEE_P_2 */
10922 { "vpmaxsw", { XM, Vex, EXx }, 0 },
10925 /* VEX_W_0FEF_P_2 */
10926 { "vpxor", { XM, Vex, EXx }, 0 },
10929 /* VEX_W_0FF0_P_3_M_0 */
10930 { "vlddqu", { XM, M }, 0 },
10933 /* VEX_W_0FF1_P_2 */
10934 { "vpsllw", { XM, Vex, EXxmm }, 0 },
10937 /* VEX_W_0FF2_P_2 */
10938 { "vpslld", { XM, Vex, EXxmm }, 0 },
10941 /* VEX_W_0FF3_P_2 */
10942 { "vpsllq", { XM, Vex, EXxmm }, 0 },
10945 /* VEX_W_0FF4_P_2 */
10946 { "vpmuludq", { XM, Vex, EXx }, 0 },
10949 /* VEX_W_0FF5_P_2 */
10950 { "vpmaddwd", { XM, Vex, EXx }, 0 },
10953 /* VEX_W_0FF6_P_2 */
10954 { "vpsadbw", { XM, Vex, EXx }, 0 },
10957 /* VEX_W_0FF7_P_2 */
10958 { "vmaskmovdqu", { XM, XS }, 0 },
10961 /* VEX_W_0FF8_P_2 */
10962 { "vpsubb", { XM, Vex, EXx }, 0 },
10965 /* VEX_W_0FF9_P_2 */
10966 { "vpsubw", { XM, Vex, EXx }, 0 },
10969 /* VEX_W_0FFA_P_2 */
10970 { "vpsubd", { XM, Vex, EXx }, 0 },
10973 /* VEX_W_0FFB_P_2 */
10974 { "vpsubq", { XM, Vex, EXx }, 0 },
10977 /* VEX_W_0FFC_P_2 */
10978 { "vpaddb", { XM, Vex, EXx }, 0 },
10981 /* VEX_W_0FFD_P_2 */
10982 { "vpaddw", { XM, Vex, EXx }, 0 },
10985 /* VEX_W_0FFE_P_2 */
10986 { "vpaddd", { XM, Vex, EXx }, 0 },
10989 /* VEX_W_0F3800_P_2 */
10990 { "vpshufb", { XM, Vex, EXx }, 0 },
10993 /* VEX_W_0F3801_P_2 */
10994 { "vphaddw", { XM, Vex, EXx }, 0 },
10997 /* VEX_W_0F3802_P_2 */
10998 { "vphaddd", { XM, Vex, EXx }, 0 },
11001 /* VEX_W_0F3803_P_2 */
11002 { "vphaddsw", { XM, Vex, EXx }, 0 },
11005 /* VEX_W_0F3804_P_2 */
11006 { "vpmaddubsw", { XM, Vex, EXx }, 0 },
11009 /* VEX_W_0F3805_P_2 */
11010 { "vphsubw", { XM, Vex, EXx }, 0 },
11013 /* VEX_W_0F3806_P_2 */
11014 { "vphsubd", { XM, Vex, EXx }, 0 },
11017 /* VEX_W_0F3807_P_2 */
11018 { "vphsubsw", { XM, Vex, EXx }, 0 },
11021 /* VEX_W_0F3808_P_2 */
11022 { "vpsignb", { XM, Vex, EXx }, 0 },
11025 /* VEX_W_0F3809_P_2 */
11026 { "vpsignw", { XM, Vex, EXx }, 0 },
11029 /* VEX_W_0F380A_P_2 */
11030 { "vpsignd", { XM, Vex, EXx }, 0 },
11033 /* VEX_W_0F380B_P_2 */
11034 { "vpmulhrsw", { XM, Vex, EXx }, 0 },
11037 /* VEX_W_0F380C_P_2 */
11038 { "vpermilps", { XM, Vex, EXx }, 0 },
11041 /* VEX_W_0F380D_P_2 */
11042 { "vpermilpd", { XM, Vex, EXx }, 0 },
11045 /* VEX_W_0F380E_P_2 */
11046 { "vtestps", { XM, EXx }, 0 },
11049 /* VEX_W_0F380F_P_2 */
11050 { "vtestpd", { XM, EXx }, 0 },
11053 /* VEX_W_0F3816_P_2 */
11054 { "vpermps", { XM, Vex, EXx }, 0 },
11057 /* VEX_W_0F3817_P_2 */
11058 { "vptest", { XM, EXx }, 0 },
11061 /* VEX_W_0F3818_P_2 */
11062 { "vbroadcastss", { XM, EXxmm_md }, 0 },
11065 /* VEX_W_0F3819_P_2 */
11066 { "vbroadcastsd", { XM, EXxmm_mq }, 0 },
11069 /* VEX_W_0F381A_P_2_M_0 */
11070 { "vbroadcastf128", { XM, Mxmm }, 0 },
11073 /* VEX_W_0F381C_P_2 */
11074 { "vpabsb", { XM, EXx }, 0 },
11077 /* VEX_W_0F381D_P_2 */
11078 { "vpabsw", { XM, EXx }, 0 },
11081 /* VEX_W_0F381E_P_2 */
11082 { "vpabsd", { XM, EXx }, 0 },
11085 /* VEX_W_0F3820_P_2 */
11086 { "vpmovsxbw", { XM, EXxmmq }, 0 },
11089 /* VEX_W_0F3821_P_2 */
11090 { "vpmovsxbd", { XM, EXxmmqd }, 0 },
11093 /* VEX_W_0F3822_P_2 */
11094 { "vpmovsxbq", { XM, EXxmmdw }, 0 },
11097 /* VEX_W_0F3823_P_2 */
11098 { "vpmovsxwd", { XM, EXxmmq }, 0 },
11101 /* VEX_W_0F3824_P_2 */
11102 { "vpmovsxwq", { XM, EXxmmqd }, 0 },
11105 /* VEX_W_0F3825_P_2 */
11106 { "vpmovsxdq", { XM, EXxmmq }, 0 },
11109 /* VEX_W_0F3828_P_2 */
11110 { "vpmuldq", { XM, Vex, EXx }, 0 },
11113 /* VEX_W_0F3829_P_2 */
11114 { "vpcmpeqq", { XM, Vex, EXx }, 0 },
11117 /* VEX_W_0F382A_P_2_M_0 */
11118 { "vmovntdqa", { XM, Mx }, 0 },
11121 /* VEX_W_0F382B_P_2 */
11122 { "vpackusdw", { XM, Vex, EXx }, 0 },
11125 /* VEX_W_0F382C_P_2_M_0 */
11126 { "vmaskmovps", { XM, Vex, Mx }, 0 },
11129 /* VEX_W_0F382D_P_2_M_0 */
11130 { "vmaskmovpd", { XM, Vex, Mx }, 0 },
11133 /* VEX_W_0F382E_P_2_M_0 */
11134 { "vmaskmovps", { Mx, Vex, XM }, 0 },
11137 /* VEX_W_0F382F_P_2_M_0 */
11138 { "vmaskmovpd", { Mx, Vex, XM }, 0 },
11141 /* VEX_W_0F3830_P_2 */
11142 { "vpmovzxbw", { XM, EXxmmq }, 0 },
11145 /* VEX_W_0F3831_P_2 */
11146 { "vpmovzxbd", { XM, EXxmmqd }, 0 },
11149 /* VEX_W_0F3832_P_2 */
11150 { "vpmovzxbq", { XM, EXxmmdw }, 0 },
11153 /* VEX_W_0F3833_P_2 */
11154 { "vpmovzxwd", { XM, EXxmmq }, 0 },
11157 /* VEX_W_0F3834_P_2 */
11158 { "vpmovzxwq", { XM, EXxmmqd }, 0 },
11161 /* VEX_W_0F3835_P_2 */
11162 { "vpmovzxdq", { XM, EXxmmq }, 0 },
11165 /* VEX_W_0F3836_P_2 */
11166 { "vpermd", { XM, Vex, EXx }, 0 },
11169 /* VEX_W_0F3837_P_2 */
11170 { "vpcmpgtq", { XM, Vex, EXx }, 0 },
11173 /* VEX_W_0F3838_P_2 */
11174 { "vpminsb", { XM, Vex, EXx }, 0 },
11177 /* VEX_W_0F3839_P_2 */
11178 { "vpminsd", { XM, Vex, EXx }, 0 },
11181 /* VEX_W_0F383A_P_2 */
11182 { "vpminuw", { XM, Vex, EXx }, 0 },
11185 /* VEX_W_0F383B_P_2 */
11186 { "vpminud", { XM, Vex, EXx }, 0 },
11189 /* VEX_W_0F383C_P_2 */
11190 { "vpmaxsb", { XM, Vex, EXx }, 0 },
11193 /* VEX_W_0F383D_P_2 */
11194 { "vpmaxsd", { XM, Vex, EXx }, 0 },
11197 /* VEX_W_0F383E_P_2 */
11198 { "vpmaxuw", { XM, Vex, EXx }, 0 },
11201 /* VEX_W_0F383F_P_2 */
11202 { "vpmaxud", { XM, Vex, EXx }, 0 },
11205 /* VEX_W_0F3840_P_2 */
11206 { "vpmulld", { XM, Vex, EXx }, 0 },
11209 /* VEX_W_0F3841_P_2 */
11210 { "vphminposuw", { XM, EXx }, 0 },
11213 /* VEX_W_0F3846_P_2 */
11214 { "vpsravd", { XM, Vex, EXx }, 0 },
11217 /* VEX_W_0F3858_P_2 */
11218 { "vpbroadcastd", { XM, EXxmm_md }, 0 },
11221 /* VEX_W_0F3859_P_2 */
11222 { "vpbroadcastq", { XM, EXxmm_mq }, 0 },
11225 /* VEX_W_0F385A_P_2_M_0 */
11226 { "vbroadcasti128", { XM, Mxmm }, 0 },
11229 /* VEX_W_0F3878_P_2 */
11230 { "vpbroadcastb", { XM, EXxmm_mb }, 0 },
11233 /* VEX_W_0F3879_P_2 */
11234 { "vpbroadcastw", { XM, EXxmm_mw }, 0 },
11237 /* VEX_W_0F38DB_P_2 */
11238 { "vaesimc", { XM, EXx }, 0 },
11241 /* VEX_W_0F38DC_P_2 */
11242 { "vaesenc", { XM, Vex128, EXx }, 0 },
11245 /* VEX_W_0F38DD_P_2 */
11246 { "vaesenclast", { XM, Vex128, EXx }, 0 },
11249 /* VEX_W_0F38DE_P_2 */
11250 { "vaesdec", { XM, Vex128, EXx }, 0 },
11253 /* VEX_W_0F38DF_P_2 */
11254 { "vaesdeclast", { XM, Vex128, EXx }, 0 },
11257 /* VEX_W_0F3A00_P_2 */
11259 { "vpermq", { XM, EXx, Ib }, 0 },
11262 /* VEX_W_0F3A01_P_2 */
11264 { "vpermpd", { XM, EXx, Ib }, 0 },
11267 /* VEX_W_0F3A02_P_2 */
11268 { "vpblendd", { XM, Vex, EXx, Ib }, 0 },
11271 /* VEX_W_0F3A04_P_2 */
11272 { "vpermilps", { XM, EXx, Ib }, 0 },
11275 /* VEX_W_0F3A05_P_2 */
11276 { "vpermilpd", { XM, EXx, Ib }, 0 },
11279 /* VEX_W_0F3A06_P_2 */
11280 { "vperm2f128", { XM, Vex256, EXx, Ib }, 0 },
11283 /* VEX_W_0F3A08_P_2 */
11284 { "vroundps", { XM, EXx, Ib }, 0 },
11287 /* VEX_W_0F3A09_P_2 */
11288 { "vroundpd", { XM, EXx, Ib }, 0 },
11291 /* VEX_W_0F3A0A_P_2 */
11292 { "vroundss", { XMScalar, VexScalar, EXdScalar, Ib }, 0 },
11295 /* VEX_W_0F3A0B_P_2 */
11296 { "vroundsd", { XMScalar, VexScalar, EXqScalar, Ib }, 0 },
11299 /* VEX_W_0F3A0C_P_2 */
11300 { "vblendps", { XM, Vex, EXx, Ib }, 0 },
11303 /* VEX_W_0F3A0D_P_2 */
11304 { "vblendpd", { XM, Vex, EXx, Ib }, 0 },
11307 /* VEX_W_0F3A0E_P_2 */
11308 { "vpblendw", { XM, Vex, EXx, Ib }, 0 },
11311 /* VEX_W_0F3A0F_P_2 */
11312 { "vpalignr", { XM, Vex, EXx, Ib }, 0 },
11315 /* VEX_W_0F3A14_P_2 */
11316 { "vpextrb", { Edqb, XM, Ib }, 0 },
11319 /* VEX_W_0F3A15_P_2 */
11320 { "vpextrw", { Edqw, XM, Ib }, 0 },
11323 /* VEX_W_0F3A18_P_2 */
11324 { "vinsertf128", { XM, Vex256, EXxmm, Ib }, 0 },
11327 /* VEX_W_0F3A19_P_2 */
11328 { "vextractf128", { EXxmm, XM, Ib }, 0 },
11331 /* VEX_W_0F3A20_P_2 */
11332 { "vpinsrb", { XM, Vex128, Edqb, Ib }, 0 },
11335 /* VEX_W_0F3A21_P_2 */
11336 { "vinsertps", { XM, Vex128, EXd, Ib }, 0 },
11339 /* VEX_W_0F3A30_P_2_LEN_0 */
11340 { MOD_TABLE (MOD_VEX_W_0_0F3A30_P_2_LEN_0) },
11341 { MOD_TABLE (MOD_VEX_W_1_0F3A30_P_2_LEN_0) },
11344 /* VEX_W_0F3A31_P_2_LEN_0 */
11345 { MOD_TABLE (MOD_VEX_W_0_0F3A31_P_2_LEN_0) },
11346 { MOD_TABLE (MOD_VEX_W_1_0F3A31_P_2_LEN_0) },
11349 /* VEX_W_0F3A32_P_2_LEN_0 */
11350 { MOD_TABLE (MOD_VEX_W_0_0F3A32_P_2_LEN_0) },
11351 { MOD_TABLE (MOD_VEX_W_1_0F3A32_P_2_LEN_0) },
11354 /* VEX_W_0F3A33_P_2_LEN_0 */
11355 { MOD_TABLE (MOD_VEX_W_0_0F3A33_P_2_LEN_0) },
11356 { MOD_TABLE (MOD_VEX_W_1_0F3A33_P_2_LEN_0) },
11359 /* VEX_W_0F3A38_P_2 */
11360 { "vinserti128", { XM, Vex256, EXxmm, Ib }, 0 },
11363 /* VEX_W_0F3A39_P_2 */
11364 { "vextracti128", { EXxmm, XM, Ib }, 0 },
11367 /* VEX_W_0F3A40_P_2 */
11368 { "vdpps", { XM, Vex, EXx, Ib }, 0 },
11371 /* VEX_W_0F3A41_P_2 */
11372 { "vdppd", { XM, Vex128, EXx, Ib }, 0 },
11375 /* VEX_W_0F3A42_P_2 */
11376 { "vmpsadbw", { XM, Vex, EXx, Ib }, 0 },
11379 /* VEX_W_0F3A44_P_2 */
11380 { "vpclmulqdq", { XM, Vex128, EXx, PCLMUL }, 0 },
11383 /* VEX_W_0F3A46_P_2 */
11384 { "vperm2i128", { XM, Vex256, EXx, Ib }, 0 },
11387 /* VEX_W_0F3A48_P_2 */
11388 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
11389 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
11392 /* VEX_W_0F3A49_P_2 */
11393 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
11394 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
11397 /* VEX_W_0F3A4A_P_2 */
11398 { "vblendvps", { XM, Vex, EXx, XMVexI4 }, 0 },
11401 /* VEX_W_0F3A4B_P_2 */
11402 { "vblendvpd", { XM, Vex, EXx, XMVexI4 }, 0 },
11405 /* VEX_W_0F3A4C_P_2 */
11406 { "vpblendvb", { XM, Vex, EXx, XMVexI4 }, 0 },
11409 /* VEX_W_0F3A62_P_2 */
11410 { "vpcmpistrm", { XM, EXx, Ib }, 0 },
11413 /* VEX_W_0F3A63_P_2 */
11414 { "vpcmpistri", { XM, EXx, Ib }, 0 },
11417 /* VEX_W_0F3ADF_P_2 */
11418 { "vaeskeygenassist", { XM, EXx, Ib }, 0 },
11420 #define NEED_VEX_W_TABLE
11421 #include "i386-dis-evex.h"
11422 #undef NEED_VEX_W_TABLE
11425 static const struct dis386 mod_table[][2] = {
11428 { "leaS", { Gv, M }, 0 },
11433 { RM_TABLE (RM_C6_REG_7) },
11438 { RM_TABLE (RM_C7_REG_7) },
11442 { "Jcall^", { indirEp }, 0 },
11446 { "Jjmp^", { indirEp }, 0 },
11449 /* MOD_0F01_REG_0 */
11450 { X86_64_TABLE (X86_64_0F01_REG_0) },
11451 { RM_TABLE (RM_0F01_REG_0) },
11454 /* MOD_0F01_REG_1 */
11455 { X86_64_TABLE (X86_64_0F01_REG_1) },
11456 { RM_TABLE (RM_0F01_REG_1) },
11459 /* MOD_0F01_REG_2 */
11460 { X86_64_TABLE (X86_64_0F01_REG_2) },
11461 { RM_TABLE (RM_0F01_REG_2) },
11464 /* MOD_0F01_REG_3 */
11465 { X86_64_TABLE (X86_64_0F01_REG_3) },
11466 { RM_TABLE (RM_0F01_REG_3) },
11469 /* MOD_0F01_REG_5 */
11470 { PREFIX_TABLE (PREFIX_MOD_0_0F01_REG_5) },
11471 { RM_TABLE (RM_0F01_REG_5) },
11474 /* MOD_0F01_REG_7 */
11475 { "invlpg", { Mb }, 0 },
11476 { RM_TABLE (RM_0F01_REG_7) },
11479 /* MOD_0F12_PREFIX_0 */
11480 { "movlps", { XM, EXq }, PREFIX_OPCODE },
11481 { "movhlps", { XM, EXq }, PREFIX_OPCODE },
11485 { "movlpX", { EXq, XM }, PREFIX_OPCODE },
11488 /* MOD_0F16_PREFIX_0 */
11489 { "movhps", { XM, EXq }, 0 },
11490 { "movlhps", { XM, EXq }, 0 },
11494 { "movhpX", { EXq, XM }, PREFIX_OPCODE },
11497 /* MOD_0F18_REG_0 */
11498 { "prefetchnta", { Mb }, 0 },
11501 /* MOD_0F18_REG_1 */
11502 { "prefetcht0", { Mb }, 0 },
11505 /* MOD_0F18_REG_2 */
11506 { "prefetcht1", { Mb }, 0 },
11509 /* MOD_0F18_REG_3 */
11510 { "prefetcht2", { Mb }, 0 },
11513 /* MOD_0F18_REG_4 */
11514 { "nop/reserved", { Mb }, 0 },
11517 /* MOD_0F18_REG_5 */
11518 { "nop/reserved", { Mb }, 0 },
11521 /* MOD_0F18_REG_6 */
11522 { "nop/reserved", { Mb }, 0 },
11525 /* MOD_0F18_REG_7 */
11526 { "nop/reserved", { Mb }, 0 },
11529 /* MOD_0F1A_PREFIX_0 */
11530 { "bndldx", { Gbnd, Ev_bnd }, 0 },
11531 { "nopQ", { Ev }, 0 },
11534 /* MOD_0F1B_PREFIX_0 */
11535 { "bndstx", { Ev_bnd, Gbnd }, 0 },
11536 { "nopQ", { Ev }, 0 },
11539 /* MOD_0F1B_PREFIX_1 */
11540 { "bndmk", { Gbnd, Ev_bnd }, 0 },
11541 { "nopQ", { Ev }, 0 },
11544 /* MOD_0F1E_PREFIX_1 */
11545 { "nopQ", { Ev }, 0 },
11546 { REG_TABLE (REG_0F1E_MOD_3) },
11551 { "movL", { Rd, Td }, 0 },
11556 { "movL", { Td, Rd }, 0 },
11559 /* MOD_0F2B_PREFIX_0 */
11560 {"movntps", { Mx, XM }, PREFIX_OPCODE },
11563 /* MOD_0F2B_PREFIX_1 */
11564 {"movntss", { Md, XM }, PREFIX_OPCODE },
11567 /* MOD_0F2B_PREFIX_2 */
11568 {"movntpd", { Mx, XM }, PREFIX_OPCODE },
11571 /* MOD_0F2B_PREFIX_3 */
11572 {"movntsd", { Mq, XM }, PREFIX_OPCODE },
11577 { "movmskpX", { Gdq, XS }, PREFIX_OPCODE },
11580 /* MOD_0F71_REG_2 */
11582 { "psrlw", { MS, Ib }, 0 },
11585 /* MOD_0F71_REG_4 */
11587 { "psraw", { MS, Ib }, 0 },
11590 /* MOD_0F71_REG_6 */
11592 { "psllw", { MS, Ib }, 0 },
11595 /* MOD_0F72_REG_2 */
11597 { "psrld", { MS, Ib }, 0 },
11600 /* MOD_0F72_REG_4 */
11602 { "psrad", { MS, Ib }, 0 },
11605 /* MOD_0F72_REG_6 */
11607 { "pslld", { MS, Ib }, 0 },
11610 /* MOD_0F73_REG_2 */
11612 { "psrlq", { MS, Ib }, 0 },
11615 /* MOD_0F73_REG_3 */
11617 { PREFIX_TABLE (PREFIX_0F73_REG_3) },
11620 /* MOD_0F73_REG_6 */
11622 { "psllq", { MS, Ib }, 0 },
11625 /* MOD_0F73_REG_7 */
11627 { PREFIX_TABLE (PREFIX_0F73_REG_7) },
11630 /* MOD_0FAE_REG_0 */
11631 { "fxsave", { FXSAVE }, 0 },
11632 { PREFIX_TABLE (PREFIX_0FAE_REG_0) },
11635 /* MOD_0FAE_REG_1 */
11636 { "fxrstor", { FXSAVE }, 0 },
11637 { PREFIX_TABLE (PREFIX_0FAE_REG_1) },
11640 /* MOD_0FAE_REG_2 */
11641 { "ldmxcsr", { Md }, 0 },
11642 { PREFIX_TABLE (PREFIX_0FAE_REG_2) },
11645 /* MOD_0FAE_REG_3 */
11646 { "stmxcsr", { Md }, 0 },
11647 { PREFIX_TABLE (PREFIX_0FAE_REG_3) },
11650 /* MOD_0FAE_REG_4 */
11651 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_4) },
11652 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_4) },
11655 /* MOD_0FAE_REG_5 */
11656 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_5) },
11657 { RM_TABLE (RM_0FAE_REG_5) },
11660 /* MOD_0FAE_REG_6 */
11661 { PREFIX_TABLE (PREFIX_0FAE_REG_6) },
11662 { RM_TABLE (RM_0FAE_REG_6) },
11665 /* MOD_0FAE_REG_7 */
11666 { PREFIX_TABLE (PREFIX_0FAE_REG_7) },
11667 { RM_TABLE (RM_0FAE_REG_7) },
11671 { "lssS", { Gv, Mp }, 0 },
11675 { "lfsS", { Gv, Mp }, 0 },
11679 { "lgsS", { Gv, Mp }, 0 },
11683 { PREFIX_TABLE (PREFIX_MOD_0_0FC3) },
11686 /* MOD_0FC7_REG_3 */
11687 { "xrstors", { FXSAVE }, 0 },
11690 /* MOD_0FC7_REG_4 */
11691 { "xsavec", { FXSAVE }, 0 },
11694 /* MOD_0FC7_REG_5 */
11695 { "xsaves", { FXSAVE }, 0 },
11698 /* MOD_0FC7_REG_6 */
11699 { PREFIX_TABLE (PREFIX_MOD_0_0FC7_REG_6) },
11700 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_6) }
11703 /* MOD_0FC7_REG_7 */
11704 { "vmptrst", { Mq }, 0 },
11705 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_7) }
11710 { "pmovmskb", { Gdq, MS }, 0 },
11713 /* MOD_0FE7_PREFIX_2 */
11714 { "movntdq", { Mx, XM }, 0 },
11717 /* MOD_0FF0_PREFIX_3 */
11718 { "lddqu", { XM, M }, 0 },
11721 /* MOD_0F382A_PREFIX_2 */
11722 { "movntdqa", { XM, Mx }, 0 },
11725 /* MOD_0F38F5_PREFIX_2 */
11726 { "wrussK", { M, Gdq }, PREFIX_OPCODE },
11729 /* MOD_0F38F6_PREFIX_0 */
11730 { "wrssK", { M, Gdq }, PREFIX_OPCODE },
11734 { "bound{S|}", { Gv, Ma }, 0 },
11735 { EVEX_TABLE (EVEX_0F) },
11739 { "lesS", { Gv, Mp }, 0 },
11740 { VEX_C4_TABLE (VEX_0F) },
11744 { "ldsS", { Gv, Mp }, 0 },
11745 { VEX_C5_TABLE (VEX_0F) },
11748 /* MOD_VEX_0F12_PREFIX_0 */
11749 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0) },
11750 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1) },
11754 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0) },
11757 /* MOD_VEX_0F16_PREFIX_0 */
11758 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0) },
11759 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1) },
11763 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0) },
11767 { VEX_W_TABLE (VEX_W_0F2B_M_0) },
11770 /* MOD_VEX_W_0_0F41_P_0_LEN_1 */
11772 { "kandw", { MaskG, MaskVex, MaskR }, 0 },
11775 /* MOD_VEX_W_1_0F41_P_0_LEN_1 */
11777 { "kandq", { MaskG, MaskVex, MaskR }, 0 },
11780 /* MOD_VEX_W_0_0F41_P_2_LEN_1 */
11782 { "kandb", { MaskG, MaskVex, MaskR }, 0 },
11785 /* MOD_VEX_W_1_0F41_P_2_LEN_1 */
11787 { "kandd", { MaskG, MaskVex, MaskR }, 0 },
11790 /* MOD_VEX_W_0_0F42_P_0_LEN_1 */
11792 { "kandnw", { MaskG, MaskVex, MaskR }, 0 },
11795 /* MOD_VEX_W_1_0F42_P_0_LEN_1 */
11797 { "kandnq", { MaskG, MaskVex, MaskR }, 0 },
11800 /* MOD_VEX_W_0_0F42_P_2_LEN_1 */
11802 { "kandnb", { MaskG, MaskVex, MaskR }, 0 },
11805 /* MOD_VEX_W_1_0F42_P_2_LEN_1 */
11807 { "kandnd", { MaskG, MaskVex, MaskR }, 0 },
11810 /* MOD_VEX_W_0_0F44_P_0_LEN_0 */
11812 { "knotw", { MaskG, MaskR }, 0 },
11815 /* MOD_VEX_W_1_0F44_P_0_LEN_0 */
11817 { "knotq", { MaskG, MaskR }, 0 },
11820 /* MOD_VEX_W_0_0F44_P_2_LEN_0 */
11822 { "knotb", { MaskG, MaskR }, 0 },
11825 /* MOD_VEX_W_1_0F44_P_2_LEN_0 */
11827 { "knotd", { MaskG, MaskR }, 0 },
11830 /* MOD_VEX_W_0_0F45_P_0_LEN_1 */
11832 { "korw", { MaskG, MaskVex, MaskR }, 0 },
11835 /* MOD_VEX_W_1_0F45_P_0_LEN_1 */
11837 { "korq", { MaskG, MaskVex, MaskR }, 0 },
11840 /* MOD_VEX_W_0_0F45_P_2_LEN_1 */
11842 { "korb", { MaskG, MaskVex, MaskR }, 0 },
11845 /* MOD_VEX_W_1_0F45_P_2_LEN_1 */
11847 { "kord", { MaskG, MaskVex, MaskR }, 0 },
11850 /* MOD_VEX_W_0_0F46_P_0_LEN_1 */
11852 { "kxnorw", { MaskG, MaskVex, MaskR }, 0 },
11855 /* MOD_VEX_W_1_0F46_P_0_LEN_1 */
11857 { "kxnorq", { MaskG, MaskVex, MaskR }, 0 },
11860 /* MOD_VEX_W_0_0F46_P_2_LEN_1 */
11862 { "kxnorb", { MaskG, MaskVex, MaskR }, 0 },
11865 /* MOD_VEX_W_1_0F46_P_2_LEN_1 */
11867 { "kxnord", { MaskG, MaskVex, MaskR }, 0 },
11870 /* MOD_VEX_W_0_0F47_P_0_LEN_1 */
11872 { "kxorw", { MaskG, MaskVex, MaskR }, 0 },
11875 /* MOD_VEX_W_1_0F47_P_0_LEN_1 */
11877 { "kxorq", { MaskG, MaskVex, MaskR }, 0 },
11880 /* MOD_VEX_W_0_0F47_P_2_LEN_1 */
11882 { "kxorb", { MaskG, MaskVex, MaskR }, 0 },
11885 /* MOD_VEX_W_1_0F47_P_2_LEN_1 */
11887 { "kxord", { MaskG, MaskVex, MaskR }, 0 },
11890 /* MOD_VEX_W_0_0F4A_P_0_LEN_1 */
11892 { "kaddw", { MaskG, MaskVex, MaskR }, 0 },
11895 /* MOD_VEX_W_1_0F4A_P_0_LEN_1 */
11897 { "kaddq", { MaskG, MaskVex, MaskR }, 0 },
11900 /* MOD_VEX_W_0_0F4A_P_2_LEN_1 */
11902 { "kaddb", { MaskG, MaskVex, MaskR }, 0 },
11905 /* MOD_VEX_W_1_0F4A_P_2_LEN_1 */
11907 { "kaddd", { MaskG, MaskVex, MaskR }, 0 },
11910 /* MOD_VEX_W_0_0F4B_P_0_LEN_1 */
11912 { "kunpckwd", { MaskG, MaskVex, MaskR }, 0 },
11915 /* MOD_VEX_W_1_0F4B_P_0_LEN_1 */
11917 { "kunpckdq", { MaskG, MaskVex, MaskR }, 0 },
11920 /* MOD_VEX_W_0_0F4B_P_2_LEN_1 */
11922 { "kunpckbw", { MaskG, MaskVex, MaskR }, 0 },
11927 { VEX_W_TABLE (VEX_W_0F50_M_0) },
11930 /* MOD_VEX_0F71_REG_2 */
11932 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_2) },
11935 /* MOD_VEX_0F71_REG_4 */
11937 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_4) },
11940 /* MOD_VEX_0F71_REG_6 */
11942 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_6) },
11945 /* MOD_VEX_0F72_REG_2 */
11947 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_2) },
11950 /* MOD_VEX_0F72_REG_4 */
11952 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_4) },
11955 /* MOD_VEX_0F72_REG_6 */
11957 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_6) },
11960 /* MOD_VEX_0F73_REG_2 */
11962 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_2) },
11965 /* MOD_VEX_0F73_REG_3 */
11967 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_3) },
11970 /* MOD_VEX_0F73_REG_6 */
11972 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_6) },
11975 /* MOD_VEX_0F73_REG_7 */
11977 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_7) },
11980 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
11981 { "kmovw", { Ew, MaskG }, 0 },
11985 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
11986 { "kmovq", { Eq, MaskG }, 0 },
11990 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
11991 { "kmovb", { Eb, MaskG }, 0 },
11995 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
11996 { "kmovd", { Ed, MaskG }, 0 },
12000 /* MOD_VEX_W_0_0F92_P_0_LEN_0 */
12002 { "kmovw", { MaskG, Rdq }, 0 },
12005 /* MOD_VEX_W_0_0F92_P_2_LEN_0 */
12007 { "kmovb", { MaskG, Rdq }, 0 },
12010 /* MOD_VEX_W_0_0F92_P_3_LEN_0 */
12012 { "kmovd", { MaskG, Rdq }, 0 },
12015 /* MOD_VEX_W_1_0F92_P_3_LEN_0 */
12017 { "kmovq", { MaskG, Rdq }, 0 },
12020 /* MOD_VEX_W_0_0F93_P_0_LEN_0 */
12022 { "kmovw", { Gdq, MaskR }, 0 },
12025 /* MOD_VEX_W_0_0F93_P_2_LEN_0 */
12027 { "kmovb", { Gdq, MaskR }, 0 },
12030 /* MOD_VEX_W_0_0F93_P_3_LEN_0 */
12032 { "kmovd", { Gdq, MaskR }, 0 },
12035 /* MOD_VEX_W_1_0F93_P_3_LEN_0 */
12037 { "kmovq", { Gdq, MaskR }, 0 },
12040 /* MOD_VEX_W_0_0F98_P_0_LEN_0 */
12042 { "kortestw", { MaskG, MaskR }, 0 },
12045 /* MOD_VEX_W_1_0F98_P_0_LEN_0 */
12047 { "kortestq", { MaskG, MaskR }, 0 },
12050 /* MOD_VEX_W_0_0F98_P_2_LEN_0 */
12052 { "kortestb", { MaskG, MaskR }, 0 },
12055 /* MOD_VEX_W_1_0F98_P_2_LEN_0 */
12057 { "kortestd", { MaskG, MaskR }, 0 },
12060 /* MOD_VEX_W_0_0F99_P_0_LEN_0 */
12062 { "ktestw", { MaskG, MaskR }, 0 },
12065 /* MOD_VEX_W_1_0F99_P_0_LEN_0 */
12067 { "ktestq", { MaskG, MaskR }, 0 },
12070 /* MOD_VEX_W_0_0F99_P_2_LEN_0 */
12072 { "ktestb", { MaskG, MaskR }, 0 },
12075 /* MOD_VEX_W_1_0F99_P_2_LEN_0 */
12077 { "ktestd", { MaskG, MaskR }, 0 },
12080 /* MOD_VEX_0FAE_REG_2 */
12081 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0) },
12084 /* MOD_VEX_0FAE_REG_3 */
12085 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0) },
12088 /* MOD_VEX_0FD7_PREFIX_2 */
12090 { VEX_W_TABLE (VEX_W_0FD7_P_2_M_1) },
12093 /* MOD_VEX_0FE7_PREFIX_2 */
12094 { VEX_W_TABLE (VEX_W_0FE7_P_2_M_0) },
12097 /* MOD_VEX_0FF0_PREFIX_3 */
12098 { VEX_W_TABLE (VEX_W_0FF0_P_3_M_0) },
12101 /* MOD_VEX_0F381A_PREFIX_2 */
12102 { VEX_LEN_TABLE (VEX_LEN_0F381A_P_2_M_0) },
12105 /* MOD_VEX_0F382A_PREFIX_2 */
12106 { VEX_W_TABLE (VEX_W_0F382A_P_2_M_0) },
12109 /* MOD_VEX_0F382C_PREFIX_2 */
12110 { VEX_W_TABLE (VEX_W_0F382C_P_2_M_0) },
12113 /* MOD_VEX_0F382D_PREFIX_2 */
12114 { VEX_W_TABLE (VEX_W_0F382D_P_2_M_0) },
12117 /* MOD_VEX_0F382E_PREFIX_2 */
12118 { VEX_W_TABLE (VEX_W_0F382E_P_2_M_0) },
12121 /* MOD_VEX_0F382F_PREFIX_2 */
12122 { VEX_W_TABLE (VEX_W_0F382F_P_2_M_0) },
12125 /* MOD_VEX_0F385A_PREFIX_2 */
12126 { VEX_LEN_TABLE (VEX_LEN_0F385A_P_2_M_0) },
12129 /* MOD_VEX_0F388C_PREFIX_2 */
12130 { "vpmaskmov%LW", { XM, Vex, Mx }, 0 },
12133 /* MOD_VEX_0F388E_PREFIX_2 */
12134 { "vpmaskmov%LW", { Mx, Vex, XM }, 0 },
12137 /* MOD_VEX_W_0_0F3A30_P_2_LEN_0 */
12139 { "kshiftrb", { MaskG, MaskR, Ib }, 0 },
12142 /* MOD_VEX_W_1_0F3A30_P_2_LEN_0 */
12144 { "kshiftrw", { MaskG, MaskR, Ib }, 0 },
12147 /* MOD_VEX_W_0_0F3A31_P_2_LEN_0 */
12149 { "kshiftrd", { MaskG, MaskR, Ib }, 0 },
12152 /* MOD_VEX_W_1_0F3A31_P_2_LEN_0 */
12154 { "kshiftrq", { MaskG, MaskR, Ib }, 0 },
12157 /* MOD_VEX_W_0_0F3A32_P_2_LEN_0 */
12159 { "kshiftlb", { MaskG, MaskR, Ib }, 0 },
12162 /* MOD_VEX_W_1_0F3A32_P_2_LEN_0 */
12164 { "kshiftlw", { MaskG, MaskR, Ib }, 0 },
12167 /* MOD_VEX_W_0_0F3A33_P_2_LEN_0 */
12169 { "kshiftld", { MaskG, MaskR, Ib }, 0 },
12172 /* MOD_VEX_W_1_0F3A33_P_2_LEN_0 */
12174 { "kshiftlq", { MaskG, MaskR, Ib }, 0 },
12176 #define NEED_MOD_TABLE
12177 #include "i386-dis-evex.h"
12178 #undef NEED_MOD_TABLE
12181 static const struct dis386 rm_table[][8] = {
12184 { "xabort", { Skip_MODRM, Ib }, 0 },
12188 { "xbeginT", { Skip_MODRM, Jv }, 0 },
12191 /* RM_0F01_REG_0 */
12193 { "vmcall", { Skip_MODRM }, 0 },
12194 { "vmlaunch", { Skip_MODRM }, 0 },
12195 { "vmresume", { Skip_MODRM }, 0 },
12196 { "vmxoff", { Skip_MODRM }, 0 },
12199 /* RM_0F01_REG_1 */
12200 { "monitor", { { OP_Monitor, 0 } }, 0 },
12201 { "mwait", { { OP_Mwait, 0 } }, 0 },
12202 { "clac", { Skip_MODRM }, 0 },
12203 { "stac", { Skip_MODRM }, 0 },
12207 { "encls", { Skip_MODRM }, 0 },
12210 /* RM_0F01_REG_2 */
12211 { "xgetbv", { Skip_MODRM }, 0 },
12212 { "xsetbv", { Skip_MODRM }, 0 },
12215 { "vmfunc", { Skip_MODRM }, 0 },
12216 { "xend", { Skip_MODRM }, 0 },
12217 { "xtest", { Skip_MODRM }, 0 },
12218 { "enclu", { Skip_MODRM }, 0 },
12221 /* RM_0F01_REG_3 */
12222 { "vmrun", { Skip_MODRM }, 0 },
12223 { "vmmcall", { Skip_MODRM }, 0 },
12224 { "vmload", { Skip_MODRM }, 0 },
12225 { "vmsave", { Skip_MODRM }, 0 },
12226 { "stgi", { Skip_MODRM }, 0 },
12227 { "clgi", { Skip_MODRM }, 0 },
12228 { "skinit", { Skip_MODRM }, 0 },
12229 { "invlpga", { Skip_MODRM }, 0 },
12232 /* RM_0F01_REG_5 */
12234 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_1) },
12235 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_2) },
12239 { "rdpkru", { Skip_MODRM }, 0 },
12240 { "wrpkru", { Skip_MODRM }, 0 },
12243 /* RM_0F01_REG_7 */
12244 { "swapgs", { Skip_MODRM }, 0 },
12245 { "rdtscp", { Skip_MODRM }, 0 },
12246 { "monitorx", { { OP_Monitor, 0 } }, 0 },
12247 { "mwaitx", { { OP_Mwaitx, 0 } }, 0 },
12248 { "clzero", { Skip_MODRM }, 0 },
12251 /* RM_0F1E_MOD_3_REG_7 */
12252 { "nopQ", { Ev }, 0 },
12253 { "nopQ", { Ev }, 0 },
12254 { "endbr64", { Skip_MODRM }, PREFIX_OPCODE },
12255 { "endbr32", { Skip_MODRM }, PREFIX_OPCODE },
12256 { "nopQ", { Ev }, 0 },
12257 { "nopQ", { Ev }, 0 },
12258 { "nopQ", { Ev }, 0 },
12259 { "nopQ", { Ev }, 0 },
12262 /* RM_0FAE_REG_5 */
12263 { "lfence", { Skip_MODRM }, 0 },
12266 /* RM_0FAE_REG_6 */
12267 { "mfence", { Skip_MODRM }, 0 },
12270 /* RM_0FAE_REG_7 */
12271 { "sfence", { Skip_MODRM }, 0 },
12276 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
12278 /* We use the high bit to indicate different name for the same
12280 #define REP_PREFIX (0xf3 | 0x100)
12281 #define XACQUIRE_PREFIX (0xf2 | 0x200)
12282 #define XRELEASE_PREFIX (0xf3 | 0x400)
12283 #define BND_PREFIX (0xf2 | 0x400)
12288 int newrex, i, length;
12294 last_lock_prefix = -1;
12295 last_repz_prefix = -1;
12296 last_repnz_prefix = -1;
12297 last_data_prefix = -1;
12298 last_addr_prefix = -1;
12299 last_rex_prefix = -1;
12300 last_seg_prefix = -1;
12302 active_seg_prefix = 0;
12303 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
12304 all_prefixes[i] = 0;
12307 /* The maximum instruction length is 15bytes. */
12308 while (length < MAX_CODE_LENGTH - 1)
12310 FETCH_DATA (the_info, codep + 1);
12314 /* REX prefixes family. */
12331 if (address_mode == mode_64bit)
12335 last_rex_prefix = i;
12338 prefixes |= PREFIX_REPZ;
12339 last_repz_prefix = i;
12342 prefixes |= PREFIX_REPNZ;
12343 last_repnz_prefix = i;
12346 prefixes |= PREFIX_LOCK;
12347 last_lock_prefix = i;
12350 prefixes |= PREFIX_CS;
12351 last_seg_prefix = i;
12352 active_seg_prefix = PREFIX_CS;
12355 prefixes |= PREFIX_SS;
12356 last_seg_prefix = i;
12357 active_seg_prefix = PREFIX_SS;
12360 prefixes |= PREFIX_DS;
12361 last_seg_prefix = i;
12362 active_seg_prefix = PREFIX_DS;
12365 prefixes |= PREFIX_ES;
12366 last_seg_prefix = i;
12367 active_seg_prefix = PREFIX_ES;
12370 prefixes |= PREFIX_FS;
12371 last_seg_prefix = i;
12372 active_seg_prefix = PREFIX_FS;
12375 prefixes |= PREFIX_GS;
12376 last_seg_prefix = i;
12377 active_seg_prefix = PREFIX_GS;
12380 prefixes |= PREFIX_DATA;
12381 last_data_prefix = i;
12384 prefixes |= PREFIX_ADDR;
12385 last_addr_prefix = i;
12388 /* fwait is really an instruction. If there are prefixes
12389 before the fwait, they belong to the fwait, *not* to the
12390 following instruction. */
12392 if (prefixes || rex)
12394 prefixes |= PREFIX_FWAIT;
12396 /* This ensures that the previous REX prefixes are noticed
12397 as unused prefixes, as in the return case below. */
12401 prefixes = PREFIX_FWAIT;
12406 /* Rex is ignored when followed by another prefix. */
12412 if (*codep != FWAIT_OPCODE)
12413 all_prefixes[i++] = *codep;
12421 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
12424 static const char *
12425 prefix_name (int pref, int sizeflag)
12427 static const char *rexes [16] =
12430 "rex.B", /* 0x41 */
12431 "rex.X", /* 0x42 */
12432 "rex.XB", /* 0x43 */
12433 "rex.R", /* 0x44 */
12434 "rex.RB", /* 0x45 */
12435 "rex.RX", /* 0x46 */
12436 "rex.RXB", /* 0x47 */
12437 "rex.W", /* 0x48 */
12438 "rex.WB", /* 0x49 */
12439 "rex.WX", /* 0x4a */
12440 "rex.WXB", /* 0x4b */
12441 "rex.WR", /* 0x4c */
12442 "rex.WRB", /* 0x4d */
12443 "rex.WRX", /* 0x4e */
12444 "rex.WRXB", /* 0x4f */
12449 /* REX prefixes family. */
12466 return rexes [pref - 0x40];
12486 return (sizeflag & DFLAG) ? "data16" : "data32";
12488 if (address_mode == mode_64bit)
12489 return (sizeflag & AFLAG) ? "addr32" : "addr64";
12491 return (sizeflag & AFLAG) ? "addr16" : "addr32";
12496 case XACQUIRE_PREFIX:
12498 case XRELEASE_PREFIX:
12507 static char op_out[MAX_OPERANDS][100];
12508 static int op_ad, op_index[MAX_OPERANDS];
12509 static int two_source_ops;
12510 static bfd_vma op_address[MAX_OPERANDS];
12511 static bfd_vma op_riprel[MAX_OPERANDS];
12512 static bfd_vma start_pc;
12515 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
12516 * (see topic "Redundant prefixes" in the "Differences from 8086"
12517 * section of the "Virtual 8086 Mode" chapter.)
12518 * 'pc' should be the address of this instruction, it will
12519 * be used to print the target address if this is a relative jump or call
12520 * The function returns the length of this instruction in bytes.
12523 static char intel_syntax;
12524 static char intel_mnemonic = !SYSV386_COMPAT;
12525 static char open_char;
12526 static char close_char;
12527 static char separator_char;
12528 static char scale_char;
12536 static enum x86_64_isa isa64;
12538 /* Here for backwards compatibility. When gdb stops using
12539 print_insn_i386_att and print_insn_i386_intel these functions can
12540 disappear, and print_insn_i386 be merged into print_insn. */
12542 print_insn_i386_att (bfd_vma pc, disassemble_info *info)
12546 return print_insn (pc, info);
12550 print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
12554 return print_insn (pc, info);
12558 print_insn_i386 (bfd_vma pc, disassemble_info *info)
12562 return print_insn (pc, info);
12566 print_i386_disassembler_options (FILE *stream)
12568 fprintf (stream, _("\n\
12569 The following i386/x86-64 specific disassembler options are supported for use\n\
12570 with the -M switch (multiple options should be separated by commas):\n"));
12572 fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n"));
12573 fprintf (stream, _(" i386 Disassemble in 32bit mode\n"));
12574 fprintf (stream, _(" i8086 Disassemble in 16bit mode\n"));
12575 fprintf (stream, _(" att Display instruction in AT&T syntax\n"));
12576 fprintf (stream, _(" intel Display instruction in Intel syntax\n"));
12577 fprintf (stream, _(" att-mnemonic\n"
12578 " Display instruction in AT&T mnemonic\n"));
12579 fprintf (stream, _(" intel-mnemonic\n"
12580 " Display instruction in Intel mnemonic\n"));
12581 fprintf (stream, _(" addr64 Assume 64bit address size\n"));
12582 fprintf (stream, _(" addr32 Assume 32bit address size\n"));
12583 fprintf (stream, _(" addr16 Assume 16bit address size\n"));
12584 fprintf (stream, _(" data32 Assume 32bit data size\n"));
12585 fprintf (stream, _(" data16 Assume 16bit data size\n"));
12586 fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n"));
12587 fprintf (stream, _(" amd64 Display instruction in AMD64 ISA\n"));
12588 fprintf (stream, _(" intel64 Display instruction in Intel64 ISA\n"));
12592 static const struct dis386 bad_opcode = { "(bad)", { XX }, 0 };
12594 /* Get a pointer to struct dis386 with a valid name. */
12596 static const struct dis386 *
12597 get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
12599 int vindex, vex_table_index;
12601 if (dp->name != NULL)
12604 switch (dp->op[0].bytemode)
12606 case USE_REG_TABLE:
12607 dp = ®_table[dp->op[1].bytemode][modrm.reg];
12610 case USE_MOD_TABLE:
12611 vindex = modrm.mod == 0x3 ? 1 : 0;
12612 dp = &mod_table[dp->op[1].bytemode][vindex];
12616 dp = &rm_table[dp->op[1].bytemode][modrm.rm];
12619 case USE_PREFIX_TABLE:
12622 /* The prefix in VEX is implicit. */
12623 switch (vex.prefix)
12628 case REPE_PREFIX_OPCODE:
12631 case DATA_PREFIX_OPCODE:
12634 case REPNE_PREFIX_OPCODE:
12644 int last_prefix = -1;
12647 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
12648 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
12650 if ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) != 0)
12652 if (last_repz_prefix > last_repnz_prefix)
12655 prefix = PREFIX_REPZ;
12656 last_prefix = last_repz_prefix;
12661 prefix = PREFIX_REPNZ;
12662 last_prefix = last_repnz_prefix;
12665 /* Check if prefix should be ignored. */
12666 if ((((prefix_table[dp->op[1].bytemode][vindex].prefix_requirement
12667 & PREFIX_IGNORED) >> PREFIX_IGNORED_SHIFT)
12672 if (vindex == 0 && (prefixes & PREFIX_DATA) != 0)
12675 prefix = PREFIX_DATA;
12676 last_prefix = last_data_prefix;
12681 used_prefixes |= prefix;
12682 all_prefixes[last_prefix] = 0;
12685 dp = &prefix_table[dp->op[1].bytemode][vindex];
12688 case USE_X86_64_TABLE:
12689 vindex = address_mode == mode_64bit ? 1 : 0;
12690 dp = &x86_64_table[dp->op[1].bytemode][vindex];
12693 case USE_3BYTE_TABLE:
12694 FETCH_DATA (info, codep + 2);
12696 dp = &three_byte_table[dp->op[1].bytemode][vindex];
12698 modrm.mod = (*codep >> 6) & 3;
12699 modrm.reg = (*codep >> 3) & 7;
12700 modrm.rm = *codep & 7;
12703 case USE_VEX_LEN_TABLE:
12707 switch (vex.length)
12720 dp = &vex_len_table[dp->op[1].bytemode][vindex];
12723 case USE_XOP_8F_TABLE:
12724 FETCH_DATA (info, codep + 3);
12725 /* All bits in the REX prefix are ignored. */
12727 rex = ~(*codep >> 5) & 0x7;
12729 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
12730 switch ((*codep & 0x1f))
12736 vex_table_index = XOP_08;
12739 vex_table_index = XOP_09;
12742 vex_table_index = XOP_0A;
12746 vex.w = *codep & 0x80;
12747 if (vex.w && address_mode == mode_64bit)
12750 vex.register_specifier = (~(*codep >> 3)) & 0xf;
12751 if (address_mode != mode_64bit)
12753 /* In 16/32-bit mode REX_B is silently ignored. */
12755 if (vex.register_specifier > 0x7)
12762 vex.length = (*codep & 0x4) ? 256 : 128;
12763 switch ((*codep & 0x3))
12769 vex.prefix = DATA_PREFIX_OPCODE;
12772 vex.prefix = REPE_PREFIX_OPCODE;
12775 vex.prefix = REPNE_PREFIX_OPCODE;
12782 dp = &xop_table[vex_table_index][vindex];
12785 FETCH_DATA (info, codep + 1);
12786 modrm.mod = (*codep >> 6) & 3;
12787 modrm.reg = (*codep >> 3) & 7;
12788 modrm.rm = *codep & 7;
12791 case USE_VEX_C4_TABLE:
12793 FETCH_DATA (info, codep + 3);
12794 /* All bits in the REX prefix are ignored. */
12796 rex = ~(*codep >> 5) & 0x7;
12797 switch ((*codep & 0x1f))
12803 vex_table_index = VEX_0F;
12806 vex_table_index = VEX_0F38;
12809 vex_table_index = VEX_0F3A;
12813 vex.w = *codep & 0x80;
12814 if (address_mode == mode_64bit)
12818 vex.register_specifier = (~(*codep >> 3)) & 0xf;
12822 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
12823 is ignored, other REX bits are 0 and the highest bit in
12824 VEX.vvvv is also ignored. */
12826 vex.register_specifier = (~(*codep >> 3)) & 0x7;
12828 vex.length = (*codep & 0x4) ? 256 : 128;
12829 switch ((*codep & 0x3))
12835 vex.prefix = DATA_PREFIX_OPCODE;
12838 vex.prefix = REPE_PREFIX_OPCODE;
12841 vex.prefix = REPNE_PREFIX_OPCODE;
12848 dp = &vex_table[vex_table_index][vindex];
12850 /* There is no MODRM byte for VEX0F 77. */
12851 if (vex_table_index != VEX_0F || vindex != 0x77)
12853 FETCH_DATA (info, codep + 1);
12854 modrm.mod = (*codep >> 6) & 3;
12855 modrm.reg = (*codep >> 3) & 7;
12856 modrm.rm = *codep & 7;
12860 case USE_VEX_C5_TABLE:
12862 FETCH_DATA (info, codep + 2);
12863 /* All bits in the REX prefix are ignored. */
12865 rex = (*codep & 0x80) ? 0 : REX_R;
12867 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
12869 vex.register_specifier = (~(*codep >> 3)) & 0xf;
12871 vex.length = (*codep & 0x4) ? 256 : 128;
12872 switch ((*codep & 0x3))
12878 vex.prefix = DATA_PREFIX_OPCODE;
12881 vex.prefix = REPE_PREFIX_OPCODE;
12884 vex.prefix = REPNE_PREFIX_OPCODE;
12891 dp = &vex_table[dp->op[1].bytemode][vindex];
12893 /* There is no MODRM byte for VEX 77. */
12894 if (vindex != 0x77)
12896 FETCH_DATA (info, codep + 1);
12897 modrm.mod = (*codep >> 6) & 3;
12898 modrm.reg = (*codep >> 3) & 7;
12899 modrm.rm = *codep & 7;
12903 case USE_VEX_W_TABLE:
12907 dp = &vex_w_table[dp->op[1].bytemode][vex.w ? 1 : 0];
12910 case USE_EVEX_TABLE:
12911 two_source_ops = 0;
12914 FETCH_DATA (info, codep + 4);
12915 /* All bits in the REX prefix are ignored. */
12917 /* The first byte after 0x62. */
12918 rex = ~(*codep >> 5) & 0x7;
12919 vex.r = *codep & 0x10;
12920 switch ((*codep & 0xf))
12923 return &bad_opcode;
12925 vex_table_index = EVEX_0F;
12928 vex_table_index = EVEX_0F38;
12931 vex_table_index = EVEX_0F3A;
12935 /* The second byte after 0x62. */
12937 vex.w = *codep & 0x80;
12938 if (vex.w && address_mode == mode_64bit)
12941 vex.register_specifier = (~(*codep >> 3)) & 0xf;
12942 if (address_mode != mode_64bit)
12944 /* In 16/32-bit mode silently ignore following bits. */
12948 vex.register_specifier &= 0x7;
12952 if (!(*codep & 0x4))
12953 return &bad_opcode;
12955 switch ((*codep & 0x3))
12961 vex.prefix = DATA_PREFIX_OPCODE;
12964 vex.prefix = REPE_PREFIX_OPCODE;
12967 vex.prefix = REPNE_PREFIX_OPCODE;
12971 /* The third byte after 0x62. */
12974 /* Remember the static rounding bits. */
12975 vex.ll = (*codep >> 5) & 3;
12976 vex.b = (*codep & 0x10) != 0;
12978 vex.v = *codep & 0x8;
12979 vex.mask_register_specifier = *codep & 0x7;
12980 vex.zeroing = *codep & 0x80;
12986 dp = &evex_table[vex_table_index][vindex];
12988 FETCH_DATA (info, codep + 1);
12989 modrm.mod = (*codep >> 6) & 3;
12990 modrm.reg = (*codep >> 3) & 7;
12991 modrm.rm = *codep & 7;
12993 /* Set vector length. */
12994 if (modrm.mod == 3 && vex.b)
13010 return &bad_opcode;
13023 if (dp->name != NULL)
13026 return get_valid_dis386 (dp, info);
13030 get_sib (disassemble_info *info, int sizeflag)
13032 /* If modrm.mod == 3, operand must be register. */
13034 && ((sizeflag & AFLAG) || address_mode == mode_64bit)
13038 FETCH_DATA (info, codep + 2);
13039 sib.index = (codep [1] >> 3) & 7;
13040 sib.scale = (codep [1] >> 6) & 3;
13041 sib.base = codep [1] & 7;
13046 print_insn (bfd_vma pc, disassemble_info *info)
13048 const struct dis386 *dp;
13050 char *op_txt[MAX_OPERANDS];
13052 int sizeflag, orig_sizeflag;
13054 struct dis_private priv;
13057 priv.orig_sizeflag = AFLAG | DFLAG;
13058 if ((info->mach & bfd_mach_i386_i386) != 0)
13059 address_mode = mode_32bit;
13060 else if (info->mach == bfd_mach_i386_i8086)
13062 address_mode = mode_16bit;
13063 priv.orig_sizeflag = 0;
13066 address_mode = mode_64bit;
13068 if (intel_syntax == (char) -1)
13069 intel_syntax = (info->mach & bfd_mach_i386_intel_syntax) != 0;
13071 for (p = info->disassembler_options; p != NULL; )
13073 if (CONST_STRNEQ (p, "amd64"))
13075 else if (CONST_STRNEQ (p, "intel64"))
13077 else if (CONST_STRNEQ (p, "x86-64"))
13079 address_mode = mode_64bit;
13080 priv.orig_sizeflag = AFLAG | DFLAG;
13082 else if (CONST_STRNEQ (p, "i386"))
13084 address_mode = mode_32bit;
13085 priv.orig_sizeflag = AFLAG | DFLAG;
13087 else if (CONST_STRNEQ (p, "i8086"))
13089 address_mode = mode_16bit;
13090 priv.orig_sizeflag = 0;
13092 else if (CONST_STRNEQ (p, "intel"))
13095 if (CONST_STRNEQ (p + 5, "-mnemonic"))
13096 intel_mnemonic = 1;
13098 else if (CONST_STRNEQ (p, "att"))
13101 if (CONST_STRNEQ (p + 3, "-mnemonic"))
13102 intel_mnemonic = 0;
13104 else if (CONST_STRNEQ (p, "addr"))
13106 if (address_mode == mode_64bit)
13108 if (p[4] == '3' && p[5] == '2')
13109 priv.orig_sizeflag &= ~AFLAG;
13110 else if (p[4] == '6' && p[5] == '4')
13111 priv.orig_sizeflag |= AFLAG;
13115 if (p[4] == '1' && p[5] == '6')
13116 priv.orig_sizeflag &= ~AFLAG;
13117 else if (p[4] == '3' && p[5] == '2')
13118 priv.orig_sizeflag |= AFLAG;
13121 else if (CONST_STRNEQ (p, "data"))
13123 if (p[4] == '1' && p[5] == '6')
13124 priv.orig_sizeflag &= ~DFLAG;
13125 else if (p[4] == '3' && p[5] == '2')
13126 priv.orig_sizeflag |= DFLAG;
13128 else if (CONST_STRNEQ (p, "suffix"))
13129 priv.orig_sizeflag |= SUFFIX_ALWAYS;
13131 p = strchr (p, ',');
13136 if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
13138 (*info->fprintf_func) (info->stream,
13139 _("64-bit address is disabled"));
13145 names64 = intel_names64;
13146 names32 = intel_names32;
13147 names16 = intel_names16;
13148 names8 = intel_names8;
13149 names8rex = intel_names8rex;
13150 names_seg = intel_names_seg;
13151 names_mm = intel_names_mm;
13152 names_bnd = intel_names_bnd;
13153 names_xmm = intel_names_xmm;
13154 names_ymm = intel_names_ymm;
13155 names_zmm = intel_names_zmm;
13156 index64 = intel_index64;
13157 index32 = intel_index32;
13158 names_mask = intel_names_mask;
13159 index16 = intel_index16;
13162 separator_char = '+';
13167 names64 = att_names64;
13168 names32 = att_names32;
13169 names16 = att_names16;
13170 names8 = att_names8;
13171 names8rex = att_names8rex;
13172 names_seg = att_names_seg;
13173 names_mm = att_names_mm;
13174 names_bnd = att_names_bnd;
13175 names_xmm = att_names_xmm;
13176 names_ymm = att_names_ymm;
13177 names_zmm = att_names_zmm;
13178 index64 = att_index64;
13179 index32 = att_index32;
13180 names_mask = att_names_mask;
13181 index16 = att_index16;
13184 separator_char = ',';
13188 /* The output looks better if we put 7 bytes on a line, since that
13189 puts most long word instructions on a single line. Use 8 bytes
13191 if ((info->mach & bfd_mach_l1om) != 0)
13192 info->bytes_per_line = 8;
13194 info->bytes_per_line = 7;
13196 info->private_data = &priv;
13197 priv.max_fetched = priv.the_buffer;
13198 priv.insn_start = pc;
13201 for (i = 0; i < MAX_OPERANDS; ++i)
13209 start_codep = priv.the_buffer;
13210 codep = priv.the_buffer;
13212 if (OPCODES_SIGSETJMP (priv.bailout) != 0)
13216 /* Getting here means we tried for data but didn't get it. That
13217 means we have an incomplete instruction of some sort. Just
13218 print the first byte as a prefix or a .byte pseudo-op. */
13219 if (codep > priv.the_buffer)
13221 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
13223 (*info->fprintf_func) (info->stream, "%s", name);
13226 /* Just print the first byte as a .byte instruction. */
13227 (*info->fprintf_func) (info->stream, ".byte 0x%x",
13228 (unsigned int) priv.the_buffer[0]);
13238 sizeflag = priv.orig_sizeflag;
13240 if (!ckprefix () || rex_used)
13242 /* Too many prefixes or unused REX prefixes. */
13244 i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i];
13246 (*info->fprintf_func) (info->stream, "%s%s",
13248 prefix_name (all_prefixes[i], sizeflag));
13252 insn_codep = codep;
13254 FETCH_DATA (info, codep + 1);
13255 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
13257 if (((prefixes & PREFIX_FWAIT)
13258 && ((*codep < 0xd8) || (*codep > 0xdf))))
13260 /* Handle prefixes before fwait. */
13261 for (i = 0; i < fwait_prefix && all_prefixes[i];
13263 (*info->fprintf_func) (info->stream, "%s ",
13264 prefix_name (all_prefixes[i], sizeflag));
13265 (*info->fprintf_func) (info->stream, "fwait");
13269 if (*codep == 0x0f)
13271 unsigned char threebyte;
13274 FETCH_DATA (info, codep + 1);
13275 threebyte = *codep;
13276 dp = &dis386_twobyte[threebyte];
13277 need_modrm = twobyte_has_modrm[*codep];
13282 dp = &dis386[*codep];
13283 need_modrm = onebyte_has_modrm[*codep];
13287 /* Save sizeflag for printing the extra prefixes later before updating
13288 it for mnemonic and operand processing. The prefix names depend
13289 only on the address mode. */
13290 orig_sizeflag = sizeflag;
13291 if (prefixes & PREFIX_ADDR)
13293 if ((prefixes & PREFIX_DATA))
13299 FETCH_DATA (info, codep + 1);
13300 modrm.mod = (*codep >> 6) & 3;
13301 modrm.reg = (*codep >> 3) & 7;
13302 modrm.rm = *codep & 7;
13310 if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
13312 get_sib (info, sizeflag);
13313 dofloat (sizeflag);
13317 dp = get_valid_dis386 (dp, info);
13318 if (dp != NULL && putop (dp->name, sizeflag) == 0)
13320 get_sib (info, sizeflag);
13321 for (i = 0; i < MAX_OPERANDS; ++i)
13324 op_ad = MAX_OPERANDS - 1 - i;
13326 (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
13327 /* For EVEX instruction after the last operand masking
13328 should be printed. */
13329 if (i == 0 && vex.evex)
13331 /* Don't print {%k0}. */
13332 if (vex.mask_register_specifier)
13335 oappend (names_mask[vex.mask_register_specifier]);
13345 /* Check if the REX prefix is used. */
13346 if (rex_ignored == 0 && (rex ^ rex_used) == 0 && last_rex_prefix >= 0)
13347 all_prefixes[last_rex_prefix] = 0;
13349 /* Check if the SEG prefix is used. */
13350 if ((prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES
13351 | PREFIX_FS | PREFIX_GS)) != 0
13352 && (used_prefixes & active_seg_prefix) != 0)
13353 all_prefixes[last_seg_prefix] = 0;
13355 /* Check if the ADDR prefix is used. */
13356 if ((prefixes & PREFIX_ADDR) != 0
13357 && (used_prefixes & PREFIX_ADDR) != 0)
13358 all_prefixes[last_addr_prefix] = 0;
13360 /* Check if the DATA prefix is used. */
13361 if ((prefixes & PREFIX_DATA) != 0
13362 && (used_prefixes & PREFIX_DATA) != 0)
13363 all_prefixes[last_data_prefix] = 0;
13365 /* Print the extra prefixes. */
13367 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
13368 if (all_prefixes[i])
13371 name = prefix_name (all_prefixes[i], orig_sizeflag);
13374 prefix_length += strlen (name) + 1;
13375 (*info->fprintf_func) (info->stream, "%s ", name);
13378 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
13379 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
13380 used by putop and MMX/SSE operand and may be overriden by the
13381 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
13383 if (dp->prefix_requirement == PREFIX_OPCODE
13384 && dp != &bad_opcode
13386 & (PREFIX_REPZ | PREFIX_REPNZ)) != 0
13388 & (PREFIX_REPZ | PREFIX_REPNZ)) == 0)
13390 & (PREFIX_REPZ | PREFIX_REPNZ | PREFIX_DATA))
13392 && (used_prefixes & PREFIX_DATA) == 0))))
13394 (*info->fprintf_func) (info->stream, "(bad)");
13395 return end_codep - priv.the_buffer;
13398 /* Check maximum code length. */
13399 if ((codep - start_codep) > MAX_CODE_LENGTH)
13401 (*info->fprintf_func) (info->stream, "(bad)");
13402 return MAX_CODE_LENGTH;
13405 obufp = mnemonicendp;
13406 for (i = strlen (obuf) + prefix_length; i < 6; i++)
13409 (*info->fprintf_func) (info->stream, "%s", obuf);
13411 /* The enter and bound instructions are printed with operands in the same
13412 order as the intel book; everything else is printed in reverse order. */
13413 if (intel_syntax || two_source_ops)
13417 for (i = 0; i < MAX_OPERANDS; ++i)
13418 op_txt[i] = op_out[i];
13420 if (intel_syntax && dp && dp->op[2].rtn == OP_Rounding
13421 && dp->op[3].rtn == OP_E && dp->op[4].rtn == NULL)
13423 op_txt[2] = op_out[3];
13424 op_txt[3] = op_out[2];
13427 for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
13429 op_ad = op_index[i];
13430 op_index[i] = op_index[MAX_OPERANDS - 1 - i];
13431 op_index[MAX_OPERANDS - 1 - i] = op_ad;
13432 riprel = op_riprel[i];
13433 op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
13434 op_riprel[MAX_OPERANDS - 1 - i] = riprel;
13439 for (i = 0; i < MAX_OPERANDS; ++i)
13440 op_txt[MAX_OPERANDS - 1 - i] = op_out[i];
13444 for (i = 0; i < MAX_OPERANDS; ++i)
13448 (*info->fprintf_func) (info->stream, ",");
13449 if (op_index[i] != -1 && !op_riprel[i])
13450 (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info);
13452 (*info->fprintf_func) (info->stream, "%s", op_txt[i]);
13456 for (i = 0; i < MAX_OPERANDS; i++)
13457 if (op_index[i] != -1 && op_riprel[i])
13459 (*info->fprintf_func) (info->stream, " # ");
13460 (*info->print_address_func) ((bfd_vma) (start_pc + (codep - start_codep)
13461 + op_address[op_index[i]]), info);
13464 return codep - priv.the_buffer;
13467 static const char *float_mem[] = {
13542 static const unsigned char float_mem_mode[] = {
13617 #define ST { OP_ST, 0 }
13618 #define STi { OP_STi, 0 }
13620 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
13621 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
13622 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
13623 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
13624 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
13625 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
13626 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
13627 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
13628 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
13630 static const struct dis386 float_reg[][8] = {
13633 { "fadd", { ST, STi }, 0 },
13634 { "fmul", { ST, STi }, 0 },
13635 { "fcom", { STi }, 0 },
13636 { "fcomp", { STi }, 0 },
13637 { "fsub", { ST, STi }, 0 },
13638 { "fsubr", { ST, STi }, 0 },
13639 { "fdiv", { ST, STi }, 0 },
13640 { "fdivr", { ST, STi }, 0 },
13644 { "fld", { STi }, 0 },
13645 { "fxch", { STi }, 0 },
13655 { "fcmovb", { ST, STi }, 0 },
13656 { "fcmove", { ST, STi }, 0 },
13657 { "fcmovbe",{ ST, STi }, 0 },
13658 { "fcmovu", { ST, STi }, 0 },
13666 { "fcmovnb",{ ST, STi }, 0 },
13667 { "fcmovne",{ ST, STi }, 0 },
13668 { "fcmovnbe",{ ST, STi }, 0 },
13669 { "fcmovnu",{ ST, STi }, 0 },
13671 { "fucomi", { ST, STi }, 0 },
13672 { "fcomi", { ST, STi }, 0 },
13677 { "fadd", { STi, ST }, 0 },
13678 { "fmul", { STi, ST }, 0 },
13681 { "fsub!M", { STi, ST }, 0 },
13682 { "fsubM", { STi, ST }, 0 },
13683 { "fdiv!M", { STi, ST }, 0 },
13684 { "fdivM", { STi, ST }, 0 },
13688 { "ffree", { STi }, 0 },
13690 { "fst", { STi }, 0 },
13691 { "fstp", { STi }, 0 },
13692 { "fucom", { STi }, 0 },
13693 { "fucomp", { STi }, 0 },
13699 { "faddp", { STi, ST }, 0 },
13700 { "fmulp", { STi, ST }, 0 },
13703 { "fsub!Mp", { STi, ST }, 0 },
13704 { "fsubMp", { STi, ST }, 0 },
13705 { "fdiv!Mp", { STi, ST }, 0 },
13706 { "fdivMp", { STi, ST }, 0 },
13710 { "ffreep", { STi }, 0 },
13715 { "fucomip", { ST, STi }, 0 },
13716 { "fcomip", { ST, STi }, 0 },
13721 static char *fgrps[][8] = {
13724 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13729 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13734 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
13739 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
13744 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
13749 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
13754 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13759 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
13760 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
13765 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13770 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
13775 swap_operand (void)
13777 mnemonicendp[0] = '.';
13778 mnemonicendp[1] = 's';
13783 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
13784 int sizeflag ATTRIBUTE_UNUSED)
13786 /* Skip mod/rm byte. */
13792 dofloat (int sizeflag)
13794 const struct dis386 *dp;
13795 unsigned char floatop;
13797 floatop = codep[-1];
13799 if (modrm.mod != 3)
13801 int fp_indx = (floatop - 0xd8) * 8 + modrm.reg;
13803 putop (float_mem[fp_indx], sizeflag);
13806 OP_E (float_mem_mode[fp_indx], sizeflag);
13809 /* Skip mod/rm byte. */
13813 dp = &float_reg[floatop - 0xd8][modrm.reg];
13814 if (dp->name == NULL)
13816 putop (fgrps[dp->op[0].bytemode][modrm.rm], sizeflag);
13818 /* Instruction fnstsw is only one with strange arg. */
13819 if (floatop == 0xdf && codep[-1] == 0xe0)
13820 strcpy (op_out[0], names16[0]);
13824 putop (dp->name, sizeflag);
13829 (*dp->op[0].rtn) (dp->op[0].bytemode, sizeflag);
13834 (*dp->op[1].rtn) (dp->op[1].bytemode, sizeflag);
13838 /* Like oappend (below), but S is a string starting with '%'.
13839 In Intel syntax, the '%' is elided. */
13841 oappend_maybe_intel (const char *s)
13843 oappend (s + intel_syntax);
13847 OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
13849 oappend_maybe_intel ("%st");
13853 OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
13855 sprintf (scratchbuf, "%%st(%d)", modrm.rm);
13856 oappend_maybe_intel (scratchbuf);
13859 /* Capital letters in template are macros. */
13861 putop (const char *in_template, int sizeflag)
13866 unsigned int l = 0, len = 1;
13869 #define SAVE_LAST(c) \
13870 if (l < len && l < sizeof (last)) \
13875 for (p = in_template; *p; p++)
13891 while (*++p != '|')
13892 if (*p == '}' || *p == '\0')
13895 /* Fall through. */
13900 while (*++p != '}')
13911 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
13915 if (l == 0 && len == 1)
13920 if (sizeflag & SUFFIX_ALWAYS)
13933 if (address_mode == mode_64bit
13934 && !(prefixes & PREFIX_ADDR))
13945 if (intel_syntax && !alt)
13947 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
13949 if (sizeflag & DFLAG)
13950 *obufp++ = intel_syntax ? 'd' : 'l';
13952 *obufp++ = intel_syntax ? 'w' : 's';
13953 used_prefixes |= (prefixes & PREFIX_DATA);
13957 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
13960 if (modrm.mod == 3)
13966 if (sizeflag & DFLAG)
13967 *obufp++ = intel_syntax ? 'd' : 'l';
13970 used_prefixes |= (prefixes & PREFIX_DATA);
13976 case 'E': /* For jcxz/jecxz */
13977 if (address_mode == mode_64bit)
13979 if (sizeflag & AFLAG)
13985 if (sizeflag & AFLAG)
13987 used_prefixes |= (prefixes & PREFIX_ADDR);
13992 if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))
13994 if (sizeflag & AFLAG)
13995 *obufp++ = address_mode == mode_64bit ? 'q' : 'l';
13997 *obufp++ = address_mode == mode_64bit ? 'l' : 'w';
13998 used_prefixes |= (prefixes & PREFIX_ADDR);
14002 if (intel_syntax || (obufp[-1] != 's' && !(sizeflag & SUFFIX_ALWAYS)))
14004 if ((rex & REX_W) || (sizeflag & DFLAG))
14008 if (!(rex & REX_W))
14009 used_prefixes |= (prefixes & PREFIX_DATA);
14014 if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS
14015 || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)
14017 used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);
14020 if (prefixes & PREFIX_DS)
14039 if (l != 0 || len != 1)
14041 if (l != 1 || len != 2 || last[0] != 'X')
14046 if (!need_vex || !vex.evex)
14049 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
14051 switch (vex.length)
14069 if (address_mode == mode_64bit && (sizeflag & SUFFIX_ALWAYS))
14074 /* Fall through. */
14077 if (l != 0 || len != 1)
14085 if (sizeflag & SUFFIX_ALWAYS)
14089 if (intel_mnemonic != cond)
14093 if ((prefixes & PREFIX_FWAIT) == 0)
14096 used_prefixes |= PREFIX_FWAIT;
14102 else if (intel_syntax && (sizeflag & DFLAG))
14106 if (!(rex & REX_W))
14107 used_prefixes |= (prefixes & PREFIX_DATA);
14111 && address_mode == mode_64bit
14112 && isa64 == intel64)
14117 /* Fall through. */
14120 && address_mode == mode_64bit
14121 && ((sizeflag & DFLAG) || (rex & REX_W)))
14126 /* Fall through. */
14129 if (l == 0 && len == 1)
14134 if ((rex & REX_W) == 0
14135 && (prefixes & PREFIX_DATA))
14137 if ((sizeflag & DFLAG) == 0)
14139 used_prefixes |= (prefixes & PREFIX_DATA);
14143 if ((prefixes & PREFIX_DATA)
14145 || (sizeflag & SUFFIX_ALWAYS))
14152 if (sizeflag & DFLAG)
14156 used_prefixes |= (prefixes & PREFIX_DATA);
14162 if (l != 1 || len != 2 || last[0] != 'L')
14168 if ((prefixes & PREFIX_DATA)
14170 || (sizeflag & SUFFIX_ALWAYS))
14177 if (sizeflag & DFLAG)
14178 *obufp++ = intel_syntax ? 'd' : 'l';
14181 used_prefixes |= (prefixes & PREFIX_DATA);
14189 if (address_mode == mode_64bit
14190 && ((sizeflag & DFLAG) || (rex & REX_W)))
14192 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
14196 /* Fall through. */
14199 if (l == 0 && len == 1)
14202 if (intel_syntax && !alt)
14205 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
14211 if (sizeflag & DFLAG)
14212 *obufp++ = intel_syntax ? 'd' : 'l';
14215 used_prefixes |= (prefixes & PREFIX_DATA);
14221 if (l != 1 || len != 2 || last[0] != 'L')
14227 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
14242 else if (sizeflag & DFLAG)
14251 if (intel_syntax && !p[1]
14252 && ((rex & REX_W) || (sizeflag & DFLAG)))
14254 if (!(rex & REX_W))
14255 used_prefixes |= (prefixes & PREFIX_DATA);
14258 if (l == 0 && len == 1)
14262 if (address_mode == mode_64bit
14263 && ((sizeflag & DFLAG) || (rex & REX_W)))
14265 if (sizeflag & SUFFIX_ALWAYS)
14287 /* Fall through. */
14290 if (l == 0 && len == 1)
14295 if (sizeflag & SUFFIX_ALWAYS)
14301 if (sizeflag & DFLAG)
14305 used_prefixes |= (prefixes & PREFIX_DATA);
14319 if (address_mode == mode_64bit
14320 && !(prefixes & PREFIX_ADDR))
14331 if (l != 0 || len != 1)
14336 if (need_vex && vex.prefix)
14338 if (vex.prefix == DATA_PREFIX_OPCODE)
14345 if (prefixes & PREFIX_DATA)
14349 used_prefixes |= (prefixes & PREFIX_DATA);
14353 if (l == 0 && len == 1)
14355 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
14366 if (l != 1 || len != 2 || last[0] != 'X')
14374 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
14376 switch (vex.length)
14392 if (l == 0 && len == 1)
14394 /* operand size flag for cwtl, cbtw */
14403 else if (sizeflag & DFLAG)
14407 if (!(rex & REX_W))
14408 used_prefixes |= (prefixes & PREFIX_DATA);
14415 && last[0] != 'L'))
14422 if (last[0] == 'X')
14423 *obufp++ = vex.w ? 'd': 's';
14425 *obufp++ = vex.w ? 'q': 'd';
14431 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
14433 if (sizeflag & DFLAG)
14437 used_prefixes |= (prefixes & PREFIX_DATA);
14443 if (address_mode == mode_64bit
14444 && (isa64 == intel64
14445 || ((sizeflag & DFLAG) || (rex & REX_W))))
14447 else if ((prefixes & PREFIX_DATA))
14449 if (!(sizeflag & DFLAG))
14451 used_prefixes |= (prefixes & PREFIX_DATA);
14458 mnemonicendp = obufp;
14463 oappend (const char *s)
14465 obufp = stpcpy (obufp, s);
14471 /* Only print the active segment register. */
14472 if (!active_seg_prefix)
14475 used_prefixes |= active_seg_prefix;
14476 switch (active_seg_prefix)
14479 oappend_maybe_intel ("%cs:");
14482 oappend_maybe_intel ("%ds:");
14485 oappend_maybe_intel ("%ss:");
14488 oappend_maybe_intel ("%es:");
14491 oappend_maybe_intel ("%fs:");
14494 oappend_maybe_intel ("%gs:");
14502 OP_indirE (int bytemode, int sizeflag)
14506 OP_E (bytemode, sizeflag);
14510 print_operand_value (char *buf, int hex, bfd_vma disp)
14512 if (address_mode == mode_64bit)
14520 sprintf_vma (tmp, disp);
14521 for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
14522 strcpy (buf + 2, tmp + i);
14526 bfd_signed_vma v = disp;
14533 /* Check for possible overflow on 0x8000000000000000. */
14536 strcpy (buf, "9223372036854775808");
14550 tmp[28 - i] = (v % 10) + '0';
14554 strcpy (buf, tmp + 29 - i);
14560 sprintf (buf, "0x%x", (unsigned int) disp);
14562 sprintf (buf, "%d", (int) disp);
14566 /* Put DISP in BUF as signed hex number. */
14569 print_displacement (char *buf, bfd_vma disp)
14571 bfd_signed_vma val = disp;
14580 /* Check for possible overflow. */
14583 switch (address_mode)
14586 strcpy (buf + j, "0x8000000000000000");
14589 strcpy (buf + j, "0x80000000");
14592 strcpy (buf + j, "0x8000");
14602 sprintf_vma (tmp, (bfd_vma) val);
14603 for (i = 0; tmp[i] == '0'; i++)
14605 if (tmp[i] == '\0')
14607 strcpy (buf + j, tmp + i);
14611 intel_operand_size (int bytemode, int sizeflag)
14615 && (bytemode == x_mode
14616 || bytemode == evex_half_bcst_xmmq_mode))
14619 oappend ("QWORD PTR ");
14621 oappend ("DWORD PTR ");
14630 oappend ("BYTE PTR ");
14635 oappend ("WORD PTR ");
14638 if (address_mode == mode_64bit && isa64 == intel64)
14640 oappend ("QWORD PTR ");
14643 /* Fall through. */
14645 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
14647 oappend ("QWORD PTR ");
14650 /* Fall through. */
14656 oappend ("QWORD PTR ");
14659 if ((sizeflag & DFLAG) || bytemode == dq_mode)
14660 oappend ("DWORD PTR ");
14662 oappend ("WORD PTR ");
14663 used_prefixes |= (prefixes & PREFIX_DATA);
14667 if ((rex & REX_W) || (sizeflag & DFLAG))
14669 oappend ("WORD PTR ");
14670 if (!(rex & REX_W))
14671 used_prefixes |= (prefixes & PREFIX_DATA);
14674 if (sizeflag & DFLAG)
14675 oappend ("QWORD PTR ");
14677 oappend ("DWORD PTR ");
14678 used_prefixes |= (prefixes & PREFIX_DATA);
14681 case d_scalar_mode:
14682 case d_scalar_swap_mode:
14685 oappend ("DWORD PTR ");
14688 case q_scalar_mode:
14689 case q_scalar_swap_mode:
14691 oappend ("QWORD PTR ");
14694 if (address_mode == mode_64bit)
14695 oappend ("QWORD PTR ");
14697 oappend ("DWORD PTR ");
14700 if (sizeflag & DFLAG)
14701 oappend ("FWORD PTR ");
14703 oappend ("DWORD PTR ");
14704 used_prefixes |= (prefixes & PREFIX_DATA);
14707 oappend ("TBYTE PTR ");
14711 case evex_x_gscat_mode:
14712 case evex_x_nobcst_mode:
14715 switch (vex.length)
14718 oappend ("XMMWORD PTR ");
14721 oappend ("YMMWORD PTR ");
14724 oappend ("ZMMWORD PTR ");
14731 oappend ("XMMWORD PTR ");
14734 oappend ("XMMWORD PTR ");
14737 oappend ("YMMWORD PTR ");
14740 case evex_half_bcst_xmmq_mode:
14744 switch (vex.length)
14747 oappend ("QWORD PTR ");
14750 oappend ("XMMWORD PTR ");
14753 oappend ("YMMWORD PTR ");
14763 switch (vex.length)
14768 oappend ("BYTE PTR ");
14778 switch (vex.length)
14783 oappend ("WORD PTR ");
14793 switch (vex.length)
14798 oappend ("DWORD PTR ");
14808 switch (vex.length)
14813 oappend ("QWORD PTR ");
14823 switch (vex.length)
14826 oappend ("WORD PTR ");
14829 oappend ("DWORD PTR ");
14832 oappend ("QWORD PTR ");
14842 switch (vex.length)
14845 oappend ("DWORD PTR ");
14848 oappend ("QWORD PTR ");
14851 oappend ("XMMWORD PTR ");
14861 switch (vex.length)
14864 oappend ("QWORD PTR ");
14867 oappend ("YMMWORD PTR ");
14870 oappend ("ZMMWORD PTR ");
14880 switch (vex.length)
14884 oappend ("XMMWORD PTR ");
14891 oappend ("OWORD PTR ");
14894 case vex_w_dq_mode:
14895 case vex_scalar_w_dq_mode:
14900 oappend ("QWORD PTR ");
14902 oappend ("DWORD PTR ");
14904 case vex_vsib_d_w_dq_mode:
14905 case vex_vsib_q_w_dq_mode:
14912 oappend ("QWORD PTR ");
14914 oappend ("DWORD PTR ");
14918 switch (vex.length)
14921 oappend ("XMMWORD PTR ");
14924 oappend ("YMMWORD PTR ");
14927 oappend ("ZMMWORD PTR ");
14934 case vex_vsib_q_w_d_mode:
14935 case vex_vsib_d_w_d_mode:
14936 if (!need_vex || !vex.evex)
14939 switch (vex.length)
14942 oappend ("QWORD PTR ");
14945 oappend ("XMMWORD PTR ");
14948 oappend ("YMMWORD PTR ");
14956 if (!need_vex || vex.length != 128)
14959 oappend ("DWORD PTR ");
14961 oappend ("BYTE PTR ");
14967 oappend ("QWORD PTR ");
14969 oappend ("WORD PTR ");
14978 OP_E_register (int bytemode, int sizeflag)
14980 int reg = modrm.rm;
14981 const char **names;
14987 if ((sizeflag & SUFFIX_ALWAYS)
14988 && (bytemode == b_swap_mode
14989 || bytemode == v_swap_mode))
15015 names = address_mode == mode_64bit ? names64 : names32;
15021 if (address_mode == mode_64bit && isa64 == intel64)
15026 /* Fall through. */
15028 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
15034 /* Fall through. */
15046 if ((sizeflag & DFLAG)
15047 || (bytemode != v_mode
15048 && bytemode != v_swap_mode))
15052 used_prefixes |= (prefixes & PREFIX_DATA);
15062 names = names_mask;
15067 oappend (INTERNAL_DISASSEMBLER_ERROR);
15070 oappend (names[reg]);
15074 OP_E_memory (int bytemode, int sizeflag)
15077 int add = (rex & REX_B) ? 8 : 0;
15083 /* In EVEX, if operand doesn't allow broadcast, vex.b should be 0. */
15085 && bytemode != x_mode
15086 && bytemode != xmmq_mode
15087 && bytemode != evex_half_bcst_xmmq_mode)
15102 case vex_vsib_d_w_dq_mode:
15103 case vex_vsib_d_w_d_mode:
15104 case vex_vsib_q_w_dq_mode:
15105 case vex_vsib_q_w_d_mode:
15106 case evex_x_gscat_mode:
15108 shift = vex.w ? 3 : 2;
15111 case evex_half_bcst_xmmq_mode:
15115 shift = vex.w ? 3 : 2;
15118 /* Fall through. */
15122 case evex_x_nobcst_mode:
15124 switch (vex.length)
15147 case q_scalar_mode:
15149 case q_scalar_swap_mode:
15155 case d_scalar_mode:
15157 case d_scalar_swap_mode:
15169 /* Make necessary corrections to shift for modes that need it.
15170 For these modes we currently have shift 4, 5 or 6 depending on
15171 vex.length (it corresponds to xmmword, ymmword or zmmword
15172 operand). We might want to make it 3, 4 or 5 (e.g. for
15173 xmmq_mode). In case of broadcast enabled the corrections
15174 aren't needed, as element size is always 32 or 64 bits. */
15176 && (bytemode == xmmq_mode
15177 || bytemode == evex_half_bcst_xmmq_mode))
15179 else if (bytemode == xmmqd_mode)
15181 else if (bytemode == xmmdw_mode)
15183 else if (bytemode == ymmq_mode && vex.length == 128)
15191 intel_operand_size (bytemode, sizeflag);
15194 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
15196 /* 32/64 bit address mode */
15205 int addr32flag = !((sizeflag & AFLAG)
15206 || bytemode == v_bnd_mode
15207 || bytemode == bnd_mode);
15208 const char **indexes64 = names64;
15209 const char **indexes32 = names32;
15219 vindex = sib.index;
15225 case vex_vsib_d_w_dq_mode:
15226 case vex_vsib_d_w_d_mode:
15227 case vex_vsib_q_w_dq_mode:
15228 case vex_vsib_q_w_d_mode:
15238 switch (vex.length)
15241 indexes64 = indexes32 = names_xmm;
15245 || bytemode == vex_vsib_q_w_dq_mode
15246 || bytemode == vex_vsib_q_w_d_mode)
15247 indexes64 = indexes32 = names_ymm;
15249 indexes64 = indexes32 = names_xmm;
15253 || bytemode == vex_vsib_q_w_dq_mode
15254 || bytemode == vex_vsib_q_w_d_mode)
15255 indexes64 = indexes32 = names_zmm;
15257 indexes64 = indexes32 = names_ymm;
15264 haveindex = vindex != 4;
15271 rbase = base + add;
15279 if (address_mode == mode_64bit && !havesib)
15285 FETCH_DATA (the_info, codep + 1);
15287 if ((disp & 0x80) != 0)
15289 if (vex.evex && shift > 0)
15297 /* In 32bit mode, we need index register to tell [offset] from
15298 [eiz*1 + offset]. */
15299 needindex = (havesib
15302 && address_mode == mode_32bit);
15303 havedisp = (havebase
15305 || (havesib && (haveindex || scale != 0)));
15308 if (modrm.mod != 0 || base == 5)
15310 if (havedisp || riprel)
15311 print_displacement (scratchbuf, disp);
15313 print_operand_value (scratchbuf, 1, disp);
15314 oappend (scratchbuf);
15318 oappend (!addr32flag ? "(%rip)" : "(%eip)");
15322 if ((havebase || haveindex || riprel)
15323 && (bytemode != v_bnd_mode)
15324 && (bytemode != bnd_mode))
15325 used_prefixes |= PREFIX_ADDR;
15327 if (havedisp || (intel_syntax && riprel))
15329 *obufp++ = open_char;
15330 if (intel_syntax && riprel)
15333 oappend (!addr32flag ? "rip" : "eip");
15337 oappend (address_mode == mode_64bit && !addr32flag
15338 ? names64[rbase] : names32[rbase]);
15341 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
15342 print index to tell base + index from base. */
15346 || (havebase && base != ESP_REG_NUM))
15348 if (!intel_syntax || havebase)
15350 *obufp++ = separator_char;
15354 oappend (address_mode == mode_64bit && !addr32flag
15355 ? indexes64[vindex] : indexes32[vindex]);
15357 oappend (address_mode == mode_64bit && !addr32flag
15358 ? index64 : index32);
15360 *obufp++ = scale_char;
15362 sprintf (scratchbuf, "%d", 1 << scale);
15363 oappend (scratchbuf);
15367 && (disp || modrm.mod != 0 || base == 5))
15369 if (!havedisp || (bfd_signed_vma) disp >= 0)
15374 else if (modrm.mod != 1 && disp != -disp)
15378 disp = - (bfd_signed_vma) disp;
15382 print_displacement (scratchbuf, disp);
15384 print_operand_value (scratchbuf, 1, disp);
15385 oappend (scratchbuf);
15388 *obufp++ = close_char;
15391 else if (intel_syntax)
15393 if (modrm.mod != 0 || base == 5)
15395 if (!active_seg_prefix)
15397 oappend (names_seg[ds_reg - es_reg]);
15400 print_operand_value (scratchbuf, 1, disp);
15401 oappend (scratchbuf);
15407 /* 16 bit address mode */
15408 used_prefixes |= prefixes & PREFIX_ADDR;
15415 if ((disp & 0x8000) != 0)
15420 FETCH_DATA (the_info, codep + 1);
15422 if ((disp & 0x80) != 0)
15427 if ((disp & 0x8000) != 0)
15433 if (modrm.mod != 0 || modrm.rm == 6)
15435 print_displacement (scratchbuf, disp);
15436 oappend (scratchbuf);
15439 if (modrm.mod != 0 || modrm.rm != 6)
15441 *obufp++ = open_char;
15443 oappend (index16[modrm.rm]);
15445 && (disp || modrm.mod != 0 || modrm.rm == 6))
15447 if ((bfd_signed_vma) disp >= 0)
15452 else if (modrm.mod != 1)
15456 disp = - (bfd_signed_vma) disp;
15459 print_displacement (scratchbuf, disp);
15460 oappend (scratchbuf);
15463 *obufp++ = close_char;
15466 else if (intel_syntax)
15468 if (!active_seg_prefix)
15470 oappend (names_seg[ds_reg - es_reg]);
15473 print_operand_value (scratchbuf, 1, disp & 0xffff);
15474 oappend (scratchbuf);
15477 if (vex.evex && vex.b
15478 && (bytemode == x_mode
15479 || bytemode == xmmq_mode
15480 || bytemode == evex_half_bcst_xmmq_mode))
15483 || bytemode == xmmq_mode
15484 || bytemode == evex_half_bcst_xmmq_mode)
15486 switch (vex.length)
15489 oappend ("{1to2}");
15492 oappend ("{1to4}");
15495 oappend ("{1to8}");
15503 switch (vex.length)
15506 oappend ("{1to4}");
15509 oappend ("{1to8}");
15512 oappend ("{1to16}");
15522 OP_E (int bytemode, int sizeflag)
15524 /* Skip mod/rm byte. */
15528 if (modrm.mod == 3)
15529 OP_E_register (bytemode, sizeflag);
15531 OP_E_memory (bytemode, sizeflag);
15535 OP_G (int bytemode, int sizeflag)
15546 oappend (names8rex[modrm.reg + add]);
15548 oappend (names8[modrm.reg + add]);
15551 oappend (names16[modrm.reg + add]);
15556 oappend (names32[modrm.reg + add]);
15559 oappend (names64[modrm.reg + add]);
15562 oappend (names_bnd[modrm.reg]);
15571 oappend (names64[modrm.reg + add]);
15574 if ((sizeflag & DFLAG) || bytemode != v_mode)
15575 oappend (names32[modrm.reg + add]);
15577 oappend (names16[modrm.reg + add]);
15578 used_prefixes |= (prefixes & PREFIX_DATA);
15582 if (address_mode == mode_64bit)
15583 oappend (names64[modrm.reg + add]);
15585 oappend (names32[modrm.reg + add]);
15589 if ((modrm.reg + add) > 0x7)
15594 oappend (names_mask[modrm.reg + add]);
15597 oappend (INTERNAL_DISASSEMBLER_ERROR);
15610 FETCH_DATA (the_info, codep + 8);
15611 a = *codep++ & 0xff;
15612 a |= (*codep++ & 0xff) << 8;
15613 a |= (*codep++ & 0xff) << 16;
15614 a |= (*codep++ & 0xffu) << 24;
15615 b = *codep++ & 0xff;
15616 b |= (*codep++ & 0xff) << 8;
15617 b |= (*codep++ & 0xff) << 16;
15618 b |= (*codep++ & 0xffu) << 24;
15619 x = a + ((bfd_vma) b << 32);
15627 static bfd_signed_vma
15630 bfd_signed_vma x = 0;
15632 FETCH_DATA (the_info, codep + 4);
15633 x = *codep++ & (bfd_signed_vma) 0xff;
15634 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
15635 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
15636 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
15640 static bfd_signed_vma
15643 bfd_signed_vma x = 0;
15645 FETCH_DATA (the_info, codep + 4);
15646 x = *codep++ & (bfd_signed_vma) 0xff;
15647 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
15648 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
15649 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
15651 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
15661 FETCH_DATA (the_info, codep + 2);
15662 x = *codep++ & 0xff;
15663 x |= (*codep++ & 0xff) << 8;
15668 set_op (bfd_vma op, int riprel)
15670 op_index[op_ad] = op_ad;
15671 if (address_mode == mode_64bit)
15673 op_address[op_ad] = op;
15674 op_riprel[op_ad] = riprel;
15678 /* Mask to get a 32-bit address. */
15679 op_address[op_ad] = op & 0xffffffff;
15680 op_riprel[op_ad] = riprel & 0xffffffff;
15685 OP_REG (int code, int sizeflag)
15692 case es_reg: case ss_reg: case cs_reg:
15693 case ds_reg: case fs_reg: case gs_reg:
15694 oappend (names_seg[code - es_reg]);
15706 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
15707 case sp_reg: case bp_reg: case si_reg: case di_reg:
15708 s = names16[code - ax_reg + add];
15710 case al_reg: case ah_reg: case cl_reg: case ch_reg:
15711 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
15714 s = names8rex[code - al_reg + add];
15716 s = names8[code - al_reg];
15718 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
15719 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
15720 if (address_mode == mode_64bit
15721 && ((sizeflag & DFLAG) || (rex & REX_W)))
15723 s = names64[code - rAX_reg + add];
15726 code += eAX_reg - rAX_reg;
15727 /* Fall through. */
15728 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
15729 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
15732 s = names64[code - eAX_reg + add];
15735 if (sizeflag & DFLAG)
15736 s = names32[code - eAX_reg + add];
15738 s = names16[code - eAX_reg + add];
15739 used_prefixes |= (prefixes & PREFIX_DATA);
15743 s = INTERNAL_DISASSEMBLER_ERROR;
15750 OP_IMREG (int code, int sizeflag)
15762 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
15763 case sp_reg: case bp_reg: case si_reg: case di_reg:
15764 s = names16[code - ax_reg];
15766 case es_reg: case ss_reg: case cs_reg:
15767 case ds_reg: case fs_reg: case gs_reg:
15768 s = names_seg[code - es_reg];
15770 case al_reg: case ah_reg: case cl_reg: case ch_reg:
15771 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
15774 s = names8rex[code - al_reg];
15776 s = names8[code - al_reg];
15778 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
15779 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
15782 s = names64[code - eAX_reg];
15785 if (sizeflag & DFLAG)
15786 s = names32[code - eAX_reg];
15788 s = names16[code - eAX_reg];
15789 used_prefixes |= (prefixes & PREFIX_DATA);
15792 case z_mode_ax_reg:
15793 if ((rex & REX_W) || (sizeflag & DFLAG))
15797 if (!(rex & REX_W))
15798 used_prefixes |= (prefixes & PREFIX_DATA);
15801 s = INTERNAL_DISASSEMBLER_ERROR;
15808 OP_I (int bytemode, int sizeflag)
15811 bfd_signed_vma mask = -1;
15816 FETCH_DATA (the_info, codep + 1);
15821 if (address_mode == mode_64bit)
15826 /* Fall through. */
15833 if (sizeflag & DFLAG)
15843 used_prefixes |= (prefixes & PREFIX_DATA);
15855 oappend (INTERNAL_DISASSEMBLER_ERROR);
15860 scratchbuf[0] = '$';
15861 print_operand_value (scratchbuf + 1, 1, op);
15862 oappend_maybe_intel (scratchbuf);
15863 scratchbuf[0] = '\0';
15867 OP_I64 (int bytemode, int sizeflag)
15870 bfd_signed_vma mask = -1;
15872 if (address_mode != mode_64bit)
15874 OP_I (bytemode, sizeflag);
15881 FETCH_DATA (the_info, codep + 1);
15891 if (sizeflag & DFLAG)
15901 used_prefixes |= (prefixes & PREFIX_DATA);
15909 oappend (INTERNAL_DISASSEMBLER_ERROR);
15914 scratchbuf[0] = '$';
15915 print_operand_value (scratchbuf + 1, 1, op);
15916 oappend_maybe_intel (scratchbuf);
15917 scratchbuf[0] = '\0';
15921 OP_sI (int bytemode, int sizeflag)
15929 FETCH_DATA (the_info, codep + 1);
15931 if ((op & 0x80) != 0)
15933 if (bytemode == b_T_mode)
15935 if (address_mode != mode_64bit
15936 || !((sizeflag & DFLAG) || (rex & REX_W)))
15938 /* The operand-size prefix is overridden by a REX prefix. */
15939 if ((sizeflag & DFLAG) || (rex & REX_W))
15947 if (!(rex & REX_W))
15949 if (sizeflag & DFLAG)
15957 /* The operand-size prefix is overridden by a REX prefix. */
15958 if ((sizeflag & DFLAG) || (rex & REX_W))
15964 oappend (INTERNAL_DISASSEMBLER_ERROR);
15968 scratchbuf[0] = '$';
15969 print_operand_value (scratchbuf + 1, 1, op);
15970 oappend_maybe_intel (scratchbuf);
15974 OP_J (int bytemode, int sizeflag)
15978 bfd_vma segment = 0;
15983 FETCH_DATA (the_info, codep + 1);
15985 if ((disp & 0x80) != 0)
15989 if (isa64 == amd64)
15991 if ((sizeflag & DFLAG)
15992 || (address_mode == mode_64bit
15993 && (isa64 != amd64 || (rex & REX_W))))
15998 if ((disp & 0x8000) != 0)
16000 /* In 16bit mode, address is wrapped around at 64k within
16001 the same segment. Otherwise, a data16 prefix on a jump
16002 instruction means that the pc is masked to 16 bits after
16003 the displacement is added! */
16005 if ((prefixes & PREFIX_DATA) == 0)
16006 segment = ((start_pc + (codep - start_codep))
16007 & ~((bfd_vma) 0xffff));
16009 if (address_mode != mode_64bit
16010 || (isa64 == amd64 && !(rex & REX_W)))
16011 used_prefixes |= (prefixes & PREFIX_DATA);
16014 oappend (INTERNAL_DISASSEMBLER_ERROR);
16017 disp = ((start_pc + (codep - start_codep) + disp) & mask) | segment;
16019 print_operand_value (scratchbuf, 1, disp);
16020 oappend (scratchbuf);
16024 OP_SEG (int bytemode, int sizeflag)
16026 if (bytemode == w_mode)
16027 oappend (names_seg[modrm.reg]);
16029 OP_E (modrm.mod == 3 ? bytemode : w_mode, sizeflag);
16033 OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
16037 if (sizeflag & DFLAG)
16047 used_prefixes |= (prefixes & PREFIX_DATA);
16049 sprintf (scratchbuf, "0x%x:0x%x", seg, offset);
16051 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
16052 oappend (scratchbuf);
16056 OP_OFF (int bytemode, int sizeflag)
16060 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
16061 intel_operand_size (bytemode, sizeflag);
16064 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
16071 if (!active_seg_prefix)
16073 oappend (names_seg[ds_reg - es_reg]);
16077 print_operand_value (scratchbuf, 1, off);
16078 oappend (scratchbuf);
16082 OP_OFF64 (int bytemode, int sizeflag)
16086 if (address_mode != mode_64bit
16087 || (prefixes & PREFIX_ADDR))
16089 OP_OFF (bytemode, sizeflag);
16093 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
16094 intel_operand_size (bytemode, sizeflag);
16101 if (!active_seg_prefix)
16103 oappend (names_seg[ds_reg - es_reg]);
16107 print_operand_value (scratchbuf, 1, off);
16108 oappend (scratchbuf);
16112 ptr_reg (int code, int sizeflag)
16116 *obufp++ = open_char;
16117 used_prefixes |= (prefixes & PREFIX_ADDR);
16118 if (address_mode == mode_64bit)
16120 if (!(sizeflag & AFLAG))
16121 s = names32[code - eAX_reg];
16123 s = names64[code - eAX_reg];
16125 else if (sizeflag & AFLAG)
16126 s = names32[code - eAX_reg];
16128 s = names16[code - eAX_reg];
16130 *obufp++ = close_char;
16135 OP_ESreg (int code, int sizeflag)
16141 case 0x6d: /* insw/insl */
16142 intel_operand_size (z_mode, sizeflag);
16144 case 0xa5: /* movsw/movsl/movsq */
16145 case 0xa7: /* cmpsw/cmpsl/cmpsq */
16146 case 0xab: /* stosw/stosl */
16147 case 0xaf: /* scasw/scasl */
16148 intel_operand_size (v_mode, sizeflag);
16151 intel_operand_size (b_mode, sizeflag);
16154 oappend_maybe_intel ("%es:");
16155 ptr_reg (code, sizeflag);
16159 OP_DSreg (int code, int sizeflag)
16165 case 0x6f: /* outsw/outsl */
16166 intel_operand_size (z_mode, sizeflag);
16168 case 0xa5: /* movsw/movsl/movsq */
16169 case 0xa7: /* cmpsw/cmpsl/cmpsq */
16170 case 0xad: /* lodsw/lodsl/lodsq */
16171 intel_operand_size (v_mode, sizeflag);
16174 intel_operand_size (b_mode, sizeflag);
16177 /* Set active_seg_prefix to PREFIX_DS if it is unset so that the
16178 default segment register DS is printed. */
16179 if (!active_seg_prefix)
16180 active_seg_prefix = PREFIX_DS;
16182 ptr_reg (code, sizeflag);
16186 OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16194 else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
16196 all_prefixes[last_lock_prefix] = 0;
16197 used_prefixes |= PREFIX_LOCK;
16202 sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
16203 oappend_maybe_intel (scratchbuf);
16207 OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16216 sprintf (scratchbuf, "db%d", modrm.reg + add);
16218 sprintf (scratchbuf, "%%db%d", modrm.reg + add);
16219 oappend (scratchbuf);
16223 OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16225 sprintf (scratchbuf, "%%tr%d", modrm.reg);
16226 oappend_maybe_intel (scratchbuf);
16230 OP_R (int bytemode, int sizeflag)
16232 /* Skip mod/rm byte. */
16235 OP_E_register (bytemode, sizeflag);
16239 OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16241 int reg = modrm.reg;
16242 const char **names;
16244 used_prefixes |= (prefixes & PREFIX_DATA);
16245 if (prefixes & PREFIX_DATA)
16254 oappend (names[reg]);
16258 OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16260 int reg = modrm.reg;
16261 const char **names;
16273 && bytemode != xmm_mode
16274 && bytemode != xmmq_mode
16275 && bytemode != evex_half_bcst_xmmq_mode
16276 && bytemode != ymm_mode
16277 && bytemode != scalar_mode)
16279 switch (vex.length)
16286 || (bytemode != vex_vsib_q_w_dq_mode
16287 && bytemode != vex_vsib_q_w_d_mode))
16299 else if (bytemode == xmmq_mode
16300 || bytemode == evex_half_bcst_xmmq_mode)
16302 switch (vex.length)
16315 else if (bytemode == ymm_mode)
16319 oappend (names[reg]);
16323 OP_EM (int bytemode, int sizeflag)
16326 const char **names;
16328 if (modrm.mod != 3)
16331 && (bytemode == v_mode || bytemode == v_swap_mode))
16333 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
16334 used_prefixes |= (prefixes & PREFIX_DATA);
16336 OP_E (bytemode, sizeflag);
16340 if ((sizeflag & SUFFIX_ALWAYS) && bytemode == v_swap_mode)
16343 /* Skip mod/rm byte. */
16346 used_prefixes |= (prefixes & PREFIX_DATA);
16348 if (prefixes & PREFIX_DATA)
16357 oappend (names[reg]);
16360 /* cvt* are the only instructions in sse2 which have
16361 both SSE and MMX operands and also have 0x66 prefix
16362 in their opcode. 0x66 was originally used to differentiate
16363 between SSE and MMX instruction(operands). So we have to handle the
16364 cvt* separately using OP_EMC and OP_MXC */
16366 OP_EMC (int bytemode, int sizeflag)
16368 if (modrm.mod != 3)
16370 if (intel_syntax && bytemode == v_mode)
16372 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
16373 used_prefixes |= (prefixes & PREFIX_DATA);
16375 OP_E (bytemode, sizeflag);
16379 /* Skip mod/rm byte. */
16382 used_prefixes |= (prefixes & PREFIX_DATA);
16383 oappend (names_mm[modrm.rm]);
16387 OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16389 used_prefixes |= (prefixes & PREFIX_DATA);
16390 oappend (names_mm[modrm.reg]);
16394 OP_EX (int bytemode, int sizeflag)
16397 const char **names;
16399 /* Skip mod/rm byte. */
16403 if (modrm.mod != 3)
16405 OP_E_memory (bytemode, sizeflag);
16420 if ((sizeflag & SUFFIX_ALWAYS)
16421 && (bytemode == x_swap_mode
16422 || bytemode == d_swap_mode
16423 || bytemode == d_scalar_swap_mode
16424 || bytemode == q_swap_mode
16425 || bytemode == q_scalar_swap_mode))
16429 && bytemode != xmm_mode
16430 && bytemode != xmmdw_mode
16431 && bytemode != xmmqd_mode
16432 && bytemode != xmm_mb_mode
16433 && bytemode != xmm_mw_mode
16434 && bytemode != xmm_md_mode
16435 && bytemode != xmm_mq_mode
16436 && bytemode != xmm_mdq_mode
16437 && bytemode != xmmq_mode
16438 && bytemode != evex_half_bcst_xmmq_mode
16439 && bytemode != ymm_mode
16440 && bytemode != d_scalar_mode
16441 && bytemode != d_scalar_swap_mode
16442 && bytemode != q_scalar_mode
16443 && bytemode != q_scalar_swap_mode
16444 && bytemode != vex_scalar_w_dq_mode)
16446 switch (vex.length)
16461 else if (bytemode == xmmq_mode
16462 || bytemode == evex_half_bcst_xmmq_mode)
16464 switch (vex.length)
16477 else if (bytemode == ymm_mode)
16481 oappend (names[reg]);
16485 OP_MS (int bytemode, int sizeflag)
16487 if (modrm.mod == 3)
16488 OP_EM (bytemode, sizeflag);
16494 OP_XS (int bytemode, int sizeflag)
16496 if (modrm.mod == 3)
16497 OP_EX (bytemode, sizeflag);
16503 OP_M (int bytemode, int sizeflag)
16505 if (modrm.mod == 3)
16506 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
16509 OP_E (bytemode, sizeflag);
16513 OP_0f07 (int bytemode, int sizeflag)
16515 if (modrm.mod != 3 || modrm.rm != 0)
16518 OP_E (bytemode, sizeflag);
16521 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
16522 32bit mode and "xchg %rax,%rax" in 64bit mode. */
16525 NOP_Fixup1 (int bytemode, int sizeflag)
16527 if ((prefixes & PREFIX_DATA) != 0
16530 && address_mode == mode_64bit))
16531 OP_REG (bytemode, sizeflag);
16533 strcpy (obuf, "nop");
16537 NOP_Fixup2 (int bytemode, int sizeflag)
16539 if ((prefixes & PREFIX_DATA) != 0
16542 && address_mode == mode_64bit))
16543 OP_IMREG (bytemode, sizeflag);
16546 static const char *const Suffix3DNow[] = {
16547 /* 00 */ NULL, NULL, NULL, NULL,
16548 /* 04 */ NULL, NULL, NULL, NULL,
16549 /* 08 */ NULL, NULL, NULL, NULL,
16550 /* 0C */ "pi2fw", "pi2fd", NULL, NULL,
16551 /* 10 */ NULL, NULL, NULL, NULL,
16552 /* 14 */ NULL, NULL, NULL, NULL,
16553 /* 18 */ NULL, NULL, NULL, NULL,
16554 /* 1C */ "pf2iw", "pf2id", NULL, NULL,
16555 /* 20 */ NULL, NULL, NULL, NULL,
16556 /* 24 */ NULL, NULL, NULL, NULL,
16557 /* 28 */ NULL, NULL, NULL, NULL,
16558 /* 2C */ NULL, NULL, NULL, NULL,
16559 /* 30 */ NULL, NULL, NULL, NULL,
16560 /* 34 */ NULL, NULL, NULL, NULL,
16561 /* 38 */ NULL, NULL, NULL, NULL,
16562 /* 3C */ NULL, NULL, NULL, NULL,
16563 /* 40 */ NULL, NULL, NULL, NULL,
16564 /* 44 */ NULL, NULL, NULL, NULL,
16565 /* 48 */ NULL, NULL, NULL, NULL,
16566 /* 4C */ NULL, NULL, NULL, NULL,
16567 /* 50 */ NULL, NULL, NULL, NULL,
16568 /* 54 */ NULL, NULL, NULL, NULL,
16569 /* 58 */ NULL, NULL, NULL, NULL,
16570 /* 5C */ NULL, NULL, NULL, NULL,
16571 /* 60 */ NULL, NULL, NULL, NULL,
16572 /* 64 */ NULL, NULL, NULL, NULL,
16573 /* 68 */ NULL, NULL, NULL, NULL,
16574 /* 6C */ NULL, NULL, NULL, NULL,
16575 /* 70 */ NULL, NULL, NULL, NULL,
16576 /* 74 */ NULL, NULL, NULL, NULL,
16577 /* 78 */ NULL, NULL, NULL, NULL,
16578 /* 7C */ NULL, NULL, NULL, NULL,
16579 /* 80 */ NULL, NULL, NULL, NULL,
16580 /* 84 */ NULL, NULL, NULL, NULL,
16581 /* 88 */ NULL, NULL, "pfnacc", NULL,
16582 /* 8C */ NULL, NULL, "pfpnacc", NULL,
16583 /* 90 */ "pfcmpge", NULL, NULL, NULL,
16584 /* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",
16585 /* 98 */ NULL, NULL, "pfsub", NULL,
16586 /* 9C */ NULL, NULL, "pfadd", NULL,
16587 /* A0 */ "pfcmpgt", NULL, NULL, NULL,
16588 /* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",
16589 /* A8 */ NULL, NULL, "pfsubr", NULL,
16590 /* AC */ NULL, NULL, "pfacc", NULL,
16591 /* B0 */ "pfcmpeq", NULL, NULL, NULL,
16592 /* B4 */ "pfmul", NULL, "pfrcpit2", "pmulhrw",
16593 /* B8 */ NULL, NULL, NULL, "pswapd",
16594 /* BC */ NULL, NULL, NULL, "pavgusb",
16595 /* C0 */ NULL, NULL, NULL, NULL,
16596 /* C4 */ NULL, NULL, NULL, NULL,
16597 /* C8 */ NULL, NULL, NULL, NULL,
16598 /* CC */ NULL, NULL, NULL, NULL,
16599 /* D0 */ NULL, NULL, NULL, NULL,
16600 /* D4 */ NULL, NULL, NULL, NULL,
16601 /* D8 */ NULL, NULL, NULL, NULL,
16602 /* DC */ NULL, NULL, NULL, NULL,
16603 /* E0 */ NULL, NULL, NULL, NULL,
16604 /* E4 */ NULL, NULL, NULL, NULL,
16605 /* E8 */ NULL, NULL, NULL, NULL,
16606 /* EC */ NULL, NULL, NULL, NULL,
16607 /* F0 */ NULL, NULL, NULL, NULL,
16608 /* F4 */ NULL, NULL, NULL, NULL,
16609 /* F8 */ NULL, NULL, NULL, NULL,
16610 /* FC */ NULL, NULL, NULL, NULL,
16614 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16616 const char *mnemonic;
16618 FETCH_DATA (the_info, codep + 1);
16619 /* AMD 3DNow! instructions are specified by an opcode suffix in the
16620 place where an 8-bit immediate would normally go. ie. the last
16621 byte of the instruction. */
16622 obufp = mnemonicendp;
16623 mnemonic = Suffix3DNow[*codep++ & 0xff];
16625 oappend (mnemonic);
16628 /* Since a variable sized modrm/sib chunk is between the start
16629 of the opcode (0x0f0f) and the opcode suffix, we need to do
16630 all the modrm processing first, and don't know until now that
16631 we have a bad opcode. This necessitates some cleaning up. */
16632 op_out[0][0] = '\0';
16633 op_out[1][0] = '\0';
16636 mnemonicendp = obufp;
16639 static struct op simd_cmp_op[] =
16641 { STRING_COMMA_LEN ("eq") },
16642 { STRING_COMMA_LEN ("lt") },
16643 { STRING_COMMA_LEN ("le") },
16644 { STRING_COMMA_LEN ("unord") },
16645 { STRING_COMMA_LEN ("neq") },
16646 { STRING_COMMA_LEN ("nlt") },
16647 { STRING_COMMA_LEN ("nle") },
16648 { STRING_COMMA_LEN ("ord") }
16652 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16654 unsigned int cmp_type;
16656 FETCH_DATA (the_info, codep + 1);
16657 cmp_type = *codep++ & 0xff;
16658 if (cmp_type < ARRAY_SIZE (simd_cmp_op))
16661 char *p = mnemonicendp - 2;
16665 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
16666 mnemonicendp += simd_cmp_op[cmp_type].len;
16670 /* We have a reserved extension byte. Output it directly. */
16671 scratchbuf[0] = '$';
16672 print_operand_value (scratchbuf + 1, 1, cmp_type);
16673 oappend_maybe_intel (scratchbuf);
16674 scratchbuf[0] = '\0';
16679 OP_Mwaitx (int bytemode ATTRIBUTE_UNUSED,
16680 int sizeflag ATTRIBUTE_UNUSED)
16682 /* mwaitx %eax,%ecx,%ebx */
16685 const char **names = (address_mode == mode_64bit
16686 ? names64 : names32);
16687 strcpy (op_out[0], names[0]);
16688 strcpy (op_out[1], names[1]);
16689 strcpy (op_out[2], names[3]);
16690 two_source_ops = 1;
16692 /* Skip mod/rm byte. */
16698 OP_Mwait (int bytemode ATTRIBUTE_UNUSED,
16699 int sizeflag ATTRIBUTE_UNUSED)
16701 /* mwait %eax,%ecx */
16704 const char **names = (address_mode == mode_64bit
16705 ? names64 : names32);
16706 strcpy (op_out[0], names[0]);
16707 strcpy (op_out[1], names[1]);
16708 two_source_ops = 1;
16710 /* Skip mod/rm byte. */
16716 OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
16717 int sizeflag ATTRIBUTE_UNUSED)
16719 /* monitor %eax,%ecx,%edx" */
16722 const char **op1_names;
16723 const char **names = (address_mode == mode_64bit
16724 ? names64 : names32);
16726 if (!(prefixes & PREFIX_ADDR))
16727 op1_names = (address_mode == mode_16bit
16728 ? names16 : names);
16731 /* Remove "addr16/addr32". */
16732 all_prefixes[last_addr_prefix] = 0;
16733 op1_names = (address_mode != mode_32bit
16734 ? names32 : names16);
16735 used_prefixes |= PREFIX_ADDR;
16737 strcpy (op_out[0], op1_names[0]);
16738 strcpy (op_out[1], names[1]);
16739 strcpy (op_out[2], names[2]);
16740 two_source_ops = 1;
16742 /* Skip mod/rm byte. */
16750 /* Throw away prefixes and 1st. opcode byte. */
16751 codep = insn_codep + 1;
16756 REP_Fixup (int bytemode, int sizeflag)
16758 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
16760 if (prefixes & PREFIX_REPZ)
16761 all_prefixes[last_repz_prefix] = REP_PREFIX;
16768 OP_IMREG (bytemode, sizeflag);
16771 OP_ESreg (bytemode, sizeflag);
16774 OP_DSreg (bytemode, sizeflag);
16782 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
16786 BND_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16788 if (prefixes & PREFIX_REPNZ)
16789 all_prefixes[last_repnz_prefix] = BND_PREFIX;
16792 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
16793 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
16797 HLE_Fixup1 (int bytemode, int sizeflag)
16800 && (prefixes & PREFIX_LOCK) != 0)
16802 if (prefixes & PREFIX_REPZ)
16803 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
16804 if (prefixes & PREFIX_REPNZ)
16805 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
16808 OP_E (bytemode, sizeflag);
16811 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
16812 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
16816 HLE_Fixup2 (int bytemode, int sizeflag)
16818 if (modrm.mod != 3)
16820 if (prefixes & PREFIX_REPZ)
16821 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
16822 if (prefixes & PREFIX_REPNZ)
16823 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
16826 OP_E (bytemode, sizeflag);
16829 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
16830 "xrelease" for memory operand. No check for LOCK prefix. */
16833 HLE_Fixup3 (int bytemode, int sizeflag)
16836 && last_repz_prefix > last_repnz_prefix
16837 && (prefixes & PREFIX_REPZ) != 0)
16838 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
16840 OP_E (bytemode, sizeflag);
16844 CMPXCHG8B_Fixup (int bytemode, int sizeflag)
16849 /* Change cmpxchg8b to cmpxchg16b. */
16850 char *p = mnemonicendp - 2;
16851 mnemonicendp = stpcpy (p, "16b");
16854 else if ((prefixes & PREFIX_LOCK) != 0)
16856 if (prefixes & PREFIX_REPZ)
16857 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
16858 if (prefixes & PREFIX_REPNZ)
16859 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
16862 OP_M (bytemode, sizeflag);
16866 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
16868 const char **names;
16872 switch (vex.length)
16886 oappend (names[reg]);
16890 CRC32_Fixup (int bytemode, int sizeflag)
16892 /* Add proper suffix to "crc32". */
16893 char *p = mnemonicendp;
16912 if (sizeflag & DFLAG)
16916 used_prefixes |= (prefixes & PREFIX_DATA);
16920 oappend (INTERNAL_DISASSEMBLER_ERROR);
16927 if (modrm.mod == 3)
16931 /* Skip mod/rm byte. */
16936 add = (rex & REX_B) ? 8 : 0;
16937 if (bytemode == b_mode)
16941 oappend (names8rex[modrm.rm + add]);
16943 oappend (names8[modrm.rm + add]);
16949 oappend (names64[modrm.rm + add]);
16950 else if ((prefixes & PREFIX_DATA))
16951 oappend (names16[modrm.rm + add]);
16953 oappend (names32[modrm.rm + add]);
16957 OP_E (bytemode, sizeflag);
16961 FXSAVE_Fixup (int bytemode, int sizeflag)
16963 /* Add proper suffix to "fxsave" and "fxrstor". */
16967 char *p = mnemonicendp;
16973 OP_M (bytemode, sizeflag);
16977 PCMPESTR_Fixup (int bytemode, int sizeflag)
16979 /* Add proper suffix to "{,v}pcmpestr{i,m}". */
16982 char *p = mnemonicendp;
16987 else if (sizeflag & SUFFIX_ALWAYS)
16994 OP_EX (bytemode, sizeflag);
16997 /* Display the destination register operand for instructions with
17001 OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
17004 const char **names;
17012 reg = vex.register_specifier;
17019 if (bytemode == vex_scalar_mode)
17021 oappend (names_xmm[reg]);
17025 switch (vex.length)
17032 case vex_vsib_q_w_dq_mode:
17033 case vex_vsib_q_w_d_mode:
17049 names = names_mask;
17063 case vex_vsib_q_w_dq_mode:
17064 case vex_vsib_q_w_d_mode:
17065 names = vex.w ? names_ymm : names_xmm;
17074 names = names_mask;
17077 /* See PR binutils/20893 for a reproducer. */
17089 oappend (names[reg]);
17092 /* Get the VEX immediate byte without moving codep. */
17094 static unsigned char
17095 get_vex_imm8 (int sizeflag, int opnum)
17097 int bytes_before_imm = 0;
17099 if (modrm.mod != 3)
17101 /* There are SIB/displacement bytes. */
17102 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
17104 /* 32/64 bit address mode */
17105 int base = modrm.rm;
17107 /* Check SIB byte. */
17110 FETCH_DATA (the_info, codep + 1);
17112 /* When decoding the third source, don't increase
17113 bytes_before_imm as this has already been incremented
17114 by one in OP_E_memory while decoding the second
17117 bytes_before_imm++;
17120 /* Don't increase bytes_before_imm when decoding the third source,
17121 it has already been incremented by OP_E_memory while decoding
17122 the second source operand. */
17128 /* When modrm.rm == 5 or modrm.rm == 4 and base in
17129 SIB == 5, there is a 4 byte displacement. */
17131 /* No displacement. */
17133 /* Fall through. */
17135 /* 4 byte displacement. */
17136 bytes_before_imm += 4;
17139 /* 1 byte displacement. */
17140 bytes_before_imm++;
17147 /* 16 bit address mode */
17148 /* Don't increase bytes_before_imm when decoding the third source,
17149 it has already been incremented by OP_E_memory while decoding
17150 the second source operand. */
17156 /* When modrm.rm == 6, there is a 2 byte displacement. */
17158 /* No displacement. */
17160 /* Fall through. */
17162 /* 2 byte displacement. */
17163 bytes_before_imm += 2;
17166 /* 1 byte displacement: when decoding the third source,
17167 don't increase bytes_before_imm as this has already
17168 been incremented by one in OP_E_memory while decoding
17169 the second source operand. */
17171 bytes_before_imm++;
17179 FETCH_DATA (the_info, codep + bytes_before_imm + 1);
17180 return codep [bytes_before_imm];
17184 OP_EX_VexReg (int bytemode, int sizeflag, int reg)
17186 const char **names;
17188 if (reg == -1 && modrm.mod != 3)
17190 OP_E_memory (bytemode, sizeflag);
17202 else if (reg > 7 && address_mode != mode_64bit)
17206 switch (vex.length)
17217 oappend (names[reg]);
17221 OP_EX_VexImmW (int bytemode, int sizeflag)
17224 static unsigned char vex_imm8;
17226 if (vex_w_done == 0)
17230 /* Skip mod/rm byte. */
17234 vex_imm8 = get_vex_imm8 (sizeflag, 0);
17237 reg = vex_imm8 >> 4;
17239 OP_EX_VexReg (bytemode, sizeflag, reg);
17241 else if (vex_w_done == 1)
17246 reg = vex_imm8 >> 4;
17248 OP_EX_VexReg (bytemode, sizeflag, reg);
17252 /* Output the imm8 directly. */
17253 scratchbuf[0] = '$';
17254 print_operand_value (scratchbuf + 1, 1, vex_imm8 & 0xf);
17255 oappend_maybe_intel (scratchbuf);
17256 scratchbuf[0] = '\0';
17262 OP_Vex_2src (int bytemode, int sizeflag)
17264 if (modrm.mod == 3)
17266 int reg = modrm.rm;
17270 oappend (names_xmm[reg]);
17275 && (bytemode == v_mode || bytemode == v_swap_mode))
17277 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
17278 used_prefixes |= (prefixes & PREFIX_DATA);
17280 OP_E (bytemode, sizeflag);
17285 OP_Vex_2src_1 (int bytemode, int sizeflag)
17287 if (modrm.mod == 3)
17289 /* Skip mod/rm byte. */
17295 oappend (names_xmm[vex.register_specifier]);
17297 OP_Vex_2src (bytemode, sizeflag);
17301 OP_Vex_2src_2 (int bytemode, int sizeflag)
17304 OP_Vex_2src (bytemode, sizeflag);
17306 oappend (names_xmm[vex.register_specifier]);
17310 OP_EX_VexW (int bytemode, int sizeflag)
17318 /* Skip mod/rm byte. */
17323 reg = get_vex_imm8 (sizeflag, 0) >> 4;
17328 reg = get_vex_imm8 (sizeflag, 1) >> 4;
17331 OP_EX_VexReg (bytemode, sizeflag, reg);
17335 VEXI4_Fixup (int bytemode ATTRIBUTE_UNUSED,
17336 int sizeflag ATTRIBUTE_UNUSED)
17338 /* Skip the immediate byte and check for invalid bits. */
17339 FETCH_DATA (the_info, codep + 1);
17340 if (*codep++ & 0xf)
17345 OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
17348 const char **names;
17350 FETCH_DATA (the_info, codep + 1);
17353 if (bytemode != x_mode)
17360 if (reg > 7 && address_mode != mode_64bit)
17363 switch (vex.length)
17374 oappend (names[reg]);
17378 OP_XMM_VexW (int bytemode, int sizeflag)
17380 /* Turn off the REX.W bit since it is used for swapping operands
17383 OP_XMM (bytemode, sizeflag);
17387 OP_EX_Vex (int bytemode, int sizeflag)
17389 if (modrm.mod != 3)
17391 if (vex.register_specifier != 0)
17395 OP_EX (bytemode, sizeflag);
17399 OP_XMM_Vex (int bytemode, int sizeflag)
17401 if (modrm.mod != 3)
17403 if (vex.register_specifier != 0)
17407 OP_XMM (bytemode, sizeflag);
17411 VZERO_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
17413 switch (vex.length)
17416 mnemonicendp = stpcpy (obuf, "vzeroupper");
17419 mnemonicendp = stpcpy (obuf, "vzeroall");
17426 static struct op vex_cmp_op[] =
17428 { STRING_COMMA_LEN ("eq") },
17429 { STRING_COMMA_LEN ("lt") },
17430 { STRING_COMMA_LEN ("le") },
17431 { STRING_COMMA_LEN ("unord") },
17432 { STRING_COMMA_LEN ("neq") },
17433 { STRING_COMMA_LEN ("nlt") },
17434 { STRING_COMMA_LEN ("nle") },
17435 { STRING_COMMA_LEN ("ord") },
17436 { STRING_COMMA_LEN ("eq_uq") },
17437 { STRING_COMMA_LEN ("nge") },
17438 { STRING_COMMA_LEN ("ngt") },
17439 { STRING_COMMA_LEN ("false") },
17440 { STRING_COMMA_LEN ("neq_oq") },
17441 { STRING_COMMA_LEN ("ge") },
17442 { STRING_COMMA_LEN ("gt") },
17443 { STRING_COMMA_LEN ("true") },
17444 { STRING_COMMA_LEN ("eq_os") },
17445 { STRING_COMMA_LEN ("lt_oq") },
17446 { STRING_COMMA_LEN ("le_oq") },
17447 { STRING_COMMA_LEN ("unord_s") },
17448 { STRING_COMMA_LEN ("neq_us") },
17449 { STRING_COMMA_LEN ("nlt_uq") },
17450 { STRING_COMMA_LEN ("nle_uq") },
17451 { STRING_COMMA_LEN ("ord_s") },
17452 { STRING_COMMA_LEN ("eq_us") },
17453 { STRING_COMMA_LEN ("nge_uq") },
17454 { STRING_COMMA_LEN ("ngt_uq") },
17455 { STRING_COMMA_LEN ("false_os") },
17456 { STRING_COMMA_LEN ("neq_os") },
17457 { STRING_COMMA_LEN ("ge_oq") },
17458 { STRING_COMMA_LEN ("gt_oq") },
17459 { STRING_COMMA_LEN ("true_us") },
17463 VCMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
17465 unsigned int cmp_type;
17467 FETCH_DATA (the_info, codep + 1);
17468 cmp_type = *codep++ & 0xff;
17469 if (cmp_type < ARRAY_SIZE (vex_cmp_op))
17472 char *p = mnemonicendp - 2;
17476 sprintf (p, "%s%s", vex_cmp_op[cmp_type].name, suffix);
17477 mnemonicendp += vex_cmp_op[cmp_type].len;
17481 /* We have a reserved extension byte. Output it directly. */
17482 scratchbuf[0] = '$';
17483 print_operand_value (scratchbuf + 1, 1, cmp_type);
17484 oappend_maybe_intel (scratchbuf);
17485 scratchbuf[0] = '\0';
17490 VPCMP_Fixup (int bytemode ATTRIBUTE_UNUSED,
17491 int sizeflag ATTRIBUTE_UNUSED)
17493 unsigned int cmp_type;
17498 FETCH_DATA (the_info, codep + 1);
17499 cmp_type = *codep++ & 0xff;
17500 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
17501 If it's the case, print suffix, otherwise - print the immediate. */
17502 if (cmp_type < ARRAY_SIZE (simd_cmp_op)
17507 char *p = mnemonicendp - 2;
17509 /* vpcmp* can have both one- and two-lettered suffix. */
17523 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
17524 mnemonicendp += simd_cmp_op[cmp_type].len;
17528 /* We have a reserved extension byte. Output it directly. */
17529 scratchbuf[0] = '$';
17530 print_operand_value (scratchbuf + 1, 1, cmp_type);
17531 oappend_maybe_intel (scratchbuf);
17532 scratchbuf[0] = '\0';
17536 static const struct op pclmul_op[] =
17538 { STRING_COMMA_LEN ("lql") },
17539 { STRING_COMMA_LEN ("hql") },
17540 { STRING_COMMA_LEN ("lqh") },
17541 { STRING_COMMA_LEN ("hqh") }
17545 PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
17546 int sizeflag ATTRIBUTE_UNUSED)
17548 unsigned int pclmul_type;
17550 FETCH_DATA (the_info, codep + 1);
17551 pclmul_type = *codep++ & 0xff;
17552 switch (pclmul_type)
17563 if (pclmul_type < ARRAY_SIZE (pclmul_op))
17566 char *p = mnemonicendp - 3;
17571 sprintf (p, "%s%s", pclmul_op[pclmul_type].name, suffix);
17572 mnemonicendp += pclmul_op[pclmul_type].len;
17576 /* We have a reserved extension byte. Output it directly. */
17577 scratchbuf[0] = '$';
17578 print_operand_value (scratchbuf + 1, 1, pclmul_type);
17579 oappend_maybe_intel (scratchbuf);
17580 scratchbuf[0] = '\0';
17585 MOVBE_Fixup (int bytemode, int sizeflag)
17587 /* Add proper suffix to "movbe". */
17588 char *p = mnemonicendp;
17597 if (sizeflag & SUFFIX_ALWAYS)
17603 if (sizeflag & DFLAG)
17607 used_prefixes |= (prefixes & PREFIX_DATA);
17612 oappend (INTERNAL_DISASSEMBLER_ERROR);
17619 OP_M (bytemode, sizeflag);
17623 OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
17626 const char **names;
17628 /* Skip mod/rm byte. */
17642 oappend (names[reg]);
17646 OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
17648 const char **names;
17655 oappend (names[vex.register_specifier]);
17659 OP_Mask (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
17662 || (bytemode != mask_mode && bytemode != mask_bd_mode))
17666 if ((rex & REX_R) != 0 || !vex.r)
17672 oappend (names_mask [modrm.reg]);
17676 OP_Rounding (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
17679 || (bytemode != evex_rounding_mode
17680 && bytemode != evex_sae_mode))
17682 if (modrm.mod == 3 && vex.b)
17685 case evex_rounding_mode:
17686 oappend (names_rounding[vex.ll]);
17688 case evex_sae_mode: