1 /* Print i386 instructions for GDB, the GNU debugger.
2 Copyright 1988, 1989, 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
3 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
4 Free Software Foundation, Inc.
6 This file is part of the GNU opcodes library.
8 This library is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
13 It is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
16 License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
21 MA 02110-1301, USA. */
24 /* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
26 modified by John Hassey (hassey@dg-rtp.dg.com)
27 x86-64 support added by Jan Hubicka (jh@suse.cz)
28 VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */
30 /* The main tables describing the instructions is essentially a copy
31 of the "Opcode Map" chapter (Appendix A) of the Intel 80386
32 Programmers Manual. Usually, there is a capital letter, followed
33 by a small letter. The capital letter tell the addressing mode,
34 and the small letter tells about the operand size. Refer to
35 the Intel manual for details. */
40 #include "opcode/i386.h"
41 #include "libiberty.h"
45 static int print_insn (bfd_vma, disassemble_info *);
46 static void dofloat (int);
47 static void OP_ST (int, int);
48 static void OP_STi (int, int);
49 static int putop (const char *, int);
50 static void oappend (const char *);
51 static void append_seg (void);
52 static void OP_indirE (int, int);
53 static void print_operand_value (char *, int, bfd_vma);
54 static void OP_E_register (int, int);
55 static void OP_E_memory (int, int);
56 static void print_displacement (char *, bfd_vma);
57 static void OP_E (int, int);
58 static void OP_G (int, int);
59 static bfd_vma get64 (void);
60 static bfd_signed_vma get32 (void);
61 static bfd_signed_vma get32s (void);
62 static int get16 (void);
63 static void set_op (bfd_vma, int);
64 static void OP_Skip_MODRM (int, int);
65 static void OP_REG (int, int);
66 static void OP_IMREG (int, int);
67 static void OP_I (int, int);
68 static void OP_I64 (int, int);
69 static void OP_sI (int, int);
70 static void OP_J (int, int);
71 static void OP_SEG (int, int);
72 static void OP_DIR (int, int);
73 static void OP_OFF (int, int);
74 static void OP_OFF64 (int, int);
75 static void ptr_reg (int, int);
76 static void OP_ESreg (int, int);
77 static void OP_DSreg (int, int);
78 static void OP_C (int, int);
79 static void OP_D (int, int);
80 static void OP_T (int, int);
81 static void OP_R (int, int);
82 static void OP_MMX (int, int);
83 static void OP_XMM (int, int);
84 static void OP_EM (int, int);
85 static void OP_EX (int, int);
86 static void OP_EMC (int,int);
87 static void OP_MXC (int,int);
88 static void OP_MS (int, int);
89 static void OP_XS (int, int);
90 static void OP_M (int, int);
91 static void OP_VEX (int, int);
92 static void OP_EX_Vex (int, int);
93 static void OP_EX_VexW (int, int);
94 static void OP_EX_VexImmW (int, int);
95 static void OP_XMM_Vex (int, int);
96 static void OP_XMM_VexW (int, int);
97 static void OP_REG_VexI4 (int, int);
98 static void PCLMUL_Fixup (int, int);
99 static void VEXI4_Fixup (int, int);
100 static void VZERO_Fixup (int, int);
101 static void VCMP_Fixup (int, int);
102 static void OP_0f07 (int, int);
103 static void OP_Monitor (int, int);
104 static void OP_Mwait (int, int);
105 static void 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 HLE_Fixup1 (int, int);
112 static void HLE_Fixup2 (int, int);
113 static void HLE_Fixup3 (int, int);
114 static void CMPXCHG8B_Fixup (int, int);
115 static void XMM_Fixup (int, int);
116 static void CRC32_Fixup (int, int);
117 static void FXSAVE_Fixup (int, int);
118 static void OP_LWPCB_E (int, int);
119 static void OP_LWP_E (int, int);
120 static void OP_Vex_2src_1 (int, int);
121 static void OP_Vex_2src_2 (int, int);
123 static void MOVBE_Fixup (int, int);
126 /* Points to first byte not fetched. */
127 bfd_byte *max_fetched;
128 bfd_byte the_buffer[MAX_MNEM_SIZE];
141 enum address_mode address_mode;
143 /* Flags for the prefixes for the current instruction. See below. */
146 /* REX prefix the current instruction. See below. */
148 /* Bits of REX we've already used. */
150 /* REX bits in original REX prefix ignored. */
151 static int rex_ignored;
152 /* Mark parts used in the REX prefix. When we are testing for
153 empty prefix (for 8bit register REX extension), just mask it
154 out. Otherwise test for REX bit is excuse for existence of REX
155 only in case value is nonzero. */
156 #define USED_REX(value) \
161 rex_used |= (value) | REX_OPCODE; \
164 rex_used |= REX_OPCODE; \
167 /* Flags for prefixes which we somehow handled when printing the
168 current instruction. */
169 static int used_prefixes;
171 /* Flags stored in PREFIXES. */
172 #define PREFIX_REPZ 1
173 #define PREFIX_REPNZ 2
174 #define PREFIX_LOCK 4
176 #define PREFIX_SS 0x10
177 #define PREFIX_DS 0x20
178 #define PREFIX_ES 0x40
179 #define PREFIX_FS 0x80
180 #define PREFIX_GS 0x100
181 #define PREFIX_DATA 0x200
182 #define PREFIX_ADDR 0x400
183 #define PREFIX_FWAIT 0x800
185 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
186 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
188 #define FETCH_DATA(info, addr) \
189 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
190 ? 1 : fetch_data ((info), (addr)))
193 fetch_data (struct disassemble_info *info, bfd_byte *addr)
196 struct dis_private *priv = (struct dis_private *) info->private_data;
197 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
199 if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
200 status = (*info->read_memory_func) (start,
202 addr - priv->max_fetched,
208 /* If we did manage to read at least one byte, then
209 print_insn_i386 will do something sensible. Otherwise, print
210 an error. We do that here because this is where we know
212 if (priv->max_fetched == priv->the_buffer)
213 (*info->memory_error_func) (status, start, info);
214 longjmp (priv->bailout, 1);
217 priv->max_fetched = addr;
221 #define XX { NULL, 0 }
222 #define Bad_Opcode NULL, { { NULL, 0 } }
224 #define Eb { OP_E, b_mode }
225 #define EbS { OP_E, b_swap_mode }
226 #define Ev { OP_E, v_mode }
227 #define EvS { OP_E, v_swap_mode }
228 #define Ed { OP_E, d_mode }
229 #define Edq { OP_E, dq_mode }
230 #define Edqw { OP_E, dqw_mode }
231 #define Edqb { OP_E, dqb_mode }
232 #define Edqd { OP_E, dqd_mode }
233 #define Eq { OP_E, q_mode }
234 #define indirEv { OP_indirE, stack_v_mode }
235 #define indirEp { OP_indirE, f_mode }
236 #define stackEv { OP_E, stack_v_mode }
237 #define Em { OP_E, m_mode }
238 #define Ew { OP_E, w_mode }
239 #define M { OP_M, 0 } /* lea, lgdt, etc. */
240 #define Ma { OP_M, a_mode }
241 #define Mb { OP_M, b_mode }
242 #define Md { OP_M, d_mode }
243 #define Mo { OP_M, o_mode }
244 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
245 #define Mq { OP_M, q_mode }
246 #define Mx { OP_M, x_mode }
247 #define Mxmm { OP_M, xmm_mode }
248 #define Gb { OP_G, b_mode }
249 #define Gv { OP_G, v_mode }
250 #define Gd { OP_G, d_mode }
251 #define Gdq { OP_G, dq_mode }
252 #define Gm { OP_G, m_mode }
253 #define Gw { OP_G, w_mode }
254 #define Rd { OP_R, d_mode }
255 #define Rm { OP_R, m_mode }
256 #define Ib { OP_I, b_mode }
257 #define sIb { OP_sI, b_mode } /* sign extened byte */
258 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
259 #define Iv { OP_I, v_mode }
260 #define sIv { OP_sI, v_mode }
261 #define Iq { OP_I, q_mode }
262 #define Iv64 { OP_I64, v_mode }
263 #define Iw { OP_I, w_mode }
264 #define I1 { OP_I, const_1_mode }
265 #define Jb { OP_J, b_mode }
266 #define Jv { OP_J, v_mode }
267 #define Cm { OP_C, m_mode }
268 #define Dm { OP_D, m_mode }
269 #define Td { OP_T, d_mode }
270 #define Skip_MODRM { OP_Skip_MODRM, 0 }
272 #define RMeAX { OP_REG, eAX_reg }
273 #define RMeBX { OP_REG, eBX_reg }
274 #define RMeCX { OP_REG, eCX_reg }
275 #define RMeDX { OP_REG, eDX_reg }
276 #define RMeSP { OP_REG, eSP_reg }
277 #define RMeBP { OP_REG, eBP_reg }
278 #define RMeSI { OP_REG, eSI_reg }
279 #define RMeDI { OP_REG, eDI_reg }
280 #define RMrAX { OP_REG, rAX_reg }
281 #define RMrBX { OP_REG, rBX_reg }
282 #define RMrCX { OP_REG, rCX_reg }
283 #define RMrDX { OP_REG, rDX_reg }
284 #define RMrSP { OP_REG, rSP_reg }
285 #define RMrBP { OP_REG, rBP_reg }
286 #define RMrSI { OP_REG, rSI_reg }
287 #define RMrDI { OP_REG, rDI_reg }
288 #define RMAL { OP_REG, al_reg }
289 #define RMCL { OP_REG, cl_reg }
290 #define RMDL { OP_REG, dl_reg }
291 #define RMBL { OP_REG, bl_reg }
292 #define RMAH { OP_REG, ah_reg }
293 #define RMCH { OP_REG, ch_reg }
294 #define RMDH { OP_REG, dh_reg }
295 #define RMBH { OP_REG, bh_reg }
296 #define RMAX { OP_REG, ax_reg }
297 #define RMDX { OP_REG, dx_reg }
299 #define eAX { OP_IMREG, eAX_reg }
300 #define eBX { OP_IMREG, eBX_reg }
301 #define eCX { OP_IMREG, eCX_reg }
302 #define eDX { OP_IMREG, eDX_reg }
303 #define eSP { OP_IMREG, eSP_reg }
304 #define eBP { OP_IMREG, eBP_reg }
305 #define eSI { OP_IMREG, eSI_reg }
306 #define eDI { OP_IMREG, eDI_reg }
307 #define AL { OP_IMREG, al_reg }
308 #define CL { OP_IMREG, cl_reg }
309 #define DL { OP_IMREG, dl_reg }
310 #define BL { OP_IMREG, bl_reg }
311 #define AH { OP_IMREG, ah_reg }
312 #define CH { OP_IMREG, ch_reg }
313 #define DH { OP_IMREG, dh_reg }
314 #define BH { OP_IMREG, bh_reg }
315 #define AX { OP_IMREG, ax_reg }
316 #define DX { OP_IMREG, dx_reg }
317 #define zAX { OP_IMREG, z_mode_ax_reg }
318 #define indirDX { OP_IMREG, indir_dx_reg }
320 #define Sw { OP_SEG, w_mode }
321 #define Sv { OP_SEG, v_mode }
322 #define Ap { OP_DIR, 0 }
323 #define Ob { OP_OFF64, b_mode }
324 #define Ov { OP_OFF64, v_mode }
325 #define Xb { OP_DSreg, eSI_reg }
326 #define Xv { OP_DSreg, eSI_reg }
327 #define Xz { OP_DSreg, eSI_reg }
328 #define Yb { OP_ESreg, eDI_reg }
329 #define Yv { OP_ESreg, eDI_reg }
330 #define DSBX { OP_DSreg, eBX_reg }
332 #define es { OP_REG, es_reg }
333 #define ss { OP_REG, ss_reg }
334 #define cs { OP_REG, cs_reg }
335 #define ds { OP_REG, ds_reg }
336 #define fs { OP_REG, fs_reg }
337 #define gs { OP_REG, gs_reg }
339 #define MX { OP_MMX, 0 }
340 #define XM { OP_XMM, 0 }
341 #define XMScalar { OP_XMM, scalar_mode }
342 #define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
343 #define XMM { OP_XMM, xmm_mode }
344 #define EM { OP_EM, v_mode }
345 #define EMS { OP_EM, v_swap_mode }
346 #define EMd { OP_EM, d_mode }
347 #define EMx { OP_EM, x_mode }
348 #define EXw { OP_EX, w_mode }
349 #define EXd { OP_EX, d_mode }
350 #define EXdScalar { OP_EX, d_scalar_mode }
351 #define EXdS { OP_EX, d_swap_mode }
352 #define EXq { OP_EX, q_mode }
353 #define EXqScalar { OP_EX, q_scalar_mode }
354 #define EXqScalarS { OP_EX, q_scalar_swap_mode }
355 #define EXqS { OP_EX, q_swap_mode }
356 #define EXx { OP_EX, x_mode }
357 #define EXxS { OP_EX, x_swap_mode }
358 #define EXxmm { OP_EX, xmm_mode }
359 #define EXxmmq { OP_EX, xmmq_mode }
360 #define EXxmm_mb { OP_EX, xmm_mb_mode }
361 #define EXxmm_mw { OP_EX, xmm_mw_mode }
362 #define EXxmm_md { OP_EX, xmm_md_mode }
363 #define EXxmm_mq { OP_EX, xmm_mq_mode }
364 #define EXxmmdw { OP_EX, xmmdw_mode }
365 #define EXxmmqd { OP_EX, xmmqd_mode }
366 #define EXymmq { OP_EX, ymmq_mode }
367 #define EXVexWdq { OP_EX, vex_w_dq_mode }
368 #define EXVexWdqScalar { OP_EX, vex_scalar_w_dq_mode }
369 #define MS { OP_MS, v_mode }
370 #define XS { OP_XS, v_mode }
371 #define EMCq { OP_EMC, q_mode }
372 #define MXC { OP_MXC, 0 }
373 #define OPSUF { OP_3DNowSuffix, 0 }
374 #define CMP { CMP_Fixup, 0 }
375 #define XMM0 { XMM_Fixup, 0 }
376 #define FXSAVE { FXSAVE_Fixup, 0 }
377 #define Vex_2src_1 { OP_Vex_2src_1, 0 }
378 #define Vex_2src_2 { OP_Vex_2src_2, 0 }
380 #define Vex { OP_VEX, vex_mode }
381 #define VexScalar { OP_VEX, vex_scalar_mode }
382 #define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
383 #define Vex128 { OP_VEX, vex128_mode }
384 #define Vex256 { OP_VEX, vex256_mode }
385 #define VexGdq { OP_VEX, dq_mode }
386 #define VexI4 { VEXI4_Fixup, 0}
387 #define EXdVex { OP_EX_Vex, d_mode }
388 #define EXdVexS { OP_EX_Vex, d_swap_mode }
389 #define EXdVexScalarS { OP_EX_Vex, d_scalar_swap_mode }
390 #define EXqVex { OP_EX_Vex, q_mode }
391 #define EXqVexS { OP_EX_Vex, q_swap_mode }
392 #define EXqVexScalarS { OP_EX_Vex, q_scalar_swap_mode }
393 #define EXVexW { OP_EX_VexW, x_mode }
394 #define EXdVexW { OP_EX_VexW, d_mode }
395 #define EXqVexW { OP_EX_VexW, q_mode }
396 #define EXVexImmW { OP_EX_VexImmW, x_mode }
397 #define XMVex { OP_XMM_Vex, 0 }
398 #define XMVexScalar { OP_XMM_Vex, scalar_mode }
399 #define XMVexW { OP_XMM_VexW, 0 }
400 #define XMVexI4 { OP_REG_VexI4, x_mode }
401 #define PCLMUL { PCLMUL_Fixup, 0 }
402 #define VZERO { VZERO_Fixup, 0 }
403 #define VCMP { VCMP_Fixup, 0 }
405 #define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
406 #define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
408 /* Used handle "rep" prefix for string instructions. */
409 #define Xbr { REP_Fixup, eSI_reg }
410 #define Xvr { REP_Fixup, eSI_reg }
411 #define Ybr { REP_Fixup, eDI_reg }
412 #define Yvr { REP_Fixup, eDI_reg }
413 #define Yzr { REP_Fixup, eDI_reg }
414 #define indirDXr { REP_Fixup, indir_dx_reg }
415 #define ALr { REP_Fixup, al_reg }
416 #define eAXr { REP_Fixup, eAX_reg }
418 /* Used handle HLE prefix for lockable instructions. */
419 #define Ebh1 { HLE_Fixup1, b_mode }
420 #define Evh1 { HLE_Fixup1, v_mode }
421 #define Ebh2 { HLE_Fixup2, b_mode }
422 #define Evh2 { HLE_Fixup2, v_mode }
423 #define Ebh3 { HLE_Fixup3, b_mode }
424 #define Evh3 { HLE_Fixup3, v_mode }
426 #define cond_jump_flag { NULL, cond_jump_mode }
427 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
429 /* bits in sizeflag */
430 #define SUFFIX_ALWAYS 4
438 /* byte operand with operand swapped */
440 /* byte operand, sign extend like 'T' suffix */
442 /* operand size depends on prefixes */
444 /* operand size depends on prefixes with operand swapped */
448 /* double word operand */
450 /* double word operand with operand swapped */
452 /* quad word operand */
454 /* quad word operand with operand swapped */
456 /* ten-byte operand */
458 /* 16-byte XMM or 32-byte YMM operand */
460 /* 16-byte XMM or 32-byte YMM operand with operand swapped */
462 /* 16-byte XMM operand */
464 /* 16-byte XMM or quad word operand */
466 /* XMM register or byte memory operand */
468 /* XMM register or word memory operand */
470 /* XMM register or double word memory operand */
472 /* XMM register or quad word memory operand */
474 /* 16-byte XMM, word or double word operand */
476 /* 16-byte XMM, double word or quad word operand */
478 /* 32-byte YMM or quad word operand */
480 /* 32-byte YMM or 16-byte word operand */
482 /* d_mode in 32bit, q_mode in 64bit mode. */
484 /* pair of v_mode operands */
488 /* operand size depends on REX prefixes. */
490 /* registers like dq_mode, memory like w_mode. */
492 /* 4- or 6-byte pointer operand */
495 /* v_mode for stack-related opcodes. */
497 /* non-quad operand size depends on prefixes */
499 /* 16-byte operand */
501 /* registers like dq_mode, memory like b_mode. */
503 /* registers like dq_mode, memory like d_mode. */
505 /* normal vex mode */
507 /* 128bit vex mode */
509 /* 256bit vex mode */
511 /* operand size depends on the VEX.W bit. */
514 /* Similar to vex_w_dq_mode, with VSIB dword indices. */
515 vex_vsib_d_w_dq_mode,
516 /* Similar to vex_w_dq_mode, with VSIB qword indices. */
517 vex_vsib_q_w_dq_mode,
519 /* scalar, ignore vector length. */
521 /* like d_mode, ignore vector length. */
523 /* like d_swap_mode, ignore vector length. */
525 /* like q_mode, ignore vector length. */
527 /* like q_swap_mode, ignore vector length. */
529 /* like vex_mode, ignore vector length. */
531 /* like vex_w_dq_mode, ignore vector length. */
532 vex_scalar_w_dq_mode,
597 #define FLOAT NULL, { { NULL, FLOATCODE } }
599 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }
600 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
601 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
602 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
603 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
604 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
605 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
606 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
607 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
608 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
609 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
610 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
712 MOD_VEX_0F12_PREFIX_0,
714 MOD_VEX_0F16_PREFIX_0,
730 MOD_VEX_0FD7_PREFIX_2,
731 MOD_VEX_0FE7_PREFIX_2,
732 MOD_VEX_0FF0_PREFIX_3,
733 MOD_VEX_0F381A_PREFIX_2,
734 MOD_VEX_0F382A_PREFIX_2,
735 MOD_VEX_0F382C_PREFIX_2,
736 MOD_VEX_0F382D_PREFIX_2,
737 MOD_VEX_0F382E_PREFIX_2,
738 MOD_VEX_0F382F_PREFIX_2,
739 MOD_VEX_0F385A_PREFIX_2,
740 MOD_VEX_0F388C_PREFIX_2,
741 MOD_VEX_0F388E_PREFIX_2,
914 PREFIX_VEX_0F71_REG_2,
915 PREFIX_VEX_0F71_REG_4,
916 PREFIX_VEX_0F71_REG_6,
917 PREFIX_VEX_0F72_REG_2,
918 PREFIX_VEX_0F72_REG_4,
919 PREFIX_VEX_0F72_REG_6,
920 PREFIX_VEX_0F73_REG_2,
921 PREFIX_VEX_0F73_REG_3,
922 PREFIX_VEX_0F73_REG_6,
923 PREFIX_VEX_0F73_REG_7,
1089 PREFIX_VEX_0F38F3_REG_1,
1090 PREFIX_VEX_0F38F3_REG_2,
1091 PREFIX_VEX_0F38F3_REG_3,
1193 THREE_BYTE_0F38 = 0,
1214 VEX_LEN_0F10_P_1 = 0,
1218 VEX_LEN_0F12_P_0_M_0,
1219 VEX_LEN_0F12_P_0_M_1,
1222 VEX_LEN_0F16_P_0_M_0,
1223 VEX_LEN_0F16_P_0_M_1,
1257 VEX_LEN_0FAE_R_2_M_0,
1258 VEX_LEN_0FAE_R_3_M_0,
1267 VEX_LEN_0F381A_P_2_M_0,
1270 VEX_LEN_0F385A_P_2_M_0,
1277 VEX_LEN_0F38F3_R_1_P_0,
1278 VEX_LEN_0F38F3_R_2_P_0,
1279 VEX_LEN_0F38F3_R_3_P_0,
1321 VEX_LEN_0FXOP_09_80,
1512 VEX_W_0F381A_P_2_M_0,
1524 VEX_W_0F382A_P_2_M_0,
1526 VEX_W_0F382C_P_2_M_0,
1527 VEX_W_0F382D_P_2_M_0,
1528 VEX_W_0F382E_P_2_M_0,
1529 VEX_W_0F382F_P_2_M_0,
1551 VEX_W_0F385A_P_2_M_0,
1598 typedef void (*op_rtn) (int bytemode, int sizeflag);
1609 /* Upper case letters in the instruction names here are macros.
1610 'A' => print 'b' if no register operands or suffix_always is true
1611 'B' => print 'b' if suffix_always is true
1612 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
1614 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
1615 suffix_always is true
1616 'E' => print 'e' if 32-bit form of jcxz
1617 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
1618 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
1619 'H' => print ",pt" or ",pn" branch hint
1620 'I' => honor following macro letter even in Intel mode (implemented only
1621 for some of the macro letters)
1623 'K' => print 'd' or 'q' if rex prefix is present.
1624 'L' => print 'l' if suffix_always is true
1625 'M' => print 'r' if intel_mnemonic is false.
1626 'N' => print 'n' if instruction has no wait "prefix"
1627 'O' => print 'd' or 'o' (or 'q' in Intel mode)
1628 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
1629 or suffix_always is true. print 'q' if rex prefix is present.
1630 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
1632 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
1633 'S' => print 'w', 'l' or 'q' if suffix_always is true
1634 'T' => print 'q' in 64bit mode and behave as 'P' otherwise
1635 'U' => print 'q' in 64bit mode and behave as 'Q' otherwise
1636 'V' => print 'q' in 64bit mode and behave as 'S' otherwise
1637 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
1638 'X' => print 's', 'd' depending on data16 prefix (for XMM)
1639 'Y' => 'q' if instruction has an REX 64bit overwrite prefix and
1640 suffix_always is true.
1641 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
1642 '!' => change condition from true to false or from false to true.
1643 '%' => add 1 upper case letter to the macro.
1645 2 upper case letter macros:
1646 "XY" => print 'x' or 'y' if no register operands or suffix_always
1648 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
1649 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand
1650 or suffix_always is true
1651 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
1652 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
1653 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
1654 "LW" => print 'd', 'q' depending on the VEX.W bit
1656 Many of the above letters print nothing in Intel mode. See "putop"
1659 Braces '{' and '}', and vertical bars '|', indicate alternative
1660 mnemonic strings for AT&T and Intel. */
1662 static const struct dis386 dis386[] = {
1664 { "addB", { Ebh1, Gb } },
1665 { "addS", { Evh1, Gv } },
1666 { "addB", { Gb, EbS } },
1667 { "addS", { Gv, EvS } },
1668 { "addB", { AL, Ib } },
1669 { "addS", { eAX, Iv } },
1670 { X86_64_TABLE (X86_64_06) },
1671 { X86_64_TABLE (X86_64_07) },
1673 { "orB", { Ebh1, Gb } },
1674 { "orS", { Evh1, Gv } },
1675 { "orB", { Gb, EbS } },
1676 { "orS", { Gv, EvS } },
1677 { "orB", { AL, Ib } },
1678 { "orS", { eAX, Iv } },
1679 { X86_64_TABLE (X86_64_0D) },
1680 { Bad_Opcode }, /* 0x0f extended opcode escape */
1682 { "adcB", { Ebh1, Gb } },
1683 { "adcS", { Evh1, Gv } },
1684 { "adcB", { Gb, EbS } },
1685 { "adcS", { Gv, EvS } },
1686 { "adcB", { AL, Ib } },
1687 { "adcS", { eAX, Iv } },
1688 { X86_64_TABLE (X86_64_16) },
1689 { X86_64_TABLE (X86_64_17) },
1691 { "sbbB", { Ebh1, Gb } },
1692 { "sbbS", { Evh1, Gv } },
1693 { "sbbB", { Gb, EbS } },
1694 { "sbbS", { Gv, EvS } },
1695 { "sbbB", { AL, Ib } },
1696 { "sbbS", { eAX, Iv } },
1697 { X86_64_TABLE (X86_64_1E) },
1698 { X86_64_TABLE (X86_64_1F) },
1700 { "andB", { Ebh1, Gb } },
1701 { "andS", { Evh1, Gv } },
1702 { "andB", { Gb, EbS } },
1703 { "andS", { Gv, EvS } },
1704 { "andB", { AL, Ib } },
1705 { "andS", { eAX, Iv } },
1706 { Bad_Opcode }, /* SEG ES prefix */
1707 { X86_64_TABLE (X86_64_27) },
1709 { "subB", { Ebh1, Gb } },
1710 { "subS", { Evh1, Gv } },
1711 { "subB", { Gb, EbS } },
1712 { "subS", { Gv, EvS } },
1713 { "subB", { AL, Ib } },
1714 { "subS", { eAX, Iv } },
1715 { Bad_Opcode }, /* SEG CS prefix */
1716 { X86_64_TABLE (X86_64_2F) },
1718 { "xorB", { Ebh1, Gb } },
1719 { "xorS", { Evh1, Gv } },
1720 { "xorB", { Gb, EbS } },
1721 { "xorS", { Gv, EvS } },
1722 { "xorB", { AL, Ib } },
1723 { "xorS", { eAX, Iv } },
1724 { Bad_Opcode }, /* SEG SS prefix */
1725 { X86_64_TABLE (X86_64_37) },
1727 { "cmpB", { Eb, Gb } },
1728 { "cmpS", { Ev, Gv } },
1729 { "cmpB", { Gb, EbS } },
1730 { "cmpS", { Gv, EvS } },
1731 { "cmpB", { AL, Ib } },
1732 { "cmpS", { eAX, Iv } },
1733 { Bad_Opcode }, /* SEG DS prefix */
1734 { X86_64_TABLE (X86_64_3F) },
1736 { "inc{S|}", { RMeAX } },
1737 { "inc{S|}", { RMeCX } },
1738 { "inc{S|}", { RMeDX } },
1739 { "inc{S|}", { RMeBX } },
1740 { "inc{S|}", { RMeSP } },
1741 { "inc{S|}", { RMeBP } },
1742 { "inc{S|}", { RMeSI } },
1743 { "inc{S|}", { RMeDI } },
1745 { "dec{S|}", { RMeAX } },
1746 { "dec{S|}", { RMeCX } },
1747 { "dec{S|}", { RMeDX } },
1748 { "dec{S|}", { RMeBX } },
1749 { "dec{S|}", { RMeSP } },
1750 { "dec{S|}", { RMeBP } },
1751 { "dec{S|}", { RMeSI } },
1752 { "dec{S|}", { RMeDI } },
1754 { "pushV", { RMrAX } },
1755 { "pushV", { RMrCX } },
1756 { "pushV", { RMrDX } },
1757 { "pushV", { RMrBX } },
1758 { "pushV", { RMrSP } },
1759 { "pushV", { RMrBP } },
1760 { "pushV", { RMrSI } },
1761 { "pushV", { RMrDI } },
1763 { "popV", { RMrAX } },
1764 { "popV", { RMrCX } },
1765 { "popV", { RMrDX } },
1766 { "popV", { RMrBX } },
1767 { "popV", { RMrSP } },
1768 { "popV", { RMrBP } },
1769 { "popV", { RMrSI } },
1770 { "popV", { RMrDI } },
1772 { X86_64_TABLE (X86_64_60) },
1773 { X86_64_TABLE (X86_64_61) },
1774 { X86_64_TABLE (X86_64_62) },
1775 { X86_64_TABLE (X86_64_63) },
1776 { Bad_Opcode }, /* seg fs */
1777 { Bad_Opcode }, /* seg gs */
1778 { Bad_Opcode }, /* op size prefix */
1779 { Bad_Opcode }, /* adr size prefix */
1781 { "pushT", { sIv } },
1782 { "imulS", { Gv, Ev, Iv } },
1783 { "pushT", { sIbT } },
1784 { "imulS", { Gv, Ev, sIb } },
1785 { "ins{b|}", { Ybr, indirDX } },
1786 { X86_64_TABLE (X86_64_6D) },
1787 { "outs{b|}", { indirDXr, Xb } },
1788 { X86_64_TABLE (X86_64_6F) },
1790 { "joH", { Jb, XX, cond_jump_flag } },
1791 { "jnoH", { Jb, XX, cond_jump_flag } },
1792 { "jbH", { Jb, XX, cond_jump_flag } },
1793 { "jaeH", { Jb, XX, cond_jump_flag } },
1794 { "jeH", { Jb, XX, cond_jump_flag } },
1795 { "jneH", { Jb, XX, cond_jump_flag } },
1796 { "jbeH", { Jb, XX, cond_jump_flag } },
1797 { "jaH", { Jb, XX, cond_jump_flag } },
1799 { "jsH", { Jb, XX, cond_jump_flag } },
1800 { "jnsH", { Jb, XX, cond_jump_flag } },
1801 { "jpH", { Jb, XX, cond_jump_flag } },
1802 { "jnpH", { Jb, XX, cond_jump_flag } },
1803 { "jlH", { Jb, XX, cond_jump_flag } },
1804 { "jgeH", { Jb, XX, cond_jump_flag } },
1805 { "jleH", { Jb, XX, cond_jump_flag } },
1806 { "jgH", { Jb, XX, cond_jump_flag } },
1808 { REG_TABLE (REG_80) },
1809 { REG_TABLE (REG_81) },
1811 { REG_TABLE (REG_82) },
1812 { "testB", { Eb, Gb } },
1813 { "testS", { Ev, Gv } },
1814 { "xchgB", { Ebh2, Gb } },
1815 { "xchgS", { Evh2, Gv } },
1817 { "movB", { Ebh3, Gb } },
1818 { "movS", { Evh3, Gv } },
1819 { "movB", { Gb, EbS } },
1820 { "movS", { Gv, EvS } },
1821 { "movD", { Sv, Sw } },
1822 { MOD_TABLE (MOD_8D) },
1823 { "movD", { Sw, Sv } },
1824 { REG_TABLE (REG_8F) },
1826 { PREFIX_TABLE (PREFIX_90) },
1827 { "xchgS", { RMeCX, eAX } },
1828 { "xchgS", { RMeDX, eAX } },
1829 { "xchgS", { RMeBX, eAX } },
1830 { "xchgS", { RMeSP, eAX } },
1831 { "xchgS", { RMeBP, eAX } },
1832 { "xchgS", { RMeSI, eAX } },
1833 { "xchgS", { RMeDI, eAX } },
1835 { "cW{t|}R", { XX } },
1836 { "cR{t|}O", { XX } },
1837 { X86_64_TABLE (X86_64_9A) },
1838 { Bad_Opcode }, /* fwait */
1839 { "pushfT", { XX } },
1840 { "popfT", { XX } },
1844 { "mov%LB", { AL, Ob } },
1845 { "mov%LS", { eAX, Ov } },
1846 { "mov%LB", { Ob, AL } },
1847 { "mov%LS", { Ov, eAX } },
1848 { "movs{b|}", { Ybr, Xb } },
1849 { "movs{R|}", { Yvr, Xv } },
1850 { "cmps{b|}", { Xb, Yb } },
1851 { "cmps{R|}", { Xv, Yv } },
1853 { "testB", { AL, Ib } },
1854 { "testS", { eAX, Iv } },
1855 { "stosB", { Ybr, AL } },
1856 { "stosS", { Yvr, eAX } },
1857 { "lodsB", { ALr, Xb } },
1858 { "lodsS", { eAXr, Xv } },
1859 { "scasB", { AL, Yb } },
1860 { "scasS", { eAX, Yv } },
1862 { "movB", { RMAL, Ib } },
1863 { "movB", { RMCL, Ib } },
1864 { "movB", { RMDL, Ib } },
1865 { "movB", { RMBL, Ib } },
1866 { "movB", { RMAH, Ib } },
1867 { "movB", { RMCH, Ib } },
1868 { "movB", { RMDH, Ib } },
1869 { "movB", { RMBH, Ib } },
1871 { "mov%LV", { RMeAX, Iv64 } },
1872 { "mov%LV", { RMeCX, Iv64 } },
1873 { "mov%LV", { RMeDX, Iv64 } },
1874 { "mov%LV", { RMeBX, Iv64 } },
1875 { "mov%LV", { RMeSP, Iv64 } },
1876 { "mov%LV", { RMeBP, Iv64 } },
1877 { "mov%LV", { RMeSI, Iv64 } },
1878 { "mov%LV", { RMeDI, Iv64 } },
1880 { REG_TABLE (REG_C0) },
1881 { REG_TABLE (REG_C1) },
1884 { X86_64_TABLE (X86_64_C4) },
1885 { X86_64_TABLE (X86_64_C5) },
1886 { REG_TABLE (REG_C6) },
1887 { REG_TABLE (REG_C7) },
1889 { "enterT", { Iw, Ib } },
1890 { "leaveT", { XX } },
1891 { "Jret{|f}P", { Iw } },
1892 { "Jret{|f}P", { XX } },
1895 { X86_64_TABLE (X86_64_CE) },
1896 { "iretP", { XX } },
1898 { REG_TABLE (REG_D0) },
1899 { REG_TABLE (REG_D1) },
1900 { REG_TABLE (REG_D2) },
1901 { REG_TABLE (REG_D3) },
1902 { X86_64_TABLE (X86_64_D4) },
1903 { X86_64_TABLE (X86_64_D5) },
1905 { "xlat", { DSBX } },
1916 { "loopneFH", { Jb, XX, loop_jcxz_flag } },
1917 { "loopeFH", { Jb, XX, loop_jcxz_flag } },
1918 { "loopFH", { Jb, XX, loop_jcxz_flag } },
1919 { "jEcxzH", { Jb, XX, loop_jcxz_flag } },
1920 { "inB", { AL, Ib } },
1921 { "inG", { zAX, Ib } },
1922 { "outB", { Ib, AL } },
1923 { "outG", { Ib, zAX } },
1925 { "callT", { Jv } },
1927 { X86_64_TABLE (X86_64_EA) },
1929 { "inB", { AL, indirDX } },
1930 { "inG", { zAX, indirDX } },
1931 { "outB", { indirDX, AL } },
1932 { "outG", { indirDX, zAX } },
1934 { Bad_Opcode }, /* lock prefix */
1935 { "icebp", { XX } },
1936 { Bad_Opcode }, /* repne */
1937 { Bad_Opcode }, /* repz */
1940 { REG_TABLE (REG_F6) },
1941 { REG_TABLE (REG_F7) },
1949 { REG_TABLE (REG_FE) },
1950 { REG_TABLE (REG_FF) },
1953 static const struct dis386 dis386_twobyte[] = {
1955 { REG_TABLE (REG_0F00 ) },
1956 { REG_TABLE (REG_0F01 ) },
1957 { "larS", { Gv, Ew } },
1958 { "lslS", { Gv, Ew } },
1960 { "syscall", { XX } },
1962 { "sysretP", { XX } },
1965 { "wbinvd", { XX } },
1969 { REG_TABLE (REG_0F0D) },
1970 { "femms", { XX } },
1971 { "", { MX, EM, OPSUF } }, /* See OP_3DNowSuffix. */
1973 { PREFIX_TABLE (PREFIX_0F10) },
1974 { PREFIX_TABLE (PREFIX_0F11) },
1975 { PREFIX_TABLE (PREFIX_0F12) },
1976 { MOD_TABLE (MOD_0F13) },
1977 { "unpcklpX", { XM, EXx } },
1978 { "unpckhpX", { XM, EXx } },
1979 { PREFIX_TABLE (PREFIX_0F16) },
1980 { MOD_TABLE (MOD_0F17) },
1982 { REG_TABLE (REG_0F18) },
1991 { MOD_TABLE (MOD_0F20) },
1992 { MOD_TABLE (MOD_0F21) },
1993 { MOD_TABLE (MOD_0F22) },
1994 { MOD_TABLE (MOD_0F23) },
1995 { MOD_TABLE (MOD_0F24) },
1997 { MOD_TABLE (MOD_0F26) },
2000 { "movapX", { XM, EXx } },
2001 { "movapX", { EXxS, XM } },
2002 { PREFIX_TABLE (PREFIX_0F2A) },
2003 { PREFIX_TABLE (PREFIX_0F2B) },
2004 { PREFIX_TABLE (PREFIX_0F2C) },
2005 { PREFIX_TABLE (PREFIX_0F2D) },
2006 { PREFIX_TABLE (PREFIX_0F2E) },
2007 { PREFIX_TABLE (PREFIX_0F2F) },
2009 { "wrmsr", { XX } },
2010 { "rdtsc", { XX } },
2011 { "rdmsr", { XX } },
2012 { "rdpmc", { XX } },
2013 { "sysenter", { XX } },
2014 { "sysexit", { XX } },
2016 { "getsec", { XX } },
2018 { THREE_BYTE_TABLE (THREE_BYTE_0F38) },
2020 { THREE_BYTE_TABLE (THREE_BYTE_0F3A) },
2027 { "cmovoS", { Gv, Ev } },
2028 { "cmovnoS", { Gv, Ev } },
2029 { "cmovbS", { Gv, Ev } },
2030 { "cmovaeS", { Gv, Ev } },
2031 { "cmoveS", { Gv, Ev } },
2032 { "cmovneS", { Gv, Ev } },
2033 { "cmovbeS", { Gv, Ev } },
2034 { "cmovaS", { Gv, Ev } },
2036 { "cmovsS", { Gv, Ev } },
2037 { "cmovnsS", { Gv, Ev } },
2038 { "cmovpS", { Gv, Ev } },
2039 { "cmovnpS", { Gv, Ev } },
2040 { "cmovlS", { Gv, Ev } },
2041 { "cmovgeS", { Gv, Ev } },
2042 { "cmovleS", { Gv, Ev } },
2043 { "cmovgS", { Gv, Ev } },
2045 { MOD_TABLE (MOD_0F51) },
2046 { PREFIX_TABLE (PREFIX_0F51) },
2047 { PREFIX_TABLE (PREFIX_0F52) },
2048 { PREFIX_TABLE (PREFIX_0F53) },
2049 { "andpX", { XM, EXx } },
2050 { "andnpX", { XM, EXx } },
2051 { "orpX", { XM, EXx } },
2052 { "xorpX", { XM, EXx } },
2054 { PREFIX_TABLE (PREFIX_0F58) },
2055 { PREFIX_TABLE (PREFIX_0F59) },
2056 { PREFIX_TABLE (PREFIX_0F5A) },
2057 { PREFIX_TABLE (PREFIX_0F5B) },
2058 { PREFIX_TABLE (PREFIX_0F5C) },
2059 { PREFIX_TABLE (PREFIX_0F5D) },
2060 { PREFIX_TABLE (PREFIX_0F5E) },
2061 { PREFIX_TABLE (PREFIX_0F5F) },
2063 { PREFIX_TABLE (PREFIX_0F60) },
2064 { PREFIX_TABLE (PREFIX_0F61) },
2065 { PREFIX_TABLE (PREFIX_0F62) },
2066 { "packsswb", { MX, EM } },
2067 { "pcmpgtb", { MX, EM } },
2068 { "pcmpgtw", { MX, EM } },
2069 { "pcmpgtd", { MX, EM } },
2070 { "packuswb", { MX, EM } },
2072 { "punpckhbw", { MX, EM } },
2073 { "punpckhwd", { MX, EM } },
2074 { "punpckhdq", { MX, EM } },
2075 { "packssdw", { MX, EM } },
2076 { PREFIX_TABLE (PREFIX_0F6C) },
2077 { PREFIX_TABLE (PREFIX_0F6D) },
2078 { "movK", { MX, Edq } },
2079 { PREFIX_TABLE (PREFIX_0F6F) },
2081 { PREFIX_TABLE (PREFIX_0F70) },
2082 { REG_TABLE (REG_0F71) },
2083 { REG_TABLE (REG_0F72) },
2084 { REG_TABLE (REG_0F73) },
2085 { "pcmpeqb", { MX, EM } },
2086 { "pcmpeqw", { MX, EM } },
2087 { "pcmpeqd", { MX, EM } },
2090 { PREFIX_TABLE (PREFIX_0F78) },
2091 { PREFIX_TABLE (PREFIX_0F79) },
2092 { THREE_BYTE_TABLE (THREE_BYTE_0F7A) },
2094 { PREFIX_TABLE (PREFIX_0F7C) },
2095 { PREFIX_TABLE (PREFIX_0F7D) },
2096 { PREFIX_TABLE (PREFIX_0F7E) },
2097 { PREFIX_TABLE (PREFIX_0F7F) },
2099 { "joH", { Jv, XX, cond_jump_flag } },
2100 { "jnoH", { Jv, XX, cond_jump_flag } },
2101 { "jbH", { Jv, XX, cond_jump_flag } },
2102 { "jaeH", { Jv, XX, cond_jump_flag } },
2103 { "jeH", { Jv, XX, cond_jump_flag } },
2104 { "jneH", { Jv, XX, cond_jump_flag } },
2105 { "jbeH", { Jv, XX, cond_jump_flag } },
2106 { "jaH", { Jv, XX, cond_jump_flag } },
2108 { "jsH", { Jv, XX, cond_jump_flag } },
2109 { "jnsH", { Jv, XX, cond_jump_flag } },
2110 { "jpH", { Jv, XX, cond_jump_flag } },
2111 { "jnpH", { Jv, XX, cond_jump_flag } },
2112 { "jlH", { Jv, XX, cond_jump_flag } },
2113 { "jgeH", { Jv, XX, cond_jump_flag } },
2114 { "jleH", { Jv, XX, cond_jump_flag } },
2115 { "jgH", { Jv, XX, cond_jump_flag } },
2118 { "setno", { Eb } },
2120 { "setae", { Eb } },
2122 { "setne", { Eb } },
2123 { "setbe", { Eb } },
2127 { "setns", { Eb } },
2129 { "setnp", { Eb } },
2131 { "setge", { Eb } },
2132 { "setle", { Eb } },
2135 { "pushT", { fs } },
2137 { "cpuid", { XX } },
2138 { "btS", { Ev, Gv } },
2139 { "shldS", { Ev, Gv, Ib } },
2140 { "shldS", { Ev, Gv, CL } },
2141 { REG_TABLE (REG_0FA6) },
2142 { REG_TABLE (REG_0FA7) },
2144 { "pushT", { gs } },
2147 { "btsS", { Evh1, Gv } },
2148 { "shrdS", { Ev, Gv, Ib } },
2149 { "shrdS", { Ev, Gv, CL } },
2150 { REG_TABLE (REG_0FAE) },
2151 { "imulS", { Gv, Ev } },
2153 { "cmpxchgB", { Ebh1, Gb } },
2154 { "cmpxchgS", { Evh1, Gv } },
2155 { MOD_TABLE (MOD_0FB2) },
2156 { "btrS", { Evh1, Gv } },
2157 { MOD_TABLE (MOD_0FB4) },
2158 { MOD_TABLE (MOD_0FB5) },
2159 { "movz{bR|x}", { Gv, Eb } },
2160 { "movz{wR|x}", { Gv, Ew } }, /* yes, there really is movzww ! */
2162 { PREFIX_TABLE (PREFIX_0FB8) },
2164 { REG_TABLE (REG_0FBA) },
2165 { "btcS", { Evh1, Gv } },
2166 { PREFIX_TABLE (PREFIX_0FBC) },
2167 { PREFIX_TABLE (PREFIX_0FBD) },
2168 { "movs{bR|x}", { Gv, Eb } },
2169 { "movs{wR|x}", { Gv, Ew } }, /* yes, there really is movsww ! */
2171 { "xaddB", { Ebh1, Gb } },
2172 { "xaddS", { Evh1, Gv } },
2173 { PREFIX_TABLE (PREFIX_0FC2) },
2174 { PREFIX_TABLE (PREFIX_0FC3) },
2175 { "pinsrw", { MX, Edqw, Ib } },
2176 { "pextrw", { Gdq, MS, Ib } },
2177 { "shufpX", { XM, EXx, Ib } },
2178 { REG_TABLE (REG_0FC7) },
2180 { "bswap", { RMeAX } },
2181 { "bswap", { RMeCX } },
2182 { "bswap", { RMeDX } },
2183 { "bswap", { RMeBX } },
2184 { "bswap", { RMeSP } },
2185 { "bswap", { RMeBP } },
2186 { "bswap", { RMeSI } },
2187 { "bswap", { RMeDI } },
2189 { PREFIX_TABLE (PREFIX_0FD0) },
2190 { "psrlw", { MX, EM } },
2191 { "psrld", { MX, EM } },
2192 { "psrlq", { MX, EM } },
2193 { "paddq", { MX, EM } },
2194 { "pmullw", { MX, EM } },
2195 { PREFIX_TABLE (PREFIX_0FD6) },
2196 { MOD_TABLE (MOD_0FD7) },
2198 { "psubusb", { MX, EM } },
2199 { "psubusw", { MX, EM } },
2200 { "pminub", { MX, EM } },
2201 { "pand", { MX, EM } },
2202 { "paddusb", { MX, EM } },
2203 { "paddusw", { MX, EM } },
2204 { "pmaxub", { MX, EM } },
2205 { "pandn", { MX, EM } },
2207 { "pavgb", { MX, EM } },
2208 { "psraw", { MX, EM } },
2209 { "psrad", { MX, EM } },
2210 { "pavgw", { MX, EM } },
2211 { "pmulhuw", { MX, EM } },
2212 { "pmulhw", { MX, EM } },
2213 { PREFIX_TABLE (PREFIX_0FE6) },
2214 { PREFIX_TABLE (PREFIX_0FE7) },
2216 { "psubsb", { MX, EM } },
2217 { "psubsw", { MX, EM } },
2218 { "pminsw", { MX, EM } },
2219 { "por", { MX, EM } },
2220 { "paddsb", { MX, EM } },
2221 { "paddsw", { MX, EM } },
2222 { "pmaxsw", { MX, EM } },
2223 { "pxor", { MX, EM } },
2225 { PREFIX_TABLE (PREFIX_0FF0) },
2226 { "psllw", { MX, EM } },
2227 { "pslld", { MX, EM } },
2228 { "psllq", { MX, EM } },
2229 { "pmuludq", { MX, EM } },
2230 { "pmaddwd", { MX, EM } },
2231 { "psadbw", { MX, EM } },
2232 { PREFIX_TABLE (PREFIX_0FF7) },
2234 { "psubb", { MX, EM } },
2235 { "psubw", { MX, EM } },
2236 { "psubd", { MX, EM } },
2237 { "psubq", { MX, EM } },
2238 { "paddb", { MX, EM } },
2239 { "paddw", { MX, EM } },
2240 { "paddd", { MX, EM } },
2244 static const unsigned char onebyte_has_modrm[256] = {
2245 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2246 /* ------------------------------- */
2247 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2248 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2249 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2250 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2251 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2252 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2253 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2254 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2255 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2256 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2257 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2258 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2259 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2260 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2261 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2262 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2263 /* ------------------------------- */
2264 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2267 static const unsigned char twobyte_has_modrm[256] = {
2268 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2269 /* ------------------------------- */
2270 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2271 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2272 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2273 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2274 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2275 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2276 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2277 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2278 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2279 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2280 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2281 /* b0 */ 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, /* bf */
2282 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2283 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2284 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2285 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */
2286 /* ------------------------------- */
2287 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2290 static char obuf[100];
2292 static char *mnemonicendp;
2293 static char scratchbuf[100];
2294 static unsigned char *start_codep;
2295 static unsigned char *insn_codep;
2296 static unsigned char *codep;
2297 static int last_lock_prefix;
2298 static int last_repz_prefix;
2299 static int last_repnz_prefix;
2300 static int last_data_prefix;
2301 static int last_addr_prefix;
2302 static int last_rex_prefix;
2303 static int last_seg_prefix;
2304 #define MAX_CODE_LENGTH 15
2305 /* We can up to 14 prefixes since the maximum instruction length is
2307 static int all_prefixes[MAX_CODE_LENGTH - 1];
2308 static disassemble_info *the_info;
2316 static unsigned char need_modrm;
2326 int register_specifier;
2332 static unsigned char need_vex;
2333 static unsigned char need_vex_reg;
2334 static unsigned char vex_w_done;
2342 /* If we are accessing mod/rm/reg without need_modrm set, then the
2343 values are stale. Hitting this abort likely indicates that you
2344 need to update onebyte_has_modrm or twobyte_has_modrm. */
2345 #define MODRM_CHECK if (!need_modrm) abort ()
2347 static const char **names64;
2348 static const char **names32;
2349 static const char **names16;
2350 static const char **names8;
2351 static const char **names8rex;
2352 static const char **names_seg;
2353 static const char *index64;
2354 static const char *index32;
2355 static const char **index16;
2357 static const char *intel_names64[] = {
2358 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
2359 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
2361 static const char *intel_names32[] = {
2362 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
2363 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
2365 static const char *intel_names16[] = {
2366 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
2367 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
2369 static const char *intel_names8[] = {
2370 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
2372 static const char *intel_names8rex[] = {
2373 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
2374 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
2376 static const char *intel_names_seg[] = {
2377 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
2379 static const char *intel_index64 = "riz";
2380 static const char *intel_index32 = "eiz";
2381 static const char *intel_index16[] = {
2382 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
2385 static const char *att_names64[] = {
2386 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
2387 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
2389 static const char *att_names32[] = {
2390 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
2391 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
2393 static const char *att_names16[] = {
2394 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
2395 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
2397 static const char *att_names8[] = {
2398 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
2400 static const char *att_names8rex[] = {
2401 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
2402 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
2404 static const char *att_names_seg[] = {
2405 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
2407 static const char *att_index64 = "%riz";
2408 static const char *att_index32 = "%eiz";
2409 static const char *att_index16[] = {
2410 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
2413 static const char **names_mm;
2414 static const char *intel_names_mm[] = {
2415 "mm0", "mm1", "mm2", "mm3",
2416 "mm4", "mm5", "mm6", "mm7"
2418 static const char *att_names_mm[] = {
2419 "%mm0", "%mm1", "%mm2", "%mm3",
2420 "%mm4", "%mm5", "%mm6", "%mm7"
2423 static const char **names_xmm;
2424 static const char *intel_names_xmm[] = {
2425 "xmm0", "xmm1", "xmm2", "xmm3",
2426 "xmm4", "xmm5", "xmm6", "xmm7",
2427 "xmm8", "xmm9", "xmm10", "xmm11",
2428 "xmm12", "xmm13", "xmm14", "xmm15"
2430 static const char *att_names_xmm[] = {
2431 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
2432 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
2433 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
2434 "%xmm12", "%xmm13", "%xmm14", "%xmm15"
2437 static const char **names_ymm;
2438 static const char *intel_names_ymm[] = {
2439 "ymm0", "ymm1", "ymm2", "ymm3",
2440 "ymm4", "ymm5", "ymm6", "ymm7",
2441 "ymm8", "ymm9", "ymm10", "ymm11",
2442 "ymm12", "ymm13", "ymm14", "ymm15"
2444 static const char *att_names_ymm[] = {
2445 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
2446 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
2447 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
2448 "%ymm12", "%ymm13", "%ymm14", "%ymm15"
2451 static const struct dis386 reg_table[][8] = {
2454 { "addA", { Ebh1, Ib } },
2455 { "orA", { Ebh1, Ib } },
2456 { "adcA", { Ebh1, Ib } },
2457 { "sbbA", { Ebh1, Ib } },
2458 { "andA", { Ebh1, Ib } },
2459 { "subA", { Ebh1, Ib } },
2460 { "xorA", { Ebh1, Ib } },
2461 { "cmpA", { Eb, Ib } },
2465 { "addQ", { Evh1, Iv } },
2466 { "orQ", { Evh1, Iv } },
2467 { "adcQ", { Evh1, Iv } },
2468 { "sbbQ", { Evh1, Iv } },
2469 { "andQ", { Evh1, Iv } },
2470 { "subQ", { Evh1, Iv } },
2471 { "xorQ", { Evh1, Iv } },
2472 { "cmpQ", { Ev, Iv } },
2476 { "addQ", { Evh1, sIb } },
2477 { "orQ", { Evh1, sIb } },
2478 { "adcQ", { Evh1, sIb } },
2479 { "sbbQ", { Evh1, sIb } },
2480 { "andQ", { Evh1, sIb } },
2481 { "subQ", { Evh1, sIb } },
2482 { "xorQ", { Evh1, sIb } },
2483 { "cmpQ", { Ev, sIb } },
2487 { "popU", { stackEv } },
2488 { XOP_8F_TABLE (XOP_09) },
2492 { XOP_8F_TABLE (XOP_09) },
2496 { "rolA", { Eb, Ib } },
2497 { "rorA", { Eb, Ib } },
2498 { "rclA", { Eb, Ib } },
2499 { "rcrA", { Eb, Ib } },
2500 { "shlA", { Eb, Ib } },
2501 { "shrA", { Eb, Ib } },
2503 { "sarA", { Eb, Ib } },
2507 { "rolQ", { Ev, Ib } },
2508 { "rorQ", { Ev, Ib } },
2509 { "rclQ", { Ev, Ib } },
2510 { "rcrQ", { Ev, Ib } },
2511 { "shlQ", { Ev, Ib } },
2512 { "shrQ", { Ev, Ib } },
2514 { "sarQ", { Ev, Ib } },
2518 { "movA", { Ebh3, Ib } },
2525 { MOD_TABLE (MOD_C6_REG_7) },
2529 { "movQ", { Evh3, Iv } },
2536 { MOD_TABLE (MOD_C7_REG_7) },
2540 { "rolA", { Eb, I1 } },
2541 { "rorA", { Eb, I1 } },
2542 { "rclA", { Eb, I1 } },
2543 { "rcrA", { Eb, I1 } },
2544 { "shlA", { Eb, I1 } },
2545 { "shrA", { Eb, I1 } },
2547 { "sarA", { Eb, I1 } },
2551 { "rolQ", { Ev, I1 } },
2552 { "rorQ", { Ev, I1 } },
2553 { "rclQ", { Ev, I1 } },
2554 { "rcrQ", { Ev, I1 } },
2555 { "shlQ", { Ev, I1 } },
2556 { "shrQ", { Ev, I1 } },
2558 { "sarQ", { Ev, I1 } },
2562 { "rolA", { Eb, CL } },
2563 { "rorA", { Eb, CL } },
2564 { "rclA", { Eb, CL } },
2565 { "rcrA", { Eb, CL } },
2566 { "shlA", { Eb, CL } },
2567 { "shrA", { Eb, CL } },
2569 { "sarA", { Eb, CL } },
2573 { "rolQ", { Ev, CL } },
2574 { "rorQ", { Ev, CL } },
2575 { "rclQ", { Ev, CL } },
2576 { "rcrQ", { Ev, CL } },
2577 { "shlQ", { Ev, CL } },
2578 { "shrQ", { Ev, CL } },
2580 { "sarQ", { Ev, CL } },
2584 { "testA", { Eb, Ib } },
2586 { "notA", { Ebh1 } },
2587 { "negA", { Ebh1 } },
2588 { "mulA", { Eb } }, /* Don't print the implicit %al register, */
2589 { "imulA", { Eb } }, /* to distinguish these opcodes from other */
2590 { "divA", { Eb } }, /* mul/imul opcodes. Do the same for div */
2591 { "idivA", { Eb } }, /* and idiv for consistency. */
2595 { "testQ", { Ev, Iv } },
2597 { "notQ", { Evh1 } },
2598 { "negQ", { Evh1 } },
2599 { "mulQ", { Ev } }, /* Don't print the implicit register. */
2600 { "imulQ", { Ev } },
2602 { "idivQ", { Ev } },
2606 { "incA", { Ebh1 } },
2607 { "decA", { Ebh1 } },
2611 { "incQ", { Evh1 } },
2612 { "decQ", { Evh1 } },
2613 { "call{T|}", { indirEv } },
2614 { "Jcall{T|}", { indirEp } },
2615 { "jmp{T|}", { indirEv } },
2616 { "Jjmp{T|}", { indirEp } },
2617 { "pushU", { stackEv } },
2622 { "sldtD", { Sv } },
2633 { MOD_TABLE (MOD_0F01_REG_0) },
2634 { MOD_TABLE (MOD_0F01_REG_1) },
2635 { MOD_TABLE (MOD_0F01_REG_2) },
2636 { MOD_TABLE (MOD_0F01_REG_3) },
2637 { "smswD", { Sv } },
2640 { MOD_TABLE (MOD_0F01_REG_7) },
2644 { "prefetch", { Mb } },
2645 { "prefetchw", { Mb } },
2649 { MOD_TABLE (MOD_0F18_REG_0) },
2650 { MOD_TABLE (MOD_0F18_REG_1) },
2651 { MOD_TABLE (MOD_0F18_REG_2) },
2652 { MOD_TABLE (MOD_0F18_REG_3) },
2658 { MOD_TABLE (MOD_0F71_REG_2) },
2660 { MOD_TABLE (MOD_0F71_REG_4) },
2662 { MOD_TABLE (MOD_0F71_REG_6) },
2668 { MOD_TABLE (MOD_0F72_REG_2) },
2670 { MOD_TABLE (MOD_0F72_REG_4) },
2672 { MOD_TABLE (MOD_0F72_REG_6) },
2678 { MOD_TABLE (MOD_0F73_REG_2) },
2679 { MOD_TABLE (MOD_0F73_REG_3) },
2682 { MOD_TABLE (MOD_0F73_REG_6) },
2683 { MOD_TABLE (MOD_0F73_REG_7) },
2687 { "montmul", { { OP_0f07, 0 } } },
2688 { "xsha1", { { OP_0f07, 0 } } },
2689 { "xsha256", { { OP_0f07, 0 } } },
2693 { "xstore-rng", { { OP_0f07, 0 } } },
2694 { "xcrypt-ecb", { { OP_0f07, 0 } } },
2695 { "xcrypt-cbc", { { OP_0f07, 0 } } },
2696 { "xcrypt-ctr", { { OP_0f07, 0 } } },
2697 { "xcrypt-cfb", { { OP_0f07, 0 } } },
2698 { "xcrypt-ofb", { { OP_0f07, 0 } } },
2702 { MOD_TABLE (MOD_0FAE_REG_0) },
2703 { MOD_TABLE (MOD_0FAE_REG_1) },
2704 { MOD_TABLE (MOD_0FAE_REG_2) },
2705 { MOD_TABLE (MOD_0FAE_REG_3) },
2706 { MOD_TABLE (MOD_0FAE_REG_4) },
2707 { MOD_TABLE (MOD_0FAE_REG_5) },
2708 { MOD_TABLE (MOD_0FAE_REG_6) },
2709 { MOD_TABLE (MOD_0FAE_REG_7) },
2717 { "btQ", { Ev, Ib } },
2718 { "btsQ", { Evh1, Ib } },
2719 { "btrQ", { Evh1, Ib } },
2720 { "btcQ", { Evh1, Ib } },
2725 { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } } },
2730 { MOD_TABLE (MOD_0FC7_REG_6) },
2731 { MOD_TABLE (MOD_0FC7_REG_7) },
2737 { MOD_TABLE (MOD_VEX_0F71_REG_2) },
2739 { MOD_TABLE (MOD_VEX_0F71_REG_4) },
2741 { MOD_TABLE (MOD_VEX_0F71_REG_6) },
2747 { MOD_TABLE (MOD_VEX_0F72_REG_2) },
2749 { MOD_TABLE (MOD_VEX_0F72_REG_4) },
2751 { MOD_TABLE (MOD_VEX_0F72_REG_6) },
2757 { MOD_TABLE (MOD_VEX_0F73_REG_2) },
2758 { MOD_TABLE (MOD_VEX_0F73_REG_3) },
2761 { MOD_TABLE (MOD_VEX_0F73_REG_6) },
2762 { MOD_TABLE (MOD_VEX_0F73_REG_7) },
2768 { MOD_TABLE (MOD_VEX_0FAE_REG_2) },
2769 { MOD_TABLE (MOD_VEX_0FAE_REG_3) },
2771 /* REG_VEX_0F38F3 */
2774 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_1) },
2775 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_2) },
2776 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_3) },
2780 { "llwpcb", { { OP_LWPCB_E, 0 } } },
2781 { "slwpcb", { { OP_LWPCB_E, 0 } } },
2785 { "lwpins", { { OP_LWP_E, 0 }, Ed, Iq } },
2786 { "lwpval", { { OP_LWP_E, 0 }, Ed, Iq } },
2788 /* REG_XOP_TBM_01 */
2791 { "blcfill", { { OP_LWP_E, 0 }, Ev } },
2792 { "blsfill", { { OP_LWP_E, 0 }, Ev } },
2793 { "blcs", { { OP_LWP_E, 0 }, Ev } },
2794 { "tzmsk", { { OP_LWP_E, 0 }, Ev } },
2795 { "blcic", { { OP_LWP_E, 0 }, Ev } },
2796 { "blsic", { { OP_LWP_E, 0 }, Ev } },
2797 { "t1mskc", { { OP_LWP_E, 0 }, Ev } },
2799 /* REG_XOP_TBM_02 */
2802 { "blcmsk", { { OP_LWP_E, 0 }, Ev } },
2807 { "blci", { { OP_LWP_E, 0 }, Ev } },
2811 static const struct dis386 prefix_table[][4] = {
2814 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
2815 { "pause", { XX } },
2816 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
2821 { "movups", { XM, EXx } },
2822 { "movss", { XM, EXd } },
2823 { "movupd", { XM, EXx } },
2824 { "movsd", { XM, EXq } },
2829 { "movups", { EXxS, XM } },
2830 { "movss", { EXdS, XM } },
2831 { "movupd", { EXxS, XM } },
2832 { "movsd", { EXqS, XM } },
2837 { MOD_TABLE (MOD_0F12_PREFIX_0) },
2838 { "movsldup", { XM, EXx } },
2839 { "movlpd", { XM, EXq } },
2840 { "movddup", { XM, EXq } },
2845 { MOD_TABLE (MOD_0F16_PREFIX_0) },
2846 { "movshdup", { XM, EXx } },
2847 { "movhpd", { XM, EXq } },
2852 { "cvtpi2ps", { XM, EMCq } },
2853 { "cvtsi2ss%LQ", { XM, Ev } },
2854 { "cvtpi2pd", { XM, EMCq } },
2855 { "cvtsi2sd%LQ", { XM, Ev } },
2860 { MOD_TABLE (MOD_0F2B_PREFIX_0) },
2861 { MOD_TABLE (MOD_0F2B_PREFIX_1) },
2862 { MOD_TABLE (MOD_0F2B_PREFIX_2) },
2863 { MOD_TABLE (MOD_0F2B_PREFIX_3) },
2868 { "cvttps2pi", { MXC, EXq } },
2869 { "cvttss2siY", { Gv, EXd } },
2870 { "cvttpd2pi", { MXC, EXx } },
2871 { "cvttsd2siY", { Gv, EXq } },
2876 { "cvtps2pi", { MXC, EXq } },
2877 { "cvtss2siY", { Gv, EXd } },
2878 { "cvtpd2pi", { MXC, EXx } },
2879 { "cvtsd2siY", { Gv, EXq } },
2884 { "ucomiss",{ XM, EXd } },
2886 { "ucomisd",{ XM, EXq } },
2891 { "comiss", { XM, EXd } },
2893 { "comisd", { XM, EXq } },
2898 { "sqrtps", { XM, EXx } },
2899 { "sqrtss", { XM, EXd } },
2900 { "sqrtpd", { XM, EXx } },
2901 { "sqrtsd", { XM, EXq } },
2906 { "rsqrtps",{ XM, EXx } },
2907 { "rsqrtss",{ XM, EXd } },
2912 { "rcpps", { XM, EXx } },
2913 { "rcpss", { XM, EXd } },
2918 { "addps", { XM, EXx } },
2919 { "addss", { XM, EXd } },
2920 { "addpd", { XM, EXx } },
2921 { "addsd", { XM, EXq } },
2926 { "mulps", { XM, EXx } },
2927 { "mulss", { XM, EXd } },
2928 { "mulpd", { XM, EXx } },
2929 { "mulsd", { XM, EXq } },
2934 { "cvtps2pd", { XM, EXq } },
2935 { "cvtss2sd", { XM, EXd } },
2936 { "cvtpd2ps", { XM, EXx } },
2937 { "cvtsd2ss", { XM, EXq } },
2942 { "cvtdq2ps", { XM, EXx } },
2943 { "cvttps2dq", { XM, EXx } },
2944 { "cvtps2dq", { XM, EXx } },
2949 { "subps", { XM, EXx } },
2950 { "subss", { XM, EXd } },
2951 { "subpd", { XM, EXx } },
2952 { "subsd", { XM, EXq } },
2957 { "minps", { XM, EXx } },
2958 { "minss", { XM, EXd } },
2959 { "minpd", { XM, EXx } },
2960 { "minsd", { XM, EXq } },
2965 { "divps", { XM, EXx } },
2966 { "divss", { XM, EXd } },
2967 { "divpd", { XM, EXx } },
2968 { "divsd", { XM, EXq } },
2973 { "maxps", { XM, EXx } },
2974 { "maxss", { XM, EXd } },
2975 { "maxpd", { XM, EXx } },
2976 { "maxsd", { XM, EXq } },
2981 { "punpcklbw",{ MX, EMd } },
2983 { "punpcklbw",{ MX, EMx } },
2988 { "punpcklwd",{ MX, EMd } },
2990 { "punpcklwd",{ MX, EMx } },
2995 { "punpckldq",{ MX, EMd } },
2997 { "punpckldq",{ MX, EMx } },
3004 { "punpcklqdq", { XM, EXx } },
3011 { "punpckhqdq", { XM, EXx } },
3016 { "movq", { MX, EM } },
3017 { "movdqu", { XM, EXx } },
3018 { "movdqa", { XM, EXx } },
3023 { "pshufw", { MX, EM, Ib } },
3024 { "pshufhw",{ XM, EXx, Ib } },
3025 { "pshufd", { XM, EXx, Ib } },
3026 { "pshuflw",{ XM, EXx, Ib } },
3029 /* PREFIX_0F73_REG_3 */
3033 { "psrldq", { XS, Ib } },
3036 /* PREFIX_0F73_REG_7 */
3040 { "pslldq", { XS, Ib } },
3045 {"vmread", { Em, Gm } },
3047 {"extrq", { XS, Ib, Ib } },
3048 {"insertq", { XM, XS, Ib, Ib } },
3053 {"vmwrite", { Gm, Em } },
3055 {"extrq", { XM, XS } },
3056 {"insertq", { XM, XS } },
3063 { "haddpd", { XM, EXx } },
3064 { "haddps", { XM, EXx } },
3071 { "hsubpd", { XM, EXx } },
3072 { "hsubps", { XM, EXx } },
3077 { "movK", { Edq, MX } },
3078 { "movq", { XM, EXq } },
3079 { "movK", { Edq, XM } },
3084 { "movq", { EMS, MX } },
3085 { "movdqu", { EXxS, XM } },
3086 { "movdqa", { EXxS, XM } },
3089 /* PREFIX_0FAE_REG_0 */
3092 { "rdfsbase", { Ev } },
3095 /* PREFIX_0FAE_REG_1 */
3098 { "rdgsbase", { Ev } },
3101 /* PREFIX_0FAE_REG_2 */
3104 { "wrfsbase", { Ev } },
3107 /* PREFIX_0FAE_REG_3 */
3110 { "wrgsbase", { Ev } },
3116 { "popcntS", { Gv, Ev } },
3121 { "bsfS", { Gv, Ev } },
3122 { "tzcntS", { Gv, Ev } },
3123 { "bsfS", { Gv, Ev } },
3128 { "bsrS", { Gv, Ev } },
3129 { "lzcntS", { Gv, Ev } },
3130 { "bsrS", { Gv, Ev } },
3135 { "cmpps", { XM, EXx, CMP } },
3136 { "cmpss", { XM, EXd, CMP } },
3137 { "cmppd", { XM, EXx, CMP } },
3138 { "cmpsd", { XM, EXq, CMP } },
3143 { "movntiS", { Ma, Gv } },
3146 /* PREFIX_0FC7_REG_6 */
3148 { "vmptrld",{ Mq } },
3149 { "vmxon", { Mq } },
3150 { "vmclear",{ Mq } },
3157 { "addsubpd", { XM, EXx } },
3158 { "addsubps", { XM, EXx } },
3164 { "movq2dq",{ XM, MS } },
3165 { "movq", { EXqS, XM } },
3166 { "movdq2q",{ MX, XS } },
3172 { "cvtdq2pd", { XM, EXq } },
3173 { "cvttpd2dq", { XM, EXx } },
3174 { "cvtpd2dq", { XM, EXx } },
3179 { "movntq", { Mq, MX } },
3181 { MOD_TABLE (MOD_0FE7_PREFIX_2) },
3189 { MOD_TABLE (MOD_0FF0_PREFIX_3) },
3194 { "maskmovq", { MX, MS } },
3196 { "maskmovdqu", { XM, XS } },
3203 { "pblendvb", { XM, EXx, XMM0 } },
3210 { "blendvps", { XM, EXx, XMM0 } },
3217 { "blendvpd", { XM, EXx, XMM0 } },
3224 { "ptest", { XM, EXx } },
3231 { "pmovsxbw", { XM, EXq } },
3238 { "pmovsxbd", { XM, EXd } },
3245 { "pmovsxbq", { XM, EXw } },
3252 { "pmovsxwd", { XM, EXq } },
3259 { "pmovsxwq", { XM, EXd } },
3266 { "pmovsxdq", { XM, EXq } },
3273 { "pmuldq", { XM, EXx } },
3280 { "pcmpeqq", { XM, EXx } },
3287 { MOD_TABLE (MOD_0F382A_PREFIX_2) },
3294 { "packusdw", { XM, EXx } },
3301 { "pmovzxbw", { XM, EXq } },
3308 { "pmovzxbd", { XM, EXd } },
3315 { "pmovzxbq", { XM, EXw } },
3322 { "pmovzxwd", { XM, EXq } },
3329 { "pmovzxwq", { XM, EXd } },
3336 { "pmovzxdq", { XM, EXq } },
3343 { "pcmpgtq", { XM, EXx } },
3350 { "pminsb", { XM, EXx } },
3357 { "pminsd", { XM, EXx } },
3364 { "pminuw", { XM, EXx } },
3371 { "pminud", { XM, EXx } },
3378 { "pmaxsb", { XM, EXx } },
3385 { "pmaxsd", { XM, EXx } },
3392 { "pmaxuw", { XM, EXx } },
3399 { "pmaxud", { XM, EXx } },
3406 { "pmulld", { XM, EXx } },
3413 { "phminposuw", { XM, EXx } },
3420 { "invept", { Gm, Mo } },
3427 { "invvpid", { Gm, Mo } },
3434 { "invpcid", { Gm, M } },
3441 { "aesimc", { XM, EXx } },
3448 { "aesenc", { XM, EXx } },
3455 { "aesenclast", { XM, EXx } },
3462 { "aesdec", { XM, EXx } },
3469 { "aesdeclast", { XM, EXx } },
3474 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } } },
3476 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } } },
3477 { "crc32", { Gdq, { CRC32_Fixup, b_mode } } },
3482 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv } },
3484 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv } },
3485 { "crc32", { Gdq, { CRC32_Fixup, v_mode } } },
3492 { "roundps", { XM, EXx, Ib } },
3499 { "roundpd", { XM, EXx, Ib } },
3506 { "roundss", { XM, EXd, Ib } },
3513 { "roundsd", { XM, EXq, Ib } },
3520 { "blendps", { XM, EXx, Ib } },
3527 { "blendpd", { XM, EXx, Ib } },
3534 { "pblendw", { XM, EXx, Ib } },
3541 { "pextrb", { Edqb, XM, Ib } },
3548 { "pextrw", { Edqw, XM, Ib } },
3555 { "pextrK", { Edq, XM, Ib } },
3562 { "extractps", { Edqd, XM, Ib } },
3569 { "pinsrb", { XM, Edqb, Ib } },
3576 { "insertps", { XM, EXd, Ib } },
3583 { "pinsrK", { XM, Edq, Ib } },
3590 { "dpps", { XM, EXx, Ib } },
3597 { "dppd", { XM, EXx, Ib } },
3604 { "mpsadbw", { XM, EXx, Ib } },
3611 { "pclmulqdq", { XM, EXx, PCLMUL } },
3618 { "pcmpestrm", { XM, EXx, Ib } },
3625 { "pcmpestri", { XM, EXx, Ib } },
3632 { "pcmpistrm", { XM, EXx, Ib } },
3639 { "pcmpistri", { XM, EXx, Ib } },
3646 { "aeskeygenassist", { XM, EXx, Ib } },
3649 /* PREFIX_VEX_0F10 */
3651 { VEX_W_TABLE (VEX_W_0F10_P_0) },
3652 { VEX_LEN_TABLE (VEX_LEN_0F10_P_1) },
3653 { VEX_W_TABLE (VEX_W_0F10_P_2) },
3654 { VEX_LEN_TABLE (VEX_LEN_0F10_P_3) },
3657 /* PREFIX_VEX_0F11 */
3659 { VEX_W_TABLE (VEX_W_0F11_P_0) },
3660 { VEX_LEN_TABLE (VEX_LEN_0F11_P_1) },
3661 { VEX_W_TABLE (VEX_W_0F11_P_2) },
3662 { VEX_LEN_TABLE (VEX_LEN_0F11_P_3) },
3665 /* PREFIX_VEX_0F12 */
3667 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0) },
3668 { VEX_W_TABLE (VEX_W_0F12_P_1) },
3669 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2) },
3670 { VEX_W_TABLE (VEX_W_0F12_P_3) },
3673 /* PREFIX_VEX_0F16 */
3675 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0) },
3676 { VEX_W_TABLE (VEX_W_0F16_P_1) },
3677 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2) },
3680 /* PREFIX_VEX_0F2A */
3683 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_1) },
3685 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_3) },
3688 /* PREFIX_VEX_0F2C */
3691 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_1) },
3693 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_3) },
3696 /* PREFIX_VEX_0F2D */
3699 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_1) },
3701 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_3) },
3704 /* PREFIX_VEX_0F2E */
3706 { VEX_LEN_TABLE (VEX_LEN_0F2E_P_0) },
3708 { VEX_LEN_TABLE (VEX_LEN_0F2E_P_2) },
3711 /* PREFIX_VEX_0F2F */
3713 { VEX_LEN_TABLE (VEX_LEN_0F2F_P_0) },
3715 { VEX_LEN_TABLE (VEX_LEN_0F2F_P_2) },
3718 /* PREFIX_VEX_0F51 */
3720 { VEX_W_TABLE (VEX_W_0F51_P_0) },
3721 { VEX_LEN_TABLE (VEX_LEN_0F51_P_1) },
3722 { VEX_W_TABLE (VEX_W_0F51_P_2) },
3723 { VEX_LEN_TABLE (VEX_LEN_0F51_P_3) },
3726 /* PREFIX_VEX_0F52 */
3728 { VEX_W_TABLE (VEX_W_0F52_P_0) },
3729 { VEX_LEN_TABLE (VEX_LEN_0F52_P_1) },
3732 /* PREFIX_VEX_0F53 */
3734 { VEX_W_TABLE (VEX_W_0F53_P_0) },
3735 { VEX_LEN_TABLE (VEX_LEN_0F53_P_1) },
3738 /* PREFIX_VEX_0F58 */
3740 { VEX_W_TABLE (VEX_W_0F58_P_0) },
3741 { VEX_LEN_TABLE (VEX_LEN_0F58_P_1) },
3742 { VEX_W_TABLE (VEX_W_0F58_P_2) },
3743 { VEX_LEN_TABLE (VEX_LEN_0F58_P_3) },
3746 /* PREFIX_VEX_0F59 */
3748 { VEX_W_TABLE (VEX_W_0F59_P_0) },
3749 { VEX_LEN_TABLE (VEX_LEN_0F59_P_1) },
3750 { VEX_W_TABLE (VEX_W_0F59_P_2) },
3751 { VEX_LEN_TABLE (VEX_LEN_0F59_P_3) },
3754 /* PREFIX_VEX_0F5A */
3756 { VEX_W_TABLE (VEX_W_0F5A_P_0) },
3757 { VEX_LEN_TABLE (VEX_LEN_0F5A_P_1) },
3758 { "vcvtpd2ps%XY", { XMM, EXx } },
3759 { VEX_LEN_TABLE (VEX_LEN_0F5A_P_3) },
3762 /* PREFIX_VEX_0F5B */
3764 { VEX_W_TABLE (VEX_W_0F5B_P_0) },
3765 { VEX_W_TABLE (VEX_W_0F5B_P_1) },
3766 { VEX_W_TABLE (VEX_W_0F5B_P_2) },
3769 /* PREFIX_VEX_0F5C */
3771 { VEX_W_TABLE (VEX_W_0F5C_P_0) },
3772 { VEX_LEN_TABLE (VEX_LEN_0F5C_P_1) },
3773 { VEX_W_TABLE (VEX_W_0F5C_P_2) },
3774 { VEX_LEN_TABLE (VEX_LEN_0F5C_P_3) },
3777 /* PREFIX_VEX_0F5D */
3779 { VEX_W_TABLE (VEX_W_0F5D_P_0) },
3780 { VEX_LEN_TABLE (VEX_LEN_0F5D_P_1) },
3781 { VEX_W_TABLE (VEX_W_0F5D_P_2) },
3782 { VEX_LEN_TABLE (VEX_LEN_0F5D_P_3) },
3785 /* PREFIX_VEX_0F5E */
3787 { VEX_W_TABLE (VEX_W_0F5E_P_0) },
3788 { VEX_LEN_TABLE (VEX_LEN_0F5E_P_1) },
3789 { VEX_W_TABLE (VEX_W_0F5E_P_2) },
3790 { VEX_LEN_TABLE (VEX_LEN_0F5E_P_3) },
3793 /* PREFIX_VEX_0F5F */
3795 { VEX_W_TABLE (VEX_W_0F5F_P_0) },
3796 { VEX_LEN_TABLE (VEX_LEN_0F5F_P_1) },
3797 { VEX_W_TABLE (VEX_W_0F5F_P_2) },
3798 { VEX_LEN_TABLE (VEX_LEN_0F5F_P_3) },
3801 /* PREFIX_VEX_0F60 */
3805 { VEX_W_TABLE (VEX_W_0F60_P_2) },
3808 /* PREFIX_VEX_0F61 */
3812 { VEX_W_TABLE (VEX_W_0F61_P_2) },
3815 /* PREFIX_VEX_0F62 */
3819 { VEX_W_TABLE (VEX_W_0F62_P_2) },
3822 /* PREFIX_VEX_0F63 */
3826 { VEX_W_TABLE (VEX_W_0F63_P_2) },
3829 /* PREFIX_VEX_0F64 */
3833 { VEX_W_TABLE (VEX_W_0F64_P_2) },
3836 /* PREFIX_VEX_0F65 */
3840 { VEX_W_TABLE (VEX_W_0F65_P_2) },
3843 /* PREFIX_VEX_0F66 */
3847 { VEX_W_TABLE (VEX_W_0F66_P_2) },
3850 /* PREFIX_VEX_0F67 */
3854 { VEX_W_TABLE (VEX_W_0F67_P_2) },
3857 /* PREFIX_VEX_0F68 */
3861 { VEX_W_TABLE (VEX_W_0F68_P_2) },
3864 /* PREFIX_VEX_0F69 */
3868 { VEX_W_TABLE (VEX_W_0F69_P_2) },
3871 /* PREFIX_VEX_0F6A */
3875 { VEX_W_TABLE (VEX_W_0F6A_P_2) },
3878 /* PREFIX_VEX_0F6B */
3882 { VEX_W_TABLE (VEX_W_0F6B_P_2) },
3885 /* PREFIX_VEX_0F6C */
3889 { VEX_W_TABLE (VEX_W_0F6C_P_2) },
3892 /* PREFIX_VEX_0F6D */
3896 { VEX_W_TABLE (VEX_W_0F6D_P_2) },
3899 /* PREFIX_VEX_0F6E */
3903 { VEX_LEN_TABLE (VEX_LEN_0F6E_P_2) },
3906 /* PREFIX_VEX_0F6F */
3909 { VEX_W_TABLE (VEX_W_0F6F_P_1) },
3910 { VEX_W_TABLE (VEX_W_0F6F_P_2) },
3913 /* PREFIX_VEX_0F70 */
3916 { VEX_W_TABLE (VEX_W_0F70_P_1) },
3917 { VEX_W_TABLE (VEX_W_0F70_P_2) },
3918 { VEX_W_TABLE (VEX_W_0F70_P_3) },
3921 /* PREFIX_VEX_0F71_REG_2 */
3925 { VEX_W_TABLE (VEX_W_0F71_R_2_P_2) },
3928 /* PREFIX_VEX_0F71_REG_4 */
3932 { VEX_W_TABLE (VEX_W_0F71_R_4_P_2) },
3935 /* PREFIX_VEX_0F71_REG_6 */
3939 { VEX_W_TABLE (VEX_W_0F71_R_6_P_2) },
3942 /* PREFIX_VEX_0F72_REG_2 */
3946 { VEX_W_TABLE (VEX_W_0F72_R_2_P_2) },
3949 /* PREFIX_VEX_0F72_REG_4 */
3953 { VEX_W_TABLE (VEX_W_0F72_R_4_P_2) },
3956 /* PREFIX_VEX_0F72_REG_6 */
3960 { VEX_W_TABLE (VEX_W_0F72_R_6_P_2) },
3963 /* PREFIX_VEX_0F73_REG_2 */
3967 { VEX_W_TABLE (VEX_W_0F73_R_2_P_2) },
3970 /* PREFIX_VEX_0F73_REG_3 */
3974 { VEX_W_TABLE (VEX_W_0F73_R_3_P_2) },
3977 /* PREFIX_VEX_0F73_REG_6 */
3981 { VEX_W_TABLE (VEX_W_0F73_R_6_P_2) },
3984 /* PREFIX_VEX_0F73_REG_7 */
3988 { VEX_W_TABLE (VEX_W_0F73_R_7_P_2) },
3991 /* PREFIX_VEX_0F74 */
3995 { VEX_W_TABLE (VEX_W_0F74_P_2) },
3998 /* PREFIX_VEX_0F75 */
4002 { VEX_W_TABLE (VEX_W_0F75_P_2) },
4005 /* PREFIX_VEX_0F76 */
4009 { VEX_W_TABLE (VEX_W_0F76_P_2) },
4012 /* PREFIX_VEX_0F77 */
4014 { VEX_W_TABLE (VEX_W_0F77_P_0) },
4017 /* PREFIX_VEX_0F7C */
4021 { VEX_W_TABLE (VEX_W_0F7C_P_2) },
4022 { VEX_W_TABLE (VEX_W_0F7C_P_3) },
4025 /* PREFIX_VEX_0F7D */
4029 { VEX_W_TABLE (VEX_W_0F7D_P_2) },
4030 { VEX_W_TABLE (VEX_W_0F7D_P_3) },
4033 /* PREFIX_VEX_0F7E */
4036 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1) },
4037 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2) },
4040 /* PREFIX_VEX_0F7F */
4043 { VEX_W_TABLE (VEX_W_0F7F_P_1) },
4044 { VEX_W_TABLE (VEX_W_0F7F_P_2) },
4047 /* PREFIX_VEX_0FC2 */
4049 { VEX_W_TABLE (VEX_W_0FC2_P_0) },
4050 { VEX_LEN_TABLE (VEX_LEN_0FC2_P_1) },
4051 { VEX_W_TABLE (VEX_W_0FC2_P_2) },
4052 { VEX_LEN_TABLE (VEX_LEN_0FC2_P_3) },
4055 /* PREFIX_VEX_0FC4 */
4059 { VEX_LEN_TABLE (VEX_LEN_0FC4_P_2) },
4062 /* PREFIX_VEX_0FC5 */
4066 { VEX_LEN_TABLE (VEX_LEN_0FC5_P_2) },
4069 /* PREFIX_VEX_0FD0 */
4073 { VEX_W_TABLE (VEX_W_0FD0_P_2) },
4074 { VEX_W_TABLE (VEX_W_0FD0_P_3) },
4077 /* PREFIX_VEX_0FD1 */
4081 { VEX_W_TABLE (VEX_W_0FD1_P_2) },
4084 /* PREFIX_VEX_0FD2 */
4088 { VEX_W_TABLE (VEX_W_0FD2_P_2) },
4091 /* PREFIX_VEX_0FD3 */
4095 { VEX_W_TABLE (VEX_W_0FD3_P_2) },
4098 /* PREFIX_VEX_0FD4 */
4102 { VEX_W_TABLE (VEX_W_0FD4_P_2) },
4105 /* PREFIX_VEX_0FD5 */
4109 { VEX_W_TABLE (VEX_W_0FD5_P_2) },
4112 /* PREFIX_VEX_0FD6 */
4116 { VEX_LEN_TABLE (VEX_LEN_0FD6_P_2) },
4119 /* PREFIX_VEX_0FD7 */
4123 { MOD_TABLE (MOD_VEX_0FD7_PREFIX_2) },
4126 /* PREFIX_VEX_0FD8 */
4130 { VEX_W_TABLE (VEX_W_0FD8_P_2) },
4133 /* PREFIX_VEX_0FD9 */
4137 { VEX_W_TABLE (VEX_W_0FD9_P_2) },
4140 /* PREFIX_VEX_0FDA */
4144 { VEX_W_TABLE (VEX_W_0FDA_P_2) },
4147 /* PREFIX_VEX_0FDB */
4151 { VEX_W_TABLE (VEX_W_0FDB_P_2) },
4154 /* PREFIX_VEX_0FDC */
4158 { VEX_W_TABLE (VEX_W_0FDC_P_2) },
4161 /* PREFIX_VEX_0FDD */
4165 { VEX_W_TABLE (VEX_W_0FDD_P_2) },
4168 /* PREFIX_VEX_0FDE */
4172 { VEX_W_TABLE (VEX_W_0FDE_P_2) },
4175 /* PREFIX_VEX_0FDF */
4179 { VEX_W_TABLE (VEX_W_0FDF_P_2) },
4182 /* PREFIX_VEX_0FE0 */
4186 { VEX_W_TABLE (VEX_W_0FE0_P_2) },
4189 /* PREFIX_VEX_0FE1 */
4193 { VEX_W_TABLE (VEX_W_0FE1_P_2) },
4196 /* PREFIX_VEX_0FE2 */
4200 { VEX_W_TABLE (VEX_W_0FE2_P_2) },
4203 /* PREFIX_VEX_0FE3 */
4207 { VEX_W_TABLE (VEX_W_0FE3_P_2) },
4210 /* PREFIX_VEX_0FE4 */
4214 { VEX_W_TABLE (VEX_W_0FE4_P_2) },
4217 /* PREFIX_VEX_0FE5 */
4221 { VEX_W_TABLE (VEX_W_0FE5_P_2) },
4224 /* PREFIX_VEX_0FE6 */
4227 { VEX_W_TABLE (VEX_W_0FE6_P_1) },
4228 { VEX_W_TABLE (VEX_W_0FE6_P_2) },
4229 { VEX_W_TABLE (VEX_W_0FE6_P_3) },
4232 /* PREFIX_VEX_0FE7 */
4236 { MOD_TABLE (MOD_VEX_0FE7_PREFIX_2) },
4239 /* PREFIX_VEX_0FE8 */
4243 { VEX_W_TABLE (VEX_W_0FE8_P_2) },
4246 /* PREFIX_VEX_0FE9 */
4250 { VEX_W_TABLE (VEX_W_0FE9_P_2) },
4253 /* PREFIX_VEX_0FEA */
4257 { VEX_W_TABLE (VEX_W_0FEA_P_2) },
4260 /* PREFIX_VEX_0FEB */
4264 { VEX_W_TABLE (VEX_W_0FEB_P_2) },
4267 /* PREFIX_VEX_0FEC */
4271 { VEX_W_TABLE (VEX_W_0FEC_P_2) },
4274 /* PREFIX_VEX_0FED */
4278 { VEX_W_TABLE (VEX_W_0FED_P_2) },
4281 /* PREFIX_VEX_0FEE */
4285 { VEX_W_TABLE (VEX_W_0FEE_P_2) },
4288 /* PREFIX_VEX_0FEF */
4292 { VEX_W_TABLE (VEX_W_0FEF_P_2) },
4295 /* PREFIX_VEX_0FF0 */
4300 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3) },
4303 /* PREFIX_VEX_0FF1 */
4307 { VEX_W_TABLE (VEX_W_0FF1_P_2) },
4310 /* PREFIX_VEX_0FF2 */
4314 { VEX_W_TABLE (VEX_W_0FF2_P_2) },
4317 /* PREFIX_VEX_0FF3 */
4321 { VEX_W_TABLE (VEX_W_0FF3_P_2) },
4324 /* PREFIX_VEX_0FF4 */
4328 { VEX_W_TABLE (VEX_W_0FF4_P_2) },
4331 /* PREFIX_VEX_0FF5 */
4335 { VEX_W_TABLE (VEX_W_0FF5_P_2) },
4338 /* PREFIX_VEX_0FF6 */
4342 { VEX_W_TABLE (VEX_W_0FF6_P_2) },
4345 /* PREFIX_VEX_0FF7 */
4349 { VEX_LEN_TABLE (VEX_LEN_0FF7_P_2) },
4352 /* PREFIX_VEX_0FF8 */
4356 { VEX_W_TABLE (VEX_W_0FF8_P_2) },
4359 /* PREFIX_VEX_0FF9 */
4363 { VEX_W_TABLE (VEX_W_0FF9_P_2) },
4366 /* PREFIX_VEX_0FFA */
4370 { VEX_W_TABLE (VEX_W_0FFA_P_2) },
4373 /* PREFIX_VEX_0FFB */
4377 { VEX_W_TABLE (VEX_W_0FFB_P_2) },
4380 /* PREFIX_VEX_0FFC */
4384 { VEX_W_TABLE (VEX_W_0FFC_P_2) },
4387 /* PREFIX_VEX_0FFD */
4391 { VEX_W_TABLE (VEX_W_0FFD_P_2) },
4394 /* PREFIX_VEX_0FFE */
4398 { VEX_W_TABLE (VEX_W_0FFE_P_2) },
4401 /* PREFIX_VEX_0F3800 */
4405 { VEX_W_TABLE (VEX_W_0F3800_P_2) },
4408 /* PREFIX_VEX_0F3801 */
4412 { VEX_W_TABLE (VEX_W_0F3801_P_2) },
4415 /* PREFIX_VEX_0F3802 */
4419 { VEX_W_TABLE (VEX_W_0F3802_P_2) },
4422 /* PREFIX_VEX_0F3803 */
4426 { VEX_W_TABLE (VEX_W_0F3803_P_2) },
4429 /* PREFIX_VEX_0F3804 */
4433 { VEX_W_TABLE (VEX_W_0F3804_P_2) },
4436 /* PREFIX_VEX_0F3805 */
4440 { VEX_W_TABLE (VEX_W_0F3805_P_2) },
4443 /* PREFIX_VEX_0F3806 */
4447 { VEX_W_TABLE (VEX_W_0F3806_P_2) },
4450 /* PREFIX_VEX_0F3807 */
4454 { VEX_W_TABLE (VEX_W_0F3807_P_2) },
4457 /* PREFIX_VEX_0F3808 */
4461 { VEX_W_TABLE (VEX_W_0F3808_P_2) },
4464 /* PREFIX_VEX_0F3809 */
4468 { VEX_W_TABLE (VEX_W_0F3809_P_2) },
4471 /* PREFIX_VEX_0F380A */
4475 { VEX_W_TABLE (VEX_W_0F380A_P_2) },
4478 /* PREFIX_VEX_0F380B */
4482 { VEX_W_TABLE (VEX_W_0F380B_P_2) },
4485 /* PREFIX_VEX_0F380C */
4489 { VEX_W_TABLE (VEX_W_0F380C_P_2) },
4492 /* PREFIX_VEX_0F380D */
4496 { VEX_W_TABLE (VEX_W_0F380D_P_2) },
4499 /* PREFIX_VEX_0F380E */
4503 { VEX_W_TABLE (VEX_W_0F380E_P_2) },
4506 /* PREFIX_VEX_0F380F */
4510 { VEX_W_TABLE (VEX_W_0F380F_P_2) },
4513 /* PREFIX_VEX_0F3813 */
4517 { "vcvtph2ps", { XM, EXxmmq } },
4520 /* PREFIX_VEX_0F3816 */
4524 { VEX_LEN_TABLE (VEX_LEN_0F3816_P_2) },
4527 /* PREFIX_VEX_0F3817 */
4531 { VEX_W_TABLE (VEX_W_0F3817_P_2) },
4534 /* PREFIX_VEX_0F3818 */
4538 { VEX_W_TABLE (VEX_W_0F3818_P_2) },
4541 /* PREFIX_VEX_0F3819 */
4545 { VEX_LEN_TABLE (VEX_LEN_0F3819_P_2) },
4548 /* PREFIX_VEX_0F381A */
4552 { MOD_TABLE (MOD_VEX_0F381A_PREFIX_2) },
4555 /* PREFIX_VEX_0F381C */
4559 { VEX_W_TABLE (VEX_W_0F381C_P_2) },
4562 /* PREFIX_VEX_0F381D */
4566 { VEX_W_TABLE (VEX_W_0F381D_P_2) },
4569 /* PREFIX_VEX_0F381E */
4573 { VEX_W_TABLE (VEX_W_0F381E_P_2) },
4576 /* PREFIX_VEX_0F3820 */
4580 { VEX_W_TABLE (VEX_W_0F3820_P_2) },
4583 /* PREFIX_VEX_0F3821 */
4587 { VEX_W_TABLE (VEX_W_0F3821_P_2) },
4590 /* PREFIX_VEX_0F3822 */
4594 { VEX_W_TABLE (VEX_W_0F3822_P_2) },
4597 /* PREFIX_VEX_0F3823 */
4601 { VEX_W_TABLE (VEX_W_0F3823_P_2) },
4604 /* PREFIX_VEX_0F3824 */
4608 { VEX_W_TABLE (VEX_W_0F3824_P_2) },
4611 /* PREFIX_VEX_0F3825 */
4615 { VEX_W_TABLE (VEX_W_0F3825_P_2) },
4618 /* PREFIX_VEX_0F3828 */
4622 { VEX_W_TABLE (VEX_W_0F3828_P_2) },
4625 /* PREFIX_VEX_0F3829 */
4629 { VEX_W_TABLE (VEX_W_0F3829_P_2) },
4632 /* PREFIX_VEX_0F382A */
4636 { MOD_TABLE (MOD_VEX_0F382A_PREFIX_2) },
4639 /* PREFIX_VEX_0F382B */
4643 { VEX_W_TABLE (VEX_W_0F382B_P_2) },
4646 /* PREFIX_VEX_0F382C */
4650 { MOD_TABLE (MOD_VEX_0F382C_PREFIX_2) },
4653 /* PREFIX_VEX_0F382D */
4657 { MOD_TABLE (MOD_VEX_0F382D_PREFIX_2) },
4660 /* PREFIX_VEX_0F382E */
4664 { MOD_TABLE (MOD_VEX_0F382E_PREFIX_2) },
4667 /* PREFIX_VEX_0F382F */
4671 { MOD_TABLE (MOD_VEX_0F382F_PREFIX_2) },
4674 /* PREFIX_VEX_0F3830 */
4678 { VEX_W_TABLE (VEX_W_0F3830_P_2) },
4681 /* PREFIX_VEX_0F3831 */
4685 { VEX_W_TABLE (VEX_W_0F3831_P_2) },
4688 /* PREFIX_VEX_0F3832 */
4692 { VEX_W_TABLE (VEX_W_0F3832_P_2) },
4695 /* PREFIX_VEX_0F3833 */
4699 { VEX_W_TABLE (VEX_W_0F3833_P_2) },
4702 /* PREFIX_VEX_0F3834 */
4706 { VEX_W_TABLE (VEX_W_0F3834_P_2) },
4709 /* PREFIX_VEX_0F3835 */
4713 { VEX_W_TABLE (VEX_W_0F3835_P_2) },
4716 /* PREFIX_VEX_0F3836 */
4720 { VEX_LEN_TABLE (VEX_LEN_0F3836_P_2) },
4723 /* PREFIX_VEX_0F3837 */
4727 { VEX_W_TABLE (VEX_W_0F3837_P_2) },
4730 /* PREFIX_VEX_0F3838 */
4734 { VEX_W_TABLE (VEX_W_0F3838_P_2) },
4737 /* PREFIX_VEX_0F3839 */
4741 { VEX_W_TABLE (VEX_W_0F3839_P_2) },
4744 /* PREFIX_VEX_0F383A */
4748 { VEX_W_TABLE (VEX_W_0F383A_P_2) },
4751 /* PREFIX_VEX_0F383B */
4755 { VEX_W_TABLE (VEX_W_0F383B_P_2) },
4758 /* PREFIX_VEX_0F383C */
4762 { VEX_W_TABLE (VEX_W_0F383C_P_2) },
4765 /* PREFIX_VEX_0F383D */
4769 { VEX_W_TABLE (VEX_W_0F383D_P_2) },
4772 /* PREFIX_VEX_0F383E */
4776 { VEX_W_TABLE (VEX_W_0F383E_P_2) },
4779 /* PREFIX_VEX_0F383F */
4783 { VEX_W_TABLE (VEX_W_0F383F_P_2) },
4786 /* PREFIX_VEX_0F3840 */
4790 { VEX_W_TABLE (VEX_W_0F3840_P_2) },
4793 /* PREFIX_VEX_0F3841 */
4797 { VEX_LEN_TABLE (VEX_LEN_0F3841_P_2) },
4800 /* PREFIX_VEX_0F3845 */
4804 { "vpsrlv%LW", { XM, Vex, EXx } },
4807 /* PREFIX_VEX_0F3846 */
4811 { VEX_W_TABLE (VEX_W_0F3846_P_2) },
4814 /* PREFIX_VEX_0F3847 */
4818 { "vpsllv%LW", { XM, Vex, EXx } },
4821 /* PREFIX_VEX_0F3858 */
4825 { VEX_W_TABLE (VEX_W_0F3858_P_2) },
4828 /* PREFIX_VEX_0F3859 */
4832 { VEX_W_TABLE (VEX_W_0F3859_P_2) },
4835 /* PREFIX_VEX_0F385A */
4839 { MOD_TABLE (MOD_VEX_0F385A_PREFIX_2) },
4842 /* PREFIX_VEX_0F3878 */
4846 { VEX_W_TABLE (VEX_W_0F3878_P_2) },
4849 /* PREFIX_VEX_0F3879 */
4853 { VEX_W_TABLE (VEX_W_0F3879_P_2) },
4856 /* PREFIX_VEX_0F388C */
4860 { MOD_TABLE (MOD_VEX_0F388C_PREFIX_2) },
4863 /* PREFIX_VEX_0F388E */
4867 { MOD_TABLE (MOD_VEX_0F388E_PREFIX_2) },
4870 /* PREFIX_VEX_0F3890 */
4874 { "vpgatherd%LW", { XM, MVexVSIBDWpX, Vex } },
4877 /* PREFIX_VEX_0F3891 */
4881 { "vpgatherq%LW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ } },
4884 /* PREFIX_VEX_0F3892 */
4888 { "vgatherdp%XW", { XM, MVexVSIBDWpX, Vex } },
4891 /* PREFIX_VEX_0F3893 */
4895 { "vgatherqp%XW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ } },
4898 /* PREFIX_VEX_0F3896 */
4902 { "vfmaddsub132p%XW", { XM, Vex, EXx } },
4905 /* PREFIX_VEX_0F3897 */
4909 { "vfmsubadd132p%XW", { XM, Vex, EXx } },
4912 /* PREFIX_VEX_0F3898 */
4916 { "vfmadd132p%XW", { XM, Vex, EXx } },
4919 /* PREFIX_VEX_0F3899 */
4923 { "vfmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4926 /* PREFIX_VEX_0F389A */
4930 { "vfmsub132p%XW", { XM, Vex, EXx } },
4933 /* PREFIX_VEX_0F389B */
4937 { "vfmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4940 /* PREFIX_VEX_0F389C */
4944 { "vfnmadd132p%XW", { XM, Vex, EXx } },
4947 /* PREFIX_VEX_0F389D */
4951 { "vfnmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4954 /* PREFIX_VEX_0F389E */
4958 { "vfnmsub132p%XW", { XM, Vex, EXx } },
4961 /* PREFIX_VEX_0F389F */
4965 { "vfnmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4968 /* PREFIX_VEX_0F38A6 */
4972 { "vfmaddsub213p%XW", { XM, Vex, EXx } },
4976 /* PREFIX_VEX_0F38A7 */
4980 { "vfmsubadd213p%XW", { XM, Vex, EXx } },
4983 /* PREFIX_VEX_0F38A8 */
4987 { "vfmadd213p%XW", { XM, Vex, EXx } },
4990 /* PREFIX_VEX_0F38A9 */
4994 { "vfmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4997 /* PREFIX_VEX_0F38AA */
5001 { "vfmsub213p%XW", { XM, Vex, EXx } },
5004 /* PREFIX_VEX_0F38AB */
5008 { "vfmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
5011 /* PREFIX_VEX_0F38AC */
5015 { "vfnmadd213p%XW", { XM, Vex, EXx } },
5018 /* PREFIX_VEX_0F38AD */
5022 { "vfnmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
5025 /* PREFIX_VEX_0F38AE */
5029 { "vfnmsub213p%XW", { XM, Vex, EXx } },
5032 /* PREFIX_VEX_0F38AF */
5036 { "vfnmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
5039 /* PREFIX_VEX_0F38B6 */
5043 { "vfmaddsub231p%XW", { XM, Vex, EXx } },
5046 /* PREFIX_VEX_0F38B7 */
5050 { "vfmsubadd231p%XW", { XM, Vex, EXx } },
5053 /* PREFIX_VEX_0F38B8 */
5057 { "vfmadd231p%XW", { XM, Vex, EXx } },
5060 /* PREFIX_VEX_0F38B9 */
5064 { "vfmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
5067 /* PREFIX_VEX_0F38BA */
5071 { "vfmsub231p%XW", { XM, Vex, EXx } },
5074 /* PREFIX_VEX_0F38BB */
5078 { "vfmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
5081 /* PREFIX_VEX_0F38BC */
5085 { "vfnmadd231p%XW", { XM, Vex, EXx } },
5088 /* PREFIX_VEX_0F38BD */
5092 { "vfnmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
5095 /* PREFIX_VEX_0F38BE */
5099 { "vfnmsub231p%XW", { XM, Vex, EXx } },
5102 /* PREFIX_VEX_0F38BF */
5106 { "vfnmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
5109 /* PREFIX_VEX_0F38DB */
5113 { VEX_LEN_TABLE (VEX_LEN_0F38DB_P_2) },
5116 /* PREFIX_VEX_0F38DC */
5120 { VEX_LEN_TABLE (VEX_LEN_0F38DC_P_2) },
5123 /* PREFIX_VEX_0F38DD */
5127 { VEX_LEN_TABLE (VEX_LEN_0F38DD_P_2) },
5130 /* PREFIX_VEX_0F38DE */
5134 { VEX_LEN_TABLE (VEX_LEN_0F38DE_P_2) },
5137 /* PREFIX_VEX_0F38DF */
5141 { VEX_LEN_TABLE (VEX_LEN_0F38DF_P_2) },
5144 /* PREFIX_VEX_0F38F2 */
5146 { VEX_LEN_TABLE (VEX_LEN_0F38F2_P_0) },
5149 /* PREFIX_VEX_0F38F3_REG_1 */
5151 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_1_P_0) },
5154 /* PREFIX_VEX_0F38F3_REG_2 */
5156 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_2_P_0) },
5159 /* PREFIX_VEX_0F38F3_REG_3 */
5161 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_3_P_0) },
5164 /* PREFIX_VEX_0F38F5 */
5166 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_0) },
5167 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_1) },
5169 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_3) },
5172 /* PREFIX_VEX_0F38F6 */
5177 { VEX_LEN_TABLE (VEX_LEN_0F38F6_P_3) },
5180 /* PREFIX_VEX_0F38F7 */
5182 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_0) },
5183 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_1) },
5184 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_2) },
5185 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_3) },
5188 /* PREFIX_VEX_0F3A00 */
5192 { VEX_LEN_TABLE (VEX_LEN_0F3A00_P_2) },
5195 /* PREFIX_VEX_0F3A01 */
5199 { VEX_LEN_TABLE (VEX_LEN_0F3A01_P_2) },
5202 /* PREFIX_VEX_0F3A02 */
5206 { VEX_W_TABLE (VEX_W_0F3A02_P_2) },
5209 /* PREFIX_VEX_0F3A04 */
5213 { VEX_W_TABLE (VEX_W_0F3A04_P_2) },
5216 /* PREFIX_VEX_0F3A05 */
5220 { VEX_W_TABLE (VEX_W_0F3A05_P_2) },
5223 /* PREFIX_VEX_0F3A06 */
5227 { VEX_LEN_TABLE (VEX_LEN_0F3A06_P_2) },
5230 /* PREFIX_VEX_0F3A08 */
5234 { VEX_W_TABLE (VEX_W_0F3A08_P_2) },
5237 /* PREFIX_VEX_0F3A09 */
5241 { VEX_W_TABLE (VEX_W_0F3A09_P_2) },
5244 /* PREFIX_VEX_0F3A0A */
5248 { VEX_LEN_TABLE (VEX_LEN_0F3A0A_P_2) },
5251 /* PREFIX_VEX_0F3A0B */
5255 { VEX_LEN_TABLE (VEX_LEN_0F3A0B_P_2) },
5258 /* PREFIX_VEX_0F3A0C */
5262 { VEX_W_TABLE (VEX_W_0F3A0C_P_2) },
5265 /* PREFIX_VEX_0F3A0D */
5269 { VEX_W_TABLE (VEX_W_0F3A0D_P_2) },
5272 /* PREFIX_VEX_0F3A0E */
5276 { VEX_W_TABLE (VEX_W_0F3A0E_P_2) },
5279 /* PREFIX_VEX_0F3A0F */
5283 { VEX_W_TABLE (VEX_W_0F3A0F_P_2) },
5286 /* PREFIX_VEX_0F3A14 */
5290 { VEX_LEN_TABLE (VEX_LEN_0F3A14_P_2) },
5293 /* PREFIX_VEX_0F3A15 */
5297 { VEX_LEN_TABLE (VEX_LEN_0F3A15_P_2) },
5300 /* PREFIX_VEX_0F3A16 */
5304 { VEX_LEN_TABLE (VEX_LEN_0F3A16_P_2) },
5307 /* PREFIX_VEX_0F3A17 */
5311 { VEX_LEN_TABLE (VEX_LEN_0F3A17_P_2) },
5314 /* PREFIX_VEX_0F3A18 */
5318 { VEX_LEN_TABLE (VEX_LEN_0F3A18_P_2) },
5321 /* PREFIX_VEX_0F3A19 */
5325 { VEX_LEN_TABLE (VEX_LEN_0F3A19_P_2) },
5328 /* PREFIX_VEX_0F3A1D */
5332 { "vcvtps2ph", { EXxmmq, XM, Ib } },
5335 /* PREFIX_VEX_0F3A20 */
5339 { VEX_LEN_TABLE (VEX_LEN_0F3A20_P_2) },
5342 /* PREFIX_VEX_0F3A21 */
5346 { VEX_LEN_TABLE (VEX_LEN_0F3A21_P_2) },
5349 /* PREFIX_VEX_0F3A22 */
5353 { VEX_LEN_TABLE (VEX_LEN_0F3A22_P_2) },
5356 /* PREFIX_VEX_0F3A38 */
5360 { VEX_LEN_TABLE (VEX_LEN_0F3A38_P_2) },
5363 /* PREFIX_VEX_0F3A39 */
5367 { VEX_LEN_TABLE (VEX_LEN_0F3A39_P_2) },
5370 /* PREFIX_VEX_0F3A40 */
5374 { VEX_W_TABLE (VEX_W_0F3A40_P_2) },
5377 /* PREFIX_VEX_0F3A41 */
5381 { VEX_LEN_TABLE (VEX_LEN_0F3A41_P_2) },
5384 /* PREFIX_VEX_0F3A42 */
5388 { VEX_W_TABLE (VEX_W_0F3A42_P_2) },
5391 /* PREFIX_VEX_0F3A44 */
5395 { VEX_LEN_TABLE (VEX_LEN_0F3A44_P_2) },
5398 /* PREFIX_VEX_0F3A46 */
5402 { VEX_LEN_TABLE (VEX_LEN_0F3A46_P_2) },
5405 /* PREFIX_VEX_0F3A48 */
5409 { VEX_W_TABLE (VEX_W_0F3A48_P_2) },
5412 /* PREFIX_VEX_0F3A49 */
5416 { VEX_W_TABLE (VEX_W_0F3A49_P_2) },
5419 /* PREFIX_VEX_0F3A4A */
5423 { VEX_W_TABLE (VEX_W_0F3A4A_P_2) },
5426 /* PREFIX_VEX_0F3A4B */
5430 { VEX_W_TABLE (VEX_W_0F3A4B_P_2) },
5433 /* PREFIX_VEX_0F3A4C */
5437 { VEX_W_TABLE (VEX_W_0F3A4C_P_2) },
5440 /* PREFIX_VEX_0F3A5C */
5444 { "vfmaddsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5447 /* PREFIX_VEX_0F3A5D */
5451 { "vfmaddsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5454 /* PREFIX_VEX_0F3A5E */
5458 { "vfmsubaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5461 /* PREFIX_VEX_0F3A5F */
5465 { "vfmsubaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5468 /* PREFIX_VEX_0F3A60 */
5472 { VEX_LEN_TABLE (VEX_LEN_0F3A60_P_2) },
5476 /* PREFIX_VEX_0F3A61 */
5480 { VEX_LEN_TABLE (VEX_LEN_0F3A61_P_2) },
5483 /* PREFIX_VEX_0F3A62 */
5487 { VEX_LEN_TABLE (VEX_LEN_0F3A62_P_2) },
5490 /* PREFIX_VEX_0F3A63 */
5494 { VEX_LEN_TABLE (VEX_LEN_0F3A63_P_2) },
5497 /* PREFIX_VEX_0F3A68 */
5501 { "vfmaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5504 /* PREFIX_VEX_0F3A69 */
5508 { "vfmaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5511 /* PREFIX_VEX_0F3A6A */
5515 { VEX_LEN_TABLE (VEX_LEN_0F3A6A_P_2) },
5518 /* PREFIX_VEX_0F3A6B */
5522 { VEX_LEN_TABLE (VEX_LEN_0F3A6B_P_2) },
5525 /* PREFIX_VEX_0F3A6C */
5529 { "vfmsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5532 /* PREFIX_VEX_0F3A6D */
5536 { "vfmsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5539 /* PREFIX_VEX_0F3A6E */
5543 { VEX_LEN_TABLE (VEX_LEN_0F3A6E_P_2) },
5546 /* PREFIX_VEX_0F3A6F */
5550 { VEX_LEN_TABLE (VEX_LEN_0F3A6F_P_2) },
5553 /* PREFIX_VEX_0F3A78 */
5557 { "vfnmaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5560 /* PREFIX_VEX_0F3A79 */
5564 { "vfnmaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5567 /* PREFIX_VEX_0F3A7A */
5571 { VEX_LEN_TABLE (VEX_LEN_0F3A7A_P_2) },
5574 /* PREFIX_VEX_0F3A7B */
5578 { VEX_LEN_TABLE (VEX_LEN_0F3A7B_P_2) },
5581 /* PREFIX_VEX_0F3A7C */
5585 { "vfnmsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5589 /* PREFIX_VEX_0F3A7D */
5593 { "vfnmsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5596 /* PREFIX_VEX_0F3A7E */
5600 { VEX_LEN_TABLE (VEX_LEN_0F3A7E_P_2) },
5603 /* PREFIX_VEX_0F3A7F */
5607 { VEX_LEN_TABLE (VEX_LEN_0F3A7F_P_2) },
5610 /* PREFIX_VEX_0F3ADF */
5614 { VEX_LEN_TABLE (VEX_LEN_0F3ADF_P_2) },
5617 /* PREFIX_VEX_0F3AF0 */
5622 { VEX_LEN_TABLE (VEX_LEN_0F3AF0_P_3) },
5626 static const struct dis386 x86_64_table[][2] = {
5629 { "pushP", { es } },
5639 { "pushP", { cs } },
5644 { "pushP", { ss } },
5654 { "pushP", { ds } },
5684 { "pushaP", { XX } },
5689 { "popaP", { XX } },
5694 { MOD_TABLE (MOD_62_32BIT) },
5699 { "arpl", { Ew, Gw } },
5700 { "movs{lq|xd}", { Gv, Ed } },
5705 { "ins{R|}", { Yzr, indirDX } },
5706 { "ins{G|}", { Yzr, indirDX } },
5711 { "outs{R|}", { indirDXr, Xz } },
5712 { "outs{G|}", { indirDXr, Xz } },
5717 { "Jcall{T|}", { Ap } },
5722 { MOD_TABLE (MOD_C4_32BIT) },
5723 { VEX_C4_TABLE (VEX_0F) },
5728 { MOD_TABLE (MOD_C5_32BIT) },
5729 { VEX_C5_TABLE (VEX_0F) },
5749 { "Jjmp{T|}", { Ap } },
5752 /* X86_64_0F01_REG_0 */
5754 { "sgdt{Q|IQ}", { M } },
5758 /* X86_64_0F01_REG_1 */
5760 { "sidt{Q|IQ}", { M } },
5764 /* X86_64_0F01_REG_2 */
5766 { "lgdt{Q|Q}", { M } },
5770 /* X86_64_0F01_REG_3 */
5772 { "lidt{Q|Q}", { M } },
5777 static const struct dis386 three_byte_table[][256] = {
5779 /* THREE_BYTE_0F38 */
5782 { "pshufb", { MX, EM } },
5783 { "phaddw", { MX, EM } },
5784 { "phaddd", { MX, EM } },
5785 { "phaddsw", { MX, EM } },
5786 { "pmaddubsw", { MX, EM } },
5787 { "phsubw", { MX, EM } },
5788 { "phsubd", { MX, EM } },
5789 { "phsubsw", { MX, EM } },
5791 { "psignb", { MX, EM } },
5792 { "psignw", { MX, EM } },
5793 { "psignd", { MX, EM } },
5794 { "pmulhrsw", { MX, EM } },
5800 { PREFIX_TABLE (PREFIX_0F3810) },
5804 { PREFIX_TABLE (PREFIX_0F3814) },
5805 { PREFIX_TABLE (PREFIX_0F3815) },
5807 { PREFIX_TABLE (PREFIX_0F3817) },
5813 { "pabsb", { MX, EM } },
5814 { "pabsw", { MX, EM } },
5815 { "pabsd", { MX, EM } },
5818 { PREFIX_TABLE (PREFIX_0F3820) },
5819 { PREFIX_TABLE (PREFIX_0F3821) },
5820 { PREFIX_TABLE (PREFIX_0F3822) },
5821 { PREFIX_TABLE (PREFIX_0F3823) },
5822 { PREFIX_TABLE (PREFIX_0F3824) },
5823 { PREFIX_TABLE (PREFIX_0F3825) },
5827 { PREFIX_TABLE (PREFIX_0F3828) },
5828 { PREFIX_TABLE (PREFIX_0F3829) },
5829 { PREFIX_TABLE (PREFIX_0F382A) },
5830 { PREFIX_TABLE (PREFIX_0F382B) },
5836 { PREFIX_TABLE (PREFIX_0F3830) },
5837 { PREFIX_TABLE (PREFIX_0F3831) },
5838 { PREFIX_TABLE (PREFIX_0F3832) },
5839 { PREFIX_TABLE (PREFIX_0F3833) },
5840 { PREFIX_TABLE (PREFIX_0F3834) },
5841 { PREFIX_TABLE (PREFIX_0F3835) },
5843 { PREFIX_TABLE (PREFIX_0F3837) },
5845 { PREFIX_TABLE (PREFIX_0F3838) },
5846 { PREFIX_TABLE (PREFIX_0F3839) },
5847 { PREFIX_TABLE (PREFIX_0F383A) },
5848 { PREFIX_TABLE (PREFIX_0F383B) },
5849 { PREFIX_TABLE (PREFIX_0F383C) },
5850 { PREFIX_TABLE (PREFIX_0F383D) },
5851 { PREFIX_TABLE (PREFIX_0F383E) },
5852 { PREFIX_TABLE (PREFIX_0F383F) },
5854 { PREFIX_TABLE (PREFIX_0F3840) },
5855 { PREFIX_TABLE (PREFIX_0F3841) },
5926 { PREFIX_TABLE (PREFIX_0F3880) },
5927 { PREFIX_TABLE (PREFIX_0F3881) },
5928 { PREFIX_TABLE (PREFIX_0F3882) },
6028 { PREFIX_TABLE (PREFIX_0F38DB) },
6029 { PREFIX_TABLE (PREFIX_0F38DC) },
6030 { PREFIX_TABLE (PREFIX_0F38DD) },
6031 { PREFIX_TABLE (PREFIX_0F38DE) },
6032 { PREFIX_TABLE (PREFIX_0F38DF) },
6052 { PREFIX_TABLE (PREFIX_0F38F0) },
6053 { PREFIX_TABLE (PREFIX_0F38F1) },
6070 /* THREE_BYTE_0F3A */
6082 { PREFIX_TABLE (PREFIX_0F3A08) },
6083 { PREFIX_TABLE (PREFIX_0F3A09) },
6084 { PREFIX_TABLE (PREFIX_0F3A0A) },
6085 { PREFIX_TABLE (PREFIX_0F3A0B) },
6086 { PREFIX_TABLE (PREFIX_0F3A0C) },
6087 { PREFIX_TABLE (PREFIX_0F3A0D) },
6088 { PREFIX_TABLE (PREFIX_0F3A0E) },
6089 { "palignr", { MX, EM, Ib } },
6095 { PREFIX_TABLE (PREFIX_0F3A14) },
6096 { PREFIX_TABLE (PREFIX_0F3A15) },
6097 { PREFIX_TABLE (PREFIX_0F3A16) },
6098 { PREFIX_TABLE (PREFIX_0F3A17) },
6109 { PREFIX_TABLE (PREFIX_0F3A20) },
6110 { PREFIX_TABLE (PREFIX_0F3A21) },
6111 { PREFIX_TABLE (PREFIX_0F3A22) },
6145 { PREFIX_TABLE (PREFIX_0F3A40) },
6146 { PREFIX_TABLE (PREFIX_0F3A41) },
6147 { PREFIX_TABLE (PREFIX_0F3A42) },
6149 { PREFIX_TABLE (PREFIX_0F3A44) },
6181 { PREFIX_TABLE (PREFIX_0F3A60) },
6182 { PREFIX_TABLE (PREFIX_0F3A61) },
6183 { PREFIX_TABLE (PREFIX_0F3A62) },
6184 { PREFIX_TABLE (PREFIX_0F3A63) },
6323 { PREFIX_TABLE (PREFIX_0F3ADF) },
6362 /* THREE_BYTE_0F7A */
6401 { "ptest", { XX } },
6438 { "phaddbw", { XM, EXq } },
6439 { "phaddbd", { XM, EXq } },
6440 { "phaddbq", { XM, EXq } },
6443 { "phaddwd", { XM, EXq } },
6444 { "phaddwq", { XM, EXq } },
6449 { "phadddq", { XM, EXq } },
6456 { "phaddubw", { XM, EXq } },
6457 { "phaddubd", { XM, EXq } },
6458 { "phaddubq", { XM, EXq } },
6461 { "phadduwd", { XM, EXq } },
6462 { "phadduwq", { XM, EXq } },
6467 { "phaddudq", { XM, EXq } },
6474 { "phsubbw", { XM, EXq } },
6475 { "phsubbd", { XM, EXq } },
6476 { "phsubbq", { XM, EXq } },
6655 static const struct dis386 xop_table[][256] = {
6808 { "vpmacssww", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6809 { "vpmacsswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6810 { "vpmacssdql", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6818 { "vpmacssdd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6819 { "vpmacssdqh", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6826 { "vpmacsww", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6827 { "vpmacswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6828 { "vpmacsdql", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6836 { "vpmacsdd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6837 { "vpmacsdqh", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6841 { "vpcmov", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6842 { "vpperm", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6845 { "vpmadcsswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6863 { "vpmadcswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6875 { "vprotb", { XM, Vex_2src_1, Ib } },
6876 { "vprotw", { XM, Vex_2src_1, Ib } },
6877 { "vprotd", { XM, Vex_2src_1, Ib } },
6878 { "vprotq", { XM, Vex_2src_1, Ib } },
6888 { "vpcomb", { XM, Vex128, EXx, Ib } },
6889 { "vpcomw", { XM, Vex128, EXx, Ib } },
6890 { "vpcomd", { XM, Vex128, EXx, Ib } },
6891 { "vpcomq", { XM, Vex128, EXx, Ib } },
6924 { "vpcomub", { XM, Vex128, EXx, Ib } },
6925 { "vpcomuw", { XM, Vex128, EXx, Ib } },
6926 { "vpcomud", { XM, Vex128, EXx, Ib } },
6927 { "vpcomuq", { XM, Vex128, EXx, Ib } },
6951 { REG_TABLE (REG_XOP_TBM_01) },
6952 { REG_TABLE (REG_XOP_TBM_02) },
6970 { REG_TABLE (REG_XOP_LWPCB) },
7094 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_80) },
7095 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_81) },
7096 { "vfrczss", { XM, EXd } },
7097 { "vfrczsd", { XM, EXq } },
7112 { "vprotb", { XM, Vex_2src_1, Vex_2src_2 } },
7113 { "vprotw", { XM, Vex_2src_1, Vex_2src_2 } },
7114 { "vprotd", { XM, Vex_2src_1, Vex_2src_2 } },
7115 { "vprotq", { XM, Vex_2src_1, Vex_2src_2 } },
7116 { "vpshlb", { XM, Vex_2src_1, Vex_2src_2 } },
7117 { "vpshlw", { XM, Vex_2src_1, Vex_2src_2 } },
7118 { "vpshld", { XM, Vex_2src_1, Vex_2src_2 } },
7119 { "vpshlq", { XM, Vex_2src_1, Vex_2src_2 } },
7121 { "vpshab", { XM, Vex_2src_1, Vex_2src_2 } },
7122 { "vpshaw", { XM, Vex_2src_1, Vex_2src_2 } },
7123 { "vpshad", { XM, Vex_2src_1, Vex_2src_2 } },
7124 { "vpshaq", { XM, Vex_2src_1, Vex_2src_2 } },
7167 { "vphaddbw", { XM, EXxmm } },
7168 { "vphaddbd", { XM, EXxmm } },
7169 { "vphaddbq", { XM, EXxmm } },
7172 { "vphaddwd", { XM, EXxmm } },
7173 { "vphaddwq", { XM, EXxmm } },
7178 { "vphadddq", { XM, EXxmm } },
7185 { "vphaddubw", { XM, EXxmm } },
7186 { "vphaddubd", { XM, EXxmm } },
7187 { "vphaddubq", { XM, EXxmm } },
7190 { "vphadduwd", { XM, EXxmm } },
7191 { "vphadduwq", { XM, EXxmm } },
7196 { "vphaddudq", { XM, EXxmm } },
7203 { "vphsubbw", { XM, EXxmm } },
7204 { "vphsubwd", { XM, EXxmm } },
7205 { "vphsubdq", { XM, EXxmm } },
7259 { "bextr", { Gv, Ev, Iq } },
7261 { REG_TABLE (REG_XOP_LWP) },
7531 static const struct dis386 vex_table[][256] = {
7553 { PREFIX_TABLE (PREFIX_VEX_0F10) },
7554 { PREFIX_TABLE (PREFIX_VEX_0F11) },
7555 { PREFIX_TABLE (PREFIX_VEX_0F12) },
7556 { MOD_TABLE (MOD_VEX_0F13) },
7557 { VEX_W_TABLE (VEX_W_0F14) },
7558 { VEX_W_TABLE (VEX_W_0F15) },
7559 { PREFIX_TABLE (PREFIX_VEX_0F16) },
7560 { MOD_TABLE (MOD_VEX_0F17) },
7580 { VEX_W_TABLE (VEX_W_0F28) },
7581 { VEX_W_TABLE (VEX_W_0F29) },
7582 { PREFIX_TABLE (PREFIX_VEX_0F2A) },
7583 { MOD_TABLE (MOD_VEX_0F2B) },
7584 { PREFIX_TABLE (PREFIX_VEX_0F2C) },
7585 { PREFIX_TABLE (PREFIX_VEX_0F2D) },
7586 { PREFIX_TABLE (PREFIX_VEX_0F2E) },
7587 { PREFIX_TABLE (PREFIX_VEX_0F2F) },
7625 { MOD_TABLE (MOD_VEX_0F50) },
7626 { PREFIX_TABLE (PREFIX_VEX_0F51) },
7627 { PREFIX_TABLE (PREFIX_VEX_0F52) },
7628 { PREFIX_TABLE (PREFIX_VEX_0F53) },
7629 { "vandpX", { XM, Vex, EXx } },
7630 { "vandnpX", { XM, Vex, EXx } },
7631 { "vorpX", { XM, Vex, EXx } },
7632 { "vxorpX", { XM, Vex, EXx } },
7634 { PREFIX_TABLE (PREFIX_VEX_0F58) },
7635 { PREFIX_TABLE (PREFIX_VEX_0F59) },
7636 { PREFIX_TABLE (PREFIX_VEX_0F5A) },
7637 { PREFIX_TABLE (PREFIX_VEX_0F5B) },
7638 { PREFIX_TABLE (PREFIX_VEX_0F5C) },
7639 { PREFIX_TABLE (PREFIX_VEX_0F5D) },
7640 { PREFIX_TABLE (PREFIX_VEX_0F5E) },
7641 { PREFIX_TABLE (PREFIX_VEX_0F5F) },
7643 { PREFIX_TABLE (PREFIX_VEX_0F60) },
7644 { PREFIX_TABLE (PREFIX_VEX_0F61) },
7645 { PREFIX_TABLE (PREFIX_VEX_0F62) },
7646 { PREFIX_TABLE (PREFIX_VEX_0F63) },
7647 { PREFIX_TABLE (PREFIX_VEX_0F64) },
7648 { PREFIX_TABLE (PREFIX_VEX_0F65) },
7649 { PREFIX_TABLE (PREFIX_VEX_0F66) },
7650 { PREFIX_TABLE (PREFIX_VEX_0F67) },
7652 { PREFIX_TABLE (PREFIX_VEX_0F68) },
7653 { PREFIX_TABLE (PREFIX_VEX_0F69) },
7654 { PREFIX_TABLE (PREFIX_VEX_0F6A) },
7655 { PREFIX_TABLE (PREFIX_VEX_0F6B) },
7656 { PREFIX_TABLE (PREFIX_VEX_0F6C) },
7657 { PREFIX_TABLE (PREFIX_VEX_0F6D) },
7658 { PREFIX_TABLE (PREFIX_VEX_0F6E) },
7659 { PREFIX_TABLE (PREFIX_VEX_0F6F) },
7661 { PREFIX_TABLE (PREFIX_VEX_0F70) },
7662 { REG_TABLE (REG_VEX_0F71) },
7663 { REG_TABLE (REG_VEX_0F72) },
7664 { REG_TABLE (REG_VEX_0F73) },
7665 { PREFIX_TABLE (PREFIX_VEX_0F74) },
7666 { PREFIX_TABLE (PREFIX_VEX_0F75) },
7667 { PREFIX_TABLE (PREFIX_VEX_0F76) },
7668 { PREFIX_TABLE (PREFIX_VEX_0F77) },
7674 { PREFIX_TABLE (PREFIX_VEX_0F7C) },
7675 { PREFIX_TABLE (PREFIX_VEX_0F7D) },
7676 { PREFIX_TABLE (PREFIX_VEX_0F7E) },
7677 { PREFIX_TABLE (PREFIX_VEX_0F7F) },
7730 { REG_TABLE (REG_VEX_0FAE) },
7753 { PREFIX_TABLE (PREFIX_VEX_0FC2) },
7755 { PREFIX_TABLE (PREFIX_VEX_0FC4) },
7756 { PREFIX_TABLE (PREFIX_VEX_0FC5) },
7757 { "vshufpX", { XM, Vex, EXx, Ib } },
7769 { PREFIX_TABLE (PREFIX_VEX_0FD0) },
7770 { PREFIX_TABLE (PREFIX_VEX_0FD1) },
7771 { PREFIX_TABLE (PREFIX_VEX_0FD2) },
7772 { PREFIX_TABLE (PREFIX_VEX_0FD3) },
7773 { PREFIX_TABLE (PREFIX_VEX_0FD4) },
7774 { PREFIX_TABLE (PREFIX_VEX_0FD5) },
7775 { PREFIX_TABLE (PREFIX_VEX_0FD6) },
7776 { PREFIX_TABLE (PREFIX_VEX_0FD7) },
7778 { PREFIX_TABLE (PREFIX_VEX_0FD8) },
7779 { PREFIX_TABLE (PREFIX_VEX_0FD9) },
7780 { PREFIX_TABLE (PREFIX_VEX_0FDA) },
7781 { PREFIX_TABLE (PREFIX_VEX_0FDB) },
7782 { PREFIX_TABLE (PREFIX_VEX_0FDC) },
7783 { PREFIX_TABLE (PREFIX_VEX_0FDD) },
7784 { PREFIX_TABLE (PREFIX_VEX_0FDE) },
7785 { PREFIX_TABLE (PREFIX_VEX_0FDF) },
7787 { PREFIX_TABLE (PREFIX_VEX_0FE0) },
7788 { PREFIX_TABLE (PREFIX_VEX_0FE1) },
7789 { PREFIX_TABLE (PREFIX_VEX_0FE2) },
7790 { PREFIX_TABLE (PREFIX_VEX_0FE3) },
7791 { PREFIX_TABLE (PREFIX_VEX_0FE4) },
7792 { PREFIX_TABLE (PREFIX_VEX_0FE5) },
7793 { PREFIX_TABLE (PREFIX_VEX_0FE6) },
7794 { PREFIX_TABLE (PREFIX_VEX_0FE7) },
7796 { PREFIX_TABLE (PREFIX_VEX_0FE8) },
7797 { PREFIX_TABLE (PREFIX_VEX_0FE9) },
7798 { PREFIX_TABLE (PREFIX_VEX_0FEA) },
7799 { PREFIX_TABLE (PREFIX_VEX_0FEB) },
7800 { PREFIX_TABLE (PREFIX_VEX_0FEC) },
7801 { PREFIX_TABLE (PREFIX_VEX_0FED) },
7802 { PREFIX_TABLE (PREFIX_VEX_0FEE) },
7803 { PREFIX_TABLE (PREFIX_VEX_0FEF) },
7805 { PREFIX_TABLE (PREFIX_VEX_0FF0) },
7806 { PREFIX_TABLE (PREFIX_VEX_0FF1) },
7807 { PREFIX_TABLE (PREFIX_VEX_0FF2) },
7808 { PREFIX_TABLE (PREFIX_VEX_0FF3) },
7809 { PREFIX_TABLE (PREFIX_VEX_0FF4) },
7810 { PREFIX_TABLE (PREFIX_VEX_0FF5) },
7811 { PREFIX_TABLE (PREFIX_VEX_0FF6) },
7812 { PREFIX_TABLE (PREFIX_VEX_0FF7) },
7814 { PREFIX_TABLE (PREFIX_VEX_0FF8) },
7815 { PREFIX_TABLE (PREFIX_VEX_0FF9) },
7816 { PREFIX_TABLE (PREFIX_VEX_0FFA) },
7817 { PREFIX_TABLE (PREFIX_VEX_0FFB) },
7818 { PREFIX_TABLE (PREFIX_VEX_0FFC) },
7819 { PREFIX_TABLE (PREFIX_VEX_0FFD) },
7820 { PREFIX_TABLE (PREFIX_VEX_0FFE) },
7826 { PREFIX_TABLE (PREFIX_VEX_0F3800) },
7827 { PREFIX_TABLE (PREFIX_VEX_0F3801) },
7828 { PREFIX_TABLE (PREFIX_VEX_0F3802) },
7829 { PREFIX_TABLE (PREFIX_VEX_0F3803) },
7830 { PREFIX_TABLE (PREFIX_VEX_0F3804) },
7831 { PREFIX_TABLE (PREFIX_VEX_0F3805) },
7832 { PREFIX_TABLE (PREFIX_VEX_0F3806) },
7833 { PREFIX_TABLE (PREFIX_VEX_0F3807) },
7835 { PREFIX_TABLE (PREFIX_VEX_0F3808) },
7836 { PREFIX_TABLE (PREFIX_VEX_0F3809) },
7837 { PREFIX_TABLE (PREFIX_VEX_0F380A) },
7838 { PREFIX_TABLE (PREFIX_VEX_0F380B) },
7839 { PREFIX_TABLE (PREFIX_VEX_0F380C) },
7840 { PREFIX_TABLE (PREFIX_VEX_0F380D) },
7841 { PREFIX_TABLE (PREFIX_VEX_0F380E) },
7842 { PREFIX_TABLE (PREFIX_VEX_0F380F) },
7847 { PREFIX_TABLE (PREFIX_VEX_0F3813) },
7850 { PREFIX_TABLE (PREFIX_VEX_0F3816) },
7851 { PREFIX_TABLE (PREFIX_VEX_0F3817) },
7853 { PREFIX_TABLE (PREFIX_VEX_0F3818) },
7854 { PREFIX_TABLE (PREFIX_VEX_0F3819) },
7855 { PREFIX_TABLE (PREFIX_VEX_0F381A) },
7857 { PREFIX_TABLE (PREFIX_VEX_0F381C) },
7858 { PREFIX_TABLE (PREFIX_VEX_0F381D) },
7859 { PREFIX_TABLE (PREFIX_VEX_0F381E) },
7862 { PREFIX_TABLE (PREFIX_VEX_0F3820) },
7863 { PREFIX_TABLE (PREFIX_VEX_0F3821) },
7864 { PREFIX_TABLE (PREFIX_VEX_0F3822) },
7865 { PREFIX_TABLE (PREFIX_VEX_0F3823) },
7866 { PREFIX_TABLE (PREFIX_VEX_0F3824) },
7867 { PREFIX_TABLE (PREFIX_VEX_0F3825) },
7871 { PREFIX_TABLE (PREFIX_VEX_0F3828) },
7872 { PREFIX_TABLE (PREFIX_VEX_0F3829) },
7873 { PREFIX_TABLE (PREFIX_VEX_0F382A) },
7874 { PREFIX_TABLE (PREFIX_VEX_0F382B) },
7875 { PREFIX_TABLE (PREFIX_VEX_0F382C) },
7876 { PREFIX_TABLE (PREFIX_VEX_0F382D) },
7877 { PREFIX_TABLE (PREFIX_VEX_0F382E) },
7878 { PREFIX_TABLE (PREFIX_VEX_0F382F) },
7880 { PREFIX_TABLE (PREFIX_VEX_0F3830) },
7881 { PREFIX_TABLE (PREFIX_VEX_0F3831) },
7882 { PREFIX_TABLE (PREFIX_VEX_0F3832) },
7883 { PREFIX_TABLE (PREFIX_VEX_0F3833) },
7884 { PREFIX_TABLE (PREFIX_VEX_0F3834) },
7885 { PREFIX_TABLE (PREFIX_VEX_0F3835) },
7886 { PREFIX_TABLE (PREFIX_VEX_0F3836) },
7887 { PREFIX_TABLE (PREFIX_VEX_0F3837) },
7889 { PREFIX_TABLE (PREFIX_VEX_0F3838) },
7890 { PREFIX_TABLE (PREFIX_VEX_0F3839) },
7891 { PREFIX_TABLE (PREFIX_VEX_0F383A) },
7892 { PREFIX_TABLE (PREFIX_VEX_0F383B) },
7893 { PREFIX_TABLE (PREFIX_VEX_0F383C) },
7894 { PREFIX_TABLE (PREFIX_VEX_0F383D) },
7895 { PREFIX_TABLE (PREFIX_VEX_0F383E) },
7896 { PREFIX_TABLE (PREFIX_VEX_0F383F) },
7898 { PREFIX_TABLE (PREFIX_VEX_0F3840) },
7899 { PREFIX_TABLE (PREFIX_VEX_0F3841) },
7903 { PREFIX_TABLE (PREFIX_VEX_0F3845) },
7904 { PREFIX_TABLE (PREFIX_VEX_0F3846) },
7905 { PREFIX_TABLE (PREFIX_VEX_0F3847) },
7925 { PREFIX_TABLE (PREFIX_VEX_0F3858) },
7926 { PREFIX_TABLE (PREFIX_VEX_0F3859) },
7927 { PREFIX_TABLE (PREFIX_VEX_0F385A) },
7961 { PREFIX_TABLE (PREFIX_VEX_0F3878) },
7962 { PREFIX_TABLE (PREFIX_VEX_0F3879) },
7983 { PREFIX_TABLE (PREFIX_VEX_0F388C) },
7985 { PREFIX_TABLE (PREFIX_VEX_0F388E) },
7988 { PREFIX_TABLE (PREFIX_VEX_0F3890) },
7989 { PREFIX_TABLE (PREFIX_VEX_0F3891) },
7990 { PREFIX_TABLE (PREFIX_VEX_0F3892) },
7991 { PREFIX_TABLE (PREFIX_VEX_0F3893) },
7994 { PREFIX_TABLE (PREFIX_VEX_0F3896) },
7995 { PREFIX_TABLE (PREFIX_VEX_0F3897) },
7997 { PREFIX_TABLE (PREFIX_VEX_0F3898) },
7998 { PREFIX_TABLE (PREFIX_VEX_0F3899) },
7999 { PREFIX_TABLE (PREFIX_VEX_0F389A) },
8000 { PREFIX_TABLE (PREFIX_VEX_0F389B) },
8001 { PREFIX_TABLE (PREFIX_VEX_0F389C) },
8002 { PREFIX_TABLE (PREFIX_VEX_0F389D) },
8003 { PREFIX_TABLE (PREFIX_VEX_0F389E) },
8004 { PREFIX_TABLE (PREFIX_VEX_0F389F) },
8012 { PREFIX_TABLE (PREFIX_VEX_0F38A6) },
8013 { PREFIX_TABLE (PREFIX_VEX_0F38A7) },
8015 { PREFIX_TABLE (PREFIX_VEX_0F38A8) },
8016 { PREFIX_TABLE (PREFIX_VEX_0F38A9) },
8017 { PREFIX_TABLE (PREFIX_VEX_0F38AA) },
8018 { PREFIX_TABLE (PREFIX_VEX_0F38AB) },
8019 { PREFIX_TABLE (PREFIX_VEX_0F38AC) },
8020 { PREFIX_TABLE (PREFIX_VEX_0F38AD) },
8021 { PREFIX_TABLE (PREFIX_VEX_0F38AE) },
8022 { PREFIX_TABLE (PREFIX_VEX_0F38AF) },
8030 { PREFIX_TABLE (PREFIX_VEX_0F38B6) },
8031 { PREFIX_TABLE (PREFIX_VEX_0F38B7) },
8033 { PREFIX_TABLE (PREFIX_VEX_0F38B8) },
8034 { PREFIX_TABLE (PREFIX_VEX_0F38B9) },
8035 { PREFIX_TABLE (PREFIX_VEX_0F38BA) },
8036 { PREFIX_TABLE (PREFIX_VEX_0F38BB) },
8037 { PREFIX_TABLE (PREFIX_VEX_0F38BC) },
8038 { PREFIX_TABLE (PREFIX_VEX_0F38BD) },
8039 { PREFIX_TABLE (PREFIX_VEX_0F38BE) },
8040 { PREFIX_TABLE (PREFIX_VEX_0F38BF) },
8072 { PREFIX_TABLE (PREFIX_VEX_0F38DB) },
8073 { PREFIX_TABLE (PREFIX_VEX_0F38DC) },
8074 { PREFIX_TABLE (PREFIX_VEX_0F38DD) },
8075 { PREFIX_TABLE (PREFIX_VEX_0F38DE) },
8076 { PREFIX_TABLE (PREFIX_VEX_0F38DF) },
8098 { PREFIX_TABLE (PREFIX_VEX_0F38F2) },
8099 { REG_TABLE (REG_VEX_0F38F3) },
8101 { PREFIX_TABLE (PREFIX_VEX_0F38F5) },
8102 { PREFIX_TABLE (PREFIX_VEX_0F38F6) },
8103 { PREFIX_TABLE (PREFIX_VEX_0F38F7) },
8117 { PREFIX_TABLE (PREFIX_VEX_0F3A00) },
8118 { PREFIX_TABLE (PREFIX_VEX_0F3A01) },
8119 { PREFIX_TABLE (PREFIX_VEX_0F3A02) },
8121 { PREFIX_TABLE (PREFIX_VEX_0F3A04) },
8122 { PREFIX_TABLE (PREFIX_VEX_0F3A05) },
8123 { PREFIX_TABLE (PREFIX_VEX_0F3A06) },
8126 { PREFIX_TABLE (PREFIX_VEX_0F3A08) },
8127 { PREFIX_TABLE (PREFIX_VEX_0F3A09) },
8128 { PREFIX_TABLE (PREFIX_VEX_0F3A0A) },
8129 { PREFIX_TABLE (PREFIX_VEX_0F3A0B) },
8130 { PREFIX_TABLE (PREFIX_VEX_0F3A0C) },
8131 { PREFIX_TABLE (PREFIX_VEX_0F3A0D) },
8132 { PREFIX_TABLE (PREFIX_VEX_0F3A0E) },
8133 { PREFIX_TABLE (PREFIX_VEX_0F3A0F) },
8139 { PREFIX_TABLE (PREFIX_VEX_0F3A14) },
8140 { PREFIX_TABLE (PREFIX_VEX_0F3A15) },
8141 { PREFIX_TABLE (PREFIX_VEX_0F3A16) },
8142 { PREFIX_TABLE (PREFIX_VEX_0F3A17) },
8144 { PREFIX_TABLE (PREFIX_VEX_0F3A18) },
8145 { PREFIX_TABLE (PREFIX_VEX_0F3A19) },
8149 { PREFIX_TABLE (PREFIX_VEX_0F3A1D) },
8153 { PREFIX_TABLE (PREFIX_VEX_0F3A20) },
8154 { PREFIX_TABLE (PREFIX_VEX_0F3A21) },
8155 { PREFIX_TABLE (PREFIX_VEX_0F3A22) },
8180 { PREFIX_TABLE (PREFIX_VEX_0F3A38) },
8181 { PREFIX_TABLE (PREFIX_VEX_0F3A39) },
8189 { PREFIX_TABLE (PREFIX_VEX_0F3A40) },
8190 { PREFIX_TABLE (PREFIX_VEX_0F3A41) },
8191 { PREFIX_TABLE (PREFIX_VEX_0F3A42) },
8193 { PREFIX_TABLE (PREFIX_VEX_0F3A44) },
8195 { PREFIX_TABLE (PREFIX_VEX_0F3A46) },
8198 { PREFIX_TABLE (PREFIX_VEX_0F3A48) },
8199 { PREFIX_TABLE (PREFIX_VEX_0F3A49) },
8200 { PREFIX_TABLE (PREFIX_VEX_0F3A4A) },
8201 { PREFIX_TABLE (PREFIX_VEX_0F3A4B) },
8202 { PREFIX_TABLE (PREFIX_VEX_0F3A4C) },
8220 { PREFIX_TABLE (PREFIX_VEX_0F3A5C) },
8221 { PREFIX_TABLE (PREFIX_VEX_0F3A5D) },
8222 { PREFIX_TABLE (PREFIX_VEX_0F3A5E) },
8223 { PREFIX_TABLE (PREFIX_VEX_0F3A5F) },
8225 { PREFIX_TABLE (PREFIX_VEX_0F3A60) },
8226 { PREFIX_TABLE (PREFIX_VEX_0F3A61) },
8227 { PREFIX_TABLE (PREFIX_VEX_0F3A62) },
8228 { PREFIX_TABLE (PREFIX_VEX_0F3A63) },
8234 { PREFIX_TABLE (PREFIX_VEX_0F3A68) },
8235 { PREFIX_TABLE (PREFIX_VEX_0F3A69) },
8236 { PREFIX_TABLE (PREFIX_VEX_0F3A6A) },
8237 { PREFIX_TABLE (PREFIX_VEX_0F3A6B) },
8238 { PREFIX_TABLE (PREFIX_VEX_0F3A6C) },
8239 { PREFIX_TABLE (PREFIX_VEX_0F3A6D) },
8240 { PREFIX_TABLE (PREFIX_VEX_0F3A6E) },
8241 { PREFIX_TABLE (PREFIX_VEX_0F3A6F) },
8252 { PREFIX_TABLE (PREFIX_VEX_0F3A78) },
8253 { PREFIX_TABLE (PREFIX_VEX_0F3A79) },
8254 { PREFIX_TABLE (PREFIX_VEX_0F3A7A) },
8255 { PREFIX_TABLE (PREFIX_VEX_0F3A7B) },
8256 { PREFIX_TABLE (PREFIX_VEX_0F3A7C) },
8257 { PREFIX_TABLE (PREFIX_VEX_0F3A7D) },
8258 { PREFIX_TABLE (PREFIX_VEX_0F3A7E) },
8259 { PREFIX_TABLE (PREFIX_VEX_0F3A7F) },
8367 { PREFIX_TABLE (PREFIX_VEX_0F3ADF) },
8387 { PREFIX_TABLE (PREFIX_VEX_0F3AF0) },
8407 static const struct dis386 vex_len_table[][2] = {
8408 /* VEX_LEN_0F10_P_1 */
8410 { VEX_W_TABLE (VEX_W_0F10_P_1) },
8411 { VEX_W_TABLE (VEX_W_0F10_P_1) },
8414 /* VEX_LEN_0F10_P_3 */
8416 { VEX_W_TABLE (VEX_W_0F10_P_3) },
8417 { VEX_W_TABLE (VEX_W_0F10_P_3) },
8420 /* VEX_LEN_0F11_P_1 */
8422 { VEX_W_TABLE (VEX_W_0F11_P_1) },
8423 { VEX_W_TABLE (VEX_W_0F11_P_1) },
8426 /* VEX_LEN_0F11_P_3 */
8428 { VEX_W_TABLE (VEX_W_0F11_P_3) },
8429 { VEX_W_TABLE (VEX_W_0F11_P_3) },
8432 /* VEX_LEN_0F12_P_0_M_0 */
8434 { VEX_W_TABLE (VEX_W_0F12_P_0_M_0) },
8437 /* VEX_LEN_0F12_P_0_M_1 */
8439 { VEX_W_TABLE (VEX_W_0F12_P_0_M_1) },
8442 /* VEX_LEN_0F12_P_2 */
8444 { VEX_W_TABLE (VEX_W_0F12_P_2) },
8447 /* VEX_LEN_0F13_M_0 */
8449 { VEX_W_TABLE (VEX_W_0F13_M_0) },
8452 /* VEX_LEN_0F16_P_0_M_0 */
8454 { VEX_W_TABLE (VEX_W_0F16_P_0_M_0) },
8457 /* VEX_LEN_0F16_P_0_M_1 */
8459 { VEX_W_TABLE (VEX_W_0F16_P_0_M_1) },
8462 /* VEX_LEN_0F16_P_2 */
8464 { VEX_W_TABLE (VEX_W_0F16_P_2) },
8467 /* VEX_LEN_0F17_M_0 */
8469 { VEX_W_TABLE (VEX_W_0F17_M_0) },
8472 /* VEX_LEN_0F2A_P_1 */
8474 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev } },
8475 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev } },
8478 /* VEX_LEN_0F2A_P_3 */
8480 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev } },
8481 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev } },
8484 /* VEX_LEN_0F2C_P_1 */
8486 { "vcvttss2siY", { Gv, EXdScalar } },
8487 { "vcvttss2siY", { Gv, EXdScalar } },
8490 /* VEX_LEN_0F2C_P_3 */
8492 { "vcvttsd2siY", { Gv, EXqScalar } },
8493 { "vcvttsd2siY", { Gv, EXqScalar } },
8496 /* VEX_LEN_0F2D_P_1 */
8498 { "vcvtss2siY", { Gv, EXdScalar } },
8499 { "vcvtss2siY", { Gv, EXdScalar } },
8502 /* VEX_LEN_0F2D_P_3 */
8504 { "vcvtsd2siY", { Gv, EXqScalar } },
8505 { "vcvtsd2siY", { Gv, EXqScalar } },
8508 /* VEX_LEN_0F2E_P_0 */
8510 { VEX_W_TABLE (VEX_W_0F2E_P_0) },
8511 { VEX_W_TABLE (VEX_W_0F2E_P_0) },
8514 /* VEX_LEN_0F2E_P_2 */
8516 { VEX_W_TABLE (VEX_W_0F2E_P_2) },
8517 { VEX_W_TABLE (VEX_W_0F2E_P_2) },
8520 /* VEX_LEN_0F2F_P_0 */
8522 { VEX_W_TABLE (VEX_W_0F2F_P_0) },
8523 { VEX_W_TABLE (VEX_W_0F2F_P_0) },
8526 /* VEX_LEN_0F2F_P_2 */
8528 { VEX_W_TABLE (VEX_W_0F2F_P_2) },
8529 { VEX_W_TABLE (VEX_W_0F2F_P_2) },
8532 /* VEX_LEN_0F51_P_1 */
8534 { VEX_W_TABLE (VEX_W_0F51_P_1) },
8535 { VEX_W_TABLE (VEX_W_0F51_P_1) },
8538 /* VEX_LEN_0F51_P_3 */
8540 { VEX_W_TABLE (VEX_W_0F51_P_3) },
8541 { VEX_W_TABLE (VEX_W_0F51_P_3) },
8544 /* VEX_LEN_0F52_P_1 */
8546 { VEX_W_TABLE (VEX_W_0F52_P_1) },
8547 { VEX_W_TABLE (VEX_W_0F52_P_1) },
8550 /* VEX_LEN_0F53_P_1 */
8552 { VEX_W_TABLE (VEX_W_0F53_P_1) },
8553 { VEX_W_TABLE (VEX_W_0F53_P_1) },
8556 /* VEX_LEN_0F58_P_1 */
8558 { VEX_W_TABLE (VEX_W_0F58_P_1) },
8559 { VEX_W_TABLE (VEX_W_0F58_P_1) },
8562 /* VEX_LEN_0F58_P_3 */
8564 { VEX_W_TABLE (VEX_W_0F58_P_3) },
8565 { VEX_W_TABLE (VEX_W_0F58_P_3) },
8568 /* VEX_LEN_0F59_P_1 */
8570 { VEX_W_TABLE (VEX_W_0F59_P_1) },
8571 { VEX_W_TABLE (VEX_W_0F59_P_1) },
8574 /* VEX_LEN_0F59_P_3 */
8576 { VEX_W_TABLE (VEX_W_0F59_P_3) },
8577 { VEX_W_TABLE (VEX_W_0F59_P_3) },
8580 /* VEX_LEN_0F5A_P_1 */
8582 { VEX_W_TABLE (VEX_W_0F5A_P_1) },
8583 { VEX_W_TABLE (VEX_W_0F5A_P_1) },
8586 /* VEX_LEN_0F5A_P_3 */
8588 { VEX_W_TABLE (VEX_W_0F5A_P_3) },
8589 { VEX_W_TABLE (VEX_W_0F5A_P_3) },
8592 /* VEX_LEN_0F5C_P_1 */
8594 { VEX_W_TABLE (VEX_W_0F5C_P_1) },
8595 { VEX_W_TABLE (VEX_W_0F5C_P_1) },
8598 /* VEX_LEN_0F5C_P_3 */
8600 { VEX_W_TABLE (VEX_W_0F5C_P_3) },
8601 { VEX_W_TABLE (VEX_W_0F5C_P_3) },
8604 /* VEX_LEN_0F5D_P_1 */
8606 { VEX_W_TABLE (VEX_W_0F5D_P_1) },
8607 { VEX_W_TABLE (VEX_W_0F5D_P_1) },
8610 /* VEX_LEN_0F5D_P_3 */
8612 { VEX_W_TABLE (VEX_W_0F5D_P_3) },
8613 { VEX_W_TABLE (VEX_W_0F5D_P_3) },
8616 /* VEX_LEN_0F5E_P_1 */
8618 { VEX_W_TABLE (VEX_W_0F5E_P_1) },
8619 { VEX_W_TABLE (VEX_W_0F5E_P_1) },
8622 /* VEX_LEN_0F5E_P_3 */
8624 { VEX_W_TABLE (VEX_W_0F5E_P_3) },
8625 { VEX_W_TABLE (VEX_W_0F5E_P_3) },
8628 /* VEX_LEN_0F5F_P_1 */
8630 { VEX_W_TABLE (VEX_W_0F5F_P_1) },
8631 { VEX_W_TABLE (VEX_W_0F5F_P_1) },
8634 /* VEX_LEN_0F5F_P_3 */
8636 { VEX_W_TABLE (VEX_W_0F5F_P_3) },
8637 { VEX_W_TABLE (VEX_W_0F5F_P_3) },
8640 /* VEX_LEN_0F6E_P_2 */
8642 { "vmovK", { XMScalar, Edq } },
8643 { "vmovK", { XMScalar, Edq } },
8646 /* VEX_LEN_0F7E_P_1 */
8648 { VEX_W_TABLE (VEX_W_0F7E_P_1) },
8649 { VEX_W_TABLE (VEX_W_0F7E_P_1) },
8652 /* VEX_LEN_0F7E_P_2 */
8654 { "vmovK", { Edq, XMScalar } },
8655 { "vmovK", { Edq, XMScalar } },
8658 /* VEX_LEN_0FAE_R_2_M_0 */
8660 { VEX_W_TABLE (VEX_W_0FAE_R_2_M_0) },
8663 /* VEX_LEN_0FAE_R_3_M_0 */
8665 { VEX_W_TABLE (VEX_W_0FAE_R_3_M_0) },
8668 /* VEX_LEN_0FC2_P_1 */
8670 { VEX_W_TABLE (VEX_W_0FC2_P_1) },
8671 { VEX_W_TABLE (VEX_W_0FC2_P_1) },
8674 /* VEX_LEN_0FC2_P_3 */
8676 { VEX_W_TABLE (VEX_W_0FC2_P_3) },
8677 { VEX_W_TABLE (VEX_W_0FC2_P_3) },
8680 /* VEX_LEN_0FC4_P_2 */
8682 { VEX_W_TABLE (VEX_W_0FC4_P_2) },
8685 /* VEX_LEN_0FC5_P_2 */
8687 { VEX_W_TABLE (VEX_W_0FC5_P_2) },
8690 /* VEX_LEN_0FD6_P_2 */
8692 { VEX_W_TABLE (VEX_W_0FD6_P_2) },
8693 { VEX_W_TABLE (VEX_W_0FD6_P_2) },
8696 /* VEX_LEN_0FF7_P_2 */
8698 { VEX_W_TABLE (VEX_W_0FF7_P_2) },
8701 /* VEX_LEN_0F3816_P_2 */
8704 { VEX_W_TABLE (VEX_W_0F3816_P_2) },
8707 /* VEX_LEN_0F3819_P_2 */
8710 { VEX_W_TABLE (VEX_W_0F3819_P_2) },
8713 /* VEX_LEN_0F381A_P_2_M_0 */
8716 { VEX_W_TABLE (VEX_W_0F381A_P_2_M_0) },
8719 /* VEX_LEN_0F3836_P_2 */
8722 { VEX_W_TABLE (VEX_W_0F3836_P_2) },
8725 /* VEX_LEN_0F3841_P_2 */
8727 { VEX_W_TABLE (VEX_W_0F3841_P_2) },
8730 /* VEX_LEN_0F385A_P_2_M_0 */
8733 { VEX_W_TABLE (VEX_W_0F385A_P_2_M_0) },
8736 /* VEX_LEN_0F38DB_P_2 */
8738 { VEX_W_TABLE (VEX_W_0F38DB_P_2) },
8741 /* VEX_LEN_0F38DC_P_2 */
8743 { VEX_W_TABLE (VEX_W_0F38DC_P_2) },
8746 /* VEX_LEN_0F38DD_P_2 */
8748 { VEX_W_TABLE (VEX_W_0F38DD_P_2) },
8751 /* VEX_LEN_0F38DE_P_2 */
8753 { VEX_W_TABLE (VEX_W_0F38DE_P_2) },
8756 /* VEX_LEN_0F38DF_P_2 */
8758 { VEX_W_TABLE (VEX_W_0F38DF_P_2) },
8761 /* VEX_LEN_0F38F2_P_0 */
8763 { "andnS", { Gdq, VexGdq, Edq } },
8766 /* VEX_LEN_0F38F3_R_1_P_0 */
8768 { "blsrS", { VexGdq, Edq } },
8771 /* VEX_LEN_0F38F3_R_2_P_0 */
8773 { "blsmskS", { VexGdq, Edq } },
8776 /* VEX_LEN_0F38F3_R_3_P_0 */
8778 { "blsiS", { VexGdq, Edq } },
8781 /* VEX_LEN_0F38F5_P_0 */
8783 { "bzhiS", { Gdq, Edq, VexGdq } },
8786 /* VEX_LEN_0F38F5_P_1 */
8788 { "pextS", { Gdq, VexGdq, Edq } },
8791 /* VEX_LEN_0F38F5_P_3 */
8793 { "pdepS", { Gdq, VexGdq, Edq } },
8796 /* VEX_LEN_0F38F6_P_3 */
8798 { "mulxS", { Gdq, VexGdq, Edq } },
8801 /* VEX_LEN_0F38F7_P_0 */
8803 { "bextrS", { Gdq, Edq, VexGdq } },
8806 /* VEX_LEN_0F38F7_P_1 */
8808 { "sarxS", { Gdq, Edq, VexGdq } },
8811 /* VEX_LEN_0F38F7_P_2 */
8813 { "shlxS", { Gdq, Edq, VexGdq } },
8816 /* VEX_LEN_0F38F7_P_3 */
8818 { "shrxS", { Gdq, Edq, VexGdq } },
8821 /* VEX_LEN_0F3A00_P_2 */
8824 { VEX_W_TABLE (VEX_W_0F3A00_P_2) },
8827 /* VEX_LEN_0F3A01_P_2 */
8830 { VEX_W_TABLE (VEX_W_0F3A01_P_2) },
8833 /* VEX_LEN_0F3A06_P_2 */
8836 { VEX_W_TABLE (VEX_W_0F3A06_P_2) },
8839 /* VEX_LEN_0F3A0A_P_2 */
8841 { VEX_W_TABLE (VEX_W_0F3A0A_P_2) },
8842 { VEX_W_TABLE (VEX_W_0F3A0A_P_2) },
8845 /* VEX_LEN_0F3A0B_P_2 */
8847 { VEX_W_TABLE (VEX_W_0F3A0B_P_2) },
8848 { VEX_W_TABLE (VEX_W_0F3A0B_P_2) },
8851 /* VEX_LEN_0F3A14_P_2 */
8853 { VEX_W_TABLE (VEX_W_0F3A14_P_2) },
8856 /* VEX_LEN_0F3A15_P_2 */
8858 { VEX_W_TABLE (VEX_W_0F3A15_P_2) },
8861 /* VEX_LEN_0F3A16_P_2 */
8863 { "vpextrK", { Edq, XM, Ib } },
8866 /* VEX_LEN_0F3A17_P_2 */
8868 { "vextractps", { Edqd, XM, Ib } },
8871 /* VEX_LEN_0F3A18_P_2 */
8874 { VEX_W_TABLE (VEX_W_0F3A18_P_2) },
8877 /* VEX_LEN_0F3A19_P_2 */
8880 { VEX_W_TABLE (VEX_W_0F3A19_P_2) },
8883 /* VEX_LEN_0F3A20_P_2 */
8885 { VEX_W_TABLE (VEX_W_0F3A20_P_2) },
8888 /* VEX_LEN_0F3A21_P_2 */
8890 { VEX_W_TABLE (VEX_W_0F3A21_P_2) },
8893 /* VEX_LEN_0F3A22_P_2 */
8895 { "vpinsrK", { XM, Vex128, Edq, Ib } },
8898 /* VEX_LEN_0F3A38_P_2 */
8901 { VEX_W_TABLE (VEX_W_0F3A38_P_2) },
8904 /* VEX_LEN_0F3A39_P_2 */
8907 { VEX_W_TABLE (VEX_W_0F3A39_P_2) },
8910 /* VEX_LEN_0F3A41_P_2 */
8912 { VEX_W_TABLE (VEX_W_0F3A41_P_2) },
8915 /* VEX_LEN_0F3A44_P_2 */
8917 { VEX_W_TABLE (VEX_W_0F3A44_P_2) },
8920 /* VEX_LEN_0F3A46_P_2 */
8923 { VEX_W_TABLE (VEX_W_0F3A46_P_2) },
8926 /* VEX_LEN_0F3A60_P_2 */
8928 { VEX_W_TABLE (VEX_W_0F3A60_P_2) },
8931 /* VEX_LEN_0F3A61_P_2 */
8933 { VEX_W_TABLE (VEX_W_0F3A61_P_2) },
8936 /* VEX_LEN_0F3A62_P_2 */
8938 { VEX_W_TABLE (VEX_W_0F3A62_P_2) },
8941 /* VEX_LEN_0F3A63_P_2 */
8943 { VEX_W_TABLE (VEX_W_0F3A63_P_2) },
8946 /* VEX_LEN_0F3A6A_P_2 */
8948 { "vfmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
8951 /* VEX_LEN_0F3A6B_P_2 */
8953 { "vfmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
8956 /* VEX_LEN_0F3A6E_P_2 */
8958 { "vfmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
8961 /* VEX_LEN_0F3A6F_P_2 */
8963 { "vfmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
8966 /* VEX_LEN_0F3A7A_P_2 */
8968 { "vfnmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
8971 /* VEX_LEN_0F3A7B_P_2 */
8973 { "vfnmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
8976 /* VEX_LEN_0F3A7E_P_2 */
8978 { "vfnmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
8981 /* VEX_LEN_0F3A7F_P_2 */
8983 { "vfnmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
8986 /* VEX_LEN_0F3ADF_P_2 */
8988 { VEX_W_TABLE (VEX_W_0F3ADF_P_2) },
8991 /* VEX_LEN_0F3AF0_P_3 */
8993 { "rorxS", { Gdq, Edq, Ib } },
8996 /* VEX_LEN_0FXOP_09_80 */
8998 { "vfrczps", { XM, EXxmm } },
8999 { "vfrczps", { XM, EXymmq } },
9002 /* VEX_LEN_0FXOP_09_81 */
9004 { "vfrczpd", { XM, EXxmm } },
9005 { "vfrczpd", { XM, EXymmq } },
9009 static const struct dis386 vex_w_table[][2] = {
9011 /* VEX_W_0F10_P_0 */
9012 { "vmovups", { XM, EXx } },
9015 /* VEX_W_0F10_P_1 */
9016 { "vmovss", { XMVexScalar, VexScalar, EXdScalar } },
9019 /* VEX_W_0F10_P_2 */
9020 { "vmovupd", { XM, EXx } },
9023 /* VEX_W_0F10_P_3 */
9024 { "vmovsd", { XMVexScalar, VexScalar, EXqScalar } },
9027 /* VEX_W_0F11_P_0 */
9028 { "vmovups", { EXxS, XM } },
9031 /* VEX_W_0F11_P_1 */
9032 { "vmovss", { EXdVexScalarS, VexScalar, XMScalar } },
9035 /* VEX_W_0F11_P_2 */
9036 { "vmovupd", { EXxS, XM } },
9039 /* VEX_W_0F11_P_3 */
9040 { "vmovsd", { EXqVexScalarS, VexScalar, XMScalar } },
9043 /* VEX_W_0F12_P_0_M_0 */
9044 { "vmovlps", { XM, Vex128, EXq } },
9047 /* VEX_W_0F12_P_0_M_1 */
9048 { "vmovhlps", { XM, Vex128, EXq } },
9051 /* VEX_W_0F12_P_1 */
9052 { "vmovsldup", { XM, EXx } },
9055 /* VEX_W_0F12_P_2 */
9056 { "vmovlpd", { XM, Vex128, EXq } },
9059 /* VEX_W_0F12_P_3 */
9060 { "vmovddup", { XM, EXymmq } },
9063 /* VEX_W_0F13_M_0 */
9064 { "vmovlpX", { EXq, XM } },
9068 { "vunpcklpX", { XM, Vex, EXx } },
9072 { "vunpckhpX", { XM, Vex, EXx } },
9075 /* VEX_W_0F16_P_0_M_0 */
9076 { "vmovhps", { XM, Vex128, EXq } },
9079 /* VEX_W_0F16_P_0_M_1 */
9080 { "vmovlhps", { XM, Vex128, EXq } },
9083 /* VEX_W_0F16_P_1 */
9084 { "vmovshdup", { XM, EXx } },
9087 /* VEX_W_0F16_P_2 */
9088 { "vmovhpd", { XM, Vex128, EXq } },
9091 /* VEX_W_0F17_M_0 */
9092 { "vmovhpX", { EXq, XM } },
9096 { "vmovapX", { XM, EXx } },
9100 { "vmovapX", { EXxS, XM } },
9103 /* VEX_W_0F2B_M_0 */
9104 { "vmovntpX", { Mx, XM } },
9107 /* VEX_W_0F2E_P_0 */
9108 { "vucomiss", { XMScalar, EXdScalar } },
9111 /* VEX_W_0F2E_P_2 */
9112 { "vucomisd", { XMScalar, EXqScalar } },
9115 /* VEX_W_0F2F_P_0 */
9116 { "vcomiss", { XMScalar, EXdScalar } },
9119 /* VEX_W_0F2F_P_2 */
9120 { "vcomisd", { XMScalar, EXqScalar } },
9123 /* VEX_W_0F50_M_0 */
9124 { "vmovmskpX", { Gdq, XS } },
9127 /* VEX_W_0F51_P_0 */
9128 { "vsqrtps", { XM, EXx } },
9131 /* VEX_W_0F51_P_1 */
9132 { "vsqrtss", { XMScalar, VexScalar, EXdScalar } },
9135 /* VEX_W_0F51_P_2 */
9136 { "vsqrtpd", { XM, EXx } },
9139 /* VEX_W_0F51_P_3 */
9140 { "vsqrtsd", { XMScalar, VexScalar, EXqScalar } },
9143 /* VEX_W_0F52_P_0 */
9144 { "vrsqrtps", { XM, EXx } },
9147 /* VEX_W_0F52_P_1 */
9148 { "vrsqrtss", { XMScalar, VexScalar, EXdScalar } },
9151 /* VEX_W_0F53_P_0 */
9152 { "vrcpps", { XM, EXx } },
9155 /* VEX_W_0F53_P_1 */
9156 { "vrcpss", { XMScalar, VexScalar, EXdScalar } },
9159 /* VEX_W_0F58_P_0 */
9160 { "vaddps", { XM, Vex, EXx } },
9163 /* VEX_W_0F58_P_1 */
9164 { "vaddss", { XMScalar, VexScalar, EXdScalar } },
9167 /* VEX_W_0F58_P_2 */
9168 { "vaddpd", { XM, Vex, EXx } },
9171 /* VEX_W_0F58_P_3 */
9172 { "vaddsd", { XMScalar, VexScalar, EXqScalar } },
9175 /* VEX_W_0F59_P_0 */
9176 { "vmulps", { XM, Vex, EXx } },
9179 /* VEX_W_0F59_P_1 */
9180 { "vmulss", { XMScalar, VexScalar, EXdScalar } },
9183 /* VEX_W_0F59_P_2 */
9184 { "vmulpd", { XM, Vex, EXx } },
9187 /* VEX_W_0F59_P_3 */
9188 { "vmulsd", { XMScalar, VexScalar, EXqScalar } },
9191 /* VEX_W_0F5A_P_0 */
9192 { "vcvtps2pd", { XM, EXxmmq } },
9195 /* VEX_W_0F5A_P_1 */
9196 { "vcvtss2sd", { XMScalar, VexScalar, EXdScalar } },
9199 /* VEX_W_0F5A_P_3 */
9200 { "vcvtsd2ss", { XMScalar, VexScalar, EXqScalar } },
9203 /* VEX_W_0F5B_P_0 */
9204 { "vcvtdq2ps", { XM, EXx } },
9207 /* VEX_W_0F5B_P_1 */
9208 { "vcvttps2dq", { XM, EXx } },
9211 /* VEX_W_0F5B_P_2 */
9212 { "vcvtps2dq", { XM, EXx } },
9215 /* VEX_W_0F5C_P_0 */
9216 { "vsubps", { XM, Vex, EXx } },
9219 /* VEX_W_0F5C_P_1 */
9220 { "vsubss", { XMScalar, VexScalar, EXdScalar } },
9223 /* VEX_W_0F5C_P_2 */
9224 { "vsubpd", { XM, Vex, EXx } },
9227 /* VEX_W_0F5C_P_3 */
9228 { "vsubsd", { XMScalar, VexScalar, EXqScalar } },
9231 /* VEX_W_0F5D_P_0 */
9232 { "vminps", { XM, Vex, EXx } },
9235 /* VEX_W_0F5D_P_1 */
9236 { "vminss", { XMScalar, VexScalar, EXdScalar } },
9239 /* VEX_W_0F5D_P_2 */
9240 { "vminpd", { XM, Vex, EXx } },
9243 /* VEX_W_0F5D_P_3 */
9244 { "vminsd", { XMScalar, VexScalar, EXqScalar } },
9247 /* VEX_W_0F5E_P_0 */
9248 { "vdivps", { XM, Vex, EXx } },
9251 /* VEX_W_0F5E_P_1 */
9252 { "vdivss", { XMScalar, VexScalar, EXdScalar } },
9255 /* VEX_W_0F5E_P_2 */
9256 { "vdivpd", { XM, Vex, EXx } },
9259 /* VEX_W_0F5E_P_3 */
9260 { "vdivsd", { XMScalar, VexScalar, EXqScalar } },
9263 /* VEX_W_0F5F_P_0 */
9264 { "vmaxps", { XM, Vex, EXx } },
9267 /* VEX_W_0F5F_P_1 */
9268 { "vmaxss", { XMScalar, VexScalar, EXdScalar } },
9271 /* VEX_W_0F5F_P_2 */
9272 { "vmaxpd", { XM, Vex, EXx } },
9275 /* VEX_W_0F5F_P_3 */
9276 { "vmaxsd", { XMScalar, VexScalar, EXqScalar } },
9279 /* VEX_W_0F60_P_2 */
9280 { "vpunpcklbw", { XM, Vex, EXx } },
9283 /* VEX_W_0F61_P_2 */
9284 { "vpunpcklwd", { XM, Vex, EXx } },
9287 /* VEX_W_0F62_P_2 */
9288 { "vpunpckldq", { XM, Vex, EXx } },
9291 /* VEX_W_0F63_P_2 */
9292 { "vpacksswb", { XM, Vex, EXx } },
9295 /* VEX_W_0F64_P_2 */
9296 { "vpcmpgtb", { XM, Vex, EXx } },
9299 /* VEX_W_0F65_P_2 */
9300 { "vpcmpgtw", { XM, Vex, EXx } },
9303 /* VEX_W_0F66_P_2 */
9304 { "vpcmpgtd", { XM, Vex, EXx } },
9307 /* VEX_W_0F67_P_2 */
9308 { "vpackuswb", { XM, Vex, EXx } },
9311 /* VEX_W_0F68_P_2 */
9312 { "vpunpckhbw", { XM, Vex, EXx } },
9315 /* VEX_W_0F69_P_2 */
9316 { "vpunpckhwd", { XM, Vex, EXx } },
9319 /* VEX_W_0F6A_P_2 */
9320 { "vpunpckhdq", { XM, Vex, EXx } },
9323 /* VEX_W_0F6B_P_2 */
9324 { "vpackssdw", { XM, Vex, EXx } },
9327 /* VEX_W_0F6C_P_2 */
9328 { "vpunpcklqdq", { XM, Vex, EXx } },
9331 /* VEX_W_0F6D_P_2 */
9332 { "vpunpckhqdq", { XM, Vex, EXx } },
9335 /* VEX_W_0F6F_P_1 */
9336 { "vmovdqu", { XM, EXx } },
9339 /* VEX_W_0F6F_P_2 */
9340 { "vmovdqa", { XM, EXx } },
9343 /* VEX_W_0F70_P_1 */
9344 { "vpshufhw", { XM, EXx, Ib } },
9347 /* VEX_W_0F70_P_2 */
9348 { "vpshufd", { XM, EXx, Ib } },
9351 /* VEX_W_0F70_P_3 */
9352 { "vpshuflw", { XM, EXx, Ib } },
9355 /* VEX_W_0F71_R_2_P_2 */
9356 { "vpsrlw", { Vex, XS, Ib } },
9359 /* VEX_W_0F71_R_4_P_2 */
9360 { "vpsraw", { Vex, XS, Ib } },
9363 /* VEX_W_0F71_R_6_P_2 */
9364 { "vpsllw", { Vex, XS, Ib } },
9367 /* VEX_W_0F72_R_2_P_2 */
9368 { "vpsrld", { Vex, XS, Ib } },
9371 /* VEX_W_0F72_R_4_P_2 */
9372 { "vpsrad", { Vex, XS, Ib } },
9375 /* VEX_W_0F72_R_6_P_2 */
9376 { "vpslld", { Vex, XS, Ib } },
9379 /* VEX_W_0F73_R_2_P_2 */
9380 { "vpsrlq", { Vex, XS, Ib } },
9383 /* VEX_W_0F73_R_3_P_2 */
9384 { "vpsrldq", { Vex, XS, Ib } },
9387 /* VEX_W_0F73_R_6_P_2 */
9388 { "vpsllq", { Vex, XS, Ib } },
9391 /* VEX_W_0F73_R_7_P_2 */
9392 { "vpslldq", { Vex, XS, Ib } },
9395 /* VEX_W_0F74_P_2 */
9396 { "vpcmpeqb", { XM, Vex, EXx } },
9399 /* VEX_W_0F75_P_2 */
9400 { "vpcmpeqw", { XM, Vex, EXx } },
9403 /* VEX_W_0F76_P_2 */
9404 { "vpcmpeqd", { XM, Vex, EXx } },
9407 /* VEX_W_0F77_P_0 */
9411 /* VEX_W_0F7C_P_2 */
9412 { "vhaddpd", { XM, Vex, EXx } },
9415 /* VEX_W_0F7C_P_3 */
9416 { "vhaddps", { XM, Vex, EXx } },
9419 /* VEX_W_0F7D_P_2 */
9420 { "vhsubpd", { XM, Vex, EXx } },
9423 /* VEX_W_0F7D_P_3 */
9424 { "vhsubps", { XM, Vex, EXx } },
9427 /* VEX_W_0F7E_P_1 */
9428 { "vmovq", { XMScalar, EXqScalar } },
9431 /* VEX_W_0F7F_P_1 */
9432 { "vmovdqu", { EXxS, XM } },
9435 /* VEX_W_0F7F_P_2 */
9436 { "vmovdqa", { EXxS, XM } },
9439 /* VEX_W_0FAE_R_2_M_0 */
9440 { "vldmxcsr", { Md } },
9443 /* VEX_W_0FAE_R_3_M_0 */
9444 { "vstmxcsr", { Md } },
9447 /* VEX_W_0FC2_P_0 */
9448 { "vcmpps", { XM, Vex, EXx, VCMP } },
9451 /* VEX_W_0FC2_P_1 */
9452 { "vcmpss", { XMScalar, VexScalar, EXdScalar, VCMP } },
9455 /* VEX_W_0FC2_P_2 */
9456 { "vcmppd", { XM, Vex, EXx, VCMP } },
9459 /* VEX_W_0FC2_P_3 */
9460 { "vcmpsd", { XMScalar, VexScalar, EXqScalar, VCMP } },
9463 /* VEX_W_0FC4_P_2 */
9464 { "vpinsrw", { XM, Vex128, Edqw, Ib } },
9467 /* VEX_W_0FC5_P_2 */
9468 { "vpextrw", { Gdq, XS, Ib } },
9471 /* VEX_W_0FD0_P_2 */
9472 { "vaddsubpd", { XM, Vex, EXx } },
9475 /* VEX_W_0FD0_P_3 */
9476 { "vaddsubps", { XM, Vex, EXx } },
9479 /* VEX_W_0FD1_P_2 */
9480 { "vpsrlw", { XM, Vex, EXxmm } },
9483 /* VEX_W_0FD2_P_2 */
9484 { "vpsrld", { XM, Vex, EXxmm } },
9487 /* VEX_W_0FD3_P_2 */
9488 { "vpsrlq", { XM, Vex, EXxmm } },
9491 /* VEX_W_0FD4_P_2 */
9492 { "vpaddq", { XM, Vex, EXx } },
9495 /* VEX_W_0FD5_P_2 */
9496 { "vpmullw", { XM, Vex, EXx } },
9499 /* VEX_W_0FD6_P_2 */
9500 { "vmovq", { EXqScalarS, XMScalar } },
9503 /* VEX_W_0FD7_P_2_M_1 */
9504 { "vpmovmskb", { Gdq, XS } },
9507 /* VEX_W_0FD8_P_2 */
9508 { "vpsubusb", { XM, Vex, EXx } },
9511 /* VEX_W_0FD9_P_2 */
9512 { "vpsubusw", { XM, Vex, EXx } },
9515 /* VEX_W_0FDA_P_2 */
9516 { "vpminub", { XM, Vex, EXx } },
9519 /* VEX_W_0FDB_P_2 */
9520 { "vpand", { XM, Vex, EXx } },
9523 /* VEX_W_0FDC_P_2 */
9524 { "vpaddusb", { XM, Vex, EXx } },
9527 /* VEX_W_0FDD_P_2 */
9528 { "vpaddusw", { XM, Vex, EXx } },
9531 /* VEX_W_0FDE_P_2 */
9532 { "vpmaxub", { XM, Vex, EXx } },
9535 /* VEX_W_0FDF_P_2 */
9536 { "vpandn", { XM, Vex, EXx } },
9539 /* VEX_W_0FE0_P_2 */
9540 { "vpavgb", { XM, Vex, EXx } },
9543 /* VEX_W_0FE1_P_2 */
9544 { "vpsraw", { XM, Vex, EXxmm } },
9547 /* VEX_W_0FE2_P_2 */
9548 { "vpsrad", { XM, Vex, EXxmm } },
9551 /* VEX_W_0FE3_P_2 */
9552 { "vpavgw", { XM, Vex, EXx } },
9555 /* VEX_W_0FE4_P_2 */
9556 { "vpmulhuw", { XM, Vex, EXx } },
9559 /* VEX_W_0FE5_P_2 */
9560 { "vpmulhw", { XM, Vex, EXx } },
9563 /* VEX_W_0FE6_P_1 */
9564 { "vcvtdq2pd", { XM, EXxmmq } },
9567 /* VEX_W_0FE6_P_2 */
9568 { "vcvttpd2dq%XY", { XMM, EXx } },
9571 /* VEX_W_0FE6_P_3 */
9572 { "vcvtpd2dq%XY", { XMM, EXx } },
9575 /* VEX_W_0FE7_P_2_M_0 */
9576 { "vmovntdq", { Mx, XM } },
9579 /* VEX_W_0FE8_P_2 */
9580 { "vpsubsb", { XM, Vex, EXx } },
9583 /* VEX_W_0FE9_P_2 */
9584 { "vpsubsw", { XM, Vex, EXx } },
9587 /* VEX_W_0FEA_P_2 */
9588 { "vpminsw", { XM, Vex, EXx } },
9591 /* VEX_W_0FEB_P_2 */
9592 { "vpor", { XM, Vex, EXx } },
9595 /* VEX_W_0FEC_P_2 */
9596 { "vpaddsb", { XM, Vex, EXx } },
9599 /* VEX_W_0FED_P_2 */
9600 { "vpaddsw", { XM, Vex, EXx } },
9603 /* VEX_W_0FEE_P_2 */
9604 { "vpmaxsw", { XM, Vex, EXx } },
9607 /* VEX_W_0FEF_P_2 */
9608 { "vpxor", { XM, Vex, EXx } },
9611 /* VEX_W_0FF0_P_3_M_0 */
9612 { "vlddqu", { XM, M } },
9615 /* VEX_W_0FF1_P_2 */
9616 { "vpsllw", { XM, Vex, EXxmm } },
9619 /* VEX_W_0FF2_P_2 */
9620 { "vpslld", { XM, Vex, EXxmm } },
9623 /* VEX_W_0FF3_P_2 */
9624 { "vpsllq", { XM, Vex, EXxmm } },
9627 /* VEX_W_0FF4_P_2 */
9628 { "vpmuludq", { XM, Vex, EXx } },
9631 /* VEX_W_0FF5_P_2 */
9632 { "vpmaddwd", { XM, Vex, EXx } },
9635 /* VEX_W_0FF6_P_2 */
9636 { "vpsadbw", { XM, Vex, EXx } },
9639 /* VEX_W_0FF7_P_2 */
9640 { "vmaskmovdqu", { XM, XS } },
9643 /* VEX_W_0FF8_P_2 */
9644 { "vpsubb", { XM, Vex, EXx } },
9647 /* VEX_W_0FF9_P_2 */
9648 { "vpsubw", { XM, Vex, EXx } },
9651 /* VEX_W_0FFA_P_2 */
9652 { "vpsubd", { XM, Vex, EXx } },
9655 /* VEX_W_0FFB_P_2 */
9656 { "vpsubq", { XM, Vex, EXx } },
9659 /* VEX_W_0FFC_P_2 */
9660 { "vpaddb", { XM, Vex, EXx } },
9663 /* VEX_W_0FFD_P_2 */
9664 { "vpaddw", { XM, Vex, EXx } },
9667 /* VEX_W_0FFE_P_2 */
9668 { "vpaddd", { XM, Vex, EXx } },
9671 /* VEX_W_0F3800_P_2 */
9672 { "vpshufb", { XM, Vex, EXx } },
9675 /* VEX_W_0F3801_P_2 */
9676 { "vphaddw", { XM, Vex, EXx } },
9679 /* VEX_W_0F3802_P_2 */
9680 { "vphaddd", { XM, Vex, EXx } },
9683 /* VEX_W_0F3803_P_2 */
9684 { "vphaddsw", { XM, Vex, EXx } },
9687 /* VEX_W_0F3804_P_2 */
9688 { "vpmaddubsw", { XM, Vex, EXx } },
9691 /* VEX_W_0F3805_P_2 */
9692 { "vphsubw", { XM, Vex, EXx } },
9695 /* VEX_W_0F3806_P_2 */
9696 { "vphsubd", { XM, Vex, EXx } },
9699 /* VEX_W_0F3807_P_2 */
9700 { "vphsubsw", { XM, Vex, EXx } },
9703 /* VEX_W_0F3808_P_2 */
9704 { "vpsignb", { XM, Vex, EXx } },
9707 /* VEX_W_0F3809_P_2 */
9708 { "vpsignw", { XM, Vex, EXx } },
9711 /* VEX_W_0F380A_P_2 */
9712 { "vpsignd", { XM, Vex, EXx } },
9715 /* VEX_W_0F380B_P_2 */
9716 { "vpmulhrsw", { XM, Vex, EXx } },
9719 /* VEX_W_0F380C_P_2 */
9720 { "vpermilps", { XM, Vex, EXx } },
9723 /* VEX_W_0F380D_P_2 */
9724 { "vpermilpd", { XM, Vex, EXx } },
9727 /* VEX_W_0F380E_P_2 */
9728 { "vtestps", { XM, EXx } },
9731 /* VEX_W_0F380F_P_2 */
9732 { "vtestpd", { XM, EXx } },
9735 /* VEX_W_0F3816_P_2 */
9736 { "vpermps", { XM, Vex, EXx } },
9739 /* VEX_W_0F3817_P_2 */
9740 { "vptest", { XM, EXx } },
9743 /* VEX_W_0F3818_P_2 */
9744 { "vbroadcastss", { XM, EXxmm_md } },
9747 /* VEX_W_0F3819_P_2 */
9748 { "vbroadcastsd", { XM, EXxmm_mq } },
9751 /* VEX_W_0F381A_P_2_M_0 */
9752 { "vbroadcastf128", { XM, Mxmm } },
9755 /* VEX_W_0F381C_P_2 */
9756 { "vpabsb", { XM, EXx } },
9759 /* VEX_W_0F381D_P_2 */
9760 { "vpabsw", { XM, EXx } },
9763 /* VEX_W_0F381E_P_2 */
9764 { "vpabsd", { XM, EXx } },
9767 /* VEX_W_0F3820_P_2 */
9768 { "vpmovsxbw", { XM, EXxmmq } },
9771 /* VEX_W_0F3821_P_2 */
9772 { "vpmovsxbd", { XM, EXxmmqd } },
9775 /* VEX_W_0F3822_P_2 */
9776 { "vpmovsxbq", { XM, EXxmmdw } },
9779 /* VEX_W_0F3823_P_2 */
9780 { "vpmovsxwd", { XM, EXxmmq } },
9783 /* VEX_W_0F3824_P_2 */
9784 { "vpmovsxwq", { XM, EXxmmqd } },
9787 /* VEX_W_0F3825_P_2 */
9788 { "vpmovsxdq", { XM, EXxmmq } },
9791 /* VEX_W_0F3828_P_2 */
9792 { "vpmuldq", { XM, Vex, EXx } },
9795 /* VEX_W_0F3829_P_2 */
9796 { "vpcmpeqq", { XM, Vex, EXx } },
9799 /* VEX_W_0F382A_P_2_M_0 */
9800 { "vmovntdqa", { XM, Mx } },
9803 /* VEX_W_0F382B_P_2 */
9804 { "vpackusdw", { XM, Vex, EXx } },
9807 /* VEX_W_0F382C_P_2_M_0 */
9808 { "vmaskmovps", { XM, Vex, Mx } },
9811 /* VEX_W_0F382D_P_2_M_0 */
9812 { "vmaskmovpd", { XM, Vex, Mx } },
9815 /* VEX_W_0F382E_P_2_M_0 */
9816 { "vmaskmovps", { Mx, Vex, XM } },
9819 /* VEX_W_0F382F_P_2_M_0 */
9820 { "vmaskmovpd", { Mx, Vex, XM } },
9823 /* VEX_W_0F3830_P_2 */
9824 { "vpmovzxbw", { XM, EXxmmq } },
9827 /* VEX_W_0F3831_P_2 */
9828 { "vpmovzxbd", { XM, EXxmmqd } },
9831 /* VEX_W_0F3832_P_2 */
9832 { "vpmovzxbq", { XM, EXxmmdw } },
9835 /* VEX_W_0F3833_P_2 */
9836 { "vpmovzxwd", { XM, EXxmmq } },
9839 /* VEX_W_0F3834_P_2 */
9840 { "vpmovzxwq", { XM, EXxmmqd } },
9843 /* VEX_W_0F3835_P_2 */
9844 { "vpmovzxdq", { XM, EXxmmq } },
9847 /* VEX_W_0F3836_P_2 */
9848 { "vpermd", { XM, Vex, EXx } },
9851 /* VEX_W_0F3837_P_2 */
9852 { "vpcmpgtq", { XM, Vex, EXx } },
9855 /* VEX_W_0F3838_P_2 */
9856 { "vpminsb", { XM, Vex, EXx } },
9859 /* VEX_W_0F3839_P_2 */
9860 { "vpminsd", { XM, Vex, EXx } },
9863 /* VEX_W_0F383A_P_2 */
9864 { "vpminuw", { XM, Vex, EXx } },
9867 /* VEX_W_0F383B_P_2 */
9868 { "vpminud", { XM, Vex, EXx } },
9871 /* VEX_W_0F383C_P_2 */
9872 { "vpmaxsb", { XM, Vex, EXx } },
9875 /* VEX_W_0F383D_P_2 */
9876 { "vpmaxsd", { XM, Vex, EXx } },
9879 /* VEX_W_0F383E_P_2 */
9880 { "vpmaxuw", { XM, Vex, EXx } },
9883 /* VEX_W_0F383F_P_2 */
9884 { "vpmaxud", { XM, Vex, EXx } },
9887 /* VEX_W_0F3840_P_2 */
9888 { "vpmulld", { XM, Vex, EXx } },
9891 /* VEX_W_0F3841_P_2 */
9892 { "vphminposuw", { XM, EXx } },
9895 /* VEX_W_0F3846_P_2 */
9896 { "vpsravd", { XM, Vex, EXx } },
9899 /* VEX_W_0F3858_P_2 */
9900 { "vpbroadcastd", { XM, EXxmm_md } },
9903 /* VEX_W_0F3859_P_2 */
9904 { "vpbroadcastq", { XM, EXxmm_mq } },
9907 /* VEX_W_0F385A_P_2_M_0 */
9908 { "vbroadcasti128", { XM, Mxmm } },
9911 /* VEX_W_0F3878_P_2 */
9912 { "vpbroadcastb", { XM, EXxmm_mb } },
9915 /* VEX_W_0F3879_P_2 */
9916 { "vpbroadcastw", { XM, EXxmm_mw } },
9919 /* VEX_W_0F38DB_P_2 */
9920 { "vaesimc", { XM, EXx } },
9923 /* VEX_W_0F38DC_P_2 */
9924 { "vaesenc", { XM, Vex128, EXx } },
9927 /* VEX_W_0F38DD_P_2 */
9928 { "vaesenclast", { XM, Vex128, EXx } },
9931 /* VEX_W_0F38DE_P_2 */
9932 { "vaesdec", { XM, Vex128, EXx } },
9935 /* VEX_W_0F38DF_P_2 */
9936 { "vaesdeclast", { XM, Vex128, EXx } },
9939 /* VEX_W_0F3A00_P_2 */
9941 { "vpermq", { XM, EXx, Ib } },
9944 /* VEX_W_0F3A01_P_2 */
9946 { "vpermpd", { XM, EXx, Ib } },
9949 /* VEX_W_0F3A02_P_2 */
9950 { "vpblendd", { XM, Vex, EXx, Ib } },
9953 /* VEX_W_0F3A04_P_2 */
9954 { "vpermilps", { XM, EXx, Ib } },
9957 /* VEX_W_0F3A05_P_2 */
9958 { "vpermilpd", { XM, EXx, Ib } },
9961 /* VEX_W_0F3A06_P_2 */
9962 { "vperm2f128", { XM, Vex256, EXx, Ib } },
9965 /* VEX_W_0F3A08_P_2 */
9966 { "vroundps", { XM, EXx, Ib } },
9969 /* VEX_W_0F3A09_P_2 */
9970 { "vroundpd", { XM, EXx, Ib } },
9973 /* VEX_W_0F3A0A_P_2 */
9974 { "vroundss", { XMScalar, VexScalar, EXdScalar, Ib } },
9977 /* VEX_W_0F3A0B_P_2 */
9978 { "vroundsd", { XMScalar, VexScalar, EXqScalar, Ib } },
9981 /* VEX_W_0F3A0C_P_2 */
9982 { "vblendps", { XM, Vex, EXx, Ib } },
9985 /* VEX_W_0F3A0D_P_2 */
9986 { "vblendpd", { XM, Vex, EXx, Ib } },
9989 /* VEX_W_0F3A0E_P_2 */
9990 { "vpblendw", { XM, Vex, EXx, Ib } },
9993 /* VEX_W_0F3A0F_P_2 */
9994 { "vpalignr", { XM, Vex, EXx, Ib } },
9997 /* VEX_W_0F3A14_P_2 */
9998 { "vpextrb", { Edqb, XM, Ib } },
10001 /* VEX_W_0F3A15_P_2 */
10002 { "vpextrw", { Edqw, XM, Ib } },
10005 /* VEX_W_0F3A18_P_2 */
10006 { "vinsertf128", { XM, Vex256, EXxmm, Ib } },
10009 /* VEX_W_0F3A19_P_2 */
10010 { "vextractf128", { EXxmm, XM, Ib } },
10013 /* VEX_W_0F3A20_P_2 */
10014 { "vpinsrb", { XM, Vex128, Edqb, Ib } },
10017 /* VEX_W_0F3A21_P_2 */
10018 { "vinsertps", { XM, Vex128, EXd, Ib } },
10021 /* VEX_W_0F3A38_P_2 */
10022 { "vinserti128", { XM, Vex256, EXxmm, Ib } },
10025 /* VEX_W_0F3A39_P_2 */
10026 { "vextracti128", { EXxmm, XM, Ib } },
10029 /* VEX_W_0F3A40_P_2 */
10030 { "vdpps", { XM, Vex, EXx, Ib } },
10033 /* VEX_W_0F3A41_P_2 */
10034 { "vdppd", { XM, Vex128, EXx, Ib } },
10037 /* VEX_W_0F3A42_P_2 */
10038 { "vmpsadbw", { XM, Vex, EXx, Ib } },
10041 /* VEX_W_0F3A44_P_2 */
10042 { "vpclmulqdq", { XM, Vex128, EXx, PCLMUL } },
10045 /* VEX_W_0F3A46_P_2 */
10046 { "vperm2i128", { XM, Vex256, EXx, Ib } },
10049 /* VEX_W_0F3A48_P_2 */
10050 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW } },
10051 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW } },
10054 /* VEX_W_0F3A49_P_2 */
10055 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW } },
10056 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW } },
10059 /* VEX_W_0F3A4A_P_2 */
10060 { "vblendvps", { XM, Vex, EXx, XMVexI4 } },
10063 /* VEX_W_0F3A4B_P_2 */
10064 { "vblendvpd", { XM, Vex, EXx, XMVexI4 } },
10067 /* VEX_W_0F3A4C_P_2 */
10068 { "vpblendvb", { XM, Vex, EXx, XMVexI4 } },
10071 /* VEX_W_0F3A60_P_2 */
10072 { "vpcmpestrm", { XM, EXx, Ib } },
10075 /* VEX_W_0F3A61_P_2 */
10076 { "vpcmpestri", { XM, EXx, Ib } },
10079 /* VEX_W_0F3A62_P_2 */
10080 { "vpcmpistrm", { XM, EXx, Ib } },
10083 /* VEX_W_0F3A63_P_2 */
10084 { "vpcmpistri", { XM, EXx, Ib } },
10087 /* VEX_W_0F3ADF_P_2 */
10088 { "vaeskeygenassist", { XM, EXx, Ib } },
10092 static const struct dis386 mod_table[][2] = {
10095 { "leaS", { Gv, M } },
10100 { RM_TABLE (RM_C6_REG_7) },
10105 { RM_TABLE (RM_C7_REG_7) },
10108 /* MOD_0F01_REG_0 */
10109 { X86_64_TABLE (X86_64_0F01_REG_0) },
10110 { RM_TABLE (RM_0F01_REG_0) },
10113 /* MOD_0F01_REG_1 */
10114 { X86_64_TABLE (X86_64_0F01_REG_1) },
10115 { RM_TABLE (RM_0F01_REG_1) },
10118 /* MOD_0F01_REG_2 */
10119 { X86_64_TABLE (X86_64_0F01_REG_2) },
10120 { RM_TABLE (RM_0F01_REG_2) },
10123 /* MOD_0F01_REG_3 */
10124 { X86_64_TABLE (X86_64_0F01_REG_3) },
10125 { RM_TABLE (RM_0F01_REG_3) },
10128 /* MOD_0F01_REG_7 */
10129 { "invlpg", { Mb } },
10130 { RM_TABLE (RM_0F01_REG_7) },
10133 /* MOD_0F12_PREFIX_0 */
10134 { "movlps", { XM, EXq } },
10135 { "movhlps", { XM, EXq } },
10139 { "movlpX", { EXq, XM } },
10142 /* MOD_0F16_PREFIX_0 */
10143 { "movhps", { XM, EXq } },
10144 { "movlhps", { XM, EXq } },
10148 { "movhpX", { EXq, XM } },
10151 /* MOD_0F18_REG_0 */
10152 { "prefetchnta", { Mb } },
10155 /* MOD_0F18_REG_1 */
10156 { "prefetcht0", { Mb } },
10159 /* MOD_0F18_REG_2 */
10160 { "prefetcht1", { Mb } },
10163 /* MOD_0F18_REG_3 */
10164 { "prefetcht2", { Mb } },
10169 { "movZ", { Rm, Cm } },
10174 { "movZ", { Rm, Dm } },
10179 { "movZ", { Cm, Rm } },
10184 { "movZ", { Dm, Rm } },
10189 { "movL", { Rd, Td } },
10194 { "movL", { Td, Rd } },
10197 /* MOD_0F2B_PREFIX_0 */
10198 {"movntps", { Mx, XM } },
10201 /* MOD_0F2B_PREFIX_1 */
10202 {"movntss", { Md, XM } },
10205 /* MOD_0F2B_PREFIX_2 */
10206 {"movntpd", { Mx, XM } },
10209 /* MOD_0F2B_PREFIX_3 */
10210 {"movntsd", { Mq, XM } },
10215 { "movmskpX", { Gdq, XS } },
10218 /* MOD_0F71_REG_2 */
10220 { "psrlw", { MS, Ib } },
10223 /* MOD_0F71_REG_4 */
10225 { "psraw", { MS, Ib } },
10228 /* MOD_0F71_REG_6 */
10230 { "psllw", { MS, Ib } },
10233 /* MOD_0F72_REG_2 */
10235 { "psrld", { MS, Ib } },
10238 /* MOD_0F72_REG_4 */
10240 { "psrad", { MS, Ib } },
10243 /* MOD_0F72_REG_6 */
10245 { "pslld", { MS, Ib } },
10248 /* MOD_0F73_REG_2 */
10250 { "psrlq", { MS, Ib } },
10253 /* MOD_0F73_REG_3 */
10255 { PREFIX_TABLE (PREFIX_0F73_REG_3) },
10258 /* MOD_0F73_REG_6 */
10260 { "psllq", { MS, Ib } },
10263 /* MOD_0F73_REG_7 */
10265 { PREFIX_TABLE (PREFIX_0F73_REG_7) },
10268 /* MOD_0FAE_REG_0 */
10269 { "fxsave", { FXSAVE } },
10270 { PREFIX_TABLE (PREFIX_0FAE_REG_0) },
10273 /* MOD_0FAE_REG_1 */
10274 { "fxrstor", { FXSAVE } },
10275 { PREFIX_TABLE (PREFIX_0FAE_REG_1) },
10278 /* MOD_0FAE_REG_2 */
10279 { "ldmxcsr", { Md } },
10280 { PREFIX_TABLE (PREFIX_0FAE_REG_2) },
10283 /* MOD_0FAE_REG_3 */
10284 { "stmxcsr", { Md } },
10285 { PREFIX_TABLE (PREFIX_0FAE_REG_3) },
10288 /* MOD_0FAE_REG_4 */
10289 { "xsave", { FXSAVE } },
10292 /* MOD_0FAE_REG_5 */
10293 { "xrstor", { FXSAVE } },
10294 { RM_TABLE (RM_0FAE_REG_5) },
10297 /* MOD_0FAE_REG_6 */
10298 { "xsaveopt", { FXSAVE } },
10299 { RM_TABLE (RM_0FAE_REG_6) },
10302 /* MOD_0FAE_REG_7 */
10303 { "clflush", { Mb } },
10304 { RM_TABLE (RM_0FAE_REG_7) },
10308 { "lssS", { Gv, Mp } },
10312 { "lfsS", { Gv, Mp } },
10316 { "lgsS", { Gv, Mp } },
10319 /* MOD_0FC7_REG_6 */
10320 { PREFIX_TABLE (PREFIX_0FC7_REG_6) },
10321 { "rdrand", { Ev } },
10324 /* MOD_0FC7_REG_7 */
10325 { "vmptrst", { Mq } },
10330 { "pmovmskb", { Gdq, MS } },
10333 /* MOD_0FE7_PREFIX_2 */
10334 { "movntdq", { Mx, XM } },
10337 /* MOD_0FF0_PREFIX_3 */
10338 { "lddqu", { XM, M } },
10341 /* MOD_0F382A_PREFIX_2 */
10342 { "movntdqa", { XM, Mx } },
10346 { "bound{S|}", { Gv, Ma } },
10350 { "lesS", { Gv, Mp } },
10351 { VEX_C4_TABLE (VEX_0F) },
10355 { "ldsS", { Gv, Mp } },
10356 { VEX_C5_TABLE (VEX_0F) },
10359 /* MOD_VEX_0F12_PREFIX_0 */
10360 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0) },
10361 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1) },
10365 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0) },
10368 /* MOD_VEX_0F16_PREFIX_0 */
10369 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0) },
10370 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1) },
10374 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0) },
10378 { VEX_W_TABLE (VEX_W_0F2B_M_0) },
10383 { VEX_W_TABLE (VEX_W_0F50_M_0) },
10386 /* MOD_VEX_0F71_REG_2 */
10388 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_2) },
10391 /* MOD_VEX_0F71_REG_4 */
10393 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_4) },
10396 /* MOD_VEX_0F71_REG_6 */
10398 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_6) },
10401 /* MOD_VEX_0F72_REG_2 */
10403 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_2) },
10406 /* MOD_VEX_0F72_REG_4 */
10408 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_4) },
10411 /* MOD_VEX_0F72_REG_6 */
10413 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_6) },
10416 /* MOD_VEX_0F73_REG_2 */
10418 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_2) },
10421 /* MOD_VEX_0F73_REG_3 */
10423 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_3) },
10426 /* MOD_VEX_0F73_REG_6 */
10428 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_6) },
10431 /* MOD_VEX_0F73_REG_7 */
10433 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_7) },
10436 /* MOD_VEX_0FAE_REG_2 */
10437 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0) },
10440 /* MOD_VEX_0FAE_REG_3 */
10441 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0) },
10444 /* MOD_VEX_0FD7_PREFIX_2 */
10446 { VEX_W_TABLE (VEX_W_0FD7_P_2_M_1) },
10449 /* MOD_VEX_0FE7_PREFIX_2 */
10450 { VEX_W_TABLE (VEX_W_0FE7_P_2_M_0) },
10453 /* MOD_VEX_0FF0_PREFIX_3 */
10454 { VEX_W_TABLE (VEX_W_0FF0_P_3_M_0) },
10457 /* MOD_VEX_0F381A_PREFIX_2 */
10458 { VEX_LEN_TABLE (VEX_LEN_0F381A_P_2_M_0) },
10461 /* MOD_VEX_0F382A_PREFIX_2 */
10462 { VEX_W_TABLE (VEX_W_0F382A_P_2_M_0) },
10465 /* MOD_VEX_0F382C_PREFIX_2 */
10466 { VEX_W_TABLE (VEX_W_0F382C_P_2_M_0) },
10469 /* MOD_VEX_0F382D_PREFIX_2 */
10470 { VEX_W_TABLE (VEX_W_0F382D_P_2_M_0) },
10473 /* MOD_VEX_0F382E_PREFIX_2 */
10474 { VEX_W_TABLE (VEX_W_0F382E_P_2_M_0) },
10477 /* MOD_VEX_0F382F_PREFIX_2 */
10478 { VEX_W_TABLE (VEX_W_0F382F_P_2_M_0) },
10481 /* MOD_VEX_0F385A_PREFIX_2 */
10482 { VEX_LEN_TABLE (VEX_LEN_0F385A_P_2_M_0) },
10485 /* MOD_VEX_0F388C_PREFIX_2 */
10486 { "vpmaskmov%LW", { XM, Vex, Mx } },
10489 /* MOD_VEX_0F388E_PREFIX_2 */
10490 { "vpmaskmov%LW", { Mx, Vex, XM } },
10494 static const struct dis386 rm_table[][8] = {
10497 { "xabort", { Skip_MODRM, Ib } },
10501 { "xbeginT", { Skip_MODRM, Jv } },
10504 /* RM_0F01_REG_0 */
10506 { "vmcall", { Skip_MODRM } },
10507 { "vmlaunch", { Skip_MODRM } },
10508 { "vmresume", { Skip_MODRM } },
10509 { "vmxoff", { Skip_MODRM } },
10512 /* RM_0F01_REG_1 */
10513 { "monitor", { { OP_Monitor, 0 } } },
10514 { "mwait", { { OP_Mwait, 0 } } },
10517 /* RM_0F01_REG_2 */
10518 { "xgetbv", { Skip_MODRM } },
10519 { "xsetbv", { Skip_MODRM } },
10522 { "vmfunc", { Skip_MODRM } },
10523 { "xend", { Skip_MODRM } },
10524 { "xtest", { Skip_MODRM } },
10528 /* RM_0F01_REG_3 */
10529 { "vmrun", { Skip_MODRM } },
10530 { "vmmcall", { Skip_MODRM } },
10531 { "vmload", { Skip_MODRM } },
10532 { "vmsave", { Skip_MODRM } },
10533 { "stgi", { Skip_MODRM } },
10534 { "clgi", { Skip_MODRM } },
10535 { "skinit", { Skip_MODRM } },
10536 { "invlpga", { Skip_MODRM } },
10539 /* RM_0F01_REG_7 */
10540 { "swapgs", { Skip_MODRM } },
10541 { "rdtscp", { Skip_MODRM } },
10544 /* RM_0FAE_REG_5 */
10545 { "lfence", { Skip_MODRM } },
10548 /* RM_0FAE_REG_6 */
10549 { "mfence", { Skip_MODRM } },
10552 /* RM_0FAE_REG_7 */
10553 { "sfence", { Skip_MODRM } },
10557 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
10559 /* We use the high bit to indicate different name for the same
10561 #define ADDR16_PREFIX (0x67 | 0x100)
10562 #define ADDR32_PREFIX (0x67 | 0x200)
10563 #define DATA16_PREFIX (0x66 | 0x100)
10564 #define DATA32_PREFIX (0x66 | 0x200)
10565 #define REP_PREFIX (0xf3 | 0x100)
10566 #define XACQUIRE_PREFIX (0xf2 | 0x200)
10567 #define XRELEASE_PREFIX (0xf3 | 0x400)
10572 int newrex, i, length;
10578 last_lock_prefix = -1;
10579 last_repz_prefix = -1;
10580 last_repnz_prefix = -1;
10581 last_data_prefix = -1;
10582 last_addr_prefix = -1;
10583 last_rex_prefix = -1;
10584 last_seg_prefix = -1;
10585 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
10586 all_prefixes[i] = 0;
10589 /* The maximum instruction length is 15bytes. */
10590 while (length < MAX_CODE_LENGTH - 1)
10592 FETCH_DATA (the_info, codep + 1);
10596 /* REX prefixes family. */
10613 if (address_mode == mode_64bit)
10617 last_rex_prefix = i;
10620 prefixes |= PREFIX_REPZ;
10621 last_repz_prefix = i;
10624 prefixes |= PREFIX_REPNZ;
10625 last_repnz_prefix = i;
10628 prefixes |= PREFIX_LOCK;
10629 last_lock_prefix = i;
10632 prefixes |= PREFIX_CS;
10633 last_seg_prefix = i;
10636 prefixes |= PREFIX_SS;
10637 last_seg_prefix = i;
10640 prefixes |= PREFIX_DS;
10641 last_seg_prefix = i;
10644 prefixes |= PREFIX_ES;
10645 last_seg_prefix = i;
10648 prefixes |= PREFIX_FS;
10649 last_seg_prefix = i;
10652 prefixes |= PREFIX_GS;
10653 last_seg_prefix = i;
10656 prefixes |= PREFIX_DATA;
10657 last_data_prefix = i;
10660 prefixes |= PREFIX_ADDR;
10661 last_addr_prefix = i;
10664 /* fwait is really an instruction. If there are prefixes
10665 before the fwait, they belong to the fwait, *not* to the
10666 following instruction. */
10667 if (prefixes || rex)
10669 prefixes |= PREFIX_FWAIT;
10673 prefixes = PREFIX_FWAIT;
10678 /* Rex is ignored when followed by another prefix. */
10684 if (*codep != FWAIT_OPCODE)
10685 all_prefixes[i++] = *codep;
10694 seg_prefix (int pref)
10715 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
10718 static const char *
10719 prefix_name (int pref, int sizeflag)
10721 static const char *rexes [16] =
10724 "rex.B", /* 0x41 */
10725 "rex.X", /* 0x42 */
10726 "rex.XB", /* 0x43 */
10727 "rex.R", /* 0x44 */
10728 "rex.RB", /* 0x45 */
10729 "rex.RX", /* 0x46 */
10730 "rex.RXB", /* 0x47 */
10731 "rex.W", /* 0x48 */
10732 "rex.WB", /* 0x49 */
10733 "rex.WX", /* 0x4a */
10734 "rex.WXB", /* 0x4b */
10735 "rex.WR", /* 0x4c */
10736 "rex.WRB", /* 0x4d */
10737 "rex.WRX", /* 0x4e */
10738 "rex.WRXB", /* 0x4f */
10743 /* REX prefixes family. */
10760 return rexes [pref - 0x40];
10780 return (sizeflag & DFLAG) ? "data16" : "data32";
10782 if (address_mode == mode_64bit)
10783 return (sizeflag & AFLAG) ? "addr32" : "addr64";
10785 return (sizeflag & AFLAG) ? "addr16" : "addr32";
10788 case ADDR16_PREFIX:
10790 case ADDR32_PREFIX:
10792 case DATA16_PREFIX:
10794 case DATA32_PREFIX:
10798 case XACQUIRE_PREFIX:
10800 case XRELEASE_PREFIX:
10807 static char op_out[MAX_OPERANDS][100];
10808 static int op_ad, op_index[MAX_OPERANDS];
10809 static int two_source_ops;
10810 static bfd_vma op_address[MAX_OPERANDS];
10811 static bfd_vma op_riprel[MAX_OPERANDS];
10812 static bfd_vma start_pc;
10815 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
10816 * (see topic "Redundant prefixes" in the "Differences from 8086"
10817 * section of the "Virtual 8086 Mode" chapter.)
10818 * 'pc' should be the address of this instruction, it will
10819 * be used to print the target address if this is a relative jump or call
10820 * The function returns the length of this instruction in bytes.
10823 static char intel_syntax;
10824 static char intel_mnemonic = !SYSV386_COMPAT;
10825 static char open_char;
10826 static char close_char;
10827 static char separator_char;
10828 static char scale_char;
10830 /* Here for backwards compatibility. When gdb stops using
10831 print_insn_i386_att and print_insn_i386_intel these functions can
10832 disappear, and print_insn_i386 be merged into print_insn. */
10834 print_insn_i386_att (bfd_vma pc, disassemble_info *info)
10838 return print_insn (pc, info);
10842 print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
10846 return print_insn (pc, info);
10850 print_insn_i386 (bfd_vma pc, disassemble_info *info)
10854 return print_insn (pc, info);
10858 print_i386_disassembler_options (FILE *stream)
10860 fprintf (stream, _("\n\
10861 The following i386/x86-64 specific disassembler options are supported for use\n\
10862 with the -M switch (multiple options should be separated by commas):\n"));
10864 fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n"));
10865 fprintf (stream, _(" i386 Disassemble in 32bit mode\n"));
10866 fprintf (stream, _(" i8086 Disassemble in 16bit mode\n"));
10867 fprintf (stream, _(" att Display instruction in AT&T syntax\n"));
10868 fprintf (stream, _(" intel Display instruction in Intel syntax\n"));
10869 fprintf (stream, _(" att-mnemonic\n"
10870 " Display instruction in AT&T mnemonic\n"));
10871 fprintf (stream, _(" intel-mnemonic\n"
10872 " Display instruction in Intel mnemonic\n"));
10873 fprintf (stream, _(" addr64 Assume 64bit address size\n"));
10874 fprintf (stream, _(" addr32 Assume 32bit address size\n"));
10875 fprintf (stream, _(" addr16 Assume 16bit address size\n"));
10876 fprintf (stream, _(" data32 Assume 32bit data size\n"));
10877 fprintf (stream, _(" data16 Assume 16bit data size\n"));
10878 fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n"));
10882 static const struct dis386 bad_opcode = { "(bad)", { XX } };
10884 /* Get a pointer to struct dis386 with a valid name. */
10886 static const struct dis386 *
10887 get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
10889 int vindex, vex_table_index;
10891 if (dp->name != NULL)
10894 switch (dp->op[0].bytemode)
10896 case USE_REG_TABLE:
10897 dp = ®_table[dp->op[1].bytemode][modrm.reg];
10900 case USE_MOD_TABLE:
10901 vindex = modrm.mod == 0x3 ? 1 : 0;
10902 dp = &mod_table[dp->op[1].bytemode][vindex];
10906 dp = &rm_table[dp->op[1].bytemode][modrm.rm];
10909 case USE_PREFIX_TABLE:
10912 /* The prefix in VEX is implicit. */
10913 switch (vex.prefix)
10918 case REPE_PREFIX_OPCODE:
10921 case DATA_PREFIX_OPCODE:
10924 case REPNE_PREFIX_OPCODE:
10935 used_prefixes |= (prefixes & PREFIX_REPZ);
10936 if (prefixes & PREFIX_REPZ)
10939 all_prefixes[last_repz_prefix] = 0;
10943 /* We should check PREFIX_REPNZ and PREFIX_REPZ before
10945 used_prefixes |= (prefixes & PREFIX_REPNZ);
10946 if (prefixes & PREFIX_REPNZ)
10949 all_prefixes[last_repnz_prefix] = 0;
10953 used_prefixes |= (prefixes & PREFIX_DATA);
10954 if (prefixes & PREFIX_DATA)
10957 all_prefixes[last_data_prefix] = 0;
10962 dp = &prefix_table[dp->op[1].bytemode][vindex];
10965 case USE_X86_64_TABLE:
10966 vindex = address_mode == mode_64bit ? 1 : 0;
10967 dp = &x86_64_table[dp->op[1].bytemode][vindex];
10970 case USE_3BYTE_TABLE:
10971 FETCH_DATA (info, codep + 2);
10973 dp = &three_byte_table[dp->op[1].bytemode][vindex];
10974 modrm.mod = (*codep >> 6) & 3;
10975 modrm.reg = (*codep >> 3) & 7;
10976 modrm.rm = *codep & 7;
10979 case USE_VEX_LEN_TABLE:
10983 switch (vex.length)
10996 dp = &vex_len_table[dp->op[1].bytemode][vindex];
10999 case USE_XOP_8F_TABLE:
11000 FETCH_DATA (info, codep + 3);
11001 /* All bits in the REX prefix are ignored. */
11003 rex = ~(*codep >> 5) & 0x7;
11005 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
11006 switch ((*codep & 0x1f))
11012 vex_table_index = XOP_08;
11015 vex_table_index = XOP_09;
11018 vex_table_index = XOP_0A;
11022 vex.w = *codep & 0x80;
11023 if (vex.w && address_mode == mode_64bit)
11026 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11027 if (address_mode != mode_64bit
11028 && vex.register_specifier > 0x7)
11034 vex.length = (*codep & 0x4) ? 256 : 128;
11035 switch ((*codep & 0x3))
11041 vex.prefix = DATA_PREFIX_OPCODE;
11044 vex.prefix = REPE_PREFIX_OPCODE;
11047 vex.prefix = REPNE_PREFIX_OPCODE;
11054 dp = &xop_table[vex_table_index][vindex];
11056 FETCH_DATA (info, codep + 1);
11057 modrm.mod = (*codep >> 6) & 3;
11058 modrm.reg = (*codep >> 3) & 7;
11059 modrm.rm = *codep & 7;
11062 case USE_VEX_C4_TABLE:
11063 FETCH_DATA (info, codep + 3);
11064 /* All bits in the REX prefix are ignored. */
11066 rex = ~(*codep >> 5) & 0x7;
11067 switch ((*codep & 0x1f))
11073 vex_table_index = VEX_0F;
11076 vex_table_index = VEX_0F38;
11079 vex_table_index = VEX_0F3A;
11083 vex.w = *codep & 0x80;
11084 if (vex.w && address_mode == mode_64bit)
11087 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11088 if (address_mode != mode_64bit
11089 && vex.register_specifier > 0x7)
11095 vex.length = (*codep & 0x4) ? 256 : 128;
11096 switch ((*codep & 0x3))
11102 vex.prefix = DATA_PREFIX_OPCODE;
11105 vex.prefix = REPE_PREFIX_OPCODE;
11108 vex.prefix = REPNE_PREFIX_OPCODE;
11115 dp = &vex_table[vex_table_index][vindex];
11116 /* There is no MODRM byte for VEX [82|77]. */
11117 if (vindex != 0x77 && vindex != 0x82)
11119 FETCH_DATA (info, codep + 1);
11120 modrm.mod = (*codep >> 6) & 3;
11121 modrm.reg = (*codep >> 3) & 7;
11122 modrm.rm = *codep & 7;
11126 case USE_VEX_C5_TABLE:
11127 FETCH_DATA (info, codep + 2);
11128 /* All bits in the REX prefix are ignored. */
11130 rex = (*codep & 0x80) ? 0 : REX_R;
11132 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11133 if (address_mode != mode_64bit
11134 && vex.register_specifier > 0x7)
11142 vex.length = (*codep & 0x4) ? 256 : 128;
11143 switch ((*codep & 0x3))
11149 vex.prefix = DATA_PREFIX_OPCODE;
11152 vex.prefix = REPE_PREFIX_OPCODE;
11155 vex.prefix = REPNE_PREFIX_OPCODE;
11162 dp = &vex_table[dp->op[1].bytemode][vindex];
11163 /* There is no MODRM byte for VEX [82|77]. */
11164 if (vindex != 0x77 && vindex != 0x82)
11166 FETCH_DATA (info, codep + 1);
11167 modrm.mod = (*codep >> 6) & 3;
11168 modrm.reg = (*codep >> 3) & 7;
11169 modrm.rm = *codep & 7;
11173 case USE_VEX_W_TABLE:
11177 dp = &vex_w_table[dp->op[1].bytemode][vex.w ? 1 : 0];
11188 if (dp->name != NULL)
11191 return get_valid_dis386 (dp, info);
11195 get_sib (disassemble_info *info)
11197 /* If modrm.mod == 3, operand must be register. */
11199 && address_mode != mode_16bit
11203 FETCH_DATA (info, codep + 2);
11204 sib.index = (codep [1] >> 3) & 7;
11205 sib.scale = (codep [1] >> 6) & 3;
11206 sib.base = codep [1] & 7;
11211 print_insn (bfd_vma pc, disassemble_info *info)
11213 const struct dis386 *dp;
11215 char *op_txt[MAX_OPERANDS];
11219 struct dis_private priv;
11221 int default_prefixes;
11223 priv.orig_sizeflag = AFLAG | DFLAG;
11224 if ((info->mach & bfd_mach_i386_i386) != 0)
11225 address_mode = mode_32bit;
11226 else if (info->mach == bfd_mach_i386_i8086)
11228 address_mode = mode_16bit;
11229 priv.orig_sizeflag = 0;
11232 address_mode = mode_64bit;
11234 if (intel_syntax == (char) -1)
11235 intel_syntax = (info->mach & bfd_mach_i386_intel_syntax) != 0;
11237 for (p = info->disassembler_options; p != NULL; )
11239 if (CONST_STRNEQ (p, "x86-64"))
11241 address_mode = mode_64bit;
11242 priv.orig_sizeflag = AFLAG | DFLAG;
11244 else if (CONST_STRNEQ (p, "i386"))
11246 address_mode = mode_32bit;
11247 priv.orig_sizeflag = AFLAG | DFLAG;
11249 else if (CONST_STRNEQ (p, "i8086"))
11251 address_mode = mode_16bit;
11252 priv.orig_sizeflag = 0;
11254 else if (CONST_STRNEQ (p, "intel"))
11257 if (CONST_STRNEQ (p + 5, "-mnemonic"))
11258 intel_mnemonic = 1;
11260 else if (CONST_STRNEQ (p, "att"))
11263 if (CONST_STRNEQ (p + 3, "-mnemonic"))
11264 intel_mnemonic = 0;
11266 else if (CONST_STRNEQ (p, "addr"))
11268 if (address_mode == mode_64bit)
11270 if (p[4] == '3' && p[5] == '2')
11271 priv.orig_sizeflag &= ~AFLAG;
11272 else if (p[4] == '6' && p[5] == '4')
11273 priv.orig_sizeflag |= AFLAG;
11277 if (p[4] == '1' && p[5] == '6')
11278 priv.orig_sizeflag &= ~AFLAG;
11279 else if (p[4] == '3' && p[5] == '2')
11280 priv.orig_sizeflag |= AFLAG;
11283 else if (CONST_STRNEQ (p, "data"))
11285 if (p[4] == '1' && p[5] == '6')
11286 priv.orig_sizeflag &= ~DFLAG;
11287 else if (p[4] == '3' && p[5] == '2')
11288 priv.orig_sizeflag |= DFLAG;
11290 else if (CONST_STRNEQ (p, "suffix"))
11291 priv.orig_sizeflag |= SUFFIX_ALWAYS;
11293 p = strchr (p, ',');
11300 names64 = intel_names64;
11301 names32 = intel_names32;
11302 names16 = intel_names16;
11303 names8 = intel_names8;
11304 names8rex = intel_names8rex;
11305 names_seg = intel_names_seg;
11306 names_mm = intel_names_mm;
11307 names_xmm = intel_names_xmm;
11308 names_ymm = intel_names_ymm;
11309 index64 = intel_index64;
11310 index32 = intel_index32;
11311 index16 = intel_index16;
11314 separator_char = '+';
11319 names64 = att_names64;
11320 names32 = att_names32;
11321 names16 = att_names16;
11322 names8 = att_names8;
11323 names8rex = att_names8rex;
11324 names_seg = att_names_seg;
11325 names_mm = att_names_mm;
11326 names_xmm = att_names_xmm;
11327 names_ymm = att_names_ymm;
11328 index64 = att_index64;
11329 index32 = att_index32;
11330 index16 = att_index16;
11333 separator_char = ',';
11337 /* The output looks better if we put 7 bytes on a line, since that
11338 puts most long word instructions on a single line. Use 8 bytes
11340 if ((info->mach & bfd_mach_l1om) != 0)
11341 info->bytes_per_line = 8;
11343 info->bytes_per_line = 7;
11345 info->private_data = &priv;
11346 priv.max_fetched = priv.the_buffer;
11347 priv.insn_start = pc;
11350 for (i = 0; i < MAX_OPERANDS; ++i)
11358 start_codep = priv.the_buffer;
11359 codep = priv.the_buffer;
11361 if (setjmp (priv.bailout) != 0)
11365 /* Getting here means we tried for data but didn't get it. That
11366 means we have an incomplete instruction of some sort. Just
11367 print the first byte as a prefix or a .byte pseudo-op. */
11368 if (codep > priv.the_buffer)
11370 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
11372 (*info->fprintf_func) (info->stream, "%s", name);
11375 /* Just print the first byte as a .byte instruction. */
11376 (*info->fprintf_func) (info->stream, ".byte 0x%x",
11377 (unsigned int) priv.the_buffer[0]);
11387 sizeflag = priv.orig_sizeflag;
11389 if (!ckprefix () || rex_used)
11391 /* Too many prefixes or unused REX prefixes. */
11393 i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i];
11395 (*info->fprintf_func) (info->stream, "%s",
11396 prefix_name (all_prefixes[i], sizeflag));
11400 insn_codep = codep;
11402 FETCH_DATA (info, codep + 1);
11403 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
11405 if (((prefixes & PREFIX_FWAIT)
11406 && ((*codep < 0xd8) || (*codep > 0xdf))))
11408 (*info->fprintf_func) (info->stream, "fwait");
11412 if (*codep == 0x0f)
11414 unsigned char threebyte;
11415 FETCH_DATA (info, codep + 2);
11416 threebyte = *++codep;
11417 dp = &dis386_twobyte[threebyte];
11418 need_modrm = twobyte_has_modrm[*codep];
11423 dp = &dis386[*codep];
11424 need_modrm = onebyte_has_modrm[*codep];
11428 if ((prefixes & PREFIX_REPZ))
11429 used_prefixes |= PREFIX_REPZ;
11430 if ((prefixes & PREFIX_REPNZ))
11431 used_prefixes |= PREFIX_REPNZ;
11432 if ((prefixes & PREFIX_LOCK))
11433 used_prefixes |= PREFIX_LOCK;
11435 default_prefixes = 0;
11436 if (prefixes & PREFIX_ADDR)
11439 if (dp->op[2].bytemode != loop_jcxz_mode || intel_syntax)
11441 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
11442 all_prefixes[last_addr_prefix] = ADDR32_PREFIX;
11444 all_prefixes[last_addr_prefix] = ADDR16_PREFIX;
11445 default_prefixes |= PREFIX_ADDR;
11449 if ((prefixes & PREFIX_DATA))
11452 if (dp->op[2].bytemode == cond_jump_mode
11453 && dp->op[0].bytemode == v_mode
11456 if (sizeflag & DFLAG)
11457 all_prefixes[last_data_prefix] = DATA32_PREFIX;
11459 all_prefixes[last_data_prefix] = DATA16_PREFIX;
11460 default_prefixes |= PREFIX_DATA;
11462 else if (rex & REX_W)
11464 /* REX_W will override PREFIX_DATA. */
11465 default_prefixes |= PREFIX_DATA;
11471 FETCH_DATA (info, codep + 1);
11472 modrm.mod = (*codep >> 6) & 3;
11473 modrm.reg = (*codep >> 3) & 7;
11474 modrm.rm = *codep & 7;
11481 if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
11484 dofloat (sizeflag);
11488 dp = get_valid_dis386 (dp, info);
11489 if (dp != NULL && putop (dp->name, sizeflag) == 0)
11492 for (i = 0; i < MAX_OPERANDS; ++i)
11495 op_ad = MAX_OPERANDS - 1 - i;
11497 (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
11502 /* See if any prefixes were not used. If so, print the first one
11503 separately. If we don't do this, we'll wind up printing an
11504 instruction stream which does not precisely correspond to the
11505 bytes we are disassembling. */
11506 if ((prefixes & ~(used_prefixes | default_prefixes)) != 0)
11508 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
11509 if (all_prefixes[i])
11512 name = prefix_name (all_prefixes[i], priv.orig_sizeflag);
11514 name = INTERNAL_DISASSEMBLER_ERROR;
11515 (*info->fprintf_func) (info->stream, "%s", name);
11520 /* Check if the REX prefix is used. */
11521 if (rex_ignored == 0 && (rex ^ rex_used) == 0)
11522 all_prefixes[last_rex_prefix] = 0;
11524 /* Check if the SEG prefix is used. */
11525 if ((prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES
11526 | PREFIX_FS | PREFIX_GS)) != 0
11528 & seg_prefix (all_prefixes[last_seg_prefix])) != 0)
11529 all_prefixes[last_seg_prefix] = 0;
11531 /* Check if the ADDR prefix is used. */
11532 if ((prefixes & PREFIX_ADDR) != 0
11533 && (used_prefixes & PREFIX_ADDR) != 0)
11534 all_prefixes[last_addr_prefix] = 0;
11536 /* Check if the DATA prefix is used. */
11537 if ((prefixes & PREFIX_DATA) != 0
11538 && (used_prefixes & PREFIX_DATA) != 0)
11539 all_prefixes[last_data_prefix] = 0;
11542 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
11543 if (all_prefixes[i])
11546 name = prefix_name (all_prefixes[i], sizeflag);
11549 prefix_length += strlen (name) + 1;
11550 (*info->fprintf_func) (info->stream, "%s ", name);
11553 /* Check maximum code length. */
11554 if ((codep - start_codep) > MAX_CODE_LENGTH)
11556 (*info->fprintf_func) (info->stream, "(bad)");
11557 return MAX_CODE_LENGTH;
11560 obufp = mnemonicendp;
11561 for (i = strlen (obuf) + prefix_length; i < 6; i++)
11564 (*info->fprintf_func) (info->stream, "%s", obuf);
11566 /* The enter and bound instructions are printed with operands in the same
11567 order as the intel book; everything else is printed in reverse order. */
11568 if (intel_syntax || two_source_ops)
11572 for (i = 0; i < MAX_OPERANDS; ++i)
11573 op_txt[i] = op_out[i];
11575 for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
11577 op_ad = op_index[i];
11578 op_index[i] = op_index[MAX_OPERANDS - 1 - i];
11579 op_index[MAX_OPERANDS - 1 - i] = op_ad;
11580 riprel = op_riprel[i];
11581 op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
11582 op_riprel[MAX_OPERANDS - 1 - i] = riprel;
11587 for (i = 0; i < MAX_OPERANDS; ++i)
11588 op_txt[MAX_OPERANDS - 1 - i] = op_out[i];
11592 for (i = 0; i < MAX_OPERANDS; ++i)
11596 (*info->fprintf_func) (info->stream, ",");
11597 if (op_index[i] != -1 && !op_riprel[i])
11598 (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info);
11600 (*info->fprintf_func) (info->stream, "%s", op_txt[i]);
11604 for (i = 0; i < MAX_OPERANDS; i++)
11605 if (op_index[i] != -1 && op_riprel[i])
11607 (*info->fprintf_func) (info->stream, " # ");
11608 (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep
11609 + op_address[op_index[i]]), info);
11612 return codep - priv.the_buffer;
11615 static const char *float_mem[] = {
11690 static const unsigned char float_mem_mode[] = {
11765 #define ST { OP_ST, 0 }
11766 #define STi { OP_STi, 0 }
11768 #define FGRPd9_2 NULL, { { NULL, 0 } }
11769 #define FGRPd9_4 NULL, { { NULL, 1 } }
11770 #define FGRPd9_5 NULL, { { NULL, 2 } }
11771 #define FGRPd9_6 NULL, { { NULL, 3 } }
11772 #define FGRPd9_7 NULL, { { NULL, 4 } }
11773 #define FGRPda_5 NULL, { { NULL, 5 } }
11774 #define FGRPdb_4 NULL, { { NULL, 6 } }
11775 #define FGRPde_3 NULL, { { NULL, 7 } }
11776 #define FGRPdf_4 NULL, { { NULL, 8 } }
11778 static const struct dis386 float_reg[][8] = {
11781 { "fadd", { ST, STi } },
11782 { "fmul", { ST, STi } },
11783 { "fcom", { STi } },
11784 { "fcomp", { STi } },
11785 { "fsub", { ST, STi } },
11786 { "fsubr", { ST, STi } },
11787 { "fdiv", { ST, STi } },
11788 { "fdivr", { ST, STi } },
11792 { "fld", { STi } },
11793 { "fxch", { STi } },
11803 { "fcmovb", { ST, STi } },
11804 { "fcmove", { ST, STi } },
11805 { "fcmovbe",{ ST, STi } },
11806 { "fcmovu", { ST, STi } },
11814 { "fcmovnb",{ ST, STi } },
11815 { "fcmovne",{ ST, STi } },
11816 { "fcmovnbe",{ ST, STi } },
11817 { "fcmovnu",{ ST, STi } },
11819 { "fucomi", { ST, STi } },
11820 { "fcomi", { ST, STi } },
11825 { "fadd", { STi, ST } },
11826 { "fmul", { STi, ST } },
11829 { "fsub!M", { STi, ST } },
11830 { "fsubM", { STi, ST } },
11831 { "fdiv!M", { STi, ST } },
11832 { "fdivM", { STi, ST } },
11836 { "ffree", { STi } },
11838 { "fst", { STi } },
11839 { "fstp", { STi } },
11840 { "fucom", { STi } },
11841 { "fucomp", { STi } },
11847 { "faddp", { STi, ST } },
11848 { "fmulp", { STi, ST } },
11851 { "fsub!Mp", { STi, ST } },
11852 { "fsubMp", { STi, ST } },
11853 { "fdiv!Mp", { STi, ST } },
11854 { "fdivMp", { STi, ST } },
11858 { "ffreep", { STi } },
11863 { "fucomip", { ST, STi } },
11864 { "fcomip", { ST, STi } },
11869 static char *fgrps[][8] = {
11872 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
11877 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
11882 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
11887 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
11892 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
11897 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
11902 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
11903 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
11908 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
11913 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
11918 swap_operand (void)
11920 mnemonicendp[0] = '.';
11921 mnemonicendp[1] = 's';
11926 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
11927 int sizeflag ATTRIBUTE_UNUSED)
11929 /* Skip mod/rm byte. */
11935 dofloat (int sizeflag)
11937 const struct dis386 *dp;
11938 unsigned char floatop;
11940 floatop = codep[-1];
11942 if (modrm.mod != 3)
11944 int fp_indx = (floatop - 0xd8) * 8 + modrm.reg;
11946 putop (float_mem[fp_indx], sizeflag);
11949 OP_E (float_mem_mode[fp_indx], sizeflag);
11952 /* Skip mod/rm byte. */
11956 dp = &float_reg[floatop - 0xd8][modrm.reg];
11957 if (dp->name == NULL)
11959 putop (fgrps[dp->op[0].bytemode][modrm.rm], sizeflag);
11961 /* Instruction fnstsw is only one with strange arg. */
11962 if (floatop == 0xdf && codep[-1] == 0xe0)
11963 strcpy (op_out[0], names16[0]);
11967 putop (dp->name, sizeflag);
11972 (*dp->op[0].rtn) (dp->op[0].bytemode, sizeflag);
11977 (*dp->op[1].rtn) (dp->op[1].bytemode, sizeflag);
11982 OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
11984 oappend ("%st" + intel_syntax);
11988 OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
11990 sprintf (scratchbuf, "%%st(%d)", modrm.rm);
11991 oappend (scratchbuf + intel_syntax);
11994 /* Capital letters in template are macros. */
11996 putop (const char *in_template, int sizeflag)
12001 unsigned int l = 0, len = 1;
12004 #define SAVE_LAST(c) \
12005 if (l < len && l < sizeof (last)) \
12010 for (p = in_template; *p; p++)
12027 while (*++p != '|')
12028 if (*p == '}' || *p == '\0')
12031 /* Fall through. */
12036 while (*++p != '}')
12047 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
12051 if (l == 0 && len == 1)
12056 if (sizeflag & SUFFIX_ALWAYS)
12069 if (address_mode == mode_64bit
12070 && !(prefixes & PREFIX_ADDR))
12081 if (intel_syntax && !alt)
12083 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
12085 if (sizeflag & DFLAG)
12086 *obufp++ = intel_syntax ? 'd' : 'l';
12088 *obufp++ = intel_syntax ? 'w' : 's';
12089 used_prefixes |= (prefixes & PREFIX_DATA);
12093 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
12096 if (modrm.mod == 3)
12102 if (sizeflag & DFLAG)
12103 *obufp++ = intel_syntax ? 'd' : 'l';
12106 used_prefixes |= (prefixes & PREFIX_DATA);
12112 case 'E': /* For jcxz/jecxz */
12113 if (address_mode == mode_64bit)
12115 if (sizeflag & AFLAG)
12121 if (sizeflag & AFLAG)
12123 used_prefixes |= (prefixes & PREFIX_ADDR);
12128 if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))
12130 if (sizeflag & AFLAG)
12131 *obufp++ = address_mode == mode_64bit ? 'q' : 'l';
12133 *obufp++ = address_mode == mode_64bit ? 'l' : 'w';
12134 used_prefixes |= (prefixes & PREFIX_ADDR);
12138 if (intel_syntax || (obufp[-1] != 's' && !(sizeflag & SUFFIX_ALWAYS)))
12140 if ((rex & REX_W) || (sizeflag & DFLAG))
12144 if (!(rex & REX_W))
12145 used_prefixes |= (prefixes & PREFIX_DATA);
12150 if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS
12151 || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)
12153 used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);
12156 if (prefixes & PREFIX_DS)
12177 if (address_mode == mode_64bit && (sizeflag & SUFFIX_ALWAYS))
12182 /* Fall through. */
12185 if (l != 0 || len != 1)
12193 if (sizeflag & SUFFIX_ALWAYS)
12197 if (intel_mnemonic != cond)
12201 if ((prefixes & PREFIX_FWAIT) == 0)
12204 used_prefixes |= PREFIX_FWAIT;
12210 else if (intel_syntax && (sizeflag & DFLAG))
12214 if (!(rex & REX_W))
12215 used_prefixes |= (prefixes & PREFIX_DATA);
12219 && address_mode == mode_64bit
12220 && (sizeflag & DFLAG))
12225 /* Fall through. */
12229 if ((rex & REX_W) == 0
12230 && (prefixes & PREFIX_DATA))
12232 if ((sizeflag & DFLAG) == 0)
12234 used_prefixes |= (prefixes & PREFIX_DATA);
12238 if ((prefixes & PREFIX_DATA)
12240 || (sizeflag & SUFFIX_ALWAYS))
12247 if (sizeflag & DFLAG)
12251 used_prefixes |= (prefixes & PREFIX_DATA);
12258 if (address_mode == mode_64bit && (sizeflag & DFLAG))
12260 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
12264 /* Fall through. */
12267 if (l == 0 && len == 1)
12270 if (intel_syntax && !alt)
12273 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
12279 if (sizeflag & DFLAG)
12280 *obufp++ = intel_syntax ? 'd' : 'l';
12283 used_prefixes |= (prefixes & PREFIX_DATA);
12289 if (l != 1 || len != 2 || last[0] != 'L')
12295 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
12310 else if (sizeflag & DFLAG)
12319 if (intel_syntax && !p[1]
12320 && ((rex & REX_W) || (sizeflag & DFLAG)))
12322 if (!(rex & REX_W))
12323 used_prefixes |= (prefixes & PREFIX_DATA);
12326 if (l == 0 && len == 1)
12330 if (address_mode == mode_64bit && (sizeflag & DFLAG))
12332 if (sizeflag & SUFFIX_ALWAYS)
12354 /* Fall through. */
12357 if (l == 0 && len == 1)
12362 if (sizeflag & SUFFIX_ALWAYS)
12368 if (sizeflag & DFLAG)
12372 used_prefixes |= (prefixes & PREFIX_DATA);
12386 if (address_mode == mode_64bit
12387 && !(prefixes & PREFIX_ADDR))
12398 if (l != 0 || len != 1)
12403 if (need_vex && vex.prefix)
12405 if (vex.prefix == DATA_PREFIX_OPCODE)
12412 if (prefixes & PREFIX_DATA)
12416 used_prefixes |= (prefixes & PREFIX_DATA);
12420 if (l == 0 && len == 1)
12422 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
12433 if (l != 1 || len != 2 || last[0] != 'X')
12441 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
12443 switch (vex.length)
12457 if (l == 0 && len == 1)
12459 /* operand size flag for cwtl, cbtw */
12468 else if (sizeflag & DFLAG)
12472 if (!(rex & REX_W))
12473 used_prefixes |= (prefixes & PREFIX_DATA);
12480 && last[0] != 'L'))
12487 if (last[0] == 'X')
12488 *obufp++ = vex.w ? 'd': 's';
12490 *obufp++ = vex.w ? 'q': 'd';
12497 mnemonicendp = obufp;
12502 oappend (const char *s)
12504 obufp = stpcpy (obufp, s);
12510 if (prefixes & PREFIX_CS)
12512 used_prefixes |= PREFIX_CS;
12513 oappend ("%cs:" + intel_syntax);
12515 if (prefixes & PREFIX_DS)
12517 used_prefixes |= PREFIX_DS;
12518 oappend ("%ds:" + intel_syntax);
12520 if (prefixes & PREFIX_SS)
12522 used_prefixes |= PREFIX_SS;
12523 oappend ("%ss:" + intel_syntax);
12525 if (prefixes & PREFIX_ES)
12527 used_prefixes |= PREFIX_ES;
12528 oappend ("%es:" + intel_syntax);
12530 if (prefixes & PREFIX_FS)
12532 used_prefixes |= PREFIX_FS;
12533 oappend ("%fs:" + intel_syntax);
12535 if (prefixes & PREFIX_GS)
12537 used_prefixes |= PREFIX_GS;
12538 oappend ("%gs:" + intel_syntax);
12543 OP_indirE (int bytemode, int sizeflag)
12547 OP_E (bytemode, sizeflag);
12551 print_operand_value (char *buf, int hex, bfd_vma disp)
12553 if (address_mode == mode_64bit)
12561 sprintf_vma (tmp, disp);
12562 for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
12563 strcpy (buf + 2, tmp + i);
12567 bfd_signed_vma v = disp;
12574 /* Check for possible overflow on 0x8000000000000000. */
12577 strcpy (buf, "9223372036854775808");
12591 tmp[28 - i] = (v % 10) + '0';
12595 strcpy (buf, tmp + 29 - i);
12601 sprintf (buf, "0x%x", (unsigned int) disp);
12603 sprintf (buf, "%d", (int) disp);
12607 /* Put DISP in BUF as signed hex number. */
12610 print_displacement (char *buf, bfd_vma disp)
12612 bfd_signed_vma val = disp;
12621 /* Check for possible overflow. */
12624 switch (address_mode)
12627 strcpy (buf + j, "0x8000000000000000");
12630 strcpy (buf + j, "0x80000000");
12633 strcpy (buf + j, "0x8000");
12643 sprintf_vma (tmp, (bfd_vma) val);
12644 for (i = 0; tmp[i] == '0'; i++)
12646 if (tmp[i] == '\0')
12648 strcpy (buf + j, tmp + i);
12652 intel_operand_size (int bytemode, int sizeflag)
12659 oappend ("BYTE PTR ");
12663 oappend ("WORD PTR ");
12666 if (address_mode == mode_64bit && (sizeflag & DFLAG))
12668 oappend ("QWORD PTR ");
12677 oappend ("QWORD PTR ");
12680 if ((sizeflag & DFLAG) || bytemode == dq_mode)
12681 oappend ("DWORD PTR ");
12683 oappend ("WORD PTR ");
12684 used_prefixes |= (prefixes & PREFIX_DATA);
12688 if ((rex & REX_W) || (sizeflag & DFLAG))
12690 oappend ("WORD PTR ");
12691 if (!(rex & REX_W))
12692 used_prefixes |= (prefixes & PREFIX_DATA);
12695 if (sizeflag & DFLAG)
12696 oappend ("QWORD PTR ");
12698 oappend ("DWORD PTR ");
12699 used_prefixes |= (prefixes & PREFIX_DATA);
12702 case d_scalar_mode:
12703 case d_scalar_swap_mode:
12706 oappend ("DWORD PTR ");
12709 case q_scalar_mode:
12710 case q_scalar_swap_mode:
12712 oappend ("QWORD PTR ");
12715 if (address_mode == mode_64bit)
12716 oappend ("QWORD PTR ");
12718 oappend ("DWORD PTR ");
12721 if (sizeflag & DFLAG)
12722 oappend ("FWORD PTR ");
12724 oappend ("DWORD PTR ");
12725 used_prefixes |= (prefixes & PREFIX_DATA);
12728 oappend ("TBYTE PTR ");
12734 switch (vex.length)
12737 oappend ("XMMWORD PTR ");
12740 oappend ("YMMWORD PTR ");
12747 oappend ("XMMWORD PTR ");
12750 oappend ("XMMWORD PTR ");
12756 switch (vex.length)
12759 oappend ("QWORD PTR ");
12762 oappend ("XMMWORD PTR ");
12772 switch (vex.length)
12776 oappend ("BYTE PTR ");
12786 switch (vex.length)
12790 oappend ("WORD PTR ");
12800 switch (vex.length)
12804 oappend ("DWORD PTR ");
12814 switch (vex.length)
12818 oappend ("QWORD PTR ");
12828 switch (vex.length)
12831 oappend ("WORD PTR ");
12834 oappend ("DWORD PTR ");
12844 switch (vex.length)
12847 oappend ("DWORD PTR ");
12850 oappend ("QWORD PTR ");
12860 switch (vex.length)
12863 oappend ("QWORD PTR ");
12866 oappend ("YMMWORD PTR ");
12876 switch (vex.length)
12880 oappend ("XMMWORD PTR ");
12887 oappend ("OWORD PTR ");
12889 case vex_w_dq_mode:
12890 case vex_scalar_w_dq_mode:
12891 case vex_vsib_d_w_dq_mode:
12892 case vex_vsib_q_w_dq_mode:
12897 oappend ("QWORD PTR ");
12899 oappend ("DWORD PTR ");
12907 OP_E_register (int bytemode, int sizeflag)
12909 int reg = modrm.rm;
12910 const char **names;
12916 if ((sizeflag & SUFFIX_ALWAYS)
12917 && (bytemode == b_swap_mode || bytemode == v_swap_mode))
12940 names = address_mode == mode_64bit ? names64 : names32;
12943 if (address_mode == mode_64bit && (sizeflag & DFLAG))
12961 if ((sizeflag & DFLAG)
12962 || (bytemode != v_mode
12963 && bytemode != v_swap_mode))
12967 used_prefixes |= (prefixes & PREFIX_DATA);
12973 oappend (INTERNAL_DISASSEMBLER_ERROR);
12976 oappend (names[reg]);
12980 OP_E_memory (int bytemode, int sizeflag)
12983 int add = (rex & REX_B) ? 8 : 0;
12988 intel_operand_size (bytemode, sizeflag);
12991 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
12993 /* 32/64 bit address mode */
13002 const char **indexes64 = names64;
13003 const char **indexes32 = names32;
13013 vindex = sib.index;
13019 case vex_vsib_d_w_dq_mode:
13020 case vex_vsib_q_w_dq_mode:
13025 switch (vex.length)
13028 indexes64 = indexes32 = names_xmm;
13031 if (!vex.w || bytemode == vex_vsib_q_w_dq_mode)
13032 indexes64 = indexes32 = names_ymm;
13034 indexes64 = indexes32 = names_xmm;
13041 haveindex = vindex != 4;
13048 rbase = base + add;
13056 if (address_mode == mode_64bit && !havesib)
13062 FETCH_DATA (the_info, codep + 1);
13064 if ((disp & 0x80) != 0)
13072 /* In 32bit mode, we need index register to tell [offset] from
13073 [eiz*1 + offset]. */
13074 needindex = (havesib
13077 && address_mode == mode_32bit);
13078 havedisp = (havebase
13080 || (havesib && (haveindex || scale != 0)));
13083 if (modrm.mod != 0 || base == 5)
13085 if (havedisp || riprel)
13086 print_displacement (scratchbuf, disp);
13088 print_operand_value (scratchbuf, 1, disp);
13089 oappend (scratchbuf);
13093 oappend (sizeflag & AFLAG ? "(%rip)" : "(%eip)");
13097 if (havebase || haveindex || riprel)
13098 used_prefixes |= PREFIX_ADDR;
13100 if (havedisp || (intel_syntax && riprel))
13102 *obufp++ = open_char;
13103 if (intel_syntax && riprel)
13106 oappend (sizeflag & AFLAG ? "rip" : "eip");
13110 oappend (address_mode == mode_64bit && (sizeflag & AFLAG)
13111 ? names64[rbase] : names32[rbase]);
13114 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
13115 print index to tell base + index from base. */
13119 || (havebase && base != ESP_REG_NUM))
13121 if (!intel_syntax || havebase)
13123 *obufp++ = separator_char;
13127 oappend (address_mode == mode_64bit
13128 && (sizeflag & AFLAG)
13129 ? indexes64[vindex] : indexes32[vindex]);
13131 oappend (address_mode == mode_64bit
13132 && (sizeflag & AFLAG)
13133 ? index64 : index32);
13135 *obufp++ = scale_char;
13137 sprintf (scratchbuf, "%d", 1 << scale);
13138 oappend (scratchbuf);
13142 && (disp || modrm.mod != 0 || base == 5))
13144 if (!havedisp || (bfd_signed_vma) disp >= 0)
13149 else if (modrm.mod != 1 && disp != -disp)
13153 disp = - (bfd_signed_vma) disp;
13157 print_displacement (scratchbuf, disp);
13159 print_operand_value (scratchbuf, 1, disp);
13160 oappend (scratchbuf);
13163 *obufp++ = close_char;
13166 else if (intel_syntax)
13168 if (modrm.mod != 0 || base == 5)
13170 if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
13171 | PREFIX_ES | PREFIX_FS | PREFIX_GS))
13175 oappend (names_seg[ds_reg - es_reg]);
13178 print_operand_value (scratchbuf, 1, disp);
13179 oappend (scratchbuf);
13185 /* 16 bit address mode */
13186 used_prefixes |= prefixes & PREFIX_ADDR;
13193 if ((disp & 0x8000) != 0)
13198 FETCH_DATA (the_info, codep + 1);
13200 if ((disp & 0x80) != 0)
13205 if ((disp & 0x8000) != 0)
13211 if (modrm.mod != 0 || modrm.rm == 6)
13213 print_displacement (scratchbuf, disp);
13214 oappend (scratchbuf);
13217 if (modrm.mod != 0 || modrm.rm != 6)
13219 *obufp++ = open_char;
13221 oappend (index16[modrm.rm]);
13223 && (disp || modrm.mod != 0 || modrm.rm == 6))
13225 if ((bfd_signed_vma) disp >= 0)
13230 else if (modrm.mod != 1)
13234 disp = - (bfd_signed_vma) disp;
13237 print_displacement (scratchbuf, disp);
13238 oappend (scratchbuf);
13241 *obufp++ = close_char;
13244 else if (intel_syntax)
13246 if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
13247 | PREFIX_ES | PREFIX_FS | PREFIX_GS))
13251 oappend (names_seg[ds_reg - es_reg]);
13254 print_operand_value (scratchbuf, 1, disp & 0xffff);
13255 oappend (scratchbuf);
13261 OP_E (int bytemode, int sizeflag)
13263 /* Skip mod/rm byte. */
13267 if (modrm.mod == 3)
13268 OP_E_register (bytemode, sizeflag);
13270 OP_E_memory (bytemode, sizeflag);
13274 OP_G (int bytemode, int sizeflag)
13285 oappend (names8rex[modrm.reg + add]);
13287 oappend (names8[modrm.reg + add]);
13290 oappend (names16[modrm.reg + add]);
13293 oappend (names32[modrm.reg + add]);
13296 oappend (names64[modrm.reg + add]);
13305 oappend (names64[modrm.reg + add]);
13308 if ((sizeflag & DFLAG) || bytemode != v_mode)
13309 oappend (names32[modrm.reg + add]);
13311 oappend (names16[modrm.reg + add]);
13312 used_prefixes |= (prefixes & PREFIX_DATA);
13316 if (address_mode == mode_64bit)
13317 oappend (names64[modrm.reg + add]);
13319 oappend (names32[modrm.reg + add]);
13322 oappend (INTERNAL_DISASSEMBLER_ERROR);
13335 FETCH_DATA (the_info, codep + 8);
13336 a = *codep++ & 0xff;
13337 a |= (*codep++ & 0xff) << 8;
13338 a |= (*codep++ & 0xff) << 16;
13339 a |= (*codep++ & 0xff) << 24;
13340 b = *codep++ & 0xff;
13341 b |= (*codep++ & 0xff) << 8;
13342 b |= (*codep++ & 0xff) << 16;
13343 b |= (*codep++ & 0xff) << 24;
13344 x = a + ((bfd_vma) b << 32);
13352 static bfd_signed_vma
13355 bfd_signed_vma x = 0;
13357 FETCH_DATA (the_info, codep + 4);
13358 x = *codep++ & (bfd_signed_vma) 0xff;
13359 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
13360 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
13361 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
13365 static bfd_signed_vma
13368 bfd_signed_vma x = 0;
13370 FETCH_DATA (the_info, codep + 4);
13371 x = *codep++ & (bfd_signed_vma) 0xff;
13372 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
13373 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
13374 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
13376 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
13386 FETCH_DATA (the_info, codep + 2);
13387 x = *codep++ & 0xff;
13388 x |= (*codep++ & 0xff) << 8;
13393 set_op (bfd_vma op, int riprel)
13395 op_index[op_ad] = op_ad;
13396 if (address_mode == mode_64bit)
13398 op_address[op_ad] = op;
13399 op_riprel[op_ad] = riprel;
13403 /* Mask to get a 32-bit address. */
13404 op_address[op_ad] = op & 0xffffffff;
13405 op_riprel[op_ad] = riprel & 0xffffffff;
13410 OP_REG (int code, int sizeflag)
13422 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
13423 case sp_reg: case bp_reg: case si_reg: case di_reg:
13424 s = names16[code - ax_reg + add];
13426 case es_reg: case ss_reg: case cs_reg:
13427 case ds_reg: case fs_reg: case gs_reg:
13428 s = names_seg[code - es_reg + add];
13430 case al_reg: case ah_reg: case cl_reg: case ch_reg:
13431 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
13434 s = names8rex[code - al_reg + add];
13436 s = names8[code - al_reg];
13438 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
13439 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
13440 if (address_mode == mode_64bit && (sizeflag & DFLAG))
13442 s = names64[code - rAX_reg + add];
13445 code += eAX_reg - rAX_reg;
13446 /* Fall through. */
13447 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
13448 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
13451 s = names64[code - eAX_reg + add];
13454 if (sizeflag & DFLAG)
13455 s = names32[code - eAX_reg + add];
13457 s = names16[code - eAX_reg + add];
13458 used_prefixes |= (prefixes & PREFIX_DATA);
13462 s = INTERNAL_DISASSEMBLER_ERROR;
13469 OP_IMREG (int code, int sizeflag)
13481 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
13482 case sp_reg: case bp_reg: case si_reg: case di_reg:
13483 s = names16[code - ax_reg];
13485 case es_reg: case ss_reg: case cs_reg:
13486 case ds_reg: case fs_reg: case gs_reg:
13487 s = names_seg[code - es_reg];
13489 case al_reg: case ah_reg: case cl_reg: case ch_reg:
13490 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
13493 s = names8rex[code - al_reg];
13495 s = names8[code - al_reg];
13497 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
13498 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
13501 s = names64[code - eAX_reg];
13504 if (sizeflag & DFLAG)
13505 s = names32[code - eAX_reg];
13507 s = names16[code - eAX_reg];
13508 used_prefixes |= (prefixes & PREFIX_DATA);
13511 case z_mode_ax_reg:
13512 if ((rex & REX_W) || (sizeflag & DFLAG))
13516 if (!(rex & REX_W))
13517 used_prefixes |= (prefixes & PREFIX_DATA);
13520 s = INTERNAL_DISASSEMBLER_ERROR;
13527 OP_I (int bytemode, int sizeflag)
13530 bfd_signed_vma mask = -1;
13535 FETCH_DATA (the_info, codep + 1);
13540 if (address_mode == mode_64bit)
13545 /* Fall through. */
13552 if (sizeflag & DFLAG)
13562 used_prefixes |= (prefixes & PREFIX_DATA);
13574 oappend (INTERNAL_DISASSEMBLER_ERROR);
13579 scratchbuf[0] = '$';
13580 print_operand_value (scratchbuf + 1, 1, op);
13581 oappend (scratchbuf + intel_syntax);
13582 scratchbuf[0] = '\0';
13586 OP_I64 (int bytemode, int sizeflag)
13589 bfd_signed_vma mask = -1;
13591 if (address_mode != mode_64bit)
13593 OP_I (bytemode, sizeflag);
13600 FETCH_DATA (the_info, codep + 1);
13610 if (sizeflag & DFLAG)
13620 used_prefixes |= (prefixes & PREFIX_DATA);
13628 oappend (INTERNAL_DISASSEMBLER_ERROR);
13633 scratchbuf[0] = '$';
13634 print_operand_value (scratchbuf + 1, 1, op);
13635 oappend (scratchbuf + intel_syntax);
13636 scratchbuf[0] = '\0';
13640 OP_sI (int bytemode, int sizeflag)
13648 FETCH_DATA (the_info, codep + 1);
13650 if ((op & 0x80) != 0)
13652 if (bytemode == b_T_mode)
13654 if (address_mode != mode_64bit
13655 || !(sizeflag & DFLAG))
13657 if (sizeflag & DFLAG)
13665 if (!(rex & REX_W))
13667 if (sizeflag & DFLAG)
13675 if (sizeflag & DFLAG)
13681 oappend (INTERNAL_DISASSEMBLER_ERROR);
13685 scratchbuf[0] = '$';
13686 print_operand_value (scratchbuf + 1, 1, op);
13687 oappend (scratchbuf + intel_syntax);
13691 OP_J (int bytemode, int sizeflag)
13695 bfd_vma segment = 0;
13700 FETCH_DATA (the_info, codep + 1);
13702 if ((disp & 0x80) != 0)
13707 if ((sizeflag & DFLAG) || (rex & REX_W))
13712 if ((disp & 0x8000) != 0)
13714 /* In 16bit mode, address is wrapped around at 64k within
13715 the same segment. Otherwise, a data16 prefix on a jump
13716 instruction means that the pc is masked to 16 bits after
13717 the displacement is added! */
13719 if ((prefixes & PREFIX_DATA) == 0)
13720 segment = ((start_pc + codep - start_codep)
13721 & ~((bfd_vma) 0xffff));
13723 if (!(rex & REX_W))
13724 used_prefixes |= (prefixes & PREFIX_DATA);
13727 oappend (INTERNAL_DISASSEMBLER_ERROR);
13730 disp = ((start_pc + (codep - start_codep) + disp) & mask) | segment;
13732 print_operand_value (scratchbuf, 1, disp);
13733 oappend (scratchbuf);
13737 OP_SEG (int bytemode, int sizeflag)
13739 if (bytemode == w_mode)
13740 oappend (names_seg[modrm.reg]);
13742 OP_E (modrm.mod == 3 ? bytemode : w_mode, sizeflag);
13746 OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
13750 if (sizeflag & DFLAG)
13760 used_prefixes |= (prefixes & PREFIX_DATA);
13762 sprintf (scratchbuf, "0x%x:0x%x", seg, offset);
13764 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
13765 oappend (scratchbuf);
13769 OP_OFF (int bytemode, int sizeflag)
13773 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
13774 intel_operand_size (bytemode, sizeflag);
13777 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
13784 if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
13785 | PREFIX_ES | PREFIX_FS | PREFIX_GS)))
13787 oappend (names_seg[ds_reg - es_reg]);
13791 print_operand_value (scratchbuf, 1, off);
13792 oappend (scratchbuf);
13796 OP_OFF64 (int bytemode, int sizeflag)
13800 if (address_mode != mode_64bit
13801 || (prefixes & PREFIX_ADDR))
13803 OP_OFF (bytemode, sizeflag);
13807 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
13808 intel_operand_size (bytemode, sizeflag);
13815 if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
13816 | PREFIX_ES | PREFIX_FS | PREFIX_GS)))
13818 oappend (names_seg[ds_reg - es_reg]);
13822 print_operand_value (scratchbuf, 1, off);
13823 oappend (scratchbuf);
13827 ptr_reg (int code, int sizeflag)
13831 *obufp++ = open_char;
13832 used_prefixes |= (prefixes & PREFIX_ADDR);
13833 if (address_mode == mode_64bit)
13835 if (!(sizeflag & AFLAG))
13836 s = names32[code - eAX_reg];
13838 s = names64[code - eAX_reg];
13840 else if (sizeflag & AFLAG)
13841 s = names32[code - eAX_reg];
13843 s = names16[code - eAX_reg];
13845 *obufp++ = close_char;
13850 OP_ESreg (int code, int sizeflag)
13856 case 0x6d: /* insw/insl */
13857 intel_operand_size (z_mode, sizeflag);
13859 case 0xa5: /* movsw/movsl/movsq */
13860 case 0xa7: /* cmpsw/cmpsl/cmpsq */
13861 case 0xab: /* stosw/stosl */
13862 case 0xaf: /* scasw/scasl */
13863 intel_operand_size (v_mode, sizeflag);
13866 intel_operand_size (b_mode, sizeflag);
13869 oappend ("%es:" + intel_syntax);
13870 ptr_reg (code, sizeflag);
13874 OP_DSreg (int code, int sizeflag)
13880 case 0x6f: /* outsw/outsl */
13881 intel_operand_size (z_mode, sizeflag);
13883 case 0xa5: /* movsw/movsl/movsq */
13884 case 0xa7: /* cmpsw/cmpsl/cmpsq */
13885 case 0xad: /* lodsw/lodsl/lodsq */
13886 intel_operand_size (v_mode, sizeflag);
13889 intel_operand_size (b_mode, sizeflag);
13898 | PREFIX_GS)) == 0)
13899 prefixes |= PREFIX_DS;
13901 ptr_reg (code, sizeflag);
13905 OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
13913 else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
13915 all_prefixes[last_lock_prefix] = 0;
13916 used_prefixes |= PREFIX_LOCK;
13921 sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
13922 oappend (scratchbuf + intel_syntax);
13926 OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
13935 sprintf (scratchbuf, "db%d", modrm.reg + add);
13937 sprintf (scratchbuf, "%%db%d", modrm.reg + add);
13938 oappend (scratchbuf);
13942 OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
13944 sprintf (scratchbuf, "%%tr%d", modrm.reg);
13945 oappend (scratchbuf + intel_syntax);
13949 OP_R (int bytemode, int sizeflag)
13951 if (modrm.mod == 3)
13952 OP_E (bytemode, sizeflag);
13958 OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
13960 int reg = modrm.reg;
13961 const char **names;
13963 used_prefixes |= (prefixes & PREFIX_DATA);
13964 if (prefixes & PREFIX_DATA)
13973 oappend (names[reg]);
13977 OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
13979 int reg = modrm.reg;
13980 const char **names;
13986 && bytemode != xmm_mode
13987 && bytemode != scalar_mode)
13989 switch (vex.length)
13995 if (vex.w || bytemode != vex_vsib_q_w_dq_mode)
14006 oappend (names[reg]);
14010 OP_EM (int bytemode, int sizeflag)
14013 const char **names;
14015 if (modrm.mod != 3)
14018 && (bytemode == v_mode || bytemode == v_swap_mode))
14020 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
14021 used_prefixes |= (prefixes & PREFIX_DATA);
14023 OP_E (bytemode, sizeflag);
14027 if ((sizeflag & SUFFIX_ALWAYS) && bytemode == v_swap_mode)
14030 /* Skip mod/rm byte. */
14033 used_prefixes |= (prefixes & PREFIX_DATA);
14035 if (prefixes & PREFIX_DATA)
14044 oappend (names[reg]);
14047 /* cvt* are the only instructions in sse2 which have
14048 both SSE and MMX operands and also have 0x66 prefix
14049 in their opcode. 0x66 was originally used to differentiate
14050 between SSE and MMX instruction(operands). So we have to handle the
14051 cvt* separately using OP_EMC and OP_MXC */
14053 OP_EMC (int bytemode, int sizeflag)
14055 if (modrm.mod != 3)
14057 if (intel_syntax && bytemode == v_mode)
14059 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
14060 used_prefixes |= (prefixes & PREFIX_DATA);
14062 OP_E (bytemode, sizeflag);
14066 /* Skip mod/rm byte. */
14069 used_prefixes |= (prefixes & PREFIX_DATA);
14070 oappend (names_mm[modrm.rm]);
14074 OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14076 used_prefixes |= (prefixes & PREFIX_DATA);
14077 oappend (names_mm[modrm.reg]);
14081 OP_EX (int bytemode, int sizeflag)
14084 const char **names;
14086 /* Skip mod/rm byte. */
14090 if (modrm.mod != 3)
14092 OP_E_memory (bytemode, sizeflag);
14101 if ((sizeflag & SUFFIX_ALWAYS)
14102 && (bytemode == x_swap_mode
14103 || bytemode == d_swap_mode
14104 || bytemode == d_scalar_swap_mode
14105 || bytemode == q_swap_mode
14106 || bytemode == q_scalar_swap_mode))
14110 && bytemode != xmm_mode
14111 && bytemode != xmmdw_mode
14112 && bytemode != xmmqd_mode
14113 && bytemode != xmm_mb_mode
14114 && bytemode != xmm_mw_mode
14115 && bytemode != xmm_md_mode
14116 && bytemode != xmm_mq_mode
14117 && bytemode != xmmq_mode
14118 && bytemode != d_scalar_mode
14119 && bytemode != d_scalar_swap_mode
14120 && bytemode != q_scalar_mode
14121 && bytemode != q_scalar_swap_mode
14122 && bytemode != vex_scalar_w_dq_mode)
14124 switch (vex.length)
14138 oappend (names[reg]);
14142 OP_MS (int bytemode, int sizeflag)
14144 if (modrm.mod == 3)
14145 OP_EM (bytemode, sizeflag);
14151 OP_XS (int bytemode, int sizeflag)
14153 if (modrm.mod == 3)
14154 OP_EX (bytemode, sizeflag);
14160 OP_M (int bytemode, int sizeflag)
14162 if (modrm.mod == 3)
14163 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
14166 OP_E (bytemode, sizeflag);
14170 OP_0f07 (int bytemode, int sizeflag)
14172 if (modrm.mod != 3 || modrm.rm != 0)
14175 OP_E (bytemode, sizeflag);
14178 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
14179 32bit mode and "xchg %rax,%rax" in 64bit mode. */
14182 NOP_Fixup1 (int bytemode, int sizeflag)
14184 if ((prefixes & PREFIX_DATA) != 0
14187 && address_mode == mode_64bit))
14188 OP_REG (bytemode, sizeflag);
14190 strcpy (obuf, "nop");
14194 NOP_Fixup2 (int bytemode, int sizeflag)
14196 if ((prefixes & PREFIX_DATA) != 0
14199 && address_mode == mode_64bit))
14200 OP_IMREG (bytemode, sizeflag);
14203 static const char *const Suffix3DNow[] = {
14204 /* 00 */ NULL, NULL, NULL, NULL,
14205 /* 04 */ NULL, NULL, NULL, NULL,
14206 /* 08 */ NULL, NULL, NULL, NULL,
14207 /* 0C */ "pi2fw", "pi2fd", NULL, NULL,
14208 /* 10 */ NULL, NULL, NULL, NULL,
14209 /* 14 */ NULL, NULL, NULL, NULL,
14210 /* 18 */ NULL, NULL, NULL, NULL,
14211 /* 1C */ "pf2iw", "pf2id", NULL, NULL,
14212 /* 20 */ NULL, NULL, NULL, NULL,
14213 /* 24 */ NULL, NULL, NULL, NULL,
14214 /* 28 */ NULL, NULL, NULL, NULL,
14215 /* 2C */ NULL, NULL, NULL, NULL,
14216 /* 30 */ NULL, NULL, NULL, NULL,
14217 /* 34 */ NULL, NULL, NULL, NULL,
14218 /* 38 */ NULL, NULL, NULL, NULL,
14219 /* 3C */ NULL, NULL, NULL, NULL,
14220 /* 40 */ NULL, NULL, NULL, NULL,
14221 /* 44 */ NULL, NULL, NULL, NULL,
14222 /* 48 */ NULL, NULL, NULL, NULL,
14223 /* 4C */ NULL, NULL, NULL, NULL,
14224 /* 50 */ NULL, NULL, NULL, NULL,
14225 /* 54 */ NULL, NULL, NULL, NULL,
14226 /* 58 */ NULL, NULL, NULL, NULL,
14227 /* 5C */ NULL, NULL, NULL, NULL,
14228 /* 60 */ NULL, NULL, NULL, NULL,
14229 /* 64 */ NULL, NULL, NULL, NULL,
14230 /* 68 */ NULL, NULL, NULL, NULL,
14231 /* 6C */ NULL, NULL, NULL, NULL,
14232 /* 70 */ NULL, NULL, NULL, NULL,
14233 /* 74 */ NULL, NULL, NULL, NULL,
14234 /* 78 */ NULL, NULL, NULL, NULL,
14235 /* 7C */ NULL, NULL, NULL, NULL,
14236 /* 80 */ NULL, NULL, NULL, NULL,
14237 /* 84 */ NULL, NULL, NULL, NULL,
14238 /* 88 */ NULL, NULL, "pfnacc", NULL,
14239 /* 8C */ NULL, NULL, "pfpnacc", NULL,
14240 /* 90 */ "pfcmpge", NULL, NULL, NULL,
14241 /* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",
14242 /* 98 */ NULL, NULL, "pfsub", NULL,
14243 /* 9C */ NULL, NULL, "pfadd", NULL,
14244 /* A0 */ "pfcmpgt", NULL, NULL, NULL,
14245 /* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",
14246 /* A8 */ NULL, NULL, "pfsubr", NULL,
14247 /* AC */ NULL, NULL, "pfacc", NULL,
14248 /* B0 */ "pfcmpeq", NULL, NULL, NULL,
14249 /* B4 */ "pfmul", NULL, "pfrcpit2", "pmulhrw",
14250 /* B8 */ NULL, NULL, NULL, "pswapd",
14251 /* BC */ NULL, NULL, NULL, "pavgusb",
14252 /* C0 */ NULL, NULL, NULL, NULL,
14253 /* C4 */ NULL, NULL, NULL, NULL,
14254 /* C8 */ NULL, NULL, NULL, NULL,
14255 /* CC */ NULL, NULL, NULL, NULL,
14256 /* D0 */ NULL, NULL, NULL, NULL,
14257 /* D4 */ NULL, NULL, NULL, NULL,
14258 /* D8 */ NULL, NULL, NULL, NULL,
14259 /* DC */ NULL, NULL, NULL, NULL,
14260 /* E0 */ NULL, NULL, NULL, NULL,
14261 /* E4 */ NULL, NULL, NULL, NULL,
14262 /* E8 */ NULL, NULL, NULL, NULL,
14263 /* EC */ NULL, NULL, NULL, NULL,
14264 /* F0 */ NULL, NULL, NULL, NULL,
14265 /* F4 */ NULL, NULL, NULL, NULL,
14266 /* F8 */ NULL, NULL, NULL, NULL,
14267 /* FC */ NULL, NULL, NULL, NULL,
14271 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14273 const char *mnemonic;
14275 FETCH_DATA (the_info, codep + 1);
14276 /* AMD 3DNow! instructions are specified by an opcode suffix in the
14277 place where an 8-bit immediate would normally go. ie. the last
14278 byte of the instruction. */
14279 obufp = mnemonicendp;
14280 mnemonic = Suffix3DNow[*codep++ & 0xff];
14282 oappend (mnemonic);
14285 /* Since a variable sized modrm/sib chunk is between the start
14286 of the opcode (0x0f0f) and the opcode suffix, we need to do
14287 all the modrm processing first, and don't know until now that
14288 we have a bad opcode. This necessitates some cleaning up. */
14289 op_out[0][0] = '\0';
14290 op_out[1][0] = '\0';
14293 mnemonicendp = obufp;
14296 static struct op simd_cmp_op[] =
14298 { STRING_COMMA_LEN ("eq") },
14299 { STRING_COMMA_LEN ("lt") },
14300 { STRING_COMMA_LEN ("le") },
14301 { STRING_COMMA_LEN ("unord") },
14302 { STRING_COMMA_LEN ("neq") },
14303 { STRING_COMMA_LEN ("nlt") },
14304 { STRING_COMMA_LEN ("nle") },
14305 { STRING_COMMA_LEN ("ord") }
14309 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14311 unsigned int cmp_type;
14313 FETCH_DATA (the_info, codep + 1);
14314 cmp_type = *codep++ & 0xff;
14315 if (cmp_type < ARRAY_SIZE (simd_cmp_op))
14318 char *p = mnemonicendp - 2;
14322 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
14323 mnemonicendp += simd_cmp_op[cmp_type].len;
14327 /* We have a reserved extension byte. Output it directly. */
14328 scratchbuf[0] = '$';
14329 print_operand_value (scratchbuf + 1, 1, cmp_type);
14330 oappend (scratchbuf + intel_syntax);
14331 scratchbuf[0] = '\0';
14336 OP_Mwait (int bytemode ATTRIBUTE_UNUSED,
14337 int sizeflag ATTRIBUTE_UNUSED)
14339 /* mwait %eax,%ecx */
14342 const char **names = (address_mode == mode_64bit
14343 ? names64 : names32);
14344 strcpy (op_out[0], names[0]);
14345 strcpy (op_out[1], names[1]);
14346 two_source_ops = 1;
14348 /* Skip mod/rm byte. */
14354 OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
14355 int sizeflag ATTRIBUTE_UNUSED)
14357 /* monitor %eax,%ecx,%edx" */
14360 const char **op1_names;
14361 const char **names = (address_mode == mode_64bit
14362 ? names64 : names32);
14364 if (!(prefixes & PREFIX_ADDR))
14365 op1_names = (address_mode == mode_16bit
14366 ? names16 : names);
14369 /* Remove "addr16/addr32". */
14370 all_prefixes[last_addr_prefix] = 0;
14371 op1_names = (address_mode != mode_32bit
14372 ? names32 : names16);
14373 used_prefixes |= PREFIX_ADDR;
14375 strcpy (op_out[0], op1_names[0]);
14376 strcpy (op_out[1], names[1]);
14377 strcpy (op_out[2], names[2]);
14378 two_source_ops = 1;
14380 /* Skip mod/rm byte. */
14388 /* Throw away prefixes and 1st. opcode byte. */
14389 codep = insn_codep + 1;
14394 REP_Fixup (int bytemode, int sizeflag)
14396 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
14398 if (prefixes & PREFIX_REPZ)
14399 all_prefixes[last_repz_prefix] = REP_PREFIX;
14406 OP_IMREG (bytemode, sizeflag);
14409 OP_ESreg (bytemode, sizeflag);
14412 OP_DSreg (bytemode, sizeflag);
14420 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
14421 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
14425 HLE_Fixup1 (int bytemode, int sizeflag)
14428 && (prefixes & PREFIX_LOCK) != 0)
14430 if (prefixes & PREFIX_REPZ)
14431 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
14432 if (prefixes & PREFIX_REPNZ)
14433 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
14436 OP_E (bytemode, sizeflag);
14439 /* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
14440 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
14444 HLE_Fixup2 (int bytemode, int sizeflag)
14446 if (modrm.mod != 3)
14448 if (prefixes & PREFIX_REPZ)
14449 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
14450 if (prefixes & PREFIX_REPNZ)
14451 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
14454 OP_E (bytemode, sizeflag);
14457 /* Similar to OP_E. But the 0xf3 prefixes should be displayed as
14458 "xrelease" for memory operand. No check for LOCK prefix. */
14461 HLE_Fixup3 (int bytemode, int sizeflag)
14464 && last_repz_prefix > last_repnz_prefix
14465 && (prefixes & PREFIX_REPZ) != 0)
14466 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
14468 OP_E (bytemode, sizeflag);
14472 CMPXCHG8B_Fixup (int bytemode, int sizeflag)
14477 /* Change cmpxchg8b to cmpxchg16b. */
14478 char *p = mnemonicendp - 2;
14479 mnemonicendp = stpcpy (p, "16b");
14482 else if ((prefixes & PREFIX_LOCK) != 0)
14484 if (prefixes & PREFIX_REPZ)
14485 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
14486 if (prefixes & PREFIX_REPNZ)
14487 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
14490 OP_M (bytemode, sizeflag);
14494 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
14496 const char **names;
14500 switch (vex.length)
14514 oappend (names[reg]);
14518 CRC32_Fixup (int bytemode, int sizeflag)
14520 /* Add proper suffix to "crc32". */
14521 char *p = mnemonicendp;
14540 if (sizeflag & DFLAG)
14544 used_prefixes |= (prefixes & PREFIX_DATA);
14548 oappend (INTERNAL_DISASSEMBLER_ERROR);
14555 if (modrm.mod == 3)
14559 /* Skip mod/rm byte. */
14564 add = (rex & REX_B) ? 8 : 0;
14565 if (bytemode == b_mode)
14569 oappend (names8rex[modrm.rm + add]);
14571 oappend (names8[modrm.rm + add]);
14577 oappend (names64[modrm.rm + add]);
14578 else if ((prefixes & PREFIX_DATA))
14579 oappend (names16[modrm.rm + add]);
14581 oappend (names32[modrm.rm + add]);
14585 OP_E (bytemode, sizeflag);
14589 FXSAVE_Fixup (int bytemode, int sizeflag)
14591 /* Add proper suffix to "fxsave" and "fxrstor". */
14595 char *p = mnemonicendp;
14601 OP_M (bytemode, sizeflag);
14604 /* Display the destination register operand for instructions with
14608 OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
14611 const char **names;
14619 reg = vex.register_specifier;
14620 if (bytemode == vex_scalar_mode)
14622 oappend (names_xmm[reg]);
14626 switch (vex.length)
14633 case vex_vsib_q_w_dq_mode:
14654 case vex_vsib_q_w_dq_mode:
14655 names = vex.w ? names_ymm : names_xmm;
14666 oappend (names[reg]);
14669 /* Get the VEX immediate byte without moving codep. */
14671 static unsigned char
14672 get_vex_imm8 (int sizeflag, int opnum)
14674 int bytes_before_imm = 0;
14676 if (modrm.mod != 3)
14678 /* There are SIB/displacement bytes. */
14679 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
14681 /* 32/64 bit address mode */
14682 int base = modrm.rm;
14684 /* Check SIB byte. */
14687 FETCH_DATA (the_info, codep + 1);
14689 /* When decoding the third source, don't increase
14690 bytes_before_imm as this has already been incremented
14691 by one in OP_E_memory while decoding the second
14694 bytes_before_imm++;
14697 /* Don't increase bytes_before_imm when decoding the third source,
14698 it has already been incremented by OP_E_memory while decoding
14699 the second source operand. */
14705 /* When modrm.rm == 5 or modrm.rm == 4 and base in
14706 SIB == 5, there is a 4 byte displacement. */
14708 /* No displacement. */
14711 /* 4 byte displacement. */
14712 bytes_before_imm += 4;
14715 /* 1 byte displacement. */
14716 bytes_before_imm++;
14723 /* 16 bit address mode */
14724 /* Don't increase bytes_before_imm when decoding the third source,
14725 it has already been incremented by OP_E_memory while decoding
14726 the second source operand. */
14732 /* When modrm.rm == 6, there is a 2 byte displacement. */
14734 /* No displacement. */
14737 /* 2 byte displacement. */
14738 bytes_before_imm += 2;
14741 /* 1 byte displacement: when decoding the third source,
14742 don't increase bytes_before_imm as this has already
14743 been incremented by one in OP_E_memory while decoding
14744 the second source operand. */
14746 bytes_before_imm++;
14754 FETCH_DATA (the_info, codep + bytes_before_imm + 1);
14755 return codep [bytes_before_imm];
14759 OP_EX_VexReg (int bytemode, int sizeflag, int reg)
14761 const char **names;
14763 if (reg == -1 && modrm.mod != 3)
14765 OP_E_memory (bytemode, sizeflag);
14777 else if (reg > 7 && address_mode != mode_64bit)
14781 switch (vex.length)
14792 oappend (names[reg]);
14796 OP_EX_VexImmW (int bytemode, int sizeflag)
14799 static unsigned char vex_imm8;
14801 if (vex_w_done == 0)
14805 /* Skip mod/rm byte. */
14809 vex_imm8 = get_vex_imm8 (sizeflag, 0);
14812 reg = vex_imm8 >> 4;
14814 OP_EX_VexReg (bytemode, sizeflag, reg);
14816 else if (vex_w_done == 1)
14821 reg = vex_imm8 >> 4;
14823 OP_EX_VexReg (bytemode, sizeflag, reg);
14827 /* Output the imm8 directly. */
14828 scratchbuf[0] = '$';
14829 print_operand_value (scratchbuf + 1, 1, vex_imm8 & 0xf);
14830 oappend (scratchbuf + intel_syntax);
14831 scratchbuf[0] = '\0';
14837 OP_Vex_2src (int bytemode, int sizeflag)
14839 if (modrm.mod == 3)
14841 int reg = modrm.rm;
14845 oappend (names_xmm[reg]);
14850 && (bytemode == v_mode || bytemode == v_swap_mode))
14852 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
14853 used_prefixes |= (prefixes & PREFIX_DATA);
14855 OP_E (bytemode, sizeflag);
14860 OP_Vex_2src_1 (int bytemode, int sizeflag)
14862 if (modrm.mod == 3)
14864 /* Skip mod/rm byte. */
14870 oappend (names_xmm[vex.register_specifier]);
14872 OP_Vex_2src (bytemode, sizeflag);
14876 OP_Vex_2src_2 (int bytemode, int sizeflag)
14879 OP_Vex_2src (bytemode, sizeflag);
14881 oappend (names_xmm[vex.register_specifier]);
14885 OP_EX_VexW (int bytemode, int sizeflag)
14893 /* Skip mod/rm byte. */
14898 reg = get_vex_imm8 (sizeflag, 0) >> 4;
14903 reg = get_vex_imm8 (sizeflag, 1) >> 4;
14906 OP_EX_VexReg (bytemode, sizeflag, reg);
14910 VEXI4_Fixup (int bytemode ATTRIBUTE_UNUSED,
14911 int sizeflag ATTRIBUTE_UNUSED)
14913 /* Skip the immediate byte and check for invalid bits. */
14914 FETCH_DATA (the_info, codep + 1);
14915 if (*codep++ & 0xf)
14920 OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
14923 const char **names;
14925 FETCH_DATA (the_info, codep + 1);
14928 if (bytemode != x_mode)
14935 if (reg > 7 && address_mode != mode_64bit)
14938 switch (vex.length)
14949 oappend (names[reg]);
14953 OP_XMM_VexW (int bytemode, int sizeflag)
14955 /* Turn off the REX.W bit since it is used for swapping operands
14958 OP_XMM (bytemode, sizeflag);
14962 OP_EX_Vex (int bytemode, int sizeflag)
14964 if (modrm.mod != 3)
14966 if (vex.register_specifier != 0)
14970 OP_EX (bytemode, sizeflag);
14974 OP_XMM_Vex (int bytemode, int sizeflag)
14976 if (modrm.mod != 3)
14978 if (vex.register_specifier != 0)
14982 OP_XMM (bytemode, sizeflag);
14986 VZERO_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14988 switch (vex.length)
14991 mnemonicendp = stpcpy (obuf, "vzeroupper");
14994 mnemonicendp = stpcpy (obuf, "vzeroall");
15001 static struct op vex_cmp_op[] =
15003 { STRING_COMMA_LEN ("eq") },
15004 { STRING_COMMA_LEN ("lt") },
15005 { STRING_COMMA_LEN ("le") },
15006 { STRING_COMMA_LEN ("unord") },
15007 { STRING_COMMA_LEN ("neq") },
15008 { STRING_COMMA_LEN ("nlt") },
15009 { STRING_COMMA_LEN ("nle") },
15010 { STRING_COMMA_LEN ("ord") },
15011 { STRING_COMMA_LEN ("eq_uq") },
15012 { STRING_COMMA_LEN ("nge") },
15013 { STRING_COMMA_LEN ("ngt") },
15014 { STRING_COMMA_LEN ("false") },
15015 { STRING_COMMA_LEN ("neq_oq") },
15016 { STRING_COMMA_LEN ("ge") },
15017 { STRING_COMMA_LEN ("gt") },
15018 { STRING_COMMA_LEN ("true") },
15019 { STRING_COMMA_LEN ("eq_os") },
15020 { STRING_COMMA_LEN ("lt_oq") },
15021 { STRING_COMMA_LEN ("le_oq") },
15022 { STRING_COMMA_LEN ("unord_s") },
15023 { STRING_COMMA_LEN ("neq_us") },
15024 { STRING_COMMA_LEN ("nlt_uq") },
15025 { STRING_COMMA_LEN ("nle_uq") },
15026 { STRING_COMMA_LEN ("ord_s") },
15027 { STRING_COMMA_LEN ("eq_us") },
15028 { STRING_COMMA_LEN ("nge_uq") },
15029 { STRING_COMMA_LEN ("ngt_uq") },
15030 { STRING_COMMA_LEN ("false_os") },
15031 { STRING_COMMA_LEN ("neq_os") },
15032 { STRING_COMMA_LEN ("ge_oq") },
15033 { STRING_COMMA_LEN ("gt_oq") },
15034 { STRING_COMMA_LEN ("true_us") },
15038 VCMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15040 unsigned int cmp_type;
15042 FETCH_DATA (the_info, codep + 1);
15043 cmp_type = *codep++ & 0xff;
15044 if (cmp_type < ARRAY_SIZE (vex_cmp_op))
15047 char *p = mnemonicendp - 2;
15051 sprintf (p, "%s%s", vex_cmp_op[cmp_type].name, suffix);
15052 mnemonicendp += vex_cmp_op[cmp_type].len;
15056 /* We have a reserved extension byte. Output it directly. */
15057 scratchbuf[0] = '$';
15058 print_operand_value (scratchbuf + 1, 1, cmp_type);
15059 oappend (scratchbuf + intel_syntax);
15060 scratchbuf[0] = '\0';
15064 static const struct op pclmul_op[] =
15066 { STRING_COMMA_LEN ("lql") },
15067 { STRING_COMMA_LEN ("hql") },
15068 { STRING_COMMA_LEN ("lqh") },
15069 { STRING_COMMA_LEN ("hqh") }
15073 PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
15074 int sizeflag ATTRIBUTE_UNUSED)
15076 unsigned int pclmul_type;
15078 FETCH_DATA (the_info, codep + 1);
15079 pclmul_type = *codep++ & 0xff;
15080 switch (pclmul_type)
15091 if (pclmul_type < ARRAY_SIZE (pclmul_op))
15094 char *p = mnemonicendp - 3;
15099 sprintf (p, "%s%s", pclmul_op[pclmul_type].name, suffix);
15100 mnemonicendp += pclmul_op[pclmul_type].len;
15104 /* We have a reserved extension byte. Output it directly. */
15105 scratchbuf[0] = '$';
15106 print_operand_value (scratchbuf + 1, 1, pclmul_type);
15107 oappend (scratchbuf + intel_syntax);
15108 scratchbuf[0] = '\0';
15113 MOVBE_Fixup (int bytemode, int sizeflag)
15115 /* Add proper suffix to "movbe". */
15116 char *p = mnemonicendp;
15125 if (sizeflag & SUFFIX_ALWAYS)
15131 if (sizeflag & DFLAG)
15135 used_prefixes |= (prefixes & PREFIX_DATA);
15140 oappend (INTERNAL_DISASSEMBLER_ERROR);
15147 OP_M (bytemode, sizeflag);
15151 OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15154 const char **names;
15156 /* Skip mod/rm byte. */
15170 oappend (names[reg]);
15174 OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15176 const char **names;
15183 oappend (names[vex.register_specifier]);