1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright (C) 1988-2019 Free Software Foundation, Inc.
4 This file is part of the GNU opcodes library.
6 This library is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 It is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
22 /* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
24 modified by John Hassey (hassey@dg-rtp.dg.com)
25 x86-64 support added by Jan Hubicka (jh@suse.cz)
26 VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */
28 /* The main tables describing the instructions is essentially a copy
29 of the "Opcode Map" chapter (Appendix A) of the Intel 80386
30 Programmers Manual. Usually, there is a capital letter, followed
31 by a small letter. The capital letter tell the addressing mode,
32 and the small letter tells about the operand size. Refer to
33 the Intel manual for details. */
36 #include "disassemble.h"
38 #include "opcode/i386.h"
39 #include "libiberty.h"
43 static int print_insn (bfd_vma, disassemble_info *);
44 static void dofloat (int);
45 static void OP_ST (int, int);
46 static void OP_STi (int, int);
47 static int putop (const char *, int);
48 static void oappend (const char *);
49 static void append_seg (void);
50 static void OP_indirE (int, int);
51 static void print_operand_value (char *, int, bfd_vma);
52 static void OP_E_register (int, int);
53 static void OP_E_memory (int, int);
54 static void print_displacement (char *, bfd_vma);
55 static void OP_E (int, int);
56 static void OP_G (int, int);
57 static bfd_vma get64 (void);
58 static bfd_signed_vma get32 (void);
59 static bfd_signed_vma get32s (void);
60 static int get16 (void);
61 static void set_op (bfd_vma, int);
62 static void OP_Skip_MODRM (int, int);
63 static void OP_REG (int, int);
64 static void OP_IMREG (int, int);
65 static void OP_I (int, int);
66 static void OP_I64 (int, int);
67 static void OP_sI (int, int);
68 static void OP_J (int, int);
69 static void OP_SEG (int, int);
70 static void OP_DIR (int, int);
71 static void OP_OFF (int, int);
72 static void OP_OFF64 (int, int);
73 static void ptr_reg (int, int);
74 static void OP_ESreg (int, int);
75 static void OP_DSreg (int, int);
76 static void OP_C (int, int);
77 static void OP_D (int, int);
78 static void OP_T (int, int);
79 static void OP_R (int, int);
80 static void OP_MMX (int, int);
81 static void OP_XMM (int, int);
82 static void OP_EM (int, int);
83 static void OP_EX (int, int);
84 static void OP_EMC (int,int);
85 static void OP_MXC (int,int);
86 static void OP_MS (int, int);
87 static void OP_XS (int, int);
88 static void OP_M (int, int);
89 static void OP_VEX (int, int);
90 static void OP_EX_Vex (int, int);
91 static void OP_EX_VexW (int, int);
92 static void OP_EX_VexImmW (int, int);
93 static void OP_XMM_Vex (int, int);
94 static void OP_XMM_VexW (int, int);
95 static void OP_Rounding (int, int);
96 static void OP_REG_VexI4 (int, int);
97 static void PCLMUL_Fixup (int, int);
98 static void VCMP_Fixup (int, int);
99 static void VPCMP_Fixup (int, int);
100 static void VPCOM_Fixup (int, int);
101 static void OP_0f07 (int, int);
102 static void OP_Monitor (int, int);
103 static void OP_Mwait (int, int);
104 static void OP_Mwaitx (int, int);
105 static void NOP_Fixup1 (int, int);
106 static void NOP_Fixup2 (int, int);
107 static void OP_3DNowSuffix (int, int);
108 static void CMP_Fixup (int, int);
109 static void BadOp (void);
110 static void REP_Fixup (int, int);
111 static void BND_Fixup (int, int);
112 static void NOTRACK_Fixup (int, int);
113 static void HLE_Fixup1 (int, int);
114 static void HLE_Fixup2 (int, int);
115 static void HLE_Fixup3 (int, int);
116 static void CMPXCHG8B_Fixup (int, int);
117 static void XMM_Fixup (int, int);
118 static void CRC32_Fixup (int, int);
119 static void FXSAVE_Fixup (int, int);
120 static void PCMPESTR_Fixup (int, int);
121 static void OP_LWPCB_E (int, int);
122 static void OP_LWP_E (int, int);
123 static void OP_Vex_2src_1 (int, int);
124 static void OP_Vex_2src_2 (int, int);
126 static void MOVBE_Fixup (int, int);
128 static void OP_Mask (int, int);
131 /* Points to first byte not fetched. */
132 bfd_byte *max_fetched;
133 bfd_byte the_buffer[MAX_MNEM_SIZE];
136 OPCODES_SIGJMP_BUF bailout;
146 enum address_mode address_mode;
148 /* Flags for the prefixes for the current instruction. See below. */
151 /* REX prefix the current instruction. See below. */
153 /* Bits of REX we've already used. */
155 /* REX bits in original REX prefix ignored. */
156 static int rex_ignored;
157 /* Mark parts used in the REX prefix. When we are testing for
158 empty prefix (for 8bit register REX extension), just mask it
159 out. Otherwise test for REX bit is excuse for existence of REX
160 only in case value is nonzero. */
161 #define USED_REX(value) \
166 rex_used |= (value) | REX_OPCODE; \
169 rex_used |= REX_OPCODE; \
172 /* Flags for prefixes which we somehow handled when printing the
173 current instruction. */
174 static int used_prefixes;
176 /* Flags stored in PREFIXES. */
177 #define PREFIX_REPZ 1
178 #define PREFIX_REPNZ 2
179 #define PREFIX_LOCK 4
181 #define PREFIX_SS 0x10
182 #define PREFIX_DS 0x20
183 #define PREFIX_ES 0x40
184 #define PREFIX_FS 0x80
185 #define PREFIX_GS 0x100
186 #define PREFIX_DATA 0x200
187 #define PREFIX_ADDR 0x400
188 #define PREFIX_FWAIT 0x800
190 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
191 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
193 #define FETCH_DATA(info, addr) \
194 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
195 ? 1 : fetch_data ((info), (addr)))
198 fetch_data (struct disassemble_info *info, bfd_byte *addr)
201 struct dis_private *priv = (struct dis_private *) info->private_data;
202 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
204 if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
205 status = (*info->read_memory_func) (start,
207 addr - priv->max_fetched,
213 /* If we did manage to read at least one byte, then
214 print_insn_i386 will do something sensible. Otherwise, print
215 an error. We do that here because this is where we know
217 if (priv->max_fetched == priv->the_buffer)
218 (*info->memory_error_func) (status, start, info);
219 OPCODES_SIGLONGJMP (priv->bailout, 1);
222 priv->max_fetched = addr;
226 /* Possible values for prefix requirement. */
227 #define PREFIX_IGNORED_SHIFT 16
228 #define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
229 #define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
230 #define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
231 #define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
232 #define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
234 /* Opcode prefixes. */
235 #define PREFIX_OPCODE (PREFIX_REPZ \
239 /* Prefixes ignored. */
240 #define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
241 | PREFIX_IGNORED_REPNZ \
242 | PREFIX_IGNORED_DATA)
244 #define XX { NULL, 0 }
245 #define Bad_Opcode NULL, { { NULL, 0 } }, 0
247 #define Eb { OP_E, b_mode }
248 #define Ebnd { OP_E, bnd_mode }
249 #define EbS { OP_E, b_swap_mode }
250 #define EbndS { OP_E, bnd_swap_mode }
251 #define Ev { OP_E, v_mode }
252 #define Eva { OP_E, va_mode }
253 #define Ev_bnd { OP_E, v_bnd_mode }
254 #define EvS { OP_E, v_swap_mode }
255 #define Ed { OP_E, d_mode }
256 #define Edq { OP_E, dq_mode }
257 #define Edqw { OP_E, dqw_mode }
258 #define Edqb { OP_E, dqb_mode }
259 #define Edb { OP_E, db_mode }
260 #define Edw { OP_E, dw_mode }
261 #define Edqd { OP_E, dqd_mode }
262 #define Eq { OP_E, q_mode }
263 #define indirEv { OP_indirE, indir_v_mode }
264 #define indirEp { OP_indirE, f_mode }
265 #define stackEv { OP_E, stack_v_mode }
266 #define Em { OP_E, m_mode }
267 #define Ew { OP_E, w_mode }
268 #define M { OP_M, 0 } /* lea, lgdt, etc. */
269 #define Ma { OP_M, a_mode }
270 #define Mb { OP_M, b_mode }
271 #define Md { OP_M, d_mode }
272 #define Mo { OP_M, o_mode }
273 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
274 #define Mq { OP_M, q_mode }
275 #define Mv_bnd { OP_M, v_bndmk_mode }
276 #define Mx { OP_M, x_mode }
277 #define Mxmm { OP_M, xmm_mode }
278 #define Gb { OP_G, b_mode }
279 #define Gbnd { OP_G, bnd_mode }
280 #define Gv { OP_G, v_mode }
281 #define Gd { OP_G, d_mode }
282 #define Gdq { OP_G, dq_mode }
283 #define Gm { OP_G, m_mode }
284 #define Gva { OP_G, va_mode }
285 #define Gw { OP_G, w_mode }
286 #define Rd { OP_R, d_mode }
287 #define Rdq { OP_R, dq_mode }
288 #define Rm { OP_R, m_mode }
289 #define Ib { OP_I, b_mode }
290 #define sIb { OP_sI, b_mode } /* sign extened byte */
291 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
292 #define Iv { OP_I, v_mode }
293 #define sIv { OP_sI, v_mode }
294 #define Iq { OP_I, q_mode }
295 #define Iv64 { OP_I64, v_mode }
296 #define Iw { OP_I, w_mode }
297 #define I1 { OP_I, const_1_mode }
298 #define Jb { OP_J, b_mode }
299 #define Jv { OP_J, v_mode }
300 #define Cm { OP_C, m_mode }
301 #define Dm { OP_D, m_mode }
302 #define Td { OP_T, d_mode }
303 #define Skip_MODRM { OP_Skip_MODRM, 0 }
305 #define RMeAX { OP_REG, eAX_reg }
306 #define RMeBX { OP_REG, eBX_reg }
307 #define RMeCX { OP_REG, eCX_reg }
308 #define RMeDX { OP_REG, eDX_reg }
309 #define RMeSP { OP_REG, eSP_reg }
310 #define RMeBP { OP_REG, eBP_reg }
311 #define RMeSI { OP_REG, eSI_reg }
312 #define RMeDI { OP_REG, eDI_reg }
313 #define RMrAX { OP_REG, rAX_reg }
314 #define RMrBX { OP_REG, rBX_reg }
315 #define RMrCX { OP_REG, rCX_reg }
316 #define RMrDX { OP_REG, rDX_reg }
317 #define RMrSP { OP_REG, rSP_reg }
318 #define RMrBP { OP_REG, rBP_reg }
319 #define RMrSI { OP_REG, rSI_reg }
320 #define RMrDI { OP_REG, rDI_reg }
321 #define RMAL { OP_REG, al_reg }
322 #define RMCL { OP_REG, cl_reg }
323 #define RMDL { OP_REG, dl_reg }
324 #define RMBL { OP_REG, bl_reg }
325 #define RMAH { OP_REG, ah_reg }
326 #define RMCH { OP_REG, ch_reg }
327 #define RMDH { OP_REG, dh_reg }
328 #define RMBH { OP_REG, bh_reg }
329 #define RMAX { OP_REG, ax_reg }
330 #define RMDX { OP_REG, dx_reg }
332 #define eAX { OP_IMREG, eAX_reg }
333 #define eBX { OP_IMREG, eBX_reg }
334 #define eCX { OP_IMREG, eCX_reg }
335 #define eDX { OP_IMREG, eDX_reg }
336 #define eSP { OP_IMREG, eSP_reg }
337 #define eBP { OP_IMREG, eBP_reg }
338 #define eSI { OP_IMREG, eSI_reg }
339 #define eDI { OP_IMREG, eDI_reg }
340 #define AL { OP_IMREG, al_reg }
341 #define CL { OP_IMREG, cl_reg }
342 #define DL { OP_IMREG, dl_reg }
343 #define BL { OP_IMREG, bl_reg }
344 #define AH { OP_IMREG, ah_reg }
345 #define CH { OP_IMREG, ch_reg }
346 #define DH { OP_IMREG, dh_reg }
347 #define BH { OP_IMREG, bh_reg }
348 #define AX { OP_IMREG, ax_reg }
349 #define DX { OP_IMREG, dx_reg }
350 #define zAX { OP_IMREG, z_mode_ax_reg }
351 #define indirDX { OP_IMREG, indir_dx_reg }
353 #define Sw { OP_SEG, w_mode }
354 #define Sv { OP_SEG, v_mode }
355 #define Ap { OP_DIR, 0 }
356 #define Ob { OP_OFF64, b_mode }
357 #define Ov { OP_OFF64, v_mode }
358 #define Xb { OP_DSreg, eSI_reg }
359 #define Xv { OP_DSreg, eSI_reg }
360 #define Xz { OP_DSreg, eSI_reg }
361 #define Yb { OP_ESreg, eDI_reg }
362 #define Yv { OP_ESreg, eDI_reg }
363 #define DSBX { OP_DSreg, eBX_reg }
365 #define es { OP_REG, es_reg }
366 #define ss { OP_REG, ss_reg }
367 #define cs { OP_REG, cs_reg }
368 #define ds { OP_REG, ds_reg }
369 #define fs { OP_REG, fs_reg }
370 #define gs { OP_REG, gs_reg }
372 #define MX { OP_MMX, 0 }
373 #define XM { OP_XMM, 0 }
374 #define XMScalar { OP_XMM, scalar_mode }
375 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
376 #define XMM { OP_XMM, xmm_mode }
377 #define XMxmmq { OP_XMM, xmmq_mode }
378 #define EM { OP_EM, v_mode }
379 #define EMS { OP_EM, v_swap_mode }
380 #define EMd { OP_EM, d_mode }
381 #define EMx { OP_EM, x_mode }
382 #define EXbScalar { OP_EX, b_scalar_mode }
383 #define EXw { OP_EX, w_mode }
384 #define EXwScalar { OP_EX, w_scalar_mode }
385 #define EXd { OP_EX, d_mode }
386 #define EXdScalar { OP_EX, d_scalar_mode }
387 #define EXdS { OP_EX, d_swap_mode }
388 #define EXdScalarS { OP_EX, d_scalar_swap_mode }
389 #define EXq { OP_EX, q_mode }
390 #define EXqScalar { OP_EX, q_scalar_mode }
391 #define EXqScalarS { OP_EX, q_scalar_swap_mode }
392 #define EXqS { OP_EX, q_swap_mode }
393 #define EXx { OP_EX, x_mode }
394 #define EXxS { OP_EX, x_swap_mode }
395 #define EXxmm { OP_EX, xmm_mode }
396 #define EXymm { OP_EX, ymm_mode }
397 #define EXxmmq { OP_EX, xmmq_mode }
398 #define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
399 #define EXxmm_mb { OP_EX, xmm_mb_mode }
400 #define EXxmm_mw { OP_EX, xmm_mw_mode }
401 #define EXxmm_md { OP_EX, xmm_md_mode }
402 #define EXxmm_mq { OP_EX, xmm_mq_mode }
403 #define EXxmm_mdq { OP_EX, xmm_mdq_mode }
404 #define EXxmmdw { OP_EX, xmmdw_mode }
405 #define EXxmmqd { OP_EX, xmmqd_mode }
406 #define EXymmq { OP_EX, ymmq_mode }
407 #define EXVexWdq { OP_EX, vex_w_dq_mode }
408 #define EXVexWdqScalar { OP_EX, vex_scalar_w_dq_mode }
409 #define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
410 #define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
411 #define MS { OP_MS, v_mode }
412 #define XS { OP_XS, v_mode }
413 #define EMCq { OP_EMC, q_mode }
414 #define MXC { OP_MXC, 0 }
415 #define OPSUF { OP_3DNowSuffix, 0 }
416 #define CMP { CMP_Fixup, 0 }
417 #define XMM0 { XMM_Fixup, 0 }
418 #define FXSAVE { FXSAVE_Fixup, 0 }
419 #define Vex_2src_1 { OP_Vex_2src_1, 0 }
420 #define Vex_2src_2 { OP_Vex_2src_2, 0 }
422 #define Vex { OP_VEX, vex_mode }
423 #define VexScalar { OP_VEX, vex_scalar_mode }
424 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
425 #define Vex128 { OP_VEX, vex128_mode }
426 #define Vex256 { OP_VEX, vex256_mode }
427 #define VexGdq { OP_VEX, dq_mode }
428 #define EXdVex { OP_EX_Vex, d_mode }
429 #define EXdVexS { OP_EX_Vex, d_swap_mode }
430 #define EXdVexScalarS { OP_EX_Vex, d_scalar_swap_mode }
431 #define EXqVex { OP_EX_Vex, q_mode }
432 #define EXqVexS { OP_EX_Vex, q_swap_mode }
433 #define EXqVexScalarS { OP_EX_Vex, q_scalar_swap_mode }
434 #define EXVexW { OP_EX_VexW, x_mode }
435 #define EXdVexW { OP_EX_VexW, d_mode }
436 #define EXqVexW { OP_EX_VexW, q_mode }
437 #define EXVexImmW { OP_EX_VexImmW, x_mode }
438 #define XMVex { OP_XMM_Vex, 0 }
439 #define XMVexScalar { OP_XMM_Vex, scalar_mode }
440 #define XMVexW { OP_XMM_VexW, 0 }
441 #define XMVexI4 { OP_REG_VexI4, x_mode }
442 #define PCLMUL { PCLMUL_Fixup, 0 }
443 #define VCMP { VCMP_Fixup, 0 }
444 #define VPCMP { VPCMP_Fixup, 0 }
445 #define VPCOM { VPCOM_Fixup, 0 }
447 #define EXxEVexR { OP_Rounding, evex_rounding_mode }
448 #define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
449 #define EXxEVexS { OP_Rounding, evex_sae_mode }
451 #define XMask { OP_Mask, mask_mode }
452 #define MaskG { OP_G, mask_mode }
453 #define MaskE { OP_E, mask_mode }
454 #define MaskBDE { OP_E, mask_bd_mode }
455 #define MaskR { OP_R, mask_mode }
456 #define MaskVex { OP_VEX, mask_mode }
458 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
459 #define MVexVSIBDQWpX { OP_M, vex_vsib_d_w_d_mode }
460 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
461 #define MVexVSIBQDWpX { OP_M, vex_vsib_q_w_d_mode }
463 /* Used handle "rep" prefix for string instructions. */
464 #define Xbr { REP_Fixup, eSI_reg }
465 #define Xvr { REP_Fixup, eSI_reg }
466 #define Ybr { REP_Fixup, eDI_reg }
467 #define Yvr { REP_Fixup, eDI_reg }
468 #define Yzr { REP_Fixup, eDI_reg }
469 #define indirDXr { REP_Fixup, indir_dx_reg }
470 #define ALr { REP_Fixup, al_reg }
471 #define eAXr { REP_Fixup, eAX_reg }
473 /* Used handle HLE prefix for lockable instructions. */
474 #define Ebh1 { HLE_Fixup1, b_mode }
475 #define Evh1 { HLE_Fixup1, v_mode }
476 #define Ebh2 { HLE_Fixup2, b_mode }
477 #define Evh2 { HLE_Fixup2, v_mode }
478 #define Ebh3 { HLE_Fixup3, b_mode }
479 #define Evh3 { HLE_Fixup3, v_mode }
481 #define BND { BND_Fixup, 0 }
482 #define NOTRACK { NOTRACK_Fixup, 0 }
484 #define cond_jump_flag { NULL, cond_jump_mode }
485 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
487 /* bits in sizeflag */
488 #define SUFFIX_ALWAYS 4
496 /* byte operand with operand swapped */
498 /* byte operand, sign extend like 'T' suffix */
500 /* operand size depends on prefixes */
502 /* operand size depends on prefixes with operand swapped */
504 /* operand size depends on address prefix */
508 /* double word operand */
510 /* double word operand with operand swapped */
512 /* quad word operand */
514 /* quad word operand with operand swapped */
516 /* ten-byte operand */
518 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
519 broadcast enabled. */
521 /* Similar to x_mode, but with different EVEX mem shifts. */
523 /* Similar to x_mode, but with disabled broadcast. */
525 /* Similar to x_mode, but with operands swapped and disabled broadcast
528 /* 16-byte XMM operand */
530 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
531 memory operand (depending on vector length). Broadcast isn't
534 /* Same as xmmq_mode, but broadcast is allowed. */
535 evex_half_bcst_xmmq_mode,
536 /* XMM register or byte memory operand */
538 /* XMM register or word memory operand */
540 /* XMM register or double word memory operand */
542 /* XMM register or quad word memory operand */
544 /* XMM register or double/quad word memory operand, depending on
547 /* 16-byte XMM, word, double word or quad word operand. */
549 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
551 /* 32-byte YMM operand */
553 /* quad word, ymmword or zmmword memory operand. */
555 /* 32-byte YMM or 16-byte word operand */
557 /* d_mode in 32bit, q_mode in 64bit mode. */
559 /* pair of v_mode operands */
564 /* like v_bnd_mode in 32bit, no RIP-rel in 64bit mode. */
566 /* operand size depends on REX prefixes. */
568 /* registers like dq_mode, memory like w_mode. */
572 /* bounds operand with operand swapped */
574 /* 4- or 6-byte pointer operand */
577 /* v_mode for indirect branch opcodes. */
579 /* v_mode for stack-related opcodes. */
581 /* non-quad operand size depends on prefixes */
583 /* 16-byte operand */
585 /* registers like dq_mode, memory like b_mode. */
587 /* registers like d_mode, memory like b_mode. */
589 /* registers like d_mode, memory like w_mode. */
591 /* registers like dq_mode, memory like d_mode. */
593 /* normal vex mode */
595 /* 128bit vex mode */
597 /* 256bit vex mode */
599 /* operand size depends on the VEX.W bit. */
602 /* Similar to vex_w_dq_mode, with VSIB dword indices. */
603 vex_vsib_d_w_dq_mode,
604 /* Similar to vex_vsib_d_w_dq_mode, with smaller memory. */
606 /* Similar to vex_w_dq_mode, with VSIB qword indices. */
607 vex_vsib_q_w_dq_mode,
608 /* Similar to vex_vsib_q_w_dq_mode, with smaller memory. */
611 /* scalar, ignore vector length. */
613 /* like b_mode, ignore vector length. */
615 /* like w_mode, ignore vector length. */
617 /* like d_mode, ignore vector length. */
619 /* like d_swap_mode, ignore vector length. */
621 /* like q_mode, ignore vector length. */
623 /* like q_swap_mode, ignore vector length. */
625 /* like vex_mode, ignore vector length. */
627 /* like vex_w_dq_mode, ignore vector length. */
628 vex_scalar_w_dq_mode,
630 /* Static rounding. */
632 /* Static rounding, 64-bit mode only. */
633 evex_rounding_64_mode,
634 /* Supress all exceptions. */
637 /* Mask register operand. */
639 /* Mask register operand. */
707 #define FLOAT NULL, { { NULL, FLOATCODE } }, 0
709 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
710 #define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
711 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
712 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
713 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
714 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
715 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
716 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
717 #define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
718 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
719 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
720 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
721 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
722 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
723 #define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
724 #define EVEX_LEN_TABLE(I) DIS386 (USE_EVEX_LEN_TABLE, (I))
852 MOD_VEX_0F12_PREFIX_0,
854 MOD_VEX_0F16_PREFIX_0,
857 MOD_VEX_W_0_0F41_P_0_LEN_1,
858 MOD_VEX_W_1_0F41_P_0_LEN_1,
859 MOD_VEX_W_0_0F41_P_2_LEN_1,
860 MOD_VEX_W_1_0F41_P_2_LEN_1,
861 MOD_VEX_W_0_0F42_P_0_LEN_1,
862 MOD_VEX_W_1_0F42_P_0_LEN_1,
863 MOD_VEX_W_0_0F42_P_2_LEN_1,
864 MOD_VEX_W_1_0F42_P_2_LEN_1,
865 MOD_VEX_W_0_0F44_P_0_LEN_1,
866 MOD_VEX_W_1_0F44_P_0_LEN_1,
867 MOD_VEX_W_0_0F44_P_2_LEN_1,
868 MOD_VEX_W_1_0F44_P_2_LEN_1,
869 MOD_VEX_W_0_0F45_P_0_LEN_1,
870 MOD_VEX_W_1_0F45_P_0_LEN_1,
871 MOD_VEX_W_0_0F45_P_2_LEN_1,
872 MOD_VEX_W_1_0F45_P_2_LEN_1,
873 MOD_VEX_W_0_0F46_P_0_LEN_1,
874 MOD_VEX_W_1_0F46_P_0_LEN_1,
875 MOD_VEX_W_0_0F46_P_2_LEN_1,
876 MOD_VEX_W_1_0F46_P_2_LEN_1,
877 MOD_VEX_W_0_0F47_P_0_LEN_1,
878 MOD_VEX_W_1_0F47_P_0_LEN_1,
879 MOD_VEX_W_0_0F47_P_2_LEN_1,
880 MOD_VEX_W_1_0F47_P_2_LEN_1,
881 MOD_VEX_W_0_0F4A_P_0_LEN_1,
882 MOD_VEX_W_1_0F4A_P_0_LEN_1,
883 MOD_VEX_W_0_0F4A_P_2_LEN_1,
884 MOD_VEX_W_1_0F4A_P_2_LEN_1,
885 MOD_VEX_W_0_0F4B_P_0_LEN_1,
886 MOD_VEX_W_1_0F4B_P_0_LEN_1,
887 MOD_VEX_W_0_0F4B_P_2_LEN_1,
899 MOD_VEX_W_0_0F91_P_0_LEN_0,
900 MOD_VEX_W_1_0F91_P_0_LEN_0,
901 MOD_VEX_W_0_0F91_P_2_LEN_0,
902 MOD_VEX_W_1_0F91_P_2_LEN_0,
903 MOD_VEX_W_0_0F92_P_0_LEN_0,
904 MOD_VEX_W_0_0F92_P_2_LEN_0,
905 MOD_VEX_0F92_P_3_LEN_0,
906 MOD_VEX_W_0_0F93_P_0_LEN_0,
907 MOD_VEX_W_0_0F93_P_2_LEN_0,
908 MOD_VEX_0F93_P_3_LEN_0,
909 MOD_VEX_W_0_0F98_P_0_LEN_0,
910 MOD_VEX_W_1_0F98_P_0_LEN_0,
911 MOD_VEX_W_0_0F98_P_2_LEN_0,
912 MOD_VEX_W_1_0F98_P_2_LEN_0,
913 MOD_VEX_W_0_0F99_P_0_LEN_0,
914 MOD_VEX_W_1_0F99_P_0_LEN_0,
915 MOD_VEX_W_0_0F99_P_2_LEN_0,
916 MOD_VEX_W_1_0F99_P_2_LEN_0,
919 MOD_VEX_0FD7_PREFIX_2,
920 MOD_VEX_0FE7_PREFIX_2,
921 MOD_VEX_0FF0_PREFIX_3,
922 MOD_VEX_0F381A_PREFIX_2,
923 MOD_VEX_0F382A_PREFIX_2,
924 MOD_VEX_0F382C_PREFIX_2,
925 MOD_VEX_0F382D_PREFIX_2,
926 MOD_VEX_0F382E_PREFIX_2,
927 MOD_VEX_0F382F_PREFIX_2,
928 MOD_VEX_0F385A_PREFIX_2,
929 MOD_VEX_0F388C_PREFIX_2,
930 MOD_VEX_0F388E_PREFIX_2,
931 MOD_VEX_W_0_0F3A30_P_2_LEN_0,
932 MOD_VEX_W_1_0F3A30_P_2_LEN_0,
933 MOD_VEX_W_0_0F3A31_P_2_LEN_0,
934 MOD_VEX_W_1_0F3A31_P_2_LEN_0,
935 MOD_VEX_W_0_0F3A32_P_2_LEN_0,
936 MOD_VEX_W_1_0F3A32_P_2_LEN_0,
937 MOD_VEX_W_0_0F3A33_P_2_LEN_0,
938 MOD_VEX_W_1_0F3A33_P_2_LEN_0,
940 MOD_EVEX_0F10_PREFIX_1,
941 MOD_EVEX_0F10_PREFIX_3,
942 MOD_EVEX_0F11_PREFIX_1,
943 MOD_EVEX_0F11_PREFIX_3,
944 MOD_EVEX_0F12_PREFIX_0,
945 MOD_EVEX_0F16_PREFIX_0,
946 MOD_EVEX_0F38C6_REG_1,
947 MOD_EVEX_0F38C6_REG_2,
948 MOD_EVEX_0F38C6_REG_5,
949 MOD_EVEX_0F38C6_REG_6,
950 MOD_EVEX_0F38C7_REG_1,
951 MOD_EVEX_0F38C7_REG_2,
952 MOD_EVEX_0F38C7_REG_5,
953 MOD_EVEX_0F38C7_REG_6
974 PREFIX_MOD_0_0F01_REG_5,
975 PREFIX_MOD_3_0F01_REG_5_RM_0,
976 PREFIX_MOD_3_0F01_REG_5_RM_2,
1022 PREFIX_MOD_0_0FAE_REG_4,
1023 PREFIX_MOD_3_0FAE_REG_4,
1024 PREFIX_MOD_0_0FAE_REG_5,
1025 PREFIX_MOD_3_0FAE_REG_5,
1026 PREFIX_MOD_0_0FAE_REG_6,
1027 PREFIX_MOD_1_0FAE_REG_6,
1034 PREFIX_MOD_0_0FC7_REG_6,
1035 PREFIX_MOD_3_0FC7_REG_6,
1036 PREFIX_MOD_3_0FC7_REG_7,
1166 PREFIX_VEX_0F71_REG_2,
1167 PREFIX_VEX_0F71_REG_4,
1168 PREFIX_VEX_0F71_REG_6,
1169 PREFIX_VEX_0F72_REG_2,
1170 PREFIX_VEX_0F72_REG_4,
1171 PREFIX_VEX_0F72_REG_6,
1172 PREFIX_VEX_0F73_REG_2,
1173 PREFIX_VEX_0F73_REG_3,
1174 PREFIX_VEX_0F73_REG_6,
1175 PREFIX_VEX_0F73_REG_7,
1348 PREFIX_VEX_0F38F3_REG_1,
1349 PREFIX_VEX_0F38F3_REG_2,
1350 PREFIX_VEX_0F38F3_REG_3,
1469 PREFIX_EVEX_0F71_REG_2,
1470 PREFIX_EVEX_0F71_REG_4,
1471 PREFIX_EVEX_0F71_REG_6,
1472 PREFIX_EVEX_0F72_REG_0,
1473 PREFIX_EVEX_0F72_REG_1,
1474 PREFIX_EVEX_0F72_REG_2,
1475 PREFIX_EVEX_0F72_REG_4,
1476 PREFIX_EVEX_0F72_REG_6,
1477 PREFIX_EVEX_0F73_REG_2,
1478 PREFIX_EVEX_0F73_REG_3,
1479 PREFIX_EVEX_0F73_REG_6,
1480 PREFIX_EVEX_0F73_REG_7,
1677 PREFIX_EVEX_0F38C6_REG_1,
1678 PREFIX_EVEX_0F38C6_REG_2,
1679 PREFIX_EVEX_0F38C6_REG_5,
1680 PREFIX_EVEX_0F38C6_REG_6,
1681 PREFIX_EVEX_0F38C7_REG_1,
1682 PREFIX_EVEX_0F38C7_REG_2,
1683 PREFIX_EVEX_0F38C7_REG_5,
1684 PREFIX_EVEX_0F38C7_REG_6,
1786 THREE_BYTE_0F38 = 0,
1813 VEX_LEN_0F12_P_0_M_0 = 0,
1814 VEX_LEN_0F12_P_0_M_1,
1817 VEX_LEN_0F16_P_0_M_0,
1818 VEX_LEN_0F16_P_0_M_1,
1861 VEX_LEN_0FAE_R_2_M_0,
1862 VEX_LEN_0FAE_R_3_M_0,
1869 VEX_LEN_0F381A_P_2_M_0,
1872 VEX_LEN_0F385A_P_2_M_0,
1875 VEX_LEN_0F38F3_R_1_P_0,
1876 VEX_LEN_0F38F3_R_2_P_0,
1877 VEX_LEN_0F38F3_R_3_P_0,
1920 VEX_LEN_0FXOP_08_CC,
1921 VEX_LEN_0FXOP_08_CD,
1922 VEX_LEN_0FXOP_08_CE,
1923 VEX_LEN_0FXOP_08_CF,
1924 VEX_LEN_0FXOP_08_EC,
1925 VEX_LEN_0FXOP_08_ED,
1926 VEX_LEN_0FXOP_08_EE,
1927 VEX_LEN_0FXOP_08_EF,
1928 VEX_LEN_0FXOP_09_80,
1934 EVEX_LEN_0F6E_P_2 = 0,
1938 EVEX_LEN_0F3819_P_2_W_0,
1939 EVEX_LEN_0F3819_P_2_W_1,
1940 EVEX_LEN_0F381A_P_2_W_0,
1941 EVEX_LEN_0F381A_P_2_W_1,
1942 EVEX_LEN_0F381B_P_2_W_0,
1943 EVEX_LEN_0F381B_P_2_W_1,
1944 EVEX_LEN_0F385A_P_2_W_0,
1945 EVEX_LEN_0F385A_P_2_W_1,
1946 EVEX_LEN_0F385B_P_2_W_0,
1947 EVEX_LEN_0F385B_P_2_W_1,
1948 EVEX_LEN_0F3A18_P_2_W_0,
1949 EVEX_LEN_0F3A18_P_2_W_1,
1950 EVEX_LEN_0F3A19_P_2_W_0,
1951 EVEX_LEN_0F3A19_P_2_W_1,
1952 EVEX_LEN_0F3A1A_P_2_W_0,
1953 EVEX_LEN_0F3A1A_P_2_W_1,
1954 EVEX_LEN_0F3A1B_P_2_W_0,
1955 EVEX_LEN_0F3A1B_P_2_W_1,
1956 EVEX_LEN_0F3A23_P_2_W_0,
1957 EVEX_LEN_0F3A23_P_2_W_1,
1958 EVEX_LEN_0F3A38_P_2_W_0,
1959 EVEX_LEN_0F3A38_P_2_W_1,
1960 EVEX_LEN_0F3A39_P_2_W_0,
1961 EVEX_LEN_0F3A39_P_2_W_1,
1962 EVEX_LEN_0F3A3A_P_2_W_0,
1963 EVEX_LEN_0F3A3A_P_2_W_1,
1964 EVEX_LEN_0F3A3B_P_2_W_0,
1965 EVEX_LEN_0F3A3B_P_2_W_1,
1966 EVEX_LEN_0F3A43_P_2_W_0,
1967 EVEX_LEN_0F3A43_P_2_W_1
1972 VEX_W_0F41_P_0_LEN_1 = 0,
1973 VEX_W_0F41_P_2_LEN_1,
1974 VEX_W_0F42_P_0_LEN_1,
1975 VEX_W_0F42_P_2_LEN_1,
1976 VEX_W_0F44_P_0_LEN_0,
1977 VEX_W_0F44_P_2_LEN_0,
1978 VEX_W_0F45_P_0_LEN_1,
1979 VEX_W_0F45_P_2_LEN_1,
1980 VEX_W_0F46_P_0_LEN_1,
1981 VEX_W_0F46_P_2_LEN_1,
1982 VEX_W_0F47_P_0_LEN_1,
1983 VEX_W_0F47_P_2_LEN_1,
1984 VEX_W_0F4A_P_0_LEN_1,
1985 VEX_W_0F4A_P_2_LEN_1,
1986 VEX_W_0F4B_P_0_LEN_1,
1987 VEX_W_0F4B_P_2_LEN_1,
1988 VEX_W_0F90_P_0_LEN_0,
1989 VEX_W_0F90_P_2_LEN_0,
1990 VEX_W_0F91_P_0_LEN_0,
1991 VEX_W_0F91_P_2_LEN_0,
1992 VEX_W_0F92_P_0_LEN_0,
1993 VEX_W_0F92_P_2_LEN_0,
1994 VEX_W_0F93_P_0_LEN_0,
1995 VEX_W_0F93_P_2_LEN_0,
1996 VEX_W_0F98_P_0_LEN_0,
1997 VEX_W_0F98_P_2_LEN_0,
1998 VEX_W_0F99_P_0_LEN_0,
1999 VEX_W_0F99_P_2_LEN_0,
2007 VEX_W_0F381A_P_2_M_0,
2008 VEX_W_0F382C_P_2_M_0,
2009 VEX_W_0F382D_P_2_M_0,
2010 VEX_W_0F382E_P_2_M_0,
2011 VEX_W_0F382F_P_2_M_0,
2016 VEX_W_0F385A_P_2_M_0,
2028 VEX_W_0F3A30_P_2_LEN_0,
2029 VEX_W_0F3A31_P_2_LEN_0,
2030 VEX_W_0F3A32_P_2_LEN_0,
2031 VEX_W_0F3A33_P_2_LEN_0,
2044 EVEX_W_0F10_P_1_M_0,
2045 EVEX_W_0F10_P_1_M_1,
2047 EVEX_W_0F10_P_3_M_0,
2048 EVEX_W_0F10_P_3_M_1,
2050 EVEX_W_0F11_P_1_M_0,
2051 EVEX_W_0F11_P_1_M_1,
2053 EVEX_W_0F11_P_3_M_0,
2054 EVEX_W_0F11_P_3_M_1,
2055 EVEX_W_0F12_P_0_M_0,
2056 EVEX_W_0F12_P_0_M_1,
2066 EVEX_W_0F16_P_0_M_0,
2067 EVEX_W_0F16_P_0_M_1,
2136 EVEX_W_0F72_R_2_P_2,
2137 EVEX_W_0F72_R_6_P_2,
2138 EVEX_W_0F73_R_2_P_2,
2139 EVEX_W_0F73_R_6_P_2,
2249 EVEX_W_0F38C7_R_1_P_2,
2250 EVEX_W_0F38C7_R_2_P_2,
2251 EVEX_W_0F38C7_R_5_P_2,
2252 EVEX_W_0F38C7_R_6_P_2,
2291 typedef void (*op_rtn) (int bytemode, int sizeflag);
2300 unsigned int prefix_requirement;
2303 /* Upper case letters in the instruction names here are macros.
2304 'A' => print 'b' if no register operands or suffix_always is true
2305 'B' => print 'b' if suffix_always is true
2306 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
2308 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
2309 suffix_always is true
2310 'E' => print 'e' if 32-bit form of jcxz
2311 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
2312 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
2313 'H' => print ",pt" or ",pn" branch hint
2314 'I' => honor following macro letter even in Intel mode (implemented only
2315 for some of the macro letters)
2317 'K' => print 'd' or 'q' if rex prefix is present.
2318 'L' => print 'l' if suffix_always is true
2319 'M' => print 'r' if intel_mnemonic is false.
2320 'N' => print 'n' if instruction has no wait "prefix"
2321 'O' => print 'd' or 'o' (or 'q' in Intel mode)
2322 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
2323 or suffix_always is true. print 'q' if rex prefix is present.
2324 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
2326 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
2327 'S' => print 'w', 'l' or 'q' if suffix_always is true
2328 'T' => print 'q' in 64bit mode if instruction has no operand size
2329 prefix and behave as 'P' otherwise
2330 'U' => print 'q' in 64bit mode if instruction has no operand size
2331 prefix and behave as 'Q' otherwise
2332 'V' => print 'q' in 64bit mode if instruction has no operand size
2333 prefix and behave as 'S' otherwise
2334 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
2335 'X' => print 's', 'd' depending on data16 prefix (for XMM)
2337 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
2338 '!' => change condition from true to false or from false to true.
2339 '%' => add 1 upper case letter to the macro.
2340 '^' => print 'w' or 'l' depending on operand size prefix or
2341 suffix_always is true (lcall/ljmp).
2342 '@' => print 'q' for Intel64 ISA, 'w' or 'q' for AMD64 ISA depending
2343 on operand size prefix.
2344 '&' => print 'q' in 64bit mode for Intel64 ISA or if instruction
2345 has no operand size prefix for AMD64 ISA, behave as 'P'
2348 2 upper case letter macros:
2349 "XY" => print 'x' or 'y' if suffix_always is true or no register
2350 operands and no broadcast.
2351 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
2352 register operands and no broadcast.
2353 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
2354 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand
2355 or suffix_always is true
2356 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
2357 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
2358 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
2359 "LW" => print 'd', 'q' depending on the VEX.W bit
2360 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
2361 an operand size prefix, or suffix_always is true. print
2362 'q' if rex prefix is present.
2364 Many of the above letters print nothing in Intel mode. See "putop"
2367 Braces '{' and '}', and vertical bars '|', indicate alternative
2368 mnemonic strings for AT&T and Intel. */
2370 static const struct dis386 dis386[] = {
2372 { "addB", { Ebh1, Gb }, 0 },
2373 { "addS", { Evh1, Gv }, 0 },
2374 { "addB", { Gb, EbS }, 0 },
2375 { "addS", { Gv, EvS }, 0 },
2376 { "addB", { AL, Ib }, 0 },
2377 { "addS", { eAX, Iv }, 0 },
2378 { X86_64_TABLE (X86_64_06) },
2379 { X86_64_TABLE (X86_64_07) },
2381 { "orB", { Ebh1, Gb }, 0 },
2382 { "orS", { Evh1, Gv }, 0 },
2383 { "orB", { Gb, EbS }, 0 },
2384 { "orS", { Gv, EvS }, 0 },
2385 { "orB", { AL, Ib }, 0 },
2386 { "orS", { eAX, Iv }, 0 },
2387 { X86_64_TABLE (X86_64_0D) },
2388 { Bad_Opcode }, /* 0x0f extended opcode escape */
2390 { "adcB", { Ebh1, Gb }, 0 },
2391 { "adcS", { Evh1, Gv }, 0 },
2392 { "adcB", { Gb, EbS }, 0 },
2393 { "adcS", { Gv, EvS }, 0 },
2394 { "adcB", { AL, Ib }, 0 },
2395 { "adcS", { eAX, Iv }, 0 },
2396 { X86_64_TABLE (X86_64_16) },
2397 { X86_64_TABLE (X86_64_17) },
2399 { "sbbB", { Ebh1, Gb }, 0 },
2400 { "sbbS", { Evh1, Gv }, 0 },
2401 { "sbbB", { Gb, EbS }, 0 },
2402 { "sbbS", { Gv, EvS }, 0 },
2403 { "sbbB", { AL, Ib }, 0 },
2404 { "sbbS", { eAX, Iv }, 0 },
2405 { X86_64_TABLE (X86_64_1E) },
2406 { X86_64_TABLE (X86_64_1F) },
2408 { "andB", { Ebh1, Gb }, 0 },
2409 { "andS", { Evh1, Gv }, 0 },
2410 { "andB", { Gb, EbS }, 0 },
2411 { "andS", { Gv, EvS }, 0 },
2412 { "andB", { AL, Ib }, 0 },
2413 { "andS", { eAX, Iv }, 0 },
2414 { Bad_Opcode }, /* SEG ES prefix */
2415 { X86_64_TABLE (X86_64_27) },
2417 { "subB", { Ebh1, Gb }, 0 },
2418 { "subS", { Evh1, Gv }, 0 },
2419 { "subB", { Gb, EbS }, 0 },
2420 { "subS", { Gv, EvS }, 0 },
2421 { "subB", { AL, Ib }, 0 },
2422 { "subS", { eAX, Iv }, 0 },
2423 { Bad_Opcode }, /* SEG CS prefix */
2424 { X86_64_TABLE (X86_64_2F) },
2426 { "xorB", { Ebh1, Gb }, 0 },
2427 { "xorS", { Evh1, Gv }, 0 },
2428 { "xorB", { Gb, EbS }, 0 },
2429 { "xorS", { Gv, EvS }, 0 },
2430 { "xorB", { AL, Ib }, 0 },
2431 { "xorS", { eAX, Iv }, 0 },
2432 { Bad_Opcode }, /* SEG SS prefix */
2433 { X86_64_TABLE (X86_64_37) },
2435 { "cmpB", { Eb, Gb }, 0 },
2436 { "cmpS", { Ev, Gv }, 0 },
2437 { "cmpB", { Gb, EbS }, 0 },
2438 { "cmpS", { Gv, EvS }, 0 },
2439 { "cmpB", { AL, Ib }, 0 },
2440 { "cmpS", { eAX, Iv }, 0 },
2441 { Bad_Opcode }, /* SEG DS prefix */
2442 { X86_64_TABLE (X86_64_3F) },
2444 { "inc{S|}", { RMeAX }, 0 },
2445 { "inc{S|}", { RMeCX }, 0 },
2446 { "inc{S|}", { RMeDX }, 0 },
2447 { "inc{S|}", { RMeBX }, 0 },
2448 { "inc{S|}", { RMeSP }, 0 },
2449 { "inc{S|}", { RMeBP }, 0 },
2450 { "inc{S|}", { RMeSI }, 0 },
2451 { "inc{S|}", { RMeDI }, 0 },
2453 { "dec{S|}", { RMeAX }, 0 },
2454 { "dec{S|}", { RMeCX }, 0 },
2455 { "dec{S|}", { RMeDX }, 0 },
2456 { "dec{S|}", { RMeBX }, 0 },
2457 { "dec{S|}", { RMeSP }, 0 },
2458 { "dec{S|}", { RMeBP }, 0 },
2459 { "dec{S|}", { RMeSI }, 0 },
2460 { "dec{S|}", { RMeDI }, 0 },
2462 { "pushV", { RMrAX }, 0 },
2463 { "pushV", { RMrCX }, 0 },
2464 { "pushV", { RMrDX }, 0 },
2465 { "pushV", { RMrBX }, 0 },
2466 { "pushV", { RMrSP }, 0 },
2467 { "pushV", { RMrBP }, 0 },
2468 { "pushV", { RMrSI }, 0 },
2469 { "pushV", { RMrDI }, 0 },
2471 { "popV", { RMrAX }, 0 },
2472 { "popV", { RMrCX }, 0 },
2473 { "popV", { RMrDX }, 0 },
2474 { "popV", { RMrBX }, 0 },
2475 { "popV", { RMrSP }, 0 },
2476 { "popV", { RMrBP }, 0 },
2477 { "popV", { RMrSI }, 0 },
2478 { "popV", { RMrDI }, 0 },
2480 { X86_64_TABLE (X86_64_60) },
2481 { X86_64_TABLE (X86_64_61) },
2482 { X86_64_TABLE (X86_64_62) },
2483 { X86_64_TABLE (X86_64_63) },
2484 { Bad_Opcode }, /* seg fs */
2485 { Bad_Opcode }, /* seg gs */
2486 { Bad_Opcode }, /* op size prefix */
2487 { Bad_Opcode }, /* adr size prefix */
2489 { "pushT", { sIv }, 0 },
2490 { "imulS", { Gv, Ev, Iv }, 0 },
2491 { "pushT", { sIbT }, 0 },
2492 { "imulS", { Gv, Ev, sIb }, 0 },
2493 { "ins{b|}", { Ybr, indirDX }, 0 },
2494 { X86_64_TABLE (X86_64_6D) },
2495 { "outs{b|}", { indirDXr, Xb }, 0 },
2496 { X86_64_TABLE (X86_64_6F) },
2498 { "joH", { Jb, BND, cond_jump_flag }, 0 },
2499 { "jnoH", { Jb, BND, cond_jump_flag }, 0 },
2500 { "jbH", { Jb, BND, cond_jump_flag }, 0 },
2501 { "jaeH", { Jb, BND, cond_jump_flag }, 0 },
2502 { "jeH", { Jb, BND, cond_jump_flag }, 0 },
2503 { "jneH", { Jb, BND, cond_jump_flag }, 0 },
2504 { "jbeH", { Jb, BND, cond_jump_flag }, 0 },
2505 { "jaH", { Jb, BND, cond_jump_flag }, 0 },
2507 { "jsH", { Jb, BND, cond_jump_flag }, 0 },
2508 { "jnsH", { Jb, BND, cond_jump_flag }, 0 },
2509 { "jpH", { Jb, BND, cond_jump_flag }, 0 },
2510 { "jnpH", { Jb, BND, cond_jump_flag }, 0 },
2511 { "jlH", { Jb, BND, cond_jump_flag }, 0 },
2512 { "jgeH", { Jb, BND, cond_jump_flag }, 0 },
2513 { "jleH", { Jb, BND, cond_jump_flag }, 0 },
2514 { "jgH", { Jb, BND, cond_jump_flag }, 0 },
2516 { REG_TABLE (REG_80) },
2517 { REG_TABLE (REG_81) },
2518 { X86_64_TABLE (X86_64_82) },
2519 { REG_TABLE (REG_83) },
2520 { "testB", { Eb, Gb }, 0 },
2521 { "testS", { Ev, Gv }, 0 },
2522 { "xchgB", { Ebh2, Gb }, 0 },
2523 { "xchgS", { Evh2, Gv }, 0 },
2525 { "movB", { Ebh3, Gb }, 0 },
2526 { "movS", { Evh3, Gv }, 0 },
2527 { "movB", { Gb, EbS }, 0 },
2528 { "movS", { Gv, EvS }, 0 },
2529 { "movD", { Sv, Sw }, 0 },
2530 { MOD_TABLE (MOD_8D) },
2531 { "movD", { Sw, Sv }, 0 },
2532 { REG_TABLE (REG_8F) },
2534 { PREFIX_TABLE (PREFIX_90) },
2535 { "xchgS", { RMeCX, eAX }, 0 },
2536 { "xchgS", { RMeDX, eAX }, 0 },
2537 { "xchgS", { RMeBX, eAX }, 0 },
2538 { "xchgS", { RMeSP, eAX }, 0 },
2539 { "xchgS", { RMeBP, eAX }, 0 },
2540 { "xchgS", { RMeSI, eAX }, 0 },
2541 { "xchgS", { RMeDI, eAX }, 0 },
2543 { "cW{t|}R", { XX }, 0 },
2544 { "cR{t|}O", { XX }, 0 },
2545 { X86_64_TABLE (X86_64_9A) },
2546 { Bad_Opcode }, /* fwait */
2547 { "pushfT", { XX }, 0 },
2548 { "popfT", { XX }, 0 },
2549 { "sahf", { XX }, 0 },
2550 { "lahf", { XX }, 0 },
2552 { "mov%LB", { AL, Ob }, 0 },
2553 { "mov%LS", { eAX, Ov }, 0 },
2554 { "mov%LB", { Ob, AL }, 0 },
2555 { "mov%LS", { Ov, eAX }, 0 },
2556 { "movs{b|}", { Ybr, Xb }, 0 },
2557 { "movs{R|}", { Yvr, Xv }, 0 },
2558 { "cmps{b|}", { Xb, Yb }, 0 },
2559 { "cmps{R|}", { Xv, Yv }, 0 },
2561 { "testB", { AL, Ib }, 0 },
2562 { "testS", { eAX, Iv }, 0 },
2563 { "stosB", { Ybr, AL }, 0 },
2564 { "stosS", { Yvr, eAX }, 0 },
2565 { "lodsB", { ALr, Xb }, 0 },
2566 { "lodsS", { eAXr, Xv }, 0 },
2567 { "scasB", { AL, Yb }, 0 },
2568 { "scasS", { eAX, Yv }, 0 },
2570 { "movB", { RMAL, Ib }, 0 },
2571 { "movB", { RMCL, Ib }, 0 },
2572 { "movB", { RMDL, Ib }, 0 },
2573 { "movB", { RMBL, Ib }, 0 },
2574 { "movB", { RMAH, Ib }, 0 },
2575 { "movB", { RMCH, Ib }, 0 },
2576 { "movB", { RMDH, Ib }, 0 },
2577 { "movB", { RMBH, Ib }, 0 },
2579 { "mov%LV", { RMeAX, Iv64 }, 0 },
2580 { "mov%LV", { RMeCX, Iv64 }, 0 },
2581 { "mov%LV", { RMeDX, Iv64 }, 0 },
2582 { "mov%LV", { RMeBX, Iv64 }, 0 },
2583 { "mov%LV", { RMeSP, Iv64 }, 0 },
2584 { "mov%LV", { RMeBP, Iv64 }, 0 },
2585 { "mov%LV", { RMeSI, Iv64 }, 0 },
2586 { "mov%LV", { RMeDI, Iv64 }, 0 },
2588 { REG_TABLE (REG_C0) },
2589 { REG_TABLE (REG_C1) },
2590 { "retT", { Iw, BND }, 0 },
2591 { "retT", { BND }, 0 },
2592 { X86_64_TABLE (X86_64_C4) },
2593 { X86_64_TABLE (X86_64_C5) },
2594 { REG_TABLE (REG_C6) },
2595 { REG_TABLE (REG_C7) },
2597 { "enterT", { Iw, Ib }, 0 },
2598 { "leaveT", { XX }, 0 },
2599 { "Jret{|f}P", { Iw }, 0 },
2600 { "Jret{|f}P", { XX }, 0 },
2601 { "int3", { XX }, 0 },
2602 { "int", { Ib }, 0 },
2603 { X86_64_TABLE (X86_64_CE) },
2604 { "iret%LP", { XX }, 0 },
2606 { REG_TABLE (REG_D0) },
2607 { REG_TABLE (REG_D1) },
2608 { REG_TABLE (REG_D2) },
2609 { REG_TABLE (REG_D3) },
2610 { X86_64_TABLE (X86_64_D4) },
2611 { X86_64_TABLE (X86_64_D5) },
2613 { "xlat", { DSBX }, 0 },
2624 { "loopneFH", { Jb, XX, loop_jcxz_flag }, 0 },
2625 { "loopeFH", { Jb, XX, loop_jcxz_flag }, 0 },
2626 { "loopFH", { Jb, XX, loop_jcxz_flag }, 0 },
2627 { "jEcxzH", { Jb, XX, loop_jcxz_flag }, 0 },
2628 { "inB", { AL, Ib }, 0 },
2629 { "inG", { zAX, Ib }, 0 },
2630 { "outB", { Ib, AL }, 0 },
2631 { "outG", { Ib, zAX }, 0 },
2633 { X86_64_TABLE (X86_64_E8) },
2634 { X86_64_TABLE (X86_64_E9) },
2635 { X86_64_TABLE (X86_64_EA) },
2636 { "jmp", { Jb, BND }, 0 },
2637 { "inB", { AL, indirDX }, 0 },
2638 { "inG", { zAX, indirDX }, 0 },
2639 { "outB", { indirDX, AL }, 0 },
2640 { "outG", { indirDX, zAX }, 0 },
2642 { Bad_Opcode }, /* lock prefix */
2643 { "icebp", { XX }, 0 },
2644 { Bad_Opcode }, /* repne */
2645 { Bad_Opcode }, /* repz */
2646 { "hlt", { XX }, 0 },
2647 { "cmc", { XX }, 0 },
2648 { REG_TABLE (REG_F6) },
2649 { REG_TABLE (REG_F7) },
2651 { "clc", { XX }, 0 },
2652 { "stc", { XX }, 0 },
2653 { "cli", { XX }, 0 },
2654 { "sti", { XX }, 0 },
2655 { "cld", { XX }, 0 },
2656 { "std", { XX }, 0 },
2657 { REG_TABLE (REG_FE) },
2658 { REG_TABLE (REG_FF) },
2661 static const struct dis386 dis386_twobyte[] = {
2663 { REG_TABLE (REG_0F00 ) },
2664 { REG_TABLE (REG_0F01 ) },
2665 { "larS", { Gv, Ew }, 0 },
2666 { "lslS", { Gv, Ew }, 0 },
2668 { "syscall", { XX }, 0 },
2669 { "clts", { XX }, 0 },
2670 { "sysret%LP", { XX }, 0 },
2672 { "invd", { XX }, 0 },
2673 { PREFIX_TABLE (PREFIX_0F09) },
2675 { "ud2", { XX }, 0 },
2677 { REG_TABLE (REG_0F0D) },
2678 { "femms", { XX }, 0 },
2679 { "", { MX, EM, OPSUF }, 0 }, /* See OP_3DNowSuffix. */
2681 { PREFIX_TABLE (PREFIX_0F10) },
2682 { PREFIX_TABLE (PREFIX_0F11) },
2683 { PREFIX_TABLE (PREFIX_0F12) },
2684 { MOD_TABLE (MOD_0F13) },
2685 { "unpcklpX", { XM, EXx }, PREFIX_OPCODE },
2686 { "unpckhpX", { XM, EXx }, PREFIX_OPCODE },
2687 { PREFIX_TABLE (PREFIX_0F16) },
2688 { MOD_TABLE (MOD_0F17) },
2690 { REG_TABLE (REG_0F18) },
2691 { "nopQ", { Ev }, 0 },
2692 { PREFIX_TABLE (PREFIX_0F1A) },
2693 { PREFIX_TABLE (PREFIX_0F1B) },
2694 { PREFIX_TABLE (PREFIX_0F1C) },
2695 { "nopQ", { Ev }, 0 },
2696 { PREFIX_TABLE (PREFIX_0F1E) },
2697 { "nopQ", { Ev }, 0 },
2699 { "movZ", { Rm, Cm }, 0 },
2700 { "movZ", { Rm, Dm }, 0 },
2701 { "movZ", { Cm, Rm }, 0 },
2702 { "movZ", { Dm, Rm }, 0 },
2703 { MOD_TABLE (MOD_0F24) },
2705 { MOD_TABLE (MOD_0F26) },
2708 { "movapX", { XM, EXx }, PREFIX_OPCODE },
2709 { "movapX", { EXxS, XM }, PREFIX_OPCODE },
2710 { PREFIX_TABLE (PREFIX_0F2A) },
2711 { PREFIX_TABLE (PREFIX_0F2B) },
2712 { PREFIX_TABLE (PREFIX_0F2C) },
2713 { PREFIX_TABLE (PREFIX_0F2D) },
2714 { PREFIX_TABLE (PREFIX_0F2E) },
2715 { PREFIX_TABLE (PREFIX_0F2F) },
2717 { "wrmsr", { XX }, 0 },
2718 { "rdtsc", { XX }, 0 },
2719 { "rdmsr", { XX }, 0 },
2720 { "rdpmc", { XX }, 0 },
2721 { "sysenter", { XX }, 0 },
2722 { "sysexit", { XX }, 0 },
2724 { "getsec", { XX }, 0 },
2726 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38, PREFIX_OPCODE) },
2728 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A, PREFIX_OPCODE) },
2735 { "cmovoS", { Gv, Ev }, 0 },
2736 { "cmovnoS", { Gv, Ev }, 0 },
2737 { "cmovbS", { Gv, Ev }, 0 },
2738 { "cmovaeS", { Gv, Ev }, 0 },
2739 { "cmoveS", { Gv, Ev }, 0 },
2740 { "cmovneS", { Gv, Ev }, 0 },
2741 { "cmovbeS", { Gv, Ev }, 0 },
2742 { "cmovaS", { Gv, Ev }, 0 },
2744 { "cmovsS", { Gv, Ev }, 0 },
2745 { "cmovnsS", { Gv, Ev }, 0 },
2746 { "cmovpS", { Gv, Ev }, 0 },
2747 { "cmovnpS", { Gv, Ev }, 0 },
2748 { "cmovlS", { Gv, Ev }, 0 },
2749 { "cmovgeS", { Gv, Ev }, 0 },
2750 { "cmovleS", { Gv, Ev }, 0 },
2751 { "cmovgS", { Gv, Ev }, 0 },
2753 { MOD_TABLE (MOD_0F51) },
2754 { PREFIX_TABLE (PREFIX_0F51) },
2755 { PREFIX_TABLE (PREFIX_0F52) },
2756 { PREFIX_TABLE (PREFIX_0F53) },
2757 { "andpX", { XM, EXx }, PREFIX_OPCODE },
2758 { "andnpX", { XM, EXx }, PREFIX_OPCODE },
2759 { "orpX", { XM, EXx }, PREFIX_OPCODE },
2760 { "xorpX", { XM, EXx }, PREFIX_OPCODE },
2762 { PREFIX_TABLE (PREFIX_0F58) },
2763 { PREFIX_TABLE (PREFIX_0F59) },
2764 { PREFIX_TABLE (PREFIX_0F5A) },
2765 { PREFIX_TABLE (PREFIX_0F5B) },
2766 { PREFIX_TABLE (PREFIX_0F5C) },
2767 { PREFIX_TABLE (PREFIX_0F5D) },
2768 { PREFIX_TABLE (PREFIX_0F5E) },
2769 { PREFIX_TABLE (PREFIX_0F5F) },
2771 { PREFIX_TABLE (PREFIX_0F60) },
2772 { PREFIX_TABLE (PREFIX_0F61) },
2773 { PREFIX_TABLE (PREFIX_0F62) },
2774 { "packsswb", { MX, EM }, PREFIX_OPCODE },
2775 { "pcmpgtb", { MX, EM }, PREFIX_OPCODE },
2776 { "pcmpgtw", { MX, EM }, PREFIX_OPCODE },
2777 { "pcmpgtd", { MX, EM }, PREFIX_OPCODE },
2778 { "packuswb", { MX, EM }, PREFIX_OPCODE },
2780 { "punpckhbw", { MX, EM }, PREFIX_OPCODE },
2781 { "punpckhwd", { MX, EM }, PREFIX_OPCODE },
2782 { "punpckhdq", { MX, EM }, PREFIX_OPCODE },
2783 { "packssdw", { MX, EM }, PREFIX_OPCODE },
2784 { PREFIX_TABLE (PREFIX_0F6C) },
2785 { PREFIX_TABLE (PREFIX_0F6D) },
2786 { "movK", { MX, Edq }, PREFIX_OPCODE },
2787 { PREFIX_TABLE (PREFIX_0F6F) },
2789 { PREFIX_TABLE (PREFIX_0F70) },
2790 { REG_TABLE (REG_0F71) },
2791 { REG_TABLE (REG_0F72) },
2792 { REG_TABLE (REG_0F73) },
2793 { "pcmpeqb", { MX, EM }, PREFIX_OPCODE },
2794 { "pcmpeqw", { MX, EM }, PREFIX_OPCODE },
2795 { "pcmpeqd", { MX, EM }, PREFIX_OPCODE },
2796 { "emms", { XX }, PREFIX_OPCODE },
2798 { PREFIX_TABLE (PREFIX_0F78) },
2799 { PREFIX_TABLE (PREFIX_0F79) },
2802 { PREFIX_TABLE (PREFIX_0F7C) },
2803 { PREFIX_TABLE (PREFIX_0F7D) },
2804 { PREFIX_TABLE (PREFIX_0F7E) },
2805 { PREFIX_TABLE (PREFIX_0F7F) },
2807 { "joH", { Jv, BND, cond_jump_flag }, 0 },
2808 { "jnoH", { Jv, BND, cond_jump_flag }, 0 },
2809 { "jbH", { Jv, BND, cond_jump_flag }, 0 },
2810 { "jaeH", { Jv, BND, cond_jump_flag }, 0 },
2811 { "jeH", { Jv, BND, cond_jump_flag }, 0 },
2812 { "jneH", { Jv, BND, cond_jump_flag }, 0 },
2813 { "jbeH", { Jv, BND, cond_jump_flag }, 0 },
2814 { "jaH", { Jv, BND, cond_jump_flag }, 0 },
2816 { "jsH", { Jv, BND, cond_jump_flag }, 0 },
2817 { "jnsH", { Jv, BND, cond_jump_flag }, 0 },
2818 { "jpH", { Jv, BND, cond_jump_flag }, 0 },
2819 { "jnpH", { Jv, BND, cond_jump_flag }, 0 },
2820 { "jlH", { Jv, BND, cond_jump_flag }, 0 },
2821 { "jgeH", { Jv, BND, cond_jump_flag }, 0 },
2822 { "jleH", { Jv, BND, cond_jump_flag }, 0 },
2823 { "jgH", { Jv, BND, cond_jump_flag }, 0 },
2825 { "seto", { Eb }, 0 },
2826 { "setno", { Eb }, 0 },
2827 { "setb", { Eb }, 0 },
2828 { "setae", { Eb }, 0 },
2829 { "sete", { Eb }, 0 },
2830 { "setne", { Eb }, 0 },
2831 { "setbe", { Eb }, 0 },
2832 { "seta", { Eb }, 0 },
2834 { "sets", { Eb }, 0 },
2835 { "setns", { Eb }, 0 },
2836 { "setp", { Eb }, 0 },
2837 { "setnp", { Eb }, 0 },
2838 { "setl", { Eb }, 0 },
2839 { "setge", { Eb }, 0 },
2840 { "setle", { Eb }, 0 },
2841 { "setg", { Eb }, 0 },
2843 { "pushT", { fs }, 0 },
2844 { "popT", { fs }, 0 },
2845 { "cpuid", { XX }, 0 },
2846 { "btS", { Ev, Gv }, 0 },
2847 { "shldS", { Ev, Gv, Ib }, 0 },
2848 { "shldS", { Ev, Gv, CL }, 0 },
2849 { REG_TABLE (REG_0FA6) },
2850 { REG_TABLE (REG_0FA7) },
2852 { "pushT", { gs }, 0 },
2853 { "popT", { gs }, 0 },
2854 { "rsm", { XX }, 0 },
2855 { "btsS", { Evh1, Gv }, 0 },
2856 { "shrdS", { Ev, Gv, Ib }, 0 },
2857 { "shrdS", { Ev, Gv, CL }, 0 },
2858 { REG_TABLE (REG_0FAE) },
2859 { "imulS", { Gv, Ev }, 0 },
2861 { "cmpxchgB", { Ebh1, Gb }, 0 },
2862 { "cmpxchgS", { Evh1, Gv }, 0 },
2863 { MOD_TABLE (MOD_0FB2) },
2864 { "btrS", { Evh1, Gv }, 0 },
2865 { MOD_TABLE (MOD_0FB4) },
2866 { MOD_TABLE (MOD_0FB5) },
2867 { "movz{bR|x}", { Gv, Eb }, 0 },
2868 { "movz{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movzww ! */
2870 { PREFIX_TABLE (PREFIX_0FB8) },
2871 { "ud1S", { Gv, Ev }, 0 },
2872 { REG_TABLE (REG_0FBA) },
2873 { "btcS", { Evh1, Gv }, 0 },
2874 { PREFIX_TABLE (PREFIX_0FBC) },
2875 { PREFIX_TABLE (PREFIX_0FBD) },
2876 { "movs{bR|x}", { Gv, Eb }, 0 },
2877 { "movs{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movsww ! */
2879 { "xaddB", { Ebh1, Gb }, 0 },
2880 { "xaddS", { Evh1, Gv }, 0 },
2881 { PREFIX_TABLE (PREFIX_0FC2) },
2882 { MOD_TABLE (MOD_0FC3) },
2883 { "pinsrw", { MX, Edqw, Ib }, PREFIX_OPCODE },
2884 { "pextrw", { Gdq, MS, Ib }, PREFIX_OPCODE },
2885 { "shufpX", { XM, EXx, Ib }, PREFIX_OPCODE },
2886 { REG_TABLE (REG_0FC7) },
2888 { "bswap", { RMeAX }, 0 },
2889 { "bswap", { RMeCX }, 0 },
2890 { "bswap", { RMeDX }, 0 },
2891 { "bswap", { RMeBX }, 0 },
2892 { "bswap", { RMeSP }, 0 },
2893 { "bswap", { RMeBP }, 0 },
2894 { "bswap", { RMeSI }, 0 },
2895 { "bswap", { RMeDI }, 0 },
2897 { PREFIX_TABLE (PREFIX_0FD0) },
2898 { "psrlw", { MX, EM }, PREFIX_OPCODE },
2899 { "psrld", { MX, EM }, PREFIX_OPCODE },
2900 { "psrlq", { MX, EM }, PREFIX_OPCODE },
2901 { "paddq", { MX, EM }, PREFIX_OPCODE },
2902 { "pmullw", { MX, EM }, PREFIX_OPCODE },
2903 { PREFIX_TABLE (PREFIX_0FD6) },
2904 { MOD_TABLE (MOD_0FD7) },
2906 { "psubusb", { MX, EM }, PREFIX_OPCODE },
2907 { "psubusw", { MX, EM }, PREFIX_OPCODE },
2908 { "pminub", { MX, EM }, PREFIX_OPCODE },
2909 { "pand", { MX, EM }, PREFIX_OPCODE },
2910 { "paddusb", { MX, EM }, PREFIX_OPCODE },
2911 { "paddusw", { MX, EM }, PREFIX_OPCODE },
2912 { "pmaxub", { MX, EM }, PREFIX_OPCODE },
2913 { "pandn", { MX, EM }, PREFIX_OPCODE },
2915 { "pavgb", { MX, EM }, PREFIX_OPCODE },
2916 { "psraw", { MX, EM }, PREFIX_OPCODE },
2917 { "psrad", { MX, EM }, PREFIX_OPCODE },
2918 { "pavgw", { MX, EM }, PREFIX_OPCODE },
2919 { "pmulhuw", { MX, EM }, PREFIX_OPCODE },
2920 { "pmulhw", { MX, EM }, PREFIX_OPCODE },
2921 { PREFIX_TABLE (PREFIX_0FE6) },
2922 { PREFIX_TABLE (PREFIX_0FE7) },
2924 { "psubsb", { MX, EM }, PREFIX_OPCODE },
2925 { "psubsw", { MX, EM }, PREFIX_OPCODE },
2926 { "pminsw", { MX, EM }, PREFIX_OPCODE },
2927 { "por", { MX, EM }, PREFIX_OPCODE },
2928 { "paddsb", { MX, EM }, PREFIX_OPCODE },
2929 { "paddsw", { MX, EM }, PREFIX_OPCODE },
2930 { "pmaxsw", { MX, EM }, PREFIX_OPCODE },
2931 { "pxor", { MX, EM }, PREFIX_OPCODE },
2933 { PREFIX_TABLE (PREFIX_0FF0) },
2934 { "psllw", { MX, EM }, PREFIX_OPCODE },
2935 { "pslld", { MX, EM }, PREFIX_OPCODE },
2936 { "psllq", { MX, EM }, PREFIX_OPCODE },
2937 { "pmuludq", { MX, EM }, PREFIX_OPCODE },
2938 { "pmaddwd", { MX, EM }, PREFIX_OPCODE },
2939 { "psadbw", { MX, EM }, PREFIX_OPCODE },
2940 { PREFIX_TABLE (PREFIX_0FF7) },
2942 { "psubb", { MX, EM }, PREFIX_OPCODE },
2943 { "psubw", { MX, EM }, PREFIX_OPCODE },
2944 { "psubd", { MX, EM }, PREFIX_OPCODE },
2945 { "psubq", { MX, EM }, PREFIX_OPCODE },
2946 { "paddb", { MX, EM }, PREFIX_OPCODE },
2947 { "paddw", { MX, EM }, PREFIX_OPCODE },
2948 { "paddd", { MX, EM }, PREFIX_OPCODE },
2949 { "ud0S", { Gv, Ev }, 0 },
2952 static const unsigned char onebyte_has_modrm[256] = {
2953 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2954 /* ------------------------------- */
2955 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2956 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2957 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2958 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2959 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2960 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2961 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2962 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2963 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2964 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2965 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2966 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2967 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2968 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2969 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2970 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2971 /* ------------------------------- */
2972 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2975 static const unsigned char twobyte_has_modrm[256] = {
2976 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2977 /* ------------------------------- */
2978 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2979 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2980 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2981 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2982 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2983 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2984 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2985 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2986 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2987 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2988 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2989 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
2990 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2991 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2992 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2993 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
2994 /* ------------------------------- */
2995 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2998 static char obuf[100];
3000 static char *mnemonicendp;
3001 static char scratchbuf[100];
3002 static unsigned char *start_codep;
3003 static unsigned char *insn_codep;
3004 static unsigned char *codep;
3005 static unsigned char *end_codep;
3006 static int last_lock_prefix;
3007 static int last_repz_prefix;
3008 static int last_repnz_prefix;
3009 static int last_data_prefix;
3010 static int last_addr_prefix;
3011 static int last_rex_prefix;
3012 static int last_seg_prefix;
3013 static int fwait_prefix;
3014 /* The active segment register prefix. */
3015 static int active_seg_prefix;
3016 #define MAX_CODE_LENGTH 15
3017 /* We can up to 14 prefixes since the maximum instruction length is
3019 static int all_prefixes[MAX_CODE_LENGTH - 1];
3020 static disassemble_info *the_info;
3028 static unsigned char need_modrm;
3038 int register_specifier;
3045 int mask_register_specifier;
3051 static unsigned char need_vex;
3052 static unsigned char need_vex_reg;
3053 static unsigned char vex_w_done;
3061 /* If we are accessing mod/rm/reg without need_modrm set, then the
3062 values are stale. Hitting this abort likely indicates that you
3063 need to update onebyte_has_modrm or twobyte_has_modrm. */
3064 #define MODRM_CHECK if (!need_modrm) abort ()
3066 static const char **names64;
3067 static const char **names32;
3068 static const char **names16;
3069 static const char **names8;
3070 static const char **names8rex;
3071 static const char **names_seg;
3072 static const char *index64;
3073 static const char *index32;
3074 static const char **index16;
3075 static const char **names_bnd;
3077 static const char *intel_names64[] = {
3078 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
3079 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
3081 static const char *intel_names32[] = {
3082 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
3083 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
3085 static const char *intel_names16[] = {
3086 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
3087 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
3089 static const char *intel_names8[] = {
3090 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
3092 static const char *intel_names8rex[] = {
3093 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
3094 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
3096 static const char *intel_names_seg[] = {
3097 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
3099 static const char *intel_index64 = "riz";
3100 static const char *intel_index32 = "eiz";
3101 static const char *intel_index16[] = {
3102 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
3105 static const char *att_names64[] = {
3106 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
3107 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
3109 static const char *att_names32[] = {
3110 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
3111 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
3113 static const char *att_names16[] = {
3114 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
3115 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
3117 static const char *att_names8[] = {
3118 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
3120 static const char *att_names8rex[] = {
3121 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
3122 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
3124 static const char *att_names_seg[] = {
3125 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
3127 static const char *att_index64 = "%riz";
3128 static const char *att_index32 = "%eiz";
3129 static const char *att_index16[] = {
3130 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
3133 static const char **names_mm;
3134 static const char *intel_names_mm[] = {
3135 "mm0", "mm1", "mm2", "mm3",
3136 "mm4", "mm5", "mm6", "mm7"
3138 static const char *att_names_mm[] = {
3139 "%mm0", "%mm1", "%mm2", "%mm3",
3140 "%mm4", "%mm5", "%mm6", "%mm7"
3143 static const char *intel_names_bnd[] = {
3144 "bnd0", "bnd1", "bnd2", "bnd3"
3147 static const char *att_names_bnd[] = {
3148 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
3151 static const char **names_xmm;
3152 static const char *intel_names_xmm[] = {
3153 "xmm0", "xmm1", "xmm2", "xmm3",
3154 "xmm4", "xmm5", "xmm6", "xmm7",
3155 "xmm8", "xmm9", "xmm10", "xmm11",
3156 "xmm12", "xmm13", "xmm14", "xmm15",
3157 "xmm16", "xmm17", "xmm18", "xmm19",
3158 "xmm20", "xmm21", "xmm22", "xmm23",
3159 "xmm24", "xmm25", "xmm26", "xmm27",
3160 "xmm28", "xmm29", "xmm30", "xmm31"
3162 static const char *att_names_xmm[] = {
3163 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
3164 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
3165 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
3166 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
3167 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
3168 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
3169 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
3170 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
3173 static const char **names_ymm;
3174 static const char *intel_names_ymm[] = {
3175 "ymm0", "ymm1", "ymm2", "ymm3",
3176 "ymm4", "ymm5", "ymm6", "ymm7",
3177 "ymm8", "ymm9", "ymm10", "ymm11",
3178 "ymm12", "ymm13", "ymm14", "ymm15",
3179 "ymm16", "ymm17", "ymm18", "ymm19",
3180 "ymm20", "ymm21", "ymm22", "ymm23",
3181 "ymm24", "ymm25", "ymm26", "ymm27",
3182 "ymm28", "ymm29", "ymm30", "ymm31"
3184 static const char *att_names_ymm[] = {
3185 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
3186 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
3187 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
3188 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
3189 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
3190 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
3191 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
3192 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
3195 static const char **names_zmm;
3196 static const char *intel_names_zmm[] = {
3197 "zmm0", "zmm1", "zmm2", "zmm3",
3198 "zmm4", "zmm5", "zmm6", "zmm7",
3199 "zmm8", "zmm9", "zmm10", "zmm11",
3200 "zmm12", "zmm13", "zmm14", "zmm15",
3201 "zmm16", "zmm17", "zmm18", "zmm19",
3202 "zmm20", "zmm21", "zmm22", "zmm23",
3203 "zmm24", "zmm25", "zmm26", "zmm27",
3204 "zmm28", "zmm29", "zmm30", "zmm31"
3206 static const char *att_names_zmm[] = {
3207 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
3208 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
3209 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
3210 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
3211 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
3212 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
3213 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
3214 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
3217 static const char **names_mask;
3218 static const char *intel_names_mask[] = {
3219 "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7"
3221 static const char *att_names_mask[] = {
3222 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
3225 static const char *names_rounding[] =
3233 static const struct dis386 reg_table[][8] = {
3236 { "addA", { Ebh1, Ib }, 0 },
3237 { "orA", { Ebh1, Ib }, 0 },
3238 { "adcA", { Ebh1, Ib }, 0 },
3239 { "sbbA", { Ebh1, Ib }, 0 },
3240 { "andA", { Ebh1, Ib }, 0 },
3241 { "subA", { Ebh1, Ib }, 0 },
3242 { "xorA", { Ebh1, Ib }, 0 },
3243 { "cmpA", { Eb, Ib }, 0 },
3247 { "addQ", { Evh1, Iv }, 0 },
3248 { "orQ", { Evh1, Iv }, 0 },
3249 { "adcQ", { Evh1, Iv }, 0 },
3250 { "sbbQ", { Evh1, Iv }, 0 },
3251 { "andQ", { Evh1, Iv }, 0 },
3252 { "subQ", { Evh1, Iv }, 0 },
3253 { "xorQ", { Evh1, Iv }, 0 },
3254 { "cmpQ", { Ev, Iv }, 0 },
3258 { "addQ", { Evh1, sIb }, 0 },
3259 { "orQ", { Evh1, sIb }, 0 },
3260 { "adcQ", { Evh1, sIb }, 0 },
3261 { "sbbQ", { Evh1, sIb }, 0 },
3262 { "andQ", { Evh1, sIb }, 0 },
3263 { "subQ", { Evh1, sIb }, 0 },
3264 { "xorQ", { Evh1, sIb }, 0 },
3265 { "cmpQ", { Ev, sIb }, 0 },
3269 { "popU", { stackEv }, 0 },
3270 { XOP_8F_TABLE (XOP_09) },
3274 { XOP_8F_TABLE (XOP_09) },
3278 { "rolA", { Eb, Ib }, 0 },
3279 { "rorA", { Eb, Ib }, 0 },
3280 { "rclA", { Eb, Ib }, 0 },
3281 { "rcrA", { Eb, Ib }, 0 },
3282 { "shlA", { Eb, Ib }, 0 },
3283 { "shrA", { Eb, Ib }, 0 },
3284 { "shlA", { Eb, Ib }, 0 },
3285 { "sarA", { Eb, Ib }, 0 },
3289 { "rolQ", { Ev, Ib }, 0 },
3290 { "rorQ", { Ev, Ib }, 0 },
3291 { "rclQ", { Ev, Ib }, 0 },
3292 { "rcrQ", { Ev, Ib }, 0 },
3293 { "shlQ", { Ev, Ib }, 0 },
3294 { "shrQ", { Ev, Ib }, 0 },
3295 { "shlQ", { Ev, Ib }, 0 },
3296 { "sarQ", { Ev, Ib }, 0 },
3300 { "movA", { Ebh3, Ib }, 0 },
3307 { MOD_TABLE (MOD_C6_REG_7) },
3311 { "movQ", { Evh3, Iv }, 0 },
3318 { MOD_TABLE (MOD_C7_REG_7) },
3322 { "rolA", { Eb, I1 }, 0 },
3323 { "rorA", { Eb, I1 }, 0 },
3324 { "rclA", { Eb, I1 }, 0 },
3325 { "rcrA", { Eb, I1 }, 0 },
3326 { "shlA", { Eb, I1 }, 0 },
3327 { "shrA", { Eb, I1 }, 0 },
3328 { "shlA", { Eb, I1 }, 0 },
3329 { "sarA", { Eb, I1 }, 0 },
3333 { "rolQ", { Ev, I1 }, 0 },
3334 { "rorQ", { Ev, I1 }, 0 },
3335 { "rclQ", { Ev, I1 }, 0 },
3336 { "rcrQ", { Ev, I1 }, 0 },
3337 { "shlQ", { Ev, I1 }, 0 },
3338 { "shrQ", { Ev, I1 }, 0 },
3339 { "shlQ", { Ev, I1 }, 0 },
3340 { "sarQ", { Ev, I1 }, 0 },
3344 { "rolA", { Eb, CL }, 0 },
3345 { "rorA", { Eb, CL }, 0 },
3346 { "rclA", { Eb, CL }, 0 },
3347 { "rcrA", { Eb, CL }, 0 },
3348 { "shlA", { Eb, CL }, 0 },
3349 { "shrA", { Eb, CL }, 0 },
3350 { "shlA", { Eb, CL }, 0 },
3351 { "sarA", { Eb, CL }, 0 },
3355 { "rolQ", { Ev, CL }, 0 },
3356 { "rorQ", { Ev, CL }, 0 },
3357 { "rclQ", { Ev, CL }, 0 },
3358 { "rcrQ", { Ev, CL }, 0 },
3359 { "shlQ", { Ev, CL }, 0 },
3360 { "shrQ", { Ev, CL }, 0 },
3361 { "shlQ", { Ev, CL }, 0 },
3362 { "sarQ", { Ev, CL }, 0 },
3366 { "testA", { Eb, Ib }, 0 },
3367 { "testA", { Eb, Ib }, 0 },
3368 { "notA", { Ebh1 }, 0 },
3369 { "negA", { Ebh1 }, 0 },
3370 { "mulA", { Eb }, 0 }, /* Don't print the implicit %al register, */
3371 { "imulA", { Eb }, 0 }, /* to distinguish these opcodes from other */
3372 { "divA", { Eb }, 0 }, /* mul/imul opcodes. Do the same for div */
3373 { "idivA", { Eb }, 0 }, /* and idiv for consistency. */
3377 { "testQ", { Ev, Iv }, 0 },
3378 { "testQ", { Ev, Iv }, 0 },
3379 { "notQ", { Evh1 }, 0 },
3380 { "negQ", { Evh1 }, 0 },
3381 { "mulQ", { Ev }, 0 }, /* Don't print the implicit register. */
3382 { "imulQ", { Ev }, 0 },
3383 { "divQ", { Ev }, 0 },
3384 { "idivQ", { Ev }, 0 },
3388 { "incA", { Ebh1 }, 0 },
3389 { "decA", { Ebh1 }, 0 },
3393 { "incQ", { Evh1 }, 0 },
3394 { "decQ", { Evh1 }, 0 },
3395 { "call{&|}", { NOTRACK, indirEv, BND }, 0 },
3396 { MOD_TABLE (MOD_FF_REG_3) },
3397 { "jmp{&|}", { NOTRACK, indirEv, BND }, 0 },
3398 { MOD_TABLE (MOD_FF_REG_5) },
3399 { "pushU", { stackEv }, 0 },
3404 { "sldtD", { Sv }, 0 },
3405 { "strD", { Sv }, 0 },
3406 { "lldt", { Ew }, 0 },
3407 { "ltr", { Ew }, 0 },
3408 { "verr", { Ew }, 0 },
3409 { "verw", { Ew }, 0 },
3415 { MOD_TABLE (MOD_0F01_REG_0) },
3416 { MOD_TABLE (MOD_0F01_REG_1) },
3417 { MOD_TABLE (MOD_0F01_REG_2) },
3418 { MOD_TABLE (MOD_0F01_REG_3) },
3419 { "smswD", { Sv }, 0 },
3420 { MOD_TABLE (MOD_0F01_REG_5) },
3421 { "lmsw", { Ew }, 0 },
3422 { MOD_TABLE (MOD_0F01_REG_7) },
3426 { "prefetch", { Mb }, 0 },
3427 { "prefetchw", { Mb }, 0 },
3428 { "prefetchwt1", { Mb }, 0 },
3429 { "prefetch", { Mb }, 0 },
3430 { "prefetch", { Mb }, 0 },
3431 { "prefetch", { Mb }, 0 },
3432 { "prefetch", { Mb }, 0 },
3433 { "prefetch", { Mb }, 0 },
3437 { MOD_TABLE (MOD_0F18_REG_0) },
3438 { MOD_TABLE (MOD_0F18_REG_1) },
3439 { MOD_TABLE (MOD_0F18_REG_2) },
3440 { MOD_TABLE (MOD_0F18_REG_3) },
3441 { MOD_TABLE (MOD_0F18_REG_4) },
3442 { MOD_TABLE (MOD_0F18_REG_5) },
3443 { MOD_TABLE (MOD_0F18_REG_6) },
3444 { MOD_TABLE (MOD_0F18_REG_7) },
3446 /* REG_0F1C_MOD_0 */
3448 { "cldemote", { Mb }, 0 },
3449 { "nopQ", { Ev }, 0 },
3450 { "nopQ", { Ev }, 0 },
3451 { "nopQ", { Ev }, 0 },
3452 { "nopQ", { Ev }, 0 },
3453 { "nopQ", { Ev }, 0 },
3454 { "nopQ", { Ev }, 0 },
3455 { "nopQ", { Ev }, 0 },
3457 /* REG_0F1E_MOD_3 */
3459 { "nopQ", { Ev }, 0 },
3460 { "rdsspK", { Rdq }, PREFIX_OPCODE },
3461 { "nopQ", { Ev }, 0 },
3462 { "nopQ", { Ev }, 0 },
3463 { "nopQ", { Ev }, 0 },
3464 { "nopQ", { Ev }, 0 },
3465 { "nopQ", { Ev }, 0 },
3466 { RM_TABLE (RM_0F1E_MOD_3_REG_7) },
3472 { MOD_TABLE (MOD_0F71_REG_2) },
3474 { MOD_TABLE (MOD_0F71_REG_4) },
3476 { MOD_TABLE (MOD_0F71_REG_6) },
3482 { MOD_TABLE (MOD_0F72_REG_2) },
3484 { MOD_TABLE (MOD_0F72_REG_4) },
3486 { MOD_TABLE (MOD_0F72_REG_6) },
3492 { MOD_TABLE (MOD_0F73_REG_2) },
3493 { MOD_TABLE (MOD_0F73_REG_3) },
3496 { MOD_TABLE (MOD_0F73_REG_6) },
3497 { MOD_TABLE (MOD_0F73_REG_7) },
3501 { "montmul", { { OP_0f07, 0 } }, 0 },
3502 { "xsha1", { { OP_0f07, 0 } }, 0 },
3503 { "xsha256", { { OP_0f07, 0 } }, 0 },
3507 { "xstore-rng", { { OP_0f07, 0 } }, 0 },
3508 { "xcrypt-ecb", { { OP_0f07, 0 } }, 0 },
3509 { "xcrypt-cbc", { { OP_0f07, 0 } }, 0 },
3510 { "xcrypt-ctr", { { OP_0f07, 0 } }, 0 },
3511 { "xcrypt-cfb", { { OP_0f07, 0 } }, 0 },
3512 { "xcrypt-ofb", { { OP_0f07, 0 } }, 0 },
3516 { MOD_TABLE (MOD_0FAE_REG_0) },
3517 { MOD_TABLE (MOD_0FAE_REG_1) },
3518 { MOD_TABLE (MOD_0FAE_REG_2) },
3519 { MOD_TABLE (MOD_0FAE_REG_3) },
3520 { MOD_TABLE (MOD_0FAE_REG_4) },
3521 { MOD_TABLE (MOD_0FAE_REG_5) },
3522 { MOD_TABLE (MOD_0FAE_REG_6) },
3523 { MOD_TABLE (MOD_0FAE_REG_7) },
3531 { "btQ", { Ev, Ib }, 0 },
3532 { "btsQ", { Evh1, Ib }, 0 },
3533 { "btrQ", { Evh1, Ib }, 0 },
3534 { "btcQ", { Evh1, Ib }, 0 },
3539 { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } }, 0 },
3541 { MOD_TABLE (MOD_0FC7_REG_3) },
3542 { MOD_TABLE (MOD_0FC7_REG_4) },
3543 { MOD_TABLE (MOD_0FC7_REG_5) },
3544 { MOD_TABLE (MOD_0FC7_REG_6) },
3545 { MOD_TABLE (MOD_0FC7_REG_7) },
3551 { MOD_TABLE (MOD_VEX_0F71_REG_2) },
3553 { MOD_TABLE (MOD_VEX_0F71_REG_4) },
3555 { MOD_TABLE (MOD_VEX_0F71_REG_6) },
3561 { MOD_TABLE (MOD_VEX_0F72_REG_2) },
3563 { MOD_TABLE (MOD_VEX_0F72_REG_4) },
3565 { MOD_TABLE (MOD_VEX_0F72_REG_6) },
3571 { MOD_TABLE (MOD_VEX_0F73_REG_2) },
3572 { MOD_TABLE (MOD_VEX_0F73_REG_3) },
3575 { MOD_TABLE (MOD_VEX_0F73_REG_6) },
3576 { MOD_TABLE (MOD_VEX_0F73_REG_7) },
3582 { MOD_TABLE (MOD_VEX_0FAE_REG_2) },
3583 { MOD_TABLE (MOD_VEX_0FAE_REG_3) },
3585 /* REG_VEX_0F38F3 */
3588 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_1) },
3589 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_2) },
3590 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_3) },
3594 { "llwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3595 { "slwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3599 { "lwpins", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3600 { "lwpval", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3602 /* REG_XOP_TBM_01 */
3605 { "blcfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3606 { "blsfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3607 { "blcs", { { OP_LWP_E, 0 }, Ev }, 0 },
3608 { "tzmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3609 { "blcic", { { OP_LWP_E, 0 }, Ev }, 0 },
3610 { "blsic", { { OP_LWP_E, 0 }, Ev }, 0 },
3611 { "t1mskc", { { OP_LWP_E, 0 }, Ev }, 0 },
3613 /* REG_XOP_TBM_02 */
3616 { "blcmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3621 { "blci", { { OP_LWP_E, 0 }, Ev }, 0 },
3624 #include "i386-dis-evex-reg.h"
3627 static const struct dis386 prefix_table[][4] = {
3630 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3631 { "pause", { XX }, 0 },
3632 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3633 { NULL, { { NULL, 0 } }, PREFIX_IGNORED }
3636 /* PREFIX_MOD_0_0F01_REG_5 */
3639 { "rstorssp", { Mq }, PREFIX_OPCODE },
3642 /* PREFIX_MOD_3_0F01_REG_5_RM_0 */
3645 { "setssbsy", { Skip_MODRM }, PREFIX_OPCODE },
3648 /* PREFIX_MOD_3_0F01_REG_5_RM_2 */
3651 { "saveprevssp", { Skip_MODRM }, PREFIX_OPCODE },
3656 { "wbinvd", { XX }, 0 },
3657 { "wbnoinvd", { XX }, 0 },
3662 { "movups", { XM, EXx }, PREFIX_OPCODE },
3663 { "movss", { XM, EXd }, PREFIX_OPCODE },
3664 { "movupd", { XM, EXx }, PREFIX_OPCODE },
3665 { "movsd", { XM, EXq }, PREFIX_OPCODE },
3670 { "movups", { EXxS, XM }, PREFIX_OPCODE },
3671 { "movss", { EXdS, XM }, PREFIX_OPCODE },
3672 { "movupd", { EXxS, XM }, PREFIX_OPCODE },
3673 { "movsd", { EXqS, XM }, PREFIX_OPCODE },
3678 { MOD_TABLE (MOD_0F12_PREFIX_0) },
3679 { "movsldup", { XM, EXx }, PREFIX_OPCODE },
3680 { "movlpd", { XM, EXq }, PREFIX_OPCODE },
3681 { "movddup", { XM, EXq }, PREFIX_OPCODE },
3686 { MOD_TABLE (MOD_0F16_PREFIX_0) },
3687 { "movshdup", { XM, EXx }, PREFIX_OPCODE },
3688 { "movhpd", { XM, EXq }, PREFIX_OPCODE },
3693 { MOD_TABLE (MOD_0F1A_PREFIX_0) },
3694 { "bndcl", { Gbnd, Ev_bnd }, 0 },
3695 { "bndmov", { Gbnd, Ebnd }, 0 },
3696 { "bndcu", { Gbnd, Ev_bnd }, 0 },
3701 { MOD_TABLE (MOD_0F1B_PREFIX_0) },
3702 { MOD_TABLE (MOD_0F1B_PREFIX_1) },
3703 { "bndmov", { EbndS, Gbnd }, 0 },
3704 { "bndcn", { Gbnd, Ev_bnd }, 0 },
3709 { MOD_TABLE (MOD_0F1C_PREFIX_0) },
3710 { "nopQ", { Ev }, PREFIX_OPCODE },
3711 { "nopQ", { Ev }, PREFIX_OPCODE },
3712 { "nopQ", { Ev }, PREFIX_OPCODE },
3717 { "nopQ", { Ev }, PREFIX_OPCODE },
3718 { MOD_TABLE (MOD_0F1E_PREFIX_1) },
3719 { "nopQ", { Ev }, PREFIX_OPCODE },
3720 { "nopQ", { Ev }, PREFIX_OPCODE },
3725 { "cvtpi2ps", { XM, EMCq }, PREFIX_OPCODE },
3726 { "cvtsi2ss%LQ", { XM, Edq }, PREFIX_OPCODE },
3727 { "cvtpi2pd", { XM, EMCq }, PREFIX_OPCODE },
3728 { "cvtsi2sd%LQ", { XM, Edq }, 0 },
3733 { MOD_TABLE (MOD_0F2B_PREFIX_0) },
3734 { MOD_TABLE (MOD_0F2B_PREFIX_1) },
3735 { MOD_TABLE (MOD_0F2B_PREFIX_2) },
3736 { MOD_TABLE (MOD_0F2B_PREFIX_3) },
3741 { "cvttps2pi", { MXC, EXq }, PREFIX_OPCODE },
3742 { "cvttss2si", { Gdq, EXd }, PREFIX_OPCODE },
3743 { "cvttpd2pi", { MXC, EXx }, PREFIX_OPCODE },
3744 { "cvttsd2si", { Gdq, EXq }, PREFIX_OPCODE },
3749 { "cvtps2pi", { MXC, EXq }, PREFIX_OPCODE },
3750 { "cvtss2si", { Gdq, EXd }, PREFIX_OPCODE },
3751 { "cvtpd2pi", { MXC, EXx }, PREFIX_OPCODE },
3752 { "cvtsd2si", { Gdq, EXq }, PREFIX_OPCODE },
3757 { "ucomiss",{ XM, EXd }, 0 },
3759 { "ucomisd",{ XM, EXq }, 0 },
3764 { "comiss", { XM, EXd }, 0 },
3766 { "comisd", { XM, EXq }, 0 },
3771 { "sqrtps", { XM, EXx }, PREFIX_OPCODE },
3772 { "sqrtss", { XM, EXd }, PREFIX_OPCODE },
3773 { "sqrtpd", { XM, EXx }, PREFIX_OPCODE },
3774 { "sqrtsd", { XM, EXq }, PREFIX_OPCODE },
3779 { "rsqrtps",{ XM, EXx }, PREFIX_OPCODE },
3780 { "rsqrtss",{ XM, EXd }, PREFIX_OPCODE },
3785 { "rcpps", { XM, EXx }, PREFIX_OPCODE },
3786 { "rcpss", { XM, EXd }, PREFIX_OPCODE },
3791 { "addps", { XM, EXx }, PREFIX_OPCODE },
3792 { "addss", { XM, EXd }, PREFIX_OPCODE },
3793 { "addpd", { XM, EXx }, PREFIX_OPCODE },
3794 { "addsd", { XM, EXq }, PREFIX_OPCODE },
3799 { "mulps", { XM, EXx }, PREFIX_OPCODE },
3800 { "mulss", { XM, EXd }, PREFIX_OPCODE },
3801 { "mulpd", { XM, EXx }, PREFIX_OPCODE },
3802 { "mulsd", { XM, EXq }, PREFIX_OPCODE },
3807 { "cvtps2pd", { XM, EXq }, PREFIX_OPCODE },
3808 { "cvtss2sd", { XM, EXd }, PREFIX_OPCODE },
3809 { "cvtpd2ps", { XM, EXx }, PREFIX_OPCODE },
3810 { "cvtsd2ss", { XM, EXq }, PREFIX_OPCODE },
3815 { "cvtdq2ps", { XM, EXx }, PREFIX_OPCODE },
3816 { "cvttps2dq", { XM, EXx }, PREFIX_OPCODE },
3817 { "cvtps2dq", { XM, EXx }, PREFIX_OPCODE },
3822 { "subps", { XM, EXx }, PREFIX_OPCODE },
3823 { "subss", { XM, EXd }, PREFIX_OPCODE },
3824 { "subpd", { XM, EXx }, PREFIX_OPCODE },
3825 { "subsd", { XM, EXq }, PREFIX_OPCODE },
3830 { "minps", { XM, EXx }, PREFIX_OPCODE },
3831 { "minss", { XM, EXd }, PREFIX_OPCODE },
3832 { "minpd", { XM, EXx }, PREFIX_OPCODE },
3833 { "minsd", { XM, EXq }, PREFIX_OPCODE },
3838 { "divps", { XM, EXx }, PREFIX_OPCODE },
3839 { "divss", { XM, EXd }, PREFIX_OPCODE },
3840 { "divpd", { XM, EXx }, PREFIX_OPCODE },
3841 { "divsd", { XM, EXq }, PREFIX_OPCODE },
3846 { "maxps", { XM, EXx }, PREFIX_OPCODE },
3847 { "maxss", { XM, EXd }, PREFIX_OPCODE },
3848 { "maxpd", { XM, EXx }, PREFIX_OPCODE },
3849 { "maxsd", { XM, EXq }, PREFIX_OPCODE },
3854 { "punpcklbw",{ MX, EMd }, PREFIX_OPCODE },
3856 { "punpcklbw",{ MX, EMx }, PREFIX_OPCODE },
3861 { "punpcklwd",{ MX, EMd }, PREFIX_OPCODE },
3863 { "punpcklwd",{ MX, EMx }, PREFIX_OPCODE },
3868 { "punpckldq",{ MX, EMd }, PREFIX_OPCODE },
3870 { "punpckldq",{ MX, EMx }, PREFIX_OPCODE },
3877 { "punpcklqdq", { XM, EXx }, PREFIX_OPCODE },
3884 { "punpckhqdq", { XM, EXx }, PREFIX_OPCODE },
3889 { "movq", { MX, EM }, PREFIX_OPCODE },
3890 { "movdqu", { XM, EXx }, PREFIX_OPCODE },
3891 { "movdqa", { XM, EXx }, PREFIX_OPCODE },
3896 { "pshufw", { MX, EM, Ib }, PREFIX_OPCODE },
3897 { "pshufhw",{ XM, EXx, Ib }, PREFIX_OPCODE },
3898 { "pshufd", { XM, EXx, Ib }, PREFIX_OPCODE },
3899 { "pshuflw",{ XM, EXx, Ib }, PREFIX_OPCODE },
3902 /* PREFIX_0F73_REG_3 */
3906 { "psrldq", { XS, Ib }, 0 },
3909 /* PREFIX_0F73_REG_7 */
3913 { "pslldq", { XS, Ib }, 0 },
3918 {"vmread", { Em, Gm }, 0 },
3920 {"extrq", { XS, Ib, Ib }, 0 },
3921 {"insertq", { XM, XS, Ib, Ib }, 0 },
3926 {"vmwrite", { Gm, Em }, 0 },
3928 {"extrq", { XM, XS }, 0 },
3929 {"insertq", { XM, XS }, 0 },
3936 { "haddpd", { XM, EXx }, PREFIX_OPCODE },
3937 { "haddps", { XM, EXx }, PREFIX_OPCODE },
3944 { "hsubpd", { XM, EXx }, PREFIX_OPCODE },
3945 { "hsubps", { XM, EXx }, PREFIX_OPCODE },
3950 { "movK", { Edq, MX }, PREFIX_OPCODE },
3951 { "movq", { XM, EXq }, PREFIX_OPCODE },
3952 { "movK", { Edq, XM }, PREFIX_OPCODE },
3957 { "movq", { EMS, MX }, PREFIX_OPCODE },
3958 { "movdqu", { EXxS, XM }, PREFIX_OPCODE },
3959 { "movdqa", { EXxS, XM }, PREFIX_OPCODE },
3962 /* PREFIX_0FAE_REG_0 */
3965 { "rdfsbase", { Ev }, 0 },
3968 /* PREFIX_0FAE_REG_1 */
3971 { "rdgsbase", { Ev }, 0 },
3974 /* PREFIX_0FAE_REG_2 */
3977 { "wrfsbase", { Ev }, 0 },
3980 /* PREFIX_0FAE_REG_3 */
3983 { "wrgsbase", { Ev }, 0 },
3986 /* PREFIX_MOD_0_0FAE_REG_4 */
3988 { "xsave", { FXSAVE }, 0 },
3989 { "ptwrite%LQ", { Edq }, 0 },
3992 /* PREFIX_MOD_3_0FAE_REG_4 */
3995 { "ptwrite%LQ", { Edq }, 0 },
3998 /* PREFIX_MOD_0_0FAE_REG_5 */
4000 { "xrstor", { FXSAVE }, PREFIX_OPCODE },
4003 /* PREFIX_MOD_3_0FAE_REG_5 */
4005 { "lfence", { Skip_MODRM }, 0 },
4006 { "incsspK", { Rdq }, PREFIX_OPCODE },
4009 /* PREFIX_MOD_0_0FAE_REG_6 */
4011 { "xsaveopt", { FXSAVE }, PREFIX_OPCODE },
4012 { "clrssbsy", { Mq }, PREFIX_OPCODE },
4013 { "clwb", { Mb }, PREFIX_OPCODE },
4016 /* PREFIX_MOD_1_0FAE_REG_6 */
4018 { RM_TABLE (RM_0FAE_REG_6) },
4019 { "umonitor", { Eva }, PREFIX_OPCODE },
4020 { "tpause", { Edq }, PREFIX_OPCODE },
4021 { "umwait", { Edq }, PREFIX_OPCODE },
4024 /* PREFIX_0FAE_REG_7 */
4026 { "clflush", { Mb }, 0 },
4028 { "clflushopt", { Mb }, 0 },
4034 { "popcntS", { Gv, Ev }, 0 },
4039 { "bsfS", { Gv, Ev }, 0 },
4040 { "tzcntS", { Gv, Ev }, 0 },
4041 { "bsfS", { Gv, Ev }, 0 },
4046 { "bsrS", { Gv, Ev }, 0 },
4047 { "lzcntS", { Gv, Ev }, 0 },
4048 { "bsrS", { Gv, Ev }, 0 },
4053 { "cmpps", { XM, EXx, CMP }, PREFIX_OPCODE },
4054 { "cmpss", { XM, EXd, CMP }, PREFIX_OPCODE },
4055 { "cmppd", { XM, EXx, CMP }, PREFIX_OPCODE },
4056 { "cmpsd", { XM, EXq, CMP }, PREFIX_OPCODE },
4059 /* PREFIX_MOD_0_0FC3 */
4061 { "movntiS", { Edq, Gdq }, PREFIX_OPCODE },
4064 /* PREFIX_MOD_0_0FC7_REG_6 */
4066 { "vmptrld",{ Mq }, 0 },
4067 { "vmxon", { Mq }, 0 },
4068 { "vmclear",{ Mq }, 0 },
4071 /* PREFIX_MOD_3_0FC7_REG_6 */
4073 { "rdrand", { Ev }, 0 },
4075 { "rdrand", { Ev }, 0 }
4078 /* PREFIX_MOD_3_0FC7_REG_7 */
4080 { "rdseed", { Ev }, 0 },
4081 { "rdpid", { Em }, 0 },
4082 { "rdseed", { Ev }, 0 },
4089 { "addsubpd", { XM, EXx }, 0 },
4090 { "addsubps", { XM, EXx }, 0 },
4096 { "movq2dq",{ XM, MS }, 0 },
4097 { "movq", { EXqS, XM }, 0 },
4098 { "movdq2q",{ MX, XS }, 0 },
4104 { "cvtdq2pd", { XM, EXq }, PREFIX_OPCODE },
4105 { "cvttpd2dq", { XM, EXx }, PREFIX_OPCODE },
4106 { "cvtpd2dq", { XM, EXx }, PREFIX_OPCODE },
4111 { "movntq", { Mq, MX }, PREFIX_OPCODE },
4113 { MOD_TABLE (MOD_0FE7_PREFIX_2) },
4121 { MOD_TABLE (MOD_0FF0_PREFIX_3) },
4126 { "maskmovq", { MX, MS }, PREFIX_OPCODE },
4128 { "maskmovdqu", { XM, XS }, PREFIX_OPCODE },
4135 { "pblendvb", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4142 { "blendvps", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4149 { "blendvpd", { XM, EXx, XMM0 }, PREFIX_OPCODE },
4156 { "ptest", { XM, EXx }, PREFIX_OPCODE },
4163 { "pmovsxbw", { XM, EXq }, PREFIX_OPCODE },
4170 { "pmovsxbd", { XM, EXd }, PREFIX_OPCODE },
4177 { "pmovsxbq", { XM, EXw }, PREFIX_OPCODE },
4184 { "pmovsxwd", { XM, EXq }, PREFIX_OPCODE },
4191 { "pmovsxwq", { XM, EXd }, PREFIX_OPCODE },
4198 { "pmovsxdq", { XM, EXq }, PREFIX_OPCODE },
4205 { "pmuldq", { XM, EXx }, PREFIX_OPCODE },
4212 { "pcmpeqq", { XM, EXx }, PREFIX_OPCODE },
4219 { MOD_TABLE (MOD_0F382A_PREFIX_2) },
4226 { "packusdw", { XM, EXx }, PREFIX_OPCODE },
4233 { "pmovzxbw", { XM, EXq }, PREFIX_OPCODE },
4240 { "pmovzxbd", { XM, EXd }, PREFIX_OPCODE },
4247 { "pmovzxbq", { XM, EXw }, PREFIX_OPCODE },
4254 { "pmovzxwd", { XM, EXq }, PREFIX_OPCODE },
4261 { "pmovzxwq", { XM, EXd }, PREFIX_OPCODE },
4268 { "pmovzxdq", { XM, EXq }, PREFIX_OPCODE },
4275 { "pcmpgtq", { XM, EXx }, PREFIX_OPCODE },
4282 { "pminsb", { XM, EXx }, PREFIX_OPCODE },
4289 { "pminsd", { XM, EXx }, PREFIX_OPCODE },
4296 { "pminuw", { XM, EXx }, PREFIX_OPCODE },
4303 { "pminud", { XM, EXx }, PREFIX_OPCODE },
4310 { "pmaxsb", { XM, EXx }, PREFIX_OPCODE },
4317 { "pmaxsd", { XM, EXx }, PREFIX_OPCODE },
4324 { "pmaxuw", { XM, EXx }, PREFIX_OPCODE },
4331 { "pmaxud", { XM, EXx }, PREFIX_OPCODE },
4338 { "pmulld", { XM, EXx }, PREFIX_OPCODE },
4345 { "phminposuw", { XM, EXx }, PREFIX_OPCODE },
4352 { "invept", { Gm, Mo }, PREFIX_OPCODE },
4359 { "invvpid", { Gm, Mo }, PREFIX_OPCODE },
4366 { "invpcid", { Gm, M }, PREFIX_OPCODE },
4371 { "sha1nexte", { XM, EXxmm }, PREFIX_OPCODE },
4376 { "sha1msg1", { XM, EXxmm }, PREFIX_OPCODE },
4381 { "sha1msg2", { XM, EXxmm }, PREFIX_OPCODE },
4386 { "sha256rnds2", { XM, EXxmm, XMM0 }, PREFIX_OPCODE },
4391 { "sha256msg1", { XM, EXxmm }, PREFIX_OPCODE },
4396 { "sha256msg2", { XM, EXxmm }, PREFIX_OPCODE },
4403 { "gf2p8mulb", { XM, EXxmm }, PREFIX_OPCODE },
4410 { "aesimc", { XM, EXx }, PREFIX_OPCODE },
4417 { "aesenc", { XM, EXx }, PREFIX_OPCODE },
4424 { "aesenclast", { XM, EXx }, PREFIX_OPCODE },
4431 { "aesdec", { XM, EXx }, PREFIX_OPCODE },
4438 { "aesdeclast", { XM, EXx }, PREFIX_OPCODE },
4443 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4445 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4446 { "crc32", { Gdq, { CRC32_Fixup, b_mode } }, PREFIX_OPCODE },
4451 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4453 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4454 { "crc32", { Gdq, { CRC32_Fixup, v_mode } }, PREFIX_OPCODE },
4461 { MOD_TABLE (MOD_0F38F5_PREFIX_2) },
4466 { MOD_TABLE (MOD_0F38F6_PREFIX_0) },
4467 { "adoxS", { Gdq, Edq}, PREFIX_OPCODE },
4468 { "adcxS", { Gdq, Edq}, PREFIX_OPCODE },
4475 { MOD_TABLE (MOD_0F38F8_PREFIX_1) },
4476 { MOD_TABLE (MOD_0F38F8_PREFIX_2) },
4477 { MOD_TABLE (MOD_0F38F8_PREFIX_3) },
4482 { MOD_TABLE (MOD_0F38F9_PREFIX_0) },
4489 { "roundps", { XM, EXx, Ib }, PREFIX_OPCODE },
4496 { "roundpd", { XM, EXx, Ib }, PREFIX_OPCODE },
4503 { "roundss", { XM, EXd, Ib }, PREFIX_OPCODE },
4510 { "roundsd", { XM, EXq, Ib }, PREFIX_OPCODE },
4517 { "blendps", { XM, EXx, Ib }, PREFIX_OPCODE },
4524 { "blendpd", { XM, EXx, Ib }, PREFIX_OPCODE },
4531 { "pblendw", { XM, EXx, Ib }, PREFIX_OPCODE },
4538 { "pextrb", { Edqb, XM, Ib }, PREFIX_OPCODE },
4545 { "pextrw", { Edqw, XM, Ib }, PREFIX_OPCODE },
4552 { "pextrK", { Edq, XM, Ib }, PREFIX_OPCODE },
4559 { "extractps", { Edqd, XM, Ib }, PREFIX_OPCODE },
4566 { "pinsrb", { XM, Edqb, Ib }, PREFIX_OPCODE },
4573 { "insertps", { XM, EXd, Ib }, PREFIX_OPCODE },
4580 { "pinsrK", { XM, Edq, Ib }, PREFIX_OPCODE },
4587 { "dpps", { XM, EXx, Ib }, PREFIX_OPCODE },
4594 { "dppd", { XM, EXx, Ib }, PREFIX_OPCODE },
4601 { "mpsadbw", { XM, EXx, Ib }, PREFIX_OPCODE },
4608 { "pclmulqdq", { XM, EXx, PCLMUL }, PREFIX_OPCODE },
4615 { "pcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
4622 { "pcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
4629 { "pcmpistrm", { XM, EXx, Ib }, PREFIX_OPCODE },
4636 { "pcmpistri", { XM, EXx, Ib }, PREFIX_OPCODE },
4641 { "sha1rnds4", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4648 { "gf2p8affineqb", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4655 { "gf2p8affineinvqb", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4662 { "aeskeygenassist", { XM, EXx, Ib }, PREFIX_OPCODE },
4665 /* PREFIX_VEX_0F10 */
4667 { "vmovups", { XM, EXx }, 0 },
4668 { "vmovss", { XMVexScalar, VexScalar, EXdScalar }, 0 },
4669 { "vmovupd", { XM, EXx }, 0 },
4670 { "vmovsd", { XMVexScalar, VexScalar, EXqScalar }, 0 },
4673 /* PREFIX_VEX_0F11 */
4675 { "vmovups", { EXxS, XM }, 0 },
4676 { "vmovss", { EXdVexScalarS, VexScalar, XMScalar }, 0 },
4677 { "vmovupd", { EXxS, XM }, 0 },
4678 { "vmovsd", { EXqVexScalarS, VexScalar, XMScalar }, 0 },
4681 /* PREFIX_VEX_0F12 */
4683 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0) },
4684 { "vmovsldup", { XM, EXx }, 0 },
4685 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2) },
4686 { "vmovddup", { XM, EXymmq }, 0 },
4689 /* PREFIX_VEX_0F16 */
4691 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0) },
4692 { "vmovshdup", { XM, EXx }, 0 },
4693 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2) },
4696 /* PREFIX_VEX_0F2A */
4699 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_1) },
4701 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_3) },
4704 /* PREFIX_VEX_0F2C */
4707 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_1) },
4709 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_3) },
4712 /* PREFIX_VEX_0F2D */
4715 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_1) },
4717 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_3) },
4720 /* PREFIX_VEX_0F2E */
4722 { "vucomiss", { XMScalar, EXdScalar }, 0 },
4724 { "vucomisd", { XMScalar, EXqScalar }, 0 },
4727 /* PREFIX_VEX_0F2F */
4729 { "vcomiss", { XMScalar, EXdScalar }, 0 },
4731 { "vcomisd", { XMScalar, EXqScalar }, 0 },
4734 /* PREFIX_VEX_0F41 */
4736 { VEX_LEN_TABLE (VEX_LEN_0F41_P_0) },
4738 { VEX_LEN_TABLE (VEX_LEN_0F41_P_2) },
4741 /* PREFIX_VEX_0F42 */
4743 { VEX_LEN_TABLE (VEX_LEN_0F42_P_0) },
4745 { VEX_LEN_TABLE (VEX_LEN_0F42_P_2) },
4748 /* PREFIX_VEX_0F44 */
4750 { VEX_LEN_TABLE (VEX_LEN_0F44_P_0) },
4752 { VEX_LEN_TABLE (VEX_LEN_0F44_P_2) },
4755 /* PREFIX_VEX_0F45 */
4757 { VEX_LEN_TABLE (VEX_LEN_0F45_P_0) },
4759 { VEX_LEN_TABLE (VEX_LEN_0F45_P_2) },
4762 /* PREFIX_VEX_0F46 */
4764 { VEX_LEN_TABLE (VEX_LEN_0F46_P_0) },
4766 { VEX_LEN_TABLE (VEX_LEN_0F46_P_2) },
4769 /* PREFIX_VEX_0F47 */
4771 { VEX_LEN_TABLE (VEX_LEN_0F47_P_0) },
4773 { VEX_LEN_TABLE (VEX_LEN_0F47_P_2) },
4776 /* PREFIX_VEX_0F4A */
4778 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_0) },
4780 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_2) },
4783 /* PREFIX_VEX_0F4B */
4785 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_0) },
4787 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_2) },
4790 /* PREFIX_VEX_0F51 */
4792 { "vsqrtps", { XM, EXx }, 0 },
4793 { "vsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
4794 { "vsqrtpd", { XM, EXx }, 0 },
4795 { "vsqrtsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4798 /* PREFIX_VEX_0F52 */
4800 { "vrsqrtps", { XM, EXx }, 0 },
4801 { "vrsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
4804 /* PREFIX_VEX_0F53 */
4806 { "vrcpps", { XM, EXx }, 0 },
4807 { "vrcpss", { XMScalar, VexScalar, EXdScalar }, 0 },
4810 /* PREFIX_VEX_0F58 */
4812 { "vaddps", { XM, Vex, EXx }, 0 },
4813 { "vaddss", { XMScalar, VexScalar, EXdScalar }, 0 },
4814 { "vaddpd", { XM, Vex, EXx }, 0 },
4815 { "vaddsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4818 /* PREFIX_VEX_0F59 */
4820 { "vmulps", { XM, Vex, EXx }, 0 },
4821 { "vmulss", { XMScalar, VexScalar, EXdScalar }, 0 },
4822 { "vmulpd", { XM, Vex, EXx }, 0 },
4823 { "vmulsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4826 /* PREFIX_VEX_0F5A */
4828 { "vcvtps2pd", { XM, EXxmmq }, 0 },
4829 { "vcvtss2sd", { XMScalar, VexScalar, EXdScalar }, 0 },
4830 { "vcvtpd2ps%XY",{ XMM, EXx }, 0 },
4831 { "vcvtsd2ss", { XMScalar, VexScalar, EXqScalar }, 0 },
4834 /* PREFIX_VEX_0F5B */
4836 { "vcvtdq2ps", { XM, EXx }, 0 },
4837 { "vcvttps2dq", { XM, EXx }, 0 },
4838 { "vcvtps2dq", { XM, EXx }, 0 },
4841 /* PREFIX_VEX_0F5C */
4843 { "vsubps", { XM, Vex, EXx }, 0 },
4844 { "vsubss", { XMScalar, VexScalar, EXdScalar }, 0 },
4845 { "vsubpd", { XM, Vex, EXx }, 0 },
4846 { "vsubsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4849 /* PREFIX_VEX_0F5D */
4851 { "vminps", { XM, Vex, EXx }, 0 },
4852 { "vminss", { XMScalar, VexScalar, EXdScalar }, 0 },
4853 { "vminpd", { XM, Vex, EXx }, 0 },
4854 { "vminsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4857 /* PREFIX_VEX_0F5E */
4859 { "vdivps", { XM, Vex, EXx }, 0 },
4860 { "vdivss", { XMScalar, VexScalar, EXdScalar }, 0 },
4861 { "vdivpd", { XM, Vex, EXx }, 0 },
4862 { "vdivsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4865 /* PREFIX_VEX_0F5F */
4867 { "vmaxps", { XM, Vex, EXx }, 0 },
4868 { "vmaxss", { XMScalar, VexScalar, EXdScalar }, 0 },
4869 { "vmaxpd", { XM, Vex, EXx }, 0 },
4870 { "vmaxsd", { XMScalar, VexScalar, EXqScalar }, 0 },
4873 /* PREFIX_VEX_0F60 */
4877 { "vpunpcklbw", { XM, Vex, EXx }, 0 },
4880 /* PREFIX_VEX_0F61 */
4884 { "vpunpcklwd", { XM, Vex, EXx }, 0 },
4887 /* PREFIX_VEX_0F62 */
4891 { "vpunpckldq", { XM, Vex, EXx }, 0 },
4894 /* PREFIX_VEX_0F63 */
4898 { "vpacksswb", { XM, Vex, EXx }, 0 },
4901 /* PREFIX_VEX_0F64 */
4905 { "vpcmpgtb", { XM, Vex, EXx }, 0 },
4908 /* PREFIX_VEX_0F65 */
4912 { "vpcmpgtw", { XM, Vex, EXx }, 0 },
4915 /* PREFIX_VEX_0F66 */
4919 { "vpcmpgtd", { XM, Vex, EXx }, 0 },
4922 /* PREFIX_VEX_0F67 */
4926 { "vpackuswb", { XM, Vex, EXx }, 0 },
4929 /* PREFIX_VEX_0F68 */
4933 { "vpunpckhbw", { XM, Vex, EXx }, 0 },
4936 /* PREFIX_VEX_0F69 */
4940 { "vpunpckhwd", { XM, Vex, EXx }, 0 },
4943 /* PREFIX_VEX_0F6A */
4947 { "vpunpckhdq", { XM, Vex, EXx }, 0 },
4950 /* PREFIX_VEX_0F6B */
4954 { "vpackssdw", { XM, Vex, EXx }, 0 },
4957 /* PREFIX_VEX_0F6C */
4961 { "vpunpcklqdq", { XM, Vex, EXx }, 0 },
4964 /* PREFIX_VEX_0F6D */
4968 { "vpunpckhqdq", { XM, Vex, EXx }, 0 },
4971 /* PREFIX_VEX_0F6E */
4975 { VEX_LEN_TABLE (VEX_LEN_0F6E_P_2) },
4978 /* PREFIX_VEX_0F6F */
4981 { "vmovdqu", { XM, EXx }, 0 },
4982 { "vmovdqa", { XM, EXx }, 0 },
4985 /* PREFIX_VEX_0F70 */
4988 { "vpshufhw", { XM, EXx, Ib }, 0 },
4989 { "vpshufd", { XM, EXx, Ib }, 0 },
4990 { "vpshuflw", { XM, EXx, Ib }, 0 },
4993 /* PREFIX_VEX_0F71_REG_2 */
4997 { "vpsrlw", { Vex, XS, Ib }, 0 },
5000 /* PREFIX_VEX_0F71_REG_4 */
5004 { "vpsraw", { Vex, XS, Ib }, 0 },
5007 /* PREFIX_VEX_0F71_REG_6 */
5011 { "vpsllw", { Vex, XS, Ib }, 0 },
5014 /* PREFIX_VEX_0F72_REG_2 */
5018 { "vpsrld", { Vex, XS, Ib }, 0 },
5021 /* PREFIX_VEX_0F72_REG_4 */
5025 { "vpsrad", { Vex, XS, Ib }, 0 },
5028 /* PREFIX_VEX_0F72_REG_6 */
5032 { "vpslld", { Vex, XS, Ib }, 0 },
5035 /* PREFIX_VEX_0F73_REG_2 */
5039 { "vpsrlq", { Vex, XS, Ib }, 0 },
5042 /* PREFIX_VEX_0F73_REG_3 */
5046 { "vpsrldq", { Vex, XS, Ib }, 0 },
5049 /* PREFIX_VEX_0F73_REG_6 */
5053 { "vpsllq", { Vex, XS, Ib }, 0 },
5056 /* PREFIX_VEX_0F73_REG_7 */
5060 { "vpslldq", { Vex, XS, Ib }, 0 },
5063 /* PREFIX_VEX_0F74 */
5067 { "vpcmpeqb", { XM, Vex, EXx }, 0 },
5070 /* PREFIX_VEX_0F75 */
5074 { "vpcmpeqw", { XM, Vex, EXx }, 0 },
5077 /* PREFIX_VEX_0F76 */
5081 { "vpcmpeqd", { XM, Vex, EXx }, 0 },
5084 /* PREFIX_VEX_0F77 */
5086 { VEX_LEN_TABLE (VEX_LEN_0F77_P_0) },
5089 /* PREFIX_VEX_0F7C */
5093 { "vhaddpd", { XM, Vex, EXx }, 0 },
5094 { "vhaddps", { XM, Vex, EXx }, 0 },
5097 /* PREFIX_VEX_0F7D */
5101 { "vhsubpd", { XM, Vex, EXx }, 0 },
5102 { "vhsubps", { XM, Vex, EXx }, 0 },
5105 /* PREFIX_VEX_0F7E */
5108 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1) },
5109 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2) },
5112 /* PREFIX_VEX_0F7F */
5115 { "vmovdqu", { EXxS, XM }, 0 },
5116 { "vmovdqa", { EXxS, XM }, 0 },
5119 /* PREFIX_VEX_0F90 */
5121 { VEX_LEN_TABLE (VEX_LEN_0F90_P_0) },
5123 { VEX_LEN_TABLE (VEX_LEN_0F90_P_2) },
5126 /* PREFIX_VEX_0F91 */
5128 { VEX_LEN_TABLE (VEX_LEN_0F91_P_0) },
5130 { VEX_LEN_TABLE (VEX_LEN_0F91_P_2) },
5133 /* PREFIX_VEX_0F92 */
5135 { VEX_LEN_TABLE (VEX_LEN_0F92_P_0) },
5137 { VEX_LEN_TABLE (VEX_LEN_0F92_P_2) },
5138 { VEX_LEN_TABLE (VEX_LEN_0F92_P_3) },
5141 /* PREFIX_VEX_0F93 */
5143 { VEX_LEN_TABLE (VEX_LEN_0F93_P_0) },
5145 { VEX_LEN_TABLE (VEX_LEN_0F93_P_2) },
5146 { VEX_LEN_TABLE (VEX_LEN_0F93_P_3) },
5149 /* PREFIX_VEX_0F98 */
5151 { VEX_LEN_TABLE (VEX_LEN_0F98_P_0) },
5153 { VEX_LEN_TABLE (VEX_LEN_0F98_P_2) },
5156 /* PREFIX_VEX_0F99 */
5158 { VEX_LEN_TABLE (VEX_LEN_0F99_P_0) },
5160 { VEX_LEN_TABLE (VEX_LEN_0F99_P_2) },
5163 /* PREFIX_VEX_0FC2 */
5165 { "vcmpps", { XM, Vex, EXx, VCMP }, 0 },
5166 { "vcmpss", { XMScalar, VexScalar, EXdScalar, VCMP }, 0 },
5167 { "vcmppd", { XM, Vex, EXx, VCMP }, 0 },
5168 { "vcmpsd", { XMScalar, VexScalar, EXqScalar, VCMP }, 0 },
5171 /* PREFIX_VEX_0FC4 */
5175 { VEX_LEN_TABLE (VEX_LEN_0FC4_P_2) },
5178 /* PREFIX_VEX_0FC5 */
5182 { VEX_LEN_TABLE (VEX_LEN_0FC5_P_2) },
5185 /* PREFIX_VEX_0FD0 */
5189 { "vaddsubpd", { XM, Vex, EXx }, 0 },
5190 { "vaddsubps", { XM, Vex, EXx }, 0 },
5193 /* PREFIX_VEX_0FD1 */
5197 { "vpsrlw", { XM, Vex, EXxmm }, 0 },
5200 /* PREFIX_VEX_0FD2 */
5204 { "vpsrld", { XM, Vex, EXxmm }, 0 },
5207 /* PREFIX_VEX_0FD3 */
5211 { "vpsrlq", { XM, Vex, EXxmm }, 0 },
5214 /* PREFIX_VEX_0FD4 */
5218 { "vpaddq", { XM, Vex, EXx }, 0 },
5221 /* PREFIX_VEX_0FD5 */
5225 { "vpmullw", { XM, Vex, EXx }, 0 },
5228 /* PREFIX_VEX_0FD6 */
5232 { VEX_LEN_TABLE (VEX_LEN_0FD6_P_2) },
5235 /* PREFIX_VEX_0FD7 */
5239 { MOD_TABLE (MOD_VEX_0FD7_PREFIX_2) },
5242 /* PREFIX_VEX_0FD8 */
5246 { "vpsubusb", { XM, Vex, EXx }, 0 },
5249 /* PREFIX_VEX_0FD9 */
5253 { "vpsubusw", { XM, Vex, EXx }, 0 },
5256 /* PREFIX_VEX_0FDA */
5260 { "vpminub", { XM, Vex, EXx }, 0 },
5263 /* PREFIX_VEX_0FDB */
5267 { "vpand", { XM, Vex, EXx }, 0 },
5270 /* PREFIX_VEX_0FDC */
5274 { "vpaddusb", { XM, Vex, EXx }, 0 },
5277 /* PREFIX_VEX_0FDD */
5281 { "vpaddusw", { XM, Vex, EXx }, 0 },
5284 /* PREFIX_VEX_0FDE */
5288 { "vpmaxub", { XM, Vex, EXx }, 0 },
5291 /* PREFIX_VEX_0FDF */
5295 { "vpandn", { XM, Vex, EXx }, 0 },
5298 /* PREFIX_VEX_0FE0 */
5302 { "vpavgb", { XM, Vex, EXx }, 0 },
5305 /* PREFIX_VEX_0FE1 */
5309 { "vpsraw", { XM, Vex, EXxmm }, 0 },
5312 /* PREFIX_VEX_0FE2 */
5316 { "vpsrad", { XM, Vex, EXxmm }, 0 },
5319 /* PREFIX_VEX_0FE3 */
5323 { "vpavgw", { XM, Vex, EXx }, 0 },
5326 /* PREFIX_VEX_0FE4 */
5330 { "vpmulhuw", { XM, Vex, EXx }, 0 },
5333 /* PREFIX_VEX_0FE5 */
5337 { "vpmulhw", { XM, Vex, EXx }, 0 },
5340 /* PREFIX_VEX_0FE6 */
5343 { "vcvtdq2pd", { XM, EXxmmq }, 0 },
5344 { "vcvttpd2dq%XY", { XMM, EXx }, 0 },
5345 { "vcvtpd2dq%XY", { XMM, EXx }, 0 },
5348 /* PREFIX_VEX_0FE7 */
5352 { MOD_TABLE (MOD_VEX_0FE7_PREFIX_2) },
5355 /* PREFIX_VEX_0FE8 */
5359 { "vpsubsb", { XM, Vex, EXx }, 0 },
5362 /* PREFIX_VEX_0FE9 */
5366 { "vpsubsw", { XM, Vex, EXx }, 0 },
5369 /* PREFIX_VEX_0FEA */
5373 { "vpminsw", { XM, Vex, EXx }, 0 },
5376 /* PREFIX_VEX_0FEB */
5380 { "vpor", { XM, Vex, EXx }, 0 },
5383 /* PREFIX_VEX_0FEC */
5387 { "vpaddsb", { XM, Vex, EXx }, 0 },
5390 /* PREFIX_VEX_0FED */
5394 { "vpaddsw", { XM, Vex, EXx }, 0 },
5397 /* PREFIX_VEX_0FEE */
5401 { "vpmaxsw", { XM, Vex, EXx }, 0 },
5404 /* PREFIX_VEX_0FEF */
5408 { "vpxor", { XM, Vex, EXx }, 0 },
5411 /* PREFIX_VEX_0FF0 */
5416 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3) },
5419 /* PREFIX_VEX_0FF1 */
5423 { "vpsllw", { XM, Vex, EXxmm }, 0 },
5426 /* PREFIX_VEX_0FF2 */
5430 { "vpslld", { XM, Vex, EXxmm }, 0 },
5433 /* PREFIX_VEX_0FF3 */
5437 { "vpsllq", { XM, Vex, EXxmm }, 0 },
5440 /* PREFIX_VEX_0FF4 */
5444 { "vpmuludq", { XM, Vex, EXx }, 0 },
5447 /* PREFIX_VEX_0FF5 */
5451 { "vpmaddwd", { XM, Vex, EXx }, 0 },
5454 /* PREFIX_VEX_0FF6 */
5458 { "vpsadbw", { XM, Vex, EXx }, 0 },
5461 /* PREFIX_VEX_0FF7 */
5465 { VEX_LEN_TABLE (VEX_LEN_0FF7_P_2) },
5468 /* PREFIX_VEX_0FF8 */
5472 { "vpsubb", { XM, Vex, EXx }, 0 },
5475 /* PREFIX_VEX_0FF9 */
5479 { "vpsubw", { XM, Vex, EXx }, 0 },
5482 /* PREFIX_VEX_0FFA */
5486 { "vpsubd", { XM, Vex, EXx }, 0 },
5489 /* PREFIX_VEX_0FFB */
5493 { "vpsubq", { XM, Vex, EXx }, 0 },
5496 /* PREFIX_VEX_0FFC */
5500 { "vpaddb", { XM, Vex, EXx }, 0 },
5503 /* PREFIX_VEX_0FFD */
5507 { "vpaddw", { XM, Vex, EXx }, 0 },
5510 /* PREFIX_VEX_0FFE */
5514 { "vpaddd", { XM, Vex, EXx }, 0 },
5517 /* PREFIX_VEX_0F3800 */
5521 { "vpshufb", { XM, Vex, EXx }, 0 },
5524 /* PREFIX_VEX_0F3801 */
5528 { "vphaddw", { XM, Vex, EXx }, 0 },
5531 /* PREFIX_VEX_0F3802 */
5535 { "vphaddd", { XM, Vex, EXx }, 0 },
5538 /* PREFIX_VEX_0F3803 */
5542 { "vphaddsw", { XM, Vex, EXx }, 0 },
5545 /* PREFIX_VEX_0F3804 */
5549 { "vpmaddubsw", { XM, Vex, EXx }, 0 },
5552 /* PREFIX_VEX_0F3805 */
5556 { "vphsubw", { XM, Vex, EXx }, 0 },
5559 /* PREFIX_VEX_0F3806 */
5563 { "vphsubd", { XM, Vex, EXx }, 0 },
5566 /* PREFIX_VEX_0F3807 */
5570 { "vphsubsw", { XM, Vex, EXx }, 0 },
5573 /* PREFIX_VEX_0F3808 */
5577 { "vpsignb", { XM, Vex, EXx }, 0 },
5580 /* PREFIX_VEX_0F3809 */
5584 { "vpsignw", { XM, Vex, EXx }, 0 },
5587 /* PREFIX_VEX_0F380A */
5591 { "vpsignd", { XM, Vex, EXx }, 0 },
5594 /* PREFIX_VEX_0F380B */
5598 { "vpmulhrsw", { XM, Vex, EXx }, 0 },
5601 /* PREFIX_VEX_0F380C */
5605 { VEX_W_TABLE (VEX_W_0F380C_P_2) },
5608 /* PREFIX_VEX_0F380D */
5612 { VEX_W_TABLE (VEX_W_0F380D_P_2) },
5615 /* PREFIX_VEX_0F380E */
5619 { VEX_W_TABLE (VEX_W_0F380E_P_2) },
5622 /* PREFIX_VEX_0F380F */
5626 { VEX_W_TABLE (VEX_W_0F380F_P_2) },
5629 /* PREFIX_VEX_0F3813 */
5633 { "vcvtph2ps", { XM, EXxmmq }, 0 },
5636 /* PREFIX_VEX_0F3816 */
5640 { VEX_LEN_TABLE (VEX_LEN_0F3816_P_2) },
5643 /* PREFIX_VEX_0F3817 */
5647 { "vptest", { XM, EXx }, 0 },
5650 /* PREFIX_VEX_0F3818 */
5654 { VEX_W_TABLE (VEX_W_0F3818_P_2) },
5657 /* PREFIX_VEX_0F3819 */
5661 { VEX_LEN_TABLE (VEX_LEN_0F3819_P_2) },
5664 /* PREFIX_VEX_0F381A */
5668 { MOD_TABLE (MOD_VEX_0F381A_PREFIX_2) },
5671 /* PREFIX_VEX_0F381C */
5675 { "vpabsb", { XM, EXx }, 0 },
5678 /* PREFIX_VEX_0F381D */
5682 { "vpabsw", { XM, EXx }, 0 },
5685 /* PREFIX_VEX_0F381E */
5689 { "vpabsd", { XM, EXx }, 0 },
5692 /* PREFIX_VEX_0F3820 */
5696 { "vpmovsxbw", { XM, EXxmmq }, 0 },
5699 /* PREFIX_VEX_0F3821 */
5703 { "vpmovsxbd", { XM, EXxmmqd }, 0 },
5706 /* PREFIX_VEX_0F3822 */
5710 { "vpmovsxbq", { XM, EXxmmdw }, 0 },
5713 /* PREFIX_VEX_0F3823 */
5717 { "vpmovsxwd", { XM, EXxmmq }, 0 },
5720 /* PREFIX_VEX_0F3824 */
5724 { "vpmovsxwq", { XM, EXxmmqd }, 0 },
5727 /* PREFIX_VEX_0F3825 */
5731 { "vpmovsxdq", { XM, EXxmmq }, 0 },
5734 /* PREFIX_VEX_0F3828 */
5738 { "vpmuldq", { XM, Vex, EXx }, 0 },
5741 /* PREFIX_VEX_0F3829 */
5745 { "vpcmpeqq", { XM, Vex, EXx }, 0 },
5748 /* PREFIX_VEX_0F382A */
5752 { MOD_TABLE (MOD_VEX_0F382A_PREFIX_2) },
5755 /* PREFIX_VEX_0F382B */
5759 { "vpackusdw", { XM, Vex, EXx }, 0 },
5762 /* PREFIX_VEX_0F382C */
5766 { MOD_TABLE (MOD_VEX_0F382C_PREFIX_2) },
5769 /* PREFIX_VEX_0F382D */
5773 { MOD_TABLE (MOD_VEX_0F382D_PREFIX_2) },
5776 /* PREFIX_VEX_0F382E */
5780 { MOD_TABLE (MOD_VEX_0F382E_PREFIX_2) },
5783 /* PREFIX_VEX_0F382F */
5787 { MOD_TABLE (MOD_VEX_0F382F_PREFIX_2) },
5790 /* PREFIX_VEX_0F3830 */
5794 { "vpmovzxbw", { XM, EXxmmq }, 0 },
5797 /* PREFIX_VEX_0F3831 */
5801 { "vpmovzxbd", { XM, EXxmmqd }, 0 },
5804 /* PREFIX_VEX_0F3832 */
5808 { "vpmovzxbq", { XM, EXxmmdw }, 0 },
5811 /* PREFIX_VEX_0F3833 */
5815 { "vpmovzxwd", { XM, EXxmmq }, 0 },
5818 /* PREFIX_VEX_0F3834 */
5822 { "vpmovzxwq", { XM, EXxmmqd }, 0 },
5825 /* PREFIX_VEX_0F3835 */
5829 { "vpmovzxdq", { XM, EXxmmq }, 0 },
5832 /* PREFIX_VEX_0F3836 */
5836 { VEX_LEN_TABLE (VEX_LEN_0F3836_P_2) },
5839 /* PREFIX_VEX_0F3837 */
5843 { "vpcmpgtq", { XM, Vex, EXx }, 0 },
5846 /* PREFIX_VEX_0F3838 */
5850 { "vpminsb", { XM, Vex, EXx }, 0 },
5853 /* PREFIX_VEX_0F3839 */
5857 { "vpminsd", { XM, Vex, EXx }, 0 },
5860 /* PREFIX_VEX_0F383A */
5864 { "vpminuw", { XM, Vex, EXx }, 0 },
5867 /* PREFIX_VEX_0F383B */
5871 { "vpminud", { XM, Vex, EXx }, 0 },
5874 /* PREFIX_VEX_0F383C */
5878 { "vpmaxsb", { XM, Vex, EXx }, 0 },
5881 /* PREFIX_VEX_0F383D */
5885 { "vpmaxsd", { XM, Vex, EXx }, 0 },
5888 /* PREFIX_VEX_0F383E */
5892 { "vpmaxuw", { XM, Vex, EXx }, 0 },
5895 /* PREFIX_VEX_0F383F */
5899 { "vpmaxud", { XM, Vex, EXx }, 0 },
5902 /* PREFIX_VEX_0F3840 */
5906 { "vpmulld", { XM, Vex, EXx }, 0 },
5909 /* PREFIX_VEX_0F3841 */
5913 { VEX_LEN_TABLE (VEX_LEN_0F3841_P_2) },
5916 /* PREFIX_VEX_0F3845 */
5920 { "vpsrlv%LW", { XM, Vex, EXx }, 0 },
5923 /* PREFIX_VEX_0F3846 */
5927 { VEX_W_TABLE (VEX_W_0F3846_P_2) },
5930 /* PREFIX_VEX_0F3847 */
5934 { "vpsllv%LW", { XM, Vex, EXx }, 0 },
5937 /* PREFIX_VEX_0F3858 */
5941 { VEX_W_TABLE (VEX_W_0F3858_P_2) },
5944 /* PREFIX_VEX_0F3859 */
5948 { VEX_W_TABLE (VEX_W_0F3859_P_2) },
5951 /* PREFIX_VEX_0F385A */
5955 { MOD_TABLE (MOD_VEX_0F385A_PREFIX_2) },
5958 /* PREFIX_VEX_0F3878 */
5962 { VEX_W_TABLE (VEX_W_0F3878_P_2) },
5965 /* PREFIX_VEX_0F3879 */
5969 { VEX_W_TABLE (VEX_W_0F3879_P_2) },
5972 /* PREFIX_VEX_0F388C */
5976 { MOD_TABLE (MOD_VEX_0F388C_PREFIX_2) },
5979 /* PREFIX_VEX_0F388E */
5983 { MOD_TABLE (MOD_VEX_0F388E_PREFIX_2) },
5986 /* PREFIX_VEX_0F3890 */
5990 { "vpgatherd%LW", { XM, MVexVSIBDWpX, Vex }, 0 },
5993 /* PREFIX_VEX_0F3891 */
5997 { "vpgatherq%LW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
6000 /* PREFIX_VEX_0F3892 */
6004 { "vgatherdp%XW", { XM, MVexVSIBDWpX, Vex }, 0 },
6007 /* PREFIX_VEX_0F3893 */
6011 { "vgatherqp%XW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
6014 /* PREFIX_VEX_0F3896 */
6018 { "vfmaddsub132p%XW", { XM, Vex, EXx }, 0 },
6021 /* PREFIX_VEX_0F3897 */
6025 { "vfmsubadd132p%XW", { XM, Vex, EXx }, 0 },
6028 /* PREFIX_VEX_0F3898 */
6032 { "vfmadd132p%XW", { XM, Vex, EXx }, 0 },
6035 /* PREFIX_VEX_0F3899 */
6039 { "vfmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6042 /* PREFIX_VEX_0F389A */
6046 { "vfmsub132p%XW", { XM, Vex, EXx }, 0 },
6049 /* PREFIX_VEX_0F389B */
6053 { "vfmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6056 /* PREFIX_VEX_0F389C */
6060 { "vfnmadd132p%XW", { XM, Vex, EXx }, 0 },
6063 /* PREFIX_VEX_0F389D */
6067 { "vfnmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6070 /* PREFIX_VEX_0F389E */
6074 { "vfnmsub132p%XW", { XM, Vex, EXx }, 0 },
6077 /* PREFIX_VEX_0F389F */
6081 { "vfnmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6084 /* PREFIX_VEX_0F38A6 */
6088 { "vfmaddsub213p%XW", { XM, Vex, EXx }, 0 },
6092 /* PREFIX_VEX_0F38A7 */
6096 { "vfmsubadd213p%XW", { XM, Vex, EXx }, 0 },
6099 /* PREFIX_VEX_0F38A8 */
6103 { "vfmadd213p%XW", { XM, Vex, EXx }, 0 },
6106 /* PREFIX_VEX_0F38A9 */
6110 { "vfmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6113 /* PREFIX_VEX_0F38AA */
6117 { "vfmsub213p%XW", { XM, Vex, EXx }, 0 },
6120 /* PREFIX_VEX_0F38AB */
6124 { "vfmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6127 /* PREFIX_VEX_0F38AC */
6131 { "vfnmadd213p%XW", { XM, Vex, EXx }, 0 },
6134 /* PREFIX_VEX_0F38AD */
6138 { "vfnmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6141 /* PREFIX_VEX_0F38AE */
6145 { "vfnmsub213p%XW", { XM, Vex, EXx }, 0 },
6148 /* PREFIX_VEX_0F38AF */
6152 { "vfnmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6155 /* PREFIX_VEX_0F38B6 */
6159 { "vfmaddsub231p%XW", { XM, Vex, EXx }, 0 },
6162 /* PREFIX_VEX_0F38B7 */
6166 { "vfmsubadd231p%XW", { XM, Vex, EXx }, 0 },
6169 /* PREFIX_VEX_0F38B8 */
6173 { "vfmadd231p%XW", { XM, Vex, EXx }, 0 },
6176 /* PREFIX_VEX_0F38B9 */
6180 { "vfmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6183 /* PREFIX_VEX_0F38BA */
6187 { "vfmsub231p%XW", { XM, Vex, EXx }, 0 },
6190 /* PREFIX_VEX_0F38BB */
6194 { "vfmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6197 /* PREFIX_VEX_0F38BC */
6201 { "vfnmadd231p%XW", { XM, Vex, EXx }, 0 },
6204 /* PREFIX_VEX_0F38BD */
6208 { "vfnmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6211 /* PREFIX_VEX_0F38BE */
6215 { "vfnmsub231p%XW", { XM, Vex, EXx }, 0 },
6218 /* PREFIX_VEX_0F38BF */
6222 { "vfnmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
6225 /* PREFIX_VEX_0F38CF */
6229 { VEX_W_TABLE (VEX_W_0F38CF_P_2) },
6232 /* PREFIX_VEX_0F38DB */
6236 { VEX_LEN_TABLE (VEX_LEN_0F38DB_P_2) },
6239 /* PREFIX_VEX_0F38DC */
6243 { "vaesenc", { XM, Vex, EXx }, 0 },
6246 /* PREFIX_VEX_0F38DD */
6250 { "vaesenclast", { XM, Vex, EXx }, 0 },
6253 /* PREFIX_VEX_0F38DE */
6257 { "vaesdec", { XM, Vex, EXx }, 0 },
6260 /* PREFIX_VEX_0F38DF */
6264 { "vaesdeclast", { XM, Vex, EXx }, 0 },
6267 /* PREFIX_VEX_0F38F2 */
6269 { VEX_LEN_TABLE (VEX_LEN_0F38F2_P_0) },
6272 /* PREFIX_VEX_0F38F3_REG_1 */
6274 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_1_P_0) },
6277 /* PREFIX_VEX_0F38F3_REG_2 */
6279 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_2_P_0) },
6282 /* PREFIX_VEX_0F38F3_REG_3 */
6284 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_3_P_0) },
6287 /* PREFIX_VEX_0F38F5 */
6289 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_0) },
6290 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_1) },
6292 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_3) },
6295 /* PREFIX_VEX_0F38F6 */
6300 { VEX_LEN_TABLE (VEX_LEN_0F38F6_P_3) },
6303 /* PREFIX_VEX_0F38F7 */
6305 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_0) },
6306 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_1) },
6307 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_2) },
6308 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_3) },
6311 /* PREFIX_VEX_0F3A00 */
6315 { VEX_LEN_TABLE (VEX_LEN_0F3A00_P_2) },
6318 /* PREFIX_VEX_0F3A01 */
6322 { VEX_LEN_TABLE (VEX_LEN_0F3A01_P_2) },
6325 /* PREFIX_VEX_0F3A02 */
6329 { VEX_W_TABLE (VEX_W_0F3A02_P_2) },
6332 /* PREFIX_VEX_0F3A04 */
6336 { VEX_W_TABLE (VEX_W_0F3A04_P_2) },
6339 /* PREFIX_VEX_0F3A05 */
6343 { VEX_W_TABLE (VEX_W_0F3A05_P_2) },
6346 /* PREFIX_VEX_0F3A06 */
6350 { VEX_LEN_TABLE (VEX_LEN_0F3A06_P_2) },
6353 /* PREFIX_VEX_0F3A08 */
6357 { "vroundps", { XM, EXx, Ib }, 0 },
6360 /* PREFIX_VEX_0F3A09 */
6364 { "vroundpd", { XM, EXx, Ib }, 0 },
6367 /* PREFIX_VEX_0F3A0A */
6371 { "vroundss", { XMScalar, VexScalar, EXdScalar, Ib }, 0 },
6374 /* PREFIX_VEX_0F3A0B */
6378 { "vroundsd", { XMScalar, VexScalar, EXqScalar, Ib }, 0 },
6381 /* PREFIX_VEX_0F3A0C */
6385 { "vblendps", { XM, Vex, EXx, Ib }, 0 },
6388 /* PREFIX_VEX_0F3A0D */
6392 { "vblendpd", { XM, Vex, EXx, Ib }, 0 },
6395 /* PREFIX_VEX_0F3A0E */
6399 { "vpblendw", { XM, Vex, EXx, Ib }, 0 },
6402 /* PREFIX_VEX_0F3A0F */
6406 { "vpalignr", { XM, Vex, EXx, Ib }, 0 },
6409 /* PREFIX_VEX_0F3A14 */
6413 { VEX_LEN_TABLE (VEX_LEN_0F3A14_P_2) },
6416 /* PREFIX_VEX_0F3A15 */
6420 { VEX_LEN_TABLE (VEX_LEN_0F3A15_P_2) },
6423 /* PREFIX_VEX_0F3A16 */
6427 { VEX_LEN_TABLE (VEX_LEN_0F3A16_P_2) },
6430 /* PREFIX_VEX_0F3A17 */
6434 { VEX_LEN_TABLE (VEX_LEN_0F3A17_P_2) },
6437 /* PREFIX_VEX_0F3A18 */
6441 { VEX_LEN_TABLE (VEX_LEN_0F3A18_P_2) },
6444 /* PREFIX_VEX_0F3A19 */
6448 { VEX_LEN_TABLE (VEX_LEN_0F3A19_P_2) },
6451 /* PREFIX_VEX_0F3A1D */
6455 { "vcvtps2ph", { EXxmmq, XM, Ib }, 0 },
6458 /* PREFIX_VEX_0F3A20 */
6462 { VEX_LEN_TABLE (VEX_LEN_0F3A20_P_2) },
6465 /* PREFIX_VEX_0F3A21 */
6469 { VEX_LEN_TABLE (VEX_LEN_0F3A21_P_2) },
6472 /* PREFIX_VEX_0F3A22 */
6476 { VEX_LEN_TABLE (VEX_LEN_0F3A22_P_2) },
6479 /* PREFIX_VEX_0F3A30 */
6483 { VEX_LEN_TABLE (VEX_LEN_0F3A30_P_2) },
6486 /* PREFIX_VEX_0F3A31 */
6490 { VEX_LEN_TABLE (VEX_LEN_0F3A31_P_2) },
6493 /* PREFIX_VEX_0F3A32 */
6497 { VEX_LEN_TABLE (VEX_LEN_0F3A32_P_2) },
6500 /* PREFIX_VEX_0F3A33 */
6504 { VEX_LEN_TABLE (VEX_LEN_0F3A33_P_2) },
6507 /* PREFIX_VEX_0F3A38 */
6511 { VEX_LEN_TABLE (VEX_LEN_0F3A38_P_2) },
6514 /* PREFIX_VEX_0F3A39 */
6518 { VEX_LEN_TABLE (VEX_LEN_0F3A39_P_2) },
6521 /* PREFIX_VEX_0F3A40 */
6525 { "vdpps", { XM, Vex, EXx, Ib }, 0 },
6528 /* PREFIX_VEX_0F3A41 */
6532 { VEX_LEN_TABLE (VEX_LEN_0F3A41_P_2) },
6535 /* PREFIX_VEX_0F3A42 */
6539 { "vmpsadbw", { XM, Vex, EXx, Ib }, 0 },
6542 /* PREFIX_VEX_0F3A44 */
6546 { "vpclmulqdq", { XM, Vex, EXx, PCLMUL }, 0 },
6549 /* PREFIX_VEX_0F3A46 */
6553 { VEX_LEN_TABLE (VEX_LEN_0F3A46_P_2) },
6556 /* PREFIX_VEX_0F3A48 */
6560 { VEX_W_TABLE (VEX_W_0F3A48_P_2) },
6563 /* PREFIX_VEX_0F3A49 */
6567 { VEX_W_TABLE (VEX_W_0F3A49_P_2) },
6570 /* PREFIX_VEX_0F3A4A */
6574 { VEX_W_TABLE (VEX_W_0F3A4A_P_2) },
6577 /* PREFIX_VEX_0F3A4B */
6581 { VEX_W_TABLE (VEX_W_0F3A4B_P_2) },
6584 /* PREFIX_VEX_0F3A4C */
6588 { VEX_W_TABLE (VEX_W_0F3A4C_P_2) },
6591 /* PREFIX_VEX_0F3A5C */
6595 { "vfmaddsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6598 /* PREFIX_VEX_0F3A5D */
6602 { "vfmaddsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6605 /* PREFIX_VEX_0F3A5E */
6609 { "vfmsubaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6612 /* PREFIX_VEX_0F3A5F */
6616 { "vfmsubaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6619 /* PREFIX_VEX_0F3A60 */
6623 { VEX_LEN_TABLE (VEX_LEN_0F3A60_P_2) },
6627 /* PREFIX_VEX_0F3A61 */
6631 { VEX_LEN_TABLE (VEX_LEN_0F3A61_P_2) },
6634 /* PREFIX_VEX_0F3A62 */
6638 { VEX_LEN_TABLE (VEX_LEN_0F3A62_P_2) },
6641 /* PREFIX_VEX_0F3A63 */
6645 { VEX_LEN_TABLE (VEX_LEN_0F3A63_P_2) },
6648 /* PREFIX_VEX_0F3A68 */
6652 { "vfmaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6655 /* PREFIX_VEX_0F3A69 */
6659 { "vfmaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6662 /* PREFIX_VEX_0F3A6A */
6666 { VEX_LEN_TABLE (VEX_LEN_0F3A6A_P_2) },
6669 /* PREFIX_VEX_0F3A6B */
6673 { VEX_LEN_TABLE (VEX_LEN_0F3A6B_P_2) },
6676 /* PREFIX_VEX_0F3A6C */
6680 { "vfmsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6683 /* PREFIX_VEX_0F3A6D */
6687 { "vfmsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6690 /* PREFIX_VEX_0F3A6E */
6694 { VEX_LEN_TABLE (VEX_LEN_0F3A6E_P_2) },
6697 /* PREFIX_VEX_0F3A6F */
6701 { VEX_LEN_TABLE (VEX_LEN_0F3A6F_P_2) },
6704 /* PREFIX_VEX_0F3A78 */
6708 { "vfnmaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6711 /* PREFIX_VEX_0F3A79 */
6715 { "vfnmaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6718 /* PREFIX_VEX_0F3A7A */
6722 { VEX_LEN_TABLE (VEX_LEN_0F3A7A_P_2) },
6725 /* PREFIX_VEX_0F3A7B */
6729 { VEX_LEN_TABLE (VEX_LEN_0F3A7B_P_2) },
6732 /* PREFIX_VEX_0F3A7C */
6736 { "vfnmsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6740 /* PREFIX_VEX_0F3A7D */
6744 { "vfnmsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
6747 /* PREFIX_VEX_0F3A7E */
6751 { VEX_LEN_TABLE (VEX_LEN_0F3A7E_P_2) },
6754 /* PREFIX_VEX_0F3A7F */
6758 { VEX_LEN_TABLE (VEX_LEN_0F3A7F_P_2) },
6761 /* PREFIX_VEX_0F3ACE */
6765 { VEX_W_TABLE (VEX_W_0F3ACE_P_2) },
6768 /* PREFIX_VEX_0F3ACF */
6772 { VEX_W_TABLE (VEX_W_0F3ACF_P_2) },
6775 /* PREFIX_VEX_0F3ADF */
6779 { VEX_LEN_TABLE (VEX_LEN_0F3ADF_P_2) },
6782 /* PREFIX_VEX_0F3AF0 */
6787 { VEX_LEN_TABLE (VEX_LEN_0F3AF0_P_3) },
6790 #include "i386-dis-evex-prefix.h"
6793 static const struct dis386 x86_64_table[][2] = {
6796 { "pushP", { es }, 0 },
6801 { "popP", { es }, 0 },
6806 { "pushP", { cs }, 0 },
6811 { "pushP", { ss }, 0 },
6816 { "popP", { ss }, 0 },
6821 { "pushP", { ds }, 0 },
6826 { "popP", { ds }, 0 },
6831 { "daa", { XX }, 0 },
6836 { "das", { XX }, 0 },
6841 { "aaa", { XX }, 0 },
6846 { "aas", { XX }, 0 },
6851 { "pushaP", { XX }, 0 },
6856 { "popaP", { XX }, 0 },
6861 { MOD_TABLE (MOD_62_32BIT) },
6862 { EVEX_TABLE (EVEX_0F) },
6867 { "arpl", { Ew, Gw }, 0 },
6868 { "movs{lq|xd}", { Gv, Ed }, 0 },
6873 { "ins{R|}", { Yzr, indirDX }, 0 },
6874 { "ins{G|}", { Yzr, indirDX }, 0 },
6879 { "outs{R|}", { indirDXr, Xz }, 0 },
6880 { "outs{G|}", { indirDXr, Xz }, 0 },
6885 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
6886 { REG_TABLE (REG_80) },
6891 { "Jcall{T|}", { Ap }, 0 },
6896 { MOD_TABLE (MOD_C4_32BIT) },
6897 { VEX_C4_TABLE (VEX_0F) },
6902 { MOD_TABLE (MOD_C5_32BIT) },
6903 { VEX_C5_TABLE (VEX_0F) },
6908 { "into", { XX }, 0 },
6913 { "aam", { Ib }, 0 },
6918 { "aad", { Ib }, 0 },
6923 { "callP", { Jv, BND }, 0 },
6924 { "call@", { Jv, BND }, 0 }
6929 { "jmpP", { Jv, BND }, 0 },
6930 { "jmp@", { Jv, BND }, 0 }
6935 { "Jjmp{T|}", { Ap }, 0 },
6938 /* X86_64_0F01_REG_0 */
6940 { "sgdt{Q|IQ}", { M }, 0 },
6941 { "sgdt", { M }, 0 },
6944 /* X86_64_0F01_REG_1 */
6946 { "sidt{Q|IQ}", { M }, 0 },
6947 { "sidt", { M }, 0 },
6950 /* X86_64_0F01_REG_2 */
6952 { "lgdt{Q|Q}", { M }, 0 },
6953 { "lgdt", { M }, 0 },
6956 /* X86_64_0F01_REG_3 */
6958 { "lidt{Q|Q}", { M }, 0 },
6959 { "lidt", { M }, 0 },
6963 static const struct dis386 three_byte_table[][256] = {
6965 /* THREE_BYTE_0F38 */
6968 { "pshufb", { MX, EM }, PREFIX_OPCODE },
6969 { "phaddw", { MX, EM }, PREFIX_OPCODE },
6970 { "phaddd", { MX, EM }, PREFIX_OPCODE },
6971 { "phaddsw", { MX, EM }, PREFIX_OPCODE },
6972 { "pmaddubsw", { MX, EM }, PREFIX_OPCODE },
6973 { "phsubw", { MX, EM }, PREFIX_OPCODE },
6974 { "phsubd", { MX, EM }, PREFIX_OPCODE },
6975 { "phsubsw", { MX, EM }, PREFIX_OPCODE },
6977 { "psignb", { MX, EM }, PREFIX_OPCODE },
6978 { "psignw", { MX, EM }, PREFIX_OPCODE },
6979 { "psignd", { MX, EM }, PREFIX_OPCODE },
6980 { "pmulhrsw", { MX, EM }, PREFIX_OPCODE },
6986 { PREFIX_TABLE (PREFIX_0F3810) },
6990 { PREFIX_TABLE (PREFIX_0F3814) },
6991 { PREFIX_TABLE (PREFIX_0F3815) },
6993 { PREFIX_TABLE (PREFIX_0F3817) },
6999 { "pabsb", { MX, EM }, PREFIX_OPCODE },
7000 { "pabsw", { MX, EM }, PREFIX_OPCODE },
7001 { "pabsd", { MX, EM }, PREFIX_OPCODE },
7004 { PREFIX_TABLE (PREFIX_0F3820) },
7005 { PREFIX_TABLE (PREFIX_0F3821) },
7006 { PREFIX_TABLE (PREFIX_0F3822) },
7007 { PREFIX_TABLE (PREFIX_0F3823) },
7008 { PREFIX_TABLE (PREFIX_0F3824) },
7009 { PREFIX_TABLE (PREFIX_0F3825) },
7013 { PREFIX_TABLE (PREFIX_0F3828) },
7014 { PREFIX_TABLE (PREFIX_0F3829) },
7015 { PREFIX_TABLE (PREFIX_0F382A) },
7016 { PREFIX_TABLE (PREFIX_0F382B) },
7022 { PREFIX_TABLE (PREFIX_0F3830) },
7023 { PREFIX_TABLE (PREFIX_0F3831) },
7024 { PREFIX_TABLE (PREFIX_0F3832) },
7025 { PREFIX_TABLE (PREFIX_0F3833) },
7026 { PREFIX_TABLE (PREFIX_0F3834) },
7027 { PREFIX_TABLE (PREFIX_0F3835) },
7029 { PREFIX_TABLE (PREFIX_0F3837) },
7031 { PREFIX_TABLE (PREFIX_0F3838) },
7032 { PREFIX_TABLE (PREFIX_0F3839) },
7033 { PREFIX_TABLE (PREFIX_0F383A) },
7034 { PREFIX_TABLE (PREFIX_0F383B) },
7035 { PREFIX_TABLE (PREFIX_0F383C) },
7036 { PREFIX_TABLE (PREFIX_0F383D) },
7037 { PREFIX_TABLE (PREFIX_0F383E) },
7038 { PREFIX_TABLE (PREFIX_0F383F) },
7040 { PREFIX_TABLE (PREFIX_0F3840) },
7041 { PREFIX_TABLE (PREFIX_0F3841) },
7112 { PREFIX_TABLE (PREFIX_0F3880) },
7113 { PREFIX_TABLE (PREFIX_0F3881) },
7114 { PREFIX_TABLE (PREFIX_0F3882) },
7193 { PREFIX_TABLE (PREFIX_0F38C8) },
7194 { PREFIX_TABLE (PREFIX_0F38C9) },
7195 { PREFIX_TABLE (PREFIX_0F38CA) },
7196 { PREFIX_TABLE (PREFIX_0F38CB) },
7197 { PREFIX_TABLE (PREFIX_0F38CC) },
7198 { PREFIX_TABLE (PREFIX_0F38CD) },
7200 { PREFIX_TABLE (PREFIX_0F38CF) },
7214 { PREFIX_TABLE (PREFIX_0F38DB) },
7215 { PREFIX_TABLE (PREFIX_0F38DC) },
7216 { PREFIX_TABLE (PREFIX_0F38DD) },
7217 { PREFIX_TABLE (PREFIX_0F38DE) },
7218 { PREFIX_TABLE (PREFIX_0F38DF) },
7238 { PREFIX_TABLE (PREFIX_0F38F0) },
7239 { PREFIX_TABLE (PREFIX_0F38F1) },
7243 { PREFIX_TABLE (PREFIX_0F38F5) },
7244 { PREFIX_TABLE (PREFIX_0F38F6) },
7247 { PREFIX_TABLE (PREFIX_0F38F8) },
7248 { PREFIX_TABLE (PREFIX_0F38F9) },
7256 /* THREE_BYTE_0F3A */
7268 { PREFIX_TABLE (PREFIX_0F3A08) },
7269 { PREFIX_TABLE (PREFIX_0F3A09) },
7270 { PREFIX_TABLE (PREFIX_0F3A0A) },
7271 { PREFIX_TABLE (PREFIX_0F3A0B) },
7272 { PREFIX_TABLE (PREFIX_0F3A0C) },
7273 { PREFIX_TABLE (PREFIX_0F3A0D) },
7274 { PREFIX_TABLE (PREFIX_0F3A0E) },
7275 { "palignr", { MX, EM, Ib }, PREFIX_OPCODE },
7281 { PREFIX_TABLE (PREFIX_0F3A14) },
7282 { PREFIX_TABLE (PREFIX_0F3A15) },
7283 { PREFIX_TABLE (PREFIX_0F3A16) },
7284 { PREFIX_TABLE (PREFIX_0F3A17) },
7295 { PREFIX_TABLE (PREFIX_0F3A20) },
7296 { PREFIX_TABLE (PREFIX_0F3A21) },
7297 { PREFIX_TABLE (PREFIX_0F3A22) },
7331 { PREFIX_TABLE (PREFIX_0F3A40) },
7332 { PREFIX_TABLE (PREFIX_0F3A41) },
7333 { PREFIX_TABLE (PREFIX_0F3A42) },
7335 { PREFIX_TABLE (PREFIX_0F3A44) },
7367 { PREFIX_TABLE (PREFIX_0F3A60) },
7368 { PREFIX_TABLE (PREFIX_0F3A61) },
7369 { PREFIX_TABLE (PREFIX_0F3A62) },
7370 { PREFIX_TABLE (PREFIX_0F3A63) },
7488 { PREFIX_TABLE (PREFIX_0F3ACC) },
7490 { PREFIX_TABLE (PREFIX_0F3ACE) },
7491 { PREFIX_TABLE (PREFIX_0F3ACF) },
7509 { PREFIX_TABLE (PREFIX_0F3ADF) },
7549 static const struct dis386 xop_table[][256] = {
7702 { "vpmacssww", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7703 { "vpmacsswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7704 { "vpmacssdql", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7712 { "vpmacssdd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7713 { "vpmacssdqh", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7720 { "vpmacsww", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7721 { "vpmacswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7722 { "vpmacsdql", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7730 { "vpmacsdd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7731 { "vpmacsdqh", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7735 { "vpcmov", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7736 { "vpperm", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7739 { "vpmadcsswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7757 { "vpmadcswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7769 { "vprotb", { XM, Vex_2src_1, Ib }, 0 },
7770 { "vprotw", { XM, Vex_2src_1, Ib }, 0 },
7771 { "vprotd", { XM, Vex_2src_1, Ib }, 0 },
7772 { "vprotq", { XM, Vex_2src_1, Ib }, 0 },
7782 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC) },
7783 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD) },
7784 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE) },
7785 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF) },
7818 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC) },
7819 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED) },
7820 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE) },
7821 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF) },
7845 { REG_TABLE (REG_XOP_TBM_01) },
7846 { REG_TABLE (REG_XOP_TBM_02) },
7864 { REG_TABLE (REG_XOP_LWPCB) },
7988 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_80) },
7989 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_81) },
7990 { "vfrczss", { XM, EXd }, 0 },
7991 { "vfrczsd", { XM, EXq }, 0 },
8006 { "vprotb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8007 { "vprotw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8008 { "vprotd", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8009 { "vprotq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8010 { "vpshlb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8011 { "vpshlw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8012 { "vpshld", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8013 { "vpshlq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8015 { "vpshab", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8016 { "vpshaw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8017 { "vpshad", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8018 { "vpshaq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8061 { "vphaddbw", { XM, EXxmm }, 0 },
8062 { "vphaddbd", { XM, EXxmm }, 0 },
8063 { "vphaddbq", { XM, EXxmm }, 0 },
8066 { "vphaddwd", { XM, EXxmm }, 0 },
8067 { "vphaddwq", { XM, EXxmm }, 0 },
8072 { "vphadddq", { XM, EXxmm }, 0 },
8079 { "vphaddubw", { XM, EXxmm }, 0 },
8080 { "vphaddubd", { XM, EXxmm }, 0 },
8081 { "vphaddubq", { XM, EXxmm }, 0 },
8084 { "vphadduwd", { XM, EXxmm }, 0 },
8085 { "vphadduwq", { XM, EXxmm }, 0 },
8090 { "vphaddudq", { XM, EXxmm }, 0 },
8097 { "vphsubbw", { XM, EXxmm }, 0 },
8098 { "vphsubwd", { XM, EXxmm }, 0 },
8099 { "vphsubdq", { XM, EXxmm }, 0 },
8153 { "bextr", { Gv, Ev, Iq }, 0 },
8155 { REG_TABLE (REG_XOP_LWP) },
8425 static const struct dis386 vex_table[][256] = {
8447 { PREFIX_TABLE (PREFIX_VEX_0F10) },
8448 { PREFIX_TABLE (PREFIX_VEX_0F11) },
8449 { PREFIX_TABLE (PREFIX_VEX_0F12) },
8450 { MOD_TABLE (MOD_VEX_0F13) },
8451 { "vunpcklpX", { XM, Vex, EXx }, 0 },
8452 { "vunpckhpX", { XM, Vex, EXx }, 0 },
8453 { PREFIX_TABLE (PREFIX_VEX_0F16) },
8454 { MOD_TABLE (MOD_VEX_0F17) },
8474 { "vmovapX", { XM, EXx }, 0 },
8475 { "vmovapX", { EXxS, XM }, 0 },
8476 { PREFIX_TABLE (PREFIX_VEX_0F2A) },
8477 { MOD_TABLE (MOD_VEX_0F2B) },
8478 { PREFIX_TABLE (PREFIX_VEX_0F2C) },
8479 { PREFIX_TABLE (PREFIX_VEX_0F2D) },
8480 { PREFIX_TABLE (PREFIX_VEX_0F2E) },
8481 { PREFIX_TABLE (PREFIX_VEX_0F2F) },
8502 { PREFIX_TABLE (PREFIX_VEX_0F41) },
8503 { PREFIX_TABLE (PREFIX_VEX_0F42) },
8505 { PREFIX_TABLE (PREFIX_VEX_0F44) },
8506 { PREFIX_TABLE (PREFIX_VEX_0F45) },
8507 { PREFIX_TABLE (PREFIX_VEX_0F46) },
8508 { PREFIX_TABLE (PREFIX_VEX_0F47) },
8512 { PREFIX_TABLE (PREFIX_VEX_0F4A) },
8513 { PREFIX_TABLE (PREFIX_VEX_0F4B) },
8519 { MOD_TABLE (MOD_VEX_0F50) },
8520 { PREFIX_TABLE (PREFIX_VEX_0F51) },
8521 { PREFIX_TABLE (PREFIX_VEX_0F52) },
8522 { PREFIX_TABLE (PREFIX_VEX_0F53) },
8523 { "vandpX", { XM, Vex, EXx }, 0 },
8524 { "vandnpX", { XM, Vex, EXx }, 0 },
8525 { "vorpX", { XM, Vex, EXx }, 0 },
8526 { "vxorpX", { XM, Vex, EXx }, 0 },
8528 { PREFIX_TABLE (PREFIX_VEX_0F58) },
8529 { PREFIX_TABLE (PREFIX_VEX_0F59) },
8530 { PREFIX_TABLE (PREFIX_VEX_0F5A) },
8531 { PREFIX_TABLE (PREFIX_VEX_0F5B) },
8532 { PREFIX_TABLE (PREFIX_VEX_0F5C) },
8533 { PREFIX_TABLE (PREFIX_VEX_0F5D) },
8534 { PREFIX_TABLE (PREFIX_VEX_0F5E) },
8535 { PREFIX_TABLE (PREFIX_VEX_0F5F) },
8537 { PREFIX_TABLE (PREFIX_VEX_0F60) },
8538 { PREFIX_TABLE (PREFIX_VEX_0F61) },
8539 { PREFIX_TABLE (PREFIX_VEX_0F62) },
8540 { PREFIX_TABLE (PREFIX_VEX_0F63) },
8541 { PREFIX_TABLE (PREFIX_VEX_0F64) },
8542 { PREFIX_TABLE (PREFIX_VEX_0F65) },
8543 { PREFIX_TABLE (PREFIX_VEX_0F66) },
8544 { PREFIX_TABLE (PREFIX_VEX_0F67) },
8546 { PREFIX_TABLE (PREFIX_VEX_0F68) },
8547 { PREFIX_TABLE (PREFIX_VEX_0F69) },
8548 { PREFIX_TABLE (PREFIX_VEX_0F6A) },
8549 { PREFIX_TABLE (PREFIX_VEX_0F6B) },
8550 { PREFIX_TABLE (PREFIX_VEX_0F6C) },
8551 { PREFIX_TABLE (PREFIX_VEX_0F6D) },
8552 { PREFIX_TABLE (PREFIX_VEX_0F6E) },
8553 { PREFIX_TABLE (PREFIX_VEX_0F6F) },
8555 { PREFIX_TABLE (PREFIX_VEX_0F70) },
8556 { REG_TABLE (REG_VEX_0F71) },
8557 { REG_TABLE (REG_VEX_0F72) },
8558 { REG_TABLE (REG_VEX_0F73) },
8559 { PREFIX_TABLE (PREFIX_VEX_0F74) },
8560 { PREFIX_TABLE (PREFIX_VEX_0F75) },
8561 { PREFIX_TABLE (PREFIX_VEX_0F76) },
8562 { PREFIX_TABLE (PREFIX_VEX_0F77) },
8568 { PREFIX_TABLE (PREFIX_VEX_0F7C) },
8569 { PREFIX_TABLE (PREFIX_VEX_0F7D) },
8570 { PREFIX_TABLE (PREFIX_VEX_0F7E) },
8571 { PREFIX_TABLE (PREFIX_VEX_0F7F) },
8591 { PREFIX_TABLE (PREFIX_VEX_0F90) },
8592 { PREFIX_TABLE (PREFIX_VEX_0F91) },
8593 { PREFIX_TABLE (PREFIX_VEX_0F92) },
8594 { PREFIX_TABLE (PREFIX_VEX_0F93) },
8600 { PREFIX_TABLE (PREFIX_VEX_0F98) },
8601 { PREFIX_TABLE (PREFIX_VEX_0F99) },
8624 { REG_TABLE (REG_VEX_0FAE) },
8647 { PREFIX_TABLE (PREFIX_VEX_0FC2) },
8649 { PREFIX_TABLE (PREFIX_VEX_0FC4) },
8650 { PREFIX_TABLE (PREFIX_VEX_0FC5) },
8651 { "vshufpX", { XM, Vex, EXx, Ib }, 0 },
8663 { PREFIX_TABLE (PREFIX_VEX_0FD0) },
8664 { PREFIX_TABLE (PREFIX_VEX_0FD1) },
8665 { PREFIX_TABLE (PREFIX_VEX_0FD2) },
8666 { PREFIX_TABLE (PREFIX_VEX_0FD3) },
8667 { PREFIX_TABLE (PREFIX_VEX_0FD4) },
8668 { PREFIX_TABLE (PREFIX_VEX_0FD5) },
8669 { PREFIX_TABLE (PREFIX_VEX_0FD6) },
8670 { PREFIX_TABLE (PREFIX_VEX_0FD7) },
8672 { PREFIX_TABLE (PREFIX_VEX_0FD8) },
8673 { PREFIX_TABLE (PREFIX_VEX_0FD9) },
8674 { PREFIX_TABLE (PREFIX_VEX_0FDA) },
8675 { PREFIX_TABLE (PREFIX_VEX_0FDB) },
8676 { PREFIX_TABLE (PREFIX_VEX_0FDC) },
8677 { PREFIX_TABLE (PREFIX_VEX_0FDD) },
8678 { PREFIX_TABLE (PREFIX_VEX_0FDE) },
8679 { PREFIX_TABLE (PREFIX_VEX_0FDF) },
8681 { PREFIX_TABLE (PREFIX_VEX_0FE0) },
8682 { PREFIX_TABLE (PREFIX_VEX_0FE1) },
8683 { PREFIX_TABLE (PREFIX_VEX_0FE2) },
8684 { PREFIX_TABLE (PREFIX_VEX_0FE3) },
8685 { PREFIX_TABLE (PREFIX_VEX_0FE4) },
8686 { PREFIX_TABLE (PREFIX_VEX_0FE5) },
8687 { PREFIX_TABLE (PREFIX_VEX_0FE6) },
8688 { PREFIX_TABLE (PREFIX_VEX_0FE7) },
8690 { PREFIX_TABLE (PREFIX_VEX_0FE8) },
8691 { PREFIX_TABLE (PREFIX_VEX_0FE9) },
8692 { PREFIX_TABLE (PREFIX_VEX_0FEA) },
8693 { PREFIX_TABLE (PREFIX_VEX_0FEB) },
8694 { PREFIX_TABLE (PREFIX_VEX_0FEC) },
8695 { PREFIX_TABLE (PREFIX_VEX_0FED) },
8696 { PREFIX_TABLE (PREFIX_VEX_0FEE) },
8697 { PREFIX_TABLE (PREFIX_VEX_0FEF) },
8699 { PREFIX_TABLE (PREFIX_VEX_0FF0) },
8700 { PREFIX_TABLE (PREFIX_VEX_0FF1) },
8701 { PREFIX_TABLE (PREFIX_VEX_0FF2) },
8702 { PREFIX_TABLE (PREFIX_VEX_0FF3) },
8703 { PREFIX_TABLE (PREFIX_VEX_0FF4) },
8704 { PREFIX_TABLE (PREFIX_VEX_0FF5) },
8705 { PREFIX_TABLE (PREFIX_VEX_0FF6) },
8706 { PREFIX_TABLE (PREFIX_VEX_0FF7) },
8708 { PREFIX_TABLE (PREFIX_VEX_0FF8) },
8709 { PREFIX_TABLE (PREFIX_VEX_0FF9) },
8710 { PREFIX_TABLE (PREFIX_VEX_0FFA) },
8711 { PREFIX_TABLE (PREFIX_VEX_0FFB) },
8712 { PREFIX_TABLE (PREFIX_VEX_0FFC) },
8713 { PREFIX_TABLE (PREFIX_VEX_0FFD) },
8714 { PREFIX_TABLE (PREFIX_VEX_0FFE) },
8720 { PREFIX_TABLE (PREFIX_VEX_0F3800) },
8721 { PREFIX_TABLE (PREFIX_VEX_0F3801) },
8722 { PREFIX_TABLE (PREFIX_VEX_0F3802) },
8723 { PREFIX_TABLE (PREFIX_VEX_0F3803) },
8724 { PREFIX_TABLE (PREFIX_VEX_0F3804) },
8725 { PREFIX_TABLE (PREFIX_VEX_0F3805) },
8726 { PREFIX_TABLE (PREFIX_VEX_0F3806) },
8727 { PREFIX_TABLE (PREFIX_VEX_0F3807) },
8729 { PREFIX_TABLE (PREFIX_VEX_0F3808) },
8730 { PREFIX_TABLE (PREFIX_VEX_0F3809) },
8731 { PREFIX_TABLE (PREFIX_VEX_0F380A) },
8732 { PREFIX_TABLE (PREFIX_VEX_0F380B) },
8733 { PREFIX_TABLE (PREFIX_VEX_0F380C) },
8734 { PREFIX_TABLE (PREFIX_VEX_0F380D) },
8735 { PREFIX_TABLE (PREFIX_VEX_0F380E) },
8736 { PREFIX_TABLE (PREFIX_VEX_0F380F) },
8741 { PREFIX_TABLE (PREFIX_VEX_0F3813) },
8744 { PREFIX_TABLE (PREFIX_VEX_0F3816) },
8745 { PREFIX_TABLE (PREFIX_VEX_0F3817) },
8747 { PREFIX_TABLE (PREFIX_VEX_0F3818) },
8748 { PREFIX_TABLE (PREFIX_VEX_0F3819) },
8749 { PREFIX_TABLE (PREFIX_VEX_0F381A) },
8751 { PREFIX_TABLE (PREFIX_VEX_0F381C) },
8752 { PREFIX_TABLE (PREFIX_VEX_0F381D) },
8753 { PREFIX_TABLE (PREFIX_VEX_0F381E) },
8756 { PREFIX_TABLE (PREFIX_VEX_0F3820) },
8757 { PREFIX_TABLE (PREFIX_VEX_0F3821) },
8758 { PREFIX_TABLE (PREFIX_VEX_0F3822) },
8759 { PREFIX_TABLE (PREFIX_VEX_0F3823) },
8760 { PREFIX_TABLE (PREFIX_VEX_0F3824) },
8761 { PREFIX_TABLE (PREFIX_VEX_0F3825) },
8765 { PREFIX_TABLE (PREFIX_VEX_0F3828) },
8766 { PREFIX_TABLE (PREFIX_VEX_0F3829) },
8767 { PREFIX_TABLE (PREFIX_VEX_0F382A) },
8768 { PREFIX_TABLE (PREFIX_VEX_0F382B) },
8769 { PREFIX_TABLE (PREFIX_VEX_0F382C) },
8770 { PREFIX_TABLE (PREFIX_VEX_0F382D) },
8771 { PREFIX_TABLE (PREFIX_VEX_0F382E) },
8772 { PREFIX_TABLE (PREFIX_VEX_0F382F) },
8774 { PREFIX_TABLE (PREFIX_VEX_0F3830) },
8775 { PREFIX_TABLE (PREFIX_VEX_0F3831) },
8776 { PREFIX_TABLE (PREFIX_VEX_0F3832) },
8777 { PREFIX_TABLE (PREFIX_VEX_0F3833) },
8778 { PREFIX_TABLE (PREFIX_VEX_0F3834) },
8779 { PREFIX_TABLE (PREFIX_VEX_0F3835) },
8780 { PREFIX_TABLE (PREFIX_VEX_0F3836) },
8781 { PREFIX_TABLE (PREFIX_VEX_0F3837) },
8783 { PREFIX_TABLE (PREFIX_VEX_0F3838) },
8784 { PREFIX_TABLE (PREFIX_VEX_0F3839) },
8785 { PREFIX_TABLE (PREFIX_VEX_0F383A) },
8786 { PREFIX_TABLE (PREFIX_VEX_0F383B) },
8787 { PREFIX_TABLE (PREFIX_VEX_0F383C) },
8788 { PREFIX_TABLE (PREFIX_VEX_0F383D) },
8789 { PREFIX_TABLE (PREFIX_VEX_0F383E) },
8790 { PREFIX_TABLE (PREFIX_VEX_0F383F) },
8792 { PREFIX_TABLE (PREFIX_VEX_0F3840) },
8793 { PREFIX_TABLE (PREFIX_VEX_0F3841) },
8797 { PREFIX_TABLE (PREFIX_VEX_0F3845) },
8798 { PREFIX_TABLE (PREFIX_VEX_0F3846) },
8799 { PREFIX_TABLE (PREFIX_VEX_0F3847) },
8819 { PREFIX_TABLE (PREFIX_VEX_0F3858) },
8820 { PREFIX_TABLE (PREFIX_VEX_0F3859) },
8821 { PREFIX_TABLE (PREFIX_VEX_0F385A) },
8855 { PREFIX_TABLE (PREFIX_VEX_0F3878) },
8856 { PREFIX_TABLE (PREFIX_VEX_0F3879) },
8877 { PREFIX_TABLE (PREFIX_VEX_0F388C) },
8879 { PREFIX_TABLE (PREFIX_VEX_0F388E) },
8882 { PREFIX_TABLE (PREFIX_VEX_0F3890) },
8883 { PREFIX_TABLE (PREFIX_VEX_0F3891) },
8884 { PREFIX_TABLE (PREFIX_VEX_0F3892) },
8885 { PREFIX_TABLE (PREFIX_VEX_0F3893) },
8888 { PREFIX_TABLE (PREFIX_VEX_0F3896) },
8889 { PREFIX_TABLE (PREFIX_VEX_0F3897) },
8891 { PREFIX_TABLE (PREFIX_VEX_0F3898) },
8892 { PREFIX_TABLE (PREFIX_VEX_0F3899) },
8893 { PREFIX_TABLE (PREFIX_VEX_0F389A) },
8894 { PREFIX_TABLE (PREFIX_VEX_0F389B) },
8895 { PREFIX_TABLE (PREFIX_VEX_0F389C) },
8896 { PREFIX_TABLE (PREFIX_VEX_0F389D) },
8897 { PREFIX_TABLE (PREFIX_VEX_0F389E) },
8898 { PREFIX_TABLE (PREFIX_VEX_0F389F) },
8906 { PREFIX_TABLE (PREFIX_VEX_0F38A6) },
8907 { PREFIX_TABLE (PREFIX_VEX_0F38A7) },
8909 { PREFIX_TABLE (PREFIX_VEX_0F38A8) },
8910 { PREFIX_TABLE (PREFIX_VEX_0F38A9) },
8911 { PREFIX_TABLE (PREFIX_VEX_0F38AA) },
8912 { PREFIX_TABLE (PREFIX_VEX_0F38AB) },
8913 { PREFIX_TABLE (PREFIX_VEX_0F38AC) },
8914 { PREFIX_TABLE (PREFIX_VEX_0F38AD) },
8915 { PREFIX_TABLE (PREFIX_VEX_0F38AE) },
8916 { PREFIX_TABLE (PREFIX_VEX_0F38AF) },
8924 { PREFIX_TABLE (PREFIX_VEX_0F38B6) },
8925 { PREFIX_TABLE (PREFIX_VEX_0F38B7) },
8927 { PREFIX_TABLE (PREFIX_VEX_0F38B8) },
8928 { PREFIX_TABLE (PREFIX_VEX_0F38B9) },
8929 { PREFIX_TABLE (PREFIX_VEX_0F38BA) },
8930 { PREFIX_TABLE (PREFIX_VEX_0F38BB) },
8931 { PREFIX_TABLE (PREFIX_VEX_0F38BC) },
8932 { PREFIX_TABLE (PREFIX_VEX_0F38BD) },
8933 { PREFIX_TABLE (PREFIX_VEX_0F38BE) },
8934 { PREFIX_TABLE (PREFIX_VEX_0F38BF) },
8952 { PREFIX_TABLE (PREFIX_VEX_0F38CF) },
8966 { PREFIX_TABLE (PREFIX_VEX_0F38DB) },
8967 { PREFIX_TABLE (PREFIX_VEX_0F38DC) },
8968 { PREFIX_TABLE (PREFIX_VEX_0F38DD) },
8969 { PREFIX_TABLE (PREFIX_VEX_0F38DE) },
8970 { PREFIX_TABLE (PREFIX_VEX_0F38DF) },
8992 { PREFIX_TABLE (PREFIX_VEX_0F38F2) },
8993 { REG_TABLE (REG_VEX_0F38F3) },
8995 { PREFIX_TABLE (PREFIX_VEX_0F38F5) },
8996 { PREFIX_TABLE (PREFIX_VEX_0F38F6) },
8997 { PREFIX_TABLE (PREFIX_VEX_0F38F7) },
9011 { PREFIX_TABLE (PREFIX_VEX_0F3A00) },
9012 { PREFIX_TABLE (PREFIX_VEX_0F3A01) },
9013 { PREFIX_TABLE (PREFIX_VEX_0F3A02) },
9015 { PREFIX_TABLE (PREFIX_VEX_0F3A04) },
9016 { PREFIX_TABLE (PREFIX_VEX_0F3A05) },
9017 { PREFIX_TABLE (PREFIX_VEX_0F3A06) },
9020 { PREFIX_TABLE (PREFIX_VEX_0F3A08) },
9021 { PREFIX_TABLE (PREFIX_VEX_0F3A09) },
9022 { PREFIX_TABLE (PREFIX_VEX_0F3A0A) },
9023 { PREFIX_TABLE (PREFIX_VEX_0F3A0B) },
9024 { PREFIX_TABLE (PREFIX_VEX_0F3A0C) },
9025 { PREFIX_TABLE (PREFIX_VEX_0F3A0D) },
9026 { PREFIX_TABLE (PREFIX_VEX_0F3A0E) },
9027 { PREFIX_TABLE (PREFIX_VEX_0F3A0F) },
9033 { PREFIX_TABLE (PREFIX_VEX_0F3A14) },
9034 { PREFIX_TABLE (PREFIX_VEX_0F3A15) },
9035 { PREFIX_TABLE (PREFIX_VEX_0F3A16) },
9036 { PREFIX_TABLE (PREFIX_VEX_0F3A17) },
9038 { PREFIX_TABLE (PREFIX_VEX_0F3A18) },
9039 { PREFIX_TABLE (PREFIX_VEX_0F3A19) },
9043 { PREFIX_TABLE (PREFIX_VEX_0F3A1D) },
9047 { PREFIX_TABLE (PREFIX_VEX_0F3A20) },
9048 { PREFIX_TABLE (PREFIX_VEX_0F3A21) },
9049 { PREFIX_TABLE (PREFIX_VEX_0F3A22) },
9065 { PREFIX_TABLE (PREFIX_VEX_0F3A30) },
9066 { PREFIX_TABLE (PREFIX_VEX_0F3A31) },
9067 { PREFIX_TABLE (PREFIX_VEX_0F3A32) },
9068 { PREFIX_TABLE (PREFIX_VEX_0F3A33) },
9074 { PREFIX_TABLE (PREFIX_VEX_0F3A38) },
9075 { PREFIX_TABLE (PREFIX_VEX_0F3A39) },
9083 { PREFIX_TABLE (PREFIX_VEX_0F3A40) },
9084 { PREFIX_TABLE (PREFIX_VEX_0F3A41) },
9085 { PREFIX_TABLE (PREFIX_VEX_0F3A42) },
9087 { PREFIX_TABLE (PREFIX_VEX_0F3A44) },
9089 { PREFIX_TABLE (PREFIX_VEX_0F3A46) },
9092 { PREFIX_TABLE (PREFIX_VEX_0F3A48) },
9093 { PREFIX_TABLE (PREFIX_VEX_0F3A49) },
9094 { PREFIX_TABLE (PREFIX_VEX_0F3A4A) },
9095 { PREFIX_TABLE (PREFIX_VEX_0F3A4B) },
9096 { PREFIX_TABLE (PREFIX_VEX_0F3A4C) },
9114 { PREFIX_TABLE (PREFIX_VEX_0F3A5C) },
9115 { PREFIX_TABLE (PREFIX_VEX_0F3A5D) },
9116 { PREFIX_TABLE (PREFIX_VEX_0F3A5E) },
9117 { PREFIX_TABLE (PREFIX_VEX_0F3A5F) },
9119 { PREFIX_TABLE (PREFIX_VEX_0F3A60) },
9120 { PREFIX_TABLE (PREFIX_VEX_0F3A61) },
9121 { PREFIX_TABLE (PREFIX_VEX_0F3A62) },
9122 { PREFIX_TABLE (PREFIX_VEX_0F3A63) },
9128 { PREFIX_TABLE (PREFIX_VEX_0F3A68) },
9129 { PREFIX_TABLE (PREFIX_VEX_0F3A69) },
9130 { PREFIX_TABLE (PREFIX_VEX_0F3A6A) },
9131 { PREFIX_TABLE (PREFIX_VEX_0F3A6B) },
9132 { PREFIX_TABLE (PREFIX_VEX_0F3A6C) },
9133 { PREFIX_TABLE (PREFIX_VEX_0F3A6D) },
9134 { PREFIX_TABLE (PREFIX_VEX_0F3A6E) },
9135 { PREFIX_TABLE (PREFIX_VEX_0F3A6F) },
9146 { PREFIX_TABLE (PREFIX_VEX_0F3A78) },
9147 { PREFIX_TABLE (PREFIX_VEX_0F3A79) },
9148 { PREFIX_TABLE (PREFIX_VEX_0F3A7A) },
9149 { PREFIX_TABLE (PREFIX_VEX_0F3A7B) },
9150 { PREFIX_TABLE (PREFIX_VEX_0F3A7C) },
9151 { PREFIX_TABLE (PREFIX_VEX_0F3A7D) },
9152 { PREFIX_TABLE (PREFIX_VEX_0F3A7E) },
9153 { PREFIX_TABLE (PREFIX_VEX_0F3A7F) },
9242 { PREFIX_TABLE(PREFIX_VEX_0F3ACE) },
9243 { PREFIX_TABLE(PREFIX_VEX_0F3ACF) },
9261 { PREFIX_TABLE (PREFIX_VEX_0F3ADF) },
9281 { PREFIX_TABLE (PREFIX_VEX_0F3AF0) },
9301 #include "i386-dis-evex.h"
9303 static const struct dis386 vex_len_table[][2] = {
9304 /* VEX_LEN_0F12_P_0_M_0 */
9306 { "vmovlps", { XM, Vex128, EXq }, 0 },
9309 /* VEX_LEN_0F12_P_0_M_1 */
9311 { "vmovhlps", { XM, Vex128, EXq }, 0 },
9314 /* VEX_LEN_0F12_P_2 */
9316 { "vmovlpd", { XM, Vex128, EXq }, 0 },
9319 /* VEX_LEN_0F13_M_0 */
9321 { "vmovlpX", { EXq, XM }, 0 },
9324 /* VEX_LEN_0F16_P_0_M_0 */
9326 { "vmovhps", { XM, Vex128, EXq }, 0 },
9329 /* VEX_LEN_0F16_P_0_M_1 */
9331 { "vmovlhps", { XM, Vex128, EXq }, 0 },
9334 /* VEX_LEN_0F16_P_2 */
9336 { "vmovhpd", { XM, Vex128, EXq }, 0 },
9339 /* VEX_LEN_0F17_M_0 */
9341 { "vmovhpX", { EXq, XM }, 0 },
9344 /* VEX_LEN_0F2A_P_1 */
9346 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9347 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9350 /* VEX_LEN_0F2A_P_3 */
9352 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9353 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9356 /* VEX_LEN_0F2C_P_1 */
9358 { "vcvttss2si", { Gv, EXdScalar }, 0 },
9359 { "vcvttss2si", { Gv, EXdScalar }, 0 },
9362 /* VEX_LEN_0F2C_P_3 */
9364 { "vcvttsd2si", { Gv, EXqScalar }, 0 },
9365 { "vcvttsd2si", { Gv, EXqScalar }, 0 },
9368 /* VEX_LEN_0F2D_P_1 */
9370 { "vcvtss2si", { Gv, EXdScalar }, 0 },
9371 { "vcvtss2si", { Gv, EXdScalar }, 0 },
9374 /* VEX_LEN_0F2D_P_3 */
9376 { "vcvtsd2si", { Gv, EXqScalar }, 0 },
9377 { "vcvtsd2si", { Gv, EXqScalar }, 0 },
9380 /* VEX_LEN_0F41_P_0 */
9383 { VEX_W_TABLE (VEX_W_0F41_P_0_LEN_1) },
9385 /* VEX_LEN_0F41_P_2 */
9388 { VEX_W_TABLE (VEX_W_0F41_P_2_LEN_1) },
9390 /* VEX_LEN_0F42_P_0 */
9393 { VEX_W_TABLE (VEX_W_0F42_P_0_LEN_1) },
9395 /* VEX_LEN_0F42_P_2 */
9398 { VEX_W_TABLE (VEX_W_0F42_P_2_LEN_1) },
9400 /* VEX_LEN_0F44_P_0 */
9402 { VEX_W_TABLE (VEX_W_0F44_P_0_LEN_0) },
9404 /* VEX_LEN_0F44_P_2 */
9406 { VEX_W_TABLE (VEX_W_0F44_P_2_LEN_0) },
9408 /* VEX_LEN_0F45_P_0 */
9411 { VEX_W_TABLE (VEX_W_0F45_P_0_LEN_1) },
9413 /* VEX_LEN_0F45_P_2 */
9416 { VEX_W_TABLE (VEX_W_0F45_P_2_LEN_1) },
9418 /* VEX_LEN_0F46_P_0 */
9421 { VEX_W_TABLE (VEX_W_0F46_P_0_LEN_1) },
9423 /* VEX_LEN_0F46_P_2 */
9426 { VEX_W_TABLE (VEX_W_0F46_P_2_LEN_1) },
9428 /* VEX_LEN_0F47_P_0 */
9431 { VEX_W_TABLE (VEX_W_0F47_P_0_LEN_1) },
9433 /* VEX_LEN_0F47_P_2 */
9436 { VEX_W_TABLE (VEX_W_0F47_P_2_LEN_1) },
9438 /* VEX_LEN_0F4A_P_0 */
9441 { VEX_W_TABLE (VEX_W_0F4A_P_0_LEN_1) },
9443 /* VEX_LEN_0F4A_P_2 */
9446 { VEX_W_TABLE (VEX_W_0F4A_P_2_LEN_1) },
9448 /* VEX_LEN_0F4B_P_0 */
9451 { VEX_W_TABLE (VEX_W_0F4B_P_0_LEN_1) },
9453 /* VEX_LEN_0F4B_P_2 */
9456 { VEX_W_TABLE (VEX_W_0F4B_P_2_LEN_1) },
9459 /* VEX_LEN_0F6E_P_2 */
9461 { "vmovK", { XMScalar, Edq }, 0 },
9464 /* VEX_LEN_0F77_P_1 */
9466 { "vzeroupper", { XX }, 0 },
9467 { "vzeroall", { XX }, 0 },
9470 /* VEX_LEN_0F7E_P_1 */
9472 { "vmovq", { XMScalar, EXqScalar }, 0 },
9475 /* VEX_LEN_0F7E_P_2 */
9477 { "vmovK", { Edq, XMScalar }, 0 },
9480 /* VEX_LEN_0F90_P_0 */
9482 { VEX_W_TABLE (VEX_W_0F90_P_0_LEN_0) },
9485 /* VEX_LEN_0F90_P_2 */
9487 { VEX_W_TABLE (VEX_W_0F90_P_2_LEN_0) },
9490 /* VEX_LEN_0F91_P_0 */
9492 { VEX_W_TABLE (VEX_W_0F91_P_0_LEN_0) },
9495 /* VEX_LEN_0F91_P_2 */
9497 { VEX_W_TABLE (VEX_W_0F91_P_2_LEN_0) },
9500 /* VEX_LEN_0F92_P_0 */
9502 { VEX_W_TABLE (VEX_W_0F92_P_0_LEN_0) },
9505 /* VEX_LEN_0F92_P_2 */
9507 { VEX_W_TABLE (VEX_W_0F92_P_2_LEN_0) },
9510 /* VEX_LEN_0F92_P_3 */
9512 { MOD_TABLE (MOD_VEX_0F92_P_3_LEN_0) },
9515 /* VEX_LEN_0F93_P_0 */
9517 { VEX_W_TABLE (VEX_W_0F93_P_0_LEN_0) },
9520 /* VEX_LEN_0F93_P_2 */
9522 { VEX_W_TABLE (VEX_W_0F93_P_2_LEN_0) },
9525 /* VEX_LEN_0F93_P_3 */
9527 { MOD_TABLE (MOD_VEX_0F93_P_3_LEN_0) },
9530 /* VEX_LEN_0F98_P_0 */
9532 { VEX_W_TABLE (VEX_W_0F98_P_0_LEN_0) },
9535 /* VEX_LEN_0F98_P_2 */
9537 { VEX_W_TABLE (VEX_W_0F98_P_2_LEN_0) },
9540 /* VEX_LEN_0F99_P_0 */
9542 { VEX_W_TABLE (VEX_W_0F99_P_0_LEN_0) },
9545 /* VEX_LEN_0F99_P_2 */
9547 { VEX_W_TABLE (VEX_W_0F99_P_2_LEN_0) },
9550 /* VEX_LEN_0FAE_R_2_M_0 */
9552 { "vldmxcsr", { Md }, 0 },
9555 /* VEX_LEN_0FAE_R_3_M_0 */
9557 { "vstmxcsr", { Md }, 0 },
9560 /* VEX_LEN_0FC4_P_2 */
9562 { "vpinsrw", { XM, Vex128, Edqw, Ib }, 0 },
9565 /* VEX_LEN_0FC5_P_2 */
9567 { "vpextrw", { Gdq, XS, Ib }, 0 },
9570 /* VEX_LEN_0FD6_P_2 */
9572 { "vmovq", { EXqScalarS, XMScalar }, 0 },
9575 /* VEX_LEN_0FF7_P_2 */
9577 { "vmaskmovdqu", { XM, XS }, 0 },
9580 /* VEX_LEN_0F3816_P_2 */
9583 { VEX_W_TABLE (VEX_W_0F3816_P_2) },
9586 /* VEX_LEN_0F3819_P_2 */
9589 { VEX_W_TABLE (VEX_W_0F3819_P_2) },
9592 /* VEX_LEN_0F381A_P_2_M_0 */
9595 { VEX_W_TABLE (VEX_W_0F381A_P_2_M_0) },
9598 /* VEX_LEN_0F3836_P_2 */
9601 { VEX_W_TABLE (VEX_W_0F3836_P_2) },
9604 /* VEX_LEN_0F3841_P_2 */
9606 { "vphminposuw", { XM, EXx }, 0 },
9609 /* VEX_LEN_0F385A_P_2_M_0 */
9612 { VEX_W_TABLE (VEX_W_0F385A_P_2_M_0) },
9615 /* VEX_LEN_0F38DB_P_2 */
9617 { "vaesimc", { XM, EXx }, 0 },
9620 /* VEX_LEN_0F38F2_P_0 */
9622 { "andnS", { Gdq, VexGdq, Edq }, 0 },
9625 /* VEX_LEN_0F38F3_R_1_P_0 */
9627 { "blsrS", { VexGdq, Edq }, 0 },
9630 /* VEX_LEN_0F38F3_R_2_P_0 */
9632 { "blsmskS", { VexGdq, Edq }, 0 },
9635 /* VEX_LEN_0F38F3_R_3_P_0 */
9637 { "blsiS", { VexGdq, Edq }, 0 },
9640 /* VEX_LEN_0F38F5_P_0 */
9642 { "bzhiS", { Gdq, Edq, VexGdq }, 0 },
9645 /* VEX_LEN_0F38F5_P_1 */
9647 { "pextS", { Gdq, VexGdq, Edq }, 0 },
9650 /* VEX_LEN_0F38F5_P_3 */
9652 { "pdepS", { Gdq, VexGdq, Edq }, 0 },
9655 /* VEX_LEN_0F38F6_P_3 */
9657 { "mulxS", { Gdq, VexGdq, Edq }, 0 },
9660 /* VEX_LEN_0F38F7_P_0 */
9662 { "bextrS", { Gdq, Edq, VexGdq }, 0 },
9665 /* VEX_LEN_0F38F7_P_1 */
9667 { "sarxS", { Gdq, Edq, VexGdq }, 0 },
9670 /* VEX_LEN_0F38F7_P_2 */
9672 { "shlxS", { Gdq, Edq, VexGdq }, 0 },
9675 /* VEX_LEN_0F38F7_P_3 */
9677 { "shrxS", { Gdq, Edq, VexGdq }, 0 },
9680 /* VEX_LEN_0F3A00_P_2 */
9683 { VEX_W_TABLE (VEX_W_0F3A00_P_2) },
9686 /* VEX_LEN_0F3A01_P_2 */
9689 { VEX_W_TABLE (VEX_W_0F3A01_P_2) },
9692 /* VEX_LEN_0F3A06_P_2 */
9695 { VEX_W_TABLE (VEX_W_0F3A06_P_2) },
9698 /* VEX_LEN_0F3A14_P_2 */
9700 { "vpextrb", { Edqb, XM, Ib }, 0 },
9703 /* VEX_LEN_0F3A15_P_2 */
9705 { "vpextrw", { Edqw, XM, Ib }, 0 },
9708 /* VEX_LEN_0F3A16_P_2 */
9710 { "vpextrK", { Edq, XM, Ib }, 0 },
9713 /* VEX_LEN_0F3A17_P_2 */
9715 { "vextractps", { Edqd, XM, Ib }, 0 },
9718 /* VEX_LEN_0F3A18_P_2 */
9721 { VEX_W_TABLE (VEX_W_0F3A18_P_2) },
9724 /* VEX_LEN_0F3A19_P_2 */
9727 { VEX_W_TABLE (VEX_W_0F3A19_P_2) },
9730 /* VEX_LEN_0F3A20_P_2 */
9732 { "vpinsrb", { XM, Vex128, Edqb, Ib }, 0 },
9735 /* VEX_LEN_0F3A21_P_2 */
9737 { "vinsertps", { XM, Vex128, EXd, Ib }, 0 },
9740 /* VEX_LEN_0F3A22_P_2 */
9742 { "vpinsrK", { XM, Vex128, Edq, Ib }, 0 },
9745 /* VEX_LEN_0F3A30_P_2 */
9747 { VEX_W_TABLE (VEX_W_0F3A30_P_2_LEN_0) },
9750 /* VEX_LEN_0F3A31_P_2 */
9752 { VEX_W_TABLE (VEX_W_0F3A31_P_2_LEN_0) },
9755 /* VEX_LEN_0F3A32_P_2 */
9757 { VEX_W_TABLE (VEX_W_0F3A32_P_2_LEN_0) },
9760 /* VEX_LEN_0F3A33_P_2 */
9762 { VEX_W_TABLE (VEX_W_0F3A33_P_2_LEN_0) },
9765 /* VEX_LEN_0F3A38_P_2 */
9768 { VEX_W_TABLE (VEX_W_0F3A38_P_2) },
9771 /* VEX_LEN_0F3A39_P_2 */
9774 { VEX_W_TABLE (VEX_W_0F3A39_P_2) },
9777 /* VEX_LEN_0F3A41_P_2 */
9779 { "vdppd", { XM, Vex128, EXx, Ib }, 0 },
9782 /* VEX_LEN_0F3A46_P_2 */
9785 { VEX_W_TABLE (VEX_W_0F3A46_P_2) },
9788 /* VEX_LEN_0F3A60_P_2 */
9790 { "vpcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
9793 /* VEX_LEN_0F3A61_P_2 */
9795 { "vpcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
9798 /* VEX_LEN_0F3A62_P_2 */
9800 { "vpcmpistrm", { XM, EXx, Ib }, 0 },
9803 /* VEX_LEN_0F3A63_P_2 */
9805 { "vpcmpistri", { XM, EXx, Ib }, 0 },
9808 /* VEX_LEN_0F3A6A_P_2 */
9810 { "vfmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
9813 /* VEX_LEN_0F3A6B_P_2 */
9815 { "vfmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
9818 /* VEX_LEN_0F3A6E_P_2 */
9820 { "vfmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
9823 /* VEX_LEN_0F3A6F_P_2 */
9825 { "vfmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
9828 /* VEX_LEN_0F3A7A_P_2 */
9830 { "vfnmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
9833 /* VEX_LEN_0F3A7B_P_2 */
9835 { "vfnmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
9838 /* VEX_LEN_0F3A7E_P_2 */
9840 { "vfnmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
9843 /* VEX_LEN_0F3A7F_P_2 */
9845 { "vfnmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
9848 /* VEX_LEN_0F3ADF_P_2 */
9850 { "vaeskeygenassist", { XM, EXx, Ib }, 0 },
9853 /* VEX_LEN_0F3AF0_P_3 */
9855 { "rorxS", { Gdq, Edq, Ib }, 0 },
9858 /* VEX_LEN_0FXOP_08_CC */
9860 { "vpcomb", { XM, Vex128, EXx, VPCOM }, 0 },
9863 /* VEX_LEN_0FXOP_08_CD */
9865 { "vpcomw", { XM, Vex128, EXx, VPCOM }, 0 },
9868 /* VEX_LEN_0FXOP_08_CE */
9870 { "vpcomd", { XM, Vex128, EXx, VPCOM }, 0 },
9873 /* VEX_LEN_0FXOP_08_CF */
9875 { "vpcomq", { XM, Vex128, EXx, VPCOM }, 0 },
9878 /* VEX_LEN_0FXOP_08_EC */
9880 { "vpcomub", { XM, Vex128, EXx, VPCOM }, 0 },
9883 /* VEX_LEN_0FXOP_08_ED */
9885 { "vpcomuw", { XM, Vex128, EXx, VPCOM }, 0 },
9888 /* VEX_LEN_0FXOP_08_EE */
9890 { "vpcomud", { XM, Vex128, EXx, VPCOM }, 0 },
9893 /* VEX_LEN_0FXOP_08_EF */
9895 { "vpcomuq", { XM, Vex128, EXx, VPCOM }, 0 },
9898 /* VEX_LEN_0FXOP_09_80 */
9900 { "vfrczps", { XM, EXxmm }, 0 },
9901 { "vfrczps", { XM, EXymmq }, 0 },
9904 /* VEX_LEN_0FXOP_09_81 */
9906 { "vfrczpd", { XM, EXxmm }, 0 },
9907 { "vfrczpd", { XM, EXymmq }, 0 },
9911 #include "i386-dis-evex-len.h"
9913 static const struct dis386 vex_w_table[][2] = {
9915 /* VEX_W_0F41_P_0_LEN_1 */
9916 { MOD_TABLE (MOD_VEX_W_0_0F41_P_0_LEN_1) },
9917 { MOD_TABLE (MOD_VEX_W_1_0F41_P_0_LEN_1) },
9920 /* VEX_W_0F41_P_2_LEN_1 */
9921 { MOD_TABLE (MOD_VEX_W_0_0F41_P_2_LEN_1) },
9922 { MOD_TABLE (MOD_VEX_W_1_0F41_P_2_LEN_1) }
9925 /* VEX_W_0F42_P_0_LEN_1 */
9926 { MOD_TABLE (MOD_VEX_W_0_0F42_P_0_LEN_1) },
9927 { MOD_TABLE (MOD_VEX_W_1_0F42_P_0_LEN_1) },
9930 /* VEX_W_0F42_P_2_LEN_1 */
9931 { MOD_TABLE (MOD_VEX_W_0_0F42_P_2_LEN_1) },
9932 { MOD_TABLE (MOD_VEX_W_1_0F42_P_2_LEN_1) },
9935 /* VEX_W_0F44_P_0_LEN_0 */
9936 { MOD_TABLE (MOD_VEX_W_0_0F44_P_0_LEN_1) },
9937 { MOD_TABLE (MOD_VEX_W_1_0F44_P_0_LEN_1) },
9940 /* VEX_W_0F44_P_2_LEN_0 */
9941 { MOD_TABLE (MOD_VEX_W_0_0F44_P_2_LEN_1) },
9942 { MOD_TABLE (MOD_VEX_W_1_0F44_P_2_LEN_1) },
9945 /* VEX_W_0F45_P_0_LEN_1 */
9946 { MOD_TABLE (MOD_VEX_W_0_0F45_P_0_LEN_1) },
9947 { MOD_TABLE (MOD_VEX_W_1_0F45_P_0_LEN_1) },
9950 /* VEX_W_0F45_P_2_LEN_1 */
9951 { MOD_TABLE (MOD_VEX_W_0_0F45_P_2_LEN_1) },
9952 { MOD_TABLE (MOD_VEX_W_1_0F45_P_2_LEN_1) },
9955 /* VEX_W_0F46_P_0_LEN_1 */
9956 { MOD_TABLE (MOD_VEX_W_0_0F46_P_0_LEN_1) },
9957 { MOD_TABLE (MOD_VEX_W_1_0F46_P_0_LEN_1) },
9960 /* VEX_W_0F46_P_2_LEN_1 */
9961 { MOD_TABLE (MOD_VEX_W_0_0F46_P_2_LEN_1) },
9962 { MOD_TABLE (MOD_VEX_W_1_0F46_P_2_LEN_1) },
9965 /* VEX_W_0F47_P_0_LEN_1 */
9966 { MOD_TABLE (MOD_VEX_W_0_0F47_P_0_LEN_1) },
9967 { MOD_TABLE (MOD_VEX_W_1_0F47_P_0_LEN_1) },
9970 /* VEX_W_0F47_P_2_LEN_1 */
9971 { MOD_TABLE (MOD_VEX_W_0_0F47_P_2_LEN_1) },
9972 { MOD_TABLE (MOD_VEX_W_1_0F47_P_2_LEN_1) },
9975 /* VEX_W_0F4A_P_0_LEN_1 */
9976 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_0_LEN_1) },
9977 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_0_LEN_1) },
9980 /* VEX_W_0F4A_P_2_LEN_1 */
9981 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_2_LEN_1) },
9982 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_2_LEN_1) },
9985 /* VEX_W_0F4B_P_0_LEN_1 */
9986 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_0_LEN_1) },
9987 { MOD_TABLE (MOD_VEX_W_1_0F4B_P_0_LEN_1) },
9990 /* VEX_W_0F4B_P_2_LEN_1 */
9991 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_2_LEN_1) },
9994 /* VEX_W_0F90_P_0_LEN_0 */
9995 { "kmovw", { MaskG, MaskE }, 0 },
9996 { "kmovq", { MaskG, MaskE }, 0 },
9999 /* VEX_W_0F90_P_2_LEN_0 */
10000 { "kmovb", { MaskG, MaskBDE }, 0 },
10001 { "kmovd", { MaskG, MaskBDE }, 0 },
10004 /* VEX_W_0F91_P_0_LEN_0 */
10005 { MOD_TABLE (MOD_VEX_W_0_0F91_P_0_LEN_0) },
10006 { MOD_TABLE (MOD_VEX_W_1_0F91_P_0_LEN_0) },
10009 /* VEX_W_0F91_P_2_LEN_0 */
10010 { MOD_TABLE (MOD_VEX_W_0_0F91_P_2_LEN_0) },
10011 { MOD_TABLE (MOD_VEX_W_1_0F91_P_2_LEN_0) },
10014 /* VEX_W_0F92_P_0_LEN_0 */
10015 { MOD_TABLE (MOD_VEX_W_0_0F92_P_0_LEN_0) },
10018 /* VEX_W_0F92_P_2_LEN_0 */
10019 { MOD_TABLE (MOD_VEX_W_0_0F92_P_2_LEN_0) },
10022 /* VEX_W_0F93_P_0_LEN_0 */
10023 { MOD_TABLE (MOD_VEX_W_0_0F93_P_0_LEN_0) },
10026 /* VEX_W_0F93_P_2_LEN_0 */
10027 { MOD_TABLE (MOD_VEX_W_0_0F93_P_2_LEN_0) },
10030 /* VEX_W_0F98_P_0_LEN_0 */
10031 { MOD_TABLE (MOD_VEX_W_0_0F98_P_0_LEN_0) },
10032 { MOD_TABLE (MOD_VEX_W_1_0F98_P_0_LEN_0) },
10035 /* VEX_W_0F98_P_2_LEN_0 */
10036 { MOD_TABLE (MOD_VEX_W_0_0F98_P_2_LEN_0) },
10037 { MOD_TABLE (MOD_VEX_W_1_0F98_P_2_LEN_0) },
10040 /* VEX_W_0F99_P_0_LEN_0 */
10041 { MOD_TABLE (MOD_VEX_W_0_0F99_P_0_LEN_0) },
10042 { MOD_TABLE (MOD_VEX_W_1_0F99_P_0_LEN_0) },
10045 /* VEX_W_0F99_P_2_LEN_0 */
10046 { MOD_TABLE (MOD_VEX_W_0_0F99_P_2_LEN_0) },
10047 { MOD_TABLE (MOD_VEX_W_1_0F99_P_2_LEN_0) },
10050 /* VEX_W_0F380C_P_2 */
10051 { "vpermilps", { XM, Vex, EXx }, 0 },
10054 /* VEX_W_0F380D_P_2 */
10055 { "vpermilpd", { XM, Vex, EXx }, 0 },
10058 /* VEX_W_0F380E_P_2 */
10059 { "vtestps", { XM, EXx }, 0 },
10062 /* VEX_W_0F380F_P_2 */
10063 { "vtestpd", { XM, EXx }, 0 },
10066 /* VEX_W_0F3816_P_2 */
10067 { "vpermps", { XM, Vex, EXx }, 0 },
10070 /* VEX_W_0F3818_P_2 */
10071 { "vbroadcastss", { XM, EXxmm_md }, 0 },
10074 /* VEX_W_0F3819_P_2 */
10075 { "vbroadcastsd", { XM, EXxmm_mq }, 0 },
10078 /* VEX_W_0F381A_P_2_M_0 */
10079 { "vbroadcastf128", { XM, Mxmm }, 0 },
10082 /* VEX_W_0F382C_P_2_M_0 */
10083 { "vmaskmovps", { XM, Vex, Mx }, 0 },
10086 /* VEX_W_0F382D_P_2_M_0 */
10087 { "vmaskmovpd", { XM, Vex, Mx }, 0 },
10090 /* VEX_W_0F382E_P_2_M_0 */
10091 { "vmaskmovps", { Mx, Vex, XM }, 0 },
10094 /* VEX_W_0F382F_P_2_M_0 */
10095 { "vmaskmovpd", { Mx, Vex, XM }, 0 },
10098 /* VEX_W_0F3836_P_2 */
10099 { "vpermd", { XM, Vex, EXx }, 0 },
10102 /* VEX_W_0F3846_P_2 */
10103 { "vpsravd", { XM, Vex, EXx }, 0 },
10106 /* VEX_W_0F3858_P_2 */
10107 { "vpbroadcastd", { XM, EXxmm_md }, 0 },
10110 /* VEX_W_0F3859_P_2 */
10111 { "vpbroadcastq", { XM, EXxmm_mq }, 0 },
10114 /* VEX_W_0F385A_P_2_M_0 */
10115 { "vbroadcasti128", { XM, Mxmm }, 0 },
10118 /* VEX_W_0F3878_P_2 */
10119 { "vpbroadcastb", { XM, EXxmm_mb }, 0 },
10122 /* VEX_W_0F3879_P_2 */
10123 { "vpbroadcastw", { XM, EXxmm_mw }, 0 },
10126 /* VEX_W_0F38CF_P_2 */
10127 { "vgf2p8mulb", { XM, Vex, EXx }, 0 },
10130 /* VEX_W_0F3A00_P_2 */
10132 { "vpermq", { XM, EXx, Ib }, 0 },
10135 /* VEX_W_0F3A01_P_2 */
10137 { "vpermpd", { XM, EXx, Ib }, 0 },
10140 /* VEX_W_0F3A02_P_2 */
10141 { "vpblendd", { XM, Vex, EXx, Ib }, 0 },
10144 /* VEX_W_0F3A04_P_2 */
10145 { "vpermilps", { XM, EXx, Ib }, 0 },
10148 /* VEX_W_0F3A05_P_2 */
10149 { "vpermilpd", { XM, EXx, Ib }, 0 },
10152 /* VEX_W_0F3A06_P_2 */
10153 { "vperm2f128", { XM, Vex256, EXx, Ib }, 0 },
10156 /* VEX_W_0F3A18_P_2 */
10157 { "vinsertf128", { XM, Vex256, EXxmm, Ib }, 0 },
10160 /* VEX_W_0F3A19_P_2 */
10161 { "vextractf128", { EXxmm, XM, Ib }, 0 },
10164 /* VEX_W_0F3A30_P_2_LEN_0 */
10165 { MOD_TABLE (MOD_VEX_W_0_0F3A30_P_2_LEN_0) },
10166 { MOD_TABLE (MOD_VEX_W_1_0F3A30_P_2_LEN_0) },
10169 /* VEX_W_0F3A31_P_2_LEN_0 */
10170 { MOD_TABLE (MOD_VEX_W_0_0F3A31_P_2_LEN_0) },
10171 { MOD_TABLE (MOD_VEX_W_1_0F3A31_P_2_LEN_0) },
10174 /* VEX_W_0F3A32_P_2_LEN_0 */
10175 { MOD_TABLE (MOD_VEX_W_0_0F3A32_P_2_LEN_0) },
10176 { MOD_TABLE (MOD_VEX_W_1_0F3A32_P_2_LEN_0) },
10179 /* VEX_W_0F3A33_P_2_LEN_0 */
10180 { MOD_TABLE (MOD_VEX_W_0_0F3A33_P_2_LEN_0) },
10181 { MOD_TABLE (MOD_VEX_W_1_0F3A33_P_2_LEN_0) },
10184 /* VEX_W_0F3A38_P_2 */
10185 { "vinserti128", { XM, Vex256, EXxmm, Ib }, 0 },
10188 /* VEX_W_0F3A39_P_2 */
10189 { "vextracti128", { EXxmm, XM, Ib }, 0 },
10192 /* VEX_W_0F3A46_P_2 */
10193 { "vperm2i128", { XM, Vex256, EXx, Ib }, 0 },
10196 /* VEX_W_0F3A48_P_2 */
10197 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10198 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10201 /* VEX_W_0F3A49_P_2 */
10202 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10203 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10206 /* VEX_W_0F3A4A_P_2 */
10207 { "vblendvps", { XM, Vex, EXx, XMVexI4 }, 0 },
10210 /* VEX_W_0F3A4B_P_2 */
10211 { "vblendvpd", { XM, Vex, EXx, XMVexI4 }, 0 },
10214 /* VEX_W_0F3A4C_P_2 */
10215 { "vpblendvb", { XM, Vex, EXx, XMVexI4 }, 0 },
10218 /* VEX_W_0F3ACE_P_2 */
10220 { "vgf2p8affineqb", { XM, Vex, EXx, Ib }, 0 },
10223 /* VEX_W_0F3ACF_P_2 */
10225 { "vgf2p8affineinvqb", { XM, Vex, EXx, Ib }, 0 },
10228 #include "i386-dis-evex-w.h"
10231 static const struct dis386 mod_table[][2] = {
10234 { "leaS", { Gv, M }, 0 },
10239 { RM_TABLE (RM_C6_REG_7) },
10244 { RM_TABLE (RM_C7_REG_7) },
10248 { "Jcall^", { indirEp }, 0 },
10252 { "Jjmp^", { indirEp }, 0 },
10255 /* MOD_0F01_REG_0 */
10256 { X86_64_TABLE (X86_64_0F01_REG_0) },
10257 { RM_TABLE (RM_0F01_REG_0) },
10260 /* MOD_0F01_REG_1 */
10261 { X86_64_TABLE (X86_64_0F01_REG_1) },
10262 { RM_TABLE (RM_0F01_REG_1) },
10265 /* MOD_0F01_REG_2 */
10266 { X86_64_TABLE (X86_64_0F01_REG_2) },
10267 { RM_TABLE (RM_0F01_REG_2) },
10270 /* MOD_0F01_REG_3 */
10271 { X86_64_TABLE (X86_64_0F01_REG_3) },
10272 { RM_TABLE (RM_0F01_REG_3) },
10275 /* MOD_0F01_REG_5 */
10276 { PREFIX_TABLE (PREFIX_MOD_0_0F01_REG_5) },
10277 { RM_TABLE (RM_0F01_REG_5) },
10280 /* MOD_0F01_REG_7 */
10281 { "invlpg", { Mb }, 0 },
10282 { RM_TABLE (RM_0F01_REG_7) },
10285 /* MOD_0F12_PREFIX_0 */
10286 { "movlps", { XM, EXq }, PREFIX_OPCODE },
10287 { "movhlps", { XM, EXq }, PREFIX_OPCODE },
10291 { "movlpX", { EXq, XM }, PREFIX_OPCODE },
10294 /* MOD_0F16_PREFIX_0 */
10295 { "movhps", { XM, EXq }, 0 },
10296 { "movlhps", { XM, EXq }, 0 },
10300 { "movhpX", { EXq, XM }, PREFIX_OPCODE },
10303 /* MOD_0F18_REG_0 */
10304 { "prefetchnta", { Mb }, 0 },
10307 /* MOD_0F18_REG_1 */
10308 { "prefetcht0", { Mb }, 0 },
10311 /* MOD_0F18_REG_2 */
10312 { "prefetcht1", { Mb }, 0 },
10315 /* MOD_0F18_REG_3 */
10316 { "prefetcht2", { Mb }, 0 },
10319 /* MOD_0F18_REG_4 */
10320 { "nop/reserved", { Mb }, 0 },
10323 /* MOD_0F18_REG_5 */
10324 { "nop/reserved", { Mb }, 0 },
10327 /* MOD_0F18_REG_6 */
10328 { "nop/reserved", { Mb }, 0 },
10331 /* MOD_0F18_REG_7 */
10332 { "nop/reserved", { Mb }, 0 },
10335 /* MOD_0F1A_PREFIX_0 */
10336 { "bndldx", { Gbnd, Mv_bnd }, 0 },
10337 { "nopQ", { Ev }, 0 },
10340 /* MOD_0F1B_PREFIX_0 */
10341 { "bndstx", { Mv_bnd, Gbnd }, 0 },
10342 { "nopQ", { Ev }, 0 },
10345 /* MOD_0F1B_PREFIX_1 */
10346 { "bndmk", { Gbnd, Mv_bnd }, 0 },
10347 { "nopQ", { Ev }, 0 },
10350 /* MOD_0F1C_PREFIX_0 */
10351 { REG_TABLE (REG_0F1C_MOD_0) },
10352 { "nopQ", { Ev }, 0 },
10355 /* MOD_0F1E_PREFIX_1 */
10356 { "nopQ", { Ev }, 0 },
10357 { REG_TABLE (REG_0F1E_MOD_3) },
10362 { "movL", { Rd, Td }, 0 },
10367 { "movL", { Td, Rd }, 0 },
10370 /* MOD_0F2B_PREFIX_0 */
10371 {"movntps", { Mx, XM }, PREFIX_OPCODE },
10374 /* MOD_0F2B_PREFIX_1 */
10375 {"movntss", { Md, XM }, PREFIX_OPCODE },
10378 /* MOD_0F2B_PREFIX_2 */
10379 {"movntpd", { Mx, XM }, PREFIX_OPCODE },
10382 /* MOD_0F2B_PREFIX_3 */
10383 {"movntsd", { Mq, XM }, PREFIX_OPCODE },
10388 { "movmskpX", { Gdq, XS }, PREFIX_OPCODE },
10391 /* MOD_0F71_REG_2 */
10393 { "psrlw", { MS, Ib }, 0 },
10396 /* MOD_0F71_REG_4 */
10398 { "psraw", { MS, Ib }, 0 },
10401 /* MOD_0F71_REG_6 */
10403 { "psllw", { MS, Ib }, 0 },
10406 /* MOD_0F72_REG_2 */
10408 { "psrld", { MS, Ib }, 0 },
10411 /* MOD_0F72_REG_4 */
10413 { "psrad", { MS, Ib }, 0 },
10416 /* MOD_0F72_REG_6 */
10418 { "pslld", { MS, Ib }, 0 },
10421 /* MOD_0F73_REG_2 */
10423 { "psrlq", { MS, Ib }, 0 },
10426 /* MOD_0F73_REG_3 */
10428 { PREFIX_TABLE (PREFIX_0F73_REG_3) },
10431 /* MOD_0F73_REG_6 */
10433 { "psllq", { MS, Ib }, 0 },
10436 /* MOD_0F73_REG_7 */
10438 { PREFIX_TABLE (PREFIX_0F73_REG_7) },
10441 /* MOD_0FAE_REG_0 */
10442 { "fxsave", { FXSAVE }, 0 },
10443 { PREFIX_TABLE (PREFIX_0FAE_REG_0) },
10446 /* MOD_0FAE_REG_1 */
10447 { "fxrstor", { FXSAVE }, 0 },
10448 { PREFIX_TABLE (PREFIX_0FAE_REG_1) },
10451 /* MOD_0FAE_REG_2 */
10452 { "ldmxcsr", { Md }, 0 },
10453 { PREFIX_TABLE (PREFIX_0FAE_REG_2) },
10456 /* MOD_0FAE_REG_3 */
10457 { "stmxcsr", { Md }, 0 },
10458 { PREFIX_TABLE (PREFIX_0FAE_REG_3) },
10461 /* MOD_0FAE_REG_4 */
10462 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_4) },
10463 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_4) },
10466 /* MOD_0FAE_REG_5 */
10467 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_5) },
10468 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_5) },
10471 /* MOD_0FAE_REG_6 */
10472 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_6) },
10473 { PREFIX_TABLE (PREFIX_MOD_1_0FAE_REG_6) },
10476 /* MOD_0FAE_REG_7 */
10477 { PREFIX_TABLE (PREFIX_0FAE_REG_7) },
10478 { RM_TABLE (RM_0FAE_REG_7) },
10482 { "lssS", { Gv, Mp }, 0 },
10486 { "lfsS", { Gv, Mp }, 0 },
10490 { "lgsS", { Gv, Mp }, 0 },
10494 { PREFIX_TABLE (PREFIX_MOD_0_0FC3) },
10497 /* MOD_0FC7_REG_3 */
10498 { "xrstors", { FXSAVE }, 0 },
10501 /* MOD_0FC7_REG_4 */
10502 { "xsavec", { FXSAVE }, 0 },
10505 /* MOD_0FC7_REG_5 */
10506 { "xsaves", { FXSAVE }, 0 },
10509 /* MOD_0FC7_REG_6 */
10510 { PREFIX_TABLE (PREFIX_MOD_0_0FC7_REG_6) },
10511 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_6) }
10514 /* MOD_0FC7_REG_7 */
10515 { "vmptrst", { Mq }, 0 },
10516 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_7) }
10521 { "pmovmskb", { Gdq, MS }, 0 },
10524 /* MOD_0FE7_PREFIX_2 */
10525 { "movntdq", { Mx, XM }, 0 },
10528 /* MOD_0FF0_PREFIX_3 */
10529 { "lddqu", { XM, M }, 0 },
10532 /* MOD_0F382A_PREFIX_2 */
10533 { "movntdqa", { XM, Mx }, 0 },
10536 /* MOD_0F38F5_PREFIX_2 */
10537 { "wrussK", { M, Gdq }, PREFIX_OPCODE },
10540 /* MOD_0F38F6_PREFIX_0 */
10541 { "wrssK", { M, Gdq }, PREFIX_OPCODE },
10544 /* MOD_0F38F8_PREFIX_1 */
10545 { "enqcmds", { Gva, M }, PREFIX_OPCODE },
10548 /* MOD_0F38F8_PREFIX_2 */
10549 { "movdir64b", { Gva, M }, PREFIX_OPCODE },
10552 /* MOD_0F38F8_PREFIX_3 */
10553 { "enqcmd", { Gva, M }, PREFIX_OPCODE },
10556 /* MOD_0F38F9_PREFIX_0 */
10557 { "movdiri", { Em, Gv }, PREFIX_OPCODE },
10561 { "bound{S|}", { Gv, Ma }, 0 },
10562 { EVEX_TABLE (EVEX_0F) },
10566 { "lesS", { Gv, Mp }, 0 },
10567 { VEX_C4_TABLE (VEX_0F) },
10571 { "ldsS", { Gv, Mp }, 0 },
10572 { VEX_C5_TABLE (VEX_0F) },
10575 /* MOD_VEX_0F12_PREFIX_0 */
10576 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0) },
10577 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1) },
10581 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0) },
10584 /* MOD_VEX_0F16_PREFIX_0 */
10585 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0) },
10586 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1) },
10590 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0) },
10594 { "vmovntpX", { Mx, XM }, 0 },
10597 /* MOD_VEX_W_0_0F41_P_0_LEN_1 */
10599 { "kandw", { MaskG, MaskVex, MaskR }, 0 },
10602 /* MOD_VEX_W_1_0F41_P_0_LEN_1 */
10604 { "kandq", { MaskG, MaskVex, MaskR }, 0 },
10607 /* MOD_VEX_W_0_0F41_P_2_LEN_1 */
10609 { "kandb", { MaskG, MaskVex, MaskR }, 0 },
10612 /* MOD_VEX_W_1_0F41_P_2_LEN_1 */
10614 { "kandd", { MaskG, MaskVex, MaskR }, 0 },
10617 /* MOD_VEX_W_0_0F42_P_0_LEN_1 */
10619 { "kandnw", { MaskG, MaskVex, MaskR }, 0 },
10622 /* MOD_VEX_W_1_0F42_P_0_LEN_1 */
10624 { "kandnq", { MaskG, MaskVex, MaskR }, 0 },
10627 /* MOD_VEX_W_0_0F42_P_2_LEN_1 */
10629 { "kandnb", { MaskG, MaskVex, MaskR }, 0 },
10632 /* MOD_VEX_W_1_0F42_P_2_LEN_1 */
10634 { "kandnd", { MaskG, MaskVex, MaskR }, 0 },
10637 /* MOD_VEX_W_0_0F44_P_0_LEN_0 */
10639 { "knotw", { MaskG, MaskR }, 0 },
10642 /* MOD_VEX_W_1_0F44_P_0_LEN_0 */
10644 { "knotq", { MaskG, MaskR }, 0 },
10647 /* MOD_VEX_W_0_0F44_P_2_LEN_0 */
10649 { "knotb", { MaskG, MaskR }, 0 },
10652 /* MOD_VEX_W_1_0F44_P_2_LEN_0 */
10654 { "knotd", { MaskG, MaskR }, 0 },
10657 /* MOD_VEX_W_0_0F45_P_0_LEN_1 */
10659 { "korw", { MaskG, MaskVex, MaskR }, 0 },
10662 /* MOD_VEX_W_1_0F45_P_0_LEN_1 */
10664 { "korq", { MaskG, MaskVex, MaskR }, 0 },
10667 /* MOD_VEX_W_0_0F45_P_2_LEN_1 */
10669 { "korb", { MaskG, MaskVex, MaskR }, 0 },
10672 /* MOD_VEX_W_1_0F45_P_2_LEN_1 */
10674 { "kord", { MaskG, MaskVex, MaskR }, 0 },
10677 /* MOD_VEX_W_0_0F46_P_0_LEN_1 */
10679 { "kxnorw", { MaskG, MaskVex, MaskR }, 0 },
10682 /* MOD_VEX_W_1_0F46_P_0_LEN_1 */
10684 { "kxnorq", { MaskG, MaskVex, MaskR }, 0 },
10687 /* MOD_VEX_W_0_0F46_P_2_LEN_1 */
10689 { "kxnorb", { MaskG, MaskVex, MaskR }, 0 },
10692 /* MOD_VEX_W_1_0F46_P_2_LEN_1 */
10694 { "kxnord", { MaskG, MaskVex, MaskR }, 0 },
10697 /* MOD_VEX_W_0_0F47_P_0_LEN_1 */
10699 { "kxorw", { MaskG, MaskVex, MaskR }, 0 },
10702 /* MOD_VEX_W_1_0F47_P_0_LEN_1 */
10704 { "kxorq", { MaskG, MaskVex, MaskR }, 0 },
10707 /* MOD_VEX_W_0_0F47_P_2_LEN_1 */
10709 { "kxorb", { MaskG, MaskVex, MaskR }, 0 },
10712 /* MOD_VEX_W_1_0F47_P_2_LEN_1 */
10714 { "kxord", { MaskG, MaskVex, MaskR }, 0 },
10717 /* MOD_VEX_W_0_0F4A_P_0_LEN_1 */
10719 { "kaddw", { MaskG, MaskVex, MaskR }, 0 },
10722 /* MOD_VEX_W_1_0F4A_P_0_LEN_1 */
10724 { "kaddq", { MaskG, MaskVex, MaskR }, 0 },
10727 /* MOD_VEX_W_0_0F4A_P_2_LEN_1 */
10729 { "kaddb", { MaskG, MaskVex, MaskR }, 0 },
10732 /* MOD_VEX_W_1_0F4A_P_2_LEN_1 */
10734 { "kaddd", { MaskG, MaskVex, MaskR }, 0 },
10737 /* MOD_VEX_W_0_0F4B_P_0_LEN_1 */
10739 { "kunpckwd", { MaskG, MaskVex, MaskR }, 0 },
10742 /* MOD_VEX_W_1_0F4B_P_0_LEN_1 */
10744 { "kunpckdq", { MaskG, MaskVex, MaskR }, 0 },
10747 /* MOD_VEX_W_0_0F4B_P_2_LEN_1 */
10749 { "kunpckbw", { MaskG, MaskVex, MaskR }, 0 },
10754 { "vmovmskpX", { Gdq, XS }, 0 },
10757 /* MOD_VEX_0F71_REG_2 */
10759 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_2) },
10762 /* MOD_VEX_0F71_REG_4 */
10764 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_4) },
10767 /* MOD_VEX_0F71_REG_6 */
10769 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_6) },
10772 /* MOD_VEX_0F72_REG_2 */
10774 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_2) },
10777 /* MOD_VEX_0F72_REG_4 */
10779 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_4) },
10782 /* MOD_VEX_0F72_REG_6 */
10784 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_6) },
10787 /* MOD_VEX_0F73_REG_2 */
10789 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_2) },
10792 /* MOD_VEX_0F73_REG_3 */
10794 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_3) },
10797 /* MOD_VEX_0F73_REG_6 */
10799 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_6) },
10802 /* MOD_VEX_0F73_REG_7 */
10804 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_7) },
10807 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
10808 { "kmovw", { Ew, MaskG }, 0 },
10812 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
10813 { "kmovq", { Eq, MaskG }, 0 },
10817 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
10818 { "kmovb", { Eb, MaskG }, 0 },
10822 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
10823 { "kmovd", { Ed, MaskG }, 0 },
10827 /* MOD_VEX_W_0_0F92_P_0_LEN_0 */
10829 { "kmovw", { MaskG, Rdq }, 0 },
10832 /* MOD_VEX_W_0_0F92_P_2_LEN_0 */
10834 { "kmovb", { MaskG, Rdq }, 0 },
10837 /* MOD_VEX_0F92_P_3_LEN_0 */
10839 { "kmovK", { MaskG, Rdq }, 0 },
10842 /* MOD_VEX_W_0_0F93_P_0_LEN_0 */
10844 { "kmovw", { Gdq, MaskR }, 0 },
10847 /* MOD_VEX_W_0_0F93_P_2_LEN_0 */
10849 { "kmovb", { Gdq, MaskR }, 0 },
10852 /* MOD_VEX_0F93_P_3_LEN_0 */
10854 { "kmovK", { Gdq, MaskR }, 0 },
10857 /* MOD_VEX_W_0_0F98_P_0_LEN_0 */
10859 { "kortestw", { MaskG, MaskR }, 0 },
10862 /* MOD_VEX_W_1_0F98_P_0_LEN_0 */
10864 { "kortestq", { MaskG, MaskR }, 0 },
10867 /* MOD_VEX_W_0_0F98_P_2_LEN_0 */
10869 { "kortestb", { MaskG, MaskR }, 0 },
10872 /* MOD_VEX_W_1_0F98_P_2_LEN_0 */
10874 { "kortestd", { MaskG, MaskR }, 0 },
10877 /* MOD_VEX_W_0_0F99_P_0_LEN_0 */
10879 { "ktestw", { MaskG, MaskR }, 0 },
10882 /* MOD_VEX_W_1_0F99_P_0_LEN_0 */
10884 { "ktestq", { MaskG, MaskR }, 0 },
10887 /* MOD_VEX_W_0_0F99_P_2_LEN_0 */
10889 { "ktestb", { MaskG, MaskR }, 0 },
10892 /* MOD_VEX_W_1_0F99_P_2_LEN_0 */
10894 { "ktestd", { MaskG, MaskR }, 0 },
10897 /* MOD_VEX_0FAE_REG_2 */
10898 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0) },
10901 /* MOD_VEX_0FAE_REG_3 */
10902 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0) },
10905 /* MOD_VEX_0FD7_PREFIX_2 */
10907 { "vpmovmskb", { Gdq, XS }, 0 },
10910 /* MOD_VEX_0FE7_PREFIX_2 */
10911 { "vmovntdq", { Mx, XM }, 0 },
10914 /* MOD_VEX_0FF0_PREFIX_3 */
10915 { "vlddqu", { XM, M }, 0 },
10918 /* MOD_VEX_0F381A_PREFIX_2 */
10919 { VEX_LEN_TABLE (VEX_LEN_0F381A_P_2_M_0) },
10922 /* MOD_VEX_0F382A_PREFIX_2 */
10923 { "vmovntdqa", { XM, Mx }, 0 },
10926 /* MOD_VEX_0F382C_PREFIX_2 */
10927 { VEX_W_TABLE (VEX_W_0F382C_P_2_M_0) },
10930 /* MOD_VEX_0F382D_PREFIX_2 */
10931 { VEX_W_TABLE (VEX_W_0F382D_P_2_M_0) },
10934 /* MOD_VEX_0F382E_PREFIX_2 */
10935 { VEX_W_TABLE (VEX_W_0F382E_P_2_M_0) },
10938 /* MOD_VEX_0F382F_PREFIX_2 */
10939 { VEX_W_TABLE (VEX_W_0F382F_P_2_M_0) },
10942 /* MOD_VEX_0F385A_PREFIX_2 */
10943 { VEX_LEN_TABLE (VEX_LEN_0F385A_P_2_M_0) },
10946 /* MOD_VEX_0F388C_PREFIX_2 */
10947 { "vpmaskmov%LW", { XM, Vex, Mx }, 0 },
10950 /* MOD_VEX_0F388E_PREFIX_2 */
10951 { "vpmaskmov%LW", { Mx, Vex, XM }, 0 },
10954 /* MOD_VEX_W_0_0F3A30_P_2_LEN_0 */
10956 { "kshiftrb", { MaskG, MaskR, Ib }, 0 },
10959 /* MOD_VEX_W_1_0F3A30_P_2_LEN_0 */
10961 { "kshiftrw", { MaskG, MaskR, Ib }, 0 },
10964 /* MOD_VEX_W_0_0F3A31_P_2_LEN_0 */
10966 { "kshiftrd", { MaskG, MaskR, Ib }, 0 },
10969 /* MOD_VEX_W_1_0F3A31_P_2_LEN_0 */
10971 { "kshiftrq", { MaskG, MaskR, Ib }, 0 },
10974 /* MOD_VEX_W_0_0F3A32_P_2_LEN_0 */
10976 { "kshiftlb", { MaskG, MaskR, Ib }, 0 },
10979 /* MOD_VEX_W_1_0F3A32_P_2_LEN_0 */
10981 { "kshiftlw", { MaskG, MaskR, Ib }, 0 },
10984 /* MOD_VEX_W_0_0F3A33_P_2_LEN_0 */
10986 { "kshiftld", { MaskG, MaskR, Ib }, 0 },
10989 /* MOD_VEX_W_1_0F3A33_P_2_LEN_0 */
10991 { "kshiftlq", { MaskG, MaskR, Ib }, 0 },
10994 #include "i386-dis-evex-mod.h"
10997 static const struct dis386 rm_table[][8] = {
11000 { "xabort", { Skip_MODRM, Ib }, 0 },
11004 { "xbeginT", { Skip_MODRM, Jv }, 0 },
11007 /* RM_0F01_REG_0 */
11008 { "enclv", { Skip_MODRM }, 0 },
11009 { "vmcall", { Skip_MODRM }, 0 },
11010 { "vmlaunch", { Skip_MODRM }, 0 },
11011 { "vmresume", { Skip_MODRM }, 0 },
11012 { "vmxoff", { Skip_MODRM }, 0 },
11013 { "pconfig", { Skip_MODRM }, 0 },
11016 /* RM_0F01_REG_1 */
11017 { "monitor", { { OP_Monitor, 0 } }, 0 },
11018 { "mwait", { { OP_Mwait, 0 } }, 0 },
11019 { "clac", { Skip_MODRM }, 0 },
11020 { "stac", { Skip_MODRM }, 0 },
11024 { "encls", { Skip_MODRM }, 0 },
11027 /* RM_0F01_REG_2 */
11028 { "xgetbv", { Skip_MODRM }, 0 },
11029 { "xsetbv", { Skip_MODRM }, 0 },
11032 { "vmfunc", { Skip_MODRM }, 0 },
11033 { "xend", { Skip_MODRM }, 0 },
11034 { "xtest", { Skip_MODRM }, 0 },
11035 { "enclu", { Skip_MODRM }, 0 },
11038 /* RM_0F01_REG_3 */
11039 { "vmrun", { Skip_MODRM }, 0 },
11040 { "vmmcall", { Skip_MODRM }, 0 },
11041 { "vmload", { Skip_MODRM }, 0 },
11042 { "vmsave", { Skip_MODRM }, 0 },
11043 { "stgi", { Skip_MODRM }, 0 },
11044 { "clgi", { Skip_MODRM }, 0 },
11045 { "skinit", { Skip_MODRM }, 0 },
11046 { "invlpga", { Skip_MODRM }, 0 },
11049 /* RM_0F01_REG_5 */
11050 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_0) },
11052 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_2) },
11056 { "rdpkru", { Skip_MODRM }, 0 },
11057 { "wrpkru", { Skip_MODRM }, 0 },
11060 /* RM_0F01_REG_7 */
11061 { "swapgs", { Skip_MODRM }, 0 },
11062 { "rdtscp", { Skip_MODRM }, 0 },
11063 { "monitorx", { { OP_Monitor, 0 } }, 0 },
11064 { "mwaitx", { { OP_Mwaitx, 0 } }, 0 },
11065 { "clzero", { Skip_MODRM }, 0 },
11068 /* RM_0F1E_MOD_3_REG_7 */
11069 { "nopQ", { Ev }, 0 },
11070 { "nopQ", { Ev }, 0 },
11071 { "endbr64", { Skip_MODRM }, PREFIX_OPCODE },
11072 { "endbr32", { Skip_MODRM }, PREFIX_OPCODE },
11073 { "nopQ", { Ev }, 0 },
11074 { "nopQ", { Ev }, 0 },
11075 { "nopQ", { Ev }, 0 },
11076 { "nopQ", { Ev }, 0 },
11079 /* RM_0FAE_REG_6 */
11080 { "mfence", { Skip_MODRM }, 0 },
11083 /* RM_0FAE_REG_7 */
11084 { "sfence", { Skip_MODRM }, 0 },
11089 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
11091 /* We use the high bit to indicate different name for the same
11093 #define REP_PREFIX (0xf3 | 0x100)
11094 #define XACQUIRE_PREFIX (0xf2 | 0x200)
11095 #define XRELEASE_PREFIX (0xf3 | 0x400)
11096 #define BND_PREFIX (0xf2 | 0x400)
11097 #define NOTRACK_PREFIX (0x3e | 0x100)
11102 int newrex, i, length;
11108 last_lock_prefix = -1;
11109 last_repz_prefix = -1;
11110 last_repnz_prefix = -1;
11111 last_data_prefix = -1;
11112 last_addr_prefix = -1;
11113 last_rex_prefix = -1;
11114 last_seg_prefix = -1;
11116 active_seg_prefix = 0;
11117 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
11118 all_prefixes[i] = 0;
11121 /* The maximum instruction length is 15bytes. */
11122 while (length < MAX_CODE_LENGTH - 1)
11124 FETCH_DATA (the_info, codep + 1);
11128 /* REX prefixes family. */
11145 if (address_mode == mode_64bit)
11149 last_rex_prefix = i;
11152 prefixes |= PREFIX_REPZ;
11153 last_repz_prefix = i;
11156 prefixes |= PREFIX_REPNZ;
11157 last_repnz_prefix = i;
11160 prefixes |= PREFIX_LOCK;
11161 last_lock_prefix = i;
11164 prefixes |= PREFIX_CS;
11165 last_seg_prefix = i;
11166 active_seg_prefix = PREFIX_CS;
11169 prefixes |= PREFIX_SS;
11170 last_seg_prefix = i;
11171 active_seg_prefix = PREFIX_SS;
11174 prefixes |= PREFIX_DS;
11175 last_seg_prefix = i;
11176 active_seg_prefix = PREFIX_DS;
11179 prefixes |= PREFIX_ES;
11180 last_seg_prefix = i;
11181 active_seg_prefix = PREFIX_ES;
11184 prefixes |= PREFIX_FS;
11185 last_seg_prefix = i;
11186 active_seg_prefix = PREFIX_FS;
11189 prefixes |= PREFIX_GS;
11190 last_seg_prefix = i;
11191 active_seg_prefix = PREFIX_GS;
11194 prefixes |= PREFIX_DATA;
11195 last_data_prefix = i;
11198 prefixes |= PREFIX_ADDR;
11199 last_addr_prefix = i;
11202 /* fwait is really an instruction. If there are prefixes
11203 before the fwait, they belong to the fwait, *not* to the
11204 following instruction. */
11206 if (prefixes || rex)
11208 prefixes |= PREFIX_FWAIT;
11210 /* This ensures that the previous REX prefixes are noticed
11211 as unused prefixes, as in the return case below. */
11215 prefixes = PREFIX_FWAIT;
11220 /* Rex is ignored when followed by another prefix. */
11226 if (*codep != FWAIT_OPCODE)
11227 all_prefixes[i++] = *codep;
11235 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
11238 static const char *
11239 prefix_name (int pref, int sizeflag)
11241 static const char *rexes [16] =
11244 "rex.B", /* 0x41 */
11245 "rex.X", /* 0x42 */
11246 "rex.XB", /* 0x43 */
11247 "rex.R", /* 0x44 */
11248 "rex.RB", /* 0x45 */
11249 "rex.RX", /* 0x46 */
11250 "rex.RXB", /* 0x47 */
11251 "rex.W", /* 0x48 */
11252 "rex.WB", /* 0x49 */
11253 "rex.WX", /* 0x4a */
11254 "rex.WXB", /* 0x4b */
11255 "rex.WR", /* 0x4c */
11256 "rex.WRB", /* 0x4d */
11257 "rex.WRX", /* 0x4e */
11258 "rex.WRXB", /* 0x4f */
11263 /* REX prefixes family. */
11280 return rexes [pref - 0x40];
11300 return (sizeflag & DFLAG) ? "data16" : "data32";
11302 if (address_mode == mode_64bit)
11303 return (sizeflag & AFLAG) ? "addr32" : "addr64";
11305 return (sizeflag & AFLAG) ? "addr16" : "addr32";
11310 case XACQUIRE_PREFIX:
11312 case XRELEASE_PREFIX:
11316 case NOTRACK_PREFIX:
11323 static char op_out[MAX_OPERANDS][100];
11324 static int op_ad, op_index[MAX_OPERANDS];
11325 static int two_source_ops;
11326 static bfd_vma op_address[MAX_OPERANDS];
11327 static bfd_vma op_riprel[MAX_OPERANDS];
11328 static bfd_vma start_pc;
11331 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
11332 * (see topic "Redundant prefixes" in the "Differences from 8086"
11333 * section of the "Virtual 8086 Mode" chapter.)
11334 * 'pc' should be the address of this instruction, it will
11335 * be used to print the target address if this is a relative jump or call
11336 * The function returns the length of this instruction in bytes.
11339 static char intel_syntax;
11340 static char intel_mnemonic = !SYSV386_COMPAT;
11341 static char open_char;
11342 static char close_char;
11343 static char separator_char;
11344 static char scale_char;
11352 static enum x86_64_isa isa64;
11354 /* Here for backwards compatibility. When gdb stops using
11355 print_insn_i386_att and print_insn_i386_intel these functions can
11356 disappear, and print_insn_i386 be merged into print_insn. */
11358 print_insn_i386_att (bfd_vma pc, disassemble_info *info)
11362 return print_insn (pc, info);
11366 print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
11370 return print_insn (pc, info);
11374 print_insn_i386 (bfd_vma pc, disassemble_info *info)
11378 return print_insn (pc, info);
11382 print_i386_disassembler_options (FILE *stream)
11384 fprintf (stream, _("\n\
11385 The following i386/x86-64 specific disassembler options are supported for use\n\
11386 with the -M switch (multiple options should be separated by commas):\n"));
11388 fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n"));
11389 fprintf (stream, _(" i386 Disassemble in 32bit mode\n"));
11390 fprintf (stream, _(" i8086 Disassemble in 16bit mode\n"));
11391 fprintf (stream, _(" att Display instruction in AT&T syntax\n"));
11392 fprintf (stream, _(" intel Display instruction in Intel syntax\n"));
11393 fprintf (stream, _(" att-mnemonic\n"
11394 " Display instruction in AT&T mnemonic\n"));
11395 fprintf (stream, _(" intel-mnemonic\n"
11396 " Display instruction in Intel mnemonic\n"));
11397 fprintf (stream, _(" addr64 Assume 64bit address size\n"));
11398 fprintf (stream, _(" addr32 Assume 32bit address size\n"));
11399 fprintf (stream, _(" addr16 Assume 16bit address size\n"));
11400 fprintf (stream, _(" data32 Assume 32bit data size\n"));
11401 fprintf (stream, _(" data16 Assume 16bit data size\n"));
11402 fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n"));
11403 fprintf (stream, _(" amd64 Display instruction in AMD64 ISA\n"));
11404 fprintf (stream, _(" intel64 Display instruction in Intel64 ISA\n"));
11408 static const struct dis386 bad_opcode = { "(bad)", { XX }, 0 };
11410 /* Get a pointer to struct dis386 with a valid name. */
11412 static const struct dis386 *
11413 get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
11415 int vindex, vex_table_index;
11417 if (dp->name != NULL)
11420 switch (dp->op[0].bytemode)
11422 case USE_REG_TABLE:
11423 dp = ®_table[dp->op[1].bytemode][modrm.reg];
11426 case USE_MOD_TABLE:
11427 vindex = modrm.mod == 0x3 ? 1 : 0;
11428 dp = &mod_table[dp->op[1].bytemode][vindex];
11432 dp = &rm_table[dp->op[1].bytemode][modrm.rm];
11435 case USE_PREFIX_TABLE:
11438 /* The prefix in VEX is implicit. */
11439 switch (vex.prefix)
11444 case REPE_PREFIX_OPCODE:
11447 case DATA_PREFIX_OPCODE:
11450 case REPNE_PREFIX_OPCODE:
11460 int last_prefix = -1;
11463 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
11464 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
11466 if ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) != 0)
11468 if (last_repz_prefix > last_repnz_prefix)
11471 prefix = PREFIX_REPZ;
11472 last_prefix = last_repz_prefix;
11477 prefix = PREFIX_REPNZ;
11478 last_prefix = last_repnz_prefix;
11481 /* Check if prefix should be ignored. */
11482 if ((((prefix_table[dp->op[1].bytemode][vindex].prefix_requirement
11483 & PREFIX_IGNORED) >> PREFIX_IGNORED_SHIFT)
11488 if (vindex == 0 && (prefixes & PREFIX_DATA) != 0)
11491 prefix = PREFIX_DATA;
11492 last_prefix = last_data_prefix;
11497 used_prefixes |= prefix;
11498 all_prefixes[last_prefix] = 0;
11501 dp = &prefix_table[dp->op[1].bytemode][vindex];
11504 case USE_X86_64_TABLE:
11505 vindex = address_mode == mode_64bit ? 1 : 0;
11506 dp = &x86_64_table[dp->op[1].bytemode][vindex];
11509 case USE_3BYTE_TABLE:
11510 FETCH_DATA (info, codep + 2);
11512 dp = &three_byte_table[dp->op[1].bytemode][vindex];
11514 modrm.mod = (*codep >> 6) & 3;
11515 modrm.reg = (*codep >> 3) & 7;
11516 modrm.rm = *codep & 7;
11519 case USE_VEX_LEN_TABLE:
11523 switch (vex.length)
11536 dp = &vex_len_table[dp->op[1].bytemode][vindex];
11539 case USE_EVEX_LEN_TABLE:
11543 switch (vex.length)
11559 dp = &evex_len_table[dp->op[1].bytemode][vindex];
11562 case USE_XOP_8F_TABLE:
11563 FETCH_DATA (info, codep + 3);
11564 /* All bits in the REX prefix are ignored. */
11566 rex = ~(*codep >> 5) & 0x7;
11568 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
11569 switch ((*codep & 0x1f))
11575 vex_table_index = XOP_08;
11578 vex_table_index = XOP_09;
11581 vex_table_index = XOP_0A;
11585 vex.w = *codep & 0x80;
11586 if (vex.w && address_mode == mode_64bit)
11589 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11590 if (address_mode != mode_64bit)
11592 /* In 16/32-bit mode REX_B is silently ignored. */
11596 vex.length = (*codep & 0x4) ? 256 : 128;
11597 switch ((*codep & 0x3))
11602 vex.prefix = DATA_PREFIX_OPCODE;
11605 vex.prefix = REPE_PREFIX_OPCODE;
11608 vex.prefix = REPNE_PREFIX_OPCODE;
11615 dp = &xop_table[vex_table_index][vindex];
11618 FETCH_DATA (info, codep + 1);
11619 modrm.mod = (*codep >> 6) & 3;
11620 modrm.reg = (*codep >> 3) & 7;
11621 modrm.rm = *codep & 7;
11624 case USE_VEX_C4_TABLE:
11626 FETCH_DATA (info, codep + 3);
11627 /* All bits in the REX prefix are ignored. */
11629 rex = ~(*codep >> 5) & 0x7;
11630 switch ((*codep & 0x1f))
11636 vex_table_index = VEX_0F;
11639 vex_table_index = VEX_0F38;
11642 vex_table_index = VEX_0F3A;
11646 vex.w = *codep & 0x80;
11647 if (address_mode == mode_64bit)
11654 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
11655 is ignored, other REX bits are 0 and the highest bit in
11656 VEX.vvvv is also ignored (but we mustn't clear it here). */
11659 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11660 vex.length = (*codep & 0x4) ? 256 : 128;
11661 switch ((*codep & 0x3))
11666 vex.prefix = DATA_PREFIX_OPCODE;
11669 vex.prefix = REPE_PREFIX_OPCODE;
11672 vex.prefix = REPNE_PREFIX_OPCODE;
11679 dp = &vex_table[vex_table_index][vindex];
11681 /* There is no MODRM byte for VEX0F 77. */
11682 if (vex_table_index != VEX_0F || vindex != 0x77)
11684 FETCH_DATA (info, codep + 1);
11685 modrm.mod = (*codep >> 6) & 3;
11686 modrm.reg = (*codep >> 3) & 7;
11687 modrm.rm = *codep & 7;
11691 case USE_VEX_C5_TABLE:
11693 FETCH_DATA (info, codep + 2);
11694 /* All bits in the REX prefix are ignored. */
11696 rex = (*codep & 0x80) ? 0 : REX_R;
11698 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
11700 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11701 vex.length = (*codep & 0x4) ? 256 : 128;
11702 switch ((*codep & 0x3))
11707 vex.prefix = DATA_PREFIX_OPCODE;
11710 vex.prefix = REPE_PREFIX_OPCODE;
11713 vex.prefix = REPNE_PREFIX_OPCODE;
11720 dp = &vex_table[dp->op[1].bytemode][vindex];
11722 /* There is no MODRM byte for VEX 77. */
11723 if (vindex != 0x77)
11725 FETCH_DATA (info, codep + 1);
11726 modrm.mod = (*codep >> 6) & 3;
11727 modrm.reg = (*codep >> 3) & 7;
11728 modrm.rm = *codep & 7;
11732 case USE_VEX_W_TABLE:
11736 dp = &vex_w_table[dp->op[1].bytemode][vex.w ? 1 : 0];
11739 case USE_EVEX_TABLE:
11740 two_source_ops = 0;
11743 FETCH_DATA (info, codep + 4);
11744 /* All bits in the REX prefix are ignored. */
11746 /* The first byte after 0x62. */
11747 rex = ~(*codep >> 5) & 0x7;
11748 vex.r = *codep & 0x10;
11749 switch ((*codep & 0xf))
11752 return &bad_opcode;
11754 vex_table_index = EVEX_0F;
11757 vex_table_index = EVEX_0F38;
11760 vex_table_index = EVEX_0F3A;
11764 /* The second byte after 0x62. */
11766 vex.w = *codep & 0x80;
11767 if (vex.w && address_mode == mode_64bit)
11770 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11773 if (!(*codep & 0x4))
11774 return &bad_opcode;
11776 switch ((*codep & 0x3))
11781 vex.prefix = DATA_PREFIX_OPCODE;
11784 vex.prefix = REPE_PREFIX_OPCODE;
11787 vex.prefix = REPNE_PREFIX_OPCODE;
11791 /* The third byte after 0x62. */
11794 /* Remember the static rounding bits. */
11795 vex.ll = (*codep >> 5) & 3;
11796 vex.b = (*codep & 0x10) != 0;
11798 vex.v = *codep & 0x8;
11799 vex.mask_register_specifier = *codep & 0x7;
11800 vex.zeroing = *codep & 0x80;
11802 if (address_mode != mode_64bit)
11804 /* In 16/32-bit mode silently ignore following bits. */
11814 dp = &evex_table[vex_table_index][vindex];
11816 FETCH_DATA (info, codep + 1);
11817 modrm.mod = (*codep >> 6) & 3;
11818 modrm.reg = (*codep >> 3) & 7;
11819 modrm.rm = *codep & 7;
11821 /* Set vector length. */
11822 if (modrm.mod == 3 && vex.b)
11838 return &bad_opcode;
11851 if (dp->name != NULL)
11854 return get_valid_dis386 (dp, info);
11858 get_sib (disassemble_info *info, int sizeflag)
11860 /* If modrm.mod == 3, operand must be register. */
11862 && ((sizeflag & AFLAG) || address_mode == mode_64bit)
11866 FETCH_DATA (info, codep + 2);
11867 sib.index = (codep [1] >> 3) & 7;
11868 sib.scale = (codep [1] >> 6) & 3;
11869 sib.base = codep [1] & 7;
11874 print_insn (bfd_vma pc, disassemble_info *info)
11876 const struct dis386 *dp;
11878 char *op_txt[MAX_OPERANDS];
11880 int sizeflag, orig_sizeflag;
11882 struct dis_private priv;
11885 priv.orig_sizeflag = AFLAG | DFLAG;
11886 if ((info->mach & bfd_mach_i386_i386) != 0)
11887 address_mode = mode_32bit;
11888 else if (info->mach == bfd_mach_i386_i8086)
11890 address_mode = mode_16bit;
11891 priv.orig_sizeflag = 0;
11894 address_mode = mode_64bit;
11896 if (intel_syntax == (char) -1)
11897 intel_syntax = (info->mach & bfd_mach_i386_intel_syntax) != 0;
11899 for (p = info->disassembler_options; p != NULL; )
11901 if (CONST_STRNEQ (p, "amd64"))
11903 else if (CONST_STRNEQ (p, "intel64"))
11905 else if (CONST_STRNEQ (p, "x86-64"))
11907 address_mode = mode_64bit;
11908 priv.orig_sizeflag = AFLAG | DFLAG;
11910 else if (CONST_STRNEQ (p, "i386"))
11912 address_mode = mode_32bit;
11913 priv.orig_sizeflag = AFLAG | DFLAG;
11915 else if (CONST_STRNEQ (p, "i8086"))
11917 address_mode = mode_16bit;
11918 priv.orig_sizeflag = 0;
11920 else if (CONST_STRNEQ (p, "intel"))
11923 if (CONST_STRNEQ (p + 5, "-mnemonic"))
11924 intel_mnemonic = 1;
11926 else if (CONST_STRNEQ (p, "att"))
11929 if (CONST_STRNEQ (p + 3, "-mnemonic"))
11930 intel_mnemonic = 0;
11932 else if (CONST_STRNEQ (p, "addr"))
11934 if (address_mode == mode_64bit)
11936 if (p[4] == '3' && p[5] == '2')
11937 priv.orig_sizeflag &= ~AFLAG;
11938 else if (p[4] == '6' && p[5] == '4')
11939 priv.orig_sizeflag |= AFLAG;
11943 if (p[4] == '1' && p[5] == '6')
11944 priv.orig_sizeflag &= ~AFLAG;
11945 else if (p[4] == '3' && p[5] == '2')
11946 priv.orig_sizeflag |= AFLAG;
11949 else if (CONST_STRNEQ (p, "data"))
11951 if (p[4] == '1' && p[5] == '6')
11952 priv.orig_sizeflag &= ~DFLAG;
11953 else if (p[4] == '3' && p[5] == '2')
11954 priv.orig_sizeflag |= DFLAG;
11956 else if (CONST_STRNEQ (p, "suffix"))
11957 priv.orig_sizeflag |= SUFFIX_ALWAYS;
11959 p = strchr (p, ',');
11964 if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
11966 (*info->fprintf_func) (info->stream,
11967 _("64-bit address is disabled"));
11973 names64 = intel_names64;
11974 names32 = intel_names32;
11975 names16 = intel_names16;
11976 names8 = intel_names8;
11977 names8rex = intel_names8rex;
11978 names_seg = intel_names_seg;
11979 names_mm = intel_names_mm;
11980 names_bnd = intel_names_bnd;
11981 names_xmm = intel_names_xmm;
11982 names_ymm = intel_names_ymm;
11983 names_zmm = intel_names_zmm;
11984 index64 = intel_index64;
11985 index32 = intel_index32;
11986 names_mask = intel_names_mask;
11987 index16 = intel_index16;
11990 separator_char = '+';
11995 names64 = att_names64;
11996 names32 = att_names32;
11997 names16 = att_names16;
11998 names8 = att_names8;
11999 names8rex = att_names8rex;
12000 names_seg = att_names_seg;
12001 names_mm = att_names_mm;
12002 names_bnd = att_names_bnd;
12003 names_xmm = att_names_xmm;
12004 names_ymm = att_names_ymm;
12005 names_zmm = att_names_zmm;
12006 index64 = att_index64;
12007 index32 = att_index32;
12008 names_mask = att_names_mask;
12009 index16 = att_index16;
12012 separator_char = ',';
12016 /* The output looks better if we put 7 bytes on a line, since that
12017 puts most long word instructions on a single line. Use 8 bytes
12019 if ((info->mach & bfd_mach_l1om) != 0)
12020 info->bytes_per_line = 8;
12022 info->bytes_per_line = 7;
12024 info->private_data = &priv;
12025 priv.max_fetched = priv.the_buffer;
12026 priv.insn_start = pc;
12029 for (i = 0; i < MAX_OPERANDS; ++i)
12037 start_codep = priv.the_buffer;
12038 codep = priv.the_buffer;
12040 if (OPCODES_SIGSETJMP (priv.bailout) != 0)
12044 /* Getting here means we tried for data but didn't get it. That
12045 means we have an incomplete instruction of some sort. Just
12046 print the first byte as a prefix or a .byte pseudo-op. */
12047 if (codep > priv.the_buffer)
12049 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
12051 (*info->fprintf_func) (info->stream, "%s", name);
12054 /* Just print the first byte as a .byte instruction. */
12055 (*info->fprintf_func) (info->stream, ".byte 0x%x",
12056 (unsigned int) priv.the_buffer[0]);
12066 sizeflag = priv.orig_sizeflag;
12068 if (!ckprefix () || rex_used)
12070 /* Too many prefixes or unused REX prefixes. */
12072 i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i];
12074 (*info->fprintf_func) (info->stream, "%s%s",
12076 prefix_name (all_prefixes[i], sizeflag));
12080 insn_codep = codep;
12082 FETCH_DATA (info, codep + 1);
12083 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
12085 if (((prefixes & PREFIX_FWAIT)
12086 && ((*codep < 0xd8) || (*codep > 0xdf))))
12088 /* Handle prefixes before fwait. */
12089 for (i = 0; i < fwait_prefix && all_prefixes[i];
12091 (*info->fprintf_func) (info->stream, "%s ",
12092 prefix_name (all_prefixes[i], sizeflag));
12093 (*info->fprintf_func) (info->stream, "fwait");
12097 if (*codep == 0x0f)
12099 unsigned char threebyte;
12102 FETCH_DATA (info, codep + 1);
12103 threebyte = *codep;
12104 dp = &dis386_twobyte[threebyte];
12105 need_modrm = twobyte_has_modrm[*codep];
12110 dp = &dis386[*codep];
12111 need_modrm = onebyte_has_modrm[*codep];
12115 /* Save sizeflag for printing the extra prefixes later before updating
12116 it for mnemonic and operand processing. The prefix names depend
12117 only on the address mode. */
12118 orig_sizeflag = sizeflag;
12119 if (prefixes & PREFIX_ADDR)
12121 if ((prefixes & PREFIX_DATA))
12127 FETCH_DATA (info, codep + 1);
12128 modrm.mod = (*codep >> 6) & 3;
12129 modrm.reg = (*codep >> 3) & 7;
12130 modrm.rm = *codep & 7;
12136 memset (&vex, 0, sizeof (vex));
12138 if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
12140 get_sib (info, sizeflag);
12141 dofloat (sizeflag);
12145 dp = get_valid_dis386 (dp, info);
12146 if (dp != NULL && putop (dp->name, sizeflag) == 0)
12148 get_sib (info, sizeflag);
12149 for (i = 0; i < MAX_OPERANDS; ++i)
12152 op_ad = MAX_OPERANDS - 1 - i;
12154 (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
12155 /* For EVEX instruction after the last operand masking
12156 should be printed. */
12157 if (i == 0 && vex.evex)
12159 /* Don't print {%k0}. */
12160 if (vex.mask_register_specifier)
12163 oappend (names_mask[vex.mask_register_specifier]);
12173 /* If VEX.vvvv and EVEX.vvvv are unused, they must be all 1s, which
12174 are all 0s in inverted form. */
12175 if (need_vex && vex.register_specifier != 0)
12177 (*info->fprintf_func) (info->stream, "(bad)");
12178 return end_codep - priv.the_buffer;
12181 /* Check if the REX prefix is used. */
12182 if (rex_ignored == 0 && (rex ^ rex_used) == 0 && last_rex_prefix >= 0)
12183 all_prefixes[last_rex_prefix] = 0;
12185 /* Check if the SEG prefix is used. */
12186 if ((prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES
12187 | PREFIX_FS | PREFIX_GS)) != 0
12188 && (used_prefixes & active_seg_prefix) != 0)
12189 all_prefixes[last_seg_prefix] = 0;
12191 /* Check if the ADDR prefix is used. */
12192 if ((prefixes & PREFIX_ADDR) != 0
12193 && (used_prefixes & PREFIX_ADDR) != 0)
12194 all_prefixes[last_addr_prefix] = 0;
12196 /* Check if the DATA prefix is used. */
12197 if ((prefixes & PREFIX_DATA) != 0
12198 && (used_prefixes & PREFIX_DATA) != 0)
12199 all_prefixes[last_data_prefix] = 0;
12201 /* Print the extra prefixes. */
12203 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
12204 if (all_prefixes[i])
12207 name = prefix_name (all_prefixes[i], orig_sizeflag);
12210 prefix_length += strlen (name) + 1;
12211 (*info->fprintf_func) (info->stream, "%s ", name);
12214 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
12215 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
12216 used by putop and MMX/SSE operand and may be overriden by the
12217 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
12219 if (dp->prefix_requirement == PREFIX_OPCODE
12220 && dp != &bad_opcode
12222 & (PREFIX_REPZ | PREFIX_REPNZ)) != 0
12224 & (PREFIX_REPZ | PREFIX_REPNZ)) == 0)
12226 & (PREFIX_REPZ | PREFIX_REPNZ | PREFIX_DATA))
12228 && (used_prefixes & PREFIX_DATA) == 0))))
12230 (*info->fprintf_func) (info->stream, "(bad)");
12231 return end_codep - priv.the_buffer;
12234 /* Check maximum code length. */
12235 if ((codep - start_codep) > MAX_CODE_LENGTH)
12237 (*info->fprintf_func) (info->stream, "(bad)");
12238 return MAX_CODE_LENGTH;
12241 obufp = mnemonicendp;
12242 for (i = strlen (obuf) + prefix_length; i < 6; i++)
12245 (*info->fprintf_func) (info->stream, "%s", obuf);
12247 /* The enter and bound instructions are printed with operands in the same
12248 order as the intel book; everything else is printed in reverse order. */
12249 if (intel_syntax || two_source_ops)
12253 for (i = 0; i < MAX_OPERANDS; ++i)
12254 op_txt[i] = op_out[i];
12256 if (intel_syntax && dp && dp->op[2].rtn == OP_Rounding
12257 && dp->op[3].rtn == OP_E && dp->op[4].rtn == NULL)
12259 op_txt[2] = op_out[3];
12260 op_txt[3] = op_out[2];
12263 for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
12265 op_ad = op_index[i];
12266 op_index[i] = op_index[MAX_OPERANDS - 1 - i];
12267 op_index[MAX_OPERANDS - 1 - i] = op_ad;
12268 riprel = op_riprel[i];
12269 op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
12270 op_riprel[MAX_OPERANDS - 1 - i] = riprel;
12275 for (i = 0; i < MAX_OPERANDS; ++i)
12276 op_txt[MAX_OPERANDS - 1 - i] = op_out[i];
12280 for (i = 0; i < MAX_OPERANDS; ++i)
12284 (*info->fprintf_func) (info->stream, ",");
12285 if (op_index[i] != -1 && !op_riprel[i])
12286 (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info);
12288 (*info->fprintf_func) (info->stream, "%s", op_txt[i]);
12292 for (i = 0; i < MAX_OPERANDS; i++)
12293 if (op_index[i] != -1 && op_riprel[i])
12295 (*info->fprintf_func) (info->stream, " # ");
12296 (*info->print_address_func) ((bfd_vma) (start_pc + (codep - start_codep)
12297 + op_address[op_index[i]]), info);
12300 return codep - priv.the_buffer;
12303 static const char *float_mem[] = {
12378 static const unsigned char float_mem_mode[] = {
12453 #define ST { OP_ST, 0 }
12454 #define STi { OP_STi, 0 }
12456 #define FGRPd9_2 NULL, { { NULL, 1 } }, 0
12457 #define FGRPd9_4 NULL, { { NULL, 2 } }, 0
12458 #define FGRPd9_5 NULL, { { NULL, 3 } }, 0
12459 #define FGRPd9_6 NULL, { { NULL, 4 } }, 0
12460 #define FGRPd9_7 NULL, { { NULL, 5 } }, 0
12461 #define FGRPda_5 NULL, { { NULL, 6 } }, 0
12462 #define FGRPdb_4 NULL, { { NULL, 7 } }, 0
12463 #define FGRPde_3 NULL, { { NULL, 8 } }, 0
12464 #define FGRPdf_4 NULL, { { NULL, 9 } }, 0
12466 static const struct dis386 float_reg[][8] = {
12469 { "fadd", { ST, STi }, 0 },
12470 { "fmul", { ST, STi }, 0 },
12471 { "fcom", { STi }, 0 },
12472 { "fcomp", { STi }, 0 },
12473 { "fsub", { ST, STi }, 0 },
12474 { "fsubr", { ST, STi }, 0 },
12475 { "fdiv", { ST, STi }, 0 },
12476 { "fdivr", { ST, STi }, 0 },
12480 { "fld", { STi }, 0 },
12481 { "fxch", { STi }, 0 },
12491 { "fcmovb", { ST, STi }, 0 },
12492 { "fcmove", { ST, STi }, 0 },
12493 { "fcmovbe",{ ST, STi }, 0 },
12494 { "fcmovu", { ST, STi }, 0 },
12502 { "fcmovnb",{ ST, STi }, 0 },
12503 { "fcmovne",{ ST, STi }, 0 },
12504 { "fcmovnbe",{ ST, STi }, 0 },
12505 { "fcmovnu",{ ST, STi }, 0 },
12507 { "fucomi", { ST, STi }, 0 },
12508 { "fcomi", { ST, STi }, 0 },
12513 { "fadd", { STi, ST }, 0 },
12514 { "fmul", { STi, ST }, 0 },
12517 { "fsub{!M|r}", { STi, ST }, 0 },
12518 { "fsub{M|}", { STi, ST }, 0 },
12519 { "fdiv{!M|r}", { STi, ST }, 0 },
12520 { "fdiv{M|}", { STi, ST }, 0 },
12524 { "ffree", { STi }, 0 },
12526 { "fst", { STi }, 0 },
12527 { "fstp", { STi }, 0 },
12528 { "fucom", { STi }, 0 },
12529 { "fucomp", { STi }, 0 },
12535 { "faddp", { STi, ST }, 0 },
12536 { "fmulp", { STi, ST }, 0 },
12539 { "fsub{!M|r}p", { STi, ST }, 0 },
12540 { "fsub{M|}p", { STi, ST }, 0 },
12541 { "fdiv{!M|r}p", { STi, ST }, 0 },
12542 { "fdiv{M|}p", { STi, ST }, 0 },
12546 { "ffreep", { STi }, 0 },
12551 { "fucomip", { ST, STi }, 0 },
12552 { "fcomip", { ST, STi }, 0 },
12557 static char *fgrps[][8] = {
12560 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12565 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12570 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
12575 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
12580 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
12585 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
12590 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12595 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
12596 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
12601 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12606 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12611 swap_operand (void)
12613 mnemonicendp[0] = '.';
12614 mnemonicendp[1] = 's';
12619 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
12620 int sizeflag ATTRIBUTE_UNUSED)
12622 /* Skip mod/rm byte. */
12628 dofloat (int sizeflag)
12630 const struct dis386 *dp;
12631 unsigned char floatop;
12633 floatop = codep[-1];
12635 if (modrm.mod != 3)
12637 int fp_indx = (floatop - 0xd8) * 8 + modrm.reg;
12639 putop (float_mem[fp_indx], sizeflag);
12642 OP_E (float_mem_mode[fp_indx], sizeflag);
12645 /* Skip mod/rm byte. */
12649 dp = &float_reg[floatop - 0xd8][modrm.reg];
12650 if (dp->name == NULL)
12652 putop (fgrps[dp->op[0].bytemode][modrm.rm], sizeflag);
12654 /* Instruction fnstsw is only one with strange arg. */
12655 if (floatop == 0xdf && codep[-1] == 0xe0)
12656 strcpy (op_out[0], names16[0]);
12660 putop (dp->name, sizeflag);
12665 (*dp->op[0].rtn) (dp->op[0].bytemode, sizeflag);
12670 (*dp->op[1].rtn) (dp->op[1].bytemode, sizeflag);
12674 /* Like oappend (below), but S is a string starting with '%'.
12675 In Intel syntax, the '%' is elided. */
12677 oappend_maybe_intel (const char *s)
12679 oappend (s + intel_syntax);
12683 OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
12685 oappend_maybe_intel ("%st");
12689 OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
12691 sprintf (scratchbuf, "%%st(%d)", modrm.rm);
12692 oappend_maybe_intel (scratchbuf);
12695 /* Capital letters in template are macros. */
12697 putop (const char *in_template, int sizeflag)
12702 unsigned int l = 0, len = 1;
12705 #define SAVE_LAST(c) \
12706 if (l < len && l < sizeof (last)) \
12711 for (p = in_template; *p; p++)
12727 while (*++p != '|')
12728 if (*p == '}' || *p == '\0')
12731 /* Fall through. */
12736 while (*++p != '}')
12747 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
12751 if (l == 0 && len == 1)
12756 if (sizeflag & SUFFIX_ALWAYS)
12769 if (address_mode == mode_64bit
12770 && !(prefixes & PREFIX_ADDR))
12781 if (intel_syntax && !alt)
12783 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
12785 if (sizeflag & DFLAG)
12786 *obufp++ = intel_syntax ? 'd' : 'l';
12788 *obufp++ = intel_syntax ? 'w' : 's';
12789 used_prefixes |= (prefixes & PREFIX_DATA);
12793 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
12796 if (modrm.mod == 3)
12802 if (sizeflag & DFLAG)
12803 *obufp++ = intel_syntax ? 'd' : 'l';
12806 used_prefixes |= (prefixes & PREFIX_DATA);
12812 case 'E': /* For jcxz/jecxz */
12813 if (address_mode == mode_64bit)
12815 if (sizeflag & AFLAG)
12821 if (sizeflag & AFLAG)
12823 used_prefixes |= (prefixes & PREFIX_ADDR);
12828 if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))
12830 if (sizeflag & AFLAG)
12831 *obufp++ = address_mode == mode_64bit ? 'q' : 'l';
12833 *obufp++ = address_mode == mode_64bit ? 'l' : 'w';
12834 used_prefixes |= (prefixes & PREFIX_ADDR);
12838 if (intel_syntax || (obufp[-1] != 's' && !(sizeflag & SUFFIX_ALWAYS)))
12840 if ((rex & REX_W) || (sizeflag & DFLAG))
12844 if (!(rex & REX_W))
12845 used_prefixes |= (prefixes & PREFIX_DATA);
12850 if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS
12851 || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)
12853 used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);
12856 if (prefixes & PREFIX_DS)
12875 if (l != 0 || len != 1)
12877 if (l != 1 || len != 2 || last[0] != 'X')
12882 if (!need_vex || !vex.evex)
12885 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
12887 switch (vex.length)
12905 if (address_mode == mode_64bit && (sizeflag & SUFFIX_ALWAYS))
12910 /* Fall through. */
12913 if (l != 0 || len != 1)
12921 if (sizeflag & SUFFIX_ALWAYS)
12925 if (intel_mnemonic != cond)
12929 if ((prefixes & PREFIX_FWAIT) == 0)
12932 used_prefixes |= PREFIX_FWAIT;
12938 else if (intel_syntax && (sizeflag & DFLAG))
12942 if (!(rex & REX_W))
12943 used_prefixes |= (prefixes & PREFIX_DATA);
12947 && address_mode == mode_64bit
12948 && isa64 == intel64)
12953 /* Fall through. */
12956 && address_mode == mode_64bit
12957 && ((sizeflag & DFLAG) || (rex & REX_W)))
12962 /* Fall through. */
12965 if (l == 0 && len == 1)
12970 if ((rex & REX_W) == 0
12971 && (prefixes & PREFIX_DATA))
12973 if ((sizeflag & DFLAG) == 0)
12975 used_prefixes |= (prefixes & PREFIX_DATA);
12979 if ((prefixes & PREFIX_DATA)
12981 || (sizeflag & SUFFIX_ALWAYS))
12988 if (sizeflag & DFLAG)
12992 used_prefixes |= (prefixes & PREFIX_DATA);
12998 if (l != 1 || len != 2 || last[0] != 'L')
13004 if ((prefixes & PREFIX_DATA)
13006 || (sizeflag & SUFFIX_ALWAYS))
13013 if (sizeflag & DFLAG)
13014 *obufp++ = intel_syntax ? 'd' : 'l';
13017 used_prefixes |= (prefixes & PREFIX_DATA);
13025 if (address_mode == mode_64bit
13026 && ((sizeflag & DFLAG) || (rex & REX_W)))
13028 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
13032 /* Fall through. */
13035 if (l == 0 && len == 1)
13038 if (intel_syntax && !alt)
13041 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
13047 if (sizeflag & DFLAG)
13048 *obufp++ = intel_syntax ? 'd' : 'l';
13051 used_prefixes |= (prefixes & PREFIX_DATA);
13057 if (l != 1 || len != 2 || last[0] != 'L')
13063 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
13078 else if (sizeflag & DFLAG)
13087 if (intel_syntax && !p[1]
13088 && ((rex & REX_W) || (sizeflag & DFLAG)))
13090 if (!(rex & REX_W))
13091 used_prefixes |= (prefixes & PREFIX_DATA);
13094 if (l == 0 && len == 1)
13098 if (address_mode == mode_64bit
13099 && ((sizeflag & DFLAG) || (rex & REX_W)))
13101 if (sizeflag & SUFFIX_ALWAYS)
13123 /* Fall through. */
13126 if (l == 0 && len == 1)
13131 if (sizeflag & SUFFIX_ALWAYS)
13137 if (sizeflag & DFLAG)
13141 used_prefixes |= (prefixes & PREFIX_DATA);
13155 if (address_mode == mode_64bit
13156 && !(prefixes & PREFIX_ADDR))
13167 if (l != 0 || len != 1)
13172 if (need_vex && vex.prefix)
13174 if (vex.prefix == DATA_PREFIX_OPCODE)
13181 if (prefixes & PREFIX_DATA)
13185 used_prefixes |= (prefixes & PREFIX_DATA);
13189 if (l == 0 && len == 1)
13193 if (l != 1 || len != 2 || last[0] != 'X')
13201 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
13203 switch (vex.length)
13219 if (l == 0 && len == 1)
13221 /* operand size flag for cwtl, cbtw */
13230 else if (sizeflag & DFLAG)
13234 if (!(rex & REX_W))
13235 used_prefixes |= (prefixes & PREFIX_DATA);
13242 && last[0] != 'L'))
13249 if (last[0] == 'X')
13250 *obufp++ = vex.w ? 'd': 's';
13252 *obufp++ = vex.w ? 'q': 'd';
13258 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
13260 if (sizeflag & DFLAG)
13264 used_prefixes |= (prefixes & PREFIX_DATA);
13270 if (address_mode == mode_64bit
13271 && (isa64 == intel64
13272 || ((sizeflag & DFLAG) || (rex & REX_W))))
13274 else if ((prefixes & PREFIX_DATA))
13276 if (!(sizeflag & DFLAG))
13278 used_prefixes |= (prefixes & PREFIX_DATA);
13285 mnemonicendp = obufp;
13290 oappend (const char *s)
13292 obufp = stpcpy (obufp, s);
13298 /* Only print the active segment register. */
13299 if (!active_seg_prefix)
13302 used_prefixes |= active_seg_prefix;
13303 switch (active_seg_prefix)
13306 oappend_maybe_intel ("%cs:");
13309 oappend_maybe_intel ("%ds:");
13312 oappend_maybe_intel ("%ss:");
13315 oappend_maybe_intel ("%es:");
13318 oappend_maybe_intel ("%fs:");
13321 oappend_maybe_intel ("%gs:");
13329 OP_indirE (int bytemode, int sizeflag)
13333 OP_E (bytemode, sizeflag);
13337 print_operand_value (char *buf, int hex, bfd_vma disp)
13339 if (address_mode == mode_64bit)
13347 sprintf_vma (tmp, disp);
13348 for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
13349 strcpy (buf + 2, tmp + i);
13353 bfd_signed_vma v = disp;
13360 /* Check for possible overflow on 0x8000000000000000. */
13363 strcpy (buf, "9223372036854775808");
13377 tmp[28 - i] = (v % 10) + '0';
13381 strcpy (buf, tmp + 29 - i);
13387 sprintf (buf, "0x%x", (unsigned int) disp);
13389 sprintf (buf, "%d", (int) disp);
13393 /* Put DISP in BUF as signed hex number. */
13396 print_displacement (char *buf, bfd_vma disp)
13398 bfd_signed_vma val = disp;
13407 /* Check for possible overflow. */
13410 switch (address_mode)
13413 strcpy (buf + j, "0x8000000000000000");
13416 strcpy (buf + j, "0x80000000");
13419 strcpy (buf + j, "0x8000");
13429 sprintf_vma (tmp, (bfd_vma) val);
13430 for (i = 0; tmp[i] == '0'; i++)
13432 if (tmp[i] == '\0')
13434 strcpy (buf + j, tmp + i);
13438 intel_operand_size (int bytemode, int sizeflag)
13442 && (bytemode == x_mode
13443 || bytemode == evex_half_bcst_xmmq_mode))
13446 oappend ("QWORD PTR ");
13448 oappend ("DWORD PTR ");
13457 oappend ("BYTE PTR ");
13462 oappend ("WORD PTR ");
13465 if (address_mode == mode_64bit && isa64 == intel64)
13467 oappend ("QWORD PTR ");
13470 /* Fall through. */
13472 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
13474 oappend ("QWORD PTR ");
13477 /* Fall through. */
13483 oappend ("QWORD PTR ");
13486 if ((sizeflag & DFLAG) || bytemode == dq_mode)
13487 oappend ("DWORD PTR ");
13489 oappend ("WORD PTR ");
13490 used_prefixes |= (prefixes & PREFIX_DATA);
13494 if ((rex & REX_W) || (sizeflag & DFLAG))
13496 oappend ("WORD PTR ");
13497 if (!(rex & REX_W))
13498 used_prefixes |= (prefixes & PREFIX_DATA);
13501 if (sizeflag & DFLAG)
13502 oappend ("QWORD PTR ");
13504 oappend ("DWORD PTR ");
13505 used_prefixes |= (prefixes & PREFIX_DATA);
13508 case d_scalar_mode:
13509 case d_scalar_swap_mode:
13512 oappend ("DWORD PTR ");
13515 case q_scalar_mode:
13516 case q_scalar_swap_mode:
13518 oappend ("QWORD PTR ");
13521 if (address_mode == mode_64bit)
13522 oappend ("QWORD PTR ");
13524 oappend ("DWORD PTR ");
13527 if (sizeflag & DFLAG)
13528 oappend ("FWORD PTR ");
13530 oappend ("DWORD PTR ");
13531 used_prefixes |= (prefixes & PREFIX_DATA);
13534 oappend ("TBYTE PTR ");
13538 case evex_x_gscat_mode:
13539 case evex_x_nobcst_mode:
13540 case b_scalar_mode:
13541 case w_scalar_mode:
13544 switch (vex.length)
13547 oappend ("XMMWORD PTR ");
13550 oappend ("YMMWORD PTR ");
13553 oappend ("ZMMWORD PTR ");
13560 oappend ("XMMWORD PTR ");
13563 oappend ("XMMWORD PTR ");
13566 oappend ("YMMWORD PTR ");
13569 case evex_half_bcst_xmmq_mode:
13573 switch (vex.length)
13576 oappend ("QWORD PTR ");
13579 oappend ("XMMWORD PTR ");
13582 oappend ("YMMWORD PTR ");
13592 switch (vex.length)
13597 oappend ("BYTE PTR ");
13607 switch (vex.length)
13612 oappend ("WORD PTR ");
13622 switch (vex.length)
13627 oappend ("DWORD PTR ");
13637 switch (vex.length)
13642 oappend ("QWORD PTR ");
13652 switch (vex.length)
13655 oappend ("WORD PTR ");
13658 oappend ("DWORD PTR ");
13661 oappend ("QWORD PTR ");
13671 switch (vex.length)
13674 oappend ("DWORD PTR ");
13677 oappend ("QWORD PTR ");
13680 oappend ("XMMWORD PTR ");
13690 switch (vex.length)
13693 oappend ("QWORD PTR ");
13696 oappend ("YMMWORD PTR ");
13699 oappend ("ZMMWORD PTR ");
13709 switch (vex.length)
13713 oappend ("XMMWORD PTR ");
13720 oappend ("OWORD PTR ");
13723 case vex_w_dq_mode:
13724 case vex_scalar_w_dq_mode:
13729 oappend ("QWORD PTR ");
13731 oappend ("DWORD PTR ");
13733 case vex_vsib_d_w_dq_mode:
13734 case vex_vsib_q_w_dq_mode:
13741 oappend ("QWORD PTR ");
13743 oappend ("DWORD PTR ");
13747 switch (vex.length)
13750 oappend ("XMMWORD PTR ");
13753 oappend ("YMMWORD PTR ");
13756 oappend ("ZMMWORD PTR ");
13763 case vex_vsib_q_w_d_mode:
13764 case vex_vsib_d_w_d_mode:
13765 if (!need_vex || !vex.evex)
13768 switch (vex.length)
13771 oappend ("QWORD PTR ");
13774 oappend ("XMMWORD PTR ");
13777 oappend ("YMMWORD PTR ");
13785 if (!need_vex || vex.length != 128)
13788 oappend ("DWORD PTR ");
13790 oappend ("BYTE PTR ");
13796 oappend ("QWORD PTR ");
13798 oappend ("WORD PTR ");
13808 OP_E_register (int bytemode, int sizeflag)
13810 int reg = modrm.rm;
13811 const char **names;
13817 if ((sizeflag & SUFFIX_ALWAYS)
13818 && (bytemode == b_swap_mode
13819 || bytemode == bnd_swap_mode
13820 || bytemode == v_swap_mode))
13846 names = address_mode == mode_64bit ? names64 : names32;
13849 case bnd_swap_mode:
13858 if (address_mode == mode_64bit && isa64 == intel64)
13863 /* Fall through. */
13865 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
13871 /* Fall through. */
13883 if ((sizeflag & DFLAG)
13884 || (bytemode != v_mode
13885 && bytemode != v_swap_mode))
13889 used_prefixes |= (prefixes & PREFIX_DATA);
13893 names = (address_mode == mode_64bit
13894 ? names64 : names32);
13895 if (!(prefixes & PREFIX_ADDR))
13896 names = (address_mode == mode_16bit
13897 ? names16 : names);
13900 /* Remove "addr16/addr32". */
13901 all_prefixes[last_addr_prefix] = 0;
13902 names = (address_mode != mode_32bit
13903 ? names32 : names16);
13904 used_prefixes |= PREFIX_ADDR;
13914 names = names_mask;
13919 oappend (INTERNAL_DISASSEMBLER_ERROR);
13922 oappend (names[reg]);
13926 OP_E_memory (int bytemode, int sizeflag)
13929 int add = (rex & REX_B) ? 8 : 0;
13935 /* In EVEX, if operand doesn't allow broadcast, vex.b should be 0. */
13937 && bytemode != x_mode
13938 && bytemode != xmmq_mode
13939 && bytemode != evex_half_bcst_xmmq_mode)
13955 if (address_mode != mode_64bit)
13961 case vex_vsib_d_w_dq_mode:
13962 case vex_vsib_d_w_d_mode:
13963 case vex_vsib_q_w_dq_mode:
13964 case vex_vsib_q_w_d_mode:
13965 case evex_x_gscat_mode:
13967 shift = vex.w ? 3 : 2;
13970 case evex_half_bcst_xmmq_mode:
13974 shift = vex.w ? 3 : 2;
13977 /* Fall through. */
13981 case evex_x_nobcst_mode:
13983 switch (vex.length)
14006 case q_scalar_mode:
14008 case q_scalar_swap_mode:
14014 case d_scalar_mode:
14016 case d_scalar_swap_mode:
14019 case w_scalar_mode:
14023 case b_scalar_mode:
14030 /* Make necessary corrections to shift for modes that need it.
14031 For these modes we currently have shift 4, 5 or 6 depending on
14032 vex.length (it corresponds to xmmword, ymmword or zmmword
14033 operand). We might want to make it 3, 4 or 5 (e.g. for
14034 xmmq_mode). In case of broadcast enabled the corrections
14035 aren't needed, as element size is always 32 or 64 bits. */
14037 && (bytemode == xmmq_mode
14038 || bytemode == evex_half_bcst_xmmq_mode))
14040 else if (bytemode == xmmqd_mode)
14042 else if (bytemode == xmmdw_mode)
14044 else if (bytemode == ymmq_mode && vex.length == 128)
14052 intel_operand_size (bytemode, sizeflag);
14055 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
14057 /* 32/64 bit address mode */
14067 int addr32flag = !((sizeflag & AFLAG)
14068 || bytemode == v_bnd_mode
14069 || bytemode == v_bndmk_mode
14070 || bytemode == bnd_mode
14071 || bytemode == bnd_swap_mode);
14072 const char **indexes64 = names64;
14073 const char **indexes32 = names32;
14083 vindex = sib.index;
14089 case vex_vsib_d_w_dq_mode:
14090 case vex_vsib_d_w_d_mode:
14091 case vex_vsib_q_w_dq_mode:
14092 case vex_vsib_q_w_d_mode:
14102 switch (vex.length)
14105 indexes64 = indexes32 = names_xmm;
14109 || bytemode == vex_vsib_q_w_dq_mode
14110 || bytemode == vex_vsib_q_w_d_mode)
14111 indexes64 = indexes32 = names_ymm;
14113 indexes64 = indexes32 = names_xmm;
14117 || bytemode == vex_vsib_q_w_dq_mode
14118 || bytemode == vex_vsib_q_w_d_mode)
14119 indexes64 = indexes32 = names_zmm;
14121 indexes64 = indexes32 = names_ymm;
14128 haveindex = vindex != 4;
14135 rbase = base + add;
14143 if (address_mode == mode_64bit && !havesib)
14146 if (riprel && bytemode == v_bndmk_mode)
14154 FETCH_DATA (the_info, codep + 1);
14156 if ((disp & 0x80) != 0)
14158 if (vex.evex && shift > 0)
14171 && address_mode != mode_16bit)
14173 if (address_mode == mode_64bit)
14175 /* Display eiz instead of addr32. */
14176 needindex = addr32flag;
14181 /* In 32-bit mode, we need index register to tell [offset]
14182 from [eiz*1 + offset]. */
14187 havedisp = (havebase
14189 || (havesib && (haveindex || scale != 0)));
14192 if (modrm.mod != 0 || base == 5)
14194 if (havedisp || riprel)
14195 print_displacement (scratchbuf, disp);
14197 print_operand_value (scratchbuf, 1, disp);
14198 oappend (scratchbuf);
14202 oappend (!addr32flag ? "(%rip)" : "(%eip)");
14206 if ((havebase || haveindex || needaddr32 || riprel)
14207 && (bytemode != v_bnd_mode)
14208 && (bytemode != v_bndmk_mode)
14209 && (bytemode != bnd_mode)
14210 && (bytemode != bnd_swap_mode))
14211 used_prefixes |= PREFIX_ADDR;
14213 if (havedisp || (intel_syntax && riprel))
14215 *obufp++ = open_char;
14216 if (intel_syntax && riprel)
14219 oappend (!addr32flag ? "rip" : "eip");
14223 oappend (address_mode == mode_64bit && !addr32flag
14224 ? names64[rbase] : names32[rbase]);
14227 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
14228 print index to tell base + index from base. */
14232 || (havebase && base != ESP_REG_NUM))
14234 if (!intel_syntax || havebase)
14236 *obufp++ = separator_char;
14240 oappend (address_mode == mode_64bit && !addr32flag
14241 ? indexes64[vindex] : indexes32[vindex]);
14243 oappend (address_mode == mode_64bit && !addr32flag
14244 ? index64 : index32);
14246 *obufp++ = scale_char;
14248 sprintf (scratchbuf, "%d", 1 << scale);
14249 oappend (scratchbuf);
14253 && (disp || modrm.mod != 0 || base == 5))
14255 if (!havedisp || (bfd_signed_vma) disp >= 0)
14260 else if (modrm.mod != 1 && disp != -disp)
14264 disp = - (bfd_signed_vma) disp;
14268 print_displacement (scratchbuf, disp);
14270 print_operand_value (scratchbuf, 1, disp);
14271 oappend (scratchbuf);
14274 *obufp++ = close_char;
14277 else if (intel_syntax)
14279 if (modrm.mod != 0 || base == 5)
14281 if (!active_seg_prefix)
14283 oappend (names_seg[ds_reg - es_reg]);
14286 print_operand_value (scratchbuf, 1, disp);
14287 oappend (scratchbuf);
14293 /* 16 bit address mode */
14294 used_prefixes |= prefixes & PREFIX_ADDR;
14301 if ((disp & 0x8000) != 0)
14306 FETCH_DATA (the_info, codep + 1);
14308 if ((disp & 0x80) != 0)
14310 if (vex.evex && shift > 0)
14315 if ((disp & 0x8000) != 0)
14321 if (modrm.mod != 0 || modrm.rm == 6)
14323 print_displacement (scratchbuf, disp);
14324 oappend (scratchbuf);
14327 if (modrm.mod != 0 || modrm.rm != 6)
14329 *obufp++ = open_char;
14331 oappend (index16[modrm.rm]);
14333 && (disp || modrm.mod != 0 || modrm.rm == 6))
14335 if ((bfd_signed_vma) disp >= 0)
14340 else if (modrm.mod != 1)
14344 disp = - (bfd_signed_vma) disp;
14347 print_displacement (scratchbuf, disp);
14348 oappend (scratchbuf);
14351 *obufp++ = close_char;
14354 else if (intel_syntax)
14356 if (!active_seg_prefix)
14358 oappend (names_seg[ds_reg - es_reg]);
14361 print_operand_value (scratchbuf, 1, disp & 0xffff);
14362 oappend (scratchbuf);
14365 if (vex.evex && vex.b
14366 && (bytemode == x_mode
14367 || bytemode == xmmq_mode
14368 || bytemode == evex_half_bcst_xmmq_mode))
14371 || bytemode == xmmq_mode
14372 || bytemode == evex_half_bcst_xmmq_mode)
14374 switch (vex.length)
14377 oappend ("{1to2}");
14380 oappend ("{1to4}");
14383 oappend ("{1to8}");
14391 switch (vex.length)
14394 oappend ("{1to4}");
14397 oappend ("{1to8}");
14400 oappend ("{1to16}");
14410 OP_E (int bytemode, int sizeflag)
14412 /* Skip mod/rm byte. */
14416 if (modrm.mod == 3)
14417 OP_E_register (bytemode, sizeflag);
14419 OP_E_memory (bytemode, sizeflag);
14423 OP_G (int bytemode, int sizeflag)
14426 const char **names;
14435 oappend (names8rex[modrm.reg + add]);
14437 oappend (names8[modrm.reg + add]);
14440 oappend (names16[modrm.reg + add]);
14445 oappend (names32[modrm.reg + add]);
14448 oappend (names64[modrm.reg + add]);
14451 if (modrm.reg > 0x3)
14456 oappend (names_bnd[modrm.reg]);
14465 oappend (names64[modrm.reg + add]);
14468 if ((sizeflag & DFLAG) || bytemode != v_mode)
14469 oappend (names32[modrm.reg + add]);
14471 oappend (names16[modrm.reg + add]);
14472 used_prefixes |= (prefixes & PREFIX_DATA);
14476 names = (address_mode == mode_64bit
14477 ? names64 : names32);
14478 if (!(prefixes & PREFIX_ADDR))
14480 if (address_mode == mode_16bit)
14485 /* Remove "addr16/addr32". */
14486 all_prefixes[last_addr_prefix] = 0;
14487 names = (address_mode != mode_32bit
14488 ? names32 : names16);
14489 used_prefixes |= PREFIX_ADDR;
14491 oappend (names[modrm.reg + add]);
14494 if (address_mode == mode_64bit)
14495 oappend (names64[modrm.reg + add]);
14497 oappend (names32[modrm.reg + add]);
14501 if ((modrm.reg + add) > 0x7)
14506 oappend (names_mask[modrm.reg + add]);
14509 oappend (INTERNAL_DISASSEMBLER_ERROR);
14522 FETCH_DATA (the_info, codep + 8);
14523 a = *codep++ & 0xff;
14524 a |= (*codep++ & 0xff) << 8;
14525 a |= (*codep++ & 0xff) << 16;
14526 a |= (*codep++ & 0xffu) << 24;
14527 b = *codep++ & 0xff;
14528 b |= (*codep++ & 0xff) << 8;
14529 b |= (*codep++ & 0xff) << 16;
14530 b |= (*codep++ & 0xffu) << 24;
14531 x = a + ((bfd_vma) b << 32);
14539 static bfd_signed_vma
14542 bfd_signed_vma x = 0;
14544 FETCH_DATA (the_info, codep + 4);
14545 x = *codep++ & (bfd_signed_vma) 0xff;
14546 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
14547 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
14548 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
14552 static bfd_signed_vma
14555 bfd_signed_vma x = 0;
14557 FETCH_DATA (the_info, codep + 4);
14558 x = *codep++ & (bfd_signed_vma) 0xff;
14559 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
14560 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
14561 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
14563 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
14573 FETCH_DATA (the_info, codep + 2);
14574 x = *codep++ & 0xff;
14575 x |= (*codep++ & 0xff) << 8;
14580 set_op (bfd_vma op, int riprel)
14582 op_index[op_ad] = op_ad;
14583 if (address_mode == mode_64bit)
14585 op_address[op_ad] = op;
14586 op_riprel[op_ad] = riprel;
14590 /* Mask to get a 32-bit address. */
14591 op_address[op_ad] = op & 0xffffffff;
14592 op_riprel[op_ad] = riprel & 0xffffffff;
14597 OP_REG (int code, int sizeflag)
14604 case es_reg: case ss_reg: case cs_reg:
14605 case ds_reg: case fs_reg: case gs_reg:
14606 oappend (names_seg[code - es_reg]);
14618 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
14619 case sp_reg: case bp_reg: case si_reg: case di_reg:
14620 s = names16[code - ax_reg + add];
14622 case al_reg: case ah_reg: case cl_reg: case ch_reg:
14623 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
14626 s = names8rex[code - al_reg + add];
14628 s = names8[code - al_reg];
14630 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
14631 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
14632 if (address_mode == mode_64bit
14633 && ((sizeflag & DFLAG) || (rex & REX_W)))
14635 s = names64[code - rAX_reg + add];
14638 code += eAX_reg - rAX_reg;
14639 /* Fall through. */
14640 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
14641 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
14644 s = names64[code - eAX_reg + add];
14647 if (sizeflag & DFLAG)
14648 s = names32[code - eAX_reg + add];
14650 s = names16[code - eAX_reg + add];
14651 used_prefixes |= (prefixes & PREFIX_DATA);
14655 s = INTERNAL_DISASSEMBLER_ERROR;
14662 OP_IMREG (int code, int sizeflag)
14674 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
14675 case sp_reg: case bp_reg: case si_reg: case di_reg:
14676 s = names16[code - ax_reg];
14678 case es_reg: case ss_reg: case cs_reg:
14679 case ds_reg: case fs_reg: case gs_reg:
14680 s = names_seg[code - es_reg];
14682 case al_reg: case ah_reg: case cl_reg: case ch_reg:
14683 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
14686 s = names8rex[code - al_reg];
14688 s = names8[code - al_reg];
14690 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
14691 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
14694 s = names64[code - eAX_reg];
14697 if (sizeflag & DFLAG)
14698 s = names32[code - eAX_reg];
14700 s = names16[code - eAX_reg];
14701 used_prefixes |= (prefixes & PREFIX_DATA);
14704 case z_mode_ax_reg:
14705 if ((rex & REX_W) || (sizeflag & DFLAG))
14709 if (!(rex & REX_W))
14710 used_prefixes |= (prefixes & PREFIX_DATA);
14713 s = INTERNAL_DISASSEMBLER_ERROR;
14720 OP_I (int bytemode, int sizeflag)
14723 bfd_signed_vma mask = -1;
14728 FETCH_DATA (the_info, codep + 1);
14733 if (address_mode == mode_64bit)
14738 /* Fall through. */
14745 if (sizeflag & DFLAG)
14755 used_prefixes |= (prefixes & PREFIX_DATA);
14767 oappend (INTERNAL_DISASSEMBLER_ERROR);
14772 scratchbuf[0] = '$';
14773 print_operand_value (scratchbuf + 1, 1, op);
14774 oappend_maybe_intel (scratchbuf);
14775 scratchbuf[0] = '\0';
14779 OP_I64 (int bytemode, int sizeflag)
14781 if (bytemode != v_mode || address_mode != mode_64bit || !(rex & REX_W))
14783 OP_I (bytemode, sizeflag);
14789 scratchbuf[0] = '$';
14790 print_operand_value (scratchbuf + 1, 1, get64 ());
14791 oappend_maybe_intel (scratchbuf);
14792 scratchbuf[0] = '\0';
14796 OP_sI (int bytemode, int sizeflag)
14804 FETCH_DATA (the_info, codep + 1);
14806 if ((op & 0x80) != 0)
14808 if (bytemode == b_T_mode)
14810 if (address_mode != mode_64bit
14811 || !((sizeflag & DFLAG) || (rex & REX_W)))
14813 /* The operand-size prefix is overridden by a REX prefix. */
14814 if ((sizeflag & DFLAG) || (rex & REX_W))
14822 if (!(rex & REX_W))
14824 if (sizeflag & DFLAG)
14832 /* The operand-size prefix is overridden by a REX prefix. */
14833 if ((sizeflag & DFLAG) || (rex & REX_W))
14839 oappend (INTERNAL_DISASSEMBLER_ERROR);
14843 scratchbuf[0] = '$';
14844 print_operand_value (scratchbuf + 1, 1, op);
14845 oappend_maybe_intel (scratchbuf);
14849 OP_J (int bytemode, int sizeflag)
14853 bfd_vma segment = 0;
14858 FETCH_DATA (the_info, codep + 1);
14860 if ((disp & 0x80) != 0)
14864 if (isa64 == amd64)
14866 if ((sizeflag & DFLAG)
14867 || (address_mode == mode_64bit
14868 && (isa64 != amd64 || (rex & REX_W))))
14873 if ((disp & 0x8000) != 0)
14875 /* In 16bit mode, address is wrapped around at 64k within
14876 the same segment. Otherwise, a data16 prefix on a jump
14877 instruction means that the pc is masked to 16 bits after
14878 the displacement is added! */
14880 if ((prefixes & PREFIX_DATA) == 0)
14881 segment = ((start_pc + (codep - start_codep))
14882 & ~((bfd_vma) 0xffff));
14884 if (address_mode != mode_64bit
14885 || (isa64 == amd64 && !(rex & REX_W)))
14886 used_prefixes |= (prefixes & PREFIX_DATA);
14889 oappend (INTERNAL_DISASSEMBLER_ERROR);
14892 disp = ((start_pc + (codep - start_codep) + disp) & mask) | segment;
14894 print_operand_value (scratchbuf, 1, disp);
14895 oappend (scratchbuf);
14899 OP_SEG (int bytemode, int sizeflag)
14901 if (bytemode == w_mode)
14902 oappend (names_seg[modrm.reg]);
14904 OP_E (modrm.mod == 3 ? bytemode : w_mode, sizeflag);
14908 OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
14912 if (sizeflag & DFLAG)
14922 used_prefixes |= (prefixes & PREFIX_DATA);
14924 sprintf (scratchbuf, "0x%x:0x%x", seg, offset);
14926 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
14927 oappend (scratchbuf);
14931 OP_OFF (int bytemode, int sizeflag)
14935 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
14936 intel_operand_size (bytemode, sizeflag);
14939 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
14946 if (!active_seg_prefix)
14948 oappend (names_seg[ds_reg - es_reg]);
14952 print_operand_value (scratchbuf, 1, off);
14953 oappend (scratchbuf);
14957 OP_OFF64 (int bytemode, int sizeflag)
14961 if (address_mode != mode_64bit
14962 || (prefixes & PREFIX_ADDR))
14964 OP_OFF (bytemode, sizeflag);
14968 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
14969 intel_operand_size (bytemode, sizeflag);
14976 if (!active_seg_prefix)
14978 oappend (names_seg[ds_reg - es_reg]);
14982 print_operand_value (scratchbuf, 1, off);
14983 oappend (scratchbuf);
14987 ptr_reg (int code, int sizeflag)
14991 *obufp++ = open_char;
14992 used_prefixes |= (prefixes & PREFIX_ADDR);
14993 if (address_mode == mode_64bit)
14995 if (!(sizeflag & AFLAG))
14996 s = names32[code - eAX_reg];
14998 s = names64[code - eAX_reg];
15000 else if (sizeflag & AFLAG)
15001 s = names32[code - eAX_reg];
15003 s = names16[code - eAX_reg];
15005 *obufp++ = close_char;
15010 OP_ESreg (int code, int sizeflag)
15016 case 0x6d: /* insw/insl */
15017 intel_operand_size (z_mode, sizeflag);
15019 case 0xa5: /* movsw/movsl/movsq */
15020 case 0xa7: /* cmpsw/cmpsl/cmpsq */
15021 case 0xab: /* stosw/stosl */
15022 case 0xaf: /* scasw/scasl */
15023 intel_operand_size (v_mode, sizeflag);
15026 intel_operand_size (b_mode, sizeflag);
15029 oappend_maybe_intel ("%es:");
15030 ptr_reg (code, sizeflag);
15034 OP_DSreg (int code, int sizeflag)
15040 case 0x6f: /* outsw/outsl */
15041 intel_operand_size (z_mode, sizeflag);
15043 case 0xa5: /* movsw/movsl/movsq */
15044 case 0xa7: /* cmpsw/cmpsl/cmpsq */
15045 case 0xad: /* lodsw/lodsl/lodsq */
15046 intel_operand_size (v_mode, sizeflag);
15049 intel_operand_size (b_mode, sizeflag);
15052 /* Set active_seg_prefix to PREFIX_DS if it is unset so that the
15053 default segment register DS is printed. */
15054 if (!active_seg_prefix)
15055 active_seg_prefix = PREFIX_DS;
15057 ptr_reg (code, sizeflag);
15061 OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15069 else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
15071 all_prefixes[last_lock_prefix] = 0;
15072 used_prefixes |= PREFIX_LOCK;
15077 sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
15078 oappend_maybe_intel (scratchbuf);
15082 OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15091 sprintf (scratchbuf, "db%d", modrm.reg + add);
15093 sprintf (scratchbuf, "%%db%d", modrm.reg + add);
15094 oappend (scratchbuf);
15098 OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15100 sprintf (scratchbuf, "%%tr%d", modrm.reg);
15101 oappend_maybe_intel (scratchbuf);
15105 OP_R (int bytemode, int sizeflag)
15107 /* Skip mod/rm byte. */
15110 OP_E_register (bytemode, sizeflag);
15114 OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15116 int reg = modrm.reg;
15117 const char **names;
15119 used_prefixes |= (prefixes & PREFIX_DATA);
15120 if (prefixes & PREFIX_DATA)
15129 oappend (names[reg]);
15133 OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
15135 int reg = modrm.reg;
15136 const char **names;
15148 && bytemode != xmm_mode
15149 && bytemode != xmmq_mode
15150 && bytemode != evex_half_bcst_xmmq_mode
15151 && bytemode != ymm_mode
15152 && bytemode != scalar_mode)
15154 switch (vex.length)
15161 || (bytemode != vex_vsib_q_w_dq_mode
15162 && bytemode != vex_vsib_q_w_d_mode))
15174 else if (bytemode == xmmq_mode
15175 || bytemode == evex_half_bcst_xmmq_mode)
15177 switch (vex.length)
15190 else if (bytemode == ymm_mode)
15194 oappend (names[reg]);
15198 OP_EM (int bytemode, int sizeflag)
15201 const char **names;
15203 if (modrm.mod != 3)
15206 && (bytemode == v_mode || bytemode == v_swap_mode))
15208 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
15209 used_prefixes |= (prefixes & PREFIX_DATA);
15211 OP_E (bytemode, sizeflag);
15215 if ((sizeflag & SUFFIX_ALWAYS) && bytemode == v_swap_mode)
15218 /* Skip mod/rm byte. */
15221 used_prefixes |= (prefixes & PREFIX_DATA);
15223 if (prefixes & PREFIX_DATA)
15232 oappend (names[reg]);
15235 /* cvt* are the only instructions in sse2 which have
15236 both SSE and MMX operands and also have 0x66 prefix
15237 in their opcode. 0x66 was originally used to differentiate
15238 between SSE and MMX instruction(operands). So we have to handle the
15239 cvt* separately using OP_EMC and OP_MXC */
15241 OP_EMC (int bytemode, int sizeflag)
15243 if (modrm.mod != 3)
15245 if (intel_syntax && bytemode == v_mode)
15247 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
15248 used_prefixes |= (prefixes & PREFIX_DATA);
15250 OP_E (bytemode, sizeflag);
15254 /* Skip mod/rm byte. */
15257 used_prefixes |= (prefixes & PREFIX_DATA);
15258 oappend (names_mm[modrm.rm]);
15262 OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15264 used_prefixes |= (prefixes & PREFIX_DATA);
15265 oappend (names_mm[modrm.reg]);
15269 OP_EX (int bytemode, int sizeflag)
15272 const char **names;
15274 /* Skip mod/rm byte. */
15278 if (modrm.mod != 3)
15280 OP_E_memory (bytemode, sizeflag);
15295 if ((sizeflag & SUFFIX_ALWAYS)
15296 && (bytemode == x_swap_mode
15297 || bytemode == d_swap_mode
15298 || bytemode == d_scalar_swap_mode
15299 || bytemode == q_swap_mode
15300 || bytemode == q_scalar_swap_mode))
15304 && bytemode != xmm_mode
15305 && bytemode != xmmdw_mode
15306 && bytemode != xmmqd_mode
15307 && bytemode != xmm_mb_mode
15308 && bytemode != xmm_mw_mode
15309 && bytemode != xmm_md_mode
15310 && bytemode != xmm_mq_mode
15311 && bytemode != xmm_mdq_mode
15312 && bytemode != xmmq_mode
15313 && bytemode != evex_half_bcst_xmmq_mode
15314 && bytemode != ymm_mode
15315 && bytemode != d_scalar_mode
15316 && bytemode != d_scalar_swap_mode
15317 && bytemode != q_scalar_mode
15318 && bytemode != q_scalar_swap_mode
15319 && bytemode != vex_scalar_w_dq_mode)
15321 switch (vex.length)
15336 else if (bytemode == xmmq_mode
15337 || bytemode == evex_half_bcst_xmmq_mode)
15339 switch (vex.length)
15352 else if (bytemode == ymm_mode)
15356 oappend (names[reg]);
15360 OP_MS (int bytemode, int sizeflag)
15362 if (modrm.mod == 3)
15363 OP_EM (bytemode, sizeflag);
15369 OP_XS (int bytemode, int sizeflag)
15371 if (modrm.mod == 3)
15372 OP_EX (bytemode, sizeflag);
15378 OP_M (int bytemode, int sizeflag)
15380 if (modrm.mod == 3)
15381 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
15384 OP_E (bytemode, sizeflag);
15388 OP_0f07 (int bytemode, int sizeflag)
15390 if (modrm.mod != 3 || modrm.rm != 0)
15393 OP_E (bytemode, sizeflag);
15396 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
15397 32bit mode and "xchg %rax,%rax" in 64bit mode. */
15400 NOP_Fixup1 (int bytemode, int sizeflag)
15402 if ((prefixes & PREFIX_DATA) != 0
15405 && address_mode == mode_64bit))
15406 OP_REG (bytemode, sizeflag);
15408 strcpy (obuf, "nop");
15412 NOP_Fixup2 (int bytemode, int sizeflag)
15414 if ((prefixes & PREFIX_DATA) != 0
15417 && address_mode == mode_64bit))
15418 OP_IMREG (bytemode, sizeflag);
15421 static const char *const Suffix3DNow[] = {
15422 /* 00 */ NULL, NULL, NULL, NULL,
15423 /* 04 */ NULL, NULL, NULL, NULL,
15424 /* 08 */ NULL, NULL, NULL, NULL,
15425 /* 0C */ "pi2fw", "pi2fd", NULL, NULL,
15426 /* 10 */ NULL, NULL, NULL, NULL,
15427 /* 14 */ NULL, NULL, NULL, NULL,
15428 /* 18 */ NULL, NULL, NULL, NULL,
15429 /* 1C */ "pf2iw", "pf2id", NULL, NULL,
15430 /* 20 */ NULL, NULL, NULL, NULL,
15431 /* 24 */ NULL, NULL, NULL, NULL,
15432 /* 28 */ NULL, NULL, NULL, NULL,
15433 /* 2C */ NULL, NULL, NULL, NULL,
15434 /* 30 */ NULL, NULL, NULL, NULL,
15435 /* 34 */ NULL, NULL, NULL, NULL,
15436 /* 38 */ NULL, NULL, NULL, NULL,
15437 /* 3C */ NULL, NULL, NULL, NULL,
15438 /* 40 */ NULL, NULL, NULL, NULL,
15439 /* 44 */ NULL, NULL, NULL, NULL,
15440 /* 48 */ NULL, NULL, NULL, NULL,
15441 /* 4C */ NULL, NULL, NULL, NULL,
15442 /* 50 */ NULL, NULL, NULL, NULL,
15443 /* 54 */ NULL, NULL, NULL, NULL,
15444 /* 58 */ NULL, NULL, NULL, NULL,
15445 /* 5C */ NULL, NULL, NULL, NULL,
15446 /* 60 */ NULL, NULL, NULL, NULL,
15447 /* 64 */ NULL, NULL, NULL, NULL,
15448 /* 68 */ NULL, NULL, NULL, NULL,
15449 /* 6C */ NULL, NULL, NULL, NULL,
15450 /* 70 */ NULL, NULL, NULL, NULL,
15451 /* 74 */ NULL, NULL, NULL, NULL,
15452 /* 78 */ NULL, NULL, NULL, NULL,
15453 /* 7C */ NULL, NULL, NULL, NULL,
15454 /* 80 */ NULL, NULL, NULL, NULL,
15455 /* 84 */ NULL, NULL, NULL, NULL,
15456 /* 88 */ NULL, NULL, "pfnacc", NULL,
15457 /* 8C */ NULL, NULL, "pfpnacc", NULL,
15458 /* 90 */ "pfcmpge", NULL, NULL, NULL,
15459 /* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",
15460 /* 98 */ NULL, NULL, "pfsub", NULL,
15461 /* 9C */ NULL, NULL, "pfadd", NULL,
15462 /* A0 */ "pfcmpgt", NULL, NULL, NULL,
15463 /* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",
15464 /* A8 */ NULL, NULL, "pfsubr", NULL,
15465 /* AC */ NULL, NULL, "pfacc", NULL,
15466 /* B0 */ "pfcmpeq", NULL, NULL, NULL,
15467 /* B4 */ "pfmul", NULL, "pfrcpit2", "pmulhrw",
15468 /* B8 */ NULL, NULL, NULL, "pswapd",
15469 /* BC */ NULL, NULL, NULL, "pavgusb",
15470 /* C0 */ NULL, NULL, NULL, NULL,
15471 /* C4 */ NULL, NULL, NULL, NULL,
15472 /* C8 */ NULL, NULL, NULL, NULL,
15473 /* CC */ NULL, NULL, NULL, NULL,
15474 /* D0 */ NULL, NULL, NULL, NULL,
15475 /* D4 */ NULL, NULL, NULL, NULL,
15476 /* D8 */ NULL, NULL, NULL, NULL,
15477 /* DC */ NULL, NULL, NULL, NULL,
15478 /* E0 */ NULL, NULL, NULL, NULL,
15479 /* E4 */ NULL, NULL, NULL, NULL,
15480 /* E8 */ NULL, NULL, NULL, NULL,
15481 /* EC */ NULL, NULL, NULL, NULL,
15482 /* F0 */ NULL, NULL, NULL, NULL,
15483 /* F4 */ NULL, NULL, NULL, NULL,
15484 /* F8 */ NULL, NULL, NULL, NULL,
15485 /* FC */ NULL, NULL, NULL, NULL,
15489 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15491 const char *mnemonic;
15493 FETCH_DATA (the_info, codep + 1);
15494 /* AMD 3DNow! instructions are specified by an opcode suffix in the
15495 place where an 8-bit immediate would normally go. ie. the last
15496 byte of the instruction. */
15497 obufp = mnemonicendp;
15498 mnemonic = Suffix3DNow[*codep++ & 0xff];
15500 oappend (mnemonic);
15503 /* Since a variable sized modrm/sib chunk is between the start
15504 of the opcode (0x0f0f) and the opcode suffix, we need to do
15505 all the modrm processing first, and don't know until now that
15506 we have a bad opcode. This necessitates some cleaning up. */
15507 op_out[0][0] = '\0';
15508 op_out[1][0] = '\0';
15511 mnemonicendp = obufp;
15514 static struct op simd_cmp_op[] =
15516 { STRING_COMMA_LEN ("eq") },
15517 { STRING_COMMA_LEN ("lt") },
15518 { STRING_COMMA_LEN ("le") },
15519 { STRING_COMMA_LEN ("unord") },
15520 { STRING_COMMA_LEN ("neq") },
15521 { STRING_COMMA_LEN ("nlt") },
15522 { STRING_COMMA_LEN ("nle") },
15523 { STRING_COMMA_LEN ("ord") }
15527 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15529 unsigned int cmp_type;
15531 FETCH_DATA (the_info, codep + 1);
15532 cmp_type = *codep++ & 0xff;
15533 if (cmp_type < ARRAY_SIZE (simd_cmp_op))
15536 char *p = mnemonicendp - 2;
15540 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
15541 mnemonicendp += simd_cmp_op[cmp_type].len;
15545 /* We have a reserved extension byte. Output it directly. */
15546 scratchbuf[0] = '$';
15547 print_operand_value (scratchbuf + 1, 1, cmp_type);
15548 oappend_maybe_intel (scratchbuf);
15549 scratchbuf[0] = '\0';
15554 OP_Mwaitx (int bytemode ATTRIBUTE_UNUSED,
15555 int sizeflag ATTRIBUTE_UNUSED)
15557 /* mwaitx %eax,%ecx,%ebx */
15560 const char **names = (address_mode == mode_64bit
15561 ? names64 : names32);
15562 strcpy (op_out[0], names[0]);
15563 strcpy (op_out[1], names[1]);
15564 strcpy (op_out[2], names[3]);
15565 two_source_ops = 1;
15567 /* Skip mod/rm byte. */
15573 OP_Mwait (int bytemode ATTRIBUTE_UNUSED,
15574 int sizeflag ATTRIBUTE_UNUSED)
15576 /* mwait %eax,%ecx */
15579 const char **names = (address_mode == mode_64bit
15580 ? names64 : names32);
15581 strcpy (op_out[0], names[0]);
15582 strcpy (op_out[1], names[1]);
15583 two_source_ops = 1;
15585 /* Skip mod/rm byte. */
15591 OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
15592 int sizeflag ATTRIBUTE_UNUSED)
15594 /* monitor %eax,%ecx,%edx" */
15597 const char **op1_names;
15598 const char **names = (address_mode == mode_64bit
15599 ? names64 : names32);
15601 if (!(prefixes & PREFIX_ADDR))
15602 op1_names = (address_mode == mode_16bit
15603 ? names16 : names);
15606 /* Remove "addr16/addr32". */
15607 all_prefixes[last_addr_prefix] = 0;
15608 op1_names = (address_mode != mode_32bit
15609 ? names32 : names16);
15610 used_prefixes |= PREFIX_ADDR;
15612 strcpy (op_out[0], op1_names[0]);
15613 strcpy (op_out[1], names[1]);
15614 strcpy (op_out[2], names[2]);
15615 two_source_ops = 1;
15617 /* Skip mod/rm byte. */
15625 /* Throw away prefixes and 1st. opcode byte. */
15626 codep = insn_codep + 1;
15631 REP_Fixup (int bytemode, int sizeflag)
15633 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
15635 if (prefixes & PREFIX_REPZ)
15636 all_prefixes[last_repz_prefix] = REP_PREFIX;
15643 OP_IMREG (bytemode, sizeflag);
15646 OP_ESreg (bytemode, sizeflag);
15649 OP_DSreg (bytemode, sizeflag);
15657 /* For BND-prefixed instructions 0xF2 prefix should be displayed as
15661 BND_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15663 if (prefixes & PREFIX_REPNZ)
15664 all_prefixes[last_repnz_prefix] = BND_PREFIX;
15667 /* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
15671 NOTRACK_Fixup (int bytemode ATTRIBUTE_UNUSED,
15672 int sizeflag ATTRIBUTE_UNUSED)
15674 if (active_seg_prefix == PREFIX_DS
15675 && (address_mode != mode_64bit || last_data_prefix < 0))
15677 /* NOTRACK prefix is only valid on indirect branch instructions.
15678 NB: DATA prefix is unsupported for Intel64. */
15679 active_seg_prefix = 0;
15680 all_prefixes[last_seg_prefix] = NOTRACK_PREFIX;
15684 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
15685 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
15689 HLE_Fixup1 (int bytemode, int sizeflag)
15692 && (prefixes & PREFIX_LOCK) != 0)
15694 if (prefixes & PREFIX_REPZ)
15695 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15696 if (prefixes & PREFIX_REPNZ)
15697 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15700 OP_E (bytemode, sizeflag);
15703 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
15704 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
15708 HLE_Fixup2 (int bytemode, int sizeflag)
15710 if (modrm.mod != 3)
15712 if (prefixes & PREFIX_REPZ)
15713 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15714 if (prefixes & PREFIX_REPNZ)
15715 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15718 OP_E (bytemode, sizeflag);
15721 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
15722 "xrelease" for memory operand. No check for LOCK prefix. */
15725 HLE_Fixup3 (int bytemode, int sizeflag)
15728 && last_repz_prefix > last_repnz_prefix
15729 && (prefixes & PREFIX_REPZ) != 0)
15730 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15732 OP_E (bytemode, sizeflag);
15736 CMPXCHG8B_Fixup (int bytemode, int sizeflag)
15741 /* Change cmpxchg8b to cmpxchg16b. */
15742 char *p = mnemonicendp - 2;
15743 mnemonicendp = stpcpy (p, "16b");
15746 else if ((prefixes & PREFIX_LOCK) != 0)
15748 if (prefixes & PREFIX_REPZ)
15749 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15750 if (prefixes & PREFIX_REPNZ)
15751 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15754 OP_M (bytemode, sizeflag);
15758 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
15760 const char **names;
15764 switch (vex.length)
15778 oappend (names[reg]);
15782 CRC32_Fixup (int bytemode, int sizeflag)
15784 /* Add proper suffix to "crc32". */
15785 char *p = mnemonicendp;
15804 if (sizeflag & DFLAG)
15808 used_prefixes |= (prefixes & PREFIX_DATA);
15812 oappend (INTERNAL_DISASSEMBLER_ERROR);
15819 if (modrm.mod == 3)
15823 /* Skip mod/rm byte. */
15828 add = (rex & REX_B) ? 8 : 0;
15829 if (bytemode == b_mode)
15833 oappend (names8rex[modrm.rm + add]);
15835 oappend (names8[modrm.rm + add]);
15841 oappend (names64[modrm.rm + add]);
15842 else if ((prefixes & PREFIX_DATA))
15843 oappend (names16[modrm.rm + add]);
15845 oappend (names32[modrm.rm + add]);
15849 OP_E (bytemode, sizeflag);
15853 FXSAVE_Fixup (int bytemode, int sizeflag)
15855 /* Add proper suffix to "fxsave" and "fxrstor". */
15859 char *p = mnemonicendp;
15865 OP_M (bytemode, sizeflag);
15869 PCMPESTR_Fixup (int bytemode, int sizeflag)
15871 /* Add proper suffix to "{,v}pcmpestr{i,m}". */
15874 char *p = mnemonicendp;
15879 else if (sizeflag & SUFFIX_ALWAYS)
15886 OP_EX (bytemode, sizeflag);
15889 /* Display the destination register operand for instructions with
15893 OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
15896 const char **names;
15904 reg = vex.register_specifier;
15905 vex.register_specifier = 0;
15906 if (address_mode != mode_64bit)
15908 else if (vex.evex && !vex.v)
15911 if (bytemode == vex_scalar_mode)
15913 oappend (names_xmm[reg]);
15917 switch (vex.length)
15924 case vex_vsib_q_w_dq_mode:
15925 case vex_vsib_q_w_d_mode:
15941 names = names_mask;
15955 case vex_vsib_q_w_dq_mode:
15956 case vex_vsib_q_w_d_mode:
15957 names = vex.w ? names_ymm : names_xmm;
15966 names = names_mask;
15969 /* See PR binutils/20893 for a reproducer. */
15981 oappend (names[reg]);
15984 /* Get the VEX immediate byte without moving codep. */
15986 static unsigned char
15987 get_vex_imm8 (int sizeflag, int opnum)
15989 int bytes_before_imm = 0;
15991 if (modrm.mod != 3)
15993 /* There are SIB/displacement bytes. */
15994 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
15996 /* 32/64 bit address mode */
15997 int base = modrm.rm;
15999 /* Check SIB byte. */
16002 FETCH_DATA (the_info, codep + 1);
16004 /* When decoding the third source, don't increase
16005 bytes_before_imm as this has already been incremented
16006 by one in OP_E_memory while decoding the second
16009 bytes_before_imm++;
16012 /* Don't increase bytes_before_imm when decoding the third source,
16013 it has already been incremented by OP_E_memory while decoding
16014 the second source operand. */
16020 /* When modrm.rm == 5 or modrm.rm == 4 and base in
16021 SIB == 5, there is a 4 byte displacement. */
16023 /* No displacement. */
16025 /* Fall through. */
16027 /* 4 byte displacement. */
16028 bytes_before_imm += 4;
16031 /* 1 byte displacement. */
16032 bytes_before_imm++;
16039 /* 16 bit address mode */
16040 /* Don't increase bytes_before_imm when decoding the third source,
16041 it has already been incremented by OP_E_memory while decoding
16042 the second source operand. */
16048 /* When modrm.rm == 6, there is a 2 byte displacement. */
16050 /* No displacement. */
16052 /* Fall through. */
16054 /* 2 byte displacement. */
16055 bytes_before_imm += 2;
16058 /* 1 byte displacement: when decoding the third source,
16059 don't increase bytes_before_imm as this has already
16060 been incremented by one in OP_E_memory while decoding
16061 the second source operand. */
16063 bytes_before_imm++;
16071 FETCH_DATA (the_info, codep + bytes_before_imm + 1);
16072 return codep [bytes_before_imm];
16076 OP_EX_VexReg (int bytemode, int sizeflag, int reg)
16078 const char **names;
16080 if (reg == -1 && modrm.mod != 3)
16082 OP_E_memory (bytemode, sizeflag);
16094 if (address_mode != mode_64bit)
16098 switch (vex.length)
16109 oappend (names[reg]);
16113 OP_EX_VexImmW (int bytemode, int sizeflag)
16116 static unsigned char vex_imm8;
16118 if (vex_w_done == 0)
16122 /* Skip mod/rm byte. */
16126 vex_imm8 = get_vex_imm8 (sizeflag, 0);
16129 reg = vex_imm8 >> 4;
16131 OP_EX_VexReg (bytemode, sizeflag, reg);
16133 else if (vex_w_done == 1)
16138 reg = vex_imm8 >> 4;
16140 OP_EX_VexReg (bytemode, sizeflag, reg);
16144 /* Output the imm8 directly. */
16145 scratchbuf[0] = '$';
16146 print_operand_value (scratchbuf + 1, 1, vex_imm8 & 0xf);
16147 oappend_maybe_intel (scratchbuf);
16148 scratchbuf[0] = '\0';
16154 OP_Vex_2src (int bytemode, int sizeflag)
16156 if (modrm.mod == 3)
16158 int reg = modrm.rm;
16162 oappend (names_xmm[reg]);
16167 && (bytemode == v_mode || bytemode == v_swap_mode))
16169 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
16170 used_prefixes |= (prefixes & PREFIX_DATA);
16172 OP_E (bytemode, sizeflag);
16177 OP_Vex_2src_1 (int bytemode, int sizeflag)
16179 if (modrm.mod == 3)
16181 /* Skip mod/rm byte. */
16188 unsigned int reg = vex.register_specifier;
16189 vex.register_specifier = 0;
16191 if (address_mode != mode_64bit)
16193 oappend (names_xmm[reg]);
16196 OP_Vex_2src (bytemode, sizeflag);
16200 OP_Vex_2src_2 (int bytemode, int sizeflag)
16203 OP_Vex_2src (bytemode, sizeflag);
16206 unsigned int reg = vex.register_specifier;
16207 vex.register_specifier = 0;
16209 if (address_mode != mode_64bit)
16211 oappend (names_xmm[reg]);
16216 OP_EX_VexW (int bytemode, int sizeflag)
16222 /* Skip mod/rm byte. */
16227 reg = get_vex_imm8 (sizeflag, 0) >> 4;
16232 reg = get_vex_imm8 (sizeflag, 1) >> 4;
16235 OP_EX_VexReg (bytemode, sizeflag, reg);
16243 OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16246 const char **names;
16248 FETCH_DATA (the_info, codep + 1);
16251 if (bytemode != x_mode)
16255 if (address_mode != mode_64bit)
16258 switch (vex.length)
16269 oappend (names[reg]);
16273 OP_XMM_VexW (int bytemode, int sizeflag)
16275 /* Turn off the REX.W bit since it is used for swapping operands
16278 OP_XMM (bytemode, sizeflag);
16282 OP_EX_Vex (int bytemode, int sizeflag)
16284 if (modrm.mod != 3)
16286 OP_EX (bytemode, sizeflag);
16290 OP_XMM_Vex (int bytemode, int sizeflag)
16292 if (modrm.mod != 3)
16294 OP_XMM (bytemode, sizeflag);
16297 static struct op vex_cmp_op[] =
16299 { STRING_COMMA_LEN ("eq") },
16300 { STRING_COMMA_LEN ("lt") },
16301 { STRING_COMMA_LEN ("le") },
16302 { STRING_COMMA_LEN ("unord") },
16303 { STRING_COMMA_LEN ("neq") },
16304 { STRING_COMMA_LEN ("nlt") },
16305 { STRING_COMMA_LEN ("nle") },
16306 { STRING_COMMA_LEN ("ord") },
16307 { STRING_COMMA_LEN ("eq_uq") },
16308 { STRING_COMMA_LEN ("nge") },
16309 { STRING_COMMA_LEN ("ngt") },
16310 { STRING_COMMA_LEN ("false") },
16311 { STRING_COMMA_LEN ("neq_oq") },
16312 { STRING_COMMA_LEN ("ge") },
16313 { STRING_COMMA_LEN ("gt") },
16314 { STRING_COMMA_LEN ("true") },
16315 { STRING_COMMA_LEN ("eq_os") },
16316 { STRING_COMMA_LEN ("lt_oq") },
16317 { STRING_COMMA_LEN ("le_oq") },
16318 { STRING_COMMA_LEN ("unord_s") },
16319 { STRING_COMMA_LEN ("neq_us") },
16320 { STRING_COMMA_LEN ("nlt_uq") },
16321 { STRING_COMMA_LEN ("nle_uq") },
16322 { STRING_COMMA_LEN ("ord_s") },
16323 { STRING_COMMA_LEN ("eq_us") },
16324 { STRING_COMMA_LEN ("nge_uq") },
16325 { STRING_COMMA_LEN ("ngt_uq") },
16326 { STRING_COMMA_LEN ("false_os") },
16327 { STRING_COMMA_LEN ("neq_os") },
16328 { STRING_COMMA_LEN ("ge_oq") },
16329 { STRING_COMMA_LEN ("gt_oq") },
16330 { STRING_COMMA_LEN ("true_us") },
16334 VCMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16336 unsigned int cmp_type;
16338 FETCH_DATA (the_info, codep + 1);
16339 cmp_type = *codep++ & 0xff;
16340 if (cmp_type < ARRAY_SIZE (vex_cmp_op))
16343 char *p = mnemonicendp - 2;
16347 sprintf (p, "%s%s", vex_cmp_op[cmp_type].name, suffix);
16348 mnemonicendp += vex_cmp_op[cmp_type].len;
16352 /* We have a reserved extension byte. Output it directly. */
16353 scratchbuf[0] = '$';
16354 print_operand_value (scratchbuf + 1, 1, cmp_type);
16355 oappend_maybe_intel (scratchbuf);
16356 scratchbuf[0] = '\0';
16361 VPCMP_Fixup (int bytemode ATTRIBUTE_UNUSED,
16362 int sizeflag ATTRIBUTE_UNUSED)
16364 unsigned int cmp_type;
16369 FETCH_DATA (the_info, codep + 1);
16370 cmp_type = *codep++ & 0xff;
16371 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
16372 If it's the case, print suffix, otherwise - print the immediate. */
16373 if (cmp_type < ARRAY_SIZE (simd_cmp_op)
16378 char *p = mnemonicendp - 2;
16380 /* vpcmp* can have both one- and two-lettered suffix. */
16394 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
16395 mnemonicendp += simd_cmp_op[cmp_type].len;
16399 /* We have a reserved extension byte. Output it directly. */
16400 scratchbuf[0] = '$';
16401 print_operand_value (scratchbuf + 1, 1, cmp_type);
16402 oappend_maybe_intel (scratchbuf);
16403 scratchbuf[0] = '\0';
16407 static const struct op xop_cmp_op[] =
16409 { STRING_COMMA_LEN ("lt") },
16410 { STRING_COMMA_LEN ("le") },
16411 { STRING_COMMA_LEN ("gt") },
16412 { STRING_COMMA_LEN ("ge") },
16413 { STRING_COMMA_LEN ("eq") },
16414 { STRING_COMMA_LEN ("neq") },
16415 { STRING_COMMA_LEN ("false") },
16416 { STRING_COMMA_LEN ("true") }
16420 VPCOM_Fixup (int bytemode ATTRIBUTE_UNUSED,
16421 int sizeflag ATTRIBUTE_UNUSED)
16423 unsigned int cmp_type;
16425 FETCH_DATA (the_info, codep + 1);
16426 cmp_type = *codep++ & 0xff;
16427 if (cmp_type < ARRAY_SIZE (xop_cmp_op))
16430 char *p = mnemonicendp - 2;
16432 /* vpcom* can have both one- and two-lettered suffix. */
16446 sprintf (p, "%s%s", xop_cmp_op[cmp_type].name, suffix);
16447 mnemonicendp += xop_cmp_op[cmp_type].len;
16451 /* We have a reserved extension byte. Output it directly. */
16452 scratchbuf[0] = '$';
16453 print_operand_value (scratchbuf + 1, 1, cmp_type);
16454 oappend_maybe_intel (scratchbuf);
16455 scratchbuf[0] = '\0';
16459 static const struct op pclmul_op[] =
16461 { STRING_COMMA_LEN ("lql") },
16462 { STRING_COMMA_LEN ("hql") },
16463 { STRING_COMMA_LEN ("lqh") },
16464 { STRING_COMMA_LEN ("hqh") }
16468 PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
16469 int sizeflag ATTRIBUTE_UNUSED)
16471 unsigned int pclmul_type;
16473 FETCH_DATA (the_info, codep + 1);
16474 pclmul_type = *codep++ & 0xff;
16475 switch (pclmul_type)
16486 if (pclmul_type < ARRAY_SIZE (pclmul_op))
16489 char *p = mnemonicendp - 3;
16494 sprintf (p, "%s%s", pclmul_op[pclmul_type].name, suffix);
16495 mnemonicendp += pclmul_op[pclmul_type].len;
16499 /* We have a reserved extension byte. Output it directly. */
16500 scratchbuf[0] = '$';
16501 print_operand_value (scratchbuf + 1, 1, pclmul_type);
16502 oappend_maybe_intel (scratchbuf);
16503 scratchbuf[0] = '\0';
16508 MOVBE_Fixup (int bytemode, int sizeflag)
16510 /* Add proper suffix to "movbe". */
16511 char *p = mnemonicendp;
16520 if (sizeflag & SUFFIX_ALWAYS)
16526 if (sizeflag & DFLAG)
16530 used_prefixes |= (prefixes & PREFIX_DATA);
16535 oappend (INTERNAL_DISASSEMBLER_ERROR);
16542 OP_M (bytemode, sizeflag);
16546 OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16549 const char **names;
16551 /* Skip mod/rm byte. */
16565 oappend (names[reg]);
16569 OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16571 const char **names;
16572 unsigned int reg = vex.register_specifier;
16573 vex.register_specifier = 0;
16580 if (address_mode != mode_64bit)
16582 oappend (names[reg]);
16586 OP_Mask (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16589 || (bytemode != mask_mode && bytemode != mask_bd_mode))
16593 if ((rex & REX_R) != 0 || !vex.r)
16599 oappend (names_mask [modrm.reg]);
16603 OP_Rounding (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16606 || (bytemode != evex_rounding_mode
16607 && bytemode != evex_rounding_64_mode
16608 && bytemode != evex_sae_mode))
16610 if (modrm.mod == 3 && vex.b)
16613 case evex_rounding_64_mode:
16614 if (address_mode != mode_64bit)
16619 /* Fall through. */
16620 case evex_rounding_mode:
16621 oappend (names_rounding[vex.ll]);
16623 case evex_sae_mode: