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 CMPXCHG8B_Fixup (int, int);
112 static void XMM_Fixup (int, int);
113 static void CRC32_Fixup (int, int);
114 static void FXSAVE_Fixup (int, int);
115 static void OP_LWPCB_E (int, int);
116 static void OP_LWP_E (int, int);
117 static void OP_Vex_2src_1 (int, int);
118 static void OP_Vex_2src_2 (int, int);
120 static void MOVBE_Fixup (int, int);
123 /* Points to first byte not fetched. */
124 bfd_byte *max_fetched;
125 bfd_byte the_buffer[MAX_MNEM_SIZE];
138 enum address_mode address_mode;
140 /* Flags for the prefixes for the current instruction. See below. */
143 /* REX prefix the current instruction. See below. */
145 /* Bits of REX we've already used. */
147 /* REX bits in original REX prefix ignored. */
148 static int rex_ignored;
149 /* Mark parts used in the REX prefix. When we are testing for
150 empty prefix (for 8bit register REX extension), just mask it
151 out. Otherwise test for REX bit is excuse for existence of REX
152 only in case value is nonzero. */
153 #define USED_REX(value) \
158 rex_used |= (value) | REX_OPCODE; \
161 rex_used |= REX_OPCODE; \
164 /* Flags for prefixes which we somehow handled when printing the
165 current instruction. */
166 static int used_prefixes;
168 /* Flags stored in PREFIXES. */
169 #define PREFIX_REPZ 1
170 #define PREFIX_REPNZ 2
171 #define PREFIX_LOCK 4
173 #define PREFIX_SS 0x10
174 #define PREFIX_DS 0x20
175 #define PREFIX_ES 0x40
176 #define PREFIX_FS 0x80
177 #define PREFIX_GS 0x100
178 #define PREFIX_DATA 0x200
179 #define PREFIX_ADDR 0x400
180 #define PREFIX_FWAIT 0x800
182 /* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
183 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
185 #define FETCH_DATA(info, addr) \
186 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
187 ? 1 : fetch_data ((info), (addr)))
190 fetch_data (struct disassemble_info *info, bfd_byte *addr)
193 struct dis_private *priv = (struct dis_private *) info->private_data;
194 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
196 if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
197 status = (*info->read_memory_func) (start,
199 addr - priv->max_fetched,
205 /* If we did manage to read at least one byte, then
206 print_insn_i386 will do something sensible. Otherwise, print
207 an error. We do that here because this is where we know
209 if (priv->max_fetched == priv->the_buffer)
210 (*info->memory_error_func) (status, start, info);
211 longjmp (priv->bailout, 1);
214 priv->max_fetched = addr;
218 #define XX { NULL, 0 }
219 #define Bad_Opcode NULL, { { NULL, 0 } }
221 #define Eb { OP_E, b_mode }
222 #define EbS { OP_E, b_swap_mode }
223 #define Ev { OP_E, v_mode }
224 #define EvS { OP_E, v_swap_mode }
225 #define Ed { OP_E, d_mode }
226 #define Edq { OP_E, dq_mode }
227 #define Edqw { OP_E, dqw_mode }
228 #define Edqb { OP_E, dqb_mode }
229 #define Edqd { OP_E, dqd_mode }
230 #define Eq { OP_E, q_mode }
231 #define indirEv { OP_indirE, stack_v_mode }
232 #define indirEp { OP_indirE, f_mode }
233 #define stackEv { OP_E, stack_v_mode }
234 #define Em { OP_E, m_mode }
235 #define Ew { OP_E, w_mode }
236 #define M { OP_M, 0 } /* lea, lgdt, etc. */
237 #define Ma { OP_M, a_mode }
238 #define Mb { OP_M, b_mode }
239 #define Md { OP_M, d_mode }
240 #define Mo { OP_M, o_mode }
241 #define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
242 #define Mq { OP_M, q_mode }
243 #define Mx { OP_M, x_mode }
244 #define Mxmm { OP_M, xmm_mode }
245 #define Gb { OP_G, b_mode }
246 #define Gv { OP_G, v_mode }
247 #define Gd { OP_G, d_mode }
248 #define Gdq { OP_G, dq_mode }
249 #define Gm { OP_G, m_mode }
250 #define Gw { OP_G, w_mode }
251 #define Rd { OP_R, d_mode }
252 #define Rm { OP_R, m_mode }
253 #define Ib { OP_I, b_mode }
254 #define sIb { OP_sI, b_mode } /* sign extened byte */
255 #define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
256 #define Iv { OP_I, v_mode }
257 #define sIv { OP_sI, v_mode }
258 #define Iq { OP_I, q_mode }
259 #define Iv64 { OP_I64, v_mode }
260 #define Iw { OP_I, w_mode }
261 #define I1 { OP_I, const_1_mode }
262 #define Jb { OP_J, b_mode }
263 #define Jv { OP_J, v_mode }
264 #define Cm { OP_C, m_mode }
265 #define Dm { OP_D, m_mode }
266 #define Td { OP_T, d_mode }
267 #define Skip_MODRM { OP_Skip_MODRM, 0 }
269 #define RMeAX { OP_REG, eAX_reg }
270 #define RMeBX { OP_REG, eBX_reg }
271 #define RMeCX { OP_REG, eCX_reg }
272 #define RMeDX { OP_REG, eDX_reg }
273 #define RMeSP { OP_REG, eSP_reg }
274 #define RMeBP { OP_REG, eBP_reg }
275 #define RMeSI { OP_REG, eSI_reg }
276 #define RMeDI { OP_REG, eDI_reg }
277 #define RMrAX { OP_REG, rAX_reg }
278 #define RMrBX { OP_REG, rBX_reg }
279 #define RMrCX { OP_REG, rCX_reg }
280 #define RMrDX { OP_REG, rDX_reg }
281 #define RMrSP { OP_REG, rSP_reg }
282 #define RMrBP { OP_REG, rBP_reg }
283 #define RMrSI { OP_REG, rSI_reg }
284 #define RMrDI { OP_REG, rDI_reg }
285 #define RMAL { OP_REG, al_reg }
286 #define RMCL { OP_REG, cl_reg }
287 #define RMDL { OP_REG, dl_reg }
288 #define RMBL { OP_REG, bl_reg }
289 #define RMAH { OP_REG, ah_reg }
290 #define RMCH { OP_REG, ch_reg }
291 #define RMDH { OP_REG, dh_reg }
292 #define RMBH { OP_REG, bh_reg }
293 #define RMAX { OP_REG, ax_reg }
294 #define RMDX { OP_REG, dx_reg }
296 #define eAX { OP_IMREG, eAX_reg }
297 #define eBX { OP_IMREG, eBX_reg }
298 #define eCX { OP_IMREG, eCX_reg }
299 #define eDX { OP_IMREG, eDX_reg }
300 #define eSP { OP_IMREG, eSP_reg }
301 #define eBP { OP_IMREG, eBP_reg }
302 #define eSI { OP_IMREG, eSI_reg }
303 #define eDI { OP_IMREG, eDI_reg }
304 #define AL { OP_IMREG, al_reg }
305 #define CL { OP_IMREG, cl_reg }
306 #define DL { OP_IMREG, dl_reg }
307 #define BL { OP_IMREG, bl_reg }
308 #define AH { OP_IMREG, ah_reg }
309 #define CH { OP_IMREG, ch_reg }
310 #define DH { OP_IMREG, dh_reg }
311 #define BH { OP_IMREG, bh_reg }
312 #define AX { OP_IMREG, ax_reg }
313 #define DX { OP_IMREG, dx_reg }
314 #define zAX { OP_IMREG, z_mode_ax_reg }
315 #define indirDX { OP_IMREG, indir_dx_reg }
317 #define Sw { OP_SEG, w_mode }
318 #define Sv { OP_SEG, v_mode }
319 #define Ap { OP_DIR, 0 }
320 #define Ob { OP_OFF64, b_mode }
321 #define Ov { OP_OFF64, v_mode }
322 #define Xb { OP_DSreg, eSI_reg }
323 #define Xv { OP_DSreg, eSI_reg }
324 #define Xz { OP_DSreg, eSI_reg }
325 #define Yb { OP_ESreg, eDI_reg }
326 #define Yv { OP_ESreg, eDI_reg }
327 #define DSBX { OP_DSreg, eBX_reg }
329 #define es { OP_REG, es_reg }
330 #define ss { OP_REG, ss_reg }
331 #define cs { OP_REG, cs_reg }
332 #define ds { OP_REG, ds_reg }
333 #define fs { OP_REG, fs_reg }
334 #define gs { OP_REG, gs_reg }
336 #define MX { OP_MMX, 0 }
337 #define XM { OP_XMM, 0 }
338 #define XMScalar { OP_XMM, scalar_mode }
339 #define XMM { OP_XMM, xmm_mode }
340 #define EM { OP_EM, v_mode }
341 #define EMS { OP_EM, v_swap_mode }
342 #define EMd { OP_EM, d_mode }
343 #define EMx { OP_EM, x_mode }
344 #define EXw { OP_EX, w_mode }
345 #define EXd { OP_EX, d_mode }
346 #define EXdScalar { OP_EX, d_scalar_mode }
347 #define EXdS { OP_EX, d_swap_mode }
348 #define EXq { OP_EX, q_mode }
349 #define EXqScalar { OP_EX, q_scalar_mode }
350 #define EXqScalarS { OP_EX, q_scalar_swap_mode }
351 #define EXqS { OP_EX, q_swap_mode }
352 #define EXx { OP_EX, x_mode }
353 #define EXxS { OP_EX, x_swap_mode }
354 #define EXxmm { OP_EX, xmm_mode }
355 #define EXxmmq { OP_EX, xmmq_mode }
356 #define EXymmq { OP_EX, ymmq_mode }
357 #define EXVexWdq { OP_EX, vex_w_dq_mode }
358 #define EXVexWdqScalar { OP_EX, vex_scalar_w_dq_mode }
359 #define MS { OP_MS, v_mode }
360 #define XS { OP_XS, v_mode }
361 #define EMCq { OP_EMC, q_mode }
362 #define MXC { OP_MXC, 0 }
363 #define OPSUF { OP_3DNowSuffix, 0 }
364 #define CMP { CMP_Fixup, 0 }
365 #define XMM0 { XMM_Fixup, 0 }
366 #define FXSAVE { FXSAVE_Fixup, 0 }
367 #define Vex_2src_1 { OP_Vex_2src_1, 0 }
368 #define Vex_2src_2 { OP_Vex_2src_2, 0 }
370 #define Vex { OP_VEX, vex_mode }
371 #define VexScalar { OP_VEX, vex_scalar_mode }
372 #define Vex128 { OP_VEX, vex128_mode }
373 #define Vex256 { OP_VEX, vex256_mode }
374 #define VexGdq { OP_VEX, dq_mode }
375 #define VexI4 { VEXI4_Fixup, 0}
376 #define EXdVex { OP_EX_Vex, d_mode }
377 #define EXdVexS { OP_EX_Vex, d_swap_mode }
378 #define EXdVexScalarS { OP_EX_Vex, d_scalar_swap_mode }
379 #define EXqVex { OP_EX_Vex, q_mode }
380 #define EXqVexS { OP_EX_Vex, q_swap_mode }
381 #define EXqVexScalarS { OP_EX_Vex, q_scalar_swap_mode }
382 #define EXVexW { OP_EX_VexW, x_mode }
383 #define EXdVexW { OP_EX_VexW, d_mode }
384 #define EXqVexW { OP_EX_VexW, q_mode }
385 #define EXVexImmW { OP_EX_VexImmW, x_mode }
386 #define XMVex { OP_XMM_Vex, 0 }
387 #define XMVexScalar { OP_XMM_Vex, scalar_mode }
388 #define XMVexW { OP_XMM_VexW, 0 }
389 #define XMVexI4 { OP_REG_VexI4, x_mode }
390 #define PCLMUL { PCLMUL_Fixup, 0 }
391 #define VZERO { VZERO_Fixup, 0 }
392 #define VCMP { VCMP_Fixup, 0 }
394 /* Used handle "rep" prefix for string instructions. */
395 #define Xbr { REP_Fixup, eSI_reg }
396 #define Xvr { REP_Fixup, eSI_reg }
397 #define Ybr { REP_Fixup, eDI_reg }
398 #define Yvr { REP_Fixup, eDI_reg }
399 #define Yzr { REP_Fixup, eDI_reg }
400 #define indirDXr { REP_Fixup, indir_dx_reg }
401 #define ALr { REP_Fixup, al_reg }
402 #define eAXr { REP_Fixup, eAX_reg }
404 #define cond_jump_flag { NULL, cond_jump_mode }
405 #define loop_jcxz_flag { NULL, loop_jcxz_mode }
407 /* bits in sizeflag */
408 #define SUFFIX_ALWAYS 4
416 /* byte operand with operand swapped */
418 /* byte operand, sign extend like 'T' suffix */
420 /* operand size depends on prefixes */
422 /* operand size depends on prefixes with operand swapped */
426 /* double word operand */
428 /* double word operand with operand swapped */
430 /* quad word operand */
432 /* quad word operand with operand swapped */
434 /* ten-byte operand */
436 /* 16-byte XMM or 32-byte YMM operand */
438 /* 16-byte XMM or 32-byte YMM operand with operand swapped */
440 /* 16-byte XMM operand */
442 /* 16-byte XMM or quad word operand */
444 /* 32-byte YMM or quad word operand */
446 /* d_mode in 32bit, q_mode in 64bit mode. */
448 /* pair of v_mode operands */
452 /* operand size depends on REX prefixes. */
454 /* registers like dq_mode, memory like w_mode. */
456 /* 4- or 6-byte pointer operand */
459 /* v_mode for stack-related opcodes. */
461 /* non-quad operand size depends on prefixes */
463 /* 16-byte operand */
465 /* registers like dq_mode, memory like b_mode. */
467 /* registers like dq_mode, memory like d_mode. */
469 /* normal vex mode */
471 /* 128bit vex mode */
473 /* 256bit vex mode */
475 /* operand size depends on the VEX.W bit. */
478 /* scalar, ignore vector length. */
480 /* like d_mode, ignore vector length. */
482 /* like d_swap_mode, ignore vector length. */
484 /* like q_mode, ignore vector length. */
486 /* like q_swap_mode, ignore vector length. */
488 /* like vex_mode, ignore vector length. */
490 /* like vex_w_dq_mode, ignore vector length. */
491 vex_scalar_w_dq_mode,
556 #define FLOAT NULL, { { NULL, FLOATCODE } }
558 #define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }
559 #define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
560 #define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
561 #define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
562 #define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
563 #define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
564 #define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
565 #define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
566 #define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
567 #define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
568 #define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
569 #define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
669 MOD_VEX_0F12_PREFIX_0,
671 MOD_VEX_0F16_PREFIX_0,
687 MOD_VEX_0FD7_PREFIX_2,
688 MOD_VEX_0FE7_PREFIX_2,
689 MOD_VEX_0FF0_PREFIX_3,
690 MOD_VEX_0F3818_PREFIX_2,
691 MOD_VEX_0F3819_PREFIX_2,
692 MOD_VEX_0F381A_PREFIX_2,
693 MOD_VEX_0F382A_PREFIX_2,
694 MOD_VEX_0F382C_PREFIX_2,
695 MOD_VEX_0F382D_PREFIX_2,
696 MOD_VEX_0F382E_PREFIX_2,
697 MOD_VEX_0F382F_PREFIX_2
867 PREFIX_VEX_0F71_REG_2,
868 PREFIX_VEX_0F71_REG_4,
869 PREFIX_VEX_0F71_REG_6,
870 PREFIX_VEX_0F72_REG_2,
871 PREFIX_VEX_0F72_REG_4,
872 PREFIX_VEX_0F72_REG_6,
873 PREFIX_VEX_0F73_REG_2,
874 PREFIX_VEX_0F73_REG_3,
875 PREFIX_VEX_0F73_REG_6,
876 PREFIX_VEX_0F73_REG_7,
1026 PREFIX_VEX_0F38F3_REG_1,
1027 PREFIX_VEX_0F38F3_REG_2,
1028 PREFIX_VEX_0F38F3_REG_3,
1121 THREE_BYTE_0F38 = 0,
1142 VEX_LEN_0F10_P_1 = 0,
1146 VEX_LEN_0F12_P_0_M_0,
1147 VEX_LEN_0F12_P_0_M_1,
1150 VEX_LEN_0F16_P_0_M_0,
1151 VEX_LEN_0F16_P_0_M_1,
1200 VEX_LEN_0F71_R_2_P_2,
1201 VEX_LEN_0F71_R_4_P_2,
1202 VEX_LEN_0F71_R_6_P_2,
1203 VEX_LEN_0F72_R_2_P_2,
1204 VEX_LEN_0F72_R_4_P_2,
1205 VEX_LEN_0F72_R_6_P_2,
1206 VEX_LEN_0F73_R_2_P_2,
1207 VEX_LEN_0F73_R_3_P_2,
1208 VEX_LEN_0F73_R_6_P_2,
1209 VEX_LEN_0F73_R_7_P_2,
1215 VEX_LEN_0FAE_R_2_M_0,
1216 VEX_LEN_0FAE_R_3_M_0,
1227 VEX_LEN_0FD7_P_2_M_1,
1276 VEX_LEN_0F3819_P_2_M_0,
1277 VEX_LEN_0F381A_P_2_M_0,
1289 VEX_LEN_0F382A_P_2_M_0,
1314 VEX_LEN_0F38F3_R_1_P_0,
1315 VEX_LEN_0F38F3_R_2_P_0,
1316 VEX_LEN_0F38F3_R_3_P_0,
1349 VEX_LEN_0FXOP_09_80,
1537 VEX_W_0F3818_P_2_M_0,
1538 VEX_W_0F3819_P_2_M_0,
1539 VEX_W_0F381A_P_2_M_0,
1551 VEX_W_0F382A_P_2_M_0,
1553 VEX_W_0F382C_P_2_M_0,
1554 VEX_W_0F382D_P_2_M_0,
1555 VEX_W_0F382E_P_2_M_0,
1556 VEX_W_0F382F_P_2_M_0,
1612 typedef void (*op_rtn) (int bytemode, int sizeflag);
1623 /* Upper case letters in the instruction names here are macros.
1624 'A' => print 'b' if no register operands or suffix_always is true
1625 'B' => print 'b' if suffix_always is true
1626 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
1628 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
1629 suffix_always is true
1630 'E' => print 'e' if 32-bit form of jcxz
1631 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
1632 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
1633 'H' => print ",pt" or ",pn" branch hint
1634 'I' => honor following macro letter even in Intel mode (implemented only
1635 for some of the macro letters)
1637 'K' => print 'd' or 'q' if rex prefix is present.
1638 'L' => print 'l' if suffix_always is true
1639 'M' => print 'r' if intel_mnemonic is false.
1640 'N' => print 'n' if instruction has no wait "prefix"
1641 'O' => print 'd' or 'o' (or 'q' in Intel mode)
1642 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
1643 or suffix_always is true. print 'q' if rex prefix is present.
1644 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
1646 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
1647 'S' => print 'w', 'l' or 'q' if suffix_always is true
1648 'T' => print 'q' in 64bit mode and behave as 'P' otherwise
1649 'U' => print 'q' in 64bit mode and behave as 'Q' otherwise
1650 'V' => print 'q' in 64bit mode and behave as 'S' otherwise
1651 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
1652 'X' => print 's', 'd' depending on data16 prefix (for XMM)
1653 'Y' => 'q' if instruction has an REX 64bit overwrite prefix and
1654 suffix_always is true.
1655 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
1656 '!' => change condition from true to false or from false to true.
1657 '%' => add 1 upper case letter to the macro.
1659 2 upper case letter macros:
1660 "XY" => print 'x' or 'y' if no register operands or suffix_always
1662 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
1663 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand
1664 or suffix_always is true
1665 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
1666 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
1667 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
1669 Many of the above letters print nothing in Intel mode. See "putop"
1672 Braces '{' and '}', and vertical bars '|', indicate alternative
1673 mnemonic strings for AT&T and Intel. */
1675 static const struct dis386 dis386[] = {
1677 { "addB", { Eb, Gb } },
1678 { "addS", { Ev, Gv } },
1679 { "addB", { Gb, EbS } },
1680 { "addS", { Gv, EvS } },
1681 { "addB", { AL, Ib } },
1682 { "addS", { eAX, Iv } },
1683 { X86_64_TABLE (X86_64_06) },
1684 { X86_64_TABLE (X86_64_07) },
1686 { "orB", { Eb, Gb } },
1687 { "orS", { Ev, Gv } },
1688 { "orB", { Gb, EbS } },
1689 { "orS", { Gv, EvS } },
1690 { "orB", { AL, Ib } },
1691 { "orS", { eAX, Iv } },
1692 { X86_64_TABLE (X86_64_0D) },
1693 { Bad_Opcode }, /* 0x0f extended opcode escape */
1695 { "adcB", { Eb, Gb } },
1696 { "adcS", { Ev, Gv } },
1697 { "adcB", { Gb, EbS } },
1698 { "adcS", { Gv, EvS } },
1699 { "adcB", { AL, Ib } },
1700 { "adcS", { eAX, Iv } },
1701 { X86_64_TABLE (X86_64_16) },
1702 { X86_64_TABLE (X86_64_17) },
1704 { "sbbB", { Eb, Gb } },
1705 { "sbbS", { Ev, Gv } },
1706 { "sbbB", { Gb, EbS } },
1707 { "sbbS", { Gv, EvS } },
1708 { "sbbB", { AL, Ib } },
1709 { "sbbS", { eAX, Iv } },
1710 { X86_64_TABLE (X86_64_1E) },
1711 { X86_64_TABLE (X86_64_1F) },
1713 { "andB", { Eb, Gb } },
1714 { "andS", { Ev, Gv } },
1715 { "andB", { Gb, EbS } },
1716 { "andS", { Gv, EvS } },
1717 { "andB", { AL, Ib } },
1718 { "andS", { eAX, Iv } },
1719 { Bad_Opcode }, /* SEG ES prefix */
1720 { X86_64_TABLE (X86_64_27) },
1722 { "subB", { Eb, Gb } },
1723 { "subS", { Ev, Gv } },
1724 { "subB", { Gb, EbS } },
1725 { "subS", { Gv, EvS } },
1726 { "subB", { AL, Ib } },
1727 { "subS", { eAX, Iv } },
1728 { Bad_Opcode }, /* SEG CS prefix */
1729 { X86_64_TABLE (X86_64_2F) },
1731 { "xorB", { Eb, Gb } },
1732 { "xorS", { Ev, Gv } },
1733 { "xorB", { Gb, EbS } },
1734 { "xorS", { Gv, EvS } },
1735 { "xorB", { AL, Ib } },
1736 { "xorS", { eAX, Iv } },
1737 { Bad_Opcode }, /* SEG SS prefix */
1738 { X86_64_TABLE (X86_64_37) },
1740 { "cmpB", { Eb, Gb } },
1741 { "cmpS", { Ev, Gv } },
1742 { "cmpB", { Gb, EbS } },
1743 { "cmpS", { Gv, EvS } },
1744 { "cmpB", { AL, Ib } },
1745 { "cmpS", { eAX, Iv } },
1746 { Bad_Opcode }, /* SEG DS prefix */
1747 { X86_64_TABLE (X86_64_3F) },
1749 { "inc{S|}", { RMeAX } },
1750 { "inc{S|}", { RMeCX } },
1751 { "inc{S|}", { RMeDX } },
1752 { "inc{S|}", { RMeBX } },
1753 { "inc{S|}", { RMeSP } },
1754 { "inc{S|}", { RMeBP } },
1755 { "inc{S|}", { RMeSI } },
1756 { "inc{S|}", { RMeDI } },
1758 { "dec{S|}", { RMeAX } },
1759 { "dec{S|}", { RMeCX } },
1760 { "dec{S|}", { RMeDX } },
1761 { "dec{S|}", { RMeBX } },
1762 { "dec{S|}", { RMeSP } },
1763 { "dec{S|}", { RMeBP } },
1764 { "dec{S|}", { RMeSI } },
1765 { "dec{S|}", { RMeDI } },
1767 { "pushV", { RMrAX } },
1768 { "pushV", { RMrCX } },
1769 { "pushV", { RMrDX } },
1770 { "pushV", { RMrBX } },
1771 { "pushV", { RMrSP } },
1772 { "pushV", { RMrBP } },
1773 { "pushV", { RMrSI } },
1774 { "pushV", { RMrDI } },
1776 { "popV", { RMrAX } },
1777 { "popV", { RMrCX } },
1778 { "popV", { RMrDX } },
1779 { "popV", { RMrBX } },
1780 { "popV", { RMrSP } },
1781 { "popV", { RMrBP } },
1782 { "popV", { RMrSI } },
1783 { "popV", { RMrDI } },
1785 { X86_64_TABLE (X86_64_60) },
1786 { X86_64_TABLE (X86_64_61) },
1787 { X86_64_TABLE (X86_64_62) },
1788 { X86_64_TABLE (X86_64_63) },
1789 { Bad_Opcode }, /* seg fs */
1790 { Bad_Opcode }, /* seg gs */
1791 { Bad_Opcode }, /* op size prefix */
1792 { Bad_Opcode }, /* adr size prefix */
1794 { "pushT", { sIv } },
1795 { "imulS", { Gv, Ev, Iv } },
1796 { "pushT", { sIbT } },
1797 { "imulS", { Gv, Ev, sIb } },
1798 { "ins{b|}", { Ybr, indirDX } },
1799 { X86_64_TABLE (X86_64_6D) },
1800 { "outs{b|}", { indirDXr, Xb } },
1801 { X86_64_TABLE (X86_64_6F) },
1803 { "joH", { Jb, XX, cond_jump_flag } },
1804 { "jnoH", { Jb, XX, cond_jump_flag } },
1805 { "jbH", { Jb, XX, cond_jump_flag } },
1806 { "jaeH", { Jb, XX, cond_jump_flag } },
1807 { "jeH", { Jb, XX, cond_jump_flag } },
1808 { "jneH", { Jb, XX, cond_jump_flag } },
1809 { "jbeH", { Jb, XX, cond_jump_flag } },
1810 { "jaH", { Jb, XX, cond_jump_flag } },
1812 { "jsH", { Jb, XX, cond_jump_flag } },
1813 { "jnsH", { Jb, XX, cond_jump_flag } },
1814 { "jpH", { Jb, XX, cond_jump_flag } },
1815 { "jnpH", { Jb, XX, cond_jump_flag } },
1816 { "jlH", { Jb, XX, cond_jump_flag } },
1817 { "jgeH", { Jb, XX, cond_jump_flag } },
1818 { "jleH", { Jb, XX, cond_jump_flag } },
1819 { "jgH", { Jb, XX, cond_jump_flag } },
1821 { REG_TABLE (REG_80) },
1822 { REG_TABLE (REG_81) },
1824 { REG_TABLE (REG_82) },
1825 { "testB", { Eb, Gb } },
1826 { "testS", { Ev, Gv } },
1827 { "xchgB", { Eb, Gb } },
1828 { "xchgS", { Ev, Gv } },
1830 { "movB", { Eb, Gb } },
1831 { "movS", { Ev, Gv } },
1832 { "movB", { Gb, EbS } },
1833 { "movS", { Gv, EvS } },
1834 { "movD", { Sv, Sw } },
1835 { MOD_TABLE (MOD_8D) },
1836 { "movD", { Sw, Sv } },
1837 { REG_TABLE (REG_8F) },
1839 { PREFIX_TABLE (PREFIX_90) },
1840 { "xchgS", { RMeCX, eAX } },
1841 { "xchgS", { RMeDX, eAX } },
1842 { "xchgS", { RMeBX, eAX } },
1843 { "xchgS", { RMeSP, eAX } },
1844 { "xchgS", { RMeBP, eAX } },
1845 { "xchgS", { RMeSI, eAX } },
1846 { "xchgS", { RMeDI, eAX } },
1848 { "cW{t|}R", { XX } },
1849 { "cR{t|}O", { XX } },
1850 { X86_64_TABLE (X86_64_9A) },
1851 { Bad_Opcode }, /* fwait */
1852 { "pushfT", { XX } },
1853 { "popfT", { XX } },
1857 { "mov%LB", { AL, Ob } },
1858 { "mov%LS", { eAX, Ov } },
1859 { "mov%LB", { Ob, AL } },
1860 { "mov%LS", { Ov, eAX } },
1861 { "movs{b|}", { Ybr, Xb } },
1862 { "movs{R|}", { Yvr, Xv } },
1863 { "cmps{b|}", { Xb, Yb } },
1864 { "cmps{R|}", { Xv, Yv } },
1866 { "testB", { AL, Ib } },
1867 { "testS", { eAX, Iv } },
1868 { "stosB", { Ybr, AL } },
1869 { "stosS", { Yvr, eAX } },
1870 { "lodsB", { ALr, Xb } },
1871 { "lodsS", { eAXr, Xv } },
1872 { "scasB", { AL, Yb } },
1873 { "scasS", { eAX, Yv } },
1875 { "movB", { RMAL, Ib } },
1876 { "movB", { RMCL, Ib } },
1877 { "movB", { RMDL, Ib } },
1878 { "movB", { RMBL, Ib } },
1879 { "movB", { RMAH, Ib } },
1880 { "movB", { RMCH, Ib } },
1881 { "movB", { RMDH, Ib } },
1882 { "movB", { RMBH, Ib } },
1884 { "mov%LV", { RMeAX, Iv64 } },
1885 { "mov%LV", { RMeCX, Iv64 } },
1886 { "mov%LV", { RMeDX, Iv64 } },
1887 { "mov%LV", { RMeBX, Iv64 } },
1888 { "mov%LV", { RMeSP, Iv64 } },
1889 { "mov%LV", { RMeBP, Iv64 } },
1890 { "mov%LV", { RMeSI, Iv64 } },
1891 { "mov%LV", { RMeDI, Iv64 } },
1893 { REG_TABLE (REG_C0) },
1894 { REG_TABLE (REG_C1) },
1897 { X86_64_TABLE (X86_64_C4) },
1898 { X86_64_TABLE (X86_64_C5) },
1899 { REG_TABLE (REG_C6) },
1900 { REG_TABLE (REG_C7) },
1902 { "enterT", { Iw, Ib } },
1903 { "leaveT", { XX } },
1904 { "Jret{|f}P", { Iw } },
1905 { "Jret{|f}P", { XX } },
1908 { X86_64_TABLE (X86_64_CE) },
1909 { "iretP", { XX } },
1911 { REG_TABLE (REG_D0) },
1912 { REG_TABLE (REG_D1) },
1913 { REG_TABLE (REG_D2) },
1914 { REG_TABLE (REG_D3) },
1915 { X86_64_TABLE (X86_64_D4) },
1916 { X86_64_TABLE (X86_64_D5) },
1918 { "xlat", { DSBX } },
1929 { "loopneFH", { Jb, XX, loop_jcxz_flag } },
1930 { "loopeFH", { Jb, XX, loop_jcxz_flag } },
1931 { "loopFH", { Jb, XX, loop_jcxz_flag } },
1932 { "jEcxzH", { Jb, XX, loop_jcxz_flag } },
1933 { "inB", { AL, Ib } },
1934 { "inG", { zAX, Ib } },
1935 { "outB", { Ib, AL } },
1936 { "outG", { Ib, zAX } },
1938 { "callT", { Jv } },
1940 { X86_64_TABLE (X86_64_EA) },
1942 { "inB", { AL, indirDX } },
1943 { "inG", { zAX, indirDX } },
1944 { "outB", { indirDX, AL } },
1945 { "outG", { indirDX, zAX } },
1947 { Bad_Opcode }, /* lock prefix */
1948 { "icebp", { XX } },
1949 { Bad_Opcode }, /* repne */
1950 { Bad_Opcode }, /* repz */
1953 { REG_TABLE (REG_F6) },
1954 { REG_TABLE (REG_F7) },
1962 { REG_TABLE (REG_FE) },
1963 { REG_TABLE (REG_FF) },
1966 static const struct dis386 dis386_twobyte[] = {
1968 { REG_TABLE (REG_0F00 ) },
1969 { REG_TABLE (REG_0F01 ) },
1970 { "larS", { Gv, Ew } },
1971 { "lslS", { Gv, Ew } },
1973 { "syscall", { XX } },
1975 { "sysretP", { XX } },
1978 { "wbinvd", { XX } },
1982 { REG_TABLE (REG_0F0D) },
1983 { "femms", { XX } },
1984 { "", { MX, EM, OPSUF } }, /* See OP_3DNowSuffix. */
1986 { PREFIX_TABLE (PREFIX_0F10) },
1987 { PREFIX_TABLE (PREFIX_0F11) },
1988 { PREFIX_TABLE (PREFIX_0F12) },
1989 { MOD_TABLE (MOD_0F13) },
1990 { "unpcklpX", { XM, EXx } },
1991 { "unpckhpX", { XM, EXx } },
1992 { PREFIX_TABLE (PREFIX_0F16) },
1993 { MOD_TABLE (MOD_0F17) },
1995 { REG_TABLE (REG_0F18) },
2004 { MOD_TABLE (MOD_0F20) },
2005 { MOD_TABLE (MOD_0F21) },
2006 { MOD_TABLE (MOD_0F22) },
2007 { MOD_TABLE (MOD_0F23) },
2008 { MOD_TABLE (MOD_0F24) },
2010 { MOD_TABLE (MOD_0F26) },
2013 { "movapX", { XM, EXx } },
2014 { "movapX", { EXxS, XM } },
2015 { PREFIX_TABLE (PREFIX_0F2A) },
2016 { PREFIX_TABLE (PREFIX_0F2B) },
2017 { PREFIX_TABLE (PREFIX_0F2C) },
2018 { PREFIX_TABLE (PREFIX_0F2D) },
2019 { PREFIX_TABLE (PREFIX_0F2E) },
2020 { PREFIX_TABLE (PREFIX_0F2F) },
2022 { "wrmsr", { XX } },
2023 { "rdtsc", { XX } },
2024 { "rdmsr", { XX } },
2025 { "rdpmc", { XX } },
2026 { "sysenter", { XX } },
2027 { "sysexit", { XX } },
2029 { "getsec", { XX } },
2031 { THREE_BYTE_TABLE (THREE_BYTE_0F38) },
2033 { THREE_BYTE_TABLE (THREE_BYTE_0F3A) },
2040 { "cmovoS", { Gv, Ev } },
2041 { "cmovnoS", { Gv, Ev } },
2042 { "cmovbS", { Gv, Ev } },
2043 { "cmovaeS", { Gv, Ev } },
2044 { "cmoveS", { Gv, Ev } },
2045 { "cmovneS", { Gv, Ev } },
2046 { "cmovbeS", { Gv, Ev } },
2047 { "cmovaS", { Gv, Ev } },
2049 { "cmovsS", { Gv, Ev } },
2050 { "cmovnsS", { Gv, Ev } },
2051 { "cmovpS", { Gv, Ev } },
2052 { "cmovnpS", { Gv, Ev } },
2053 { "cmovlS", { Gv, Ev } },
2054 { "cmovgeS", { Gv, Ev } },
2055 { "cmovleS", { Gv, Ev } },
2056 { "cmovgS", { Gv, Ev } },
2058 { MOD_TABLE (MOD_0F51) },
2059 { PREFIX_TABLE (PREFIX_0F51) },
2060 { PREFIX_TABLE (PREFIX_0F52) },
2061 { PREFIX_TABLE (PREFIX_0F53) },
2062 { "andpX", { XM, EXx } },
2063 { "andnpX", { XM, EXx } },
2064 { "orpX", { XM, EXx } },
2065 { "xorpX", { XM, EXx } },
2067 { PREFIX_TABLE (PREFIX_0F58) },
2068 { PREFIX_TABLE (PREFIX_0F59) },
2069 { PREFIX_TABLE (PREFIX_0F5A) },
2070 { PREFIX_TABLE (PREFIX_0F5B) },
2071 { PREFIX_TABLE (PREFIX_0F5C) },
2072 { PREFIX_TABLE (PREFIX_0F5D) },
2073 { PREFIX_TABLE (PREFIX_0F5E) },
2074 { PREFIX_TABLE (PREFIX_0F5F) },
2076 { PREFIX_TABLE (PREFIX_0F60) },
2077 { PREFIX_TABLE (PREFIX_0F61) },
2078 { PREFIX_TABLE (PREFIX_0F62) },
2079 { "packsswb", { MX, EM } },
2080 { "pcmpgtb", { MX, EM } },
2081 { "pcmpgtw", { MX, EM } },
2082 { "pcmpgtd", { MX, EM } },
2083 { "packuswb", { MX, EM } },
2085 { "punpckhbw", { MX, EM } },
2086 { "punpckhwd", { MX, EM } },
2087 { "punpckhdq", { MX, EM } },
2088 { "packssdw", { MX, EM } },
2089 { PREFIX_TABLE (PREFIX_0F6C) },
2090 { PREFIX_TABLE (PREFIX_0F6D) },
2091 { "movK", { MX, Edq } },
2092 { PREFIX_TABLE (PREFIX_0F6F) },
2094 { PREFIX_TABLE (PREFIX_0F70) },
2095 { REG_TABLE (REG_0F71) },
2096 { REG_TABLE (REG_0F72) },
2097 { REG_TABLE (REG_0F73) },
2098 { "pcmpeqb", { MX, EM } },
2099 { "pcmpeqw", { MX, EM } },
2100 { "pcmpeqd", { MX, EM } },
2103 { PREFIX_TABLE (PREFIX_0F78) },
2104 { PREFIX_TABLE (PREFIX_0F79) },
2105 { THREE_BYTE_TABLE (THREE_BYTE_0F7A) },
2107 { PREFIX_TABLE (PREFIX_0F7C) },
2108 { PREFIX_TABLE (PREFIX_0F7D) },
2109 { PREFIX_TABLE (PREFIX_0F7E) },
2110 { PREFIX_TABLE (PREFIX_0F7F) },
2112 { "joH", { Jv, XX, cond_jump_flag } },
2113 { "jnoH", { Jv, XX, cond_jump_flag } },
2114 { "jbH", { Jv, XX, cond_jump_flag } },
2115 { "jaeH", { Jv, XX, cond_jump_flag } },
2116 { "jeH", { Jv, XX, cond_jump_flag } },
2117 { "jneH", { Jv, XX, cond_jump_flag } },
2118 { "jbeH", { Jv, XX, cond_jump_flag } },
2119 { "jaH", { Jv, XX, cond_jump_flag } },
2121 { "jsH", { Jv, XX, cond_jump_flag } },
2122 { "jnsH", { Jv, XX, cond_jump_flag } },
2123 { "jpH", { Jv, XX, cond_jump_flag } },
2124 { "jnpH", { Jv, XX, cond_jump_flag } },
2125 { "jlH", { Jv, XX, cond_jump_flag } },
2126 { "jgeH", { Jv, XX, cond_jump_flag } },
2127 { "jleH", { Jv, XX, cond_jump_flag } },
2128 { "jgH", { Jv, XX, cond_jump_flag } },
2131 { "setno", { Eb } },
2133 { "setae", { Eb } },
2135 { "setne", { Eb } },
2136 { "setbe", { Eb } },
2140 { "setns", { Eb } },
2142 { "setnp", { Eb } },
2144 { "setge", { Eb } },
2145 { "setle", { Eb } },
2148 { "pushT", { fs } },
2150 { "cpuid", { XX } },
2151 { "btS", { Ev, Gv } },
2152 { "shldS", { Ev, Gv, Ib } },
2153 { "shldS", { Ev, Gv, CL } },
2154 { REG_TABLE (REG_0FA6) },
2155 { REG_TABLE (REG_0FA7) },
2157 { "pushT", { gs } },
2160 { "btsS", { Ev, Gv } },
2161 { "shrdS", { Ev, Gv, Ib } },
2162 { "shrdS", { Ev, Gv, CL } },
2163 { REG_TABLE (REG_0FAE) },
2164 { "imulS", { Gv, Ev } },
2166 { "cmpxchgB", { Eb, Gb } },
2167 { "cmpxchgS", { Ev, Gv } },
2168 { MOD_TABLE (MOD_0FB2) },
2169 { "btrS", { Ev, Gv } },
2170 { MOD_TABLE (MOD_0FB4) },
2171 { MOD_TABLE (MOD_0FB5) },
2172 { "movz{bR|x}", { Gv, Eb } },
2173 { "movz{wR|x}", { Gv, Ew } }, /* yes, there really is movzww ! */
2175 { PREFIX_TABLE (PREFIX_0FB8) },
2177 { REG_TABLE (REG_0FBA) },
2178 { "btcS", { Ev, Gv } },
2179 { PREFIX_TABLE (PREFIX_0FBC) },
2180 { PREFIX_TABLE (PREFIX_0FBD) },
2181 { "movs{bR|x}", { Gv, Eb } },
2182 { "movs{wR|x}", { Gv, Ew } }, /* yes, there really is movsww ! */
2184 { "xaddB", { Eb, Gb } },
2185 { "xaddS", { Ev, Gv } },
2186 { PREFIX_TABLE (PREFIX_0FC2) },
2187 { PREFIX_TABLE (PREFIX_0FC3) },
2188 { "pinsrw", { MX, Edqw, Ib } },
2189 { "pextrw", { Gdq, MS, Ib } },
2190 { "shufpX", { XM, EXx, Ib } },
2191 { REG_TABLE (REG_0FC7) },
2193 { "bswap", { RMeAX } },
2194 { "bswap", { RMeCX } },
2195 { "bswap", { RMeDX } },
2196 { "bswap", { RMeBX } },
2197 { "bswap", { RMeSP } },
2198 { "bswap", { RMeBP } },
2199 { "bswap", { RMeSI } },
2200 { "bswap", { RMeDI } },
2202 { PREFIX_TABLE (PREFIX_0FD0) },
2203 { "psrlw", { MX, EM } },
2204 { "psrld", { MX, EM } },
2205 { "psrlq", { MX, EM } },
2206 { "paddq", { MX, EM } },
2207 { "pmullw", { MX, EM } },
2208 { PREFIX_TABLE (PREFIX_0FD6) },
2209 { MOD_TABLE (MOD_0FD7) },
2211 { "psubusb", { MX, EM } },
2212 { "psubusw", { MX, EM } },
2213 { "pminub", { MX, EM } },
2214 { "pand", { MX, EM } },
2215 { "paddusb", { MX, EM } },
2216 { "paddusw", { MX, EM } },
2217 { "pmaxub", { MX, EM } },
2218 { "pandn", { MX, EM } },
2220 { "pavgb", { MX, EM } },
2221 { "psraw", { MX, EM } },
2222 { "psrad", { MX, EM } },
2223 { "pavgw", { MX, EM } },
2224 { "pmulhuw", { MX, EM } },
2225 { "pmulhw", { MX, EM } },
2226 { PREFIX_TABLE (PREFIX_0FE6) },
2227 { PREFIX_TABLE (PREFIX_0FE7) },
2229 { "psubsb", { MX, EM } },
2230 { "psubsw", { MX, EM } },
2231 { "pminsw", { MX, EM } },
2232 { "por", { MX, EM } },
2233 { "paddsb", { MX, EM } },
2234 { "paddsw", { MX, EM } },
2235 { "pmaxsw", { MX, EM } },
2236 { "pxor", { MX, EM } },
2238 { PREFIX_TABLE (PREFIX_0FF0) },
2239 { "psllw", { MX, EM } },
2240 { "pslld", { MX, EM } },
2241 { "psllq", { MX, EM } },
2242 { "pmuludq", { MX, EM } },
2243 { "pmaddwd", { MX, EM } },
2244 { "psadbw", { MX, EM } },
2245 { PREFIX_TABLE (PREFIX_0FF7) },
2247 { "psubb", { MX, EM } },
2248 { "psubw", { MX, EM } },
2249 { "psubd", { MX, EM } },
2250 { "psubq", { MX, EM } },
2251 { "paddb", { MX, EM } },
2252 { "paddw", { MX, EM } },
2253 { "paddd", { MX, EM } },
2257 static const unsigned char onebyte_has_modrm[256] = {
2258 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2259 /* ------------------------------- */
2260 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2261 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2262 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2263 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2264 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2265 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2266 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2267 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2268 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2269 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2270 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2271 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2272 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2273 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2274 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2275 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2276 /* ------------------------------- */
2277 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2280 static const unsigned char twobyte_has_modrm[256] = {
2281 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2282 /* ------------------------------- */
2283 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
2284 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
2285 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
2286 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
2287 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
2288 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2289 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
2290 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
2291 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2292 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
2293 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
2294 /* b0 */ 1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1, /* bf */
2295 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
2296 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
2297 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
2298 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0 /* ff */
2299 /* ------------------------------- */
2300 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2303 static char obuf[100];
2305 static char *mnemonicendp;
2306 static char scratchbuf[100];
2307 static unsigned char *start_codep;
2308 static unsigned char *insn_codep;
2309 static unsigned char *codep;
2310 static int last_lock_prefix;
2311 static int last_repz_prefix;
2312 static int last_repnz_prefix;
2313 static int last_data_prefix;
2314 static int last_addr_prefix;
2315 static int last_rex_prefix;
2316 static int last_seg_prefix;
2317 #define MAX_CODE_LENGTH 15
2318 /* We can up to 14 prefixes since the maximum instruction length is
2320 static int all_prefixes[MAX_CODE_LENGTH - 1];
2321 static disassemble_info *the_info;
2329 static unsigned char need_modrm;
2339 int register_specifier;
2345 static unsigned char need_vex;
2346 static unsigned char need_vex_reg;
2347 static unsigned char vex_w_done;
2355 /* If we are accessing mod/rm/reg without need_modrm set, then the
2356 values are stale. Hitting this abort likely indicates that you
2357 need to update onebyte_has_modrm or twobyte_has_modrm. */
2358 #define MODRM_CHECK if (!need_modrm) abort ()
2360 static const char **names64;
2361 static const char **names32;
2362 static const char **names16;
2363 static const char **names8;
2364 static const char **names8rex;
2365 static const char **names_seg;
2366 static const char *index64;
2367 static const char *index32;
2368 static const char **index16;
2370 static const char *intel_names64[] = {
2371 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
2372 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
2374 static const char *intel_names32[] = {
2375 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
2376 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
2378 static const char *intel_names16[] = {
2379 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
2380 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
2382 static const char *intel_names8[] = {
2383 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
2385 static const char *intel_names8rex[] = {
2386 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
2387 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
2389 static const char *intel_names_seg[] = {
2390 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
2392 static const char *intel_index64 = "riz";
2393 static const char *intel_index32 = "eiz";
2394 static const char *intel_index16[] = {
2395 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
2398 static const char *att_names64[] = {
2399 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
2400 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
2402 static const char *att_names32[] = {
2403 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
2404 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
2406 static const char *att_names16[] = {
2407 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
2408 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
2410 static const char *att_names8[] = {
2411 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
2413 static const char *att_names8rex[] = {
2414 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
2415 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
2417 static const char *att_names_seg[] = {
2418 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
2420 static const char *att_index64 = "%riz";
2421 static const char *att_index32 = "%eiz";
2422 static const char *att_index16[] = {
2423 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
2426 static const char **names_mm;
2427 static const char *intel_names_mm[] = {
2428 "mm0", "mm1", "mm2", "mm3",
2429 "mm4", "mm5", "mm6", "mm7"
2431 static const char *att_names_mm[] = {
2432 "%mm0", "%mm1", "%mm2", "%mm3",
2433 "%mm4", "%mm5", "%mm6", "%mm7"
2436 static const char **names_xmm;
2437 static const char *intel_names_xmm[] = {
2438 "xmm0", "xmm1", "xmm2", "xmm3",
2439 "xmm4", "xmm5", "xmm6", "xmm7",
2440 "xmm8", "xmm9", "xmm10", "xmm11",
2441 "xmm12", "xmm13", "xmm14", "xmm15"
2443 static const char *att_names_xmm[] = {
2444 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
2445 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
2446 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
2447 "%xmm12", "%xmm13", "%xmm14", "%xmm15"
2450 static const char **names_ymm;
2451 static const char *intel_names_ymm[] = {
2452 "ymm0", "ymm1", "ymm2", "ymm3",
2453 "ymm4", "ymm5", "ymm6", "ymm7",
2454 "ymm8", "ymm9", "ymm10", "ymm11",
2455 "ymm12", "ymm13", "ymm14", "ymm15"
2457 static const char *att_names_ymm[] = {
2458 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
2459 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
2460 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
2461 "%ymm12", "%ymm13", "%ymm14", "%ymm15"
2464 static const struct dis386 reg_table[][8] = {
2467 { "addA", { Eb, Ib } },
2468 { "orA", { Eb, Ib } },
2469 { "adcA", { Eb, Ib } },
2470 { "sbbA", { Eb, Ib } },
2471 { "andA", { Eb, Ib } },
2472 { "subA", { Eb, Ib } },
2473 { "xorA", { Eb, Ib } },
2474 { "cmpA", { Eb, Ib } },
2478 { "addQ", { Ev, Iv } },
2479 { "orQ", { Ev, Iv } },
2480 { "adcQ", { Ev, Iv } },
2481 { "sbbQ", { Ev, Iv } },
2482 { "andQ", { Ev, Iv } },
2483 { "subQ", { Ev, Iv } },
2484 { "xorQ", { Ev, Iv } },
2485 { "cmpQ", { Ev, Iv } },
2489 { "addQ", { Ev, sIb } },
2490 { "orQ", { Ev, sIb } },
2491 { "adcQ", { Ev, sIb } },
2492 { "sbbQ", { Ev, sIb } },
2493 { "andQ", { Ev, sIb } },
2494 { "subQ", { Ev, sIb } },
2495 { "xorQ", { Ev, sIb } },
2496 { "cmpQ", { Ev, sIb } },
2500 { "popU", { stackEv } },
2501 { XOP_8F_TABLE (XOP_09) },
2505 { XOP_8F_TABLE (XOP_09) },
2509 { "rolA", { Eb, Ib } },
2510 { "rorA", { Eb, Ib } },
2511 { "rclA", { Eb, Ib } },
2512 { "rcrA", { Eb, Ib } },
2513 { "shlA", { Eb, Ib } },
2514 { "shrA", { Eb, Ib } },
2516 { "sarA", { Eb, Ib } },
2520 { "rolQ", { Ev, Ib } },
2521 { "rorQ", { Ev, Ib } },
2522 { "rclQ", { Ev, Ib } },
2523 { "rcrQ", { Ev, Ib } },
2524 { "shlQ", { Ev, Ib } },
2525 { "shrQ", { Ev, Ib } },
2527 { "sarQ", { Ev, Ib } },
2531 { "movA", { Eb, Ib } },
2535 { "movQ", { Ev, Iv } },
2539 { "rolA", { Eb, I1 } },
2540 { "rorA", { Eb, I1 } },
2541 { "rclA", { Eb, I1 } },
2542 { "rcrA", { Eb, I1 } },
2543 { "shlA", { Eb, I1 } },
2544 { "shrA", { Eb, I1 } },
2546 { "sarA", { Eb, I1 } },
2550 { "rolQ", { Ev, I1 } },
2551 { "rorQ", { Ev, I1 } },
2552 { "rclQ", { Ev, I1 } },
2553 { "rcrQ", { Ev, I1 } },
2554 { "shlQ", { Ev, I1 } },
2555 { "shrQ", { Ev, I1 } },
2557 { "sarQ", { Ev, I1 } },
2561 { "rolA", { Eb, CL } },
2562 { "rorA", { Eb, CL } },
2563 { "rclA", { Eb, CL } },
2564 { "rcrA", { Eb, CL } },
2565 { "shlA", { Eb, CL } },
2566 { "shrA", { Eb, CL } },
2568 { "sarA", { Eb, CL } },
2572 { "rolQ", { Ev, CL } },
2573 { "rorQ", { Ev, CL } },
2574 { "rclQ", { Ev, CL } },
2575 { "rcrQ", { Ev, CL } },
2576 { "shlQ", { Ev, CL } },
2577 { "shrQ", { Ev, CL } },
2579 { "sarQ", { Ev, CL } },
2583 { "testA", { Eb, Ib } },
2587 { "mulA", { Eb } }, /* Don't print the implicit %al register, */
2588 { "imulA", { Eb } }, /* to distinguish these opcodes from other */
2589 { "divA", { Eb } }, /* mul/imul opcodes. Do the same for div */
2590 { "idivA", { Eb } }, /* and idiv for consistency. */
2594 { "testQ", { Ev, Iv } },
2598 { "mulQ", { Ev } }, /* Don't print the implicit register. */
2599 { "imulQ", { Ev } },
2601 { "idivQ", { Ev } },
2612 { "call{T|}", { indirEv } },
2613 { "Jcall{T|}", { indirEp } },
2614 { "jmp{T|}", { indirEv } },
2615 { "Jjmp{T|}", { indirEp } },
2616 { "pushU", { stackEv } },
2621 { "sldtD", { Sv } },
2632 { MOD_TABLE (MOD_0F01_REG_0) },
2633 { MOD_TABLE (MOD_0F01_REG_1) },
2634 { MOD_TABLE (MOD_0F01_REG_2) },
2635 { MOD_TABLE (MOD_0F01_REG_3) },
2636 { "smswD", { Sv } },
2639 { MOD_TABLE (MOD_0F01_REG_7) },
2643 { "prefetch", { Mb } },
2644 { "prefetchw", { Mb } },
2648 { MOD_TABLE (MOD_0F18_REG_0) },
2649 { MOD_TABLE (MOD_0F18_REG_1) },
2650 { MOD_TABLE (MOD_0F18_REG_2) },
2651 { MOD_TABLE (MOD_0F18_REG_3) },
2657 { MOD_TABLE (MOD_0F71_REG_2) },
2659 { MOD_TABLE (MOD_0F71_REG_4) },
2661 { MOD_TABLE (MOD_0F71_REG_6) },
2667 { MOD_TABLE (MOD_0F72_REG_2) },
2669 { MOD_TABLE (MOD_0F72_REG_4) },
2671 { MOD_TABLE (MOD_0F72_REG_6) },
2677 { MOD_TABLE (MOD_0F73_REG_2) },
2678 { MOD_TABLE (MOD_0F73_REG_3) },
2681 { MOD_TABLE (MOD_0F73_REG_6) },
2682 { MOD_TABLE (MOD_0F73_REG_7) },
2686 { "montmul", { { OP_0f07, 0 } } },
2687 { "xsha1", { { OP_0f07, 0 } } },
2688 { "xsha256", { { OP_0f07, 0 } } },
2692 { "xstore-rng", { { OP_0f07, 0 } } },
2693 { "xcrypt-ecb", { { OP_0f07, 0 } } },
2694 { "xcrypt-cbc", { { OP_0f07, 0 } } },
2695 { "xcrypt-ctr", { { OP_0f07, 0 } } },
2696 { "xcrypt-cfb", { { OP_0f07, 0 } } },
2697 { "xcrypt-ofb", { { OP_0f07, 0 } } },
2701 { MOD_TABLE (MOD_0FAE_REG_0) },
2702 { MOD_TABLE (MOD_0FAE_REG_1) },
2703 { MOD_TABLE (MOD_0FAE_REG_2) },
2704 { MOD_TABLE (MOD_0FAE_REG_3) },
2705 { MOD_TABLE (MOD_0FAE_REG_4) },
2706 { MOD_TABLE (MOD_0FAE_REG_5) },
2707 { MOD_TABLE (MOD_0FAE_REG_6) },
2708 { MOD_TABLE (MOD_0FAE_REG_7) },
2716 { "btQ", { Ev, Ib } },
2717 { "btsQ", { Ev, Ib } },
2718 { "btrQ", { Ev, Ib } },
2719 { "btcQ", { Ev, Ib } },
2724 { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } } },
2729 { MOD_TABLE (MOD_0FC7_REG_6) },
2730 { MOD_TABLE (MOD_0FC7_REG_7) },
2736 { MOD_TABLE (MOD_VEX_0F71_REG_2) },
2738 { MOD_TABLE (MOD_VEX_0F71_REG_4) },
2740 { MOD_TABLE (MOD_VEX_0F71_REG_6) },
2746 { MOD_TABLE (MOD_VEX_0F72_REG_2) },
2748 { MOD_TABLE (MOD_VEX_0F72_REG_4) },
2750 { MOD_TABLE (MOD_VEX_0F72_REG_6) },
2756 { MOD_TABLE (MOD_VEX_0F73_REG_2) },
2757 { MOD_TABLE (MOD_VEX_0F73_REG_3) },
2760 { MOD_TABLE (MOD_VEX_0F73_REG_6) },
2761 { MOD_TABLE (MOD_VEX_0F73_REG_7) },
2767 { MOD_TABLE (MOD_VEX_0FAE_REG_2) },
2768 { MOD_TABLE (MOD_VEX_0FAE_REG_3) },
2770 /* REG_VEX_0F38F3 */
2773 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_1) },
2774 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_2) },
2775 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_3) },
2779 { "llwpcb", { { OP_LWPCB_E, 0 } } },
2780 { "slwpcb", { { OP_LWPCB_E, 0 } } },
2784 { "lwpins", { { OP_LWP_E, 0 }, Ed, Iq } },
2785 { "lwpval", { { OP_LWP_E, 0 }, Ed, Iq } },
2787 /* REG_XOP_TBM_01 */
2790 { "blcfill", { { OP_LWP_E, 0 }, Ev } },
2791 { "blsfill", { { OP_LWP_E, 0 }, Ev } },
2792 { "blcs", { { OP_LWP_E, 0 }, Ev } },
2793 { "tzmsk", { { OP_LWP_E, 0 }, Ev } },
2794 { "blcic", { { OP_LWP_E, 0 }, Ev } },
2795 { "blsic", { { OP_LWP_E, 0 }, Ev } },
2796 { "t1mskc", { { OP_LWP_E, 0 }, Ev } },
2798 /* REG_XOP_TBM_02 */
2801 { "blcmsk", { { OP_LWP_E, 0 }, Ev } },
2806 { "blci", { { OP_LWP_E, 0 }, Ev } },
2810 static const struct dis386 prefix_table[][4] = {
2813 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
2814 { "pause", { XX } },
2815 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } } },
2820 { "movups", { XM, EXx } },
2821 { "movss", { XM, EXd } },
2822 { "movupd", { XM, EXx } },
2823 { "movsd", { XM, EXq } },
2828 { "movups", { EXxS, XM } },
2829 { "movss", { EXdS, XM } },
2830 { "movupd", { EXxS, XM } },
2831 { "movsd", { EXqS, XM } },
2836 { MOD_TABLE (MOD_0F12_PREFIX_0) },
2837 { "movsldup", { XM, EXx } },
2838 { "movlpd", { XM, EXq } },
2839 { "movddup", { XM, EXq } },
2844 { MOD_TABLE (MOD_0F16_PREFIX_0) },
2845 { "movshdup", { XM, EXx } },
2846 { "movhpd", { XM, EXq } },
2851 { "cvtpi2ps", { XM, EMCq } },
2852 { "cvtsi2ss%LQ", { XM, Ev } },
2853 { "cvtpi2pd", { XM, EMCq } },
2854 { "cvtsi2sd%LQ", { XM, Ev } },
2859 { MOD_TABLE (MOD_0F2B_PREFIX_0) },
2860 { MOD_TABLE (MOD_0F2B_PREFIX_1) },
2861 { MOD_TABLE (MOD_0F2B_PREFIX_2) },
2862 { MOD_TABLE (MOD_0F2B_PREFIX_3) },
2867 { "cvttps2pi", { MXC, EXq } },
2868 { "cvttss2siY", { Gv, EXd } },
2869 { "cvttpd2pi", { MXC, EXx } },
2870 { "cvttsd2siY", { Gv, EXq } },
2875 { "cvtps2pi", { MXC, EXq } },
2876 { "cvtss2siY", { Gv, EXd } },
2877 { "cvtpd2pi", { MXC, EXx } },
2878 { "cvtsd2siY", { Gv, EXq } },
2883 { "ucomiss",{ XM, EXd } },
2885 { "ucomisd",{ XM, EXq } },
2890 { "comiss", { XM, EXd } },
2892 { "comisd", { XM, EXq } },
2897 { "sqrtps", { XM, EXx } },
2898 { "sqrtss", { XM, EXd } },
2899 { "sqrtpd", { XM, EXx } },
2900 { "sqrtsd", { XM, EXq } },
2905 { "rsqrtps",{ XM, EXx } },
2906 { "rsqrtss",{ XM, EXd } },
2911 { "rcpps", { XM, EXx } },
2912 { "rcpss", { XM, EXd } },
2917 { "addps", { XM, EXx } },
2918 { "addss", { XM, EXd } },
2919 { "addpd", { XM, EXx } },
2920 { "addsd", { XM, EXq } },
2925 { "mulps", { XM, EXx } },
2926 { "mulss", { XM, EXd } },
2927 { "mulpd", { XM, EXx } },
2928 { "mulsd", { XM, EXq } },
2933 { "cvtps2pd", { XM, EXq } },
2934 { "cvtss2sd", { XM, EXd } },
2935 { "cvtpd2ps", { XM, EXx } },
2936 { "cvtsd2ss", { XM, EXq } },
2941 { "cvtdq2ps", { XM, EXx } },
2942 { "cvttps2dq", { XM, EXx } },
2943 { "cvtps2dq", { XM, EXx } },
2948 { "subps", { XM, EXx } },
2949 { "subss", { XM, EXd } },
2950 { "subpd", { XM, EXx } },
2951 { "subsd", { XM, EXq } },
2956 { "minps", { XM, EXx } },
2957 { "minss", { XM, EXd } },
2958 { "minpd", { XM, EXx } },
2959 { "minsd", { XM, EXq } },
2964 { "divps", { XM, EXx } },
2965 { "divss", { XM, EXd } },
2966 { "divpd", { XM, EXx } },
2967 { "divsd", { XM, EXq } },
2972 { "maxps", { XM, EXx } },
2973 { "maxss", { XM, EXd } },
2974 { "maxpd", { XM, EXx } },
2975 { "maxsd", { XM, EXq } },
2980 { "punpcklbw",{ MX, EMd } },
2982 { "punpcklbw",{ MX, EMx } },
2987 { "punpcklwd",{ MX, EMd } },
2989 { "punpcklwd",{ MX, EMx } },
2994 { "punpckldq",{ MX, EMd } },
2996 { "punpckldq",{ MX, EMx } },
3003 { "punpcklqdq", { XM, EXx } },
3010 { "punpckhqdq", { XM, EXx } },
3015 { "movq", { MX, EM } },
3016 { "movdqu", { XM, EXx } },
3017 { "movdqa", { XM, EXx } },
3022 { "pshufw", { MX, EM, Ib } },
3023 { "pshufhw",{ XM, EXx, Ib } },
3024 { "pshufd", { XM, EXx, Ib } },
3025 { "pshuflw",{ XM, EXx, Ib } },
3028 /* PREFIX_0F73_REG_3 */
3032 { "psrldq", { XS, Ib } },
3035 /* PREFIX_0F73_REG_7 */
3039 { "pslldq", { XS, Ib } },
3044 {"vmread", { Em, Gm } },
3046 {"extrq", { XS, Ib, Ib } },
3047 {"insertq", { XM, XS, Ib, Ib } },
3052 {"vmwrite", { Gm, Em } },
3054 {"extrq", { XM, XS } },
3055 {"insertq", { XM, XS } },
3062 { "haddpd", { XM, EXx } },
3063 { "haddps", { XM, EXx } },
3070 { "hsubpd", { XM, EXx } },
3071 { "hsubps", { XM, EXx } },
3076 { "movK", { Edq, MX } },
3077 { "movq", { XM, EXq } },
3078 { "movK", { Edq, XM } },
3083 { "movq", { EMS, MX } },
3084 { "movdqu", { EXxS, XM } },
3085 { "movdqa", { EXxS, XM } },
3088 /* PREFIX_0FAE_REG_0 */
3091 { "rdfsbase", { Ev } },
3094 /* PREFIX_0FAE_REG_1 */
3097 { "rdgsbase", { Ev } },
3100 /* PREFIX_0FAE_REG_2 */
3103 { "wrfsbase", { Ev } },
3106 /* PREFIX_0FAE_REG_3 */
3109 { "wrgsbase", { Ev } },
3115 { "popcntS", { Gv, Ev } },
3120 { "bsfS", { Gv, Ev } },
3121 { "tzcntS", { Gv, Ev } },
3122 { "bsfS", { Gv, Ev } },
3127 { "bsrS", { Gv, Ev } },
3128 { "lzcntS", { Gv, Ev } },
3129 { "bsrS", { Gv, Ev } },
3134 { "cmpps", { XM, EXx, CMP } },
3135 { "cmpss", { XM, EXd, CMP } },
3136 { "cmppd", { XM, EXx, CMP } },
3137 { "cmpsd", { XM, EXq, CMP } },
3142 { "movntiS", { Ma, Gv } },
3145 /* PREFIX_0FC7_REG_6 */
3147 { "vmptrld",{ Mq } },
3148 { "vmxon", { Mq } },
3149 { "vmclear",{ Mq } },
3156 { "addsubpd", { XM, EXx } },
3157 { "addsubps", { XM, EXx } },
3163 { "movq2dq",{ XM, MS } },
3164 { "movq", { EXqS, XM } },
3165 { "movdq2q",{ MX, XS } },
3171 { "cvtdq2pd", { XM, EXq } },
3172 { "cvttpd2dq", { XM, EXx } },
3173 { "cvtpd2dq", { XM, EXx } },
3178 { "movntq", { Mq, MX } },
3180 { MOD_TABLE (MOD_0FE7_PREFIX_2) },
3188 { MOD_TABLE (MOD_0FF0_PREFIX_3) },
3193 { "maskmovq", { MX, MS } },
3195 { "maskmovdqu", { XM, XS } },
3202 { "pblendvb", { XM, EXx, XMM0 } },
3209 { "blendvps", { XM, EXx, XMM0 } },
3216 { "blendvpd", { XM, EXx, XMM0 } },
3223 { "ptest", { XM, EXx } },
3230 { "pmovsxbw", { XM, EXq } },
3237 { "pmovsxbd", { XM, EXd } },
3244 { "pmovsxbq", { XM, EXw } },
3251 { "pmovsxwd", { XM, EXq } },
3258 { "pmovsxwq", { XM, EXd } },
3265 { "pmovsxdq", { XM, EXq } },
3272 { "pmuldq", { XM, EXx } },
3279 { "pcmpeqq", { XM, EXx } },
3286 { MOD_TABLE (MOD_0F382A_PREFIX_2) },
3293 { "packusdw", { XM, EXx } },
3300 { "pmovzxbw", { XM, EXq } },
3307 { "pmovzxbd", { XM, EXd } },
3314 { "pmovzxbq", { XM, EXw } },
3321 { "pmovzxwd", { XM, EXq } },
3328 { "pmovzxwq", { XM, EXd } },
3335 { "pmovzxdq", { XM, EXq } },
3342 { "pcmpgtq", { XM, EXx } },
3349 { "pminsb", { XM, EXx } },
3356 { "pminsd", { XM, EXx } },
3363 { "pminuw", { XM, EXx } },
3370 { "pminud", { XM, EXx } },
3377 { "pmaxsb", { XM, EXx } },
3384 { "pmaxsd", { XM, EXx } },
3391 { "pmaxuw", { XM, EXx } },
3398 { "pmaxud", { XM, EXx } },
3405 { "pmulld", { XM, EXx } },
3412 { "phminposuw", { XM, EXx } },
3419 { "invept", { Gm, Mo } },
3426 { "invvpid", { Gm, Mo } },
3433 { "aesimc", { XM, EXx } },
3440 { "aesenc", { XM, EXx } },
3447 { "aesenclast", { XM, EXx } },
3454 { "aesdec", { XM, EXx } },
3461 { "aesdeclast", { XM, EXx } },
3466 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } } },
3468 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } } },
3469 { "crc32", { Gdq, { CRC32_Fixup, b_mode } } },
3474 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv } },
3476 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv } },
3477 { "crc32", { Gdq, { CRC32_Fixup, v_mode } } },
3484 { "roundps", { XM, EXx, Ib } },
3491 { "roundpd", { XM, EXx, Ib } },
3498 { "roundss", { XM, EXd, Ib } },
3505 { "roundsd", { XM, EXq, Ib } },
3512 { "blendps", { XM, EXx, Ib } },
3519 { "blendpd", { XM, EXx, Ib } },
3526 { "pblendw", { XM, EXx, Ib } },
3533 { "pextrb", { Edqb, XM, Ib } },
3540 { "pextrw", { Edqw, XM, Ib } },
3547 { "pextrK", { Edq, XM, Ib } },
3554 { "extractps", { Edqd, XM, Ib } },
3561 { "pinsrb", { XM, Edqb, Ib } },
3568 { "insertps", { XM, EXd, Ib } },
3575 { "pinsrK", { XM, Edq, Ib } },
3582 { "dpps", { XM, EXx, Ib } },
3589 { "dppd", { XM, EXx, Ib } },
3596 { "mpsadbw", { XM, EXx, Ib } },
3603 { "pclmulqdq", { XM, EXx, PCLMUL } },
3610 { "pcmpestrm", { XM, EXx, Ib } },
3617 { "pcmpestri", { XM, EXx, Ib } },
3624 { "pcmpistrm", { XM, EXx, Ib } },
3631 { "pcmpistri", { XM, EXx, Ib } },
3638 { "aeskeygenassist", { XM, EXx, Ib } },
3641 /* PREFIX_VEX_0F10 */
3643 { VEX_W_TABLE (VEX_W_0F10_P_0) },
3644 { VEX_LEN_TABLE (VEX_LEN_0F10_P_1) },
3645 { VEX_W_TABLE (VEX_W_0F10_P_2) },
3646 { VEX_LEN_TABLE (VEX_LEN_0F10_P_3) },
3649 /* PREFIX_VEX_0F11 */
3651 { VEX_W_TABLE (VEX_W_0F11_P_0) },
3652 { VEX_LEN_TABLE (VEX_LEN_0F11_P_1) },
3653 { VEX_W_TABLE (VEX_W_0F11_P_2) },
3654 { VEX_LEN_TABLE (VEX_LEN_0F11_P_3) },
3657 /* PREFIX_VEX_0F12 */
3659 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0) },
3660 { VEX_W_TABLE (VEX_W_0F12_P_1) },
3661 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2) },
3662 { VEX_W_TABLE (VEX_W_0F12_P_3) },
3665 /* PREFIX_VEX_0F16 */
3667 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0) },
3668 { VEX_W_TABLE (VEX_W_0F16_P_1) },
3669 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2) },
3672 /* PREFIX_VEX_0F2A */
3675 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_1) },
3677 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_3) },
3680 /* PREFIX_VEX_0F2C */
3683 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_1) },
3685 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_3) },
3688 /* PREFIX_VEX_0F2D */
3691 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_1) },
3693 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_3) },
3696 /* PREFIX_VEX_0F2E */
3698 { VEX_LEN_TABLE (VEX_LEN_0F2E_P_0) },
3700 { VEX_LEN_TABLE (VEX_LEN_0F2E_P_2) },
3703 /* PREFIX_VEX_0F2F */
3705 { VEX_LEN_TABLE (VEX_LEN_0F2F_P_0) },
3707 { VEX_LEN_TABLE (VEX_LEN_0F2F_P_2) },
3710 /* PREFIX_VEX_0F51 */
3712 { VEX_W_TABLE (VEX_W_0F51_P_0) },
3713 { VEX_LEN_TABLE (VEX_LEN_0F51_P_1) },
3714 { VEX_W_TABLE (VEX_W_0F51_P_2) },
3715 { VEX_LEN_TABLE (VEX_LEN_0F51_P_3) },
3718 /* PREFIX_VEX_0F52 */
3720 { VEX_W_TABLE (VEX_W_0F52_P_0) },
3721 { VEX_LEN_TABLE (VEX_LEN_0F52_P_1) },
3724 /* PREFIX_VEX_0F53 */
3726 { VEX_W_TABLE (VEX_W_0F53_P_0) },
3727 { VEX_LEN_TABLE (VEX_LEN_0F53_P_1) },
3730 /* PREFIX_VEX_0F58 */
3732 { VEX_W_TABLE (VEX_W_0F58_P_0) },
3733 { VEX_LEN_TABLE (VEX_LEN_0F58_P_1) },
3734 { VEX_W_TABLE (VEX_W_0F58_P_2) },
3735 { VEX_LEN_TABLE (VEX_LEN_0F58_P_3) },
3738 /* PREFIX_VEX_0F59 */
3740 { VEX_W_TABLE (VEX_W_0F59_P_0) },
3741 { VEX_LEN_TABLE (VEX_LEN_0F59_P_1) },
3742 { VEX_W_TABLE (VEX_W_0F59_P_2) },
3743 { VEX_LEN_TABLE (VEX_LEN_0F59_P_3) },
3746 /* PREFIX_VEX_0F5A */
3748 { VEX_W_TABLE (VEX_W_0F5A_P_0) },
3749 { VEX_LEN_TABLE (VEX_LEN_0F5A_P_1) },
3750 { "vcvtpd2ps%XY", { XMM, EXx } },
3751 { VEX_LEN_TABLE (VEX_LEN_0F5A_P_3) },
3754 /* PREFIX_VEX_0F5B */
3756 { VEX_W_TABLE (VEX_W_0F5B_P_0) },
3757 { VEX_W_TABLE (VEX_W_0F5B_P_1) },
3758 { VEX_W_TABLE (VEX_W_0F5B_P_2) },
3761 /* PREFIX_VEX_0F5C */
3763 { VEX_W_TABLE (VEX_W_0F5C_P_0) },
3764 { VEX_LEN_TABLE (VEX_LEN_0F5C_P_1) },
3765 { VEX_W_TABLE (VEX_W_0F5C_P_2) },
3766 { VEX_LEN_TABLE (VEX_LEN_0F5C_P_3) },
3769 /* PREFIX_VEX_0F5D */
3771 { VEX_W_TABLE (VEX_W_0F5D_P_0) },
3772 { VEX_LEN_TABLE (VEX_LEN_0F5D_P_1) },
3773 { VEX_W_TABLE (VEX_W_0F5D_P_2) },
3774 { VEX_LEN_TABLE (VEX_LEN_0F5D_P_3) },
3777 /* PREFIX_VEX_0F5E */
3779 { VEX_W_TABLE (VEX_W_0F5E_P_0) },
3780 { VEX_LEN_TABLE (VEX_LEN_0F5E_P_1) },
3781 { VEX_W_TABLE (VEX_W_0F5E_P_2) },
3782 { VEX_LEN_TABLE (VEX_LEN_0F5E_P_3) },
3785 /* PREFIX_VEX_0F5F */
3787 { VEX_W_TABLE (VEX_W_0F5F_P_0) },
3788 { VEX_LEN_TABLE (VEX_LEN_0F5F_P_1) },
3789 { VEX_W_TABLE (VEX_W_0F5F_P_2) },
3790 { VEX_LEN_TABLE (VEX_LEN_0F5F_P_3) },
3793 /* PREFIX_VEX_0F60 */
3797 { VEX_LEN_TABLE (VEX_LEN_0F60_P_2) },
3800 /* PREFIX_VEX_0F61 */
3804 { VEX_LEN_TABLE (VEX_LEN_0F61_P_2) },
3807 /* PREFIX_VEX_0F62 */
3811 { VEX_LEN_TABLE (VEX_LEN_0F62_P_2) },
3814 /* PREFIX_VEX_0F63 */
3818 { VEX_LEN_TABLE (VEX_LEN_0F63_P_2) },
3821 /* PREFIX_VEX_0F64 */
3825 { VEX_LEN_TABLE (VEX_LEN_0F64_P_2) },
3828 /* PREFIX_VEX_0F65 */
3832 { VEX_LEN_TABLE (VEX_LEN_0F65_P_2) },
3835 /* PREFIX_VEX_0F66 */
3839 { VEX_LEN_TABLE (VEX_LEN_0F66_P_2) },
3842 /* PREFIX_VEX_0F67 */
3846 { VEX_LEN_TABLE (VEX_LEN_0F67_P_2) },
3849 /* PREFIX_VEX_0F68 */
3853 { VEX_LEN_TABLE (VEX_LEN_0F68_P_2) },
3856 /* PREFIX_VEX_0F69 */
3860 { VEX_LEN_TABLE (VEX_LEN_0F69_P_2) },
3863 /* PREFIX_VEX_0F6A */
3867 { VEX_LEN_TABLE (VEX_LEN_0F6A_P_2) },
3870 /* PREFIX_VEX_0F6B */
3874 { VEX_LEN_TABLE (VEX_LEN_0F6B_P_2) },
3877 /* PREFIX_VEX_0F6C */
3881 { VEX_LEN_TABLE (VEX_LEN_0F6C_P_2) },
3884 /* PREFIX_VEX_0F6D */
3888 { VEX_LEN_TABLE (VEX_LEN_0F6D_P_2) },
3891 /* PREFIX_VEX_0F6E */
3895 { VEX_LEN_TABLE (VEX_LEN_0F6E_P_2) },
3898 /* PREFIX_VEX_0F6F */
3901 { VEX_W_TABLE (VEX_W_0F6F_P_1) },
3902 { VEX_W_TABLE (VEX_W_0F6F_P_2) },
3905 /* PREFIX_VEX_0F70 */
3908 { VEX_LEN_TABLE (VEX_LEN_0F70_P_1) },
3909 { VEX_LEN_TABLE (VEX_LEN_0F70_P_2) },
3910 { VEX_LEN_TABLE (VEX_LEN_0F70_P_3) },
3913 /* PREFIX_VEX_0F71_REG_2 */
3917 { VEX_LEN_TABLE (VEX_LEN_0F71_R_2_P_2) },
3920 /* PREFIX_VEX_0F71_REG_4 */
3924 { VEX_LEN_TABLE (VEX_LEN_0F71_R_4_P_2) },
3927 /* PREFIX_VEX_0F71_REG_6 */
3931 { VEX_LEN_TABLE (VEX_LEN_0F71_R_6_P_2) },
3934 /* PREFIX_VEX_0F72_REG_2 */
3938 { VEX_LEN_TABLE (VEX_LEN_0F72_R_2_P_2) },
3941 /* PREFIX_VEX_0F72_REG_4 */
3945 { VEX_LEN_TABLE (VEX_LEN_0F72_R_4_P_2) },
3948 /* PREFIX_VEX_0F72_REG_6 */
3952 { VEX_LEN_TABLE (VEX_LEN_0F72_R_6_P_2) },
3955 /* PREFIX_VEX_0F73_REG_2 */
3959 { VEX_LEN_TABLE (VEX_LEN_0F73_R_2_P_2) },
3962 /* PREFIX_VEX_0F73_REG_3 */
3966 { VEX_LEN_TABLE (VEX_LEN_0F73_R_3_P_2) },
3969 /* PREFIX_VEX_0F73_REG_6 */
3973 { VEX_LEN_TABLE (VEX_LEN_0F73_R_6_P_2) },
3976 /* PREFIX_VEX_0F73_REG_7 */
3980 { VEX_LEN_TABLE (VEX_LEN_0F73_R_7_P_2) },
3983 /* PREFIX_VEX_0F74 */
3987 { VEX_LEN_TABLE (VEX_LEN_0F74_P_2) },
3990 /* PREFIX_VEX_0F75 */
3994 { VEX_LEN_TABLE (VEX_LEN_0F75_P_2) },
3997 /* PREFIX_VEX_0F76 */
4001 { VEX_LEN_TABLE (VEX_LEN_0F76_P_2) },
4004 /* PREFIX_VEX_0F77 */
4006 { VEX_W_TABLE (VEX_W_0F77_P_0) },
4009 /* PREFIX_VEX_0F7C */
4013 { VEX_W_TABLE (VEX_W_0F7C_P_2) },
4014 { VEX_W_TABLE (VEX_W_0F7C_P_3) },
4017 /* PREFIX_VEX_0F7D */
4021 { VEX_W_TABLE (VEX_W_0F7D_P_2) },
4022 { VEX_W_TABLE (VEX_W_0F7D_P_3) },
4025 /* PREFIX_VEX_0F7E */
4028 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1) },
4029 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2) },
4032 /* PREFIX_VEX_0F7F */
4035 { VEX_W_TABLE (VEX_W_0F7F_P_1) },
4036 { VEX_W_TABLE (VEX_W_0F7F_P_2) },
4039 /* PREFIX_VEX_0FC2 */
4041 { VEX_W_TABLE (VEX_W_0FC2_P_0) },
4042 { VEX_LEN_TABLE (VEX_LEN_0FC2_P_1) },
4043 { VEX_W_TABLE (VEX_W_0FC2_P_2) },
4044 { VEX_LEN_TABLE (VEX_LEN_0FC2_P_3) },
4047 /* PREFIX_VEX_0FC4 */
4051 { VEX_LEN_TABLE (VEX_LEN_0FC4_P_2) },
4054 /* PREFIX_VEX_0FC5 */
4058 { VEX_LEN_TABLE (VEX_LEN_0FC5_P_2) },
4061 /* PREFIX_VEX_0FD0 */
4065 { VEX_W_TABLE (VEX_W_0FD0_P_2) },
4066 { VEX_W_TABLE (VEX_W_0FD0_P_3) },
4069 /* PREFIX_VEX_0FD1 */
4073 { VEX_LEN_TABLE (VEX_LEN_0FD1_P_2) },
4076 /* PREFIX_VEX_0FD2 */
4080 { VEX_LEN_TABLE (VEX_LEN_0FD2_P_2) },
4083 /* PREFIX_VEX_0FD3 */
4087 { VEX_LEN_TABLE (VEX_LEN_0FD3_P_2) },
4090 /* PREFIX_VEX_0FD4 */
4094 { VEX_LEN_TABLE (VEX_LEN_0FD4_P_2) },
4097 /* PREFIX_VEX_0FD5 */
4101 { VEX_LEN_TABLE (VEX_LEN_0FD5_P_2) },
4104 /* PREFIX_VEX_0FD6 */
4108 { VEX_LEN_TABLE (VEX_LEN_0FD6_P_2) },
4111 /* PREFIX_VEX_0FD7 */
4115 { MOD_TABLE (MOD_VEX_0FD7_PREFIX_2) },
4118 /* PREFIX_VEX_0FD8 */
4122 { VEX_LEN_TABLE (VEX_LEN_0FD8_P_2) },
4125 /* PREFIX_VEX_0FD9 */
4129 { VEX_LEN_TABLE (VEX_LEN_0FD9_P_2) },
4132 /* PREFIX_VEX_0FDA */
4136 { VEX_LEN_TABLE (VEX_LEN_0FDA_P_2) },
4139 /* PREFIX_VEX_0FDB */
4143 { VEX_LEN_TABLE (VEX_LEN_0FDB_P_2) },
4146 /* PREFIX_VEX_0FDC */
4150 { VEX_LEN_TABLE (VEX_LEN_0FDC_P_2) },
4153 /* PREFIX_VEX_0FDD */
4157 { VEX_LEN_TABLE (VEX_LEN_0FDD_P_2) },
4160 /* PREFIX_VEX_0FDE */
4164 { VEX_LEN_TABLE (VEX_LEN_0FDE_P_2) },
4167 /* PREFIX_VEX_0FDF */
4171 { VEX_LEN_TABLE (VEX_LEN_0FDF_P_2) },
4174 /* PREFIX_VEX_0FE0 */
4178 { VEX_LEN_TABLE (VEX_LEN_0FE0_P_2) },
4181 /* PREFIX_VEX_0FE1 */
4185 { VEX_LEN_TABLE (VEX_LEN_0FE1_P_2) },
4188 /* PREFIX_VEX_0FE2 */
4192 { VEX_LEN_TABLE (VEX_LEN_0FE2_P_2) },
4195 /* PREFIX_VEX_0FE3 */
4199 { VEX_LEN_TABLE (VEX_LEN_0FE3_P_2) },
4202 /* PREFIX_VEX_0FE4 */
4206 { VEX_LEN_TABLE (VEX_LEN_0FE4_P_2) },
4209 /* PREFIX_VEX_0FE5 */
4213 { VEX_LEN_TABLE (VEX_LEN_0FE5_P_2) },
4216 /* PREFIX_VEX_0FE6 */
4219 { VEX_W_TABLE (VEX_W_0FE6_P_1) },
4220 { VEX_W_TABLE (VEX_W_0FE6_P_2) },
4221 { VEX_W_TABLE (VEX_W_0FE6_P_3) },
4224 /* PREFIX_VEX_0FE7 */
4228 { MOD_TABLE (MOD_VEX_0FE7_PREFIX_2) },
4231 /* PREFIX_VEX_0FE8 */
4235 { VEX_LEN_TABLE (VEX_LEN_0FE8_P_2) },
4238 /* PREFIX_VEX_0FE9 */
4242 { VEX_LEN_TABLE (VEX_LEN_0FE9_P_2) },
4245 /* PREFIX_VEX_0FEA */
4249 { VEX_LEN_TABLE (VEX_LEN_0FEA_P_2) },
4252 /* PREFIX_VEX_0FEB */
4256 { VEX_LEN_TABLE (VEX_LEN_0FEB_P_2) },
4259 /* PREFIX_VEX_0FEC */
4263 { VEX_LEN_TABLE (VEX_LEN_0FEC_P_2) },
4266 /* PREFIX_VEX_0FED */
4270 { VEX_LEN_TABLE (VEX_LEN_0FED_P_2) },
4273 /* PREFIX_VEX_0FEE */
4277 { VEX_LEN_TABLE (VEX_LEN_0FEE_P_2) },
4280 /* PREFIX_VEX_0FEF */
4284 { VEX_LEN_TABLE (VEX_LEN_0FEF_P_2) },
4287 /* PREFIX_VEX_0FF0 */
4292 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3) },
4295 /* PREFIX_VEX_0FF1 */
4299 { VEX_LEN_TABLE (VEX_LEN_0FF1_P_2) },
4302 /* PREFIX_VEX_0FF2 */
4306 { VEX_LEN_TABLE (VEX_LEN_0FF2_P_2) },
4309 /* PREFIX_VEX_0FF3 */
4313 { VEX_LEN_TABLE (VEX_LEN_0FF3_P_2) },
4316 /* PREFIX_VEX_0FF4 */
4320 { VEX_LEN_TABLE (VEX_LEN_0FF4_P_2) },
4323 /* PREFIX_VEX_0FF5 */
4327 { VEX_LEN_TABLE (VEX_LEN_0FF5_P_2) },
4330 /* PREFIX_VEX_0FF6 */
4334 { VEX_LEN_TABLE (VEX_LEN_0FF6_P_2) },
4337 /* PREFIX_VEX_0FF7 */
4341 { VEX_LEN_TABLE (VEX_LEN_0FF7_P_2) },
4344 /* PREFIX_VEX_0FF8 */
4348 { VEX_LEN_TABLE (VEX_LEN_0FF8_P_2) },
4351 /* PREFIX_VEX_0FF9 */
4355 { VEX_LEN_TABLE (VEX_LEN_0FF9_P_2) },
4358 /* PREFIX_VEX_0FFA */
4362 { VEX_LEN_TABLE (VEX_LEN_0FFA_P_2) },
4365 /* PREFIX_VEX_0FFB */
4369 { VEX_LEN_TABLE (VEX_LEN_0FFB_P_2) },
4372 /* PREFIX_VEX_0FFC */
4376 { VEX_LEN_TABLE (VEX_LEN_0FFC_P_2) },
4379 /* PREFIX_VEX_0FFD */
4383 { VEX_LEN_TABLE (VEX_LEN_0FFD_P_2) },
4386 /* PREFIX_VEX_0FFE */
4390 { VEX_LEN_TABLE (VEX_LEN_0FFE_P_2) },
4393 /* PREFIX_VEX_0F3800 */
4397 { VEX_LEN_TABLE (VEX_LEN_0F3800_P_2) },
4400 /* PREFIX_VEX_0F3801 */
4404 { VEX_LEN_TABLE (VEX_LEN_0F3801_P_2) },
4407 /* PREFIX_VEX_0F3802 */
4411 { VEX_LEN_TABLE (VEX_LEN_0F3802_P_2) },
4414 /* PREFIX_VEX_0F3803 */
4418 { VEX_LEN_TABLE (VEX_LEN_0F3803_P_2) },
4421 /* PREFIX_VEX_0F3804 */
4425 { VEX_LEN_TABLE (VEX_LEN_0F3804_P_2) },
4428 /* PREFIX_VEX_0F3805 */
4432 { VEX_LEN_TABLE (VEX_LEN_0F3805_P_2) },
4435 /* PREFIX_VEX_0F3806 */
4439 { VEX_LEN_TABLE (VEX_LEN_0F3806_P_2) },
4442 /* PREFIX_VEX_0F3807 */
4446 { VEX_LEN_TABLE (VEX_LEN_0F3807_P_2) },
4449 /* PREFIX_VEX_0F3808 */
4453 { VEX_LEN_TABLE (VEX_LEN_0F3808_P_2) },
4456 /* PREFIX_VEX_0F3809 */
4460 { VEX_LEN_TABLE (VEX_LEN_0F3809_P_2) },
4463 /* PREFIX_VEX_0F380A */
4467 { VEX_LEN_TABLE (VEX_LEN_0F380A_P_2) },
4470 /* PREFIX_VEX_0F380B */
4474 { VEX_LEN_TABLE (VEX_LEN_0F380B_P_2) },
4477 /* PREFIX_VEX_0F380C */
4481 { VEX_W_TABLE (VEX_W_0F380C_P_2) },
4484 /* PREFIX_VEX_0F380D */
4488 { VEX_W_TABLE (VEX_W_0F380D_P_2) },
4491 /* PREFIX_VEX_0F380E */
4495 { VEX_W_TABLE (VEX_W_0F380E_P_2) },
4498 /* PREFIX_VEX_0F380F */
4502 { VEX_W_TABLE (VEX_W_0F380F_P_2) },
4505 /* PREFIX_VEX_0F3813 */
4509 { "vcvtph2ps", { XM, EXxmmq } },
4512 /* PREFIX_VEX_0F3817 */
4516 { VEX_W_TABLE (VEX_W_0F3817_P_2) },
4519 /* PREFIX_VEX_0F3818 */
4523 { MOD_TABLE (MOD_VEX_0F3818_PREFIX_2) },
4526 /* PREFIX_VEX_0F3819 */
4530 { MOD_TABLE (MOD_VEX_0F3819_PREFIX_2) },
4533 /* PREFIX_VEX_0F381A */
4537 { MOD_TABLE (MOD_VEX_0F381A_PREFIX_2) },
4540 /* PREFIX_VEX_0F381C */
4544 { VEX_LEN_TABLE (VEX_LEN_0F381C_P_2) },
4547 /* PREFIX_VEX_0F381D */
4551 { VEX_LEN_TABLE (VEX_LEN_0F381D_P_2) },
4554 /* PREFIX_VEX_0F381E */
4558 { VEX_LEN_TABLE (VEX_LEN_0F381E_P_2) },
4561 /* PREFIX_VEX_0F3820 */
4565 { VEX_LEN_TABLE (VEX_LEN_0F3820_P_2) },
4568 /* PREFIX_VEX_0F3821 */
4572 { VEX_LEN_TABLE (VEX_LEN_0F3821_P_2) },
4575 /* PREFIX_VEX_0F3822 */
4579 { VEX_LEN_TABLE (VEX_LEN_0F3822_P_2) },
4582 /* PREFIX_VEX_0F3823 */
4586 { VEX_LEN_TABLE (VEX_LEN_0F3823_P_2) },
4589 /* PREFIX_VEX_0F3824 */
4593 { VEX_LEN_TABLE (VEX_LEN_0F3824_P_2) },
4596 /* PREFIX_VEX_0F3825 */
4600 { VEX_LEN_TABLE (VEX_LEN_0F3825_P_2) },
4603 /* PREFIX_VEX_0F3828 */
4607 { VEX_LEN_TABLE (VEX_LEN_0F3828_P_2) },
4610 /* PREFIX_VEX_0F3829 */
4614 { VEX_LEN_TABLE (VEX_LEN_0F3829_P_2) },
4617 /* PREFIX_VEX_0F382A */
4621 { MOD_TABLE (MOD_VEX_0F382A_PREFIX_2) },
4624 /* PREFIX_VEX_0F382B */
4628 { VEX_LEN_TABLE (VEX_LEN_0F382B_P_2) },
4631 /* PREFIX_VEX_0F382C */
4635 { MOD_TABLE (MOD_VEX_0F382C_PREFIX_2) },
4638 /* PREFIX_VEX_0F382D */
4642 { MOD_TABLE (MOD_VEX_0F382D_PREFIX_2) },
4645 /* PREFIX_VEX_0F382E */
4649 { MOD_TABLE (MOD_VEX_0F382E_PREFIX_2) },
4652 /* PREFIX_VEX_0F382F */
4656 { MOD_TABLE (MOD_VEX_0F382F_PREFIX_2) },
4659 /* PREFIX_VEX_0F3830 */
4663 { VEX_LEN_TABLE (VEX_LEN_0F3830_P_2) },
4666 /* PREFIX_VEX_0F3831 */
4670 { VEX_LEN_TABLE (VEX_LEN_0F3831_P_2) },
4673 /* PREFIX_VEX_0F3832 */
4677 { VEX_LEN_TABLE (VEX_LEN_0F3832_P_2) },
4680 /* PREFIX_VEX_0F3833 */
4684 { VEX_LEN_TABLE (VEX_LEN_0F3833_P_2) },
4687 /* PREFIX_VEX_0F3834 */
4691 { VEX_LEN_TABLE (VEX_LEN_0F3834_P_2) },
4694 /* PREFIX_VEX_0F3835 */
4698 { VEX_LEN_TABLE (VEX_LEN_0F3835_P_2) },
4701 /* PREFIX_VEX_0F3837 */
4705 { VEX_LEN_TABLE (VEX_LEN_0F3837_P_2) },
4708 /* PREFIX_VEX_0F3838 */
4712 { VEX_LEN_TABLE (VEX_LEN_0F3838_P_2) },
4715 /* PREFIX_VEX_0F3839 */
4719 { VEX_LEN_TABLE (VEX_LEN_0F3839_P_2) },
4722 /* PREFIX_VEX_0F383A */
4726 { VEX_LEN_TABLE (VEX_LEN_0F383A_P_2) },
4729 /* PREFIX_VEX_0F383B */
4733 { VEX_LEN_TABLE (VEX_LEN_0F383B_P_2) },
4736 /* PREFIX_VEX_0F383C */
4740 { VEX_LEN_TABLE (VEX_LEN_0F383C_P_2) },
4743 /* PREFIX_VEX_0F383D */
4747 { VEX_LEN_TABLE (VEX_LEN_0F383D_P_2) },
4750 /* PREFIX_VEX_0F383E */
4754 { VEX_LEN_TABLE (VEX_LEN_0F383E_P_2) },
4757 /* PREFIX_VEX_0F383F */
4761 { VEX_LEN_TABLE (VEX_LEN_0F383F_P_2) },
4764 /* PREFIX_VEX_0F3840 */
4768 { VEX_LEN_TABLE (VEX_LEN_0F3840_P_2) },
4771 /* PREFIX_VEX_0F3841 */
4775 { VEX_LEN_TABLE (VEX_LEN_0F3841_P_2) },
4778 /* PREFIX_VEX_0F3896 */
4782 { "vfmaddsub132p%XW", { XM, Vex, EXx } },
4785 /* PREFIX_VEX_0F3897 */
4789 { "vfmsubadd132p%XW", { XM, Vex, EXx } },
4792 /* PREFIX_VEX_0F3898 */
4796 { "vfmadd132p%XW", { XM, Vex, EXx } },
4799 /* PREFIX_VEX_0F3899 */
4803 { "vfmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4806 /* PREFIX_VEX_0F389A */
4810 { "vfmsub132p%XW", { XM, Vex, EXx } },
4813 /* PREFIX_VEX_0F389B */
4817 { "vfmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4820 /* PREFIX_VEX_0F389C */
4824 { "vfnmadd132p%XW", { XM, Vex, EXx } },
4827 /* PREFIX_VEX_0F389D */
4831 { "vfnmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4834 /* PREFIX_VEX_0F389E */
4838 { "vfnmsub132p%XW", { XM, Vex, EXx } },
4841 /* PREFIX_VEX_0F389F */
4845 { "vfnmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4848 /* PREFIX_VEX_0F38A6 */
4852 { "vfmaddsub213p%XW", { XM, Vex, EXx } },
4856 /* PREFIX_VEX_0F38A7 */
4860 { "vfmsubadd213p%XW", { XM, Vex, EXx } },
4863 /* PREFIX_VEX_0F38A8 */
4867 { "vfmadd213p%XW", { XM, Vex, EXx } },
4870 /* PREFIX_VEX_0F38A9 */
4874 { "vfmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4877 /* PREFIX_VEX_0F38AA */
4881 { "vfmsub213p%XW", { XM, Vex, EXx } },
4884 /* PREFIX_VEX_0F38AB */
4888 { "vfmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4891 /* PREFIX_VEX_0F38AC */
4895 { "vfnmadd213p%XW", { XM, Vex, EXx } },
4898 /* PREFIX_VEX_0F38AD */
4902 { "vfnmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4905 /* PREFIX_VEX_0F38AE */
4909 { "vfnmsub213p%XW", { XM, Vex, EXx } },
4912 /* PREFIX_VEX_0F38AF */
4916 { "vfnmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4919 /* PREFIX_VEX_0F38B6 */
4923 { "vfmaddsub231p%XW", { XM, Vex, EXx } },
4926 /* PREFIX_VEX_0F38B7 */
4930 { "vfmsubadd231p%XW", { XM, Vex, EXx } },
4933 /* PREFIX_VEX_0F38B8 */
4937 { "vfmadd231p%XW", { XM, Vex, EXx } },
4940 /* PREFIX_VEX_0F38B9 */
4944 { "vfmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4947 /* PREFIX_VEX_0F38BA */
4951 { "vfmsub231p%XW", { XM, Vex, EXx } },
4954 /* PREFIX_VEX_0F38BB */
4958 { "vfmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4961 /* PREFIX_VEX_0F38BC */
4965 { "vfnmadd231p%XW", { XM, Vex, EXx } },
4968 /* PREFIX_VEX_0F38BD */
4972 { "vfnmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4975 /* PREFIX_VEX_0F38BE */
4979 { "vfnmsub231p%XW", { XM, Vex, EXx } },
4982 /* PREFIX_VEX_0F38BF */
4986 { "vfnmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar } },
4989 /* PREFIX_VEX_0F38DB */
4993 { VEX_LEN_TABLE (VEX_LEN_0F38DB_P_2) },
4996 /* PREFIX_VEX_0F38DC */
5000 { VEX_LEN_TABLE (VEX_LEN_0F38DC_P_2) },
5003 /* PREFIX_VEX_0F38DD */
5007 { VEX_LEN_TABLE (VEX_LEN_0F38DD_P_2) },
5010 /* PREFIX_VEX_0F38DE */
5014 { VEX_LEN_TABLE (VEX_LEN_0F38DE_P_2) },
5017 /* PREFIX_VEX_0F38DF */
5021 { VEX_LEN_TABLE (VEX_LEN_0F38DF_P_2) },
5024 /* PREFIX_VEX_0F38F2 */
5026 { VEX_LEN_TABLE (VEX_LEN_0F38F2_P_0) },
5029 /* PREFIX_VEX_0F38F3_REG_1 */
5031 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_1_P_0) },
5034 /* PREFIX_VEX_0F38F3_REG_2 */
5036 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_2_P_0) },
5039 /* PREFIX_VEX_0F38F3_REG_3 */
5041 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_3_P_0) },
5044 /* PREFIX_VEX_0F38F7 */
5046 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_0) },
5049 /* PREFIX_VEX_0F3A04 */
5053 { VEX_W_TABLE (VEX_W_0F3A04_P_2) },
5056 /* PREFIX_VEX_0F3A05 */
5060 { VEX_W_TABLE (VEX_W_0F3A05_P_2) },
5063 /* PREFIX_VEX_0F3A06 */
5067 { VEX_LEN_TABLE (VEX_LEN_0F3A06_P_2) },
5070 /* PREFIX_VEX_0F3A08 */
5074 { VEX_W_TABLE (VEX_W_0F3A08_P_2) },
5077 /* PREFIX_VEX_0F3A09 */
5081 { VEX_W_TABLE (VEX_W_0F3A09_P_2) },
5084 /* PREFIX_VEX_0F3A0A */
5088 { VEX_LEN_TABLE (VEX_LEN_0F3A0A_P_2) },
5091 /* PREFIX_VEX_0F3A0B */
5095 { VEX_LEN_TABLE (VEX_LEN_0F3A0B_P_2) },
5098 /* PREFIX_VEX_0F3A0C */
5102 { VEX_W_TABLE (VEX_W_0F3A0C_P_2) },
5105 /* PREFIX_VEX_0F3A0D */
5109 { VEX_W_TABLE (VEX_W_0F3A0D_P_2) },
5112 /* PREFIX_VEX_0F3A0E */
5116 { VEX_LEN_TABLE (VEX_LEN_0F3A0E_P_2) },
5119 /* PREFIX_VEX_0F3A0F */
5123 { VEX_LEN_TABLE (VEX_LEN_0F3A0F_P_2) },
5126 /* PREFIX_VEX_0F3A14 */
5130 { VEX_LEN_TABLE (VEX_LEN_0F3A14_P_2) },
5133 /* PREFIX_VEX_0F3A15 */
5137 { VEX_LEN_TABLE (VEX_LEN_0F3A15_P_2) },
5140 /* PREFIX_VEX_0F3A16 */
5144 { VEX_LEN_TABLE (VEX_LEN_0F3A16_P_2) },
5147 /* PREFIX_VEX_0F3A17 */
5151 { VEX_LEN_TABLE (VEX_LEN_0F3A17_P_2) },
5154 /* PREFIX_VEX_0F3A18 */
5158 { VEX_LEN_TABLE (VEX_LEN_0F3A18_P_2) },
5161 /* PREFIX_VEX_0F3A19 */
5165 { VEX_LEN_TABLE (VEX_LEN_0F3A19_P_2) },
5168 /* PREFIX_VEX_0F3A1D */
5172 { "vcvtps2ph", { EXxmmq, XM, Ib } },
5175 /* PREFIX_VEX_0F3A20 */
5179 { VEX_LEN_TABLE (VEX_LEN_0F3A20_P_2) },
5182 /* PREFIX_VEX_0F3A21 */
5186 { VEX_LEN_TABLE (VEX_LEN_0F3A21_P_2) },
5189 /* PREFIX_VEX_0F3A22 */
5193 { VEX_LEN_TABLE (VEX_LEN_0F3A22_P_2) },
5196 /* PREFIX_VEX_0F3A40 */
5200 { VEX_W_TABLE (VEX_W_0F3A40_P_2) },
5203 /* PREFIX_VEX_0F3A41 */
5207 { VEX_LEN_TABLE (VEX_LEN_0F3A41_P_2) },
5210 /* PREFIX_VEX_0F3A42 */
5214 { VEX_LEN_TABLE (VEX_LEN_0F3A42_P_2) },
5217 /* PREFIX_VEX_0F3A44 */
5221 { VEX_LEN_TABLE (VEX_LEN_0F3A44_P_2) },
5224 /* PREFIX_VEX_0F3A48 */
5228 { VEX_W_TABLE (VEX_W_0F3A48_P_2) },
5231 /* PREFIX_VEX_0F3A49 */
5235 { VEX_W_TABLE (VEX_W_0F3A49_P_2) },
5238 /* PREFIX_VEX_0F3A4A */
5242 { VEX_W_TABLE (VEX_W_0F3A4A_P_2) },
5245 /* PREFIX_VEX_0F3A4B */
5249 { VEX_W_TABLE (VEX_W_0F3A4B_P_2) },
5252 /* PREFIX_VEX_0F3A4C */
5256 { VEX_LEN_TABLE (VEX_LEN_0F3A4C_P_2) },
5259 /* PREFIX_VEX_0F3A5C */
5263 { "vfmaddsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5266 /* PREFIX_VEX_0F3A5D */
5270 { "vfmaddsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5273 /* PREFIX_VEX_0F3A5E */
5277 { "vfmsubaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5280 /* PREFIX_VEX_0F3A5F */
5284 { "vfmsubaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5287 /* PREFIX_VEX_0F3A60 */
5291 { VEX_LEN_TABLE (VEX_LEN_0F3A60_P_2) },
5295 /* PREFIX_VEX_0F3A61 */
5299 { VEX_LEN_TABLE (VEX_LEN_0F3A61_P_2) },
5302 /* PREFIX_VEX_0F3A62 */
5306 { VEX_LEN_TABLE (VEX_LEN_0F3A62_P_2) },
5309 /* PREFIX_VEX_0F3A63 */
5313 { VEX_LEN_TABLE (VEX_LEN_0F3A63_P_2) },
5316 /* PREFIX_VEX_0F3A68 */
5320 { "vfmaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5323 /* PREFIX_VEX_0F3A69 */
5327 { "vfmaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5330 /* PREFIX_VEX_0F3A6A */
5334 { VEX_LEN_TABLE (VEX_LEN_0F3A6A_P_2) },
5337 /* PREFIX_VEX_0F3A6B */
5341 { VEX_LEN_TABLE (VEX_LEN_0F3A6B_P_2) },
5344 /* PREFIX_VEX_0F3A6C */
5348 { "vfmsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5351 /* PREFIX_VEX_0F3A6D */
5355 { "vfmsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5358 /* PREFIX_VEX_0F3A6E */
5362 { VEX_LEN_TABLE (VEX_LEN_0F3A6E_P_2) },
5365 /* PREFIX_VEX_0F3A6F */
5369 { VEX_LEN_TABLE (VEX_LEN_0F3A6F_P_2) },
5372 /* PREFIX_VEX_0F3A78 */
5376 { "vfnmaddps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5379 /* PREFIX_VEX_0F3A79 */
5383 { "vfnmaddpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5386 /* PREFIX_VEX_0F3A7A */
5390 { VEX_LEN_TABLE (VEX_LEN_0F3A7A_P_2) },
5393 /* PREFIX_VEX_0F3A7B */
5397 { VEX_LEN_TABLE (VEX_LEN_0F3A7B_P_2) },
5400 /* PREFIX_VEX_0F3A7C */
5404 { "vfnmsubps", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5408 /* PREFIX_VEX_0F3A7D */
5412 { "vfnmsubpd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
5415 /* PREFIX_VEX_0F3A7E */
5419 { VEX_LEN_TABLE (VEX_LEN_0F3A7E_P_2) },
5422 /* PREFIX_VEX_0F3A7F */
5426 { VEX_LEN_TABLE (VEX_LEN_0F3A7F_P_2) },
5429 /* PREFIX_VEX_0F3ADF */
5433 { VEX_LEN_TABLE (VEX_LEN_0F3ADF_P_2) },
5437 static const struct dis386 x86_64_table[][2] = {
5440 { "pushP", { es } },
5450 { "pushP", { cs } },
5455 { "pushP", { ss } },
5465 { "pushP", { ds } },
5495 { "pushaP", { XX } },
5500 { "popaP", { XX } },
5505 { MOD_TABLE (MOD_62_32BIT) },
5510 { "arpl", { Ew, Gw } },
5511 { "movs{lq|xd}", { Gv, Ed } },
5516 { "ins{R|}", { Yzr, indirDX } },
5517 { "ins{G|}", { Yzr, indirDX } },
5522 { "outs{R|}", { indirDXr, Xz } },
5523 { "outs{G|}", { indirDXr, Xz } },
5528 { "Jcall{T|}", { Ap } },
5533 { MOD_TABLE (MOD_C4_32BIT) },
5534 { VEX_C4_TABLE (VEX_0F) },
5539 { MOD_TABLE (MOD_C5_32BIT) },
5540 { VEX_C5_TABLE (VEX_0F) },
5560 { "Jjmp{T|}", { Ap } },
5563 /* X86_64_0F01_REG_0 */
5565 { "sgdt{Q|IQ}", { M } },
5569 /* X86_64_0F01_REG_1 */
5571 { "sidt{Q|IQ}", { M } },
5575 /* X86_64_0F01_REG_2 */
5577 { "lgdt{Q|Q}", { M } },
5581 /* X86_64_0F01_REG_3 */
5583 { "lidt{Q|Q}", { M } },
5588 static const struct dis386 three_byte_table[][256] = {
5590 /* THREE_BYTE_0F38 */
5593 { "pshufb", { MX, EM } },
5594 { "phaddw", { MX, EM } },
5595 { "phaddd", { MX, EM } },
5596 { "phaddsw", { MX, EM } },
5597 { "pmaddubsw", { MX, EM } },
5598 { "phsubw", { MX, EM } },
5599 { "phsubd", { MX, EM } },
5600 { "phsubsw", { MX, EM } },
5602 { "psignb", { MX, EM } },
5603 { "psignw", { MX, EM } },
5604 { "psignd", { MX, EM } },
5605 { "pmulhrsw", { MX, EM } },
5611 { PREFIX_TABLE (PREFIX_0F3810) },
5615 { PREFIX_TABLE (PREFIX_0F3814) },
5616 { PREFIX_TABLE (PREFIX_0F3815) },
5618 { PREFIX_TABLE (PREFIX_0F3817) },
5624 { "pabsb", { MX, EM } },
5625 { "pabsw", { MX, EM } },
5626 { "pabsd", { MX, EM } },
5629 { PREFIX_TABLE (PREFIX_0F3820) },
5630 { PREFIX_TABLE (PREFIX_0F3821) },
5631 { PREFIX_TABLE (PREFIX_0F3822) },
5632 { PREFIX_TABLE (PREFIX_0F3823) },
5633 { PREFIX_TABLE (PREFIX_0F3824) },
5634 { PREFIX_TABLE (PREFIX_0F3825) },
5638 { PREFIX_TABLE (PREFIX_0F3828) },
5639 { PREFIX_TABLE (PREFIX_0F3829) },
5640 { PREFIX_TABLE (PREFIX_0F382A) },
5641 { PREFIX_TABLE (PREFIX_0F382B) },
5647 { PREFIX_TABLE (PREFIX_0F3830) },
5648 { PREFIX_TABLE (PREFIX_0F3831) },
5649 { PREFIX_TABLE (PREFIX_0F3832) },
5650 { PREFIX_TABLE (PREFIX_0F3833) },
5651 { PREFIX_TABLE (PREFIX_0F3834) },
5652 { PREFIX_TABLE (PREFIX_0F3835) },
5654 { PREFIX_TABLE (PREFIX_0F3837) },
5656 { PREFIX_TABLE (PREFIX_0F3838) },
5657 { PREFIX_TABLE (PREFIX_0F3839) },
5658 { PREFIX_TABLE (PREFIX_0F383A) },
5659 { PREFIX_TABLE (PREFIX_0F383B) },
5660 { PREFIX_TABLE (PREFIX_0F383C) },
5661 { PREFIX_TABLE (PREFIX_0F383D) },
5662 { PREFIX_TABLE (PREFIX_0F383E) },
5663 { PREFIX_TABLE (PREFIX_0F383F) },
5665 { PREFIX_TABLE (PREFIX_0F3840) },
5666 { PREFIX_TABLE (PREFIX_0F3841) },
5737 { PREFIX_TABLE (PREFIX_0F3880) },
5738 { PREFIX_TABLE (PREFIX_0F3881) },
5839 { PREFIX_TABLE (PREFIX_0F38DB) },
5840 { PREFIX_TABLE (PREFIX_0F38DC) },
5841 { PREFIX_TABLE (PREFIX_0F38DD) },
5842 { PREFIX_TABLE (PREFIX_0F38DE) },
5843 { PREFIX_TABLE (PREFIX_0F38DF) },
5863 { PREFIX_TABLE (PREFIX_0F38F0) },
5864 { PREFIX_TABLE (PREFIX_0F38F1) },
5881 /* THREE_BYTE_0F3A */
5893 { PREFIX_TABLE (PREFIX_0F3A08) },
5894 { PREFIX_TABLE (PREFIX_0F3A09) },
5895 { PREFIX_TABLE (PREFIX_0F3A0A) },
5896 { PREFIX_TABLE (PREFIX_0F3A0B) },
5897 { PREFIX_TABLE (PREFIX_0F3A0C) },
5898 { PREFIX_TABLE (PREFIX_0F3A0D) },
5899 { PREFIX_TABLE (PREFIX_0F3A0E) },
5900 { "palignr", { MX, EM, Ib } },
5906 { PREFIX_TABLE (PREFIX_0F3A14) },
5907 { PREFIX_TABLE (PREFIX_0F3A15) },
5908 { PREFIX_TABLE (PREFIX_0F3A16) },
5909 { PREFIX_TABLE (PREFIX_0F3A17) },
5920 { PREFIX_TABLE (PREFIX_0F3A20) },
5921 { PREFIX_TABLE (PREFIX_0F3A21) },
5922 { PREFIX_TABLE (PREFIX_0F3A22) },
5956 { PREFIX_TABLE (PREFIX_0F3A40) },
5957 { PREFIX_TABLE (PREFIX_0F3A41) },
5958 { PREFIX_TABLE (PREFIX_0F3A42) },
5960 { PREFIX_TABLE (PREFIX_0F3A44) },
5992 { PREFIX_TABLE (PREFIX_0F3A60) },
5993 { PREFIX_TABLE (PREFIX_0F3A61) },
5994 { PREFIX_TABLE (PREFIX_0F3A62) },
5995 { PREFIX_TABLE (PREFIX_0F3A63) },
6134 { PREFIX_TABLE (PREFIX_0F3ADF) },
6173 /* THREE_BYTE_0F7A */
6212 { "ptest", { XX } },
6249 { "phaddbw", { XM, EXq } },
6250 { "phaddbd", { XM, EXq } },
6251 { "phaddbq", { XM, EXq } },
6254 { "phaddwd", { XM, EXq } },
6255 { "phaddwq", { XM, EXq } },
6260 { "phadddq", { XM, EXq } },
6267 { "phaddubw", { XM, EXq } },
6268 { "phaddubd", { XM, EXq } },
6269 { "phaddubq", { XM, EXq } },
6272 { "phadduwd", { XM, EXq } },
6273 { "phadduwq", { XM, EXq } },
6278 { "phaddudq", { XM, EXq } },
6285 { "phsubbw", { XM, EXq } },
6286 { "phsubbd", { XM, EXq } },
6287 { "phsubbq", { XM, EXq } },
6466 static const struct dis386 xop_table[][256] = {
6488 { "bextr", { Gv, Ev, Iq } },
6619 { "vpmacssww", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6620 { "vpmacsswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6621 { "vpmacssdql", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6629 { "vpmacssdd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6630 { "vpmacssdqh", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6637 { "vpmacsww", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6638 { "vpmacswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6639 { "vpmacsdql", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6647 { "vpmacsdd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6648 { "vpmacsdqh", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6652 { "vpcmov", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6653 { "vpperm", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6656 { "vpmadcsswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6674 { "vpmadcswd", { XMVexW, Vex, EXVexW, EXVexW, VexI4 } },
6686 { "vprotb", { XM, Vex_2src_1, Ib } },
6687 { "vprotw", { XM, Vex_2src_1, Ib } },
6688 { "vprotd", { XM, Vex_2src_1, Ib } },
6689 { "vprotq", { XM, Vex_2src_1, Ib } },
6699 { "vpcomb", { XM, Vex128, EXx, Ib } },
6700 { "vpcomw", { XM, Vex128, EXx, Ib } },
6701 { "vpcomd", { XM, Vex128, EXx, Ib } },
6702 { "vpcomq", { XM, Vex128, EXx, Ib } },
6735 { "vpcomub", { XM, Vex128, EXx, Ib } },
6736 { "vpcomuw", { XM, Vex128, EXx, Ib } },
6737 { "vpcomud", { XM, Vex128, EXx, Ib } },
6738 { "vpcomuq", { XM, Vex128, EXx, Ib } },
6762 { REG_TABLE (REG_XOP_TBM_01) },
6763 { REG_TABLE (REG_XOP_TBM_02) },
6781 { REG_TABLE (REG_XOP_LWPCB) },
6905 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_80) },
6906 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_81) },
6907 { "vfrczss", { XM, EXd } },
6908 { "vfrczsd", { XM, EXq } },
6923 { "vprotb", { XM, Vex_2src_1, Vex_2src_2 } },
6924 { "vprotw", { XM, Vex_2src_1, Vex_2src_2 } },
6925 { "vprotd", { XM, Vex_2src_1, Vex_2src_2 } },
6926 { "vprotq", { XM, Vex_2src_1, Vex_2src_2 } },
6927 { "vpshlb", { XM, Vex_2src_1, Vex_2src_2 } },
6928 { "vpshlw", { XM, Vex_2src_1, Vex_2src_2 } },
6929 { "vpshld", { XM, Vex_2src_1, Vex_2src_2 } },
6930 { "vpshlq", { XM, Vex_2src_1, Vex_2src_2 } },
6932 { "vpshab", { XM, Vex_2src_1, Vex_2src_2 } },
6933 { "vpshaw", { XM, Vex_2src_1, Vex_2src_2 } },
6934 { "vpshad", { XM, Vex_2src_1, Vex_2src_2 } },
6935 { "vpshaq", { XM, Vex_2src_1, Vex_2src_2 } },
6978 { "vphaddbw", { XM, EXxmm } },
6979 { "vphaddbd", { XM, EXxmm } },
6980 { "vphaddbq", { XM, EXxmm } },
6983 { "vphaddwd", { XM, EXxmm } },
6984 { "vphaddwq", { XM, EXxmm } },
6989 { "vphadddq", { XM, EXxmm } },
6996 { "vphaddubw", { XM, EXxmm } },
6997 { "vphaddubd", { XM, EXxmm } },
6998 { "vphaddubq", { XM, EXxmm } },
7001 { "vphadduwd", { XM, EXxmm } },
7002 { "vphadduwq", { XM, EXxmm } },
7007 { "vphaddudq", { XM, EXxmm } },
7014 { "vphsubbw", { XM, EXxmm } },
7015 { "vphsubwd", { XM, EXxmm } },
7016 { "vphsubdq", { XM, EXxmm } },
7070 { "bextr", { Gv, Ev, Iq } },
7072 { REG_TABLE (REG_XOP_LWP) },
7342 static const struct dis386 vex_table[][256] = {
7364 { PREFIX_TABLE (PREFIX_VEX_0F10) },
7365 { PREFIX_TABLE (PREFIX_VEX_0F11) },
7366 { PREFIX_TABLE (PREFIX_VEX_0F12) },
7367 { MOD_TABLE (MOD_VEX_0F13) },
7368 { VEX_W_TABLE (VEX_W_0F14) },
7369 { VEX_W_TABLE (VEX_W_0F15) },
7370 { PREFIX_TABLE (PREFIX_VEX_0F16) },
7371 { MOD_TABLE (MOD_VEX_0F17) },
7391 { VEX_W_TABLE (VEX_W_0F28) },
7392 { VEX_W_TABLE (VEX_W_0F29) },
7393 { PREFIX_TABLE (PREFIX_VEX_0F2A) },
7394 { MOD_TABLE (MOD_VEX_0F2B) },
7395 { PREFIX_TABLE (PREFIX_VEX_0F2C) },
7396 { PREFIX_TABLE (PREFIX_VEX_0F2D) },
7397 { PREFIX_TABLE (PREFIX_VEX_0F2E) },
7398 { PREFIX_TABLE (PREFIX_VEX_0F2F) },
7436 { MOD_TABLE (MOD_VEX_0F50) },
7437 { PREFIX_TABLE (PREFIX_VEX_0F51) },
7438 { PREFIX_TABLE (PREFIX_VEX_0F52) },
7439 { PREFIX_TABLE (PREFIX_VEX_0F53) },
7440 { "vandpX", { XM, Vex, EXx } },
7441 { "vandnpX", { XM, Vex, EXx } },
7442 { "vorpX", { XM, Vex, EXx } },
7443 { "vxorpX", { XM, Vex, EXx } },
7445 { PREFIX_TABLE (PREFIX_VEX_0F58) },
7446 { PREFIX_TABLE (PREFIX_VEX_0F59) },
7447 { PREFIX_TABLE (PREFIX_VEX_0F5A) },
7448 { PREFIX_TABLE (PREFIX_VEX_0F5B) },
7449 { PREFIX_TABLE (PREFIX_VEX_0F5C) },
7450 { PREFIX_TABLE (PREFIX_VEX_0F5D) },
7451 { PREFIX_TABLE (PREFIX_VEX_0F5E) },
7452 { PREFIX_TABLE (PREFIX_VEX_0F5F) },
7454 { PREFIX_TABLE (PREFIX_VEX_0F60) },
7455 { PREFIX_TABLE (PREFIX_VEX_0F61) },
7456 { PREFIX_TABLE (PREFIX_VEX_0F62) },
7457 { PREFIX_TABLE (PREFIX_VEX_0F63) },
7458 { PREFIX_TABLE (PREFIX_VEX_0F64) },
7459 { PREFIX_TABLE (PREFIX_VEX_0F65) },
7460 { PREFIX_TABLE (PREFIX_VEX_0F66) },
7461 { PREFIX_TABLE (PREFIX_VEX_0F67) },
7463 { PREFIX_TABLE (PREFIX_VEX_0F68) },
7464 { PREFIX_TABLE (PREFIX_VEX_0F69) },
7465 { PREFIX_TABLE (PREFIX_VEX_0F6A) },
7466 { PREFIX_TABLE (PREFIX_VEX_0F6B) },
7467 { PREFIX_TABLE (PREFIX_VEX_0F6C) },
7468 { PREFIX_TABLE (PREFIX_VEX_0F6D) },
7469 { PREFIX_TABLE (PREFIX_VEX_0F6E) },
7470 { PREFIX_TABLE (PREFIX_VEX_0F6F) },
7472 { PREFIX_TABLE (PREFIX_VEX_0F70) },
7473 { REG_TABLE (REG_VEX_0F71) },
7474 { REG_TABLE (REG_VEX_0F72) },
7475 { REG_TABLE (REG_VEX_0F73) },
7476 { PREFIX_TABLE (PREFIX_VEX_0F74) },
7477 { PREFIX_TABLE (PREFIX_VEX_0F75) },
7478 { PREFIX_TABLE (PREFIX_VEX_0F76) },
7479 { PREFIX_TABLE (PREFIX_VEX_0F77) },
7485 { PREFIX_TABLE (PREFIX_VEX_0F7C) },
7486 { PREFIX_TABLE (PREFIX_VEX_0F7D) },
7487 { PREFIX_TABLE (PREFIX_VEX_0F7E) },
7488 { PREFIX_TABLE (PREFIX_VEX_0F7F) },
7541 { REG_TABLE (REG_VEX_0FAE) },
7564 { PREFIX_TABLE (PREFIX_VEX_0FC2) },
7566 { PREFIX_TABLE (PREFIX_VEX_0FC4) },
7567 { PREFIX_TABLE (PREFIX_VEX_0FC5) },
7568 { "vshufpX", { XM, Vex, EXx, Ib } },
7580 { PREFIX_TABLE (PREFIX_VEX_0FD0) },
7581 { PREFIX_TABLE (PREFIX_VEX_0FD1) },
7582 { PREFIX_TABLE (PREFIX_VEX_0FD2) },
7583 { PREFIX_TABLE (PREFIX_VEX_0FD3) },
7584 { PREFIX_TABLE (PREFIX_VEX_0FD4) },
7585 { PREFIX_TABLE (PREFIX_VEX_0FD5) },
7586 { PREFIX_TABLE (PREFIX_VEX_0FD6) },
7587 { PREFIX_TABLE (PREFIX_VEX_0FD7) },
7589 { PREFIX_TABLE (PREFIX_VEX_0FD8) },
7590 { PREFIX_TABLE (PREFIX_VEX_0FD9) },
7591 { PREFIX_TABLE (PREFIX_VEX_0FDA) },
7592 { PREFIX_TABLE (PREFIX_VEX_0FDB) },
7593 { PREFIX_TABLE (PREFIX_VEX_0FDC) },
7594 { PREFIX_TABLE (PREFIX_VEX_0FDD) },
7595 { PREFIX_TABLE (PREFIX_VEX_0FDE) },
7596 { PREFIX_TABLE (PREFIX_VEX_0FDF) },
7598 { PREFIX_TABLE (PREFIX_VEX_0FE0) },
7599 { PREFIX_TABLE (PREFIX_VEX_0FE1) },
7600 { PREFIX_TABLE (PREFIX_VEX_0FE2) },
7601 { PREFIX_TABLE (PREFIX_VEX_0FE3) },
7602 { PREFIX_TABLE (PREFIX_VEX_0FE4) },
7603 { PREFIX_TABLE (PREFIX_VEX_0FE5) },
7604 { PREFIX_TABLE (PREFIX_VEX_0FE6) },
7605 { PREFIX_TABLE (PREFIX_VEX_0FE7) },
7607 { PREFIX_TABLE (PREFIX_VEX_0FE8) },
7608 { PREFIX_TABLE (PREFIX_VEX_0FE9) },
7609 { PREFIX_TABLE (PREFIX_VEX_0FEA) },
7610 { PREFIX_TABLE (PREFIX_VEX_0FEB) },
7611 { PREFIX_TABLE (PREFIX_VEX_0FEC) },
7612 { PREFIX_TABLE (PREFIX_VEX_0FED) },
7613 { PREFIX_TABLE (PREFIX_VEX_0FEE) },
7614 { PREFIX_TABLE (PREFIX_VEX_0FEF) },
7616 { PREFIX_TABLE (PREFIX_VEX_0FF0) },
7617 { PREFIX_TABLE (PREFIX_VEX_0FF1) },
7618 { PREFIX_TABLE (PREFIX_VEX_0FF2) },
7619 { PREFIX_TABLE (PREFIX_VEX_0FF3) },
7620 { PREFIX_TABLE (PREFIX_VEX_0FF4) },
7621 { PREFIX_TABLE (PREFIX_VEX_0FF5) },
7622 { PREFIX_TABLE (PREFIX_VEX_0FF6) },
7623 { PREFIX_TABLE (PREFIX_VEX_0FF7) },
7625 { PREFIX_TABLE (PREFIX_VEX_0FF8) },
7626 { PREFIX_TABLE (PREFIX_VEX_0FF9) },
7627 { PREFIX_TABLE (PREFIX_VEX_0FFA) },
7628 { PREFIX_TABLE (PREFIX_VEX_0FFB) },
7629 { PREFIX_TABLE (PREFIX_VEX_0FFC) },
7630 { PREFIX_TABLE (PREFIX_VEX_0FFD) },
7631 { PREFIX_TABLE (PREFIX_VEX_0FFE) },
7637 { PREFIX_TABLE (PREFIX_VEX_0F3800) },
7638 { PREFIX_TABLE (PREFIX_VEX_0F3801) },
7639 { PREFIX_TABLE (PREFIX_VEX_0F3802) },
7640 { PREFIX_TABLE (PREFIX_VEX_0F3803) },
7641 { PREFIX_TABLE (PREFIX_VEX_0F3804) },
7642 { PREFIX_TABLE (PREFIX_VEX_0F3805) },
7643 { PREFIX_TABLE (PREFIX_VEX_0F3806) },
7644 { PREFIX_TABLE (PREFIX_VEX_0F3807) },
7646 { PREFIX_TABLE (PREFIX_VEX_0F3808) },
7647 { PREFIX_TABLE (PREFIX_VEX_0F3809) },
7648 { PREFIX_TABLE (PREFIX_VEX_0F380A) },
7649 { PREFIX_TABLE (PREFIX_VEX_0F380B) },
7650 { PREFIX_TABLE (PREFIX_VEX_0F380C) },
7651 { PREFIX_TABLE (PREFIX_VEX_0F380D) },
7652 { PREFIX_TABLE (PREFIX_VEX_0F380E) },
7653 { PREFIX_TABLE (PREFIX_VEX_0F380F) },
7658 { PREFIX_TABLE (PREFIX_VEX_0F3813) },
7662 { PREFIX_TABLE (PREFIX_VEX_0F3817) },
7664 { PREFIX_TABLE (PREFIX_VEX_0F3818) },
7665 { PREFIX_TABLE (PREFIX_VEX_0F3819) },
7666 { PREFIX_TABLE (PREFIX_VEX_0F381A) },
7668 { PREFIX_TABLE (PREFIX_VEX_0F381C) },
7669 { PREFIX_TABLE (PREFIX_VEX_0F381D) },
7670 { PREFIX_TABLE (PREFIX_VEX_0F381E) },
7673 { PREFIX_TABLE (PREFIX_VEX_0F3820) },
7674 { PREFIX_TABLE (PREFIX_VEX_0F3821) },
7675 { PREFIX_TABLE (PREFIX_VEX_0F3822) },
7676 { PREFIX_TABLE (PREFIX_VEX_0F3823) },
7677 { PREFIX_TABLE (PREFIX_VEX_0F3824) },
7678 { PREFIX_TABLE (PREFIX_VEX_0F3825) },
7682 { PREFIX_TABLE (PREFIX_VEX_0F3828) },
7683 { PREFIX_TABLE (PREFIX_VEX_0F3829) },
7684 { PREFIX_TABLE (PREFIX_VEX_0F382A) },
7685 { PREFIX_TABLE (PREFIX_VEX_0F382B) },
7686 { PREFIX_TABLE (PREFIX_VEX_0F382C) },
7687 { PREFIX_TABLE (PREFIX_VEX_0F382D) },
7688 { PREFIX_TABLE (PREFIX_VEX_0F382E) },
7689 { PREFIX_TABLE (PREFIX_VEX_0F382F) },
7691 { PREFIX_TABLE (PREFIX_VEX_0F3830) },
7692 { PREFIX_TABLE (PREFIX_VEX_0F3831) },
7693 { PREFIX_TABLE (PREFIX_VEX_0F3832) },
7694 { PREFIX_TABLE (PREFIX_VEX_0F3833) },
7695 { PREFIX_TABLE (PREFIX_VEX_0F3834) },
7696 { PREFIX_TABLE (PREFIX_VEX_0F3835) },
7698 { PREFIX_TABLE (PREFIX_VEX_0F3837) },
7700 { PREFIX_TABLE (PREFIX_VEX_0F3838) },
7701 { PREFIX_TABLE (PREFIX_VEX_0F3839) },
7702 { PREFIX_TABLE (PREFIX_VEX_0F383A) },
7703 { PREFIX_TABLE (PREFIX_VEX_0F383B) },
7704 { PREFIX_TABLE (PREFIX_VEX_0F383C) },
7705 { PREFIX_TABLE (PREFIX_VEX_0F383D) },
7706 { PREFIX_TABLE (PREFIX_VEX_0F383E) },
7707 { PREFIX_TABLE (PREFIX_VEX_0F383F) },
7709 { PREFIX_TABLE (PREFIX_VEX_0F3840) },
7710 { PREFIX_TABLE (PREFIX_VEX_0F3841) },
7805 { PREFIX_TABLE (PREFIX_VEX_0F3896) },
7806 { PREFIX_TABLE (PREFIX_VEX_0F3897) },
7808 { PREFIX_TABLE (PREFIX_VEX_0F3898) },
7809 { PREFIX_TABLE (PREFIX_VEX_0F3899) },
7810 { PREFIX_TABLE (PREFIX_VEX_0F389A) },
7811 { PREFIX_TABLE (PREFIX_VEX_0F389B) },
7812 { PREFIX_TABLE (PREFIX_VEX_0F389C) },
7813 { PREFIX_TABLE (PREFIX_VEX_0F389D) },
7814 { PREFIX_TABLE (PREFIX_VEX_0F389E) },
7815 { PREFIX_TABLE (PREFIX_VEX_0F389F) },
7823 { PREFIX_TABLE (PREFIX_VEX_0F38A6) },
7824 { PREFIX_TABLE (PREFIX_VEX_0F38A7) },
7826 { PREFIX_TABLE (PREFIX_VEX_0F38A8) },
7827 { PREFIX_TABLE (PREFIX_VEX_0F38A9) },
7828 { PREFIX_TABLE (PREFIX_VEX_0F38AA) },
7829 { PREFIX_TABLE (PREFIX_VEX_0F38AB) },
7830 { PREFIX_TABLE (PREFIX_VEX_0F38AC) },
7831 { PREFIX_TABLE (PREFIX_VEX_0F38AD) },
7832 { PREFIX_TABLE (PREFIX_VEX_0F38AE) },
7833 { PREFIX_TABLE (PREFIX_VEX_0F38AF) },
7841 { PREFIX_TABLE (PREFIX_VEX_0F38B6) },
7842 { PREFIX_TABLE (PREFIX_VEX_0F38B7) },
7844 { PREFIX_TABLE (PREFIX_VEX_0F38B8) },
7845 { PREFIX_TABLE (PREFIX_VEX_0F38B9) },
7846 { PREFIX_TABLE (PREFIX_VEX_0F38BA) },
7847 { PREFIX_TABLE (PREFIX_VEX_0F38BB) },
7848 { PREFIX_TABLE (PREFIX_VEX_0F38BC) },
7849 { PREFIX_TABLE (PREFIX_VEX_0F38BD) },
7850 { PREFIX_TABLE (PREFIX_VEX_0F38BE) },
7851 { PREFIX_TABLE (PREFIX_VEX_0F38BF) },
7883 { PREFIX_TABLE (PREFIX_VEX_0F38DB) },
7884 { PREFIX_TABLE (PREFIX_VEX_0F38DC) },
7885 { PREFIX_TABLE (PREFIX_VEX_0F38DD) },
7886 { PREFIX_TABLE (PREFIX_VEX_0F38DE) },
7887 { PREFIX_TABLE (PREFIX_VEX_0F38DF) },
7909 { PREFIX_TABLE (PREFIX_VEX_0F38F2) },
7910 { REG_TABLE (REG_VEX_0F38F3) },
7914 { PREFIX_TABLE (PREFIX_VEX_0F38F7) },
7932 { PREFIX_TABLE (PREFIX_VEX_0F3A04) },
7933 { PREFIX_TABLE (PREFIX_VEX_0F3A05) },
7934 { PREFIX_TABLE (PREFIX_VEX_0F3A06) },
7937 { PREFIX_TABLE (PREFIX_VEX_0F3A08) },
7938 { PREFIX_TABLE (PREFIX_VEX_0F3A09) },
7939 { PREFIX_TABLE (PREFIX_VEX_0F3A0A) },
7940 { PREFIX_TABLE (PREFIX_VEX_0F3A0B) },
7941 { PREFIX_TABLE (PREFIX_VEX_0F3A0C) },
7942 { PREFIX_TABLE (PREFIX_VEX_0F3A0D) },
7943 { PREFIX_TABLE (PREFIX_VEX_0F3A0E) },
7944 { PREFIX_TABLE (PREFIX_VEX_0F3A0F) },
7950 { PREFIX_TABLE (PREFIX_VEX_0F3A14) },
7951 { PREFIX_TABLE (PREFIX_VEX_0F3A15) },
7952 { PREFIX_TABLE (PREFIX_VEX_0F3A16) },
7953 { PREFIX_TABLE (PREFIX_VEX_0F3A17) },
7955 { PREFIX_TABLE (PREFIX_VEX_0F3A18) },
7956 { PREFIX_TABLE (PREFIX_VEX_0F3A19) },
7960 { PREFIX_TABLE (PREFIX_VEX_0F3A1D) },
7964 { PREFIX_TABLE (PREFIX_VEX_0F3A20) },
7965 { PREFIX_TABLE (PREFIX_VEX_0F3A21) },
7966 { PREFIX_TABLE (PREFIX_VEX_0F3A22) },
8000 { PREFIX_TABLE (PREFIX_VEX_0F3A40) },
8001 { PREFIX_TABLE (PREFIX_VEX_0F3A41) },
8002 { PREFIX_TABLE (PREFIX_VEX_0F3A42) },
8004 { PREFIX_TABLE (PREFIX_VEX_0F3A44) },
8009 { PREFIX_TABLE (PREFIX_VEX_0F3A48) },
8010 { PREFIX_TABLE (PREFIX_VEX_0F3A49) },
8011 { PREFIX_TABLE (PREFIX_VEX_0F3A4A) },
8012 { PREFIX_TABLE (PREFIX_VEX_0F3A4B) },
8013 { PREFIX_TABLE (PREFIX_VEX_0F3A4C) },
8031 { PREFIX_TABLE (PREFIX_VEX_0F3A5C) },
8032 { PREFIX_TABLE (PREFIX_VEX_0F3A5D) },
8033 { PREFIX_TABLE (PREFIX_VEX_0F3A5E) },
8034 { PREFIX_TABLE (PREFIX_VEX_0F3A5F) },
8036 { PREFIX_TABLE (PREFIX_VEX_0F3A60) },
8037 { PREFIX_TABLE (PREFIX_VEX_0F3A61) },
8038 { PREFIX_TABLE (PREFIX_VEX_0F3A62) },
8039 { PREFIX_TABLE (PREFIX_VEX_0F3A63) },
8045 { PREFIX_TABLE (PREFIX_VEX_0F3A68) },
8046 { PREFIX_TABLE (PREFIX_VEX_0F3A69) },
8047 { PREFIX_TABLE (PREFIX_VEX_0F3A6A) },
8048 { PREFIX_TABLE (PREFIX_VEX_0F3A6B) },
8049 { PREFIX_TABLE (PREFIX_VEX_0F3A6C) },
8050 { PREFIX_TABLE (PREFIX_VEX_0F3A6D) },
8051 { PREFIX_TABLE (PREFIX_VEX_0F3A6E) },
8052 { PREFIX_TABLE (PREFIX_VEX_0F3A6F) },
8063 { PREFIX_TABLE (PREFIX_VEX_0F3A78) },
8064 { PREFIX_TABLE (PREFIX_VEX_0F3A79) },
8065 { PREFIX_TABLE (PREFIX_VEX_0F3A7A) },
8066 { PREFIX_TABLE (PREFIX_VEX_0F3A7B) },
8067 { PREFIX_TABLE (PREFIX_VEX_0F3A7C) },
8068 { PREFIX_TABLE (PREFIX_VEX_0F3A7D) },
8069 { PREFIX_TABLE (PREFIX_VEX_0F3A7E) },
8070 { PREFIX_TABLE (PREFIX_VEX_0F3A7F) },
8178 { PREFIX_TABLE (PREFIX_VEX_0F3ADF) },
8218 static const struct dis386 vex_len_table[][2] = {
8219 /* VEX_LEN_0F10_P_1 */
8221 { VEX_W_TABLE (VEX_W_0F10_P_1) },
8222 { VEX_W_TABLE (VEX_W_0F10_P_1) },
8225 /* VEX_LEN_0F10_P_3 */
8227 { VEX_W_TABLE (VEX_W_0F10_P_3) },
8228 { VEX_W_TABLE (VEX_W_0F10_P_3) },
8231 /* VEX_LEN_0F11_P_1 */
8233 { VEX_W_TABLE (VEX_W_0F11_P_1) },
8234 { VEX_W_TABLE (VEX_W_0F11_P_1) },
8237 /* VEX_LEN_0F11_P_3 */
8239 { VEX_W_TABLE (VEX_W_0F11_P_3) },
8240 { VEX_W_TABLE (VEX_W_0F11_P_3) },
8243 /* VEX_LEN_0F12_P_0_M_0 */
8245 { VEX_W_TABLE (VEX_W_0F12_P_0_M_0) },
8248 /* VEX_LEN_0F12_P_0_M_1 */
8250 { VEX_W_TABLE (VEX_W_0F12_P_0_M_1) },
8253 /* VEX_LEN_0F12_P_2 */
8255 { VEX_W_TABLE (VEX_W_0F12_P_2) },
8258 /* VEX_LEN_0F13_M_0 */
8260 { VEX_W_TABLE (VEX_W_0F13_M_0) },
8263 /* VEX_LEN_0F16_P_0_M_0 */
8265 { VEX_W_TABLE (VEX_W_0F16_P_0_M_0) },
8268 /* VEX_LEN_0F16_P_0_M_1 */
8270 { VEX_W_TABLE (VEX_W_0F16_P_0_M_1) },
8273 /* VEX_LEN_0F16_P_2 */
8275 { VEX_W_TABLE (VEX_W_0F16_P_2) },
8278 /* VEX_LEN_0F17_M_0 */
8280 { VEX_W_TABLE (VEX_W_0F17_M_0) },
8283 /* VEX_LEN_0F2A_P_1 */
8285 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev } },
8286 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev } },
8289 /* VEX_LEN_0F2A_P_3 */
8291 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev } },
8292 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev } },
8295 /* VEX_LEN_0F2C_P_1 */
8297 { "vcvttss2siY", { Gv, EXdScalar } },
8298 { "vcvttss2siY", { Gv, EXdScalar } },
8301 /* VEX_LEN_0F2C_P_3 */
8303 { "vcvttsd2siY", { Gv, EXqScalar } },
8304 { "vcvttsd2siY", { Gv, EXqScalar } },
8307 /* VEX_LEN_0F2D_P_1 */
8309 { "vcvtss2siY", { Gv, EXdScalar } },
8310 { "vcvtss2siY", { Gv, EXdScalar } },
8313 /* VEX_LEN_0F2D_P_3 */
8315 { "vcvtsd2siY", { Gv, EXqScalar } },
8316 { "vcvtsd2siY", { Gv, EXqScalar } },
8319 /* VEX_LEN_0F2E_P_0 */
8321 { VEX_W_TABLE (VEX_W_0F2E_P_0) },
8322 { VEX_W_TABLE (VEX_W_0F2E_P_0) },
8325 /* VEX_LEN_0F2E_P_2 */
8327 { VEX_W_TABLE (VEX_W_0F2E_P_2) },
8328 { VEX_W_TABLE (VEX_W_0F2E_P_2) },
8331 /* VEX_LEN_0F2F_P_0 */
8333 { VEX_W_TABLE (VEX_W_0F2F_P_0) },
8334 { VEX_W_TABLE (VEX_W_0F2F_P_0) },
8337 /* VEX_LEN_0F2F_P_2 */
8339 { VEX_W_TABLE (VEX_W_0F2F_P_2) },
8340 { VEX_W_TABLE (VEX_W_0F2F_P_2) },
8343 /* VEX_LEN_0F51_P_1 */
8345 { VEX_W_TABLE (VEX_W_0F51_P_1) },
8346 { VEX_W_TABLE (VEX_W_0F51_P_1) },
8349 /* VEX_LEN_0F51_P_3 */
8351 { VEX_W_TABLE (VEX_W_0F51_P_3) },
8352 { VEX_W_TABLE (VEX_W_0F51_P_3) },
8355 /* VEX_LEN_0F52_P_1 */
8357 { VEX_W_TABLE (VEX_W_0F52_P_1) },
8358 { VEX_W_TABLE (VEX_W_0F52_P_1) },
8361 /* VEX_LEN_0F53_P_1 */
8363 { VEX_W_TABLE (VEX_W_0F53_P_1) },
8364 { VEX_W_TABLE (VEX_W_0F53_P_1) },
8367 /* VEX_LEN_0F58_P_1 */
8369 { VEX_W_TABLE (VEX_W_0F58_P_1) },
8370 { VEX_W_TABLE (VEX_W_0F58_P_1) },
8373 /* VEX_LEN_0F58_P_3 */
8375 { VEX_W_TABLE (VEX_W_0F58_P_3) },
8376 { VEX_W_TABLE (VEX_W_0F58_P_3) },
8379 /* VEX_LEN_0F59_P_1 */
8381 { VEX_W_TABLE (VEX_W_0F59_P_1) },
8382 { VEX_W_TABLE (VEX_W_0F59_P_1) },
8385 /* VEX_LEN_0F59_P_3 */
8387 { VEX_W_TABLE (VEX_W_0F59_P_3) },
8388 { VEX_W_TABLE (VEX_W_0F59_P_3) },
8391 /* VEX_LEN_0F5A_P_1 */
8393 { VEX_W_TABLE (VEX_W_0F5A_P_1) },
8394 { VEX_W_TABLE (VEX_W_0F5A_P_1) },
8397 /* VEX_LEN_0F5A_P_3 */
8399 { VEX_W_TABLE (VEX_W_0F5A_P_3) },
8400 { VEX_W_TABLE (VEX_W_0F5A_P_3) },
8403 /* VEX_LEN_0F5C_P_1 */
8405 { VEX_W_TABLE (VEX_W_0F5C_P_1) },
8406 { VEX_W_TABLE (VEX_W_0F5C_P_1) },
8409 /* VEX_LEN_0F5C_P_3 */
8411 { VEX_W_TABLE (VEX_W_0F5C_P_3) },
8412 { VEX_W_TABLE (VEX_W_0F5C_P_3) },
8415 /* VEX_LEN_0F5D_P_1 */
8417 { VEX_W_TABLE (VEX_W_0F5D_P_1) },
8418 { VEX_W_TABLE (VEX_W_0F5D_P_1) },
8421 /* VEX_LEN_0F5D_P_3 */
8423 { VEX_W_TABLE (VEX_W_0F5D_P_3) },
8424 { VEX_W_TABLE (VEX_W_0F5D_P_3) },
8427 /* VEX_LEN_0F5E_P_1 */
8429 { VEX_W_TABLE (VEX_W_0F5E_P_1) },
8430 { VEX_W_TABLE (VEX_W_0F5E_P_1) },
8433 /* VEX_LEN_0F5E_P_3 */
8435 { VEX_W_TABLE (VEX_W_0F5E_P_3) },
8436 { VEX_W_TABLE (VEX_W_0F5E_P_3) },
8439 /* VEX_LEN_0F5F_P_1 */
8441 { VEX_W_TABLE (VEX_W_0F5F_P_1) },
8442 { VEX_W_TABLE (VEX_W_0F5F_P_1) },
8445 /* VEX_LEN_0F5F_P_3 */
8447 { VEX_W_TABLE (VEX_W_0F5F_P_3) },
8448 { VEX_W_TABLE (VEX_W_0F5F_P_3) },
8451 /* VEX_LEN_0F60_P_2 */
8453 { VEX_W_TABLE (VEX_W_0F60_P_2) },
8456 /* VEX_LEN_0F61_P_2 */
8458 { VEX_W_TABLE (VEX_W_0F61_P_2) },
8461 /* VEX_LEN_0F62_P_2 */
8463 { VEX_W_TABLE (VEX_W_0F62_P_2) },
8466 /* VEX_LEN_0F63_P_2 */
8468 { VEX_W_TABLE (VEX_W_0F63_P_2) },
8471 /* VEX_LEN_0F64_P_2 */
8473 { VEX_W_TABLE (VEX_W_0F64_P_2) },
8476 /* VEX_LEN_0F65_P_2 */
8478 { VEX_W_TABLE (VEX_W_0F65_P_2) },
8481 /* VEX_LEN_0F66_P_2 */
8483 { VEX_W_TABLE (VEX_W_0F66_P_2) },
8486 /* VEX_LEN_0F67_P_2 */
8488 { VEX_W_TABLE (VEX_W_0F67_P_2) },
8491 /* VEX_LEN_0F68_P_2 */
8493 { VEX_W_TABLE (VEX_W_0F68_P_2) },
8496 /* VEX_LEN_0F69_P_2 */
8498 { VEX_W_TABLE (VEX_W_0F69_P_2) },
8501 /* VEX_LEN_0F6A_P_2 */
8503 { VEX_W_TABLE (VEX_W_0F6A_P_2) },
8506 /* VEX_LEN_0F6B_P_2 */
8508 { VEX_W_TABLE (VEX_W_0F6B_P_2) },
8511 /* VEX_LEN_0F6C_P_2 */
8513 { VEX_W_TABLE (VEX_W_0F6C_P_2) },
8516 /* VEX_LEN_0F6D_P_2 */
8518 { VEX_W_TABLE (VEX_W_0F6D_P_2) },
8521 /* VEX_LEN_0F6E_P_2 */
8523 { "vmovK", { XMScalar, Edq } },
8524 { "vmovK", { XMScalar, Edq } },
8527 /* VEX_LEN_0F70_P_1 */
8529 { VEX_W_TABLE (VEX_W_0F70_P_1) },
8532 /* VEX_LEN_0F70_P_2 */
8534 { VEX_W_TABLE (VEX_W_0F70_P_2) },
8537 /* VEX_LEN_0F70_P_3 */
8539 { VEX_W_TABLE (VEX_W_0F70_P_3) },
8542 /* VEX_LEN_0F71_R_2_P_2 */
8544 { VEX_W_TABLE (VEX_W_0F71_R_2_P_2) },
8547 /* VEX_LEN_0F71_R_4_P_2 */
8549 { VEX_W_TABLE (VEX_W_0F71_R_4_P_2) },
8552 /* VEX_LEN_0F71_R_6_P_2 */
8554 { VEX_W_TABLE (VEX_W_0F71_R_6_P_2) },
8557 /* VEX_LEN_0F72_R_2_P_2 */
8559 { VEX_W_TABLE (VEX_W_0F72_R_2_P_2) },
8562 /* VEX_LEN_0F72_R_4_P_2 */
8564 { VEX_W_TABLE (VEX_W_0F72_R_4_P_2) },
8567 /* VEX_LEN_0F72_R_6_P_2 */
8569 { VEX_W_TABLE (VEX_W_0F72_R_6_P_2) },
8572 /* VEX_LEN_0F73_R_2_P_2 */
8574 { VEX_W_TABLE (VEX_W_0F73_R_2_P_2) },
8577 /* VEX_LEN_0F73_R_3_P_2 */
8579 { VEX_W_TABLE (VEX_W_0F73_R_3_P_2) },
8582 /* VEX_LEN_0F73_R_6_P_2 */
8584 { VEX_W_TABLE (VEX_W_0F73_R_6_P_2) },
8587 /* VEX_LEN_0F73_R_7_P_2 */
8589 { VEX_W_TABLE (VEX_W_0F73_R_7_P_2) },
8592 /* VEX_LEN_0F74_P_2 */
8594 { VEX_W_TABLE (VEX_W_0F74_P_2) },
8597 /* VEX_LEN_0F75_P_2 */
8599 { VEX_W_TABLE (VEX_W_0F75_P_2) },
8602 /* VEX_LEN_0F76_P_2 */
8604 { VEX_W_TABLE (VEX_W_0F76_P_2) },
8607 /* VEX_LEN_0F7E_P_1 */
8609 { VEX_W_TABLE (VEX_W_0F7E_P_1) },
8610 { VEX_W_TABLE (VEX_W_0F7E_P_1) },
8613 /* VEX_LEN_0F7E_P_2 */
8615 { "vmovK", { Edq, XMScalar } },
8616 { "vmovK", { Edq, XMScalar } },
8619 /* VEX_LEN_0FAE_R_2_M_0 */
8621 { VEX_W_TABLE (VEX_W_0FAE_R_2_M_0) },
8624 /* VEX_LEN_0FAE_R_3_M_0 */
8626 { VEX_W_TABLE (VEX_W_0FAE_R_3_M_0) },
8629 /* VEX_LEN_0FC2_P_1 */
8631 { VEX_W_TABLE (VEX_W_0FC2_P_1) },
8632 { VEX_W_TABLE (VEX_W_0FC2_P_1) },
8635 /* VEX_LEN_0FC2_P_3 */
8637 { VEX_W_TABLE (VEX_W_0FC2_P_3) },
8638 { VEX_W_TABLE (VEX_W_0FC2_P_3) },
8641 /* VEX_LEN_0FC4_P_2 */
8643 { VEX_W_TABLE (VEX_W_0FC4_P_2) },
8646 /* VEX_LEN_0FC5_P_2 */
8648 { VEX_W_TABLE (VEX_W_0FC5_P_2) },
8651 /* VEX_LEN_0FD1_P_2 */
8653 { VEX_W_TABLE (VEX_W_0FD1_P_2) },
8656 /* VEX_LEN_0FD2_P_2 */
8658 { VEX_W_TABLE (VEX_W_0FD2_P_2) },
8661 /* VEX_LEN_0FD3_P_2 */
8663 { VEX_W_TABLE (VEX_W_0FD3_P_2) },
8666 /* VEX_LEN_0FD4_P_2 */
8668 { VEX_W_TABLE (VEX_W_0FD4_P_2) },
8671 /* VEX_LEN_0FD5_P_2 */
8673 { VEX_W_TABLE (VEX_W_0FD5_P_2) },
8676 /* VEX_LEN_0FD6_P_2 */
8678 { VEX_W_TABLE (VEX_W_0FD6_P_2) },
8679 { VEX_W_TABLE (VEX_W_0FD6_P_2) },
8682 /* VEX_LEN_0FD7_P_2_M_1 */
8684 { VEX_W_TABLE (VEX_W_0FD7_P_2_M_1) },
8687 /* VEX_LEN_0FD8_P_2 */
8689 { VEX_W_TABLE (VEX_W_0FD8_P_2) },
8692 /* VEX_LEN_0FD9_P_2 */
8694 { VEX_W_TABLE (VEX_W_0FD9_P_2) },
8697 /* VEX_LEN_0FDA_P_2 */
8699 { VEX_W_TABLE (VEX_W_0FDA_P_2) },
8702 /* VEX_LEN_0FDB_P_2 */
8704 { VEX_W_TABLE (VEX_W_0FDB_P_2) },
8707 /* VEX_LEN_0FDC_P_2 */
8709 { VEX_W_TABLE (VEX_W_0FDC_P_2) },
8712 /* VEX_LEN_0FDD_P_2 */
8714 { VEX_W_TABLE (VEX_W_0FDD_P_2) },
8717 /* VEX_LEN_0FDE_P_2 */
8719 { VEX_W_TABLE (VEX_W_0FDE_P_2) },
8722 /* VEX_LEN_0FDF_P_2 */
8724 { VEX_W_TABLE (VEX_W_0FDF_P_2) },
8727 /* VEX_LEN_0FE0_P_2 */
8729 { VEX_W_TABLE (VEX_W_0FE0_P_2) },
8732 /* VEX_LEN_0FE1_P_2 */
8734 { VEX_W_TABLE (VEX_W_0FE1_P_2) },
8737 /* VEX_LEN_0FE2_P_2 */
8739 { VEX_W_TABLE (VEX_W_0FE2_P_2) },
8742 /* VEX_LEN_0FE3_P_2 */
8744 { VEX_W_TABLE (VEX_W_0FE3_P_2) },
8747 /* VEX_LEN_0FE4_P_2 */
8749 { VEX_W_TABLE (VEX_W_0FE4_P_2) },
8752 /* VEX_LEN_0FE5_P_2 */
8754 { VEX_W_TABLE (VEX_W_0FE5_P_2) },
8757 /* VEX_LEN_0FE8_P_2 */
8759 { VEX_W_TABLE (VEX_W_0FE8_P_2) },
8762 /* VEX_LEN_0FE9_P_2 */
8764 { VEX_W_TABLE (VEX_W_0FE9_P_2) },
8767 /* VEX_LEN_0FEA_P_2 */
8769 { VEX_W_TABLE (VEX_W_0FEA_P_2) },
8772 /* VEX_LEN_0FEB_P_2 */
8774 { VEX_W_TABLE (VEX_W_0FEB_P_2) },
8777 /* VEX_LEN_0FEC_P_2 */
8779 { VEX_W_TABLE (VEX_W_0FEC_P_2) },
8782 /* VEX_LEN_0FED_P_2 */
8784 { VEX_W_TABLE (VEX_W_0FED_P_2) },
8787 /* VEX_LEN_0FEE_P_2 */
8789 { VEX_W_TABLE (VEX_W_0FEE_P_2) },
8792 /* VEX_LEN_0FEF_P_2 */
8794 { VEX_W_TABLE (VEX_W_0FEF_P_2) },
8797 /* VEX_LEN_0FF1_P_2 */
8799 { VEX_W_TABLE (VEX_W_0FF1_P_2) },
8802 /* VEX_LEN_0FF2_P_2 */
8804 { VEX_W_TABLE (VEX_W_0FF2_P_2) },
8807 /* VEX_LEN_0FF3_P_2 */
8809 { VEX_W_TABLE (VEX_W_0FF3_P_2) },
8812 /* VEX_LEN_0FF4_P_2 */
8814 { VEX_W_TABLE (VEX_W_0FF4_P_2) },
8817 /* VEX_LEN_0FF5_P_2 */
8819 { VEX_W_TABLE (VEX_W_0FF5_P_2) },
8822 /* VEX_LEN_0FF6_P_2 */
8824 { VEX_W_TABLE (VEX_W_0FF6_P_2) },
8827 /* VEX_LEN_0FF7_P_2 */
8829 { VEX_W_TABLE (VEX_W_0FF7_P_2) },
8832 /* VEX_LEN_0FF8_P_2 */
8834 { VEX_W_TABLE (VEX_W_0FF8_P_2) },
8837 /* VEX_LEN_0FF9_P_2 */
8839 { VEX_W_TABLE (VEX_W_0FF9_P_2) },
8842 /* VEX_LEN_0FFA_P_2 */
8844 { VEX_W_TABLE (VEX_W_0FFA_P_2) },
8847 /* VEX_LEN_0FFB_P_2 */
8849 { VEX_W_TABLE (VEX_W_0FFB_P_2) },
8852 /* VEX_LEN_0FFC_P_2 */
8854 { VEX_W_TABLE (VEX_W_0FFC_P_2) },
8857 /* VEX_LEN_0FFD_P_2 */
8859 { VEX_W_TABLE (VEX_W_0FFD_P_2) },
8862 /* VEX_LEN_0FFE_P_2 */
8864 { VEX_W_TABLE (VEX_W_0FFE_P_2) },
8867 /* VEX_LEN_0F3800_P_2 */
8869 { VEX_W_TABLE (VEX_W_0F3800_P_2) },
8872 /* VEX_LEN_0F3801_P_2 */
8874 { VEX_W_TABLE (VEX_W_0F3801_P_2) },
8877 /* VEX_LEN_0F3802_P_2 */
8879 { VEX_W_TABLE (VEX_W_0F3802_P_2) },
8882 /* VEX_LEN_0F3803_P_2 */
8884 { VEX_W_TABLE (VEX_W_0F3803_P_2) },
8887 /* VEX_LEN_0F3804_P_2 */
8889 { VEX_W_TABLE (VEX_W_0F3804_P_2) },
8892 /* VEX_LEN_0F3805_P_2 */
8894 { VEX_W_TABLE (VEX_W_0F3805_P_2) },
8897 /* VEX_LEN_0F3806_P_2 */
8899 { VEX_W_TABLE (VEX_W_0F3806_P_2) },
8902 /* VEX_LEN_0F3807_P_2 */
8904 { VEX_W_TABLE (VEX_W_0F3807_P_2) },
8907 /* VEX_LEN_0F3808_P_2 */
8909 { VEX_W_TABLE (VEX_W_0F3808_P_2) },
8912 /* VEX_LEN_0F3809_P_2 */
8914 { VEX_W_TABLE (VEX_W_0F3809_P_2) },
8917 /* VEX_LEN_0F380A_P_2 */
8919 { VEX_W_TABLE (VEX_W_0F380A_P_2) },
8922 /* VEX_LEN_0F380B_P_2 */
8924 { VEX_W_TABLE (VEX_W_0F380B_P_2) },
8927 /* VEX_LEN_0F3819_P_2_M_0 */
8930 { VEX_W_TABLE (VEX_W_0F3819_P_2_M_0) },
8933 /* VEX_LEN_0F381A_P_2_M_0 */
8936 { VEX_W_TABLE (VEX_W_0F381A_P_2_M_0) },
8939 /* VEX_LEN_0F381C_P_2 */
8941 { VEX_W_TABLE (VEX_W_0F381C_P_2) },
8944 /* VEX_LEN_0F381D_P_2 */
8946 { VEX_W_TABLE (VEX_W_0F381D_P_2) },
8949 /* VEX_LEN_0F381E_P_2 */
8951 { VEX_W_TABLE (VEX_W_0F381E_P_2) },
8954 /* VEX_LEN_0F3820_P_2 */
8956 { VEX_W_TABLE (VEX_W_0F3820_P_2) },
8959 /* VEX_LEN_0F3821_P_2 */
8961 { VEX_W_TABLE (VEX_W_0F3821_P_2) },
8964 /* VEX_LEN_0F3822_P_2 */
8966 { VEX_W_TABLE (VEX_W_0F3822_P_2) },
8969 /* VEX_LEN_0F3823_P_2 */
8971 { VEX_W_TABLE (VEX_W_0F3823_P_2) },
8974 /* VEX_LEN_0F3824_P_2 */
8976 { VEX_W_TABLE (VEX_W_0F3824_P_2) },
8979 /* VEX_LEN_0F3825_P_2 */
8981 { VEX_W_TABLE (VEX_W_0F3825_P_2) },
8984 /* VEX_LEN_0F3828_P_2 */
8986 { VEX_W_TABLE (VEX_W_0F3828_P_2) },
8989 /* VEX_LEN_0F3829_P_2 */
8991 { VEX_W_TABLE (VEX_W_0F3829_P_2) },
8994 /* VEX_LEN_0F382A_P_2_M_0 */
8996 { VEX_W_TABLE (VEX_W_0F382A_P_2_M_0) },
8999 /* VEX_LEN_0F382B_P_2 */
9001 { VEX_W_TABLE (VEX_W_0F382B_P_2) },
9004 /* VEX_LEN_0F3830_P_2 */
9006 { VEX_W_TABLE (VEX_W_0F3830_P_2) },
9009 /* VEX_LEN_0F3831_P_2 */
9011 { VEX_W_TABLE (VEX_W_0F3831_P_2) },
9014 /* VEX_LEN_0F3832_P_2 */
9016 { VEX_W_TABLE (VEX_W_0F3832_P_2) },
9019 /* VEX_LEN_0F3833_P_2 */
9021 { VEX_W_TABLE (VEX_W_0F3833_P_2) },
9024 /* VEX_LEN_0F3834_P_2 */
9026 { VEX_W_TABLE (VEX_W_0F3834_P_2) },
9029 /* VEX_LEN_0F3835_P_2 */
9031 { VEX_W_TABLE (VEX_W_0F3835_P_2) },
9034 /* VEX_LEN_0F3837_P_2 */
9036 { VEX_W_TABLE (VEX_W_0F3837_P_2) },
9039 /* VEX_LEN_0F3838_P_2 */
9041 { VEX_W_TABLE (VEX_W_0F3838_P_2) },
9044 /* VEX_LEN_0F3839_P_2 */
9046 { VEX_W_TABLE (VEX_W_0F3839_P_2) },
9049 /* VEX_LEN_0F383A_P_2 */
9051 { VEX_W_TABLE (VEX_W_0F383A_P_2) },
9054 /* VEX_LEN_0F383B_P_2 */
9056 { VEX_W_TABLE (VEX_W_0F383B_P_2) },
9059 /* VEX_LEN_0F383C_P_2 */
9061 { VEX_W_TABLE (VEX_W_0F383C_P_2) },
9064 /* VEX_LEN_0F383D_P_2 */
9066 { VEX_W_TABLE (VEX_W_0F383D_P_2) },
9069 /* VEX_LEN_0F383E_P_2 */
9071 { VEX_W_TABLE (VEX_W_0F383E_P_2) },
9074 /* VEX_LEN_0F383F_P_2 */
9076 { VEX_W_TABLE (VEX_W_0F383F_P_2) },
9079 /* VEX_LEN_0F3840_P_2 */
9081 { VEX_W_TABLE (VEX_W_0F3840_P_2) },
9084 /* VEX_LEN_0F3841_P_2 */
9086 { VEX_W_TABLE (VEX_W_0F3841_P_2) },
9089 /* VEX_LEN_0F38DB_P_2 */
9091 { VEX_W_TABLE (VEX_W_0F38DB_P_2) },
9094 /* VEX_LEN_0F38DC_P_2 */
9096 { VEX_W_TABLE (VEX_W_0F38DC_P_2) },
9099 /* VEX_LEN_0F38DD_P_2 */
9101 { VEX_W_TABLE (VEX_W_0F38DD_P_2) },
9104 /* VEX_LEN_0F38DE_P_2 */
9106 { VEX_W_TABLE (VEX_W_0F38DE_P_2) },
9109 /* VEX_LEN_0F38DF_P_2 */
9111 { VEX_W_TABLE (VEX_W_0F38DF_P_2) },
9114 /* VEX_LEN_0F38F2_P_0 */
9116 { "andnS", { Gdq, VexGdq, Edq } },
9119 /* VEX_LEN_0F38F3_R_1_P_0 */
9121 { "blsrS", { VexGdq, Edq } },
9124 /* VEX_LEN_0F38F3_R_2_P_0 */
9126 { "blsmskS", { VexGdq, Edq } },
9129 /* VEX_LEN_0F38F3_R_3_P_0 */
9131 { "blsiS", { VexGdq, Edq } },
9134 /* VEX_LEN_0F38F7_P_0 */
9136 { "bextrS", { Gdq, Edq, VexGdq } },
9139 /* VEX_LEN_0F3A06_P_2 */
9142 { VEX_W_TABLE (VEX_W_0F3A06_P_2) },
9145 /* VEX_LEN_0F3A0A_P_2 */
9147 { VEX_W_TABLE (VEX_W_0F3A0A_P_2) },
9148 { VEX_W_TABLE (VEX_W_0F3A0A_P_2) },
9151 /* VEX_LEN_0F3A0B_P_2 */
9153 { VEX_W_TABLE (VEX_W_0F3A0B_P_2) },
9154 { VEX_W_TABLE (VEX_W_0F3A0B_P_2) },
9157 /* VEX_LEN_0F3A0E_P_2 */
9159 { VEX_W_TABLE (VEX_W_0F3A0E_P_2) },
9162 /* VEX_LEN_0F3A0F_P_2 */
9164 { VEX_W_TABLE (VEX_W_0F3A0F_P_2) },
9167 /* VEX_LEN_0F3A14_P_2 */
9169 { VEX_W_TABLE (VEX_W_0F3A14_P_2) },
9172 /* VEX_LEN_0F3A15_P_2 */
9174 { VEX_W_TABLE (VEX_W_0F3A15_P_2) },
9177 /* VEX_LEN_0F3A16_P_2 */
9179 { "vpextrK", { Edq, XM, Ib } },
9182 /* VEX_LEN_0F3A17_P_2 */
9184 { "vextractps", { Edqd, XM, Ib } },
9187 /* VEX_LEN_0F3A18_P_2 */
9190 { VEX_W_TABLE (VEX_W_0F3A18_P_2) },
9193 /* VEX_LEN_0F3A19_P_2 */
9196 { VEX_W_TABLE (VEX_W_0F3A19_P_2) },
9199 /* VEX_LEN_0F3A20_P_2 */
9201 { VEX_W_TABLE (VEX_W_0F3A20_P_2) },
9204 /* VEX_LEN_0F3A21_P_2 */
9206 { VEX_W_TABLE (VEX_W_0F3A21_P_2) },
9209 /* VEX_LEN_0F3A22_P_2 */
9211 { "vpinsrK", { XM, Vex128, Edq, Ib } },
9214 /* VEX_LEN_0F3A41_P_2 */
9216 { VEX_W_TABLE (VEX_W_0F3A41_P_2) },
9219 /* VEX_LEN_0F3A42_P_2 */
9221 { VEX_W_TABLE (VEX_W_0F3A42_P_2) },
9224 /* VEX_LEN_0F3A44_P_2 */
9226 { VEX_W_TABLE (VEX_W_0F3A44_P_2) },
9229 /* VEX_LEN_0F3A4C_P_2 */
9231 { VEX_W_TABLE (VEX_W_0F3A4C_P_2) },
9234 /* VEX_LEN_0F3A60_P_2 */
9236 { VEX_W_TABLE (VEX_W_0F3A60_P_2) },
9239 /* VEX_LEN_0F3A61_P_2 */
9241 { VEX_W_TABLE (VEX_W_0F3A61_P_2) },
9244 /* VEX_LEN_0F3A62_P_2 */
9246 { VEX_W_TABLE (VEX_W_0F3A62_P_2) },
9249 /* VEX_LEN_0F3A63_P_2 */
9251 { VEX_W_TABLE (VEX_W_0F3A63_P_2) },
9254 /* VEX_LEN_0F3A6A_P_2 */
9256 { "vfmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
9259 /* VEX_LEN_0F3A6B_P_2 */
9261 { "vfmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
9264 /* VEX_LEN_0F3A6E_P_2 */
9266 { "vfmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
9269 /* VEX_LEN_0F3A6F_P_2 */
9271 { "vfmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
9274 /* VEX_LEN_0F3A7A_P_2 */
9276 { "vfnmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
9279 /* VEX_LEN_0F3A7B_P_2 */
9281 { "vfnmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
9284 /* VEX_LEN_0F3A7E_P_2 */
9286 { "vfnmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW, VexI4 } },
9289 /* VEX_LEN_0F3A7F_P_2 */
9291 { "vfnmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW, VexI4 } },
9294 /* VEX_LEN_0F3ADF_P_2 */
9296 { VEX_W_TABLE (VEX_W_0F3ADF_P_2) },
9299 /* VEX_LEN_0FXOP_09_80 */
9301 { "vfrczps", { XM, EXxmm } },
9302 { "vfrczps", { XM, EXymmq } },
9305 /* VEX_LEN_0FXOP_09_81 */
9307 { "vfrczpd", { XM, EXxmm } },
9308 { "vfrczpd", { XM, EXymmq } },
9312 static const struct dis386 vex_w_table[][2] = {
9314 /* VEX_W_0F10_P_0 */
9315 { "vmovups", { XM, EXx } },
9318 /* VEX_W_0F10_P_1 */
9319 { "vmovss", { XMVexScalar, VexScalar, EXdScalar } },
9322 /* VEX_W_0F10_P_2 */
9323 { "vmovupd", { XM, EXx } },
9326 /* VEX_W_0F10_P_3 */
9327 { "vmovsd", { XMVexScalar, VexScalar, EXqScalar } },
9330 /* VEX_W_0F11_P_0 */
9331 { "vmovups", { EXxS, XM } },
9334 /* VEX_W_0F11_P_1 */
9335 { "vmovss", { EXdVexScalarS, VexScalar, XMScalar } },
9338 /* VEX_W_0F11_P_2 */
9339 { "vmovupd", { EXxS, XM } },
9342 /* VEX_W_0F11_P_3 */
9343 { "vmovsd", { EXqVexScalarS, VexScalar, XMScalar } },
9346 /* VEX_W_0F12_P_0_M_0 */
9347 { "vmovlps", { XM, Vex128, EXq } },
9350 /* VEX_W_0F12_P_0_M_1 */
9351 { "vmovhlps", { XM, Vex128, EXq } },
9354 /* VEX_W_0F12_P_1 */
9355 { "vmovsldup", { XM, EXx } },
9358 /* VEX_W_0F12_P_2 */
9359 { "vmovlpd", { XM, Vex128, EXq } },
9362 /* VEX_W_0F12_P_3 */
9363 { "vmovddup", { XM, EXymmq } },
9366 /* VEX_W_0F13_M_0 */
9367 { "vmovlpX", { EXq, XM } },
9371 { "vunpcklpX", { XM, Vex, EXx } },
9375 { "vunpckhpX", { XM, Vex, EXx } },
9378 /* VEX_W_0F16_P_0_M_0 */
9379 { "vmovhps", { XM, Vex128, EXq } },
9382 /* VEX_W_0F16_P_0_M_1 */
9383 { "vmovlhps", { XM, Vex128, EXq } },
9386 /* VEX_W_0F16_P_1 */
9387 { "vmovshdup", { XM, EXx } },
9390 /* VEX_W_0F16_P_2 */
9391 { "vmovhpd", { XM, Vex128, EXq } },
9394 /* VEX_W_0F17_M_0 */
9395 { "vmovhpX", { EXq, XM } },
9399 { "vmovapX", { XM, EXx } },
9403 { "vmovapX", { EXxS, XM } },
9406 /* VEX_W_0F2B_M_0 */
9407 { "vmovntpX", { Mx, XM } },
9410 /* VEX_W_0F2E_P_0 */
9411 { "vucomiss", { XMScalar, EXdScalar } },
9414 /* VEX_W_0F2E_P_2 */
9415 { "vucomisd", { XMScalar, EXqScalar } },
9418 /* VEX_W_0F2F_P_0 */
9419 { "vcomiss", { XMScalar, EXdScalar } },
9422 /* VEX_W_0F2F_P_2 */
9423 { "vcomisd", { XMScalar, EXqScalar } },
9426 /* VEX_W_0F50_M_0 */
9427 { "vmovmskpX", { Gdq, XS } },
9430 /* VEX_W_0F51_P_0 */
9431 { "vsqrtps", { XM, EXx } },
9434 /* VEX_W_0F51_P_1 */
9435 { "vsqrtss", { XMScalar, VexScalar, EXdScalar } },
9438 /* VEX_W_0F51_P_2 */
9439 { "vsqrtpd", { XM, EXx } },
9442 /* VEX_W_0F51_P_3 */
9443 { "vsqrtsd", { XMScalar, VexScalar, EXqScalar } },
9446 /* VEX_W_0F52_P_0 */
9447 { "vrsqrtps", { XM, EXx } },
9450 /* VEX_W_0F52_P_1 */
9451 { "vrsqrtss", { XMScalar, VexScalar, EXdScalar } },
9454 /* VEX_W_0F53_P_0 */
9455 { "vrcpps", { XM, EXx } },
9458 /* VEX_W_0F53_P_1 */
9459 { "vrcpss", { XMScalar, VexScalar, EXdScalar } },
9462 /* VEX_W_0F58_P_0 */
9463 { "vaddps", { XM, Vex, EXx } },
9466 /* VEX_W_0F58_P_1 */
9467 { "vaddss", { XMScalar, VexScalar, EXdScalar } },
9470 /* VEX_W_0F58_P_2 */
9471 { "vaddpd", { XM, Vex, EXx } },
9474 /* VEX_W_0F58_P_3 */
9475 { "vaddsd", { XMScalar, VexScalar, EXqScalar } },
9478 /* VEX_W_0F59_P_0 */
9479 { "vmulps", { XM, Vex, EXx } },
9482 /* VEX_W_0F59_P_1 */
9483 { "vmulss", { XMScalar, VexScalar, EXdScalar } },
9486 /* VEX_W_0F59_P_2 */
9487 { "vmulpd", { XM, Vex, EXx } },
9490 /* VEX_W_0F59_P_3 */
9491 { "vmulsd", { XMScalar, VexScalar, EXqScalar } },
9494 /* VEX_W_0F5A_P_0 */
9495 { "vcvtps2pd", { XM, EXxmmq } },
9498 /* VEX_W_0F5A_P_1 */
9499 { "vcvtss2sd", { XMScalar, VexScalar, EXdScalar } },
9502 /* VEX_W_0F5A_P_3 */
9503 { "vcvtsd2ss", { XMScalar, VexScalar, EXqScalar } },
9506 /* VEX_W_0F5B_P_0 */
9507 { "vcvtdq2ps", { XM, EXx } },
9510 /* VEX_W_0F5B_P_1 */
9511 { "vcvttps2dq", { XM, EXx } },
9514 /* VEX_W_0F5B_P_2 */
9515 { "vcvtps2dq", { XM, EXx } },
9518 /* VEX_W_0F5C_P_0 */
9519 { "vsubps", { XM, Vex, EXx } },
9522 /* VEX_W_0F5C_P_1 */
9523 { "vsubss", { XMScalar, VexScalar, EXdScalar } },
9526 /* VEX_W_0F5C_P_2 */
9527 { "vsubpd", { XM, Vex, EXx } },
9530 /* VEX_W_0F5C_P_3 */
9531 { "vsubsd", { XMScalar, VexScalar, EXqScalar } },
9534 /* VEX_W_0F5D_P_0 */
9535 { "vminps", { XM, Vex, EXx } },
9538 /* VEX_W_0F5D_P_1 */
9539 { "vminss", { XMScalar, VexScalar, EXdScalar } },
9542 /* VEX_W_0F5D_P_2 */
9543 { "vminpd", { XM, Vex, EXx } },
9546 /* VEX_W_0F5D_P_3 */
9547 { "vminsd", { XMScalar, VexScalar, EXqScalar } },
9550 /* VEX_W_0F5E_P_0 */
9551 { "vdivps", { XM, Vex, EXx } },
9554 /* VEX_W_0F5E_P_1 */
9555 { "vdivss", { XMScalar, VexScalar, EXdScalar } },
9558 /* VEX_W_0F5E_P_2 */
9559 { "vdivpd", { XM, Vex, EXx } },
9562 /* VEX_W_0F5E_P_3 */
9563 { "vdivsd", { XMScalar, VexScalar, EXqScalar } },
9566 /* VEX_W_0F5F_P_0 */
9567 { "vmaxps", { XM, Vex, EXx } },
9570 /* VEX_W_0F5F_P_1 */
9571 { "vmaxss", { XMScalar, VexScalar, EXdScalar } },
9574 /* VEX_W_0F5F_P_2 */
9575 { "vmaxpd", { XM, Vex, EXx } },
9578 /* VEX_W_0F5F_P_3 */
9579 { "vmaxsd", { XMScalar, VexScalar, EXqScalar } },
9582 /* VEX_W_0F60_P_2 */
9583 { "vpunpcklbw", { XM, Vex128, EXx } },
9586 /* VEX_W_0F61_P_2 */
9587 { "vpunpcklwd", { XM, Vex128, EXx } },
9590 /* VEX_W_0F62_P_2 */
9591 { "vpunpckldq", { XM, Vex128, EXx } },
9594 /* VEX_W_0F63_P_2 */
9595 { "vpacksswb", { XM, Vex128, EXx } },
9598 /* VEX_W_0F64_P_2 */
9599 { "vpcmpgtb", { XM, Vex128, EXx } },
9602 /* VEX_W_0F65_P_2 */
9603 { "vpcmpgtw", { XM, Vex128, EXx } },
9606 /* VEX_W_0F66_P_2 */
9607 { "vpcmpgtd", { XM, Vex128, EXx } },
9610 /* VEX_W_0F67_P_2 */
9611 { "vpackuswb", { XM, Vex128, EXx } },
9614 /* VEX_W_0F68_P_2 */
9615 { "vpunpckhbw", { XM, Vex128, EXx } },
9618 /* VEX_W_0F69_P_2 */
9619 { "vpunpckhwd", { XM, Vex128, EXx } },
9622 /* VEX_W_0F6A_P_2 */
9623 { "vpunpckhdq", { XM, Vex128, EXx } },
9626 /* VEX_W_0F6B_P_2 */
9627 { "vpackssdw", { XM, Vex128, EXx } },
9630 /* VEX_W_0F6C_P_2 */
9631 { "vpunpcklqdq", { XM, Vex128, EXx } },
9634 /* VEX_W_0F6D_P_2 */
9635 { "vpunpckhqdq", { XM, Vex128, EXx } },
9638 /* VEX_W_0F6F_P_1 */
9639 { "vmovdqu", { XM, EXx } },
9642 /* VEX_W_0F6F_P_2 */
9643 { "vmovdqa", { XM, EXx } },
9646 /* VEX_W_0F70_P_1 */
9647 { "vpshufhw", { XM, EXx, Ib } },
9650 /* VEX_W_0F70_P_2 */
9651 { "vpshufd", { XM, EXx, Ib } },
9654 /* VEX_W_0F70_P_3 */
9655 { "vpshuflw", { XM, EXx, Ib } },
9658 /* VEX_W_0F71_R_2_P_2 */
9659 { "vpsrlw", { Vex128, XS, Ib } },
9662 /* VEX_W_0F71_R_4_P_2 */
9663 { "vpsraw", { Vex128, XS, Ib } },
9666 /* VEX_W_0F71_R_6_P_2 */
9667 { "vpsllw", { Vex128, XS, Ib } },
9670 /* VEX_W_0F72_R_2_P_2 */
9671 { "vpsrld", { Vex128, XS, Ib } },
9674 /* VEX_W_0F72_R_4_P_2 */
9675 { "vpsrad", { Vex128, XS, Ib } },
9678 /* VEX_W_0F72_R_6_P_2 */
9679 { "vpslld", { Vex128, XS, Ib } },
9682 /* VEX_W_0F73_R_2_P_2 */
9683 { "vpsrlq", { Vex128, XS, Ib } },
9686 /* VEX_W_0F73_R_3_P_2 */
9687 { "vpsrldq", { Vex128, XS, Ib } },
9690 /* VEX_W_0F73_R_6_P_2 */
9691 { "vpsllq", { Vex128, XS, Ib } },
9694 /* VEX_W_0F73_R_7_P_2 */
9695 { "vpslldq", { Vex128, XS, Ib } },
9698 /* VEX_W_0F74_P_2 */
9699 { "vpcmpeqb", { XM, Vex128, EXx } },
9702 /* VEX_W_0F75_P_2 */
9703 { "vpcmpeqw", { XM, Vex128, EXx } },
9706 /* VEX_W_0F76_P_2 */
9707 { "vpcmpeqd", { XM, Vex128, EXx } },
9710 /* VEX_W_0F77_P_0 */
9714 /* VEX_W_0F7C_P_2 */
9715 { "vhaddpd", { XM, Vex, EXx } },
9718 /* VEX_W_0F7C_P_3 */
9719 { "vhaddps", { XM, Vex, EXx } },
9722 /* VEX_W_0F7D_P_2 */
9723 { "vhsubpd", { XM, Vex, EXx } },
9726 /* VEX_W_0F7D_P_3 */
9727 { "vhsubps", { XM, Vex, EXx } },
9730 /* VEX_W_0F7E_P_1 */
9731 { "vmovq", { XMScalar, EXqScalar } },
9734 /* VEX_W_0F7F_P_1 */
9735 { "vmovdqu", { EXxS, XM } },
9738 /* VEX_W_0F7F_P_2 */
9739 { "vmovdqa", { EXxS, XM } },
9742 /* VEX_W_0FAE_R_2_M_0 */
9743 { "vldmxcsr", { Md } },
9746 /* VEX_W_0FAE_R_3_M_0 */
9747 { "vstmxcsr", { Md } },
9750 /* VEX_W_0FC2_P_0 */
9751 { "vcmpps", { XM, Vex, EXx, VCMP } },
9754 /* VEX_W_0FC2_P_1 */
9755 { "vcmpss", { XMScalar, VexScalar, EXdScalar, VCMP } },
9758 /* VEX_W_0FC2_P_2 */
9759 { "vcmppd", { XM, Vex, EXx, VCMP } },
9762 /* VEX_W_0FC2_P_3 */
9763 { "vcmpsd", { XMScalar, VexScalar, EXqScalar, VCMP } },
9766 /* VEX_W_0FC4_P_2 */
9767 { "vpinsrw", { XM, Vex128, Edqw, Ib } },
9770 /* VEX_W_0FC5_P_2 */
9771 { "vpextrw", { Gdq, XS, Ib } },
9774 /* VEX_W_0FD0_P_2 */
9775 { "vaddsubpd", { XM, Vex, EXx } },
9778 /* VEX_W_0FD0_P_3 */
9779 { "vaddsubps", { XM, Vex, EXx } },
9782 /* VEX_W_0FD1_P_2 */
9783 { "vpsrlw", { XM, Vex128, EXx } },
9786 /* VEX_W_0FD2_P_2 */
9787 { "vpsrld", { XM, Vex128, EXx } },
9790 /* VEX_W_0FD3_P_2 */
9791 { "vpsrlq", { XM, Vex128, EXx } },
9794 /* VEX_W_0FD4_P_2 */
9795 { "vpaddq", { XM, Vex128, EXx } },
9798 /* VEX_W_0FD5_P_2 */
9799 { "vpmullw", { XM, Vex128, EXx } },
9802 /* VEX_W_0FD6_P_2 */
9803 { "vmovq", { EXqScalarS, XMScalar } },
9806 /* VEX_W_0FD7_P_2_M_1 */
9807 { "vpmovmskb", { Gdq, XS } },
9810 /* VEX_W_0FD8_P_2 */
9811 { "vpsubusb", { XM, Vex128, EXx } },
9814 /* VEX_W_0FD9_P_2 */
9815 { "vpsubusw", { XM, Vex128, EXx } },
9818 /* VEX_W_0FDA_P_2 */
9819 { "vpminub", { XM, Vex128, EXx } },
9822 /* VEX_W_0FDB_P_2 */
9823 { "vpand", { XM, Vex128, EXx } },
9826 /* VEX_W_0FDC_P_2 */
9827 { "vpaddusb", { XM, Vex128, EXx } },
9830 /* VEX_W_0FDD_P_2 */
9831 { "vpaddusw", { XM, Vex128, EXx } },
9834 /* VEX_W_0FDE_P_2 */
9835 { "vpmaxub", { XM, Vex128, EXx } },
9838 /* VEX_W_0FDF_P_2 */
9839 { "vpandn", { XM, Vex128, EXx } },
9842 /* VEX_W_0FE0_P_2 */
9843 { "vpavgb", { XM, Vex128, EXx } },
9846 /* VEX_W_0FE1_P_2 */
9847 { "vpsraw", { XM, Vex128, EXx } },
9850 /* VEX_W_0FE2_P_2 */
9851 { "vpsrad", { XM, Vex128, EXx } },
9854 /* VEX_W_0FE3_P_2 */
9855 { "vpavgw", { XM, Vex128, EXx } },
9858 /* VEX_W_0FE4_P_2 */
9859 { "vpmulhuw", { XM, Vex128, EXx } },
9862 /* VEX_W_0FE5_P_2 */
9863 { "vpmulhw", { XM, Vex128, EXx } },
9866 /* VEX_W_0FE6_P_1 */
9867 { "vcvtdq2pd", { XM, EXxmmq } },
9870 /* VEX_W_0FE6_P_2 */
9871 { "vcvttpd2dq%XY", { XMM, EXx } },
9874 /* VEX_W_0FE6_P_3 */
9875 { "vcvtpd2dq%XY", { XMM, EXx } },
9878 /* VEX_W_0FE7_P_2_M_0 */
9879 { "vmovntdq", { Mx, XM } },
9882 /* VEX_W_0FE8_P_2 */
9883 { "vpsubsb", { XM, Vex128, EXx } },
9886 /* VEX_W_0FE9_P_2 */
9887 { "vpsubsw", { XM, Vex128, EXx } },
9890 /* VEX_W_0FEA_P_2 */
9891 { "vpminsw", { XM, Vex128, EXx } },
9894 /* VEX_W_0FEB_P_2 */
9895 { "vpor", { XM, Vex128, EXx } },
9898 /* VEX_W_0FEC_P_2 */
9899 { "vpaddsb", { XM, Vex128, EXx } },
9902 /* VEX_W_0FED_P_2 */
9903 { "vpaddsw", { XM, Vex128, EXx } },
9906 /* VEX_W_0FEE_P_2 */
9907 { "vpmaxsw", { XM, Vex128, EXx } },
9910 /* VEX_W_0FEF_P_2 */
9911 { "vpxor", { XM, Vex128, EXx } },
9914 /* VEX_W_0FF0_P_3_M_0 */
9915 { "vlddqu", { XM, M } },
9918 /* VEX_W_0FF1_P_2 */
9919 { "vpsllw", { XM, Vex128, EXx } },
9922 /* VEX_W_0FF2_P_2 */
9923 { "vpslld", { XM, Vex128, EXx } },
9926 /* VEX_W_0FF3_P_2 */
9927 { "vpsllq", { XM, Vex128, EXx } },
9930 /* VEX_W_0FF4_P_2 */
9931 { "vpmuludq", { XM, Vex128, EXx } },
9934 /* VEX_W_0FF5_P_2 */
9935 { "vpmaddwd", { XM, Vex128, EXx } },
9938 /* VEX_W_0FF6_P_2 */
9939 { "vpsadbw", { XM, Vex128, EXx } },
9942 /* VEX_W_0FF7_P_2 */
9943 { "vmaskmovdqu", { XM, XS } },
9946 /* VEX_W_0FF8_P_2 */
9947 { "vpsubb", { XM, Vex128, EXx } },
9950 /* VEX_W_0FF9_P_2 */
9951 { "vpsubw", { XM, Vex128, EXx } },
9954 /* VEX_W_0FFA_P_2 */
9955 { "vpsubd", { XM, Vex128, EXx } },
9958 /* VEX_W_0FFB_P_2 */
9959 { "vpsubq", { XM, Vex128, EXx } },
9962 /* VEX_W_0FFC_P_2 */
9963 { "vpaddb", { XM, Vex128, EXx } },
9966 /* VEX_W_0FFD_P_2 */
9967 { "vpaddw", { XM, Vex128, EXx } },
9970 /* VEX_W_0FFE_P_2 */
9971 { "vpaddd", { XM, Vex128, EXx } },
9974 /* VEX_W_0F3800_P_2 */
9975 { "vpshufb", { XM, Vex128, EXx } },
9978 /* VEX_W_0F3801_P_2 */
9979 { "vphaddw", { XM, Vex128, EXx } },
9982 /* VEX_W_0F3802_P_2 */
9983 { "vphaddd", { XM, Vex128, EXx } },
9986 /* VEX_W_0F3803_P_2 */
9987 { "vphaddsw", { XM, Vex128, EXx } },
9990 /* VEX_W_0F3804_P_2 */
9991 { "vpmaddubsw", { XM, Vex128, EXx } },
9994 /* VEX_W_0F3805_P_2 */
9995 { "vphsubw", { XM, Vex128, EXx } },
9998 /* VEX_W_0F3806_P_2 */
9999 { "vphsubd", { XM, Vex128, EXx } },
10002 /* VEX_W_0F3807_P_2 */
10003 { "vphsubsw", { XM, Vex128, EXx } },
10006 /* VEX_W_0F3808_P_2 */
10007 { "vpsignb", { XM, Vex128, EXx } },
10010 /* VEX_W_0F3809_P_2 */
10011 { "vpsignw", { XM, Vex128, EXx } },
10014 /* VEX_W_0F380A_P_2 */
10015 { "vpsignd", { XM, Vex128, EXx } },
10018 /* VEX_W_0F380B_P_2 */
10019 { "vpmulhrsw", { XM, Vex128, EXx } },
10022 /* VEX_W_0F380C_P_2 */
10023 { "vpermilps", { XM, Vex, EXx } },
10026 /* VEX_W_0F380D_P_2 */
10027 { "vpermilpd", { XM, Vex, EXx } },
10030 /* VEX_W_0F380E_P_2 */
10031 { "vtestps", { XM, EXx } },
10034 /* VEX_W_0F380F_P_2 */
10035 { "vtestpd", { XM, EXx } },
10038 /* VEX_W_0F3817_P_2 */
10039 { "vptest", { XM, EXx } },
10042 /* VEX_W_0F3818_P_2_M_0 */
10043 { "vbroadcastss", { XM, Md } },
10046 /* VEX_W_0F3819_P_2_M_0 */
10047 { "vbroadcastsd", { XM, Mq } },
10050 /* VEX_W_0F381A_P_2_M_0 */
10051 { "vbroadcastf128", { XM, Mxmm } },
10054 /* VEX_W_0F381C_P_2 */
10055 { "vpabsb", { XM, EXx } },
10058 /* VEX_W_0F381D_P_2 */
10059 { "vpabsw", { XM, EXx } },
10062 /* VEX_W_0F381E_P_2 */
10063 { "vpabsd", { XM, EXx } },
10066 /* VEX_W_0F3820_P_2 */
10067 { "vpmovsxbw", { XM, EXq } },
10070 /* VEX_W_0F3821_P_2 */
10071 { "vpmovsxbd", { XM, EXd } },
10074 /* VEX_W_0F3822_P_2 */
10075 { "vpmovsxbq", { XM, EXw } },
10078 /* VEX_W_0F3823_P_2 */
10079 { "vpmovsxwd", { XM, EXq } },
10082 /* VEX_W_0F3824_P_2 */
10083 { "vpmovsxwq", { XM, EXd } },
10086 /* VEX_W_0F3825_P_2 */
10087 { "vpmovsxdq", { XM, EXq } },
10090 /* VEX_W_0F3828_P_2 */
10091 { "vpmuldq", { XM, Vex128, EXx } },
10094 /* VEX_W_0F3829_P_2 */
10095 { "vpcmpeqq", { XM, Vex128, EXx } },
10098 /* VEX_W_0F382A_P_2_M_0 */
10099 { "vmovntdqa", { XM, Mx } },
10102 /* VEX_W_0F382B_P_2 */
10103 { "vpackusdw", { XM, Vex128, EXx } },
10106 /* VEX_W_0F382C_P_2_M_0 */
10107 { "vmaskmovps", { XM, Vex, Mx } },
10110 /* VEX_W_0F382D_P_2_M_0 */
10111 { "vmaskmovpd", { XM, Vex, Mx } },
10114 /* VEX_W_0F382E_P_2_M_0 */
10115 { "vmaskmovps", { Mx, Vex, XM } },
10118 /* VEX_W_0F382F_P_2_M_0 */
10119 { "vmaskmovpd", { Mx, Vex, XM } },
10122 /* VEX_W_0F3830_P_2 */
10123 { "vpmovzxbw", { XM, EXq } },
10126 /* VEX_W_0F3831_P_2 */
10127 { "vpmovzxbd", { XM, EXd } },
10130 /* VEX_W_0F3832_P_2 */
10131 { "vpmovzxbq", { XM, EXw } },
10134 /* VEX_W_0F3833_P_2 */
10135 { "vpmovzxwd", { XM, EXq } },
10138 /* VEX_W_0F3834_P_2 */
10139 { "vpmovzxwq", { XM, EXd } },
10142 /* VEX_W_0F3835_P_2 */
10143 { "vpmovzxdq", { XM, EXq } },
10146 /* VEX_W_0F3837_P_2 */
10147 { "vpcmpgtq", { XM, Vex128, EXx } },
10150 /* VEX_W_0F3838_P_2 */
10151 { "vpminsb", { XM, Vex128, EXx } },
10154 /* VEX_W_0F3839_P_2 */
10155 { "vpminsd", { XM, Vex128, EXx } },
10158 /* VEX_W_0F383A_P_2 */
10159 { "vpminuw", { XM, Vex128, EXx } },
10162 /* VEX_W_0F383B_P_2 */
10163 { "vpminud", { XM, Vex128, EXx } },
10166 /* VEX_W_0F383C_P_2 */
10167 { "vpmaxsb", { XM, Vex128, EXx } },
10170 /* VEX_W_0F383D_P_2 */
10171 { "vpmaxsd", { XM, Vex128, EXx } },
10174 /* VEX_W_0F383E_P_2 */
10175 { "vpmaxuw", { XM, Vex128, EXx } },
10178 /* VEX_W_0F383F_P_2 */
10179 { "vpmaxud", { XM, Vex128, EXx } },
10182 /* VEX_W_0F3840_P_2 */
10183 { "vpmulld", { XM, Vex128, EXx } },
10186 /* VEX_W_0F3841_P_2 */
10187 { "vphminposuw", { XM, EXx } },
10190 /* VEX_W_0F38DB_P_2 */
10191 { "vaesimc", { XM, EXx } },
10194 /* VEX_W_0F38DC_P_2 */
10195 { "vaesenc", { XM, Vex128, EXx } },
10198 /* VEX_W_0F38DD_P_2 */
10199 { "vaesenclast", { XM, Vex128, EXx } },
10202 /* VEX_W_0F38DE_P_2 */
10203 { "vaesdec", { XM, Vex128, EXx } },
10206 /* VEX_W_0F38DF_P_2 */
10207 { "vaesdeclast", { XM, Vex128, EXx } },
10210 /* VEX_W_0F3A04_P_2 */
10211 { "vpermilps", { XM, EXx, Ib } },
10214 /* VEX_W_0F3A05_P_2 */
10215 { "vpermilpd", { XM, EXx, Ib } },
10218 /* VEX_W_0F3A06_P_2 */
10219 { "vperm2f128", { XM, Vex256, EXx, Ib } },
10222 /* VEX_W_0F3A08_P_2 */
10223 { "vroundps", { XM, EXx, Ib } },
10226 /* VEX_W_0F3A09_P_2 */
10227 { "vroundpd", { XM, EXx, Ib } },
10230 /* VEX_W_0F3A0A_P_2 */
10231 { "vroundss", { XMScalar, VexScalar, EXdScalar, Ib } },
10234 /* VEX_W_0F3A0B_P_2 */
10235 { "vroundsd", { XMScalar, VexScalar, EXqScalar, Ib } },
10238 /* VEX_W_0F3A0C_P_2 */
10239 { "vblendps", { XM, Vex, EXx, Ib } },
10242 /* VEX_W_0F3A0D_P_2 */
10243 { "vblendpd", { XM, Vex, EXx, Ib } },
10246 /* VEX_W_0F3A0E_P_2 */
10247 { "vpblendw", { XM, Vex128, EXx, Ib } },
10250 /* VEX_W_0F3A0F_P_2 */
10251 { "vpalignr", { XM, Vex128, EXx, Ib } },
10254 /* VEX_W_0F3A14_P_2 */
10255 { "vpextrb", { Edqb, XM, Ib } },
10258 /* VEX_W_0F3A15_P_2 */
10259 { "vpextrw", { Edqw, XM, Ib } },
10262 /* VEX_W_0F3A18_P_2 */
10263 { "vinsertf128", { XM, Vex256, EXxmm, Ib } },
10266 /* VEX_W_0F3A19_P_2 */
10267 { "vextractf128", { EXxmm, XM, Ib } },
10270 /* VEX_W_0F3A20_P_2 */
10271 { "vpinsrb", { XM, Vex128, Edqb, Ib } },
10274 /* VEX_W_0F3A21_P_2 */
10275 { "vinsertps", { XM, Vex128, EXd, Ib } },
10278 /* VEX_W_0F3A40_P_2 */
10279 { "vdpps", { XM, Vex, EXx, Ib } },
10282 /* VEX_W_0F3A41_P_2 */
10283 { "vdppd", { XM, Vex128, EXx, Ib } },
10286 /* VEX_W_0F3A42_P_2 */
10287 { "vmpsadbw", { XM, Vex128, EXx, Ib } },
10290 /* VEX_W_0F3A44_P_2 */
10291 { "vpclmulqdq", { XM, Vex128, EXx, PCLMUL } },
10294 /* VEX_W_0F3A48_P_2 */
10295 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW } },
10296 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW } },
10299 /* VEX_W_0F3A49_P_2 */
10300 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW } },
10301 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW } },
10304 /* VEX_W_0F3A4A_P_2 */
10305 { "vblendvps", { XM, Vex, EXx, XMVexI4 } },
10308 /* VEX_W_0F3A4B_P_2 */
10309 { "vblendvpd", { XM, Vex, EXx, XMVexI4 } },
10312 /* VEX_W_0F3A4C_P_2 */
10313 { "vpblendvb", { XM, Vex128, EXx, XMVexI4 } },
10316 /* VEX_W_0F3A60_P_2 */
10317 { "vpcmpestrm", { XM, EXx, Ib } },
10320 /* VEX_W_0F3A61_P_2 */
10321 { "vpcmpestri", { XM, EXx, Ib } },
10324 /* VEX_W_0F3A62_P_2 */
10325 { "vpcmpistrm", { XM, EXx, Ib } },
10328 /* VEX_W_0F3A63_P_2 */
10329 { "vpcmpistri", { XM, EXx, Ib } },
10332 /* VEX_W_0F3ADF_P_2 */
10333 { "vaeskeygenassist", { XM, EXx, Ib } },
10337 static const struct dis386 mod_table[][2] = {
10340 { "leaS", { Gv, M } },
10343 /* MOD_0F01_REG_0 */
10344 { X86_64_TABLE (X86_64_0F01_REG_0) },
10345 { RM_TABLE (RM_0F01_REG_0) },
10348 /* MOD_0F01_REG_1 */
10349 { X86_64_TABLE (X86_64_0F01_REG_1) },
10350 { RM_TABLE (RM_0F01_REG_1) },
10353 /* MOD_0F01_REG_2 */
10354 { X86_64_TABLE (X86_64_0F01_REG_2) },
10355 { RM_TABLE (RM_0F01_REG_2) },
10358 /* MOD_0F01_REG_3 */
10359 { X86_64_TABLE (X86_64_0F01_REG_3) },
10360 { RM_TABLE (RM_0F01_REG_3) },
10363 /* MOD_0F01_REG_7 */
10364 { "invlpg", { Mb } },
10365 { RM_TABLE (RM_0F01_REG_7) },
10368 /* MOD_0F12_PREFIX_0 */
10369 { "movlps", { XM, EXq } },
10370 { "movhlps", { XM, EXq } },
10374 { "movlpX", { EXq, XM } },
10377 /* MOD_0F16_PREFIX_0 */
10378 { "movhps", { XM, EXq } },
10379 { "movlhps", { XM, EXq } },
10383 { "movhpX", { EXq, XM } },
10386 /* MOD_0F18_REG_0 */
10387 { "prefetchnta", { Mb } },
10390 /* MOD_0F18_REG_1 */
10391 { "prefetcht0", { Mb } },
10394 /* MOD_0F18_REG_2 */
10395 { "prefetcht1", { Mb } },
10398 /* MOD_0F18_REG_3 */
10399 { "prefetcht2", { Mb } },
10404 { "movZ", { Rm, Cm } },
10409 { "movZ", { Rm, Dm } },
10414 { "movZ", { Cm, Rm } },
10419 { "movZ", { Dm, Rm } },
10424 { "movL", { Rd, Td } },
10429 { "movL", { Td, Rd } },
10432 /* MOD_0F2B_PREFIX_0 */
10433 {"movntps", { Mx, XM } },
10436 /* MOD_0F2B_PREFIX_1 */
10437 {"movntss", { Md, XM } },
10440 /* MOD_0F2B_PREFIX_2 */
10441 {"movntpd", { Mx, XM } },
10444 /* MOD_0F2B_PREFIX_3 */
10445 {"movntsd", { Mq, XM } },
10450 { "movmskpX", { Gdq, XS } },
10453 /* MOD_0F71_REG_2 */
10455 { "psrlw", { MS, Ib } },
10458 /* MOD_0F71_REG_4 */
10460 { "psraw", { MS, Ib } },
10463 /* MOD_0F71_REG_6 */
10465 { "psllw", { MS, Ib } },
10468 /* MOD_0F72_REG_2 */
10470 { "psrld", { MS, Ib } },
10473 /* MOD_0F72_REG_4 */
10475 { "psrad", { MS, Ib } },
10478 /* MOD_0F72_REG_6 */
10480 { "pslld", { MS, Ib } },
10483 /* MOD_0F73_REG_2 */
10485 { "psrlq", { MS, Ib } },
10488 /* MOD_0F73_REG_3 */
10490 { PREFIX_TABLE (PREFIX_0F73_REG_3) },
10493 /* MOD_0F73_REG_6 */
10495 { "psllq", { MS, Ib } },
10498 /* MOD_0F73_REG_7 */
10500 { PREFIX_TABLE (PREFIX_0F73_REG_7) },
10503 /* MOD_0FAE_REG_0 */
10504 { "fxsave", { FXSAVE } },
10505 { PREFIX_TABLE (PREFIX_0FAE_REG_0) },
10508 /* MOD_0FAE_REG_1 */
10509 { "fxrstor", { FXSAVE } },
10510 { PREFIX_TABLE (PREFIX_0FAE_REG_1) },
10513 /* MOD_0FAE_REG_2 */
10514 { "ldmxcsr", { Md } },
10515 { PREFIX_TABLE (PREFIX_0FAE_REG_2) },
10518 /* MOD_0FAE_REG_3 */
10519 { "stmxcsr", { Md } },
10520 { PREFIX_TABLE (PREFIX_0FAE_REG_3) },
10523 /* MOD_0FAE_REG_4 */
10524 { "xsave", { FXSAVE } },
10527 /* MOD_0FAE_REG_5 */
10528 { "xrstor", { FXSAVE } },
10529 { RM_TABLE (RM_0FAE_REG_5) },
10532 /* MOD_0FAE_REG_6 */
10533 { "xsaveopt", { FXSAVE } },
10534 { RM_TABLE (RM_0FAE_REG_6) },
10537 /* MOD_0FAE_REG_7 */
10538 { "clflush", { Mb } },
10539 { RM_TABLE (RM_0FAE_REG_7) },
10543 { "lssS", { Gv, Mp } },
10547 { "lfsS", { Gv, Mp } },
10551 { "lgsS", { Gv, Mp } },
10554 /* MOD_0FC7_REG_6 */
10555 { PREFIX_TABLE (PREFIX_0FC7_REG_6) },
10556 { "rdrand", { Ev } },
10559 /* MOD_0FC7_REG_7 */
10560 { "vmptrst", { Mq } },
10565 { "pmovmskb", { Gdq, MS } },
10568 /* MOD_0FE7_PREFIX_2 */
10569 { "movntdq", { Mx, XM } },
10572 /* MOD_0FF0_PREFIX_3 */
10573 { "lddqu", { XM, M } },
10576 /* MOD_0F382A_PREFIX_2 */
10577 { "movntdqa", { XM, Mx } },
10581 { "bound{S|}", { Gv, Ma } },
10585 { "lesS", { Gv, Mp } },
10586 { VEX_C4_TABLE (VEX_0F) },
10590 { "ldsS", { Gv, Mp } },
10591 { VEX_C5_TABLE (VEX_0F) },
10594 /* MOD_VEX_0F12_PREFIX_0 */
10595 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0) },
10596 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1) },
10600 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0) },
10603 /* MOD_VEX_0F16_PREFIX_0 */
10604 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0) },
10605 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1) },
10609 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0) },
10613 { VEX_W_TABLE (VEX_W_0F2B_M_0) },
10618 { VEX_W_TABLE (VEX_W_0F50_M_0) },
10621 /* MOD_VEX_0F71_REG_2 */
10623 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_2) },
10626 /* MOD_VEX_0F71_REG_4 */
10628 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_4) },
10631 /* MOD_VEX_0F71_REG_6 */
10633 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_6) },
10636 /* MOD_VEX_0F72_REG_2 */
10638 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_2) },
10641 /* MOD_VEX_0F72_REG_4 */
10643 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_4) },
10646 /* MOD_VEX_0F72_REG_6 */
10648 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_6) },
10651 /* MOD_VEX_0F73_REG_2 */
10653 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_2) },
10656 /* MOD_VEX_0F73_REG_3 */
10658 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_3) },
10661 /* MOD_VEX_0F73_REG_6 */
10663 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_6) },
10666 /* MOD_VEX_0F73_REG_7 */
10668 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_7) },
10671 /* MOD_VEX_0FAE_REG_2 */
10672 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0) },
10675 /* MOD_VEX_0FAE_REG_3 */
10676 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0) },
10679 /* MOD_VEX_0FD7_PREFIX_2 */
10681 { VEX_LEN_TABLE (VEX_LEN_0FD7_P_2_M_1) },
10684 /* MOD_VEX_0FE7_PREFIX_2 */
10685 { VEX_W_TABLE (VEX_W_0FE7_P_2_M_0) },
10688 /* MOD_VEX_0FF0_PREFIX_3 */
10689 { VEX_W_TABLE (VEX_W_0FF0_P_3_M_0) },
10692 /* MOD_VEX_0F3818_PREFIX_2 */
10693 { VEX_W_TABLE (VEX_W_0F3818_P_2_M_0) },
10696 /* MOD_VEX_0F3819_PREFIX_2 */
10697 { VEX_LEN_TABLE (VEX_LEN_0F3819_P_2_M_0) },
10700 /* MOD_VEX_0F381A_PREFIX_2 */
10701 { VEX_LEN_TABLE (VEX_LEN_0F381A_P_2_M_0) },
10704 /* MOD_VEX_0F382A_PREFIX_2 */
10705 { VEX_LEN_TABLE (VEX_LEN_0F382A_P_2_M_0) },
10708 /* MOD_VEX_0F382C_PREFIX_2 */
10709 { VEX_W_TABLE (VEX_W_0F382C_P_2_M_0) },
10712 /* MOD_VEX_0F382D_PREFIX_2 */
10713 { VEX_W_TABLE (VEX_W_0F382D_P_2_M_0) },
10716 /* MOD_VEX_0F382E_PREFIX_2 */
10717 { VEX_W_TABLE (VEX_W_0F382E_P_2_M_0) },
10720 /* MOD_VEX_0F382F_PREFIX_2 */
10721 { VEX_W_TABLE (VEX_W_0F382F_P_2_M_0) },
10725 static const struct dis386 rm_table[][8] = {
10727 /* RM_0F01_REG_0 */
10729 { "vmcall", { Skip_MODRM } },
10730 { "vmlaunch", { Skip_MODRM } },
10731 { "vmresume", { Skip_MODRM } },
10732 { "vmxoff", { Skip_MODRM } },
10735 /* RM_0F01_REG_1 */
10736 { "monitor", { { OP_Monitor, 0 } } },
10737 { "mwait", { { OP_Mwait, 0 } } },
10740 /* RM_0F01_REG_2 */
10741 { "xgetbv", { Skip_MODRM } },
10742 { "xsetbv", { Skip_MODRM } },
10745 /* RM_0F01_REG_3 */
10746 { "vmrun", { Skip_MODRM } },
10747 { "vmmcall", { Skip_MODRM } },
10748 { "vmload", { Skip_MODRM } },
10749 { "vmsave", { Skip_MODRM } },
10750 { "stgi", { Skip_MODRM } },
10751 { "clgi", { Skip_MODRM } },
10752 { "skinit", { Skip_MODRM } },
10753 { "invlpga", { Skip_MODRM } },
10756 /* RM_0F01_REG_7 */
10757 { "swapgs", { Skip_MODRM } },
10758 { "rdtscp", { Skip_MODRM } },
10761 /* RM_0FAE_REG_5 */
10762 { "lfence", { Skip_MODRM } },
10765 /* RM_0FAE_REG_6 */
10766 { "mfence", { Skip_MODRM } },
10769 /* RM_0FAE_REG_7 */
10770 { "sfence", { Skip_MODRM } },
10774 #define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
10776 /* We use the high bit to indicate different name for the same
10778 #define ADDR16_PREFIX (0x67 | 0x100)
10779 #define ADDR32_PREFIX (0x67 | 0x200)
10780 #define DATA16_PREFIX (0x66 | 0x100)
10781 #define DATA32_PREFIX (0x66 | 0x200)
10782 #define REP_PREFIX (0xf3 | 0x100)
10787 int newrex, i, length;
10793 last_lock_prefix = -1;
10794 last_repz_prefix = -1;
10795 last_repnz_prefix = -1;
10796 last_data_prefix = -1;
10797 last_addr_prefix = -1;
10798 last_rex_prefix = -1;
10799 last_seg_prefix = -1;
10800 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
10801 all_prefixes[i] = 0;
10804 /* The maximum instruction length is 15bytes. */
10805 while (length < MAX_CODE_LENGTH - 1)
10807 FETCH_DATA (the_info, codep + 1);
10811 /* REX prefixes family. */
10828 if (address_mode == mode_64bit)
10832 last_rex_prefix = i;
10835 prefixes |= PREFIX_REPZ;
10836 last_repz_prefix = i;
10839 prefixes |= PREFIX_REPNZ;
10840 last_repnz_prefix = i;
10843 prefixes |= PREFIX_LOCK;
10844 last_lock_prefix = i;
10847 prefixes |= PREFIX_CS;
10848 last_seg_prefix = i;
10851 prefixes |= PREFIX_SS;
10852 last_seg_prefix = i;
10855 prefixes |= PREFIX_DS;
10856 last_seg_prefix = i;
10859 prefixes |= PREFIX_ES;
10860 last_seg_prefix = i;
10863 prefixes |= PREFIX_FS;
10864 last_seg_prefix = i;
10867 prefixes |= PREFIX_GS;
10868 last_seg_prefix = i;
10871 prefixes |= PREFIX_DATA;
10872 last_data_prefix = i;
10875 prefixes |= PREFIX_ADDR;
10876 last_addr_prefix = i;
10879 /* fwait is really an instruction. If there are prefixes
10880 before the fwait, they belong to the fwait, *not* to the
10881 following instruction. */
10882 if (prefixes || rex)
10884 prefixes |= PREFIX_FWAIT;
10888 prefixes = PREFIX_FWAIT;
10893 /* Rex is ignored when followed by another prefix. */
10899 if (*codep != FWAIT_OPCODE)
10900 all_prefixes[i++] = *codep;
10909 seg_prefix (int pref)
10930 /* Return the name of the prefix byte PREF, or NULL if PREF is not a
10933 static const char *
10934 prefix_name (int pref, int sizeflag)
10936 static const char *rexes [16] =
10939 "rex.B", /* 0x41 */
10940 "rex.X", /* 0x42 */
10941 "rex.XB", /* 0x43 */
10942 "rex.R", /* 0x44 */
10943 "rex.RB", /* 0x45 */
10944 "rex.RX", /* 0x46 */
10945 "rex.RXB", /* 0x47 */
10946 "rex.W", /* 0x48 */
10947 "rex.WB", /* 0x49 */
10948 "rex.WX", /* 0x4a */
10949 "rex.WXB", /* 0x4b */
10950 "rex.WR", /* 0x4c */
10951 "rex.WRB", /* 0x4d */
10952 "rex.WRX", /* 0x4e */
10953 "rex.WRXB", /* 0x4f */
10958 /* REX prefixes family. */
10975 return rexes [pref - 0x40];
10995 return (sizeflag & DFLAG) ? "data16" : "data32";
10997 if (address_mode == mode_64bit)
10998 return (sizeflag & AFLAG) ? "addr32" : "addr64";
11000 return (sizeflag & AFLAG) ? "addr16" : "addr32";
11003 case ADDR16_PREFIX:
11005 case ADDR32_PREFIX:
11007 case DATA16_PREFIX:
11009 case DATA32_PREFIX:
11018 static char op_out[MAX_OPERANDS][100];
11019 static int op_ad, op_index[MAX_OPERANDS];
11020 static int two_source_ops;
11021 static bfd_vma op_address[MAX_OPERANDS];
11022 static bfd_vma op_riprel[MAX_OPERANDS];
11023 static bfd_vma start_pc;
11026 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
11027 * (see topic "Redundant prefixes" in the "Differences from 8086"
11028 * section of the "Virtual 8086 Mode" chapter.)
11029 * 'pc' should be the address of this instruction, it will
11030 * be used to print the target address if this is a relative jump or call
11031 * The function returns the length of this instruction in bytes.
11034 static char intel_syntax;
11035 static char intel_mnemonic = !SYSV386_COMPAT;
11036 static char open_char;
11037 static char close_char;
11038 static char separator_char;
11039 static char scale_char;
11041 /* Here for backwards compatibility. When gdb stops using
11042 print_insn_i386_att and print_insn_i386_intel these functions can
11043 disappear, and print_insn_i386 be merged into print_insn. */
11045 print_insn_i386_att (bfd_vma pc, disassemble_info *info)
11049 return print_insn (pc, info);
11053 print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
11057 return print_insn (pc, info);
11061 print_insn_i386 (bfd_vma pc, disassemble_info *info)
11065 return print_insn (pc, info);
11069 print_i386_disassembler_options (FILE *stream)
11071 fprintf (stream, _("\n\
11072 The following i386/x86-64 specific disassembler options are supported for use\n\
11073 with the -M switch (multiple options should be separated by commas):\n"));
11075 fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n"));
11076 fprintf (stream, _(" i386 Disassemble in 32bit mode\n"));
11077 fprintf (stream, _(" i8086 Disassemble in 16bit mode\n"));
11078 fprintf (stream, _(" att Display instruction in AT&T syntax\n"));
11079 fprintf (stream, _(" intel Display instruction in Intel syntax\n"));
11080 fprintf (stream, _(" att-mnemonic\n"
11081 " Display instruction in AT&T mnemonic\n"));
11082 fprintf (stream, _(" intel-mnemonic\n"
11083 " Display instruction in Intel mnemonic\n"));
11084 fprintf (stream, _(" addr64 Assume 64bit address size\n"));
11085 fprintf (stream, _(" addr32 Assume 32bit address size\n"));
11086 fprintf (stream, _(" addr16 Assume 16bit address size\n"));
11087 fprintf (stream, _(" data32 Assume 32bit data size\n"));
11088 fprintf (stream, _(" data16 Assume 16bit data size\n"));
11089 fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n"));
11093 static const struct dis386 bad_opcode = { "(bad)", { XX } };
11095 /* Get a pointer to struct dis386 with a valid name. */
11097 static const struct dis386 *
11098 get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
11100 int vindex, vex_table_index;
11102 if (dp->name != NULL)
11105 switch (dp->op[0].bytemode)
11107 case USE_REG_TABLE:
11108 dp = ®_table[dp->op[1].bytemode][modrm.reg];
11111 case USE_MOD_TABLE:
11112 vindex = modrm.mod == 0x3 ? 1 : 0;
11113 dp = &mod_table[dp->op[1].bytemode][vindex];
11117 dp = &rm_table[dp->op[1].bytemode][modrm.rm];
11120 case USE_PREFIX_TABLE:
11123 /* The prefix in VEX is implicit. */
11124 switch (vex.prefix)
11129 case REPE_PREFIX_OPCODE:
11132 case DATA_PREFIX_OPCODE:
11135 case REPNE_PREFIX_OPCODE:
11146 used_prefixes |= (prefixes & PREFIX_REPZ);
11147 if (prefixes & PREFIX_REPZ)
11150 all_prefixes[last_repz_prefix] = 0;
11154 /* We should check PREFIX_REPNZ and PREFIX_REPZ before
11156 used_prefixes |= (prefixes & PREFIX_REPNZ);
11157 if (prefixes & PREFIX_REPNZ)
11160 all_prefixes[last_repnz_prefix] = 0;
11164 used_prefixes |= (prefixes & PREFIX_DATA);
11165 if (prefixes & PREFIX_DATA)
11168 all_prefixes[last_data_prefix] = 0;
11173 dp = &prefix_table[dp->op[1].bytemode][vindex];
11176 case USE_X86_64_TABLE:
11177 vindex = address_mode == mode_64bit ? 1 : 0;
11178 dp = &x86_64_table[dp->op[1].bytemode][vindex];
11181 case USE_3BYTE_TABLE:
11182 FETCH_DATA (info, codep + 2);
11184 dp = &three_byte_table[dp->op[1].bytemode][vindex];
11185 modrm.mod = (*codep >> 6) & 3;
11186 modrm.reg = (*codep >> 3) & 7;
11187 modrm.rm = *codep & 7;
11190 case USE_VEX_LEN_TABLE:
11194 switch (vex.length)
11207 dp = &vex_len_table[dp->op[1].bytemode][vindex];
11210 case USE_XOP_8F_TABLE:
11211 FETCH_DATA (info, codep + 3);
11212 /* All bits in the REX prefix are ignored. */
11214 rex = ~(*codep >> 5) & 0x7;
11216 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
11217 switch ((*codep & 0x1f))
11223 vex_table_index = XOP_08;
11226 vex_table_index = XOP_09;
11229 vex_table_index = XOP_0A;
11233 vex.w = *codep & 0x80;
11234 if (vex.w && address_mode == mode_64bit)
11237 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11238 if (address_mode != mode_64bit
11239 && vex.register_specifier > 0x7)
11245 vex.length = (*codep & 0x4) ? 256 : 128;
11246 switch ((*codep & 0x3))
11252 vex.prefix = DATA_PREFIX_OPCODE;
11255 vex.prefix = REPE_PREFIX_OPCODE;
11258 vex.prefix = REPNE_PREFIX_OPCODE;
11265 dp = &xop_table[vex_table_index][vindex];
11267 FETCH_DATA (info, codep + 1);
11268 modrm.mod = (*codep >> 6) & 3;
11269 modrm.reg = (*codep >> 3) & 7;
11270 modrm.rm = *codep & 7;
11273 case USE_VEX_C4_TABLE:
11274 FETCH_DATA (info, codep + 3);
11275 /* All bits in the REX prefix are ignored. */
11277 rex = ~(*codep >> 5) & 0x7;
11278 switch ((*codep & 0x1f))
11284 vex_table_index = VEX_0F;
11287 vex_table_index = VEX_0F38;
11290 vex_table_index = VEX_0F3A;
11294 vex.w = *codep & 0x80;
11295 if (vex.w && address_mode == mode_64bit)
11298 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11299 if (address_mode != mode_64bit
11300 && vex.register_specifier > 0x7)
11306 vex.length = (*codep & 0x4) ? 256 : 128;
11307 switch ((*codep & 0x3))
11313 vex.prefix = DATA_PREFIX_OPCODE;
11316 vex.prefix = REPE_PREFIX_OPCODE;
11319 vex.prefix = REPNE_PREFIX_OPCODE;
11326 dp = &vex_table[vex_table_index][vindex];
11327 /* There is no MODRM byte for VEX [82|77]. */
11328 if (vindex != 0x77 && vindex != 0x82)
11330 FETCH_DATA (info, codep + 1);
11331 modrm.mod = (*codep >> 6) & 3;
11332 modrm.reg = (*codep >> 3) & 7;
11333 modrm.rm = *codep & 7;
11337 case USE_VEX_C5_TABLE:
11338 FETCH_DATA (info, codep + 2);
11339 /* All bits in the REX prefix are ignored. */
11341 rex = (*codep & 0x80) ? 0 : REX_R;
11343 vex.register_specifier = (~(*codep >> 3)) & 0xf;
11344 if (address_mode != mode_64bit
11345 && vex.register_specifier > 0x7)
11353 vex.length = (*codep & 0x4) ? 256 : 128;
11354 switch ((*codep & 0x3))
11360 vex.prefix = DATA_PREFIX_OPCODE;
11363 vex.prefix = REPE_PREFIX_OPCODE;
11366 vex.prefix = REPNE_PREFIX_OPCODE;
11373 dp = &vex_table[dp->op[1].bytemode][vindex];
11374 /* There is no MODRM byte for VEX [82|77]. */
11375 if (vindex != 0x77 && vindex != 0x82)
11377 FETCH_DATA (info, codep + 1);
11378 modrm.mod = (*codep >> 6) & 3;
11379 modrm.reg = (*codep >> 3) & 7;
11380 modrm.rm = *codep & 7;
11384 case USE_VEX_W_TABLE:
11388 dp = &vex_w_table[dp->op[1].bytemode][vex.w ? 1 : 0];
11399 if (dp->name != NULL)
11402 return get_valid_dis386 (dp, info);
11406 get_sib (disassemble_info *info)
11408 /* If modrm.mod == 3, operand must be register. */
11410 && address_mode != mode_16bit
11414 FETCH_DATA (info, codep + 2);
11415 sib.index = (codep [1] >> 3) & 7;
11416 sib.scale = (codep [1] >> 6) & 3;
11417 sib.base = codep [1] & 7;
11422 print_insn (bfd_vma pc, disassemble_info *info)
11424 const struct dis386 *dp;
11426 char *op_txt[MAX_OPERANDS];
11430 struct dis_private priv;
11432 int default_prefixes;
11434 if (info->mach == bfd_mach_x86_64_intel_syntax
11435 || info->mach == bfd_mach_x86_64
11436 || info->mach == bfd_mach_x64_32_intel_syntax
11437 || info->mach == bfd_mach_x64_32
11438 || info->mach == bfd_mach_l1om
11439 || info->mach == bfd_mach_l1om_intel_syntax)
11440 address_mode = mode_64bit;
11442 address_mode = mode_32bit;
11444 if (intel_syntax == (char) -1)
11445 intel_syntax = (info->mach == bfd_mach_i386_i386_intel_syntax
11446 || info->mach == bfd_mach_x86_64_intel_syntax
11447 || info->mach == bfd_mach_x64_32_intel_syntax
11448 || info->mach == bfd_mach_l1om_intel_syntax);
11450 if (info->mach == bfd_mach_i386_i386
11451 || info->mach == bfd_mach_x86_64
11452 || info->mach == bfd_mach_x64_32
11453 || info->mach == bfd_mach_l1om
11454 || info->mach == bfd_mach_i386_i386_intel_syntax
11455 || info->mach == bfd_mach_x86_64_intel_syntax
11456 || info->mach == bfd_mach_x64_32_intel_syntax
11457 || info->mach == bfd_mach_l1om_intel_syntax)
11458 priv.orig_sizeflag = AFLAG | DFLAG;
11459 else if (info->mach == bfd_mach_i386_i8086)
11460 priv.orig_sizeflag = 0;
11464 for (p = info->disassembler_options; p != NULL; )
11466 if (CONST_STRNEQ (p, "x86-64"))
11468 address_mode = mode_64bit;
11469 priv.orig_sizeflag = AFLAG | DFLAG;
11471 else if (CONST_STRNEQ (p, "i386"))
11473 address_mode = mode_32bit;
11474 priv.orig_sizeflag = AFLAG | DFLAG;
11476 else if (CONST_STRNEQ (p, "i8086"))
11478 address_mode = mode_16bit;
11479 priv.orig_sizeflag = 0;
11481 else if (CONST_STRNEQ (p, "intel"))
11484 if (CONST_STRNEQ (p + 5, "-mnemonic"))
11485 intel_mnemonic = 1;
11487 else if (CONST_STRNEQ (p, "att"))
11490 if (CONST_STRNEQ (p + 3, "-mnemonic"))
11491 intel_mnemonic = 0;
11493 else if (CONST_STRNEQ (p, "addr"))
11495 if (address_mode == mode_64bit)
11497 if (p[4] == '3' && p[5] == '2')
11498 priv.orig_sizeflag &= ~AFLAG;
11499 else if (p[4] == '6' && p[5] == '4')
11500 priv.orig_sizeflag |= AFLAG;
11504 if (p[4] == '1' && p[5] == '6')
11505 priv.orig_sizeflag &= ~AFLAG;
11506 else if (p[4] == '3' && p[5] == '2')
11507 priv.orig_sizeflag |= AFLAG;
11510 else if (CONST_STRNEQ (p, "data"))
11512 if (p[4] == '1' && p[5] == '6')
11513 priv.orig_sizeflag &= ~DFLAG;
11514 else if (p[4] == '3' && p[5] == '2')
11515 priv.orig_sizeflag |= DFLAG;
11517 else if (CONST_STRNEQ (p, "suffix"))
11518 priv.orig_sizeflag |= SUFFIX_ALWAYS;
11520 p = strchr (p, ',');
11527 names64 = intel_names64;
11528 names32 = intel_names32;
11529 names16 = intel_names16;
11530 names8 = intel_names8;
11531 names8rex = intel_names8rex;
11532 names_seg = intel_names_seg;
11533 names_mm = intel_names_mm;
11534 names_xmm = intel_names_xmm;
11535 names_ymm = intel_names_ymm;
11536 index64 = intel_index64;
11537 index32 = intel_index32;
11538 index16 = intel_index16;
11541 separator_char = '+';
11546 names64 = att_names64;
11547 names32 = att_names32;
11548 names16 = att_names16;
11549 names8 = att_names8;
11550 names8rex = att_names8rex;
11551 names_seg = att_names_seg;
11552 names_mm = att_names_mm;
11553 names_xmm = att_names_xmm;
11554 names_ymm = att_names_ymm;
11555 index64 = att_index64;
11556 index32 = att_index32;
11557 index16 = att_index16;
11560 separator_char = ',';
11564 /* The output looks better if we put 7 bytes on a line, since that
11565 puts most long word instructions on a single line. Use 8 bytes
11567 if (info->mach == bfd_mach_l1om
11568 || info->mach == bfd_mach_l1om_intel_syntax)
11569 info->bytes_per_line = 8;
11571 info->bytes_per_line = 7;
11573 info->private_data = &priv;
11574 priv.max_fetched = priv.the_buffer;
11575 priv.insn_start = pc;
11578 for (i = 0; i < MAX_OPERANDS; ++i)
11586 start_codep = priv.the_buffer;
11587 codep = priv.the_buffer;
11589 if (setjmp (priv.bailout) != 0)
11593 /* Getting here means we tried for data but didn't get it. That
11594 means we have an incomplete instruction of some sort. Just
11595 print the first byte as a prefix or a .byte pseudo-op. */
11596 if (codep > priv.the_buffer)
11598 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
11600 (*info->fprintf_func) (info->stream, "%s", name);
11603 /* Just print the first byte as a .byte instruction. */
11604 (*info->fprintf_func) (info->stream, ".byte 0x%x",
11605 (unsigned int) priv.the_buffer[0]);
11615 sizeflag = priv.orig_sizeflag;
11617 if (!ckprefix () || rex_used)
11619 /* Too many prefixes or unused REX prefixes. */
11621 all_prefixes[i] && i < (int) ARRAY_SIZE (all_prefixes);
11623 (*info->fprintf_func) (info->stream, "%s",
11624 prefix_name (all_prefixes[i], sizeflag));
11628 insn_codep = codep;
11630 FETCH_DATA (info, codep + 1);
11631 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
11633 if (((prefixes & PREFIX_FWAIT)
11634 && ((*codep < 0xd8) || (*codep > 0xdf))))
11636 (*info->fprintf_func) (info->stream, "fwait");
11640 if (*codep == 0x0f)
11642 unsigned char threebyte;
11643 FETCH_DATA (info, codep + 2);
11644 threebyte = *++codep;
11645 dp = &dis386_twobyte[threebyte];
11646 need_modrm = twobyte_has_modrm[*codep];
11651 dp = &dis386[*codep];
11652 need_modrm = onebyte_has_modrm[*codep];
11656 if ((prefixes & PREFIX_REPZ))
11657 used_prefixes |= PREFIX_REPZ;
11658 if ((prefixes & PREFIX_REPNZ))
11659 used_prefixes |= PREFIX_REPNZ;
11660 if ((prefixes & PREFIX_LOCK))
11661 used_prefixes |= PREFIX_LOCK;
11663 default_prefixes = 0;
11664 if (prefixes & PREFIX_ADDR)
11667 if (dp->op[2].bytemode != loop_jcxz_mode || intel_syntax)
11669 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
11670 all_prefixes[last_addr_prefix] = ADDR32_PREFIX;
11672 all_prefixes[last_addr_prefix] = ADDR16_PREFIX;
11673 default_prefixes |= PREFIX_ADDR;
11677 if ((prefixes & PREFIX_DATA))
11680 if (dp->op[2].bytemode == cond_jump_mode
11681 && dp->op[0].bytemode == v_mode
11684 if (sizeflag & DFLAG)
11685 all_prefixes[last_data_prefix] = DATA32_PREFIX;
11687 all_prefixes[last_data_prefix] = DATA16_PREFIX;
11688 default_prefixes |= PREFIX_DATA;
11690 else if (rex & REX_W)
11692 /* REX_W will override PREFIX_DATA. */
11693 default_prefixes |= PREFIX_DATA;
11699 FETCH_DATA (info, codep + 1);
11700 modrm.mod = (*codep >> 6) & 3;
11701 modrm.reg = (*codep >> 3) & 7;
11702 modrm.rm = *codep & 7;
11709 if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
11712 dofloat (sizeflag);
11716 dp = get_valid_dis386 (dp, info);
11717 if (dp != NULL && putop (dp->name, sizeflag) == 0)
11720 for (i = 0; i < MAX_OPERANDS; ++i)
11723 op_ad = MAX_OPERANDS - 1 - i;
11725 (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
11730 /* See if any prefixes were not used. If so, print the first one
11731 separately. If we don't do this, we'll wind up printing an
11732 instruction stream which does not precisely correspond to the
11733 bytes we are disassembling. */
11734 if ((prefixes & ~(used_prefixes | default_prefixes)) != 0)
11736 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
11737 if (all_prefixes[i])
11740 name = prefix_name (all_prefixes[i], priv.orig_sizeflag);
11742 name = INTERNAL_DISASSEMBLER_ERROR;
11743 (*info->fprintf_func) (info->stream, "%s", name);
11748 /* Check if the REX prefix is used. */
11749 if (rex_ignored == 0 && (rex ^ rex_used) == 0)
11750 all_prefixes[last_rex_prefix] = 0;
11752 /* Check if the SEG prefix is used. */
11753 if ((prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES
11754 | PREFIX_FS | PREFIX_GS)) != 0
11756 & seg_prefix (all_prefixes[last_seg_prefix])) != 0)
11757 all_prefixes[last_seg_prefix] = 0;
11759 /* Check if the ADDR prefix is used. */
11760 if ((prefixes & PREFIX_ADDR) != 0
11761 && (used_prefixes & PREFIX_ADDR) != 0)
11762 all_prefixes[last_addr_prefix] = 0;
11764 /* Check if the DATA prefix is used. */
11765 if ((prefixes & PREFIX_DATA) != 0
11766 && (used_prefixes & PREFIX_DATA) != 0)
11767 all_prefixes[last_data_prefix] = 0;
11770 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
11771 if (all_prefixes[i])
11774 name = prefix_name (all_prefixes[i], sizeflag);
11777 prefix_length += strlen (name) + 1;
11778 (*info->fprintf_func) (info->stream, "%s ", name);
11781 /* Check maximum code length. */
11782 if ((codep - start_codep) > MAX_CODE_LENGTH)
11784 (*info->fprintf_func) (info->stream, "(bad)");
11785 return MAX_CODE_LENGTH;
11788 obufp = mnemonicendp;
11789 for (i = strlen (obuf) + prefix_length; i < 6; i++)
11792 (*info->fprintf_func) (info->stream, "%s", obuf);
11794 /* The enter and bound instructions are printed with operands in the same
11795 order as the intel book; everything else is printed in reverse order. */
11796 if (intel_syntax || two_source_ops)
11800 for (i = 0; i < MAX_OPERANDS; ++i)
11801 op_txt[i] = op_out[i];
11803 for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
11805 op_ad = op_index[i];
11806 op_index[i] = op_index[MAX_OPERANDS - 1 - i];
11807 op_index[MAX_OPERANDS - 1 - i] = op_ad;
11808 riprel = op_riprel[i];
11809 op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
11810 op_riprel[MAX_OPERANDS - 1 - i] = riprel;
11815 for (i = 0; i < MAX_OPERANDS; ++i)
11816 op_txt[MAX_OPERANDS - 1 - i] = op_out[i];
11820 for (i = 0; i < MAX_OPERANDS; ++i)
11824 (*info->fprintf_func) (info->stream, ",");
11825 if (op_index[i] != -1 && !op_riprel[i])
11826 (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info);
11828 (*info->fprintf_func) (info->stream, "%s", op_txt[i]);
11832 for (i = 0; i < MAX_OPERANDS; i++)
11833 if (op_index[i] != -1 && op_riprel[i])
11835 (*info->fprintf_func) (info->stream, " # ");
11836 (*info->print_address_func) ((bfd_vma) (start_pc + codep - start_codep
11837 + op_address[op_index[i]]), info);
11840 return codep - priv.the_buffer;
11843 static const char *float_mem[] = {
11918 static const unsigned char float_mem_mode[] = {
11993 #define ST { OP_ST, 0 }
11994 #define STi { OP_STi, 0 }
11996 #define FGRPd9_2 NULL, { { NULL, 0 } }
11997 #define FGRPd9_4 NULL, { { NULL, 1 } }
11998 #define FGRPd9_5 NULL, { { NULL, 2 } }
11999 #define FGRPd9_6 NULL, { { NULL, 3 } }
12000 #define FGRPd9_7 NULL, { { NULL, 4 } }
12001 #define FGRPda_5 NULL, { { NULL, 5 } }
12002 #define FGRPdb_4 NULL, { { NULL, 6 } }
12003 #define FGRPde_3 NULL, { { NULL, 7 } }
12004 #define FGRPdf_4 NULL, { { NULL, 8 } }
12006 static const struct dis386 float_reg[][8] = {
12009 { "fadd", { ST, STi } },
12010 { "fmul", { ST, STi } },
12011 { "fcom", { STi } },
12012 { "fcomp", { STi } },
12013 { "fsub", { ST, STi } },
12014 { "fsubr", { ST, STi } },
12015 { "fdiv", { ST, STi } },
12016 { "fdivr", { ST, STi } },
12020 { "fld", { STi } },
12021 { "fxch", { STi } },
12031 { "fcmovb", { ST, STi } },
12032 { "fcmove", { ST, STi } },
12033 { "fcmovbe",{ ST, STi } },
12034 { "fcmovu", { ST, STi } },
12042 { "fcmovnb",{ ST, STi } },
12043 { "fcmovne",{ ST, STi } },
12044 { "fcmovnbe",{ ST, STi } },
12045 { "fcmovnu",{ ST, STi } },
12047 { "fucomi", { ST, STi } },
12048 { "fcomi", { ST, STi } },
12053 { "fadd", { STi, ST } },
12054 { "fmul", { STi, ST } },
12057 { "fsub!M", { STi, ST } },
12058 { "fsubM", { STi, ST } },
12059 { "fdiv!M", { STi, ST } },
12060 { "fdivM", { STi, ST } },
12064 { "ffree", { STi } },
12066 { "fst", { STi } },
12067 { "fstp", { STi } },
12068 { "fucom", { STi } },
12069 { "fucomp", { STi } },
12075 { "faddp", { STi, ST } },
12076 { "fmulp", { STi, ST } },
12079 { "fsub!Mp", { STi, ST } },
12080 { "fsubMp", { STi, ST } },
12081 { "fdiv!Mp", { STi, ST } },
12082 { "fdivMp", { STi, ST } },
12086 { "ffreep", { STi } },
12091 { "fucomip", { ST, STi } },
12092 { "fcomip", { ST, STi } },
12097 static char *fgrps[][8] = {
12100 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12105 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
12110 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
12115 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
12120 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
12125 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12130 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
12131 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
12136 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12141 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12146 swap_operand (void)
12148 mnemonicendp[0] = '.';
12149 mnemonicendp[1] = 's';
12154 OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
12155 int sizeflag ATTRIBUTE_UNUSED)
12157 /* Skip mod/rm byte. */
12163 dofloat (int sizeflag)
12165 const struct dis386 *dp;
12166 unsigned char floatop;
12168 floatop = codep[-1];
12170 if (modrm.mod != 3)
12172 int fp_indx = (floatop - 0xd8) * 8 + modrm.reg;
12174 putop (float_mem[fp_indx], sizeflag);
12177 OP_E (float_mem_mode[fp_indx], sizeflag);
12180 /* Skip mod/rm byte. */
12184 dp = &float_reg[floatop - 0xd8][modrm.reg];
12185 if (dp->name == NULL)
12187 putop (fgrps[dp->op[0].bytemode][modrm.rm], sizeflag);
12189 /* Instruction fnstsw is only one with strange arg. */
12190 if (floatop == 0xdf && codep[-1] == 0xe0)
12191 strcpy (op_out[0], names16[0]);
12195 putop (dp->name, sizeflag);
12200 (*dp->op[0].rtn) (dp->op[0].bytemode, sizeflag);
12205 (*dp->op[1].rtn) (dp->op[1].bytemode, sizeflag);
12210 OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
12212 oappend ("%st" + intel_syntax);
12216 OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
12218 sprintf (scratchbuf, "%%st(%d)", modrm.rm);
12219 oappend (scratchbuf + intel_syntax);
12222 /* Capital letters in template are macros. */
12224 putop (const char *in_template, int sizeflag)
12229 unsigned int l = 0, len = 1;
12232 #define SAVE_LAST(c) \
12233 if (l < len && l < sizeof (last)) \
12238 for (p = in_template; *p; p++)
12255 while (*++p != '|')
12256 if (*p == '}' || *p == '\0')
12259 /* Fall through. */
12264 while (*++p != '}')
12275 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
12279 if (l == 0 && len == 1)
12284 if (sizeflag & SUFFIX_ALWAYS)
12297 if (address_mode == mode_64bit
12298 && !(prefixes & PREFIX_ADDR))
12309 if (intel_syntax && !alt)
12311 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
12313 if (sizeflag & DFLAG)
12314 *obufp++ = intel_syntax ? 'd' : 'l';
12316 *obufp++ = intel_syntax ? 'w' : 's';
12317 used_prefixes |= (prefixes & PREFIX_DATA);
12321 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
12324 if (modrm.mod == 3)
12330 if (sizeflag & DFLAG)
12331 *obufp++ = intel_syntax ? 'd' : 'l';
12334 used_prefixes |= (prefixes & PREFIX_DATA);
12340 case 'E': /* For jcxz/jecxz */
12341 if (address_mode == mode_64bit)
12343 if (sizeflag & AFLAG)
12349 if (sizeflag & AFLAG)
12351 used_prefixes |= (prefixes & PREFIX_ADDR);
12356 if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))
12358 if (sizeflag & AFLAG)
12359 *obufp++ = address_mode == mode_64bit ? 'q' : 'l';
12361 *obufp++ = address_mode == mode_64bit ? 'l' : 'w';
12362 used_prefixes |= (prefixes & PREFIX_ADDR);
12366 if (intel_syntax || (obufp[-1] != 's' && !(sizeflag & SUFFIX_ALWAYS)))
12368 if ((rex & REX_W) || (sizeflag & DFLAG))
12372 if (!(rex & REX_W))
12373 used_prefixes |= (prefixes & PREFIX_DATA);
12378 if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS
12379 || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)
12381 used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);
12384 if (prefixes & PREFIX_DS)
12405 if (address_mode == mode_64bit && (sizeflag & SUFFIX_ALWAYS))
12410 /* Fall through. */
12413 if (l != 0 || len != 1)
12421 if (sizeflag & SUFFIX_ALWAYS)
12425 if (intel_mnemonic != cond)
12429 if ((prefixes & PREFIX_FWAIT) == 0)
12432 used_prefixes |= PREFIX_FWAIT;
12438 else if (intel_syntax && (sizeflag & DFLAG))
12442 if (!(rex & REX_W))
12443 used_prefixes |= (prefixes & PREFIX_DATA);
12447 && address_mode == mode_64bit
12448 && (sizeflag & DFLAG))
12453 /* Fall through. */
12457 if ((rex & REX_W) == 0
12458 && (prefixes & PREFIX_DATA))
12460 if ((sizeflag & DFLAG) == 0)
12462 used_prefixes |= (prefixes & PREFIX_DATA);
12466 if ((prefixes & PREFIX_DATA)
12468 || (sizeflag & SUFFIX_ALWAYS))
12475 if (sizeflag & DFLAG)
12479 used_prefixes |= (prefixes & PREFIX_DATA);
12486 if (address_mode == mode_64bit && (sizeflag & DFLAG))
12488 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
12492 /* Fall through. */
12495 if (l == 0 && len == 1)
12498 if (intel_syntax && !alt)
12501 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
12507 if (sizeflag & DFLAG)
12508 *obufp++ = intel_syntax ? 'd' : 'l';
12511 used_prefixes |= (prefixes & PREFIX_DATA);
12517 if (l != 1 || len != 2 || last[0] != 'L')
12523 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
12538 else if (sizeflag & DFLAG)
12547 if (intel_syntax && !p[1]
12548 && ((rex & REX_W) || (sizeflag & DFLAG)))
12550 if (!(rex & REX_W))
12551 used_prefixes |= (prefixes & PREFIX_DATA);
12554 if (l == 0 && len == 1)
12558 if (address_mode == mode_64bit && (sizeflag & DFLAG))
12560 if (sizeflag & SUFFIX_ALWAYS)
12582 /* Fall through. */
12585 if (l == 0 && len == 1)
12590 if (sizeflag & SUFFIX_ALWAYS)
12596 if (sizeflag & DFLAG)
12600 used_prefixes |= (prefixes & PREFIX_DATA);
12614 if (address_mode == mode_64bit
12615 && !(prefixes & PREFIX_ADDR))
12626 if (l != 0 || len != 1)
12631 if (need_vex && vex.prefix)
12633 if (vex.prefix == DATA_PREFIX_OPCODE)
12640 if (prefixes & PREFIX_DATA)
12644 used_prefixes |= (prefixes & PREFIX_DATA);
12648 if (l == 0 && len == 1)
12650 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
12661 if (l != 1 || len != 2 || last[0] != 'X')
12669 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
12671 switch (vex.length)
12685 if (l == 0 && len == 1)
12687 /* operand size flag for cwtl, cbtw */
12696 else if (sizeflag & DFLAG)
12700 if (!(rex & REX_W))
12701 used_prefixes |= (prefixes & PREFIX_DATA);
12705 if (l != 1 || len != 2 || last[0] != 'X')
12712 *obufp++ = vex.w ? 'd': 's';
12719 mnemonicendp = obufp;
12724 oappend (const char *s)
12726 obufp = stpcpy (obufp, s);
12732 if (prefixes & PREFIX_CS)
12734 used_prefixes |= PREFIX_CS;
12735 oappend ("%cs:" + intel_syntax);
12737 if (prefixes & PREFIX_DS)
12739 used_prefixes |= PREFIX_DS;
12740 oappend ("%ds:" + intel_syntax);
12742 if (prefixes & PREFIX_SS)
12744 used_prefixes |= PREFIX_SS;
12745 oappend ("%ss:" + intel_syntax);
12747 if (prefixes & PREFIX_ES)
12749 used_prefixes |= PREFIX_ES;
12750 oappend ("%es:" + intel_syntax);
12752 if (prefixes & PREFIX_FS)
12754 used_prefixes |= PREFIX_FS;
12755 oappend ("%fs:" + intel_syntax);
12757 if (prefixes & PREFIX_GS)
12759 used_prefixes |= PREFIX_GS;
12760 oappend ("%gs:" + intel_syntax);
12765 OP_indirE (int bytemode, int sizeflag)
12769 OP_E (bytemode, sizeflag);
12773 print_operand_value (char *buf, int hex, bfd_vma disp)
12775 if (address_mode == mode_64bit)
12783 sprintf_vma (tmp, disp);
12784 for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
12785 strcpy (buf + 2, tmp + i);
12789 bfd_signed_vma v = disp;
12796 /* Check for possible overflow on 0x8000000000000000. */
12799 strcpy (buf, "9223372036854775808");
12813 tmp[28 - i] = (v % 10) + '0';
12817 strcpy (buf, tmp + 29 - i);
12823 sprintf (buf, "0x%x", (unsigned int) disp);
12825 sprintf (buf, "%d", (int) disp);
12829 /* Put DISP in BUF as signed hex number. */
12832 print_displacement (char *buf, bfd_vma disp)
12834 bfd_signed_vma val = disp;
12843 /* Check for possible overflow. */
12846 switch (address_mode)
12849 strcpy (buf + j, "0x8000000000000000");
12852 strcpy (buf + j, "0x80000000");
12855 strcpy (buf + j, "0x8000");
12865 sprintf_vma (tmp, (bfd_vma) val);
12866 for (i = 0; tmp[i] == '0'; i++)
12868 if (tmp[i] == '\0')
12870 strcpy (buf + j, tmp + i);
12874 intel_operand_size (int bytemode, int sizeflag)
12881 oappend ("BYTE PTR ");
12885 oappend ("WORD PTR ");
12888 if (address_mode == mode_64bit && (sizeflag & DFLAG))
12890 oappend ("QWORD PTR ");
12899 oappend ("QWORD PTR ");
12902 if ((sizeflag & DFLAG) || bytemode == dq_mode)
12903 oappend ("DWORD PTR ");
12905 oappend ("WORD PTR ");
12906 used_prefixes |= (prefixes & PREFIX_DATA);
12910 if ((rex & REX_W) || (sizeflag & DFLAG))
12912 oappend ("WORD PTR ");
12913 if (!(rex & REX_W))
12914 used_prefixes |= (prefixes & PREFIX_DATA);
12917 if (sizeflag & DFLAG)
12918 oappend ("QWORD PTR ");
12920 oappend ("DWORD PTR ");
12921 used_prefixes |= (prefixes & PREFIX_DATA);
12924 case d_scalar_mode:
12925 case d_scalar_swap_mode:
12928 oappend ("DWORD PTR ");
12931 case q_scalar_mode:
12932 case q_scalar_swap_mode:
12934 oappend ("QWORD PTR ");
12937 if (address_mode == mode_64bit)
12938 oappend ("QWORD PTR ");
12940 oappend ("DWORD PTR ");
12943 if (sizeflag & DFLAG)
12944 oappend ("FWORD PTR ");
12946 oappend ("DWORD PTR ");
12947 used_prefixes |= (prefixes & PREFIX_DATA);
12950 oappend ("TBYTE PTR ");
12956 switch (vex.length)
12959 oappend ("XMMWORD PTR ");
12962 oappend ("YMMWORD PTR ");
12969 oappend ("XMMWORD PTR ");
12972 oappend ("XMMWORD PTR ");
12978 switch (vex.length)
12981 oappend ("QWORD PTR ");
12984 oappend ("XMMWORD PTR ");
12994 switch (vex.length)
12997 oappend ("QWORD PTR ");
13000 oappend ("YMMWORD PTR ");
13007 oappend ("OWORD PTR ");
13009 case vex_w_dq_mode:
13010 case vex_scalar_w_dq_mode:
13015 oappend ("QWORD PTR ");
13017 oappend ("DWORD PTR ");
13025 OP_E_register (int bytemode, int sizeflag)
13027 int reg = modrm.rm;
13028 const char **names;
13034 if ((sizeflag & SUFFIX_ALWAYS)
13035 && (bytemode == b_swap_mode || bytemode == v_swap_mode))
13058 names = address_mode == mode_64bit ? names64 : names32;
13061 if (address_mode == mode_64bit && (sizeflag & DFLAG))
13079 if ((sizeflag & DFLAG)
13080 || (bytemode != v_mode
13081 && bytemode != v_swap_mode))
13085 used_prefixes |= (prefixes & PREFIX_DATA);
13091 oappend (INTERNAL_DISASSEMBLER_ERROR);
13094 oappend (names[reg]);
13098 OP_E_memory (int bytemode, int sizeflag)
13101 int add = (rex & REX_B) ? 8 : 0;
13106 intel_operand_size (bytemode, sizeflag);
13109 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
13111 /* 32/64 bit address mode */
13129 vindex = sib.index;
13135 haveindex = vindex != 4;
13138 rbase = base + add;
13146 if (address_mode == mode_64bit && !havesib)
13152 FETCH_DATA (the_info, codep + 1);
13154 if ((disp & 0x80) != 0)
13162 /* In 32bit mode, we need index register to tell [offset] from
13163 [eiz*1 + offset]. */
13164 needindex = (havesib
13167 && address_mode == mode_32bit);
13168 havedisp = (havebase
13170 || (havesib && (haveindex || scale != 0)));
13173 if (modrm.mod != 0 || base == 5)
13175 if (havedisp || riprel)
13176 print_displacement (scratchbuf, disp);
13178 print_operand_value (scratchbuf, 1, disp);
13179 oappend (scratchbuf);
13183 oappend (sizeflag & AFLAG ? "(%rip)" : "(%eip)");
13187 if (havebase || haveindex || riprel)
13188 used_prefixes |= PREFIX_ADDR;
13190 if (havedisp || (intel_syntax && riprel))
13192 *obufp++ = open_char;
13193 if (intel_syntax && riprel)
13196 oappend (sizeflag & AFLAG ? "rip" : "eip");
13200 oappend (address_mode == mode_64bit && (sizeflag & AFLAG)
13201 ? names64[rbase] : names32[rbase]);
13204 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
13205 print index to tell base + index from base. */
13209 || (havebase && base != ESP_REG_NUM))
13211 if (!intel_syntax || havebase)
13213 *obufp++ = separator_char;
13217 oappend (address_mode == mode_64bit
13218 && (sizeflag & AFLAG)
13219 ? names64[vindex] : names32[vindex]);
13221 oappend (address_mode == mode_64bit
13222 && (sizeflag & AFLAG)
13223 ? index64 : index32);
13225 *obufp++ = scale_char;
13227 sprintf (scratchbuf, "%d", 1 << scale);
13228 oappend (scratchbuf);
13232 && (disp || modrm.mod != 0 || base == 5))
13234 if (!havedisp || (bfd_signed_vma) disp >= 0)
13239 else if (modrm.mod != 1 && disp != -disp)
13243 disp = - (bfd_signed_vma) disp;
13247 print_displacement (scratchbuf, disp);
13249 print_operand_value (scratchbuf, 1, disp);
13250 oappend (scratchbuf);
13253 *obufp++ = close_char;
13256 else if (intel_syntax)
13258 if (modrm.mod != 0 || base == 5)
13260 if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
13261 | PREFIX_ES | PREFIX_FS | PREFIX_GS))
13265 oappend (names_seg[ds_reg - es_reg]);
13268 print_operand_value (scratchbuf, 1, disp);
13269 oappend (scratchbuf);
13275 /* 16 bit address mode */
13276 used_prefixes |= prefixes & PREFIX_ADDR;
13283 if ((disp & 0x8000) != 0)
13288 FETCH_DATA (the_info, codep + 1);
13290 if ((disp & 0x80) != 0)
13295 if ((disp & 0x8000) != 0)
13301 if (modrm.mod != 0 || modrm.rm == 6)
13303 print_displacement (scratchbuf, disp);
13304 oappend (scratchbuf);
13307 if (modrm.mod != 0 || modrm.rm != 6)
13309 *obufp++ = open_char;
13311 oappend (index16[modrm.rm]);
13313 && (disp || modrm.mod != 0 || modrm.rm == 6))
13315 if ((bfd_signed_vma) disp >= 0)
13320 else if (modrm.mod != 1)
13324 disp = - (bfd_signed_vma) disp;
13327 print_displacement (scratchbuf, disp);
13328 oappend (scratchbuf);
13331 *obufp++ = close_char;
13334 else if (intel_syntax)
13336 if (prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
13337 | PREFIX_ES | PREFIX_FS | PREFIX_GS))
13341 oappend (names_seg[ds_reg - es_reg]);
13344 print_operand_value (scratchbuf, 1, disp & 0xffff);
13345 oappend (scratchbuf);
13351 OP_E (int bytemode, int sizeflag)
13353 /* Skip mod/rm byte. */
13357 if (modrm.mod == 3)
13358 OP_E_register (bytemode, sizeflag);
13360 OP_E_memory (bytemode, sizeflag);
13364 OP_G (int bytemode, int sizeflag)
13375 oappend (names8rex[modrm.reg + add]);
13377 oappend (names8[modrm.reg + add]);
13380 oappend (names16[modrm.reg + add]);
13383 oappend (names32[modrm.reg + add]);
13386 oappend (names64[modrm.reg + add]);
13395 oappend (names64[modrm.reg + add]);
13398 if ((sizeflag & DFLAG) || bytemode != v_mode)
13399 oappend (names32[modrm.reg + add]);
13401 oappend (names16[modrm.reg + add]);
13402 used_prefixes |= (prefixes & PREFIX_DATA);
13406 if (address_mode == mode_64bit)
13407 oappend (names64[modrm.reg + add]);
13409 oappend (names32[modrm.reg + add]);
13412 oappend (INTERNAL_DISASSEMBLER_ERROR);
13425 FETCH_DATA (the_info, codep + 8);
13426 a = *codep++ & 0xff;
13427 a |= (*codep++ & 0xff) << 8;
13428 a |= (*codep++ & 0xff) << 16;
13429 a |= (*codep++ & 0xff) << 24;
13430 b = *codep++ & 0xff;
13431 b |= (*codep++ & 0xff) << 8;
13432 b |= (*codep++ & 0xff) << 16;
13433 b |= (*codep++ & 0xff) << 24;
13434 x = a + ((bfd_vma) b << 32);
13442 static bfd_signed_vma
13445 bfd_signed_vma x = 0;
13447 FETCH_DATA (the_info, codep + 4);
13448 x = *codep++ & (bfd_signed_vma) 0xff;
13449 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
13450 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
13451 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
13455 static bfd_signed_vma
13458 bfd_signed_vma x = 0;
13460 FETCH_DATA (the_info, codep + 4);
13461 x = *codep++ & (bfd_signed_vma) 0xff;
13462 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
13463 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
13464 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
13466 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
13476 FETCH_DATA (the_info, codep + 2);
13477 x = *codep++ & 0xff;
13478 x |= (*codep++ & 0xff) << 8;
13483 set_op (bfd_vma op, int riprel)
13485 op_index[op_ad] = op_ad;
13486 if (address_mode == mode_64bit)
13488 op_address[op_ad] = op;
13489 op_riprel[op_ad] = riprel;
13493 /* Mask to get a 32-bit address. */
13494 op_address[op_ad] = op & 0xffffffff;
13495 op_riprel[op_ad] = riprel & 0xffffffff;
13500 OP_REG (int code, int sizeflag)
13512 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
13513 case sp_reg: case bp_reg: case si_reg: case di_reg:
13514 s = names16[code - ax_reg + add];
13516 case es_reg: case ss_reg: case cs_reg:
13517 case ds_reg: case fs_reg: case gs_reg:
13518 s = names_seg[code - es_reg + add];
13520 case al_reg: case ah_reg: case cl_reg: case ch_reg:
13521 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
13524 s = names8rex[code - al_reg + add];
13526 s = names8[code - al_reg];
13528 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
13529 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
13530 if (address_mode == mode_64bit && (sizeflag & DFLAG))
13532 s = names64[code - rAX_reg + add];
13535 code += eAX_reg - rAX_reg;
13536 /* Fall through. */
13537 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
13538 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
13541 s = names64[code - eAX_reg + add];
13544 if (sizeflag & DFLAG)
13545 s = names32[code - eAX_reg + add];
13547 s = names16[code - eAX_reg + add];
13548 used_prefixes |= (prefixes & PREFIX_DATA);
13552 s = INTERNAL_DISASSEMBLER_ERROR;
13559 OP_IMREG (int code, int sizeflag)
13571 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
13572 case sp_reg: case bp_reg: case si_reg: case di_reg:
13573 s = names16[code - ax_reg];
13575 case es_reg: case ss_reg: case cs_reg:
13576 case ds_reg: case fs_reg: case gs_reg:
13577 s = names_seg[code - es_reg];
13579 case al_reg: case ah_reg: case cl_reg: case ch_reg:
13580 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
13583 s = names8rex[code - al_reg];
13585 s = names8[code - al_reg];
13587 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
13588 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
13591 s = names64[code - eAX_reg];
13594 if (sizeflag & DFLAG)
13595 s = names32[code - eAX_reg];
13597 s = names16[code - eAX_reg];
13598 used_prefixes |= (prefixes & PREFIX_DATA);
13601 case z_mode_ax_reg:
13602 if ((rex & REX_W) || (sizeflag & DFLAG))
13606 if (!(rex & REX_W))
13607 used_prefixes |= (prefixes & PREFIX_DATA);
13610 s = INTERNAL_DISASSEMBLER_ERROR;
13617 OP_I (int bytemode, int sizeflag)
13620 bfd_signed_vma mask = -1;
13625 FETCH_DATA (the_info, codep + 1);
13630 if (address_mode == mode_64bit)
13635 /* Fall through. */
13642 if (sizeflag & DFLAG)
13652 used_prefixes |= (prefixes & PREFIX_DATA);
13664 oappend (INTERNAL_DISASSEMBLER_ERROR);
13669 scratchbuf[0] = '$';
13670 print_operand_value (scratchbuf + 1, 1, op);
13671 oappend (scratchbuf + intel_syntax);
13672 scratchbuf[0] = '\0';
13676 OP_I64 (int bytemode, int sizeflag)
13679 bfd_signed_vma mask = -1;
13681 if (address_mode != mode_64bit)
13683 OP_I (bytemode, sizeflag);
13690 FETCH_DATA (the_info, codep + 1);
13700 if (sizeflag & DFLAG)
13710 used_prefixes |= (prefixes & PREFIX_DATA);
13718 oappend (INTERNAL_DISASSEMBLER_ERROR);
13723 scratchbuf[0] = '$';
13724 print_operand_value (scratchbuf + 1, 1, op);
13725 oappend (scratchbuf + intel_syntax);
13726 scratchbuf[0] = '\0';
13730 OP_sI (int bytemode, int sizeflag)
13738 FETCH_DATA (the_info, codep + 1);
13740 if ((op & 0x80) != 0)
13742 if (bytemode == b_T_mode)
13744 if (address_mode != mode_64bit
13745 || !(sizeflag & DFLAG))
13747 if (sizeflag & DFLAG)
13755 if (!(rex & REX_W))
13757 if (sizeflag & DFLAG)
13765 if (sizeflag & DFLAG)
13771 oappend (INTERNAL_DISASSEMBLER_ERROR);
13775 scratchbuf[0] = '$';
13776 print_operand_value (scratchbuf + 1, 1, op);
13777 oappend (scratchbuf + intel_syntax);
13781 OP_J (int bytemode, int sizeflag)
13785 bfd_vma segment = 0;
13790 FETCH_DATA (the_info, codep + 1);
13792 if ((disp & 0x80) != 0)
13797 if ((sizeflag & DFLAG) || (rex & REX_W))
13802 if ((disp & 0x8000) != 0)
13804 /* In 16bit mode, address is wrapped around at 64k within
13805 the same segment. Otherwise, a data16 prefix on a jump
13806 instruction means that the pc is masked to 16 bits after
13807 the displacement is added! */
13809 if ((prefixes & PREFIX_DATA) == 0)
13810 segment = ((start_pc + codep - start_codep)
13811 & ~((bfd_vma) 0xffff));
13813 if (!(rex & REX_W))
13814 used_prefixes |= (prefixes & PREFIX_DATA);
13817 oappend (INTERNAL_DISASSEMBLER_ERROR);
13820 disp = ((start_pc + (codep - start_codep) + disp) & mask) | segment;
13822 print_operand_value (scratchbuf, 1, disp);
13823 oappend (scratchbuf);
13827 OP_SEG (int bytemode, int sizeflag)
13829 if (bytemode == w_mode)
13830 oappend (names_seg[modrm.reg]);
13832 OP_E (modrm.mod == 3 ? bytemode : w_mode, sizeflag);
13836 OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
13840 if (sizeflag & DFLAG)
13850 used_prefixes |= (prefixes & PREFIX_DATA);
13852 sprintf (scratchbuf, "0x%x:0x%x", seg, offset);
13854 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
13855 oappend (scratchbuf);
13859 OP_OFF (int bytemode, int sizeflag)
13863 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
13864 intel_operand_size (bytemode, sizeflag);
13867 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
13874 if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
13875 | PREFIX_ES | PREFIX_FS | PREFIX_GS)))
13877 oappend (names_seg[ds_reg - es_reg]);
13881 print_operand_value (scratchbuf, 1, off);
13882 oappend (scratchbuf);
13886 OP_OFF64 (int bytemode, int sizeflag)
13890 if (address_mode != mode_64bit
13891 || (prefixes & PREFIX_ADDR))
13893 OP_OFF (bytemode, sizeflag);
13897 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
13898 intel_operand_size (bytemode, sizeflag);
13905 if (!(prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS
13906 | PREFIX_ES | PREFIX_FS | PREFIX_GS)))
13908 oappend (names_seg[ds_reg - es_reg]);
13912 print_operand_value (scratchbuf, 1, off);
13913 oappend (scratchbuf);
13917 ptr_reg (int code, int sizeflag)
13921 *obufp++ = open_char;
13922 used_prefixes |= (prefixes & PREFIX_ADDR);
13923 if (address_mode == mode_64bit)
13925 if (!(sizeflag & AFLAG))
13926 s = names32[code - eAX_reg];
13928 s = names64[code - eAX_reg];
13930 else if (sizeflag & AFLAG)
13931 s = names32[code - eAX_reg];
13933 s = names16[code - eAX_reg];
13935 *obufp++ = close_char;
13940 OP_ESreg (int code, int sizeflag)
13946 case 0x6d: /* insw/insl */
13947 intel_operand_size (z_mode, sizeflag);
13949 case 0xa5: /* movsw/movsl/movsq */
13950 case 0xa7: /* cmpsw/cmpsl/cmpsq */
13951 case 0xab: /* stosw/stosl */
13952 case 0xaf: /* scasw/scasl */
13953 intel_operand_size (v_mode, sizeflag);
13956 intel_operand_size (b_mode, sizeflag);
13959 oappend ("%es:" + intel_syntax);
13960 ptr_reg (code, sizeflag);
13964 OP_DSreg (int code, int sizeflag)
13970 case 0x6f: /* outsw/outsl */
13971 intel_operand_size (z_mode, sizeflag);
13973 case 0xa5: /* movsw/movsl/movsq */
13974 case 0xa7: /* cmpsw/cmpsl/cmpsq */
13975 case 0xad: /* lodsw/lodsl/lodsq */
13976 intel_operand_size (v_mode, sizeflag);
13979 intel_operand_size (b_mode, sizeflag);
13988 | PREFIX_GS)) == 0)
13989 prefixes |= PREFIX_DS;
13991 ptr_reg (code, sizeflag);
13995 OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14003 else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
14005 all_prefixes[last_lock_prefix] = 0;
14006 used_prefixes |= PREFIX_LOCK;
14011 sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
14012 oappend (scratchbuf + intel_syntax);
14016 OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14025 sprintf (scratchbuf, "db%d", modrm.reg + add);
14027 sprintf (scratchbuf, "%%db%d", modrm.reg + add);
14028 oappend (scratchbuf);
14032 OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14034 sprintf (scratchbuf, "%%tr%d", modrm.reg);
14035 oappend (scratchbuf + intel_syntax);
14039 OP_R (int bytemode, int sizeflag)
14041 if (modrm.mod == 3)
14042 OP_E (bytemode, sizeflag);
14048 OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14050 int reg = modrm.reg;
14051 const char **names;
14053 used_prefixes |= (prefixes & PREFIX_DATA);
14054 if (prefixes & PREFIX_DATA)
14063 oappend (names[reg]);
14067 OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
14069 int reg = modrm.reg;
14070 const char **names;
14076 && bytemode != xmm_mode
14077 && bytemode != scalar_mode)
14079 switch (vex.length)
14093 oappend (names[reg]);
14097 OP_EM (int bytemode, int sizeflag)
14100 const char **names;
14102 if (modrm.mod != 3)
14105 && (bytemode == v_mode || bytemode == v_swap_mode))
14107 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
14108 used_prefixes |= (prefixes & PREFIX_DATA);
14110 OP_E (bytemode, sizeflag);
14114 if ((sizeflag & SUFFIX_ALWAYS) && bytemode == v_swap_mode)
14117 /* Skip mod/rm byte. */
14120 used_prefixes |= (prefixes & PREFIX_DATA);
14122 if (prefixes & PREFIX_DATA)
14131 oappend (names[reg]);
14134 /* cvt* are the only instructions in sse2 which have
14135 both SSE and MMX operands and also have 0x66 prefix
14136 in their opcode. 0x66 was originally used to differentiate
14137 between SSE and MMX instruction(operands). So we have to handle the
14138 cvt* separately using OP_EMC and OP_MXC */
14140 OP_EMC (int bytemode, int sizeflag)
14142 if (modrm.mod != 3)
14144 if (intel_syntax && bytemode == v_mode)
14146 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
14147 used_prefixes |= (prefixes & PREFIX_DATA);
14149 OP_E (bytemode, sizeflag);
14153 /* Skip mod/rm byte. */
14156 used_prefixes |= (prefixes & PREFIX_DATA);
14157 oappend (names_mm[modrm.rm]);
14161 OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14163 used_prefixes |= (prefixes & PREFIX_DATA);
14164 oappend (names_mm[modrm.reg]);
14168 OP_EX (int bytemode, int sizeflag)
14171 const char **names;
14173 /* Skip mod/rm byte. */
14177 if (modrm.mod != 3)
14179 OP_E_memory (bytemode, sizeflag);
14188 if ((sizeflag & SUFFIX_ALWAYS)
14189 && (bytemode == x_swap_mode
14190 || bytemode == d_swap_mode
14191 || bytemode == d_scalar_swap_mode
14192 || bytemode == q_swap_mode
14193 || bytemode == q_scalar_swap_mode))
14197 && bytemode != xmm_mode
14198 && bytemode != xmmq_mode
14199 && bytemode != d_scalar_mode
14200 && bytemode != d_scalar_swap_mode
14201 && bytemode != q_scalar_mode
14202 && bytemode != q_scalar_swap_mode
14203 && bytemode != vex_scalar_w_dq_mode)
14205 switch (vex.length)
14219 oappend (names[reg]);
14223 OP_MS (int bytemode, int sizeflag)
14225 if (modrm.mod == 3)
14226 OP_EM (bytemode, sizeflag);
14232 OP_XS (int bytemode, int sizeflag)
14234 if (modrm.mod == 3)
14235 OP_EX (bytemode, sizeflag);
14241 OP_M (int bytemode, int sizeflag)
14243 if (modrm.mod == 3)
14244 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
14247 OP_E (bytemode, sizeflag);
14251 OP_0f07 (int bytemode, int sizeflag)
14253 if (modrm.mod != 3 || modrm.rm != 0)
14256 OP_E (bytemode, sizeflag);
14259 /* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
14260 32bit mode and "xchg %rax,%rax" in 64bit mode. */
14263 NOP_Fixup1 (int bytemode, int sizeflag)
14265 if ((prefixes & PREFIX_DATA) != 0
14268 && address_mode == mode_64bit))
14269 OP_REG (bytemode, sizeflag);
14271 strcpy (obuf, "nop");
14275 NOP_Fixup2 (int bytemode, int sizeflag)
14277 if ((prefixes & PREFIX_DATA) != 0
14280 && address_mode == mode_64bit))
14281 OP_IMREG (bytemode, sizeflag);
14284 static const char *const Suffix3DNow[] = {
14285 /* 00 */ NULL, NULL, NULL, NULL,
14286 /* 04 */ NULL, NULL, NULL, NULL,
14287 /* 08 */ NULL, NULL, NULL, NULL,
14288 /* 0C */ "pi2fw", "pi2fd", NULL, NULL,
14289 /* 10 */ NULL, NULL, NULL, NULL,
14290 /* 14 */ NULL, NULL, NULL, NULL,
14291 /* 18 */ NULL, NULL, NULL, NULL,
14292 /* 1C */ "pf2iw", "pf2id", NULL, NULL,
14293 /* 20 */ NULL, NULL, NULL, NULL,
14294 /* 24 */ NULL, NULL, NULL, NULL,
14295 /* 28 */ NULL, NULL, NULL, NULL,
14296 /* 2C */ NULL, NULL, NULL, NULL,
14297 /* 30 */ NULL, NULL, NULL, NULL,
14298 /* 34 */ NULL, NULL, NULL, NULL,
14299 /* 38 */ NULL, NULL, NULL, NULL,
14300 /* 3C */ NULL, NULL, NULL, NULL,
14301 /* 40 */ NULL, NULL, NULL, NULL,
14302 /* 44 */ NULL, NULL, NULL, NULL,
14303 /* 48 */ NULL, NULL, NULL, NULL,
14304 /* 4C */ NULL, NULL, NULL, NULL,
14305 /* 50 */ NULL, NULL, NULL, NULL,
14306 /* 54 */ NULL, NULL, NULL, NULL,
14307 /* 58 */ NULL, NULL, NULL, NULL,
14308 /* 5C */ NULL, NULL, NULL, NULL,
14309 /* 60 */ NULL, NULL, NULL, NULL,
14310 /* 64 */ NULL, NULL, NULL, NULL,
14311 /* 68 */ NULL, NULL, NULL, NULL,
14312 /* 6C */ NULL, NULL, NULL, NULL,
14313 /* 70 */ NULL, NULL, NULL, NULL,
14314 /* 74 */ NULL, NULL, NULL, NULL,
14315 /* 78 */ NULL, NULL, NULL, NULL,
14316 /* 7C */ NULL, NULL, NULL, NULL,
14317 /* 80 */ NULL, NULL, NULL, NULL,
14318 /* 84 */ NULL, NULL, NULL, NULL,
14319 /* 88 */ NULL, NULL, "pfnacc", NULL,
14320 /* 8C */ NULL, NULL, "pfpnacc", NULL,
14321 /* 90 */ "pfcmpge", NULL, NULL, NULL,
14322 /* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",
14323 /* 98 */ NULL, NULL, "pfsub", NULL,
14324 /* 9C */ NULL, NULL, "pfadd", NULL,
14325 /* A0 */ "pfcmpgt", NULL, NULL, NULL,
14326 /* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",
14327 /* A8 */ NULL, NULL, "pfsubr", NULL,
14328 /* AC */ NULL, NULL, "pfacc", NULL,
14329 /* B0 */ "pfcmpeq", NULL, NULL, NULL,
14330 /* B4 */ "pfmul", NULL, "pfrcpit2", "pmulhrw",
14331 /* B8 */ NULL, NULL, NULL, "pswapd",
14332 /* BC */ NULL, NULL, NULL, "pavgusb",
14333 /* C0 */ NULL, NULL, NULL, NULL,
14334 /* C4 */ NULL, NULL, NULL, NULL,
14335 /* C8 */ NULL, NULL, NULL, NULL,
14336 /* CC */ NULL, NULL, NULL, NULL,
14337 /* D0 */ NULL, NULL, NULL, NULL,
14338 /* D4 */ NULL, NULL, NULL, NULL,
14339 /* D8 */ NULL, NULL, NULL, NULL,
14340 /* DC */ NULL, NULL, NULL, NULL,
14341 /* E0 */ NULL, NULL, NULL, NULL,
14342 /* E4 */ NULL, NULL, NULL, NULL,
14343 /* E8 */ NULL, NULL, NULL, NULL,
14344 /* EC */ NULL, NULL, NULL, NULL,
14345 /* F0 */ NULL, NULL, NULL, NULL,
14346 /* F4 */ NULL, NULL, NULL, NULL,
14347 /* F8 */ NULL, NULL, NULL, NULL,
14348 /* FC */ NULL, NULL, NULL, NULL,
14352 OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14354 const char *mnemonic;
14356 FETCH_DATA (the_info, codep + 1);
14357 /* AMD 3DNow! instructions are specified by an opcode suffix in the
14358 place where an 8-bit immediate would normally go. ie. the last
14359 byte of the instruction. */
14360 obufp = mnemonicendp;
14361 mnemonic = Suffix3DNow[*codep++ & 0xff];
14363 oappend (mnemonic);
14366 /* Since a variable sized modrm/sib chunk is between the start
14367 of the opcode (0x0f0f) and the opcode suffix, we need to do
14368 all the modrm processing first, and don't know until now that
14369 we have a bad opcode. This necessitates some cleaning up. */
14370 op_out[0][0] = '\0';
14371 op_out[1][0] = '\0';
14374 mnemonicendp = obufp;
14377 static struct op simd_cmp_op[] =
14379 { STRING_COMMA_LEN ("eq") },
14380 { STRING_COMMA_LEN ("lt") },
14381 { STRING_COMMA_LEN ("le") },
14382 { STRING_COMMA_LEN ("unord") },
14383 { STRING_COMMA_LEN ("neq") },
14384 { STRING_COMMA_LEN ("nlt") },
14385 { STRING_COMMA_LEN ("nle") },
14386 { STRING_COMMA_LEN ("ord") }
14390 CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
14392 unsigned int cmp_type;
14394 FETCH_DATA (the_info, codep + 1);
14395 cmp_type = *codep++ & 0xff;
14396 if (cmp_type < ARRAY_SIZE (simd_cmp_op))
14399 char *p = mnemonicendp - 2;
14403 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
14404 mnemonicendp += simd_cmp_op[cmp_type].len;
14408 /* We have a reserved extension byte. Output it directly. */
14409 scratchbuf[0] = '$';
14410 print_operand_value (scratchbuf + 1, 1, cmp_type);
14411 oappend (scratchbuf + intel_syntax);
14412 scratchbuf[0] = '\0';
14417 OP_Mwait (int bytemode ATTRIBUTE_UNUSED,
14418 int sizeflag ATTRIBUTE_UNUSED)
14420 /* mwait %eax,%ecx */
14423 const char **names = (address_mode == mode_64bit
14424 ? names64 : names32);
14425 strcpy (op_out[0], names[0]);
14426 strcpy (op_out[1], names[1]);
14427 two_source_ops = 1;
14429 /* Skip mod/rm byte. */
14435 OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
14436 int sizeflag ATTRIBUTE_UNUSED)
14438 /* monitor %eax,%ecx,%edx" */
14441 const char **op1_names;
14442 const char **names = (address_mode == mode_64bit
14443 ? names64 : names32);
14445 if (!(prefixes & PREFIX_ADDR))
14446 op1_names = (address_mode == mode_16bit
14447 ? names16 : names);
14450 /* Remove "addr16/addr32". */
14451 all_prefixes[last_addr_prefix] = 0;
14452 op1_names = (address_mode != mode_32bit
14453 ? names32 : names16);
14454 used_prefixes |= PREFIX_ADDR;
14456 strcpy (op_out[0], op1_names[0]);
14457 strcpy (op_out[1], names[1]);
14458 strcpy (op_out[2], names[2]);
14459 two_source_ops = 1;
14461 /* Skip mod/rm byte. */
14469 /* Throw away prefixes and 1st. opcode byte. */
14470 codep = insn_codep + 1;
14475 REP_Fixup (int bytemode, int sizeflag)
14477 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
14479 if (prefixes & PREFIX_REPZ)
14480 all_prefixes[last_repz_prefix] = REP_PREFIX;
14487 OP_IMREG (bytemode, sizeflag);
14490 OP_ESreg (bytemode, sizeflag);
14493 OP_DSreg (bytemode, sizeflag);
14502 CMPXCHG8B_Fixup (int bytemode, int sizeflag)
14507 /* Change cmpxchg8b to cmpxchg16b. */
14508 char *p = mnemonicendp - 2;
14509 mnemonicendp = stpcpy (p, "16b");
14512 OP_M (bytemode, sizeflag);
14516 XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
14518 const char **names;
14522 switch (vex.length)
14536 oappend (names[reg]);
14540 CRC32_Fixup (int bytemode, int sizeflag)
14542 /* Add proper suffix to "crc32". */
14543 char *p = mnemonicendp;
14562 if (sizeflag & DFLAG)
14566 used_prefixes |= (prefixes & PREFIX_DATA);
14570 oappend (INTERNAL_DISASSEMBLER_ERROR);
14577 if (modrm.mod == 3)
14581 /* Skip mod/rm byte. */
14586 add = (rex & REX_B) ? 8 : 0;
14587 if (bytemode == b_mode)
14591 oappend (names8rex[modrm.rm + add]);
14593 oappend (names8[modrm.rm + add]);
14599 oappend (names64[modrm.rm + add]);
14600 else if ((prefixes & PREFIX_DATA))
14601 oappend (names16[modrm.rm + add]);
14603 oappend (names32[modrm.rm + add]);
14607 OP_E (bytemode, sizeflag);
14611 FXSAVE_Fixup (int bytemode, int sizeflag)
14613 /* Add proper suffix to "fxsave" and "fxrstor". */
14617 char *p = mnemonicendp;
14623 OP_M (bytemode, sizeflag);
14626 /* Display the destination register operand for instructions with
14630 OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
14633 const char **names;
14641 reg = vex.register_specifier;
14642 if (bytemode == vex_scalar_mode)
14644 oappend (names_xmm[reg]);
14648 switch (vex.length)
14685 oappend (names[reg]);
14688 /* Get the VEX immediate byte without moving codep. */
14690 static unsigned char
14691 get_vex_imm8 (int sizeflag, int opnum)
14693 int bytes_before_imm = 0;
14695 if (modrm.mod != 3)
14697 /* There are SIB/displacement bytes. */
14698 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
14700 /* 32/64 bit address mode */
14701 int base = modrm.rm;
14703 /* Check SIB byte. */
14706 FETCH_DATA (the_info, codep + 1);
14708 /* When decoding the third source, don't increase
14709 bytes_before_imm as this has already been incremented
14710 by one in OP_E_memory while decoding the second
14713 bytes_before_imm++;
14716 /* Don't increase bytes_before_imm when decoding the third source,
14717 it has already been incremented by OP_E_memory while decoding
14718 the second source operand. */
14724 /* When modrm.rm == 5 or modrm.rm == 4 and base in
14725 SIB == 5, there is a 4 byte displacement. */
14727 /* No displacement. */
14730 /* 4 byte displacement. */
14731 bytes_before_imm += 4;
14734 /* 1 byte displacement. */
14735 bytes_before_imm++;
14742 /* 16 bit address mode */
14743 /* Don't increase bytes_before_imm when decoding the third source,
14744 it has already been incremented by OP_E_memory while decoding
14745 the second source operand. */
14751 /* When modrm.rm == 6, there is a 2 byte displacement. */
14753 /* No displacement. */
14756 /* 2 byte displacement. */
14757 bytes_before_imm += 2;
14760 /* 1 byte displacement: when decoding the third source,
14761 don't increase bytes_before_imm as this has already
14762 been incremented by one in OP_E_memory while decoding
14763 the second source operand. */
14765 bytes_before_imm++;
14773 FETCH_DATA (the_info, codep + bytes_before_imm + 1);
14774 return codep [bytes_before_imm];
14778 OP_EX_VexReg (int bytemode, int sizeflag, int reg)
14780 const char **names;
14782 if (reg == -1 && modrm.mod != 3)
14784 OP_E_memory (bytemode, sizeflag);
14796 else if (reg > 7 && address_mode != mode_64bit)
14800 switch (vex.length)
14811 oappend (names[reg]);
14815 OP_EX_VexImmW (int bytemode, int sizeflag)
14818 static unsigned char vex_imm8;
14820 if (vex_w_done == 0)
14824 /* Skip mod/rm byte. */
14828 vex_imm8 = get_vex_imm8 (sizeflag, 0);
14831 reg = vex_imm8 >> 4;
14833 OP_EX_VexReg (bytemode, sizeflag, reg);
14835 else if (vex_w_done == 1)
14840 reg = vex_imm8 >> 4;
14842 OP_EX_VexReg (bytemode, sizeflag, reg);
14846 /* Output the imm8 directly. */
14847 scratchbuf[0] = '$';
14848 print_operand_value (scratchbuf + 1, 1, vex_imm8 & 0xf);
14849 oappend (scratchbuf + intel_syntax);
14850 scratchbuf[0] = '\0';
14856 OP_Vex_2src (int bytemode, int sizeflag)
14858 if (modrm.mod == 3)
14860 int reg = modrm.rm;
14864 oappend (names_xmm[reg]);
14869 && (bytemode == v_mode || bytemode == v_swap_mode))
14871 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
14872 used_prefixes |= (prefixes & PREFIX_DATA);
14874 OP_E (bytemode, sizeflag);
14879 OP_Vex_2src_1 (int bytemode, int sizeflag)
14881 if (modrm.mod == 3)
14883 /* Skip mod/rm byte. */
14889 oappend (names_xmm[vex.register_specifier]);
14891 OP_Vex_2src (bytemode, sizeflag);
14895 OP_Vex_2src_2 (int bytemode, int sizeflag)
14898 OP_Vex_2src (bytemode, sizeflag);
14900 oappend (names_xmm[vex.register_specifier]);
14904 OP_EX_VexW (int bytemode, int sizeflag)
14912 /* Skip mod/rm byte. */
14917 reg = get_vex_imm8 (sizeflag, 0) >> 4;
14922 reg = get_vex_imm8 (sizeflag, 1) >> 4;
14925 OP_EX_VexReg (bytemode, sizeflag, reg);
14929 VEXI4_Fixup (int bytemode ATTRIBUTE_UNUSED,
14930 int sizeflag ATTRIBUTE_UNUSED)
14932 /* Skip the immediate byte and check for invalid bits. */
14933 FETCH_DATA (the_info, codep + 1);
14934 if (*codep++ & 0xf)
14939 OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
14942 const char **names;
14944 FETCH_DATA (the_info, codep + 1);
14947 if (bytemode != x_mode)
14954 if (reg > 7 && address_mode != mode_64bit)
14957 switch (vex.length)
14968 oappend (names[reg]);
14972 OP_XMM_VexW (int bytemode, int sizeflag)
14974 /* Turn off the REX.W bit since it is used for swapping operands
14977 OP_XMM (bytemode, sizeflag);
14981 OP_EX_Vex (int bytemode, int sizeflag)
14983 if (modrm.mod != 3)
14985 if (vex.register_specifier != 0)
14989 OP_EX (bytemode, sizeflag);
14993 OP_XMM_Vex (int bytemode, int sizeflag)
14995 if (modrm.mod != 3)
14997 if (vex.register_specifier != 0)
15001 OP_XMM (bytemode, sizeflag);
15005 VZERO_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15007 switch (vex.length)
15010 mnemonicendp = stpcpy (obuf, "vzeroupper");
15013 mnemonicendp = stpcpy (obuf, "vzeroall");
15020 static struct op vex_cmp_op[] =
15022 { STRING_COMMA_LEN ("eq") },
15023 { STRING_COMMA_LEN ("lt") },
15024 { STRING_COMMA_LEN ("le") },
15025 { STRING_COMMA_LEN ("unord") },
15026 { STRING_COMMA_LEN ("neq") },
15027 { STRING_COMMA_LEN ("nlt") },
15028 { STRING_COMMA_LEN ("nle") },
15029 { STRING_COMMA_LEN ("ord") },
15030 { STRING_COMMA_LEN ("eq_uq") },
15031 { STRING_COMMA_LEN ("nge") },
15032 { STRING_COMMA_LEN ("ngt") },
15033 { STRING_COMMA_LEN ("false") },
15034 { STRING_COMMA_LEN ("neq_oq") },
15035 { STRING_COMMA_LEN ("ge") },
15036 { STRING_COMMA_LEN ("gt") },
15037 { STRING_COMMA_LEN ("true") },
15038 { STRING_COMMA_LEN ("eq_os") },
15039 { STRING_COMMA_LEN ("lt_oq") },
15040 { STRING_COMMA_LEN ("le_oq") },
15041 { STRING_COMMA_LEN ("unord_s") },
15042 { STRING_COMMA_LEN ("neq_us") },
15043 { STRING_COMMA_LEN ("nlt_uq") },
15044 { STRING_COMMA_LEN ("nle_uq") },
15045 { STRING_COMMA_LEN ("ord_s") },
15046 { STRING_COMMA_LEN ("eq_us") },
15047 { STRING_COMMA_LEN ("nge_uq") },
15048 { STRING_COMMA_LEN ("ngt_uq") },
15049 { STRING_COMMA_LEN ("false_os") },
15050 { STRING_COMMA_LEN ("neq_os") },
15051 { STRING_COMMA_LEN ("ge_oq") },
15052 { STRING_COMMA_LEN ("gt_oq") },
15053 { STRING_COMMA_LEN ("true_us") },
15057 VCMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15059 unsigned int cmp_type;
15061 FETCH_DATA (the_info, codep + 1);
15062 cmp_type = *codep++ & 0xff;
15063 if (cmp_type < ARRAY_SIZE (vex_cmp_op))
15066 char *p = mnemonicendp - 2;
15070 sprintf (p, "%s%s", vex_cmp_op[cmp_type].name, suffix);
15071 mnemonicendp += vex_cmp_op[cmp_type].len;
15075 /* We have a reserved extension byte. Output it directly. */
15076 scratchbuf[0] = '$';
15077 print_operand_value (scratchbuf + 1, 1, cmp_type);
15078 oappend (scratchbuf + intel_syntax);
15079 scratchbuf[0] = '\0';
15083 static const struct op pclmul_op[] =
15085 { STRING_COMMA_LEN ("lql") },
15086 { STRING_COMMA_LEN ("hql") },
15087 { STRING_COMMA_LEN ("lqh") },
15088 { STRING_COMMA_LEN ("hqh") }
15092 PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
15093 int sizeflag ATTRIBUTE_UNUSED)
15095 unsigned int pclmul_type;
15097 FETCH_DATA (the_info, codep + 1);
15098 pclmul_type = *codep++ & 0xff;
15099 switch (pclmul_type)
15110 if (pclmul_type < ARRAY_SIZE (pclmul_op))
15113 char *p = mnemonicendp - 3;
15118 sprintf (p, "%s%s", pclmul_op[pclmul_type].name, suffix);
15119 mnemonicendp += pclmul_op[pclmul_type].len;
15123 /* We have a reserved extension byte. Output it directly. */
15124 scratchbuf[0] = '$';
15125 print_operand_value (scratchbuf + 1, 1, pclmul_type);
15126 oappend (scratchbuf + intel_syntax);
15127 scratchbuf[0] = '\0';
15132 MOVBE_Fixup (int bytemode, int sizeflag)
15134 /* Add proper suffix to "movbe". */
15135 char *p = mnemonicendp;
15144 if (sizeflag & SUFFIX_ALWAYS)
15150 if (sizeflag & DFLAG)
15154 used_prefixes |= (prefixes & PREFIX_DATA);
15159 oappend (INTERNAL_DISASSEMBLER_ERROR);
15166 OP_M (bytemode, sizeflag);
15170 OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15173 const char **names;
15175 /* Skip mod/rm byte. */
15189 oappend (names[reg]);
15193 OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15195 const char **names;
15202 oappend (names[vex.register_specifier]);