i386: Check vector length for vshufXXX/vinsertXXX/vextractXXX
[deliverable/binutils-gdb.git] / opcodes / i386-dis.c
CommitLineData
252b5132 1/* Print i386 instructions for GDB, the GNU debugger.
82704155 2 Copyright (C) 1988-2019 Free Software Foundation, Inc.
252b5132 3
9b201bb5 4 This file is part of the GNU opcodes library.
20f0a1fc 5
9b201bb5 6 This library is free software; you can redistribute it and/or modify
20f0a1fc 7 it under the terms of the GNU General Public License as published by
9b201bb5
NC
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
20f0a1fc 10
9b201bb5
NC
11 It is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
20f0a1fc
NC
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
9b201bb5
NC
18 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
19 MA 02110-1301, USA. */
20
20f0a1fc
NC
21
22/* 80386 instruction printer by Pace Willisson (pace@prep.ai.mit.edu)
23 July 1988
24 modified by John Hassey (hassey@dg-rtp.dg.com)
25 x86-64 support added by Jan Hubicka (jh@suse.cz)
26 VIA PadLock support by Michal Ludvig (mludvig@suse.cz). */
27
28/* The main tables describing the instructions is essentially a copy
29 of the "Opcode Map" chapter (Appendix A) of the Intel 80386
30 Programmers Manual. Usually, there is a capital letter, followed
31 by a small letter. The capital letter tell the addressing mode,
32 and the small letter tells about the operand size. Refer to
33 the Intel manual for details. */
252b5132 34
252b5132 35#include "sysdep.h"
88c1242d 36#include "disassemble.h"
252b5132 37#include "opintl.h"
0b1cf022 38#include "opcode/i386.h"
85f10a01 39#include "libiberty.h"
252b5132
RH
40
41#include <setjmp.h>
42
26ca5450
AJ
43static int print_insn (bfd_vma, disassemble_info *);
44static void dofloat (int);
45static void OP_ST (int, int);
46static void OP_STi (int, int);
47static int putop (const char *, int);
48static void oappend (const char *);
49static void append_seg (void);
50static void OP_indirE (int, int);
51static void print_operand_value (char *, int, bfd_vma);
c0f3af97 52static void OP_E_register (int, int);
c1e679ec 53static void OP_E_memory (int, int);
5d669648 54static void print_displacement (char *, bfd_vma);
26ca5450
AJ
55static void OP_E (int, int);
56static void OP_G (int, int);
57static bfd_vma get64 (void);
58static bfd_signed_vma get32 (void);
59static bfd_signed_vma get32s (void);
60static int get16 (void);
61static void set_op (bfd_vma, int);
b844680a 62static void OP_Skip_MODRM (int, int);
26ca5450
AJ
63static void OP_REG (int, int);
64static void OP_IMREG (int, int);
65static void OP_I (int, int);
66static void OP_I64 (int, int);
67static void OP_sI (int, int);
68static void OP_J (int, int);
69static void OP_SEG (int, int);
70static void OP_DIR (int, int);
71static void OP_OFF (int, int);
72static void OP_OFF64 (int, int);
73static void ptr_reg (int, int);
74static void OP_ESreg (int, int);
75static void OP_DSreg (int, int);
76static void OP_C (int, int);
77static void OP_D (int, int);
78static void OP_T (int, int);
6f74c397 79static void OP_R (int, int);
26ca5450
AJ
80static void OP_MMX (int, int);
81static void OP_XMM (int, int);
82static void OP_EM (int, int);
83static void OP_EX (int, int);
4d9567e0
MM
84static void OP_EMC (int,int);
85static void OP_MXC (int,int);
26ca5450
AJ
86static void OP_MS (int, int);
87static void OP_XS (int, int);
cc0ec051 88static void OP_M (int, int);
c0f3af97
L
89static void OP_VEX (int, int);
90static void OP_EX_Vex (int, int);
922d8de8 91static void OP_EX_VexW (int, int);
a683cc34 92static void OP_EX_VexImmW (int, int);
c0f3af97 93static void OP_XMM_Vex (int, int);
922d8de8 94static void OP_XMM_VexW (int, int);
43234a1e 95static void OP_Rounding (int, int);
c0f3af97
L
96static void OP_REG_VexI4 (int, int);
97static void PCLMUL_Fixup (int, int);
c0f3af97 98static void VCMP_Fixup (int, int);
43234a1e 99static void VPCMP_Fixup (int, int);
be92cb14 100static void VPCOM_Fixup (int, int);
cc0ec051 101static void OP_0f07 (int, int);
b844680a
L
102static void OP_Monitor (int, int);
103static void OP_Mwait (int, int);
9916071f 104static void OP_Mwaitx (int, int);
46e883c5
L
105static void NOP_Fixup1 (int, int);
106static void NOP_Fixup2 (int, int);
26ca5450 107static void OP_3DNowSuffix (int, int);
ad19981d 108static void CMP_Fixup (int, int);
26ca5450 109static void BadOp (void);
35c52694 110static void REP_Fixup (int, int);
7e8b059b 111static void BND_Fixup (int, int);
04ef582a 112static void NOTRACK_Fixup (int, int);
42164a71
L
113static void HLE_Fixup1 (int, int);
114static void HLE_Fixup2 (int, int);
115static void HLE_Fixup3 (int, int);
f5804c90 116static void CMPXCHG8B_Fixup (int, int);
42903f7f 117static void XMM_Fixup (int, int);
381d071f 118static void CRC32_Fixup (int, int);
eacc9c89 119static void FXSAVE_Fixup (int, int);
15c7c1d8 120static void PCMPESTR_Fixup (int, int);
f88c9eb0
SP
121static void OP_LWPCB_E (int, int);
122static void OP_LWP_E (int, int);
5dd85c99
SP
123static void OP_Vex_2src_1 (int, int);
124static void OP_Vex_2src_2 (int, int);
c1e679ec 125
f1f8f695 126static void MOVBE_Fixup (int, int);
252b5132 127
43234a1e
L
128static void OP_Mask (int, int);
129
6608db57 130struct dis_private {
252b5132
RH
131 /* Points to first byte not fetched. */
132 bfd_byte *max_fetched;
0b1cf022 133 bfd_byte the_buffer[MAX_MNEM_SIZE];
252b5132 134 bfd_vma insn_start;
e396998b 135 int orig_sizeflag;
8df14d78 136 OPCODES_SIGJMP_BUF bailout;
252b5132
RH
137};
138
cb712a9e
L
139enum address_mode
140{
141 mode_16bit,
142 mode_32bit,
143 mode_64bit
144};
145
146enum address_mode address_mode;
52b15da3 147
5076851f
ILT
148/* Flags for the prefixes for the current instruction. See below. */
149static int prefixes;
150
52b15da3
JH
151/* REX prefix the current instruction. See below. */
152static int rex;
153/* Bits of REX we've already used. */
154static int rex_used;
d869730d 155/* REX bits in original REX prefix ignored. */
c0f3af97 156static int rex_ignored;
52b15da3
JH
157/* Mark parts used in the REX prefix. When we are testing for
158 empty prefix (for 8bit register REX extension), just mask it
159 out. Otherwise test for REX bit is excuse for existence of REX
160 only in case value is nonzero. */
161#define USED_REX(value) \
162 { \
163 if (value) \
161a04f6
L
164 { \
165 if ((rex & value)) \
166 rex_used |= (value) | REX_OPCODE; \
167 } \
52b15da3 168 else \
161a04f6 169 rex_used |= REX_OPCODE; \
52b15da3
JH
170 }
171
7d421014
ILT
172/* Flags for prefixes which we somehow handled when printing the
173 current instruction. */
174static int used_prefixes;
175
5076851f
ILT
176/* Flags stored in PREFIXES. */
177#define PREFIX_REPZ 1
178#define PREFIX_REPNZ 2
179#define PREFIX_LOCK 4
180#define PREFIX_CS 8
181#define PREFIX_SS 0x10
182#define PREFIX_DS 0x20
183#define PREFIX_ES 0x40
184#define PREFIX_FS 0x80
185#define PREFIX_GS 0x100
186#define PREFIX_DATA 0x200
187#define PREFIX_ADDR 0x400
188#define PREFIX_FWAIT 0x800
189
252b5132
RH
190/* Make sure that bytes from INFO->PRIVATE_DATA->BUFFER (inclusive)
191 to ADDR (exclusive) are valid. Returns 1 for success, longjmps
192 on error. */
193#define FETCH_DATA(info, addr) \
6608db57 194 ((addr) <= ((struct dis_private *) (info->private_data))->max_fetched \
252b5132
RH
195 ? 1 : fetch_data ((info), (addr)))
196
197static int
26ca5450 198fetch_data (struct disassemble_info *info, bfd_byte *addr)
252b5132
RH
199{
200 int status;
6608db57 201 struct dis_private *priv = (struct dis_private *) info->private_data;
252b5132
RH
202 bfd_vma start = priv->insn_start + (priv->max_fetched - priv->the_buffer);
203
0b1cf022 204 if (addr <= priv->the_buffer + MAX_MNEM_SIZE)
272c9217
JB
205 status = (*info->read_memory_func) (start,
206 priv->max_fetched,
207 addr - priv->max_fetched,
208 info);
209 else
210 status = -1;
252b5132
RH
211 if (status != 0)
212 {
7d421014 213 /* If we did manage to read at least one byte, then
db6eb5be
AM
214 print_insn_i386 will do something sensible. Otherwise, print
215 an error. We do that here because this is where we know
216 STATUS. */
7d421014 217 if (priv->max_fetched == priv->the_buffer)
5076851f 218 (*info->memory_error_func) (status, start, info);
8df14d78 219 OPCODES_SIGLONGJMP (priv->bailout, 1);
252b5132
RH
220 }
221 else
222 priv->max_fetched = addr;
223 return 1;
224}
225
bf890a93 226/* Possible values for prefix requirement. */
507bd325
L
227#define PREFIX_IGNORED_SHIFT 16
228#define PREFIX_IGNORED_REPZ (PREFIX_REPZ << PREFIX_IGNORED_SHIFT)
229#define PREFIX_IGNORED_REPNZ (PREFIX_REPNZ << PREFIX_IGNORED_SHIFT)
230#define PREFIX_IGNORED_DATA (PREFIX_DATA << PREFIX_IGNORED_SHIFT)
231#define PREFIX_IGNORED_ADDR (PREFIX_ADDR << PREFIX_IGNORED_SHIFT)
232#define PREFIX_IGNORED_LOCK (PREFIX_LOCK << PREFIX_IGNORED_SHIFT)
233
234/* Opcode prefixes. */
235#define PREFIX_OPCODE (PREFIX_REPZ \
236 | PREFIX_REPNZ \
237 | PREFIX_DATA)
238
239/* Prefixes ignored. */
240#define PREFIX_IGNORED (PREFIX_IGNORED_REPZ \
241 | PREFIX_IGNORED_REPNZ \
242 | PREFIX_IGNORED_DATA)
bf890a93 243
ce518a5f 244#define XX { NULL, 0 }
507bd325 245#define Bad_Opcode NULL, { { NULL, 0 } }, 0
ce518a5f
L
246
247#define Eb { OP_E, b_mode }
7e8b059b 248#define Ebnd { OP_E, bnd_mode }
b6169b20 249#define EbS { OP_E, b_swap_mode }
9f79e886 250#define EbndS { OP_E, bnd_swap_mode }
ce518a5f 251#define Ev { OP_E, v_mode }
de89d0a3 252#define Eva { OP_E, va_mode }
7e8b059b 253#define Ev_bnd { OP_E, v_bnd_mode }
b6169b20 254#define EvS { OP_E, v_swap_mode }
ce518a5f
L
255#define Ed { OP_E, d_mode }
256#define Edq { OP_E, dq_mode }
257#define Edqw { OP_E, dqw_mode }
42903f7f 258#define Edqb { OP_E, dqb_mode }
1ba585e8
IT
259#define Edb { OP_E, db_mode }
260#define Edw { OP_E, dw_mode }
42903f7f 261#define Edqd { OP_E, dqd_mode }
d20dee9e 262#define Edqa { OP_E, dqa_mode }
09335d05 263#define Eq { OP_E, q_mode }
07f5af7d 264#define indirEv { OP_indirE, indir_v_mode }
ce518a5f
L
265#define indirEp { OP_indirE, f_mode }
266#define stackEv { OP_E, stack_v_mode }
267#define Em { OP_E, m_mode }
268#define Ew { OP_E, w_mode }
269#define M { OP_M, 0 } /* lea, lgdt, etc. */
34b772a6 270#define Ma { OP_M, a_mode }
b844680a 271#define Mb { OP_M, b_mode }
d9a5e5e5 272#define Md { OP_M, d_mode }
f1f8f695 273#define Mo { OP_M, o_mode }
ce518a5f
L
274#define Mp { OP_M, f_mode } /* 32 or 48 bit memory operand for LDS, LES etc */
275#define Mq { OP_M, q_mode }
d276ec69 276#define Mv_bnd { OP_M, v_bndmk_mode }
4ee52178 277#define Mx { OP_M, x_mode }
c0f3af97 278#define Mxmm { OP_M, xmm_mode }
ce518a5f 279#define Gb { OP_G, b_mode }
7e8b059b 280#define Gbnd { OP_G, bnd_mode }
ce518a5f
L
281#define Gv { OP_G, v_mode }
282#define Gd { OP_G, d_mode }
283#define Gdq { OP_G, dq_mode }
284#define Gm { OP_G, m_mode }
c0a30a9f 285#define Gva { OP_G, va_mode }
ce518a5f 286#define Gw { OP_G, w_mode }
6f74c397 287#define Rd { OP_R, d_mode }
43234a1e 288#define Rdq { OP_R, dq_mode }
6f74c397 289#define Rm { OP_R, m_mode }
ce518a5f
L
290#define Ib { OP_I, b_mode }
291#define sIb { OP_sI, b_mode } /* sign extened byte */
e3949f17 292#define sIbT { OP_sI, b_T_mode } /* sign extened byte like 'T' */
ce518a5f 293#define Iv { OP_I, v_mode }
7bb15c6f 294#define sIv { OP_sI, v_mode }
ce518a5f
L
295#define Iq { OP_I, q_mode }
296#define Iv64 { OP_I64, v_mode }
297#define Iw { OP_I, w_mode }
298#define I1 { OP_I, const_1_mode }
299#define Jb { OP_J, b_mode }
300#define Jv { OP_J, v_mode }
301#define Cm { OP_C, m_mode }
302#define Dm { OP_D, m_mode }
303#define Td { OP_T, d_mode }
b844680a 304#define Skip_MODRM { OP_Skip_MODRM, 0 }
ce518a5f
L
305
306#define RMeAX { OP_REG, eAX_reg }
307#define RMeBX { OP_REG, eBX_reg }
308#define RMeCX { OP_REG, eCX_reg }
309#define RMeDX { OP_REG, eDX_reg }
310#define RMeSP { OP_REG, eSP_reg }
311#define RMeBP { OP_REG, eBP_reg }
312#define RMeSI { OP_REG, eSI_reg }
313#define RMeDI { OP_REG, eDI_reg }
314#define RMrAX { OP_REG, rAX_reg }
315#define RMrBX { OP_REG, rBX_reg }
316#define RMrCX { OP_REG, rCX_reg }
317#define RMrDX { OP_REG, rDX_reg }
318#define RMrSP { OP_REG, rSP_reg }
319#define RMrBP { OP_REG, rBP_reg }
320#define RMrSI { OP_REG, rSI_reg }
321#define RMrDI { OP_REG, rDI_reg }
322#define RMAL { OP_REG, al_reg }
ce518a5f
L
323#define RMCL { OP_REG, cl_reg }
324#define RMDL { OP_REG, dl_reg }
325#define RMBL { OP_REG, bl_reg }
326#define RMAH { OP_REG, ah_reg }
327#define RMCH { OP_REG, ch_reg }
328#define RMDH { OP_REG, dh_reg }
329#define RMBH { OP_REG, bh_reg }
330#define RMAX { OP_REG, ax_reg }
331#define RMDX { OP_REG, dx_reg }
332
333#define eAX { OP_IMREG, eAX_reg }
334#define eBX { OP_IMREG, eBX_reg }
335#define eCX { OP_IMREG, eCX_reg }
336#define eDX { OP_IMREG, eDX_reg }
337#define eSP { OP_IMREG, eSP_reg }
338#define eBP { OP_IMREG, eBP_reg }
339#define eSI { OP_IMREG, eSI_reg }
340#define eDI { OP_IMREG, eDI_reg }
341#define AL { OP_IMREG, al_reg }
342#define CL { OP_IMREG, cl_reg }
343#define DL { OP_IMREG, dl_reg }
344#define BL { OP_IMREG, bl_reg }
345#define AH { OP_IMREG, ah_reg }
346#define CH { OP_IMREG, ch_reg }
347#define DH { OP_IMREG, dh_reg }
348#define BH { OP_IMREG, bh_reg }
349#define AX { OP_IMREG, ax_reg }
350#define DX { OP_IMREG, dx_reg }
351#define zAX { OP_IMREG, z_mode_ax_reg }
352#define indirDX { OP_IMREG, indir_dx_reg }
353
354#define Sw { OP_SEG, w_mode }
355#define Sv { OP_SEG, v_mode }
356#define Ap { OP_DIR, 0 }
357#define Ob { OP_OFF64, b_mode }
358#define Ov { OP_OFF64, v_mode }
359#define Xb { OP_DSreg, eSI_reg }
360#define Xv { OP_DSreg, eSI_reg }
361#define Xz { OP_DSreg, eSI_reg }
362#define Yb { OP_ESreg, eDI_reg }
363#define Yv { OP_ESreg, eDI_reg }
364#define DSBX { OP_DSreg, eBX_reg }
365
366#define es { OP_REG, es_reg }
367#define ss { OP_REG, ss_reg }
368#define cs { OP_REG, cs_reg }
369#define ds { OP_REG, ds_reg }
370#define fs { OP_REG, fs_reg }
371#define gs { OP_REG, gs_reg }
372
373#define MX { OP_MMX, 0 }
374#define XM { OP_XMM, 0 }
539f890d 375#define XMScalar { OP_XMM, scalar_mode }
6c30d220 376#define XMGatherQ { OP_XMM, vex_vsib_q_w_dq_mode }
c0f3af97 377#define XMM { OP_XMM, xmm_mode }
43234a1e 378#define XMxmmq { OP_XMM, xmmq_mode }
ce518a5f 379#define EM { OP_EM, v_mode }
b6169b20 380#define EMS { OP_EM, v_swap_mode }
09a2c6cf 381#define EMd { OP_EM, d_mode }
14051056 382#define EMx { OP_EM, x_mode }
53467f57 383#define EXbScalar { OP_EX, b_scalar_mode }
8976381e 384#define EXw { OP_EX, w_mode }
53467f57 385#define EXwScalar { OP_EX, w_scalar_mode }
09a2c6cf 386#define EXd { OP_EX, d_mode }
539f890d 387#define EXdScalar { OP_EX, d_scalar_mode }
fa99fab2 388#define EXdS { OP_EX, d_swap_mode }
43234a1e 389#define EXdScalarS { OP_EX, d_scalar_swap_mode }
09a2c6cf 390#define EXq { OP_EX, q_mode }
539f890d
L
391#define EXqScalar { OP_EX, q_scalar_mode }
392#define EXqScalarS { OP_EX, q_scalar_swap_mode }
b6169b20 393#define EXqS { OP_EX, q_swap_mode }
09a2c6cf 394#define EXx { OP_EX, x_mode }
b6169b20 395#define EXxS { OP_EX, x_swap_mode }
c0f3af97 396#define EXxmm { OP_EX, xmm_mode }
43234a1e 397#define EXymm { OP_EX, ymm_mode }
c0f3af97 398#define EXxmmq { OP_EX, xmmq_mode }
43234a1e 399#define EXEvexHalfBcstXmmq { OP_EX, evex_half_bcst_xmmq_mode }
6c30d220
L
400#define EXxmm_mb { OP_EX, xmm_mb_mode }
401#define EXxmm_mw { OP_EX, xmm_mw_mode }
402#define EXxmm_md { OP_EX, xmm_md_mode }
403#define EXxmm_mq { OP_EX, xmm_mq_mode }
43234a1e 404#define EXxmm_mdq { OP_EX, xmm_mdq_mode }
6c30d220
L
405#define EXxmmdw { OP_EX, xmmdw_mode }
406#define EXxmmqd { OP_EX, xmmqd_mode }
c0f3af97 407#define EXymmq { OP_EX, ymmq_mode }
0bfee649 408#define EXVexWdq { OP_EX, vex_w_dq_mode }
1c480963 409#define EXVexWdqScalar { OP_EX, vex_scalar_w_dq_mode }
43234a1e
L
410#define EXEvexXGscat { OP_EX, evex_x_gscat_mode }
411#define EXEvexXNoBcst { OP_EX, evex_x_nobcst_mode }
ce518a5f
L
412#define MS { OP_MS, v_mode }
413#define XS { OP_XS, v_mode }
09335d05 414#define EMCq { OP_EMC, q_mode }
ce518a5f 415#define MXC { OP_MXC, 0 }
ce518a5f 416#define OPSUF { OP_3DNowSuffix, 0 }
ad19981d 417#define CMP { CMP_Fixup, 0 }
42903f7f 418#define XMM0 { XMM_Fixup, 0 }
eacc9c89 419#define FXSAVE { FXSAVE_Fixup, 0 }
5dd85c99
SP
420#define Vex_2src_1 { OP_Vex_2src_1, 0 }
421#define Vex_2src_2 { OP_Vex_2src_2, 0 }
252b5132 422
c0f3af97 423#define Vex { OP_VEX, vex_mode }
539f890d 424#define VexScalar { OP_VEX, vex_scalar_mode }
6c30d220 425#define VexGatherQ { OP_VEX, vex_vsib_q_w_dq_mode }
c0f3af97
L
426#define Vex128 { OP_VEX, vex128_mode }
427#define Vex256 { OP_VEX, vex256_mode }
cb21baef 428#define VexGdq { OP_VEX, dq_mode }
c0f3af97 429#define EXdVex { OP_EX_Vex, d_mode }
fa99fab2 430#define EXdVexS { OP_EX_Vex, d_swap_mode }
539f890d 431#define EXdVexScalarS { OP_EX_Vex, d_scalar_swap_mode }
c0f3af97 432#define EXqVex { OP_EX_Vex, q_mode }
fa99fab2 433#define EXqVexS { OP_EX_Vex, q_swap_mode }
539f890d 434#define EXqVexScalarS { OP_EX_Vex, q_scalar_swap_mode }
922d8de8
DR
435#define EXVexW { OP_EX_VexW, x_mode }
436#define EXdVexW { OP_EX_VexW, d_mode }
437#define EXqVexW { OP_EX_VexW, q_mode }
a683cc34 438#define EXVexImmW { OP_EX_VexImmW, x_mode }
c0f3af97 439#define XMVex { OP_XMM_Vex, 0 }
539f890d 440#define XMVexScalar { OP_XMM_Vex, scalar_mode }
922d8de8 441#define XMVexW { OP_XMM_VexW, 0 }
c0f3af97
L
442#define XMVexI4 { OP_REG_VexI4, x_mode }
443#define PCLMUL { PCLMUL_Fixup, 0 }
c0f3af97 444#define VCMP { VCMP_Fixup, 0 }
43234a1e 445#define VPCMP { VPCMP_Fixup, 0 }
be92cb14 446#define VPCOM { VPCOM_Fixup, 0 }
43234a1e
L
447
448#define EXxEVexR { OP_Rounding, evex_rounding_mode }
70df6fc9 449#define EXxEVexR64 { OP_Rounding, evex_rounding_64_mode }
43234a1e
L
450#define EXxEVexS { OP_Rounding, evex_sae_mode }
451
452#define XMask { OP_Mask, mask_mode }
453#define MaskG { OP_G, mask_mode }
454#define MaskE { OP_E, mask_mode }
1ba585e8 455#define MaskBDE { OP_E, mask_bd_mode }
43234a1e
L
456#define MaskR { OP_R, mask_mode }
457#define MaskVex { OP_VEX, mask_mode }
c0f3af97 458
6c30d220 459#define MVexVSIBDWpX { OP_M, vex_vsib_d_w_dq_mode }
5fc35d96 460#define MVexVSIBDQWpX { OP_M, vex_vsib_d_w_d_mode }
6c30d220 461#define MVexVSIBQWpX { OP_M, vex_vsib_q_w_dq_mode }
5fc35d96 462#define MVexVSIBQDWpX { OP_M, vex_vsib_q_w_d_mode }
6c30d220 463
35c52694 464/* Used handle "rep" prefix for string instructions. */
ce518a5f
L
465#define Xbr { REP_Fixup, eSI_reg }
466#define Xvr { REP_Fixup, eSI_reg }
467#define Ybr { REP_Fixup, eDI_reg }
468#define Yvr { REP_Fixup, eDI_reg }
469#define Yzr { REP_Fixup, eDI_reg }
470#define indirDXr { REP_Fixup, indir_dx_reg }
471#define ALr { REP_Fixup, al_reg }
472#define eAXr { REP_Fixup, eAX_reg }
473
42164a71
L
474/* Used handle HLE prefix for lockable instructions. */
475#define Ebh1 { HLE_Fixup1, b_mode }
476#define Evh1 { HLE_Fixup1, v_mode }
477#define Ebh2 { HLE_Fixup2, b_mode }
478#define Evh2 { HLE_Fixup2, v_mode }
479#define Ebh3 { HLE_Fixup3, b_mode }
480#define Evh3 { HLE_Fixup3, v_mode }
481
7e8b059b 482#define BND { BND_Fixup, 0 }
04ef582a 483#define NOTRACK { NOTRACK_Fixup, 0 }
7e8b059b 484
ce518a5f
L
485#define cond_jump_flag { NULL, cond_jump_mode }
486#define loop_jcxz_flag { NULL, loop_jcxz_mode }
3ffd33cf 487
252b5132 488/* bits in sizeflag */
252b5132 489#define SUFFIX_ALWAYS 4
252b5132
RH
490#define AFLAG 2
491#define DFLAG 1
492
51e7da1b
L
493enum
494{
495 /* byte operand */
496 b_mode = 1,
497 /* byte operand with operand swapped */
3873ba12 498 b_swap_mode,
e3949f17
L
499 /* byte operand, sign extend like 'T' suffix */
500 b_T_mode,
51e7da1b 501 /* operand size depends on prefixes */
3873ba12 502 v_mode,
51e7da1b 503 /* operand size depends on prefixes with operand swapped */
3873ba12 504 v_swap_mode,
de89d0a3
IT
505 /* operand size depends on address prefix */
506 va_mode,
51e7da1b 507 /* word operand */
3873ba12 508 w_mode,
51e7da1b 509 /* double word operand */
3873ba12 510 d_mode,
51e7da1b 511 /* double word operand with operand swapped */
3873ba12 512 d_swap_mode,
51e7da1b 513 /* quad word operand */
3873ba12 514 q_mode,
51e7da1b 515 /* quad word operand with operand swapped */
3873ba12 516 q_swap_mode,
51e7da1b 517 /* ten-byte operand */
3873ba12 518 t_mode,
43234a1e
L
519 /* 16-byte XMM, 32-byte YMM or 64-byte ZMM operand. In EVEX with
520 broadcast enabled. */
3873ba12 521 x_mode,
43234a1e
L
522 /* Similar to x_mode, but with different EVEX mem shifts. */
523 evex_x_gscat_mode,
524 /* Similar to x_mode, but with disabled broadcast. */
525 evex_x_nobcst_mode,
526 /* Similar to x_mode, but with operands swapped and disabled broadcast
527 in EVEX. */
3873ba12 528 x_swap_mode,
51e7da1b 529 /* 16-byte XMM operand */
3873ba12 530 xmm_mode,
43234a1e
L
531 /* XMM, XMM or YMM register operand, or quad word, xmmword or ymmword
532 memory operand (depending on vector length). Broadcast isn't
533 allowed. */
3873ba12 534 xmmq_mode,
43234a1e
L
535 /* Same as xmmq_mode, but broadcast is allowed. */
536 evex_half_bcst_xmmq_mode,
6c30d220
L
537 /* XMM register or byte memory operand */
538 xmm_mb_mode,
539 /* XMM register or word memory operand */
540 xmm_mw_mode,
541 /* XMM register or double word memory operand */
542 xmm_md_mode,
543 /* XMM register or quad word memory operand */
544 xmm_mq_mode,
43234a1e
L
545 /* XMM register or double/quad word memory operand, depending on
546 VEX.W. */
547 xmm_mdq_mode,
548 /* 16-byte XMM, word, double word or quad word operand. */
6c30d220 549 xmmdw_mode,
43234a1e 550 /* 16-byte XMM, double word, quad word operand or xmm word operand. */
6c30d220 551 xmmqd_mode,
43234a1e
L
552 /* 32-byte YMM operand */
553 ymm_mode,
554 /* quad word, ymmword or zmmword memory operand. */
3873ba12 555 ymmq_mode,
6c30d220
L
556 /* 32-byte YMM or 16-byte word operand */
557 ymmxmm_mode,
51e7da1b 558 /* d_mode in 32bit, q_mode in 64bit mode. */
3873ba12 559 m_mode,
51e7da1b 560 /* pair of v_mode operands */
3873ba12
L
561 a_mode,
562 cond_jump_mode,
563 loop_jcxz_mode,
7e8b059b 564 v_bnd_mode,
d276ec69
JB
565 /* like v_bnd_mode in 32bit, no RIP-rel in 64bit mode. */
566 v_bndmk_mode,
51e7da1b 567 /* operand size depends on REX prefixes. */
3873ba12 568 dq_mode,
51e7da1b 569 /* registers like dq_mode, memory like w_mode. */
3873ba12 570 dqw_mode,
9f79e886 571 /* bounds operand */
7e8b059b 572 bnd_mode,
9f79e886
JB
573 /* bounds operand with operand swapped */
574 bnd_swap_mode,
51e7da1b 575 /* 4- or 6-byte pointer operand */
3873ba12
L
576 f_mode,
577 const_1_mode,
07f5af7d
L
578 /* v_mode for indirect branch opcodes. */
579 indir_v_mode,
51e7da1b 580 /* v_mode for stack-related opcodes. */
3873ba12 581 stack_v_mode,
51e7da1b 582 /* non-quad operand size depends on prefixes */
3873ba12 583 z_mode,
51e7da1b 584 /* 16-byte operand */
3873ba12 585 o_mode,
51e7da1b 586 /* registers like dq_mode, memory like b_mode. */
3873ba12 587 dqb_mode,
1ba585e8
IT
588 /* registers like d_mode, memory like b_mode. */
589 db_mode,
590 /* registers like d_mode, memory like w_mode. */
591 dw_mode,
51e7da1b 592 /* registers like dq_mode, memory like d_mode. */
3873ba12 593 dqd_mode,
d20dee9e
L
594 /* operand size depends on the W bit as well as address mode. */
595 dqa_mode,
51e7da1b 596 /* normal vex mode */
3873ba12 597 vex_mode,
51e7da1b 598 /* 128bit vex mode */
3873ba12 599 vex128_mode,
51e7da1b 600 /* 256bit vex mode */
3873ba12 601 vex256_mode,
51e7da1b 602 /* operand size depends on the VEX.W bit. */
3873ba12 603 vex_w_dq_mode,
d55ee72f 604
6c30d220
L
605 /* Similar to vex_w_dq_mode, with VSIB dword indices. */
606 vex_vsib_d_w_dq_mode,
5fc35d96
IT
607 /* Similar to vex_vsib_d_w_dq_mode, with smaller memory. */
608 vex_vsib_d_w_d_mode,
6c30d220
L
609 /* Similar to vex_w_dq_mode, with VSIB qword indices. */
610 vex_vsib_q_w_dq_mode,
5fc35d96
IT
611 /* Similar to vex_vsib_q_w_dq_mode, with smaller memory. */
612 vex_vsib_q_w_d_mode,
6c30d220 613
539f890d
L
614 /* scalar, ignore vector length. */
615 scalar_mode,
53467f57
IT
616 /* like b_mode, ignore vector length. */
617 b_scalar_mode,
618 /* like w_mode, ignore vector length. */
619 w_scalar_mode,
539f890d
L
620 /* like d_mode, ignore vector length. */
621 d_scalar_mode,
622 /* like d_swap_mode, ignore vector length. */
623 d_scalar_swap_mode,
624 /* like q_mode, ignore vector length. */
625 q_scalar_mode,
626 /* like q_swap_mode, ignore vector length. */
627 q_scalar_swap_mode,
628 /* like vex_mode, ignore vector length. */
629 vex_scalar_mode,
1c480963
L
630 /* like vex_w_dq_mode, ignore vector length. */
631 vex_scalar_w_dq_mode,
539f890d 632
43234a1e
L
633 /* Static rounding. */
634 evex_rounding_mode,
70df6fc9
L
635 /* Static rounding, 64-bit mode only. */
636 evex_rounding_64_mode,
43234a1e
L
637 /* Supress all exceptions. */
638 evex_sae_mode,
639
640 /* Mask register operand. */
641 mask_mode,
1ba585e8
IT
642 /* Mask register operand. */
643 mask_bd_mode,
43234a1e 644
3873ba12
L
645 es_reg,
646 cs_reg,
647 ss_reg,
648 ds_reg,
649 fs_reg,
650 gs_reg,
d55ee72f 651
3873ba12
L
652 eAX_reg,
653 eCX_reg,
654 eDX_reg,
655 eBX_reg,
656 eSP_reg,
657 eBP_reg,
658 eSI_reg,
659 eDI_reg,
d55ee72f 660
3873ba12
L
661 al_reg,
662 cl_reg,
663 dl_reg,
664 bl_reg,
665 ah_reg,
666 ch_reg,
667 dh_reg,
668 bh_reg,
d55ee72f 669
3873ba12
L
670 ax_reg,
671 cx_reg,
672 dx_reg,
673 bx_reg,
674 sp_reg,
675 bp_reg,
676 si_reg,
677 di_reg,
d55ee72f 678
3873ba12
L
679 rAX_reg,
680 rCX_reg,
681 rDX_reg,
682 rBX_reg,
683 rSP_reg,
684 rBP_reg,
685 rSI_reg,
686 rDI_reg,
d55ee72f 687
3873ba12
L
688 z_mode_ax_reg,
689 indir_dx_reg
51e7da1b 690};
252b5132 691
51e7da1b
L
692enum
693{
694 FLOATCODE = 1,
3873ba12
L
695 USE_REG_TABLE,
696 USE_MOD_TABLE,
697 USE_RM_TABLE,
698 USE_PREFIX_TABLE,
699 USE_X86_64_TABLE,
700 USE_3BYTE_TABLE,
f88c9eb0 701 USE_XOP_8F_TABLE,
3873ba12
L
702 USE_VEX_C4_TABLE,
703 USE_VEX_C5_TABLE,
9e30b8e0 704 USE_VEX_LEN_TABLE,
43234a1e 705 USE_VEX_W_TABLE,
04e2a182
L
706 USE_EVEX_TABLE,
707 USE_EVEX_LEN_TABLE
51e7da1b 708};
6439fc28 709
bf890a93 710#define FLOAT NULL, { { NULL, FLOATCODE } }, 0
4efba78c 711
bf890a93
IT
712#define DIS386(T, I) NULL, { { NULL, (T)}, { NULL, (I) } }, 0
713#define DIS386_PREFIX(T, I, P) NULL, { { NULL, (T)}, { NULL, (I) } }, P
1ceb70f8
L
714#define REG_TABLE(I) DIS386 (USE_REG_TABLE, (I))
715#define MOD_TABLE(I) DIS386 (USE_MOD_TABLE, (I))
716#define RM_TABLE(I) DIS386 (USE_RM_TABLE, (I))
717#define PREFIX_TABLE(I) DIS386 (USE_PREFIX_TABLE, (I))
4e7d34a6
L
718#define X86_64_TABLE(I) DIS386 (USE_X86_64_TABLE, (I))
719#define THREE_BYTE_TABLE(I) DIS386 (USE_3BYTE_TABLE, (I))
bf890a93 720#define THREE_BYTE_TABLE_PREFIX(I, P) DIS386_PREFIX (USE_3BYTE_TABLE, (I), P)
f88c9eb0 721#define XOP_8F_TABLE(I) DIS386 (USE_XOP_8F_TABLE, (I))
c0f3af97
L
722#define VEX_C4_TABLE(I) DIS386 (USE_VEX_C4_TABLE, (I))
723#define VEX_C5_TABLE(I) DIS386 (USE_VEX_C5_TABLE, (I))
724#define VEX_LEN_TABLE(I) DIS386 (USE_VEX_LEN_TABLE, (I))
9e30b8e0 725#define VEX_W_TABLE(I) DIS386 (USE_VEX_W_TABLE, (I))
43234a1e 726#define EVEX_TABLE(I) DIS386 (USE_EVEX_TABLE, (I))
04e2a182 727#define EVEX_LEN_TABLE(I) DIS386 (USE_EVEX_LEN_TABLE, (I))
1ceb70f8 728
51e7da1b
L
729enum
730{
731 REG_80 = 0,
3873ba12 732 REG_81,
7148c369 733 REG_83,
3873ba12
L
734 REG_8F,
735 REG_C0,
736 REG_C1,
737 REG_C6,
738 REG_C7,
739 REG_D0,
740 REG_D1,
741 REG_D2,
742 REG_D3,
743 REG_F6,
744 REG_F7,
745 REG_FE,
746 REG_FF,
747 REG_0F00,
748 REG_0F01,
749 REG_0F0D,
750 REG_0F18,
c48935d7 751 REG_0F1C_MOD_0,
603555e5 752 REG_0F1E_MOD_3,
3873ba12
L
753 REG_0F71,
754 REG_0F72,
755 REG_0F73,
756 REG_0FA6,
757 REG_0FA7,
758 REG_0FAE,
759 REG_0FBA,
760 REG_0FC7,
592a252b
L
761 REG_VEX_0F71,
762 REG_VEX_0F72,
763 REG_VEX_0F73,
764 REG_VEX_0FAE,
f12dc422 765 REG_VEX_0F38F3,
f88c9eb0 766 REG_XOP_LWPCB,
2a2a0f38
QN
767 REG_XOP_LWP,
768 REG_XOP_TBM_01,
43234a1e
L
769 REG_XOP_TBM_02,
770
1ba585e8 771 REG_EVEX_0F71,
43234a1e
L
772 REG_EVEX_0F72,
773 REG_EVEX_0F73,
774 REG_EVEX_0F38C6,
775 REG_EVEX_0F38C7
51e7da1b 776};
1ceb70f8 777
51e7da1b
L
778enum
779{
780 MOD_8D = 0,
42164a71
L
781 MOD_C6_REG_7,
782 MOD_C7_REG_7,
4a357820
MZ
783 MOD_FF_REG_3,
784 MOD_FF_REG_5,
3873ba12
L
785 MOD_0F01_REG_0,
786 MOD_0F01_REG_1,
787 MOD_0F01_REG_2,
788 MOD_0F01_REG_3,
8eab4136 789 MOD_0F01_REG_5,
3873ba12
L
790 MOD_0F01_REG_7,
791 MOD_0F12_PREFIX_0,
792 MOD_0F13,
793 MOD_0F16_PREFIX_0,
794 MOD_0F17,
795 MOD_0F18_REG_0,
796 MOD_0F18_REG_1,
797 MOD_0F18_REG_2,
798 MOD_0F18_REG_3,
d7189fa5
RM
799 MOD_0F18_REG_4,
800 MOD_0F18_REG_5,
801 MOD_0F18_REG_6,
802 MOD_0F18_REG_7,
7e8b059b
L
803 MOD_0F1A_PREFIX_0,
804 MOD_0F1B_PREFIX_0,
805 MOD_0F1B_PREFIX_1,
c48935d7 806 MOD_0F1C_PREFIX_0,
603555e5 807 MOD_0F1E_PREFIX_1,
3873ba12
L
808 MOD_0F24,
809 MOD_0F26,
810 MOD_0F2B_PREFIX_0,
811 MOD_0F2B_PREFIX_1,
812 MOD_0F2B_PREFIX_2,
813 MOD_0F2B_PREFIX_3,
814 MOD_0F51,
815 MOD_0F71_REG_2,
816 MOD_0F71_REG_4,
817 MOD_0F71_REG_6,
818 MOD_0F72_REG_2,
819 MOD_0F72_REG_4,
820 MOD_0F72_REG_6,
821 MOD_0F73_REG_2,
822 MOD_0F73_REG_3,
823 MOD_0F73_REG_6,
824 MOD_0F73_REG_7,
825 MOD_0FAE_REG_0,
826 MOD_0FAE_REG_1,
827 MOD_0FAE_REG_2,
828 MOD_0FAE_REG_3,
829 MOD_0FAE_REG_4,
830 MOD_0FAE_REG_5,
831 MOD_0FAE_REG_6,
832 MOD_0FAE_REG_7,
833 MOD_0FB2,
834 MOD_0FB4,
835 MOD_0FB5,
a8484f96 836 MOD_0FC3,
963f3586
IT
837 MOD_0FC7_REG_3,
838 MOD_0FC7_REG_4,
839 MOD_0FC7_REG_5,
3873ba12
L
840 MOD_0FC7_REG_6,
841 MOD_0FC7_REG_7,
842 MOD_0FD7,
843 MOD_0FE7_PREFIX_2,
844 MOD_0FF0_PREFIX_3,
845 MOD_0F382A_PREFIX_2,
603555e5
L
846 MOD_0F38F5_PREFIX_2,
847 MOD_0F38F6_PREFIX_0,
5d79adc4 848 MOD_0F38F8_PREFIX_1,
c0a30a9f 849 MOD_0F38F8_PREFIX_2,
5d79adc4 850 MOD_0F38F8_PREFIX_3,
c0a30a9f 851 MOD_0F38F9_PREFIX_0,
3873ba12
L
852 MOD_62_32BIT,
853 MOD_C4_32BIT,
854 MOD_C5_32BIT,
592a252b
L
855 MOD_VEX_0F12_PREFIX_0,
856 MOD_VEX_0F13,
857 MOD_VEX_0F16_PREFIX_0,
858 MOD_VEX_0F17,
859 MOD_VEX_0F2B,
ab4e4ed5
AF
860 MOD_VEX_W_0_0F41_P_0_LEN_1,
861 MOD_VEX_W_1_0F41_P_0_LEN_1,
862 MOD_VEX_W_0_0F41_P_2_LEN_1,
863 MOD_VEX_W_1_0F41_P_2_LEN_1,
864 MOD_VEX_W_0_0F42_P_0_LEN_1,
865 MOD_VEX_W_1_0F42_P_0_LEN_1,
866 MOD_VEX_W_0_0F42_P_2_LEN_1,
867 MOD_VEX_W_1_0F42_P_2_LEN_1,
868 MOD_VEX_W_0_0F44_P_0_LEN_1,
869 MOD_VEX_W_1_0F44_P_0_LEN_1,
870 MOD_VEX_W_0_0F44_P_2_LEN_1,
871 MOD_VEX_W_1_0F44_P_2_LEN_1,
872 MOD_VEX_W_0_0F45_P_0_LEN_1,
873 MOD_VEX_W_1_0F45_P_0_LEN_1,
874 MOD_VEX_W_0_0F45_P_2_LEN_1,
875 MOD_VEX_W_1_0F45_P_2_LEN_1,
876 MOD_VEX_W_0_0F46_P_0_LEN_1,
877 MOD_VEX_W_1_0F46_P_0_LEN_1,
878 MOD_VEX_W_0_0F46_P_2_LEN_1,
879 MOD_VEX_W_1_0F46_P_2_LEN_1,
880 MOD_VEX_W_0_0F47_P_0_LEN_1,
881 MOD_VEX_W_1_0F47_P_0_LEN_1,
882 MOD_VEX_W_0_0F47_P_2_LEN_1,
883 MOD_VEX_W_1_0F47_P_2_LEN_1,
884 MOD_VEX_W_0_0F4A_P_0_LEN_1,
885 MOD_VEX_W_1_0F4A_P_0_LEN_1,
886 MOD_VEX_W_0_0F4A_P_2_LEN_1,
887 MOD_VEX_W_1_0F4A_P_2_LEN_1,
888 MOD_VEX_W_0_0F4B_P_0_LEN_1,
889 MOD_VEX_W_1_0F4B_P_0_LEN_1,
890 MOD_VEX_W_0_0F4B_P_2_LEN_1,
592a252b
L
891 MOD_VEX_0F50,
892 MOD_VEX_0F71_REG_2,
893 MOD_VEX_0F71_REG_4,
894 MOD_VEX_0F71_REG_6,
895 MOD_VEX_0F72_REG_2,
896 MOD_VEX_0F72_REG_4,
897 MOD_VEX_0F72_REG_6,
898 MOD_VEX_0F73_REG_2,
899 MOD_VEX_0F73_REG_3,
900 MOD_VEX_0F73_REG_6,
901 MOD_VEX_0F73_REG_7,
ab4e4ed5
AF
902 MOD_VEX_W_0_0F91_P_0_LEN_0,
903 MOD_VEX_W_1_0F91_P_0_LEN_0,
904 MOD_VEX_W_0_0F91_P_2_LEN_0,
905 MOD_VEX_W_1_0F91_P_2_LEN_0,
906 MOD_VEX_W_0_0F92_P_0_LEN_0,
907 MOD_VEX_W_0_0F92_P_2_LEN_0,
58a211d2 908 MOD_VEX_0F92_P_3_LEN_0,
ab4e4ed5
AF
909 MOD_VEX_W_0_0F93_P_0_LEN_0,
910 MOD_VEX_W_0_0F93_P_2_LEN_0,
58a211d2 911 MOD_VEX_0F93_P_3_LEN_0,
ab4e4ed5
AF
912 MOD_VEX_W_0_0F98_P_0_LEN_0,
913 MOD_VEX_W_1_0F98_P_0_LEN_0,
914 MOD_VEX_W_0_0F98_P_2_LEN_0,
915 MOD_VEX_W_1_0F98_P_2_LEN_0,
916 MOD_VEX_W_0_0F99_P_0_LEN_0,
917 MOD_VEX_W_1_0F99_P_0_LEN_0,
918 MOD_VEX_W_0_0F99_P_2_LEN_0,
919 MOD_VEX_W_1_0F99_P_2_LEN_0,
592a252b
L
920 MOD_VEX_0FAE_REG_2,
921 MOD_VEX_0FAE_REG_3,
922 MOD_VEX_0FD7_PREFIX_2,
923 MOD_VEX_0FE7_PREFIX_2,
924 MOD_VEX_0FF0_PREFIX_3,
592a252b
L
925 MOD_VEX_0F381A_PREFIX_2,
926 MOD_VEX_0F382A_PREFIX_2,
927 MOD_VEX_0F382C_PREFIX_2,
928 MOD_VEX_0F382D_PREFIX_2,
929 MOD_VEX_0F382E_PREFIX_2,
6c30d220
L
930 MOD_VEX_0F382F_PREFIX_2,
931 MOD_VEX_0F385A_PREFIX_2,
932 MOD_VEX_0F388C_PREFIX_2,
933 MOD_VEX_0F388E_PREFIX_2,
ab4e4ed5
AF
934 MOD_VEX_W_0_0F3A30_P_2_LEN_0,
935 MOD_VEX_W_1_0F3A30_P_2_LEN_0,
936 MOD_VEX_W_0_0F3A31_P_2_LEN_0,
937 MOD_VEX_W_1_0F3A31_P_2_LEN_0,
938 MOD_VEX_W_0_0F3A32_P_2_LEN_0,
939 MOD_VEX_W_1_0F3A32_P_2_LEN_0,
940 MOD_VEX_W_0_0F3A33_P_2_LEN_0,
941 MOD_VEX_W_1_0F3A33_P_2_LEN_0,
43234a1e
L
942
943 MOD_EVEX_0F10_PREFIX_1,
944 MOD_EVEX_0F10_PREFIX_3,
945 MOD_EVEX_0F11_PREFIX_1,
946 MOD_EVEX_0F11_PREFIX_3,
947 MOD_EVEX_0F12_PREFIX_0,
948 MOD_EVEX_0F16_PREFIX_0,
949 MOD_EVEX_0F38C6_REG_1,
950 MOD_EVEX_0F38C6_REG_2,
951 MOD_EVEX_0F38C6_REG_5,
952 MOD_EVEX_0F38C6_REG_6,
953 MOD_EVEX_0F38C7_REG_1,
954 MOD_EVEX_0F38C7_REG_2,
955 MOD_EVEX_0F38C7_REG_5,
956 MOD_EVEX_0F38C7_REG_6
51e7da1b 957};
1ceb70f8 958
51e7da1b
L
959enum
960{
42164a71
L
961 RM_C6_REG_7 = 0,
962 RM_C7_REG_7,
963 RM_0F01_REG_0,
3873ba12
L
964 RM_0F01_REG_1,
965 RM_0F01_REG_2,
966 RM_0F01_REG_3,
8eab4136 967 RM_0F01_REG_5,
3873ba12 968 RM_0F01_REG_7,
603555e5 969 RM_0F1E_MOD_3_REG_7,
3873ba12
L
970 RM_0FAE_REG_6,
971 RM_0FAE_REG_7
51e7da1b 972};
1ceb70f8 973
51e7da1b
L
974enum
975{
976 PREFIX_90 = 0,
603555e5 977 PREFIX_MOD_0_0F01_REG_5,
2234eee6 978 PREFIX_MOD_3_0F01_REG_5_RM_0,
603555e5 979 PREFIX_MOD_3_0F01_REG_5_RM_2,
3233d7d0 980 PREFIX_0F09,
3873ba12
L
981 PREFIX_0F10,
982 PREFIX_0F11,
983 PREFIX_0F12,
984 PREFIX_0F16,
7e8b059b
L
985 PREFIX_0F1A,
986 PREFIX_0F1B,
c48935d7 987 PREFIX_0F1C,
603555e5 988 PREFIX_0F1E,
3873ba12
L
989 PREFIX_0F2A,
990 PREFIX_0F2B,
991 PREFIX_0F2C,
992 PREFIX_0F2D,
993 PREFIX_0F2E,
994 PREFIX_0F2F,
995 PREFIX_0F51,
996 PREFIX_0F52,
997 PREFIX_0F53,
998 PREFIX_0F58,
999 PREFIX_0F59,
1000 PREFIX_0F5A,
1001 PREFIX_0F5B,
1002 PREFIX_0F5C,
1003 PREFIX_0F5D,
1004 PREFIX_0F5E,
1005 PREFIX_0F5F,
1006 PREFIX_0F60,
1007 PREFIX_0F61,
1008 PREFIX_0F62,
1009 PREFIX_0F6C,
1010 PREFIX_0F6D,
1011 PREFIX_0F6F,
1012 PREFIX_0F70,
1013 PREFIX_0F73_REG_3,
1014 PREFIX_0F73_REG_7,
1015 PREFIX_0F78,
1016 PREFIX_0F79,
1017 PREFIX_0F7C,
1018 PREFIX_0F7D,
1019 PREFIX_0F7E,
1020 PREFIX_0F7F,
c7b8aa3a
L
1021 PREFIX_0FAE_REG_0,
1022 PREFIX_0FAE_REG_1,
1023 PREFIX_0FAE_REG_2,
1024 PREFIX_0FAE_REG_3,
6b40c462
L
1025 PREFIX_MOD_0_0FAE_REG_4,
1026 PREFIX_MOD_3_0FAE_REG_4,
603555e5 1027 PREFIX_MOD_0_0FAE_REG_5,
2234eee6 1028 PREFIX_MOD_3_0FAE_REG_5,
de89d0a3
IT
1029 PREFIX_MOD_0_0FAE_REG_6,
1030 PREFIX_MOD_1_0FAE_REG_6,
963f3586 1031 PREFIX_0FAE_REG_7,
3873ba12 1032 PREFIX_0FB8,
f12dc422 1033 PREFIX_0FBC,
3873ba12
L
1034 PREFIX_0FBD,
1035 PREFIX_0FC2,
a8484f96 1036 PREFIX_MOD_0_0FC3,
f24bcbaa
L
1037 PREFIX_MOD_0_0FC7_REG_6,
1038 PREFIX_MOD_3_0FC7_REG_6,
1039 PREFIX_MOD_3_0FC7_REG_7,
3873ba12
L
1040 PREFIX_0FD0,
1041 PREFIX_0FD6,
1042 PREFIX_0FE6,
1043 PREFIX_0FE7,
1044 PREFIX_0FF0,
1045 PREFIX_0FF7,
1046 PREFIX_0F3810,
1047 PREFIX_0F3814,
1048 PREFIX_0F3815,
1049 PREFIX_0F3817,
1050 PREFIX_0F3820,
1051 PREFIX_0F3821,
1052 PREFIX_0F3822,
1053 PREFIX_0F3823,
1054 PREFIX_0F3824,
1055 PREFIX_0F3825,
1056 PREFIX_0F3828,
1057 PREFIX_0F3829,
1058 PREFIX_0F382A,
1059 PREFIX_0F382B,
1060 PREFIX_0F3830,
1061 PREFIX_0F3831,
1062 PREFIX_0F3832,
1063 PREFIX_0F3833,
1064 PREFIX_0F3834,
1065 PREFIX_0F3835,
1066 PREFIX_0F3837,
1067 PREFIX_0F3838,
1068 PREFIX_0F3839,
1069 PREFIX_0F383A,
1070 PREFIX_0F383B,
1071 PREFIX_0F383C,
1072 PREFIX_0F383D,
1073 PREFIX_0F383E,
1074 PREFIX_0F383F,
1075 PREFIX_0F3840,
1076 PREFIX_0F3841,
1077 PREFIX_0F3880,
1078 PREFIX_0F3881,
6c30d220 1079 PREFIX_0F3882,
a0046408
L
1080 PREFIX_0F38C8,
1081 PREFIX_0F38C9,
1082 PREFIX_0F38CA,
1083 PREFIX_0F38CB,
1084 PREFIX_0F38CC,
1085 PREFIX_0F38CD,
48521003 1086 PREFIX_0F38CF,
3873ba12
L
1087 PREFIX_0F38DB,
1088 PREFIX_0F38DC,
1089 PREFIX_0F38DD,
1090 PREFIX_0F38DE,
1091 PREFIX_0F38DF,
1092 PREFIX_0F38F0,
1093 PREFIX_0F38F1,
603555e5 1094 PREFIX_0F38F5,
e2e1fcde 1095 PREFIX_0F38F6,
c0a30a9f
L
1096 PREFIX_0F38F8,
1097 PREFIX_0F38F9,
3873ba12
L
1098 PREFIX_0F3A08,
1099 PREFIX_0F3A09,
1100 PREFIX_0F3A0A,
1101 PREFIX_0F3A0B,
1102 PREFIX_0F3A0C,
1103 PREFIX_0F3A0D,
1104 PREFIX_0F3A0E,
1105 PREFIX_0F3A14,
1106 PREFIX_0F3A15,
1107 PREFIX_0F3A16,
1108 PREFIX_0F3A17,
1109 PREFIX_0F3A20,
1110 PREFIX_0F3A21,
1111 PREFIX_0F3A22,
1112 PREFIX_0F3A40,
1113 PREFIX_0F3A41,
1114 PREFIX_0F3A42,
1115 PREFIX_0F3A44,
1116 PREFIX_0F3A60,
1117 PREFIX_0F3A61,
1118 PREFIX_0F3A62,
1119 PREFIX_0F3A63,
a0046408 1120 PREFIX_0F3ACC,
48521003
IT
1121 PREFIX_0F3ACE,
1122 PREFIX_0F3ACF,
3873ba12 1123 PREFIX_0F3ADF,
592a252b
L
1124 PREFIX_VEX_0F10,
1125 PREFIX_VEX_0F11,
1126 PREFIX_VEX_0F12,
1127 PREFIX_VEX_0F16,
1128 PREFIX_VEX_0F2A,
1129 PREFIX_VEX_0F2C,
1130 PREFIX_VEX_0F2D,
1131 PREFIX_VEX_0F2E,
1132 PREFIX_VEX_0F2F,
43234a1e
L
1133 PREFIX_VEX_0F41,
1134 PREFIX_VEX_0F42,
1135 PREFIX_VEX_0F44,
1136 PREFIX_VEX_0F45,
1137 PREFIX_VEX_0F46,
1138 PREFIX_VEX_0F47,
1ba585e8 1139 PREFIX_VEX_0F4A,
43234a1e 1140 PREFIX_VEX_0F4B,
592a252b
L
1141 PREFIX_VEX_0F51,
1142 PREFIX_VEX_0F52,
1143 PREFIX_VEX_0F53,
1144 PREFIX_VEX_0F58,
1145 PREFIX_VEX_0F59,
1146 PREFIX_VEX_0F5A,
1147 PREFIX_VEX_0F5B,
1148 PREFIX_VEX_0F5C,
1149 PREFIX_VEX_0F5D,
1150 PREFIX_VEX_0F5E,
1151 PREFIX_VEX_0F5F,
1152 PREFIX_VEX_0F60,
1153 PREFIX_VEX_0F61,
1154 PREFIX_VEX_0F62,
1155 PREFIX_VEX_0F63,
1156 PREFIX_VEX_0F64,
1157 PREFIX_VEX_0F65,
1158 PREFIX_VEX_0F66,
1159 PREFIX_VEX_0F67,
1160 PREFIX_VEX_0F68,
1161 PREFIX_VEX_0F69,
1162 PREFIX_VEX_0F6A,
1163 PREFIX_VEX_0F6B,
1164 PREFIX_VEX_0F6C,
1165 PREFIX_VEX_0F6D,
1166 PREFIX_VEX_0F6E,
1167 PREFIX_VEX_0F6F,
1168 PREFIX_VEX_0F70,
1169 PREFIX_VEX_0F71_REG_2,
1170 PREFIX_VEX_0F71_REG_4,
1171 PREFIX_VEX_0F71_REG_6,
1172 PREFIX_VEX_0F72_REG_2,
1173 PREFIX_VEX_0F72_REG_4,
1174 PREFIX_VEX_0F72_REG_6,
1175 PREFIX_VEX_0F73_REG_2,
1176 PREFIX_VEX_0F73_REG_3,
1177 PREFIX_VEX_0F73_REG_6,
1178 PREFIX_VEX_0F73_REG_7,
1179 PREFIX_VEX_0F74,
1180 PREFIX_VEX_0F75,
1181 PREFIX_VEX_0F76,
1182 PREFIX_VEX_0F77,
1183 PREFIX_VEX_0F7C,
1184 PREFIX_VEX_0F7D,
1185 PREFIX_VEX_0F7E,
1186 PREFIX_VEX_0F7F,
43234a1e
L
1187 PREFIX_VEX_0F90,
1188 PREFIX_VEX_0F91,
1189 PREFIX_VEX_0F92,
1190 PREFIX_VEX_0F93,
1191 PREFIX_VEX_0F98,
1ba585e8 1192 PREFIX_VEX_0F99,
592a252b
L
1193 PREFIX_VEX_0FC2,
1194 PREFIX_VEX_0FC4,
1195 PREFIX_VEX_0FC5,
1196 PREFIX_VEX_0FD0,
1197 PREFIX_VEX_0FD1,
1198 PREFIX_VEX_0FD2,
1199 PREFIX_VEX_0FD3,
1200 PREFIX_VEX_0FD4,
1201 PREFIX_VEX_0FD5,
1202 PREFIX_VEX_0FD6,
1203 PREFIX_VEX_0FD7,
1204 PREFIX_VEX_0FD8,
1205 PREFIX_VEX_0FD9,
1206 PREFIX_VEX_0FDA,
1207 PREFIX_VEX_0FDB,
1208 PREFIX_VEX_0FDC,
1209 PREFIX_VEX_0FDD,
1210 PREFIX_VEX_0FDE,
1211 PREFIX_VEX_0FDF,
1212 PREFIX_VEX_0FE0,
1213 PREFIX_VEX_0FE1,
1214 PREFIX_VEX_0FE2,
1215 PREFIX_VEX_0FE3,
1216 PREFIX_VEX_0FE4,
1217 PREFIX_VEX_0FE5,
1218 PREFIX_VEX_0FE6,
1219 PREFIX_VEX_0FE7,
1220 PREFIX_VEX_0FE8,
1221 PREFIX_VEX_0FE9,
1222 PREFIX_VEX_0FEA,
1223 PREFIX_VEX_0FEB,
1224 PREFIX_VEX_0FEC,
1225 PREFIX_VEX_0FED,
1226 PREFIX_VEX_0FEE,
1227 PREFIX_VEX_0FEF,
1228 PREFIX_VEX_0FF0,
1229 PREFIX_VEX_0FF1,
1230 PREFIX_VEX_0FF2,
1231 PREFIX_VEX_0FF3,
1232 PREFIX_VEX_0FF4,
1233 PREFIX_VEX_0FF5,
1234 PREFIX_VEX_0FF6,
1235 PREFIX_VEX_0FF7,
1236 PREFIX_VEX_0FF8,
1237 PREFIX_VEX_0FF9,
1238 PREFIX_VEX_0FFA,
1239 PREFIX_VEX_0FFB,
1240 PREFIX_VEX_0FFC,
1241 PREFIX_VEX_0FFD,
1242 PREFIX_VEX_0FFE,
1243 PREFIX_VEX_0F3800,
1244 PREFIX_VEX_0F3801,
1245 PREFIX_VEX_0F3802,
1246 PREFIX_VEX_0F3803,
1247 PREFIX_VEX_0F3804,
1248 PREFIX_VEX_0F3805,
1249 PREFIX_VEX_0F3806,
1250 PREFIX_VEX_0F3807,
1251 PREFIX_VEX_0F3808,
1252 PREFIX_VEX_0F3809,
1253 PREFIX_VEX_0F380A,
1254 PREFIX_VEX_0F380B,
1255 PREFIX_VEX_0F380C,
1256 PREFIX_VEX_0F380D,
1257 PREFIX_VEX_0F380E,
1258 PREFIX_VEX_0F380F,
1259 PREFIX_VEX_0F3813,
6c30d220 1260 PREFIX_VEX_0F3816,
592a252b
L
1261 PREFIX_VEX_0F3817,
1262 PREFIX_VEX_0F3818,
1263 PREFIX_VEX_0F3819,
1264 PREFIX_VEX_0F381A,
1265 PREFIX_VEX_0F381C,
1266 PREFIX_VEX_0F381D,
1267 PREFIX_VEX_0F381E,
1268 PREFIX_VEX_0F3820,
1269 PREFIX_VEX_0F3821,
1270 PREFIX_VEX_0F3822,
1271 PREFIX_VEX_0F3823,
1272 PREFIX_VEX_0F3824,
1273 PREFIX_VEX_0F3825,
1274 PREFIX_VEX_0F3828,
1275 PREFIX_VEX_0F3829,
1276 PREFIX_VEX_0F382A,
1277 PREFIX_VEX_0F382B,
1278 PREFIX_VEX_0F382C,
1279 PREFIX_VEX_0F382D,
1280 PREFIX_VEX_0F382E,
1281 PREFIX_VEX_0F382F,
1282 PREFIX_VEX_0F3830,
1283 PREFIX_VEX_0F3831,
1284 PREFIX_VEX_0F3832,
1285 PREFIX_VEX_0F3833,
1286 PREFIX_VEX_0F3834,
1287 PREFIX_VEX_0F3835,
6c30d220 1288 PREFIX_VEX_0F3836,
592a252b
L
1289 PREFIX_VEX_0F3837,
1290 PREFIX_VEX_0F3838,
1291 PREFIX_VEX_0F3839,
1292 PREFIX_VEX_0F383A,
1293 PREFIX_VEX_0F383B,
1294 PREFIX_VEX_0F383C,
1295 PREFIX_VEX_0F383D,
1296 PREFIX_VEX_0F383E,
1297 PREFIX_VEX_0F383F,
1298 PREFIX_VEX_0F3840,
1299 PREFIX_VEX_0F3841,
6c30d220
L
1300 PREFIX_VEX_0F3845,
1301 PREFIX_VEX_0F3846,
1302 PREFIX_VEX_0F3847,
1303 PREFIX_VEX_0F3858,
1304 PREFIX_VEX_0F3859,
1305 PREFIX_VEX_0F385A,
1306 PREFIX_VEX_0F3878,
1307 PREFIX_VEX_0F3879,
1308 PREFIX_VEX_0F388C,
1309 PREFIX_VEX_0F388E,
1310 PREFIX_VEX_0F3890,
1311 PREFIX_VEX_0F3891,
1312 PREFIX_VEX_0F3892,
1313 PREFIX_VEX_0F3893,
592a252b
L
1314 PREFIX_VEX_0F3896,
1315 PREFIX_VEX_0F3897,
1316 PREFIX_VEX_0F3898,
1317 PREFIX_VEX_0F3899,
1318 PREFIX_VEX_0F389A,
1319 PREFIX_VEX_0F389B,
1320 PREFIX_VEX_0F389C,
1321 PREFIX_VEX_0F389D,
1322 PREFIX_VEX_0F389E,
1323 PREFIX_VEX_0F389F,
1324 PREFIX_VEX_0F38A6,
1325 PREFIX_VEX_0F38A7,
1326 PREFIX_VEX_0F38A8,
1327 PREFIX_VEX_0F38A9,
1328 PREFIX_VEX_0F38AA,
1329 PREFIX_VEX_0F38AB,
1330 PREFIX_VEX_0F38AC,
1331 PREFIX_VEX_0F38AD,
1332 PREFIX_VEX_0F38AE,
1333 PREFIX_VEX_0F38AF,
1334 PREFIX_VEX_0F38B6,
1335 PREFIX_VEX_0F38B7,
1336 PREFIX_VEX_0F38B8,
1337 PREFIX_VEX_0F38B9,
1338 PREFIX_VEX_0F38BA,
1339 PREFIX_VEX_0F38BB,
1340 PREFIX_VEX_0F38BC,
1341 PREFIX_VEX_0F38BD,
1342 PREFIX_VEX_0F38BE,
1343 PREFIX_VEX_0F38BF,
48521003 1344 PREFIX_VEX_0F38CF,
592a252b
L
1345 PREFIX_VEX_0F38DB,
1346 PREFIX_VEX_0F38DC,
1347 PREFIX_VEX_0F38DD,
1348 PREFIX_VEX_0F38DE,
1349 PREFIX_VEX_0F38DF,
f12dc422
L
1350 PREFIX_VEX_0F38F2,
1351 PREFIX_VEX_0F38F3_REG_1,
1352 PREFIX_VEX_0F38F3_REG_2,
1353 PREFIX_VEX_0F38F3_REG_3,
6c30d220
L
1354 PREFIX_VEX_0F38F5,
1355 PREFIX_VEX_0F38F6,
f12dc422 1356 PREFIX_VEX_0F38F7,
6c30d220
L
1357 PREFIX_VEX_0F3A00,
1358 PREFIX_VEX_0F3A01,
1359 PREFIX_VEX_0F3A02,
592a252b
L
1360 PREFIX_VEX_0F3A04,
1361 PREFIX_VEX_0F3A05,
1362 PREFIX_VEX_0F3A06,
1363 PREFIX_VEX_0F3A08,
1364 PREFIX_VEX_0F3A09,
1365 PREFIX_VEX_0F3A0A,
1366 PREFIX_VEX_0F3A0B,
1367 PREFIX_VEX_0F3A0C,
1368 PREFIX_VEX_0F3A0D,
1369 PREFIX_VEX_0F3A0E,
1370 PREFIX_VEX_0F3A0F,
1371 PREFIX_VEX_0F3A14,
1372 PREFIX_VEX_0F3A15,
1373 PREFIX_VEX_0F3A16,
1374 PREFIX_VEX_0F3A17,
1375 PREFIX_VEX_0F3A18,
1376 PREFIX_VEX_0F3A19,
1377 PREFIX_VEX_0F3A1D,
1378 PREFIX_VEX_0F3A20,
1379 PREFIX_VEX_0F3A21,
1380 PREFIX_VEX_0F3A22,
43234a1e 1381 PREFIX_VEX_0F3A30,
1ba585e8 1382 PREFIX_VEX_0F3A31,
43234a1e 1383 PREFIX_VEX_0F3A32,
1ba585e8 1384 PREFIX_VEX_0F3A33,
6c30d220
L
1385 PREFIX_VEX_0F3A38,
1386 PREFIX_VEX_0F3A39,
592a252b
L
1387 PREFIX_VEX_0F3A40,
1388 PREFIX_VEX_0F3A41,
1389 PREFIX_VEX_0F3A42,
1390 PREFIX_VEX_0F3A44,
6c30d220 1391 PREFIX_VEX_0F3A46,
592a252b
L
1392 PREFIX_VEX_0F3A48,
1393 PREFIX_VEX_0F3A49,
1394 PREFIX_VEX_0F3A4A,
1395 PREFIX_VEX_0F3A4B,
1396 PREFIX_VEX_0F3A4C,
1397 PREFIX_VEX_0F3A5C,
1398 PREFIX_VEX_0F3A5D,
1399 PREFIX_VEX_0F3A5E,
1400 PREFIX_VEX_0F3A5F,
1401 PREFIX_VEX_0F3A60,
1402 PREFIX_VEX_0F3A61,
1403 PREFIX_VEX_0F3A62,
1404 PREFIX_VEX_0F3A63,
1405 PREFIX_VEX_0F3A68,
1406 PREFIX_VEX_0F3A69,
1407 PREFIX_VEX_0F3A6A,
1408 PREFIX_VEX_0F3A6B,
1409 PREFIX_VEX_0F3A6C,
1410 PREFIX_VEX_0F3A6D,
1411 PREFIX_VEX_0F3A6E,
1412 PREFIX_VEX_0F3A6F,
1413 PREFIX_VEX_0F3A78,
1414 PREFIX_VEX_0F3A79,
1415 PREFIX_VEX_0F3A7A,
1416 PREFIX_VEX_0F3A7B,
1417 PREFIX_VEX_0F3A7C,
1418 PREFIX_VEX_0F3A7D,
1419 PREFIX_VEX_0F3A7E,
1420 PREFIX_VEX_0F3A7F,
48521003
IT
1421 PREFIX_VEX_0F3ACE,
1422 PREFIX_VEX_0F3ACF,
6c30d220 1423 PREFIX_VEX_0F3ADF,
43234a1e
L
1424 PREFIX_VEX_0F3AF0,
1425
1426 PREFIX_EVEX_0F10,
1427 PREFIX_EVEX_0F11,
1428 PREFIX_EVEX_0F12,
1429 PREFIX_EVEX_0F13,
1430 PREFIX_EVEX_0F14,
1431 PREFIX_EVEX_0F15,
1432 PREFIX_EVEX_0F16,
1433 PREFIX_EVEX_0F17,
1434 PREFIX_EVEX_0F28,
1435 PREFIX_EVEX_0F29,
1436 PREFIX_EVEX_0F2A,
1437 PREFIX_EVEX_0F2B,
1438 PREFIX_EVEX_0F2C,
1439 PREFIX_EVEX_0F2D,
1440 PREFIX_EVEX_0F2E,
1441 PREFIX_EVEX_0F2F,
1442 PREFIX_EVEX_0F51,
90a915bf
IT
1443 PREFIX_EVEX_0F54,
1444 PREFIX_EVEX_0F55,
1445 PREFIX_EVEX_0F56,
1446 PREFIX_EVEX_0F57,
43234a1e
L
1447 PREFIX_EVEX_0F58,
1448 PREFIX_EVEX_0F59,
1449 PREFIX_EVEX_0F5A,
1450 PREFIX_EVEX_0F5B,
1451 PREFIX_EVEX_0F5C,
1452 PREFIX_EVEX_0F5D,
1453 PREFIX_EVEX_0F5E,
1454 PREFIX_EVEX_0F5F,
1ba585e8
IT
1455 PREFIX_EVEX_0F60,
1456 PREFIX_EVEX_0F61,
43234a1e 1457 PREFIX_EVEX_0F62,
1ba585e8
IT
1458 PREFIX_EVEX_0F63,
1459 PREFIX_EVEX_0F64,
1460 PREFIX_EVEX_0F65,
43234a1e 1461 PREFIX_EVEX_0F66,
1ba585e8
IT
1462 PREFIX_EVEX_0F67,
1463 PREFIX_EVEX_0F68,
1464 PREFIX_EVEX_0F69,
43234a1e 1465 PREFIX_EVEX_0F6A,
1ba585e8 1466 PREFIX_EVEX_0F6B,
43234a1e
L
1467 PREFIX_EVEX_0F6C,
1468 PREFIX_EVEX_0F6D,
1469 PREFIX_EVEX_0F6E,
1470 PREFIX_EVEX_0F6F,
1471 PREFIX_EVEX_0F70,
1ba585e8
IT
1472 PREFIX_EVEX_0F71_REG_2,
1473 PREFIX_EVEX_0F71_REG_4,
1474 PREFIX_EVEX_0F71_REG_6,
43234a1e
L
1475 PREFIX_EVEX_0F72_REG_0,
1476 PREFIX_EVEX_0F72_REG_1,
1477 PREFIX_EVEX_0F72_REG_2,
1478 PREFIX_EVEX_0F72_REG_4,
1479 PREFIX_EVEX_0F72_REG_6,
1480 PREFIX_EVEX_0F73_REG_2,
1ba585e8 1481 PREFIX_EVEX_0F73_REG_3,
43234a1e 1482 PREFIX_EVEX_0F73_REG_6,
1ba585e8
IT
1483 PREFIX_EVEX_0F73_REG_7,
1484 PREFIX_EVEX_0F74,
1485 PREFIX_EVEX_0F75,
43234a1e
L
1486 PREFIX_EVEX_0F76,
1487 PREFIX_EVEX_0F78,
1488 PREFIX_EVEX_0F79,
1489 PREFIX_EVEX_0F7A,
1490 PREFIX_EVEX_0F7B,
1491 PREFIX_EVEX_0F7E,
1492 PREFIX_EVEX_0F7F,
1493 PREFIX_EVEX_0FC2,
1ba585e8
IT
1494 PREFIX_EVEX_0FC4,
1495 PREFIX_EVEX_0FC5,
43234a1e 1496 PREFIX_EVEX_0FC6,
1ba585e8 1497 PREFIX_EVEX_0FD1,
43234a1e
L
1498 PREFIX_EVEX_0FD2,
1499 PREFIX_EVEX_0FD3,
1500 PREFIX_EVEX_0FD4,
1ba585e8 1501 PREFIX_EVEX_0FD5,
43234a1e 1502 PREFIX_EVEX_0FD6,
1ba585e8
IT
1503 PREFIX_EVEX_0FD8,
1504 PREFIX_EVEX_0FD9,
1505 PREFIX_EVEX_0FDA,
43234a1e 1506 PREFIX_EVEX_0FDB,
1ba585e8
IT
1507 PREFIX_EVEX_0FDC,
1508 PREFIX_EVEX_0FDD,
1509 PREFIX_EVEX_0FDE,
43234a1e 1510 PREFIX_EVEX_0FDF,
1ba585e8
IT
1511 PREFIX_EVEX_0FE0,
1512 PREFIX_EVEX_0FE1,
43234a1e 1513 PREFIX_EVEX_0FE2,
1ba585e8
IT
1514 PREFIX_EVEX_0FE3,
1515 PREFIX_EVEX_0FE4,
1516 PREFIX_EVEX_0FE5,
43234a1e
L
1517 PREFIX_EVEX_0FE6,
1518 PREFIX_EVEX_0FE7,
1ba585e8
IT
1519 PREFIX_EVEX_0FE8,
1520 PREFIX_EVEX_0FE9,
1521 PREFIX_EVEX_0FEA,
43234a1e 1522 PREFIX_EVEX_0FEB,
1ba585e8
IT
1523 PREFIX_EVEX_0FEC,
1524 PREFIX_EVEX_0FED,
1525 PREFIX_EVEX_0FEE,
43234a1e 1526 PREFIX_EVEX_0FEF,
1ba585e8 1527 PREFIX_EVEX_0FF1,
43234a1e
L
1528 PREFIX_EVEX_0FF2,
1529 PREFIX_EVEX_0FF3,
1530 PREFIX_EVEX_0FF4,
1ba585e8
IT
1531 PREFIX_EVEX_0FF5,
1532 PREFIX_EVEX_0FF6,
1533 PREFIX_EVEX_0FF8,
1534 PREFIX_EVEX_0FF9,
43234a1e
L
1535 PREFIX_EVEX_0FFA,
1536 PREFIX_EVEX_0FFB,
1ba585e8
IT
1537 PREFIX_EVEX_0FFC,
1538 PREFIX_EVEX_0FFD,
43234a1e 1539 PREFIX_EVEX_0FFE,
1ba585e8
IT
1540 PREFIX_EVEX_0F3800,
1541 PREFIX_EVEX_0F3804,
1542 PREFIX_EVEX_0F380B,
43234a1e
L
1543 PREFIX_EVEX_0F380C,
1544 PREFIX_EVEX_0F380D,
1ba585e8 1545 PREFIX_EVEX_0F3810,
43234a1e
L
1546 PREFIX_EVEX_0F3811,
1547 PREFIX_EVEX_0F3812,
1548 PREFIX_EVEX_0F3813,
1549 PREFIX_EVEX_0F3814,
1550 PREFIX_EVEX_0F3815,
1551 PREFIX_EVEX_0F3816,
1552 PREFIX_EVEX_0F3818,
1553 PREFIX_EVEX_0F3819,
1554 PREFIX_EVEX_0F381A,
1555 PREFIX_EVEX_0F381B,
1ba585e8
IT
1556 PREFIX_EVEX_0F381C,
1557 PREFIX_EVEX_0F381D,
43234a1e
L
1558 PREFIX_EVEX_0F381E,
1559 PREFIX_EVEX_0F381F,
1ba585e8 1560 PREFIX_EVEX_0F3820,
43234a1e
L
1561 PREFIX_EVEX_0F3821,
1562 PREFIX_EVEX_0F3822,
1563 PREFIX_EVEX_0F3823,
1564 PREFIX_EVEX_0F3824,
1565 PREFIX_EVEX_0F3825,
1ba585e8 1566 PREFIX_EVEX_0F3826,
43234a1e
L
1567 PREFIX_EVEX_0F3827,
1568 PREFIX_EVEX_0F3828,
1569 PREFIX_EVEX_0F3829,
1570 PREFIX_EVEX_0F382A,
1ba585e8 1571 PREFIX_EVEX_0F382B,
43234a1e
L
1572 PREFIX_EVEX_0F382C,
1573 PREFIX_EVEX_0F382D,
1ba585e8 1574 PREFIX_EVEX_0F3830,
43234a1e
L
1575 PREFIX_EVEX_0F3831,
1576 PREFIX_EVEX_0F3832,
1577 PREFIX_EVEX_0F3833,
1578 PREFIX_EVEX_0F3834,
1579 PREFIX_EVEX_0F3835,
1580 PREFIX_EVEX_0F3836,
1581 PREFIX_EVEX_0F3837,
1ba585e8 1582 PREFIX_EVEX_0F3838,
43234a1e
L
1583 PREFIX_EVEX_0F3839,
1584 PREFIX_EVEX_0F383A,
1585 PREFIX_EVEX_0F383B,
1ba585e8 1586 PREFIX_EVEX_0F383C,
43234a1e 1587 PREFIX_EVEX_0F383D,
1ba585e8 1588 PREFIX_EVEX_0F383E,
43234a1e
L
1589 PREFIX_EVEX_0F383F,
1590 PREFIX_EVEX_0F3840,
1591 PREFIX_EVEX_0F3842,
1592 PREFIX_EVEX_0F3843,
1593 PREFIX_EVEX_0F3844,
1594 PREFIX_EVEX_0F3845,
1595 PREFIX_EVEX_0F3846,
1596 PREFIX_EVEX_0F3847,
1597 PREFIX_EVEX_0F384C,
1598 PREFIX_EVEX_0F384D,
1599 PREFIX_EVEX_0F384E,
1600 PREFIX_EVEX_0F384F,
8cfcb765
IT
1601 PREFIX_EVEX_0F3850,
1602 PREFIX_EVEX_0F3851,
47acf0bd
IT
1603 PREFIX_EVEX_0F3852,
1604 PREFIX_EVEX_0F3853,
ee6872be 1605 PREFIX_EVEX_0F3854,
620214f7 1606 PREFIX_EVEX_0F3855,
43234a1e
L
1607 PREFIX_EVEX_0F3858,
1608 PREFIX_EVEX_0F3859,
1609 PREFIX_EVEX_0F385A,
1610 PREFIX_EVEX_0F385B,
53467f57
IT
1611 PREFIX_EVEX_0F3862,
1612 PREFIX_EVEX_0F3863,
43234a1e
L
1613 PREFIX_EVEX_0F3864,
1614 PREFIX_EVEX_0F3865,
1ba585e8 1615 PREFIX_EVEX_0F3866,
9186c494 1616 PREFIX_EVEX_0F3868,
53467f57
IT
1617 PREFIX_EVEX_0F3870,
1618 PREFIX_EVEX_0F3871,
1619 PREFIX_EVEX_0F3872,
1620 PREFIX_EVEX_0F3873,
1ba585e8 1621 PREFIX_EVEX_0F3875,
43234a1e
L
1622 PREFIX_EVEX_0F3876,
1623 PREFIX_EVEX_0F3877,
1ba585e8
IT
1624 PREFIX_EVEX_0F3878,
1625 PREFIX_EVEX_0F3879,
1626 PREFIX_EVEX_0F387A,
1627 PREFIX_EVEX_0F387B,
43234a1e 1628 PREFIX_EVEX_0F387C,
1ba585e8 1629 PREFIX_EVEX_0F387D,
43234a1e
L
1630 PREFIX_EVEX_0F387E,
1631 PREFIX_EVEX_0F387F,
14f195c9 1632 PREFIX_EVEX_0F3883,
43234a1e
L
1633 PREFIX_EVEX_0F3888,
1634 PREFIX_EVEX_0F3889,
1635 PREFIX_EVEX_0F388A,
1636 PREFIX_EVEX_0F388B,
1ba585e8 1637 PREFIX_EVEX_0F388D,
ee6872be 1638 PREFIX_EVEX_0F388F,
43234a1e
L
1639 PREFIX_EVEX_0F3890,
1640 PREFIX_EVEX_0F3891,
1641 PREFIX_EVEX_0F3892,
1642 PREFIX_EVEX_0F3893,
1643 PREFIX_EVEX_0F3896,
1644 PREFIX_EVEX_0F3897,
1645 PREFIX_EVEX_0F3898,
1646 PREFIX_EVEX_0F3899,
1647 PREFIX_EVEX_0F389A,
1648 PREFIX_EVEX_0F389B,
1649 PREFIX_EVEX_0F389C,
1650 PREFIX_EVEX_0F389D,
1651 PREFIX_EVEX_0F389E,
1652 PREFIX_EVEX_0F389F,
1653 PREFIX_EVEX_0F38A0,
1654 PREFIX_EVEX_0F38A1,
1655 PREFIX_EVEX_0F38A2,
1656 PREFIX_EVEX_0F38A3,
1657 PREFIX_EVEX_0F38A6,
1658 PREFIX_EVEX_0F38A7,
1659 PREFIX_EVEX_0F38A8,
1660 PREFIX_EVEX_0F38A9,
1661 PREFIX_EVEX_0F38AA,
1662 PREFIX_EVEX_0F38AB,
1663 PREFIX_EVEX_0F38AC,
1664 PREFIX_EVEX_0F38AD,
1665 PREFIX_EVEX_0F38AE,
1666 PREFIX_EVEX_0F38AF,
2cc1b5aa
IT
1667 PREFIX_EVEX_0F38B4,
1668 PREFIX_EVEX_0F38B5,
43234a1e
L
1669 PREFIX_EVEX_0F38B6,
1670 PREFIX_EVEX_0F38B7,
1671 PREFIX_EVEX_0F38B8,
1672 PREFIX_EVEX_0F38B9,
1673 PREFIX_EVEX_0F38BA,
1674 PREFIX_EVEX_0F38BB,
1675 PREFIX_EVEX_0F38BC,
1676 PREFIX_EVEX_0F38BD,
1677 PREFIX_EVEX_0F38BE,
1678 PREFIX_EVEX_0F38BF,
1679 PREFIX_EVEX_0F38C4,
1680 PREFIX_EVEX_0F38C6_REG_1,
1681 PREFIX_EVEX_0F38C6_REG_2,
1682 PREFIX_EVEX_0F38C6_REG_5,
1683 PREFIX_EVEX_0F38C6_REG_6,
1684 PREFIX_EVEX_0F38C7_REG_1,
1685 PREFIX_EVEX_0F38C7_REG_2,
1686 PREFIX_EVEX_0F38C7_REG_5,
1687 PREFIX_EVEX_0F38C7_REG_6,
1688 PREFIX_EVEX_0F38C8,
1689 PREFIX_EVEX_0F38CA,
1690 PREFIX_EVEX_0F38CB,
1691 PREFIX_EVEX_0F38CC,
1692 PREFIX_EVEX_0F38CD,
48521003 1693 PREFIX_EVEX_0F38CF,
8dcf1fad
IT
1694 PREFIX_EVEX_0F38DC,
1695 PREFIX_EVEX_0F38DD,
1696 PREFIX_EVEX_0F38DE,
1697 PREFIX_EVEX_0F38DF,
43234a1e
L
1698
1699 PREFIX_EVEX_0F3A00,
1700 PREFIX_EVEX_0F3A01,
1701 PREFIX_EVEX_0F3A03,
1702 PREFIX_EVEX_0F3A04,
1703 PREFIX_EVEX_0F3A05,
1704 PREFIX_EVEX_0F3A08,
1705 PREFIX_EVEX_0F3A09,
1706 PREFIX_EVEX_0F3A0A,
1707 PREFIX_EVEX_0F3A0B,
1ba585e8
IT
1708 PREFIX_EVEX_0F3A0F,
1709 PREFIX_EVEX_0F3A14,
1710 PREFIX_EVEX_0F3A15,
90a915bf 1711 PREFIX_EVEX_0F3A16,
43234a1e
L
1712 PREFIX_EVEX_0F3A17,
1713 PREFIX_EVEX_0F3A18,
1714 PREFIX_EVEX_0F3A19,
1715 PREFIX_EVEX_0F3A1A,
1716 PREFIX_EVEX_0F3A1B,
1717 PREFIX_EVEX_0F3A1D,
1718 PREFIX_EVEX_0F3A1E,
1719 PREFIX_EVEX_0F3A1F,
1ba585e8 1720 PREFIX_EVEX_0F3A20,
43234a1e 1721 PREFIX_EVEX_0F3A21,
90a915bf 1722 PREFIX_EVEX_0F3A22,
43234a1e
L
1723 PREFIX_EVEX_0F3A23,
1724 PREFIX_EVEX_0F3A25,
1725 PREFIX_EVEX_0F3A26,
1726 PREFIX_EVEX_0F3A27,
1727 PREFIX_EVEX_0F3A38,
1728 PREFIX_EVEX_0F3A39,
1729 PREFIX_EVEX_0F3A3A,
1730 PREFIX_EVEX_0F3A3B,
1ba585e8
IT
1731 PREFIX_EVEX_0F3A3E,
1732 PREFIX_EVEX_0F3A3F,
1733 PREFIX_EVEX_0F3A42,
43234a1e 1734 PREFIX_EVEX_0F3A43,
ff1982d5 1735 PREFIX_EVEX_0F3A44,
90a915bf
IT
1736 PREFIX_EVEX_0F3A50,
1737 PREFIX_EVEX_0F3A51,
43234a1e 1738 PREFIX_EVEX_0F3A54,
90a915bf
IT
1739 PREFIX_EVEX_0F3A55,
1740 PREFIX_EVEX_0F3A56,
1741 PREFIX_EVEX_0F3A57,
1742 PREFIX_EVEX_0F3A66,
53467f57
IT
1743 PREFIX_EVEX_0F3A67,
1744 PREFIX_EVEX_0F3A70,
1745 PREFIX_EVEX_0F3A71,
1746 PREFIX_EVEX_0F3A72,
48521003
IT
1747 PREFIX_EVEX_0F3A73,
1748 PREFIX_EVEX_0F3ACE,
1749 PREFIX_EVEX_0F3ACF
51e7da1b 1750};
4e7d34a6 1751
51e7da1b
L
1752enum
1753{
1754 X86_64_06 = 0,
3873ba12
L
1755 X86_64_07,
1756 X86_64_0D,
1757 X86_64_16,
1758 X86_64_17,
1759 X86_64_1E,
1760 X86_64_1F,
1761 X86_64_27,
1762 X86_64_2F,
1763 X86_64_37,
1764 X86_64_3F,
1765 X86_64_60,
1766 X86_64_61,
1767 X86_64_62,
1768 X86_64_63,
1769 X86_64_6D,
1770 X86_64_6F,
d039fef3 1771 X86_64_82,
3873ba12
L
1772 X86_64_9A,
1773 X86_64_C4,
1774 X86_64_C5,
1775 X86_64_CE,
1776 X86_64_D4,
1777 X86_64_D5,
a72d2af2
L
1778 X86_64_E8,
1779 X86_64_E9,
3873ba12
L
1780 X86_64_EA,
1781 X86_64_0F01_REG_0,
1782 X86_64_0F01_REG_1,
1783 X86_64_0F01_REG_2,
1784 X86_64_0F01_REG_3
51e7da1b 1785};
4e7d34a6 1786
51e7da1b
L
1787enum
1788{
1789 THREE_BYTE_0F38 = 0,
1f334aeb 1790 THREE_BYTE_0F3A
51e7da1b 1791};
4e7d34a6 1792
f88c9eb0
SP
1793enum
1794{
5dd85c99
SP
1795 XOP_08 = 0,
1796 XOP_09,
f88c9eb0
SP
1797 XOP_0A
1798};
1799
51e7da1b
L
1800enum
1801{
1802 VEX_0F = 0,
3873ba12
L
1803 VEX_0F38,
1804 VEX_0F3A
51e7da1b 1805};
c0f3af97 1806
43234a1e
L
1807enum
1808{
1809 EVEX_0F = 0,
1810 EVEX_0F38,
1811 EVEX_0F3A
1812};
1813
51e7da1b
L
1814enum
1815{
ec6f095a 1816 VEX_LEN_0F12_P_0_M_0 = 0,
592a252b
L
1817 VEX_LEN_0F12_P_0_M_1,
1818 VEX_LEN_0F12_P_2,
1819 VEX_LEN_0F13_M_0,
1820 VEX_LEN_0F16_P_0_M_0,
1821 VEX_LEN_0F16_P_0_M_1,
1822 VEX_LEN_0F16_P_2,
1823 VEX_LEN_0F17_M_0,
1824 VEX_LEN_0F2A_P_1,
1825 VEX_LEN_0F2A_P_3,
1826 VEX_LEN_0F2C_P_1,
1827 VEX_LEN_0F2C_P_3,
1828 VEX_LEN_0F2D_P_1,
1829 VEX_LEN_0F2D_P_3,
43234a1e 1830 VEX_LEN_0F41_P_0,
1ba585e8 1831 VEX_LEN_0F41_P_2,
43234a1e 1832 VEX_LEN_0F42_P_0,
1ba585e8 1833 VEX_LEN_0F42_P_2,
43234a1e 1834 VEX_LEN_0F44_P_0,
1ba585e8 1835 VEX_LEN_0F44_P_2,
43234a1e 1836 VEX_LEN_0F45_P_0,
1ba585e8 1837 VEX_LEN_0F45_P_2,
43234a1e 1838 VEX_LEN_0F46_P_0,
1ba585e8 1839 VEX_LEN_0F46_P_2,
43234a1e 1840 VEX_LEN_0F47_P_0,
1ba585e8
IT
1841 VEX_LEN_0F47_P_2,
1842 VEX_LEN_0F4A_P_0,
1843 VEX_LEN_0F4A_P_2,
1844 VEX_LEN_0F4B_P_0,
43234a1e 1845 VEX_LEN_0F4B_P_2,
592a252b 1846 VEX_LEN_0F6E_P_2,
ec6f095a 1847 VEX_LEN_0F77_P_0,
592a252b
L
1848 VEX_LEN_0F7E_P_1,
1849 VEX_LEN_0F7E_P_2,
43234a1e 1850 VEX_LEN_0F90_P_0,
1ba585e8 1851 VEX_LEN_0F90_P_2,
43234a1e 1852 VEX_LEN_0F91_P_0,
1ba585e8 1853 VEX_LEN_0F91_P_2,
43234a1e 1854 VEX_LEN_0F92_P_0,
90a915bf 1855 VEX_LEN_0F92_P_2,
1ba585e8 1856 VEX_LEN_0F92_P_3,
43234a1e 1857 VEX_LEN_0F93_P_0,
90a915bf 1858 VEX_LEN_0F93_P_2,
1ba585e8 1859 VEX_LEN_0F93_P_3,
43234a1e 1860 VEX_LEN_0F98_P_0,
1ba585e8
IT
1861 VEX_LEN_0F98_P_2,
1862 VEX_LEN_0F99_P_0,
1863 VEX_LEN_0F99_P_2,
592a252b
L
1864 VEX_LEN_0FAE_R_2_M_0,
1865 VEX_LEN_0FAE_R_3_M_0,
592a252b
L
1866 VEX_LEN_0FC4_P_2,
1867 VEX_LEN_0FC5_P_2,
592a252b 1868 VEX_LEN_0FD6_P_2,
592a252b 1869 VEX_LEN_0FF7_P_2,
6c30d220
L
1870 VEX_LEN_0F3816_P_2,
1871 VEX_LEN_0F3819_P_2,
592a252b 1872 VEX_LEN_0F381A_P_2_M_0,
6c30d220 1873 VEX_LEN_0F3836_P_2,
592a252b 1874 VEX_LEN_0F3841_P_2,
6c30d220 1875 VEX_LEN_0F385A_P_2_M_0,
592a252b 1876 VEX_LEN_0F38DB_P_2,
f12dc422
L
1877 VEX_LEN_0F38F2_P_0,
1878 VEX_LEN_0F38F3_R_1_P_0,
1879 VEX_LEN_0F38F3_R_2_P_0,
1880 VEX_LEN_0F38F3_R_3_P_0,
6c30d220
L
1881 VEX_LEN_0F38F5_P_0,
1882 VEX_LEN_0F38F5_P_1,
1883 VEX_LEN_0F38F5_P_3,
1884 VEX_LEN_0F38F6_P_3,
f12dc422 1885 VEX_LEN_0F38F7_P_0,
6c30d220
L
1886 VEX_LEN_0F38F7_P_1,
1887 VEX_LEN_0F38F7_P_2,
1888 VEX_LEN_0F38F7_P_3,
1889 VEX_LEN_0F3A00_P_2,
1890 VEX_LEN_0F3A01_P_2,
592a252b 1891 VEX_LEN_0F3A06_P_2,
592a252b
L
1892 VEX_LEN_0F3A14_P_2,
1893 VEX_LEN_0F3A15_P_2,
1894 VEX_LEN_0F3A16_P_2,
1895 VEX_LEN_0F3A17_P_2,
1896 VEX_LEN_0F3A18_P_2,
1897 VEX_LEN_0F3A19_P_2,
1898 VEX_LEN_0F3A20_P_2,
1899 VEX_LEN_0F3A21_P_2,
1900 VEX_LEN_0F3A22_P_2,
43234a1e 1901 VEX_LEN_0F3A30_P_2,
1ba585e8 1902 VEX_LEN_0F3A31_P_2,
43234a1e 1903 VEX_LEN_0F3A32_P_2,
1ba585e8 1904 VEX_LEN_0F3A33_P_2,
6c30d220
L
1905 VEX_LEN_0F3A38_P_2,
1906 VEX_LEN_0F3A39_P_2,
592a252b 1907 VEX_LEN_0F3A41_P_2,
6c30d220 1908 VEX_LEN_0F3A46_P_2,
592a252b
L
1909 VEX_LEN_0F3A60_P_2,
1910 VEX_LEN_0F3A61_P_2,
1911 VEX_LEN_0F3A62_P_2,
1912 VEX_LEN_0F3A63_P_2,
1913 VEX_LEN_0F3A6A_P_2,
1914 VEX_LEN_0F3A6B_P_2,
1915 VEX_LEN_0F3A6E_P_2,
1916 VEX_LEN_0F3A6F_P_2,
1917 VEX_LEN_0F3A7A_P_2,
1918 VEX_LEN_0F3A7B_P_2,
1919 VEX_LEN_0F3A7E_P_2,
1920 VEX_LEN_0F3A7F_P_2,
1921 VEX_LEN_0F3ADF_P_2,
6c30d220 1922 VEX_LEN_0F3AF0_P_3,
ff688e1f
L
1923 VEX_LEN_0FXOP_08_CC,
1924 VEX_LEN_0FXOP_08_CD,
1925 VEX_LEN_0FXOP_08_CE,
1926 VEX_LEN_0FXOP_08_CF,
1927 VEX_LEN_0FXOP_08_EC,
1928 VEX_LEN_0FXOP_08_ED,
1929 VEX_LEN_0FXOP_08_EE,
1930 VEX_LEN_0FXOP_08_EF,
592a252b
L
1931 VEX_LEN_0FXOP_09_80,
1932 VEX_LEN_0FXOP_09_81
51e7da1b 1933};
c0f3af97 1934
04e2a182
L
1935enum
1936{
1937 EVEX_LEN_0F6E_P_2 = 0,
1938 EVEX_LEN_0F7E_P_1,
1939 EVEX_LEN_0F7E_P_2,
12efd68d
L
1940 EVEX_LEN_0FD6_P_2,
1941 EVEX_LEN_0F3A18_P_2_W_0,
1942 EVEX_LEN_0F3A18_P_2_W_1,
1943 EVEX_LEN_0F3A19_P_2_W_0,
1944 EVEX_LEN_0F3A19_P_2_W_1,
1945 EVEX_LEN_0F3A1A_P_2_W_0,
1946 EVEX_LEN_0F3A1A_P_2_W_1,
1947 EVEX_LEN_0F3A1B_P_2_W_0,
6e1c90b7
L
1948 EVEX_LEN_0F3A1B_P_2_W_1,
1949 EVEX_LEN_0F3A23_P_2_W_0,
1950 EVEX_LEN_0F3A23_P_2_W_1,
1951 EVEX_LEN_0F3A38_P_2_W_0,
1952 EVEX_LEN_0F3A38_P_2_W_1,
1953 EVEX_LEN_0F3A39_P_2_W_0,
1954 EVEX_LEN_0F3A39_P_2_W_1,
1955 EVEX_LEN_0F3A3A_P_2_W_0,
1956 EVEX_LEN_0F3A3A_P_2_W_1,
1957 EVEX_LEN_0F3A3B_P_2_W_0,
1958 EVEX_LEN_0F3A3B_P_2_W_1,
1959 EVEX_LEN_0F3A43_P_2_W_0,
1960 EVEX_LEN_0F3A43_P_2_W_1
04e2a182
L
1961};
1962
9e30b8e0
L
1963enum
1964{
ec6f095a 1965 VEX_W_0F41_P_0_LEN_1 = 0,
1ba585e8 1966 VEX_W_0F41_P_2_LEN_1,
43234a1e 1967 VEX_W_0F42_P_0_LEN_1,
1ba585e8 1968 VEX_W_0F42_P_2_LEN_1,
43234a1e 1969 VEX_W_0F44_P_0_LEN_0,
1ba585e8 1970 VEX_W_0F44_P_2_LEN_0,
43234a1e 1971 VEX_W_0F45_P_0_LEN_1,
1ba585e8 1972 VEX_W_0F45_P_2_LEN_1,
43234a1e 1973 VEX_W_0F46_P_0_LEN_1,
1ba585e8 1974 VEX_W_0F46_P_2_LEN_1,
43234a1e 1975 VEX_W_0F47_P_0_LEN_1,
1ba585e8
IT
1976 VEX_W_0F47_P_2_LEN_1,
1977 VEX_W_0F4A_P_0_LEN_1,
1978 VEX_W_0F4A_P_2_LEN_1,
1979 VEX_W_0F4B_P_0_LEN_1,
43234a1e 1980 VEX_W_0F4B_P_2_LEN_1,
43234a1e 1981 VEX_W_0F90_P_0_LEN_0,
1ba585e8 1982 VEX_W_0F90_P_2_LEN_0,
43234a1e 1983 VEX_W_0F91_P_0_LEN_0,
1ba585e8 1984 VEX_W_0F91_P_2_LEN_0,
43234a1e 1985 VEX_W_0F92_P_0_LEN_0,
90a915bf 1986 VEX_W_0F92_P_2_LEN_0,
43234a1e 1987 VEX_W_0F93_P_0_LEN_0,
90a915bf 1988 VEX_W_0F93_P_2_LEN_0,
43234a1e 1989 VEX_W_0F98_P_0_LEN_0,
1ba585e8
IT
1990 VEX_W_0F98_P_2_LEN_0,
1991 VEX_W_0F99_P_0_LEN_0,
1992 VEX_W_0F99_P_2_LEN_0,
592a252b
L
1993 VEX_W_0F380C_P_2,
1994 VEX_W_0F380D_P_2,
1995 VEX_W_0F380E_P_2,
1996 VEX_W_0F380F_P_2,
6c30d220 1997 VEX_W_0F3816_P_2,
6c30d220
L
1998 VEX_W_0F3818_P_2,
1999 VEX_W_0F3819_P_2,
592a252b 2000 VEX_W_0F381A_P_2_M_0,
592a252b
L
2001 VEX_W_0F382C_P_2_M_0,
2002 VEX_W_0F382D_P_2_M_0,
2003 VEX_W_0F382E_P_2_M_0,
2004 VEX_W_0F382F_P_2_M_0,
6c30d220 2005 VEX_W_0F3836_P_2,
6c30d220
L
2006 VEX_W_0F3846_P_2,
2007 VEX_W_0F3858_P_2,
2008 VEX_W_0F3859_P_2,
2009 VEX_W_0F385A_P_2_M_0,
2010 VEX_W_0F3878_P_2,
2011 VEX_W_0F3879_P_2,
48521003 2012 VEX_W_0F38CF_P_2,
6c30d220
L
2013 VEX_W_0F3A00_P_2,
2014 VEX_W_0F3A01_P_2,
2015 VEX_W_0F3A02_P_2,
592a252b
L
2016 VEX_W_0F3A04_P_2,
2017 VEX_W_0F3A05_P_2,
2018 VEX_W_0F3A06_P_2,
592a252b
L
2019 VEX_W_0F3A18_P_2,
2020 VEX_W_0F3A19_P_2,
43234a1e 2021 VEX_W_0F3A30_P_2_LEN_0,
1ba585e8 2022 VEX_W_0F3A31_P_2_LEN_0,
43234a1e 2023 VEX_W_0F3A32_P_2_LEN_0,
1ba585e8 2024 VEX_W_0F3A33_P_2_LEN_0,
6c30d220
L
2025 VEX_W_0F3A38_P_2,
2026 VEX_W_0F3A39_P_2,
6c30d220 2027 VEX_W_0F3A46_P_2,
592a252b
L
2028 VEX_W_0F3A48_P_2,
2029 VEX_W_0F3A49_P_2,
2030 VEX_W_0F3A4A_P_2,
2031 VEX_W_0F3A4B_P_2,
2032 VEX_W_0F3A4C_P_2,
48521003
IT
2033 VEX_W_0F3ACE_P_2,
2034 VEX_W_0F3ACF_P_2,
43234a1e
L
2035
2036 EVEX_W_0F10_P_0,
2037 EVEX_W_0F10_P_1_M_0,
2038 EVEX_W_0F10_P_1_M_1,
2039 EVEX_W_0F10_P_2,
2040 EVEX_W_0F10_P_3_M_0,
2041 EVEX_W_0F10_P_3_M_1,
2042 EVEX_W_0F11_P_0,
2043 EVEX_W_0F11_P_1_M_0,
2044 EVEX_W_0F11_P_1_M_1,
2045 EVEX_W_0F11_P_2,
2046 EVEX_W_0F11_P_3_M_0,
2047 EVEX_W_0F11_P_3_M_1,
2048 EVEX_W_0F12_P_0_M_0,
2049 EVEX_W_0F12_P_0_M_1,
2050 EVEX_W_0F12_P_1,
2051 EVEX_W_0F12_P_2,
2052 EVEX_W_0F12_P_3,
2053 EVEX_W_0F13_P_0,
2054 EVEX_W_0F13_P_2,
2055 EVEX_W_0F14_P_0,
2056 EVEX_W_0F14_P_2,
2057 EVEX_W_0F15_P_0,
2058 EVEX_W_0F15_P_2,
2059 EVEX_W_0F16_P_0_M_0,
2060 EVEX_W_0F16_P_0_M_1,
2061 EVEX_W_0F16_P_1,
2062 EVEX_W_0F16_P_2,
2063 EVEX_W_0F17_P_0,
2064 EVEX_W_0F17_P_2,
2065 EVEX_W_0F28_P_0,
2066 EVEX_W_0F28_P_2,
2067 EVEX_W_0F29_P_0,
2068 EVEX_W_0F29_P_2,
2069 EVEX_W_0F2A_P_1,
2070 EVEX_W_0F2A_P_3,
2071 EVEX_W_0F2B_P_0,
2072 EVEX_W_0F2B_P_2,
2073 EVEX_W_0F2E_P_0,
2074 EVEX_W_0F2E_P_2,
2075 EVEX_W_0F2F_P_0,
2076 EVEX_W_0F2F_P_2,
2077 EVEX_W_0F51_P_0,
2078 EVEX_W_0F51_P_1,
2079 EVEX_W_0F51_P_2,
2080 EVEX_W_0F51_P_3,
90a915bf
IT
2081 EVEX_W_0F54_P_0,
2082 EVEX_W_0F54_P_2,
2083 EVEX_W_0F55_P_0,
2084 EVEX_W_0F55_P_2,
2085 EVEX_W_0F56_P_0,
2086 EVEX_W_0F56_P_2,
2087 EVEX_W_0F57_P_0,
2088 EVEX_W_0F57_P_2,
43234a1e
L
2089 EVEX_W_0F58_P_0,
2090 EVEX_W_0F58_P_1,
2091 EVEX_W_0F58_P_2,
2092 EVEX_W_0F58_P_3,
2093 EVEX_W_0F59_P_0,
2094 EVEX_W_0F59_P_1,
2095 EVEX_W_0F59_P_2,
2096 EVEX_W_0F59_P_3,
2097 EVEX_W_0F5A_P_0,
2098 EVEX_W_0F5A_P_1,
2099 EVEX_W_0F5A_P_2,
2100 EVEX_W_0F5A_P_3,
2101 EVEX_W_0F5B_P_0,
2102 EVEX_W_0F5B_P_1,
2103 EVEX_W_0F5B_P_2,
2104 EVEX_W_0F5C_P_0,
2105 EVEX_W_0F5C_P_1,
2106 EVEX_W_0F5C_P_2,
2107 EVEX_W_0F5C_P_3,
2108 EVEX_W_0F5D_P_0,
2109 EVEX_W_0F5D_P_1,
2110 EVEX_W_0F5D_P_2,
2111 EVEX_W_0F5D_P_3,
2112 EVEX_W_0F5E_P_0,
2113 EVEX_W_0F5E_P_1,
2114 EVEX_W_0F5E_P_2,
2115 EVEX_W_0F5E_P_3,
2116 EVEX_W_0F5F_P_0,
2117 EVEX_W_0F5F_P_1,
2118 EVEX_W_0F5F_P_2,
2119 EVEX_W_0F5F_P_3,
2120 EVEX_W_0F62_P_2,
2121 EVEX_W_0F66_P_2,
2122 EVEX_W_0F6A_P_2,
1ba585e8 2123 EVEX_W_0F6B_P_2,
43234a1e
L
2124 EVEX_W_0F6C_P_2,
2125 EVEX_W_0F6D_P_2,
43234a1e
L
2126 EVEX_W_0F6F_P_1,
2127 EVEX_W_0F6F_P_2,
1ba585e8 2128 EVEX_W_0F6F_P_3,
43234a1e
L
2129 EVEX_W_0F70_P_2,
2130 EVEX_W_0F72_R_2_P_2,
2131 EVEX_W_0F72_R_6_P_2,
2132 EVEX_W_0F73_R_2_P_2,
2133 EVEX_W_0F73_R_6_P_2,
2134 EVEX_W_0F76_P_2,
2135 EVEX_W_0F78_P_0,
90a915bf 2136 EVEX_W_0F78_P_2,
43234a1e 2137 EVEX_W_0F79_P_0,
90a915bf 2138 EVEX_W_0F79_P_2,
43234a1e 2139 EVEX_W_0F7A_P_1,
90a915bf 2140 EVEX_W_0F7A_P_2,
43234a1e
L
2141 EVEX_W_0F7A_P_3,
2142 EVEX_W_0F7B_P_1,
90a915bf 2143 EVEX_W_0F7B_P_2,
43234a1e
L
2144 EVEX_W_0F7B_P_3,
2145 EVEX_W_0F7E_P_1,
43234a1e
L
2146 EVEX_W_0F7F_P_1,
2147 EVEX_W_0F7F_P_2,
1ba585e8 2148 EVEX_W_0F7F_P_3,
43234a1e
L
2149 EVEX_W_0FC2_P_0,
2150 EVEX_W_0FC2_P_1,
2151 EVEX_W_0FC2_P_2,
2152 EVEX_W_0FC2_P_3,
2153 EVEX_W_0FC6_P_0,
2154 EVEX_W_0FC6_P_2,
2155 EVEX_W_0FD2_P_2,
2156 EVEX_W_0FD3_P_2,
2157 EVEX_W_0FD4_P_2,
2158 EVEX_W_0FD6_P_2,
2159 EVEX_W_0FE6_P_1,
2160 EVEX_W_0FE6_P_2,
2161 EVEX_W_0FE6_P_3,
2162 EVEX_W_0FE7_P_2,
2163 EVEX_W_0FF2_P_2,
2164 EVEX_W_0FF3_P_2,
2165 EVEX_W_0FF4_P_2,
2166 EVEX_W_0FFA_P_2,
2167 EVEX_W_0FFB_P_2,
2168 EVEX_W_0FFE_P_2,
2169 EVEX_W_0F380C_P_2,
2170 EVEX_W_0F380D_P_2,
1ba585e8
IT
2171 EVEX_W_0F3810_P_1,
2172 EVEX_W_0F3810_P_2,
43234a1e 2173 EVEX_W_0F3811_P_1,
1ba585e8 2174 EVEX_W_0F3811_P_2,
43234a1e 2175 EVEX_W_0F3812_P_1,
1ba585e8 2176 EVEX_W_0F3812_P_2,
43234a1e
L
2177 EVEX_W_0F3813_P_1,
2178 EVEX_W_0F3813_P_2,
2179 EVEX_W_0F3814_P_1,
2180 EVEX_W_0F3815_P_1,
2181 EVEX_W_0F3818_P_2,
2182 EVEX_W_0F3819_P_2,
2183 EVEX_W_0F381A_P_2,
2184 EVEX_W_0F381B_P_2,
2185 EVEX_W_0F381E_P_2,
2186 EVEX_W_0F381F_P_2,
1ba585e8 2187 EVEX_W_0F3820_P_1,
43234a1e
L
2188 EVEX_W_0F3821_P_1,
2189 EVEX_W_0F3822_P_1,
2190 EVEX_W_0F3823_P_1,
2191 EVEX_W_0F3824_P_1,
2192 EVEX_W_0F3825_P_1,
2193 EVEX_W_0F3825_P_2,
1ba585e8
IT
2194 EVEX_W_0F3826_P_1,
2195 EVEX_W_0F3826_P_2,
2196 EVEX_W_0F3828_P_1,
43234a1e 2197 EVEX_W_0F3828_P_2,
1ba585e8 2198 EVEX_W_0F3829_P_1,
43234a1e
L
2199 EVEX_W_0F3829_P_2,
2200 EVEX_W_0F382A_P_1,
2201 EVEX_W_0F382A_P_2,
1ba585e8
IT
2202 EVEX_W_0F382B_P_2,
2203 EVEX_W_0F3830_P_1,
43234a1e
L
2204 EVEX_W_0F3831_P_1,
2205 EVEX_W_0F3832_P_1,
2206 EVEX_W_0F3833_P_1,
2207 EVEX_W_0F3834_P_1,
2208 EVEX_W_0F3835_P_1,
2209 EVEX_W_0F3835_P_2,
2210 EVEX_W_0F3837_P_2,
90a915bf
IT
2211 EVEX_W_0F3838_P_1,
2212 EVEX_W_0F3839_P_1,
43234a1e
L
2213 EVEX_W_0F383A_P_1,
2214 EVEX_W_0F3840_P_2,
d6aab7a1 2215 EVEX_W_0F3852_P_1,
ee6872be 2216 EVEX_W_0F3854_P_2,
620214f7 2217 EVEX_W_0F3855_P_2,
43234a1e
L
2218 EVEX_W_0F3858_P_2,
2219 EVEX_W_0F3859_P_2,
2220 EVEX_W_0F385A_P_2,
2221 EVEX_W_0F385B_P_2,
53467f57
IT
2222 EVEX_W_0F3862_P_2,
2223 EVEX_W_0F3863_P_2,
1ba585e8 2224 EVEX_W_0F3866_P_2,
9186c494 2225 EVEX_W_0F3868_P_3,
53467f57
IT
2226 EVEX_W_0F3870_P_2,
2227 EVEX_W_0F3871_P_2,
d6aab7a1 2228 EVEX_W_0F3872_P_1,
53467f57 2229 EVEX_W_0F3872_P_2,
d6aab7a1 2230 EVEX_W_0F3872_P_3,
53467f57 2231 EVEX_W_0F3873_P_2,
1ba585e8
IT
2232 EVEX_W_0F3875_P_2,
2233 EVEX_W_0F3878_P_2,
2234 EVEX_W_0F3879_P_2,
2235 EVEX_W_0F387A_P_2,
2236 EVEX_W_0F387B_P_2,
2237 EVEX_W_0F387D_P_2,
14f195c9 2238 EVEX_W_0F3883_P_2,
1ba585e8 2239 EVEX_W_0F388D_P_2,
43234a1e
L
2240 EVEX_W_0F3891_P_2,
2241 EVEX_W_0F3893_P_2,
2242 EVEX_W_0F38A1_P_2,
2243 EVEX_W_0F38A3_P_2,
2244 EVEX_W_0F38C7_R_1_P_2,
2245 EVEX_W_0F38C7_R_2_P_2,
2246 EVEX_W_0F38C7_R_5_P_2,
2247 EVEX_W_0F38C7_R_6_P_2,
2248
2249 EVEX_W_0F3A00_P_2,
2250 EVEX_W_0F3A01_P_2,
2251 EVEX_W_0F3A04_P_2,
2252 EVEX_W_0F3A05_P_2,
2253 EVEX_W_0F3A08_P_2,
2254 EVEX_W_0F3A09_P_2,
2255 EVEX_W_0F3A0A_P_2,
2256 EVEX_W_0F3A0B_P_2,
2257 EVEX_W_0F3A18_P_2,
2258 EVEX_W_0F3A19_P_2,
2259 EVEX_W_0F3A1A_P_2,
2260 EVEX_W_0F3A1B_P_2,
2261 EVEX_W_0F3A1D_P_2,
2262 EVEX_W_0F3A21_P_2,
2263 EVEX_W_0F3A23_P_2,
2264 EVEX_W_0F3A38_P_2,
2265 EVEX_W_0F3A39_P_2,
2266 EVEX_W_0F3A3A_P_2,
2267 EVEX_W_0F3A3B_P_2,
1ba585e8
IT
2268 EVEX_W_0F3A3E_P_2,
2269 EVEX_W_0F3A3F_P_2,
2270 EVEX_W_0F3A42_P_2,
90a915bf
IT
2271 EVEX_W_0F3A43_P_2,
2272 EVEX_W_0F3A50_P_2,
2273 EVEX_W_0F3A51_P_2,
2274 EVEX_W_0F3A56_P_2,
2275 EVEX_W_0F3A57_P_2,
2276 EVEX_W_0F3A66_P_2,
53467f57
IT
2277 EVEX_W_0F3A67_P_2,
2278 EVEX_W_0F3A70_P_2,
2279 EVEX_W_0F3A71_P_2,
2280 EVEX_W_0F3A72_P_2,
48521003
IT
2281 EVEX_W_0F3A73_P_2,
2282 EVEX_W_0F3ACE_P_2,
2283 EVEX_W_0F3ACF_P_2
9e30b8e0
L
2284};
2285
26ca5450 2286typedef void (*op_rtn) (int bytemode, int sizeflag);
252b5132
RH
2287
2288struct dis386 {
2da11e11 2289 const char *name;
ce518a5f
L
2290 struct
2291 {
2292 op_rtn rtn;
2293 int bytemode;
2294 } op[MAX_OPERANDS];
bf890a93 2295 unsigned int prefix_requirement;
252b5132
RH
2296};
2297
2298/* Upper case letters in the instruction names here are macros.
2299 'A' => print 'b' if no register operands or suffix_always is true
2300 'B' => print 'b' if suffix_always is true
9306ca4a 2301 'C' => print 's' or 'l' ('w' or 'd' in Intel mode) depending on operand
98b528ac 2302 size prefix
ed7841b3 2303 'D' => print 'w' if no register operands or 'w', 'l' or 'q', if
98b528ac 2304 suffix_always is true
252b5132 2305 'E' => print 'e' if 32-bit form of jcxz
3ffd33cf 2306 'F' => print 'w' or 'l' depending on address size prefix (loop insns)
52fd6d94 2307 'G' => print 'w' or 'l' depending on operand size prefix (i/o insns)
5dd0794d 2308 'H' => print ",pt" or ",pn" branch hint
9306ca4a 2309 'I' => honor following macro letter even in Intel mode (implemented only
98b528ac 2310 for some of the macro letters)
9306ca4a 2311 'J' => print 'l'
42903f7f 2312 'K' => print 'd' or 'q' if rex prefix is present.
252b5132 2313 'L' => print 'l' if suffix_always is true
9d141669 2314 'M' => print 'r' if intel_mnemonic is false.
252b5132 2315 'N' => print 'n' if instruction has no wait "prefix"
a35ca55a 2316 'O' => print 'd' or 'o' (or 'q' in Intel mode)
52b15da3 2317 'P' => print 'w', 'l' or 'q' if instruction has an operand size prefix,
98b528ac
L
2318 or suffix_always is true. print 'q' if rex prefix is present.
2319 'Q' => print 'w', 'l' or 'q' for memory operand or suffix_always
2320 is true
a35ca55a 2321 'R' => print 'w', 'l' or 'q' ('d' for 'l' and 'e' in Intel mode)
52b15da3 2322 'S' => print 'w', 'l' or 'q' if suffix_always is true
a72d2af2
L
2323 'T' => print 'q' in 64bit mode if instruction has no operand size
2324 prefix and behave as 'P' otherwise
2325 'U' => print 'q' in 64bit mode if instruction has no operand size
2326 prefix and behave as 'Q' otherwise
2327 'V' => print 'q' in 64bit mode if instruction has no operand size
2328 prefix and behave as 'S' otherwise
a35ca55a 2329 'W' => print 'b', 'w' or 'l' ('d' in Intel mode)
9306ca4a 2330 'X' => print 's', 'd' depending on data16 prefix (for XMM)
9646c87b 2331 'Y' unused.
6dd5059a 2332 'Z' => print 'q' in 64bit mode and behave as 'L' otherwise
9d141669 2333 '!' => change condition from true to false or from false to true.
98b528ac 2334 '%' => add 1 upper case letter to the macro.
a72d2af2
L
2335 '^' => print 'w' or 'l' depending on operand size prefix or
2336 suffix_always is true (lcall/ljmp).
5db04b09
L
2337 '@' => print 'q' for Intel64 ISA, 'w' or 'q' for AMD64 ISA depending
2338 on operand size prefix.
07f5af7d
L
2339 '&' => print 'q' in 64bit mode for Intel64 ISA or if instruction
2340 has no operand size prefix for AMD64 ISA, behave as 'P'
2341 otherwise
98b528ac
L
2342
2343 2 upper case letter macros:
04d824a4
JB
2344 "XY" => print 'x' or 'y' if suffix_always is true or no register
2345 operands and no broadcast.
2346 "XZ" => print 'x', 'y', or 'z' if suffix_always is true or no
2347 register operands and no broadcast.
4b06377f
L
2348 "XW" => print 's', 'd' depending on the VEX.W bit (for FMA)
2349 "LQ" => print 'l' ('d' in Intel mode) or 'q' for memory operand
98b528ac 2350 or suffix_always is true
4b06377f
L
2351 "LB" => print "abs" in 64bit mode and behave as 'B' otherwise
2352 "LS" => print "abs" in 64bit mode and behave as 'S' otherwise
2353 "LV" => print "abs" for 64bit operand and behave as 'S' otherwise
6c30d220 2354 "LW" => print 'd', 'q' depending on the VEX.W bit
4b4c407a
L
2355 "LP" => print 'w' or 'l' ('d' in Intel mode) if instruction has
2356 an operand size prefix, or suffix_always is true. print
2357 'q' if rex prefix is present.
52b15da3 2358
6439fc28
AM
2359 Many of the above letters print nothing in Intel mode. See "putop"
2360 for the details.
52b15da3 2361
6439fc28 2362 Braces '{' and '}', and vertical bars '|', indicate alternative
7c52e0e8 2363 mnemonic strings for AT&T and Intel. */
252b5132 2364
6439fc28 2365static const struct dis386 dis386[] = {
252b5132 2366 /* 00 */
bf890a93
IT
2367 { "addB", { Ebh1, Gb }, 0 },
2368 { "addS", { Evh1, Gv }, 0 },
2369 { "addB", { Gb, EbS }, 0 },
2370 { "addS", { Gv, EvS }, 0 },
2371 { "addB", { AL, Ib }, 0 },
2372 { "addS", { eAX, Iv }, 0 },
4e7d34a6
L
2373 { X86_64_TABLE (X86_64_06) },
2374 { X86_64_TABLE (X86_64_07) },
252b5132 2375 /* 08 */
bf890a93
IT
2376 { "orB", { Ebh1, Gb }, 0 },
2377 { "orS", { Evh1, Gv }, 0 },
2378 { "orB", { Gb, EbS }, 0 },
2379 { "orS", { Gv, EvS }, 0 },
2380 { "orB", { AL, Ib }, 0 },
2381 { "orS", { eAX, Iv }, 0 },
4e7d34a6 2382 { X86_64_TABLE (X86_64_0D) },
592d1631 2383 { Bad_Opcode }, /* 0x0f extended opcode escape */
252b5132 2384 /* 10 */
bf890a93
IT
2385 { "adcB", { Ebh1, Gb }, 0 },
2386 { "adcS", { Evh1, Gv }, 0 },
2387 { "adcB", { Gb, EbS }, 0 },
2388 { "adcS", { Gv, EvS }, 0 },
2389 { "adcB", { AL, Ib }, 0 },
2390 { "adcS", { eAX, Iv }, 0 },
4e7d34a6
L
2391 { X86_64_TABLE (X86_64_16) },
2392 { X86_64_TABLE (X86_64_17) },
252b5132 2393 /* 18 */
bf890a93
IT
2394 { "sbbB", { Ebh1, Gb }, 0 },
2395 { "sbbS", { Evh1, Gv }, 0 },
2396 { "sbbB", { Gb, EbS }, 0 },
2397 { "sbbS", { Gv, EvS }, 0 },
2398 { "sbbB", { AL, Ib }, 0 },
2399 { "sbbS", { eAX, Iv }, 0 },
4e7d34a6
L
2400 { X86_64_TABLE (X86_64_1E) },
2401 { X86_64_TABLE (X86_64_1F) },
252b5132 2402 /* 20 */
bf890a93
IT
2403 { "andB", { Ebh1, Gb }, 0 },
2404 { "andS", { Evh1, Gv }, 0 },
2405 { "andB", { Gb, EbS }, 0 },
2406 { "andS", { Gv, EvS }, 0 },
2407 { "andB", { AL, Ib }, 0 },
2408 { "andS", { eAX, Iv }, 0 },
592d1631 2409 { Bad_Opcode }, /* SEG ES prefix */
4e7d34a6 2410 { X86_64_TABLE (X86_64_27) },
252b5132 2411 /* 28 */
bf890a93
IT
2412 { "subB", { Ebh1, Gb }, 0 },
2413 { "subS", { Evh1, Gv }, 0 },
2414 { "subB", { Gb, EbS }, 0 },
2415 { "subS", { Gv, EvS }, 0 },
2416 { "subB", { AL, Ib }, 0 },
2417 { "subS", { eAX, Iv }, 0 },
592d1631 2418 { Bad_Opcode }, /* SEG CS prefix */
4e7d34a6 2419 { X86_64_TABLE (X86_64_2F) },
252b5132 2420 /* 30 */
bf890a93
IT
2421 { "xorB", { Ebh1, Gb }, 0 },
2422 { "xorS", { Evh1, Gv }, 0 },
2423 { "xorB", { Gb, EbS }, 0 },
2424 { "xorS", { Gv, EvS }, 0 },
2425 { "xorB", { AL, Ib }, 0 },
2426 { "xorS", { eAX, Iv }, 0 },
592d1631 2427 { Bad_Opcode }, /* SEG SS prefix */
4e7d34a6 2428 { X86_64_TABLE (X86_64_37) },
252b5132 2429 /* 38 */
bf890a93
IT
2430 { "cmpB", { Eb, Gb }, 0 },
2431 { "cmpS", { Ev, Gv }, 0 },
2432 { "cmpB", { Gb, EbS }, 0 },
2433 { "cmpS", { Gv, EvS }, 0 },
2434 { "cmpB", { AL, Ib }, 0 },
2435 { "cmpS", { eAX, Iv }, 0 },
592d1631 2436 { Bad_Opcode }, /* SEG DS prefix */
4e7d34a6 2437 { X86_64_TABLE (X86_64_3F) },
252b5132 2438 /* 40 */
bf890a93
IT
2439 { "inc{S|}", { RMeAX }, 0 },
2440 { "inc{S|}", { RMeCX }, 0 },
2441 { "inc{S|}", { RMeDX }, 0 },
2442 { "inc{S|}", { RMeBX }, 0 },
2443 { "inc{S|}", { RMeSP }, 0 },
2444 { "inc{S|}", { RMeBP }, 0 },
2445 { "inc{S|}", { RMeSI }, 0 },
2446 { "inc{S|}", { RMeDI }, 0 },
252b5132 2447 /* 48 */
bf890a93
IT
2448 { "dec{S|}", { RMeAX }, 0 },
2449 { "dec{S|}", { RMeCX }, 0 },
2450 { "dec{S|}", { RMeDX }, 0 },
2451 { "dec{S|}", { RMeBX }, 0 },
2452 { "dec{S|}", { RMeSP }, 0 },
2453 { "dec{S|}", { RMeBP }, 0 },
2454 { "dec{S|}", { RMeSI }, 0 },
2455 { "dec{S|}", { RMeDI }, 0 },
252b5132 2456 /* 50 */
bf890a93
IT
2457 { "pushV", { RMrAX }, 0 },
2458 { "pushV", { RMrCX }, 0 },
2459 { "pushV", { RMrDX }, 0 },
2460 { "pushV", { RMrBX }, 0 },
2461 { "pushV", { RMrSP }, 0 },
2462 { "pushV", { RMrBP }, 0 },
2463 { "pushV", { RMrSI }, 0 },
2464 { "pushV", { RMrDI }, 0 },
252b5132 2465 /* 58 */
bf890a93
IT
2466 { "popV", { RMrAX }, 0 },
2467 { "popV", { RMrCX }, 0 },
2468 { "popV", { RMrDX }, 0 },
2469 { "popV", { RMrBX }, 0 },
2470 { "popV", { RMrSP }, 0 },
2471 { "popV", { RMrBP }, 0 },
2472 { "popV", { RMrSI }, 0 },
2473 { "popV", { RMrDI }, 0 },
252b5132 2474 /* 60 */
4e7d34a6
L
2475 { X86_64_TABLE (X86_64_60) },
2476 { X86_64_TABLE (X86_64_61) },
2477 { X86_64_TABLE (X86_64_62) },
2478 { X86_64_TABLE (X86_64_63) },
592d1631
L
2479 { Bad_Opcode }, /* seg fs */
2480 { Bad_Opcode }, /* seg gs */
2481 { Bad_Opcode }, /* op size prefix */
2482 { Bad_Opcode }, /* adr size prefix */
252b5132 2483 /* 68 */
bf890a93
IT
2484 { "pushT", { sIv }, 0 },
2485 { "imulS", { Gv, Ev, Iv }, 0 },
2486 { "pushT", { sIbT }, 0 },
2487 { "imulS", { Gv, Ev, sIb }, 0 },
2488 { "ins{b|}", { Ybr, indirDX }, 0 },
4e7d34a6 2489 { X86_64_TABLE (X86_64_6D) },
bf890a93 2490 { "outs{b|}", { indirDXr, Xb }, 0 },
4e7d34a6 2491 { X86_64_TABLE (X86_64_6F) },
252b5132 2492 /* 70 */
bf890a93
IT
2493 { "joH", { Jb, BND, cond_jump_flag }, 0 },
2494 { "jnoH", { Jb, BND, cond_jump_flag }, 0 },
2495 { "jbH", { Jb, BND, cond_jump_flag }, 0 },
2496 { "jaeH", { Jb, BND, cond_jump_flag }, 0 },
2497 { "jeH", { Jb, BND, cond_jump_flag }, 0 },
2498 { "jneH", { Jb, BND, cond_jump_flag }, 0 },
2499 { "jbeH", { Jb, BND, cond_jump_flag }, 0 },
2500 { "jaH", { Jb, BND, cond_jump_flag }, 0 },
252b5132 2501 /* 78 */
bf890a93
IT
2502 { "jsH", { Jb, BND, cond_jump_flag }, 0 },
2503 { "jnsH", { Jb, BND, cond_jump_flag }, 0 },
2504 { "jpH", { Jb, BND, cond_jump_flag }, 0 },
2505 { "jnpH", { Jb, BND, cond_jump_flag }, 0 },
2506 { "jlH", { Jb, BND, cond_jump_flag }, 0 },
2507 { "jgeH", { Jb, BND, cond_jump_flag }, 0 },
2508 { "jleH", { Jb, BND, cond_jump_flag }, 0 },
2509 { "jgH", { Jb, BND, cond_jump_flag }, 0 },
252b5132 2510 /* 80 */
1ceb70f8
L
2511 { REG_TABLE (REG_80) },
2512 { REG_TABLE (REG_81) },
d039fef3 2513 { X86_64_TABLE (X86_64_82) },
7148c369 2514 { REG_TABLE (REG_83) },
bf890a93
IT
2515 { "testB", { Eb, Gb }, 0 },
2516 { "testS", { Ev, Gv }, 0 },
2517 { "xchgB", { Ebh2, Gb }, 0 },
2518 { "xchgS", { Evh2, Gv }, 0 },
252b5132 2519 /* 88 */
bf890a93
IT
2520 { "movB", { Ebh3, Gb }, 0 },
2521 { "movS", { Evh3, Gv }, 0 },
2522 { "movB", { Gb, EbS }, 0 },
2523 { "movS", { Gv, EvS }, 0 },
2524 { "movD", { Sv, Sw }, 0 },
1ceb70f8 2525 { MOD_TABLE (MOD_8D) },
bf890a93 2526 { "movD", { Sw, Sv }, 0 },
1ceb70f8 2527 { REG_TABLE (REG_8F) },
252b5132 2528 /* 90 */
1ceb70f8 2529 { PREFIX_TABLE (PREFIX_90) },
bf890a93
IT
2530 { "xchgS", { RMeCX, eAX }, 0 },
2531 { "xchgS", { RMeDX, eAX }, 0 },
2532 { "xchgS", { RMeBX, eAX }, 0 },
2533 { "xchgS", { RMeSP, eAX }, 0 },
2534 { "xchgS", { RMeBP, eAX }, 0 },
2535 { "xchgS", { RMeSI, eAX }, 0 },
2536 { "xchgS", { RMeDI, eAX }, 0 },
252b5132 2537 /* 98 */
bf890a93
IT
2538 { "cW{t|}R", { XX }, 0 },
2539 { "cR{t|}O", { XX }, 0 },
4e7d34a6 2540 { X86_64_TABLE (X86_64_9A) },
592d1631 2541 { Bad_Opcode }, /* fwait */
bf890a93
IT
2542 { "pushfT", { XX }, 0 },
2543 { "popfT", { XX }, 0 },
2544 { "sahf", { XX }, 0 },
2545 { "lahf", { XX }, 0 },
252b5132 2546 /* a0 */
bf890a93
IT
2547 { "mov%LB", { AL, Ob }, 0 },
2548 { "mov%LS", { eAX, Ov }, 0 },
2549 { "mov%LB", { Ob, AL }, 0 },
2550 { "mov%LS", { Ov, eAX }, 0 },
2551 { "movs{b|}", { Ybr, Xb }, 0 },
2552 { "movs{R|}", { Yvr, Xv }, 0 },
2553 { "cmps{b|}", { Xb, Yb }, 0 },
2554 { "cmps{R|}", { Xv, Yv }, 0 },
252b5132 2555 /* a8 */
bf890a93
IT
2556 { "testB", { AL, Ib }, 0 },
2557 { "testS", { eAX, Iv }, 0 },
2558 { "stosB", { Ybr, AL }, 0 },
2559 { "stosS", { Yvr, eAX }, 0 },
2560 { "lodsB", { ALr, Xb }, 0 },
2561 { "lodsS", { eAXr, Xv }, 0 },
2562 { "scasB", { AL, Yb }, 0 },
2563 { "scasS", { eAX, Yv }, 0 },
252b5132 2564 /* b0 */
bf890a93
IT
2565 { "movB", { RMAL, Ib }, 0 },
2566 { "movB", { RMCL, Ib }, 0 },
2567 { "movB", { RMDL, Ib }, 0 },
2568 { "movB", { RMBL, Ib }, 0 },
2569 { "movB", { RMAH, Ib }, 0 },
2570 { "movB", { RMCH, Ib }, 0 },
2571 { "movB", { RMDH, Ib }, 0 },
2572 { "movB", { RMBH, Ib }, 0 },
252b5132 2573 /* b8 */
bf890a93
IT
2574 { "mov%LV", { RMeAX, Iv64 }, 0 },
2575 { "mov%LV", { RMeCX, Iv64 }, 0 },
2576 { "mov%LV", { RMeDX, Iv64 }, 0 },
2577 { "mov%LV", { RMeBX, Iv64 }, 0 },
2578 { "mov%LV", { RMeSP, Iv64 }, 0 },
2579 { "mov%LV", { RMeBP, Iv64 }, 0 },
2580 { "mov%LV", { RMeSI, Iv64 }, 0 },
2581 { "mov%LV", { RMeDI, Iv64 }, 0 },
252b5132 2582 /* c0 */
1ceb70f8
L
2583 { REG_TABLE (REG_C0) },
2584 { REG_TABLE (REG_C1) },
bf890a93
IT
2585 { "retT", { Iw, BND }, 0 },
2586 { "retT", { BND }, 0 },
4e7d34a6
L
2587 { X86_64_TABLE (X86_64_C4) },
2588 { X86_64_TABLE (X86_64_C5) },
1ceb70f8
L
2589 { REG_TABLE (REG_C6) },
2590 { REG_TABLE (REG_C7) },
252b5132 2591 /* c8 */
bf890a93
IT
2592 { "enterT", { Iw, Ib }, 0 },
2593 { "leaveT", { XX }, 0 },
2594 { "Jret{|f}P", { Iw }, 0 },
2595 { "Jret{|f}P", { XX }, 0 },
2596 { "int3", { XX }, 0 },
2597 { "int", { Ib }, 0 },
4e7d34a6 2598 { X86_64_TABLE (X86_64_CE) },
bf890a93 2599 { "iret%LP", { XX }, 0 },
252b5132 2600 /* d0 */
1ceb70f8
L
2601 { REG_TABLE (REG_D0) },
2602 { REG_TABLE (REG_D1) },
2603 { REG_TABLE (REG_D2) },
2604 { REG_TABLE (REG_D3) },
4e7d34a6
L
2605 { X86_64_TABLE (X86_64_D4) },
2606 { X86_64_TABLE (X86_64_D5) },
592d1631 2607 { Bad_Opcode },
bf890a93 2608 { "xlat", { DSBX }, 0 },
252b5132
RH
2609 /* d8 */
2610 { FLOAT },
2611 { FLOAT },
2612 { FLOAT },
2613 { FLOAT },
2614 { FLOAT },
2615 { FLOAT },
2616 { FLOAT },
2617 { FLOAT },
2618 /* e0 */
bf890a93
IT
2619 { "loopneFH", { Jb, XX, loop_jcxz_flag }, 0 },
2620 { "loopeFH", { Jb, XX, loop_jcxz_flag }, 0 },
2621 { "loopFH", { Jb, XX, loop_jcxz_flag }, 0 },
2622 { "jEcxzH", { Jb, XX, loop_jcxz_flag }, 0 },
2623 { "inB", { AL, Ib }, 0 },
2624 { "inG", { zAX, Ib }, 0 },
2625 { "outB", { Ib, AL }, 0 },
2626 { "outG", { Ib, zAX }, 0 },
252b5132 2627 /* e8 */
a72d2af2
L
2628 { X86_64_TABLE (X86_64_E8) },
2629 { X86_64_TABLE (X86_64_E9) },
4e7d34a6 2630 { X86_64_TABLE (X86_64_EA) },
bf890a93
IT
2631 { "jmp", { Jb, BND }, 0 },
2632 { "inB", { AL, indirDX }, 0 },
2633 { "inG", { zAX, indirDX }, 0 },
2634 { "outB", { indirDX, AL }, 0 },
2635 { "outG", { indirDX, zAX }, 0 },
252b5132 2636 /* f0 */
592d1631 2637 { Bad_Opcode }, /* lock prefix */
bf890a93 2638 { "icebp", { XX }, 0 },
592d1631
L
2639 { Bad_Opcode }, /* repne */
2640 { Bad_Opcode }, /* repz */
bf890a93
IT
2641 { "hlt", { XX }, 0 },
2642 { "cmc", { XX }, 0 },
1ceb70f8
L
2643 { REG_TABLE (REG_F6) },
2644 { REG_TABLE (REG_F7) },
252b5132 2645 /* f8 */
bf890a93
IT
2646 { "clc", { XX }, 0 },
2647 { "stc", { XX }, 0 },
2648 { "cli", { XX }, 0 },
2649 { "sti", { XX }, 0 },
2650 { "cld", { XX }, 0 },
2651 { "std", { XX }, 0 },
1ceb70f8
L
2652 { REG_TABLE (REG_FE) },
2653 { REG_TABLE (REG_FF) },
252b5132
RH
2654};
2655
6439fc28 2656static const struct dis386 dis386_twobyte[] = {
252b5132 2657 /* 00 */
1ceb70f8
L
2658 { REG_TABLE (REG_0F00 ) },
2659 { REG_TABLE (REG_0F01 ) },
bf890a93
IT
2660 { "larS", { Gv, Ew }, 0 },
2661 { "lslS", { Gv, Ew }, 0 },
592d1631 2662 { Bad_Opcode },
bf890a93
IT
2663 { "syscall", { XX }, 0 },
2664 { "clts", { XX }, 0 },
2665 { "sysret%LP", { XX }, 0 },
252b5132 2666 /* 08 */
bf890a93 2667 { "invd", { XX }, 0 },
3233d7d0 2668 { PREFIX_TABLE (PREFIX_0F09) },
592d1631 2669 { Bad_Opcode },
bf890a93 2670 { "ud2", { XX }, 0 },
592d1631 2671 { Bad_Opcode },
b5b1fc4f 2672 { REG_TABLE (REG_0F0D) },
bf890a93
IT
2673 { "femms", { XX }, 0 },
2674 { "", { MX, EM, OPSUF }, 0 }, /* See OP_3DNowSuffix. */
252b5132 2675 /* 10 */
1ceb70f8
L
2676 { PREFIX_TABLE (PREFIX_0F10) },
2677 { PREFIX_TABLE (PREFIX_0F11) },
2678 { PREFIX_TABLE (PREFIX_0F12) },
2679 { MOD_TABLE (MOD_0F13) },
507bd325
L
2680 { "unpcklpX", { XM, EXx }, PREFIX_OPCODE },
2681 { "unpckhpX", { XM, EXx }, PREFIX_OPCODE },
1ceb70f8
L
2682 { PREFIX_TABLE (PREFIX_0F16) },
2683 { MOD_TABLE (MOD_0F17) },
252b5132 2684 /* 18 */
1ceb70f8 2685 { REG_TABLE (REG_0F18) },
bf890a93 2686 { "nopQ", { Ev }, 0 },
7e8b059b
L
2687 { PREFIX_TABLE (PREFIX_0F1A) },
2688 { PREFIX_TABLE (PREFIX_0F1B) },
c48935d7 2689 { PREFIX_TABLE (PREFIX_0F1C) },
bf890a93 2690 { "nopQ", { Ev }, 0 },
603555e5 2691 { PREFIX_TABLE (PREFIX_0F1E) },
bf890a93 2692 { "nopQ", { Ev }, 0 },
252b5132 2693 /* 20 */
bf890a93
IT
2694 { "movZ", { Rm, Cm }, 0 },
2695 { "movZ", { Rm, Dm }, 0 },
2696 { "movZ", { Cm, Rm }, 0 },
2697 { "movZ", { Dm, Rm }, 0 },
1ceb70f8 2698 { MOD_TABLE (MOD_0F24) },
592d1631 2699 { Bad_Opcode },
1ceb70f8 2700 { MOD_TABLE (MOD_0F26) },
592d1631 2701 { Bad_Opcode },
252b5132 2702 /* 28 */
507bd325
L
2703 { "movapX", { XM, EXx }, PREFIX_OPCODE },
2704 { "movapX", { EXxS, XM }, PREFIX_OPCODE },
1ceb70f8
L
2705 { PREFIX_TABLE (PREFIX_0F2A) },
2706 { PREFIX_TABLE (PREFIX_0F2B) },
2707 { PREFIX_TABLE (PREFIX_0F2C) },
2708 { PREFIX_TABLE (PREFIX_0F2D) },
2709 { PREFIX_TABLE (PREFIX_0F2E) },
2710 { PREFIX_TABLE (PREFIX_0F2F) },
252b5132 2711 /* 30 */
bf890a93
IT
2712 { "wrmsr", { XX }, 0 },
2713 { "rdtsc", { XX }, 0 },
2714 { "rdmsr", { XX }, 0 },
2715 { "rdpmc", { XX }, 0 },
2716 { "sysenter", { XX }, 0 },
2717 { "sysexit", { XX }, 0 },
592d1631 2718 { Bad_Opcode },
bf890a93 2719 { "getsec", { XX }, 0 },
252b5132 2720 /* 38 */
507bd325 2721 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F38, PREFIX_OPCODE) },
592d1631 2722 { Bad_Opcode },
507bd325 2723 { THREE_BYTE_TABLE_PREFIX (THREE_BYTE_0F3A, PREFIX_OPCODE) },
592d1631
L
2724 { Bad_Opcode },
2725 { Bad_Opcode },
2726 { Bad_Opcode },
2727 { Bad_Opcode },
2728 { Bad_Opcode },
252b5132 2729 /* 40 */
bf890a93
IT
2730 { "cmovoS", { Gv, Ev }, 0 },
2731 { "cmovnoS", { Gv, Ev }, 0 },
2732 { "cmovbS", { Gv, Ev }, 0 },
2733 { "cmovaeS", { Gv, Ev }, 0 },
2734 { "cmoveS", { Gv, Ev }, 0 },
2735 { "cmovneS", { Gv, Ev }, 0 },
2736 { "cmovbeS", { Gv, Ev }, 0 },
2737 { "cmovaS", { Gv, Ev }, 0 },
252b5132 2738 /* 48 */
bf890a93
IT
2739 { "cmovsS", { Gv, Ev }, 0 },
2740 { "cmovnsS", { Gv, Ev }, 0 },
2741 { "cmovpS", { Gv, Ev }, 0 },
2742 { "cmovnpS", { Gv, Ev }, 0 },
2743 { "cmovlS", { Gv, Ev }, 0 },
2744 { "cmovgeS", { Gv, Ev }, 0 },
2745 { "cmovleS", { Gv, Ev }, 0 },
2746 { "cmovgS", { Gv, Ev }, 0 },
252b5132 2747 /* 50 */
75c135a8 2748 { MOD_TABLE (MOD_0F51) },
1ceb70f8
L
2749 { PREFIX_TABLE (PREFIX_0F51) },
2750 { PREFIX_TABLE (PREFIX_0F52) },
2751 { PREFIX_TABLE (PREFIX_0F53) },
507bd325
L
2752 { "andpX", { XM, EXx }, PREFIX_OPCODE },
2753 { "andnpX", { XM, EXx }, PREFIX_OPCODE },
2754 { "orpX", { XM, EXx }, PREFIX_OPCODE },
2755 { "xorpX", { XM, EXx }, PREFIX_OPCODE },
252b5132 2756 /* 58 */
1ceb70f8
L
2757 { PREFIX_TABLE (PREFIX_0F58) },
2758 { PREFIX_TABLE (PREFIX_0F59) },
2759 { PREFIX_TABLE (PREFIX_0F5A) },
2760 { PREFIX_TABLE (PREFIX_0F5B) },
2761 { PREFIX_TABLE (PREFIX_0F5C) },
2762 { PREFIX_TABLE (PREFIX_0F5D) },
2763 { PREFIX_TABLE (PREFIX_0F5E) },
2764 { PREFIX_TABLE (PREFIX_0F5F) },
252b5132 2765 /* 60 */
1ceb70f8
L
2766 { PREFIX_TABLE (PREFIX_0F60) },
2767 { PREFIX_TABLE (PREFIX_0F61) },
2768 { PREFIX_TABLE (PREFIX_0F62) },
507bd325
L
2769 { "packsswb", { MX, EM }, PREFIX_OPCODE },
2770 { "pcmpgtb", { MX, EM }, PREFIX_OPCODE },
2771 { "pcmpgtw", { MX, EM }, PREFIX_OPCODE },
2772 { "pcmpgtd", { MX, EM }, PREFIX_OPCODE },
2773 { "packuswb", { MX, EM }, PREFIX_OPCODE },
252b5132 2774 /* 68 */
507bd325
L
2775 { "punpckhbw", { MX, EM }, PREFIX_OPCODE },
2776 { "punpckhwd", { MX, EM }, PREFIX_OPCODE },
2777 { "punpckhdq", { MX, EM }, PREFIX_OPCODE },
2778 { "packssdw", { MX, EM }, PREFIX_OPCODE },
1ceb70f8
L
2779 { PREFIX_TABLE (PREFIX_0F6C) },
2780 { PREFIX_TABLE (PREFIX_0F6D) },
507bd325 2781 { "movK", { MX, Edq }, PREFIX_OPCODE },
1ceb70f8 2782 { PREFIX_TABLE (PREFIX_0F6F) },
252b5132 2783 /* 70 */
1ceb70f8
L
2784 { PREFIX_TABLE (PREFIX_0F70) },
2785 { REG_TABLE (REG_0F71) },
2786 { REG_TABLE (REG_0F72) },
2787 { REG_TABLE (REG_0F73) },
507bd325
L
2788 { "pcmpeqb", { MX, EM }, PREFIX_OPCODE },
2789 { "pcmpeqw", { MX, EM }, PREFIX_OPCODE },
2790 { "pcmpeqd", { MX, EM }, PREFIX_OPCODE },
2791 { "emms", { XX }, PREFIX_OPCODE },
252b5132 2792 /* 78 */
1ceb70f8
L
2793 { PREFIX_TABLE (PREFIX_0F78) },
2794 { PREFIX_TABLE (PREFIX_0F79) },
1f334aeb 2795 { Bad_Opcode },
592d1631 2796 { Bad_Opcode },
1ceb70f8
L
2797 { PREFIX_TABLE (PREFIX_0F7C) },
2798 { PREFIX_TABLE (PREFIX_0F7D) },
2799 { PREFIX_TABLE (PREFIX_0F7E) },
2800 { PREFIX_TABLE (PREFIX_0F7F) },
252b5132 2801 /* 80 */
bf890a93
IT
2802 { "joH", { Jv, BND, cond_jump_flag }, 0 },
2803 { "jnoH", { Jv, BND, cond_jump_flag }, 0 },
2804 { "jbH", { Jv, BND, cond_jump_flag }, 0 },
2805 { "jaeH", { Jv, BND, cond_jump_flag }, 0 },
2806 { "jeH", { Jv, BND, cond_jump_flag }, 0 },
2807 { "jneH", { Jv, BND, cond_jump_flag }, 0 },
2808 { "jbeH", { Jv, BND, cond_jump_flag }, 0 },
2809 { "jaH", { Jv, BND, cond_jump_flag }, 0 },
252b5132 2810 /* 88 */
bf890a93
IT
2811 { "jsH", { Jv, BND, cond_jump_flag }, 0 },
2812 { "jnsH", { Jv, BND, cond_jump_flag }, 0 },
2813 { "jpH", { Jv, BND, cond_jump_flag }, 0 },
2814 { "jnpH", { Jv, BND, cond_jump_flag }, 0 },
2815 { "jlH", { Jv, BND, cond_jump_flag }, 0 },
2816 { "jgeH", { Jv, BND, cond_jump_flag }, 0 },
2817 { "jleH", { Jv, BND, cond_jump_flag }, 0 },
2818 { "jgH", { Jv, BND, cond_jump_flag }, 0 },
252b5132 2819 /* 90 */
bf890a93
IT
2820 { "seto", { Eb }, 0 },
2821 { "setno", { Eb }, 0 },
2822 { "setb", { Eb }, 0 },
2823 { "setae", { Eb }, 0 },
2824 { "sete", { Eb }, 0 },
2825 { "setne", { Eb }, 0 },
2826 { "setbe", { Eb }, 0 },
2827 { "seta", { Eb }, 0 },
252b5132 2828 /* 98 */
bf890a93
IT
2829 { "sets", { Eb }, 0 },
2830 { "setns", { Eb }, 0 },
2831 { "setp", { Eb }, 0 },
2832 { "setnp", { Eb }, 0 },
2833 { "setl", { Eb }, 0 },
2834 { "setge", { Eb }, 0 },
2835 { "setle", { Eb }, 0 },
2836 { "setg", { Eb }, 0 },
252b5132 2837 /* a0 */
bf890a93
IT
2838 { "pushT", { fs }, 0 },
2839 { "popT", { fs }, 0 },
2840 { "cpuid", { XX }, 0 },
2841 { "btS", { Ev, Gv }, 0 },
2842 { "shldS", { Ev, Gv, Ib }, 0 },
2843 { "shldS", { Ev, Gv, CL }, 0 },
1ceb70f8
L
2844 { REG_TABLE (REG_0FA6) },
2845 { REG_TABLE (REG_0FA7) },
252b5132 2846 /* a8 */
bf890a93
IT
2847 { "pushT", { gs }, 0 },
2848 { "popT", { gs }, 0 },
2849 { "rsm", { XX }, 0 },
2850 { "btsS", { Evh1, Gv }, 0 },
2851 { "shrdS", { Ev, Gv, Ib }, 0 },
2852 { "shrdS", { Ev, Gv, CL }, 0 },
1ceb70f8 2853 { REG_TABLE (REG_0FAE) },
bf890a93 2854 { "imulS", { Gv, Ev }, 0 },
252b5132 2855 /* b0 */
bf890a93
IT
2856 { "cmpxchgB", { Ebh1, Gb }, 0 },
2857 { "cmpxchgS", { Evh1, Gv }, 0 },
1ceb70f8 2858 { MOD_TABLE (MOD_0FB2) },
bf890a93 2859 { "btrS", { Evh1, Gv }, 0 },
1ceb70f8
L
2860 { MOD_TABLE (MOD_0FB4) },
2861 { MOD_TABLE (MOD_0FB5) },
bf890a93
IT
2862 { "movz{bR|x}", { Gv, Eb }, 0 },
2863 { "movz{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movzww ! */
252b5132 2864 /* b8 */
1ceb70f8 2865 { PREFIX_TABLE (PREFIX_0FB8) },
66f1eba0 2866 { "ud1S", { Gv, Ev }, 0 },
1ceb70f8 2867 { REG_TABLE (REG_0FBA) },
bf890a93 2868 { "btcS", { Evh1, Gv }, 0 },
f12dc422 2869 { PREFIX_TABLE (PREFIX_0FBC) },
1ceb70f8 2870 { PREFIX_TABLE (PREFIX_0FBD) },
bf890a93
IT
2871 { "movs{bR|x}", { Gv, Eb }, 0 },
2872 { "movs{wR|x}", { Gv, Ew }, 0 }, /* yes, there really is movsww ! */
252b5132 2873 /* c0 */
bf890a93
IT
2874 { "xaddB", { Ebh1, Gb }, 0 },
2875 { "xaddS", { Evh1, Gv }, 0 },
1ceb70f8 2876 { PREFIX_TABLE (PREFIX_0FC2) },
a8484f96 2877 { MOD_TABLE (MOD_0FC3) },
507bd325
L
2878 { "pinsrw", { MX, Edqw, Ib }, PREFIX_OPCODE },
2879 { "pextrw", { Gdq, MS, Ib }, PREFIX_OPCODE },
2880 { "shufpX", { XM, EXx, Ib }, PREFIX_OPCODE },
1ceb70f8 2881 { REG_TABLE (REG_0FC7) },
252b5132 2882 /* c8 */
bf890a93
IT
2883 { "bswap", { RMeAX }, 0 },
2884 { "bswap", { RMeCX }, 0 },
2885 { "bswap", { RMeDX }, 0 },
2886 { "bswap", { RMeBX }, 0 },
2887 { "bswap", { RMeSP }, 0 },
2888 { "bswap", { RMeBP }, 0 },
2889 { "bswap", { RMeSI }, 0 },
2890 { "bswap", { RMeDI }, 0 },
252b5132 2891 /* d0 */
1ceb70f8 2892 { PREFIX_TABLE (PREFIX_0FD0) },
507bd325
L
2893 { "psrlw", { MX, EM }, PREFIX_OPCODE },
2894 { "psrld", { MX, EM }, PREFIX_OPCODE },
2895 { "psrlq", { MX, EM }, PREFIX_OPCODE },
2896 { "paddq", { MX, EM }, PREFIX_OPCODE },
2897 { "pmullw", { MX, EM }, PREFIX_OPCODE },
1ceb70f8 2898 { PREFIX_TABLE (PREFIX_0FD6) },
75c135a8 2899 { MOD_TABLE (MOD_0FD7) },
252b5132 2900 /* d8 */
507bd325
L
2901 { "psubusb", { MX, EM }, PREFIX_OPCODE },
2902 { "psubusw", { MX, EM }, PREFIX_OPCODE },
2903 { "pminub", { MX, EM }, PREFIX_OPCODE },
2904 { "pand", { MX, EM }, PREFIX_OPCODE },
2905 { "paddusb", { MX, EM }, PREFIX_OPCODE },
2906 { "paddusw", { MX, EM }, PREFIX_OPCODE },
2907 { "pmaxub", { MX, EM }, PREFIX_OPCODE },
2908 { "pandn", { MX, EM }, PREFIX_OPCODE },
252b5132 2909 /* e0 */
507bd325
L
2910 { "pavgb", { MX, EM }, PREFIX_OPCODE },
2911 { "psraw", { MX, EM }, PREFIX_OPCODE },
2912 { "psrad", { MX, EM }, PREFIX_OPCODE },
2913 { "pavgw", { MX, EM }, PREFIX_OPCODE },
2914 { "pmulhuw", { MX, EM }, PREFIX_OPCODE },
2915 { "pmulhw", { MX, EM }, PREFIX_OPCODE },
1ceb70f8
L
2916 { PREFIX_TABLE (PREFIX_0FE6) },
2917 { PREFIX_TABLE (PREFIX_0FE7) },
252b5132 2918 /* e8 */
507bd325
L
2919 { "psubsb", { MX, EM }, PREFIX_OPCODE },
2920 { "psubsw", { MX, EM }, PREFIX_OPCODE },
2921 { "pminsw", { MX, EM }, PREFIX_OPCODE },
2922 { "por", { MX, EM }, PREFIX_OPCODE },
2923 { "paddsb", { MX, EM }, PREFIX_OPCODE },
2924 { "paddsw", { MX, EM }, PREFIX_OPCODE },
2925 { "pmaxsw", { MX, EM }, PREFIX_OPCODE },
2926 { "pxor", { MX, EM }, PREFIX_OPCODE },
252b5132 2927 /* f0 */
1ceb70f8 2928 { PREFIX_TABLE (PREFIX_0FF0) },
507bd325
L
2929 { "psllw", { MX, EM }, PREFIX_OPCODE },
2930 { "pslld", { MX, EM }, PREFIX_OPCODE },
2931 { "psllq", { MX, EM }, PREFIX_OPCODE },
2932 { "pmuludq", { MX, EM }, PREFIX_OPCODE },
2933 { "pmaddwd", { MX, EM }, PREFIX_OPCODE },
2934 { "psadbw", { MX, EM }, PREFIX_OPCODE },
1ceb70f8 2935 { PREFIX_TABLE (PREFIX_0FF7) },
252b5132 2936 /* f8 */
507bd325
L
2937 { "psubb", { MX, EM }, PREFIX_OPCODE },
2938 { "psubw", { MX, EM }, PREFIX_OPCODE },
2939 { "psubd", { MX, EM }, PREFIX_OPCODE },
2940 { "psubq", { MX, EM }, PREFIX_OPCODE },
2941 { "paddb", { MX, EM }, PREFIX_OPCODE },
2942 { "paddw", { MX, EM }, PREFIX_OPCODE },
2943 { "paddd", { MX, EM }, PREFIX_OPCODE },
66f1eba0 2944 { "ud0S", { Gv, Ev }, 0 },
252b5132
RH
2945};
2946
2947static const unsigned char onebyte_has_modrm[256] = {
c608c12e
AM
2948 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2949 /* ------------------------------- */
2950 /* 00 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 00 */
2951 /* 10 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 10 */
2952 /* 20 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 20 */
2953 /* 30 */ 1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0, /* 30 */
2954 /* 40 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 40 */
2955 /* 50 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 50 */
2956 /* 60 */ 0,0,1,1,0,0,0,0,0,1,0,1,0,0,0,0, /* 60 */
2957 /* 70 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 70 */
2958 /* 80 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 80 */
2959 /* 90 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 90 */
2960 /* a0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* a0 */
2961 /* b0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* b0 */
2962 /* c0 */ 1,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0, /* c0 */
2963 /* d0 */ 1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1, /* d0 */
2964 /* e0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* e0 */
2965 /* f0 */ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1 /* f0 */
2966 /* ------------------------------- */
2967 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
252b5132
RH
2968};
2969
2970static const unsigned char twobyte_has_modrm[256] = {
c608c12e
AM
2971 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2972 /* ------------------------------- */
252b5132 2973 /* 00 */ 1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1, /* 0f */
b5b1fc4f 2974 /* 10 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 1f */
85f10a01 2975 /* 20 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 2f */
331d2d0d 2976 /* 30 */ 0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0, /* 3f */
252b5132 2977 /* 40 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 4f */
4bba6815
AM
2978 /* 50 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 5f */
2979 /* 60 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 6f */
85f10a01 2980 /* 70 */ 1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1, /* 7f */
252b5132
RH
2981 /* 80 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 8f */
2982 /* 90 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* 9f */
30d1c836 2983 /* a0 */ 0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1, /* af */
66f1eba0 2984 /* b0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* bf */
252b5132 2985 /* c0 */ 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0, /* cf */
ca164297 2986 /* d0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* df */
4bba6815 2987 /* e0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, /* ef */
66f1eba0 2988 /* f0 */ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 /* ff */
c608c12e
AM
2989 /* ------------------------------- */
2990 /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */
2991};
2992
252b5132
RH
2993static char obuf[100];
2994static char *obufp;
ea397f5b 2995static char *mnemonicendp;
252b5132
RH
2996static char scratchbuf[100];
2997static unsigned char *start_codep;
2998static unsigned char *insn_codep;
2999static unsigned char *codep;
285ca992 3000static unsigned char *end_codep;
f16cd0d5
L
3001static int last_lock_prefix;
3002static int last_repz_prefix;
3003static int last_repnz_prefix;
3004static int last_data_prefix;
3005static int last_addr_prefix;
3006static int last_rex_prefix;
3007static int last_seg_prefix;
d9949a36 3008static int fwait_prefix;
285ca992
L
3009/* The active segment register prefix. */
3010static int active_seg_prefix;
f16cd0d5
L
3011#define MAX_CODE_LENGTH 15
3012/* We can up to 14 prefixes since the maximum instruction length is
3013 15bytes. */
3014static int all_prefixes[MAX_CODE_LENGTH - 1];
252b5132 3015static disassemble_info *the_info;
7967e09e
L
3016static struct
3017 {
3018 int mod;
7967e09e 3019 int reg;
484c222e 3020 int rm;
7967e09e
L
3021 }
3022modrm;
4bba6815 3023static unsigned char need_modrm;
dfc8cf43
L
3024static struct
3025 {
3026 int scale;
3027 int index;
3028 int base;
3029 }
3030sib;
c0f3af97
L
3031static struct
3032 {
3033 int register_specifier;
3034 int length;
3035 int prefix;
3036 int w;
43234a1e
L
3037 int evex;
3038 int r;
3039 int v;
3040 int mask_register_specifier;
3041 int zeroing;
3042 int ll;
3043 int b;
c0f3af97
L
3044 }
3045vex;
3046static unsigned char need_vex;
3047static unsigned char need_vex_reg;
dae39acc 3048static unsigned char vex_w_done;
252b5132 3049
ea397f5b
L
3050struct op
3051 {
3052 const char *name;
3053 unsigned int len;
3054 };
3055
4bba6815
AM
3056/* If we are accessing mod/rm/reg without need_modrm set, then the
3057 values are stale. Hitting this abort likely indicates that you
3058 need to update onebyte_has_modrm or twobyte_has_modrm. */
3059#define MODRM_CHECK if (!need_modrm) abort ()
3060
d708bcba
AM
3061static const char **names64;
3062static const char **names32;
3063static const char **names16;
3064static const char **names8;
3065static const char **names8rex;
3066static const char **names_seg;
db51cc60
L
3067static const char *index64;
3068static const char *index32;
d708bcba 3069static const char **index16;
7e8b059b 3070static const char **names_bnd;
d708bcba
AM
3071
3072static const char *intel_names64[] = {
3073 "rax", "rcx", "rdx", "rbx", "rsp", "rbp", "rsi", "rdi",
3074 "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
3075};
3076static const char *intel_names32[] = {
3077 "eax", "ecx", "edx", "ebx", "esp", "ebp", "esi", "edi",
3078 "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d"
3079};
3080static const char *intel_names16[] = {
3081 "ax", "cx", "dx", "bx", "sp", "bp", "si", "di",
3082 "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
3083};
3084static const char *intel_names8[] = {
3085 "al", "cl", "dl", "bl", "ah", "ch", "dh", "bh",
3086};
3087static const char *intel_names8rex[] = {
3088 "al", "cl", "dl", "bl", "spl", "bpl", "sil", "dil",
3089 "r8b", "r9b", "r10b", "r11b", "r12b", "r13b", "r14b", "r15b"
3090};
3091static const char *intel_names_seg[] = {
3092 "es", "cs", "ss", "ds", "fs", "gs", "?", "?",
3093};
db51cc60
L
3094static const char *intel_index64 = "riz";
3095static const char *intel_index32 = "eiz";
d708bcba
AM
3096static const char *intel_index16[] = {
3097 "bx+si", "bx+di", "bp+si", "bp+di", "si", "di", "bp", "bx"
3098};
3099
3100static const char *att_names64[] = {
3101 "%rax", "%rcx", "%rdx", "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
52b15da3
JH
3102 "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
3103};
d708bcba
AM
3104static const char *att_names32[] = {
3105 "%eax", "%ecx", "%edx", "%ebx", "%esp", "%ebp", "%esi", "%edi",
52b15da3 3106 "%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
252b5132 3107};
d708bcba
AM
3108static const char *att_names16[] = {
3109 "%ax", "%cx", "%dx", "%bx", "%sp", "%bp", "%si", "%di",
52b15da3 3110 "%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
252b5132 3111};
d708bcba
AM
3112static const char *att_names8[] = {
3113 "%al", "%cl", "%dl", "%bl", "%ah", "%ch", "%dh", "%bh",
252b5132 3114};
d708bcba
AM
3115static const char *att_names8rex[] = {
3116 "%al", "%cl", "%dl", "%bl", "%spl", "%bpl", "%sil", "%dil",
52b15da3
JH
3117 "%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
3118};
d708bcba
AM
3119static const char *att_names_seg[] = {
3120 "%es", "%cs", "%ss", "%ds", "%fs", "%gs", "%?", "%?",
252b5132 3121};
db51cc60
L
3122static const char *att_index64 = "%riz";
3123static const char *att_index32 = "%eiz";
d708bcba
AM
3124static const char *att_index16[] = {
3125 "%bx,%si", "%bx,%di", "%bp,%si", "%bp,%di", "%si", "%di", "%bp", "%bx"
252b5132
RH
3126};
3127
b9733481
L
3128static const char **names_mm;
3129static const char *intel_names_mm[] = {
3130 "mm0", "mm1", "mm2", "mm3",
3131 "mm4", "mm5", "mm6", "mm7"
3132};
3133static const char *att_names_mm[] = {
3134 "%mm0", "%mm1", "%mm2", "%mm3",
3135 "%mm4", "%mm5", "%mm6", "%mm7"
3136};
3137
7e8b059b
L
3138static const char *intel_names_bnd[] = {
3139 "bnd0", "bnd1", "bnd2", "bnd3"
3140};
3141
3142static const char *att_names_bnd[] = {
3143 "%bnd0", "%bnd1", "%bnd2", "%bnd3"
3144};
3145
b9733481
L
3146static const char **names_xmm;
3147static const char *intel_names_xmm[] = {
3148 "xmm0", "xmm1", "xmm2", "xmm3",
3149 "xmm4", "xmm5", "xmm6", "xmm7",
3150 "xmm8", "xmm9", "xmm10", "xmm11",
43234a1e
L
3151 "xmm12", "xmm13", "xmm14", "xmm15",
3152 "xmm16", "xmm17", "xmm18", "xmm19",
3153 "xmm20", "xmm21", "xmm22", "xmm23",
3154 "xmm24", "xmm25", "xmm26", "xmm27",
3155 "xmm28", "xmm29", "xmm30", "xmm31"
b9733481
L
3156};
3157static const char *att_names_xmm[] = {
3158 "%xmm0", "%xmm1", "%xmm2", "%xmm3",
3159 "%xmm4", "%xmm5", "%xmm6", "%xmm7",
3160 "%xmm8", "%xmm9", "%xmm10", "%xmm11",
43234a1e
L
3161 "%xmm12", "%xmm13", "%xmm14", "%xmm15",
3162 "%xmm16", "%xmm17", "%xmm18", "%xmm19",
3163 "%xmm20", "%xmm21", "%xmm22", "%xmm23",
3164 "%xmm24", "%xmm25", "%xmm26", "%xmm27",
3165 "%xmm28", "%xmm29", "%xmm30", "%xmm31"
b9733481
L
3166};
3167
3168static const char **names_ymm;
3169static const char *intel_names_ymm[] = {
3170 "ymm0", "ymm1", "ymm2", "ymm3",
3171 "ymm4", "ymm5", "ymm6", "ymm7",
3172 "ymm8", "ymm9", "ymm10", "ymm11",
43234a1e
L
3173 "ymm12", "ymm13", "ymm14", "ymm15",
3174 "ymm16", "ymm17", "ymm18", "ymm19",
3175 "ymm20", "ymm21", "ymm22", "ymm23",
3176 "ymm24", "ymm25", "ymm26", "ymm27",
3177 "ymm28", "ymm29", "ymm30", "ymm31"
b9733481
L
3178};
3179static const char *att_names_ymm[] = {
3180 "%ymm0", "%ymm1", "%ymm2", "%ymm3",
3181 "%ymm4", "%ymm5", "%ymm6", "%ymm7",
3182 "%ymm8", "%ymm9", "%ymm10", "%ymm11",
43234a1e
L
3183 "%ymm12", "%ymm13", "%ymm14", "%ymm15",
3184 "%ymm16", "%ymm17", "%ymm18", "%ymm19",
3185 "%ymm20", "%ymm21", "%ymm22", "%ymm23",
3186 "%ymm24", "%ymm25", "%ymm26", "%ymm27",
3187 "%ymm28", "%ymm29", "%ymm30", "%ymm31"
3188};
3189
3190static const char **names_zmm;
3191static const char *intel_names_zmm[] = {
3192 "zmm0", "zmm1", "zmm2", "zmm3",
3193 "zmm4", "zmm5", "zmm6", "zmm7",
3194 "zmm8", "zmm9", "zmm10", "zmm11",
3195 "zmm12", "zmm13", "zmm14", "zmm15",
3196 "zmm16", "zmm17", "zmm18", "zmm19",
3197 "zmm20", "zmm21", "zmm22", "zmm23",
3198 "zmm24", "zmm25", "zmm26", "zmm27",
3199 "zmm28", "zmm29", "zmm30", "zmm31"
3200};
3201static const char *att_names_zmm[] = {
3202 "%zmm0", "%zmm1", "%zmm2", "%zmm3",
3203 "%zmm4", "%zmm5", "%zmm6", "%zmm7",
3204 "%zmm8", "%zmm9", "%zmm10", "%zmm11",
3205 "%zmm12", "%zmm13", "%zmm14", "%zmm15",
3206 "%zmm16", "%zmm17", "%zmm18", "%zmm19",
3207 "%zmm20", "%zmm21", "%zmm22", "%zmm23",
3208 "%zmm24", "%zmm25", "%zmm26", "%zmm27",
3209 "%zmm28", "%zmm29", "%zmm30", "%zmm31"
3210};
3211
3212static const char **names_mask;
3213static const char *intel_names_mask[] = {
3214 "k0", "k1", "k2", "k3", "k4", "k5", "k6", "k7"
3215};
3216static const char *att_names_mask[] = {
3217 "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
3218};
3219
3220static const char *names_rounding[] =
3221{
3222 "{rn-sae}",
3223 "{rd-sae}",
3224 "{ru-sae}",
3225 "{rz-sae}"
b9733481
L
3226};
3227
1ceb70f8
L
3228static const struct dis386 reg_table[][8] = {
3229 /* REG_80 */
252b5132 3230 {
bf890a93
IT
3231 { "addA", { Ebh1, Ib }, 0 },
3232 { "orA", { Ebh1, Ib }, 0 },
3233 { "adcA", { Ebh1, Ib }, 0 },
3234 { "sbbA", { Ebh1, Ib }, 0 },
3235 { "andA", { Ebh1, Ib }, 0 },
3236 { "subA", { Ebh1, Ib }, 0 },
3237 { "xorA", { Ebh1, Ib }, 0 },
3238 { "cmpA", { Eb, Ib }, 0 },
252b5132 3239 },
1ceb70f8 3240 /* REG_81 */
252b5132 3241 {
bf890a93
IT
3242 { "addQ", { Evh1, Iv }, 0 },
3243 { "orQ", { Evh1, Iv }, 0 },
3244 { "adcQ", { Evh1, Iv }, 0 },
3245 { "sbbQ", { Evh1, Iv }, 0 },
3246 { "andQ", { Evh1, Iv }, 0 },
3247 { "subQ", { Evh1, Iv }, 0 },
3248 { "xorQ", { Evh1, Iv }, 0 },
3249 { "cmpQ", { Ev, Iv }, 0 },
252b5132 3250 },
7148c369 3251 /* REG_83 */
252b5132 3252 {
bf890a93
IT
3253 { "addQ", { Evh1, sIb }, 0 },
3254 { "orQ", { Evh1, sIb }, 0 },
3255 { "adcQ", { Evh1, sIb }, 0 },
3256 { "sbbQ", { Evh1, sIb }, 0 },
3257 { "andQ", { Evh1, sIb }, 0 },
3258 { "subQ", { Evh1, sIb }, 0 },
3259 { "xorQ", { Evh1, sIb }, 0 },
3260 { "cmpQ", { Ev, sIb }, 0 },
252b5132 3261 },
1ceb70f8 3262 /* REG_8F */
4e7d34a6 3263 {
bf890a93 3264 { "popU", { stackEv }, 0 },
c48244a5 3265 { XOP_8F_TABLE (XOP_09) },
592d1631
L
3266 { Bad_Opcode },
3267 { Bad_Opcode },
3268 { Bad_Opcode },
f88c9eb0 3269 { XOP_8F_TABLE (XOP_09) },
4e7d34a6 3270 },
1ceb70f8 3271 /* REG_C0 */
252b5132 3272 {
bf890a93
IT
3273 { "rolA", { Eb, Ib }, 0 },
3274 { "rorA", { Eb, Ib }, 0 },
3275 { "rclA", { Eb, Ib }, 0 },
3276 { "rcrA", { Eb, Ib }, 0 },
3277 { "shlA", { Eb, Ib }, 0 },
3278 { "shrA", { Eb, Ib }, 0 },
e4bdd679 3279 { "shlA", { Eb, Ib }, 0 },
bf890a93 3280 { "sarA", { Eb, Ib }, 0 },
252b5132 3281 },
1ceb70f8 3282 /* REG_C1 */
252b5132 3283 {
bf890a93
IT
3284 { "rolQ", { Ev, Ib }, 0 },
3285 { "rorQ", { Ev, Ib }, 0 },
3286 { "rclQ", { Ev, Ib }, 0 },
3287 { "rcrQ", { Ev, Ib }, 0 },
3288 { "shlQ", { Ev, Ib }, 0 },
3289 { "shrQ", { Ev, Ib }, 0 },
e4bdd679 3290 { "shlQ", { Ev, Ib }, 0 },
bf890a93 3291 { "sarQ", { Ev, Ib }, 0 },
252b5132 3292 },
1ceb70f8 3293 /* REG_C6 */
4e7d34a6 3294 {
bf890a93 3295 { "movA", { Ebh3, Ib }, 0 },
42164a71
L
3296 { Bad_Opcode },
3297 { Bad_Opcode },
3298 { Bad_Opcode },
3299 { Bad_Opcode },
3300 { Bad_Opcode },
3301 { Bad_Opcode },
3302 { MOD_TABLE (MOD_C6_REG_7) },
4e7d34a6 3303 },
1ceb70f8 3304 /* REG_C7 */
4e7d34a6 3305 {
bf890a93 3306 { "movQ", { Evh3, Iv }, 0 },
42164a71
L
3307 { Bad_Opcode },
3308 { Bad_Opcode },
3309 { Bad_Opcode },
3310 { Bad_Opcode },
3311 { Bad_Opcode },
3312 { Bad_Opcode },
3313 { MOD_TABLE (MOD_C7_REG_7) },
4e7d34a6 3314 },
1ceb70f8 3315 /* REG_D0 */
252b5132 3316 {
bf890a93
IT
3317 { "rolA", { Eb, I1 }, 0 },
3318 { "rorA", { Eb, I1 }, 0 },
3319 { "rclA", { Eb, I1 }, 0 },
3320 { "rcrA", { Eb, I1 }, 0 },
3321 { "shlA", { Eb, I1 }, 0 },
3322 { "shrA", { Eb, I1 }, 0 },
e4bdd679 3323 { "shlA", { Eb, I1 }, 0 },
bf890a93 3324 { "sarA", { Eb, I1 }, 0 },
252b5132 3325 },
1ceb70f8 3326 /* REG_D1 */
252b5132 3327 {
bf890a93
IT
3328 { "rolQ", { Ev, I1 }, 0 },
3329 { "rorQ", { Ev, I1 }, 0 },
3330 { "rclQ", { Ev, I1 }, 0 },
3331 { "rcrQ", { Ev, I1 }, 0 },
3332 { "shlQ", { Ev, I1 }, 0 },
3333 { "shrQ", { Ev, I1 }, 0 },
e4bdd679 3334 { "shlQ", { Ev, I1 }, 0 },
bf890a93 3335 { "sarQ", { Ev, I1 }, 0 },
252b5132 3336 },
1ceb70f8 3337 /* REG_D2 */
252b5132 3338 {
bf890a93
IT
3339 { "rolA", { Eb, CL }, 0 },
3340 { "rorA", { Eb, CL }, 0 },
3341 { "rclA", { Eb, CL }, 0 },
3342 { "rcrA", { Eb, CL }, 0 },
3343 { "shlA", { Eb, CL }, 0 },
3344 { "shrA", { Eb, CL }, 0 },
e4bdd679 3345 { "shlA", { Eb, CL }, 0 },
bf890a93 3346 { "sarA", { Eb, CL }, 0 },
252b5132 3347 },
1ceb70f8 3348 /* REG_D3 */
252b5132 3349 {
bf890a93
IT
3350 { "rolQ", { Ev, CL }, 0 },
3351 { "rorQ", { Ev, CL }, 0 },
3352 { "rclQ", { Ev, CL }, 0 },
3353 { "rcrQ", { Ev, CL }, 0 },
3354 { "shlQ", { Ev, CL }, 0 },
3355 { "shrQ", { Ev, CL }, 0 },
e4bdd679 3356 { "shlQ", { Ev, CL }, 0 },
bf890a93 3357 { "sarQ", { Ev, CL }, 0 },
252b5132 3358 },
1ceb70f8 3359 /* REG_F6 */
252b5132 3360 {
bf890a93 3361 { "testA", { Eb, Ib }, 0 },
7db2c588 3362 { "testA", { Eb, Ib }, 0 },
bf890a93
IT
3363 { "notA", { Ebh1 }, 0 },
3364 { "negA", { Ebh1 }, 0 },
3365 { "mulA", { Eb }, 0 }, /* Don't print the implicit %al register, */
3366 { "imulA", { Eb }, 0 }, /* to distinguish these opcodes from other */
3367 { "divA", { Eb }, 0 }, /* mul/imul opcodes. Do the same for div */
3368 { "idivA", { Eb }, 0 }, /* and idiv for consistency. */
252b5132 3369 },
1ceb70f8 3370 /* REG_F7 */
252b5132 3371 {
bf890a93 3372 { "testQ", { Ev, Iv }, 0 },
7db2c588 3373 { "testQ", { Ev, Iv }, 0 },
bf890a93
IT
3374 { "notQ", { Evh1 }, 0 },
3375 { "negQ", { Evh1 }, 0 },
3376 { "mulQ", { Ev }, 0 }, /* Don't print the implicit register. */
3377 { "imulQ", { Ev }, 0 },
3378 { "divQ", { Ev }, 0 },
3379 { "idivQ", { Ev }, 0 },
252b5132 3380 },
1ceb70f8 3381 /* REG_FE */
252b5132 3382 {
bf890a93
IT
3383 { "incA", { Ebh1 }, 0 },
3384 { "decA", { Ebh1 }, 0 },
252b5132 3385 },
1ceb70f8 3386 /* REG_FF */
252b5132 3387 {
bf890a93
IT
3388 { "incQ", { Evh1 }, 0 },
3389 { "decQ", { Evh1 }, 0 },
9fef80d6 3390 { "call{&|}", { NOTRACK, indirEv, BND }, 0 },
4a357820 3391 { MOD_TABLE (MOD_FF_REG_3) },
9fef80d6 3392 { "jmp{&|}", { NOTRACK, indirEv, BND }, 0 },
4a357820 3393 { MOD_TABLE (MOD_FF_REG_5) },
bf890a93 3394 { "pushU", { stackEv }, 0 },
592d1631 3395 { Bad_Opcode },
252b5132 3396 },
1ceb70f8 3397 /* REG_0F00 */
252b5132 3398 {
bf890a93
IT
3399 { "sldtD", { Sv }, 0 },
3400 { "strD", { Sv }, 0 },
3401 { "lldt", { Ew }, 0 },
3402 { "ltr", { Ew }, 0 },
3403 { "verr", { Ew }, 0 },
3404 { "verw", { Ew }, 0 },
592d1631
L
3405 { Bad_Opcode },
3406 { Bad_Opcode },
252b5132 3407 },
1ceb70f8 3408 /* REG_0F01 */
252b5132 3409 {
1ceb70f8
L
3410 { MOD_TABLE (MOD_0F01_REG_0) },
3411 { MOD_TABLE (MOD_0F01_REG_1) },
3412 { MOD_TABLE (MOD_0F01_REG_2) },
3413 { MOD_TABLE (MOD_0F01_REG_3) },
bf890a93 3414 { "smswD", { Sv }, 0 },
8eab4136 3415 { MOD_TABLE (MOD_0F01_REG_5) },
bf890a93 3416 { "lmsw", { Ew }, 0 },
1ceb70f8 3417 { MOD_TABLE (MOD_0F01_REG_7) },
252b5132 3418 },
b5b1fc4f 3419 /* REG_0F0D */
252b5132 3420 {
bf890a93
IT
3421 { "prefetch", { Mb }, 0 },
3422 { "prefetchw", { Mb }, 0 },
3423 { "prefetchwt1", { Mb }, 0 },
3424 { "prefetch", { Mb }, 0 },
3425 { "prefetch", { Mb }, 0 },
3426 { "prefetch", { Mb }, 0 },
3427 { "prefetch", { Mb }, 0 },
3428 { "prefetch", { Mb }, 0 },
252b5132 3429 },
1ceb70f8 3430 /* REG_0F18 */
252b5132 3431 {
1ceb70f8
L
3432 { MOD_TABLE (MOD_0F18_REG_0) },
3433 { MOD_TABLE (MOD_0F18_REG_1) },
3434 { MOD_TABLE (MOD_0F18_REG_2) },
3435 { MOD_TABLE (MOD_0F18_REG_3) },
d7189fa5
RM
3436 { MOD_TABLE (MOD_0F18_REG_4) },
3437 { MOD_TABLE (MOD_0F18_REG_5) },
3438 { MOD_TABLE (MOD_0F18_REG_6) },
3439 { MOD_TABLE (MOD_0F18_REG_7) },
252b5132 3440 },
c48935d7
IT
3441 /* REG_0F1C_MOD_0 */
3442 {
3443 { "cldemote", { Mb }, 0 },
3444 { "nopQ", { Ev }, 0 },
3445 { "nopQ", { Ev }, 0 },
3446 { "nopQ", { Ev }, 0 },
3447 { "nopQ", { Ev }, 0 },
3448 { "nopQ", { Ev }, 0 },
3449 { "nopQ", { Ev }, 0 },
3450 { "nopQ", { Ev }, 0 },
3451 },
603555e5
L
3452 /* REG_0F1E_MOD_3 */
3453 {
3454 { "nopQ", { Ev }, 0 },
3455 { "rdsspK", { Rdq }, PREFIX_OPCODE },
3456 { "nopQ", { Ev }, 0 },
3457 { "nopQ", { Ev }, 0 },
3458 { "nopQ", { Ev }, 0 },
3459 { "nopQ", { Ev }, 0 },
3460 { "nopQ", { Ev }, 0 },
3461 { RM_TABLE (RM_0F1E_MOD_3_REG_7) },
3462 },
1ceb70f8 3463 /* REG_0F71 */
a6bd098c 3464 {
592d1631
L
3465 { Bad_Opcode },
3466 { Bad_Opcode },
1ceb70f8 3467 { MOD_TABLE (MOD_0F71_REG_2) },
592d1631 3468 { Bad_Opcode },
1ceb70f8 3469 { MOD_TABLE (MOD_0F71_REG_4) },
592d1631 3470 { Bad_Opcode },
1ceb70f8 3471 { MOD_TABLE (MOD_0F71_REG_6) },
a6bd098c 3472 },
1ceb70f8 3473 /* REG_0F72 */
a6bd098c 3474 {
592d1631
L
3475 { Bad_Opcode },
3476 { Bad_Opcode },
1ceb70f8 3477 { MOD_TABLE (MOD_0F72_REG_2) },
592d1631 3478 { Bad_Opcode },
1ceb70f8 3479 { MOD_TABLE (MOD_0F72_REG_4) },
592d1631 3480 { Bad_Opcode },
1ceb70f8 3481 { MOD_TABLE (MOD_0F72_REG_6) },
a6bd098c 3482 },
1ceb70f8 3483 /* REG_0F73 */
252b5132 3484 {
592d1631
L
3485 { Bad_Opcode },
3486 { Bad_Opcode },
1ceb70f8
L
3487 { MOD_TABLE (MOD_0F73_REG_2) },
3488 { MOD_TABLE (MOD_0F73_REG_3) },
592d1631
L
3489 { Bad_Opcode },
3490 { Bad_Opcode },
1ceb70f8
L
3491 { MOD_TABLE (MOD_0F73_REG_6) },
3492 { MOD_TABLE (MOD_0F73_REG_7) },
252b5132 3493 },
1ceb70f8 3494 /* REG_0FA6 */
252b5132 3495 {
bf890a93
IT
3496 { "montmul", { { OP_0f07, 0 } }, 0 },
3497 { "xsha1", { { OP_0f07, 0 } }, 0 },
3498 { "xsha256", { { OP_0f07, 0 } }, 0 },
4e7d34a6 3499 },
1ceb70f8 3500 /* REG_0FA7 */
4e7d34a6 3501 {
bf890a93
IT
3502 { "xstore-rng", { { OP_0f07, 0 } }, 0 },
3503 { "xcrypt-ecb", { { OP_0f07, 0 } }, 0 },
3504 { "xcrypt-cbc", { { OP_0f07, 0 } }, 0 },
3505 { "xcrypt-ctr", { { OP_0f07, 0 } }, 0 },
3506 { "xcrypt-cfb", { { OP_0f07, 0 } }, 0 },
3507 { "xcrypt-ofb", { { OP_0f07, 0 } }, 0 },
4e7d34a6 3508 },
1ceb70f8 3509 /* REG_0FAE */
4e7d34a6 3510 {
1ceb70f8
L
3511 { MOD_TABLE (MOD_0FAE_REG_0) },
3512 { MOD_TABLE (MOD_0FAE_REG_1) },
3513 { MOD_TABLE (MOD_0FAE_REG_2) },
3514 { MOD_TABLE (MOD_0FAE_REG_3) },
475a2301 3515 { MOD_TABLE (MOD_0FAE_REG_4) },
1ceb70f8
L
3516 { MOD_TABLE (MOD_0FAE_REG_5) },
3517 { MOD_TABLE (MOD_0FAE_REG_6) },
3518 { MOD_TABLE (MOD_0FAE_REG_7) },
252b5132 3519 },
1ceb70f8 3520 /* REG_0FBA */
252b5132 3521 {
592d1631
L
3522 { Bad_Opcode },
3523 { Bad_Opcode },
3524 { Bad_Opcode },
3525 { Bad_Opcode },
bf890a93
IT
3526 { "btQ", { Ev, Ib }, 0 },
3527 { "btsQ", { Evh1, Ib }, 0 },
3528 { "btrQ", { Evh1, Ib }, 0 },
3529 { "btcQ", { Evh1, Ib }, 0 },
c608c12e 3530 },
1ceb70f8 3531 /* REG_0FC7 */
c608c12e 3532 {
592d1631 3533 { Bad_Opcode },
bf890a93 3534 { "cmpxchg8b", { { CMPXCHG8B_Fixup, q_mode } }, 0 },
592d1631 3535 { Bad_Opcode },
963f3586
IT
3536 { MOD_TABLE (MOD_0FC7_REG_3) },
3537 { MOD_TABLE (MOD_0FC7_REG_4) },
3538 { MOD_TABLE (MOD_0FC7_REG_5) },
1ceb70f8
L
3539 { MOD_TABLE (MOD_0FC7_REG_6) },
3540 { MOD_TABLE (MOD_0FC7_REG_7) },
252b5132 3541 },
592a252b 3542 /* REG_VEX_0F71 */
c0f3af97 3543 {
592d1631
L
3544 { Bad_Opcode },
3545 { Bad_Opcode },
592a252b 3546 { MOD_TABLE (MOD_VEX_0F71_REG_2) },
592d1631 3547 { Bad_Opcode },
592a252b 3548 { MOD_TABLE (MOD_VEX_0F71_REG_4) },
592d1631 3549 { Bad_Opcode },
592a252b 3550 { MOD_TABLE (MOD_VEX_0F71_REG_6) },
c0f3af97 3551 },
592a252b 3552 /* REG_VEX_0F72 */
c0f3af97 3553 {
592d1631
L
3554 { Bad_Opcode },
3555 { Bad_Opcode },
592a252b 3556 { MOD_TABLE (MOD_VEX_0F72_REG_2) },
592d1631 3557 { Bad_Opcode },
592a252b 3558 { MOD_TABLE (MOD_VEX_0F72_REG_4) },
592d1631 3559 { Bad_Opcode },
592a252b 3560 { MOD_TABLE (MOD_VEX_0F72_REG_6) },
c0f3af97 3561 },
592a252b 3562 /* REG_VEX_0F73 */
c0f3af97 3563 {
592d1631
L
3564 { Bad_Opcode },
3565 { Bad_Opcode },
592a252b
L
3566 { MOD_TABLE (MOD_VEX_0F73_REG_2) },
3567 { MOD_TABLE (MOD_VEX_0F73_REG_3) },
592d1631
L
3568 { Bad_Opcode },
3569 { Bad_Opcode },
592a252b
L
3570 { MOD_TABLE (MOD_VEX_0F73_REG_6) },
3571 { MOD_TABLE (MOD_VEX_0F73_REG_7) },
c0f3af97 3572 },
592a252b 3573 /* REG_VEX_0FAE */
c0f3af97 3574 {
592d1631
L
3575 { Bad_Opcode },
3576 { Bad_Opcode },
592a252b
L
3577 { MOD_TABLE (MOD_VEX_0FAE_REG_2) },
3578 { MOD_TABLE (MOD_VEX_0FAE_REG_3) },
c0f3af97 3579 },
f12dc422
L
3580 /* REG_VEX_0F38F3 */
3581 {
3582 { Bad_Opcode },
3583 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_1) },
3584 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_2) },
3585 { PREFIX_TABLE (PREFIX_VEX_0F38F3_REG_3) },
3586 },
f88c9eb0
SP
3587 /* REG_XOP_LWPCB */
3588 {
bf890a93
IT
3589 { "llwpcb", { { OP_LWPCB_E, 0 } }, 0 },
3590 { "slwpcb", { { OP_LWPCB_E, 0 } }, 0 },
f88c9eb0
SP
3591 },
3592 /* REG_XOP_LWP */
3593 {
bf890a93
IT
3594 { "lwpins", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
3595 { "lwpval", { { OP_LWP_E, 0 }, Ed, Iq }, 0 },
f88c9eb0 3596 },
2a2a0f38
QN
3597 /* REG_XOP_TBM_01 */
3598 {
3599 { Bad_Opcode },
bf890a93
IT
3600 { "blcfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3601 { "blsfill", { { OP_LWP_E, 0 }, Ev }, 0 },
3602 { "blcs", { { OP_LWP_E, 0 }, Ev }, 0 },
3603 { "tzmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
3604 { "blcic", { { OP_LWP_E, 0 }, Ev }, 0 },
3605 { "blsic", { { OP_LWP_E, 0 }, Ev }, 0 },
3606 { "t1mskc", { { OP_LWP_E, 0 }, Ev }, 0 },
2a2a0f38
QN
3607 },
3608 /* REG_XOP_TBM_02 */
3609 {
3610 { Bad_Opcode },
bf890a93 3611 { "blcmsk", { { OP_LWP_E, 0 }, Ev }, 0 },
2a2a0f38
QN
3612 { Bad_Opcode },
3613 { Bad_Opcode },
3614 { Bad_Opcode },
3615 { Bad_Opcode },
bf890a93 3616 { "blci", { { OP_LWP_E, 0 }, Ev }, 0 },
2a2a0f38 3617 },
43234a1e
L
3618#define NEED_REG_TABLE
3619#include "i386-dis-evex.h"
3620#undef NEED_REG_TABLE
4e7d34a6
L
3621};
3622
1ceb70f8
L
3623static const struct dis386 prefix_table[][4] = {
3624 /* PREFIX_90 */
252b5132 3625 {
bf890a93
IT
3626 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
3627 { "pause", { XX }, 0 },
3628 { "xchgS", { { NOP_Fixup1, eAX_reg }, { NOP_Fixup2, eAX_reg } }, 0 },
507bd325 3629 { NULL, { { NULL, 0 } }, PREFIX_IGNORED }
0f10071e 3630 },
4e7d34a6 3631
603555e5
L
3632 /* PREFIX_MOD_0_0F01_REG_5 */
3633 {
3634 { Bad_Opcode },
3635 { "rstorssp", { Mq }, PREFIX_OPCODE },
3636 },
3637
2234eee6 3638 /* PREFIX_MOD_3_0F01_REG_5_RM_0 */
603555e5
L
3639 {
3640 { Bad_Opcode },
2234eee6 3641 { "setssbsy", { Skip_MODRM }, PREFIX_OPCODE },
603555e5
L
3642 },
3643
3644 /* PREFIX_MOD_3_0F01_REG_5_RM_2 */
3645 {
3646 { Bad_Opcode },
c2f76402 3647 { "saveprevssp", { Skip_MODRM }, PREFIX_OPCODE },
603555e5
L
3648 },
3649
3233d7d0
IT
3650 /* PREFIX_0F09 */
3651 {
3652 { "wbinvd", { XX }, 0 },
3653 { "wbnoinvd", { XX }, 0 },
3654 },
3655
1ceb70f8 3656 /* PREFIX_0F10 */
cc0ec051 3657 {
507bd325
L
3658 { "movups", { XM, EXx }, PREFIX_OPCODE },
3659 { "movss", { XM, EXd }, PREFIX_OPCODE },
3660 { "movupd", { XM, EXx }, PREFIX_OPCODE },
3661 { "movsd", { XM, EXq }, PREFIX_OPCODE },
30d1c836 3662 },
4e7d34a6 3663
1ceb70f8 3664 /* PREFIX_0F11 */
30d1c836 3665 {
507bd325
L
3666 { "movups", { EXxS, XM }, PREFIX_OPCODE },
3667 { "movss", { EXdS, XM }, PREFIX_OPCODE },
3668 { "movupd", { EXxS, XM }, PREFIX_OPCODE },
3669 { "movsd", { EXqS, XM }, PREFIX_OPCODE },
4e7d34a6 3670 },
252b5132 3671
1ceb70f8 3672 /* PREFIX_0F12 */
c608c12e 3673 {
1ceb70f8 3674 { MOD_TABLE (MOD_0F12_PREFIX_0) },
507bd325
L
3675 { "movsldup", { XM, EXx }, PREFIX_OPCODE },
3676 { "movlpd", { XM, EXq }, PREFIX_OPCODE },
3677 { "movddup", { XM, EXq }, PREFIX_OPCODE },
c608c12e 3678 },
4e7d34a6 3679
1ceb70f8 3680 /* PREFIX_0F16 */
c608c12e 3681 {
1ceb70f8 3682 { MOD_TABLE (MOD_0F16_PREFIX_0) },
507bd325
L
3683 { "movshdup", { XM, EXx }, PREFIX_OPCODE },
3684 { "movhpd", { XM, EXq }, PREFIX_OPCODE },
c608c12e 3685 },
4e7d34a6 3686
7e8b059b
L
3687 /* PREFIX_0F1A */
3688 {
3689 { MOD_TABLE (MOD_0F1A_PREFIX_0) },
bf890a93
IT
3690 { "bndcl", { Gbnd, Ev_bnd }, 0 },
3691 { "bndmov", { Gbnd, Ebnd }, 0 },
3692 { "bndcu", { Gbnd, Ev_bnd }, 0 },
7e8b059b
L
3693 },
3694
3695 /* PREFIX_0F1B */
3696 {
3697 { MOD_TABLE (MOD_0F1B_PREFIX_0) },
3698 { MOD_TABLE (MOD_0F1B_PREFIX_1) },
9f79e886 3699 { "bndmov", { EbndS, Gbnd }, 0 },
bf890a93 3700 { "bndcn", { Gbnd, Ev_bnd }, 0 },
7e8b059b
L
3701 },
3702
c48935d7
IT
3703 /* PREFIX_0F1C */
3704 {
3705 { MOD_TABLE (MOD_0F1C_PREFIX_0) },
3706 { "nopQ", { Ev }, PREFIX_OPCODE },
3707 { "nopQ", { Ev }, PREFIX_OPCODE },
3708 { "nopQ", { Ev }, PREFIX_OPCODE },
3709 },
3710
603555e5
L
3711 /* PREFIX_0F1E */
3712 {
3713 { "nopQ", { Ev }, PREFIX_OPCODE },
3714 { MOD_TABLE (MOD_0F1E_PREFIX_1) },
3715 { "nopQ", { Ev }, PREFIX_OPCODE },
3716 { "nopQ", { Ev }, PREFIX_OPCODE },
3717 },
3718
1ceb70f8 3719 /* PREFIX_0F2A */
c608c12e 3720 {
507bd325
L
3721 { "cvtpi2ps", { XM, EMCq }, PREFIX_OPCODE },
3722 { "cvtsi2ss%LQ", { XM, Ev }, PREFIX_OPCODE },
3723 { "cvtpi2pd", { XM, EMCq }, PREFIX_OPCODE },
bf890a93 3724 { "cvtsi2sd%LQ", { XM, Ev }, 0 },
c608c12e 3725 },
4e7d34a6 3726
1ceb70f8 3727 /* PREFIX_0F2B */
c608c12e 3728 {
75c135a8
L
3729 { MOD_TABLE (MOD_0F2B_PREFIX_0) },
3730 { MOD_TABLE (MOD_0F2B_PREFIX_1) },
3731 { MOD_TABLE (MOD_0F2B_PREFIX_2) },
3732 { MOD_TABLE (MOD_0F2B_PREFIX_3) },
c608c12e 3733 },
4e7d34a6 3734
1ceb70f8 3735 /* PREFIX_0F2C */
c608c12e 3736 {
507bd325 3737 { "cvttps2pi", { MXC, EXq }, PREFIX_OPCODE },
9646c87b 3738 { "cvttss2si", { Gv, EXd }, PREFIX_OPCODE },
507bd325 3739 { "cvttpd2pi", { MXC, EXx }, PREFIX_OPCODE },
9646c87b 3740 { "cvttsd2si", { Gv, EXq }, PREFIX_OPCODE },
c608c12e 3741 },
4e7d34a6 3742
1ceb70f8 3743 /* PREFIX_0F2D */
c608c12e 3744 {
507bd325 3745 { "cvtps2pi", { MXC, EXq }, PREFIX_OPCODE },
9646c87b 3746 { "cvtss2si", { Gv, EXd }, PREFIX_OPCODE },
507bd325 3747 { "cvtpd2pi", { MXC, EXx }, PREFIX_OPCODE },
9646c87b 3748 { "cvtsd2si", { Gv, EXq }, PREFIX_OPCODE },
c608c12e 3749 },
4e7d34a6 3750
1ceb70f8 3751 /* PREFIX_0F2E */
c608c12e 3752 {
bf890a93 3753 { "ucomiss",{ XM, EXd }, 0 },
592d1631 3754 { Bad_Opcode },
bf890a93 3755 { "ucomisd",{ XM, EXq }, 0 },
c608c12e 3756 },
4e7d34a6 3757
1ceb70f8 3758 /* PREFIX_0F2F */
c608c12e 3759 {
bf890a93 3760 { "comiss", { XM, EXd }, 0 },
592d1631 3761 { Bad_Opcode },
bf890a93 3762 { "comisd", { XM, EXq }, 0 },
c608c12e 3763 },
4e7d34a6 3764
1ceb70f8 3765 /* PREFIX_0F51 */
c608c12e 3766 {
507bd325
L
3767 { "sqrtps", { XM, EXx }, PREFIX_OPCODE },
3768 { "sqrtss", { XM, EXd }, PREFIX_OPCODE },
3769 { "sqrtpd", { XM, EXx }, PREFIX_OPCODE },
3770 { "sqrtsd", { XM, EXq }, PREFIX_OPCODE },
c608c12e 3771 },
4e7d34a6 3772
1ceb70f8 3773 /* PREFIX_0F52 */
c608c12e 3774 {
507bd325
L
3775 { "rsqrtps",{ XM, EXx }, PREFIX_OPCODE },
3776 { "rsqrtss",{ XM, EXd }, PREFIX_OPCODE },
c608c12e 3777 },
4e7d34a6 3778
1ceb70f8 3779 /* PREFIX_0F53 */
c608c12e 3780 {
507bd325
L
3781 { "rcpps", { XM, EXx }, PREFIX_OPCODE },
3782 { "rcpss", { XM, EXd }, PREFIX_OPCODE },
c608c12e 3783 },
4e7d34a6 3784
1ceb70f8 3785 /* PREFIX_0F58 */
c608c12e 3786 {
507bd325
L
3787 { "addps", { XM, EXx }, PREFIX_OPCODE },
3788 { "addss", { XM, EXd }, PREFIX_OPCODE },
3789 { "addpd", { XM, EXx }, PREFIX_OPCODE },
3790 { "addsd", { XM, EXq }, PREFIX_OPCODE },
c608c12e 3791 },
4e7d34a6 3792
1ceb70f8 3793 /* PREFIX_0F59 */
c608c12e 3794 {
507bd325
L
3795 { "mulps", { XM, EXx }, PREFIX_OPCODE },
3796 { "mulss", { XM, EXd }, PREFIX_OPCODE },
3797 { "mulpd", { XM, EXx }, PREFIX_OPCODE },
3798 { "mulsd", { XM, EXq }, PREFIX_OPCODE },
041bd2e0 3799 },
4e7d34a6 3800
1ceb70f8 3801 /* PREFIX_0F5A */
041bd2e0 3802 {
507bd325
L
3803 { "cvtps2pd", { XM, EXq }, PREFIX_OPCODE },
3804 { "cvtss2sd", { XM, EXd }, PREFIX_OPCODE },
3805 { "cvtpd2ps", { XM, EXx }, PREFIX_OPCODE },
3806 { "cvtsd2ss", { XM, EXq }, PREFIX_OPCODE },
041bd2e0 3807 },
4e7d34a6 3808
1ceb70f8 3809 /* PREFIX_0F5B */
041bd2e0 3810 {
507bd325
L
3811 { "cvtdq2ps", { XM, EXx }, PREFIX_OPCODE },
3812 { "cvttps2dq", { XM, EXx }, PREFIX_OPCODE },
3813 { "cvtps2dq", { XM, EXx }, PREFIX_OPCODE },
041bd2e0 3814 },
4e7d34a6 3815
1ceb70f8 3816 /* PREFIX_0F5C */
041bd2e0 3817 {
507bd325
L
3818 { "subps", { XM, EXx }, PREFIX_OPCODE },
3819 { "subss", { XM, EXd }, PREFIX_OPCODE },
3820 { "subpd", { XM, EXx }, PREFIX_OPCODE },
3821 { "subsd", { XM, EXq }, PREFIX_OPCODE },
041bd2e0 3822 },
4e7d34a6 3823
1ceb70f8 3824 /* PREFIX_0F5D */
041bd2e0 3825 {
507bd325
L
3826 { "minps", { XM, EXx }, PREFIX_OPCODE },
3827 { "minss", { XM, EXd }, PREFIX_OPCODE },
3828 { "minpd", { XM, EXx }, PREFIX_OPCODE },
3829 { "minsd", { XM, EXq }, PREFIX_OPCODE },
041bd2e0 3830 },
4e7d34a6 3831
1ceb70f8 3832 /* PREFIX_0F5E */
041bd2e0 3833 {
507bd325
L
3834 { "divps", { XM, EXx }, PREFIX_OPCODE },
3835 { "divss", { XM, EXd }, PREFIX_OPCODE },
3836 { "divpd", { XM, EXx }, PREFIX_OPCODE },
3837 { "divsd", { XM, EXq }, PREFIX_OPCODE },
041bd2e0 3838 },
4e7d34a6 3839
1ceb70f8 3840 /* PREFIX_0F5F */
041bd2e0 3841 {
507bd325
L
3842 { "maxps", { XM, EXx }, PREFIX_OPCODE },
3843 { "maxss", { XM, EXd }, PREFIX_OPCODE },
3844 { "maxpd", { XM, EXx }, PREFIX_OPCODE },
3845 { "maxsd", { XM, EXq }, PREFIX_OPCODE },
041bd2e0 3846 },
4e7d34a6 3847
1ceb70f8 3848 /* PREFIX_0F60 */
041bd2e0 3849 {
507bd325 3850 { "punpcklbw",{ MX, EMd }, PREFIX_OPCODE },
592d1631 3851 { Bad_Opcode },
507bd325 3852 { "punpcklbw",{ MX, EMx }, PREFIX_OPCODE },
041bd2e0 3853 },
4e7d34a6 3854
1ceb70f8 3855 /* PREFIX_0F61 */
041bd2e0 3856 {
507bd325 3857 { "punpcklwd",{ MX, EMd }, PREFIX_OPCODE },
592d1631 3858 { Bad_Opcode },
507bd325 3859 { "punpcklwd",{ MX, EMx }, PREFIX_OPCODE },
041bd2e0 3860 },
4e7d34a6 3861
1ceb70f8 3862 /* PREFIX_0F62 */
041bd2e0 3863 {
507bd325 3864 { "punpckldq",{ MX, EMd }, PREFIX_OPCODE },
592d1631 3865 { Bad_Opcode },
507bd325 3866 { "punpckldq",{ MX, EMx }, PREFIX_OPCODE },
041bd2e0 3867 },
4e7d34a6 3868
1ceb70f8 3869 /* PREFIX_0F6C */
041bd2e0 3870 {
592d1631
L
3871 { Bad_Opcode },
3872 { Bad_Opcode },
507bd325 3873 { "punpcklqdq", { XM, EXx }, PREFIX_OPCODE },
0f17484f 3874 },
4e7d34a6 3875
1ceb70f8 3876 /* PREFIX_0F6D */
0f17484f 3877 {
592d1631
L
3878 { Bad_Opcode },
3879 { Bad_Opcode },
507bd325 3880 { "punpckhqdq", { XM, EXx }, PREFIX_OPCODE },
041bd2e0 3881 },
4e7d34a6 3882
1ceb70f8 3883 /* PREFIX_0F6F */
ca164297 3884 {
507bd325
L
3885 { "movq", { MX, EM }, PREFIX_OPCODE },
3886 { "movdqu", { XM, EXx }, PREFIX_OPCODE },
3887 { "movdqa", { XM, EXx }, PREFIX_OPCODE },
ca164297 3888 },
4e7d34a6 3889
1ceb70f8 3890 /* PREFIX_0F70 */
4e7d34a6 3891 {
507bd325
L
3892 { "pshufw", { MX, EM, Ib }, PREFIX_OPCODE },
3893 { "pshufhw",{ XM, EXx, Ib }, PREFIX_OPCODE },
3894 { "pshufd", { XM, EXx, Ib }, PREFIX_OPCODE },
3895 { "pshuflw",{ XM, EXx, Ib }, PREFIX_OPCODE },
4e7d34a6
L
3896 },
3897
92fddf8e
L
3898 /* PREFIX_0F73_REG_3 */
3899 {
592d1631
L
3900 { Bad_Opcode },
3901 { Bad_Opcode },
bf890a93 3902 { "psrldq", { XS, Ib }, 0 },
92fddf8e
L
3903 },
3904
3905 /* PREFIX_0F73_REG_7 */
3906 {
592d1631
L
3907 { Bad_Opcode },
3908 { Bad_Opcode },
bf890a93 3909 { "pslldq", { XS, Ib }, 0 },
92fddf8e
L
3910 },
3911
1ceb70f8 3912 /* PREFIX_0F78 */
4e7d34a6 3913 {
bf890a93 3914 {"vmread", { Em, Gm }, 0 },
592d1631 3915 { Bad_Opcode },
bf890a93
IT
3916 {"extrq", { XS, Ib, Ib }, 0 },
3917 {"insertq", { XM, XS, Ib, Ib }, 0 },
4e7d34a6
L
3918 },
3919
1ceb70f8 3920 /* PREFIX_0F79 */
4e7d34a6 3921 {
bf890a93 3922 {"vmwrite", { Gm, Em }, 0 },
592d1631 3923 { Bad_Opcode },
bf890a93
IT
3924 {"extrq", { XM, XS }, 0 },
3925 {"insertq", { XM, XS }, 0 },
4e7d34a6
L
3926 },
3927
1ceb70f8 3928 /* PREFIX_0F7C */
ca164297 3929 {
592d1631
L
3930 { Bad_Opcode },
3931 { Bad_Opcode },
507bd325
L
3932 { "haddpd", { XM, EXx }, PREFIX_OPCODE },
3933 { "haddps", { XM, EXx }, PREFIX_OPCODE },
ca164297 3934 },
4e7d34a6 3935
1ceb70f8 3936 /* PREFIX_0F7D */
ca164297 3937 {
592d1631
L
3938 { Bad_Opcode },
3939 { Bad_Opcode },
507bd325
L
3940 { "hsubpd", { XM, EXx }, PREFIX_OPCODE },
3941 { "hsubps", { XM, EXx }, PREFIX_OPCODE },
ca164297 3942 },
4e7d34a6 3943
1ceb70f8 3944 /* PREFIX_0F7E */
ca164297 3945 {
507bd325
L
3946 { "movK", { Edq, MX }, PREFIX_OPCODE },
3947 { "movq", { XM, EXq }, PREFIX_OPCODE },
3948 { "movK", { Edq, XM }, PREFIX_OPCODE },
ca164297 3949 },
4e7d34a6 3950
1ceb70f8 3951 /* PREFIX_0F7F */
ca164297 3952 {
507bd325
L
3953 { "movq", { EMS, MX }, PREFIX_OPCODE },
3954 { "movdqu", { EXxS, XM }, PREFIX_OPCODE },
3955 { "movdqa", { EXxS, XM }, PREFIX_OPCODE },
ca164297 3956 },
4e7d34a6 3957
c7b8aa3a
L
3958 /* PREFIX_0FAE_REG_0 */
3959 {
3960 { Bad_Opcode },
bf890a93 3961 { "rdfsbase", { Ev }, 0 },
c7b8aa3a
L
3962 },
3963
3964 /* PREFIX_0FAE_REG_1 */
3965 {
3966 { Bad_Opcode },
bf890a93 3967 { "rdgsbase", { Ev }, 0 },
c7b8aa3a
L
3968 },
3969
3970 /* PREFIX_0FAE_REG_2 */
3971 {
3972 { Bad_Opcode },
bf890a93 3973 { "wrfsbase", { Ev }, 0 },
c7b8aa3a
L
3974 },
3975
3976 /* PREFIX_0FAE_REG_3 */
3977 {
3978 { Bad_Opcode },
bf890a93 3979 { "wrgsbase", { Ev }, 0 },
c7b8aa3a
L
3980 },
3981
6b40c462
L
3982 /* PREFIX_MOD_0_0FAE_REG_4 */
3983 {
3984 { "xsave", { FXSAVE }, 0 },
3985 { "ptwrite%LQ", { Edq }, 0 },
3986 },
3987
3988 /* PREFIX_MOD_3_0FAE_REG_4 */
3989 {
3990 { Bad_Opcode },
3991 { "ptwrite%LQ", { Edq }, 0 },
3992 },
3993
603555e5
L
3994 /* PREFIX_MOD_0_0FAE_REG_5 */
3995 {
3996 { "xrstor", { FXSAVE }, PREFIX_OPCODE },
2234eee6
L
3997 },
3998
3999 /* PREFIX_MOD_3_0FAE_REG_5 */
4000 {
4001 { "lfence", { Skip_MODRM }, 0 },
4002 { "incsspK", { Rdq }, PREFIX_OPCODE },
603555e5
L
4003 },
4004
de89d0a3 4005 /* PREFIX_MOD_0_0FAE_REG_6 */
c5e7287a 4006 {
603555e5
L
4007 { "xsaveopt", { FXSAVE }, PREFIX_OPCODE },
4008 { "clrssbsy", { Mq }, PREFIX_OPCODE },
4009 { "clwb", { Mb }, PREFIX_OPCODE },
c5e7287a
IT
4010 },
4011
de89d0a3
IT
4012 /* PREFIX_MOD_1_0FAE_REG_6 */
4013 {
4014 { RM_TABLE (RM_0FAE_REG_6) },
4015 { "umonitor", { Eva }, PREFIX_OPCODE },
ae1d3843
L
4016 { "tpause", { Edq }, PREFIX_OPCODE },
4017 { "umwait", { Edq }, PREFIX_OPCODE },
de89d0a3
IT
4018 },
4019
963f3586
IT
4020 /* PREFIX_0FAE_REG_7 */
4021 {
bf890a93 4022 { "clflush", { Mb }, 0 },
963f3586 4023 { Bad_Opcode },
bf890a93 4024 { "clflushopt", { Mb }, 0 },
963f3586
IT
4025 },
4026
1ceb70f8 4027 /* PREFIX_0FB8 */
ca164297 4028 {
592d1631 4029 { Bad_Opcode },
bf890a93 4030 { "popcntS", { Gv, Ev }, 0 },
ca164297 4031 },
4e7d34a6 4032
f12dc422
L
4033 /* PREFIX_0FBC */
4034 {
bf890a93
IT
4035 { "bsfS", { Gv, Ev }, 0 },
4036 { "tzcntS", { Gv, Ev }, 0 },
4037 { "bsfS", { Gv, Ev }, 0 },
f12dc422
L
4038 },
4039
1ceb70f8 4040 /* PREFIX_0FBD */
050dfa73 4041 {
bf890a93
IT
4042 { "bsrS", { Gv, Ev }, 0 },
4043 { "lzcntS", { Gv, Ev }, 0 },
4044 { "bsrS", { Gv, Ev }, 0 },
050dfa73
MM
4045 },
4046
1ceb70f8 4047 /* PREFIX_0FC2 */
050dfa73 4048 {
507bd325
L
4049 { "cmpps", { XM, EXx, CMP }, PREFIX_OPCODE },
4050 { "cmpss", { XM, EXd, CMP }, PREFIX_OPCODE },
4051 { "cmppd", { XM, EXx, CMP }, PREFIX_OPCODE },
4052 { "cmpsd", { XM, EXq, CMP }, PREFIX_OPCODE },
050dfa73 4053 },
246c51aa 4054
a8484f96 4055 /* PREFIX_MOD_0_0FC3 */
4ee52178 4056 {
a8484f96 4057 { "movntiS", { Ev, Gv }, PREFIX_OPCODE },
4ee52178
L
4058 },
4059
f24bcbaa 4060 /* PREFIX_MOD_0_0FC7_REG_6 */
92fddf8e 4061 {
bf890a93
IT
4062 { "vmptrld",{ Mq }, 0 },
4063 { "vmxon", { Mq }, 0 },
4064 { "vmclear",{ Mq }, 0 },
92fddf8e
L
4065 },
4066
f24bcbaa
L
4067 /* PREFIX_MOD_3_0FC7_REG_6 */
4068 {
4069 { "rdrand", { Ev }, 0 },
4070 { Bad_Opcode },
4071 { "rdrand", { Ev }, 0 }
4072 },
4073
4074 /* PREFIX_MOD_3_0FC7_REG_7 */
4075 {
4076 { "rdseed", { Ev }, 0 },
8bc52696 4077 { "rdpid", { Em }, 0 },
f24bcbaa
L
4078 { "rdseed", { Ev }, 0 },
4079 },
4080
1ceb70f8 4081 /* PREFIX_0FD0 */
050dfa73 4082 {
592d1631
L
4083 { Bad_Opcode },
4084 { Bad_Opcode },
bf890a93
IT
4085 { "addsubpd", { XM, EXx }, 0 },
4086 { "addsubps", { XM, EXx }, 0 },
246c51aa 4087 },
050dfa73 4088
1ceb70f8 4089 /* PREFIX_0FD6 */
050dfa73 4090 {
592d1631 4091 { Bad_Opcode },
bf890a93
IT
4092 { "movq2dq",{ XM, MS }, 0 },
4093 { "movq", { EXqS, XM }, 0 },
4094 { "movdq2q",{ MX, XS }, 0 },
050dfa73
MM
4095 },
4096
1ceb70f8 4097 /* PREFIX_0FE6 */
7918206c 4098 {
592d1631 4099 { Bad_Opcode },
507bd325
L
4100 { "cvtdq2pd", { XM, EXq }, PREFIX_OPCODE },
4101 { "cvttpd2dq", { XM, EXx }, PREFIX_OPCODE },
4102 { "cvtpd2dq", { XM, EXx }, PREFIX_OPCODE },
7918206c 4103 },
8b38ad71 4104
1ceb70f8 4105 /* PREFIX_0FE7 */
8b38ad71 4106 {
507bd325 4107 { "movntq", { Mq, MX }, PREFIX_OPCODE },
592d1631 4108 { Bad_Opcode },
75c135a8 4109 { MOD_TABLE (MOD_0FE7_PREFIX_2) },
4e7d34a6
L
4110 },
4111
1ceb70f8 4112 /* PREFIX_0FF0 */
4e7d34a6 4113 {
592d1631
L
4114 { Bad_Opcode },
4115 { Bad_Opcode },
4116 { Bad_Opcode },
1ceb70f8 4117 { MOD_TABLE (MOD_0FF0_PREFIX_3) },
4e7d34a6
L
4118 },
4119
1ceb70f8 4120 /* PREFIX_0FF7 */
4e7d34a6 4121 {
507bd325 4122 { "maskmovq", { MX, MS }, PREFIX_OPCODE },
592d1631 4123 { Bad_Opcode },
507bd325 4124 { "maskmovdqu", { XM, XS }, PREFIX_OPCODE },
8b38ad71 4125 },
42903f7f 4126
1ceb70f8 4127 /* PREFIX_0F3810 */
42903f7f 4128 {
592d1631
L
4129 { Bad_Opcode },
4130 { Bad_Opcode },
507bd325 4131 { "pblendvb", { XM, EXx, XMM0 }, PREFIX_OPCODE },
42903f7f
L
4132 },
4133
1ceb70f8 4134 /* PREFIX_0F3814 */
42903f7f 4135 {
592d1631
L
4136 { Bad_Opcode },
4137 { Bad_Opcode },
507bd325 4138 { "blendvps", { XM, EXx, XMM0 }, PREFIX_OPCODE },
42903f7f
L
4139 },
4140
1ceb70f8 4141 /* PREFIX_0F3815 */
42903f7f 4142 {
592d1631
L
4143 { Bad_Opcode },
4144 { Bad_Opcode },
507bd325 4145 { "blendvpd", { XM, EXx, XMM0 }, PREFIX_OPCODE },
42903f7f
L
4146 },
4147
1ceb70f8 4148 /* PREFIX_0F3817 */
42903f7f 4149 {
592d1631
L
4150 { Bad_Opcode },
4151 { Bad_Opcode },
507bd325 4152 { "ptest", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4153 },
4154
1ceb70f8 4155 /* PREFIX_0F3820 */
42903f7f 4156 {
592d1631
L
4157 { Bad_Opcode },
4158 { Bad_Opcode },
507bd325 4159 { "pmovsxbw", { XM, EXq }, PREFIX_OPCODE },
42903f7f
L
4160 },
4161
1ceb70f8 4162 /* PREFIX_0F3821 */
42903f7f 4163 {
592d1631
L
4164 { Bad_Opcode },
4165 { Bad_Opcode },
507bd325 4166 { "pmovsxbd", { XM, EXd }, PREFIX_OPCODE },
42903f7f
L
4167 },
4168
1ceb70f8 4169 /* PREFIX_0F3822 */
42903f7f 4170 {
592d1631
L
4171 { Bad_Opcode },
4172 { Bad_Opcode },
507bd325 4173 { "pmovsxbq", { XM, EXw }, PREFIX_OPCODE },
42903f7f
L
4174 },
4175
1ceb70f8 4176 /* PREFIX_0F3823 */
42903f7f 4177 {
592d1631
L
4178 { Bad_Opcode },
4179 { Bad_Opcode },
507bd325 4180 { "pmovsxwd", { XM, EXq }, PREFIX_OPCODE },
42903f7f
L
4181 },
4182
1ceb70f8 4183 /* PREFIX_0F3824 */
42903f7f 4184 {
592d1631
L
4185 { Bad_Opcode },
4186 { Bad_Opcode },
507bd325 4187 { "pmovsxwq", { XM, EXd }, PREFIX_OPCODE },
42903f7f
L
4188 },
4189
1ceb70f8 4190 /* PREFIX_0F3825 */
42903f7f 4191 {
592d1631
L
4192 { Bad_Opcode },
4193 { Bad_Opcode },
507bd325 4194 { "pmovsxdq", { XM, EXq }, PREFIX_OPCODE },
42903f7f
L
4195 },
4196
1ceb70f8 4197 /* PREFIX_0F3828 */
42903f7f 4198 {
592d1631
L
4199 { Bad_Opcode },
4200 { Bad_Opcode },
507bd325 4201 { "pmuldq", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4202 },
4203
1ceb70f8 4204 /* PREFIX_0F3829 */
42903f7f 4205 {
592d1631
L
4206 { Bad_Opcode },
4207 { Bad_Opcode },
507bd325 4208 { "pcmpeqq", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4209 },
4210
1ceb70f8 4211 /* PREFIX_0F382A */
42903f7f 4212 {
592d1631
L
4213 { Bad_Opcode },
4214 { Bad_Opcode },
75c135a8 4215 { MOD_TABLE (MOD_0F382A_PREFIX_2) },
42903f7f
L
4216 },
4217
1ceb70f8 4218 /* PREFIX_0F382B */
42903f7f 4219 {
592d1631
L
4220 { Bad_Opcode },
4221 { Bad_Opcode },
507bd325 4222 { "packusdw", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4223 },
4224
1ceb70f8 4225 /* PREFIX_0F3830 */
42903f7f 4226 {
592d1631
L
4227 { Bad_Opcode },
4228 { Bad_Opcode },
507bd325 4229 { "pmovzxbw", { XM, EXq }, PREFIX_OPCODE },
42903f7f
L
4230 },
4231
1ceb70f8 4232 /* PREFIX_0F3831 */
42903f7f 4233 {
592d1631
L
4234 { Bad_Opcode },
4235 { Bad_Opcode },
507bd325 4236 { "pmovzxbd", { XM, EXd }, PREFIX_OPCODE },
42903f7f
L
4237 },
4238
1ceb70f8 4239 /* PREFIX_0F3832 */
42903f7f 4240 {
592d1631
L
4241 { Bad_Opcode },
4242 { Bad_Opcode },
507bd325 4243 { "pmovzxbq", { XM, EXw }, PREFIX_OPCODE },
42903f7f
L
4244 },
4245
1ceb70f8 4246 /* PREFIX_0F3833 */
42903f7f 4247 {
592d1631
L
4248 { Bad_Opcode },
4249 { Bad_Opcode },
507bd325 4250 { "pmovzxwd", { XM, EXq }, PREFIX_OPCODE },
42903f7f
L
4251 },
4252
1ceb70f8 4253 /* PREFIX_0F3834 */
42903f7f 4254 {
592d1631
L
4255 { Bad_Opcode },
4256 { Bad_Opcode },
507bd325 4257 { "pmovzxwq", { XM, EXd }, PREFIX_OPCODE },
42903f7f
L
4258 },
4259
1ceb70f8 4260 /* PREFIX_0F3835 */
42903f7f 4261 {
592d1631
L
4262 { Bad_Opcode },
4263 { Bad_Opcode },
507bd325 4264 { "pmovzxdq", { XM, EXq }, PREFIX_OPCODE },
42903f7f
L
4265 },
4266
1ceb70f8 4267 /* PREFIX_0F3837 */
4e7d34a6 4268 {
592d1631
L
4269 { Bad_Opcode },
4270 { Bad_Opcode },
507bd325 4271 { "pcmpgtq", { XM, EXx }, PREFIX_OPCODE },
4e7d34a6
L
4272 },
4273
1ceb70f8 4274 /* PREFIX_0F3838 */
42903f7f 4275 {
592d1631
L
4276 { Bad_Opcode },
4277 { Bad_Opcode },
507bd325 4278 { "pminsb", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4279 },
4280
1ceb70f8 4281 /* PREFIX_0F3839 */
42903f7f 4282 {
592d1631
L
4283 { Bad_Opcode },
4284 { Bad_Opcode },
507bd325 4285 { "pminsd", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4286 },
4287
1ceb70f8 4288 /* PREFIX_0F383A */
42903f7f 4289 {
592d1631
L
4290 { Bad_Opcode },
4291 { Bad_Opcode },
507bd325 4292 { "pminuw", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4293 },
4294
1ceb70f8 4295 /* PREFIX_0F383B */
42903f7f 4296 {
592d1631
L
4297 { Bad_Opcode },
4298 { Bad_Opcode },
507bd325 4299 { "pminud", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4300 },
4301
1ceb70f8 4302 /* PREFIX_0F383C */
42903f7f 4303 {
592d1631
L
4304 { Bad_Opcode },
4305 { Bad_Opcode },
507bd325 4306 { "pmaxsb", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4307 },
4308
1ceb70f8 4309 /* PREFIX_0F383D */
42903f7f 4310 {
592d1631
L
4311 { Bad_Opcode },
4312 { Bad_Opcode },
507bd325 4313 { "pmaxsd", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4314 },
4315
1ceb70f8 4316 /* PREFIX_0F383E */
42903f7f 4317 {
592d1631
L
4318 { Bad_Opcode },
4319 { Bad_Opcode },
507bd325 4320 { "pmaxuw", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4321 },
4322
1ceb70f8 4323 /* PREFIX_0F383F */
42903f7f 4324 {
592d1631
L
4325 { Bad_Opcode },
4326 { Bad_Opcode },
507bd325 4327 { "pmaxud", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4328 },
4329
1ceb70f8 4330 /* PREFIX_0F3840 */
42903f7f 4331 {
592d1631
L
4332 { Bad_Opcode },
4333 { Bad_Opcode },
507bd325 4334 { "pmulld", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4335 },
4336
1ceb70f8 4337 /* PREFIX_0F3841 */
42903f7f 4338 {
592d1631
L
4339 { Bad_Opcode },
4340 { Bad_Opcode },
507bd325 4341 { "phminposuw", { XM, EXx }, PREFIX_OPCODE },
42903f7f
L
4342 },
4343
f1f8f695
L
4344 /* PREFIX_0F3880 */
4345 {
592d1631
L
4346 { Bad_Opcode },
4347 { Bad_Opcode },
507bd325 4348 { "invept", { Gm, Mo }, PREFIX_OPCODE },
f1f8f695
L
4349 },
4350
4351 /* PREFIX_0F3881 */
4352 {
592d1631
L
4353 { Bad_Opcode },
4354 { Bad_Opcode },
507bd325 4355 { "invvpid", { Gm, Mo }, PREFIX_OPCODE },
f1f8f695
L
4356 },
4357
6c30d220
L
4358 /* PREFIX_0F3882 */
4359 {
4360 { Bad_Opcode },
4361 { Bad_Opcode },
507bd325 4362 { "invpcid", { Gm, M }, PREFIX_OPCODE },
6c30d220
L
4363 },
4364
a0046408
L
4365 /* PREFIX_0F38C8 */
4366 {
507bd325 4367 { "sha1nexte", { XM, EXxmm }, PREFIX_OPCODE },
a0046408
L
4368 },
4369
4370 /* PREFIX_0F38C9 */
4371 {
507bd325 4372 { "sha1msg1", { XM, EXxmm }, PREFIX_OPCODE },
a0046408
L
4373 },
4374
4375 /* PREFIX_0F38CA */
4376 {
507bd325 4377 { "sha1msg2", { XM, EXxmm }, PREFIX_OPCODE },
a0046408
L
4378 },
4379
4380 /* PREFIX_0F38CB */
4381 {
507bd325 4382 { "sha256rnds2", { XM, EXxmm, XMM0 }, PREFIX_OPCODE },
a0046408
L
4383 },
4384
4385 /* PREFIX_0F38CC */
4386 {
507bd325 4387 { "sha256msg1", { XM, EXxmm }, PREFIX_OPCODE },
a0046408
L
4388 },
4389
4390 /* PREFIX_0F38CD */
4391 {
507bd325 4392 { "sha256msg2", { XM, EXxmm }, PREFIX_OPCODE },
a0046408
L
4393 },
4394
48521003
IT
4395 /* PREFIX_0F38CF */
4396 {
4397 { Bad_Opcode },
4398 { Bad_Opcode },
4399 { "gf2p8mulb", { XM, EXxmm }, PREFIX_OPCODE },
4400 },
4401
c0f3af97
L
4402 /* PREFIX_0F38DB */
4403 {
592d1631
L
4404 { Bad_Opcode },
4405 { Bad_Opcode },
507bd325 4406 { "aesimc", { XM, EXx }, PREFIX_OPCODE },
c0f3af97
L
4407 },
4408
4409 /* PREFIX_0F38DC */
4410 {
592d1631
L
4411 { Bad_Opcode },
4412 { Bad_Opcode },
507bd325 4413 { "aesenc", { XM, EXx }, PREFIX_OPCODE },
c0f3af97
L
4414 },
4415
4416 /* PREFIX_0F38DD */
4417 {
592d1631
L
4418 { Bad_Opcode },
4419 { Bad_Opcode },
507bd325 4420 { "aesenclast", { XM, EXx }, PREFIX_OPCODE },
c0f3af97
L
4421 },
4422
4423 /* PREFIX_0F38DE */
4424 {
592d1631
L
4425 { Bad_Opcode },
4426 { Bad_Opcode },
507bd325 4427 { "aesdec", { XM, EXx }, PREFIX_OPCODE },
c0f3af97
L
4428 },
4429
4430 /* PREFIX_0F38DF */
4431 {
592d1631
L
4432 { Bad_Opcode },
4433 { Bad_Opcode },
507bd325 4434 { "aesdeclast", { XM, EXx }, PREFIX_OPCODE },
c0f3af97
L
4435 },
4436
1ceb70f8 4437 /* PREFIX_0F38F0 */
4e7d34a6 4438 {
507bd325 4439 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
592d1631 4440 { Bad_Opcode },
507bd325
L
4441 { "movbeS", { Gv, { MOVBE_Fixup, v_mode } }, PREFIX_OPCODE },
4442 { "crc32", { Gdq, { CRC32_Fixup, b_mode } }, PREFIX_OPCODE },
4e7d34a6
L
4443 },
4444
1ceb70f8 4445 /* PREFIX_0F38F1 */
4e7d34a6 4446 {
507bd325 4447 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
592d1631 4448 { Bad_Opcode },
507bd325
L
4449 { "movbeS", { { MOVBE_Fixup, v_mode }, Gv }, PREFIX_OPCODE },
4450 { "crc32", { Gdq, { CRC32_Fixup, v_mode } }, PREFIX_OPCODE },
4e7d34a6
L
4451 },
4452
603555e5 4453 /* PREFIX_0F38F5 */
e2e1fcde
L
4454 {
4455 { Bad_Opcode },
603555e5
L
4456 { Bad_Opcode },
4457 { MOD_TABLE (MOD_0F38F5_PREFIX_2) },
4458 },
4459
4460 /* PREFIX_0F38F6 */
4461 {
4462 { MOD_TABLE (MOD_0F38F6_PREFIX_0) },
507bd325
L
4463 { "adoxS", { Gdq, Edq}, PREFIX_OPCODE },
4464 { "adcxS", { Gdq, Edq}, PREFIX_OPCODE },
e2e1fcde
L
4465 { Bad_Opcode },
4466 },
4467
c0a30a9f
L
4468 /* PREFIX_0F38F8 */
4469 {
4470 { Bad_Opcode },
5d79adc4 4471 { MOD_TABLE (MOD_0F38F8_PREFIX_1) },
c0a30a9f 4472 { MOD_TABLE (MOD_0F38F8_PREFIX_2) },
5d79adc4 4473 { MOD_TABLE (MOD_0F38F8_PREFIX_3) },
c0a30a9f
L
4474 },
4475
4476 /* PREFIX_0F38F9 */
4477 {
4478 { MOD_TABLE (MOD_0F38F9_PREFIX_0) },
4479 },
4480
1ceb70f8 4481 /* PREFIX_0F3A08 */
42903f7f 4482 {
592d1631
L
4483 { Bad_Opcode },
4484 { Bad_Opcode },
507bd325 4485 { "roundps", { XM, EXx, Ib }, PREFIX_OPCODE },
42903f7f
L
4486 },
4487
1ceb70f8 4488 /* PREFIX_0F3A09 */
42903f7f 4489 {
592d1631
L
4490 { Bad_Opcode },
4491 { Bad_Opcode },
507bd325 4492 { "roundpd", { XM, EXx, Ib }, PREFIX_OPCODE },
42903f7f
L
4493 },
4494
1ceb70f8 4495 /* PREFIX_0F3A0A */
42903f7f 4496 {
592d1631
L
4497 { Bad_Opcode },
4498 { Bad_Opcode },
507bd325 4499 { "roundss", { XM, EXd, Ib }, PREFIX_OPCODE },
42903f7f
L
4500 },
4501
1ceb70f8 4502 /* PREFIX_0F3A0B */
42903f7f 4503 {
592d1631
L
4504 { Bad_Opcode },
4505 { Bad_Opcode },
507bd325 4506 { "roundsd", { XM, EXq, Ib }, PREFIX_OPCODE },
42903f7f
L
4507 },
4508
1ceb70f8 4509 /* PREFIX_0F3A0C */
42903f7f 4510 {
592d1631
L
4511 { Bad_Opcode },
4512 { Bad_Opcode },
507bd325 4513 { "blendps", { XM, EXx, Ib }, PREFIX_OPCODE },
42903f7f
L
4514 },
4515
1ceb70f8 4516 /* PREFIX_0F3A0D */
42903f7f 4517 {
592d1631
L
4518 { Bad_Opcode },
4519 { Bad_Opcode },
507bd325 4520 { "blendpd", { XM, EXx, Ib }, PREFIX_OPCODE },
42903f7f
L
4521 },
4522
1ceb70f8 4523 /* PREFIX_0F3A0E */
42903f7f 4524 {
592d1631
L
4525 { Bad_Opcode },
4526 { Bad_Opcode },
507bd325 4527 { "pblendw", { XM, EXx, Ib }, PREFIX_OPCODE },
42903f7f
L
4528 },
4529
1ceb70f8 4530 /* PREFIX_0F3A14 */
42903f7f 4531 {
592d1631
L
4532 { Bad_Opcode },
4533 { Bad_Opcode },
507bd325 4534 { "pextrb", { Edqb, XM, Ib }, PREFIX_OPCODE },
42903f7f
L
4535 },
4536
1ceb70f8 4537 /* PREFIX_0F3A15 */
42903f7f 4538 {
592d1631
L
4539 { Bad_Opcode },
4540 { Bad_Opcode },
507bd325 4541 { "pextrw", { Edqw, XM, Ib }, PREFIX_OPCODE },
42903f7f
L
4542 },
4543
1ceb70f8 4544 /* PREFIX_0F3A16 */
42903f7f 4545 {
592d1631
L
4546 { Bad_Opcode },
4547 { Bad_Opcode },
507bd325 4548 { "pextrK", { Edq, XM, Ib }, PREFIX_OPCODE },
42903f7f
L
4549 },
4550
1ceb70f8 4551 /* PREFIX_0F3A17 */
42903f7f 4552 {
592d1631
L
4553 { Bad_Opcode },
4554 { Bad_Opcode },
507bd325 4555 { "extractps", { Edqd, XM, Ib }, PREFIX_OPCODE },
42903f7f
L
4556 },
4557
1ceb70f8 4558 /* PREFIX_0F3A20 */
42903f7f 4559 {
592d1631
L
4560 { Bad_Opcode },
4561 { Bad_Opcode },
507bd325 4562 { "pinsrb", { XM, Edqb, Ib }, PREFIX_OPCODE },
42903f7f
L
4563 },
4564
1ceb70f8 4565 /* PREFIX_0F3A21 */
42903f7f 4566 {
592d1631
L
4567 { Bad_Opcode },
4568 { Bad_Opcode },
507bd325 4569 { "insertps", { XM, EXd, Ib }, PREFIX_OPCODE },
42903f7f
L
4570 },
4571
1ceb70f8 4572 /* PREFIX_0F3A22 */
42903f7f 4573 {
592d1631
L
4574 { Bad_Opcode },
4575 { Bad_Opcode },
507bd325 4576 { "pinsrK", { XM, Edq, Ib }, PREFIX_OPCODE },
42903f7f
L
4577 },
4578
1ceb70f8 4579 /* PREFIX_0F3A40 */
42903f7f 4580 {
592d1631
L
4581 { Bad_Opcode },
4582 { Bad_Opcode },
507bd325 4583 { "dpps", { XM, EXx, Ib }, PREFIX_OPCODE },
42903f7f
L
4584 },
4585
1ceb70f8 4586 /* PREFIX_0F3A41 */
42903f7f 4587 {
592d1631
L
4588 { Bad_Opcode },
4589 { Bad_Opcode },
507bd325 4590 { "dppd", { XM, EXx, Ib }, PREFIX_OPCODE },
42903f7f
L
4591 },
4592
1ceb70f8 4593 /* PREFIX_0F3A42 */
42903f7f 4594 {
592d1631
L
4595 { Bad_Opcode },
4596 { Bad_Opcode },
507bd325 4597 { "mpsadbw", { XM, EXx, Ib }, PREFIX_OPCODE },
42903f7f 4598 },
381d071f 4599
c0f3af97
L
4600 /* PREFIX_0F3A44 */
4601 {
592d1631
L
4602 { Bad_Opcode },
4603 { Bad_Opcode },
507bd325 4604 { "pclmulqdq", { XM, EXx, PCLMUL }, PREFIX_OPCODE },
c0f3af97
L
4605 },
4606
1ceb70f8 4607 /* PREFIX_0F3A60 */
381d071f 4608 {
592d1631
L
4609 { Bad_Opcode },
4610 { Bad_Opcode },
15c7c1d8 4611 { "pcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
381d071f
L
4612 },
4613
1ceb70f8 4614 /* PREFIX_0F3A61 */
381d071f 4615 {
592d1631
L
4616 { Bad_Opcode },
4617 { Bad_Opcode },
15c7c1d8 4618 { "pcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, PREFIX_OPCODE },
381d071f
L
4619 },
4620
1ceb70f8 4621 /* PREFIX_0F3A62 */
381d071f 4622 {
592d1631
L
4623 { Bad_Opcode },
4624 { Bad_Opcode },
507bd325 4625 { "pcmpistrm", { XM, EXx, Ib }, PREFIX_OPCODE },
381d071f
L
4626 },
4627
1ceb70f8 4628 /* PREFIX_0F3A63 */
381d071f 4629 {
592d1631
L
4630 { Bad_Opcode },
4631 { Bad_Opcode },
507bd325 4632 { "pcmpistri", { XM, EXx, Ib }, PREFIX_OPCODE },
381d071f 4633 },
09a2c6cf 4634
a0046408
L
4635 /* PREFIX_0F3ACC */
4636 {
507bd325 4637 { "sha1rnds4", { XM, EXxmm, Ib }, PREFIX_OPCODE },
a0046408
L
4638 },
4639
48521003
IT
4640 /* PREFIX_0F3ACE */
4641 {
4642 { Bad_Opcode },
4643 { Bad_Opcode },
4644 { "gf2p8affineqb", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4645 },
4646
4647 /* PREFIX_0F3ACF */
4648 {
4649 { Bad_Opcode },
4650 { Bad_Opcode },
4651 { "gf2p8affineinvqb", { XM, EXxmm, Ib }, PREFIX_OPCODE },
4652 },
4653
c0f3af97 4654 /* PREFIX_0F3ADF */
09a2c6cf 4655 {
592d1631
L
4656 { Bad_Opcode },
4657 { Bad_Opcode },
507bd325 4658 { "aeskeygenassist", { XM, EXx, Ib }, PREFIX_OPCODE },
09a2c6cf
L
4659 },
4660
592a252b 4661 /* PREFIX_VEX_0F10 */
09a2c6cf 4662 {
ec6f095a
L
4663 { "vmovups", { XM, EXx }, 0 },
4664 { "vmovss", { XMVexScalar, VexScalar, EXdScalar }, 0 },
4665 { "vmovupd", { XM, EXx }, 0 },
4666 { "vmovsd", { XMVexScalar, VexScalar, EXqScalar }, 0 },
09a2c6cf
L
4667 },
4668
592a252b 4669 /* PREFIX_VEX_0F11 */
09a2c6cf 4670 {
ec6f095a
L
4671 { "vmovups", { EXxS, XM }, 0 },
4672 { "vmovss", { EXdVexScalarS, VexScalar, XMScalar }, 0 },
4673 { "vmovupd", { EXxS, XM }, 0 },
4674 { "vmovsd", { EXqVexScalarS, VexScalar, XMScalar }, 0 },
09a2c6cf
L
4675 },
4676
592a252b 4677 /* PREFIX_VEX_0F12 */
09a2c6cf 4678 {
592a252b 4679 { MOD_TABLE (MOD_VEX_0F12_PREFIX_0) },
ec6f095a 4680 { "vmovsldup", { XM, EXx }, 0 },
592a252b 4681 { VEX_LEN_TABLE (VEX_LEN_0F12_P_2) },
ec6f095a 4682 { "vmovddup", { XM, EXymmq }, 0 },
09a2c6cf
L
4683 },
4684
592a252b 4685 /* PREFIX_VEX_0F16 */
09a2c6cf 4686 {
592a252b 4687 { MOD_TABLE (MOD_VEX_0F16_PREFIX_0) },
ec6f095a 4688 { "vmovshdup", { XM, EXx }, 0 },
592a252b 4689 { VEX_LEN_TABLE (VEX_LEN_0F16_P_2) },
5f754f58 4690 },
7c52e0e8 4691
592a252b 4692 /* PREFIX_VEX_0F2A */
5f754f58 4693 {
592d1631 4694 { Bad_Opcode },
592a252b 4695 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_1) },
592d1631 4696 { Bad_Opcode },
592a252b 4697 { VEX_LEN_TABLE (VEX_LEN_0F2A_P_3) },
5f754f58 4698 },
7c52e0e8 4699
592a252b 4700 /* PREFIX_VEX_0F2C */
5f754f58 4701 {
592d1631 4702 { Bad_Opcode },
592a252b 4703 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_1) },
592d1631 4704 { Bad_Opcode },
592a252b 4705 { VEX_LEN_TABLE (VEX_LEN_0F2C_P_3) },
5f754f58 4706 },
7c52e0e8 4707
592a252b 4708 /* PREFIX_VEX_0F2D */
7c52e0e8 4709 {
592d1631 4710 { Bad_Opcode },
592a252b 4711 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_1) },
592d1631 4712 { Bad_Opcode },
592a252b 4713 { VEX_LEN_TABLE (VEX_LEN_0F2D_P_3) },
7c52e0e8
L
4714 },
4715
592a252b 4716 /* PREFIX_VEX_0F2E */
7c52e0e8 4717 {
ec6f095a 4718 { "vucomiss", { XMScalar, EXdScalar }, 0 },
592d1631 4719 { Bad_Opcode },
ec6f095a 4720 { "vucomisd", { XMScalar, EXqScalar }, 0 },
7c52e0e8
L
4721 },
4722
592a252b 4723 /* PREFIX_VEX_0F2F */
7c52e0e8 4724 {
ec6f095a 4725 { "vcomiss", { XMScalar, EXdScalar }, 0 },
592d1631 4726 { Bad_Opcode },
ec6f095a 4727 { "vcomisd", { XMScalar, EXqScalar }, 0 },
7c52e0e8
L
4728 },
4729
43234a1e
L
4730 /* PREFIX_VEX_0F41 */
4731 {
4732 { VEX_LEN_TABLE (VEX_LEN_0F41_P_0) },
1ba585e8
IT
4733 { Bad_Opcode },
4734 { VEX_LEN_TABLE (VEX_LEN_0F41_P_2) },
43234a1e
L
4735 },
4736
4737 /* PREFIX_VEX_0F42 */
4738 {
4739 { VEX_LEN_TABLE (VEX_LEN_0F42_P_0) },
1ba585e8
IT
4740 { Bad_Opcode },
4741 { VEX_LEN_TABLE (VEX_LEN_0F42_P_2) },
43234a1e
L
4742 },
4743
4744 /* PREFIX_VEX_0F44 */
4745 {
4746 { VEX_LEN_TABLE (VEX_LEN_0F44_P_0) },
1ba585e8
IT
4747 { Bad_Opcode },
4748 { VEX_LEN_TABLE (VEX_LEN_0F44_P_2) },
43234a1e
L
4749 },
4750
4751 /* PREFIX_VEX_0F45 */
4752 {
4753 { VEX_LEN_TABLE (VEX_LEN_0F45_P_0) },
1ba585e8
IT
4754 { Bad_Opcode },
4755 { VEX_LEN_TABLE (VEX_LEN_0F45_P_2) },
43234a1e
L
4756 },
4757
4758 /* PREFIX_VEX_0F46 */
4759 {
4760 { VEX_LEN_TABLE (VEX_LEN_0F46_P_0) },
1ba585e8
IT
4761 { Bad_Opcode },
4762 { VEX_LEN_TABLE (VEX_LEN_0F46_P_2) },
43234a1e
L
4763 },
4764
4765 /* PREFIX_VEX_0F47 */
4766 {
4767 { VEX_LEN_TABLE (VEX_LEN_0F47_P_0) },
1ba585e8
IT
4768 { Bad_Opcode },
4769 { VEX_LEN_TABLE (VEX_LEN_0F47_P_2) },
43234a1e
L
4770 },
4771
1ba585e8 4772 /* PREFIX_VEX_0F4A */
43234a1e 4773 {
1ba585e8 4774 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_0) },
43234a1e 4775 { Bad_Opcode },
1ba585e8
IT
4776 { VEX_LEN_TABLE (VEX_LEN_0F4A_P_2) },
4777 },
4778
4779 /* PREFIX_VEX_0F4B */
4780 {
4781 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_0) },
43234a1e
L
4782 { Bad_Opcode },
4783 { VEX_LEN_TABLE (VEX_LEN_0F4B_P_2) },
4784 },
4785
592a252b 4786 /* PREFIX_VEX_0F51 */
7c52e0e8 4787 {
ec6f095a
L
4788 { "vsqrtps", { XM, EXx }, 0 },
4789 { "vsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
4790 { "vsqrtpd", { XM, EXx }, 0 },
4791 { "vsqrtsd", { XMScalar, VexScalar, EXqScalar }, 0 },
7c52e0e8
L
4792 },
4793
592a252b 4794 /* PREFIX_VEX_0F52 */
7c52e0e8 4795 {
ec6f095a
L
4796 { "vrsqrtps", { XM, EXx }, 0 },
4797 { "vrsqrtss", { XMScalar, VexScalar, EXdScalar }, 0 },
7c52e0e8
L
4798 },
4799
592a252b 4800 /* PREFIX_VEX_0F53 */
7c52e0e8 4801 {
ec6f095a
L
4802 { "vrcpps", { XM, EXx }, 0 },
4803 { "vrcpss", { XMScalar, VexScalar, EXdScalar }, 0 },
7c52e0e8
L
4804 },
4805
592a252b 4806 /* PREFIX_VEX_0F58 */
7c52e0e8 4807 {
ec6f095a
L
4808 { "vaddps", { XM, Vex, EXx }, 0 },
4809 { "vaddss", { XMScalar, VexScalar, EXdScalar }, 0 },
4810 { "vaddpd", { XM, Vex, EXx }, 0 },
4811 { "vaddsd", { XMScalar, VexScalar, EXqScalar }, 0 },
7c52e0e8
L
4812 },
4813
592a252b 4814 /* PREFIX_VEX_0F59 */
7c52e0e8 4815 {
ec6f095a
L
4816 { "vmulps", { XM, Vex, EXx }, 0 },
4817 { "vmulss", { XMScalar, VexScalar, EXdScalar }, 0 },
4818 { "vmulpd", { XM, Vex, EXx }, 0 },
4819 { "vmulsd", { XMScalar, VexScalar, EXqScalar }, 0 },
7c52e0e8
L
4820 },
4821
592a252b 4822 /* PREFIX_VEX_0F5A */
7c52e0e8 4823 {
ec6f095a
L
4824 { "vcvtps2pd", { XM, EXxmmq }, 0 },
4825 { "vcvtss2sd", { XMScalar, VexScalar, EXdScalar }, 0 },
4826 { "vcvtpd2ps%XY",{ XMM, EXx }, 0 },
4827 { "vcvtsd2ss", { XMScalar, VexScalar, EXqScalar }, 0 },
7c52e0e8
L
4828 },
4829
592a252b 4830 /* PREFIX_VEX_0F5B */
7c52e0e8 4831 {
ec6f095a
L
4832 { "vcvtdq2ps", { XM, EXx }, 0 },
4833 { "vcvttps2dq", { XM, EXx }, 0 },
4834 { "vcvtps2dq", { XM, EXx }, 0 },
7c52e0e8
L
4835 },
4836
592a252b 4837 /* PREFIX_VEX_0F5C */
7c52e0e8 4838 {
ec6f095a
L
4839 { "vsubps", { XM, Vex, EXx }, 0 },
4840 { "vsubss", { XMScalar, VexScalar, EXdScalar }, 0 },
4841 { "vsubpd", { XM, Vex, EXx }, 0 },
4842 { "vsubsd", { XMScalar, VexScalar, EXqScalar }, 0 },
7c52e0e8
L
4843 },
4844
592a252b 4845 /* PREFIX_VEX_0F5D */
7c52e0e8 4846 {
ec6f095a
L
4847 { "vminps", { XM, Vex, EXx }, 0 },
4848 { "vminss", { XMScalar, VexScalar, EXdScalar }, 0 },
4849 { "vminpd", { XM, Vex, EXx }, 0 },
4850 { "vminsd", { XMScalar, VexScalar, EXqScalar }, 0 },
7c52e0e8
L
4851 },
4852
592a252b 4853 /* PREFIX_VEX_0F5E */
7c52e0e8 4854 {
ec6f095a
L
4855 { "vdivps", { XM, Vex, EXx }, 0 },
4856 { "vdivss", { XMScalar, VexScalar, EXdScalar }, 0 },
4857 { "vdivpd", { XM, Vex, EXx }, 0 },
4858 { "vdivsd", { XMScalar, VexScalar, EXqScalar }, 0 },
7c52e0e8
L
4859 },
4860
592a252b 4861 /* PREFIX_VEX_0F5F */
7c52e0e8 4862 {
ec6f095a
L
4863 { "vmaxps", { XM, Vex, EXx }, 0 },
4864 { "vmaxss", { XMScalar, VexScalar, EXdScalar }, 0 },
4865 { "vmaxpd", { XM, Vex, EXx }, 0 },
4866 { "vmaxsd", { XMScalar, VexScalar, EXqScalar }, 0 },
7c52e0e8
L
4867 },
4868
592a252b 4869 /* PREFIX_VEX_0F60 */
7c52e0e8 4870 {
592d1631
L
4871 { Bad_Opcode },
4872 { Bad_Opcode },
ec6f095a 4873 { "vpunpcklbw", { XM, Vex, EXx }, 0 },
7c52e0e8
L
4874 },
4875
592a252b 4876 /* PREFIX_VEX_0F61 */
7c52e0e8 4877 {
592d1631
L
4878 { Bad_Opcode },
4879 { Bad_Opcode },
ec6f095a 4880 { "vpunpcklwd", { XM, Vex, EXx }, 0 },
7c52e0e8
L
4881 },
4882
592a252b 4883 /* PREFIX_VEX_0F62 */
7c52e0e8 4884 {
592d1631
L
4885 { Bad_Opcode },
4886 { Bad_Opcode },
ec6f095a 4887 { "vpunpckldq", { XM, Vex, EXx }, 0 },
7c52e0e8
L
4888 },
4889
592a252b 4890 /* PREFIX_VEX_0F63 */
7c52e0e8 4891 {
592d1631
L
4892 { Bad_Opcode },
4893 { Bad_Opcode },
ec6f095a 4894 { "vpacksswb", { XM, Vex, EXx }, 0 },
7c52e0e8
L
4895 },
4896
592a252b 4897 /* PREFIX_VEX_0F64 */
7c52e0e8 4898 {
592d1631
L
4899 { Bad_Opcode },
4900 { Bad_Opcode },
ec6f095a 4901 { "vpcmpgtb", { XM, Vex, EXx }, 0 },
7c52e0e8
L
4902 },
4903
592a252b 4904 /* PREFIX_VEX_0F65 */
7c52e0e8 4905 {
592d1631
L
4906 { Bad_Opcode },
4907 { Bad_Opcode },
ec6f095a 4908 { "vpcmpgtw", { XM, Vex, EXx }, 0 },
7c52e0e8
L
4909 },
4910
592a252b 4911 /* PREFIX_VEX_0F66 */
7c52e0e8 4912 {
592d1631
L
4913 { Bad_Opcode },
4914 { Bad_Opcode },
ec6f095a 4915 { "vpcmpgtd", { XM, Vex, EXx }, 0 },
7c52e0e8 4916 },
6439fc28 4917
592a252b 4918 /* PREFIX_VEX_0F67 */
331d2d0d 4919 {
592d1631
L
4920 { Bad_Opcode },
4921 { Bad_Opcode },
ec6f095a 4922 { "vpackuswb", { XM, Vex, EXx }, 0 },
c0f3af97
L
4923 },
4924
592a252b 4925 /* PREFIX_VEX_0F68 */
c0f3af97 4926 {
592d1631
L
4927 { Bad_Opcode },
4928 { Bad_Opcode },
ec6f095a 4929 { "vpunpckhbw", { XM, Vex, EXx }, 0 },
c0f3af97
L
4930 },
4931
592a252b 4932 /* PREFIX_VEX_0F69 */
c0f3af97 4933 {
592d1631
L
4934 { Bad_Opcode },
4935 { Bad_Opcode },
ec6f095a 4936 { "vpunpckhwd", { XM, Vex, EXx }, 0 },
c0f3af97
L
4937 },
4938
592a252b 4939 /* PREFIX_VEX_0F6A */
c0f3af97 4940 {
592d1631
L
4941 { Bad_Opcode },
4942 { Bad_Opcode },
ec6f095a 4943 { "vpunpckhdq", { XM, Vex, EXx }, 0 },
c0f3af97
L
4944 },
4945
592a252b 4946 /* PREFIX_VEX_0F6B */
c0f3af97 4947 {
592d1631
L
4948 { Bad_Opcode },
4949 { Bad_Opcode },
ec6f095a 4950 { "vpackssdw", { XM, Vex, EXx }, 0 },
c0f3af97
L
4951 },
4952
592a252b 4953 /* PREFIX_VEX_0F6C */
c0f3af97 4954 {
592d1631
L
4955 { Bad_Opcode },
4956 { Bad_Opcode },
ec6f095a 4957 { "vpunpcklqdq", { XM, Vex, EXx }, 0 },
c0f3af97
L
4958 },
4959
592a252b 4960 /* PREFIX_VEX_0F6D */
c0f3af97 4961 {
592d1631
L
4962 { Bad_Opcode },
4963 { Bad_Opcode },
ec6f095a 4964 { "vpunpckhqdq", { XM, Vex, EXx }, 0 },
c0f3af97
L
4965 },
4966
592a252b 4967 /* PREFIX_VEX_0F6E */
c0f3af97 4968 {
592d1631
L
4969 { Bad_Opcode },
4970 { Bad_Opcode },
592a252b 4971 { VEX_LEN_TABLE (VEX_LEN_0F6E_P_2) },
c0f3af97
L
4972 },
4973
592a252b 4974 /* PREFIX_VEX_0F6F */
c0f3af97 4975 {
592d1631 4976 { Bad_Opcode },
ec6f095a
L
4977 { "vmovdqu", { XM, EXx }, 0 },
4978 { "vmovdqa", { XM, EXx }, 0 },
c0f3af97
L
4979 },
4980
592a252b 4981 /* PREFIX_VEX_0F70 */
c0f3af97 4982 {
592d1631 4983 { Bad_Opcode },
ec6f095a
L
4984 { "vpshufhw", { XM, EXx, Ib }, 0 },
4985 { "vpshufd", { XM, EXx, Ib }, 0 },
4986 { "vpshuflw", { XM, EXx, Ib }, 0 },
c0f3af97
L
4987 },
4988
592a252b 4989 /* PREFIX_VEX_0F71_REG_2 */
c0f3af97 4990 {
592d1631
L
4991 { Bad_Opcode },
4992 { Bad_Opcode },
ec6f095a 4993 { "vpsrlw", { Vex, XS, Ib }, 0 },
c0f3af97
L
4994 },
4995
592a252b 4996 /* PREFIX_VEX_0F71_REG_4 */
c0f3af97 4997 {
592d1631
L
4998 { Bad_Opcode },
4999 { Bad_Opcode },
ec6f095a 5000 { "vpsraw", { Vex, XS, Ib }, 0 },
c0f3af97
L
5001 },
5002
592a252b 5003 /* PREFIX_VEX_0F71_REG_6 */
c0f3af97 5004 {
592d1631
L
5005 { Bad_Opcode },
5006 { Bad_Opcode },
ec6f095a 5007 { "vpsllw", { Vex, XS, Ib }, 0 },
c0f3af97
L
5008 },
5009
592a252b 5010 /* PREFIX_VEX_0F72_REG_2 */
c0f3af97 5011 {
592d1631
L
5012 { Bad_Opcode },
5013 { Bad_Opcode },
ec6f095a 5014 { "vpsrld", { Vex, XS, Ib }, 0 },
c0f3af97
L
5015 },
5016
592a252b 5017 /* PREFIX_VEX_0F72_REG_4 */
c0f3af97 5018 {
592d1631
L
5019 { Bad_Opcode },
5020 { Bad_Opcode },
ec6f095a 5021 { "vpsrad", { Vex, XS, Ib }, 0 },
c0f3af97
L
5022 },
5023
592a252b 5024 /* PREFIX_VEX_0F72_REG_6 */
c0f3af97 5025 {
592d1631
L
5026 { Bad_Opcode },
5027 { Bad_Opcode },
ec6f095a 5028 { "vpslld", { Vex, XS, Ib }, 0 },
c0f3af97
L
5029 },
5030
592a252b 5031 /* PREFIX_VEX_0F73_REG_2 */
c0f3af97 5032 {
592d1631
L
5033 { Bad_Opcode },
5034 { Bad_Opcode },
ec6f095a 5035 { "vpsrlq", { Vex, XS, Ib }, 0 },
c0f3af97
L
5036 },
5037
592a252b 5038 /* PREFIX_VEX_0F73_REG_3 */
c0f3af97 5039 {
592d1631
L
5040 { Bad_Opcode },
5041 { Bad_Opcode },
ec6f095a 5042 { "vpsrldq", { Vex, XS, Ib }, 0 },
c0f3af97
L
5043 },
5044
592a252b 5045 /* PREFIX_VEX_0F73_REG_6 */
c0f3af97 5046 {
592d1631
L
5047 { Bad_Opcode },
5048 { Bad_Opcode },
ec6f095a 5049 { "vpsllq", { Vex, XS, Ib }, 0 },
c0f3af97
L
5050 },
5051
592a252b 5052 /* PREFIX_VEX_0F73_REG_7 */
c0f3af97 5053 {
592d1631
L
5054 { Bad_Opcode },
5055 { Bad_Opcode },
ec6f095a 5056 { "vpslldq", { Vex, XS, Ib }, 0 },
c0f3af97
L
5057 },
5058
592a252b 5059 /* PREFIX_VEX_0F74 */
c0f3af97 5060 {
592d1631
L
5061 { Bad_Opcode },
5062 { Bad_Opcode },
ec6f095a 5063 { "vpcmpeqb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5064 },
5065
592a252b 5066 /* PREFIX_VEX_0F75 */
c0f3af97 5067 {
592d1631
L
5068 { Bad_Opcode },
5069 { Bad_Opcode },
ec6f095a 5070 { "vpcmpeqw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5071 },
5072
592a252b 5073 /* PREFIX_VEX_0F76 */
c0f3af97 5074 {
592d1631
L
5075 { Bad_Opcode },
5076 { Bad_Opcode },
ec6f095a 5077 { "vpcmpeqd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5078 },
5079
592a252b 5080 /* PREFIX_VEX_0F77 */
c0f3af97 5081 {
ec6f095a 5082 { VEX_LEN_TABLE (VEX_LEN_0F77_P_0) },
c0f3af97
L
5083 },
5084
592a252b 5085 /* PREFIX_VEX_0F7C */
c0f3af97 5086 {
592d1631
L
5087 { Bad_Opcode },
5088 { Bad_Opcode },
ec6f095a
L
5089 { "vhaddpd", { XM, Vex, EXx }, 0 },
5090 { "vhaddps", { XM, Vex, EXx }, 0 },
c0f3af97
L
5091 },
5092
592a252b 5093 /* PREFIX_VEX_0F7D */
c0f3af97 5094 {
592d1631
L
5095 { Bad_Opcode },
5096 { Bad_Opcode },
ec6f095a
L
5097 { "vhsubpd", { XM, Vex, EXx }, 0 },
5098 { "vhsubps", { XM, Vex, EXx }, 0 },
c0f3af97
L
5099 },
5100
592a252b 5101 /* PREFIX_VEX_0F7E */
c0f3af97 5102 {
592d1631 5103 { Bad_Opcode },
592a252b
L
5104 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_1) },
5105 { VEX_LEN_TABLE (VEX_LEN_0F7E_P_2) },
c0f3af97
L
5106 },
5107
592a252b 5108 /* PREFIX_VEX_0F7F */
c0f3af97 5109 {
592d1631 5110 { Bad_Opcode },
ec6f095a
L
5111 { "vmovdqu", { EXxS, XM }, 0 },
5112 { "vmovdqa", { EXxS, XM }, 0 },
c0f3af97
L
5113 },
5114
43234a1e
L
5115 /* PREFIX_VEX_0F90 */
5116 {
5117 { VEX_LEN_TABLE (VEX_LEN_0F90_P_0) },
1ba585e8
IT
5118 { Bad_Opcode },
5119 { VEX_LEN_TABLE (VEX_LEN_0F90_P_2) },
43234a1e
L
5120 },
5121
5122 /* PREFIX_VEX_0F91 */
5123 {
5124 { VEX_LEN_TABLE (VEX_LEN_0F91_P_0) },
1ba585e8
IT
5125 { Bad_Opcode },
5126 { VEX_LEN_TABLE (VEX_LEN_0F91_P_2) },
43234a1e
L
5127 },
5128
5129 /* PREFIX_VEX_0F92 */
5130 {
5131 { VEX_LEN_TABLE (VEX_LEN_0F92_P_0) },
1ba585e8 5132 { Bad_Opcode },
90a915bf 5133 { VEX_LEN_TABLE (VEX_LEN_0F92_P_2) },
1ba585e8 5134 { VEX_LEN_TABLE (VEX_LEN_0F92_P_3) },
43234a1e
L
5135 },
5136
5137 /* PREFIX_VEX_0F93 */
5138 {
5139 { VEX_LEN_TABLE (VEX_LEN_0F93_P_0) },
1ba585e8 5140 { Bad_Opcode },
90a915bf 5141 { VEX_LEN_TABLE (VEX_LEN_0F93_P_2) },
1ba585e8 5142 { VEX_LEN_TABLE (VEX_LEN_0F93_P_3) },
43234a1e
L
5143 },
5144
5145 /* PREFIX_VEX_0F98 */
5146 {
5147 { VEX_LEN_TABLE (VEX_LEN_0F98_P_0) },
1ba585e8
IT
5148 { Bad_Opcode },
5149 { VEX_LEN_TABLE (VEX_LEN_0F98_P_2) },
5150 },
5151
5152 /* PREFIX_VEX_0F99 */
5153 {
5154 { VEX_LEN_TABLE (VEX_LEN_0F99_P_0) },
5155 { Bad_Opcode },
5156 { VEX_LEN_TABLE (VEX_LEN_0F99_P_2) },
43234a1e
L
5157 },
5158
592a252b 5159 /* PREFIX_VEX_0FC2 */
c0f3af97 5160 {
ec6f095a
L
5161 { "vcmpps", { XM, Vex, EXx, VCMP }, 0 },
5162 { "vcmpss", { XMScalar, VexScalar, EXdScalar, VCMP }, 0 },
5163 { "vcmppd", { XM, Vex, EXx, VCMP }, 0 },
5164 { "vcmpsd", { XMScalar, VexScalar, EXqScalar, VCMP }, 0 },
c0f3af97
L
5165 },
5166
592a252b 5167 /* PREFIX_VEX_0FC4 */
c0f3af97 5168 {
592d1631
L
5169 { Bad_Opcode },
5170 { Bad_Opcode },
592a252b 5171 { VEX_LEN_TABLE (VEX_LEN_0FC4_P_2) },
c0f3af97
L
5172 },
5173
592a252b 5174 /* PREFIX_VEX_0FC5 */
c0f3af97 5175 {
592d1631
L
5176 { Bad_Opcode },
5177 { Bad_Opcode },
592a252b 5178 { VEX_LEN_TABLE (VEX_LEN_0FC5_P_2) },
c0f3af97
L
5179 },
5180
592a252b 5181 /* PREFIX_VEX_0FD0 */
c0f3af97 5182 {
592d1631
L
5183 { Bad_Opcode },
5184 { Bad_Opcode },
ec6f095a
L
5185 { "vaddsubpd", { XM, Vex, EXx }, 0 },
5186 { "vaddsubps", { XM, Vex, EXx }, 0 },
c0f3af97
L
5187 },
5188
592a252b 5189 /* PREFIX_VEX_0FD1 */
c0f3af97 5190 {
592d1631
L
5191 { Bad_Opcode },
5192 { Bad_Opcode },
ec6f095a 5193 { "vpsrlw", { XM, Vex, EXxmm }, 0 },
c0f3af97
L
5194 },
5195
592a252b 5196 /* PREFIX_VEX_0FD2 */
c0f3af97 5197 {
592d1631
L
5198 { Bad_Opcode },
5199 { Bad_Opcode },
ec6f095a 5200 { "vpsrld", { XM, Vex, EXxmm }, 0 },
c0f3af97
L
5201 },
5202
592a252b 5203 /* PREFIX_VEX_0FD3 */
c0f3af97 5204 {
592d1631
L
5205 { Bad_Opcode },
5206 { Bad_Opcode },
ec6f095a 5207 { "vpsrlq", { XM, Vex, EXxmm }, 0 },
c0f3af97
L
5208 },
5209
592a252b 5210 /* PREFIX_VEX_0FD4 */
c0f3af97 5211 {
592d1631
L
5212 { Bad_Opcode },
5213 { Bad_Opcode },
ec6f095a 5214 { "vpaddq", { XM, Vex, EXx }, 0 },
c0f3af97
L
5215 },
5216
592a252b 5217 /* PREFIX_VEX_0FD5 */
c0f3af97 5218 {
592d1631
L
5219 { Bad_Opcode },
5220 { Bad_Opcode },
ec6f095a 5221 { "vpmullw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5222 },
5223
592a252b 5224 /* PREFIX_VEX_0FD6 */
c0f3af97 5225 {
592d1631
L
5226 { Bad_Opcode },
5227 { Bad_Opcode },
592a252b 5228 { VEX_LEN_TABLE (VEX_LEN_0FD6_P_2) },
c0f3af97
L
5229 },
5230
592a252b 5231 /* PREFIX_VEX_0FD7 */
c0f3af97 5232 {
592d1631
L
5233 { Bad_Opcode },
5234 { Bad_Opcode },
592a252b 5235 { MOD_TABLE (MOD_VEX_0FD7_PREFIX_2) },
c0f3af97
L
5236 },
5237
592a252b 5238 /* PREFIX_VEX_0FD8 */
c0f3af97 5239 {
592d1631
L
5240 { Bad_Opcode },
5241 { Bad_Opcode },
ec6f095a 5242 { "vpsubusb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5243 },
5244
592a252b 5245 /* PREFIX_VEX_0FD9 */
c0f3af97 5246 {
592d1631
L
5247 { Bad_Opcode },
5248 { Bad_Opcode },
ec6f095a 5249 { "vpsubusw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5250 },
5251
592a252b 5252 /* PREFIX_VEX_0FDA */
c0f3af97 5253 {
592d1631
L
5254 { Bad_Opcode },
5255 { Bad_Opcode },
ec6f095a 5256 { "vpminub", { XM, Vex, EXx }, 0 },
c0f3af97
L
5257 },
5258
592a252b 5259 /* PREFIX_VEX_0FDB */
c0f3af97 5260 {
592d1631
L
5261 { Bad_Opcode },
5262 { Bad_Opcode },
ec6f095a 5263 { "vpand", { XM, Vex, EXx }, 0 },
c0f3af97
L
5264 },
5265
592a252b 5266 /* PREFIX_VEX_0FDC */
c0f3af97 5267 {
592d1631
L
5268 { Bad_Opcode },
5269 { Bad_Opcode },
ec6f095a 5270 { "vpaddusb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5271 },
5272
592a252b 5273 /* PREFIX_VEX_0FDD */
c0f3af97 5274 {
592d1631
L
5275 { Bad_Opcode },
5276 { Bad_Opcode },
ec6f095a 5277 { "vpaddusw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5278 },
5279
592a252b 5280 /* PREFIX_VEX_0FDE */
c0f3af97 5281 {
592d1631
L
5282 { Bad_Opcode },
5283 { Bad_Opcode },
ec6f095a 5284 { "vpmaxub", { XM, Vex, EXx }, 0 },
c0f3af97
L
5285 },
5286
592a252b 5287 /* PREFIX_VEX_0FDF */
c0f3af97 5288 {
592d1631
L
5289 { Bad_Opcode },
5290 { Bad_Opcode },
ec6f095a 5291 { "vpandn", { XM, Vex, EXx }, 0 },
c0f3af97
L
5292 },
5293
592a252b 5294 /* PREFIX_VEX_0FE0 */
c0f3af97 5295 {
592d1631
L
5296 { Bad_Opcode },
5297 { Bad_Opcode },
ec6f095a 5298 { "vpavgb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5299 },
5300
592a252b 5301 /* PREFIX_VEX_0FE1 */
c0f3af97 5302 {
592d1631
L
5303 { Bad_Opcode },
5304 { Bad_Opcode },
ec6f095a 5305 { "vpsraw", { XM, Vex, EXxmm }, 0 },
c0f3af97
L
5306 },
5307
592a252b 5308 /* PREFIX_VEX_0FE2 */
c0f3af97 5309 {
592d1631
L
5310 { Bad_Opcode },
5311 { Bad_Opcode },
ec6f095a 5312 { "vpsrad", { XM, Vex, EXxmm }, 0 },
c0f3af97
L
5313 },
5314
592a252b 5315 /* PREFIX_VEX_0FE3 */
c0f3af97 5316 {
592d1631
L
5317 { Bad_Opcode },
5318 { Bad_Opcode },
ec6f095a 5319 { "vpavgw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5320 },
5321
592a252b 5322 /* PREFIX_VEX_0FE4 */
c0f3af97 5323 {
592d1631
L
5324 { Bad_Opcode },
5325 { Bad_Opcode },
ec6f095a 5326 { "vpmulhuw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5327 },
5328
592a252b 5329 /* PREFIX_VEX_0FE5 */
c0f3af97 5330 {
592d1631
L
5331 { Bad_Opcode },
5332 { Bad_Opcode },
ec6f095a 5333 { "vpmulhw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5334 },
5335
592a252b 5336 /* PREFIX_VEX_0FE6 */
c0f3af97 5337 {
592d1631 5338 { Bad_Opcode },
ec6f095a
L
5339 { "vcvtdq2pd", { XM, EXxmmq }, 0 },
5340 { "vcvttpd2dq%XY", { XMM, EXx }, 0 },
5341 { "vcvtpd2dq%XY", { XMM, EXx }, 0 },
c0f3af97
L
5342 },
5343
592a252b 5344 /* PREFIX_VEX_0FE7 */
c0f3af97 5345 {
592d1631
L
5346 { Bad_Opcode },
5347 { Bad_Opcode },
592a252b 5348 { MOD_TABLE (MOD_VEX_0FE7_PREFIX_2) },
c0f3af97
L
5349 },
5350
592a252b 5351 /* PREFIX_VEX_0FE8 */
c0f3af97 5352 {
592d1631
L
5353 { Bad_Opcode },
5354 { Bad_Opcode },
ec6f095a 5355 { "vpsubsb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5356 },
5357
592a252b 5358 /* PREFIX_VEX_0FE9 */
c0f3af97 5359 {
592d1631
L
5360 { Bad_Opcode },
5361 { Bad_Opcode },
ec6f095a 5362 { "vpsubsw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5363 },
5364
592a252b 5365 /* PREFIX_VEX_0FEA */
c0f3af97 5366 {
592d1631
L
5367 { Bad_Opcode },
5368 { Bad_Opcode },
ec6f095a 5369 { "vpminsw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5370 },
5371
592a252b 5372 /* PREFIX_VEX_0FEB */
c0f3af97 5373 {
592d1631
L
5374 { Bad_Opcode },
5375 { Bad_Opcode },
ec6f095a 5376 { "vpor", { XM, Vex, EXx }, 0 },
c0f3af97
L
5377 },
5378
592a252b 5379 /* PREFIX_VEX_0FEC */
c0f3af97 5380 {
592d1631
L
5381 { Bad_Opcode },
5382 { Bad_Opcode },
ec6f095a 5383 { "vpaddsb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5384 },
5385
592a252b 5386 /* PREFIX_VEX_0FED */
c0f3af97 5387 {
592d1631
L
5388 { Bad_Opcode },
5389 { Bad_Opcode },
ec6f095a 5390 { "vpaddsw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5391 },
5392
592a252b 5393 /* PREFIX_VEX_0FEE */
c0f3af97 5394 {
592d1631
L
5395 { Bad_Opcode },
5396 { Bad_Opcode },
ec6f095a 5397 { "vpmaxsw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5398 },
5399
592a252b 5400 /* PREFIX_VEX_0FEF */
c0f3af97 5401 {
592d1631
L
5402 { Bad_Opcode },
5403 { Bad_Opcode },
ec6f095a 5404 { "vpxor", { XM, Vex, EXx }, 0 },
c0f3af97
L
5405 },
5406
592a252b 5407 /* PREFIX_VEX_0FF0 */
c0f3af97 5408 {
592d1631
L
5409 { Bad_Opcode },
5410 { Bad_Opcode },
5411 { Bad_Opcode },
592a252b 5412 { MOD_TABLE (MOD_VEX_0FF0_PREFIX_3) },
c0f3af97
L
5413 },
5414
592a252b 5415 /* PREFIX_VEX_0FF1 */
c0f3af97 5416 {
592d1631
L
5417 { Bad_Opcode },
5418 { Bad_Opcode },
ec6f095a 5419 { "vpsllw", { XM, Vex, EXxmm }, 0 },
c0f3af97
L
5420 },
5421
592a252b 5422 /* PREFIX_VEX_0FF2 */
c0f3af97 5423 {
592d1631
L
5424 { Bad_Opcode },
5425 { Bad_Opcode },
ec6f095a 5426 { "vpslld", { XM, Vex, EXxmm }, 0 },
c0f3af97
L
5427 },
5428
592a252b 5429 /* PREFIX_VEX_0FF3 */
c0f3af97 5430 {
592d1631
L
5431 { Bad_Opcode },
5432 { Bad_Opcode },
ec6f095a 5433 { "vpsllq", { XM, Vex, EXxmm }, 0 },
c0f3af97
L
5434 },
5435
592a252b 5436 /* PREFIX_VEX_0FF4 */
c0f3af97 5437 {
592d1631
L
5438 { Bad_Opcode },
5439 { Bad_Opcode },
ec6f095a 5440 { "vpmuludq", { XM, Vex, EXx }, 0 },
c0f3af97
L
5441 },
5442
592a252b 5443 /* PREFIX_VEX_0FF5 */
c0f3af97 5444 {
592d1631
L
5445 { Bad_Opcode },
5446 { Bad_Opcode },
ec6f095a 5447 { "vpmaddwd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5448 },
5449
592a252b 5450 /* PREFIX_VEX_0FF6 */
c0f3af97 5451 {
592d1631
L
5452 { Bad_Opcode },
5453 { Bad_Opcode },
ec6f095a 5454 { "vpsadbw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5455 },
5456
592a252b 5457 /* PREFIX_VEX_0FF7 */
c0f3af97 5458 {
592d1631
L
5459 { Bad_Opcode },
5460 { Bad_Opcode },
592a252b 5461 { VEX_LEN_TABLE (VEX_LEN_0FF7_P_2) },
c0f3af97
L
5462 },
5463
592a252b 5464 /* PREFIX_VEX_0FF8 */
c0f3af97 5465 {
592d1631
L
5466 { Bad_Opcode },
5467 { Bad_Opcode },
ec6f095a 5468 { "vpsubb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5469 },
5470
592a252b 5471 /* PREFIX_VEX_0FF9 */
c0f3af97 5472 {
592d1631
L
5473 { Bad_Opcode },
5474 { Bad_Opcode },
ec6f095a 5475 { "vpsubw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5476 },
5477
592a252b 5478 /* PREFIX_VEX_0FFA */
c0f3af97 5479 {
592d1631
L
5480 { Bad_Opcode },
5481 { Bad_Opcode },
ec6f095a 5482 { "vpsubd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5483 },
5484
592a252b 5485 /* PREFIX_VEX_0FFB */
c0f3af97 5486 {
592d1631
L
5487 { Bad_Opcode },
5488 { Bad_Opcode },
ec6f095a 5489 { "vpsubq", { XM, Vex, EXx }, 0 },
c0f3af97
L
5490 },
5491
592a252b 5492 /* PREFIX_VEX_0FFC */
c0f3af97 5493 {
592d1631
L
5494 { Bad_Opcode },
5495 { Bad_Opcode },
ec6f095a 5496 { "vpaddb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5497 },
5498
592a252b 5499 /* PREFIX_VEX_0FFD */
c0f3af97 5500 {
592d1631
L
5501 { Bad_Opcode },
5502 { Bad_Opcode },
ec6f095a 5503 { "vpaddw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5504 },
5505
592a252b 5506 /* PREFIX_VEX_0FFE */
c0f3af97 5507 {
592d1631
L
5508 { Bad_Opcode },
5509 { Bad_Opcode },
ec6f095a 5510 { "vpaddd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5511 },
5512
592a252b 5513 /* PREFIX_VEX_0F3800 */
c0f3af97 5514 {
592d1631
L
5515 { Bad_Opcode },
5516 { Bad_Opcode },
ec6f095a 5517 { "vpshufb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5518 },
5519
592a252b 5520 /* PREFIX_VEX_0F3801 */
c0f3af97 5521 {
592d1631
L
5522 { Bad_Opcode },
5523 { Bad_Opcode },
ec6f095a 5524 { "vphaddw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5525 },
5526
592a252b 5527 /* PREFIX_VEX_0F3802 */
c0f3af97 5528 {
592d1631
L
5529 { Bad_Opcode },
5530 { Bad_Opcode },
ec6f095a 5531 { "vphaddd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5532 },
5533
592a252b 5534 /* PREFIX_VEX_0F3803 */
c0f3af97 5535 {
592d1631
L
5536 { Bad_Opcode },
5537 { Bad_Opcode },
ec6f095a 5538 { "vphaddsw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5539 },
5540
592a252b 5541 /* PREFIX_VEX_0F3804 */
c0f3af97 5542 {
592d1631
L
5543 { Bad_Opcode },
5544 { Bad_Opcode },
ec6f095a 5545 { "vpmaddubsw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5546 },
5547
592a252b 5548 /* PREFIX_VEX_0F3805 */
c0f3af97 5549 {
592d1631
L
5550 { Bad_Opcode },
5551 { Bad_Opcode },
ec6f095a 5552 { "vphsubw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5553 },
5554
592a252b 5555 /* PREFIX_VEX_0F3806 */
c0f3af97 5556 {
592d1631
L
5557 { Bad_Opcode },
5558 { Bad_Opcode },
ec6f095a 5559 { "vphsubd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5560 },
5561
592a252b 5562 /* PREFIX_VEX_0F3807 */
c0f3af97 5563 {
592d1631
L
5564 { Bad_Opcode },
5565 { Bad_Opcode },
ec6f095a 5566 { "vphsubsw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5567 },
5568
592a252b 5569 /* PREFIX_VEX_0F3808 */
c0f3af97 5570 {
592d1631
L
5571 { Bad_Opcode },
5572 { Bad_Opcode },
ec6f095a 5573 { "vpsignb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5574 },
5575
592a252b 5576 /* PREFIX_VEX_0F3809 */
c0f3af97 5577 {
592d1631
L
5578 { Bad_Opcode },
5579 { Bad_Opcode },
ec6f095a 5580 { "vpsignw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5581 },
5582
592a252b 5583 /* PREFIX_VEX_0F380A */
c0f3af97 5584 {
592d1631
L
5585 { Bad_Opcode },
5586 { Bad_Opcode },
ec6f095a 5587 { "vpsignd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5588 },
5589
592a252b 5590 /* PREFIX_VEX_0F380B */
c0f3af97 5591 {
592d1631
L
5592 { Bad_Opcode },
5593 { Bad_Opcode },
ec6f095a 5594 { "vpmulhrsw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5595 },
5596
592a252b 5597 /* PREFIX_VEX_0F380C */
c0f3af97 5598 {
592d1631
L
5599 { Bad_Opcode },
5600 { Bad_Opcode },
592a252b 5601 { VEX_W_TABLE (VEX_W_0F380C_P_2) },
c0f3af97
L
5602 },
5603
592a252b 5604 /* PREFIX_VEX_0F380D */
c0f3af97 5605 {
592d1631
L
5606 { Bad_Opcode },
5607 { Bad_Opcode },
592a252b 5608 { VEX_W_TABLE (VEX_W_0F380D_P_2) },
c0f3af97
L
5609 },
5610
592a252b 5611 /* PREFIX_VEX_0F380E */
c0f3af97 5612 {
592d1631
L
5613 { Bad_Opcode },
5614 { Bad_Opcode },
592a252b 5615 { VEX_W_TABLE (VEX_W_0F380E_P_2) },
c0f3af97
L
5616 },
5617
592a252b 5618 /* PREFIX_VEX_0F380F */
c0f3af97 5619 {
592d1631
L
5620 { Bad_Opcode },
5621 { Bad_Opcode },
592a252b 5622 { VEX_W_TABLE (VEX_W_0F380F_P_2) },
c0f3af97
L
5623 },
5624
592a252b 5625 /* PREFIX_VEX_0F3813 */
c7b8aa3a
L
5626 {
5627 { Bad_Opcode },
5628 { Bad_Opcode },
bf890a93 5629 { "vcvtph2ps", { XM, EXxmmq }, 0 },
c7b8aa3a
L
5630 },
5631
6c30d220
L
5632 /* PREFIX_VEX_0F3816 */
5633 {
5634 { Bad_Opcode },
5635 { Bad_Opcode },
5636 { VEX_LEN_TABLE (VEX_LEN_0F3816_P_2) },
5637 },
5638
592a252b 5639 /* PREFIX_VEX_0F3817 */
c0f3af97 5640 {
592d1631
L
5641 { Bad_Opcode },
5642 { Bad_Opcode },
ec6f095a 5643 { "vptest", { XM, EXx }, 0 },
c0f3af97
L
5644 },
5645
592a252b 5646 /* PREFIX_VEX_0F3818 */
c0f3af97 5647 {
592d1631
L
5648 { Bad_Opcode },
5649 { Bad_Opcode },
6c30d220 5650 { VEX_W_TABLE (VEX_W_0F3818_P_2) },
c0f3af97
L
5651 },
5652
592a252b 5653 /* PREFIX_VEX_0F3819 */
c0f3af97 5654 {
592d1631
L
5655 { Bad_Opcode },
5656 { Bad_Opcode },
6c30d220 5657 { VEX_LEN_TABLE (VEX_LEN_0F3819_P_2) },
c0f3af97
L
5658 },
5659
592a252b 5660 /* PREFIX_VEX_0F381A */
c0f3af97 5661 {
592d1631
L
5662 { Bad_Opcode },
5663 { Bad_Opcode },
592a252b 5664 { MOD_TABLE (MOD_VEX_0F381A_PREFIX_2) },
c0f3af97
L
5665 },
5666
592a252b 5667 /* PREFIX_VEX_0F381C */
c0f3af97 5668 {
592d1631
L
5669 { Bad_Opcode },
5670 { Bad_Opcode },
ec6f095a 5671 { "vpabsb", { XM, EXx }, 0 },
c0f3af97
L
5672 },
5673
592a252b 5674 /* PREFIX_VEX_0F381D */
c0f3af97 5675 {
592d1631
L
5676 { Bad_Opcode },
5677 { Bad_Opcode },
ec6f095a 5678 { "vpabsw", { XM, EXx }, 0 },
c0f3af97
L
5679 },
5680
592a252b 5681 /* PREFIX_VEX_0F381E */
c0f3af97 5682 {
592d1631
L
5683 { Bad_Opcode },
5684 { Bad_Opcode },
ec6f095a 5685 { "vpabsd", { XM, EXx }, 0 },
c0f3af97
L
5686 },
5687
592a252b 5688 /* PREFIX_VEX_0F3820 */
c0f3af97 5689 {
592d1631
L
5690 { Bad_Opcode },
5691 { Bad_Opcode },
ec6f095a 5692 { "vpmovsxbw", { XM, EXxmmq }, 0 },
c0f3af97
L
5693 },
5694
592a252b 5695 /* PREFIX_VEX_0F3821 */
c0f3af97 5696 {
592d1631
L
5697 { Bad_Opcode },
5698 { Bad_Opcode },
ec6f095a 5699 { "vpmovsxbd", { XM, EXxmmqd }, 0 },
c0f3af97
L
5700 },
5701
592a252b 5702 /* PREFIX_VEX_0F3822 */
c0f3af97 5703 {
592d1631
L
5704 { Bad_Opcode },
5705 { Bad_Opcode },
ec6f095a 5706 { "vpmovsxbq", { XM, EXxmmdw }, 0 },
c0f3af97
L
5707 },
5708
592a252b 5709 /* PREFIX_VEX_0F3823 */
c0f3af97 5710 {
592d1631
L
5711 { Bad_Opcode },
5712 { Bad_Opcode },
ec6f095a 5713 { "vpmovsxwd", { XM, EXxmmq }, 0 },
c0f3af97
L
5714 },
5715
592a252b 5716 /* PREFIX_VEX_0F3824 */
c0f3af97 5717 {
592d1631
L
5718 { Bad_Opcode },
5719 { Bad_Opcode },
ec6f095a 5720 { "vpmovsxwq", { XM, EXxmmqd }, 0 },
c0f3af97
L
5721 },
5722
592a252b 5723 /* PREFIX_VEX_0F3825 */
c0f3af97 5724 {
592d1631
L
5725 { Bad_Opcode },
5726 { Bad_Opcode },
ec6f095a 5727 { "vpmovsxdq", { XM, EXxmmq }, 0 },
c0f3af97
L
5728 },
5729
592a252b 5730 /* PREFIX_VEX_0F3828 */
c0f3af97 5731 {
592d1631
L
5732 { Bad_Opcode },
5733 { Bad_Opcode },
ec6f095a 5734 { "vpmuldq", { XM, Vex, EXx }, 0 },
c0f3af97
L
5735 },
5736
592a252b 5737 /* PREFIX_VEX_0F3829 */
c0f3af97 5738 {
592d1631
L
5739 { Bad_Opcode },
5740 { Bad_Opcode },
ec6f095a 5741 { "vpcmpeqq", { XM, Vex, EXx }, 0 },
c0f3af97
L
5742 },
5743
592a252b 5744 /* PREFIX_VEX_0F382A */
c0f3af97 5745 {
592d1631
L
5746 { Bad_Opcode },
5747 { Bad_Opcode },
592a252b 5748 { MOD_TABLE (MOD_VEX_0F382A_PREFIX_2) },
c0f3af97
L
5749 },
5750
592a252b 5751 /* PREFIX_VEX_0F382B */
c0f3af97 5752 {
592d1631
L
5753 { Bad_Opcode },
5754 { Bad_Opcode },
ec6f095a 5755 { "vpackusdw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5756 },
5757
592a252b 5758 /* PREFIX_VEX_0F382C */
c0f3af97 5759 {
592d1631
L
5760 { Bad_Opcode },
5761 { Bad_Opcode },
592a252b 5762 { MOD_TABLE (MOD_VEX_0F382C_PREFIX_2) },
c0f3af97
L
5763 },
5764
592a252b 5765 /* PREFIX_VEX_0F382D */
c0f3af97 5766 {
592d1631
L
5767 { Bad_Opcode },
5768 { Bad_Opcode },
592a252b 5769 { MOD_TABLE (MOD_VEX_0F382D_PREFIX_2) },
c0f3af97
L
5770 },
5771
592a252b 5772 /* PREFIX_VEX_0F382E */
c0f3af97 5773 {
592d1631
L
5774 { Bad_Opcode },
5775 { Bad_Opcode },
592a252b 5776 { MOD_TABLE (MOD_VEX_0F382E_PREFIX_2) },
c0f3af97
L
5777 },
5778
592a252b 5779 /* PREFIX_VEX_0F382F */
c0f3af97 5780 {
592d1631
L
5781 { Bad_Opcode },
5782 { Bad_Opcode },
592a252b 5783 { MOD_TABLE (MOD_VEX_0F382F_PREFIX_2) },
c0f3af97
L
5784 },
5785
592a252b 5786 /* PREFIX_VEX_0F3830 */
c0f3af97 5787 {
592d1631
L
5788 { Bad_Opcode },
5789 { Bad_Opcode },
ec6f095a 5790 { "vpmovzxbw", { XM, EXxmmq }, 0 },
c0f3af97
L
5791 },
5792
592a252b 5793 /* PREFIX_VEX_0F3831 */
c0f3af97 5794 {
592d1631
L
5795 { Bad_Opcode },
5796 { Bad_Opcode },
ec6f095a 5797 { "vpmovzxbd", { XM, EXxmmqd }, 0 },
c0f3af97
L
5798 },
5799
592a252b 5800 /* PREFIX_VEX_0F3832 */
c0f3af97 5801 {
592d1631
L
5802 { Bad_Opcode },
5803 { Bad_Opcode },
ec6f095a 5804 { "vpmovzxbq", { XM, EXxmmdw }, 0 },
c0f3af97
L
5805 },
5806
592a252b 5807 /* PREFIX_VEX_0F3833 */
c0f3af97 5808 {
592d1631
L
5809 { Bad_Opcode },
5810 { Bad_Opcode },
ec6f095a 5811 { "vpmovzxwd", { XM, EXxmmq }, 0 },
c0f3af97
L
5812 },
5813
592a252b 5814 /* PREFIX_VEX_0F3834 */
c0f3af97 5815 {
592d1631
L
5816 { Bad_Opcode },
5817 { Bad_Opcode },
ec6f095a 5818 { "vpmovzxwq", { XM, EXxmmqd }, 0 },
c0f3af97
L
5819 },
5820
592a252b 5821 /* PREFIX_VEX_0F3835 */
c0f3af97 5822 {
592d1631
L
5823 { Bad_Opcode },
5824 { Bad_Opcode },
ec6f095a 5825 { "vpmovzxdq", { XM, EXxmmq }, 0 },
6c30d220
L
5826 },
5827
5828 /* PREFIX_VEX_0F3836 */
5829 {
5830 { Bad_Opcode },
5831 { Bad_Opcode },
5832 { VEX_LEN_TABLE (VEX_LEN_0F3836_P_2) },
c0f3af97
L
5833 },
5834
592a252b 5835 /* PREFIX_VEX_0F3837 */
c0f3af97 5836 {
592d1631
L
5837 { Bad_Opcode },
5838 { Bad_Opcode },
ec6f095a 5839 { "vpcmpgtq", { XM, Vex, EXx }, 0 },
c0f3af97
L
5840 },
5841
592a252b 5842 /* PREFIX_VEX_0F3838 */
c0f3af97 5843 {
592d1631
L
5844 { Bad_Opcode },
5845 { Bad_Opcode },
ec6f095a 5846 { "vpminsb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5847 },
5848
592a252b 5849 /* PREFIX_VEX_0F3839 */
c0f3af97 5850 {
592d1631
L
5851 { Bad_Opcode },
5852 { Bad_Opcode },
ec6f095a 5853 { "vpminsd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5854 },
5855
592a252b 5856 /* PREFIX_VEX_0F383A */
c0f3af97 5857 {
592d1631
L
5858 { Bad_Opcode },
5859 { Bad_Opcode },
ec6f095a 5860 { "vpminuw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5861 },
5862
592a252b 5863 /* PREFIX_VEX_0F383B */
c0f3af97 5864 {
592d1631
L
5865 { Bad_Opcode },
5866 { Bad_Opcode },
ec6f095a 5867 { "vpminud", { XM, Vex, EXx }, 0 },
c0f3af97
L
5868 },
5869
592a252b 5870 /* PREFIX_VEX_0F383C */
c0f3af97 5871 {
592d1631
L
5872 { Bad_Opcode },
5873 { Bad_Opcode },
ec6f095a 5874 { "vpmaxsb", { XM, Vex, EXx }, 0 },
c0f3af97
L
5875 },
5876
592a252b 5877 /* PREFIX_VEX_0F383D */
c0f3af97 5878 {
592d1631
L
5879 { Bad_Opcode },
5880 { Bad_Opcode },
ec6f095a 5881 { "vpmaxsd", { XM, Vex, EXx }, 0 },
c0f3af97
L
5882 },
5883
592a252b 5884 /* PREFIX_VEX_0F383E */
c0f3af97 5885 {
592d1631
L
5886 { Bad_Opcode },
5887 { Bad_Opcode },
ec6f095a 5888 { "vpmaxuw", { XM, Vex, EXx }, 0 },
c0f3af97
L
5889 },
5890
592a252b 5891 /* PREFIX_VEX_0F383F */
c0f3af97 5892 {
592d1631
L
5893 { Bad_Opcode },
5894 { Bad_Opcode },
ec6f095a 5895 { "vpmaxud", { XM, Vex, EXx }, 0 },
c0f3af97
L
5896 },
5897
592a252b 5898 /* PREFIX_VEX_0F3840 */
c0f3af97 5899 {
592d1631
L
5900 { Bad_Opcode },
5901 { Bad_Opcode },
ec6f095a 5902 { "vpmulld", { XM, Vex, EXx }, 0 },
c0f3af97
L
5903 },
5904
592a252b 5905 /* PREFIX_VEX_0F3841 */
c0f3af97 5906 {
592d1631
L
5907 { Bad_Opcode },
5908 { Bad_Opcode },
592a252b 5909 { VEX_LEN_TABLE (VEX_LEN_0F3841_P_2) },
c0f3af97
L
5910 },
5911
6c30d220
L
5912 /* PREFIX_VEX_0F3845 */
5913 {
5914 { Bad_Opcode },
5915 { Bad_Opcode },
bf890a93 5916 { "vpsrlv%LW", { XM, Vex, EXx }, 0 },
6c30d220
L
5917 },
5918
5919 /* PREFIX_VEX_0F3846 */
5920 {
5921 { Bad_Opcode },
5922 { Bad_Opcode },
5923 { VEX_W_TABLE (VEX_W_0F3846_P_2) },
5924 },
5925
5926 /* PREFIX_VEX_0F3847 */
5927 {
5928 { Bad_Opcode },
5929 { Bad_Opcode },
bf890a93 5930 { "vpsllv%LW", { XM, Vex, EXx }, 0 },
6c30d220
L
5931 },
5932
5933 /* PREFIX_VEX_0F3858 */
5934 {
5935 { Bad_Opcode },
5936 { Bad_Opcode },
5937 { VEX_W_TABLE (VEX_W_0F3858_P_2) },
5938 },
5939
5940 /* PREFIX_VEX_0F3859 */
5941 {
5942 { Bad_Opcode },
5943 { Bad_Opcode },
5944 { VEX_W_TABLE (VEX_W_0F3859_P_2) },
5945 },
5946
5947 /* PREFIX_VEX_0F385A */
5948 {
5949 { Bad_Opcode },
5950 { Bad_Opcode },
5951 { MOD_TABLE (MOD_VEX_0F385A_PREFIX_2) },
5952 },
5953
5954 /* PREFIX_VEX_0F3878 */
5955 {
5956 { Bad_Opcode },
5957 { Bad_Opcode },
5958 { VEX_W_TABLE (VEX_W_0F3878_P_2) },
5959 },
5960
5961 /* PREFIX_VEX_0F3879 */
5962 {
5963 { Bad_Opcode },
5964 { Bad_Opcode },
5965 { VEX_W_TABLE (VEX_W_0F3879_P_2) },
5966 },
5967
5968 /* PREFIX_VEX_0F388C */
5969 {
5970 { Bad_Opcode },
5971 { Bad_Opcode },
f7002f42 5972 { MOD_TABLE (MOD_VEX_0F388C_PREFIX_2) },
6c30d220
L
5973 },
5974
5975 /* PREFIX_VEX_0F388E */
5976 {
5977 { Bad_Opcode },
5978 { Bad_Opcode },
f7002f42 5979 { MOD_TABLE (MOD_VEX_0F388E_PREFIX_2) },
6c30d220
L
5980 },
5981
5982 /* PREFIX_VEX_0F3890 */
5983 {
5984 { Bad_Opcode },
5985 { Bad_Opcode },
bf890a93 5986 { "vpgatherd%LW", { XM, MVexVSIBDWpX, Vex }, 0 },
6c30d220
L
5987 },
5988
5989 /* PREFIX_VEX_0F3891 */
5990 {
5991 { Bad_Opcode },
5992 { Bad_Opcode },
bf890a93 5993 { "vpgatherq%LW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
6c30d220
L
5994 },
5995
5996 /* PREFIX_VEX_0F3892 */
5997 {
5998 { Bad_Opcode },
5999 { Bad_Opcode },
bf890a93 6000 { "vgatherdp%XW", { XM, MVexVSIBDWpX, Vex }, 0 },
6c30d220
L
6001 },
6002
6003 /* PREFIX_VEX_0F3893 */
6004 {
6005 { Bad_Opcode },
6006 { Bad_Opcode },
bf890a93 6007 { "vgatherqp%XW", { XMGatherQ, MVexVSIBQWpX, VexGatherQ }, 0 },
6c30d220
L
6008 },
6009
592a252b 6010 /* PREFIX_VEX_0F3896 */
a5ff0eb2 6011 {
592d1631
L
6012 { Bad_Opcode },
6013 { Bad_Opcode },
bf890a93 6014 { "vfmaddsub132p%XW", { XM, Vex, EXx }, 0 },
a5ff0eb2
L
6015 },
6016
592a252b 6017 /* PREFIX_VEX_0F3897 */
a5ff0eb2 6018 {
592d1631
L
6019 { Bad_Opcode },
6020 { Bad_Opcode },
bf890a93 6021 { "vfmsubadd132p%XW", { XM, Vex, EXx }, 0 },
a5ff0eb2
L
6022 },
6023
592a252b 6024 /* PREFIX_VEX_0F3898 */
a5ff0eb2 6025 {
592d1631
L
6026 { Bad_Opcode },
6027 { Bad_Opcode },
bf890a93 6028 { "vfmadd132p%XW", { XM, Vex, EXx }, 0 },
a5ff0eb2
L
6029 },
6030
592a252b 6031 /* PREFIX_VEX_0F3899 */
a5ff0eb2 6032 {
592d1631
L
6033 { Bad_Opcode },
6034 { Bad_Opcode },
bf890a93 6035 { "vfmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
a5ff0eb2
L
6036 },
6037
592a252b 6038 /* PREFIX_VEX_0F389A */
a5ff0eb2 6039 {
592d1631
L
6040 { Bad_Opcode },
6041 { Bad_Opcode },
bf890a93 6042 { "vfmsub132p%XW", { XM, Vex, EXx }, 0 },
a5ff0eb2
L
6043 },
6044
592a252b 6045 /* PREFIX_VEX_0F389B */
c0f3af97 6046 {
592d1631
L
6047 { Bad_Opcode },
6048 { Bad_Opcode },
bf890a93 6049 { "vfmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6050 },
6051
592a252b 6052 /* PREFIX_VEX_0F389C */
c0f3af97 6053 {
592d1631
L
6054 { Bad_Opcode },
6055 { Bad_Opcode },
bf890a93 6056 { "vfnmadd132p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6057 },
6058
592a252b 6059 /* PREFIX_VEX_0F389D */
c0f3af97 6060 {
592d1631
L
6061 { Bad_Opcode },
6062 { Bad_Opcode },
bf890a93 6063 { "vfnmadd132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6064 },
6065
592a252b 6066 /* PREFIX_VEX_0F389E */
c0f3af97 6067 {
592d1631
L
6068 { Bad_Opcode },
6069 { Bad_Opcode },
bf890a93 6070 { "vfnmsub132p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6071 },
6072
592a252b 6073 /* PREFIX_VEX_0F389F */
c0f3af97 6074 {
592d1631
L
6075 { Bad_Opcode },
6076 { Bad_Opcode },
bf890a93 6077 { "vfnmsub132s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6078 },
6079
592a252b 6080 /* PREFIX_VEX_0F38A6 */
c0f3af97 6081 {
592d1631
L
6082 { Bad_Opcode },
6083 { Bad_Opcode },
bf890a93 6084 { "vfmaddsub213p%XW", { XM, Vex, EXx }, 0 },
592d1631 6085 { Bad_Opcode },
c0f3af97
L
6086 },
6087
592a252b 6088 /* PREFIX_VEX_0F38A7 */
c0f3af97 6089 {
592d1631
L
6090 { Bad_Opcode },
6091 { Bad_Opcode },
bf890a93 6092 { "vfmsubadd213p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6093 },
6094
592a252b 6095 /* PREFIX_VEX_0F38A8 */
c0f3af97 6096 {
592d1631
L
6097 { Bad_Opcode },
6098 { Bad_Opcode },
bf890a93 6099 { "vfmadd213p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6100 },
6101
592a252b 6102 /* PREFIX_VEX_0F38A9 */
c0f3af97 6103 {
592d1631
L
6104 { Bad_Opcode },
6105 { Bad_Opcode },
bf890a93 6106 { "vfmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6107 },
6108
592a252b 6109 /* PREFIX_VEX_0F38AA */
c0f3af97 6110 {
592d1631
L
6111 { Bad_Opcode },
6112 { Bad_Opcode },
bf890a93 6113 { "vfmsub213p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6114 },
6115
592a252b 6116 /* PREFIX_VEX_0F38AB */
c0f3af97 6117 {
592d1631
L
6118 { Bad_Opcode },
6119 { Bad_Opcode },
bf890a93 6120 { "vfmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6121 },
6122
592a252b 6123 /* PREFIX_VEX_0F38AC */
c0f3af97 6124 {
592d1631
L
6125 { Bad_Opcode },
6126 { Bad_Opcode },
bf890a93 6127 { "vfnmadd213p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6128 },
6129
592a252b 6130 /* PREFIX_VEX_0F38AD */
c0f3af97 6131 {
592d1631
L
6132 { Bad_Opcode },
6133 { Bad_Opcode },
bf890a93 6134 { "vfnmadd213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6135 },
6136
592a252b 6137 /* PREFIX_VEX_0F38AE */
c0f3af97 6138 {
592d1631
L
6139 { Bad_Opcode },
6140 { Bad_Opcode },
bf890a93 6141 { "vfnmsub213p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6142 },
6143
592a252b 6144 /* PREFIX_VEX_0F38AF */
c0f3af97 6145 {
592d1631
L
6146 { Bad_Opcode },
6147 { Bad_Opcode },
bf890a93 6148 { "vfnmsub213s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6149 },
6150
592a252b 6151 /* PREFIX_VEX_0F38B6 */
c0f3af97 6152 {
592d1631
L
6153 { Bad_Opcode },
6154 { Bad_Opcode },
bf890a93 6155 { "vfmaddsub231p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6156 },
6157
592a252b 6158 /* PREFIX_VEX_0F38B7 */
c0f3af97 6159 {
592d1631
L
6160 { Bad_Opcode },
6161 { Bad_Opcode },
bf890a93 6162 { "vfmsubadd231p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6163 },
6164
592a252b 6165 /* PREFIX_VEX_0F38B8 */
c0f3af97 6166 {
592d1631
L
6167 { Bad_Opcode },
6168 { Bad_Opcode },
bf890a93 6169 { "vfmadd231p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6170 },
6171
592a252b 6172 /* PREFIX_VEX_0F38B9 */
c0f3af97 6173 {
592d1631
L
6174 { Bad_Opcode },
6175 { Bad_Opcode },
bf890a93 6176 { "vfmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6177 },
6178
592a252b 6179 /* PREFIX_VEX_0F38BA */
c0f3af97 6180 {
592d1631
L
6181 { Bad_Opcode },
6182 { Bad_Opcode },
bf890a93 6183 { "vfmsub231p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6184 },
6185
592a252b 6186 /* PREFIX_VEX_0F38BB */
c0f3af97 6187 {
592d1631
L
6188 { Bad_Opcode },
6189 { Bad_Opcode },
bf890a93 6190 { "vfmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6191 },
6192
592a252b 6193 /* PREFIX_VEX_0F38BC */
c0f3af97 6194 {
592d1631
L
6195 { Bad_Opcode },
6196 { Bad_Opcode },
bf890a93 6197 { "vfnmadd231p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6198 },
6199
592a252b 6200 /* PREFIX_VEX_0F38BD */
c0f3af97 6201 {
592d1631
L
6202 { Bad_Opcode },
6203 { Bad_Opcode },
bf890a93 6204 { "vfnmadd231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6205 },
6206
592a252b 6207 /* PREFIX_VEX_0F38BE */
c0f3af97 6208 {
592d1631
L
6209 { Bad_Opcode },
6210 { Bad_Opcode },
bf890a93 6211 { "vfnmsub231p%XW", { XM, Vex, EXx }, 0 },
c0f3af97
L
6212 },
6213
592a252b 6214 /* PREFIX_VEX_0F38BF */
c0f3af97 6215 {
592d1631
L
6216 { Bad_Opcode },
6217 { Bad_Opcode },
bf890a93 6218 { "vfnmsub231s%XW", { XMScalar, VexScalar, EXVexWdqScalar }, 0 },
c0f3af97
L
6219 },
6220
48521003
IT
6221 /* PREFIX_VEX_0F38CF */
6222 {
6223 { Bad_Opcode },
6224 { Bad_Opcode },
6225 { VEX_W_TABLE (VEX_W_0F38CF_P_2) },
6226 },
6227
592a252b 6228 /* PREFIX_VEX_0F38DB */
c0f3af97 6229 {
592d1631
L
6230 { Bad_Opcode },
6231 { Bad_Opcode },
592a252b 6232 { VEX_LEN_TABLE (VEX_LEN_0F38DB_P_2) },
c0f3af97
L
6233 },
6234
592a252b 6235 /* PREFIX_VEX_0F38DC */
c0f3af97 6236 {
592d1631
L
6237 { Bad_Opcode },
6238 { Bad_Opcode },
8dcf1fad 6239 { "vaesenc", { XM, Vex, EXx }, 0 },
c0f3af97
L
6240 },
6241
592a252b 6242 /* PREFIX_VEX_0F38DD */
c0f3af97 6243 {
592d1631
L
6244 { Bad_Opcode },
6245 { Bad_Opcode },
8dcf1fad 6246 { "vaesenclast", { XM, Vex, EXx }, 0 },
c0f3af97
L
6247 },
6248
592a252b 6249 /* PREFIX_VEX_0F38DE */
c0f3af97 6250 {
592d1631
L
6251 { Bad_Opcode },
6252 { Bad_Opcode },
8dcf1fad 6253 { "vaesdec", { XM, Vex, EXx }, 0 },
c0f3af97
L
6254 },
6255
592a252b 6256 /* PREFIX_VEX_0F38DF */
c0f3af97 6257 {
592d1631
L
6258 { Bad_Opcode },
6259 { Bad_Opcode },
8dcf1fad 6260 { "vaesdeclast", { XM, Vex, EXx }, 0 },
c0f3af97
L
6261 },
6262
f12dc422
L
6263 /* PREFIX_VEX_0F38F2 */
6264 {
6265 { VEX_LEN_TABLE (VEX_LEN_0F38F2_P_0) },
6266 },
6267
6268 /* PREFIX_VEX_0F38F3_REG_1 */
6269 {
6270 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_1_P_0) },
6271 },
6272
6273 /* PREFIX_VEX_0F38F3_REG_2 */
6274 {
6275 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_2_P_0) },
6276 },
6277
6278 /* PREFIX_VEX_0F38F3_REG_3 */
6279 {
6280 { VEX_LEN_TABLE (VEX_LEN_0F38F3_R_3_P_0) },
6281 },
6282
6c30d220
L
6283 /* PREFIX_VEX_0F38F5 */
6284 {
6285 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_0) },
6286 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_1) },
6287 { Bad_Opcode },
6288 { VEX_LEN_TABLE (VEX_LEN_0F38F5_P_3) },
6289 },
6290
6291 /* PREFIX_VEX_0F38F6 */
6292 {
6293 { Bad_Opcode },
6294 { Bad_Opcode },
6295 { Bad_Opcode },
6296 { VEX_LEN_TABLE (VEX_LEN_0F38F6_P_3) },
6297 },
6298
f12dc422
L
6299 /* PREFIX_VEX_0F38F7 */
6300 {
6301 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_0) },
6c30d220
L
6302 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_1) },
6303 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_2) },
6304 { VEX_LEN_TABLE (VEX_LEN_0F38F7_P_3) },
6305 },
6306
6307 /* PREFIX_VEX_0F3A00 */
6308 {
6309 { Bad_Opcode },
6310 { Bad_Opcode },
6311 { VEX_LEN_TABLE (VEX_LEN_0F3A00_P_2) },
6312 },
6313
6314 /* PREFIX_VEX_0F3A01 */
6315 {
6316 { Bad_Opcode },
6317 { Bad_Opcode },
6318 { VEX_LEN_TABLE (VEX_LEN_0F3A01_P_2) },
6319 },
6320
6321 /* PREFIX_VEX_0F3A02 */
6322 {
6323 { Bad_Opcode },
6324 { Bad_Opcode },
6325 { VEX_W_TABLE (VEX_W_0F3A02_P_2) },
f12dc422
L
6326 },
6327
592a252b 6328 /* PREFIX_VEX_0F3A04 */
c0f3af97 6329 {
592d1631
L
6330 { Bad_Opcode },
6331 { Bad_Opcode },
592a252b 6332 { VEX_W_TABLE (VEX_W_0F3A04_P_2) },
c0f3af97
L
6333 },
6334
592a252b 6335 /* PREFIX_VEX_0F3A05 */
c0f3af97 6336 {
592d1631
L
6337 { Bad_Opcode },
6338 { Bad_Opcode },
592a252b 6339 { VEX_W_TABLE (VEX_W_0F3A05_P_2) },
c0f3af97
L
6340 },
6341
592a252b 6342 /* PREFIX_VEX_0F3A06 */
c0f3af97 6343 {
592d1631
L
6344 { Bad_Opcode },
6345 { Bad_Opcode },
592a252b 6346 { VEX_LEN_TABLE (VEX_LEN_0F3A06_P_2) },
c0f3af97
L
6347 },
6348
592a252b 6349 /* PREFIX_VEX_0F3A08 */
c0f3af97 6350 {
592d1631
L
6351 { Bad_Opcode },
6352 { Bad_Opcode },
ec6f095a 6353 { "vroundps", { XM, EXx, Ib }, 0 },
c0f3af97
L
6354 },
6355
592a252b 6356 /* PREFIX_VEX_0F3A09 */
c0f3af97 6357 {
592d1631
L
6358 { Bad_Opcode },
6359 { Bad_Opcode },
ec6f095a 6360 { "vroundpd", { XM, EXx, Ib }, 0 },
c0f3af97
L
6361 },
6362
592a252b 6363 /* PREFIX_VEX_0F3A0A */
c0f3af97 6364 {
592d1631
L
6365 { Bad_Opcode },
6366 { Bad_Opcode },
ec6f095a 6367 { "vroundss", { XMScalar, VexScalar, EXdScalar, Ib }, 0 },
0bfee649
L
6368 },
6369
592a252b 6370 /* PREFIX_VEX_0F3A0B */
0bfee649 6371 {
592d1631
L
6372 { Bad_Opcode },
6373 { Bad_Opcode },
ec6f095a 6374 { "vroundsd", { XMScalar, VexScalar, EXqScalar, Ib }, 0 },
0bfee649
L
6375 },
6376
592a252b 6377 /* PREFIX_VEX_0F3A0C */
0bfee649 6378 {
592d1631
L
6379 { Bad_Opcode },
6380 { Bad_Opcode },
ec6f095a 6381 { "vblendps", { XM, Vex, EXx, Ib }, 0 },
0bfee649
L
6382 },
6383
592a252b 6384 /* PREFIX_VEX_0F3A0D */
0bfee649 6385 {
592d1631
L
6386 { Bad_Opcode },
6387 { Bad_Opcode },
ec6f095a 6388 { "vblendpd", { XM, Vex, EXx, Ib }, 0 },
c0f3af97
L
6389 },
6390
592a252b 6391 /* PREFIX_VEX_0F3A0E */
0bfee649 6392 {
592d1631
L
6393 { Bad_Opcode },
6394 { Bad_Opcode },
ec6f095a 6395 { "vpblendw", { XM, Vex, EXx, Ib }, 0 },
0bfee649
L
6396 },
6397
592a252b 6398 /* PREFIX_VEX_0F3A0F */
0bfee649 6399 {
592d1631
L
6400 { Bad_Opcode },
6401 { Bad_Opcode },
ec6f095a 6402 { "vpalignr", { XM, Vex, EXx, Ib }, 0 },
0bfee649
L
6403 },
6404
592a252b 6405 /* PREFIX_VEX_0F3A14 */
0bfee649 6406 {
592d1631
L
6407 { Bad_Opcode },
6408 { Bad_Opcode },
592a252b 6409 { VEX_LEN_TABLE (VEX_LEN_0F3A14_P_2) },
0bfee649
L
6410 },
6411
592a252b 6412 /* PREFIX_VEX_0F3A15 */
0bfee649 6413 {
592d1631
L
6414 { Bad_Opcode },
6415 { Bad_Opcode },
592a252b 6416 { VEX_LEN_TABLE (VEX_LEN_0F3A15_P_2) },
0bfee649
L
6417 },
6418
592a252b 6419 /* PREFIX_VEX_0F3A16 */
c0f3af97 6420 {
592d1631
L
6421 { Bad_Opcode },
6422 { Bad_Opcode },
592a252b 6423 { VEX_LEN_TABLE (VEX_LEN_0F3A16_P_2) },
c0f3af97
L
6424 },
6425
592a252b 6426 /* PREFIX_VEX_0F3A17 */
c0f3af97 6427 {
592d1631
L
6428 { Bad_Opcode },
6429 { Bad_Opcode },
592a252b 6430 { VEX_LEN_TABLE (VEX_LEN_0F3A17_P_2) },
c0f3af97
L
6431 },
6432
592a252b 6433 /* PREFIX_VEX_0F3A18 */
c0f3af97 6434 {
592d1631
L
6435 { Bad_Opcode },
6436 { Bad_Opcode },
592a252b 6437 { VEX_LEN_TABLE (VEX_LEN_0F3A18_P_2) },
c0f3af97
L
6438 },
6439
592a252b 6440 /* PREFIX_VEX_0F3A19 */
c0f3af97 6441 {
592d1631
L
6442 { Bad_Opcode },
6443 { Bad_Opcode },
592a252b 6444 { VEX_LEN_TABLE (VEX_LEN_0F3A19_P_2) },
c0f3af97
L
6445 },
6446
592a252b 6447 /* PREFIX_VEX_0F3A1D */
c7b8aa3a
L
6448 {
6449 { Bad_Opcode },
6450 { Bad_Opcode },
bf890a93 6451 { "vcvtps2ph", { EXxmmq, XM, Ib }, 0 },
c7b8aa3a
L
6452 },
6453
592a252b 6454 /* PREFIX_VEX_0F3A20 */
c0f3af97 6455 {
592d1631
L
6456 { Bad_Opcode },
6457 { Bad_Opcode },
592a252b 6458 { VEX_LEN_TABLE (VEX_LEN_0F3A20_P_2) },
c0f3af97
L
6459 },
6460
592a252b 6461 /* PREFIX_VEX_0F3A21 */
c0f3af97 6462 {
592d1631
L
6463 { Bad_Opcode },
6464 { Bad_Opcode },
592a252b 6465 { VEX_LEN_TABLE (VEX_LEN_0F3A21_P_2) },
c0f3af97
L
6466 },
6467
592a252b 6468 /* PREFIX_VEX_0F3A22 */
0bfee649 6469 {
592d1631
L
6470 { Bad_Opcode },
6471 { Bad_Opcode },
592a252b 6472 { VEX_LEN_TABLE (VEX_LEN_0F3A22_P_2) },
0bfee649
L
6473 },
6474
43234a1e
L
6475 /* PREFIX_VEX_0F3A30 */
6476 {
6477 { Bad_Opcode },
6478 { Bad_Opcode },
6479 { VEX_LEN_TABLE (VEX_LEN_0F3A30_P_2) },
6480 },
6481
1ba585e8
IT
6482 /* PREFIX_VEX_0F3A31 */
6483 {
6484 { Bad_Opcode },
6485 { Bad_Opcode },
6486 { VEX_LEN_TABLE (VEX_LEN_0F3A31_P_2) },
6487 },
6488
43234a1e
L
6489 /* PREFIX_VEX_0F3A32 */
6490 {
6491 { Bad_Opcode },
6492 { Bad_Opcode },
6493 { VEX_LEN_TABLE (VEX_LEN_0F3A32_P_2) },
6494 },
6495
1ba585e8
IT
6496 /* PREFIX_VEX_0F3A33 */
6497 {
6498 { Bad_Opcode },
6499 { Bad_Opcode },
6500 { VEX_LEN_TABLE (VEX_LEN_0F3A33_P_2) },
6501 },
6502
6c30d220
L
6503 /* PREFIX_VEX_0F3A38 */
6504 {
6505 { Bad_Opcode },
6506 { Bad_Opcode },
6507 { VEX_LEN_TABLE (VEX_LEN_0F3A38_P_2) },
6508 },
6509
6510 /* PREFIX_VEX_0F3A39 */
6511 {
6512 { Bad_Opcode },
6513 { Bad_Opcode },
6514 { VEX_LEN_TABLE (VEX_LEN_0F3A39_P_2) },
6515 },
6516
592a252b 6517 /* PREFIX_VEX_0F3A40 */
c0f3af97 6518 {
592d1631
L
6519 { Bad_Opcode },
6520 { Bad_Opcode },
ec6f095a 6521 { "vdpps", { XM, Vex, EXx, Ib }, 0 },
c0f3af97
L
6522 },
6523
592a252b 6524 /* PREFIX_VEX_0F3A41 */
c0f3af97 6525 {
592d1631
L
6526 { Bad_Opcode },
6527 { Bad_Opcode },
592a252b 6528 { VEX_LEN_TABLE (VEX_LEN_0F3A41_P_2) },
c0f3af97
L
6529 },
6530
592a252b 6531 /* PREFIX_VEX_0F3A42 */
c0f3af97 6532 {
592d1631
L
6533 { Bad_Opcode },
6534 { Bad_Opcode },
ec6f095a 6535 { "vmpsadbw", { XM, Vex, EXx, Ib }, 0 },
c0f3af97
L
6536 },
6537
592a252b 6538 /* PREFIX_VEX_0F3A44 */
ce2f5b3c 6539 {
592d1631
L
6540 { Bad_Opcode },
6541 { Bad_Opcode },
ff1982d5 6542 { "vpclmulqdq", { XM, Vex, EXx, PCLMUL }, 0 },
ce2f5b3c
L
6543 },
6544
6c30d220
L
6545 /* PREFIX_VEX_0F3A46 */
6546 {
6547 { Bad_Opcode },
6548 { Bad_Opcode },
6549 { VEX_LEN_TABLE (VEX_LEN_0F3A46_P_2) },
6550 },
6551
592a252b 6552 /* PREFIX_VEX_0F3A48 */
a683cc34
SP
6553 {
6554 { Bad_Opcode },
6555 { Bad_Opcode },
592a252b 6556 { VEX_W_TABLE (VEX_W_0F3A48_P_2) },
a683cc34
SP
6557 },
6558
592a252b 6559 /* PREFIX_VEX_0F3A49 */
a683cc34
SP
6560 {
6561 { Bad_Opcode },
6562 { Bad_Opcode },
592a252b 6563 { VEX_W_TABLE (VEX_W_0F3A49_P_2) },
a683cc34
SP
6564 },
6565
592a252b 6566 /* PREFIX_VEX_0F3A4A */
c0f3af97 6567 {
592d1631
L
6568 { Bad_Opcode },
6569 { Bad_Opcode },
592a252b 6570 { VEX_W_TABLE (VEX_W_0F3A4A_P_2) },
c0f3af97
L
6571 },
6572
592a252b 6573 /* PREFIX_VEX_0F3A4B */
c0f3af97 6574 {
592d1631
L
6575 { Bad_Opcode },
6576 { Bad_Opcode },
592a252b 6577 { VEX_W_TABLE (VEX_W_0F3A4B_P_2) },
c0f3af97
L
6578 },
6579
592a252b 6580 /* PREFIX_VEX_0F3A4C */
c0f3af97 6581 {
592d1631
L
6582 { Bad_Opcode },
6583 { Bad_Opcode },
6c30d220 6584 { VEX_W_TABLE (VEX_W_0F3A4C_P_2) },
c0f3af97
L
6585 },
6586
592a252b 6587 /* PREFIX_VEX_0F3A5C */
922d8de8 6588 {
592d1631
L
6589 { Bad_Opcode },
6590 { Bad_Opcode },
3a2430e0 6591 { "vfmaddsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6592 },
6593
592a252b 6594 /* PREFIX_VEX_0F3A5D */
922d8de8 6595 {
592d1631
L
6596 { Bad_Opcode },
6597 { Bad_Opcode },
3a2430e0 6598 { "vfmaddsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6599 },
6600
592a252b 6601 /* PREFIX_VEX_0F3A5E */
922d8de8 6602 {
592d1631
L
6603 { Bad_Opcode },
6604 { Bad_Opcode },
3a2430e0 6605 { "vfmsubaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6606 },
6607
592a252b 6608 /* PREFIX_VEX_0F3A5F */
922d8de8 6609 {
592d1631
L
6610 { Bad_Opcode },
6611 { Bad_Opcode },
3a2430e0 6612 { "vfmsubaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6613 },
6614
592a252b 6615 /* PREFIX_VEX_0F3A60 */
c0f3af97 6616 {
592d1631
L
6617 { Bad_Opcode },
6618 { Bad_Opcode },
592a252b 6619 { VEX_LEN_TABLE (VEX_LEN_0F3A60_P_2) },
592d1631 6620 { Bad_Opcode },
c0f3af97
L
6621 },
6622
592a252b 6623 /* PREFIX_VEX_0F3A61 */
c0f3af97 6624 {
592d1631
L
6625 { Bad_Opcode },
6626 { Bad_Opcode },
592a252b 6627 { VEX_LEN_TABLE (VEX_LEN_0F3A61_P_2) },
c0f3af97
L
6628 },
6629
592a252b 6630 /* PREFIX_VEX_0F3A62 */
c0f3af97 6631 {
592d1631
L
6632 { Bad_Opcode },
6633 { Bad_Opcode },
592a252b 6634 { VEX_LEN_TABLE (VEX_LEN_0F3A62_P_2) },
c0f3af97
L
6635 },
6636
592a252b 6637 /* PREFIX_VEX_0F3A63 */
c0f3af97 6638 {
592d1631
L
6639 { Bad_Opcode },
6640 { Bad_Opcode },
592a252b 6641 { VEX_LEN_TABLE (VEX_LEN_0F3A63_P_2) },
c0f3af97 6642 },
a5ff0eb2 6643
592a252b 6644 /* PREFIX_VEX_0F3A68 */
922d8de8 6645 {
592d1631
L
6646 { Bad_Opcode },
6647 { Bad_Opcode },
3a2430e0 6648 { "vfmaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6649 },
6650
592a252b 6651 /* PREFIX_VEX_0F3A69 */
922d8de8 6652 {
592d1631
L
6653 { Bad_Opcode },
6654 { Bad_Opcode },
3a2430e0 6655 { "vfmaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6656 },
6657
592a252b 6658 /* PREFIX_VEX_0F3A6A */
922d8de8 6659 {
592d1631
L
6660 { Bad_Opcode },
6661 { Bad_Opcode },
592a252b 6662 { VEX_LEN_TABLE (VEX_LEN_0F3A6A_P_2) },
922d8de8
DR
6663 },
6664
592a252b 6665 /* PREFIX_VEX_0F3A6B */
922d8de8 6666 {
592d1631
L
6667 { Bad_Opcode },
6668 { Bad_Opcode },
592a252b 6669 { VEX_LEN_TABLE (VEX_LEN_0F3A6B_P_2) },
922d8de8
DR
6670 },
6671
592a252b 6672 /* PREFIX_VEX_0F3A6C */
922d8de8 6673 {
592d1631
L
6674 { Bad_Opcode },
6675 { Bad_Opcode },
3a2430e0 6676 { "vfmsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6677 },
6678
592a252b 6679 /* PREFIX_VEX_0F3A6D */
922d8de8 6680 {
592d1631
L
6681 { Bad_Opcode },
6682 { Bad_Opcode },
3a2430e0 6683 { "vfmsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6684 },
6685
592a252b 6686 /* PREFIX_VEX_0F3A6E */
922d8de8 6687 {
592d1631
L
6688 { Bad_Opcode },
6689 { Bad_Opcode },
592a252b 6690 { VEX_LEN_TABLE (VEX_LEN_0F3A6E_P_2) },
922d8de8
DR
6691 },
6692
592a252b 6693 /* PREFIX_VEX_0F3A6F */
922d8de8 6694 {
592d1631
L
6695 { Bad_Opcode },
6696 { Bad_Opcode },
592a252b 6697 { VEX_LEN_TABLE (VEX_LEN_0F3A6F_P_2) },
922d8de8
DR
6698 },
6699
592a252b 6700 /* PREFIX_VEX_0F3A78 */
922d8de8 6701 {
592d1631
L
6702 { Bad_Opcode },
6703 { Bad_Opcode },
3a2430e0 6704 { "vfnmaddps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6705 },
6706
592a252b 6707 /* PREFIX_VEX_0F3A79 */
922d8de8 6708 {
592d1631
L
6709 { Bad_Opcode },
6710 { Bad_Opcode },
3a2430e0 6711 { "vfnmaddpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6712 },
6713
592a252b 6714 /* PREFIX_VEX_0F3A7A */
922d8de8 6715 {
592d1631
L
6716 { Bad_Opcode },
6717 { Bad_Opcode },
592a252b 6718 { VEX_LEN_TABLE (VEX_LEN_0F3A7A_P_2) },
922d8de8
DR
6719 },
6720
592a252b 6721 /* PREFIX_VEX_0F3A7B */
922d8de8 6722 {
592d1631
L
6723 { Bad_Opcode },
6724 { Bad_Opcode },
592a252b 6725 { VEX_LEN_TABLE (VEX_LEN_0F3A7B_P_2) },
922d8de8
DR
6726 },
6727
592a252b 6728 /* PREFIX_VEX_0F3A7C */
922d8de8 6729 {
592d1631
L
6730 { Bad_Opcode },
6731 { Bad_Opcode },
3a2430e0 6732 { "vfnmsubps", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
592d1631 6733 { Bad_Opcode },
922d8de8
DR
6734 },
6735
592a252b 6736 /* PREFIX_VEX_0F3A7D */
922d8de8 6737 {
592d1631
L
6738 { Bad_Opcode },
6739 { Bad_Opcode },
3a2430e0 6740 { "vfnmsubpd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
922d8de8
DR
6741 },
6742
592a252b 6743 /* PREFIX_VEX_0F3A7E */
922d8de8 6744 {
592d1631
L
6745 { Bad_Opcode },
6746 { Bad_Opcode },
592a252b 6747 { VEX_LEN_TABLE (VEX_LEN_0F3A7E_P_2) },
922d8de8
DR
6748 },
6749
592a252b 6750 /* PREFIX_VEX_0F3A7F */
922d8de8 6751 {
592d1631
L
6752 { Bad_Opcode },
6753 { Bad_Opcode },
592a252b 6754 { VEX_LEN_TABLE (VEX_LEN_0F3A7F_P_2) },
922d8de8
DR
6755 },
6756
48521003
IT
6757 /* PREFIX_VEX_0F3ACE */
6758 {
6759 { Bad_Opcode },
6760 { Bad_Opcode },
6761 { VEX_W_TABLE (VEX_W_0F3ACE_P_2) },
6762 },
6763
6764 /* PREFIX_VEX_0F3ACF */
6765 {
6766 { Bad_Opcode },
6767 { Bad_Opcode },
6768 { VEX_W_TABLE (VEX_W_0F3ACF_P_2) },
6769 },
6770
592a252b 6771 /* PREFIX_VEX_0F3ADF */
a5ff0eb2 6772 {
592d1631
L
6773 { Bad_Opcode },
6774 { Bad_Opcode },
592a252b 6775 { VEX_LEN_TABLE (VEX_LEN_0F3ADF_P_2) },
a5ff0eb2 6776 },
6c30d220
L
6777
6778 /* PREFIX_VEX_0F3AF0 */
6779 {
6780 { Bad_Opcode },
6781 { Bad_Opcode },
6782 { Bad_Opcode },
6783 { VEX_LEN_TABLE (VEX_LEN_0F3AF0_P_3) },
6784 },
43234a1e
L
6785
6786#define NEED_PREFIX_TABLE
6787#include "i386-dis-evex.h"
6788#undef NEED_PREFIX_TABLE
c0f3af97
L
6789};
6790
6791static const struct dis386 x86_64_table[][2] = {
6792 /* X86_64_06 */
6793 {
bf890a93 6794 { "pushP", { es }, 0 },
c0f3af97
L
6795 },
6796
6797 /* X86_64_07 */
6798 {
bf890a93 6799 { "popP", { es }, 0 },
c0f3af97
L
6800 },
6801
6802 /* X86_64_0D */
6803 {
bf890a93 6804 { "pushP", { cs }, 0 },
c0f3af97
L
6805 },
6806
6807 /* X86_64_16 */
6808 {
bf890a93 6809 { "pushP", { ss }, 0 },
c0f3af97
L
6810 },
6811
6812 /* X86_64_17 */
6813 {
bf890a93 6814 { "popP", { ss }, 0 },
c0f3af97
L
6815 },
6816
6817 /* X86_64_1E */
6818 {
bf890a93 6819 { "pushP", { ds }, 0 },
c0f3af97
L
6820 },
6821
6822 /* X86_64_1F */
6823 {
bf890a93 6824 { "popP", { ds }, 0 },
c0f3af97
L
6825 },
6826
6827 /* X86_64_27 */
6828 {
bf890a93 6829 { "daa", { XX }, 0 },
c0f3af97
L
6830 },
6831
6832 /* X86_64_2F */
6833 {
bf890a93 6834 { "das", { XX }, 0 },
c0f3af97
L
6835 },
6836
6837 /* X86_64_37 */
6838 {
bf890a93 6839 { "aaa", { XX }, 0 },
c0f3af97
L
6840 },
6841
6842 /* X86_64_3F */
6843 {
bf890a93 6844 { "aas", { XX }, 0 },
c0f3af97
L
6845 },
6846
6847 /* X86_64_60 */
6848 {
bf890a93 6849 { "pushaP", { XX }, 0 },
c0f3af97
L
6850 },
6851
6852 /* X86_64_61 */
6853 {
bf890a93 6854 { "popaP", { XX }, 0 },
c0f3af97
L
6855 },
6856
6857 /* X86_64_62 */
6858 {
6859 { MOD_TABLE (MOD_62_32BIT) },
43234a1e 6860 { EVEX_TABLE (EVEX_0F) },
c0f3af97
L
6861 },
6862
6863 /* X86_64_63 */
6864 {
bf890a93
IT
6865 { "arpl", { Ew, Gw }, 0 },
6866 { "movs{lq|xd}", { Gv, Ed }, 0 },
c0f3af97
L
6867 },
6868
6869 /* X86_64_6D */
6870 {
bf890a93
IT
6871 { "ins{R|}", { Yzr, indirDX }, 0 },
6872 { "ins{G|}", { Yzr, indirDX }, 0 },
c0f3af97
L
6873 },
6874
6875 /* X86_64_6F */
6876 {
bf890a93
IT
6877 { "outs{R|}", { indirDXr, Xz }, 0 },
6878 { "outs{G|}", { indirDXr, Xz }, 0 },
c0f3af97
L
6879 },
6880
d039fef3 6881 /* X86_64_82 */
8b89fe14 6882 {
de194d85 6883 /* Opcode 0x82 is an alias of opcode 0x80 in 32-bit mode. */
d039fef3 6884 { REG_TABLE (REG_80) },
8b89fe14
L
6885 },
6886
c0f3af97
L
6887 /* X86_64_9A */
6888 {
bf890a93 6889 { "Jcall{T|}", { Ap }, 0 },
c0f3af97
L
6890 },
6891
6892 /* X86_64_C4 */
6893 {
6894 { MOD_TABLE (MOD_C4_32BIT) },
6895 { VEX_C4_TABLE (VEX_0F) },
6896 },
6897
6898 /* X86_64_C5 */
6899 {
6900 { MOD_TABLE (MOD_C5_32BIT) },
6901 { VEX_C5_TABLE (VEX_0F) },
6902 },
6903
6904 /* X86_64_CE */
6905 {
bf890a93 6906 { "into", { XX }, 0 },
c0f3af97
L
6907 },
6908
6909 /* X86_64_D4 */
6910 {
bf890a93 6911 { "aam", { Ib }, 0 },
c0f3af97
L
6912 },
6913
6914 /* X86_64_D5 */
6915 {
bf890a93 6916 { "aad", { Ib }, 0 },
c0f3af97
L
6917 },
6918
a72d2af2
L
6919 /* X86_64_E8 */
6920 {
6921 { "callP", { Jv, BND }, 0 },
5db04b09 6922 { "call@", { Jv, BND }, 0 }
a72d2af2
L
6923 },
6924
6925 /* X86_64_E9 */
6926 {
6927 { "jmpP", { Jv, BND }, 0 },
5db04b09 6928 { "jmp@", { Jv, BND }, 0 }
a72d2af2
L
6929 },
6930
c0f3af97
L
6931 /* X86_64_EA */
6932 {
bf890a93 6933 { "Jjmp{T|}", { Ap }, 0 },
c0f3af97
L
6934 },
6935
6936 /* X86_64_0F01_REG_0 */
6937 {
bf890a93
IT
6938 { "sgdt{Q|IQ}", { M }, 0 },
6939 { "sgdt", { M }, 0 },
c0f3af97
L
6940 },
6941
6942 /* X86_64_0F01_REG_1 */
6943 {
bf890a93
IT
6944 { "sidt{Q|IQ}", { M }, 0 },
6945 { "sidt", { M }, 0 },
c0f3af97
L
6946 },
6947
6948 /* X86_64_0F01_REG_2 */
6949 {
bf890a93
IT
6950 { "lgdt{Q|Q}", { M }, 0 },
6951 { "lgdt", { M }, 0 },
c0f3af97
L
6952 },
6953
6954 /* X86_64_0F01_REG_3 */
6955 {
bf890a93
IT
6956 { "lidt{Q|Q}", { M }, 0 },
6957 { "lidt", { M }, 0 },
c0f3af97
L
6958 },
6959};
6960
6961static const struct dis386 three_byte_table[][256] = {
c1e679ec
DR
6962
6963 /* THREE_BYTE_0F38 */
c0f3af97
L
6964 {
6965 /* 00 */
507bd325
L
6966 { "pshufb", { MX, EM }, PREFIX_OPCODE },
6967 { "phaddw", { MX, EM }, PREFIX_OPCODE },
6968 { "phaddd", { MX, EM }, PREFIX_OPCODE },
6969 { "phaddsw", { MX, EM }, PREFIX_OPCODE },
6970 { "pmaddubsw", { MX, EM }, PREFIX_OPCODE },
6971 { "phsubw", { MX, EM }, PREFIX_OPCODE },
6972 { "phsubd", { MX, EM }, PREFIX_OPCODE },
6973 { "phsubsw", { MX, EM }, PREFIX_OPCODE },
c0f3af97 6974 /* 08 */
507bd325
L
6975 { "psignb", { MX, EM }, PREFIX_OPCODE },
6976 { "psignw", { MX, EM }, PREFIX_OPCODE },
6977 { "psignd", { MX, EM }, PREFIX_OPCODE },
6978 { "pmulhrsw", { MX, EM }, PREFIX_OPCODE },
592d1631
L
6979 { Bad_Opcode },
6980 { Bad_Opcode },
6981 { Bad_Opcode },
6982 { Bad_Opcode },
f88c9eb0
SP
6983 /* 10 */
6984 { PREFIX_TABLE (PREFIX_0F3810) },
592d1631
L
6985 { Bad_Opcode },
6986 { Bad_Opcode },
6987 { Bad_Opcode },
f88c9eb0
SP
6988 { PREFIX_TABLE (PREFIX_0F3814) },
6989 { PREFIX_TABLE (PREFIX_0F3815) },
592d1631 6990 { Bad_Opcode },
f88c9eb0
SP
6991 { PREFIX_TABLE (PREFIX_0F3817) },
6992 /* 18 */
592d1631
L
6993 { Bad_Opcode },
6994 { Bad_Opcode },
6995 { Bad_Opcode },
6996 { Bad_Opcode },
507bd325
L
6997 { "pabsb", { MX, EM }, PREFIX_OPCODE },
6998 { "pabsw", { MX, EM }, PREFIX_OPCODE },
6999 { "pabsd", { MX, EM }, PREFIX_OPCODE },
592d1631 7000 { Bad_Opcode },
f88c9eb0
SP
7001 /* 20 */
7002 { PREFIX_TABLE (PREFIX_0F3820) },
7003 { PREFIX_TABLE (PREFIX_0F3821) },
7004 { PREFIX_TABLE (PREFIX_0F3822) },
7005 { PREFIX_TABLE (PREFIX_0F3823) },
7006 { PREFIX_TABLE (PREFIX_0F3824) },
7007 { PREFIX_TABLE (PREFIX_0F3825) },
592d1631
L
7008 { Bad_Opcode },
7009 { Bad_Opcode },
f88c9eb0
SP
7010 /* 28 */
7011 { PREFIX_TABLE (PREFIX_0F3828) },
7012 { PREFIX_TABLE (PREFIX_0F3829) },
7013 { PREFIX_TABLE (PREFIX_0F382A) },
7014 { PREFIX_TABLE (PREFIX_0F382B) },
592d1631
L
7015 { Bad_Opcode },
7016 { Bad_Opcode },
7017 { Bad_Opcode },
7018 { Bad_Opcode },
f88c9eb0
SP
7019 /* 30 */
7020 { PREFIX_TABLE (PREFIX_0F3830) },
7021 { PREFIX_TABLE (PREFIX_0F3831) },
7022 { PREFIX_TABLE (PREFIX_0F3832) },
7023 { PREFIX_TABLE (PREFIX_0F3833) },
7024 { PREFIX_TABLE (PREFIX_0F3834) },
7025 { PREFIX_TABLE (PREFIX_0F3835) },
592d1631 7026 { Bad_Opcode },
f88c9eb0
SP
7027 { PREFIX_TABLE (PREFIX_0F3837) },
7028 /* 38 */
7029 { PREFIX_TABLE (PREFIX_0F3838) },
7030 { PREFIX_TABLE (PREFIX_0F3839) },
7031 { PREFIX_TABLE (PREFIX_0F383A) },
7032 { PREFIX_TABLE (PREFIX_0F383B) },
7033 { PREFIX_TABLE (PREFIX_0F383C) },
7034 { PREFIX_TABLE (PREFIX_0F383D) },
7035 { PREFIX_TABLE (PREFIX_0F383E) },
7036 { PREFIX_TABLE (PREFIX_0F383F) },
7037 /* 40 */
7038 { PREFIX_TABLE (PREFIX_0F3840) },
7039 { PREFIX_TABLE (PREFIX_0F3841) },
592d1631
L
7040 { Bad_Opcode },
7041 { Bad_Opcode },
7042 { Bad_Opcode },
7043 { Bad_Opcode },
7044 { Bad_Opcode },
7045 { Bad_Opcode },
f88c9eb0 7046 /* 48 */
592d1631
L
7047 { Bad_Opcode },
7048 { Bad_Opcode },
7049 { Bad_Opcode },
7050 { Bad_Opcode },
7051 { Bad_Opcode },
7052 { Bad_Opcode },
7053 { Bad_Opcode },
7054 { Bad_Opcode },
f88c9eb0 7055 /* 50 */
592d1631
L
7056 { Bad_Opcode },
7057 { Bad_Opcode },
7058 { Bad_Opcode },
7059 { Bad_Opcode },
7060 { Bad_Opcode },
7061 { Bad_Opcode },
7062 { Bad_Opcode },
7063 { Bad_Opcode },
f88c9eb0 7064 /* 58 */
592d1631
L
7065 { Bad_Opcode },
7066 { Bad_Opcode },
7067 { Bad_Opcode },
7068 { Bad_Opcode },
7069 { Bad_Opcode },
7070 { Bad_Opcode },
7071 { Bad_Opcode },
7072 { Bad_Opcode },
f88c9eb0 7073 /* 60 */
592d1631
L
7074 { Bad_Opcode },
7075 { Bad_Opcode },
7076 { Bad_Opcode },
7077 { Bad_Opcode },
7078 { Bad_Opcode },
7079 { Bad_Opcode },
7080 { Bad_Opcode },
7081 { Bad_Opcode },
f88c9eb0 7082 /* 68 */
592d1631
L
7083 { Bad_Opcode },
7084 { Bad_Opcode },
7085 { Bad_Opcode },
7086 { Bad_Opcode },
7087 { Bad_Opcode },
7088 { Bad_Opcode },
7089 { Bad_Opcode },
7090 { Bad_Opcode },
f88c9eb0 7091 /* 70 */
592d1631
L
7092 { Bad_Opcode },
7093 { Bad_Opcode },
7094 { Bad_Opcode },
7095 { Bad_Opcode },
7096 { Bad_Opcode },
7097 { Bad_Opcode },
7098 { Bad_Opcode },
7099 { Bad_Opcode },
f88c9eb0 7100 /* 78 */
592d1631
L
7101 { Bad_Opcode },
7102 { Bad_Opcode },
7103 { Bad_Opcode },
7104 { Bad_Opcode },
7105 { Bad_Opcode },
7106 { Bad_Opcode },
7107 { Bad_Opcode },
7108 { Bad_Opcode },
f88c9eb0
SP
7109 /* 80 */
7110 { PREFIX_TABLE (PREFIX_0F3880) },
7111 { PREFIX_TABLE (PREFIX_0F3881) },
6c30d220 7112 { PREFIX_TABLE (PREFIX_0F3882) },
592d1631
L
7113 { Bad_Opcode },
7114 { Bad_Opcode },
7115 { Bad_Opcode },
7116 { Bad_Opcode },
7117 { Bad_Opcode },
f88c9eb0 7118 /* 88 */
592d1631
L
7119 { Bad_Opcode },
7120 { Bad_Opcode },
7121 { Bad_Opcode },
7122 { Bad_Opcode },
7123 { Bad_Opcode },
7124 { Bad_Opcode },
7125 { Bad_Opcode },
7126 { Bad_Opcode },
f88c9eb0 7127 /* 90 */
592d1631
L
7128 { Bad_Opcode },
7129 { Bad_Opcode },
7130 { Bad_Opcode },
7131 { Bad_Opcode },
7132 { Bad_Opcode },
7133 { Bad_Opcode },
7134 { Bad_Opcode },
7135 { Bad_Opcode },
f88c9eb0 7136 /* 98 */
592d1631
L
7137 { Bad_Opcode },
7138 { Bad_Opcode },
7139 { Bad_Opcode },
7140 { Bad_Opcode },
7141 { Bad_Opcode },
7142 { Bad_Opcode },
7143 { Bad_Opcode },
7144 { Bad_Opcode },
f88c9eb0 7145 /* a0 */
592d1631
L
7146 { Bad_Opcode },
7147 { Bad_Opcode },
7148 { Bad_Opcode },
7149 { Bad_Opcode },
7150 { Bad_Opcode },
7151 { Bad_Opcode },
7152 { Bad_Opcode },
7153 { Bad_Opcode },
f88c9eb0 7154 /* a8 */
592d1631
L
7155 { Bad_Opcode },
7156 { Bad_Opcode },
7157 { Bad_Opcode },
7158 { Bad_Opcode },
7159 { Bad_Opcode },
7160 { Bad_Opcode },
7161 { Bad_Opcode },
7162 { Bad_Opcode },
f88c9eb0 7163 /* b0 */
592d1631
L
7164 { Bad_Opcode },
7165 { Bad_Opcode },
7166 { Bad_Opcode },
7167 { Bad_Opcode },
7168 { Bad_Opcode },
7169 { Bad_Opcode },
7170 { Bad_Opcode },
7171 { Bad_Opcode },
f88c9eb0 7172 /* b8 */
592d1631
L
7173 { Bad_Opcode },
7174 { Bad_Opcode },
7175 { Bad_Opcode },
7176 { Bad_Opcode },
7177 { Bad_Opcode },
7178 { Bad_Opcode },
7179 { Bad_Opcode },
7180 { Bad_Opcode },
f88c9eb0 7181 /* c0 */
592d1631
L
7182 { Bad_Opcode },
7183 { Bad_Opcode },
7184 { Bad_Opcode },
7185 { Bad_Opcode },
7186 { Bad_Opcode },
7187 { Bad_Opcode },
7188 { Bad_Opcode },
7189 { Bad_Opcode },
f88c9eb0 7190 /* c8 */
a0046408
L
7191 { PREFIX_TABLE (PREFIX_0F38C8) },
7192 { PREFIX_TABLE (PREFIX_0F38C9) },
7193 { PREFIX_TABLE (PREFIX_0F38CA) },
7194 { PREFIX_TABLE (PREFIX_0F38CB) },
7195 { PREFIX_TABLE (PREFIX_0F38CC) },
7196 { PREFIX_TABLE (PREFIX_0F38CD) },
592d1631 7197 { Bad_Opcode },
48521003 7198 { PREFIX_TABLE (PREFIX_0F38CF) },
f88c9eb0 7199 /* d0 */
592d1631
L
7200 { Bad_Opcode },
7201 { Bad_Opcode },
7202 { Bad_Opcode },
7203 { Bad_Opcode },
7204 { Bad_Opcode },
7205 { Bad_Opcode },
7206 { Bad_Opcode },
7207 { Bad_Opcode },
f88c9eb0 7208 /* d8 */
592d1631
L
7209 { Bad_Opcode },
7210 { Bad_Opcode },
7211 { Bad_Opcode },
f88c9eb0
SP
7212 { PREFIX_TABLE (PREFIX_0F38DB) },
7213 { PREFIX_TABLE (PREFIX_0F38DC) },
7214 { PREFIX_TABLE (PREFIX_0F38DD) },
7215 { PREFIX_TABLE (PREFIX_0F38DE) },
7216 { PREFIX_TABLE (PREFIX_0F38DF) },
7217 /* e0 */
592d1631
L
7218 { Bad_Opcode },
7219 { Bad_Opcode },
7220 { Bad_Opcode },
7221 { Bad_Opcode },
7222 { Bad_Opcode },
7223 { Bad_Opcode },
7224 { Bad_Opcode },
7225 { Bad_Opcode },
f88c9eb0 7226 /* e8 */
592d1631
L
7227 { Bad_Opcode },
7228 { Bad_Opcode },
7229 { Bad_Opcode },
7230 { Bad_Opcode },
7231 { Bad_Opcode },
7232 { Bad_Opcode },
7233 { Bad_Opcode },
7234 { Bad_Opcode },
f88c9eb0
SP
7235 /* f0 */
7236 { PREFIX_TABLE (PREFIX_0F38F0) },
7237 { PREFIX_TABLE (PREFIX_0F38F1) },
592d1631
L
7238 { Bad_Opcode },
7239 { Bad_Opcode },
7240 { Bad_Opcode },
603555e5 7241 { PREFIX_TABLE (PREFIX_0F38F5) },
e2e1fcde 7242 { PREFIX_TABLE (PREFIX_0F38F6) },
592d1631 7243 { Bad_Opcode },
f88c9eb0 7244 /* f8 */
c0a30a9f
L
7245 { PREFIX_TABLE (PREFIX_0F38F8) },
7246 { PREFIX_TABLE (PREFIX_0F38F9) },
592d1631
L
7247 { Bad_Opcode },
7248 { Bad_Opcode },
7249 { Bad_Opcode },
7250 { Bad_Opcode },
7251 { Bad_Opcode },
7252 { Bad_Opcode },
f88c9eb0
SP
7253 },
7254 /* THREE_BYTE_0F3A */
7255 {
7256 /* 00 */
592d1631
L
7257 { Bad_Opcode },
7258 { Bad_Opcode },
7259 { Bad_Opcode },
7260 { Bad_Opcode },
7261 { Bad_Opcode },
7262 { Bad_Opcode },
7263 { Bad_Opcode },
7264 { Bad_Opcode },
f88c9eb0
SP
7265 /* 08 */
7266 { PREFIX_TABLE (PREFIX_0F3A08) },
7267 { PREFIX_TABLE (PREFIX_0F3A09) },
7268 { PREFIX_TABLE (PREFIX_0F3A0A) },
7269 { PREFIX_TABLE (PREFIX_0F3A0B) },
7270 { PREFIX_TABLE (PREFIX_0F3A0C) },
7271 { PREFIX_TABLE (PREFIX_0F3A0D) },
7272 { PREFIX_TABLE (PREFIX_0F3A0E) },
507bd325 7273 { "palignr", { MX, EM, Ib }, PREFIX_OPCODE },
f88c9eb0 7274 /* 10 */
592d1631
L
7275 { Bad_Opcode },
7276 { Bad_Opcode },
7277 { Bad_Opcode },
7278 { Bad_Opcode },
f88c9eb0
SP
7279 { PREFIX_TABLE (PREFIX_0F3A14) },
7280 { PREFIX_TABLE (PREFIX_0F3A15) },
7281 { PREFIX_TABLE (PREFIX_0F3A16) },
7282 { PREFIX_TABLE (PREFIX_0F3A17) },
7283 /* 18 */
592d1631
L
7284 { Bad_Opcode },
7285 { Bad_Opcode },
7286 { Bad_Opcode },
7287 { Bad_Opcode },
7288 { Bad_Opcode },
7289 { Bad_Opcode },
7290 { Bad_Opcode },
7291 { Bad_Opcode },
f88c9eb0
SP
7292 /* 20 */
7293 { PREFIX_TABLE (PREFIX_0F3A20) },
7294 { PREFIX_TABLE (PREFIX_0F3A21) },
7295 { PREFIX_TABLE (PREFIX_0F3A22) },
592d1631
L
7296 { Bad_Opcode },
7297 { Bad_Opcode },
7298 { Bad_Opcode },
7299 { Bad_Opcode },
7300 { Bad_Opcode },
f88c9eb0 7301 /* 28 */
592d1631
L
7302 { Bad_Opcode },
7303 { Bad_Opcode },
7304 { Bad_Opcode },
7305 { Bad_Opcode },
7306 { Bad_Opcode },
7307 { Bad_Opcode },
7308 { Bad_Opcode },
7309 { Bad_Opcode },
f88c9eb0 7310 /* 30 */
592d1631
L
7311 { Bad_Opcode },
7312 { Bad_Opcode },
7313 { Bad_Opcode },
7314 { Bad_Opcode },
7315 { Bad_Opcode },
7316 { Bad_Opcode },
7317 { Bad_Opcode },
7318 { Bad_Opcode },
f88c9eb0 7319 /* 38 */
592d1631
L
7320 { Bad_Opcode },
7321 { Bad_Opcode },
7322 { Bad_Opcode },
7323 { Bad_Opcode },
7324 { Bad_Opcode },
7325 { Bad_Opcode },
7326 { Bad_Opcode },
7327 { Bad_Opcode },
f88c9eb0
SP
7328 /* 40 */
7329 { PREFIX_TABLE (PREFIX_0F3A40) },
7330 { PREFIX_TABLE (PREFIX_0F3A41) },
7331 { PREFIX_TABLE (PREFIX_0F3A42) },
592d1631 7332 { Bad_Opcode },
f88c9eb0 7333 { PREFIX_TABLE (PREFIX_0F3A44) },
592d1631
L
7334 { Bad_Opcode },
7335 { Bad_Opcode },
7336 { Bad_Opcode },
f88c9eb0 7337 /* 48 */
592d1631
L
7338 { Bad_Opcode },
7339 { Bad_Opcode },
7340 { Bad_Opcode },
7341 { Bad_Opcode },
7342 { Bad_Opcode },
7343 { Bad_Opcode },
7344 { Bad_Opcode },
7345 { Bad_Opcode },
f88c9eb0 7346 /* 50 */
592d1631
L
7347 { Bad_Opcode },
7348 { Bad_Opcode },
7349 { Bad_Opcode },
7350 { Bad_Opcode },
7351 { Bad_Opcode },
7352 { Bad_Opcode },
7353 { Bad_Opcode },
7354 { Bad_Opcode },
f88c9eb0 7355 /* 58 */
592d1631
L
7356 { Bad_Opcode },
7357 { Bad_Opcode },
7358 { Bad_Opcode },
7359 { Bad_Opcode },
7360 { Bad_Opcode },
7361 { Bad_Opcode },
7362 { Bad_Opcode },
7363 { Bad_Opcode },
f88c9eb0
SP
7364 /* 60 */
7365 { PREFIX_TABLE (PREFIX_0F3A60) },
7366 { PREFIX_TABLE (PREFIX_0F3A61) },
7367 { PREFIX_TABLE (PREFIX_0F3A62) },
7368 { PREFIX_TABLE (PREFIX_0F3A63) },
592d1631
L
7369 { Bad_Opcode },
7370 { Bad_Opcode },
7371 { Bad_Opcode },
7372 { Bad_Opcode },
f88c9eb0 7373 /* 68 */
592d1631
L
7374 { Bad_Opcode },
7375 { Bad_Opcode },
7376 { Bad_Opcode },
7377 { Bad_Opcode },
7378 { Bad_Opcode },
7379 { Bad_Opcode },
7380 { Bad_Opcode },
7381 { Bad_Opcode },
f88c9eb0 7382 /* 70 */
592d1631
L
7383 { Bad_Opcode },
7384 { Bad_Opcode },
7385 { Bad_Opcode },
7386 { Bad_Opcode },
7387 { Bad_Opcode },
7388 { Bad_Opcode },
7389 { Bad_Opcode },
7390 { Bad_Opcode },
f88c9eb0 7391 /* 78 */
592d1631
L
7392 { Bad_Opcode },
7393 { Bad_Opcode },
7394 { Bad_Opcode },
7395 { Bad_Opcode },
7396 { Bad_Opcode },
7397 { Bad_Opcode },
7398 { Bad_Opcode },
7399 { Bad_Opcode },
f88c9eb0 7400 /* 80 */
592d1631
L
7401 { Bad_Opcode },
7402 { Bad_Opcode },
7403 { Bad_Opcode },
7404 { Bad_Opcode },
7405 { Bad_Opcode },
7406 { Bad_Opcode },
7407 { Bad_Opcode },
7408 { Bad_Opcode },
f88c9eb0 7409 /* 88 */
592d1631
L
7410 { Bad_Opcode },
7411 { Bad_Opcode },
7412 { Bad_Opcode },
7413 { Bad_Opcode },
7414 { Bad_Opcode },
7415 { Bad_Opcode },
7416 { Bad_Opcode },
7417 { Bad_Opcode },
f88c9eb0 7418 /* 90 */
592d1631
L
7419 { Bad_Opcode },
7420 { Bad_Opcode },
7421 { Bad_Opcode },
7422 { Bad_Opcode },
7423 { Bad_Opcode },
7424 { Bad_Opcode },
7425 { Bad_Opcode },
7426 { Bad_Opcode },
f88c9eb0 7427 /* 98 */
592d1631
L
7428 { Bad_Opcode },
7429 { Bad_Opcode },
7430 { Bad_Opcode },
7431 { Bad_Opcode },
7432 { Bad_Opcode },
7433 { Bad_Opcode },
7434 { Bad_Opcode },
7435 { Bad_Opcode },
f88c9eb0 7436 /* a0 */
592d1631
L
7437 { Bad_Opcode },
7438 { Bad_Opcode },
7439 { Bad_Opcode },
7440 { Bad_Opcode },
7441 { Bad_Opcode },
7442 { Bad_Opcode },
7443 { Bad_Opcode },
7444 { Bad_Opcode },
f88c9eb0 7445 /* a8 */
592d1631
L
7446 { Bad_Opcode },
7447 { Bad_Opcode },
7448 { Bad_Opcode },
7449 { Bad_Opcode },
7450 { Bad_Opcode },
7451 { Bad_Opcode },
7452 { Bad_Opcode },
7453 { Bad_Opcode },
f88c9eb0 7454 /* b0 */
592d1631
L
7455 { Bad_Opcode },
7456 { Bad_Opcode },
7457 { Bad_Opcode },
7458 { Bad_Opcode },
7459 { Bad_Opcode },
7460 { Bad_Opcode },
7461 { Bad_Opcode },
7462 { Bad_Opcode },
f88c9eb0 7463 /* b8 */
592d1631
L
7464 { Bad_Opcode },
7465 { Bad_Opcode },
7466 { Bad_Opcode },
7467 { Bad_Opcode },
7468 { Bad_Opcode },
7469 { Bad_Opcode },
7470 { Bad_Opcode },
7471 { Bad_Opcode },
f88c9eb0 7472 /* c0 */
592d1631
L
7473 { Bad_Opcode },
7474 { Bad_Opcode },
7475 { Bad_Opcode },
7476 { Bad_Opcode },
7477 { Bad_Opcode },
7478 { Bad_Opcode },
7479 { Bad_Opcode },
7480 { Bad_Opcode },
f88c9eb0 7481 /* c8 */
592d1631
L
7482 { Bad_Opcode },
7483 { Bad_Opcode },
7484 { Bad_Opcode },
7485 { Bad_Opcode },
a0046408 7486 { PREFIX_TABLE (PREFIX_0F3ACC) },
592d1631 7487 { Bad_Opcode },
48521003
IT
7488 { PREFIX_TABLE (PREFIX_0F3ACE) },
7489 { PREFIX_TABLE (PREFIX_0F3ACF) },
f88c9eb0 7490 /* d0 */
592d1631
L
7491 { Bad_Opcode },
7492 { Bad_Opcode },
7493 { Bad_Opcode },
7494 { Bad_Opcode },
7495 { Bad_Opcode },
7496 { Bad_Opcode },
7497 { Bad_Opcode },
7498 { Bad_Opcode },
f88c9eb0 7499 /* d8 */
592d1631
L
7500 { Bad_Opcode },
7501 { Bad_Opcode },
7502 { Bad_Opcode },
7503 { Bad_Opcode },
7504 { Bad_Opcode },
7505 { Bad_Opcode },
7506 { Bad_Opcode },
f88c9eb0
SP
7507 { PREFIX_TABLE (PREFIX_0F3ADF) },
7508 /* e0 */
592d1631
L
7509 { Bad_Opcode },
7510 { Bad_Opcode },
7511 { Bad_Opcode },
7512 { Bad_Opcode },
7513 { Bad_Opcode },
592d1631
L
7514 { Bad_Opcode },
7515 { Bad_Opcode },
7516 { Bad_Opcode },
85f10a01 7517 /* e8 */
592d1631
L
7518 { Bad_Opcode },
7519 { Bad_Opcode },
7520 { Bad_Opcode },
7521 { Bad_Opcode },
7522 { Bad_Opcode },
7523 { Bad_Opcode },
7524 { Bad_Opcode },
7525 { Bad_Opcode },
85f10a01 7526 /* f0 */
592d1631
L
7527 { Bad_Opcode },
7528 { Bad_Opcode },
7529 { Bad_Opcode },
7530 { Bad_Opcode },
7531 { Bad_Opcode },
7532 { Bad_Opcode },
7533 { Bad_Opcode },
7534 { Bad_Opcode },
85f10a01 7535 /* f8 */
592d1631
L
7536 { Bad_Opcode },
7537 { Bad_Opcode },
7538 { Bad_Opcode },
7539 { Bad_Opcode },
7540 { Bad_Opcode },
7541 { Bad_Opcode },
7542 { Bad_Opcode },
7543 { Bad_Opcode },
85f10a01 7544 },
f88c9eb0
SP
7545};
7546
7547static const struct dis386 xop_table[][256] = {
5dd85c99 7548 /* XOP_08 */
85f10a01
MM
7549 {
7550 /* 00 */
592d1631
L
7551 { Bad_Opcode },
7552 { Bad_Opcode },
7553 { Bad_Opcode },
7554 { Bad_Opcode },
7555 { Bad_Opcode },
7556 { Bad_Opcode },
7557 { Bad_Opcode },
7558 { Bad_Opcode },
85f10a01 7559 /* 08 */
592d1631
L
7560 { Bad_Opcode },
7561 { Bad_Opcode },
7562 { Bad_Opcode },
7563 { Bad_Opcode },
7564 { Bad_Opcode },
7565 { Bad_Opcode },
7566 { Bad_Opcode },
7567 { Bad_Opcode },
85f10a01 7568 /* 10 */
3929df09 7569 { Bad_Opcode },
592d1631
L
7570 { Bad_Opcode },
7571 { Bad_Opcode },
7572 { Bad_Opcode },
7573 { Bad_Opcode },
7574 { Bad_Opcode },
7575 { Bad_Opcode },
7576 { Bad_Opcode },
85f10a01 7577 /* 18 */
592d1631
L
7578 { Bad_Opcode },
7579 { Bad_Opcode },
7580 { Bad_Opcode },
7581 { Bad_Opcode },
7582 { Bad_Opcode },
7583 { Bad_Opcode },
7584 { Bad_Opcode },
7585 { Bad_Opcode },
85f10a01 7586 /* 20 */
592d1631
L
7587 { Bad_Opcode },
7588 { Bad_Opcode },
7589 { Bad_Opcode },
7590 { Bad_Opcode },
7591 { Bad_Opcode },
7592 { Bad_Opcode },
7593 { Bad_Opcode },
7594 { Bad_Opcode },
85f10a01 7595 /* 28 */
592d1631
L
7596 { Bad_Opcode },
7597 { Bad_Opcode },
7598 { Bad_Opcode },
7599 { Bad_Opcode },
7600 { Bad_Opcode },
7601 { Bad_Opcode },
7602 { Bad_Opcode },
7603 { Bad_Opcode },
c0f3af97 7604 /* 30 */
592d1631
L
7605 { Bad_Opcode },
7606 { Bad_Opcode },
7607 { Bad_Opcode },
7608 { Bad_Opcode },
7609 { Bad_Opcode },
7610 { Bad_Opcode },
7611 { Bad_Opcode },
7612 { Bad_Opcode },
c0f3af97 7613 /* 38 */
592d1631
L
7614 { Bad_Opcode },
7615 { Bad_Opcode },
7616 { Bad_Opcode },
7617 { Bad_Opcode },
7618 { Bad_Opcode },
7619 { Bad_Opcode },
7620 { Bad_Opcode },
7621 { Bad_Opcode },
c0f3af97 7622 /* 40 */
592d1631
L
7623 { Bad_Opcode },
7624 { Bad_Opcode },
7625 { Bad_Opcode },
7626 { Bad_Opcode },
7627 { Bad_Opcode },
7628 { Bad_Opcode },
7629 { Bad_Opcode },
7630 { Bad_Opcode },
85f10a01 7631 /* 48 */
592d1631
L
7632 { Bad_Opcode },
7633 { Bad_Opcode },
7634 { Bad_Opcode },
7635 { Bad_Opcode },
7636 { Bad_Opcode },
7637 { Bad_Opcode },
7638 { Bad_Opcode },
7639 { Bad_Opcode },
c0f3af97 7640 /* 50 */
592d1631
L
7641 { Bad_Opcode },
7642 { Bad_Opcode },
7643 { Bad_Opcode },
7644 { Bad_Opcode },
7645 { Bad_Opcode },
7646 { Bad_Opcode },
7647 { Bad_Opcode },
7648 { Bad_Opcode },
85f10a01 7649 /* 58 */
592d1631
L
7650 { Bad_Opcode },
7651 { Bad_Opcode },
7652 { Bad_Opcode },
7653 { Bad_Opcode },
7654 { Bad_Opcode },
7655 { Bad_Opcode },
7656 { Bad_Opcode },
7657 { Bad_Opcode },
c1e679ec 7658 /* 60 */
592d1631
L
7659 { Bad_Opcode },
7660 { Bad_Opcode },
7661 { Bad_Opcode },
7662 { Bad_Opcode },
7663 { Bad_Opcode },
7664 { Bad_Opcode },
7665 { Bad_Opcode },
7666 { Bad_Opcode },
c0f3af97 7667 /* 68 */
592d1631
L
7668 { Bad_Opcode },
7669 { Bad_Opcode },
7670 { Bad_Opcode },
7671 { Bad_Opcode },
7672 { Bad_Opcode },
7673 { Bad_Opcode },
7674 { Bad_Opcode },
7675 { Bad_Opcode },
85f10a01 7676 /* 70 */
592d1631
L
7677 { Bad_Opcode },
7678 { Bad_Opcode },
7679 { Bad_Opcode },
7680 { Bad_Opcode },
7681 { Bad_Opcode },
7682 { Bad_Opcode },
7683 { Bad_Opcode },
7684 { Bad_Opcode },
85f10a01 7685 /* 78 */
592d1631
L
7686 { Bad_Opcode },
7687 { Bad_Opcode },
7688 { Bad_Opcode },
7689 { Bad_Opcode },
7690 { Bad_Opcode },
7691 { Bad_Opcode },
7692 { Bad_Opcode },
7693 { Bad_Opcode },
85f10a01 7694 /* 80 */
592d1631
L
7695 { Bad_Opcode },
7696 { Bad_Opcode },
7697 { Bad_Opcode },
7698 { Bad_Opcode },
7699 { Bad_Opcode },
3a2430e0
JB
7700 { "vpmacssww", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7701 { "vpmacsswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7702 { "vpmacssdql", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
5dd85c99 7703 /* 88 */
592d1631
L
7704 { Bad_Opcode },
7705 { Bad_Opcode },
7706 { Bad_Opcode },
7707 { Bad_Opcode },
7708 { Bad_Opcode },
7709 { Bad_Opcode },
3a2430e0
JB
7710 { "vpmacssdd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7711 { "vpmacssdqh", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
5dd85c99 7712 /* 90 */
592d1631
L
7713 { Bad_Opcode },
7714 { Bad_Opcode },
7715 { Bad_Opcode },
7716 { Bad_Opcode },
7717 { Bad_Opcode },
3a2430e0
JB
7718 { "vpmacsww", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7719 { "vpmacswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7720 { "vpmacsdql", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
5dd85c99 7721 /* 98 */
592d1631
L
7722 { Bad_Opcode },
7723 { Bad_Opcode },
7724 { Bad_Opcode },
7725 { Bad_Opcode },
7726 { Bad_Opcode },
7727 { Bad_Opcode },
3a2430e0
JB
7728 { "vpmacsdd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7729 { "vpmacsdqh", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
5dd85c99 7730 /* a0 */
592d1631
L
7731 { Bad_Opcode },
7732 { Bad_Opcode },
3a2430e0
JB
7733 { "vpcmov", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
7734 { "vpperm", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
592d1631
L
7735 { Bad_Opcode },
7736 { Bad_Opcode },
3a2430e0 7737 { "vpmadcsswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
592d1631 7738 { Bad_Opcode },
5dd85c99 7739 /* a8 */
592d1631
L
7740 { Bad_Opcode },
7741 { Bad_Opcode },
7742 { Bad_Opcode },
7743 { Bad_Opcode },
7744 { Bad_Opcode },
7745 { Bad_Opcode },
7746 { Bad_Opcode },
7747 { Bad_Opcode },
5dd85c99 7748 /* b0 */
592d1631
L
7749 { Bad_Opcode },
7750 { Bad_Opcode },
7751 { Bad_Opcode },
7752 { Bad_Opcode },
7753 { Bad_Opcode },
7754 { Bad_Opcode },
3a2430e0 7755 { "vpmadcswd", { XMVexW, Vex, EXVexW, EXVexW }, 0 },
592d1631 7756 { Bad_Opcode },
5dd85c99 7757 /* b8 */
592d1631
L
7758 { Bad_Opcode },
7759 { Bad_Opcode },
7760 { Bad_Opcode },
7761 { Bad_Opcode },
7762 { Bad_Opcode },
7763 { Bad_Opcode },
7764 { Bad_Opcode },
7765 { Bad_Opcode },
5dd85c99 7766 /* c0 */
bf890a93
IT
7767 { "vprotb", { XM, Vex_2src_1, Ib }, 0 },
7768 { "vprotw", { XM, Vex_2src_1, Ib }, 0 },
7769 { "vprotd", { XM, Vex_2src_1, Ib }, 0 },
7770 { "vprotq", { XM, Vex_2src_1, Ib }, 0 },
592d1631
L
7771 { Bad_Opcode },
7772 { Bad_Opcode },
7773 { Bad_Opcode },
7774 { Bad_Opcode },
5dd85c99 7775 /* c8 */
592d1631
L
7776 { Bad_Opcode },
7777 { Bad_Opcode },
7778 { Bad_Opcode },
7779 { Bad_Opcode },
ff688e1f
L
7780 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CC) },
7781 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CD) },
7782 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CE) },
7783 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_CF) },
5dd85c99 7784 /* d0 */
592d1631
L
7785 { Bad_Opcode },
7786 { Bad_Opcode },
7787 { Bad_Opcode },
7788 { Bad_Opcode },
7789 { Bad_Opcode },
7790 { Bad_Opcode },
7791 { Bad_Opcode },
7792 { Bad_Opcode },
5dd85c99 7793 /* d8 */
592d1631
L
7794 { Bad_Opcode },
7795 { Bad_Opcode },
7796 { Bad_Opcode },
7797 { Bad_Opcode },
7798 { Bad_Opcode },
7799 { Bad_Opcode },
7800 { Bad_Opcode },
7801 { Bad_Opcode },
5dd85c99 7802 /* e0 */
592d1631
L
7803 { Bad_Opcode },
7804 { Bad_Opcode },
7805 { Bad_Opcode },
7806 { Bad_Opcode },
7807 { Bad_Opcode },
7808 { Bad_Opcode },
7809 { Bad_Opcode },
7810 { Bad_Opcode },
5dd85c99 7811 /* e8 */
592d1631
L
7812 { Bad_Opcode },
7813 { Bad_Opcode },
7814 { Bad_Opcode },
7815 { Bad_Opcode },
ff688e1f
L
7816 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EC) },
7817 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_ED) },
7818 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EE) },
7819 { VEX_LEN_TABLE (VEX_LEN_0FXOP_08_EF) },
5dd85c99 7820 /* f0 */
592d1631
L
7821 { Bad_Opcode },
7822 { Bad_Opcode },
7823 { Bad_Opcode },
7824 { Bad_Opcode },
7825 { Bad_Opcode },
7826 { Bad_Opcode },
7827 { Bad_Opcode },
7828 { Bad_Opcode },
5dd85c99 7829 /* f8 */
592d1631
L
7830 { Bad_Opcode },
7831 { Bad_Opcode },
7832 { Bad_Opcode },
7833 { Bad_Opcode },
7834 { Bad_Opcode },
7835 { Bad_Opcode },
7836 { Bad_Opcode },
7837 { Bad_Opcode },
5dd85c99
SP
7838 },
7839 /* XOP_09 */
7840 {
7841 /* 00 */
592d1631 7842 { Bad_Opcode },
2a2a0f38
QN
7843 { REG_TABLE (REG_XOP_TBM_01) },
7844 { REG_TABLE (REG_XOP_TBM_02) },
592d1631
L
7845 { Bad_Opcode },
7846 { Bad_Opcode },
7847 { Bad_Opcode },
7848 { Bad_Opcode },
7849 { Bad_Opcode },
5dd85c99 7850 /* 08 */
592d1631
L
7851 { Bad_Opcode },
7852 { Bad_Opcode },
7853 { Bad_Opcode },
7854 { Bad_Opcode },
7855 { Bad_Opcode },
7856 { Bad_Opcode },
7857 { Bad_Opcode },
7858 { Bad_Opcode },
5dd85c99 7859 /* 10 */
592d1631
L
7860 { Bad_Opcode },
7861 { Bad_Opcode },
5dd85c99 7862 { REG_TABLE (REG_XOP_LWPCB) },
592d1631
L
7863 { Bad_Opcode },
7864 { Bad_Opcode },
7865 { Bad_Opcode },
7866 { Bad_Opcode },
7867 { Bad_Opcode },
5dd85c99 7868 /* 18 */
592d1631
L
7869 { Bad_Opcode },
7870 { Bad_Opcode },
7871 { Bad_Opcode },
7872 { Bad_Opcode },
7873 { Bad_Opcode },
7874 { Bad_Opcode },
7875 { Bad_Opcode },
7876 { Bad_Opcode },
5dd85c99 7877 /* 20 */
592d1631
L
7878 { Bad_Opcode },
7879 { Bad_Opcode },
7880 { Bad_Opcode },
7881 { Bad_Opcode },
7882 { Bad_Opcode },
7883 { Bad_Opcode },
7884 { Bad_Opcode },
7885 { Bad_Opcode },
5dd85c99 7886 /* 28 */
592d1631
L
7887 { Bad_Opcode },
7888 { Bad_Opcode },
7889 { Bad_Opcode },
7890 { Bad_Opcode },
7891 { Bad_Opcode },
7892 { Bad_Opcode },
7893 { Bad_Opcode },
7894 { Bad_Opcode },
5dd85c99 7895 /* 30 */
592d1631
L
7896 { Bad_Opcode },
7897 { Bad_Opcode },
7898 { Bad_Opcode },
7899 { Bad_Opcode },
7900 { Bad_Opcode },
7901 { Bad_Opcode },
7902 { Bad_Opcode },
7903 { Bad_Opcode },
5dd85c99 7904 /* 38 */
592d1631
L
7905 { Bad_Opcode },
7906 { Bad_Opcode },
7907 { Bad_Opcode },
7908 { Bad_Opcode },
7909 { Bad_Opcode },
7910 { Bad_Opcode },
7911 { Bad_Opcode },
7912 { Bad_Opcode },
5dd85c99 7913 /* 40 */
592d1631
L
7914 { Bad_Opcode },
7915 { Bad_Opcode },
7916 { Bad_Opcode },
7917 { Bad_Opcode },
7918 { Bad_Opcode },
7919 { Bad_Opcode },
7920 { Bad_Opcode },
7921 { Bad_Opcode },
5dd85c99 7922 /* 48 */
592d1631
L
7923 { Bad_Opcode },
7924 { Bad_Opcode },
7925 { Bad_Opcode },
7926 { Bad_Opcode },
7927 { Bad_Opcode },
7928 { Bad_Opcode },
7929 { Bad_Opcode },
7930 { Bad_Opcode },
5dd85c99 7931 /* 50 */
592d1631
L
7932 { Bad_Opcode },
7933 { Bad_Opcode },
7934 { Bad_Opcode },
7935 { Bad_Opcode },
7936 { Bad_Opcode },
7937 { Bad_Opcode },
7938 { Bad_Opcode },
7939 { Bad_Opcode },
5dd85c99 7940 /* 58 */
592d1631
L
7941 { Bad_Opcode },
7942 { Bad_Opcode },
7943 { Bad_Opcode },
7944 { Bad_Opcode },
7945 { Bad_Opcode },
7946 { Bad_Opcode },
7947 { Bad_Opcode },
7948 { Bad_Opcode },
5dd85c99 7949 /* 60 */
592d1631
L
7950 { Bad_Opcode },
7951 { Bad_Opcode },
7952 { Bad_Opcode },
7953 { Bad_Opcode },
7954 { Bad_Opcode },
7955 { Bad_Opcode },
7956 { Bad_Opcode },
7957 { Bad_Opcode },
5dd85c99 7958 /* 68 */
592d1631
L
7959 { Bad_Opcode },
7960 { Bad_Opcode },
7961 { Bad_Opcode },
7962 { Bad_Opcode },
7963 { Bad_Opcode },
7964 { Bad_Opcode },
7965 { Bad_Opcode },
7966 { Bad_Opcode },
5dd85c99 7967 /* 70 */
592d1631
L
7968 { Bad_Opcode },
7969 { Bad_Opcode },
7970 { Bad_Opcode },
7971 { Bad_Opcode },
7972 { Bad_Opcode },
7973 { Bad_Opcode },
7974 { Bad_Opcode },
7975 { Bad_Opcode },
5dd85c99 7976 /* 78 */
592d1631
L
7977 { Bad_Opcode },
7978 { Bad_Opcode },
7979 { Bad_Opcode },
7980 { Bad_Opcode },
7981 { Bad_Opcode },
7982 { Bad_Opcode },
7983 { Bad_Opcode },
7984 { Bad_Opcode },
5dd85c99 7985 /* 80 */
592a252b
L
7986 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_80) },
7987 { VEX_LEN_TABLE (VEX_LEN_0FXOP_09_81) },
bf890a93
IT
7988 { "vfrczss", { XM, EXd }, 0 },
7989 { "vfrczsd", { XM, EXq }, 0 },
592d1631
L
7990 { Bad_Opcode },
7991 { Bad_Opcode },
7992 { Bad_Opcode },
7993 { Bad_Opcode },
5dd85c99 7994 /* 88 */
592d1631
L
7995 { Bad_Opcode },
7996 { Bad_Opcode },
7997 { Bad_Opcode },
7998 { Bad_Opcode },
7999 { Bad_Opcode },
8000 { Bad_Opcode },
8001 { Bad_Opcode },
8002 { Bad_Opcode },
5dd85c99 8003 /* 90 */
bf890a93
IT
8004 { "vprotb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8005 { "vprotw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8006 { "vprotd", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8007 { "vprotq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8008 { "vpshlb", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8009 { "vpshlw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8010 { "vpshld", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8011 { "vpshlq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
5dd85c99 8012 /* 98 */
bf890a93
IT
8013 { "vpshab", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8014 { "vpshaw", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8015 { "vpshad", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
8016 { "vpshaq", { XM, Vex_2src_1, Vex_2src_2 }, 0 },
592d1631
L
8017 { Bad_Opcode },
8018 { Bad_Opcode },
8019 { Bad_Opcode },
8020 { Bad_Opcode },
5dd85c99 8021 /* a0 */
592d1631
L
8022 { Bad_Opcode },
8023 { Bad_Opcode },
8024 { Bad_Opcode },
8025 { Bad_Opcode },
8026 { Bad_Opcode },
8027 { Bad_Opcode },
8028 { Bad_Opcode },
8029 { Bad_Opcode },
5dd85c99 8030 /* a8 */
592d1631
L
8031 { Bad_Opcode },
8032 { Bad_Opcode },
8033 { Bad_Opcode },
8034 { Bad_Opcode },
8035 { Bad_Opcode },
8036 { Bad_Opcode },
8037 { Bad_Opcode },
8038 { Bad_Opcode },
5dd85c99 8039 /* b0 */
592d1631
L
8040 { Bad_Opcode },
8041 { Bad_Opcode },
8042 { Bad_Opcode },
8043 { Bad_Opcode },
8044 { Bad_Opcode },
8045 { Bad_Opcode },
8046 { Bad_Opcode },
8047 { Bad_Opcode },
5dd85c99 8048 /* b8 */
592d1631
L
8049 { Bad_Opcode },
8050 { Bad_Opcode },
8051 { Bad_Opcode },
8052 { Bad_Opcode },
8053 { Bad_Opcode },
8054 { Bad_Opcode },
8055 { Bad_Opcode },
8056 { Bad_Opcode },
5dd85c99 8057 /* c0 */
592d1631 8058 { Bad_Opcode },
bf890a93
IT
8059 { "vphaddbw", { XM, EXxmm }, 0 },
8060 { "vphaddbd", { XM, EXxmm }, 0 },
8061 { "vphaddbq", { XM, EXxmm }, 0 },
592d1631
L
8062 { Bad_Opcode },
8063 { Bad_Opcode },
bf890a93
IT
8064 { "vphaddwd", { XM, EXxmm }, 0 },
8065 { "vphaddwq", { XM, EXxmm }, 0 },
5dd85c99 8066 /* c8 */
592d1631
L
8067 { Bad_Opcode },
8068 { Bad_Opcode },
8069 { Bad_Opcode },
bf890a93 8070 { "vphadddq", { XM, EXxmm }, 0 },
592d1631
L
8071 { Bad_Opcode },
8072 { Bad_Opcode },
8073 { Bad_Opcode },
8074 { Bad_Opcode },
5dd85c99 8075 /* d0 */
592d1631 8076 { Bad_Opcode },
bf890a93
IT
8077 { "vphaddubw", { XM, EXxmm }, 0 },
8078 { "vphaddubd", { XM, EXxmm }, 0 },
8079 { "vphaddubq", { XM, EXxmm }, 0 },
592d1631
L
8080 { Bad_Opcode },
8081 { Bad_Opcode },
bf890a93
IT
8082 { "vphadduwd", { XM, EXxmm }, 0 },
8083 { "vphadduwq", { XM, EXxmm }, 0 },
5dd85c99 8084 /* d8 */
592d1631
L
8085 { Bad_Opcode },
8086 { Bad_Opcode },
8087 { Bad_Opcode },
bf890a93 8088 { "vphaddudq", { XM, EXxmm }, 0 },
592d1631
L
8089 { Bad_Opcode },
8090 { Bad_Opcode },
8091 { Bad_Opcode },
8092 { Bad_Opcode },
5dd85c99 8093 /* e0 */
592d1631 8094 { Bad_Opcode },
bf890a93
IT
8095 { "vphsubbw", { XM, EXxmm }, 0 },
8096 { "vphsubwd", { XM, EXxmm }, 0 },
8097 { "vphsubdq", { XM, EXxmm }, 0 },
592d1631
L
8098 { Bad_Opcode },
8099 { Bad_Opcode },
8100 { Bad_Opcode },
8101 { Bad_Opcode },
4e7d34a6 8102 /* e8 */
592d1631
L
8103 { Bad_Opcode },
8104 { Bad_Opcode },
8105 { Bad_Opcode },
8106 { Bad_Opcode },
8107 { Bad_Opcode },
8108 { Bad_Opcode },
8109 { Bad_Opcode },
8110 { Bad_Opcode },
4e7d34a6 8111 /* f0 */
592d1631
L
8112 { Bad_Opcode },
8113 { Bad_Opcode },
8114 { Bad_Opcode },
8115 { Bad_Opcode },
8116 { Bad_Opcode },
8117 { Bad_Opcode },
8118 { Bad_Opcode },
8119 { Bad_Opcode },
4e7d34a6 8120 /* f8 */
592d1631
L
8121 { Bad_Opcode },
8122 { Bad_Opcode },
8123 { Bad_Opcode },
8124 { Bad_Opcode },
8125 { Bad_Opcode },
8126 { Bad_Opcode },
8127 { Bad_Opcode },
8128 { Bad_Opcode },
4e7d34a6 8129 },
f88c9eb0 8130 /* XOP_0A */
4e7d34a6
L
8131 {
8132 /* 00 */
592d1631
L
8133 { Bad_Opcode },
8134 { Bad_Opcode },
8135 { Bad_Opcode },
8136 { Bad_Opcode },
8137 { Bad_Opcode },
8138 { Bad_Opcode },
8139 { Bad_Opcode },
8140 { Bad_Opcode },
4e7d34a6 8141 /* 08 */
592d1631
L
8142 { Bad_Opcode },
8143 { Bad_Opcode },
8144 { Bad_Opcode },
8145 { Bad_Opcode },
8146 { Bad_Opcode },
8147 { Bad_Opcode },
8148 { Bad_Opcode },
8149 { Bad_Opcode },
4e7d34a6 8150 /* 10 */
bf890a93 8151 { "bextr", { Gv, Ev, Iq }, 0 },
592d1631 8152 { Bad_Opcode },
f88c9eb0 8153 { REG_TABLE (REG_XOP_LWP) },
592d1631
L
8154 { Bad_Opcode },
8155 { Bad_Opcode },
8156 { Bad_Opcode },
8157 { Bad_Opcode },
8158 { Bad_Opcode },
4e7d34a6 8159 /* 18 */
592d1631
L
8160 { Bad_Opcode },
8161 { Bad_Opcode },
8162 { Bad_Opcode },
8163 { Bad_Opcode },
8164 { Bad_Opcode },
8165 { Bad_Opcode },
8166 { Bad_Opcode },
8167 { Bad_Opcode },
4e7d34a6 8168 /* 20 */
592d1631
L
8169 { Bad_Opcode },
8170 { Bad_Opcode },
8171 { Bad_Opcode },
8172 { Bad_Opcode },
8173 { Bad_Opcode },
8174 { Bad_Opcode },
8175 { Bad_Opcode },
8176 { Bad_Opcode },
4e7d34a6 8177 /* 28 */
592d1631
L
8178 { Bad_Opcode },
8179 { Bad_Opcode },
8180 { Bad_Opcode },
8181 { Bad_Opcode },
8182 { Bad_Opcode },
8183 { Bad_Opcode },
8184 { Bad_Opcode },
8185 { Bad_Opcode },
4e7d34a6 8186 /* 30 */
592d1631
L
8187 { Bad_Opcode },
8188 { Bad_Opcode },
8189 { Bad_Opcode },
8190 { Bad_Opcode },
8191 { Bad_Opcode },
8192 { Bad_Opcode },
8193 { Bad_Opcode },
8194 { Bad_Opcode },
c0f3af97 8195 /* 38 */
592d1631
L
8196 { Bad_Opcode },
8197 { Bad_Opcode },
8198 { Bad_Opcode },
8199 { Bad_Opcode },
8200 { Bad_Opcode },
8201 { Bad_Opcode },
8202 { Bad_Opcode },
8203 { Bad_Opcode },
c0f3af97 8204 /* 40 */
592d1631
L
8205 { Bad_Opcode },
8206 { Bad_Opcode },
8207 { Bad_Opcode },
8208 { Bad_Opcode },
8209 { Bad_Opcode },
8210 { Bad_Opcode },
8211 { Bad_Opcode },
8212 { Bad_Opcode },
c1e679ec 8213 /* 48 */
592d1631
L
8214 { Bad_Opcode },
8215 { Bad_Opcode },
8216 { Bad_Opcode },
8217 { Bad_Opcode },
8218 { Bad_Opcode },
8219 { Bad_Opcode },
8220 { Bad_Opcode },
8221 { Bad_Opcode },
c1e679ec 8222 /* 50 */
592d1631
L
8223 { Bad_Opcode },
8224 { Bad_Opcode },
8225 { Bad_Opcode },
8226 { Bad_Opcode },
8227 { Bad_Opcode },
8228 { Bad_Opcode },
8229 { Bad_Opcode },
8230 { Bad_Opcode },
4e7d34a6 8231 /* 58 */
592d1631
L
8232 { Bad_Opcode },
8233 { Bad_Opcode },
8234 { Bad_Opcode },
8235 { Bad_Opcode },
8236 { Bad_Opcode },
8237 { Bad_Opcode },
8238 { Bad_Opcode },
8239 { Bad_Opcode },
4e7d34a6 8240 /* 60 */
592d1631
L
8241 { Bad_Opcode },
8242 { Bad_Opcode },
8243 { Bad_Opcode },
8244 { Bad_Opcode },
8245 { Bad_Opcode },
8246 { Bad_Opcode },
8247 { Bad_Opcode },
8248 { Bad_Opcode },
4e7d34a6 8249 /* 68 */
592d1631
L
8250 { Bad_Opcode },
8251 { Bad_Opcode },
8252 { Bad_Opcode },
8253 { Bad_Opcode },
8254 { Bad_Opcode },
8255 { Bad_Opcode },
8256 { Bad_Opcode },
8257 { Bad_Opcode },
4e7d34a6 8258 /* 70 */
592d1631
L
8259 { Bad_Opcode },
8260 { Bad_Opcode },
8261 { Bad_Opcode },
8262 { Bad_Opcode },
8263 { Bad_Opcode },
8264 { Bad_Opcode },
8265 { Bad_Opcode },
8266 { Bad_Opcode },
4e7d34a6 8267 /* 78 */
592d1631
L
8268 { Bad_Opcode },
8269 { Bad_Opcode },
8270 { Bad_Opcode },
8271 { Bad_Opcode },
8272 { Bad_Opcode },
8273 { Bad_Opcode },
8274 { Bad_Opcode },
8275 { Bad_Opcode },
4e7d34a6 8276 /* 80 */
592d1631
L
8277 { Bad_Opcode },
8278 { Bad_Opcode },
8279 { Bad_Opcode },
8280 { Bad_Opcode },
8281 { Bad_Opcode },
8282 { Bad_Opcode },
8283 { Bad_Opcode },
8284 { Bad_Opcode },
4e7d34a6 8285 /* 88 */
592d1631
L
8286 { Bad_Opcode },
8287 { Bad_Opcode },
8288 { Bad_Opcode },
8289 { Bad_Opcode },
8290 { Bad_Opcode },
8291 { Bad_Opcode },
8292 { Bad_Opcode },
8293 { Bad_Opcode },
4e7d34a6 8294 /* 90 */
592d1631
L
8295 { Bad_Opcode },
8296 { Bad_Opcode },
8297 { Bad_Opcode },
8298 { Bad_Opcode },
8299 { Bad_Opcode },
8300 { Bad_Opcode },
8301 { Bad_Opcode },
8302 { Bad_Opcode },
4e7d34a6 8303 /* 98 */
592d1631
L
8304 { Bad_Opcode },
8305 { Bad_Opcode },
8306 { Bad_Opcode },
8307 { Bad_Opcode },
8308 { Bad_Opcode },
8309 { Bad_Opcode },
8310 { Bad_Opcode },
8311 { Bad_Opcode },
4e7d34a6 8312 /* a0 */
592d1631
L
8313 { Bad_Opcode },
8314 { Bad_Opcode },
8315 { Bad_Opcode },
8316 { Bad_Opcode },
8317 { Bad_Opcode },
8318 { Bad_Opcode },
8319 { Bad_Opcode },
8320 { Bad_Opcode },
4e7d34a6 8321 /* a8 */
592d1631
L
8322 { Bad_Opcode },
8323 { Bad_Opcode },
8324 { Bad_Opcode },
8325 { Bad_Opcode },
8326 { Bad_Opcode },
8327 { Bad_Opcode },
8328 { Bad_Opcode },
8329 { Bad_Opcode },
d5d7db8e 8330 /* b0 */
592d1631
L
8331 { Bad_Opcode },
8332 { Bad_Opcode },
8333 { Bad_Opcode },
8334 { Bad_Opcode },
8335 { Bad_Opcode },
8336 { Bad_Opcode },
8337 { Bad_Opcode },
8338 { Bad_Opcode },
85f10a01 8339 /* b8 */
592d1631
L
8340 { Bad_Opcode },
8341 { Bad_Opcode },
8342 { Bad_Opcode },
8343 { Bad_Opcode },
8344 { Bad_Opcode },
8345 { Bad_Opcode },
8346 { Bad_Opcode },
8347 { Bad_Opcode },
85f10a01 8348 /* c0 */
592d1631
L
8349 { Bad_Opcode },
8350 { Bad_Opcode },
8351 { Bad_Opcode },
8352 { Bad_Opcode },
8353 { Bad_Opcode },
8354 { Bad_Opcode },
8355 { Bad_Opcode },
8356 { Bad_Opcode },
85f10a01 8357 /* c8 */
592d1631
L
8358 { Bad_Opcode },
8359 { Bad_Opcode },
8360 { Bad_Opcode },
8361 { Bad_Opcode },
8362 { Bad_Opcode },
8363 { Bad_Opcode },
8364 { Bad_Opcode },
8365 { Bad_Opcode },
85f10a01 8366 /* d0 */
592d1631
L
8367 { Bad_Opcode },
8368 { Bad_Opcode },
8369 { Bad_Opcode },
8370 { Bad_Opcode },
8371 { Bad_Opcode },
8372 { Bad_Opcode },
8373 { Bad_Opcode },
8374 { Bad_Opcode },
85f10a01 8375 /* d8 */
592d1631
L
8376 { Bad_Opcode },
8377 { Bad_Opcode },
8378 { Bad_Opcode },
8379 { Bad_Opcode },
8380 { Bad_Opcode },
8381 { Bad_Opcode },
8382 { Bad_Opcode },
8383 { Bad_Opcode },
85f10a01 8384 /* e0 */
592d1631
L
8385 { Bad_Opcode },
8386 { Bad_Opcode },
8387 { Bad_Opcode },
8388 { Bad_Opcode },
8389 { Bad_Opcode },
8390 { Bad_Opcode },
8391 { Bad_Opcode },
8392 { Bad_Opcode },
85f10a01 8393 /* e8 */
592d1631
L
8394 { Bad_Opcode },
8395 { Bad_Opcode },
8396 { Bad_Opcode },
8397 { Bad_Opcode },
8398 { Bad_Opcode },
8399 { Bad_Opcode },
8400 { Bad_Opcode },
8401 { Bad_Opcode },
85f10a01 8402 /* f0 */
592d1631
L
8403 { Bad_Opcode },
8404 { Bad_Opcode },
8405 { Bad_Opcode },
8406 { Bad_Opcode },
8407 { Bad_Opcode },
8408 { Bad_Opcode },
8409 { Bad_Opcode },
8410 { Bad_Opcode },
85f10a01 8411 /* f8 */
592d1631
L
8412 { Bad_Opcode },
8413 { Bad_Opcode },
8414 { Bad_Opcode },
8415 { Bad_Opcode },
8416 { Bad_Opcode },
8417 { Bad_Opcode },
8418 { Bad_Opcode },
8419 { Bad_Opcode },
85f10a01 8420 },
c0f3af97
L
8421};
8422
8423static const struct dis386 vex_table[][256] = {
8424 /* VEX_0F */
85f10a01
MM
8425 {
8426 /* 00 */
592d1631
L
8427 { Bad_Opcode },
8428 { Bad_Opcode },
8429 { Bad_Opcode },
8430 { Bad_Opcode },
8431 { Bad_Opcode },
8432 { Bad_Opcode },
8433 { Bad_Opcode },
8434 { Bad_Opcode },
85f10a01 8435 /* 08 */
592d1631
L
8436 { Bad_Opcode },
8437 { Bad_Opcode },
8438 { Bad_Opcode },
8439 { Bad_Opcode },
8440 { Bad_Opcode },
8441 { Bad_Opcode },
8442 { Bad_Opcode },
8443 { Bad_Opcode },
c0f3af97 8444 /* 10 */
592a252b
L
8445 { PREFIX_TABLE (PREFIX_VEX_0F10) },
8446 { PREFIX_TABLE (PREFIX_VEX_0F11) },
8447 { PREFIX_TABLE (PREFIX_VEX_0F12) },
8448 { MOD_TABLE (MOD_VEX_0F13) },
ec6f095a
L
8449 { "vunpcklpX", { XM, Vex, EXx }, 0 },
8450 { "vunpckhpX", { XM, Vex, EXx }, 0 },
592a252b
L
8451 { PREFIX_TABLE (PREFIX_VEX_0F16) },
8452 { MOD_TABLE (MOD_VEX_0F17) },
c0f3af97 8453 /* 18 */
592d1631
L
8454 { Bad_Opcode },
8455 { Bad_Opcode },
8456 { Bad_Opcode },
8457 { Bad_Opcode },
8458 { Bad_Opcode },
8459 { Bad_Opcode },
8460 { Bad_Opcode },
8461 { Bad_Opcode },
c0f3af97 8462 /* 20 */
592d1631
L
8463 { Bad_Opcode },
8464 { Bad_Opcode },
8465 { Bad_Opcode },
8466 { Bad_Opcode },
8467 { Bad_Opcode },
8468 { Bad_Opcode },
8469 { Bad_Opcode },
8470 { Bad_Opcode },
c0f3af97 8471 /* 28 */
ec6f095a
L
8472 { "vmovapX", { XM, EXx }, 0 },
8473 { "vmovapX", { EXxS, XM }, 0 },
592a252b
L
8474 { PREFIX_TABLE (PREFIX_VEX_0F2A) },
8475 { MOD_TABLE (MOD_VEX_0F2B) },
8476 { PREFIX_TABLE (PREFIX_VEX_0F2C) },
8477 { PREFIX_TABLE (PREFIX_VEX_0F2D) },
8478 { PREFIX_TABLE (PREFIX_VEX_0F2E) },
8479 { PREFIX_TABLE (PREFIX_VEX_0F2F) },
85f10a01 8480 /* 30 */
592d1631
L
8481 { Bad_Opcode },
8482 { Bad_Opcode },
8483 { Bad_Opcode },
8484 { Bad_Opcode },
8485 { Bad_Opcode },
8486 { Bad_Opcode },
8487 { Bad_Opcode },
8488 { Bad_Opcode },
4e7d34a6 8489 /* 38 */
592d1631
L
8490 { Bad_Opcode },
8491 { Bad_Opcode },
8492 { Bad_Opcode },
8493 { Bad_Opcode },
8494 { Bad_Opcode },
8495 { Bad_Opcode },
8496 { Bad_Opcode },
8497 { Bad_Opcode },
d5d7db8e 8498 /* 40 */
592d1631 8499 { Bad_Opcode },
43234a1e
L
8500 { PREFIX_TABLE (PREFIX_VEX_0F41) },
8501 { PREFIX_TABLE (PREFIX_VEX_0F42) },
592d1631 8502 { Bad_Opcode },
43234a1e
L
8503 { PREFIX_TABLE (PREFIX_VEX_0F44) },
8504 { PREFIX_TABLE (PREFIX_VEX_0F45) },
8505 { PREFIX_TABLE (PREFIX_VEX_0F46) },
8506 { PREFIX_TABLE (PREFIX_VEX_0F47) },
85f10a01 8507 /* 48 */
592d1631
L
8508 { Bad_Opcode },
8509 { Bad_Opcode },
1ba585e8 8510 { PREFIX_TABLE (PREFIX_VEX_0F4A) },
43234a1e 8511 { PREFIX_TABLE (PREFIX_VEX_0F4B) },
592d1631
L
8512 { Bad_Opcode },
8513 { Bad_Opcode },
8514 { Bad_Opcode },
8515 { Bad_Opcode },
d5d7db8e 8516 /* 50 */
592a252b
L
8517 { MOD_TABLE (MOD_VEX_0F50) },
8518 { PREFIX_TABLE (PREFIX_VEX_0F51) },
8519 { PREFIX_TABLE (PREFIX_VEX_0F52) },
8520 { PREFIX_TABLE (PREFIX_VEX_0F53) },
bf890a93
IT
8521 { "vandpX", { XM, Vex, EXx }, 0 },
8522 { "vandnpX", { XM, Vex, EXx }, 0 },
8523 { "vorpX", { XM, Vex, EXx }, 0 },
8524 { "vxorpX", { XM, Vex, EXx }, 0 },
c0f3af97 8525 /* 58 */
592a252b
L
8526 { PREFIX_TABLE (PREFIX_VEX_0F58) },
8527 { PREFIX_TABLE (PREFIX_VEX_0F59) },
8528 { PREFIX_TABLE (PREFIX_VEX_0F5A) },
8529 { PREFIX_TABLE (PREFIX_VEX_0F5B) },
8530 { PREFIX_TABLE (PREFIX_VEX_0F5C) },
8531 { PREFIX_TABLE (PREFIX_VEX_0F5D) },
8532 { PREFIX_TABLE (PREFIX_VEX_0F5E) },
8533 { PREFIX_TABLE (PREFIX_VEX_0F5F) },
c0f3af97 8534 /* 60 */
592a252b
L
8535 { PREFIX_TABLE (PREFIX_VEX_0F60) },
8536 { PREFIX_TABLE (PREFIX_VEX_0F61) },
8537 { PREFIX_TABLE (PREFIX_VEX_0F62) },
8538 { PREFIX_TABLE (PREFIX_VEX_0F63) },
8539 { PREFIX_TABLE (PREFIX_VEX_0F64) },
8540 { PREFIX_TABLE (PREFIX_VEX_0F65) },
8541 { PREFIX_TABLE (PREFIX_VEX_0F66) },
8542 { PREFIX_TABLE (PREFIX_VEX_0F67) },
c0f3af97 8543 /* 68 */
592a252b
L
8544 { PREFIX_TABLE (PREFIX_VEX_0F68) },
8545 { PREFIX_TABLE (PREFIX_VEX_0F69) },
8546 { PREFIX_TABLE (PREFIX_VEX_0F6A) },
8547 { PREFIX_TABLE (PREFIX_VEX_0F6B) },
8548 { PREFIX_TABLE (PREFIX_VEX_0F6C) },
8549 { PREFIX_TABLE (PREFIX_VEX_0F6D) },
8550 { PREFIX_TABLE (PREFIX_VEX_0F6E) },
8551 { PREFIX_TABLE (PREFIX_VEX_0F6F) },
c0f3af97 8552 /* 70 */
592a252b
L
8553 { PREFIX_TABLE (PREFIX_VEX_0F70) },
8554 { REG_TABLE (REG_VEX_0F71) },
8555 { REG_TABLE (REG_VEX_0F72) },
8556 { REG_TABLE (REG_VEX_0F73) },
8557 { PREFIX_TABLE (PREFIX_VEX_0F74) },
8558 { PREFIX_TABLE (PREFIX_VEX_0F75) },
8559 { PREFIX_TABLE (PREFIX_VEX_0F76) },
8560 { PREFIX_TABLE (PREFIX_VEX_0F77) },
c0f3af97 8561 /* 78 */
592d1631
L
8562 { Bad_Opcode },
8563 { Bad_Opcode },
8564 { Bad_Opcode },
8565 { Bad_Opcode },
592a252b
L
8566 { PREFIX_TABLE (PREFIX_VEX_0F7C) },
8567 { PREFIX_TABLE (PREFIX_VEX_0F7D) },
8568 { PREFIX_TABLE (PREFIX_VEX_0F7E) },
8569 { PREFIX_TABLE (PREFIX_VEX_0F7F) },
c0f3af97 8570 /* 80 */
592d1631
L
8571 { Bad_Opcode },
8572 { Bad_Opcode },
8573 { Bad_Opcode },
8574 { Bad_Opcode },
8575 { Bad_Opcode },
8576 { Bad_Opcode },
8577 { Bad_Opcode },
8578 { Bad_Opcode },
c0f3af97 8579 /* 88 */
592d1631
L
8580 { Bad_Opcode },
8581 { Bad_Opcode },
8582 { Bad_Opcode },
8583 { Bad_Opcode },
8584 { Bad_Opcode },
8585 { Bad_Opcode },
8586 { Bad_Opcode },
8587 { Bad_Opcode },
c0f3af97 8588 /* 90 */
43234a1e
L
8589 { PREFIX_TABLE (PREFIX_VEX_0F90) },
8590 { PREFIX_TABLE (PREFIX_VEX_0F91) },
8591 { PREFIX_TABLE (PREFIX_VEX_0F92) },
8592 { PREFIX_TABLE (PREFIX_VEX_0F93) },
592d1631
L
8593 { Bad_Opcode },
8594 { Bad_Opcode },
8595 { Bad_Opcode },
8596 { Bad_Opcode },
c0f3af97 8597 /* 98 */
43234a1e 8598 { PREFIX_TABLE (PREFIX_VEX_0F98) },
1ba585e8 8599 { PREFIX_TABLE (PREFIX_VEX_0F99) },
592d1631
L
8600 { Bad_Opcode },
8601 { Bad_Opcode },
8602 { Bad_Opcode },
8603 { Bad_Opcode },
8604 { Bad_Opcode },
8605 { Bad_Opcode },
c0f3af97 8606 /* a0 */
592d1631
L
8607 { Bad_Opcode },
8608 { Bad_Opcode },
8609 { Bad_Opcode },
8610 { Bad_Opcode },
8611 { Bad_Opcode },
8612 { Bad_Opcode },
8613 { Bad_Opcode },
8614 { Bad_Opcode },
c0f3af97 8615 /* a8 */
592d1631
L
8616 { Bad_Opcode },
8617 { Bad_Opcode },
8618 { Bad_Opcode },
8619 { Bad_Opcode },
8620 { Bad_Opcode },
8621 { Bad_Opcode },
592a252b 8622 { REG_TABLE (REG_VEX_0FAE) },
592d1631 8623 { Bad_Opcode },
c0f3af97 8624 /* b0 */
592d1631
L
8625 { Bad_Opcode },
8626 { Bad_Opcode },
8627 { Bad_Opcode },
8628 { Bad_Opcode },
8629 { Bad_Opcode },
8630 { Bad_Opcode },
8631 { Bad_Opcode },
8632 { Bad_Opcode },
c0f3af97 8633 /* b8 */
592d1631
L
8634 { Bad_Opcode },
8635 { Bad_Opcode },
8636 { Bad_Opcode },
8637 { Bad_Opcode },
8638 { Bad_Opcode },
8639 { Bad_Opcode },
8640 { Bad_Opcode },
8641 { Bad_Opcode },
c0f3af97 8642 /* c0 */
592d1631
L
8643 { Bad_Opcode },
8644 { Bad_Opcode },
592a252b 8645 { PREFIX_TABLE (PREFIX_VEX_0FC2) },
592d1631 8646 { Bad_Opcode },
592a252b
L
8647 { PREFIX_TABLE (PREFIX_VEX_0FC4) },
8648 { PREFIX_TABLE (PREFIX_VEX_0FC5) },
bf890a93 8649 { "vshufpX", { XM, Vex, EXx, Ib }, 0 },
592d1631 8650 { Bad_Opcode },
c0f3af97 8651 /* c8 */
592d1631
L
8652 { Bad_Opcode },
8653 { Bad_Opcode },
8654 { Bad_Opcode },
8655 { Bad_Opcode },
8656 { Bad_Opcode },
8657 { Bad_Opcode },
8658 { Bad_Opcode },
8659 { Bad_Opcode },
c0f3af97 8660 /* d0 */
592a252b
L
8661 { PREFIX_TABLE (PREFIX_VEX_0FD0) },
8662 { PREFIX_TABLE (PREFIX_VEX_0FD1) },
8663 { PREFIX_TABLE (PREFIX_VEX_0FD2) },
8664 { PREFIX_TABLE (PREFIX_VEX_0FD3) },
8665 { PREFIX_TABLE (PREFIX_VEX_0FD4) },
8666 { PREFIX_TABLE (PREFIX_VEX_0FD5) },
8667 { PREFIX_TABLE (PREFIX_VEX_0FD6) },
8668 { PREFIX_TABLE (PREFIX_VEX_0FD7) },
c0f3af97 8669 /* d8 */
592a252b
L
8670 { PREFIX_TABLE (PREFIX_VEX_0FD8) },
8671 { PREFIX_TABLE (PREFIX_VEX_0FD9) },
8672 { PREFIX_TABLE (PREFIX_VEX_0FDA) },
8673 { PREFIX_TABLE (PREFIX_VEX_0FDB) },
8674 { PREFIX_TABLE (PREFIX_VEX_0FDC) },
8675 { PREFIX_TABLE (PREFIX_VEX_0FDD) },
8676 { PREFIX_TABLE (PREFIX_VEX_0FDE) },
8677 { PREFIX_TABLE (PREFIX_VEX_0FDF) },
c0f3af97 8678 /* e0 */
592a252b
L
8679 { PREFIX_TABLE (PREFIX_VEX_0FE0) },
8680 { PREFIX_TABLE (PREFIX_VEX_0FE1) },
8681 { PREFIX_TABLE (PREFIX_VEX_0FE2) },
8682 { PREFIX_TABLE (PREFIX_VEX_0FE3) },
8683 { PREFIX_TABLE (PREFIX_VEX_0FE4) },
8684 { PREFIX_TABLE (PREFIX_VEX_0FE5) },
8685 { PREFIX_TABLE (PREFIX_VEX_0FE6) },
8686 { PREFIX_TABLE (PREFIX_VEX_0FE7) },
c0f3af97 8687 /* e8 */
592a252b
L
8688 { PREFIX_TABLE (PREFIX_VEX_0FE8) },
8689 { PREFIX_TABLE (PREFIX_VEX_0FE9) },
8690 { PREFIX_TABLE (PREFIX_VEX_0FEA) },
8691 { PREFIX_TABLE (PREFIX_VEX_0FEB) },
8692 { PREFIX_TABLE (PREFIX_VEX_0FEC) },
8693 { PREFIX_TABLE (PREFIX_VEX_0FED) },
8694 { PREFIX_TABLE (PREFIX_VEX_0FEE) },
8695 { PREFIX_TABLE (PREFIX_VEX_0FEF) },
c0f3af97 8696 /* f0 */
592a252b
L
8697 { PREFIX_TABLE (PREFIX_VEX_0FF0) },
8698 { PREFIX_TABLE (PREFIX_VEX_0FF1) },
8699 { PREFIX_TABLE (PREFIX_VEX_0FF2) },
8700 { PREFIX_TABLE (PREFIX_VEX_0FF3) },
8701 { PREFIX_TABLE (PREFIX_VEX_0FF4) },
8702 { PREFIX_TABLE (PREFIX_VEX_0FF5) },
8703 { PREFIX_TABLE (PREFIX_VEX_0FF6) },
8704 { PREFIX_TABLE (PREFIX_VEX_0FF7) },
c0f3af97 8705 /* f8 */
592a252b
L
8706 { PREFIX_TABLE (PREFIX_VEX_0FF8) },
8707 { PREFIX_TABLE (PREFIX_VEX_0FF9) },
8708 { PREFIX_TABLE (PREFIX_VEX_0FFA) },
8709 { PREFIX_TABLE (PREFIX_VEX_0FFB) },
8710 { PREFIX_TABLE (PREFIX_VEX_0FFC) },
8711 { PREFIX_TABLE (PREFIX_VEX_0FFD) },
8712 { PREFIX_TABLE (PREFIX_VEX_0FFE) },
592d1631 8713 { Bad_Opcode },
c0f3af97
L
8714 },
8715 /* VEX_0F38 */
8716 {
8717 /* 00 */
592a252b
L
8718 { PREFIX_TABLE (PREFIX_VEX_0F3800) },
8719 { PREFIX_TABLE (PREFIX_VEX_0F3801) },
8720 { PREFIX_TABLE (PREFIX_VEX_0F3802) },
8721 { PREFIX_TABLE (PREFIX_VEX_0F3803) },
8722 { PREFIX_TABLE (PREFIX_VEX_0F3804) },
8723 { PREFIX_TABLE (PREFIX_VEX_0F3805) },
8724 { PREFIX_TABLE (PREFIX_VEX_0F3806) },
8725 { PREFIX_TABLE (PREFIX_VEX_0F3807) },
c0f3af97 8726 /* 08 */
592a252b
L
8727 { PREFIX_TABLE (PREFIX_VEX_0F3808) },
8728 { PREFIX_TABLE (PREFIX_VEX_0F3809) },
8729 { PREFIX_TABLE (PREFIX_VEX_0F380A) },
8730 { PREFIX_TABLE (PREFIX_VEX_0F380B) },
8731 { PREFIX_TABLE (PREFIX_VEX_0F380C) },
8732 { PREFIX_TABLE (PREFIX_VEX_0F380D) },
8733 { PREFIX_TABLE (PREFIX_VEX_0F380E) },
8734 { PREFIX_TABLE (PREFIX_VEX_0F380F) },
c0f3af97 8735 /* 10 */
592d1631
L
8736 { Bad_Opcode },
8737 { Bad_Opcode },
8738 { Bad_Opcode },
592a252b 8739 { PREFIX_TABLE (PREFIX_VEX_0F3813) },
592d1631
L
8740 { Bad_Opcode },
8741 { Bad_Opcode },
6c30d220 8742 { PREFIX_TABLE (PREFIX_VEX_0F3816) },
592a252b 8743 { PREFIX_TABLE (PREFIX_VEX_0F3817) },
c0f3af97 8744 /* 18 */
592a252b
L
8745 { PREFIX_TABLE (PREFIX_VEX_0F3818) },
8746 { PREFIX_TABLE (PREFIX_VEX_0F3819) },
8747 { PREFIX_TABLE (PREFIX_VEX_0F381A) },
592d1631 8748 { Bad_Opcode },
592a252b
L
8749 { PREFIX_TABLE (PREFIX_VEX_0F381C) },
8750 { PREFIX_TABLE (PREFIX_VEX_0F381D) },
8751 { PREFIX_TABLE (PREFIX_VEX_0F381E) },
592d1631 8752 { Bad_Opcode },
c0f3af97 8753 /* 20 */
592a252b
L
8754 { PREFIX_TABLE (PREFIX_VEX_0F3820) },
8755 { PREFIX_TABLE (PREFIX_VEX_0F3821) },
8756 { PREFIX_TABLE (PREFIX_VEX_0F3822) },
8757 { PREFIX_TABLE (PREFIX_VEX_0F3823) },
8758 { PREFIX_TABLE (PREFIX_VEX_0F3824) },
8759 { PREFIX_TABLE (PREFIX_VEX_0F3825) },
592d1631
L
8760 { Bad_Opcode },
8761 { Bad_Opcode },
c0f3af97 8762 /* 28 */
592a252b
L
8763 { PREFIX_TABLE (PREFIX_VEX_0F3828) },
8764 { PREFIX_TABLE (PREFIX_VEX_0F3829) },
8765 { PREFIX_TABLE (PREFIX_VEX_0F382A) },
8766 { PREFIX_TABLE (PREFIX_VEX_0F382B) },
8767 { PREFIX_TABLE (PREFIX_VEX_0F382C) },
8768 { PREFIX_TABLE (PREFIX_VEX_0F382D) },
8769 { PREFIX_TABLE (PREFIX_VEX_0F382E) },
8770 { PREFIX_TABLE (PREFIX_VEX_0F382F) },
c0f3af97 8771 /* 30 */
592a252b
L
8772 { PREFIX_TABLE (PREFIX_VEX_0F3830) },
8773 { PREFIX_TABLE (PREFIX_VEX_0F3831) },
8774 { PREFIX_TABLE (PREFIX_VEX_0F3832) },
8775 { PREFIX_TABLE (PREFIX_VEX_0F3833) },
8776 { PREFIX_TABLE (PREFIX_VEX_0F3834) },
8777 { PREFIX_TABLE (PREFIX_VEX_0F3835) },
6c30d220 8778 { PREFIX_TABLE (PREFIX_VEX_0F3836) },
592a252b 8779 { PREFIX_TABLE (PREFIX_VEX_0F3837) },
c0f3af97 8780 /* 38 */
592a252b
L
8781 { PREFIX_TABLE (PREFIX_VEX_0F3838) },
8782 { PREFIX_TABLE (PREFIX_VEX_0F3839) },
8783 { PREFIX_TABLE (PREFIX_VEX_0F383A) },
8784 { PREFIX_TABLE (PREFIX_VEX_0F383B) },
8785 { PREFIX_TABLE (PREFIX_VEX_0F383C) },
8786 { PREFIX_TABLE (PREFIX_VEX_0F383D) },
8787 { PREFIX_TABLE (PREFIX_VEX_0F383E) },
8788 { PREFIX_TABLE (PREFIX_VEX_0F383F) },
c0f3af97 8789 /* 40 */
592a252b
L
8790 { PREFIX_TABLE (PREFIX_VEX_0F3840) },
8791 { PREFIX_TABLE (PREFIX_VEX_0F3841) },
592d1631
L
8792 { Bad_Opcode },
8793 { Bad_Opcode },
8794 { Bad_Opcode },
6c30d220
L
8795 { PREFIX_TABLE (PREFIX_VEX_0F3845) },
8796 { PREFIX_TABLE (PREFIX_VEX_0F3846) },
8797 { PREFIX_TABLE (PREFIX_VEX_0F3847) },
c0f3af97 8798 /* 48 */
592d1631
L
8799 { Bad_Opcode },
8800 { Bad_Opcode },
8801 { Bad_Opcode },
8802 { Bad_Opcode },
8803 { Bad_Opcode },
8804 { Bad_Opcode },
8805 { Bad_Opcode },
8806 { Bad_Opcode },
c0f3af97 8807 /* 50 */
592d1631
L
8808 { Bad_Opcode },
8809 { Bad_Opcode },
8810 { Bad_Opcode },
8811 { Bad_Opcode },
8812 { Bad_Opcode },
8813 { Bad_Opcode },
8814 { Bad_Opcode },
8815 { Bad_Opcode },
c0f3af97 8816 /* 58 */
6c30d220
L
8817 { PREFIX_TABLE (PREFIX_VEX_0F3858) },
8818 { PREFIX_TABLE (PREFIX_VEX_0F3859) },
8819 { PREFIX_TABLE (PREFIX_VEX_0F385A) },
592d1631
L
8820 { Bad_Opcode },
8821 { Bad_Opcode },
8822 { Bad_Opcode },
8823 { Bad_Opcode },
8824 { Bad_Opcode },
c0f3af97 8825 /* 60 */
592d1631
L
8826 { Bad_Opcode },
8827 { Bad_Opcode },
8828 { Bad_Opcode },
8829 { Bad_Opcode },
8830 { Bad_Opcode },
8831 { Bad_Opcode },
8832 { Bad_Opcode },
8833 { Bad_Opcode },
c0f3af97 8834 /* 68 */
592d1631
L
8835 { Bad_Opcode },
8836 { Bad_Opcode },
8837 { Bad_Opcode },
8838 { Bad_Opcode },
8839 { Bad_Opcode },
8840 { Bad_Opcode },
8841 { Bad_Opcode },
8842 { Bad_Opcode },
c0f3af97 8843 /* 70 */
592d1631
L
8844 { Bad_Opcode },
8845 { Bad_Opcode },
8846 { Bad_Opcode },
8847 { Bad_Opcode },
8848 { Bad_Opcode },
8849 { Bad_Opcode },
8850 { Bad_Opcode },
8851 { Bad_Opcode },
c0f3af97 8852 /* 78 */
6c30d220
L
8853 { PREFIX_TABLE (PREFIX_VEX_0F3878) },
8854 { PREFIX_TABLE (PREFIX_VEX_0F3879) },
592d1631
L
8855 { Bad_Opcode },
8856 { Bad_Opcode },
8857 { Bad_Opcode },
8858 { Bad_Opcode },
8859 { Bad_Opcode },
8860 { Bad_Opcode },
c0f3af97 8861 /* 80 */
592d1631
L
8862 { Bad_Opcode },
8863 { Bad_Opcode },
8864 { Bad_Opcode },
8865 { Bad_Opcode },
8866 { Bad_Opcode },
8867 { Bad_Opcode },
8868 { Bad_Opcode },
8869 { Bad_Opcode },
c0f3af97 8870 /* 88 */
592d1631
L
8871 { Bad_Opcode },
8872 { Bad_Opcode },
8873 { Bad_Opcode },
8874 { Bad_Opcode },
6c30d220 8875 { PREFIX_TABLE (PREFIX_VEX_0F388C) },
592d1631 8876 { Bad_Opcode },
6c30d220 8877 { PREFIX_TABLE (PREFIX_VEX_0F388E) },
592d1631 8878 { Bad_Opcode },
c0f3af97 8879 /* 90 */
6c30d220
L
8880 { PREFIX_TABLE (PREFIX_VEX_0F3890) },
8881 { PREFIX_TABLE (PREFIX_VEX_0F3891) },
8882 { PREFIX_TABLE (PREFIX_VEX_0F3892) },
8883 { PREFIX_TABLE (PREFIX_VEX_0F3893) },
592d1631
L
8884 { Bad_Opcode },
8885 { Bad_Opcode },
592a252b
L
8886 { PREFIX_TABLE (PREFIX_VEX_0F3896) },
8887 { PREFIX_TABLE (PREFIX_VEX_0F3897) },
c0f3af97 8888 /* 98 */
592a252b
L
8889 { PREFIX_TABLE (PREFIX_VEX_0F3898) },
8890 { PREFIX_TABLE (PREFIX_VEX_0F3899) },
8891 { PREFIX_TABLE (PREFIX_VEX_0F389A) },
8892 { PREFIX_TABLE (PREFIX_VEX_0F389B) },
8893 { PREFIX_TABLE (PREFIX_VEX_0F389C) },
8894 { PREFIX_TABLE (PREFIX_VEX_0F389D) },
8895 { PREFIX_TABLE (PREFIX_VEX_0F389E) },
8896 { PREFIX_TABLE (PREFIX_VEX_0F389F) },
c0f3af97 8897 /* a0 */
592d1631
L
8898 { Bad_Opcode },
8899 { Bad_Opcode },
8900 { Bad_Opcode },
8901 { Bad_Opcode },
8902 { Bad_Opcode },
8903 { Bad_Opcode },
592a252b
L
8904 { PREFIX_TABLE (PREFIX_VEX_0F38A6) },
8905 { PREFIX_TABLE (PREFIX_VEX_0F38A7) },
c0f3af97 8906 /* a8 */
592a252b
L
8907 { PREFIX_TABLE (PREFIX_VEX_0F38A8) },
8908 { PREFIX_TABLE (PREFIX_VEX_0F38A9) },
8909 { PREFIX_TABLE (PREFIX_VEX_0F38AA) },
8910 { PREFIX_TABLE (PREFIX_VEX_0F38AB) },
8911 { PREFIX_TABLE (PREFIX_VEX_0F38AC) },
8912 { PREFIX_TABLE (PREFIX_VEX_0F38AD) },
8913 { PREFIX_TABLE (PREFIX_VEX_0F38AE) },
8914 { PREFIX_TABLE (PREFIX_VEX_0F38AF) },
c0f3af97 8915 /* b0 */
592d1631
L
8916 { Bad_Opcode },
8917 { Bad_Opcode },
8918 { Bad_Opcode },
8919 { Bad_Opcode },
8920 { Bad_Opcode },
8921 { Bad_Opcode },
592a252b
L
8922 { PREFIX_TABLE (PREFIX_VEX_0F38B6) },
8923 { PREFIX_TABLE (PREFIX_VEX_0F38B7) },
c0f3af97 8924 /* b8 */
592a252b
L
8925 { PREFIX_TABLE (PREFIX_VEX_0F38B8) },
8926 { PREFIX_TABLE (PREFIX_VEX_0F38B9) },
8927 { PREFIX_TABLE (PREFIX_VEX_0F38BA) },
8928 { PREFIX_TABLE (PREFIX_VEX_0F38BB) },
8929 { PREFIX_TABLE (PREFIX_VEX_0F38BC) },
8930 { PREFIX_TABLE (PREFIX_VEX_0F38BD) },
8931 { PREFIX_TABLE (PREFIX_VEX_0F38BE) },
8932 { PREFIX_TABLE (PREFIX_VEX_0F38BF) },
c0f3af97 8933 /* c0 */
592d1631
L
8934 { Bad_Opcode },
8935 { Bad_Opcode },
8936 { Bad_Opcode },
8937 { Bad_Opcode },
8938 { Bad_Opcode },
8939 { Bad_Opcode },
8940 { Bad_Opcode },
8941 { Bad_Opcode },
c0f3af97 8942 /* c8 */
592d1631
L
8943 { Bad_Opcode },
8944 { Bad_Opcode },
8945 { Bad_Opcode },
8946 { Bad_Opcode },
8947 { Bad_Opcode },
8948 { Bad_Opcode },
8949 { Bad_Opcode },
48521003 8950 { PREFIX_TABLE (PREFIX_VEX_0F38CF) },
c0f3af97 8951 /* d0 */
592d1631
L
8952 { Bad_Opcode },
8953 { Bad_Opcode },
8954 { Bad_Opcode },
8955 { Bad_Opcode },
8956 { Bad_Opcode },
8957 { Bad_Opcode },
8958 { Bad_Opcode },
8959 { Bad_Opcode },
c0f3af97 8960 /* d8 */
592d1631
L
8961 { Bad_Opcode },
8962 { Bad_Opcode },
8963 { Bad_Opcode },
592a252b
L
8964 { PREFIX_TABLE (PREFIX_VEX_0F38DB) },
8965 { PREFIX_TABLE (PREFIX_VEX_0F38DC) },
8966 { PREFIX_TABLE (PREFIX_VEX_0F38DD) },
8967 { PREFIX_TABLE (PREFIX_VEX_0F38DE) },
8968 { PREFIX_TABLE (PREFIX_VEX_0F38DF) },
c0f3af97 8969 /* e0 */
592d1631
L
8970 { Bad_Opcode },
8971 { Bad_Opcode },
8972 { Bad_Opcode },
8973 { Bad_Opcode },
8974 { Bad_Opcode },
8975 { Bad_Opcode },
8976 { Bad_Opcode },
8977 { Bad_Opcode },
c0f3af97 8978 /* e8 */
592d1631
L
8979 { Bad_Opcode },
8980 { Bad_Opcode },
8981 { Bad_Opcode },
8982 { Bad_Opcode },
8983 { Bad_Opcode },
8984 { Bad_Opcode },
8985 { Bad_Opcode },
8986 { Bad_Opcode },
c0f3af97 8987 /* f0 */
592d1631
L
8988 { Bad_Opcode },
8989 { Bad_Opcode },
f12dc422
L
8990 { PREFIX_TABLE (PREFIX_VEX_0F38F2) },
8991 { REG_TABLE (REG_VEX_0F38F3) },
592d1631 8992 { Bad_Opcode },
6c30d220
L
8993 { PREFIX_TABLE (PREFIX_VEX_0F38F5) },
8994 { PREFIX_TABLE (PREFIX_VEX_0F38F6) },
f12dc422 8995 { PREFIX_TABLE (PREFIX_VEX_0F38F7) },
c0f3af97 8996 /* f8 */
592d1631
L
8997 { Bad_Opcode },
8998 { Bad_Opcode },
8999 { Bad_Opcode },
9000 { Bad_Opcode },
9001 { Bad_Opcode },
9002 { Bad_Opcode },
9003 { Bad_Opcode },
9004 { Bad_Opcode },
c0f3af97
L
9005 },
9006 /* VEX_0F3A */
9007 {
9008 /* 00 */
6c30d220
L
9009 { PREFIX_TABLE (PREFIX_VEX_0F3A00) },
9010 { PREFIX_TABLE (PREFIX_VEX_0F3A01) },
9011 { PREFIX_TABLE (PREFIX_VEX_0F3A02) },
592d1631 9012 { Bad_Opcode },
592a252b
L
9013 { PREFIX_TABLE (PREFIX_VEX_0F3A04) },
9014 { PREFIX_TABLE (PREFIX_VEX_0F3A05) },
9015 { PREFIX_TABLE (PREFIX_VEX_0F3A06) },
592d1631 9016 { Bad_Opcode },
c0f3af97 9017 /* 08 */
592a252b
L
9018 { PREFIX_TABLE (PREFIX_VEX_0F3A08) },
9019 { PREFIX_TABLE (PREFIX_VEX_0F3A09) },
9020 { PREFIX_TABLE (PREFIX_VEX_0F3A0A) },
9021 { PREFIX_TABLE (PREFIX_VEX_0F3A0B) },
9022 { PREFIX_TABLE (PREFIX_VEX_0F3A0C) },
9023 { PREFIX_TABLE (PREFIX_VEX_0F3A0D) },
9024 { PREFIX_TABLE (PREFIX_VEX_0F3A0E) },
9025 { PREFIX_TABLE (PREFIX_VEX_0F3A0F) },
c0f3af97 9026 /* 10 */
592d1631
L
9027 { Bad_Opcode },
9028 { Bad_Opcode },
9029 { Bad_Opcode },
9030 { Bad_Opcode },
592a252b
L
9031 { PREFIX_TABLE (PREFIX_VEX_0F3A14) },
9032 { PREFIX_TABLE (PREFIX_VEX_0F3A15) },
9033 { PREFIX_TABLE (PREFIX_VEX_0F3A16) },
9034 { PREFIX_TABLE (PREFIX_VEX_0F3A17) },
c0f3af97 9035 /* 18 */
592a252b
L
9036 { PREFIX_TABLE (PREFIX_VEX_0F3A18) },
9037 { PREFIX_TABLE (PREFIX_VEX_0F3A19) },
592d1631
L
9038 { Bad_Opcode },
9039 { Bad_Opcode },
9040 { Bad_Opcode },
592a252b 9041 { PREFIX_TABLE (PREFIX_VEX_0F3A1D) },
592d1631
L
9042 { Bad_Opcode },
9043 { Bad_Opcode },
c0f3af97 9044 /* 20 */
592a252b
L
9045 { PREFIX_TABLE (PREFIX_VEX_0F3A20) },
9046 { PREFIX_TABLE (PREFIX_VEX_0F3A21) },
9047 { PREFIX_TABLE (PREFIX_VEX_0F3A22) },
592d1631
L
9048 { Bad_Opcode },
9049 { Bad_Opcode },
9050 { Bad_Opcode },
9051 { Bad_Opcode },
9052 { Bad_Opcode },
c0f3af97 9053 /* 28 */
592d1631
L
9054 { Bad_Opcode },
9055 { Bad_Opcode },
9056 { Bad_Opcode },
9057 { Bad_Opcode },
9058 { Bad_Opcode },
9059 { Bad_Opcode },
9060 { Bad_Opcode },
9061 { Bad_Opcode },
c0f3af97 9062 /* 30 */
43234a1e 9063 { PREFIX_TABLE (PREFIX_VEX_0F3A30) },
1ba585e8 9064 { PREFIX_TABLE (PREFIX_VEX_0F3A31) },
43234a1e 9065 { PREFIX_TABLE (PREFIX_VEX_0F3A32) },
1ba585e8 9066 { PREFIX_TABLE (PREFIX_VEX_0F3A33) },
592d1631
L
9067 { Bad_Opcode },
9068 { Bad_Opcode },
9069 { Bad_Opcode },
9070 { Bad_Opcode },
c0f3af97 9071 /* 38 */
6c30d220
L
9072 { PREFIX_TABLE (PREFIX_VEX_0F3A38) },
9073 { PREFIX_TABLE (PREFIX_VEX_0F3A39) },
592d1631
L
9074 { Bad_Opcode },
9075 { Bad_Opcode },
9076 { Bad_Opcode },
9077 { Bad_Opcode },
9078 { Bad_Opcode },
9079 { Bad_Opcode },
c0f3af97 9080 /* 40 */
592a252b
L
9081 { PREFIX_TABLE (PREFIX_VEX_0F3A40) },
9082 { PREFIX_TABLE (PREFIX_VEX_0F3A41) },
9083 { PREFIX_TABLE (PREFIX_VEX_0F3A42) },
592d1631 9084 { Bad_Opcode },
592a252b 9085 { PREFIX_TABLE (PREFIX_VEX_0F3A44) },
592d1631 9086 { Bad_Opcode },
6c30d220 9087 { PREFIX_TABLE (PREFIX_VEX_0F3A46) },
592d1631 9088 { Bad_Opcode },
c0f3af97 9089 /* 48 */
592a252b
L
9090 { PREFIX_TABLE (PREFIX_VEX_0F3A48) },
9091 { PREFIX_TABLE (PREFIX_VEX_0F3A49) },
9092 { PREFIX_TABLE (PREFIX_VEX_0F3A4A) },
9093 { PREFIX_TABLE (PREFIX_VEX_0F3A4B) },
9094 { PREFIX_TABLE (PREFIX_VEX_0F3A4C) },
592d1631
L
9095 { Bad_Opcode },
9096 { Bad_Opcode },
9097 { Bad_Opcode },
c0f3af97 9098 /* 50 */
592d1631
L
9099 { Bad_Opcode },
9100 { Bad_Opcode },
9101 { Bad_Opcode },
9102 { Bad_Opcode },
9103 { Bad_Opcode },
9104 { Bad_Opcode },
9105 { Bad_Opcode },
9106 { Bad_Opcode },
c0f3af97 9107 /* 58 */
592d1631
L
9108 { Bad_Opcode },
9109 { Bad_Opcode },
9110 { Bad_Opcode },
9111 { Bad_Opcode },
592a252b
L
9112 { PREFIX_TABLE (PREFIX_VEX_0F3A5C) },
9113 { PREFIX_TABLE (PREFIX_VEX_0F3A5D) },
9114 { PREFIX_TABLE (PREFIX_VEX_0F3A5E) },
9115 { PREFIX_TABLE (PREFIX_VEX_0F3A5F) },
c0f3af97 9116 /* 60 */
592a252b
L
9117 { PREFIX_TABLE (PREFIX_VEX_0F3A60) },
9118 { PREFIX_TABLE (PREFIX_VEX_0F3A61) },
9119 { PREFIX_TABLE (PREFIX_VEX_0F3A62) },
9120 { PREFIX_TABLE (PREFIX_VEX_0F3A63) },
592d1631
L
9121 { Bad_Opcode },
9122 { Bad_Opcode },
9123 { Bad_Opcode },
9124 { Bad_Opcode },
c0f3af97 9125 /* 68 */
592a252b
L
9126 { PREFIX_TABLE (PREFIX_VEX_0F3A68) },
9127 { PREFIX_TABLE (PREFIX_VEX_0F3A69) },
9128 { PREFIX_TABLE (PREFIX_VEX_0F3A6A) },
9129 { PREFIX_TABLE (PREFIX_VEX_0F3A6B) },
9130 { PREFIX_TABLE (PREFIX_VEX_0F3A6C) },
9131 { PREFIX_TABLE (PREFIX_VEX_0F3A6D) },
9132 { PREFIX_TABLE (PREFIX_VEX_0F3A6E) },
9133 { PREFIX_TABLE (PREFIX_VEX_0F3A6F) },
c0f3af97 9134 /* 70 */
592d1631
L
9135 { Bad_Opcode },
9136 { Bad_Opcode },
9137 { Bad_Opcode },
9138 { Bad_Opcode },
9139 { Bad_Opcode },
9140 { Bad_Opcode },
9141 { Bad_Opcode },
9142 { Bad_Opcode },
c0f3af97 9143 /* 78 */
592a252b
L
9144 { PREFIX_TABLE (PREFIX_VEX_0F3A78) },
9145 { PREFIX_TABLE (PREFIX_VEX_0F3A79) },
9146 { PREFIX_TABLE (PREFIX_VEX_0F3A7A) },
9147 { PREFIX_TABLE (PREFIX_VEX_0F3A7B) },
9148 { PREFIX_TABLE (PREFIX_VEX_0F3A7C) },
9149 { PREFIX_TABLE (PREFIX_VEX_0F3A7D) },
9150 { PREFIX_TABLE (PREFIX_VEX_0F3A7E) },
9151 { PREFIX_TABLE (PREFIX_VEX_0F3A7F) },
c0f3af97 9152 /* 80 */
592d1631
L
9153 { Bad_Opcode },
9154 { Bad_Opcode },
9155 { Bad_Opcode },
9156 { Bad_Opcode },
9157 { Bad_Opcode },
9158 { Bad_Opcode },
9159 { Bad_Opcode },
9160 { Bad_Opcode },
c0f3af97 9161 /* 88 */
592d1631
L
9162 { Bad_Opcode },
9163 { Bad_Opcode },
9164 { Bad_Opcode },
9165 { Bad_Opcode },
9166 { Bad_Opcode },
9167 { Bad_Opcode },
9168 { Bad_Opcode },
9169 { Bad_Opcode },
c0f3af97 9170 /* 90 */
592d1631
L
9171 { Bad_Opcode },
9172 { Bad_Opcode },
9173 { Bad_Opcode },
9174 { Bad_Opcode },
9175 { Bad_Opcode },
9176 { Bad_Opcode },
9177 { Bad_Opcode },
9178 { Bad_Opcode },
c0f3af97 9179 /* 98 */
592d1631
L
9180 { Bad_Opcode },
9181 { Bad_Opcode },
9182 { Bad_Opcode },
9183 { Bad_Opcode },
9184 { Bad_Opcode },
9185 { Bad_Opcode },
9186 { Bad_Opcode },
9187 { Bad_Opcode },
c0f3af97 9188 /* a0 */
592d1631
L
9189 { Bad_Opcode },
9190 { Bad_Opcode },
9191 { Bad_Opcode },
9192 { Bad_Opcode },
9193 { Bad_Opcode },
9194 { Bad_Opcode },
9195 { Bad_Opcode },
9196 { Bad_Opcode },
c0f3af97 9197 /* a8 */
592d1631
L
9198 { Bad_Opcode },
9199 { Bad_Opcode },
9200 { Bad_Opcode },
9201 { Bad_Opcode },
9202 { Bad_Opcode },
9203 { Bad_Opcode },
9204 { Bad_Opcode },
9205 { Bad_Opcode },
c0f3af97 9206 /* b0 */
592d1631
L
9207 { Bad_Opcode },
9208 { Bad_Opcode },
9209 { Bad_Opcode },
9210 { Bad_Opcode },
9211 { Bad_Opcode },
9212 { Bad_Opcode },
9213 { Bad_Opcode },
9214 { Bad_Opcode },
c0f3af97 9215 /* b8 */
592d1631
L
9216 { Bad_Opcode },
9217 { Bad_Opcode },
9218 { Bad_Opcode },
9219 { Bad_Opcode },
9220 { Bad_Opcode },
9221 { Bad_Opcode },
9222 { Bad_Opcode },
9223 { Bad_Opcode },
c0f3af97 9224 /* c0 */
592d1631
L
9225 { Bad_Opcode },
9226 { Bad_Opcode },
9227 { Bad_Opcode },
9228 { Bad_Opcode },
9229 { Bad_Opcode },
9230 { Bad_Opcode },
9231 { Bad_Opcode },
9232 { Bad_Opcode },
c0f3af97 9233 /* c8 */
592d1631
L
9234 { Bad_Opcode },
9235 { Bad_Opcode },
9236 { Bad_Opcode },
9237 { Bad_Opcode },
9238 { Bad_Opcode },
9239 { Bad_Opcode },
48521003
IT
9240 { PREFIX_TABLE(PREFIX_VEX_0F3ACE) },
9241 { PREFIX_TABLE(PREFIX_VEX_0F3ACF) },
c0f3af97 9242 /* d0 */
592d1631
L
9243 { Bad_Opcode },
9244 { Bad_Opcode },
9245 { Bad_Opcode },
9246 { Bad_Opcode },
9247 { Bad_Opcode },
9248 { Bad_Opcode },
9249 { Bad_Opcode },
9250 { Bad_Opcode },
c0f3af97 9251 /* d8 */
592d1631
L
9252 { Bad_Opcode },
9253 { Bad_Opcode },
9254 { Bad_Opcode },
9255 { Bad_Opcode },
9256 { Bad_Opcode },
9257 { Bad_Opcode },
9258 { Bad_Opcode },
592a252b 9259 { PREFIX_TABLE (PREFIX_VEX_0F3ADF) },
c0f3af97 9260 /* e0 */
592d1631
L
9261 { Bad_Opcode },
9262 { Bad_Opcode },
9263 { Bad_Opcode },
9264 { Bad_Opcode },
9265 { Bad_Opcode },
9266 { Bad_Opcode },
9267 { Bad_Opcode },
9268 { Bad_Opcode },
c0f3af97 9269 /* e8 */
592d1631
L
9270 { Bad_Opcode },
9271 { Bad_Opcode },
9272 { Bad_Opcode },
9273 { Bad_Opcode },
9274 { Bad_Opcode },
9275 { Bad_Opcode },
9276 { Bad_Opcode },
9277 { Bad_Opcode },
c0f3af97 9278 /* f0 */
6c30d220 9279 { PREFIX_TABLE (PREFIX_VEX_0F3AF0) },
592d1631
L
9280 { Bad_Opcode },
9281 { Bad_Opcode },
9282 { Bad_Opcode },
9283 { Bad_Opcode },
9284 { Bad_Opcode },
9285 { Bad_Opcode },
9286 { Bad_Opcode },
c0f3af97 9287 /* f8 */
592d1631
L
9288 { Bad_Opcode },
9289 { Bad_Opcode },
9290 { Bad_Opcode },
9291 { Bad_Opcode },
9292 { Bad_Opcode },
9293 { Bad_Opcode },
9294 { Bad_Opcode },
9295 { Bad_Opcode },
c0f3af97
L
9296 },
9297};
9298
43234a1e
L
9299#define NEED_OPCODE_TABLE
9300#include "i386-dis-evex.h"
9301#undef NEED_OPCODE_TABLE
c0f3af97 9302static const struct dis386 vex_len_table[][2] = {
592a252b 9303 /* VEX_LEN_0F12_P_0_M_0 */
c0f3af97 9304 {
ec6f095a 9305 { "vmovlps", { XM, Vex128, EXq }, 0 },
c0f3af97
L
9306 },
9307
592a252b 9308 /* VEX_LEN_0F12_P_0_M_1 */
c0f3af97 9309 {
ec6f095a 9310 { "vmovhlps", { XM, Vex128, EXq }, 0 },
c0f3af97
L
9311 },
9312
592a252b 9313 /* VEX_LEN_0F12_P_2 */
c0f3af97 9314 {
ec6f095a 9315 { "vmovlpd", { XM, Vex128, EXq }, 0 },
c0f3af97
L
9316 },
9317
592a252b 9318 /* VEX_LEN_0F13_M_0 */
c0f3af97 9319 {
ec6f095a 9320 { "vmovlpX", { EXq, XM }, 0 },
c0f3af97
L
9321 },
9322
592a252b 9323 /* VEX_LEN_0F16_P_0_M_0 */
c0f3af97 9324 {
ec6f095a 9325 { "vmovhps", { XM, Vex128, EXq }, 0 },
c0f3af97
L
9326 },
9327
592a252b 9328 /* VEX_LEN_0F16_P_0_M_1 */
c0f3af97 9329 {
ec6f095a 9330 { "vmovlhps", { XM, Vex128, EXq }, 0 },
c0f3af97
L
9331 },
9332
592a252b 9333 /* VEX_LEN_0F16_P_2 */
c0f3af97 9334 {
ec6f095a 9335 { "vmovhpd", { XM, Vex128, EXq }, 0 },
c0f3af97
L
9336 },
9337
592a252b 9338 /* VEX_LEN_0F17_M_0 */
c0f3af97 9339 {
ec6f095a 9340 { "vmovhpX", { EXq, XM }, 0 },
c0f3af97
L
9341 },
9342
592a252b 9343 /* VEX_LEN_0F2A_P_1 */
c0f3af97 9344 {
bf890a93
IT
9345 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
9346 { "vcvtsi2ss%LQ", { XMScalar, VexScalar, Ev }, 0 },
c0f3af97
L
9347 },
9348
592a252b 9349 /* VEX_LEN_0F2A_P_3 */
c0f3af97 9350 {
bf890a93
IT
9351 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
9352 { "vcvtsi2sd%LQ", { XMScalar, VexScalar, Ev }, 0 },
c0f3af97
L
9353 },
9354
592a252b 9355 /* VEX_LEN_0F2C_P_1 */
c0f3af97 9356 {
9646c87b
JB
9357 { "vcvttss2si", { Gv, EXdScalar }, 0 },
9358 { "vcvttss2si", { Gv, EXdScalar }, 0 },
c0f3af97
L
9359 },
9360
592a252b 9361 /* VEX_LEN_0F2C_P_3 */
c0f3af97 9362 {
9646c87b
JB
9363 { "vcvttsd2si", { Gv, EXqScalar }, 0 },
9364 { "vcvttsd2si", { Gv, EXqScalar }, 0 },
c0f3af97
L
9365 },
9366
592a252b 9367 /* VEX_LEN_0F2D_P_1 */
c0f3af97 9368 {
9646c87b
JB
9369 { "vcvtss2si", { Gv, EXdScalar }, 0 },
9370 { "vcvtss2si", { Gv, EXdScalar }, 0 },
c0f3af97
L
9371 },
9372
592a252b 9373 /* VEX_LEN_0F2D_P_3 */
c0f3af97 9374 {
9646c87b
JB
9375 { "vcvtsd2si", { Gv, EXqScalar }, 0 },
9376 { "vcvtsd2si", { Gv, EXqScalar }, 0 },
c0f3af97
L
9377 },
9378
43234a1e
L
9379 /* VEX_LEN_0F41_P_0 */
9380 {
9381 { Bad_Opcode },
9382 { VEX_W_TABLE (VEX_W_0F41_P_0_LEN_1) },
9383 },
1ba585e8
IT
9384 /* VEX_LEN_0F41_P_2 */
9385 {
9386 { Bad_Opcode },
9387 { VEX_W_TABLE (VEX_W_0F41_P_2_LEN_1) },
9388 },
43234a1e
L
9389 /* VEX_LEN_0F42_P_0 */
9390 {
9391 { Bad_Opcode },
9392 { VEX_W_TABLE (VEX_W_0F42_P_0_LEN_1) },
9393 },
1ba585e8
IT
9394 /* VEX_LEN_0F42_P_2 */
9395 {
9396 { Bad_Opcode },
9397 { VEX_W_TABLE (VEX_W_0F42_P_2_LEN_1) },
9398 },
43234a1e
L
9399 /* VEX_LEN_0F44_P_0 */
9400 {
9401 { VEX_W_TABLE (VEX_W_0F44_P_0_LEN_0) },
9402 },
1ba585e8
IT
9403 /* VEX_LEN_0F44_P_2 */
9404 {
9405 { VEX_W_TABLE (VEX_W_0F44_P_2_LEN_0) },
9406 },
43234a1e
L
9407 /* VEX_LEN_0F45_P_0 */
9408 {
9409 { Bad_Opcode },
9410 { VEX_W_TABLE (VEX_W_0F45_P_0_LEN_1) },
9411 },
1ba585e8
IT
9412 /* VEX_LEN_0F45_P_2 */
9413 {
9414 { Bad_Opcode },
9415 { VEX_W_TABLE (VEX_W_0F45_P_2_LEN_1) },
9416 },
43234a1e
L
9417 /* VEX_LEN_0F46_P_0 */
9418 {
9419 { Bad_Opcode },
9420 { VEX_W_TABLE (VEX_W_0F46_P_0_LEN_1) },
9421 },
1ba585e8
IT
9422 /* VEX_LEN_0F46_P_2 */
9423 {
9424 { Bad_Opcode },
9425 { VEX_W_TABLE (VEX_W_0F46_P_2_LEN_1) },
9426 },
43234a1e
L
9427 /* VEX_LEN_0F47_P_0 */
9428 {
9429 { Bad_Opcode },
9430 { VEX_W_TABLE (VEX_W_0F47_P_0_LEN_1) },
9431 },
1ba585e8
IT
9432 /* VEX_LEN_0F47_P_2 */
9433 {
9434 { Bad_Opcode },
9435 { VEX_W_TABLE (VEX_W_0F47_P_2_LEN_1) },
9436 },
9437 /* VEX_LEN_0F4A_P_0 */
9438 {
9439 { Bad_Opcode },
9440 { VEX_W_TABLE (VEX_W_0F4A_P_0_LEN_1) },
9441 },
9442 /* VEX_LEN_0F4A_P_2 */
9443 {
9444 { Bad_Opcode },
9445 { VEX_W_TABLE (VEX_W_0F4A_P_2_LEN_1) },
9446 },
9447 /* VEX_LEN_0F4B_P_0 */
9448 {
9449 { Bad_Opcode },
9450 { VEX_W_TABLE (VEX_W_0F4B_P_0_LEN_1) },
9451 },
43234a1e
L
9452 /* VEX_LEN_0F4B_P_2 */
9453 {
9454 { Bad_Opcode },
9455 { VEX_W_TABLE (VEX_W_0F4B_P_2_LEN_1) },
9456 },
9457
ec6f095a 9458 /* VEX_LEN_0F6E_P_2 */
c0f3af97 9459 {
ec6f095a 9460 { "vmovK", { XMScalar, Edq }, 0 },
c0f3af97
L
9461 },
9462
ec6f095a 9463 /* VEX_LEN_0F77_P_1 */
c0f3af97 9464 {
ec6f095a
L
9465 { "vzeroupper", { XX }, 0 },
9466 { "vzeroall", { XX }, 0 },
c0f3af97
L
9467 },
9468
ec6f095a 9469 /* VEX_LEN_0F7E_P_1 */
c0f3af97 9470 {
ec6f095a 9471 { "vmovq", { XMScalar, EXqScalar }, 0 },
c0f3af97
L
9472 },
9473
ec6f095a 9474 /* VEX_LEN_0F7E_P_2 */
c0f3af97 9475 {
ec6f095a 9476 { "vmovK", { Edq, XMScalar }, 0 },
c0f3af97
L
9477 },
9478
ec6f095a 9479 /* VEX_LEN_0F90_P_0 */
c0f3af97 9480 {
ec6f095a 9481 { VEX_W_TABLE (VEX_W_0F90_P_0_LEN_0) },
c0f3af97
L
9482 },
9483
ec6f095a 9484 /* VEX_LEN_0F90_P_2 */
c0f3af97 9485 {
ec6f095a 9486 { VEX_W_TABLE (VEX_W_0F90_P_2_LEN_0) },
c0f3af97
L
9487 },
9488
ec6f095a 9489 /* VEX_LEN_0F91_P_0 */
c0f3af97 9490 {
ec6f095a 9491 { VEX_W_TABLE (VEX_W_0F91_P_0_LEN_0) },
c0f3af97
L
9492 },
9493
ec6f095a 9494 /* VEX_LEN_0F91_P_2 */
c0f3af97 9495 {
ec6f095a 9496 { VEX_W_TABLE (VEX_W_0F91_P_2_LEN_0) },
c0f3af97
L
9497 },
9498
ec6f095a 9499 /* VEX_LEN_0F92_P_0 */
c0f3af97 9500 {
ec6f095a 9501 { VEX_W_TABLE (VEX_W_0F92_P_0_LEN_0) },
c0f3af97
L
9502 },
9503
ec6f095a 9504 /* VEX_LEN_0F92_P_2 */
c0f3af97 9505 {
ec6f095a 9506 { VEX_W_TABLE (VEX_W_0F92_P_2_LEN_0) },
c0f3af97
L
9507 },
9508
ec6f095a 9509 /* VEX_LEN_0F92_P_3 */
c0f3af97 9510 {
58a211d2 9511 { MOD_TABLE (MOD_VEX_0F92_P_3_LEN_0) },
c0f3af97
L
9512 },
9513
ec6f095a 9514 /* VEX_LEN_0F93_P_0 */
c0f3af97 9515 {
ec6f095a 9516 { VEX_W_TABLE (VEX_W_0F93_P_0_LEN_0) },
c0f3af97
L
9517 },
9518
ec6f095a 9519 /* VEX_LEN_0F93_P_2 */
c0f3af97 9520 {
ec6f095a 9521 { VEX_W_TABLE (VEX_W_0F93_P_2_LEN_0) },
c0f3af97
L
9522 },
9523
ec6f095a 9524 /* VEX_LEN_0F93_P_3 */
c0f3af97 9525 {
58a211d2 9526 { MOD_TABLE (MOD_VEX_0F93_P_3_LEN_0) },
c0f3af97
L
9527 },
9528
ec6f095a 9529 /* VEX_LEN_0F98_P_0 */
43234a1e
L
9530 {
9531 { VEX_W_TABLE (VEX_W_0F98_P_0_LEN_0) },
9532 },
9533
1ba585e8
IT
9534 /* VEX_LEN_0F98_P_2 */
9535 {
9536 { VEX_W_TABLE (VEX_W_0F98_P_2_LEN_0) },
9537 },
9538
9539 /* VEX_LEN_0F99_P_0 */
9540 {
9541 { VEX_W_TABLE (VEX_W_0F99_P_0_LEN_0) },
9542 },
9543
9544 /* VEX_LEN_0F99_P_2 */
9545 {
9546 { VEX_W_TABLE (VEX_W_0F99_P_2_LEN_0) },
9547 },
9548
6c30d220 9549 /* VEX_LEN_0FAE_R_2_M_0 */
c0f3af97 9550 {
ec6f095a 9551 { "vldmxcsr", { Md }, 0 },
c0f3af97
L
9552 },
9553
6c30d220 9554 /* VEX_LEN_0FAE_R_3_M_0 */
c0f3af97 9555 {
ec6f095a 9556 { "vstmxcsr", { Md }, 0 },
c0f3af97
L
9557 },
9558
6c30d220 9559 /* VEX_LEN_0FC4_P_2 */
c0f3af97 9560 {
b50c9f31 9561 { "vpinsrw", { XM, Vex128, Edqw, Ib }, 0 },
c0f3af97
L
9562 },
9563
6c30d220 9564 /* VEX_LEN_0FC5_P_2 */
c0f3af97 9565 {
b50c9f31 9566 { "vpextrw", { Gdq, XS, Ib }, 0 },
c0f3af97
L
9567 },
9568
6c30d220 9569 /* VEX_LEN_0FD6_P_2 */
c0f3af97 9570 {
ec6f095a 9571 { "vmovq", { EXqScalarS, XMScalar }, 0 },
c0f3af97
L
9572 },
9573
6c30d220 9574 /* VEX_LEN_0FF7_P_2 */
c0f3af97 9575 {
ec6f095a 9576 { "vmaskmovdqu", { XM, XS }, 0 },
c0f3af97
L
9577 },
9578
6c30d220 9579 /* VEX_LEN_0F3816_P_2 */
c0f3af97 9580 {
6c30d220
L
9581 { Bad_Opcode },
9582 { VEX_W_TABLE (VEX_W_0F3816_P_2) },
c0f3af97
L
9583 },
9584
6c30d220 9585 /* VEX_LEN_0F3819_P_2 */
c0f3af97 9586 {
6c30d220
L
9587 { Bad_Opcode },
9588 { VEX_W_TABLE (VEX_W_0F3819_P_2) },
c0f3af97
L
9589 },
9590
6c30d220 9591 /* VEX_LEN_0F381A_P_2_M_0 */
c0f3af97 9592 {
6c30d220
L
9593 { Bad_Opcode },
9594 { VEX_W_TABLE (VEX_W_0F381A_P_2_M_0) },
c0f3af97
L
9595 },
9596
6c30d220 9597 /* VEX_LEN_0F3836_P_2 */
c0f3af97 9598 {
6c30d220
L
9599 { Bad_Opcode },
9600 { VEX_W_TABLE (VEX_W_0F3836_P_2) },
c0f3af97
L
9601 },
9602
592a252b 9603 /* VEX_LEN_0F3841_P_2 */
c0f3af97 9604 {
ec6f095a 9605 { "vphminposuw", { XM, EXx }, 0 },
c0f3af97
L
9606 },
9607
6c30d220
L
9608 /* VEX_LEN_0F385A_P_2_M_0 */
9609 {
9610 { Bad_Opcode },
9611 { VEX_W_TABLE (VEX_W_0F385A_P_2_M_0) },
9612 },
9613
592a252b 9614 /* VEX_LEN_0F38DB_P_2 */
a5ff0eb2 9615 {
ec6f095a 9616 { "vaesimc", { XM, EXx }, 0 },
a5ff0eb2
L
9617 },
9618
f12dc422
L
9619 /* VEX_LEN_0F38F2_P_0 */
9620 {
bf890a93 9621 { "andnS", { Gdq, VexGdq, Edq }, 0 },
f12dc422
L
9622 },
9623
9624 /* VEX_LEN_0F38F3_R_1_P_0 */
9625 {
bf890a93 9626 { "blsrS", { VexGdq, Edq }, 0 },
f12dc422
L
9627 },
9628
9629 /* VEX_LEN_0F38F3_R_2_P_0 */
9630 {
bf890a93 9631 { "blsmskS", { VexGdq, Edq }, 0 },
f12dc422
L
9632 },
9633
9634 /* VEX_LEN_0F38F3_R_3_P_0 */
9635 {
bf890a93 9636 { "blsiS", { VexGdq, Edq }, 0 },
f12dc422
L
9637 },
9638
6c30d220
L
9639 /* VEX_LEN_0F38F5_P_0 */
9640 {
bf890a93 9641 { "bzhiS", { Gdq, Edq, VexGdq }, 0 },
6c30d220
L
9642 },
9643
9644 /* VEX_LEN_0F38F5_P_1 */
9645 {
bf890a93 9646 { "pextS", { Gdq, VexGdq, Edq }, 0 },
6c30d220
L
9647 },
9648
9649 /* VEX_LEN_0F38F5_P_3 */
9650 {
bf890a93 9651 { "pdepS", { Gdq, VexGdq, Edq }, 0 },
6c30d220
L
9652 },
9653
9654 /* VEX_LEN_0F38F6_P_3 */
9655 {
bf890a93 9656 { "mulxS", { Gdq, VexGdq, Edq }, 0 },
6c30d220
L
9657 },
9658
f12dc422
L
9659 /* VEX_LEN_0F38F7_P_0 */
9660 {
bf890a93 9661 { "bextrS", { Gdq, Edq, VexGdq }, 0 },
f12dc422
L
9662 },
9663
6c30d220
L
9664 /* VEX_LEN_0F38F7_P_1 */
9665 {
bf890a93 9666 { "sarxS", { Gdq, Edq, VexGdq }, 0 },
6c30d220
L
9667 },
9668
9669 /* VEX_LEN_0F38F7_P_2 */
9670 {
bf890a93 9671 { "shlxS", { Gdq, Edq, VexGdq }, 0 },
6c30d220
L
9672 },
9673
9674 /* VEX_LEN_0F38F7_P_3 */
9675 {
bf890a93 9676 { "shrxS", { Gdq, Edq, VexGdq }, 0 },
6c30d220
L
9677 },
9678
9679 /* VEX_LEN_0F3A00_P_2 */
9680 {
9681 { Bad_Opcode },
9682 { VEX_W_TABLE (VEX_W_0F3A00_P_2) },
9683 },
9684
9685 /* VEX_LEN_0F3A01_P_2 */
9686 {
9687 { Bad_Opcode },
9688 { VEX_W_TABLE (VEX_W_0F3A01_P_2) },
9689 },
9690
592a252b 9691 /* VEX_LEN_0F3A06_P_2 */
c0f3af97 9692 {
592d1631 9693 { Bad_Opcode },
592a252b 9694 { VEX_W_TABLE (VEX_W_0F3A06_P_2) },
c0f3af97
L
9695 },
9696
592a252b 9697 /* VEX_LEN_0F3A14_P_2 */
c0f3af97 9698 {
b50c9f31 9699 { "vpextrb", { Edqb, XM, Ib }, 0 },
c0f3af97
L
9700 },
9701
592a252b 9702 /* VEX_LEN_0F3A15_P_2 */
c0f3af97 9703 {
b50c9f31 9704 { "vpextrw", { Edqw, XM, Ib }, 0 },
c0f3af97
L
9705 },
9706
592a252b 9707 /* VEX_LEN_0F3A16_P_2 */
c0f3af97 9708 {
bf890a93 9709 { "vpextrK", { Edq, XM, Ib }, 0 },
c0f3af97
L
9710 },
9711
592a252b 9712 /* VEX_LEN_0F3A17_P_2 */
c0f3af97 9713 {
bf890a93 9714 { "vextractps", { Edqd, XM, Ib }, 0 },
c0f3af97
L
9715 },
9716
592a252b 9717 /* VEX_LEN_0F3A18_P_2 */
c0f3af97 9718 {
592d1631 9719 { Bad_Opcode },
592a252b 9720 { VEX_W_TABLE (VEX_W_0F3A18_P_2) },
c0f3af97
L
9721 },
9722
592a252b 9723 /* VEX_LEN_0F3A19_P_2 */
c0f3af97 9724 {
592d1631 9725 { Bad_Opcode },
592a252b 9726 { VEX_W_TABLE (VEX_W_0F3A19_P_2) },
c0f3af97
L
9727 },
9728
592a252b 9729 /* VEX_LEN_0F3A20_P_2 */
c0f3af97 9730 {
b50c9f31 9731 { "vpinsrb", { XM, Vex128, Edqb, Ib }, 0 },
c0f3af97
L
9732 },
9733
592a252b 9734 /* VEX_LEN_0F3A21_P_2 */
c0f3af97 9735 {
ec6f095a 9736 { "vinsertps", { XM, Vex128, EXd, Ib }, 0 },
c0f3af97
L
9737 },
9738
592a252b 9739 /* VEX_LEN_0F3A22_P_2 */
c0f3af97 9740 {
bf890a93 9741 { "vpinsrK", { XM, Vex128, Edq, Ib }, 0 },
c0f3af97
L
9742 },
9743
43234a1e
L
9744 /* VEX_LEN_0F3A30_P_2 */
9745 {
9746 { VEX_W_TABLE (VEX_W_0F3A30_P_2_LEN_0) },
9747 },
9748
1ba585e8
IT
9749 /* VEX_LEN_0F3A31_P_2 */
9750 {
9751 { VEX_W_TABLE (VEX_W_0F3A31_P_2_LEN_0) },
9752 },
9753
43234a1e
L
9754 /* VEX_LEN_0F3A32_P_2 */
9755 {
9756 { VEX_W_TABLE (VEX_W_0F3A32_P_2_LEN_0) },
9757 },
9758
1ba585e8
IT
9759 /* VEX_LEN_0F3A33_P_2 */
9760 {
9761 { VEX_W_TABLE (VEX_W_0F3A33_P_2_LEN_0) },
9762 },
9763
6c30d220 9764 /* VEX_LEN_0F3A38_P_2 */
c0f3af97 9765 {
6c30d220
L
9766 { Bad_Opcode },
9767 { VEX_W_TABLE (VEX_W_0F3A38_P_2) },
c0f3af97
L
9768 },
9769
6c30d220 9770 /* VEX_LEN_0F3A39_P_2 */
c0f3af97 9771 {
6c30d220
L
9772 { Bad_Opcode },
9773 { VEX_W_TABLE (VEX_W_0F3A39_P_2) },
9774 },
9775
9776 /* VEX_LEN_0F3A41_P_2 */
9777 {
ec6f095a 9778 { "vdppd", { XM, Vex128, EXx, Ib }, 0 },
c0f3af97
L
9779 },
9780
6c30d220 9781 /* VEX_LEN_0F3A46_P_2 */
c0f3af97 9782 {
6c30d220
L
9783 { Bad_Opcode },
9784 { VEX_W_TABLE (VEX_W_0F3A46_P_2) },
c0f3af97
L
9785 },
9786
592a252b 9787 /* VEX_LEN_0F3A60_P_2 */
c0f3af97 9788 {
15c7c1d8 9789 { "vpcmpestrm", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
c0f3af97
L
9790 },
9791
592a252b 9792 /* VEX_LEN_0F3A61_P_2 */
c0f3af97 9793 {
15c7c1d8 9794 { "vpcmpestri", { XM, { PCMPESTR_Fixup, x_mode }, Ib }, 0 },
c0f3af97
L
9795 },
9796
592a252b 9797 /* VEX_LEN_0F3A62_P_2 */
c0f3af97 9798 {
ec6f095a 9799 { "vpcmpistrm", { XM, EXx, Ib }, 0 },
c0f3af97
L
9800 },
9801
592a252b 9802 /* VEX_LEN_0F3A63_P_2 */
c0f3af97 9803 {
ec6f095a 9804 { "vpcmpistri", { XM, EXx, Ib }, 0 },
c0f3af97
L
9805 },
9806
592a252b 9807 /* VEX_LEN_0F3A6A_P_2 */
922d8de8 9808 {
3a2430e0 9809 { "vfmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
922d8de8
DR
9810 },
9811
592a252b 9812 /* VEX_LEN_0F3A6B_P_2 */
922d8de8 9813 {
3a2430e0 9814 { "vfmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
922d8de8
DR
9815 },
9816
592a252b 9817 /* VEX_LEN_0F3A6E_P_2 */
922d8de8 9818 {
3a2430e0 9819 { "vfmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
922d8de8
DR
9820 },
9821
592a252b 9822 /* VEX_LEN_0F3A6F_P_2 */
922d8de8 9823 {
3a2430e0 9824 { "vfmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
922d8de8
DR
9825 },
9826
592a252b 9827 /* VEX_LEN_0F3A7A_P_2 */
922d8de8 9828 {
3a2430e0 9829 { "vfnmaddss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
922d8de8
DR
9830 },
9831
592a252b 9832 /* VEX_LEN_0F3A7B_P_2 */
922d8de8 9833 {
3a2430e0 9834 { "vfnmaddsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
922d8de8
DR
9835 },
9836
592a252b 9837 /* VEX_LEN_0F3A7E_P_2 */
922d8de8 9838 {
3a2430e0 9839 { "vfnmsubss", { XMVexW, Vex128, EXdVexW, EXdVexW }, 0 },
922d8de8
DR
9840 },
9841
592a252b 9842 /* VEX_LEN_0F3A7F_P_2 */
922d8de8 9843 {
3a2430e0 9844 { "vfnmsubsd", { XMVexW, Vex128, EXqVexW, EXqVexW }, 0 },
922d8de8
DR
9845 },
9846
592a252b 9847 /* VEX_LEN_0F3ADF_P_2 */
a5ff0eb2 9848 {
ec6f095a 9849 { "vaeskeygenassist", { XM, EXx, Ib }, 0 },
a5ff0eb2 9850 },
4c807e72 9851
6c30d220
L
9852 /* VEX_LEN_0F3AF0_P_3 */
9853 {
bf890a93 9854 { "rorxS", { Gdq, Edq, Ib }, 0 },
6c30d220
L
9855 },
9856
ff688e1f
L
9857 /* VEX_LEN_0FXOP_08_CC */
9858 {
be92cb14 9859 { "vpcomb", { XM, Vex128, EXx, VPCOM }, 0 },
ff688e1f
L
9860 },
9861
9862 /* VEX_LEN_0FXOP_08_CD */
9863 {
be92cb14 9864 { "vpcomw", { XM, Vex128, EXx, VPCOM }, 0 },
ff688e1f
L
9865 },
9866
9867 /* VEX_LEN_0FXOP_08_CE */
9868 {
be92cb14 9869 { "vpcomd", { XM, Vex128, EXx, VPCOM }, 0 },
ff688e1f
L
9870 },
9871
9872 /* VEX_LEN_0FXOP_08_CF */
9873 {
be92cb14 9874 { "vpcomq", { XM, Vex128, EXx, VPCOM }, 0 },
ff688e1f
L
9875 },
9876
9877 /* VEX_LEN_0FXOP_08_EC */
9878 {
be92cb14 9879 { "vpcomub", { XM, Vex128, EXx, VPCOM }, 0 },
ff688e1f
L
9880 },
9881
9882 /* VEX_LEN_0FXOP_08_ED */
9883 {
be92cb14 9884 { "vpcomuw", { XM, Vex128, EXx, VPCOM }, 0 },
ff688e1f
L
9885 },
9886
9887 /* VEX_LEN_0FXOP_08_EE */
9888 {
be92cb14 9889 { "vpcomud", { XM, Vex128, EXx, VPCOM }, 0 },
ff688e1f
L
9890 },
9891
9892 /* VEX_LEN_0FXOP_08_EF */
9893 {
be92cb14 9894 { "vpcomuq", { XM, Vex128, EXx, VPCOM }, 0 },
ff688e1f
L
9895 },
9896
592a252b 9897 /* VEX_LEN_0FXOP_09_80 */
5dd85c99 9898 {
bf890a93
IT
9899 { "vfrczps", { XM, EXxmm }, 0 },
9900 { "vfrczps", { XM, EXymmq }, 0 },
5dd85c99 9901 },
4c807e72 9902
592a252b 9903 /* VEX_LEN_0FXOP_09_81 */
5dd85c99 9904 {
bf890a93
IT
9905 { "vfrczpd", { XM, EXxmm }, 0 },
9906 { "vfrczpd", { XM, EXymmq }, 0 },
5dd85c99 9907 },
331d2d0d
L
9908};
9909
04e2a182
L
9910static const struct dis386 evex_len_table[][3] = {
9911#define NEED_EVEX_LEN_TABLE
9912#include "i386-dis-evex.h"
9913#undef NEED_EVEX_LEN_TABLE
9914};
9915
9e30b8e0 9916static const struct dis386 vex_w_table[][2] = {
43234a1e
L
9917 {
9918 /* VEX_W_0F41_P_0_LEN_1 */
ab4e4ed5
AF
9919 { MOD_TABLE (MOD_VEX_W_0_0F41_P_0_LEN_1) },
9920 { MOD_TABLE (MOD_VEX_W_1_0F41_P_0_LEN_1) },
1ba585e8
IT
9921 },
9922 {
9923 /* VEX_W_0F41_P_2_LEN_1 */
ab4e4ed5
AF
9924 { MOD_TABLE (MOD_VEX_W_0_0F41_P_2_LEN_1) },
9925 { MOD_TABLE (MOD_VEX_W_1_0F41_P_2_LEN_1) }
43234a1e
L
9926 },
9927 {
9928 /* VEX_W_0F42_P_0_LEN_1 */
ab4e4ed5
AF
9929 { MOD_TABLE (MOD_VEX_W_0_0F42_P_0_LEN_1) },
9930 { MOD_TABLE (MOD_VEX_W_1_0F42_P_0_LEN_1) },
1ba585e8
IT
9931 },
9932 {
9933 /* VEX_W_0F42_P_2_LEN_1 */
ab4e4ed5
AF
9934 { MOD_TABLE (MOD_VEX_W_0_0F42_P_2_LEN_1) },
9935 { MOD_TABLE (MOD_VEX_W_1_0F42_P_2_LEN_1) },
43234a1e
L
9936 },
9937 {
9938 /* VEX_W_0F44_P_0_LEN_0 */
ab4e4ed5
AF
9939 { MOD_TABLE (MOD_VEX_W_0_0F44_P_0_LEN_1) },
9940 { MOD_TABLE (MOD_VEX_W_1_0F44_P_0_LEN_1) },
1ba585e8
IT
9941 },
9942 {
9943 /* VEX_W_0F44_P_2_LEN_0 */
ab4e4ed5
AF
9944 { MOD_TABLE (MOD_VEX_W_0_0F44_P_2_LEN_1) },
9945 { MOD_TABLE (MOD_VEX_W_1_0F44_P_2_LEN_1) },
43234a1e
L
9946 },
9947 {
ec6f095a
L
9948 /* VEX_W_0F45_P_0_LEN_1 */
9949 { MOD_TABLE (MOD_VEX_W_0_0F45_P_0_LEN_1) },
9950 { MOD_TABLE (MOD_VEX_W_1_0F45_P_0_LEN_1) },
9e30b8e0
L
9951 },
9952 {
ec6f095a
L
9953 /* VEX_W_0F45_P_2_LEN_1 */
9954 { MOD_TABLE (MOD_VEX_W_0_0F45_P_2_LEN_1) },
9955 { MOD_TABLE (MOD_VEX_W_1_0F45_P_2_LEN_1) },
9e30b8e0
L
9956 },
9957 {
ec6f095a
L
9958 /* VEX_W_0F46_P_0_LEN_1 */
9959 { MOD_TABLE (MOD_VEX_W_0_0F46_P_0_LEN_1) },
9960 { MOD_TABLE (MOD_VEX_W_1_0F46_P_0_LEN_1) },
9e30b8e0
L
9961 },
9962 {
ec6f095a
L
9963 /* VEX_W_0F46_P_2_LEN_1 */
9964 { MOD_TABLE (MOD_VEX_W_0_0F46_P_2_LEN_1) },
9965 { MOD_TABLE (MOD_VEX_W_1_0F46_P_2_LEN_1) },
9e30b8e0
L
9966 },
9967 {
ec6f095a
L
9968 /* VEX_W_0F47_P_0_LEN_1 */
9969 { MOD_TABLE (MOD_VEX_W_0_0F47_P_0_LEN_1) },
9970 { MOD_TABLE (MOD_VEX_W_1_0F47_P_0_LEN_1) },
9e30b8e0
L
9971 },
9972 {
ec6f095a
L
9973 /* VEX_W_0F47_P_2_LEN_1 */
9974 { MOD_TABLE (MOD_VEX_W_0_0F47_P_2_LEN_1) },
9975 { MOD_TABLE (MOD_VEX_W_1_0F47_P_2_LEN_1) },
9e30b8e0
L
9976 },
9977 {
ec6f095a
L
9978 /* VEX_W_0F4A_P_0_LEN_1 */
9979 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_0_LEN_1) },
9980 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_0_LEN_1) },
9e30b8e0
L
9981 },
9982 {
ec6f095a
L
9983 /* VEX_W_0F4A_P_2_LEN_1 */
9984 { MOD_TABLE (MOD_VEX_W_0_0F4A_P_2_LEN_1) },
9985 { MOD_TABLE (MOD_VEX_W_1_0F4A_P_2_LEN_1) },
9e30b8e0
L
9986 },
9987 {
ec6f095a
L
9988 /* VEX_W_0F4B_P_0_LEN_1 */
9989 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_0_LEN_1) },
9990 { MOD_TABLE (MOD_VEX_W_1_0F4B_P_0_LEN_1) },
9e30b8e0
L
9991 },
9992 {
ec6f095a
L
9993 /* VEX_W_0F4B_P_2_LEN_1 */
9994 { MOD_TABLE (MOD_VEX_W_0_0F4B_P_2_LEN_1) },
9e30b8e0
L
9995 },
9996 {
ec6f095a
L
9997 /* VEX_W_0F90_P_0_LEN_0 */
9998 { "kmovw", { MaskG, MaskE }, 0 },
9999 { "kmovq", { MaskG, MaskE }, 0 },
9e30b8e0
L
10000 },
10001 {
ec6f095a
L
10002 /* VEX_W_0F90_P_2_LEN_0 */
10003 { "kmovb", { MaskG, MaskBDE }, 0 },
10004 { "kmovd", { MaskG, MaskBDE }, 0 },
9e30b8e0
L
10005 },
10006 {
ec6f095a
L
10007 /* VEX_W_0F91_P_0_LEN_0 */
10008 { MOD_TABLE (MOD_VEX_W_0_0F91_P_0_LEN_0) },
10009 { MOD_TABLE (MOD_VEX_W_1_0F91_P_0_LEN_0) },
9e30b8e0
L
10010 },
10011 {
ec6f095a
L
10012 /* VEX_W_0F91_P_2_LEN_0 */
10013 { MOD_TABLE (MOD_VEX_W_0_0F91_P_2_LEN_0) },
10014 { MOD_TABLE (MOD_VEX_W_1_0F91_P_2_LEN_0) },
9e30b8e0
L
10015 },
10016 {
ec6f095a
L
10017 /* VEX_W_0F92_P_0_LEN_0 */
10018 { MOD_TABLE (MOD_VEX_W_0_0F92_P_0_LEN_0) },
9e30b8e0
L
10019 },
10020 {
ec6f095a
L
10021 /* VEX_W_0F92_P_2_LEN_0 */
10022 { MOD_TABLE (MOD_VEX_W_0_0F92_P_2_LEN_0) },
9e30b8e0 10023 },
9e30b8e0 10024 {
ec6f095a
L
10025 /* VEX_W_0F93_P_0_LEN_0 */
10026 { MOD_TABLE (MOD_VEX_W_0_0F93_P_0_LEN_0) },
9e30b8e0
L
10027 },
10028 {
ec6f095a
L
10029 /* VEX_W_0F93_P_2_LEN_0 */
10030 { MOD_TABLE (MOD_VEX_W_0_0F93_P_2_LEN_0) },
9e30b8e0 10031 },
9e30b8e0 10032 {
ec6f095a
L
10033 /* VEX_W_0F98_P_0_LEN_0 */
10034 { MOD_TABLE (MOD_VEX_W_0_0F98_P_0_LEN_0) },
10035 { MOD_TABLE (MOD_VEX_W_1_0F98_P_0_LEN_0) },
9e30b8e0
L
10036 },
10037 {
ec6f095a
L
10038 /* VEX_W_0F98_P_2_LEN_0 */
10039 { MOD_TABLE (MOD_VEX_W_0_0F98_P_2_LEN_0) },
10040 { MOD_TABLE (MOD_VEX_W_1_0F98_P_2_LEN_0) },
9e30b8e0
L
10041 },
10042 {
ec6f095a
L
10043 /* VEX_W_0F99_P_0_LEN_0 */
10044 { MOD_TABLE (MOD_VEX_W_0_0F99_P_0_LEN_0) },
10045 { MOD_TABLE (MOD_VEX_W_1_0F99_P_0_LEN_0) },
9e30b8e0
L
10046 },
10047 {
ec6f095a
L
10048 /* VEX_W_0F99_P_2_LEN_0 */
10049 { MOD_TABLE (MOD_VEX_W_0_0F99_P_2_LEN_0) },
10050 { MOD_TABLE (MOD_VEX_W_1_0F99_P_2_LEN_0) },
9e30b8e0 10051 },
9e30b8e0 10052 {
592a252b 10053 /* VEX_W_0F380C_P_2 */
bf890a93 10054 { "vpermilps", { XM, Vex, EXx }, 0 },
9e30b8e0
L
10055 },
10056 {
592a252b 10057 /* VEX_W_0F380D_P_2 */
bf890a93 10058 { "vpermilpd", { XM, Vex, EXx }, 0 },
9e30b8e0
L
10059 },
10060 {
592a252b 10061 /* VEX_W_0F380E_P_2 */
bf890a93 10062 { "vtestps", { XM, EXx }, 0 },
9e30b8e0
L
10063 },
10064 {
592a252b 10065 /* VEX_W_0F380F_P_2 */
bf890a93 10066 { "vtestpd", { XM, EXx }, 0 },
9e30b8e0 10067 },
6c30d220
L
10068 {
10069 /* VEX_W_0F3816_P_2 */
bf890a93 10070 { "vpermps", { XM, Vex, EXx }, 0 },
6c30d220 10071 },
bcf2684f 10072 {
6c30d220 10073 /* VEX_W_0F3818_P_2 */
bf890a93 10074 { "vbroadcastss", { XM, EXxmm_md }, 0 },
bcf2684f 10075 },
9e30b8e0 10076 {
6c30d220 10077 /* VEX_W_0F3819_P_2 */
bf890a93 10078 { "vbroadcastsd", { XM, EXxmm_mq }, 0 },
9e30b8e0
L
10079 },
10080 {
592a252b 10081 /* VEX_W_0F381A_P_2_M_0 */
bf890a93 10082 { "vbroadcastf128", { XM, Mxmm }, 0 },
9e30b8e0 10083 },
53aa04a0 10084 {
592a252b 10085 /* VEX_W_0F382C_P_2_M_0 */
bf890a93 10086 { "vmaskmovps", { XM, Vex, Mx }, 0 },
53aa04a0
L
10087 },
10088 {
592a252b 10089 /* VEX_W_0F382D_P_2_M_0 */
bf890a93 10090 { "vmaskmovpd", { XM, Vex, Mx }, 0 },
53aa04a0
L
10091 },
10092 {
592a252b 10093 /* VEX_W_0F382E_P_2_M_0 */
bf890a93 10094 { "vmaskmovps", { Mx, Vex, XM }, 0 },
53aa04a0
L
10095 },
10096 {
592a252b 10097 /* VEX_W_0F382F_P_2_M_0 */
bf890a93 10098 { "vmaskmovpd", { Mx, Vex, XM }, 0 },
53aa04a0 10099 },
6c30d220
L
10100 {
10101 /* VEX_W_0F3836_P_2 */
bf890a93 10102 { "vpermd", { XM, Vex, EXx }, 0 },
9e30b8e0 10103 },
6c30d220
L
10104 {
10105 /* VEX_W_0F3846_P_2 */
bf890a93 10106 { "vpsravd", { XM, Vex, EXx }, 0 },
6c30d220
L
10107 },
10108 {
10109 /* VEX_W_0F3858_P_2 */
bf890a93 10110 { "vpbroadcastd", { XM, EXxmm_md }, 0 },
6c30d220
L
10111 },
10112 {
10113 /* VEX_W_0F3859_P_2 */
bf890a93 10114 { "vpbroadcastq", { XM, EXxmm_mq }, 0 },
6c30d220
L
10115 },
10116 {
10117 /* VEX_W_0F385A_P_2_M_0 */
bf890a93 10118 { "vbroadcasti128", { XM, Mxmm }, 0 },
6c30d220
L
10119 },
10120 {
10121 /* VEX_W_0F3878_P_2 */
bf890a93 10122 { "vpbroadcastb", { XM, EXxmm_mb }, 0 },
6c30d220
L
10123 },
10124 {
10125 /* VEX_W_0F3879_P_2 */
bf890a93 10126 { "vpbroadcastw", { XM, EXxmm_mw }, 0 },
6c30d220 10127 },
48521003
IT
10128 {
10129 /* VEX_W_0F38CF_P_2 */
10130 { "vgf2p8mulb", { XM, Vex, EXx }, 0 },
10131 },
6c30d220
L
10132 {
10133 /* VEX_W_0F3A00_P_2 */
10134 { Bad_Opcode },
bf890a93 10135 { "vpermq", { XM, EXx, Ib }, 0 },
6c30d220
L
10136 },
10137 {
10138 /* VEX_W_0F3A01_P_2 */
10139 { Bad_Opcode },
bf890a93 10140 { "vpermpd", { XM, EXx, Ib }, 0 },
6c30d220
L
10141 },
10142 {
10143 /* VEX_W_0F3A02_P_2 */
bf890a93 10144 { "vpblendd", { XM, Vex, EXx, Ib }, 0 },
6c30d220 10145 },
9e30b8e0 10146 {
592a252b 10147 /* VEX_W_0F3A04_P_2 */
bf890a93 10148 { "vpermilps", { XM, EXx, Ib }, 0 },
9e30b8e0
L
10149 },
10150 {
592a252b 10151 /* VEX_W_0F3A05_P_2 */
bf890a93 10152 { "vpermilpd", { XM, EXx, Ib }, 0 },
9e30b8e0
L
10153 },
10154 {
592a252b 10155 /* VEX_W_0F3A06_P_2 */
bf890a93 10156 { "vperm2f128", { XM, Vex256, EXx, Ib }, 0 },
9e30b8e0 10157 },
9e30b8e0 10158 {
592a252b 10159 /* VEX_W_0F3A18_P_2 */
bf890a93 10160 { "vinsertf128", { XM, Vex256, EXxmm, Ib }, 0 },
9e30b8e0
L
10161 },
10162 {
592a252b 10163 /* VEX_W_0F3A19_P_2 */
bf890a93 10164 { "vextractf128", { EXxmm, XM, Ib }, 0 },
9e30b8e0 10165 },
43234a1e 10166 {
1ba585e8 10167 /* VEX_W_0F3A30_P_2_LEN_0 */
ab4e4ed5
AF
10168 { MOD_TABLE (MOD_VEX_W_0_0F3A30_P_2_LEN_0) },
10169 { MOD_TABLE (MOD_VEX_W_1_0F3A30_P_2_LEN_0) },
43234a1e
L
10170 },
10171 {
1ba585e8 10172 /* VEX_W_0F3A31_P_2_LEN_0 */
ab4e4ed5
AF
10173 { MOD_TABLE (MOD_VEX_W_0_0F3A31_P_2_LEN_0) },
10174 { MOD_TABLE (MOD_VEX_W_1_0F3A31_P_2_LEN_0) },
1ba585e8
IT
10175 },
10176 {
10177 /* VEX_W_0F3A32_P_2_LEN_0 */
ab4e4ed5
AF
10178 { MOD_TABLE (MOD_VEX_W_0_0F3A32_P_2_LEN_0) },
10179 { MOD_TABLE (MOD_VEX_W_1_0F3A32_P_2_LEN_0) },
43234a1e 10180 },
1ba585e8
IT
10181 {
10182 /* VEX_W_0F3A33_P_2_LEN_0 */
ab4e4ed5
AF
10183 { MOD_TABLE (MOD_VEX_W_0_0F3A33_P_2_LEN_0) },
10184 { MOD_TABLE (MOD_VEX_W_1_0F3A33_P_2_LEN_0) },
1ba585e8 10185 },
6c30d220
L
10186 {
10187 /* VEX_W_0F3A38_P_2 */
bf890a93 10188 { "vinserti128", { XM, Vex256, EXxmm, Ib }, 0 },
6c30d220
L
10189 },
10190 {
10191 /* VEX_W_0F3A39_P_2 */
bf890a93 10192 { "vextracti128", { EXxmm, XM, Ib }, 0 },
6c30d220 10193 },
6c30d220
L
10194 {
10195 /* VEX_W_0F3A46_P_2 */
bf890a93 10196 { "vperm2i128", { XM, Vex256, EXx, Ib }, 0 },
6c30d220 10197 },
a683cc34 10198 {
592a252b 10199 /* VEX_W_0F3A48_P_2 */
bf890a93
IT
10200 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10201 { "vpermil2ps", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
a683cc34
SP
10202 },
10203 {
592a252b 10204 /* VEX_W_0F3A49_P_2 */
bf890a93
IT
10205 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
10206 { "vpermil2pd", { XMVexW, Vex, EXVexImmW, EXVexImmW, EXVexImmW }, 0 },
a683cc34 10207 },
9e30b8e0 10208 {
592a252b 10209 /* VEX_W_0F3A4A_P_2 */
bf890a93 10210 { "vblendvps", { XM, Vex, EXx, XMVexI4 }, 0 },
9e30b8e0
L
10211 },
10212 {
592a252b 10213 /* VEX_W_0F3A4B_P_2 */
bf890a93 10214 { "vblendvpd", { XM, Vex, EXx, XMVexI4 }, 0 },
9e30b8e0
L
10215 },
10216 {
592a252b 10217 /* VEX_W_0F3A4C_P_2 */
bf890a93 10218 { "vpblendvb", { XM, Vex, EXx, XMVexI4 }, 0 },
9e30b8e0 10219 },
48521003
IT
10220 {
10221 /* VEX_W_0F3ACE_P_2 */
10222 { Bad_Opcode },
10223 { "vgf2p8affineqb", { XM, Vex, EXx, Ib }, 0 },
10224 },
10225 {
10226 /* VEX_W_0F3ACF_P_2 */
10227 { Bad_Opcode },
10228 { "vgf2p8affineinvqb", { XM, Vex, EXx, Ib }, 0 },
10229 },
43234a1e
L
10230#define NEED_VEX_W_TABLE
10231#include "i386-dis-evex.h"
10232#undef NEED_VEX_W_TABLE
9e30b8e0
L
10233};
10234
10235static const struct dis386 mod_table[][2] = {
10236 {
10237 /* MOD_8D */
bf890a93 10238 { "leaS", { Gv, M }, 0 },
9e30b8e0 10239 },
42164a71
L
10240 {
10241 /* MOD_C6_REG_7 */
10242 { Bad_Opcode },
10243 { RM_TABLE (RM_C6_REG_7) },
10244 },
10245 {
10246 /* MOD_C7_REG_7 */
10247 { Bad_Opcode },
10248 { RM_TABLE (RM_C7_REG_7) },
10249 },
4a357820
MZ
10250 {
10251 /* MOD_FF_REG_3 */
a72d2af2 10252 { "Jcall^", { indirEp }, 0 },
4a357820
MZ
10253 },
10254 {
10255 /* MOD_FF_REG_5 */
a72d2af2 10256 { "Jjmp^", { indirEp }, 0 },
4a357820 10257 },
9e30b8e0
L
10258 {
10259 /* MOD_0F01_REG_0 */
10260 { X86_64_TABLE (X86_64_0F01_REG_0) },
10261 { RM_TABLE (RM_0F01_REG_0) },
10262 },
10263 {
10264 /* MOD_0F01_REG_1 */
10265 { X86_64_TABLE (X86_64_0F01_REG_1) },
10266 { RM_TABLE (RM_0F01_REG_1) },
10267 },
10268 {
10269 /* MOD_0F01_REG_2 */
10270 { X86_64_TABLE (X86_64_0F01_REG_2) },
10271 { RM_TABLE (RM_0F01_REG_2) },
10272 },
10273 {
10274 /* MOD_0F01_REG_3 */
10275 { X86_64_TABLE (X86_64_0F01_REG_3) },
10276 { RM_TABLE (RM_0F01_REG_3) },
10277 },
8eab4136
L
10278 {
10279 /* MOD_0F01_REG_5 */
603555e5 10280 { PREFIX_TABLE (PREFIX_MOD_0_0F01_REG_5) },
8eab4136
L
10281 { RM_TABLE (RM_0F01_REG_5) },
10282 },
9e30b8e0
L
10283 {
10284 /* MOD_0F01_REG_7 */
bf890a93 10285 { "invlpg", { Mb }, 0 },
9e30b8e0
L
10286 { RM_TABLE (RM_0F01_REG_7) },
10287 },
10288 {
10289 /* MOD_0F12_PREFIX_0 */
507bd325
L
10290 { "movlps", { XM, EXq }, PREFIX_OPCODE },
10291 { "movhlps", { XM, EXq }, PREFIX_OPCODE },
9e30b8e0
L
10292 },
10293 {
10294 /* MOD_0F13 */
507bd325 10295 { "movlpX", { EXq, XM }, PREFIX_OPCODE },
9e30b8e0
L
10296 },
10297 {
10298 /* MOD_0F16_PREFIX_0 */
bf890a93
IT
10299 { "movhps", { XM, EXq }, 0 },
10300 { "movlhps", { XM, EXq }, 0 },
9e30b8e0
L
10301 },
10302 {
10303 /* MOD_0F17 */
507bd325 10304 { "movhpX", { EXq, XM }, PREFIX_OPCODE },
9e30b8e0
L
10305 },
10306 {
10307 /* MOD_0F18_REG_0 */
bf890a93 10308 { "prefetchnta", { Mb }, 0 },
9e30b8e0
L
10309 },
10310 {
10311 /* MOD_0F18_REG_1 */
bf890a93 10312 { "prefetcht0", { Mb }, 0 },
9e30b8e0
L
10313 },
10314 {
10315 /* MOD_0F18_REG_2 */
bf890a93 10316 { "prefetcht1", { Mb }, 0 },
9e30b8e0
L
10317 },
10318 {
10319 /* MOD_0F18_REG_3 */
bf890a93 10320 { "prefetcht2", { Mb }, 0 },
9e30b8e0 10321 },
d7189fa5
RM
10322 {
10323 /* MOD_0F18_REG_4 */
bf890a93 10324 { "nop/reserved", { Mb }, 0 },
d7189fa5
RM
10325 },
10326 {
10327 /* MOD_0F18_REG_5 */
bf890a93 10328 { "nop/reserved", { Mb }, 0 },
d7189fa5
RM
10329 },
10330 {
10331 /* MOD_0F18_REG_6 */
bf890a93 10332 { "nop/reserved", { Mb }, 0 },
d7189fa5
RM
10333 },
10334 {
10335 /* MOD_0F18_REG_7 */
bf890a93 10336 { "nop/reserved", { Mb }, 0 },
d7189fa5 10337 },
7e8b059b
L
10338 {
10339 /* MOD_0F1A_PREFIX_0 */
d276ec69 10340 { "bndldx", { Gbnd, Mv_bnd }, 0 },
bf890a93 10341 { "nopQ", { Ev }, 0 },
7e8b059b
L
10342 },
10343 {
10344 /* MOD_0F1B_PREFIX_0 */
d276ec69 10345 { "bndstx", { Mv_bnd, Gbnd }, 0 },
bf890a93 10346 { "nopQ", { Ev }, 0 },
7e8b059b
L
10347 },
10348 {
10349 /* MOD_0F1B_PREFIX_1 */
d276ec69 10350 { "bndmk", { Gbnd, Mv_bnd }, 0 },
bf890a93 10351 { "nopQ", { Ev }, 0 },
7e8b059b 10352 },
c48935d7
IT
10353 {
10354 /* MOD_0F1C_PREFIX_0 */
10355 { REG_TABLE (REG_0F1C_MOD_0) },
10356 { "nopQ", { Ev }, 0 },
10357 },
603555e5
L
10358 {
10359 /* MOD_0F1E_PREFIX_1 */
10360 { "nopQ", { Ev }, 0 },
10361 { REG_TABLE (REG_0F1E_MOD_3) },
10362 },
b844680a 10363 {
92fddf8e 10364 /* MOD_0F24 */
7bb15c6f 10365 { Bad_Opcode },
bf890a93 10366 { "movL", { Rd, Td }, 0 },
b844680a
L
10367 },
10368 {
92fddf8e 10369 /* MOD_0F26 */
592d1631 10370 { Bad_Opcode },
bf890a93 10371 { "movL", { Td, Rd }, 0 },
b844680a 10372 },
75c135a8
L
10373 {
10374 /* MOD_0F2B_PREFIX_0 */
507bd325 10375 {"movntps", { Mx, XM }, PREFIX_OPCODE },
75c135a8
L
10376 },
10377 {
10378 /* MOD_0F2B_PREFIX_1 */
507bd325 10379 {"movntss", { Md, XM }, PREFIX_OPCODE },
75c135a8
L
10380 },
10381 {
10382 /* MOD_0F2B_PREFIX_2 */
507bd325 10383 {"movntpd", { Mx, XM }, PREFIX_OPCODE },
75c135a8
L
10384 },
10385 {
10386 /* MOD_0F2B_PREFIX_3 */
507bd325 10387 {"movntsd", { Mq, XM }, PREFIX_OPCODE },
75c135a8
L
10388 },
10389 {
10390 /* MOD_0F51 */
592d1631 10391 { Bad_Opcode },
507bd325 10392 { "movmskpX", { Gdq, XS }, PREFIX_OPCODE },
75c135a8 10393 },
b844680a 10394 {
1ceb70f8 10395 /* MOD_0F71_REG_2 */
592d1631 10396 { Bad_Opcode },
bf890a93 10397 { "psrlw", { MS, Ib }, 0 },
b844680a
L
10398 },
10399 {
1ceb70f8 10400 /* MOD_0F71_REG_4 */
592d1631 10401 { Bad_Opcode },
bf890a93 10402 { "psraw", { MS, Ib }, 0 },
b844680a
L
10403 },
10404 {
1ceb70f8 10405 /* MOD_0F71_REG_6 */
592d1631 10406 { Bad_Opcode },
bf890a93 10407 { "psllw", { MS, Ib }, 0 },
b844680a
L
10408 },
10409 {
1ceb70f8 10410 /* MOD_0F72_REG_2 */
592d1631 10411 { Bad_Opcode },
bf890a93 10412 { "psrld", { MS, Ib }, 0 },
b844680a
L
10413 },
10414 {
1ceb70f8 10415 /* MOD_0F72_REG_4 */
592d1631 10416 { Bad_Opcode },
bf890a93 10417 { "psrad", { MS, Ib }, 0 },
b844680a
L
10418 },
10419 {
1ceb70f8 10420 /* MOD_0F72_REG_6 */
592d1631 10421 { Bad_Opcode },
bf890a93 10422 { "pslld", { MS, Ib }, 0 },
b844680a
L
10423 },
10424 {
1ceb70f8 10425 /* MOD_0F73_REG_2 */
592d1631 10426 { Bad_Opcode },
bf890a93 10427 { "psrlq", { MS, Ib }, 0 },
b844680a
L
10428 },
10429 {
1ceb70f8 10430 /* MOD_0F73_REG_3 */
592d1631 10431 { Bad_Opcode },
c0f3af97
L
10432 { PREFIX_TABLE (PREFIX_0F73_REG_3) },
10433 },
10434 {
10435 /* MOD_0F73_REG_6 */
592d1631 10436 { Bad_Opcode },
bf890a93 10437 { "psllq", { MS, Ib }, 0 },
c0f3af97
L
10438 },
10439 {
10440 /* MOD_0F73_REG_7 */
592d1631 10441 { Bad_Opcode },
c0f3af97
L
10442 { PREFIX_TABLE (PREFIX_0F73_REG_7) },
10443 },
10444 {
10445 /* MOD_0FAE_REG_0 */
bf890a93 10446 { "fxsave", { FXSAVE }, 0 },
c7b8aa3a 10447 { PREFIX_TABLE (PREFIX_0FAE_REG_0) },
c0f3af97
L
10448 },
10449 {
10450 /* MOD_0FAE_REG_1 */
bf890a93 10451 { "fxrstor", { FXSAVE }, 0 },
c7b8aa3a 10452 { PREFIX_TABLE (PREFIX_0FAE_REG_1) },
c0f3af97
L
10453 },
10454 {
10455 /* MOD_0FAE_REG_2 */
bf890a93 10456 { "ldmxcsr", { Md }, 0 },
c7b8aa3a 10457 { PREFIX_TABLE (PREFIX_0FAE_REG_2) },
c0f3af97
L
10458 },
10459 {
10460 /* MOD_0FAE_REG_3 */
bf890a93 10461 { "stmxcsr", { Md }, 0 },
c7b8aa3a 10462 { PREFIX_TABLE (PREFIX_0FAE_REG_3) },
c0f3af97
L
10463 },
10464 {
10465 /* MOD_0FAE_REG_4 */
6b40c462
L
10466 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_4) },
10467 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_4) },
c0f3af97
L
10468 },
10469 {
10470 /* MOD_0FAE_REG_5 */
603555e5 10471 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_5) },
2234eee6 10472 { PREFIX_TABLE (PREFIX_MOD_3_0FAE_REG_5) },
c0f3af97
L
10473 },
10474 {
10475 /* MOD_0FAE_REG_6 */
de89d0a3
IT
10476 { PREFIX_TABLE (PREFIX_MOD_0_0FAE_REG_6) },
10477 { PREFIX_TABLE (PREFIX_MOD_1_0FAE_REG_6) },
c0f3af97
L
10478 },
10479 {
10480 /* MOD_0FAE_REG_7 */
963f3586 10481 { PREFIX_TABLE (PREFIX_0FAE_REG_7) },
c0f3af97
L
10482 { RM_TABLE (RM_0FAE_REG_7) },
10483 },
10484 {
10485 /* MOD_0FB2 */
bf890a93 10486 { "lssS", { Gv, Mp }, 0 },
c0f3af97
L
10487 },
10488 {
10489 /* MOD_0FB4 */
bf890a93 10490 { "lfsS", { Gv, Mp }, 0 },
c0f3af97
L
10491 },
10492 {
10493 /* MOD_0FB5 */
bf890a93 10494 { "lgsS", { Gv, Mp }, 0 },
c0f3af97 10495 },
a8484f96
L
10496 {
10497 /* MOD_0FC3 */
10498 { PREFIX_TABLE (PREFIX_MOD_0_0FC3) },
10499 },
963f3586
IT
10500 {
10501 /* MOD_0FC7_REG_3 */
a8484f96 10502 { "xrstors", { FXSAVE }, 0 },
963f3586
IT
10503 },
10504 {
10505 /* MOD_0FC7_REG_4 */
bf890a93 10506 { "xsavec", { FXSAVE }, 0 },
963f3586
IT
10507 },
10508 {
10509 /* MOD_0FC7_REG_5 */
bf890a93 10510 { "xsaves", { FXSAVE }, 0 },
963f3586 10511 },
c0f3af97
L
10512 {
10513 /* MOD_0FC7_REG_6 */
f24bcbaa
L
10514 { PREFIX_TABLE (PREFIX_MOD_0_0FC7_REG_6) },
10515 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_6) }
c0f3af97
L
10516 },
10517 {
10518 /* MOD_0FC7_REG_7 */
bf890a93 10519 { "vmptrst", { Mq }, 0 },
f24bcbaa 10520 { PREFIX_TABLE (PREFIX_MOD_3_0FC7_REG_7) }
c0f3af97
L
10521 },
10522 {
10523 /* MOD_0FD7 */
592d1631 10524 { Bad_Opcode },
bf890a93 10525 { "pmovmskb", { Gdq, MS }, 0 },
c0f3af97
L
10526 },
10527 {
10528 /* MOD_0FE7_PREFIX_2 */
bf890a93 10529 { "movntdq", { Mx, XM }, 0 },
c0f3af97
L
10530 },
10531 {
10532 /* MOD_0FF0_PREFIX_3 */
bf890a93 10533 { "lddqu", { XM, M }, 0 },
c0f3af97
L
10534 },
10535 {
10536 /* MOD_0F382A_PREFIX_2 */
bf890a93 10537 { "movntdqa", { XM, Mx }, 0 },
c0f3af97 10538 },
603555e5
L
10539 {
10540 /* MOD_0F38F5_PREFIX_2 */
10541 { "wrussK", { M, Gdq }, PREFIX_OPCODE },
10542 },
10543 {
10544 /* MOD_0F38F6_PREFIX_0 */
10545 { "wrssK", { M, Gdq }, PREFIX_OPCODE },
10546 },
5d79adc4
L
10547 {
10548 /* MOD_0F38F8_PREFIX_1 */
10549 { "enqcmds", { Gva, M }, PREFIX_OPCODE },
10550 },
c0a30a9f
L
10551 {
10552 /* MOD_0F38F8_PREFIX_2 */
10553 { "movdir64b", { Gva, M }, PREFIX_OPCODE },
10554 },
5d79adc4
L
10555 {
10556 /* MOD_0F38F8_PREFIX_3 */
10557 { "enqcmd", { Gva, M }, PREFIX_OPCODE },
10558 },
c0a30a9f
L
10559 {
10560 /* MOD_0F38F9_PREFIX_0 */
10561 { "movdiri", { Em, Gv }, PREFIX_OPCODE },
10562 },
c0f3af97
L
10563 {
10564 /* MOD_62_32BIT */
bf890a93 10565 { "bound{S|}", { Gv, Ma }, 0 },
43234a1e 10566 { EVEX_TABLE (EVEX_0F) },
c0f3af97
L
10567 },
10568 {
10569 /* MOD_C4_32BIT */
bf890a93 10570 { "lesS", { Gv, Mp }, 0 },
c0f3af97
L
10571 { VEX_C4_TABLE (VEX_0F) },
10572 },
10573 {
10574 /* MOD_C5_32BIT */
bf890a93 10575 { "ldsS", { Gv, Mp }, 0 },
c0f3af97
L
10576 { VEX_C5_TABLE (VEX_0F) },
10577 },
10578 {
592a252b
L
10579 /* MOD_VEX_0F12_PREFIX_0 */
10580 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_0) },
10581 { VEX_LEN_TABLE (VEX_LEN_0F12_P_0_M_1) },
c0f3af97
L
10582 },
10583 {
592a252b
L
10584 /* MOD_VEX_0F13 */
10585 { VEX_LEN_TABLE (VEX_LEN_0F13_M_0) },
c0f3af97
L
10586 },
10587 {
592a252b
L
10588 /* MOD_VEX_0F16_PREFIX_0 */
10589 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_0) },
10590 { VEX_LEN_TABLE (VEX_LEN_0F16_P_0_M_1) },
c0f3af97
L
10591 },
10592 {
592a252b
L
10593 /* MOD_VEX_0F17 */
10594 { VEX_LEN_TABLE (VEX_LEN_0F17_M_0) },
c0f3af97
L
10595 },
10596 {
592a252b 10597 /* MOD_VEX_0F2B */
ec6f095a 10598 { "vmovntpX", { Mx, XM }, 0 },
c0f3af97 10599 },
ab4e4ed5
AF
10600 {
10601 /* MOD_VEX_W_0_0F41_P_0_LEN_1 */
10602 { Bad_Opcode },
10603 { "kandw", { MaskG, MaskVex, MaskR }, 0 },
10604 },
10605 {
10606 /* MOD_VEX_W_1_0F41_P_0_LEN_1 */
10607 { Bad_Opcode },
10608 { "kandq", { MaskG, MaskVex, MaskR }, 0 },
10609 },
10610 {
10611 /* MOD_VEX_W_0_0F41_P_2_LEN_1 */
10612 { Bad_Opcode },
10613 { "kandb", { MaskG, MaskVex, MaskR }, 0 },
10614 },
10615 {
10616 /* MOD_VEX_W_1_0F41_P_2_LEN_1 */
10617 { Bad_Opcode },
10618 { "kandd", { MaskG, MaskVex, MaskR }, 0 },
10619 },
10620 {
10621 /* MOD_VEX_W_0_0F42_P_0_LEN_1 */
10622 { Bad_Opcode },
10623 { "kandnw", { MaskG, MaskVex, MaskR }, 0 },
10624 },
10625 {
10626 /* MOD_VEX_W_1_0F42_P_0_LEN_1 */
10627 { Bad_Opcode },
10628 { "kandnq", { MaskG, MaskVex, MaskR }, 0 },
10629 },
10630 {
10631 /* MOD_VEX_W_0_0F42_P_2_LEN_1 */
10632 { Bad_Opcode },
10633 { "kandnb", { MaskG, MaskVex, MaskR }, 0 },
10634 },
10635 {
10636 /* MOD_VEX_W_1_0F42_P_2_LEN_1 */
10637 { Bad_Opcode },
10638 { "kandnd", { MaskG, MaskVex, MaskR }, 0 },
10639 },
10640 {
10641 /* MOD_VEX_W_0_0F44_P_0_LEN_0 */
10642 { Bad_Opcode },
10643 { "knotw", { MaskG, MaskR }, 0 },
10644 },
10645 {
10646 /* MOD_VEX_W_1_0F44_P_0_LEN_0 */
10647 { Bad_Opcode },
10648 { "knotq", { MaskG, MaskR }, 0 },
10649 },
10650 {
10651 /* MOD_VEX_W_0_0F44_P_2_LEN_0 */
10652 { Bad_Opcode },
10653 { "knotb", { MaskG, MaskR }, 0 },
10654 },
10655 {
10656 /* MOD_VEX_W_1_0F44_P_2_LEN_0 */
10657 { Bad_Opcode },
10658 { "knotd", { MaskG, MaskR }, 0 },
10659 },
10660 {
10661 /* MOD_VEX_W_0_0F45_P_0_LEN_1 */
10662 { Bad_Opcode },
10663 { "korw", { MaskG, MaskVex, MaskR }, 0 },
10664 },
10665 {
10666 /* MOD_VEX_W_1_0F45_P_0_LEN_1 */
10667 { Bad_Opcode },
10668 { "korq", { MaskG, MaskVex, MaskR }, 0 },
10669 },
10670 {
10671 /* MOD_VEX_W_0_0F45_P_2_LEN_1 */
10672 { Bad_Opcode },
10673 { "korb", { MaskG, MaskVex, MaskR }, 0 },
10674 },
10675 {
10676 /* MOD_VEX_W_1_0F45_P_2_LEN_1 */
10677 { Bad_Opcode },
10678 { "kord", { MaskG, MaskVex, MaskR }, 0 },
10679 },
10680 {
10681 /* MOD_VEX_W_0_0F46_P_0_LEN_1 */
10682 { Bad_Opcode },
10683 { "kxnorw", { MaskG, MaskVex, MaskR }, 0 },
10684 },
10685 {
10686 /* MOD_VEX_W_1_0F46_P_0_LEN_1 */
10687 { Bad_Opcode },
10688 { "kxnorq", { MaskG, MaskVex, MaskR }, 0 },
10689 },
10690 {
10691 /* MOD_VEX_W_0_0F46_P_2_LEN_1 */
10692 { Bad_Opcode },
10693 { "kxnorb", { MaskG, MaskVex, MaskR }, 0 },
10694 },
10695 {
10696 /* MOD_VEX_W_1_0F46_P_2_LEN_1 */
10697 { Bad_Opcode },
10698 { "kxnord", { MaskG, MaskVex, MaskR }, 0 },
10699 },
10700 {
10701 /* MOD_VEX_W_0_0F47_P_0_LEN_1 */
10702 { Bad_Opcode },
10703 { "kxorw", { MaskG, MaskVex, MaskR }, 0 },
10704 },
10705 {
10706 /* MOD_VEX_W_1_0F47_P_0_LEN_1 */
10707 { Bad_Opcode },
10708 { "kxorq", { MaskG, MaskVex, MaskR }, 0 },
10709 },
10710 {
10711 /* MOD_VEX_W_0_0F47_P_2_LEN_1 */
10712 { Bad_Opcode },
10713 { "kxorb", { MaskG, MaskVex, MaskR }, 0 },
10714 },
10715 {
10716 /* MOD_VEX_W_1_0F47_P_2_LEN_1 */
10717 { Bad_Opcode },
10718 { "kxord", { MaskG, MaskVex, MaskR }, 0 },
10719 },
10720 {
10721 /* MOD_VEX_W_0_0F4A_P_0_LEN_1 */
10722 { Bad_Opcode },
10723 { "kaddw", { MaskG, MaskVex, MaskR }, 0 },
10724 },
10725 {
10726 /* MOD_VEX_W_1_0F4A_P_0_LEN_1 */
10727 { Bad_Opcode },
10728 { "kaddq", { MaskG, MaskVex, MaskR }, 0 },
10729 },
10730 {
10731 /* MOD_VEX_W_0_0F4A_P_2_LEN_1 */
10732 { Bad_Opcode },
10733 { "kaddb", { MaskG, MaskVex, MaskR }, 0 },
10734 },
10735 {
10736 /* MOD_VEX_W_1_0F4A_P_2_LEN_1 */
10737 { Bad_Opcode },
10738 { "kaddd", { MaskG, MaskVex, MaskR }, 0 },
10739 },
10740 {
10741 /* MOD_VEX_W_0_0F4B_P_0_LEN_1 */
10742 { Bad_Opcode },
10743 { "kunpckwd", { MaskG, MaskVex, MaskR }, 0 },
10744 },
10745 {
10746 /* MOD_VEX_W_1_0F4B_P_0_LEN_1 */
10747 { Bad_Opcode },
10748 { "kunpckdq", { MaskG, MaskVex, MaskR }, 0 },
10749 },
10750 {
10751 /* MOD_VEX_W_0_0F4B_P_2_LEN_1 */
10752 { Bad_Opcode },
10753 { "kunpckbw", { MaskG, MaskVex, MaskR }, 0 },
10754 },
c0f3af97 10755 {
592a252b 10756 /* MOD_VEX_0F50 */
592d1631 10757 { Bad_Opcode },
ec6f095a 10758 { "vmovmskpX", { Gdq, XS }, 0 },
c0f3af97
L
10759 },
10760 {
592a252b 10761 /* MOD_VEX_0F71_REG_2 */
592d1631 10762 { Bad_Opcode },
592a252b 10763 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_2) },
b844680a
L
10764 },
10765 {
592a252b 10766 /* MOD_VEX_0F71_REG_4 */
592d1631 10767 { Bad_Opcode },
592a252b 10768 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_4) },
b844680a
L
10769 },
10770 {
592a252b 10771 /* MOD_VEX_0F71_REG_6 */
592d1631 10772 { Bad_Opcode },
592a252b 10773 { PREFIX_TABLE (PREFIX_VEX_0F71_REG_6) },
b844680a
L
10774 },
10775 {
592a252b 10776 /* MOD_VEX_0F72_REG_2 */
592d1631 10777 { Bad_Opcode },
592a252b 10778 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_2) },
b844680a 10779 },
d8faab4e 10780 {
592a252b 10781 /* MOD_VEX_0F72_REG_4 */
592d1631 10782 { Bad_Opcode },
592a252b 10783 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_4) },
d8faab4e
L
10784 },
10785 {
592a252b 10786 /* MOD_VEX_0F72_REG_6 */
592d1631 10787 { Bad_Opcode },
592a252b 10788 { PREFIX_TABLE (PREFIX_VEX_0F72_REG_6) },
d8faab4e 10789 },
876d4bfa 10790 {
592a252b 10791 /* MOD_VEX_0F73_REG_2 */
592d1631 10792 { Bad_Opcode },
592a252b 10793 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_2) },
876d4bfa
L
10794 },
10795 {
592a252b 10796 /* MOD_VEX_0F73_REG_3 */
592d1631 10797 { Bad_Opcode },
592a252b 10798 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_3) },
475a2301
L
10799 },
10800 {
592a252b 10801 /* MOD_VEX_0F73_REG_6 */
592d1631 10802 { Bad_Opcode },
592a252b 10803 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_6) },
876d4bfa
L
10804 },
10805 {
592a252b 10806 /* MOD_VEX_0F73_REG_7 */
592d1631 10807 { Bad_Opcode },
592a252b 10808 { PREFIX_TABLE (PREFIX_VEX_0F73_REG_7) },
876d4bfa 10809 },
ab4e4ed5
AF
10810 {
10811 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
10812 { "kmovw", { Ew, MaskG }, 0 },
10813 { Bad_Opcode },
10814 },
10815 {
10816 /* MOD_VEX_W_0_0F91_P_0_LEN_0 */
10817 { "kmovq", { Eq, MaskG }, 0 },
10818 { Bad_Opcode },
10819 },
10820 {
10821 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
10822 { "kmovb", { Eb, MaskG }, 0 },
10823 { Bad_Opcode },
10824 },
10825 {
10826 /* MOD_VEX_W_0_0F91_P_2_LEN_0 */
10827 { "kmovd", { Ed, MaskG }, 0 },
10828 { Bad_Opcode },
10829 },
10830 {
10831 /* MOD_VEX_W_0_0F92_P_0_LEN_0 */
10832 { Bad_Opcode },
10833 { "kmovw", { MaskG, Rdq }, 0 },
10834 },
10835 {
10836 /* MOD_VEX_W_0_0F92_P_2_LEN_0 */
10837 { Bad_Opcode },
10838 { "kmovb", { MaskG, Rdq }, 0 },
10839 },
10840 {
58a211d2 10841 /* MOD_VEX_0F92_P_3_LEN_0 */
ab4e4ed5 10842 { Bad_Opcode },
58a211d2 10843 { "kmovK", { MaskG, Rdq }, 0 },
ab4e4ed5
AF
10844 },
10845 {
10846 /* MOD_VEX_W_0_0F93_P_0_LEN_0 */
10847 { Bad_Opcode },
10848 { "kmovw", { Gdq, MaskR }, 0 },
10849 },
10850 {
10851 /* MOD_VEX_W_0_0F93_P_2_LEN_0 */
10852 { Bad_Opcode },
10853 { "kmovb", { Gdq, MaskR }, 0 },
10854 },
10855 {
58a211d2 10856 /* MOD_VEX_0F93_P_3_LEN_0 */
ab4e4ed5 10857 { Bad_Opcode },
58a211d2 10858 { "kmovK", { Gdq, MaskR }, 0 },
ab4e4ed5
AF
10859 },
10860 {
10861 /* MOD_VEX_W_0_0F98_P_0_LEN_0 */
10862 { Bad_Opcode },
10863 { "kortestw", { MaskG, MaskR }, 0 },
10864 },
10865 {
10866 /* MOD_VEX_W_1_0F98_P_0_LEN_0 */
10867 { Bad_Opcode },
10868 { "kortestq", { MaskG, MaskR }, 0 },
10869 },
10870 {
10871 /* MOD_VEX_W_0_0F98_P_2_LEN_0 */
10872 { Bad_Opcode },
10873 { "kortestb", { MaskG, MaskR }, 0 },
10874 },
10875 {
10876 /* MOD_VEX_W_1_0F98_P_2_LEN_0 */
10877 { Bad_Opcode },
10878 { "kortestd", { MaskG, MaskR }, 0 },
10879 },
10880 {
10881 /* MOD_VEX_W_0_0F99_P_0_LEN_0 */
10882 { Bad_Opcode },
10883 { "ktestw", { MaskG, MaskR }, 0 },
10884 },
10885 {
10886 /* MOD_VEX_W_1_0F99_P_0_LEN_0 */
10887 { Bad_Opcode },
10888 { "ktestq", { MaskG, MaskR }, 0 },
10889 },
10890 {
10891 /* MOD_VEX_W_0_0F99_P_2_LEN_0 */
10892 { Bad_Opcode },
10893 { "ktestb", { MaskG, MaskR }, 0 },
10894 },
10895 {
10896 /* MOD_VEX_W_1_0F99_P_2_LEN_0 */
10897 { Bad_Opcode },
10898 { "ktestd", { MaskG, MaskR }, 0 },
10899 },
876d4bfa 10900 {
592a252b
L
10901 /* MOD_VEX_0FAE_REG_2 */
10902 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_2_M_0) },
876d4bfa 10903 },
bbedc832 10904 {
592a252b
L
10905 /* MOD_VEX_0FAE_REG_3 */
10906 { VEX_LEN_TABLE (VEX_LEN_0FAE_R_3_M_0) },
bbedc832 10907 },
144c41d9 10908 {
592a252b 10909 /* MOD_VEX_0FD7_PREFIX_2 */
592d1631 10910 { Bad_Opcode },
ec6f095a 10911 { "vpmovmskb", { Gdq, XS }, 0 },
144c41d9 10912 },
1afd85e3 10913 {
592a252b 10914 /* MOD_VEX_0FE7_PREFIX_2 */
ec6f095a 10915 { "vmovntdq", { Mx, XM }, 0 },
1afd85e3
L
10916 },
10917 {
592a252b 10918 /* MOD_VEX_0FF0_PREFIX_3 */
ec6f095a 10919 { "vlddqu", { XM, M }, 0 },
92fddf8e 10920 },
75c135a8 10921 {
592a252b
L
10922 /* MOD_VEX_0F381A_PREFIX_2 */
10923 { VEX_LEN_TABLE (VEX_LEN_0F381A_P_2_M_0) },
75c135a8 10924 },
1afd85e3 10925 {
592a252b 10926 /* MOD_VEX_0F382A_PREFIX_2 */
ec6f095a 10927 { "vmovntdqa", { XM, Mx }, 0 },
1afd85e3 10928 },
75c135a8 10929 {
592a252b
L
10930 /* MOD_VEX_0F382C_PREFIX_2 */
10931 { VEX_W_TABLE (VEX_W_0F382C_P_2_M_0) },
75c135a8 10932 },
1afd85e3 10933 {
592a252b
L
10934 /* MOD_VEX_0F382D_PREFIX_2 */
10935 { VEX_W_TABLE (VEX_W_0F382D_P_2_M_0) },
1afd85e3
L
10936 },
10937 {
592a252b
L
10938 /* MOD_VEX_0F382E_PREFIX_2 */
10939 { VEX_W_TABLE (VEX_W_0F382E_P_2_M_0) },
1afd85e3
L
10940 },
10941 {
592a252b
L
10942 /* MOD_VEX_0F382F_PREFIX_2 */
10943 { VEX_W_TABLE (VEX_W_0F382F_P_2_M_0) },
1afd85e3 10944 },
6c30d220
L
10945 {
10946 /* MOD_VEX_0F385A_PREFIX_2 */
10947 { VEX_LEN_TABLE (VEX_LEN_0F385A_P_2_M_0) },
10948 },
10949 {
10950 /* MOD_VEX_0F388C_PREFIX_2 */
bf890a93 10951 { "vpmaskmov%LW", { XM, Vex, Mx }, 0 },
6c30d220
L
10952 },
10953 {
10954 /* MOD_VEX_0F388E_PREFIX_2 */
bf890a93 10955 { "vpmaskmov%LW", { Mx, Vex, XM }, 0 },
6c30d220 10956 },
ab4e4ed5
AF
10957 {
10958 /* MOD_VEX_W_0_0F3A30_P_2_LEN_0 */
10959 { Bad_Opcode },
10960 { "kshiftrb", { MaskG, MaskR, Ib }, 0 },
10961 },
10962 {
10963 /* MOD_VEX_W_1_0F3A30_P_2_LEN_0 */
10964 { Bad_Opcode },
10965 { "kshiftrw", { MaskG, MaskR, Ib }, 0 },
10966 },
10967 {
10968 /* MOD_VEX_W_0_0F3A31_P_2_LEN_0 */
10969 { Bad_Opcode },
10970 { "kshiftrd", { MaskG, MaskR, Ib }, 0 },
10971 },
10972 {
10973 /* MOD_VEX_W_1_0F3A31_P_2_LEN_0 */
10974 { Bad_Opcode },
10975 { "kshiftrq", { MaskG, MaskR, Ib }, 0 },
10976 },
10977 {
10978 /* MOD_VEX_W_0_0F3A32_P_2_LEN_0 */
10979 { Bad_Opcode },
10980 { "kshiftlb", { MaskG, MaskR, Ib }, 0 },
10981 },
10982 {
10983 /* MOD_VEX_W_1_0F3A32_P_2_LEN_0 */
10984 { Bad_Opcode },
10985 { "kshiftlw", { MaskG, MaskR, Ib }, 0 },
10986 },
10987 {
10988 /* MOD_VEX_W_0_0F3A33_P_2_LEN_0 */
10989 { Bad_Opcode },
10990 { "kshiftld", { MaskG, MaskR, Ib }, 0 },
10991 },
10992 {
10993 /* MOD_VEX_W_1_0F3A33_P_2_LEN_0 */
10994 { Bad_Opcode },
10995 { "kshiftlq", { MaskG, MaskR, Ib }, 0 },
10996 },
43234a1e
L
10997#define NEED_MOD_TABLE
10998#include "i386-dis-evex.h"
10999#undef NEED_MOD_TABLE
b844680a
L
11000};
11001
1ceb70f8 11002static const struct dis386 rm_table[][8] = {
42164a71
L
11003 {
11004 /* RM_C6_REG_7 */
bf890a93 11005 { "xabort", { Skip_MODRM, Ib }, 0 },
42164a71
L
11006 },
11007 {
11008 /* RM_C7_REG_7 */
bf890a93 11009 { "xbeginT", { Skip_MODRM, Jv }, 0 },
42164a71 11010 },
b844680a 11011 {
1ceb70f8 11012 /* RM_0F01_REG_0 */
a4e78aa5 11013 { "enclv", { Skip_MODRM }, 0 },
bf890a93
IT
11014 { "vmcall", { Skip_MODRM }, 0 },
11015 { "vmlaunch", { Skip_MODRM }, 0 },
11016 { "vmresume", { Skip_MODRM }, 0 },
11017 { "vmxoff", { Skip_MODRM }, 0 },
be3a8dca 11018 { "pconfig", { Skip_MODRM }, 0 },
b844680a
L
11019 },
11020 {
1ceb70f8 11021 /* RM_0F01_REG_1 */
bf890a93
IT
11022 { "monitor", { { OP_Monitor, 0 } }, 0 },
11023 { "mwait", { { OP_Mwait, 0 } }, 0 },
11024 { "clac", { Skip_MODRM }, 0 },
11025 { "stac", { Skip_MODRM }, 0 },
2cf200a4
IT
11026 { Bad_Opcode },
11027 { Bad_Opcode },
11028 { Bad_Opcode },
bf890a93 11029 { "encls", { Skip_MODRM }, 0 },
b844680a 11030 },
475a2301
L
11031 {
11032 /* RM_0F01_REG_2 */
bf890a93
IT
11033 { "xgetbv", { Skip_MODRM }, 0 },
11034 { "xsetbv", { Skip_MODRM }, 0 },
8729a6f6
L
11035 { Bad_Opcode },
11036 { Bad_Opcode },
bf890a93
IT
11037 { "vmfunc", { Skip_MODRM }, 0 },
11038 { "xend", { Skip_MODRM }, 0 },
11039 { "xtest", { Skip_MODRM }, 0 },
11040 { "enclu", { Skip_MODRM }, 0 },
475a2301 11041 },
b844680a 11042 {
1ceb70f8 11043 /* RM_0F01_REG_3 */
bf890a93
IT
11044 { "vmrun", { Skip_MODRM }, 0 },
11045 { "vmmcall", { Skip_MODRM }, 0 },
11046 { "vmload", { Skip_MODRM }, 0 },
11047 { "vmsave", { Skip_MODRM }, 0 },
11048 { "stgi", { Skip_MODRM }, 0 },
11049 { "clgi", { Skip_MODRM }, 0 },
11050 { "skinit", { Skip_MODRM }, 0 },
11051 { "invlpga", { Skip_MODRM }, 0 },
4e7d34a6 11052 },
8eab4136
L
11053 {
11054 /* RM_0F01_REG_5 */
2234eee6 11055 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_0) },
8eab4136 11056 { Bad_Opcode },
603555e5 11057 { PREFIX_TABLE (PREFIX_MOD_3_0F01_REG_5_RM_2) },
8eab4136
L
11058 { Bad_Opcode },
11059 { Bad_Opcode },
11060 { Bad_Opcode },
11061 { "rdpkru", { Skip_MODRM }, 0 },
11062 { "wrpkru", { Skip_MODRM }, 0 },
11063 },
4e7d34a6 11064 {
1ceb70f8 11065 /* RM_0F01_REG_7 */
bf890a93
IT
11066 { "swapgs", { Skip_MODRM }, 0 },
11067 { "rdtscp", { Skip_MODRM }, 0 },
9916071f
AP
11068 { "monitorx", { { OP_Monitor, 0 } }, 0 },
11069 { "mwaitx", { { OP_Mwaitx, 0 } }, 0 },
bf890a93 11070 { "clzero", { Skip_MODRM }, 0 },
b844680a 11071 },
603555e5
L
11072 {
11073 /* RM_0F1E_MOD_3_REG_7 */
11074 { "nopQ", { Ev }, 0 },
11075 { "nopQ", { Ev }, 0 },
11076 { "endbr64", { Skip_MODRM }, PREFIX_OPCODE },
11077 { "endbr32", { Skip_MODRM }, PREFIX_OPCODE },
11078 { "nopQ", { Ev }, 0 },
11079 { "nopQ", { Ev }, 0 },
11080 { "nopQ", { Ev }, 0 },
11081 { "nopQ", { Ev }, 0 },
11082 },
b844680a 11083 {
1ceb70f8 11084 /* RM_0FAE_REG_6 */
bf890a93 11085 { "mfence", { Skip_MODRM }, 0 },
b844680a 11086 },
bbedc832 11087 {
1ceb70f8 11088 /* RM_0FAE_REG_7 */
b5cefcca
L
11089 { "sfence", { Skip_MODRM }, 0 },
11090
144c41d9 11091 },
b844680a
L
11092};
11093
c608c12e
AM
11094#define INTERNAL_DISASSEMBLER_ERROR _("<internal disassembler error>")
11095
f16cd0d5
L
11096/* We use the high bit to indicate different name for the same
11097 prefix. */
f16cd0d5 11098#define REP_PREFIX (0xf3 | 0x100)
42164a71
L
11099#define XACQUIRE_PREFIX (0xf2 | 0x200)
11100#define XRELEASE_PREFIX (0xf3 | 0x400)
7e8b059b 11101#define BND_PREFIX (0xf2 | 0x400)
04ef582a 11102#define NOTRACK_PREFIX (0x3e | 0x100)
f16cd0d5
L
11103
11104static int
26ca5450 11105ckprefix (void)
252b5132 11106{
f16cd0d5 11107 int newrex, i, length;
52b15da3 11108 rex = 0;
c0f3af97 11109 rex_ignored = 0;
252b5132 11110 prefixes = 0;
7d421014 11111 used_prefixes = 0;
52b15da3 11112 rex_used = 0;
f16cd0d5
L
11113 last_lock_prefix = -1;
11114 last_repz_prefix = -1;
11115 last_repnz_prefix = -1;
11116 last_data_prefix = -1;
11117 last_addr_prefix = -1;
11118 last_rex_prefix = -1;
11119 last_seg_prefix = -1;
d9949a36 11120 fwait_prefix = -1;
285ca992 11121 active_seg_prefix = 0;
f310f33d
L
11122 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
11123 all_prefixes[i] = 0;
11124 i = 0;
f16cd0d5
L
11125 length = 0;
11126 /* The maximum instruction length is 15bytes. */
11127 while (length < MAX_CODE_LENGTH - 1)
252b5132
RH
11128 {
11129 FETCH_DATA (the_info, codep + 1);
52b15da3 11130 newrex = 0;
252b5132
RH
11131 switch (*codep)
11132 {
52b15da3
JH
11133 /* REX prefixes family. */
11134 case 0x40:
11135 case 0x41:
11136 case 0x42:
11137 case 0x43:
11138 case 0x44:
11139 case 0x45:
11140 case 0x46:
11141 case 0x47:
11142 case 0x48:
11143 case 0x49:
11144 case 0x4a:
11145 case 0x4b:
11146 case 0x4c:
11147 case 0x4d:
11148 case 0x4e:
11149 case 0x4f:
f16cd0d5
L
11150 if (address_mode == mode_64bit)
11151 newrex = *codep;
11152 else
11153 return 1;
11154 last_rex_prefix = i;
52b15da3 11155 break;
252b5132
RH
11156 case 0xf3:
11157 prefixes |= PREFIX_REPZ;
f16cd0d5 11158 last_repz_prefix = i;
252b5132
RH
11159 break;
11160 case 0xf2:
11161 prefixes |= PREFIX_REPNZ;
f16cd0d5 11162 last_repnz_prefix = i;
252b5132
RH
11163 break;
11164 case 0xf0:
11165 prefixes |= PREFIX_LOCK;
f16cd0d5 11166 last_lock_prefix = i;
252b5132
RH
11167 break;
11168 case 0x2e:
11169 prefixes |= PREFIX_CS;
f16cd0d5 11170 last_seg_prefix = i;
285ca992 11171 active_seg_prefix = PREFIX_CS;
252b5132
RH
11172 break;
11173 case 0x36:
11174 prefixes |= PREFIX_SS;
f16cd0d5 11175 last_seg_prefix = i;
285ca992 11176 active_seg_prefix = PREFIX_SS;
252b5132
RH
11177 break;
11178 case 0x3e:
11179 prefixes |= PREFIX_DS;
f16cd0d5 11180 last_seg_prefix = i;
285ca992 11181 active_seg_prefix = PREFIX_DS;
252b5132
RH
11182 break;
11183 case 0x26:
11184 prefixes |= PREFIX_ES;
f16cd0d5 11185 last_seg_prefix = i;
285ca992 11186 active_seg_prefix = PREFIX_ES;
252b5132
RH
11187 break;
11188 case 0x64:
11189 prefixes |= PREFIX_FS;
f16cd0d5 11190 last_seg_prefix = i;
285ca992 11191 active_seg_prefix = PREFIX_FS;
252b5132
RH
11192 break;
11193 case 0x65:
11194 prefixes |= PREFIX_GS;
f16cd0d5 11195 last_seg_prefix = i;
285ca992 11196 active_seg_prefix = PREFIX_GS;
252b5132
RH
11197 break;
11198 case 0x66:
11199 prefixes |= PREFIX_DATA;
f16cd0d5 11200 last_data_prefix = i;
252b5132
RH
11201 break;
11202 case 0x67:
11203 prefixes |= PREFIX_ADDR;
f16cd0d5 11204 last_addr_prefix = i;
252b5132 11205 break;
5076851f 11206 case FWAIT_OPCODE:
252b5132
RH
11207 /* fwait is really an instruction. If there are prefixes
11208 before the fwait, they belong to the fwait, *not* to the
11209 following instruction. */
d9949a36 11210 fwait_prefix = i;
3e7d61b2 11211 if (prefixes || rex)
252b5132
RH
11212 {
11213 prefixes |= PREFIX_FWAIT;
11214 codep++;
6c067bbb
RM
11215 /* This ensures that the previous REX prefixes are noticed
11216 as unused prefixes, as in the return case below. */
11217 rex_used = rex;
f16cd0d5 11218 return 1;
252b5132
RH
11219 }
11220 prefixes = PREFIX_FWAIT;
11221 break;
11222 default:
f16cd0d5 11223 return 1;
252b5132 11224 }
52b15da3
JH
11225 /* Rex is ignored when followed by another prefix. */
11226 if (rex)
11227 {
3e7d61b2 11228 rex_used = rex;
f16cd0d5 11229 return 1;
52b15da3 11230 }
f16cd0d5 11231 if (*codep != FWAIT_OPCODE)
4e9ac44a 11232 all_prefixes[i++] = *codep;
52b15da3 11233 rex = newrex;
252b5132 11234 codep++;
f16cd0d5
L
11235 length++;
11236 }
11237 return 0;
11238}
11239
7d421014
ILT
11240/* Return the name of the prefix byte PREF, or NULL if PREF is not a
11241 prefix byte. */
11242
11243static const char *
26ca5450 11244prefix_name (int pref, int sizeflag)
7d421014 11245{
0003779b
L
11246 static const char *rexes [16] =
11247 {
11248 "rex", /* 0x40 */
11249 "rex.B", /* 0x41 */
11250 "rex.X", /* 0x42 */
11251 "rex.XB", /* 0x43 */
11252 "rex.R", /* 0x44 */
11253 "rex.RB", /* 0x45 */
11254 "rex.RX", /* 0x46 */
11255 "rex.RXB", /* 0x47 */
11256 "rex.W", /* 0x48 */
11257 "rex.WB", /* 0x49 */
11258 "rex.WX", /* 0x4a */
11259 "rex.WXB", /* 0x4b */
11260 "rex.WR", /* 0x4c */
11261 "rex.WRB", /* 0x4d */
11262 "rex.WRX", /* 0x4e */
11263 "rex.WRXB", /* 0x4f */
11264 };
11265
7d421014
ILT
11266 switch (pref)
11267 {
52b15da3
JH
11268 /* REX prefixes family. */
11269 case 0x40:
52b15da3 11270 case 0x41:
52b15da3 11271 case 0x42:
52b15da3 11272 case 0x43:
52b15da3 11273 case 0x44:
52b15da3 11274 case 0x45:
52b15da3 11275 case 0x46:
52b15da3 11276 case 0x47:
52b15da3 11277 case 0x48:
52b15da3 11278 case 0x49:
52b15da3 11279 case 0x4a:
52b15da3 11280 case 0x4b:
52b15da3 11281 case 0x4c:
52b15da3 11282 case 0x4d:
52b15da3 11283 case 0x4e:
52b15da3 11284 case 0x4f:
0003779b 11285 return rexes [pref - 0x40];
7d421014
ILT
11286 case 0xf3:
11287 return "repz";
11288 case 0xf2:
11289 return "repnz";
11290 case 0xf0:
11291 return "lock";
11292 case 0x2e:
11293 return "cs";
11294 case 0x36:
11295 return "ss";
11296 case 0x3e:
11297 return "ds";
11298 case 0x26:
11299 return "es";
11300 case 0x64:
11301 return "fs";
11302 case 0x65:
11303 return "gs";
11304 case 0x66:
11305 return (sizeflag & DFLAG) ? "data16" : "data32";
11306 case 0x67:
cb712a9e 11307 if (address_mode == mode_64bit)
db6eb5be 11308 return (sizeflag & AFLAG) ? "addr32" : "addr64";
c1a64871 11309 else
2888cb7a 11310 return (sizeflag & AFLAG) ? "addr16" : "addr32";
7d421014
ILT
11311 case FWAIT_OPCODE:
11312 return "fwait";
f16cd0d5
L
11313 case REP_PREFIX:
11314 return "rep";
42164a71
L
11315 case XACQUIRE_PREFIX:
11316 return "xacquire";
11317 case XRELEASE_PREFIX:
11318 return "xrelease";
7e8b059b
L
11319 case BND_PREFIX:
11320 return "bnd";
04ef582a
L
11321 case NOTRACK_PREFIX:
11322 return "notrack";
7d421014
ILT
11323 default:
11324 return NULL;
11325 }
11326}
11327
ce518a5f
L
11328static char op_out[MAX_OPERANDS][100];
11329static int op_ad, op_index[MAX_OPERANDS];
1d9f512f 11330static int two_source_ops;
ce518a5f
L
11331static bfd_vma op_address[MAX_OPERANDS];
11332static bfd_vma op_riprel[MAX_OPERANDS];
52b15da3 11333static bfd_vma start_pc;
ce518a5f 11334
252b5132
RH
11335/*
11336 * On the 386's of 1988, the maximum length of an instruction is 15 bytes.
11337 * (see topic "Redundant prefixes" in the "Differences from 8086"
11338 * section of the "Virtual 8086 Mode" chapter.)
11339 * 'pc' should be the address of this instruction, it will
11340 * be used to print the target address if this is a relative jump or call
11341 * The function returns the length of this instruction in bytes.
11342 */
11343
252b5132 11344static char intel_syntax;
9d141669 11345static char intel_mnemonic = !SYSV386_COMPAT;
252b5132
RH
11346static char open_char;
11347static char close_char;
11348static char separator_char;
11349static char scale_char;
11350
5db04b09
L
11351enum x86_64_isa
11352{
11353 amd64 = 0,
11354 intel64
11355};
11356
11357static enum x86_64_isa isa64;
11358
e396998b
AM
11359/* Here for backwards compatibility. When gdb stops using
11360 print_insn_i386_att and print_insn_i386_intel these functions can
11361 disappear, and print_insn_i386 be merged into print_insn. */
252b5132 11362int
26ca5450 11363print_insn_i386_att (bfd_vma pc, disassemble_info *info)
252b5132
RH
11364{
11365 intel_syntax = 0;
e396998b
AM
11366
11367 return print_insn (pc, info);
252b5132
RH
11368}
11369
11370int
26ca5450 11371print_insn_i386_intel (bfd_vma pc, disassemble_info *info)
252b5132
RH
11372{
11373 intel_syntax = 1;
e396998b
AM
11374
11375 return print_insn (pc, info);
252b5132
RH
11376}
11377
e396998b 11378int
26ca5450 11379print_insn_i386 (bfd_vma pc, disassemble_info *info)
e396998b
AM
11380{
11381 intel_syntax = -1;
11382
11383 return print_insn (pc, info);
11384}
11385
f59a29b9
L
11386void
11387print_i386_disassembler_options (FILE *stream)
11388{
11389 fprintf (stream, _("\n\
11390The following i386/x86-64 specific disassembler options are supported for use\n\
11391with the -M switch (multiple options should be separated by commas):\n"));
11392
11393 fprintf (stream, _(" x86-64 Disassemble in 64bit mode\n"));
11394 fprintf (stream, _(" i386 Disassemble in 32bit mode\n"));
11395 fprintf (stream, _(" i8086 Disassemble in 16bit mode\n"));
11396 fprintf (stream, _(" att Display instruction in AT&T syntax\n"));
11397 fprintf (stream, _(" intel Display instruction in Intel syntax\n"));
9d141669
L
11398 fprintf (stream, _(" att-mnemonic\n"
11399 " Display instruction in AT&T mnemonic\n"));
11400 fprintf (stream, _(" intel-mnemonic\n"
11401 " Display instruction in Intel mnemonic\n"));
f59a29b9
L
11402 fprintf (stream, _(" addr64 Assume 64bit address size\n"));
11403 fprintf (stream, _(" addr32 Assume 32bit address size\n"));
11404 fprintf (stream, _(" addr16 Assume 16bit address size\n"));
11405 fprintf (stream, _(" data32 Assume 32bit data size\n"));
11406 fprintf (stream, _(" data16 Assume 16bit data size\n"));
11407 fprintf (stream, _(" suffix Always display instruction suffix in AT&T syntax\n"));
5db04b09
L
11408 fprintf (stream, _(" amd64 Display instruction in AMD64 ISA\n"));
11409 fprintf (stream, _(" intel64 Display instruction in Intel64 ISA\n"));
f59a29b9
L
11410}
11411
592d1631 11412/* Bad opcode. */
bf890a93 11413static const struct dis386 bad_opcode = { "(bad)", { XX }, 0 };
592d1631 11414
b844680a
L
11415/* Get a pointer to struct dis386 with a valid name. */
11416
11417static const struct dis386 *
8bb15339 11418get_valid_dis386 (const struct dis386 *dp, disassemble_info *info)
b844680a 11419{
91d6fa6a 11420 int vindex, vex_table_index;
b844680a
L
11421
11422 if (dp->name != NULL)
11423 return dp;
11424
11425 switch (dp->op[0].bytemode)
11426 {
1ceb70f8
L
11427 case USE_REG_TABLE:
11428 dp = &reg_table[dp->op[1].bytemode][modrm.reg];
11429 break;
11430
11431 case USE_MOD_TABLE:
91d6fa6a
NC
11432 vindex = modrm.mod == 0x3 ? 1 : 0;
11433 dp = &mod_table[dp->op[1].bytemode][vindex];
1ceb70f8
L
11434 break;
11435
11436 case USE_RM_TABLE:
11437 dp = &rm_table[dp->op[1].bytemode][modrm.rm];
b844680a
L
11438 break;
11439
4e7d34a6 11440 case USE_PREFIX_TABLE:
c0f3af97 11441 if (need_vex)
b844680a 11442 {
c0f3af97
L
11443 /* The prefix in VEX is implicit. */
11444 switch (vex.prefix)
11445 {
11446 case 0:
91d6fa6a 11447 vindex = 0;
c0f3af97
L
11448 break;
11449 case REPE_PREFIX_OPCODE:
91d6fa6a 11450 vindex = 1;
c0f3af97
L
11451 break;
11452 case DATA_PREFIX_OPCODE:
91d6fa6a 11453 vindex = 2;
c0f3af97
L
11454 break;
11455 case REPNE_PREFIX_OPCODE:
91d6fa6a 11456 vindex = 3;
c0f3af97
L
11457 break;
11458 default:
11459 abort ();
11460 break;
11461 }
b844680a 11462 }
7bb15c6f 11463 else
b844680a 11464 {
285ca992
L
11465 int last_prefix = -1;
11466 int prefix = 0;
91d6fa6a 11467 vindex = 0;
285ca992
L
11468 /* We check PREFIX_REPNZ and PREFIX_REPZ before PREFIX_DATA.
11469 When there are multiple PREFIX_REPNZ and PREFIX_REPZ, the
11470 last one wins. */
11471 if ((prefixes & (PREFIX_REPZ | PREFIX_REPNZ)) != 0)
b844680a 11472 {
285ca992 11473 if (last_repz_prefix > last_repnz_prefix)
c0f3af97 11474 {
285ca992
L
11475 vindex = 1;
11476 prefix = PREFIX_REPZ;
11477 last_prefix = last_repz_prefix;
c0f3af97
L
11478 }
11479 else
b844680a 11480 {
285ca992
L
11481 vindex = 3;
11482 prefix = PREFIX_REPNZ;
11483 last_prefix = last_repnz_prefix;
b844680a 11484 }
285ca992 11485
507bd325
L
11486 /* Check if prefix should be ignored. */
11487 if ((((prefix_table[dp->op[1].bytemode][vindex].prefix_requirement
11488 & PREFIX_IGNORED) >> PREFIX_IGNORED_SHIFT)
11489 & prefix) != 0)
285ca992
L
11490 vindex = 0;
11491 }
11492
11493 if (vindex == 0 && (prefixes & PREFIX_DATA) != 0)
11494 {
11495 vindex = 2;
11496 prefix = PREFIX_DATA;
11497 last_prefix = last_data_prefix;
11498 }
11499
11500 if (vindex != 0)
11501 {
11502 used_prefixes |= prefix;
11503 all_prefixes[last_prefix] = 0;
b844680a
L
11504 }
11505 }
91d6fa6a 11506 dp = &prefix_table[dp->op[1].bytemode][vindex];
b844680a
L
11507 break;
11508
4e7d34a6 11509 case USE_X86_64_TABLE:
91d6fa6a
NC
11510 vindex = address_mode == mode_64bit ? 1 : 0;
11511 dp = &x86_64_table[dp->op[1].bytemode][vindex];
b844680a
L
11512 break;
11513
4e7d34a6 11514 case USE_3BYTE_TABLE:
8bb15339 11515 FETCH_DATA (info, codep + 2);
91d6fa6a
NC
11516 vindex = *codep++;
11517 dp = &three_byte_table[dp->op[1].bytemode][vindex];
285ca992 11518 end_codep = codep;
8bb15339
L
11519 modrm.mod = (*codep >> 6) & 3;
11520 modrm.reg = (*codep >> 3) & 7;
11521 modrm.rm = *codep & 7;
11522 break;
11523
c0f3af97
L
11524 case USE_VEX_LEN_TABLE:
11525 if (!need_vex)
11526 abort ();
11527
11528 switch (vex.length)
11529 {
11530 case 128:
91d6fa6a 11531 vindex = 0;
c0f3af97
L
11532 break;
11533 case 256:
91d6fa6a 11534 vindex = 1;
c0f3af97
L
11535 break;
11536 default:
11537 abort ();
11538 break;
11539 }
11540
91d6fa6a 11541 dp = &vex_len_table[dp->op[1].bytemode][vindex];
c0f3af97
L
11542 break;
11543
04e2a182
L
11544 case USE_EVEX_LEN_TABLE:
11545 if (!vex.evex)
11546 abort ();
11547
11548 switch (vex.length)
11549 {
11550 case 128:
11551 vindex = 0;
11552 break;
11553 case 256:
11554 vindex = 1;
11555 break;
11556 case 512:
11557 vindex = 2;
11558 break;
11559 default:
11560 abort ();
11561 break;
11562 }
11563
11564 dp = &evex_len_table[dp->op[1].bytemode][vindex];
11565 break;
11566
f88c9eb0
SP
11567 case USE_XOP_8F_TABLE:
11568 FETCH_DATA (info, codep + 3);
11569 /* All bits in the REX prefix are ignored. */
11570 rex_ignored = rex;
11571 rex = ~(*codep >> 5) & 0x7;
11572
11573 /* VEX_TABLE_INDEX is the mmmmm part of the XOP byte 1 "RCB.mmmmm". */
11574 switch ((*codep & 0x1f))
11575 {
11576 default:
f07af43e
L
11577 dp = &bad_opcode;
11578 return dp;
5dd85c99
SP
11579 case 0x8:
11580 vex_table_index = XOP_08;
11581 break;
f88c9eb0
SP
11582 case 0x9:
11583 vex_table_index = XOP_09;
11584 break;
11585 case 0xa:
11586 vex_table_index = XOP_0A;
11587 break;
11588 }
11589 codep++;
11590 vex.w = *codep & 0x80;
11591 if (vex.w && address_mode == mode_64bit)
11592 rex |= REX_W;
11593
11594 vex.register_specifier = (~(*codep >> 3)) & 0xf;
abfcb414 11595 if (address_mode != mode_64bit)
f07af43e 11596 {
abfcb414
AP
11597 /* In 16/32-bit mode REX_B is silently ignored. */
11598 rex &= ~REX_B;
f07af43e 11599 }
f88c9eb0
SP
11600
11601 vex.length = (*codep & 0x4) ? 256 : 128;
11602 switch ((*codep & 0x3))
11603 {
11604 case 0:
f88c9eb0
SP
11605 break;
11606 case 1:
11607 vex.prefix = DATA_PREFIX_OPCODE;
11608 break;
11609 case 2:
11610 vex.prefix = REPE_PREFIX_OPCODE;
11611 break;
11612 case 3:
11613 vex.prefix = REPNE_PREFIX_OPCODE;
11614 break;
11615 }
11616 need_vex = 1;
11617 need_vex_reg = 1;
11618 codep++;
91d6fa6a
NC
11619 vindex = *codep++;
11620 dp = &xop_table[vex_table_index][vindex];
c48244a5 11621
285ca992 11622 end_codep = codep;
c48244a5
SP
11623 FETCH_DATA (info, codep + 1);
11624 modrm.mod = (*codep >> 6) & 3;
11625 modrm.reg = (*codep >> 3) & 7;
11626 modrm.rm = *codep & 7;
f88c9eb0
SP
11627 break;
11628
c0f3af97 11629 case USE_VEX_C4_TABLE:
43234a1e 11630 /* VEX prefix. */
c0f3af97
L
11631 FETCH_DATA (info, codep + 3);
11632 /* All bits in the REX prefix are ignored. */
11633 rex_ignored = rex;
11634 rex = ~(*codep >> 5) & 0x7;
11635 switch ((*codep & 0x1f))
11636 {
11637 default:
f07af43e
L
11638 dp = &bad_opcode;
11639 return dp;
c0f3af97 11640 case 0x1:
f88c9eb0 11641 vex_table_index = VEX_0F;
c0f3af97
L
11642 break;
11643 case 0x2:
f88c9eb0 11644 vex_table_index = VEX_0F38;
c0f3af97
L
11645 break;
11646 case 0x3:
f88c9eb0 11647 vex_table_index = VEX_0F3A;
c0f3af97
L
11648 break;
11649 }
11650 codep++;
11651 vex.w = *codep & 0x80;
9889cbb1 11652 if (address_mode == mode_64bit)
f07af43e 11653 {
9889cbb1
L
11654 if (vex.w)
11655 rex |= REX_W;
9889cbb1
L
11656 }
11657 else
11658 {
11659 /* For the 3-byte VEX prefix in 32-bit mode, the REX_B bit
11660 is ignored, other REX bits are 0 and the highest bit in
5f847646 11661 VEX.vvvv is also ignored (but we mustn't clear it here). */
9889cbb1 11662 rex = 0;
f07af43e 11663 }
5f847646 11664 vex.register_specifier = (~(*codep >> 3)) & 0xf;
c0f3af97
L
11665 vex.length = (*codep & 0x4) ? 256 : 128;
11666 switch ((*codep & 0x3))
11667 {
11668 case 0:
c0f3af97
L
11669 break;
11670 case 1:
11671 vex.prefix = DATA_PREFIX_OPCODE;
11672 break;
11673 case 2:
11674 vex.prefix = REPE_PREFIX_OPCODE;
11675 break;
11676 case 3:
11677 vex.prefix = REPNE_PREFIX_OPCODE;
11678 break;
11679 }
11680 need_vex = 1;
11681 need_vex_reg = 1;
11682 codep++;
91d6fa6a
NC
11683 vindex = *codep++;
11684 dp = &vex_table[vex_table_index][vindex];
285ca992 11685 end_codep = codep;
53c4d625
JB
11686 /* There is no MODRM byte for VEX0F 77. */
11687 if (vex_table_index != VEX_0F || vindex != 0x77)
c0f3af97
L
11688 {
11689 FETCH_DATA (info, codep + 1);
11690 modrm.mod = (*codep >> 6) & 3;
11691 modrm.reg = (*codep >> 3) & 7;
11692 modrm.rm = *codep & 7;
11693 }
11694 break;
11695
11696 case USE_VEX_C5_TABLE:
43234a1e 11697 /* VEX prefix. */
c0f3af97
L
11698 FETCH_DATA (info, codep + 2);
11699 /* All bits in the REX prefix are ignored. */
11700 rex_ignored = rex;
11701 rex = (*codep & 0x80) ? 0 : REX_R;
11702
9889cbb1
L
11703 /* For the 2-byte VEX prefix in 32-bit mode, the highest bit in
11704 VEX.vvvv is 1. */
c0f3af97 11705 vex.register_specifier = (~(*codep >> 3)) & 0xf;
c0f3af97
L
11706 vex.length = (*codep & 0x4) ? 256 : 128;
11707 switch ((*codep & 0x3))
11708 {
11709 case 0:
c0f3af97
L
11710 break;
11711 case 1:
11712 vex.prefix = DATA_PREFIX_OPCODE;
11713 break;
11714 case 2:
11715 vex.prefix = REPE_PREFIX_OPCODE;
11716 break;
11717 case 3:
11718 vex.prefix = REPNE_PREFIX_OPCODE;
11719 break;
11720 }
11721 need_vex = 1;
11722 need_vex_reg = 1;
11723 codep++;
91d6fa6a
NC
11724 vindex = *codep++;
11725 dp = &vex_table[dp->op[1].bytemode][vindex];
285ca992 11726 end_codep = codep;
53c4d625
JB
11727 /* There is no MODRM byte for VEX 77. */
11728 if (vindex != 0x77)
c0f3af97
L
11729 {
11730 FETCH_DATA (info, codep + 1);
11731 modrm.mod = (*codep >> 6) & 3;
11732 modrm.reg = (*codep >> 3) & 7;
11733 modrm.rm = *codep & 7;
11734 }
11735 break;
11736
9e30b8e0
L
11737 case USE_VEX_W_TABLE:
11738 if (!need_vex)
11739 abort ();
11740
11741 dp = &vex_w_table[dp->op[1].bytemode][vex.w ? 1 : 0];
11742 break;
11743
43234a1e
L
11744 case USE_EVEX_TABLE:
11745 two_source_ops = 0;
11746 /* EVEX prefix. */
11747 vex.evex = 1;
11748 FETCH_DATA (info, codep + 4);
11749 /* All bits in the REX prefix are ignored. */
11750 rex_ignored = rex;
11751 /* The first byte after 0x62. */
11752 rex = ~(*codep >> 5) & 0x7;
11753 vex.r = *codep & 0x10;
11754 switch ((*codep & 0xf))
11755 {
11756 default:
11757 return &bad_opcode;
11758 case 0x1:
11759 vex_table_index = EVEX_0F;
11760 break;
11761 case 0x2:
11762 vex_table_index = EVEX_0F38;
11763 break;
11764 case 0x3:
11765 vex_table_index = EVEX_0F3A;
11766 break;
11767 }
11768
11769 /* The second byte after 0x62. */
11770 codep++;
11771 vex.w = *codep & 0x80;
11772 if (vex.w && address_mode == mode_64bit)
11773 rex |= REX_W;
11774
11775 vex.register_specifier = (~(*codep >> 3)) & 0xf;
43234a1e
L
11776
11777 /* The U bit. */
11778 if (!(*codep & 0x4))
11779 return &bad_opcode;
11780
11781 switch ((*codep & 0x3))
11782 {
11783 case 0:
43234a1e
L
11784 break;
11785 case 1:
11786 vex.prefix = DATA_PREFIX_OPCODE;
11787 break;
11788 case 2:
11789 vex.prefix = REPE_PREFIX_OPCODE;
11790 break;
11791 case 3:
11792 vex.prefix = REPNE_PREFIX_OPCODE;
11793 break;
11794 }
11795
11796 /* The third byte after 0x62. */
11797 codep++;
11798
11799 /* Remember the static rounding bits. */
11800 vex.ll = (*codep >> 5) & 3;
11801 vex.b = (*codep & 0x10) != 0;
11802
11803 vex.v = *codep & 0x8;
11804 vex.mask_register_specifier = *codep & 0x7;
11805 vex.zeroing = *codep & 0x80;
11806
5f847646
JB
11807 if (address_mode != mode_64bit)
11808 {
11809 /* In 16/32-bit mode silently ignore following bits. */
11810 rex &= ~REX_B;
11811 vex.r = 1;
11812 vex.v = 1;
11813 }
11814
43234a1e
L
11815 need_vex = 1;
11816 need_vex_reg = 1;
11817 codep++;
11818 vindex = *codep++;
11819 dp = &evex_table[vex_table_index][vindex];
285ca992 11820 end_codep = codep;
43234a1e
L
11821 FETCH_DATA (info, codep + 1);
11822 modrm.mod = (*codep >> 6) & 3;
11823 modrm.reg = (*codep >> 3) & 7;
11824 modrm.rm = *codep & 7;
11825
11826 /* Set vector length. */
11827 if (modrm.mod == 3 && vex.b)
11828 vex.length = 512;
11829 else
11830 {
11831 switch (vex.ll)
11832 {
11833 case 0x0:
11834 vex.length = 128;
11835 break;
11836 case 0x1:
11837 vex.length = 256;
11838 break;
11839 case 0x2:
11840 vex.length = 512;
11841 break;
11842 default:
11843 return &bad_opcode;
11844 }
11845 }
11846 break;
11847
592d1631
L
11848 case 0:
11849 dp = &bad_opcode;
11850 break;
11851
b844680a 11852 default:
d34b5006 11853 abort ();
b844680a
L
11854 }
11855
11856 if (dp->name != NULL)
11857 return dp;
11858 else
8bb15339 11859 return get_valid_dis386 (dp, info);
b844680a
L
11860}
11861
dfc8cf43 11862static void
55cf16e1 11863get_sib (disassemble_info *info, int sizeflag)
dfc8cf43
L
11864{
11865 /* If modrm.mod == 3, operand must be register. */
11866 if (need_modrm
55cf16e1 11867 && ((sizeflag & AFLAG) || address_mode == mode_64bit)
dfc8cf43
L
11868 && modrm.mod != 3
11869 && modrm.rm == 4)
11870 {
11871 FETCH_DATA (info, codep + 2);
11872 sib.index = (codep [1] >> 3) & 7;
11873 sib.scale = (codep [1] >> 6) & 3;
11874 sib.base = codep [1] & 7;
11875 }
11876}
11877
e396998b 11878static int
26ca5450 11879print_insn (bfd_vma pc, disassemble_info *info)
252b5132 11880{
2da11e11 11881 const struct dis386 *dp;
252b5132 11882 int i;
ce518a5f 11883 char *op_txt[MAX_OPERANDS];
252b5132 11884 int needcomma;
df18fdba 11885 int sizeflag, orig_sizeflag;
e396998b 11886 const char *p;
252b5132 11887 struct dis_private priv;
f16cd0d5 11888 int prefix_length;
252b5132 11889
d7921315
L
11890 priv.orig_sizeflag = AFLAG | DFLAG;
11891 if ((info->mach & bfd_mach_i386_i386) != 0)
cb712a9e 11892 address_mode = mode_32bit;
2da11e11 11893 else if (info->mach == bfd_mach_i386_i8086)
d7921315
L
11894 {
11895 address_mode = mode_16bit;
11896 priv.orig_sizeflag = 0;
11897 }
2da11e11 11898 else
d7921315
L
11899 address_mode = mode_64bit;
11900
11901 if (intel_syntax == (char) -1)
11902 intel_syntax = (info->mach & bfd_mach_i386_intel_syntax) != 0;
e396998b
AM
11903
11904 for (p = info->disassembler_options; p != NULL; )
11905 {
5db04b09
L
11906 if (CONST_STRNEQ (p, "amd64"))
11907 isa64 = amd64;
11908 else if (CONST_STRNEQ (p, "intel64"))
11909 isa64 = intel64;
11910 else if (CONST_STRNEQ (p, "x86-64"))
e396998b 11911 {
cb712a9e 11912 address_mode = mode_64bit;
e396998b
AM
11913 priv.orig_sizeflag = AFLAG | DFLAG;
11914 }
0112cd26 11915 else if (CONST_STRNEQ (p, "i386"))
e396998b 11916 {
cb712a9e 11917 address_mode = mode_32bit;
e396998b
AM
11918 priv.orig_sizeflag = AFLAG | DFLAG;
11919 }
0112cd26 11920 else if (CONST_STRNEQ (p, "i8086"))
e396998b 11921 {
cb712a9e 11922 address_mode = mode_16bit;
e396998b
AM
11923 priv.orig_sizeflag = 0;
11924 }
0112cd26 11925 else if (CONST_STRNEQ (p, "intel"))
e396998b
AM
11926 {
11927 intel_syntax = 1;
9d141669
L
11928 if (CONST_STRNEQ (p + 5, "-mnemonic"))
11929 intel_mnemonic = 1;
e396998b 11930 }
0112cd26 11931 else if (CONST_STRNEQ (p, "att"))
e396998b
AM
11932 {
11933 intel_syntax = 0;
9d141669
L
11934 if (CONST_STRNEQ (p + 3, "-mnemonic"))
11935 intel_mnemonic = 0;
e396998b 11936 }
0112cd26 11937 else if (CONST_STRNEQ (p, "addr"))
e396998b 11938 {
f59a29b9
L
11939 if (address_mode == mode_64bit)
11940 {
11941 if (p[4] == '3' && p[5] == '2')
11942 priv.orig_sizeflag &= ~AFLAG;
11943 else if (p[4] == '6' && p[5] == '4')
11944 priv.orig_sizeflag |= AFLAG;
11945 }
11946 else
11947 {
11948 if (p[4] == '1' && p[5] == '6')
11949 priv.orig_sizeflag &= ~AFLAG;
11950 else if (p[4] == '3' && p[5] == '2')
11951 priv.orig_sizeflag |= AFLAG;
11952 }
e396998b 11953 }
0112cd26 11954 else if (CONST_STRNEQ (p, "data"))
e396998b
AM
11955 {
11956 if (p[4] == '1' && p[5] == '6')
11957 priv.orig_sizeflag &= ~DFLAG;
11958 else if (p[4] == '3' && p[5] == '2')
11959 priv.orig_sizeflag |= DFLAG;
11960 }
0112cd26 11961 else if (CONST_STRNEQ (p, "suffix"))
e396998b
AM
11962 priv.orig_sizeflag |= SUFFIX_ALWAYS;
11963
11964 p = strchr (p, ',');
11965 if (p != NULL)
11966 p++;
11967 }
11968
c0f92bf9
L
11969 if (address_mode == mode_64bit && sizeof (bfd_vma) < 8)
11970 {
11971 (*info->fprintf_func) (info->stream,
11972 _("64-bit address is disabled"));
11973 return -1;
11974 }
11975
e396998b
AM
11976 if (intel_syntax)
11977 {
11978 names64 = intel_names64;
11979 names32 = intel_names32;
11980 names16 = intel_names16;
11981 names8 = intel_names8;
11982 names8rex = intel_names8rex;
11983 names_seg = intel_names_seg;
b9733481 11984 names_mm = intel_names_mm;
7e8b059b 11985 names_bnd = intel_names_bnd;
b9733481
L
11986 names_xmm = intel_names_xmm;
11987 names_ymm = intel_names_ymm;
43234a1e 11988 names_zmm = intel_names_zmm;
db51cc60
L
11989 index64 = intel_index64;
11990 index32 = intel_index32;
43234a1e 11991 names_mask = intel_names_mask;
e396998b
AM
11992 index16 = intel_index16;
11993 open_char = '[';
11994 close_char = ']';
11995 separator_char = '+';
11996 scale_char = '*';
11997 }
11998 else
11999 {
12000 names64 = att_names64;
12001 names32 = att_names32;
12002 names16 = att_names16;
12003 names8 = att_names8;
12004 names8rex = att_names8rex;
12005 names_seg = att_names_seg;
b9733481 12006 names_mm = att_names_mm;
7e8b059b 12007 names_bnd = att_names_bnd;
b9733481
L
12008 names_xmm = att_names_xmm;
12009 names_ymm = att_names_ymm;
43234a1e 12010 names_zmm = att_names_zmm;
db51cc60
L
12011 index64 = att_index64;
12012 index32 = att_index32;
43234a1e 12013 names_mask = att_names_mask;
e396998b
AM
12014 index16 = att_index16;
12015 open_char = '(';
12016 close_char = ')';
12017 separator_char = ',';
12018 scale_char = ',';
12019 }
2da11e11 12020
4fe53c98 12021 /* The output looks better if we put 7 bytes on a line, since that
8a9036a4
L
12022 puts most long word instructions on a single line. Use 8 bytes
12023 for Intel L1OM. */
d7921315 12024 if ((info->mach & bfd_mach_l1om) != 0)
8a9036a4
L
12025 info->bytes_per_line = 8;
12026 else
12027 info->bytes_per_line = 7;
252b5132 12028
26ca5450 12029 info->private_data = &priv;
252b5132
RH
12030 priv.max_fetched = priv.the_buffer;
12031 priv.insn_start = pc;
252b5132
RH
12032
12033 obuf[0] = 0;
ce518a5f
L
12034 for (i = 0; i < MAX_OPERANDS; ++i)
12035 {
12036 op_out[i][0] = 0;
12037 op_index[i] = -1;
12038 }
252b5132
RH
12039
12040 the_info = info;
12041 start_pc = pc;
e396998b
AM
12042 start_codep = priv.the_buffer;
12043 codep = priv.the_buffer;
252b5132 12044
8df14d78 12045 if (OPCODES_SIGSETJMP (priv.bailout) != 0)
5076851f 12046 {
7d421014
ILT
12047 const char *name;
12048
5076851f 12049 /* Getting here means we tried for data but didn't get it. That
e396998b
AM
12050 means we have an incomplete instruction of some sort. Just
12051 print the first byte as a prefix or a .byte pseudo-op. */
12052 if (codep > priv.the_buffer)
5076851f 12053 {
e396998b 12054 name = prefix_name (priv.the_buffer[0], priv.orig_sizeflag);
7d421014
ILT
12055 if (name != NULL)
12056 (*info->fprintf_func) (info->stream, "%s", name);
12057 else
5076851f 12058 {
7d421014
ILT
12059 /* Just print the first byte as a .byte instruction. */
12060 (*info->fprintf_func) (info->stream, ".byte 0x%x",
e396998b 12061 (unsigned int) priv.the_buffer[0]);
5076851f 12062 }
5076851f 12063
7d421014 12064 return 1;
5076851f
ILT
12065 }
12066
12067 return -1;
12068 }
12069
52b15da3 12070 obufp = obuf;
f16cd0d5
L
12071 sizeflag = priv.orig_sizeflag;
12072
12073 if (!ckprefix () || rex_used)
12074 {
12075 /* Too many prefixes or unused REX prefixes. */
12076 for (i = 0;
f6dd4781 12077 i < (int) ARRAY_SIZE (all_prefixes) && all_prefixes[i];
f16cd0d5 12078 i++)
de882298 12079 (*info->fprintf_func) (info->stream, "%s%s",
6c067bbb 12080 i == 0 ? "" : " ",
f16cd0d5 12081 prefix_name (all_prefixes[i], sizeflag));
de882298 12082 return i;
f16cd0d5 12083 }
252b5132
RH
12084
12085 insn_codep = codep;
12086
12087 FETCH_DATA (info, codep + 1);
12088 two_source_ops = (*codep == 0x62) || (*codep == 0xc8);
12089
3e7d61b2 12090 if (((prefixes & PREFIX_FWAIT)
f16cd0d5 12091 && ((*codep < 0xd8) || (*codep > 0xdf))))
252b5132 12092 {
86a80a50 12093 /* Handle prefixes before fwait. */
d9949a36 12094 for (i = 0; i < fwait_prefix && all_prefixes[i];
86a80a50
L
12095 i++)
12096 (*info->fprintf_func) (info->stream, "%s ",
12097 prefix_name (all_prefixes[i], sizeflag));
f16cd0d5 12098 (*info->fprintf_func) (info->stream, "fwait");
86a80a50 12099 return i + 1;
252b5132
RH
12100 }
12101
252b5132
RH
12102 if (*codep == 0x0f)
12103 {
eec0f4ca 12104 unsigned char threebyte;
5f40e14d
JS
12105
12106 codep++;
12107 FETCH_DATA (info, codep + 1);
12108 threebyte = *codep;
eec0f4ca 12109 dp = &dis386_twobyte[threebyte];
252b5132 12110 need_modrm = twobyte_has_modrm[*codep];
eec0f4ca 12111 codep++;
252b5132
RH
12112 }
12113 else
12114 {
6439fc28 12115 dp = &dis386[*codep];
252b5132 12116 need_modrm = onebyte_has_modrm[*codep];
eec0f4ca 12117 codep++;
252b5132 12118 }
246c51aa 12119
df18fdba
L
12120 /* Save sizeflag for printing the extra prefixes later before updating
12121 it for mnemonic and operand processing. The prefix names depend
12122 only on the address mode. */
12123 orig_sizeflag = sizeflag;
c608c12e 12124 if (prefixes & PREFIX_ADDR)
df18fdba 12125 sizeflag ^= AFLAG;
b844680a 12126 if ((prefixes & PREFIX_DATA))
df18fdba 12127 sizeflag ^= DFLAG;
3ffd33cf 12128
285ca992 12129 end_codep = codep;
8bb15339 12130 if (need_modrm)
252b5132
RH
12131 {
12132 FETCH_DATA (info, codep + 1);
7967e09e
L
12133 modrm.mod = (*codep >> 6) & 3;
12134 modrm.reg = (*codep >> 3) & 7;
12135 modrm.rm = *codep & 7;
252b5132
RH
12136 }
12137
42d5f9c6
MS
12138 need_vex = 0;
12139 need_vex_reg = 0;
12140 vex_w_done = 0;
caf0678c 12141 memset (&vex, 0, sizeof (vex));
55b126d4 12142
ce518a5f 12143 if (dp->name == NULL && dp->op[0].bytemode == FLOATCODE)
252b5132 12144 {
55cf16e1 12145 get_sib (info, sizeflag);
252b5132
RH
12146 dofloat (sizeflag);
12147 }
12148 else
12149 {
8bb15339 12150 dp = get_valid_dis386 (dp, info);
b844680a 12151 if (dp != NULL && putop (dp->name, sizeflag) == 0)
6c067bbb 12152 {
55cf16e1 12153 get_sib (info, sizeflag);
ce518a5f
L
12154 for (i = 0; i < MAX_OPERANDS; ++i)
12155 {
246c51aa 12156 obufp = op_out[i];
ce518a5f
L
12157 op_ad = MAX_OPERANDS - 1 - i;
12158 if (dp->op[i].rtn)
12159 (*dp->op[i].rtn) (dp->op[i].bytemode, sizeflag);
43234a1e
L
12160 /* For EVEX instruction after the last operand masking
12161 should be printed. */
12162 if (i == 0 && vex.evex)
12163 {
12164 /* Don't print {%k0}. */
12165 if (vex.mask_register_specifier)
12166 {
12167 oappend ("{");
12168 oappend (names_mask[vex.mask_register_specifier]);
12169 oappend ("}");
12170 }
12171 if (vex.zeroing)
12172 oappend ("{z}");
12173 }
ce518a5f 12174 }
6439fc28 12175 }
252b5132
RH
12176 }
12177
63c6fc6c
L
12178 /* If VEX.vvvv and EVEX.vvvv are unused, they must be all 1s, which
12179 are all 0s in inverted form. */
12180 if (need_vex && vex.register_specifier != 0)
12181 {
12182 (*info->fprintf_func) (info->stream, "(bad)");
12183 return end_codep - priv.the_buffer;
12184 }
12185
d869730d 12186 /* Check if the REX prefix is used. */
e2e6193d 12187 if (rex_ignored == 0 && (rex ^ rex_used) == 0 && last_rex_prefix >= 0)
f16cd0d5
L
12188 all_prefixes[last_rex_prefix] = 0;
12189
5e6718e4 12190 /* Check if the SEG prefix is used. */
f16cd0d5
L
12191 if ((prefixes & (PREFIX_CS | PREFIX_SS | PREFIX_DS | PREFIX_ES
12192 | PREFIX_FS | PREFIX_GS)) != 0
285ca992 12193 && (used_prefixes & active_seg_prefix) != 0)
f16cd0d5
L
12194 all_prefixes[last_seg_prefix] = 0;
12195
5e6718e4 12196 /* Check if the ADDR prefix is used. */
f16cd0d5
L
12197 if ((prefixes & PREFIX_ADDR) != 0
12198 && (used_prefixes & PREFIX_ADDR) != 0)
12199 all_prefixes[last_addr_prefix] = 0;
12200
df18fdba
L
12201 /* Check if the DATA prefix is used. */
12202 if ((prefixes & PREFIX_DATA) != 0
12203 && (used_prefixes & PREFIX_DATA) != 0)
12204 all_prefixes[last_data_prefix] = 0;
f16cd0d5 12205
df18fdba 12206 /* Print the extra prefixes. */
f16cd0d5 12207 prefix_length = 0;
f310f33d 12208 for (i = 0; i < (int) ARRAY_SIZE (all_prefixes); i++)
f16cd0d5
L
12209 if (all_prefixes[i])
12210 {
12211 const char *name;
df18fdba 12212 name = prefix_name (all_prefixes[i], orig_sizeflag);
f16cd0d5
L
12213 if (name == NULL)
12214 abort ();
12215 prefix_length += strlen (name) + 1;
12216 (*info->fprintf_func) (info->stream, "%s ", name);
12217 }
b844680a 12218
285ca992
L
12219 /* If the mandatory PREFIX_REPZ/PREFIX_REPNZ/PREFIX_DATA prefix is
12220 unused, opcode is invalid. Since the PREFIX_DATA prefix may be
12221 used by putop and MMX/SSE operand and may be overriden by the
12222 PREFIX_REPZ/PREFIX_REPNZ fix, we check the PREFIX_DATA prefix
12223 separately. */
3888916d 12224 if (dp->prefix_requirement == PREFIX_OPCODE
285ca992
L
12225 && dp != &bad_opcode
12226 && (((prefixes
12227 & (PREFIX_REPZ | PREFIX_REPNZ)) != 0
12228 && (used_prefixes
12229 & (PREFIX_REPZ | PREFIX_REPNZ)) == 0)
12230 || ((((prefixes
12231 & (PREFIX_REPZ | PREFIX_REPNZ | PREFIX_DATA))
12232 == PREFIX_DATA)
12233 && (used_prefixes & PREFIX_DATA) == 0))))
12234 {
12235 (*info->fprintf_func) (info->stream, "(bad)");
12236 return end_codep - priv.the_buffer;
12237 }
12238
f16cd0d5
L
12239 /* Check maximum code length. */
12240 if ((codep - start_codep) > MAX_CODE_LENGTH)
12241 {
12242 (*info->fprintf_func) (info->stream, "(bad)");
12243 return MAX_CODE_LENGTH;
12244 }
b844680a 12245
ea397f5b 12246 obufp = mnemonicendp;
f16cd0d5 12247 for (i = strlen (obuf) + prefix_length; i < 6; i++)
252b5132
RH
12248 oappend (" ");
12249 oappend (" ");
12250 (*info->fprintf_func) (info->stream, "%s", obuf);
12251
12252 /* The enter and bound instructions are printed with operands in the same
12253 order as the intel book; everything else is printed in reverse order. */
2da11e11 12254 if (intel_syntax || two_source_ops)
252b5132 12255 {
185b1163
L
12256 bfd_vma riprel;
12257
ce518a5f 12258 for (i = 0; i < MAX_OPERANDS; ++i)
6c067bbb 12259 op_txt[i] = op_out[i];
246c51aa 12260
3a8547d2
JB
12261 if (intel_syntax && dp && dp->op[2].rtn == OP_Rounding
12262 && dp->op[3].rtn == OP_E && dp->op[4].rtn == NULL)
12263 {
12264 op_txt[2] = op_out[3];
12265 op_txt[3] = op_out[2];
12266 }
12267
ce518a5f
L
12268 for (i = 0; i < (MAX_OPERANDS >> 1); ++i)
12269 {
6c067bbb
RM
12270 op_ad = op_index[i];
12271 op_index[i] = op_index[MAX_OPERANDS - 1 - i];
12272 op_index[MAX_OPERANDS - 1 - i] = op_ad;
185b1163
L
12273 riprel = op_riprel[i];
12274 op_riprel[i] = op_riprel [MAX_OPERANDS - 1 - i];
12275 op_riprel[MAX_OPERANDS - 1 - i] = riprel;
ce518a5f 12276 }
252b5132
RH
12277 }
12278 else
12279 {
ce518a5f 12280 for (i = 0; i < MAX_OPERANDS; ++i)
6c067bbb 12281 op_txt[MAX_OPERANDS - 1 - i] = op_out[i];
050dfa73
MM
12282 }
12283
ce518a5f
L
12284 needcomma = 0;
12285 for (i = 0; i < MAX_OPERANDS; ++i)
12286 if (*op_txt[i])
12287 {
12288 if (needcomma)
12289 (*info->fprintf_func) (info->stream, ",");
12290 if (op_index[i] != -1 && !op_riprel[i])
12291 (*info->print_address_func) ((bfd_vma) op_address[op_index[i]], info);
12292 else
12293 (*info->fprintf_func) (info->stream, "%s", op_txt[i]);
12294 needcomma = 1;
12295 }
050dfa73 12296
ce518a5f 12297 for (i = 0; i < MAX_OPERANDS; i++)
52b15da3
JH
12298 if (op_index[i] != -1 && op_riprel[i])
12299 {
12300 (*info->fprintf_func) (info->stream, " # ");
4fd7268a 12301 (*info->print_address_func) ((bfd_vma) (start_pc + (codep - start_codep)
52b15da3 12302 + op_address[op_index[i]]), info);
185b1163 12303 break;
52b15da3 12304 }
e396998b 12305 return codep - priv.the_buffer;
252b5132
RH
12306}
12307
6439fc28 12308static const char *float_mem[] = {
252b5132 12309 /* d8 */
7c52e0e8
L
12310 "fadd{s|}",
12311 "fmul{s|}",
12312 "fcom{s|}",
12313 "fcomp{s|}",
12314 "fsub{s|}",
12315 "fsubr{s|}",
12316 "fdiv{s|}",
12317 "fdivr{s|}",
db6eb5be 12318 /* d9 */
7c52e0e8 12319 "fld{s|}",
252b5132 12320 "(bad)",
7c52e0e8
L
12321 "fst{s|}",
12322 "fstp{s|}",
9306ca4a 12323 "fldenvIC",
252b5132 12324 "fldcw",
9306ca4a 12325 "fNstenvIC",
252b5132
RH
12326 "fNstcw",
12327 /* da */
7c52e0e8
L
12328 "fiadd{l|}",
12329 "fimul{l|}",
12330 "ficom{l|}",
12331 "ficomp{l|}",
12332 "fisub{l|}",
12333 "fisubr{l|}",
12334 "fidiv{l|}",
12335 "fidivr{l|}",
252b5132 12336 /* db */
7c52e0e8
L
12337 "fild{l|}",
12338 "fisttp{l|}",
12339 "fist{l|}",
12340 "fistp{l|}",
252b5132 12341 "(bad)",
6439fc28 12342 "fld{t||t|}",
252b5132 12343 "(bad)",
6439fc28 12344 "fstp{t||t|}",
252b5132 12345 /* dc */
7c52e0e8
L
12346 "fadd{l|}",
12347 "fmul{l|}",
12348 "fcom{l|}",
12349 "fcomp{l|}",
12350 "fsub{l|}",
12351 "fsubr{l|}",
12352 "fdiv{l|}",
12353 "fdivr{l|}",
252b5132 12354 /* dd */
7c52e0e8
L
12355 "fld{l|}",
12356 "fisttp{ll|}",
12357 "fst{l||}",
12358 "fstp{l|}",
9306ca4a 12359 "frstorIC",
252b5132 12360 "(bad)",
9306ca4a 12361 "fNsaveIC",
252b5132
RH
12362 "fNstsw",
12363 /* de */
ac465521
JB
12364 "fiadd{s|}",
12365 "fimul{s|}",
12366 "ficom{s|}",
12367 "ficomp{s|}",
12368 "fisub{s|}",
12369 "fisubr{s|}",
12370 "fidiv{s|}",
12371 "fidivr{s|}",
252b5132 12372 /* df */
ac465521
JB
12373 "fild{s|}",
12374 "fisttp{s|}",
12375 "fist{s|}",
12376 "fistp{s|}",
252b5132 12377 "fbld",
7c52e0e8 12378 "fild{ll|}",
252b5132 12379 "fbstp",
7c52e0e8 12380 "fistp{ll|}",
1d9f512f
AM
12381};
12382
12383static const unsigned char float_mem_mode[] = {
12384 /* d8 */
12385 d_mode,
12386 d_mode,
12387 d_mode,
12388 d_mode,
12389 d_mode,
12390 d_mode,
12391 d_mode,
12392 d_mode,
12393 /* d9 */
12394 d_mode,
12395 0,
12396 d_mode,
12397 d_mode,
12398 0,
12399 w_mode,
12400 0,
12401 w_mode,
12402 /* da */
12403 d_mode,
12404 d_mode,
12405 d_mode,
12406 d_mode,
12407 d_mode,
12408 d_mode,
12409 d_mode,
12410 d_mode,
12411 /* db */
12412 d_mode,
12413 d_mode,
12414 d_mode,
12415 d_mode,
12416 0,
9306ca4a 12417 t_mode,
1d9f512f 12418 0,
9306ca4a 12419 t_mode,
1d9f512f
AM
12420 /* dc */
12421 q_mode,
12422 q_mode,
12423 q_mode,
12424 q_mode,
12425 q_mode,
12426 q_mode,
12427 q_mode,
12428 q_mode,
12429 /* dd */
12430 q_mode,
12431 q_mode,
12432 q_mode,
12433 q_mode,
12434 0,
12435 0,
12436 0,
12437 w_mode,
12438 /* de */
12439 w_mode,
12440 w_mode,
12441 w_mode,
12442 w_mode,
12443 w_mode,
12444 w_mode,
12445 w_mode,
12446 w_mode,
12447 /* df */
12448 w_mode,
12449 w_mode,
12450 w_mode,
12451 w_mode,
9306ca4a 12452 t_mode,
1d9f512f 12453 q_mode,
9306ca4a 12454 t_mode,
1d9f512f 12455 q_mode
252b5132
RH
12456};
12457
ce518a5f
L
12458#define ST { OP_ST, 0 }
12459#define STi { OP_STi, 0 }
252b5132 12460
48c97fa1
L
12461#define FGRPd9_2 NULL, { { NULL, 1 } }, 0
12462#define FGRPd9_4 NULL, { { NULL, 2 } }, 0
12463#define FGRPd9_5 NULL, { { NULL, 3 } }, 0
12464#define FGRPd9_6 NULL, { { NULL, 4 } }, 0
12465#define FGRPd9_7 NULL, { { NULL, 5 } }, 0
12466#define FGRPda_5 NULL, { { NULL, 6 } }, 0
12467#define FGRPdb_4 NULL, { { NULL, 7 } }, 0
12468#define FGRPde_3 NULL, { { NULL, 8 } }, 0
12469#define FGRPdf_4 NULL, { { NULL, 9 } }, 0
252b5132 12470
2da11e11 12471static const struct dis386 float_reg[][8] = {
252b5132
RH
12472 /* d8 */
12473 {
bf890a93
IT
12474 { "fadd", { ST, STi }, 0 },
12475 { "fmul", { ST, STi }, 0 },
12476 { "fcom", { STi }, 0 },
12477 { "fcomp", { STi }, 0 },
12478 { "fsub", { ST, STi }, 0 },
12479 { "fsubr", { ST, STi }, 0 },
12480 { "fdiv", { ST, STi }, 0 },
12481 { "fdivr", { ST, STi }, 0 },
252b5132
RH
12482 },
12483 /* d9 */
12484 {
bf890a93
IT
12485 { "fld", { STi }, 0 },
12486 { "fxch", { STi }, 0 },
252b5132 12487 { FGRPd9_2 },
592d1631 12488 { Bad_Opcode },
252b5132
RH
12489 { FGRPd9_4 },
12490 { FGRPd9_5 },
12491 { FGRPd9_6 },
12492 { FGRPd9_7 },
12493 },
12494 /* da */
12495 {
bf890a93
IT
12496 { "fcmovb", { ST, STi }, 0 },
12497 { "fcmove", { ST, STi }, 0 },
12498 { "fcmovbe",{ ST, STi }, 0 },
12499 { "fcmovu", { ST, STi }, 0 },
592d1631 12500 { Bad_Opcode },
252b5132 12501 { FGRPda_5 },
592d1631
L
12502 { Bad_Opcode },
12503 { Bad_Opcode },
252b5132
RH
12504 },
12505 /* db */
12506 {
bf890a93
IT
12507 { "fcmovnb",{ ST, STi }, 0 },
12508 { "fcmovne",{ ST, STi }, 0 },
12509 { "fcmovnbe",{ ST, STi }, 0 },
12510 { "fcmovnu",{ ST, STi }, 0 },
252b5132 12511 { FGRPdb_4 },
bf890a93
IT
12512 { "fucomi", { ST, STi }, 0 },
12513 { "fcomi", { ST, STi }, 0 },
592d1631 12514 { Bad_Opcode },
252b5132
RH
12515 },
12516 /* dc */
12517 {
bf890a93
IT
12518 { "fadd", { STi, ST }, 0 },
12519 { "fmul", { STi, ST }, 0 },
592d1631
L
12520 { Bad_Opcode },
12521 { Bad_Opcode },
d53e6b98
JB
12522 { "fsub{!M|r}", { STi, ST }, 0 },
12523 { "fsub{M|}", { STi, ST }, 0 },
12524 { "fdiv{!M|r}", { STi, ST }, 0 },
12525 { "fdiv{M|}", { STi, ST }, 0 },
252b5132
RH
12526 },
12527 /* dd */
12528 {
bf890a93 12529 { "ffree", { STi }, 0 },
592d1631 12530 { Bad_Opcode },
bf890a93
IT
12531 { "fst", { STi }, 0 },
12532 { "fstp", { STi }, 0 },
12533 { "fucom", { STi }, 0 },
12534 { "fucomp", { STi }, 0 },
592d1631
L
12535 { Bad_Opcode },
12536 { Bad_Opcode },
252b5132
RH
12537 },
12538 /* de */
12539 {
bf890a93
IT
12540 { "faddp", { STi, ST }, 0 },
12541 { "fmulp", { STi, ST }, 0 },
592d1631 12542 { Bad_Opcode },
252b5132 12543 { FGRPde_3 },
d53e6b98
JB
12544 { "fsub{!M|r}p", { STi, ST }, 0 },
12545 { "fsub{M|}p", { STi, ST }, 0 },
12546 { "fdiv{!M|r}p", { STi, ST }, 0 },
12547 { "fdiv{M|}p", { STi, ST }, 0 },
252b5132
RH
12548 },
12549 /* df */
12550 {
bf890a93 12551 { "ffreep", { STi }, 0 },
592d1631
L
12552 { Bad_Opcode },
12553 { Bad_Opcode },
12554 { Bad_Opcode },
252b5132 12555 { FGRPdf_4 },
bf890a93
IT
12556 { "fucomip", { ST, STi }, 0 },
12557 { "fcomip", { ST, STi }, 0 },
592d1631 12558 { Bad_Opcode },
252b5132
RH
12559 },
12560};
12561
252b5132 12562static char *fgrps[][8] = {
48c97fa1
L
12563 /* Bad opcode 0 */
12564 {
12565 "(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12566 },
12567
12568 /* d9_2 1 */
252b5132
RH
12569 {
12570 "fnop","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12571 },
12572
48c97fa1 12573 /* d9_4 2 */
252b5132
RH
12574 {
12575 "fchs","fabs","(bad)","(bad)","ftst","fxam","(bad)","(bad)",
12576 },
12577
48c97fa1 12578 /* d9_5 3 */
252b5132
RH
12579 {
12580 "fld1","fldl2t","fldl2e","fldpi","fldlg2","fldln2","fldz","(bad)",
12581 },
12582
48c97fa1 12583 /* d9_6 4 */
252b5132
RH
12584 {
12585 "f2xm1","fyl2x","fptan","fpatan","fxtract","fprem1","fdecstp","fincstp",
12586 },
12587
48c97fa1 12588 /* d9_7 5 */
252b5132
RH
12589 {
12590 "fprem","fyl2xp1","fsqrt","fsincos","frndint","fscale","fsin","fcos",
12591 },
12592
48c97fa1 12593 /* da_5 6 */
252b5132
RH
12594 {
12595 "(bad)","fucompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12596 },
12597
48c97fa1 12598 /* db_4 7 */
252b5132 12599 {
309d3373
JB
12600 "fNeni(8087 only)","fNdisi(8087 only)","fNclex","fNinit",
12601 "fNsetpm(287 only)","frstpm(287 only)","(bad)","(bad)",
252b5132
RH
12602 },
12603
48c97fa1 12604 /* de_3 8 */
252b5132
RH
12605 {
12606 "(bad)","fcompp","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12607 },
12608
48c97fa1 12609 /* df_4 9 */
252b5132
RH
12610 {
12611 "fNstsw","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)","(bad)",
12612 },
12613};
12614
b6169b20
L
12615static void
12616swap_operand (void)
12617{
12618 mnemonicendp[0] = '.';
12619 mnemonicendp[1] = 's';
12620 mnemonicendp += 2;
12621}
12622
b844680a
L
12623static void
12624OP_Skip_MODRM (int bytemode ATTRIBUTE_UNUSED,
12625 int sizeflag ATTRIBUTE_UNUSED)
12626{
12627 /* Skip mod/rm byte. */
12628 MODRM_CHECK;
12629 codep++;
12630}
12631
252b5132 12632static void
26ca5450 12633dofloat (int sizeflag)
252b5132 12634{
2da11e11 12635 const struct dis386 *dp;
252b5132
RH
12636 unsigned char floatop;
12637
12638 floatop = codep[-1];
12639
7967e09e 12640 if (modrm.mod != 3)
252b5132 12641 {
7967e09e 12642 int fp_indx = (floatop - 0xd8) * 8 + modrm.reg;
1d9f512f
AM
12643
12644 putop (float_mem[fp_indx], sizeflag);
ce518a5f 12645 obufp = op_out[0];
6e50d963 12646 op_ad = 2;
1d9f512f 12647 OP_E (float_mem_mode[fp_indx], sizeflag);
252b5132
RH
12648 return;
12649 }
6608db57 12650 /* Skip mod/rm byte. */
4bba6815 12651 MODRM_CHECK;
252b5132
RH
12652 codep++;
12653
7967e09e 12654 dp = &float_reg[floatop - 0xd8][modrm.reg];
252b5132
RH
12655 if (dp->name == NULL)
12656 {
7967e09e 12657 putop (fgrps[dp->op[0].bytemode][modrm.rm], sizeflag);
252b5132 12658
6608db57 12659 /* Instruction fnstsw is only one with strange arg. */
252b5132 12660 if (floatop == 0xdf && codep[-1] == 0xe0)
ce518a5f 12661 strcpy (op_out[0], names16[0]);
252b5132
RH
12662 }
12663 else
12664 {
12665 putop (dp->name, sizeflag);
12666
ce518a5f 12667 obufp = op_out[0];
6e50d963 12668 op_ad = 2;
ce518a5f
L
12669 if (dp->op[0].rtn)
12670 (*dp->op[0].rtn) (dp->op[0].bytemode, sizeflag);
6e50d963 12671
ce518a5f 12672 obufp = op_out[1];
6e50d963 12673 op_ad = 1;
ce518a5f
L
12674 if (dp->op[1].rtn)
12675 (*dp->op[1].rtn) (dp->op[1].bytemode, sizeflag);
252b5132
RH
12676 }
12677}
12678
9ce09ba2
RM
12679/* Like oappend (below), but S is a string starting with '%'.
12680 In Intel syntax, the '%' is elided. */
12681static void
12682oappend_maybe_intel (const char *s)
12683{
12684 oappend (s + intel_syntax);
12685}
12686
252b5132 12687static void
26ca5450 12688OP_ST (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
252b5132 12689{
9ce09ba2 12690 oappend_maybe_intel ("%st");
252b5132
RH
12691}
12692
252b5132 12693static void
26ca5450 12694OP_STi (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
252b5132 12695{
7967e09e 12696 sprintf (scratchbuf, "%%st(%d)", modrm.rm);
9ce09ba2 12697 oappend_maybe_intel (scratchbuf);
252b5132
RH
12698}
12699
6608db57 12700/* Capital letters in template are macros. */
6439fc28 12701static int
d3ce72d0 12702putop (const char *in_template, int sizeflag)
252b5132 12703{
2da11e11 12704 const char *p;
9306ca4a 12705 int alt = 0;
9d141669 12706 int cond = 1;
98b528ac
L
12707 unsigned int l = 0, len = 1;
12708 char last[4];
12709
12710#define SAVE_LAST(c) \
12711 if (l < len && l < sizeof (last)) \
12712 last[l++] = c; \
12713 else \
12714 abort ();
252b5132 12715
d3ce72d0 12716 for (p = in_template; *p; p++)
252b5132
RH
12717 {
12718 switch (*p)
12719 {
12720 default:
12721 *obufp++ = *p;
12722 break;
98b528ac
L
12723 case '%':
12724 len++;
12725 break;
9d141669
L
12726 case '!':
12727 cond = 0;
12728 break;
6439fc28 12729 case '{':
6439fc28 12730 if (intel_syntax)
6439fc28
AM
12731 {
12732 while (*++p != '|')
7c52e0e8
L
12733 if (*p == '}' || *p == '\0')
12734 abort ();
6439fc28 12735 }
9306ca4a
JB
12736 /* Fall through. */
12737 case 'I':
12738 alt = 1;
12739 continue;
6439fc28
AM
12740 case '|':
12741 while (*++p != '}')
12742 {
12743 if (*p == '\0')
12744 abort ();
12745 }
12746 break;
12747 case '}':
12748 break;
252b5132 12749 case 'A':
db6eb5be
AM
12750 if (intel_syntax)
12751 break;
7967e09e 12752 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
252b5132
RH
12753 *obufp++ = 'b';
12754 break;
12755 case 'B':
4b06377f
L
12756 if (l == 0 && len == 1)
12757 {
12758case_B:
12759 if (intel_syntax)
12760 break;
12761 if (sizeflag & SUFFIX_ALWAYS)
12762 *obufp++ = 'b';
12763 }
12764 else
12765 {
12766 if (l != 1
12767 || len != 2
12768 || last[0] != 'L')
12769 {
12770 SAVE_LAST (*p);
12771 break;
12772 }
12773
12774 if (address_mode == mode_64bit
12775 && !(prefixes & PREFIX_ADDR))
12776 {
12777 *obufp++ = 'a';
12778 *obufp++ = 'b';
12779 *obufp++ = 's';
12780 }
12781
12782 goto case_B;
12783 }
252b5132 12784 break;
9306ca4a
JB
12785 case 'C':
12786 if (intel_syntax && !alt)
12787 break;
12788 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
12789 {
12790 if (sizeflag & DFLAG)
12791 *obufp++ = intel_syntax ? 'd' : 'l';
12792 else
12793 *obufp++ = intel_syntax ? 'w' : 's';
12794 used_prefixes |= (prefixes & PREFIX_DATA);
12795 }
12796 break;
ed7841b3
JB
12797 case 'D':
12798 if (intel_syntax || !(sizeflag & SUFFIX_ALWAYS))
12799 break;
161a04f6 12800 USED_REX (REX_W);
7967e09e 12801 if (modrm.mod == 3)
ed7841b3 12802 {
161a04f6 12803 if (rex & REX_W)
ed7841b3 12804 *obufp++ = 'q';
ed7841b3 12805 else
f16cd0d5
L
12806 {
12807 if (sizeflag & DFLAG)
12808 *obufp++ = intel_syntax ? 'd' : 'l';
12809 else
12810 *obufp++ = 'w';
12811 used_prefixes |= (prefixes & PREFIX_DATA);
12812 }
ed7841b3
JB
12813 }
12814 else
12815 *obufp++ = 'w';
12816 break;
252b5132 12817 case 'E': /* For jcxz/jecxz */
cb712a9e 12818 if (address_mode == mode_64bit)
c1a64871
JH
12819 {
12820 if (sizeflag & AFLAG)
12821 *obufp++ = 'r';
12822 else
12823 *obufp++ = 'e';
12824 }
12825 else
12826 if (sizeflag & AFLAG)
12827 *obufp++ = 'e';
3ffd33cf
AM
12828 used_prefixes |= (prefixes & PREFIX_ADDR);
12829 break;
12830 case 'F':
db6eb5be
AM
12831 if (intel_syntax)
12832 break;
e396998b 12833 if ((prefixes & PREFIX_ADDR) || (sizeflag & SUFFIX_ALWAYS))
3ffd33cf
AM
12834 {
12835 if (sizeflag & AFLAG)
cb712a9e 12836 *obufp++ = address_mode == mode_64bit ? 'q' : 'l';
3ffd33cf 12837 else
cb712a9e 12838 *obufp++ = address_mode == mode_64bit ? 'l' : 'w';
3ffd33cf
AM
12839 used_prefixes |= (prefixes & PREFIX_ADDR);
12840 }
252b5132 12841 break;
52fd6d94
JB
12842 case 'G':
12843 if (intel_syntax || (obufp[-1] != 's' && !(sizeflag & SUFFIX_ALWAYS)))
12844 break;
161a04f6 12845 if ((rex & REX_W) || (sizeflag & DFLAG))
52fd6d94
JB
12846 *obufp++ = 'l';
12847 else
12848 *obufp++ = 'w';
161a04f6 12849 if (!(rex & REX_W))
52fd6d94
JB
12850 used_prefixes |= (prefixes & PREFIX_DATA);
12851 break;
5dd0794d 12852 case 'H':
db6eb5be
AM
12853 if (intel_syntax)
12854 break;
5dd0794d
AM
12855 if ((prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_CS
12856 || (prefixes & (PREFIX_CS | PREFIX_DS)) == PREFIX_DS)
12857 {
12858 used_prefixes |= prefixes & (PREFIX_CS | PREFIX_DS);
12859 *obufp++ = ',';
12860 *obufp++ = 'p';
12861 if (prefixes & PREFIX_DS)
12862 *obufp++ = 't';
12863 else
12864 *obufp++ = 'n';
12865 }
12866 break;
9306ca4a
JB
12867 case 'J':
12868 if (intel_syntax)
12869 break;
12870 *obufp++ = 'l';
12871 break;
42903f7f
L
12872 case 'K':
12873 USED_REX (REX_W);
12874 if (rex & REX_W)
12875 *obufp++ = 'q';
12876 else
12877 *obufp++ = 'd';
12878 break;
6dd5059a 12879 case 'Z':
04d824a4
JB
12880 if (l != 0 || len != 1)
12881 {
12882 if (l != 1 || len != 2 || last[0] != 'X')
12883 {
12884 SAVE_LAST (*p);
12885 break;
12886 }
12887 if (!need_vex || !vex.evex)
12888 abort ();
12889 if (intel_syntax
12890 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
12891 break;
12892 switch (vex.length)
12893 {
12894 case 128:
12895 *obufp++ = 'x';
12896 break;
12897 case 256:
12898 *obufp++ = 'y';
12899 break;
12900 case 512:
12901 *obufp++ = 'z';
12902 break;
12903 default:
12904 abort ();
12905 }
12906 break;
12907 }
6dd5059a
L
12908 if (intel_syntax)
12909 break;
12910 if (address_mode == mode_64bit && (sizeflag & SUFFIX_ALWAYS))
12911 {
12912 *obufp++ = 'q';
12913 break;
12914 }
12915 /* Fall through. */
98b528ac 12916 goto case_L;
252b5132 12917 case 'L':
98b528ac
L
12918 if (l != 0 || len != 1)
12919 {
12920 SAVE_LAST (*p);
12921 break;
12922 }
12923case_L:
db6eb5be
AM
12924 if (intel_syntax)
12925 break;
252b5132
RH
12926 if (sizeflag & SUFFIX_ALWAYS)
12927 *obufp++ = 'l';
252b5132 12928 break;
9d141669
L
12929 case 'M':
12930 if (intel_mnemonic != cond)
12931 *obufp++ = 'r';
12932 break;
252b5132
RH
12933 case 'N':
12934 if ((prefixes & PREFIX_FWAIT) == 0)
12935 *obufp++ = 'n';
7d421014
ILT
12936 else
12937 used_prefixes |= PREFIX_FWAIT;
252b5132 12938 break;
52b15da3 12939 case 'O':
161a04f6
L
12940 USED_REX (REX_W);
12941 if (rex & REX_W)
6439fc28 12942 *obufp++ = 'o';
a35ca55a
JB
12943 else if (intel_syntax && (sizeflag & DFLAG))
12944 *obufp++ = 'q';
52b15da3
JH
12945 else
12946 *obufp++ = 'd';
161a04f6 12947 if (!(rex & REX_W))
a35ca55a 12948 used_prefixes |= (prefixes & PREFIX_DATA);
52b15da3 12949 break;
07f5af7d
L
12950 case '&':
12951 if (!intel_syntax
12952 && address_mode == mode_64bit
12953 && isa64 == intel64)
12954 {
12955 *obufp++ = 'q';
12956 break;
12957 }
12958 /* Fall through. */
6439fc28 12959 case 'T':
d9e3625e
L
12960 if (!intel_syntax
12961 && address_mode == mode_64bit
7bb15c6f 12962 && ((sizeflag & DFLAG) || (rex & REX_W)))
6439fc28
AM
12963 {
12964 *obufp++ = 'q';
12965 break;
12966 }
6608db57 12967 /* Fall through. */
4b4c407a 12968 goto case_P;
252b5132 12969 case 'P':
4b4c407a 12970 if (l == 0 && len == 1)
d9e3625e 12971 {
4b4c407a
L
12972case_P:
12973 if (intel_syntax)
d9e3625e 12974 {
4b4c407a
L
12975 if ((rex & REX_W) == 0
12976 && (prefixes & PREFIX_DATA))
12977 {
12978 if ((sizeflag & DFLAG) == 0)
12979 *obufp++ = 'w';
12980 used_prefixes |= (prefixes & PREFIX_DATA);
12981 }
12982 break;
12983 }
12984 if ((prefixes & PREFIX_DATA)
12985 || (rex & REX_W)
12986 || (sizeflag & SUFFIX_ALWAYS))
12987 {
12988 USED_REX (REX_W);
12989 if (rex & REX_W)
12990 *obufp++ = 'q';
12991 else
12992 {
12993 if (sizeflag & DFLAG)
12994 *obufp++ = 'l';
12995 else
12996 *obufp++ = 'w';
12997 used_prefixes |= (prefixes & PREFIX_DATA);
12998 }
d9e3625e 12999 }
d9e3625e 13000 }
4b4c407a 13001 else
252b5132 13002 {
4b4c407a
L
13003 if (l != 1 || len != 2 || last[0] != 'L')
13004 {
13005 SAVE_LAST (*p);
13006 break;
13007 }
13008
13009 if ((prefixes & PREFIX_DATA)
13010 || (rex & REX_W)
13011 || (sizeflag & SUFFIX_ALWAYS))
52b15da3 13012 {
4b4c407a
L
13013 USED_REX (REX_W);
13014 if (rex & REX_W)
13015 *obufp++ = 'q';
13016 else
13017 {
13018 if (sizeflag & DFLAG)
13019 *obufp++ = intel_syntax ? 'd' : 'l';
13020 else
13021 *obufp++ = 'w';
13022 used_prefixes |= (prefixes & PREFIX_DATA);
13023 }
52b15da3 13024 }
252b5132
RH
13025 }
13026 break;
6439fc28 13027 case 'U':
db6eb5be
AM
13028 if (intel_syntax)
13029 break;
7bb15c6f 13030 if (address_mode == mode_64bit
6c067bbb 13031 && ((sizeflag & DFLAG) || (rex & REX_W)))
6439fc28 13032 {
7967e09e 13033 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
1a114b12 13034 *obufp++ = 'q';
6439fc28
AM
13035 break;
13036 }
6608db57 13037 /* Fall through. */
98b528ac 13038 goto case_Q;
252b5132 13039 case 'Q':
98b528ac 13040 if (l == 0 && len == 1)
252b5132 13041 {
98b528ac
L
13042case_Q:
13043 if (intel_syntax && !alt)
13044 break;
13045 USED_REX (REX_W);
13046 if (modrm.mod != 3 || (sizeflag & SUFFIX_ALWAYS))
52b15da3 13047 {
98b528ac
L
13048 if (rex & REX_W)
13049 *obufp++ = 'q';
52b15da3 13050 else
98b528ac
L
13051 {
13052 if (sizeflag & DFLAG)
13053 *obufp++ = intel_syntax ? 'd' : 'l';
13054 else
13055 *obufp++ = 'w';
f16cd0d5 13056 used_prefixes |= (prefixes & PREFIX_DATA);
98b528ac 13057 }
52b15da3 13058 }
98b528ac
L
13059 }
13060 else
13061 {
13062 if (l != 1 || len != 2 || last[0] != 'L')
13063 {
13064 SAVE_LAST (*p);
13065 break;
13066 }
13067 if (intel_syntax
13068 || (modrm.mod == 3 && !(sizeflag & SUFFIX_ALWAYS)))
13069 break;
13070 if ((rex & REX_W))
13071 {
13072 USED_REX (REX_W);
13073 *obufp++ = 'q';
13074 }
13075 else
13076 *obufp++ = 'l';
252b5132
RH
13077 }
13078 break;
13079 case 'R':
161a04f6
L
13080 USED_REX (REX_W);
13081 if (rex & REX_W)
a35ca55a
JB
13082 *obufp++ = 'q';
13083 else if (sizeflag & DFLAG)
c608c12e 13084 {
a35ca55a 13085 if (intel_syntax)
c608c12e 13086 *obufp++ = 'd';
c608c12e 13087 else
a35ca55a 13088 *obufp++ = 'l';
c608c12e 13089 }
252b5132 13090 else
a35ca55a
JB
13091 *obufp++ = 'w';
13092 if (intel_syntax && !p[1]
161a04f6 13093 && ((rex & REX_W) || (sizeflag & DFLAG)))
a35ca55a 13094 *obufp++ = 'e';
161a04f6 13095 if (!(rex & REX_W))
52b15da3 13096 used_prefixes |= (prefixes & PREFIX_DATA);
252b5132 13097 break;
1a114b12 13098 case 'V':
4b06377f 13099 if (l == 0 && len == 1)
1a114b12 13100 {
4b06377f
L
13101 if (intel_syntax)
13102 break;
7bb15c6f 13103 if (address_mode == mode_64bit
6c067bbb 13104 && ((sizeflag & DFLAG) || (rex & REX_W)))
4b06377f
L
13105 {
13106 if (sizeflag & SUFFIX_ALWAYS)
13107 *obufp++ = 'q';
13108 break;
13109 }
13110 }
13111 else
13112 {
13113 if (l != 1
13114 || len != 2
13115 || last[0] != 'L')
13116 {
13117 SAVE_LAST (*p);
13118 break;
13119 }
13120
13121 if (rex & REX_W)
13122 {
13123 *obufp++ = 'a';
13124 *obufp++ = 'b';
13125 *obufp++ = 's';
13126 }
1a114b12
JB
13127 }
13128 /* Fall through. */
4b06377f 13129 goto case_S;
252b5132 13130 case 'S':
4b06377f 13131 if (l == 0 && len == 1)
252b5132 13132 {
4b06377f
L
13133case_S:
13134 if (intel_syntax)
13135 break;
13136 if (sizeflag & SUFFIX_ALWAYS)
52b15da3 13137 {
4b06377f
L
13138 if (rex & REX_W)
13139 *obufp++ = 'q';
52b15da3 13140 else
4b06377f
L
13141 {
13142 if (sizeflag & DFLAG)
13143 *obufp++ = 'l';
13144 else
13145 *obufp++ = 'w';
13146 used_prefixes |= (prefixes & PREFIX_DATA);
13147 }
13148 }
13149 }
13150 else
13151 {
13152 if (l != 1
13153 || len != 2
13154 || last[0] != 'L')
13155 {
13156 SAVE_LAST (*p);
13157 break;
52b15da3 13158 }
4b06377f
L
13159
13160 if (address_mode == mode_64bit
13161 && !(prefixes & PREFIX_ADDR))
13162 {
13163 *obufp++ = 'a';
13164 *obufp++ = 'b';
13165 *obufp++ = 's';
13166 }
13167
13168 goto case_S;
252b5132 13169 }
252b5132 13170 break;
041bd2e0 13171 case 'X':
c0f3af97
L
13172 if (l != 0 || len != 1)
13173 {
13174 SAVE_LAST (*p);
13175 break;
13176 }
13177 if (need_vex && vex.prefix)
13178 {
13179 if (vex.prefix == DATA_PREFIX_OPCODE)
13180 *obufp++ = 'd';
13181 else
13182 *obufp++ = 's';
13183 }
041bd2e0 13184 else
f16cd0d5
L
13185 {
13186 if (prefixes & PREFIX_DATA)
13187 *obufp++ = 'd';
13188 else
13189 *obufp++ = 's';
13190 used_prefixes |= (prefixes & PREFIX_DATA);
13191 }
041bd2e0 13192 break;
76f227a5 13193 case 'Y':
c0f3af97 13194 if (l == 0 && len == 1)
9646c87b 13195 abort ();
c0f3af97
L
13196 else
13197 {
13198 if (l != 1 || len != 2 || last[0] != 'X')
13199 {
13200 SAVE_LAST (*p);
13201 break;
13202 }
13203 if (!need_vex)
13204 abort ();
13205 if (intel_syntax
04d824a4 13206 || ((modrm.mod == 3 || vex.b) && !(sizeflag & SUFFIX_ALWAYS)))
c0f3af97
L
13207 break;
13208 switch (vex.length)
13209 {
13210 case 128:
13211 *obufp++ = 'x';
13212 break;
13213 case 256:
13214 *obufp++ = 'y';
13215 break;
04d824a4
JB
13216 case 512:
13217 if (!vex.evex)
c0f3af97 13218 default:
04d824a4 13219 abort ();
c0f3af97 13220 }
76f227a5
JH
13221 }
13222 break;
252b5132 13223 case 'W':
0bfee649 13224 if (l == 0 && len == 1)
a35ca55a 13225 {
0bfee649
L
13226 /* operand size flag for cwtl, cbtw */
13227 USED_REX (REX_W);
13228 if (rex & REX_W)
13229 {
13230 if (intel_syntax)
13231 *obufp++ = 'd';
13232 else
13233 *obufp++ = 'l';
13234 }
13235 else if (sizeflag & DFLAG)
13236 *obufp++ = 'w';
a35ca55a 13237 else
0bfee649
L
13238 *obufp++ = 'b';
13239 if (!(rex & REX_W))
13240 used_prefixes |= (prefixes & PREFIX_DATA);
a35ca55a 13241 }
252b5132 13242 else
0bfee649 13243 {
6c30d220
L
13244 if (l != 1
13245 || len != 2
13246 || (last[0] != 'X'
13247 && last[0] != 'L'))
0bfee649
L
13248 {
13249 SAVE_LAST (*p);
13250 break;
13251 }
13252 if (!need_vex)
13253 abort ();
6c30d220
L
13254 if (last[0] == 'X')
13255 *obufp++ = vex.w ? 'd': 's';
13256 else
13257 *obufp++ = vex.w ? 'q': 'd';
0bfee649 13258 }
252b5132 13259 break;
a72d2af2
L
13260 case '^':
13261 if (intel_syntax)
13262 break;
13263 if ((prefixes & PREFIX_DATA) || (sizeflag & SUFFIX_ALWAYS))
13264 {
13265 if (sizeflag & DFLAG)
13266 *obufp++ = 'l';
13267 else
13268 *obufp++ = 'w';
13269 used_prefixes |= (prefixes & PREFIX_DATA);
13270 }
13271 break;
5db04b09
L
13272 case '@':
13273 if (intel_syntax)
13274 break;
13275 if (address_mode == mode_64bit
13276 && (isa64 == intel64
13277 || ((sizeflag & DFLAG) || (rex & REX_W))))
13278 *obufp++ = 'q';
13279 else if ((prefixes & PREFIX_DATA))
13280 {
13281 if (!(sizeflag & DFLAG))
13282 *obufp++ = 'w';
13283 used_prefixes |= (prefixes & PREFIX_DATA);
13284 }
13285 break;
252b5132 13286 }
9306ca4a 13287 alt = 0;
252b5132
RH
13288 }
13289 *obufp = 0;
ea397f5b 13290 mnemonicendp = obufp;
6439fc28 13291 return 0;
252b5132
RH
13292}
13293
13294static void
26ca5450 13295oappend (const char *s)
252b5132 13296{
ea397f5b 13297 obufp = stpcpy (obufp, s);
252b5132
RH
13298}
13299
13300static void
26ca5450 13301append_seg (void)
252b5132 13302{
285ca992
L
13303 /* Only print the active segment register. */
13304 if (!active_seg_prefix)
13305 return;
13306
13307 used_prefixes |= active_seg_prefix;
13308 switch (active_seg_prefix)
7d421014 13309 {
285ca992 13310 case PREFIX_CS:
9ce09ba2 13311 oappend_maybe_intel ("%cs:");
285ca992
L
13312 break;
13313 case PREFIX_DS:
9ce09ba2 13314 oappend_maybe_intel ("%ds:");
285ca992
L
13315 break;
13316 case PREFIX_SS:
9ce09ba2 13317 oappend_maybe_intel ("%ss:");
285ca992
L
13318 break;
13319 case PREFIX_ES:
9ce09ba2 13320 oappend_maybe_intel ("%es:");
285ca992
L
13321 break;
13322 case PREFIX_FS:
9ce09ba2 13323 oappend_maybe_intel ("%fs:");
285ca992
L
13324 break;
13325 case PREFIX_GS:
9ce09ba2 13326 oappend_maybe_intel ("%gs:");
285ca992
L
13327 break;
13328 default:
13329 break;
7d421014 13330 }
252b5132
RH
13331}
13332
13333static void
26ca5450 13334OP_indirE (int bytemode, int sizeflag)
252b5132
RH
13335{
13336 if (!intel_syntax)
13337 oappend ("*");
13338 OP_E (bytemode, sizeflag);
13339}
13340
52b15da3 13341static void
26ca5450 13342print_operand_value (char *buf, int hex, bfd_vma disp)
52b15da3 13343{
cb712a9e 13344 if (address_mode == mode_64bit)
52b15da3
JH
13345 {
13346 if (hex)
13347 {
13348 char tmp[30];
13349 int i;
13350 buf[0] = '0';
13351 buf[1] = 'x';
13352 sprintf_vma (tmp, disp);
6608db57 13353 for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++);
52b15da3
JH
13354 strcpy (buf + 2, tmp + i);
13355 }
13356 else
13357 {
13358 bfd_signed_vma v = disp;
13359 char tmp[30];
13360 int i;
13361 if (v < 0)
13362 {
13363 *(buf++) = '-';
13364 v = -disp;
6608db57 13365 /* Check for possible overflow on 0x8000000000000000. */
52b15da3
JH
13366 if (v < 0)
13367 {
13368 strcpy (buf, "9223372036854775808");
13369 return;
13370 }
13371 }
13372 if (!v)
13373 {
13374 strcpy (buf, "0");
13375 return;
13376 }
13377
13378 i = 0;
13379 tmp[29] = 0;
13380 while (v)
13381 {
6608db57 13382 tmp[28 - i] = (v % 10) + '0';
52b15da3
JH
13383 v /= 10;
13384 i++;
13385 }
13386 strcpy (buf, tmp + 29 - i);
13387 }
13388 }
13389 else
13390 {
13391 if (hex)
13392 sprintf (buf, "0x%x", (unsigned int) disp);
13393 else
13394 sprintf (buf, "%d", (int) disp);
13395 }
13396}
13397
5d669648
L
13398/* Put DISP in BUF as signed hex number. */
13399
13400static void
13401print_displacement (char *buf, bfd_vma disp)
13402{
13403 bfd_signed_vma val = disp;
13404 char tmp[30];
13405 int i, j = 0;
13406
13407 if (val < 0)
13408 {
13409 buf[j++] = '-';
13410 val = -disp;
13411
13412 /* Check for possible overflow. */
13413 if (val < 0)
13414 {
13415 switch (address_mode)
13416 {
13417 case mode_64bit:
13418 strcpy (buf + j, "0x8000000000000000");
13419 break;
13420 case mode_32bit:
13421 strcpy (buf + j, "0x80000000");
13422 break;
13423 case mode_16bit:
13424 strcpy (buf + j, "0x8000");
13425 break;
13426 }
13427 return;
13428 }
13429 }
13430
13431 buf[j++] = '0';
13432 buf[j++] = 'x';
13433
0af1713e 13434 sprintf_vma (tmp, (bfd_vma) val);
5d669648
L
13435 for (i = 0; tmp[i] == '0'; i++)
13436 continue;
13437 if (tmp[i] == '\0')
13438 i--;
13439 strcpy (buf + j, tmp + i);
13440}
13441
3f31e633
JB
13442static void
13443intel_operand_size (int bytemode, int sizeflag)
13444{
43234a1e
L
13445 if (vex.evex
13446 && vex.b
13447 && (bytemode == x_mode
13448 || bytemode == evex_half_bcst_xmmq_mode))
13449 {
13450 if (vex.w)
13451 oappend ("QWORD PTR ");
13452 else
13453 oappend ("DWORD PTR ");
13454 return;
13455 }
3f31e633
JB
13456 switch (bytemode)
13457 {
13458 case b_mode:
b6169b20 13459 case b_swap_mode:
42903f7f 13460 case dqb_mode:
1ba585e8 13461 case db_mode:
3f31e633
JB
13462 oappend ("BYTE PTR ");
13463 break;
13464 case w_mode:
1ba585e8 13465 case dw_mode:
3f31e633
JB
13466 case dqw_mode:
13467 oappend ("WORD PTR ");
13468 break;
07f5af7d
L
13469 case indir_v_mode:
13470 if (address_mode == mode_64bit && isa64 == intel64)
13471 {
13472 oappend ("QWORD PTR ");
13473 break;
13474 }
1a0670f3 13475 /* Fall through. */
1a114b12 13476 case stack_v_mode:
7bb15c6f 13477 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
3f31e633
JB
13478 {
13479 oappend ("QWORD PTR ");
3f31e633
JB
13480 break;
13481 }
1a0670f3 13482 /* Fall through. */
3f31e633 13483 case v_mode:
b6169b20 13484 case v_swap_mode:
3f31e633 13485 case dq_mode:
161a04f6
L
13486 USED_REX (REX_W);
13487 if (rex & REX_W)
3f31e633 13488 oappend ("QWORD PTR ");
3f31e633 13489 else
f16cd0d5
L
13490 {
13491 if ((sizeflag & DFLAG) || bytemode == dq_mode)
13492 oappend ("DWORD PTR ");
13493 else
13494 oappend ("WORD PTR ");
13495 used_prefixes |= (prefixes & PREFIX_DATA);
13496 }
3f31e633 13497 break;
52fd6d94 13498 case z_mode:
161a04f6 13499 if ((rex & REX_W) || (sizeflag & DFLAG))
52fd6d94
JB
13500 *obufp++ = 'D';
13501 oappend ("WORD PTR ");
161a04f6 13502 if (!(rex & REX_W))
52fd6d94
JB
13503 used_prefixes |= (prefixes & PREFIX_DATA);
13504 break;
34b772a6
JB
13505 case a_mode:
13506 if (sizeflag & DFLAG)
13507 oappend ("QWORD PTR ");
13508 else
13509 oappend ("DWORD PTR ");
13510 used_prefixes |= (prefixes & PREFIX_DATA);
13511 break;
3f31e633 13512 case d_mode:
539f890d
L
13513 case d_scalar_mode:
13514 case d_scalar_swap_mode:
fa99fab2 13515 case d_swap_mode:
42903f7f 13516 case dqd_mode:
3f31e633
JB
13517 oappend ("DWORD PTR ");
13518 break;
13519 case q_mode:
539f890d
L
13520 case q_scalar_mode:
13521 case q_scalar_swap_mode:
b6169b20 13522 case q_swap_mode:
3f31e633
JB
13523 oappend ("QWORD PTR ");
13524 break;
d20dee9e 13525 case dqa_mode:
3f31e633 13526 case m_mode:
cb712a9e 13527 if (address_mode == mode_64bit)
3f31e633
JB
13528 oappend ("QWORD PTR ");
13529 else
13530 oappend ("DWORD PTR ");
13531 break;
13532 case f_mode:
13533 if (sizeflag & DFLAG)
13534 oappend ("FWORD PTR ");
13535 else
13536 oappend ("DWORD PTR ");
13537 used_prefixes |= (prefixes & PREFIX_DATA);
13538 break;
13539 case t_mode:
13540 oappend ("TBYTE PTR ");
13541 break;
13542 case x_mode:
b6169b20 13543 case x_swap_mode:
43234a1e
L
13544 case evex_x_gscat_mode:
13545 case evex_x_nobcst_mode:
53467f57
IT
13546 case b_scalar_mode:
13547 case w_scalar_mode:
c0f3af97
L
13548 if (need_vex)
13549 {
13550 switch (vex.length)
13551 {
13552 case 128:
13553 oappend ("XMMWORD PTR ");
13554 break;
13555 case 256:
13556 oappend ("YMMWORD PTR ");
13557 break;
43234a1e
L
13558 case 512:
13559 oappend ("ZMMWORD PTR ");
13560 break;
c0f3af97
L
13561 default:
13562 abort ();
13563 }
13564 }
13565 else
13566 oappend ("XMMWORD PTR ");
13567 break;
13568 case xmm_mode:
3f31e633
JB
13569 oappend ("XMMWORD PTR ");
13570 break;
43234a1e
L
13571 case ymm_mode:
13572 oappend ("YMMWORD PTR ");
13573 break;
c0f3af97 13574 case xmmq_mode:
43234a1e 13575 case evex_half_bcst_xmmq_mode:
c0f3af97
L
13576 if (!need_vex)
13577 abort ();
13578
13579 switch (vex.length)
13580 {
13581 case 128:
13582 oappend ("QWORD PTR ");
13583 break;
13584 case 256:
13585 oappend ("XMMWORD PTR ");
13586 break;
43234a1e
L
13587 case 512:
13588 oappend ("YMMWORD PTR ");
13589 break;
c0f3af97
L
13590 default:
13591 abort ();
13592 }
13593 break;
6c30d220
L
13594 case xmm_mb_mode:
13595 if (!need_vex)
13596 abort ();
13597
13598 switch (vex.length)
13599 {
13600 case 128:
13601 case 256:
43234a1e 13602 case 512:
6c30d220
L
13603 oappend ("BYTE PTR ");
13604 break;
13605 default:
13606 abort ();
13607 }
13608 break;
13609 case xmm_mw_mode:
13610 if (!need_vex)
13611 abort ();
13612
13613 switch (vex.length)
13614 {
13615 case 128:
13616 case 256:
43234a1e 13617 case 512:
6c30d220
L
13618 oappend ("WORD PTR ");
13619 break;
13620 default:
13621 abort ();
13622 }
13623 break;
13624 case xmm_md_mode:
13625 if (!need_vex)
13626 abort ();
13627
13628 switch (vex.length)
13629 {
13630 case 128:
13631 case 256:
43234a1e 13632 case 512:
6c30d220
L
13633 oappend ("DWORD PTR ");
13634 break;
13635 default:
13636 abort ();
13637 }
13638 break;
13639 case xmm_mq_mode:
13640 if (!need_vex)
13641 abort ();
13642
13643 switch (vex.length)
13644 {
13645 case 128:
13646 case 256:
43234a1e 13647 case 512:
6c30d220
L
13648 oappend ("QWORD PTR ");
13649 break;
13650 default:
13651 abort ();
13652 }
13653 break;
13654 case xmmdw_mode:
13655 if (!need_vex)
13656 abort ();
13657
13658 switch (vex.length)
13659 {
13660 case 128:
13661 oappend ("WORD PTR ");
13662 break;
13663 case 256:
13664 oappend ("DWORD PTR ");
13665 break;
43234a1e
L
13666 case 512:
13667 oappend ("QWORD PTR ");
13668 break;
6c30d220
L
13669 default:
13670 abort ();
13671 }
13672 break;
13673 case xmmqd_mode:
13674 if (!need_vex)
13675 abort ();
13676
13677 switch (vex.length)
13678 {
13679 case 128:
13680 oappend ("DWORD PTR ");
13681 break;
13682 case 256:
13683 oappend ("QWORD PTR ");
13684 break;
43234a1e
L
13685 case 512:
13686 oappend ("XMMWORD PTR ");
13687 break;
6c30d220
L
13688 default:
13689 abort ();
13690 }
13691 break;
c0f3af97
L
13692 case ymmq_mode:
13693 if (!need_vex)
13694 abort ();
13695
13696 switch (vex.length)
13697 {
13698 case 128:
13699 oappend ("QWORD PTR ");
13700 break;
13701 case 256:
13702 oappend ("YMMWORD PTR ");
13703 break;
43234a1e
L
13704 case 512:
13705 oappend ("ZMMWORD PTR ");
13706 break;
c0f3af97
L
13707 default:
13708 abort ();
13709 }
13710 break;
6c30d220
L
13711 case ymmxmm_mode:
13712 if (!need_vex)
13713 abort ();
13714
13715 switch (vex.length)
13716 {
13717 case 128:
13718 case 256:
13719 oappend ("XMMWORD PTR ");
13720 break;
13721 default:
13722 abort ();
13723 }
13724 break;
fb9c77c7
L
13725 case o_mode:
13726 oappend ("OWORD PTR ");
13727 break;
43234a1e 13728 case xmm_mdq_mode:
0bfee649 13729 case vex_w_dq_mode:
1c480963 13730 case vex_scalar_w_dq_mode:
0bfee649
L
13731 if (!need_vex)
13732 abort ();
13733
13734 if (vex.w)
13735 oappend ("QWORD PTR ");
13736 else
13737 oappend ("DWORD PTR ");
13738 break;
43234a1e
L
13739 case vex_vsib_d_w_dq_mode:
13740 case vex_vsib_q_w_dq_mode:
13741 if (!need_vex)
13742 abort ();
13743
13744 if (!vex.evex)
13745 {
13746 if (vex.w)
13747 oappend ("QWORD PTR ");
13748 else
13749 oappend ("DWORD PTR ");
13750 }
13751 else
13752 {
b28d1bda
IT
13753 switch (vex.length)
13754 {
13755 case 128:
13756 oappend ("XMMWORD PTR ");
13757 break;
13758 case 256:
13759 oappend ("YMMWORD PTR ");
13760 break;
13761 case 512:
13762 oappend ("ZMMWORD PTR ");
13763 break;
13764 default:
13765 abort ();
13766 }
43234a1e
L
13767 }
13768 break;
5fc35d96
IT
13769 case vex_vsib_q_w_d_mode:
13770 case vex_vsib_d_w_d_mode:
b28d1bda 13771 if (!need_vex || !vex.evex)
5fc35d96
IT
13772 abort ();
13773
b28d1bda
IT
13774 switch (vex.length)
13775 {
13776 case 128:
13777 oappend ("QWORD PTR ");
13778 break;
13779 case 256:
13780 oappend ("XMMWORD PTR ");
13781 break;
13782 case 512:
13783 oappend ("YMMWORD PTR ");
13784 break;
13785 default:
13786 abort ();
13787 }
5fc35d96
IT
13788
13789 break;
1ba585e8
IT
13790 case mask_bd_mode:
13791 if (!need_vex || vex.length != 128)
13792 abort ();
13793 if (vex.w)
13794 oappend ("DWORD PTR ");
13795 else
13796 oappend ("BYTE PTR ");
13797 break;
43234a1e
L
13798 case mask_mode:
13799 if (!need_vex)
13800 abort ();
1ba585e8
IT
13801 if (vex.w)
13802 oappend ("QWORD PTR ");
13803 else
13804 oappend ("WORD PTR ");
43234a1e 13805 break;
6c75cc62 13806 case v_bnd_mode:
d276ec69 13807 case v_bndmk_mode:
3f31e633
JB
13808 default:
13809 break;
13810 }
13811}
13812
252b5132 13813static void
c0f3af97 13814OP_E_register (int bytemode, int sizeflag)
252b5132 13815{
c0f3af97
L
13816 int reg = modrm.rm;
13817 const char **names;
252b5132 13818
c0f3af97
L
13819 USED_REX (REX_B);
13820 if ((rex & REX_B))
13821 reg += 8;
252b5132 13822
b6169b20 13823 if ((sizeflag & SUFFIX_ALWAYS)
1ba585e8 13824 && (bytemode == b_swap_mode
9f79e886 13825 || bytemode == bnd_swap_mode
60227d64 13826 || bytemode == v_swap_mode))
b6169b20
L
13827 swap_operand ();
13828
c0f3af97 13829 switch (bytemode)
252b5132 13830 {
c0f3af97 13831 case b_mode:
b6169b20 13832 case b_swap_mode:
c0f3af97
L
13833 USED_REX (0);
13834 if (rex)
13835 names = names8rex;
13836 else
13837 names = names8;
13838 break;
13839 case w_mode:
13840 names = names16;
13841 break;
13842 case d_mode:
1ba585e8
IT
13843 case dw_mode:
13844 case db_mode:
c0f3af97
L
13845 names = names32;
13846 break;
13847 case q_mode:
13848 names = names64;
13849 break;
13850 case m_mode:
6c75cc62 13851 case v_bnd_mode:
c0f3af97
L
13852 names = address_mode == mode_64bit ? names64 : names32;
13853 break;
7e8b059b 13854 case bnd_mode:
9f79e886 13855 case bnd_swap_mode:
0d96e4df
L
13856 if (reg > 0x3)
13857 {
13858 oappend ("(bad)");
13859 return;
13860 }
7e8b059b
L
13861 names = names_bnd;
13862 break;
07f5af7d
L
13863 case indir_v_mode:
13864 if (address_mode == mode_64bit && isa64 == intel64)
13865 {
13866 names = names64;
13867 break;
13868 }
1a0670f3 13869 /* Fall through. */
c0f3af97 13870 case stack_v_mode:
7bb15c6f 13871 if (address_mode == mode_64bit && ((sizeflag & DFLAG) || (rex & REX_W)))
252b5132 13872 {
c0f3af97 13873 names = names64;
252b5132 13874 break;
252b5132 13875 }
c0f3af97 13876 bytemode = v_mode;
1a0670f3 13877 /* Fall through. */
c0f3af97 13878 case v_mode:
b6169b20 13879 case v_swap_mode:
c0f3af97
L
13880 case dq_mode:
13881 case dqb_mode:
13882 case dqd_mode:
13883 case dqw_mode:
d20dee9e 13884 case dqa_mode:
c0f3af97
L
13885 USED_REX (REX_W);
13886 if (rex & REX_W)
13887 names = names64;
c0f3af97 13888 else
f16cd0d5 13889 {
7bb15c6f 13890 if ((sizeflag & DFLAG)
f16cd0d5
L
13891 || (bytemode != v_mode
13892 && bytemode != v_swap_mode))
13893 names = names32;
13894 else
13895 names = names16;
13896 used_prefixes |= (prefixes & PREFIX_DATA);
13897 }
c0f3af97 13898 break;
de89d0a3
IT
13899 case va_mode:
13900 names = (address_mode == mode_64bit
13901 ? names64 : names32);
13902 if (!(prefixes & PREFIX_ADDR))
aa178437
IT
13903 names = (address_mode == mode_16bit
13904 ? names16 : names);
de89d0a3
IT
13905 else
13906 {
13907 /* Remove "addr16/addr32". */
13908 all_prefixes[last_addr_prefix] = 0;
13909 names = (address_mode != mode_32bit
13910 ? names32 : names16);
13911 used_prefixes |= PREFIX_ADDR;
13912 }
13913 break;
1ba585e8 13914 case mask_bd_mode:
43234a1e 13915 case mask_mode:
9889cbb1
L
13916 if (reg > 0x7)
13917 {
13918 oappend ("(bad)");
13919 return;
13920 }
43234a1e
L
13921 names = names_mask;
13922 break;
c0f3af97
L
13923 case 0:
13924 return;
13925 default:
13926 oappend (INTERNAL_DISASSEMBLER_ERROR);
252b5132
RH
13927 return;
13928 }
c0f3af97
L
13929 oappend (names[reg]);
13930}
13931
13932static void
c1e679ec 13933OP_E_memory (int bytemode, int sizeflag)
c0f3af97
L
13934{
13935 bfd_vma disp = 0;
13936 int add = (rex & REX_B) ? 8 : 0;
13937 int riprel = 0;
43234a1e
L
13938 int shift;
13939
13940 if (vex.evex)
13941 {
13942 /* In EVEX, if operand doesn't allow broadcast, vex.b should be 0. */
13943 if (vex.b
13944 && bytemode != x_mode
90a915bf 13945 && bytemode != xmmq_mode
43234a1e
L
13946 && bytemode != evex_half_bcst_xmmq_mode)
13947 {
13948 BadOp ();
13949 return;
13950 }
13951 switch (bytemode)
13952 {
1ba585e8
IT
13953 case dqw_mode:
13954 case dw_mode:
1ba585e8
IT
13955 shift = 1;
13956 break;
13957 case dqb_mode:
13958 case db_mode:
13959 shift = 0;
13960 break;
b50c9f31
JB
13961 case dq_mode:
13962 if (address_mode != mode_64bit)
13963 {
13964 shift = 2;
13965 break;
13966 }
13967 /* fall through */
43234a1e 13968 case vex_vsib_d_w_dq_mode:
5fc35d96 13969 case vex_vsib_d_w_d_mode:
eaa9d1ad 13970 case vex_vsib_q_w_dq_mode:
5fc35d96 13971 case vex_vsib_q_w_d_mode:
43234a1e
L
13972 case evex_x_gscat_mode:
13973 case xmm_mdq_mode:
13974 shift = vex.w ? 3 : 2;
13975 break;
43234a1e
L
13976 case x_mode:
13977 case evex_half_bcst_xmmq_mode:
90a915bf 13978 case xmmq_mode:
43234a1e
L
13979 if (vex.b)
13980 {
13981 shift = vex.w ? 3 : 2;
13982 break;
13983 }
1a0670f3 13984 /* Fall through. */
43234a1e
L
13985 case xmmqd_mode:
13986 case xmmdw_mode:
43234a1e
L
13987 case ymmq_mode:
13988 case evex_x_nobcst_mode:
13989 case x_swap_mode:
13990 switch (vex.length)
13991 {
13992 case 128:
13993 shift = 4;
13994 break;
13995 case 256:
13996 shift = 5;
13997 break;
13998 case 512:
13999 shift = 6;
14000 break;
14001 default:
14002 abort ();
14003 }
14004 break;
14005 case ymm_mode:
14006 shift = 5;
14007 break;
14008 case xmm_mode:
14009 shift = 4;
14010 break;
14011 case xmm_mq_mode:
14012 case q_mode:
14013 case q_scalar_mode:
14014 case q_swap_mode:
14015 case q_scalar_swap_mode:
14016 shift = 3;
14017 break;
14018 case dqd_mode:
14019 case xmm_md_mode:
14020 case d_mode:
14021 case d_scalar_mode:
14022 case d_swap_mode:
14023 case d_scalar_swap_mode:
14024 shift = 2;
14025 break;
5074ad8a 14026 case w_scalar_mode:
43234a1e
L
14027 case xmm_mw_mode:
14028 shift = 1;
14029 break;
5074ad8a 14030 case b_scalar_mode:
43234a1e
L
14031 case xmm_mb_mode:
14032 shift = 0;
14033 break;
d20dee9e
L
14034 case dqa_mode:
14035 shift = address_mode == mode_64bit ? 3 : 2;
14036 break;
43234a1e
L
14037 default:
14038 abort ();
14039 }
14040 /* Make necessary corrections to shift for modes that need it.
14041 For these modes we currently have shift 4, 5 or 6 depending on
14042 vex.length (it corresponds to xmmword, ymmword or zmmword
14043 operand). We might want to make it 3, 4 or 5 (e.g. for
14044 xmmq_mode). In case of broadcast enabled the corrections
14045 aren't needed, as element size is always 32 or 64 bits. */
90a915bf
IT
14046 if (!vex.b
14047 && (bytemode == xmmq_mode
14048 || bytemode == evex_half_bcst_xmmq_mode))
43234a1e
L
14049 shift -= 1;
14050 else if (bytemode == xmmqd_mode)
14051 shift -= 2;
14052 else if (bytemode == xmmdw_mode)
14053 shift -= 3;
b28d1bda
IT
14054 else if (bytemode == ymmq_mode && vex.length == 128)
14055 shift -= 1;
43234a1e
L
14056 }
14057 else
14058 shift = 0;
252b5132 14059
c0f3af97 14060 USED_REX (REX_B);
3f31e633
JB
14061 if (intel_syntax)
14062 intel_operand_size (bytemode, sizeflag);
252b5132
RH
14063 append_seg ();
14064
5d669648 14065 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
252b5132 14066 {
5d669648
L
14067 /* 32/64 bit address mode */
14068 int havedisp;
252b5132
RH
14069 int havesib;
14070 int havebase;
0f7da397 14071 int haveindex;
20afcfb7 14072 int needindex;
1bc60e56 14073 int needaddr32;
82c18208 14074 int base, rbase;
91d6fa6a 14075 int vindex = 0;
252b5132 14076 int scale = 0;
7e8b059b
L
14077 int addr32flag = !((sizeflag & AFLAG)
14078 || bytemode == v_bnd_mode
d276ec69 14079 || bytemode == v_bndmk_mode
9f79e886
JB
14080 || bytemode == bnd_mode
14081 || bytemode == bnd_swap_mode);
6c30d220
L
14082 const char **indexes64 = names64;
14083 const char **indexes32 = names32;
252b5132
RH
14084
14085 havesib = 0;
14086 havebase = 1;
0f7da397 14087 haveindex = 0;
7967e09e 14088 base = modrm.rm;
252b5132
RH
14089
14090 if (base == 4)
14091 {
14092 havesib = 1;
dfc8cf43 14093 vindex = sib.index;
161a04f6
L
14094 USED_REX (REX_X);
14095 if (rex & REX_X)
91d6fa6a 14096 vindex += 8;
6c30d220
L
14097 switch (bytemode)
14098 {
14099 case vex_vsib_d_w_dq_mode:
5fc35d96 14100 case vex_vsib_d_w_d_mode:
6c30d220 14101 case vex_vsib_q_w_dq_mode:
5fc35d96 14102 case vex_vsib_q_w_d_mode:
6c30d220
L
14103 if (!need_vex)
14104 abort ();
43234a1e
L
14105 if (vex.evex)
14106 {
14107 if (!vex.v)
14108 vindex += 16;
14109 }
6c30d220
L
14110
14111 haveindex = 1;
14112 switch (vex.length)
14113 {
14114 case 128:
7bb15c6f 14115 indexes64 = indexes32 = names_xmm;
6c30d220
L
14116 break;
14117 case 256:
5fc35d96
IT
14118 if (!vex.w
14119 || bytemode == vex_vsib_q_w_dq_mode
14120 || bytemode == vex_vsib_q_w_d_mode)
7bb15c6f 14121 indexes64 = indexes32 = names_ymm;
6c30d220 14122 else
7bb15c6f 14123 indexes64 = indexes32 = names_xmm;
6c30d220 14124 break;
43234a1e 14125 case 512:
5fc35d96
IT
14126 if (!vex.w
14127 || bytemode == vex_vsib_q_w_dq_mode
14128 || bytemode == vex_vsib_q_w_d_mode)
43234a1e
L
14129 indexes64 = indexes32 = names_zmm;
14130 else
14131 indexes64 = indexes32 = names_ymm;
14132 break;
6c30d220
L
14133 default:
14134 abort ();
14135 }
14136 break;
14137 default:
14138 haveindex = vindex != 4;
14139 break;
14140 }
14141 scale = sib.scale;
14142 base = sib.base;
252b5132
RH
14143 codep++;
14144 }
82c18208 14145 rbase = base + add;
252b5132 14146
7967e09e 14147 switch (modrm.mod)
252b5132
RH
14148 {
14149 case 0:
82c18208 14150 if (base == 5)
252b5132
RH
14151 {
14152 havebase = 0;
cb712a9e 14153 if (address_mode == mode_64bit && !havesib)
52b15da3
JH
14154 riprel = 1;
14155 disp = get32s ();
d276ec69
JB
14156 if (riprel && bytemode == v_bndmk_mode)
14157 {
14158 oappend ("(bad)");
14159 return;
14160 }
252b5132
RH
14161 }
14162 break;
14163 case 1:
14164 FETCH_DATA (the_info, codep + 1);
14165 disp = *codep++;
14166 if ((disp & 0x80) != 0)
14167 disp -= 0x100;
43234a1e
L
14168 if (vex.evex && shift > 0)
14169 disp <<= shift;
252b5132
RH
14170 break;
14171 case 2:
52b15da3 14172 disp = get32s ();
252b5132
RH
14173 break;
14174 }
14175
1bc60e56
L
14176 needindex = 0;
14177 needaddr32 = 0;
14178 if (havesib
14179 && !havebase
14180 && !haveindex
14181 && address_mode != mode_16bit)
14182 {
14183 if (address_mode == mode_64bit)
14184 {
14185 /* Display eiz instead of addr32. */
14186 needindex = addr32flag;
14187 needaddr32 = 1;
14188 }
14189 else
14190 {
14191 /* In 32-bit mode, we need index register to tell [offset]
14192 from [eiz*1 + offset]. */
14193 needindex = 1;
14194 }
14195 }
14196
20afcfb7
L
14197 havedisp = (havebase
14198 || needindex
14199 || (havesib && (haveindex || scale != 0)));
5d669648 14200
252b5132 14201 if (!intel_syntax)
82c18208 14202 if (modrm.mod != 0 || base == 5)
db6eb5be 14203 {
5d669648
L
14204 if (havedisp || riprel)
14205 print_displacement (scratchbuf, disp);
14206 else
14207 print_operand_value (scratchbuf, 1, disp);
db6eb5be 14208 oappend (scratchbuf);
52b15da3
JH
14209 if (riprel)
14210 {
14211 set_op (disp, 1);
28596323 14212 oappend (!addr32flag ? "(%rip)" : "(%eip)");
52b15da3 14213 }
db6eb5be 14214 }
2da11e11 14215
1bc60e56 14216 if ((havebase || haveindex || needaddr32 || riprel)
7e8b059b 14217 && (bytemode != v_bnd_mode)
d276ec69 14218 && (bytemode != v_bndmk_mode)
9f79e886
JB
14219 && (bytemode != bnd_mode)
14220 && (bytemode != bnd_swap_mode))
87767711
JB
14221 used_prefixes |= PREFIX_ADDR;
14222
5d669648 14223 if (havedisp || (intel_syntax && riprel))
252b5132 14224 {
252b5132 14225 *obufp++ = open_char;
52b15da3 14226 if (intel_syntax && riprel)
185b1163
L
14227 {
14228 set_op (disp, 1);
28596323 14229 oappend (!addr32flag ? "rip" : "eip");
185b1163 14230 }
db6eb5be 14231 *obufp = '\0';
252b5132 14232 if (havebase)
7e8b059b 14233 oappend (address_mode == mode_64bit && !addr32flag
82c18208 14234 ? names64[rbase] : names32[rbase]);
252b5132
RH
14235 if (havesib)
14236 {
db51cc60
L
14237 /* ESP/RSP won't allow index. If base isn't ESP/RSP,
14238 print index to tell base + index from base. */
14239 if (scale != 0
20afcfb7 14240 || needindex
db51cc60
L
14241 || haveindex
14242 || (havebase && base != ESP_REG_NUM))
252b5132 14243 {
9306ca4a 14244 if (!intel_syntax || havebase)
db6eb5be 14245 {
9306ca4a
JB
14246 *obufp++ = separator_char;
14247 *obufp = '\0';
db6eb5be 14248 }
db51cc60 14249 if (haveindex)
7e8b059b 14250 oappend (address_mode == mode_64bit && !addr32flag
6c30d220 14251 ? indexes64[vindex] : indexes32[vindex]);
db51cc60 14252 else
7e8b059b 14253 oappend (address_mode == mode_64bit && !addr32flag
db51cc60
L
14254 ? index64 : index32);
14255
db6eb5be
AM
14256 *obufp++ = scale_char;
14257 *obufp = '\0';
14258 sprintf (scratchbuf, "%d", 1 << scale);
14259 oappend (scratchbuf);
14260 }
252b5132 14261 }
185b1163 14262 if (intel_syntax
82c18208 14263 && (disp || modrm.mod != 0 || base == 5))
3d456fa1 14264 {
db51cc60 14265 if (!havedisp || (bfd_signed_vma) disp >= 0)
3d456fa1
JB
14266 {
14267 *obufp++ = '+';
14268 *obufp = '\0';
14269 }
05203043 14270 else if (modrm.mod != 1 && disp != -disp)
3d456fa1
JB
14271 {
14272 *obufp++ = '-';
14273 *obufp = '\0';
14274 disp = - (bfd_signed_vma) disp;
14275 }
14276
db51cc60
L
14277 if (havedisp)
14278 print_displacement (scratchbuf, disp);
14279 else
14280 print_operand_value (scratchbuf, 1, disp);
3d456fa1
JB
14281 oappend (scratchbuf);
14282 }
252b5132
RH
14283
14284 *obufp++ = close_char;
db6eb5be 14285 *obufp = '\0';
252b5132
RH
14286 }
14287 else if (intel_syntax)
db6eb5be 14288 {
82c18208 14289 if (modrm.mod != 0 || base == 5)
db6eb5be 14290 {
285ca992 14291 if (!active_seg_prefix)
252b5132 14292 {
d708bcba 14293 oappend (names_seg[ds_reg - es_reg]);
252b5132
RH
14294 oappend (":");
14295 }
52b15da3 14296 print_operand_value (scratchbuf, 1, disp);
db6eb5be
AM
14297 oappend (scratchbuf);
14298 }
14299 }
252b5132
RH
14300 }
14301 else
f16cd0d5
L
14302 {
14303 /* 16 bit address mode */
14304 used_prefixes |= prefixes & PREFIX_ADDR;
7967e09e 14305 switch (modrm.mod)
252b5132
RH
14306 {
14307 case 0:
7967e09e 14308 if (modrm.rm == 6)
252b5132
RH
14309 {
14310 disp = get16 ();
14311 if ((disp & 0x8000) != 0)
14312 disp -= 0x10000;
14313 }
14314 break;
14315 case 1:
14316 FETCH_DATA (the_info, codep + 1);
14317 disp = *codep++;
14318 if ((disp & 0x80) != 0)
14319 disp -= 0x100;
65f3ed04
JB
14320 if (vex.evex && shift > 0)
14321 disp <<= shift;
252b5132
RH
14322 break;
14323 case 2:
14324 disp = get16 ();
14325 if ((disp & 0x8000) != 0)
14326 disp -= 0x10000;
14327 break;
14328 }
14329
14330 if (!intel_syntax)
7967e09e 14331 if (modrm.mod != 0 || modrm.rm == 6)
db6eb5be 14332 {
5d669648 14333 print_displacement (scratchbuf, disp);
db6eb5be
AM
14334 oappend (scratchbuf);
14335 }
252b5132 14336
7967e09e 14337 if (modrm.mod != 0 || modrm.rm != 6)
252b5132
RH
14338 {
14339 *obufp++ = open_char;
db6eb5be 14340 *obufp = '\0';
7967e09e 14341 oappend (index16[modrm.rm]);
5d669648
L
14342 if (intel_syntax
14343 && (disp || modrm.mod != 0 || modrm.rm == 6))
3d456fa1 14344 {
5d669648 14345 if ((bfd_signed_vma) disp >= 0)
3d456fa1
JB
14346 {
14347 *obufp++ = '+';
14348 *obufp = '\0';
14349 }
7967e09e 14350 else if (modrm.mod != 1)
3d456fa1
JB
14351 {
14352 *obufp++ = '-';
14353 *obufp = '\0';
14354 disp = - (bfd_signed_vma) disp;
14355 }
14356
5d669648 14357 print_displacement (scratchbuf, disp);
3d456fa1
JB
14358 oappend (scratchbuf);
14359 }
14360
db6eb5be
AM
14361 *obufp++ = close_char;
14362 *obufp = '\0';
252b5132 14363 }
3d456fa1
JB
14364 else if (intel_syntax)
14365 {
285ca992 14366 if (!active_seg_prefix)
3d456fa1
JB
14367 {
14368 oappend (names_seg[ds_reg - es_reg]);
14369 oappend (":");
14370 }
14371 print_operand_value (scratchbuf, 1, disp & 0xffff);
14372 oappend (scratchbuf);
14373 }
252b5132 14374 }
43234a1e
L
14375 if (vex.evex && vex.b
14376 && (bytemode == x_mode
90a915bf 14377 || bytemode == xmmq_mode
43234a1e
L
14378 || bytemode == evex_half_bcst_xmmq_mode))
14379 {
90a915bf
IT
14380 if (vex.w
14381 || bytemode == xmmq_mode
14382 || bytemode == evex_half_bcst_xmmq_mode)
b28d1bda
IT
14383 {
14384 switch (vex.length)
14385 {
14386 case 128:
14387 oappend ("{1to2}");
14388 break;
14389 case 256:
14390 oappend ("{1to4}");
14391 break;
14392 case 512:
14393 oappend ("{1to8}");
14394 break;
14395 default:
14396 abort ();
14397 }
14398 }
43234a1e 14399 else
b28d1bda
IT
14400 {
14401 switch (vex.length)
14402 {
14403 case 128:
14404 oappend ("{1to4}");
14405 break;
14406 case 256:
14407 oappend ("{1to8}");
14408 break;
14409 case 512:
14410 oappend ("{1to16}");
14411 break;
14412 default:
14413 abort ();
14414 }
14415 }
43234a1e 14416 }
252b5132
RH
14417}
14418
c0f3af97 14419static void
8b3f93e7 14420OP_E (int bytemode, int sizeflag)
c0f3af97
L
14421{
14422 /* Skip mod/rm byte. */
14423 MODRM_CHECK;
14424 codep++;
14425
14426 if (modrm.mod == 3)
14427 OP_E_register (bytemode, sizeflag);
14428 else
c1e679ec 14429 OP_E_memory (bytemode, sizeflag);
c0f3af97
L
14430}
14431
252b5132 14432static void
26ca5450 14433OP_G (int bytemode, int sizeflag)
252b5132 14434{
52b15da3 14435 int add = 0;
c0a30a9f 14436 const char **names;
161a04f6
L
14437 USED_REX (REX_R);
14438 if (rex & REX_R)
52b15da3 14439 add += 8;
252b5132
RH
14440 switch (bytemode)
14441 {
14442 case b_mode:
52b15da3
JH
14443 USED_REX (0);
14444 if (rex)
7967e09e 14445 oappend (names8rex[modrm.reg + add]);
52b15da3 14446 else
7967e09e 14447 oappend (names8[modrm.reg + add]);
252b5132
RH
14448 break;
14449 case w_mode:
7967e09e 14450 oappend (names16[modrm.reg + add]);
252b5132
RH
14451 break;
14452 case d_mode:
1ba585e8
IT
14453 case db_mode:
14454 case dw_mode:
7967e09e 14455 oappend (names32[modrm.reg + add]);
52b15da3
JH
14456 break;
14457 case q_mode:
7967e09e 14458 oappend (names64[modrm.reg + add]);
252b5132 14459 break;
7e8b059b 14460 case bnd_mode:
0d96e4df
L
14461 if (modrm.reg > 0x3)
14462 {
14463 oappend ("(bad)");
14464 return;
14465 }
7e8b059b
L
14466 oappend (names_bnd[modrm.reg]);
14467 break;
252b5132 14468 case v_mode:
9306ca4a 14469 case dq_mode:
42903f7f
L
14470 case dqb_mode:
14471 case dqd_mode:
9306ca4a 14472 case dqw_mode:
161a04f6
L
14473 USED_REX (REX_W);
14474 if (rex & REX_W)
7967e09e 14475 oappend (names64[modrm.reg + add]);
252b5132 14476 else
f16cd0d5
L
14477 {
14478 if ((sizeflag & DFLAG) || bytemode != v_mode)
14479 oappend (names32[modrm.reg + add]);
14480 else
14481 oappend (names16[modrm.reg + add]);
14482 used_prefixes |= (prefixes & PREFIX_DATA);
14483 }
252b5132 14484 break;
c0a30a9f
L
14485 case va_mode:
14486 names = (address_mode == mode_64bit
14487 ? names64 : names32);
14488 if (!(prefixes & PREFIX_ADDR))
14489 {
14490 if (address_mode == mode_16bit)
14491 names = names16;
14492 }
14493 else
14494 {
14495 /* Remove "addr16/addr32". */
14496 all_prefixes[last_addr_prefix] = 0;
14497 names = (address_mode != mode_32bit
14498 ? names32 : names16);
14499 used_prefixes |= PREFIX_ADDR;
14500 }
14501 oappend (names[modrm.reg + add]);
14502 break;
90700ea2 14503 case m_mode:
cb712a9e 14504 if (address_mode == mode_64bit)
7967e09e 14505 oappend (names64[modrm.reg + add]);
90700ea2 14506 else
7967e09e 14507 oappend (names32[modrm.reg + add]);
90700ea2 14508 break;
1ba585e8 14509 case mask_bd_mode:
43234a1e 14510 case mask_mode:
9889cbb1
L
14511 if ((modrm.reg + add) > 0x7)
14512 {
14513 oappend ("(bad)");
14514 return;
14515 }
43234a1e
L
14516 oappend (names_mask[modrm.reg + add]);
14517 break;
252b5132
RH
14518 default:
14519 oappend (INTERNAL_DISASSEMBLER_ERROR);
14520 break;
14521 }
14522}
14523
52b15da3 14524static bfd_vma
26ca5450 14525get64 (void)
52b15da3 14526{
5dd0794d 14527 bfd_vma x;
52b15da3 14528#ifdef BFD64
5dd0794d
AM
14529 unsigned int a;
14530 unsigned int b;
14531
52b15da3
JH
14532 FETCH_DATA (the_info, codep + 8);
14533 a = *codep++ & 0xff;
14534 a |= (*codep++ & 0xff) << 8;
14535 a |= (*codep++ & 0xff) << 16;
070fe95d 14536 a |= (*codep++ & 0xffu) << 24;
5dd0794d 14537 b = *codep++ & 0xff;
52b15da3
JH
14538 b |= (*codep++ & 0xff) << 8;
14539 b |= (*codep++ & 0xff) << 16;
070fe95d 14540 b |= (*codep++ & 0xffu) << 24;
52b15da3
JH
14541 x = a + ((bfd_vma) b << 32);
14542#else
6608db57 14543 abort ();
5dd0794d 14544 x = 0;
52b15da3
JH
14545#endif
14546 return x;
14547}
14548
14549static bfd_signed_vma
26ca5450 14550get32 (void)
252b5132 14551{
52b15da3 14552 bfd_signed_vma x = 0;
252b5132
RH
14553
14554 FETCH_DATA (the_info, codep + 4);
52b15da3
JH
14555 x = *codep++ & (bfd_signed_vma) 0xff;
14556 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
14557 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
14558 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
14559 return x;
14560}
14561
14562static bfd_signed_vma
26ca5450 14563get32s (void)
52b15da3
JH
14564{
14565 bfd_signed_vma x = 0;
14566
14567 FETCH_DATA (the_info, codep + 4);
14568 x = *codep++ & (bfd_signed_vma) 0xff;
14569 x |= (*codep++ & (bfd_signed_vma) 0xff) << 8;
14570 x |= (*codep++ & (bfd_signed_vma) 0xff) << 16;
14571 x |= (*codep++ & (bfd_signed_vma) 0xff) << 24;
14572
14573 x = (x ^ ((bfd_signed_vma) 1 << 31)) - ((bfd_signed_vma) 1 << 31);
14574
252b5132
RH
14575 return x;
14576}
14577
14578static int
26ca5450 14579get16 (void)
252b5132
RH
14580{
14581 int x = 0;
14582
14583 FETCH_DATA (the_info, codep + 2);
14584 x = *codep++ & 0xff;
14585 x |= (*codep++ & 0xff) << 8;
14586 return x;
14587}
14588
14589static void
26ca5450 14590set_op (bfd_vma op, int riprel)
252b5132
RH
14591{
14592 op_index[op_ad] = op_ad;
cb712a9e 14593 if (address_mode == mode_64bit)
7081ff04
AJ
14594 {
14595 op_address[op_ad] = op;
14596 op_riprel[op_ad] = riprel;
14597 }
14598 else
14599 {
14600 /* Mask to get a 32-bit address. */
14601 op_address[op_ad] = op & 0xffffffff;
14602 op_riprel[op_ad] = riprel & 0xffffffff;
14603 }
252b5132
RH
14604}
14605
14606static void
26ca5450 14607OP_REG (int code, int sizeflag)
252b5132 14608{
2da11e11 14609 const char *s;
9b60702d 14610 int add;
de882298
RM
14611
14612 switch (code)
14613 {
14614 case es_reg: case ss_reg: case cs_reg:
14615 case ds_reg: case fs_reg: case gs_reg:
14616 oappend (names_seg[code - es_reg]);
14617 return;
14618 }
14619
161a04f6
L
14620 USED_REX (REX_B);
14621 if (rex & REX_B)
52b15da3 14622 add = 8;
9b60702d
L
14623 else
14624 add = 0;
52b15da3
JH
14625
14626 switch (code)
14627 {
52b15da3
JH
14628 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
14629 case sp_reg: case bp_reg: case si_reg: case di_reg:
14630 s = names16[code - ax_reg + add];
14631 break;
52b15da3
JH
14632 case al_reg: case ah_reg: case cl_reg: case ch_reg:
14633 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
14634 USED_REX (0);
14635 if (rex)
14636 s = names8rex[code - al_reg + add];
14637 else
14638 s = names8[code - al_reg];
14639 break;
6439fc28
AM
14640 case rAX_reg: case rCX_reg: case rDX_reg: case rBX_reg:
14641 case rSP_reg: case rBP_reg: case rSI_reg: case rDI_reg:
7bb15c6f 14642 if (address_mode == mode_64bit
6c067bbb 14643 && ((sizeflag & DFLAG) || (rex & REX_W)))
6439fc28
AM
14644 {
14645 s = names64[code - rAX_reg + add];
14646 break;
14647 }
14648 code += eAX_reg - rAX_reg;
6608db57 14649 /* Fall through. */
52b15da3
JH
14650 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
14651 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
161a04f6
L
14652 USED_REX (REX_W);
14653 if (rex & REX_W)
52b15da3 14654 s = names64[code - eAX_reg + add];
52b15da3 14655 else
f16cd0d5
L
14656 {
14657 if (sizeflag & DFLAG)
14658 s = names32[code - eAX_reg + add];
14659 else
14660 s = names16[code - eAX_reg + add];
14661 used_prefixes |= (prefixes & PREFIX_DATA);
14662 }
52b15da3 14663 break;
52b15da3
JH
14664 default:
14665 s = INTERNAL_DISASSEMBLER_ERROR;
14666 break;
14667 }
14668 oappend (s);
14669}
14670
14671static void
26ca5450 14672OP_IMREG (int code, int sizeflag)
52b15da3
JH
14673{
14674 const char *s;
252b5132
RH
14675
14676 switch (code)
14677 {
14678 case indir_dx_reg:
d708bcba 14679 if (intel_syntax)
52fd6d94 14680 s = "dx";
d708bcba 14681 else
db6eb5be 14682 s = "(%dx)";
252b5132
RH
14683 break;
14684 case ax_reg: case cx_reg: case dx_reg: case bx_reg:
14685 case sp_reg: case bp_reg: case si_reg: case di_reg:
14686 s = names16[code - ax_reg];
14687 break;
14688 case es_reg: case ss_reg: case cs_reg:
14689 case ds_reg: case fs_reg: case gs_reg:
14690 s = names_seg[code - es_reg];
14691 break;
14692 case al_reg: case ah_reg: case cl_reg: case ch_reg:
14693 case dl_reg: case dh_reg: case bl_reg: case bh_reg:
52b15da3
JH
14694 USED_REX (0);
14695 if (rex)
14696 s = names8rex[code - al_reg];
14697 else
14698 s = names8[code - al_reg];
252b5132
RH
14699 break;
14700 case eAX_reg: case eCX_reg: case eDX_reg: case eBX_reg:
14701 case eSP_reg: case eBP_reg: case eSI_reg: case eDI_reg:
161a04f6
L
14702 USED_REX (REX_W);
14703 if (rex & REX_W)
52b15da3 14704 s = names64[code - eAX_reg];
252b5132 14705 else
f16cd0d5
L
14706 {
14707 if (sizeflag & DFLAG)
14708 s = names32[code - eAX_reg];
14709 else
14710 s = names16[code - eAX_reg];
14711 used_prefixes |= (prefixes & PREFIX_DATA);
14712 }
252b5132 14713 break;
52fd6d94 14714 case z_mode_ax_reg:
161a04f6 14715 if ((rex & REX_W) || (sizeflag & DFLAG))
52fd6d94
JB
14716 s = *names32;
14717 else
14718 s = *names16;
161a04f6 14719 if (!(rex & REX_W))
52fd6d94
JB
14720 used_prefixes |= (prefixes & PREFIX_DATA);
14721 break;
252b5132
RH
14722 default:
14723 s = INTERNAL_DISASSEMBLER_ERROR;
14724 break;
14725 }
14726 oappend (s);
14727}
14728
14729static void
26ca5450 14730OP_I (int bytemode, int sizeflag)
252b5132 14731{
52b15da3
JH
14732 bfd_signed_vma op;
14733 bfd_signed_vma mask = -1;
252b5132
RH
14734
14735 switch (bytemode)
14736 {
14737 case b_mode:
14738 FETCH_DATA (the_info, codep + 1);
52b15da3
JH
14739 op = *codep++;
14740 mask = 0xff;
14741 break;
14742 case q_mode:
cb712a9e 14743 if (address_mode == mode_64bit)
6439fc28
AM
14744 {
14745 op = get32s ();
14746 break;
14747 }
6608db57 14748 /* Fall through. */
252b5132 14749 case v_mode:
161a04f6
L
14750 USED_REX (REX_W);
14751 if (rex & REX_W)
52b15da3 14752 op = get32s ();
252b5132 14753 else
52b15da3 14754 {
f16cd0d5
L
14755 if (sizeflag & DFLAG)
14756 {
14757 op = get32 ();
14758 mask = 0xffffffff;
14759 }
14760 else
14761 {
14762 op = get16 ();
14763 mask = 0xfffff;
14764 }
14765 used_prefixes |= (prefixes & PREFIX_DATA);
52b15da3 14766 }
252b5132
RH
14767 break;
14768 case w_mode:
52b15da3 14769 mask = 0xfffff;
252b5132
RH
14770 op = get16 ();
14771 break;
9306ca4a
JB
14772 case const_1_mode:
14773 if (intel_syntax)
6c067bbb 14774 oappend ("1");
9306ca4a 14775 return;
252b5132
RH
14776 default:
14777 oappend (INTERNAL_DISASSEMBLER_ERROR);
14778 return;
14779 }
14780
52b15da3
JH
14781 op &= mask;
14782 scratchbuf[0] = '$';
d708bcba 14783 print_operand_value (scratchbuf + 1, 1, op);
9ce09ba2 14784 oappend_maybe_intel (scratchbuf);
52b15da3
JH
14785 scratchbuf[0] = '\0';
14786}
14787
14788static void
26ca5450 14789OP_I64 (int bytemode, int sizeflag)
52b15da3
JH
14790{
14791 bfd_signed_vma op;
14792 bfd_signed_vma mask = -1;
14793
cb712a9e 14794 if (address_mode != mode_64bit)
6439fc28
AM
14795 {
14796 OP_I (bytemode, sizeflag);
14797 return;
14798 }
14799
52b15da3
JH
14800 switch (bytemode)
14801 {
14802 case b_mode:
14803 FETCH_DATA (the_info, codep + 1);
14804 op = *codep++;
14805 mask = 0xff;
14806 break;
14807 case v_mode:
161a04f6
L
14808 USED_REX (REX_W);
14809 if (rex & REX_W)
52b15da3 14810 op = get64 ();
52b15da3
JH
14811 else
14812 {
f16cd0d5
L
14813 if (sizeflag & DFLAG)
14814 {
14815 op = get32 ();
14816 mask = 0xffffffff;
14817 }
14818 else
14819 {
14820 op = get16 ();
14821 mask = 0xfffff;
14822 }
14823 used_prefixes |= (prefixes & PREFIX_DATA);
52b15da3 14824 }
52b15da3
JH
14825 break;
14826 case w_mode:
14827 mask = 0xfffff;
14828 op = get16 ();
14829 break;
14830 default:
14831 oappend (INTERNAL_DISASSEMBLER_ERROR);
14832 return;
14833 }
14834
14835 op &= mask;
14836 scratchbuf[0] = '$';
d708bcba 14837 print_operand_value (scratchbuf + 1, 1, op);
9ce09ba2 14838 oappend_maybe_intel (scratchbuf);
252b5132
RH
14839 scratchbuf[0] = '\0';
14840}
14841
14842static void
26ca5450 14843OP_sI (int bytemode, int sizeflag)
252b5132 14844{
52b15da3 14845 bfd_signed_vma op;
252b5132
RH
14846
14847 switch (bytemode)
14848 {
14849 case b_mode:
e3949f17 14850 case b_T_mode:
252b5132
RH
14851 FETCH_DATA (the_info, codep + 1);
14852 op = *codep++;
14853 if ((op & 0x80) != 0)
14854 op -= 0x100;
e3949f17
L
14855 if (bytemode == b_T_mode)
14856 {
14857 if (address_mode != mode_64bit
7bb15c6f 14858 || !((sizeflag & DFLAG) || (rex & REX_W)))
e3949f17 14859 {
6c067bbb
RM
14860 /* The operand-size prefix is overridden by a REX prefix. */
14861 if ((sizeflag & DFLAG) || (rex & REX_W))
e3949f17
L
14862 op &= 0xffffffff;
14863 else
14864 op &= 0xffff;
14865 }
14866 }
14867 else
14868 {
14869 if (!(rex & REX_W))
14870 {
14871 if (sizeflag & DFLAG)
14872 op &= 0xffffffff;
14873 else
14874 op &= 0xffff;
14875 }
14876 }
252b5132
RH
14877 break;
14878 case v_mode:
7bb15c6f
RM
14879 /* The operand-size prefix is overridden by a REX prefix. */
14880 if ((sizeflag & DFLAG) || (rex & REX_W))
52b15da3 14881 op = get32s ();
252b5132 14882 else
d9e3625e 14883 op = get16 ();
252b5132
RH
14884 break;
14885 default:
14886 oappend (INTERNAL_DISASSEMBLER_ERROR);
14887 return;
14888 }
52b15da3
JH
14889
14890 scratchbuf[0] = '$';
14891 print_operand_value (scratchbuf + 1, 1, op);
9ce09ba2 14892 oappend_maybe_intel (scratchbuf);
252b5132
RH
14893}
14894
14895static void
26ca5450 14896OP_J (int bytemode, int sizeflag)
252b5132 14897{
52b15da3 14898 bfd_vma disp;
7081ff04 14899 bfd_vma mask = -1;
65ca155d 14900 bfd_vma segment = 0;
252b5132
RH
14901
14902 switch (bytemode)
14903 {
14904 case b_mode:
14905 FETCH_DATA (the_info, codep + 1);
14906 disp = *codep++;
14907 if ((disp & 0x80) != 0)
14908 disp -= 0x100;
14909 break;
14910 case v_mode:
5db04b09
L
14911 if (isa64 == amd64)
14912 USED_REX (REX_W);
14913 if ((sizeflag & DFLAG)
14914 || (address_mode == mode_64bit
14915 && (isa64 != amd64 || (rex & REX_W))))
52b15da3 14916 disp = get32s ();
252b5132
RH
14917 else
14918 {
14919 disp = get16 ();
206717e8
L
14920 if ((disp & 0x8000) != 0)
14921 disp -= 0x10000;
65ca155d
L
14922 /* In 16bit mode, address is wrapped around at 64k within
14923 the same segment. Otherwise, a data16 prefix on a jump
14924 instruction means that the pc is masked to 16 bits after
14925 the displacement is added! */
14926 mask = 0xffff;
14927 if ((prefixes & PREFIX_DATA) == 0)
4fd7268a 14928 segment = ((start_pc + (codep - start_codep))
65ca155d 14929 & ~((bfd_vma) 0xffff));
252b5132 14930 }
5db04b09
L
14931 if (address_mode != mode_64bit
14932 || (isa64 == amd64 && !(rex & REX_W)))
f16cd0d5 14933 used_prefixes |= (prefixes & PREFIX_DATA);
252b5132
RH
14934 break;
14935 default:
14936 oappend (INTERNAL_DISASSEMBLER_ERROR);
14937 return;
14938 }
42d5f9c6 14939 disp = ((start_pc + (codep - start_codep) + disp) & mask) | segment;
52b15da3
JH
14940 set_op (disp, 0);
14941 print_operand_value (scratchbuf, 1, disp);
252b5132
RH
14942 oappend (scratchbuf);
14943}
14944
252b5132 14945static void
ed7841b3 14946OP_SEG (int bytemode, int sizeflag)
252b5132 14947{
ed7841b3 14948 if (bytemode == w_mode)
7967e09e 14949 oappend (names_seg[modrm.reg]);
ed7841b3 14950 else
7967e09e 14951 OP_E (modrm.mod == 3 ? bytemode : w_mode, sizeflag);
252b5132
RH
14952}
14953
14954static void
26ca5450 14955OP_DIR (int dummy ATTRIBUTE_UNUSED, int sizeflag)
252b5132
RH
14956{
14957 int seg, offset;
14958
c608c12e 14959 if (sizeflag & DFLAG)
252b5132 14960 {
c608c12e
AM
14961 offset = get32 ();
14962 seg = get16 ();
252b5132 14963 }
c608c12e
AM
14964 else
14965 {
14966 offset = get16 ();
14967 seg = get16 ();
14968 }
7d421014 14969 used_prefixes |= (prefixes & PREFIX_DATA);
d708bcba 14970 if (intel_syntax)
3f31e633 14971 sprintf (scratchbuf, "0x%x:0x%x", seg, offset);
d708bcba
AM
14972 else
14973 sprintf (scratchbuf, "$0x%x,$0x%x", seg, offset);
c608c12e 14974 oappend (scratchbuf);
252b5132
RH
14975}
14976
252b5132 14977static void
3f31e633 14978OP_OFF (int bytemode, int sizeflag)
252b5132 14979{
52b15da3 14980 bfd_vma off;
252b5132 14981
3f31e633
JB
14982 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
14983 intel_operand_size (bytemode, sizeflag);
252b5132
RH
14984 append_seg ();
14985
cb712a9e 14986 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
252b5132
RH
14987 off = get32 ();
14988 else
14989 off = get16 ();
14990
14991 if (intel_syntax)
14992 {
285ca992 14993 if (!active_seg_prefix)
252b5132 14994 {
d708bcba 14995 oappend (names_seg[ds_reg - es_reg]);
252b5132
RH
14996 oappend (":");
14997 }
14998 }
52b15da3
JH
14999 print_operand_value (scratchbuf, 1, off);
15000 oappend (scratchbuf);
15001}
6439fc28 15002
52b15da3 15003static void
3f31e633 15004OP_OFF64 (int bytemode, int sizeflag)
52b15da3
JH
15005{
15006 bfd_vma off;
15007
539e75ad
L
15008 if (address_mode != mode_64bit
15009 || (prefixes & PREFIX_ADDR))
6439fc28
AM
15010 {
15011 OP_OFF (bytemode, sizeflag);
15012 return;
15013 }
15014
3f31e633
JB
15015 if (intel_syntax && (sizeflag & SUFFIX_ALWAYS))
15016 intel_operand_size (bytemode, sizeflag);
52b15da3
JH
15017 append_seg ();
15018
6608db57 15019 off = get64 ();
52b15da3
JH
15020
15021 if (intel_syntax)
15022 {
285ca992 15023 if (!active_seg_prefix)
52b15da3 15024 {
d708bcba 15025 oappend (names_seg[ds_reg - es_reg]);
52b15da3
JH
15026 oappend (":");
15027 }
15028 }
15029 print_operand_value (scratchbuf, 1, off);
252b5132
RH
15030 oappend (scratchbuf);
15031}
15032
15033static void
26ca5450 15034ptr_reg (int code, int sizeflag)
252b5132 15035{
2da11e11 15036 const char *s;
d708bcba 15037
1d9f512f 15038 *obufp++ = open_char;
20f0a1fc 15039 used_prefixes |= (prefixes & PREFIX_ADDR);
cb712a9e 15040 if (address_mode == mode_64bit)
c1a64871
JH
15041 {
15042 if (!(sizeflag & AFLAG))
db6eb5be 15043 s = names32[code - eAX_reg];
c1a64871 15044 else
db6eb5be 15045 s = names64[code - eAX_reg];
c1a64871 15046 }
52b15da3 15047 else if (sizeflag & AFLAG)
252b5132
RH
15048 s = names32[code - eAX_reg];
15049 else
15050 s = names16[code - eAX_reg];
15051 oappend (s);
1d9f512f
AM
15052 *obufp++ = close_char;
15053 *obufp = 0;
252b5132
RH
15054}
15055
15056static void
26ca5450 15057OP_ESreg (int code, int sizeflag)
252b5132 15058{
9306ca4a 15059 if (intel_syntax)
52fd6d94
JB
15060 {
15061 switch (codep[-1])
15062 {
15063 case 0x6d: /* insw/insl */
15064 intel_operand_size (z_mode, sizeflag);
15065 break;
15066 case 0xa5: /* movsw/movsl/movsq */
15067 case 0xa7: /* cmpsw/cmpsl/cmpsq */
15068 case 0xab: /* stosw/stosl */
15069 case 0xaf: /* scasw/scasl */
15070 intel_operand_size (v_mode, sizeflag);
15071 break;
15072 default:
15073 intel_operand_size (b_mode, sizeflag);
15074 }
15075 }
9ce09ba2 15076 oappend_maybe_intel ("%es:");
252b5132
RH
15077 ptr_reg (code, sizeflag);
15078}
15079
15080static void
26ca5450 15081OP_DSreg (int code, int sizeflag)
252b5132 15082{
9306ca4a 15083 if (intel_syntax)
52fd6d94
JB
15084 {
15085 switch (codep[-1])
15086 {
15087 case 0x6f: /* outsw/outsl */
15088 intel_operand_size (z_mode, sizeflag);
15089 break;
15090 case 0xa5: /* movsw/movsl/movsq */
15091 case 0xa7: /* cmpsw/cmpsl/cmpsq */
15092 case 0xad: /* lodsw/lodsl/lodsq */
15093 intel_operand_size (v_mode, sizeflag);
15094 break;
15095 default:
15096 intel_operand_size (b_mode, sizeflag);
15097 }
15098 }
285ca992
L
15099 /* Set active_seg_prefix to PREFIX_DS if it is unset so that the
15100 default segment register DS is printed. */
15101 if (!active_seg_prefix)
15102 active_seg_prefix = PREFIX_DS;
6608db57 15103 append_seg ();
252b5132
RH
15104 ptr_reg (code, sizeflag);
15105}
15106
252b5132 15107static void
26ca5450 15108OP_C (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
252b5132 15109{
9b60702d 15110 int add;
161a04f6 15111 if (rex & REX_R)
c4a530c5 15112 {
161a04f6 15113 USED_REX (REX_R);
c4a530c5
JB
15114 add = 8;
15115 }
cb712a9e 15116 else if (address_mode != mode_64bit && (prefixes & PREFIX_LOCK))
c4a530c5 15117 {
f16cd0d5 15118 all_prefixes[last_lock_prefix] = 0;
c4a530c5
JB
15119 used_prefixes |= PREFIX_LOCK;
15120 add = 8;
15121 }
9b60702d
L
15122 else
15123 add = 0;
7967e09e 15124 sprintf (scratchbuf, "%%cr%d", modrm.reg + add);
9ce09ba2 15125 oappend_maybe_intel (scratchbuf);
252b5132
RH
15126}
15127
252b5132 15128static void
26ca5450 15129OP_D (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
252b5132 15130{
9b60702d 15131 int add;
161a04f6
L
15132 USED_REX (REX_R);
15133 if (rex & REX_R)
52b15da3 15134 add = 8;
9b60702d
L
15135 else
15136 add = 0;
d708bcba 15137 if (intel_syntax)
7967e09e 15138 sprintf (scratchbuf, "db%d", modrm.reg + add);
d708bcba 15139 else
7967e09e 15140 sprintf (scratchbuf, "%%db%d", modrm.reg + add);
252b5132
RH
15141 oappend (scratchbuf);
15142}
15143
252b5132 15144static void
26ca5450 15145OP_T (int dummy ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
252b5132 15146{
7967e09e 15147 sprintf (scratchbuf, "%%tr%d", modrm.reg);
9ce09ba2 15148 oappend_maybe_intel (scratchbuf);
252b5132
RH
15149}
15150
15151static void
6f74c397 15152OP_R (int bytemode, int sizeflag)
252b5132 15153{
68f34464
L
15154 /* Skip mod/rm byte. */
15155 MODRM_CHECK;
15156 codep++;
15157 OP_E_register (bytemode, sizeflag);
252b5132
RH
15158}
15159
15160static void
26ca5450 15161OP_MMX (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
252b5132 15162{
b9733481
L
15163 int reg = modrm.reg;
15164 const char **names;
15165
041bd2e0
JH
15166 used_prefixes |= (prefixes & PREFIX_DATA);
15167 if (prefixes & PREFIX_DATA)
20f0a1fc 15168 {
b9733481 15169 names = names_xmm;
161a04f6
L
15170 USED_REX (REX_R);
15171 if (rex & REX_R)
b9733481 15172 reg += 8;
20f0a1fc 15173 }
041bd2e0 15174 else
b9733481
L
15175 names = names_mm;
15176 oappend (names[reg]);
252b5132
RH
15177}
15178
c608c12e 15179static void
c0f3af97 15180OP_XMM (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
c608c12e 15181{
b9733481
L
15182 int reg = modrm.reg;
15183 const char **names;
15184
161a04f6
L
15185 USED_REX (REX_R);
15186 if (rex & REX_R)
b9733481 15187 reg += 8;
43234a1e
L
15188 if (vex.evex)
15189 {
15190 if (!vex.r)
15191 reg += 16;
15192 }
15193
539f890d
L
15194 if (need_vex
15195 && bytemode != xmm_mode
43234a1e
L
15196 && bytemode != xmmq_mode
15197 && bytemode != evex_half_bcst_xmmq_mode
15198 && bytemode != ymm_mode
539f890d 15199 && bytemode != scalar_mode)
c0f3af97
L
15200 {
15201 switch (vex.length)
15202 {
15203 case 128:
b9733481 15204 names = names_xmm;
c0f3af97
L
15205 break;
15206 case 256:
5fc35d96
IT
15207 if (vex.w
15208 || (bytemode != vex_vsib_q_w_dq_mode
15209 && bytemode != vex_vsib_q_w_d_mode))
6c30d220
L
15210 names = names_ymm;
15211 else
15212 names = names_xmm;
c0f3af97 15213 break;
43234a1e
L
15214 case 512:
15215 names = names_zmm;
15216 break;
c0f3af97
L
15217 default:
15218 abort ();
15219 }
15220 }
43234a1e
L
15221 else if (bytemode == xmmq_mode
15222 || bytemode == evex_half_bcst_xmmq_mode)
15223 {
15224 switch (vex.length)
15225 {
15226 case 128:
15227 case 256:
15228 names = names_xmm;
15229 break;
15230 case 512:
15231 names = names_ymm;
15232 break;
15233 default:
15234 abort ();
15235 }
15236 }
15237 else if (bytemode == ymm_mode)
15238 names = names_ymm;
c0f3af97 15239 else
b9733481
L
15240 names = names_xmm;
15241 oappend (names[reg]);
c608c12e
AM
15242}
15243
252b5132 15244static void
26ca5450 15245OP_EM (int bytemode, int sizeflag)
252b5132 15246{
b9733481
L
15247 int reg;
15248 const char **names;
15249
7967e09e 15250 if (modrm.mod != 3)
252b5132 15251 {
b6169b20
L
15252 if (intel_syntax
15253 && (bytemode == v_mode || bytemode == v_swap_mode))
9306ca4a
JB
15254 {
15255 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
15256 used_prefixes |= (prefixes & PREFIX_DATA);
6c067bbb 15257 }
252b5132
RH
15258 OP_E (bytemode, sizeflag);
15259 return;
15260 }
15261
b6169b20
L
15262 if ((sizeflag & SUFFIX_ALWAYS) && bytemode == v_swap_mode)
15263 swap_operand ();
15264
6608db57 15265 /* Skip mod/rm byte. */
4bba6815 15266 MODRM_CHECK;
252b5132 15267 codep++;
041bd2e0 15268 used_prefixes |= (prefixes & PREFIX_DATA);
b9733481 15269 reg = modrm.rm;
041bd2e0 15270 if (prefixes & PREFIX_DATA)
20f0a1fc 15271 {
b9733481 15272 names = names_xmm;
161a04f6
L
15273 USED_REX (REX_B);
15274 if (rex & REX_B)
b9733481 15275 reg += 8;
20f0a1fc 15276 }
041bd2e0 15277 else
b9733481
L
15278 names = names_mm;
15279 oappend (names[reg]);
252b5132
RH
15280}
15281
246c51aa
L
15282/* cvt* are the only instructions in sse2 which have
15283 both SSE and MMX operands and also have 0x66 prefix
15284 in their opcode. 0x66 was originally used to differentiate
15285 between SSE and MMX instruction(operands). So we have to handle the
4d9567e0
MM
15286 cvt* separately using OP_EMC and OP_MXC */
15287static void
15288OP_EMC (int bytemode, int sizeflag)
15289{
7967e09e 15290 if (modrm.mod != 3)
4d9567e0
MM
15291 {
15292 if (intel_syntax && bytemode == v_mode)
15293 {
15294 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
15295 used_prefixes |= (prefixes & PREFIX_DATA);
6c067bbb 15296 }
4d9567e0
MM
15297 OP_E (bytemode, sizeflag);
15298 return;
15299 }
246c51aa 15300
4d9567e0
MM
15301 /* Skip mod/rm byte. */
15302 MODRM_CHECK;
15303 codep++;
15304 used_prefixes |= (prefixes & PREFIX_DATA);
b9733481 15305 oappend (names_mm[modrm.rm]);
4d9567e0
MM
15306}
15307
15308static void
15309OP_MXC (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15310{
15311 used_prefixes |= (prefixes & PREFIX_DATA);
b9733481 15312 oappend (names_mm[modrm.reg]);
4d9567e0
MM
15313}
15314
c608c12e 15315static void
26ca5450 15316OP_EX (int bytemode, int sizeflag)
c608c12e 15317{
b9733481
L
15318 int reg;
15319 const char **names;
d6f574e0
L
15320
15321 /* Skip mod/rm byte. */
15322 MODRM_CHECK;
15323 codep++;
15324
7967e09e 15325 if (modrm.mod != 3)
c608c12e 15326 {
c1e679ec 15327 OP_E_memory (bytemode, sizeflag);
c608c12e
AM
15328 return;
15329 }
d6f574e0 15330
b9733481 15331 reg = modrm.rm;
161a04f6
L
15332 USED_REX (REX_B);
15333 if (rex & REX_B)
b9733481 15334 reg += 8;
43234a1e
L
15335 if (vex.evex)
15336 {
15337 USED_REX (REX_X);
15338 if ((rex & REX_X))
15339 reg += 16;
15340 }
c608c12e 15341
b6169b20 15342 if ((sizeflag & SUFFIX_ALWAYS)
fa99fab2
L
15343 && (bytemode == x_swap_mode
15344 || bytemode == d_swap_mode
7bb15c6f 15345 || bytemode == d_scalar_swap_mode
539f890d
L
15346 || bytemode == q_swap_mode
15347 || bytemode == q_scalar_swap_mode))
b6169b20
L
15348 swap_operand ();
15349
c0f3af97
L
15350 if (need_vex
15351 && bytemode != xmm_mode
6c30d220
L
15352 && bytemode != xmmdw_mode
15353 && bytemode != xmmqd_mode
15354 && bytemode != xmm_mb_mode
15355 && bytemode != xmm_mw_mode
15356 && bytemode != xmm_md_mode
15357 && bytemode != xmm_mq_mode
43234a1e 15358 && bytemode != xmm_mdq_mode
539f890d 15359 && bytemode != xmmq_mode
43234a1e
L
15360 && bytemode != evex_half_bcst_xmmq_mode
15361 && bytemode != ymm_mode
539f890d 15362 && bytemode != d_scalar_mode
7bb15c6f 15363 && bytemode != d_scalar_swap_mode
539f890d 15364 && bytemode != q_scalar_mode
1c480963
L
15365 && bytemode != q_scalar_swap_mode
15366 && bytemode != vex_scalar_w_dq_mode)
c0f3af97
L
15367 {
15368 switch (vex.length)
15369 {
15370 case 128:
b9733481 15371 names = names_xmm;
c0f3af97
L
15372 break;
15373 case 256:
b9733481 15374 names = names_ymm;
c0f3af97 15375 break;
43234a1e
L
15376 case 512:
15377 names = names_zmm;
15378 break;
c0f3af97
L
15379 default:
15380 abort ();
15381 }
15382 }
43234a1e
L
15383 else if (bytemode == xmmq_mode
15384 || bytemode == evex_half_bcst_xmmq_mode)
15385 {
15386 switch (vex.length)
15387 {
15388 case 128:
15389 case 256:
15390 names = names_xmm;
15391 break;
15392 case 512:
15393 names = names_ymm;
15394 break;
15395 default:
15396 abort ();
15397 }
15398 }
15399 else if (bytemode == ymm_mode)
15400 names = names_ymm;
c0f3af97 15401 else
b9733481
L
15402 names = names_xmm;
15403 oappend (names[reg]);
c608c12e
AM
15404}
15405
252b5132 15406static void
26ca5450 15407OP_MS (int bytemode, int sizeflag)
252b5132 15408{
7967e09e 15409 if (modrm.mod == 3)
2da11e11
AM
15410 OP_EM (bytemode, sizeflag);
15411 else
6608db57 15412 BadOp ();
252b5132
RH
15413}
15414
992aaec9 15415static void
26ca5450 15416OP_XS (int bytemode, int sizeflag)
992aaec9 15417{
7967e09e 15418 if (modrm.mod == 3)
992aaec9
AM
15419 OP_EX (bytemode, sizeflag);
15420 else
6608db57 15421 BadOp ();
992aaec9
AM
15422}
15423
cc0ec051
AM
15424static void
15425OP_M (int bytemode, int sizeflag)
15426{
7967e09e 15427 if (modrm.mod == 3)
75413a22
L
15428 /* bad bound,lea,lds,les,lfs,lgs,lss,cmpxchg8b,vmptrst modrm */
15429 BadOp ();
cc0ec051
AM
15430 else
15431 OP_E (bytemode, sizeflag);
15432}
15433
15434static void
15435OP_0f07 (int bytemode, int sizeflag)
15436{
7967e09e 15437 if (modrm.mod != 3 || modrm.rm != 0)
cc0ec051
AM
15438 BadOp ();
15439 else
15440 OP_E (bytemode, sizeflag);
15441}
15442
46e883c5 15443/* NOP is an alias of "xchg %ax,%ax" in 16bit mode, "xchg %eax,%eax" in
246c51aa 15444 32bit mode and "xchg %rax,%rax" in 64bit mode. */
46e883c5 15445
cc0ec051 15446static void
46e883c5 15447NOP_Fixup1 (int bytemode, int sizeflag)
cc0ec051 15448{
8b38ad71
L
15449 if ((prefixes & PREFIX_DATA) != 0
15450 || (rex != 0
15451 && rex != 0x48
15452 && address_mode == mode_64bit))
46e883c5
L
15453 OP_REG (bytemode, sizeflag);
15454 else
15455 strcpy (obuf, "nop");
15456}
15457
15458static void
15459NOP_Fixup2 (int bytemode, int sizeflag)
15460{
8b38ad71
L
15461 if ((prefixes & PREFIX_DATA) != 0
15462 || (rex != 0
15463 && rex != 0x48
15464 && address_mode == mode_64bit))
46e883c5 15465 OP_IMREG (bytemode, sizeflag);
cc0ec051
AM
15466}
15467
84037f8c 15468static const char *const Suffix3DNow[] = {
252b5132
RH
15469/* 00 */ NULL, NULL, NULL, NULL,
15470/* 04 */ NULL, NULL, NULL, NULL,
15471/* 08 */ NULL, NULL, NULL, NULL,
9e525108 15472/* 0C */ "pi2fw", "pi2fd", NULL, NULL,
252b5132
RH
15473/* 10 */ NULL, NULL, NULL, NULL,
15474/* 14 */ NULL, NULL, NULL, NULL,
15475/* 18 */ NULL, NULL, NULL, NULL,
9e525108 15476/* 1C */ "pf2iw", "pf2id", NULL, NULL,
252b5132
RH
15477/* 20 */ NULL, NULL, NULL, NULL,
15478/* 24 */ NULL, NULL, NULL, NULL,
15479/* 28 */ NULL, NULL, NULL, NULL,
15480/* 2C */ NULL, NULL, NULL, NULL,
15481/* 30 */ NULL, NULL, NULL, NULL,
15482/* 34 */ NULL, NULL, NULL, NULL,
15483/* 38 */ NULL, NULL, NULL, NULL,
15484/* 3C */ NULL, NULL, NULL, NULL,
15485/* 40 */ NULL, NULL, NULL, NULL,
15486/* 44 */ NULL, NULL, NULL, NULL,
15487/* 48 */ NULL, NULL, NULL, NULL,
15488/* 4C */ NULL, NULL, NULL, NULL,
15489/* 50 */ NULL, NULL, NULL, NULL,
15490/* 54 */ NULL, NULL, NULL, NULL,
15491/* 58 */ NULL, NULL, NULL, NULL,
15492/* 5C */ NULL, NULL, NULL, NULL,
15493/* 60 */ NULL, NULL, NULL, NULL,
15494/* 64 */ NULL, NULL, NULL, NULL,
15495/* 68 */ NULL, NULL, NULL, NULL,
15496/* 6C */ NULL, NULL, NULL, NULL,
15497/* 70 */ NULL, NULL, NULL, NULL,
15498/* 74 */ NULL, NULL, NULL, NULL,
15499/* 78 */ NULL, NULL, NULL, NULL,
15500/* 7C */ NULL, NULL, NULL, NULL,
15501/* 80 */ NULL, NULL, NULL, NULL,
15502/* 84 */ NULL, NULL, NULL, NULL,
9e525108
AM
15503/* 88 */ NULL, NULL, "pfnacc", NULL,
15504/* 8C */ NULL, NULL, "pfpnacc", NULL,
252b5132
RH
15505/* 90 */ "pfcmpge", NULL, NULL, NULL,
15506/* 94 */ "pfmin", NULL, "pfrcp", "pfrsqrt",
15507/* 98 */ NULL, NULL, "pfsub", NULL,
15508/* 9C */ NULL, NULL, "pfadd", NULL,
15509/* A0 */ "pfcmpgt", NULL, NULL, NULL,
15510/* A4 */ "pfmax", NULL, "pfrcpit1", "pfrsqit1",
15511/* A8 */ NULL, NULL, "pfsubr", NULL,
15512/* AC */ NULL, NULL, "pfacc", NULL,
15513/* B0 */ "pfcmpeq", NULL, NULL, NULL,
9beff690 15514/* B4 */ "pfmul", NULL, "pfrcpit2", "pmulhrw",
9e525108 15515/* B8 */ NULL, NULL, NULL, "pswapd",
252b5132
RH
15516/* BC */ NULL, NULL, NULL, "pavgusb",
15517/* C0 */ NULL, NULL, NULL, NULL,
15518/* C4 */ NULL, NULL, NULL, NULL,
15519/* C8 */ NULL, NULL, NULL, NULL,
15520/* CC */ NULL, NULL, NULL, NULL,
15521/* D0 */ NULL, NULL, NULL, NULL,
15522/* D4 */ NULL, NULL, NULL, NULL,
15523/* D8 */ NULL, NULL, NULL, NULL,
15524/* DC */ NULL, NULL, NULL, NULL,
15525/* E0 */ NULL, NULL, NULL, NULL,
15526/* E4 */ NULL, NULL, NULL, NULL,
15527/* E8 */ NULL, NULL, NULL, NULL,
15528/* EC */ NULL, NULL, NULL, NULL,
15529/* F0 */ NULL, NULL, NULL, NULL,
15530/* F4 */ NULL, NULL, NULL, NULL,
15531/* F8 */ NULL, NULL, NULL, NULL,
15532/* FC */ NULL, NULL, NULL, NULL,
15533};
15534
15535static void
26ca5450 15536OP_3DNowSuffix (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
252b5132
RH
15537{
15538 const char *mnemonic;
15539
15540 FETCH_DATA (the_info, codep + 1);
15541 /* AMD 3DNow! instructions are specified by an opcode suffix in the
15542 place where an 8-bit immediate would normally go. ie. the last
15543 byte of the instruction. */
ea397f5b 15544 obufp = mnemonicendp;
c608c12e 15545 mnemonic = Suffix3DNow[*codep++ & 0xff];
252b5132 15546 if (mnemonic)
2da11e11 15547 oappend (mnemonic);
252b5132
RH
15548 else
15549 {
15550 /* Since a variable sized modrm/sib chunk is between the start
15551 of the opcode (0x0f0f) and the opcode suffix, we need to do
15552 all the modrm processing first, and don't know until now that
15553 we have a bad opcode. This necessitates some cleaning up. */
ce518a5f
L
15554 op_out[0][0] = '\0';
15555 op_out[1][0] = '\0';
6608db57 15556 BadOp ();
252b5132 15557 }
ea397f5b 15558 mnemonicendp = obufp;
252b5132 15559}
c608c12e 15560
ea397f5b
L
15561static struct op simd_cmp_op[] =
15562{
15563 { STRING_COMMA_LEN ("eq") },
15564 { STRING_COMMA_LEN ("lt") },
15565 { STRING_COMMA_LEN ("le") },
15566 { STRING_COMMA_LEN ("unord") },
15567 { STRING_COMMA_LEN ("neq") },
15568 { STRING_COMMA_LEN ("nlt") },
15569 { STRING_COMMA_LEN ("nle") },
15570 { STRING_COMMA_LEN ("ord") }
c608c12e
AM
15571};
15572
15573static void
ad19981d 15574CMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
c608c12e
AM
15575{
15576 unsigned int cmp_type;
15577
15578 FETCH_DATA (the_info, codep + 1);
15579 cmp_type = *codep++ & 0xff;
c0f3af97 15580 if (cmp_type < ARRAY_SIZE (simd_cmp_op))
c608c12e 15581 {
ad19981d 15582 char suffix [3];
ea397f5b 15583 char *p = mnemonicendp - 2;
ad19981d
L
15584 suffix[0] = p[0];
15585 suffix[1] = p[1];
15586 suffix[2] = '\0';
ea397f5b
L
15587 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
15588 mnemonicendp += simd_cmp_op[cmp_type].len;
c608c12e
AM
15589 }
15590 else
15591 {
ad19981d
L
15592 /* We have a reserved extension byte. Output it directly. */
15593 scratchbuf[0] = '$';
15594 print_operand_value (scratchbuf + 1, 1, cmp_type);
9ce09ba2 15595 oappend_maybe_intel (scratchbuf);
ad19981d 15596 scratchbuf[0] = '\0';
c608c12e
AM
15597 }
15598}
15599
9916071f
AP
15600static void
15601OP_Mwaitx (int bytemode ATTRIBUTE_UNUSED,
15602 int sizeflag ATTRIBUTE_UNUSED)
15603{
15604 /* mwaitx %eax,%ecx,%ebx */
15605 if (!intel_syntax)
15606 {
15607 const char **names = (address_mode == mode_64bit
15608 ? names64 : names32);
15609 strcpy (op_out[0], names[0]);
15610 strcpy (op_out[1], names[1]);
15611 strcpy (op_out[2], names[3]);
15612 two_source_ops = 1;
15613 }
15614 /* Skip mod/rm byte. */
15615 MODRM_CHECK;
15616 codep++;
15617}
15618
ca164297 15619static void
b844680a
L
15620OP_Mwait (int bytemode ATTRIBUTE_UNUSED,
15621 int sizeflag ATTRIBUTE_UNUSED)
15622{
15623 /* mwait %eax,%ecx */
15624 if (!intel_syntax)
15625 {
15626 const char **names = (address_mode == mode_64bit
15627 ? names64 : names32);
15628 strcpy (op_out[0], names[0]);
15629 strcpy (op_out[1], names[1]);
15630 two_source_ops = 1;
15631 }
15632 /* Skip mod/rm byte. */
15633 MODRM_CHECK;
15634 codep++;
15635}
15636
15637static void
15638OP_Monitor (int bytemode ATTRIBUTE_UNUSED,
15639 int sizeflag ATTRIBUTE_UNUSED)
ca164297 15640{
b844680a
L
15641 /* monitor %eax,%ecx,%edx" */
15642 if (!intel_syntax)
ca164297 15643 {
b844680a 15644 const char **op1_names;
cb712a9e
L
15645 const char **names = (address_mode == mode_64bit
15646 ? names64 : names32);
1d9f512f 15647
b844680a
L
15648 if (!(prefixes & PREFIX_ADDR))
15649 op1_names = (address_mode == mode_16bit
15650 ? names16 : names);
ca164297
L
15651 else
15652 {
b844680a 15653 /* Remove "addr16/addr32". */
f16cd0d5 15654 all_prefixes[last_addr_prefix] = 0;
b844680a
L
15655 op1_names = (address_mode != mode_32bit
15656 ? names32 : names16);
15657 used_prefixes |= PREFIX_ADDR;
ca164297 15658 }
b844680a
L
15659 strcpy (op_out[0], op1_names[0]);
15660 strcpy (op_out[1], names[1]);
15661 strcpy (op_out[2], names[2]);
15662 two_source_ops = 1;
ca164297 15663 }
b844680a
L
15664 /* Skip mod/rm byte. */
15665 MODRM_CHECK;
15666 codep++;
30123838
JB
15667}
15668
6608db57
KH
15669static void
15670BadOp (void)
2da11e11 15671{
6608db57
KH
15672 /* Throw away prefixes and 1st. opcode byte. */
15673 codep = insn_codep + 1;
2da11e11
AM
15674 oappend ("(bad)");
15675}
4cc91dba 15676
35c52694
L
15677static void
15678REP_Fixup (int bytemode, int sizeflag)
15679{
15680 /* The 0xf3 prefix should be displayed as "rep" for ins, outs, movs,
15681 lods and stos. */
35c52694 15682 if (prefixes & PREFIX_REPZ)
f16cd0d5 15683 all_prefixes[last_repz_prefix] = REP_PREFIX;
35c52694
L
15684
15685 switch (bytemode)
15686 {
15687 case al_reg:
15688 case eAX_reg:
15689 case indir_dx_reg:
15690 OP_IMREG (bytemode, sizeflag);
15691 break;
15692 case eDI_reg:
15693 OP_ESreg (bytemode, sizeflag);
15694 break;
15695 case eSI_reg:
15696 OP_DSreg (bytemode, sizeflag);
15697 break;
15698 default:
15699 abort ();
15700 break;
15701 }
15702}
f5804c90 15703
7e8b059b
L
15704/* For BND-prefixed instructions 0xF2 prefix should be displayed as
15705 "bnd". */
15706
15707static void
15708BND_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
15709{
15710 if (prefixes & PREFIX_REPNZ)
15711 all_prefixes[last_repnz_prefix] = BND_PREFIX;
15712}
15713
04ef582a
L
15714/* For NOTRACK-prefixed instructions, 0x3E prefix should be displayed as
15715 "notrack". */
15716
15717static void
15718NOTRACK_Fixup (int bytemode ATTRIBUTE_UNUSED,
15719 int sizeflag ATTRIBUTE_UNUSED)
15720{
9fef80d6 15721 if (active_seg_prefix == PREFIX_DS
04ef582a
L
15722 && (address_mode != mode_64bit || last_data_prefix < 0))
15723 {
4e9ac44a 15724 /* NOTRACK prefix is only valid on indirect branch instructions.
9fef80d6 15725 NB: DATA prefix is unsupported for Intel64. */
04ef582a
L
15726 active_seg_prefix = 0;
15727 all_prefixes[last_seg_prefix] = NOTRACK_PREFIX;
15728 }
15729}
15730
42164a71
L
15731/* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
15732 "xacquire"/"xrelease" for memory operand if there is a LOCK prefix.
15733 */
15734
15735static void
15736HLE_Fixup1 (int bytemode, int sizeflag)
15737{
15738 if (modrm.mod != 3
15739 && (prefixes & PREFIX_LOCK) != 0)
15740 {
15741 if (prefixes & PREFIX_REPZ)
15742 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15743 if (prefixes & PREFIX_REPNZ)
15744 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15745 }
15746
15747 OP_E (bytemode, sizeflag);
15748}
15749
15750/* Similar to OP_E. But the 0xf2/0xf3 prefixes should be displayed as
15751 "xacquire"/"xrelease" for memory operand. No check for LOCK prefix.
15752 */
15753
15754static void
15755HLE_Fixup2 (int bytemode, int sizeflag)
15756{
15757 if (modrm.mod != 3)
15758 {
15759 if (prefixes & PREFIX_REPZ)
15760 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15761 if (prefixes & PREFIX_REPNZ)
15762 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15763 }
15764
15765 OP_E (bytemode, sizeflag);
15766}
15767
15768/* Similar to OP_E. But the 0xf3 prefixes should be displayed as
15769 "xrelease" for memory operand. No check for LOCK prefix. */
15770
15771static void
15772HLE_Fixup3 (int bytemode, int sizeflag)
15773{
15774 if (modrm.mod != 3
15775 && last_repz_prefix > last_repnz_prefix
15776 && (prefixes & PREFIX_REPZ) != 0)
15777 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15778
15779 OP_E (bytemode, sizeflag);
15780}
15781
f5804c90
L
15782static void
15783CMPXCHG8B_Fixup (int bytemode, int sizeflag)
15784{
161a04f6
L
15785 USED_REX (REX_W);
15786 if (rex & REX_W)
f5804c90
L
15787 {
15788 /* Change cmpxchg8b to cmpxchg16b. */
ea397f5b
L
15789 char *p = mnemonicendp - 2;
15790 mnemonicendp = stpcpy (p, "16b");
fb9c77c7 15791 bytemode = o_mode;
f5804c90 15792 }
42164a71
L
15793 else if ((prefixes & PREFIX_LOCK) != 0)
15794 {
15795 if (prefixes & PREFIX_REPZ)
15796 all_prefixes[last_repz_prefix] = XRELEASE_PREFIX;
15797 if (prefixes & PREFIX_REPNZ)
15798 all_prefixes[last_repnz_prefix] = XACQUIRE_PREFIX;
15799 }
15800
f5804c90
L
15801 OP_M (bytemode, sizeflag);
15802}
42903f7f
L
15803
15804static void
15805XMM_Fixup (int reg, int sizeflag ATTRIBUTE_UNUSED)
15806{
b9733481
L
15807 const char **names;
15808
c0f3af97
L
15809 if (need_vex)
15810 {
15811 switch (vex.length)
15812 {
15813 case 128:
b9733481 15814 names = names_xmm;
c0f3af97
L
15815 break;
15816 case 256:
b9733481 15817 names = names_ymm;
c0f3af97
L
15818 break;
15819 default:
15820 abort ();
15821 }
15822 }
15823 else
b9733481
L
15824 names = names_xmm;
15825 oappend (names[reg]);
42903f7f 15826}
381d071f
L
15827
15828static void
15829CRC32_Fixup (int bytemode, int sizeflag)
15830{
15831 /* Add proper suffix to "crc32". */
ea397f5b 15832 char *p = mnemonicendp;
381d071f
L
15833
15834 switch (bytemode)
15835 {
15836 case b_mode:
20592a94 15837 if (intel_syntax)
ea397f5b 15838 goto skip;
20592a94 15839
381d071f
L
15840 *p++ = 'b';
15841 break;
15842 case v_mode:
20592a94 15843 if (intel_syntax)
ea397f5b 15844 goto skip;
20592a94 15845
381d071f
L
15846 USED_REX (REX_W);
15847 if (rex & REX_W)
15848 *p++ = 'q';
7bb15c6f 15849 else
f16cd0d5
L
15850 {
15851 if (sizeflag & DFLAG)
15852 *p++ = 'l';
15853 else
15854 *p++ = 'w';
15855 used_prefixes |= (prefixes & PREFIX_DATA);
15856 }
381d071f
L
15857 break;
15858 default:
15859 oappend (INTERNAL_DISASSEMBLER_ERROR);
15860 break;
15861 }
ea397f5b 15862 mnemonicendp = p;
381d071f
L
15863 *p = '\0';
15864
ea397f5b 15865skip:
381d071f
L
15866 if (modrm.mod == 3)
15867 {
15868 int add;
15869
15870 /* Skip mod/rm byte. */
15871 MODRM_CHECK;
15872 codep++;
15873
15874 USED_REX (REX_B);
15875 add = (rex & REX_B) ? 8 : 0;
15876 if (bytemode == b_mode)
15877 {
15878 USED_REX (0);
15879 if (rex)
15880 oappend (names8rex[modrm.rm + add]);
15881 else
15882 oappend (names8[modrm.rm + add]);
15883 }
15884 else
15885 {
15886 USED_REX (REX_W);
15887 if (rex & REX_W)
15888 oappend (names64[modrm.rm + add]);
15889 else if ((prefixes & PREFIX_DATA))
15890 oappend (names16[modrm.rm + add]);
15891 else
15892 oappend (names32[modrm.rm + add]);
15893 }
15894 }
15895 else
9344ff29 15896 OP_E (bytemode, sizeflag);
381d071f 15897}
85f10a01 15898
eacc9c89
L
15899static void
15900FXSAVE_Fixup (int bytemode, int sizeflag)
15901{
15902 /* Add proper suffix to "fxsave" and "fxrstor". */
15903 USED_REX (REX_W);
15904 if (rex & REX_W)
15905 {
15906 char *p = mnemonicendp;
15907 *p++ = '6';
15908 *p++ = '4';
15909 *p = '\0';
15910 mnemonicendp = p;
15911 }
15912 OP_M (bytemode, sizeflag);
15913}
15914
15c7c1d8
JB
15915static void
15916PCMPESTR_Fixup (int bytemode, int sizeflag)
15917{
15918 /* Add proper suffix to "{,v}pcmpestr{i,m}". */
15919 if (!intel_syntax)
15920 {
15921 char *p = mnemonicendp;
15922
15923 USED_REX (REX_W);
15924 if (rex & REX_W)
15925 *p++ = 'q';
15926 else if (sizeflag & SUFFIX_ALWAYS)
15927 *p++ = 'l';
15928
15929 *p = '\0';
15930 mnemonicendp = p;
15931 }
15932
15933 OP_EX (bytemode, sizeflag);
15934}
15935
c0f3af97
L
15936/* Display the destination register operand for instructions with
15937 VEX. */
15938
15939static void
15940OP_VEX (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
15941{
539f890d 15942 int reg;
b9733481
L
15943 const char **names;
15944
c0f3af97
L
15945 if (!need_vex)
15946 abort ();
15947
15948 if (!need_vex_reg)
15949 return;
15950
539f890d 15951 reg = vex.register_specifier;
63c6fc6c 15952 vex.register_specifier = 0;
5f847646
JB
15953 if (address_mode != mode_64bit)
15954 reg &= 7;
15955 else if (vex.evex && !vex.v)
15956 reg += 16;
43234a1e 15957
539f890d
L
15958 if (bytemode == vex_scalar_mode)
15959 {
15960 oappend (names_xmm[reg]);
15961 return;
15962 }
15963
c0f3af97
L
15964 switch (vex.length)
15965 {
15966 case 128:
15967 switch (bytemode)
15968 {
15969 case vex_mode:
15970 case vex128_mode:
6c30d220 15971 case vex_vsib_q_w_dq_mode:
5fc35d96 15972 case vex_vsib_q_w_d_mode:
cb21baef
L
15973 names = names_xmm;
15974 break;
15975 case dq_mode:
390a6789 15976 if (rex & REX_W)
cb21baef
L
15977 names = names64;
15978 else
15979 names = names32;
c0f3af97 15980 break;
1ba585e8 15981 case mask_bd_mode:
43234a1e 15982 case mask_mode:
9889cbb1
L
15983 if (reg > 0x7)
15984 {
15985 oappend ("(bad)");
15986 return;
15987 }
43234a1e
L
15988 names = names_mask;
15989 break;
c0f3af97
L
15990 default:
15991 abort ();
15992 return;
15993 }
c0f3af97
L
15994 break;
15995 case 256:
15996 switch (bytemode)
15997 {
15998 case vex_mode:
15999 case vex256_mode:
6c30d220
L
16000 names = names_ymm;
16001 break;
16002 case vex_vsib_q_w_dq_mode:
5fc35d96 16003 case vex_vsib_q_w_d_mode:
6c30d220 16004 names = vex.w ? names_ymm : names_xmm;
c0f3af97 16005 break;
1ba585e8 16006 case mask_bd_mode:
43234a1e 16007 case mask_mode:
9889cbb1
L
16008 if (reg > 0x7)
16009 {
16010 oappend ("(bad)");
16011 return;
16012 }
43234a1e
L
16013 names = names_mask;
16014 break;
c0f3af97 16015 default:
a37a2806
NC
16016 /* See PR binutils/20893 for a reproducer. */
16017 oappend ("(bad)");
c0f3af97
L
16018 return;
16019 }
c0f3af97 16020 break;
43234a1e
L
16021 case 512:
16022 names = names_zmm;
16023 break;
c0f3af97
L
16024 default:
16025 abort ();
16026 break;
16027 }
539f890d 16028 oappend (names[reg]);
c0f3af97
L
16029}
16030
922d8de8
DR
16031/* Get the VEX immediate byte without moving codep. */
16032
16033static unsigned char
ccc5981b 16034get_vex_imm8 (int sizeflag, int opnum)
922d8de8
DR
16035{
16036 int bytes_before_imm = 0;
16037
922d8de8
DR
16038 if (modrm.mod != 3)
16039 {
16040 /* There are SIB/displacement bytes. */
16041 if ((sizeflag & AFLAG) || address_mode == mode_64bit)
6c067bbb 16042 {
922d8de8 16043 /* 32/64 bit address mode */
6c067bbb 16044 int base = modrm.rm;
922d8de8
DR
16045
16046 /* Check SIB byte. */
6c067bbb
RM
16047 if (base == 4)
16048 {
16049 FETCH_DATA (the_info, codep + 1);
16050 base = *codep & 7;
16051 /* When decoding the third source, don't increase
16052 bytes_before_imm as this has already been incremented
16053 by one in OP_E_memory while decoding the second
16054 source operand. */
16055 if (opnum == 0)
16056 bytes_before_imm++;
16057 }
16058
16059 /* Don't increase bytes_before_imm when decoding the third source,
16060 it has already been incremented by OP_E_memory while decoding
16061 the second source operand. */
16062 if (opnum == 0)
16063 {
16064 switch (modrm.mod)
16065 {
16066 case 0:
16067 /* When modrm.rm == 5 or modrm.rm == 4 and base in
16068 SIB == 5, there is a 4 byte displacement. */
16069 if (base != 5)
16070 /* No displacement. */
16071 break;
1a0670f3 16072 /* Fall through. */
6c067bbb
RM
16073 case 2:
16074 /* 4 byte displacement. */
16075 bytes_before_imm += 4;
16076 break;
16077 case 1:
16078 /* 1 byte displacement. */
16079 bytes_before_imm++;
16080 break;
16081 }
16082 }
16083 }
922d8de8 16084 else
02e647f9
SP
16085 {
16086 /* 16 bit address mode */
6c067bbb
RM
16087 /* Don't increase bytes_before_imm when decoding the third source,
16088 it has already been incremented by OP_E_memory while decoding
16089 the second source operand. */
16090 if (opnum == 0)
16091 {
02e647f9
SP
16092 switch (modrm.mod)
16093 {
16094 case 0:
16095 /* When modrm.rm == 6, there is a 2 byte displacement. */
16096 if (modrm.rm != 6)
16097 /* No displacement. */
16098 break;
1a0670f3 16099 /* Fall through. */
02e647f9
SP
16100 case 2:
16101 /* 2 byte displacement. */
16102 bytes_before_imm += 2;
16103 break;
16104 case 1:
16105 /* 1 byte displacement: when decoding the third source,
16106 don't increase bytes_before_imm as this has already
16107 been incremented by one in OP_E_memory while decoding
16108 the second source operand. */
16109 if (opnum == 0)
16110 bytes_before_imm++;
ccc5981b 16111
02e647f9
SP
16112 break;
16113 }
922d8de8
DR
16114 }
16115 }
16116 }
16117
16118 FETCH_DATA (the_info, codep + bytes_before_imm + 1);
16119 return codep [bytes_before_imm];
16120}
16121
16122static void
16123OP_EX_VexReg (int bytemode, int sizeflag, int reg)
16124{
b9733481
L
16125 const char **names;
16126
922d8de8
DR
16127 if (reg == -1 && modrm.mod != 3)
16128 {
16129 OP_E_memory (bytemode, sizeflag);
16130 return;
16131 }
16132 else
16133 {
16134 if (reg == -1)
16135 {
16136 reg = modrm.rm;
16137 USED_REX (REX_B);
16138 if (rex & REX_B)
16139 reg += 8;
16140 }
5f847646
JB
16141 if (address_mode != mode_64bit)
16142 reg &= 7;
922d8de8
DR
16143 }
16144
16145 switch (vex.length)
16146 {
16147 case 128:
b9733481 16148 names = names_xmm;
922d8de8
DR
16149 break;
16150 case 256:
b9733481 16151 names = names_ymm;
922d8de8
DR
16152 break;
16153 default:
16154 abort ();
16155 }
b9733481 16156 oappend (names[reg]);
922d8de8
DR
16157}
16158
a683cc34
SP
16159static void
16160OP_EX_VexImmW (int bytemode, int sizeflag)
16161{
16162 int reg = -1;
16163 static unsigned char vex_imm8;
16164
16165 if (vex_w_done == 0)
16166 {
16167 vex_w_done = 1;
16168
16169 /* Skip mod/rm byte. */
16170 MODRM_CHECK;
16171 codep++;
16172
16173 vex_imm8 = get_vex_imm8 (sizeflag, 0);
16174
16175 if (vex.w)
16176 reg = vex_imm8 >> 4;
16177
16178 OP_EX_VexReg (bytemode, sizeflag, reg);
16179 }
16180 else if (vex_w_done == 1)
16181 {
16182 vex_w_done = 2;
16183
16184 if (!vex.w)
16185 reg = vex_imm8 >> 4;
16186
16187 OP_EX_VexReg (bytemode, sizeflag, reg);
16188 }
16189 else
16190 {
16191 /* Output the imm8 directly. */
16192 scratchbuf[0] = '$';
16193 print_operand_value (scratchbuf + 1, 1, vex_imm8 & 0xf);
9ce09ba2 16194 oappend_maybe_intel (scratchbuf);
a683cc34
SP
16195 scratchbuf[0] = '\0';
16196 codep++;
16197 }
16198}
16199
5dd85c99
SP
16200static void
16201OP_Vex_2src (int bytemode, int sizeflag)
16202{
16203 if (modrm.mod == 3)
16204 {
b9733481 16205 int reg = modrm.rm;
5dd85c99 16206 USED_REX (REX_B);
b9733481
L
16207 if (rex & REX_B)
16208 reg += 8;
16209 oappend (names_xmm[reg]);
5dd85c99
SP
16210 }
16211 else
16212 {
16213 if (intel_syntax
16214 && (bytemode == v_mode || bytemode == v_swap_mode))
16215 {
16216 bytemode = (prefixes & PREFIX_DATA) ? x_mode : q_mode;
16217 used_prefixes |= (prefixes & PREFIX_DATA);
16218 }
16219 OP_E (bytemode, sizeflag);
16220 }
16221}
16222
16223static void
16224OP_Vex_2src_1 (int bytemode, int sizeflag)
16225{
16226 if (modrm.mod == 3)
16227 {
16228 /* Skip mod/rm byte. */
16229 MODRM_CHECK;
16230 codep++;
16231 }
16232
16233 if (vex.w)
5f847646
JB
16234 {
16235 unsigned int reg = vex.register_specifier;
63c6fc6c 16236 vex.register_specifier = 0;
5f847646
JB
16237
16238 if (address_mode != mode_64bit)
16239 reg &= 7;
16240 oappend (names_xmm[reg]);
16241 }
5dd85c99
SP
16242 else
16243 OP_Vex_2src (bytemode, sizeflag);
16244}
16245
16246static void
16247OP_Vex_2src_2 (int bytemode, int sizeflag)
16248{
16249 if (vex.w)
16250 OP_Vex_2src (bytemode, sizeflag);
16251 else
5f847646
JB
16252 {
16253 unsigned int reg = vex.register_specifier;
63c6fc6c 16254 vex.register_specifier = 0;
5f847646
JB
16255
16256 if (address_mode != mode_64bit)
16257 reg &= 7;
16258 oappend (names_xmm[reg]);
16259 }
5dd85c99
SP
16260}
16261
922d8de8
DR
16262static void
16263OP_EX_VexW (int bytemode, int sizeflag)
16264{
16265 int reg = -1;
16266
16267 if (!vex_w_done)
16268 {
41effecb
SP
16269 /* Skip mod/rm byte. */
16270 MODRM_CHECK;
16271 codep++;
16272
922d8de8 16273 if (vex.w)
ccc5981b 16274 reg = get_vex_imm8 (sizeflag, 0) >> 4;
922d8de8
DR
16275 }
16276 else
16277 {
16278 if (!vex.w)
ccc5981b 16279 reg = get_vex_imm8 (sizeflag, 1) >> 4;
922d8de8
DR
16280 }
16281
16282 OP_EX_VexReg (bytemode, sizeflag, reg);
922d8de8 16283
3a2430e0
JB
16284 if (vex_w_done)
16285 codep++;
16286 vex_w_done = 1;
922d8de8
DR
16287}
16288
c0f3af97
L
16289static void
16290OP_REG_VexI4 (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16291{
16292 int reg;
b9733481
L
16293 const char **names;
16294
c0f3af97
L
16295 FETCH_DATA (the_info, codep + 1);
16296 reg = *codep++;
16297
16298 if (bytemode != x_mode)
16299 abort ();
16300
c0f3af97 16301 reg >>= 4;
5f847646
JB
16302 if (address_mode != mode_64bit)
16303 reg &= 7;
dae39acc 16304
c0f3af97
L
16305 switch (vex.length)
16306 {
16307 case 128:
b9733481 16308 names = names_xmm;
c0f3af97
L
16309 break;
16310 case 256:
b9733481 16311 names = names_ymm;
c0f3af97
L
16312 break;
16313 default:
16314 abort ();
16315 }
b9733481 16316 oappend (names[reg]);
c0f3af97
L
16317}
16318
922d8de8
DR
16319static void
16320OP_XMM_VexW (int bytemode, int sizeflag)
16321{
16322 /* Turn off the REX.W bit since it is used for swapping operands
16323 now. */
16324 rex &= ~REX_W;
16325 OP_XMM (bytemode, sizeflag);
16326}
16327
c0f3af97
L
16328static void
16329OP_EX_Vex (int bytemode, int sizeflag)
16330{
16331 if (modrm.mod != 3)
63c6fc6c 16332 need_vex_reg = 0;
c0f3af97
L
16333 OP_EX (bytemode, sizeflag);
16334}
16335
16336static void
16337OP_XMM_Vex (int bytemode, int sizeflag)
16338{
16339 if (modrm.mod != 3)
63c6fc6c 16340 need_vex_reg = 0;
c0f3af97
L
16341 OP_XMM (bytemode, sizeflag);
16342}
16343
ea397f5b
L
16344static struct op vex_cmp_op[] =
16345{
16346 { STRING_COMMA_LEN ("eq") },
16347 { STRING_COMMA_LEN ("lt") },
16348 { STRING_COMMA_LEN ("le") },
16349 { STRING_COMMA_LEN ("unord") },
16350 { STRING_COMMA_LEN ("neq") },
16351 { STRING_COMMA_LEN ("nlt") },
16352 { STRING_COMMA_LEN ("nle") },
16353 { STRING_COMMA_LEN ("ord") },
16354 { STRING_COMMA_LEN ("eq_uq") },
16355 { STRING_COMMA_LEN ("nge") },
16356 { STRING_COMMA_LEN ("ngt") },
16357 { STRING_COMMA_LEN ("false") },
16358 { STRING_COMMA_LEN ("neq_oq") },
16359 { STRING_COMMA_LEN ("ge") },
16360 { STRING_COMMA_LEN ("gt") },
16361 { STRING_COMMA_LEN ("true") },
16362 { STRING_COMMA_LEN ("eq_os") },
16363 { STRING_COMMA_LEN ("lt_oq") },
16364 { STRING_COMMA_LEN ("le_oq") },
16365 { STRING_COMMA_LEN ("unord_s") },
16366 { STRING_COMMA_LEN ("neq_us") },
16367 { STRING_COMMA_LEN ("nlt_uq") },
16368 { STRING_COMMA_LEN ("nle_uq") },
16369 { STRING_COMMA_LEN ("ord_s") },
16370 { STRING_COMMA_LEN ("eq_us") },
16371 { STRING_COMMA_LEN ("nge_uq") },
16372 { STRING_COMMA_LEN ("ngt_uq") },
16373 { STRING_COMMA_LEN ("false_os") },
16374 { STRING_COMMA_LEN ("neq_os") },
16375 { STRING_COMMA_LEN ("ge_oq") },
16376 { STRING_COMMA_LEN ("gt_oq") },
16377 { STRING_COMMA_LEN ("true_us") },
c0f3af97
L
16378};
16379
16380static void
16381VCMP_Fixup (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16382{
16383 unsigned int cmp_type;
16384
16385 FETCH_DATA (the_info, codep + 1);
16386 cmp_type = *codep++ & 0xff;
16387 if (cmp_type < ARRAY_SIZE (vex_cmp_op))
16388 {
16389 char suffix [3];
ea397f5b 16390 char *p = mnemonicendp - 2;
c0f3af97
L
16391 suffix[0] = p[0];
16392 suffix[1] = p[1];
16393 suffix[2] = '\0';
ea397f5b
L
16394 sprintf (p, "%s%s", vex_cmp_op[cmp_type].name, suffix);
16395 mnemonicendp += vex_cmp_op[cmp_type].len;
c0f3af97
L
16396 }
16397 else
16398 {
16399 /* We have a reserved extension byte. Output it directly. */
16400 scratchbuf[0] = '$';
16401 print_operand_value (scratchbuf + 1, 1, cmp_type);
9ce09ba2 16402 oappend_maybe_intel (scratchbuf);
c0f3af97
L
16403 scratchbuf[0] = '\0';
16404 }
16405}
16406
43234a1e
L
16407static void
16408VPCMP_Fixup (int bytemode ATTRIBUTE_UNUSED,
16409 int sizeflag ATTRIBUTE_UNUSED)
16410{
16411 unsigned int cmp_type;
16412
16413 if (!vex.evex)
16414 abort ();
16415
16416 FETCH_DATA (the_info, codep + 1);
16417 cmp_type = *codep++ & 0xff;
16418 /* There are aliases for immediates 0, 1, 2, 4, 5, 6.
16419 If it's the case, print suffix, otherwise - print the immediate. */
16420 if (cmp_type < ARRAY_SIZE (simd_cmp_op)
16421 && cmp_type != 3
16422 && cmp_type != 7)
16423 {
16424 char suffix [3];
16425 char *p = mnemonicendp - 2;
16426
16427 /* vpcmp* can have both one- and two-lettered suffix. */
16428 if (p[0] == 'p')
16429 {
16430 p++;
16431 suffix[0] = p[0];
16432 suffix[1] = '\0';
16433 }
16434 else
16435 {
16436 suffix[0] = p[0];
16437 suffix[1] = p[1];
16438 suffix[2] = '\0';
16439 }
16440
16441 sprintf (p, "%s%s", simd_cmp_op[cmp_type].name, suffix);
16442 mnemonicendp += simd_cmp_op[cmp_type].len;
16443 }
be92cb14
JB
16444 else
16445 {
16446 /* We have a reserved extension byte. Output it directly. */
16447 scratchbuf[0] = '$';
16448 print_operand_value (scratchbuf + 1, 1, cmp_type);
16449 oappend_maybe_intel (scratchbuf);
16450 scratchbuf[0] = '\0';
16451 }
16452}
16453
16454static const struct op xop_cmp_op[] =
16455{
16456 { STRING_COMMA_LEN ("lt") },
16457 { STRING_COMMA_LEN ("le") },
16458 { STRING_COMMA_LEN ("gt") },
16459 { STRING_COMMA_LEN ("ge") },
16460 { STRING_COMMA_LEN ("eq") },
16461 { STRING_COMMA_LEN ("neq") },
16462 { STRING_COMMA_LEN ("false") },
16463 { STRING_COMMA_LEN ("true") }
16464};
16465
16466static void
16467VPCOM_Fixup (int bytemode ATTRIBUTE_UNUSED,
16468 int sizeflag ATTRIBUTE_UNUSED)
16469{
16470 unsigned int cmp_type;
16471
16472 FETCH_DATA (the_info, codep + 1);
16473 cmp_type = *codep++ & 0xff;
16474 if (cmp_type < ARRAY_SIZE (xop_cmp_op))
16475 {
16476 char suffix[3];
16477 char *p = mnemonicendp - 2;
16478
16479 /* vpcom* can have both one- and two-lettered suffix. */
16480 if (p[0] == 'm')
16481 {
16482 p++;
16483 suffix[0] = p[0];
16484 suffix[1] = '\0';
16485 }
16486 else
16487 {
16488 suffix[0] = p[0];
16489 suffix[1] = p[1];
16490 suffix[2] = '\0';
16491 }
16492
16493 sprintf (p, "%s%s", xop_cmp_op[cmp_type].name, suffix);
16494 mnemonicendp += xop_cmp_op[cmp_type].len;
16495 }
43234a1e
L
16496 else
16497 {
16498 /* We have a reserved extension byte. Output it directly. */
16499 scratchbuf[0] = '$';
16500 print_operand_value (scratchbuf + 1, 1, cmp_type);
9ce09ba2 16501 oappend_maybe_intel (scratchbuf);
43234a1e
L
16502 scratchbuf[0] = '\0';
16503 }
16504}
16505
ea397f5b
L
16506static const struct op pclmul_op[] =
16507{
16508 { STRING_COMMA_LEN ("lql") },
16509 { STRING_COMMA_LEN ("hql") },
16510 { STRING_COMMA_LEN ("lqh") },
16511 { STRING_COMMA_LEN ("hqh") }
c0f3af97
L
16512};
16513
16514static void
16515PCLMUL_Fixup (int bytemode ATTRIBUTE_UNUSED,
16516 int sizeflag ATTRIBUTE_UNUSED)
16517{
16518 unsigned int pclmul_type;
16519
16520 FETCH_DATA (the_info, codep + 1);
16521 pclmul_type = *codep++ & 0xff;
16522 switch (pclmul_type)
16523 {
16524 case 0x10:
16525 pclmul_type = 2;
16526 break;
16527 case 0x11:
16528 pclmul_type = 3;
16529 break;
16530 default:
16531 break;
7bb15c6f 16532 }
c0f3af97
L
16533 if (pclmul_type < ARRAY_SIZE (pclmul_op))
16534 {
16535 char suffix [4];
ea397f5b 16536 char *p = mnemonicendp - 3;
c0f3af97
L
16537 suffix[0] = p[0];
16538 suffix[1] = p[1];
16539 suffix[2] = p[2];
16540 suffix[3] = '\0';
ea397f5b
L
16541 sprintf (p, "%s%s", pclmul_op[pclmul_type].name, suffix);
16542 mnemonicendp += pclmul_op[pclmul_type].len;
c0f3af97
L
16543 }
16544 else
16545 {
16546 /* We have a reserved extension byte. Output it directly. */
16547 scratchbuf[0] = '$';
16548 print_operand_value (scratchbuf + 1, 1, pclmul_type);
9ce09ba2 16549 oappend_maybe_intel (scratchbuf);
c0f3af97
L
16550 scratchbuf[0] = '\0';
16551 }
16552}
16553
f1f8f695
L
16554static void
16555MOVBE_Fixup (int bytemode, int sizeflag)
16556{
16557 /* Add proper suffix to "movbe". */
ea397f5b 16558 char *p = mnemonicendp;
f1f8f695
L
16559
16560 switch (bytemode)
16561 {
16562 case v_mode:
16563 if (intel_syntax)
ea397f5b 16564 goto skip;
f1f8f695
L
16565
16566 USED_REX (REX_W);
16567 if (sizeflag & SUFFIX_ALWAYS)
16568 {
16569 if (rex & REX_W)
16570 *p++ = 'q';
f1f8f695 16571 else
f16cd0d5
L
16572 {
16573 if (sizeflag & DFLAG)
16574 *p++ = 'l';
16575 else
16576 *p++ = 'w';
16577 used_prefixes |= (prefixes & PREFIX_DATA);
16578 }
f1f8f695 16579 }
f1f8f695
L
16580 break;
16581 default:
16582 oappend (INTERNAL_DISASSEMBLER_ERROR);
16583 break;
16584 }
ea397f5b 16585 mnemonicendp = p;
f1f8f695
L
16586 *p = '\0';
16587
ea397f5b 16588skip:
f1f8f695
L
16589 OP_M (bytemode, sizeflag);
16590}
f88c9eb0
SP
16591
16592static void
16593OP_LWPCB_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16594{
16595 int reg;
16596 const char **names;
16597
16598 /* Skip mod/rm byte. */
16599 MODRM_CHECK;
16600 codep++;
16601
390a6789 16602 if (rex & REX_W)
f88c9eb0 16603 names = names64;
f88c9eb0 16604 else
ce7d077e 16605 names = names32;
f88c9eb0
SP
16606
16607 reg = modrm.rm;
16608 USED_REX (REX_B);
16609 if (rex & REX_B)
16610 reg += 8;
16611
16612 oappend (names[reg]);
16613}
16614
16615static void
16616OP_LWP_E (int bytemode ATTRIBUTE_UNUSED, int sizeflag ATTRIBUTE_UNUSED)
16617{
16618 const char **names;
5f847646 16619 unsigned int reg = vex.register_specifier;
63c6fc6c 16620 vex.register_specifier = 0;
f88c9eb0 16621
390a6789 16622 if (rex & REX_W)
f88c9eb0 16623 names = names64;
f88c9eb0 16624 else
ce7d077e 16625 names = names32;
f88c9eb0 16626
5f847646
JB
16627 if (address_mode != mode_64bit)
16628 reg &= 7;
16629 oappend (names[reg]);
f88c9eb0 16630}
43234a1e
L
16631
16632static void
16633OP_Mask (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16634{
16635 if (!vex.evex
1ba585e8 16636 || (bytemode != mask_mode && bytemode != mask_bd_mode))
43234a1e
L
16637 abort ();
16638
16639 USED_REX (REX_R);
16640 if ((rex & REX_R) != 0 || !vex.r)
16641 {
16642 BadOp ();
16643 return;
16644 }
16645
16646 oappend (names_mask [modrm.reg]);
16647}
16648
16649static void
16650OP_Rounding (int bytemode, int sizeflag ATTRIBUTE_UNUSED)
16651{
16652 if (!vex.evex
16653 || (bytemode != evex_rounding_mode
70df6fc9 16654 && bytemode != evex_rounding_64_mode
43234a1e
L
16655 && bytemode != evex_sae_mode))
16656 abort ();
16657 if (modrm.mod == 3 && vex.b)
16658 switch (bytemode)
16659 {
70df6fc9
L
16660 case evex_rounding_64_mode:
16661 if (address_mode != mode_64bit)
16662 {
16663 oappend ("(bad)");
16664 break;
16665 }
16666 /* Fall through. */
43234a1e
L
16667 case evex_rounding_mode:
16668 oappend (names_rounding[vex.ll]);
16669 break;
16670 case evex_sae_mode:
16671 oappend ("{sae}");
16672 break;
16673 default:
16674 break;
16675 }
16676}
This page took 2.318928 seconds and 4 git commands to generate.