17c478bdstevel@tonic-gate/*
2d0f8ff6kk *
37c478bdstevel@tonic-gate * CDDL HEADER START
47c478bdstevel@tonic-gate *
57c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
6dc0093feschrock * Common Development and Distribution License (the "License").
7dc0093feschrock * You may not use this file except in compliance with the License.
87c478bdstevel@tonic-gate *
97c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
117c478bdstevel@tonic-gate * See the License for the specific language governing permissions
127c478bdstevel@tonic-gate * and limitations under the License.
137c478bdstevel@tonic-gate *
147c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
157c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
177c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
187c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bdstevel@tonic-gate *
207c478bdstevel@tonic-gate * CDDL HEADER END
217c478bdstevel@tonic-gate */
227c478bdstevel@tonic-gate/*
23ab47273Edward Gillett * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24c1e9bf0Robert Mustacchi * Copyright 2019 Joyent, Inc.
25a25e615Robert Mustacchi * Copyright 2020 Robert Mustacchi
26ab47273Edward Gillett */
27ab47273Edward Gillett
28ab47273Edward Gillett/*
29ab47273Edward Gillett * Copyright (c) 2010, Intel Corporation.
30ab47273Edward Gillett * All rights reserved.
317c478bdstevel@tonic-gate */
327c478bdstevel@tonic-gate
337c478bdstevel@tonic-gate/*	Copyright (c) 1988 AT&T	*/
34cff040fRobert Mustacchi/*	  All Rights Reserved	*/
357c478bdstevel@tonic-gate
367c478bdstevel@tonic-gate#include	"dis_tables.h"
377c478bdstevel@tonic-gate
387c478bdstevel@tonic-gate/* BEGIN CSTYLED */
397c478bdstevel@tonic-gate
407c478bdstevel@tonic-gate/*
417c478bdstevel@tonic-gate * Disassembly begins in dis_distable, which is equivalent to the One-byte
427c478bdstevel@tonic-gate * Opcode Map in the Intel IA32 ISA Reference (page A-6 in my copy).  The
437c478bdstevel@tonic-gate * decoding loops then traverse out through the other tables as necessary to
447c478bdstevel@tonic-gate * decode a given instruction.
457c478bdstevel@tonic-gate *
467c478bdstevel@tonic-gate * The behavior of this file can be controlled by one of the following flags:
477c478bdstevel@tonic-gate *
48cff040fRobert Mustacchi *	DIS_TEXT	Include text for disassembly
49cff040fRobert Mustacchi *	DIS_MEM		Include memory-size calculations
507c478bdstevel@tonic-gate *
517c478bdstevel@tonic-gate * Either or both of these can be defined.
527c478bdstevel@tonic-gate *
537c478bdstevel@tonic-gate * This file is not, and will never be, cstyled.  If anything, the tables should
547c478bdstevel@tonic-gate * be taken out another tab stop or two so nothing overlaps.
557c478bdstevel@tonic-gate */
567c478bdstevel@tonic-gate
577c478bdstevel@tonic-gate/*
587c478bdstevel@tonic-gate * These functions must be provided for the consumer to do disassembly.
597c478bdstevel@tonic-gate */
607c478bdstevel@tonic-gate#ifdef DIS_TEXT
617c478bdstevel@tonic-gateextern char *strncpy(char *, const char *, size_t);
627c478bdstevel@tonic-gateextern size_t strlen(const char *);
637c478bdstevel@tonic-gateextern int strcmp(const char *, const char *);
647c478bdstevel@tonic-gateextern int strncmp(const char *, const char *, size_t);
657c478bdstevel@tonic-gateextern size_t strlcat(char *, const char *, size_t);
667c478bdstevel@tonic-gate#endif
677c478bdstevel@tonic-gate
687c478bdstevel@tonic-gate
69cff040fRobert Mustacchi#define		TERM	0	/* used to indicate that the 'indirect' */
707c478bdstevel@tonic-gate				/* field terminates - no pointer.	*/
717c478bdstevel@tonic-gate
727c478bdstevel@tonic-gate/* Used to decode instructions. */
737c478bdstevel@tonic-gatetypedef struct	instable {
747c478bdstevel@tonic-gate	struct instable	*it_indirect;	/* for decode op codes */
757c478bdstevel@tonic-gate	uchar_t		it_adrmode;
767c478bdstevel@tonic-gate#ifdef DIS_TEXT
777c478bdstevel@tonic-gate	char		it_name[NCPS];
78d267098dmick	uint_t		it_suffix:1;		/* mnem + "w", "l", or "d" */
797c478bdstevel@tonic-gate#endif
807c478bdstevel@tonic-gate#ifdef DIS_MEM
817c478bdstevel@tonic-gate	uint_t		it_size:16;
827c478bdstevel@tonic-gate#endif
837c478bdstevel@tonic-gate	uint_t		it_invalid64:1;		/* opcode invalid in amd64 */
847c478bdstevel@tonic-gate	uint_t		it_always64:1;		/* 64 bit when in 64 bit mode */
857c478bdstevel@tonic-gate	uint_t		it_invalid32:1;		/* invalid in IA32 */
867c478bdstevel@tonic-gate	uint_t		it_stackop:1;		/* push/pop stack operation */
87245ac94Robert Mustacchi	uint_t		it_vexwoxmm:1;		/* VEX instructions that don't use XMM/YMM */
88d242cdfJerry Jelinek	uint_t		it_avxsuf:2;		/* AVX2/AVX512 suffix rqd. */
89a4e73d5Jerry Jelinek	uint_t		it_vexopmask:1;		/* VEX inst. that use opmask */
907c478bdstevel@tonic-gate} instable_t;
917c478bdstevel@tonic-gate
927c478bdstevel@tonic-gate/*
937c478bdstevel@tonic-gate * Instruction formats.
947c478bdstevel@tonic-gate */
957c478bdstevel@tonic-gateenum {
967c478bdstevel@tonic-gate	UNKNOWN,
977c478bdstevel@tonic-gate	MRw,
987c478bdstevel@tonic-gate	IMlw,
997c478bdstevel@tonic-gate	IMw,
1007c478bdstevel@tonic-gate	IR,
1017c478bdstevel@tonic-gate	OA,
1027c478bdstevel@tonic-gate	AO,
1037c478bdstevel@tonic-gate	MS,
1047c478bdstevel@tonic-gate	SM,
1057c478bdstevel@tonic-gate	Mv,
1067c478bdstevel@tonic-gate	Mw,
1077c478bdstevel@tonic-gate	M,		/* register or memory */
1087aa76ffBryan Cantrill	MG9,		/* register or memory in group 9 (prefix optional) */
1097c478bdstevel@tonic-gate	Mb,		/* register or memory, always byte sized */
1107c478bdstevel@tonic-gate	MO,		/* memory only (no registers) */
1117c478bdstevel@tonic-gate	PREF,
112eb23829Bryan Cantrill	SWAPGS_RDTSCP,
113f880125kk	MONITOR_MWAIT,
1147c478bdstevel@tonic-gate	R,
1157c478bdstevel@tonic-gate	RA,
1167c478bdstevel@tonic-gate	SEG,
1177c478bdstevel@tonic-gate	MR,
1187c478bdstevel@tonic-gate	RM,
119cff040fRobert Mustacchi	RM_66r,		/* RM, but with a required 0x66 prefix */
1207c478bdstevel@tonic-gate	IA,
1217c478bdstevel@tonic-gate	MA,
1227c478bdstevel@tonic-gate	SD,
1237c478bdstevel@tonic-gate	AD,
1247c478bdstevel@tonic-gate	SA,
1257c478bdstevel@tonic-gate	D,
1267c478bdstevel@tonic-gate	INM,
1277c478bdstevel@tonic-gate	SO,
1287c478bdstevel@tonic-gate	BD,
1297c478bdstevel@tonic-gate	I,
1307c478bdstevel@tonic-gate	P,
1317c478bdstevel@tonic-gate	V,
1327c478bdstevel@tonic-gate	DSHIFT,		/* for double shift that has an 8-bit immediate */
1337c478bdstevel@tonic-gate	U,
1347c478bdstevel@tonic-gate	OVERRIDE,
1357c478bdstevel@tonic-gate	NORM,		/* instructions w/o ModR/M byte, no memory access */
1367c478bdstevel@tonic-gate	IMPLMEM,	/* instructions w/o ModR/M byte, implicit mem access */
1377c478bdstevel@tonic-gate	O,		/* for call	*/
138cff040fRobert Mustacchi	JTAB,		/* jump table	*/
1397c478bdstevel@tonic-gate	IMUL,		/* for 186 iimul instr  */
1407c478bdstevel@tonic-gate	CBW,		/* so data16 can be evaluated for cbw and variants */
1417c478bdstevel@tonic-gate	MvI,		/* for 186 logicals */
1427c478bdstevel@tonic-gate	ENTER,		/* for 186 enter instr  */
1437c478bdstevel@tonic-gate	RMw,		/* for 286 arpl instr */
1447c478bdstevel@tonic-gate	Ib,		/* for push immediate byte */
1457c478bdstevel@tonic-gate	F,		/* for 287 instructions */
1467c478bdstevel@tonic-gate	FF,		/* for 287 instructions */
1477c478bdstevel@tonic-gate	FFC,		/* for 287 instructions */
1487c478bdstevel@tonic-gate	DM,		/* 16-bit data */
1497c478bdstevel@tonic-gate	AM,		/* 16-bit addr */
1507c478bdstevel@tonic-gate	LSEG,		/* for 3-bit seg reg encoding */
1517c478bdstevel@tonic-gate	MIb,		/* for 386 logicals */
1527c478bdstevel@tonic-gate	SREG,		/* for 386 special registers */
1537c478bdstevel@tonic-gate	PREFIX,		/* a REP instruction prefix */
1547c478bdstevel@tonic-gate	LOCK,		/* a LOCK instruction prefix */
1557c478bdstevel@tonic-gate	INT3,		/* The int 3 instruction, which has a fake operand */
1567c478bdstevel@tonic-gate	INTx,		/* The normal int instruction, with explicit int num */
1577c478bdstevel@tonic-gate	DSHIFTcl,	/* for double shift that implicitly uses %cl */
1587c478bdstevel@tonic-gate	CWD,		/* so data16 can be evaluated for cwd and variants */
1597c478bdstevel@tonic-gate	RET,		/* single immediate 16-bit operand */
1607c478bdstevel@tonic-gate	MOVZ,		/* for movs and movz, with different size operands */
161d0f8ff6kk	CRC32,		/* for crc32, with different size operands */
1627c478bdstevel@tonic-gate	XADDB,		/* for xaddb */
1637c478bdstevel@tonic-gate	MOVSXZ,		/* AMD64 mov sign extend 32 to 64 bit instruction */
16482d5eb4Krishnendu Sadhukhan - Sun Microsystems	MOVBE,		/* movbe instruction */
1657c478bdstevel@tonic-gate
1667c478bdstevel@tonic-gate/*
1677c478bdstevel@tonic-gate * MMX/SIMD addressing modes.
1687c478bdstevel@tonic-gate */
1697c478bdstevel@tonic-gate
1707c478bdstevel@tonic-gate	MMO,		/* Prefixable MMX/SIMD-Int	mm/mem	-> mm */
1717c478bdstevel@tonic-gate	MMOIMPL,	/* Prefixable MMX/SIMD-Int	mm	-> mm (mem) */
1727c478bdstevel@tonic-gate	MMO3P,		/* Prefixable MMX/SIMD-Int	mm	-> r32,imm8 */
173cff040fRobert Mustacchi	MMOM3,		/* Prefixable MMX/SIMD-Int	mm	-> r32	*/
1747c478bdstevel@tonic-gate	MMOS,		/* Prefixable MMX/SIMD-Int	mm	-> mm/mem */
1757c478bdstevel@tonic-gate	MMOMS,		/* Prefixable MMX/SIMD-Int	mm	-> mem */
1767c478bdstevel@tonic-gate	MMOPM,		/* MMX/SIMD-Int			mm/mem	-> mm,imm8 */
177d0f8ff6kk	MMOPM_66o,	/* MMX/SIMD-Int 0x66 optional	mm/mem	-> mm,imm8 */
1787c478bdstevel@tonic-gate	MMOPRM,		/* Prefixable MMX/SIMD-Int	r32/mem	-> mm,imm8 */
1797c478bdstevel@tonic-gate	MMOSH,		/* Prefixable MMX		mm,imm8	*/
1807c478bdstevel@tonic-gate	MM,		/* MMX/SIMD-Int			mm/mem	-> mm	*/
1817c478bdstevel@tonic-gate	MMS,		/* MMX/SIMD-Int			mm	-> mm/mem */
1827c478bdstevel@tonic-gate	MMSH,		/* MMX				mm,imm8 */
1837c478bdstevel@tonic-gate	XMMO,		/* Prefixable SIMD		xmm/mem	-> xmm */
1847c478bdstevel@tonic-gate	XMMOS,		/* Prefixable SIMD		xmm	-> xmm/mem */
1857c478bdstevel@tonic-gate	XMMOPM,		/* Prefixable SIMD		xmm/mem	w/to xmm,imm8 */
1867c478bdstevel@tonic-gate	XMMOMX,		/* Prefixable SIMD		mm/mem	-> xmm */
1877c478bdstevel@tonic-gate	XMMOX3,		/* Prefixable SIMD		xmm	-> r32 */
1887c478bdstevel@tonic-gate	XMMOXMM,	/* Prefixable SIMD		xmm/mem	-> mm	*/
1897c478bdstevel@tonic-gate	XMMOM,		/* Prefixable SIMD		xmm	-> mem */
1907c478bdstevel@tonic-gate	XMMOMS,		/* Prefixable SIMD		mem	-> xmm */
191cff040fRobert Mustacchi	XMM,		/* SIMD				xmm/mem	-> xmm */
192d0f8ff6kk	XMM_66r,	/* SIMD 0x66 prefix required	xmm/mem	-> xmm */
193cff040fRobert Mustacchi	XMM_66o,	/* SIMD 0x66 prefix optional	xmm/mem	-> xmm */
1947c478bdstevel@tonic-gate	XMMXIMPL,	/* SIMD				xmm	-> xmm (mem) */
1957c478bdstevel@tonic-gate	XMM3P,		/* SIMD				xmm	-> r32,imm8 */
196d0f8ff6kk	XMM3PM_66r,	/* SIMD 0x66 prefix required	xmm	-> r32/mem,imm8 */
197cff040fRobert Mustacchi	XMMP,		/* SIMD				xmm/mem w/to xmm,imm8 */
198d0f8ff6kk	XMMP_66o,	/* SIMD 0x66 prefix optional	xmm/mem w/to xmm,imm8 */
199d0f8ff6kk	XMMP_66r,	/* SIMD 0x66 prefix required	xmm/mem w/to xmm,imm8 */
200cff040fRobert Mustacchi	XMMPRM,		/* SIMD				r32/mem -> xmm,imm8 */
201d0f8ff6kk	XMMPRM_66r,	/* SIMD 0x66 prefix required	r32/mem -> xmm,imm8 */
2027c478bdstevel@tonic-gate	XMMS,		/* SIMD				xmm	-> xmm/mem */
203cff040fRobert Mustacchi	XMMM,		/* SIMD				mem	-> xmm */
204d0f8ff6kk	XMMM_66r,	/* SIMD	0x66 prefix required	mem	-> xmm */
2057c478bdstevel@tonic-gate	XMMMS,		/* SIMD				xmm	-> mem */
206cff040fRobert Mustacchi	XMM3MX,		/* SIMD				r32/mem -> xmm */
207cff040fRobert Mustacchi	XMM3MXS,	/* SIMD				xmm	-> r32/mem */
208cff040fRobert Mustacchi	XMMSH,		/* SIMD				xmm,imm8 */
209cff040fRobert Mustacchi	XMMXM3,		/* SIMD				xmm/mem -> r32 */
210cff040fRobert Mustacchi	XMMX3,		/* SIMD				xmm	-> r32 */
211cff040fRobert Mustacchi	XMMXMM,		/* SIMD				xmm/mem	-> mm */
212cff040fRobert Mustacchi	XMMMX,		/* SIMD				mm	-> xmm */
213cff040fRobert Mustacchi	XMMXM,		/* SIMD				xmm	-> mm */
214cff040fRobert Mustacchi	XMMX2I,		/* SIMD				xmm -> xmm, imm, imm */
215cff040fRobert Mustacchi	XMM2I,		/* SIMD				xmm, imm, imm */
2167c478bdstevel@tonic-gate	XMMFENCE,	/* SIMD lfence or mfence */
217ab47273Edward Gillett	XMMSFNC,	/* SIMD sfence (none or mem) */
218cff040fRobert Mustacchi	FSGS,		/* FSGSBASE if reg */
219ab47273Edward Gillett	XGETBV_XSETBV,
220ab47273Edward Gillett	VEX_NONE,	/* VEX  no operand */
221ab47273Edward Gillett	VEX_MO,		/* VEX	mod_rm		               -> implicit reg */
222ab47273Edward Gillett	VEX_RMrX,	/* VEX  VEX.vvvv, mod_rm               -> mod_reg */
223245ac94Robert Mustacchi	VEX_VRMrX,	/* VEX  mod_rm, VEX.vvvv               -> mod_rm */
224ab47273Edward Gillett	VEX_RRX,	/* VEX  VEX.vvvv, mod_reg              -> mod_rm */
225ab47273Edward Gillett	VEX_RMRX,	/* VEX  VEX.vvvv, mod_rm, imm8[7:4]    -> mod_reg */
226cff040fRobert Mustacchi	VEX_MX,		/* VEX  mod_rm                         -> mod_reg */
227cff040fRobert Mustacchi	VEX_MXI,	/* VEX  mod_rm, imm8                   -> mod_reg */
228cff040fRobert Mustacchi	VEX_XXI,	/* VEX  mod_rm, imm8                   -> VEX.vvvv */
229cff040fRobert Mustacchi	VEX_MR,		/* VEX  mod_rm                         -> mod_reg */
230cff040fRobert Mustacchi	VEX_RRI,	/* VEX  mod_reg, mod_rm                -> implicit(eflags/r32) */
231cff040fRobert Mustacchi	VEX_RX,		/* VEX  mod_reg                        -> mod_rm */
232cff040fRobert Mustacchi	VEX_KRR,	/* VEX  mod_rm                         -> mod_reg */
233cff040fRobert Mustacchi	VEX_KMR,	/* VEX  mod_reg                        -> mod_rm */
234cff040fRobert Mustacchi	VEX_KRM,	/* VEX  mod_rm                         -> mod_reg */
235cff040fRobert Mustacchi	VEX_RR,		/* VEX  mod_rm                         -> mod_reg */
236cff040fRobert Mustacchi	VEX_RRi,	/* VEX  mod_rm, imm8                   -> mod_reg */
237cff040fRobert Mustacchi	VEX_RM,		/* VEX  mod_reg                        -> mod_rm */
238245ac94Robert Mustacchi	VEX_RIM,	/* VEX  mod_reg, imm8                  -> mod_rm */
239cff040fRobert Mustacchi	VEX_RRM,	/* VEX  VEX.vvvv, mod_reg              -> mod_rm */
240cff040fRobert Mustacchi	VEX_RMX,	/* VEX  VEX.vvvv, mod_rm               -> mod_reg */
241245ac94Robert Mustacchi	VEX_SbVM,	/* VEX  SIB, VEX.vvvv                  -> mod_rm */
2427aa76ffBryan Cantrill	VMx,		/* vmcall/vmlaunch/vmresume/vmxoff */
24370dc763Richard Lowe	VMxo,		/* VMx instruction with optional prefix */
244245ac94Robert Mustacchi	SVM,		/* AMD SVM instructions */
245245ac94Robert Mustacchi	BLS,		/* BLSR, BLSMSK, BLSI */
2468889c87Robert Mustacchi	FMA,		/* FMA instructions, all VEX_RMrX */
24781b505bJerry Jelinek	ADX,		/* ADX instructions, support REX.w, mod_rm->mod_reg */
248cff040fRobert Mustacchi	EVEX_RX,	/* EVEX  mod_reg                      -> mod_rm */
249cff040fRobert Mustacchi	EVEX_MX,	/* EVEX  mod_rm                       -> mod_reg */
250a25e615Robert Mustacchi	EVEX_RMrX,	/* EVEX  EVEX.vvvv, mod_rm            -> mod_reg */
251a25e615Robert Mustacchi	EVEX_RMRX	/* EVEX  EVEX.vvvv, mod_rm, imm8      -> mod_reg */
2527c478bdstevel@tonic-gate};
2537c478bdstevel@tonic-gate
254ab47273Edward Gillett/*
255ab47273Edward Gillett * VEX prefixes
256ab47273Edward Gillett */
257ab47273Edward Gillett#define VEX_2bytes	0xC5	/* the first byte of two-byte form */
258ab47273Edward Gillett#define VEX_3bytes	0xC4	/* the first byte of three-byte form */
259ab47273Edward Gillett
2607c478bdstevel@tonic-gate#define	FILL	0x90	/* Fill byte used for alignment (nop)	*/
2617c478bdstevel@tonic-gate
2627c478bdstevel@tonic-gate/*
2637c478bdstevel@tonic-gate** Register numbers for the i386
2647c478bdstevel@tonic-gate*/
2657c478bdstevel@tonic-gate#define	EAX_REGNO 0
2667c478bdstevel@tonic-gate#define	ECX_REGNO 1
2677c478bdstevel@tonic-gate#define	EDX_REGNO 2
2687c478bdstevel@tonic-gate#define	EBX_REGNO 3
2697c478bdstevel@tonic-gate#define	ESP_REGNO 4
2707c478bdstevel@tonic-gate#define	EBP_REGNO 5
2717c478bdstevel@tonic-gate#define	ESI_REGNO 6
2727c478bdstevel@tonic-gate#define	EDI_REGNO 7
2737c478bdstevel@tonic-gate
2747c478bdstevel@tonic-gate/*
2757c478bdstevel@tonic-gate * modes for immediate values
2767c478bdstevel@tonic-gate */
2777c478bdstevel@tonic-gate#define	MODE_NONE	0
2787c478bdstevel@tonic-gate#define	MODE_IPREL	1	/* signed IP relative value */
2797c478bdstevel@tonic-gate#define	MODE_SIGNED	2	/* sign extended immediate */
2807c478bdstevel@tonic-gate#define	MODE_IMPLIED	3	/* constant value implied from opcode */
2817c478bdstevel@tonic-gate#define	MODE_OFFSET	4	/* offset part of an address */
282d267098dmick#define	MODE_RIPREL	5	/* like IPREL, but from %rip (amd64) */
2837c478bdstevel@tonic-gate
2847c478bdstevel@tonic-gate/*
2857c478bdstevel@tonic-gate * The letters used in these macros are:
2867c478bdstevel@tonic-gate *   IND - indirect to another to another table
2877c478bdstevel@tonic-gate *   "T" - means to Terminate indirections (this is the final opcode)
2887c478bdstevel@tonic-gate *   "S" - means "operand length suffix required"
289d242cdfJerry Jelinek *   "Sa" - means AVX2 suffix (q/d) required
290d242cdfJerry Jelinek *   "Sq" - means AVX512 suffix (q/d) required
291d242cdfJerry Jelinek *   "Sd" - means AVX512 suffix (d/s) required
2927c478bdstevel@tonic-gate *   "NS" - means "no suffix" which is the operand length suffix of the opcode
2937c478bdstevel@tonic-gate *   "Z" - means instruction size arg required
2947c478bdstevel@tonic-gate *   "u" - means the opcode is invalid in IA32 but valid in amd64
2957c478bdstevel@tonic-gate *   "x" - means the opcode is invalid in amd64, but not IA32
2967c478bdstevel@tonic-gate *   "y" - means the operand size is always 64 bits in 64 bit mode
2977c478bdstevel@tonic-gate *   "p" - means push/pop stack operation
298245ac94Robert Mustacchi *   "vr" - means VEX instruction that operates on normal registers, not fpu
299a4e73d5Jerry Jelinek *   "vo" - means VEX instruction that operates on opmask registers, not fpu
3007c478bdstevel@tonic-gate */
3017c478bdstevel@tonic-gate
302d242cdfJerry Jelinek#define	AVS2	(uint_t)1	/* it_avxsuf: AVX2 q/d suffix handling */
303d242cdfJerry Jelinek#define	AVS5Q	(uint_t)2	/* it_avxsuf: AVX512 q/d suffix handling */
304d242cdfJerry Jelinek#define	AVS5D	(uint_t)3	/* it_avxsuf: AVX512 d/s suffix handling */
305d242cdfJerry Jelinek
3067c478bdstevel@tonic-gate#if defined(DIS_TEXT) && defined(DIS_MEM)
3077c478bdstevel@tonic-gate#define	IND(table)		{(instable_t *)table, 0, "", 0, 0, 0, 0, 0, 0}
3087c478bdstevel@tonic-gate#define	INDx(table)		{(instable_t *)table, 0, "", 0, 0, 1, 0, 0, 0}
3097c478bdstevel@tonic-gate#define	TNS(name, amode)	{TERM, amode, name, 0, 0, 0, 0, 0, 0}
3107c478bdstevel@tonic-gate#define	TNSu(name, amode)	{TERM, amode, name, 0, 0, 0, 0, 1, 0}
3117c478bdstevel@tonic-gate#define	TNSx(name, amode)	{TERM, amode, name, 0, 0, 1, 0, 0, 0}
3127c478bdstevel@tonic-gate#define	TNSy(name, amode)	{TERM, amode, name, 0, 0, 0, 1, 0, 0}
3137c478bdstevel@tonic-gate#define	TNSyp(name, amode)	{TERM, amode, name, 0, 0, 0, 1, 0, 1}
3147c478bdstevel@tonic-gate#define	TNSZ(name, amode, sz)	{TERM, amode, name, 0, sz, 0, 0, 0, 0}
3157c478bdstevel@tonic-gate#define	TNSZy(name, amode, sz)	{TERM, amode, name, 0, sz, 0, 1, 0, 0}
316245ac94Robert Mustacchi#define	TNSZvr(name, amode, sz)	{TERM, amode, name, 0, sz, 0, 0, 0, 0, 1}
317a4e73d5Jerry Jelinek#define	TSvo(name, amode)	{TERM, amode, name, 1,  0, 0, 0, 0, 0, 0, 0, 1}
3187c478bdstevel@tonic-gate#define	TS(name, amode)		{TERM, amode, name, 1, 0, 0, 0, 0, 0}
3197c478bdstevel@tonic-gate#define	TSx(name, amode)	{TERM, amode, name, 1, 0, 1, 0, 0, 0}
3207c478bdstevel@tonic-gate#define	TSy(name, amode)	{TERM, amode, name, 1, 0, 0, 1, 0, 0}
3217c478bdstevel@tonic-gate#define	TSp(name, amode)	{TERM, amode, name, 1, 0, 0, 0, 0, 1}
3227c478bdstevel@tonic-gate#define	TSZ(name, amode, sz)	{TERM, amode, name, 1, sz, 0, 0, 0, 0}
323d242cdfJerry Jelinek#define	TSaZ(name, amode, sz)	{TERM, amode, name, 1, sz, 0, 0, 0, 0, 0, AVS2}
324d242cdfJerry Jelinek#define	TSq(name, amode)	{TERM, amode, name, 0, 0, 0, 0, 0, 0, 0, AVS5Q}
325d242cdfJerry Jelinek#define	TSd(name, amode)	{TERM, amode, name, 0, 0, 0, 0, 0, 0, 0, AVS5D}
3267c478bdstevel@tonic-gate#define	TSZx(name, amode, sz)	{TERM, amode, name, 1, sz, 1, 0, 0, 0}
3277c478bdstevel@tonic-gate#define	TSZy(name, amode, sz)	{TERM, amode, name, 1, sz, 0, 1, 0, 0}
3287c478bdstevel@tonic-gate#define	INVALID			{TERM, UNKNOWN, "", 0, 0, 0, 0, 0}
3297c478bdstevel@tonic-gate#elif defined(DIS_TEXT)
3307c478bdstevel@tonic-gate#define	IND(table)		{(instable_t *)table, 0, "", 0, 0, 0, 0, 0}
3317c478bdstevel@tonic-gate#define	INDx(table)		{(instable_t *)table, 0, "", 0, 1, 0, 0, 0}
3327c478bdstevel@tonic-gate#define	TNS(name, amode)	{TERM, amode, name, 0, 0, 0, 0, 0}
3337c478bdstevel@tonic-gate#define	TNSu(name, amode)	{TERM, amode, name, 0, 0, 0, 1, 0}
3347c478bdstevel@tonic-gate#define	TNSx(name, amode)	{TERM, amode, name, 0, 1, 0, 0, 0}
3357c478bdstevel@tonic-gate#define	TNSy(name, amode)	{TERM, amode, name, 0, 0, 1, 0, 0}
3367c478bdstevel@tonic-gate#define	TNSyp(name, amode)	{TERM, amode, name, 0, 0, 1, 0, 1}
3377c478bdstevel@tonic-gate#define	TNSZ(name, amode, sz)	{TERM, amode, name, 0, 0, 0, 0, 0}
3387c478bdstevel@tonic-gate#define	TNSZy(name, amode, sz)	{TERM, amode, name, 0, 0, 1, 0, 0}
339245ac94Robert Mustacchi#define	TNSZvr(name, amode, sz)	{TERM, amode, name, 0, 0, 0, 0, 0, 1}
340a4e73d5Jerry Jelinek#define	TSvo(name, amode)	{TERM, amode, name, 1, 0, 0, 0, 0, 0, 0, 1}
3417c478bdstevel@tonic-gate#define	TS(name, amode)		{TERM, amode, name, 1, 0, 0, 0, 0}
3427c478bdstevel@tonic-gate#define	TSx(name, amode)	{TERM, amode, name, 1, 1, 0, 0, 0}
3437c478bdstevel@tonic-gate#define	TSy(name, amode)	{TERM, amode, name, 1, 0, 1, 0, 0}
3447c478bdstevel@tonic-gate#define	TSp(name, amode)	{TERM, amode, name, 1, 0, 0, 0, 1}
3457c478bdstevel@tonic-gate#define	TSZ(name, amode, sz)	{TERM, amode, name, 1, 0, 0, 0, 0}
346d242cdfJerry Jelinek#define	TSaZ(name, amode, sz)	{TERM, amode, name, 1, 0, 0, 0, 0, 0, AVS2}
347d242cdfJerry Jelinek#define	TSq(name, amode)	{TERM, amode, name, 0, 0, 0, 0, 0, 0, AVS5Q}
3487c478bdstevel@tonic-gate#define	TSZx(name, amode, sz)	{TERM, amode, name, 1, 1, 0, 0, 0}
3497c478bdstevel@tonic-gate#define	TSZy(name, amode, sz)	{TERM, amode, name, 1, 0, 1, 0, 0}
3507c478bdstevel@tonic-gate#define	INVALID			{TERM, UNKNOWN, "", 0, 0, 0, 0, 0}
3517c478bdstevel@tonic-gate#elif defined(DIS_MEM)
3527c478bdstevel@tonic-gate#define	IND(table)		{(instable_t *)table, 0, 0, 0, 0, 0, 0}
3537c478bdstevel@tonic-gate#define	INDx(table)		{(instable_t *)table, 0, 0, 1, 0, 0, 0}
3547c478bdstevel@tonic-gate#define	TNS(name, amode)	{TERM, amode,  0, 0, 0, 0, 0}
3557c478bdstevel@tonic-gate#define	TNSu(name, amode)	{TERM, amode,  0, 0, 0, 1, 0}
3567c478bdstevel@tonic-gate#define	TNSy(name, amode)	{TERM, amode,  0, 0, 1, 0, 0}
3577c478bdstevel@tonic-gate#define	TNSyp(name, amode)	{TERM, amode,  0, 0, 1, 0, 1}
3587c478bdstevel@tonic-gate#define	TNSx(name, amode)	{TERM, amode,  0, 1, 0, 0, 0}
3597c478bdstevel@tonic-gate#define	TNSZ(name, amode, sz)	{TERM, amode, sz, 0, 0, 0, 0}
3607c478bdstevel@tonic-gate#define	TNSZy(name, amode, sz)	{TERM, amode, sz, 0, 1, 0, 0}
361245ac94Robert Mustacchi#define	TNSZvr(name, amode, sz)	{TERM, amode, sz, 0, 0, 0, 0, 1}
362a4e73d5Jerry Jelinek#define	TSvo(name, amode)	{TERM, amode,  0, 0, 0, 0, 0, 0, 0, 1}
3637c478bdstevel@tonic-gate#define	TS(name, amode)		{TERM, amode,  0, 0, 0, 0, 0}
3647c478bdstevel@tonic-gate#define	TSx(name, amode)	{TERM, amode,  0, 1, 0, 0, 0}
3657c478bdstevel@tonic-gate#define	TSy(name, amode)	{TERM, amode,  0, 0, 1, 0, 0}
3667c478bdstevel@tonic-gate#define	TSp(name, amode)	{TERM, amode,  0, 0, 0, 0, 1}
3677c478bdstevel@tonic-gate#define	TSZ(name, amode, sz)	{TERM, amode, sz, 0, 0, 0, 0}
368d242cdfJerry Jelinek#define	TSaZ(name, amode, sz)	{TERM, amode, sz, 0, 0, 0, 0, 0, AVS2}
369d242cdfJerry Jelinek#define	TSq(name, amode)	{TERM, amode, 0, 0, 0, 0, 0, 0, AVS5Q}
3707c478bdstevel@tonic-gate#define	TSZx(name, amode, sz)	{TERM, amode, sz, 1, 0, 0, 0}
3717c478bdstevel@tonic-gate#define	TSZy(name, amode, sz)	{TERM, amode, sz, 0, 1, 0, 0}
3727c478bdstevel@tonic-gate#define	INVALID			{TERM, UNKNOWN, 0, 0, 0, 0, 0}
3737c478bdstevel@tonic-gate#else
3747c478bdstevel@tonic-gate#define	IND(table)		{(instable_t *)table, 0, 0, 0, 0, 0}
3757c478bdstevel@tonic-gate#define	INDx(table)		{(instable_t *)table, 0, 1, 0, 0, 0}
3767c478bdstevel@tonic-gate#define	TNS(name, amode)	{TERM, amode,  0, 0, 0, 0}
3777c478bdstevel@tonic-gate#define	TNSu(name, amode)	{TERM, amode,  0, 0, 1, 0}
3787c478bdstevel@tonic-gate#define	TNSy(name, amode)	{TERM, amode,  0, 1, 0, 0}
3797c478bdstevel@tonic-gate#define	TNSyp(name, amode)	{TERM, amode,  0, 1, 0, 1}
3807c478bdstevel@tonic-gate#define	TNSx(name, amode)	{TERM, amode,  1, 0, 0, 0}
3817c478bdstevel@tonic-gate#define	TNSZ(name, amode, sz)	{TERM, amode,  0, 0, 0, 0}
3827c478bdstevel@tonic-gate#define	TNSZy(name, amode, sz)	{TERM, amode,  0, 1, 0, 0}
383245ac94Robert Mustacchi#define	TNSZvr(name, amode, sz)	{TERM, amode,  0, 0, 0, 0, 1}
384a4e73d5Jerry Jelinek#define	TSvo(name, amode)	{TERM, amode,  0, 0, 0, 0, 0, 0, 1}
3857c478bdstevel@tonic-gate#define	TS(name, amode)		{TERM, amode,  0, 0, 0, 0}
3867c478bdstevel@tonic-gate#define	TSx(name, amode)	{TERM, amode,  1, 0, 0, 0}
3877c478bdstevel@tonic-gate#define	TSy(name, amode)	{TERM, amode,  0, 1, 0, 0}
3887c478bdstevel@tonic-gate#define	TSp(name, amode)	{TERM, amode,  0, 0, 0, 1}
3897c478bdstevel@tonic-gate#define	TSZ(name, amode, sz)	{TERM, amode,  0, 0, 0, 0}
390d242cdfJerry Jelinek#define	TSaZ(name, amode, sz)	{TERM, amode,  0, 0, 0, 0, 0, AVS2}
391d242cdfJerry Jelinek#define	TSq(name, amode)	{TERM, amode,  0, 0, 0, 0, 0, AVS5Q}
392d242cdfJerry Jelinek#define	TSd(name, amode)	{TERM, amode,  0, 0, 0, 0, 0, AVS5D}
3937c478bdstevel@tonic-gate#define	TSZx(name, amode, sz)	{TERM, amode,  1, 0, 0, 0}
3947c478bdstevel@tonic-gate#define	TSZy(name, amode, sz)	{TERM, amode,  0, 1, 0, 0}
3957c478bdstevel@tonic-gate#define	INVALID			{TERM, UNKNOWN, 0, 0, 0, 0}
3967c478bdstevel@tonic-gate#endif
3977c478bdstevel@tonic-gate
3987c478bdstevel@tonic-gate#ifdef DIS_TEXT
3997c478bdstevel@tonic-gate/*
4007c478bdstevel@tonic-gate * this decodes the r_m field for mode's 0, 1, 2 in 16 bit mode
4017c478bdstevel@tonic-gate */
4027c478bdstevel@tonic-gateconst char *const dis_addr16[3][8] = {
4037c478bdstevel@tonic-gate"(%bx,%si)", "(%bx,%di)", "(%bp,%si)", "(%bp,%di)", "(%si)", "(%di)", "",
4047c478bdstevel@tonic-gate									"(%bx)",
4057c478bdstevel@tonic-gate"(%bx,%si)", "(%bx,%di)", "(%bp,%si)", "(%bp,%di)", "(%si)", "(%di", "(%bp)",
4067c478bdstevel@tonic-gate									"(%bx)",
4077c478bdstevel@tonic-gate"(%bx,%si)", "(%bx,%di)", "(%bp,%si)", "(%bp,%di)", "(%si)", "(%di)", "(%bp)",
4087c478bdstevel@tonic-gate									"(%bx)",
4097c478bdstevel@tonic-gate};
4107c478bdstevel@tonic-gate
4117c478bdstevel@tonic-gate
4127c478bdstevel@tonic-gate/*
4137c478bdstevel@tonic-gate * This decodes 32 bit addressing mode r_m field for modes 0, 1, 2
4147c478bdstevel@tonic-gate */
4157c478bdstevel@tonic-gateconst char *const dis_addr32_mode0[16] = {
4167c478bdstevel@tonic-gate  "(%eax)", "(%ecx)", "(%edx)",  "(%ebx)",  "", "",        "(%esi)",  "(%edi)",
4177c478bdstevel@tonic-gate  "(%r8d)", "(%r9d)", "(%r10d)", "(%r11d)", "", "",        "(%r14d)", "(%r15d)"
4187c478bdstevel@tonic-gate};
4197c478bdstevel@tonic-gate
4207c478bdstevel@tonic-gateconst char *const dis_addr32_mode12[16] = {
4217c478bdstevel@tonic-gate  "(%eax)", "(%ecx)", "(%edx)",  "(%ebx)",  "", "(%ebp)",  "(%esi)",  "(%edi)",
4227c478bdstevel@tonic-gate  "(%r8d)", "(%r9d)", "(%r10d)", "(%r11d)", "", "(%r13d)", "(%r14d)", "(%r15d)"
4237c478bdstevel@tonic-gate};
4247c478bdstevel@tonic-gate
4257c478bdstevel@tonic-gate/*
4267c478bdstevel@tonic-gate * This decodes 64 bit addressing mode r_m field for modes 0, 1, 2
4277c478bdstevel@tonic-gate */
4287c478bdstevel@tonic-gateconst char *const dis_addr64_mode0[16] = {
4297c478bdstevel@tonic-gate "(%rax)", "(%rcx)", "(%rdx)", "(%rbx)", "",       "(%rip)", "(%rsi)", "(%rdi)",
4307c478bdstevel@tonic-gate "(%r8)",  "(%r9)",  "(%r10)", "(%r11)", "(%r12)", "(%rip)", "(%r14)", "(%r15)"
4317c478bdstevel@tonic-gate};
4327c478bdstevel@tonic-gateconst char *const dis_addr64_mode12[16] = {
4337c478bdstevel@tonic-gate "(%rax)", "(%rcx)", "(%rdx)", "(%rbx)", "",       "(%rbp)", "(%rsi)", "(%rdi)",
4347c478bdstevel@tonic-gate "(%r8)",  "(%r9)",  "(%r10)", "(%r11)", "(%r12)", "(%r13)", "(%r14)", "(%r15)"
4357c478bdstevel@tonic-gate};
4367c478bdstevel@tonic-gate
4377c478bdstevel@tonic-gate/*
4387c478bdstevel@tonic-gate * decode for scale from SIB byte
4397c478bdstevel@tonic-gate */
4407c478bdstevel@tonic-gateconst char *const dis_scale_factor[4] = { ")", ",2)", ",4)", ",8)" };
4417c478bdstevel@tonic-gate
4427c478bdstevel@tonic-gate/*
443245ac94Robert Mustacchi * decode for scale from VSIB byte, note that we always include the scale factor
444245ac94Robert Mustacchi * to match gas.
445245ac94Robert Mustacchi */
446245ac94Robert Mustacchiconst char *const dis_vscale_factor[4] = { ",1)", ",2)", ",4)", ",8)" };
447245ac94Robert Mustacchi
448245ac94Robert Mustacchi/*
4497c478bdstevel@tonic-gate * register decoding for normal references to registers (ie. not addressing)
4507c478bdstevel@tonic-gate */
4517c478bdstevel@tonic-gateconst char *const dis_REG8[16] = {
4527c478bdstevel@tonic-gate	"%al",  "%cl",  "%dl",   "%bl",   "%ah",   "%ch",   "%dh",   "%bh",
4537c478bdstevel@tonic-gate	"%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
4547c478bdstevel@tonic-gate};
4557c478bdstevel@tonic-gate
4567c478bdstevel@tonic-gateconst char *const dis_REG8_REX[16] = {
4577c478bdstevel@tonic-gate	"%al",  "%cl",  "%dl",   "%bl",   "%spl",  "%bpl",  "%sil",  "%dil",
4587c478bdstevel@tonic-gate	"%r8b", "%r9b", "%r10b", "%r11b", "%r12b", "%r13b", "%r14b", "%r15b"
4597c478bdstevel@tonic-gate};
4607c478bdstevel@tonic-gate
4617c478bdstevel@tonic-gateconst char *const dis_REG16[16] = {
4627c478bdstevel@tonic-gate	"%ax",  "%cx",  "%dx",   "%bx",   "%sp",   "%bp",   "%si",   "%di",
4637c478bdstevel@tonic-gate	"%r8w", "%r9w", "%r10w", "%r11w", "%r12w", "%r13w", "%r14w", "%r15w"
4647c478bdstevel@tonic-gate};
4657c478bdstevel@tonic-gate
4667c478bdstevel@tonic-gateconst char *const dis_REG32[16] = {
4677c478bdstevel@tonic-gate	"%eax", "%ecx", "%edx",  "%ebx",  "%esp",  "%ebp",  "%esi",  "%edi",
4687c478bdstevel@tonic-gate	"%r8d", "%r9d", "%r10d", "%r11d", "%r12d", "%r13d", "%r14d", "%r15d"
4697c478bdstevel@tonic-gate};
4707c478bdstevel@tonic-gate
4717c478bdstevel@tonic-gateconst char *const dis_REG64[16] = {
4727c478bdstevel@tonic-gate	"%rax", "%rcx", "%rdx",  "%rbx", "%rsp", "%rbp", "%rsi", "%rdi",
4737c478bdstevel@tonic-gate	"%r8",  "%r9",  "%r10",  "%r11", "%r12", "%r13", "%r14", "%r15"
4747c478bdstevel@tonic-gate};
4757c478bdstevel@tonic-gate
4767c478bdstevel@tonic-gateconst char *const dis_DEBUGREG[16] = {
4777c478bdstevel@tonic-gate	"%db0", "%db1", "%db2",  "%db3",  "%db4",  "%db5",  "%db6",  "%db7",
4787c478bdstevel@tonic-gate	"%db8", "%db9", "%db10", "%db11", "%db12", "%db13", "%db14", "%db15"
4797c478bdstevel@tonic-gate};
4807c478bdstevel@tonic-gate
4817c478bdstevel@tonic-gateconst char *const dis_CONTROLREG[16] = {
4827c478bdstevel@tonic-gate    "%cr0", "%cr1", "%cr2", "%cr3", "%cr4", "%cr5?", "%cr6?", "%cr7?",
4837c478bdstevel@tonic-gate    "%cr8", "%cr9?", "%cr10?", "%cr11?", "%cr12?", "%cr13?", "%cr14?", "%cr15?"
4847c478bdstevel@tonic-gate};
4857c478bdstevel@tonic-gate
4867c478bdstevel@tonic-gateconst char *const dis_TESTREG[16] = {
4877c478bdstevel@tonic-gate	"%tr0?", "%tr1?", "%tr2?", "%tr3", "%tr4", "%tr5", "%tr6", "%tr7",
4887c478bdstevel@tonic-gate	"%tr0?", "%tr1?", "%tr2?", "%tr3", "%tr4", "%tr5", "%tr6", "%tr7"
4897c478bdstevel@tonic-gate};
4907c478bdstevel@tonic-gate
4917c478bdstevel@tonic-gateconst char *const dis_MMREG[16] = {
4927c478bdstevel@tonic-gate	"%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7",
4937c478bdstevel@tonic-gate	"%mm0", "%mm1", "%mm2", "%mm3", "%mm4", "%mm5", "%mm6", "%mm7"
4947c478bdstevel@tonic-gate};
4957c478bdstevel@tonic-gate
49681b505bJerry Jelinekconst char *const dis_XMMREG[32] = {
49781b505bJerry Jelinek    "%xmm0", "%xmm1", "%xmm2", "%xmm3",
49881b505bJerry Jelinek    "%xmm4", "%xmm5", "%xmm6", "%xmm7",
49981b505bJerry Jelinek    "%xmm8", "%xmm9", "%xmm10", "%xmm11",
50081b505bJerry Jelinek    "%xmm12", "%xmm13", "%xmm14", "%xmm15",
50181b505bJerry Jelinek    "%xmm16", "%xmm17", "%xmm18", "%xmm19",
50281b505bJerry Jelinek    "%xmm20", "%xmm21", "%xmm22", "%xmm23",
50381b505bJerry Jelinek    "%xmm24", "%xmm25", "%xmm26", "%xmm27",
50481b505bJerry Jelinek    "%xmm28", "%xmm29", "%xmm30", "%xmm31",
5057c478bdstevel@tonic-gate};
5067c478bdstevel@tonic-gate
50781b505bJerry Jelinekconst char *const dis_YMMREG[32] = {
50881b505bJerry Jelinek    "%ymm0", "%ymm1", "%ymm2", "%ymm3",
50981b505bJerry Jelinek    "%ymm4", "%ymm5", "%ymm6", "%ymm7",
51081b505bJerry Jelinek    "%ymm8", "%ymm9", "%ymm10", "%ymm11",
51181b505bJerry Jelinek    "%ymm12", "%ymm13", "%ymm14", "%ymm15",
51281b505bJerry Jelinek    "%ymm16", "%ymm17", "%ymm18", "%ymm19",
51381b505bJerry Jelinek    "%ymm20", "%ymm21", "%ymm22", "%ymm23",
51481b505bJerry Jelinek    "%ymm24", "%ymm25", "%ymm26", "%ymm27",
51581b505bJerry Jelinek    "%ymm28", "%ymm29", "%ymm30", "%ymm31",
51681b505bJerry Jelinek};
51781b505bJerry Jelinek
51881b505bJerry Jelinekconst char *const dis_ZMMREG[32] = {
51981b505bJerry Jelinek    "%zmm0", "%zmm1", "%zmm2", "%zmm3",
52081b505bJerry Jelinek    "%zmm4", "%zmm5", "%zmm6", "%zmm7",
52181b505bJerry Jelinek    "%zmm8", "%zmm9", "%zmm10", "%zmm11",
52281b505bJerry Jelinek    "%zmm12", "%zmm13", "%zmm14", "%zmm15",
52381b505bJerry Jelinek    "%zmm16", "%zmm17", "%zmm18", "%zmm19",
52481b505bJerry Jelinek    "%zmm20", "%zmm21", "%zmm22", "%zmm23",
52581b505bJerry Jelinek    "%zmm24", "%zmm25", "%zmm26", "%zmm27",
52681b505bJerry Jelinek    "%zmm28", "%zmm29", "%zmm30", "%zmm31",
527ab47273Edward Gillett};
528ab47273Edward Gillett
529a4e73d5Jerry Jelinekconst char *const dis_KOPMASKREG[8] = {
530a4e73d5Jerry Jelinek    "%k0", "%k1", "%k2", "%k3", "%k4", "%k5", "%k6", "%k7"
531a4e73d5Jerry Jelinek};
532a4e73d5Jerry Jelinek
5337c478bdstevel@tonic-gateconst char *const dis_SEGREG[16] = {
5347c478bdstevel@tonic-gate	"%es", "%cs", "%ss", "%ds", "%fs", "%gs", "<reserved>", "<reserved>",
5357c478bdstevel@tonic-gate	"%es", "%cs", "%ss", "%ds", "%fs", "%gs", "<reserved>", "<reserved>"
5367c478bdstevel@tonic-gate};
5377c478bdstevel@tonic-gate
5387c478bdstevel@tonic-gate/*
5397c478bdstevel@tonic-gate * SIMD predicate suffixes
5407c478bdstevel@tonic-gate */
5417c478bdstevel@tonic-gateconst char *const dis_PREDSUFFIX[8] = {
5427c478bdstevel@tonic-gate	"eq", "lt", "le", "unord", "neq", "nlt", "nle", "ord"
5437c478bdstevel@tonic-gate};
5447c478bdstevel@tonic-gate
545ab47273Edward Gillettconst char *const dis_AVXvgrp7[3][8] = {
546ab47273Edward Gillett	/*0	1	2		3		4		5	6		7*/
547ab47273Edward Gillett/*71*/	{"",	"",	"vpsrlw",	"",		"vpsraw",	"",	"vpsllw",	""},
548ab47273Edward Gillett/*72*/	{"",	"",	"vpsrld",	"",		"vpsrad",	"",	"vpslld",	""},
549ab47273Edward Gillett/*73*/	{"",	"",	"vpsrlq",	"vpsrldq",	"",		"",	"vpsllq",	"vpslldq"}
550ab47273Edward Gillett};
5517c478bdstevel@tonic-gate
5527c478bdstevel@tonic-gate#endif	/* DIS_TEXT */
5537c478bdstevel@tonic-gate
5547c478bdstevel@tonic-gate/*
5557c478bdstevel@tonic-gate *	"decode table" for 64 bit mode MOVSXD instruction (opcode 0x63)
5567c478bdstevel@tonic-gate */
5577c478bdstevel@tonic-gateconst instable_t dis_opMOVSLD = TNS("movslq",MOVSXZ);
5587c478bdstevel@tonic-gate
5597c478bdstevel@tonic-gate/*
5607c478bdstevel@tonic-gate *	"decode table" for pause and clflush instructions
5617c478bdstevel@tonic-gate */
5627c478bdstevel@tonic-gateconst instable_t dis_opPause = TNS("pause", NORM);
5637c478bdstevel@tonic-gate
5647c478bdstevel@tonic-gate/*
565c1e9bf0Robert Mustacchi *	"decode table" for wbnoinvd instruction
566c1e9bf0Robert Mustacchi */
567c1e9bf0Robert Mustacchiconst instable_t dis_opWbnoinvd = TNS("wbnoinvd", NORM);
568c1e9bf0Robert Mustacchi
569c1e9bf0Robert Mustacchi/*
5707c478bdstevel@tonic-gate *	Decode table for 0x0F00 opcodes
5717c478bdstevel@tonic-gate */
5727c478bdstevel@tonic-gateconst instable_t dis_op0F00[8] = {
5737c478bdstevel@tonic-gate
574cff040fRobert Mustacchi/*  [0]  */	TNS("sldt",M),		TNS("str",M),		TNSy("lldt",M),		TNSy("ltr",M),
5757c478bdstevel@tonic-gate/*  [4]  */	TNSZ("verr",M,2),	TNSZ("verw",M,2),	INVALID,		INVALID,
5767c478bdstevel@tonic-gate};
5777c478bdstevel@tonic-gate
5787c478bdstevel@tonic-gate
5797c478bdstevel@tonic-gate/*
5807c478bdstevel@tonic-gate *	Decode table for 0x0F01 opcodes
5817c478bdstevel@tonic-gate */
5827c478bdstevel@tonic-gateconst instable_t dis_op0F01[8] = {
5837c478bdstevel@tonic-gate
58470dc763Richard Lowe/*  [0]  */	TNSZ("sgdt",VMx,6),	TNSZ("sidt",MONITOR_MWAIT,6),	TNSZ("lgdt",XGETBV_XSETBV,6),	TNSZ("lidt",SVM,6),
585cff040fRobert Mustacchi/*  [4]  */	TNSZ("smsw",M,2),	INVALID,		TNSZ("lmsw",M,2),	TNS("invlpg",SWAPGS_RDTSCP),
5867c478bdstevel@tonic-gate};
5877c478bdstevel@tonic-gate
5887c478bdstevel@tonic-gate/*
5897c478bdstevel@tonic-gate *	Decode table for 0x0F18 opcodes -- SIMD prefetch
5907c478bdstevel@tonic-gate */
5917c478bdstevel@tonic-gateconst instable_t dis_op0F18[8] = {
5927c478bdstevel@tonic-gate
5937c478bdstevel@tonic-gate/*  [0]  */	TNS("prefetchnta",PREF),TNS("prefetcht0",PREF),	TNS("prefetcht1",PREF),	TNS("prefetcht2",PREF),
5947c478bdstevel@tonic-gate/*  [4]  */	INVALID,		INVALID,		INVALID,		INVALID,
5957c478bdstevel@tonic-gate};
5967c478bdstevel@tonic-gate
5977c478bdstevel@tonic-gate/*
598cff040fRobert Mustacchi *	Decode table for 0x0FAE opcodes -- SIMD state save/restore
5997c478bdstevel@tonic-gate */
6007c478bdstevel@tonic-gateconst instable_t dis_op0FAE[8] = {
601cff040fRobert Mustacchi/*  [0]  */	TNSZ("fxsave",FSGS,512),TNSZ("fxrstor",FSGS,512),TNS("ldmxcsr",FSGS),	TNS("stmxcsr",FSGS),
602ab47273Edward Gillett/*  [4]  */	TNSZ("xsave",M,512),	TNS("lfence",XMMFENCE), TNS("mfence",XMMFENCE),	TNS("sfence",XMMSFNC),
6037c478bdstevel@tonic-gate};
6047c478bdstevel@tonic-gate
6057c478bdstevel@tonic-gate/*
606cff040fRobert Mustacchi *	Decode table for 0xF30FAE opcodes -- FSGSBASE
607cff040fRobert Mustacchi */
608cff040fRobert Mustacchiconst instable_t dis_opF30FAE[8] = {
609cff040fRobert Mustacchi/*  [0]  */	TNSx("rdfsbase",FSGS),	TNSx("rdgsbase",FSGS),	TNSx("wrfsbase",FSGS),	TNSx("wrgsbase",FSGS),
610cff040fRobert Mustacchi/*  [4]  */	INVALID,		INVALID,		INVALID,		INVALID,
611cff040fRobert Mustacchi};
612cff040fRobert Mustacchi
613cff040fRobert Mustacchi/*
6147c478bdstevel@tonic-gate *	Decode table for 0x0FBA opcodes
6157c478bdstevel@tonic-gate */
6167c478bdstevel@tonic-gate
6177c478bdstevel@tonic-gateconst instable_t dis_op0FBA[8] = {
6187c478bdstevel@tonic-gate
6197c478bdstevel@tonic-gate/*  [0]  */	INVALID,		INVALID,		INVALID,		INVALID,
6207c478bdstevel@tonic-gate/*  [4]  */	TS("bt",MIb),		TS("bts",MIb),		TS("btr",MIb),		TS("btc",MIb),
6217c478bdstevel@tonic-gate};
6227c478bdstevel@tonic-gate
6237c478bdstevel@tonic-gate/*
624cff040fRobert Mustacchi *	Decode table for 0x0FC7 opcode (group 9)
6257c478bdstevel@tonic-gate */
6267c478bdstevel@tonic-gate
6277c478bdstevel@tonic-gateconst instable_t dis_op0FC7[8] = {
6287c478bdstevel@tonic-gate
6299238136Jerry Jelinek/*  [0]  */	INVALID,		TNS("cmpxchg8b",M),	INVALID,		TNS("xrstors",MG9),
6309238136Jerry Jelinek/*  [4]  */	TNS("xsavec",MG9),	TNS("xsaves",MG9),		TNS("vmptrld",MG9),	TNS("vmptrst",MG9),
6317c478bdstevel@tonic-gate};
6327c478bdstevel@tonic-gate
6337aa76ffBryan Cantrill/*
634cff040fRobert Mustacchi *	Decode table for 0x0FC7 opcode (group 9) mode 3
635ebb8ac0Robert Mustacchi */
636ebb8ac0Robert Mustacchi
637ebb8ac0Robert Mustacchiconst instable_t dis_op0FC7m3[8] = {
638ebb8ac0Robert Mustacchi
639ebb8ac0Robert Mustacchi/*  [0]  */	INVALID,		INVALID,	INVALID,		INVALID,
6408889c87Robert Mustacchi/*  [4]  */	INVALID,		INVALID,	TNS("rdrand",MG9),	TNS("rdseed", MG9),
641ebb8ac0Robert Mustacchi};
642ebb8ac0Robert Mustacchi
643ebb8ac0Robert Mustacchi/*
644cff040fRobert Mustacchi *	Decode table for 0x0FC7 opcode with 0x66 prefix
6457aa76ffBryan Cantrill */
6467aa76ffBryan Cantrill
6477aa76ffBryan Cantrillconst instable_t dis_op660FC7[8] = {
6487aa76ffBryan Cantrill
6497aa76ffBryan Cantrill/*  [0]  */	INVALID,		INVALID,		INVALID,		INVALID,
6507aa76ffBryan Cantrill/*  [4]  */	INVALID,		INVALID,		TNS("vmclear",M),	INVALID,
6517aa76ffBryan Cantrill};
6527aa76ffBryan Cantrill
6537aa76ffBryan Cantrill/*
654cff040fRobert Mustacchi *	Decode table for 0x0FC7 opcode with 0xF3 prefix
6557aa76ffBryan Cantrill */
6567aa76ffBryan Cantrill
6577aa76ffBryan Cantrillconst instable_t dis_opF30FC7[8] = {
6587aa76ffBryan Cantrill
6597aa76ffBryan Cantrill/*  [0]  */	INVALID,		INVALID,		INVALID,		INVALID,
6607aa76ffBryan Cantrill/*  [4]  */	INVALID,		INVALID,		TNS("vmxon",M),		INVALID,
6617aa76ffBryan Cantrill};
6627c478bdstevel@tonic-gate
6637c478bdstevel@tonic-gate/*
6647c478bdstevel@tonic-gate *	Decode table for 0x0FC8 opcode -- 486 bswap instruction
6657c478bdstevel@tonic-gate *
6667c478bdstevel@tonic-gate *bit pattern: 0000 1111 1100 1reg
6677c478bdstevel@tonic-gate */
6687c478bdstevel@tonic-gateconst instable_t dis_op0FC8[4] = {
6697c478bdstevel@tonic-gate/*  [0]  */	TNS("bswap",R),		INVALID,		INVALID,		INVALID,
6707c478bdstevel@tonic-gate};
6717c478bdstevel@tonic-gate
6727c478bdstevel@tonic-gate/*
6737c478bdstevel@tonic-gate *	Decode table for 0x0F71, 0x0F72, and 0x0F73 opcodes -- MMX instructions
6747c478bdstevel@tonic-gate */
6757c478bdstevel@tonic-gateconst instable_t dis_op0F7123[4][8] = {
6767c478bdstevel@tonic-gate{
6777c478bdstevel@tonic-gate/*  [70].0 */	INVALID,		INVALID,		INVALID,		INVALID,
6787c478bdstevel@tonic-gate/*      .4 */	INVALID,		INVALID,		INVALID,		INVALID,
6797c478bdstevel@tonic-gate}, {
6807c478bdstevel@tonic-gate/*  [71].0 */	INVALID,		INVALID,		TNS("psrlw",MMOSH),	INVALID,
6817c478bdstevel@tonic-gate/*      .4 */	TNS("psraw",MMOSH),	INVALID,		TNS("psllw",MMOSH),	INVALID,
6827c478bdstevel@tonic-gate}, {
6837c478bdstevel@tonic-gate/*  [72].0 */	INVALID,		INVALID,		TNS("psrld",MMOSH),	INVALID,
6847c478bdstevel@tonic-gate/*      .4 */	TNS("psrad",MMOSH),	INVALID,		TNS("pslld",MMOSH),	INVALID,
6857c478bdstevel@tonic-gate}, {
6867c478bdstevel@tonic-gate/*  [73].0 */	INVALID,		INVALID,		TNS("psrlq",MMOSH),	TNS("INVALID",MMOSH),
687cff040fRobert Mustacchi/*      .4 */	INVALID,		INVALID,		TNS("psllq",MMOSH),	TNS("INVALID",MMOSH),
6887c478bdstevel@tonic-gate} };
6897c478bdstevel@tonic-gate
6907c478bdstevel@tonic-gate/*
6917c478bdstevel@tonic-gate *	Decode table for SIMD extensions to above 0x0F71-0x0F73 opcodes.
6927c478bdstevel@tonic-gate */
6937c478bdstevel@tonic-gateconst instable_t dis_opSIMD7123[32] = {
6947c478bdstevel@tonic-gate/* [70].0 */	INVALID,		INVALID,		INVALID,		INVALID,
6957c478bdstevel@tonic-gate/*     .4 */	INVALID,		INVALID,		INVALID,		INVALID,
6967c478bdstevel@tonic-gate
6977c478bdstevel@tonic-gate/* [71].0 */	INVALID,		INVALID,		TNS("psrlw",XMMSH),	INVALID,
6987c478bdstevel@tonic-gate/*     .4 */	TNS("psraw",XMMSH),	INVALID,		TNS("psllw",XMMSH),	INVALID,
6997c478bdstevel@tonic-gate
7007c478bdstevel@tonic-gate/* [72].0 */	INVALID,		INVALID,		TNS("psrld",XMMSH),	INVALID,
7017c478bdstevel@tonic-gate/*     .4 */	TNS("psrad",XMMSH),	INVALID,		TNS("pslld",XMMSH),	INVALID,
7027c478bdstevel@tonic-gate
7037c478bdstevel@tonic-gate/* [73].0 */	INVALID,		INVALID,		TNS("psrlq",XMMSH),	TNS("psrldq",XMMSH),
7047c478bdstevel@tonic-gate/*     .4 */	INVALID,		INVALID,		TNS("psllq",XMMSH),	TNS("pslldq",XMMSH),
7057c478bdstevel@tonic-gate};
7067c478bdstevel@tonic-gate
7077c478bdstevel@tonic-gate/*
7087c478bdstevel@tonic-gate *	SIMD instructions have been wedged into the existing IA32 instruction
7097c478bdstevel@tonic-gate *	set through the use of prefixes.  That is, while 0xf0 0x58 may be
7107c478bdstevel@tonic-gate *	addps, 0xf3 0xf0 0x58 (literally, repz addps) is a completely different
7117c478bdstevel@tonic-gate *	instruction - addss.  At present, three prefixes have been coopted in
7127c478bdstevel@tonic-gate *	this manner - address size (0x66), repnz (0xf2) and repz (0xf3).  The
7137c478bdstevel@tonic-gate *	following tables are used to provide the prefixed instruction names.
7147c478bdstevel@tonic-gate *	The arrays are sparse, but they're fast.
7157c478bdstevel@tonic-gate */
7167c478bdstevel@tonic-gate
7177c478bdstevel@tonic-gate/*
7187c478bdstevel@tonic-gate *	Decode table for SIMD instructions with the address size (0x66) prefix.
7197c478bdstevel@tonic-gate */
7207c478bdstevel@tonic-gateconst instable_t dis_opSIMDdata16[256] = {
7217c478bdstevel@tonic-gate/*  [00]  */	INVALID,		INVALID,		INVALID,		INVALID,
7227c478bdstevel@tonic-gate/*  [04]  */	INVALID,		INVALID,		INVALID,		INVALID,
7237c478bdstevel@tonic-gate/*  [08]  */	INVALID,		INVALID,		INVALID,		INVALID,
7247c478bdstevel@tonic-gate/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
7257c478bdstevel@tonic-gate
7267c478bdstevel@tonic-gate/*  [10]  */	TNSZ("movupd",XMM,16),	TNSZ("movupd",XMMS,16),	TNSZ("movlpd",XMMM,8),	TNSZ("movlpd",XMMMS,8),
7277c478bdstevel@tonic-gate/*  [14]  */	TNSZ("unpcklpd",XMM,16),TNSZ("unpckhpd",XMM,16),TNSZ("movhpd",XMMM,8),	TNSZ("movhpd",XMMMS,8),
7287c478bdstevel@tonic-gate/*  [18]  */	INVALID,		INVALID,		INVALID,		INVALID,
7297c478bdstevel@tonic-gate/*  [1C]  */	INVALID,		INVALID,		INVALID,		INVALID,
7307c478bdstevel@tonic-gate
7317c478bdstevel@tonic-gate/*  [20]  */	INVALID,		INVALID,		INVALID,		INVALID,
7327c478bdstevel@tonic-gate/*  [24]  */	INVALID,		INVALID,		INVALID,		INVALID,
7337c478bdstevel@tonic-gate/*  [28]  */	TNSZ("movapd",XMM,16),	TNSZ("movapd",XMMS,16),	TNSZ("cvtpi2pd",XMMOMX,8),TNSZ("movntpd",XMMOMS,16),
7347c478bdstevel@tonic-gate/*  [2C]  */	TNSZ("cvttpd2pi",XMMXMM,16),TNSZ("cvtpd2pi",XMMXMM,16),TNSZ("ucomisd",XMM,8),TNSZ("comisd",XMM,8),
7357c478bdstevel@tonic-gate
7367c478bdstevel@tonic-gate/*  [30]  */	INVALID,		INVALID,		INVALID,		INVALID,
7377c478bdstevel@tonic-gate/*  [34]  */	INVALID,		INVALID,		INVALID,		INVALID,
7387c478bdstevel@tonic-gate/*  [38]  */	INVALID,		INVALID,		INVALID,		INVALID,
7397c478bdstevel@tonic-gate/*  [3C]  */	INVALID,		INVALID,		INVALID,		INVALID,
7407c478bdstevel@tonic-gate
7417c478bdstevel@tonic-gate/*  [40]  */	INVALID,		INVALID,		INVALID,		INVALID,
7427c478bdstevel@tonic-gate/*  [44]  */	INVALID,		INVALID,		INVALID,		INVALID,
7437c478bdstevel@tonic-gate/*  [48]  */	INVALID,		INVALID,		INVALID,		INVALID,
7447c478bdstevel@tonic-gate/*  [4C]  */	INVALID,		INVALID,		INVALID,		INVALID,
7457c478bdstevel@tonic-gate
7467c478bdstevel@tonic-gate/*  [50]  */	TNS("movmskpd",XMMOX3),	TNSZ("sqrtpd",XMM,16),	INVALID,		INVALID,
7477c478bdstevel@tonic-gate/*  [54]  */	TNSZ("andpd",XMM,16),	TNSZ("andnpd",XMM,16),	TNSZ("orpd",XMM,16),	TNSZ("xorpd",XMM,16),
7487c478bdstevel@tonic-gate/*  [58]  */	TNSZ("addpd",XMM,16),	TNSZ("mulpd",XMM,16),	TNSZ("cvtpd2ps",XMM,16),TNSZ("cvtps2dq",XMM,16),
7497c478bdstevel@tonic-gate/*  [5C]  */	TNSZ("subpd",XMM,16),	TNSZ("minpd",XMM,16),	TNSZ("divpd",XMM,16),	TNSZ("maxpd",XMM,16),
7507c478bdstevel@tonic-gate
7517c478bdstevel@tonic-gate/*  [60]  */	TNSZ("punpcklbw",XMM,16),TNSZ("punpcklwd",XMM,16),TNSZ("punpckldq",XMM,16),TNSZ("packsswb",XMM,16),
7527c478bdstevel@tonic-gate/*  [64]  */	TNSZ("pcmpgtb",XMM,16),	TNSZ("pcmpgtw",XMM,16),	TNSZ("pcmpgtd",XMM,16),	TNSZ("packuswb",XMM,16),
7537c478bdstevel@tonic-gate/*  [68]  */	TNSZ("punpckhbw",XMM,16),TNSZ("punpckhwd",XMM,16),TNSZ("punpckhdq",XMM,16),TNSZ("packssdw",XMM,16),
7547c478bdstevel@tonic-gate/*  [6C]  */	TNSZ("punpcklqdq",XMM,16),TNSZ("punpckhqdq",XMM,16),TNSZ("movd",XMM3MX,4),TNSZ("movdqa",XMM,16),
7557c478bdstevel@tonic-gate
7567c478bdstevel@tonic-gate/*  [70]  */	TNSZ("pshufd",XMMP,16),	INVALID,		INVALID,		INVALID,
7577c478bdstevel@tonic-gate/*  [74]  */	TNSZ("pcmpeqb",XMM,16),	TNSZ("pcmpeqw",XMM,16),	TNSZ("pcmpeqd",XMM,16),	INVALID,
758f880125kk/*  [78]  */	TNSZ("extrq",XMM2I,16),	TNSZ("extrq",XMM,16), INVALID,		INVALID,
759d4c899eRobert Mustacchi/*  [7C]  */	TNSZ("haddpd",XMM,16),	TNSZ("hsubpd",XMM,16),	TNSZ("movd",XMM3MXS,4),	TNSZ("movdqa",XMMS,16),
7607c478bdstevel@tonic-gate
7617c478bdstevel@tonic-gate/*  [80]  */	INVALID,		INVALID,		INVALID,		INVALID,
7627c478bdstevel@tonic-gate/*  [84]  */	INVALID,		INVALID,		INVALID,		INVALID,
7637c478bdstevel@tonic-gate/*  [88]  */	INVALID,		INVALID,		INVALID,		INVALID,
7647c478bdstevel@tonic-gate/*  [8C]  */	INVALID,		INVALID,		INVALID,		INVALID,
7657c478bdstevel@tonic-gate
7667c478bdstevel@tonic-gate/*  [90]  */	INVALID,		INVALID,		INVALID,		INVALID,
7677c478bdstevel@tonic-gate/*  [94]  */	INVALID,		INVALID,		INVALID,		INVALID,
7687c478bdstevel@tonic-gate/*  [98]  */	INVALID,		INVALID,		INVALID,		INVALID,
7697c478bdstevel@tonic-gate/*  [9C]  */	INVALID,		INVALID,		INVALID,		INVALID,
7707c478bdstevel@tonic-gate
7717c478bdstevel@tonic-gate/*  [A0]  */	INVALID,		INVALID,		INVALID,		INVALID,
7727c478bdstevel@tonic-gate/*  [A4]  */	INVALID,		INVALID,		INVALID,		INVALID,
7737c478bdstevel@tonic-gate/*  [A8]  */	INVALID,		INVALID,		INVALID,		INVALID,
7747c478bdstevel@tonic-gate/*  [AC]  */	INVALID,		INVALID,		INVALID,		INVALID,
7757c478bdstevel@tonic-gate
7767c478bdstevel@tonic-gate/*  [B0]  */	INVALID,		INVALID,		INVALID,		INVALID,
7777c478bdstevel@tonic-gate/*  [B4]  */	INVALID,		INVALID,		INVALID,		INVALID,
7787c478bdstevel@tonic-gate/*  [B8]  */	INVALID,		INVALID,		INVALID,		INVALID,
7797c478bdstevel@tonic-gate/*  [BC]  */	INVALID,		INVALID,		INVALID,		INVALID,
7807c478bdstevel@tonic-gate
7817c478bdstevel@tonic-gate/*  [C0]  */	INVALID,		INVALID,		TNSZ("cmppd",XMMP,16),	INVALID,
7827c478bdstevel@tonic-gate/*  [C4]  */	TNSZ("pinsrw",XMMPRM,2),TNS("pextrw",XMM3P),	TNSZ("shufpd",XMMP,16),	INVALID,
7837c478bdstevel@tonic-gate/*  [C8]  */	INVALID,		INVALID,		INVALID,		INVALID,
7847c478bdstevel@tonic-gate/*  [CC]  */	INVALID,		INVALID,		INVALID,		INVALID,
7857c478bdstevel@tonic-gate
786d4c899eRobert Mustacchi/*  [D0]  */	TNSZ("addsubpd",XMM,16),TNSZ("psrlw",XMM,16),	TNSZ("psrld",XMM,16),	TNSZ("psrlq",XMM,16),
7877c478bdstevel@tonic-gate/*  [D4]  */	TNSZ("paddq",XMM,16),	TNSZ("pmullw",XMM,16),	TNSZ("movq",XMMS,8),	TNS("pmovmskb",XMMX3),
7887c478bdstevel@tonic-gate/*  [D8]  */	TNSZ("psubusb",XMM,16),	TNSZ("psubusw",XMM,16),	TNSZ("pminub",XMM,16),	TNSZ("pand",XMM,16),
7897c478bdstevel@tonic-gate/*  [DC]  */	TNSZ("paddusb",XMM,16),	TNSZ("paddusw",XMM,16),	TNSZ("pmaxub",XMM,16),	TNSZ("pandn",XMM,16),
7907c478bdstevel@tonic-gate
7917c478bdstevel@tonic-gate/*  [E0]  */	TNSZ("pavgb",XMM,16),	TNSZ("psraw",XMM,16),	TNSZ("psrad",XMM,16),	TNSZ("pavgw",XMM,16),
7927c478bdstevel@tonic-gate/*  [E4]  */	TNSZ("pmulhuw",XMM,16),	TNSZ("pmulhw",XMM,16),	TNSZ("cvttpd2dq",XMM,16),TNSZ("movntdq",XMMS,16),
7937c478bdstevel@tonic-gate/*  [E8]  */	TNSZ("psubsb",XMM,16),	TNSZ("psubsw",XMM,16),	TNSZ("pminsw",XMM,16),	TNSZ("por",XMM,16),
7947c478bdstevel@tonic-gate/*  [EC]  */	TNSZ("paddsb",XMM,16),	TNSZ("paddsw",XMM,16),	TNSZ("pmaxsw",XMM,16),	TNSZ("pxor",XMM,16),
7957c478bdstevel@tonic-gate
7967c478bdstevel@tonic-gate/*  [F0]  */	INVALID,		TNSZ("psllw",XMM,16),	TNSZ("pslld",XMM,16),	TNSZ("psllq",XMM,16),
7977c478bdstevel@tonic-gate/*  [F4]  */	TNSZ("pmuludq",XMM,16),	TNSZ("pmaddwd",XMM,16),	TNSZ("psadbw",XMM,16),	TNSZ("maskmovdqu", XMMXIMPL,16),
7987c478bdstevel@tonic-gate/*  [F8]  */	TNSZ("psubb",XMM,16),	TNSZ("psubw",XMM,16),	TNSZ("psubd",XMM,16),	TNSZ("psubq",XMM,16),
7997c478bdstevel@tonic-gate/*  [FC]  */	TNSZ("paddb",XMM,16),	TNSZ("paddw",XMM,16),	TNSZ("paddd",XMM,16),	INVALID,
8007c478bdstevel@tonic-gate};
8017c478bdstevel@tonic-gate
802ab47273Edward Gillettconst instable_t dis_opAVX660F[256] = {
803ab47273Edward Gillett/*  [00]  */	INVALID,		INVALID,		INVALID,		INVALID,
804ab47273Edward Gillett/*  [04]  */	INVALID,		INVALID,		INVALID,		INVALID,
805ab47273Edward Gillett/*  [08]  */	INVALID,		INVALID,		INVALID,		INVALID,
806ab47273Edward Gillett/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
807ab47273Edward Gillett
808ab47273Edward Gillett/*  [10]  */	TNSZ("vmovupd",VEX_MX,16),	TNSZ("vmovupd",VEX_RX,16),	TNSZ("vmovlpd",VEX_RMrX,8),	TNSZ("vmovlpd",VEX_RM,8),
809ab47273Edward Gillett/*  [14]  */	TNSZ("vunpcklpd",VEX_RMrX,16),TNSZ("vunpckhpd",VEX_RMrX,16),TNSZ("vmovhpd",VEX_RMrX,8),	TNSZ("vmovhpd",VEX_RM,8),
810ab47273Edward Gillett/*  [18]  */	INVALID,		INVALID,		INVALID,		INVALID,
811ab47273Edward Gillett/*  [1C]  */	INVALID,		INVALID,		INVALID,		INVALID,
812ab47273Edward Gillett
813ab47273Edward Gillett/*  [20]  */	INVALID,		INVALID,		INVALID,		INVALID,
814ab47273Edward Gillett/*  [24]  */	INVALID,		INVALID,		INVALID,		INVALID,
815ab47273Edward Gillett/*  [28]  */	TNSZ("vmovapd",VEX_MX,16),	TNSZ("vmovapd",VEX_RX,16),	INVALID,		TNSZ("vmovntpd",VEX_RM,16),
816ab47273Edward Gillett/*  [2C]  */	INVALID,		INVALID,		TNSZ("vucomisd",VEX_MX,8),TNSZ("vcomisd",VEX_MX,8),
817ab47273Edward Gillett
818ab47273Edward Gillett/*  [30]  */	INVALID,		INVALID,		INVALID,		INVALID,
819ab47273Edward Gillett/*  [34]  */	INVALID,		INVALID,		INVALID,		INVALID,
820ab47273Edward Gillett/*  [38]  */	INVALID,		INVALID,		INVALID,		INVALID,
821ab47273Edward Gillett/*  [3C]  */	INVALID,		INVALID,		INVALID,		INVALID,
822ab47273Edward Gillett
823a4e73d5Jerry Jelinek/*  [40]  */	INVALID,		TSvo("kand",VEX_RMX),	TSvo("kandn",VEX_RMX),		INVALID,
824a4e73d5Jerry Jelinek/*  [44]  */	TSvo("knot",VEX_MX),	TSvo("kor",VEX_RMX),	TSvo("kxnor",VEX_RMX),		TSvo("kxor",VEX_RMX),
825a4e73d5Jerry Jelinek/*  [48]  */	INVALID,		INVALID,		TSvo("kadd",VEX_RMX),		TSvo("kunpck",VEX_RMX),
826ab47273Edward Gillett/*  [4C]  */	INVALID,		INVALID,		INVALID,		INVALID,
827ab47273Edward Gillett
828ab47273Edward Gillett/*  [50]  */	TNS("vmovmskpd",VEX_MR),	TNSZ("vsqrtpd",VEX_MX,16),	INVALID,		INVALID,
829ab47273Edward Gillett/*  [54]  */	TNSZ("vandpd",VEX_RMrX,16),	TNSZ("vandnpd",VEX_RMrX,16),	TNSZ("vorpd",VEX_RMrX,16),	TNSZ("vxorpd",VEX_RMrX,16),
830ab47273Edward Gillett/*  [58]  */	TNSZ("vaddpd",VEX_RMrX,16),	TNSZ("vmulpd",VEX_RMrX,16),	TNSZ("vcvtpd2ps",VEX_MX,16),TNSZ("vcvtps2dq",VEX_MX,16),
831ab47273Edward Gillett/*  [5C]  */	TNSZ("vsubpd",VEX_RMrX,16),	TNSZ("vminpd",VEX_RMrX,16),	TNSZ("vdivpd",VEX_RMrX,16),	TNSZ("vmaxpd",VEX_RMrX,16),
832ab47273Edward Gillett
833ab47273Edward Gillett/*  [60]  */	TNSZ("vpunpcklbw",VEX_RMrX,16),TNSZ("vpunpcklwd",VEX_RMrX,16),TNSZ("vpunpckldq",VEX_RMrX,16),TNSZ("vpacksswb",VEX_RMrX,16),
834ab47273Edward Gillett/*  [64]  */	TNSZ("vpcmpgtb",VEX_RMrX,16),	TNSZ("vpcmpgtw",VEX_RMrX,16),	TNSZ("vpcmpgtd",VEX_RMrX,16),	TNSZ("vpackuswb",VEX_RMrX,16),
835ab47273Edward Gillett/*  [68]  */	TNSZ("vpunpckhbw",VEX_RMrX,16),TNSZ("vpunpckhwd",VEX_RMrX,16),TNSZ("vpunpckhdq",VEX_RMrX,16),TNSZ("vpackssdw",VEX_RMrX,16),
836ab47273Edward Gillett/*  [6C]  */	TNSZ("vpunpcklqdq",VEX_RMrX,16),TNSZ("vpunpckhqdq",VEX_RMrX,16),TNSZ("vmovd",VEX_MX,4),TNSZ("vmovdqa",VEX_MX,16),
837ab47273Edward Gillett
838ab47273Edward Gillett/*  [70]  */	TNSZ("vpshufd",VEX_MXI,16),	TNSZ("vgrp71",VEX_XXI,16),	TNSZ("vgrp72",VEX_XXI,16),		TNSZ("vgrp73",VEX_XXI,16),
839ab47273Edward Gillett/*  [74]  */	TNSZ("vpcmpeqb",VEX_RMrX,16),	TNSZ("vpcmpeqw",VEX_RMrX,16),	TNSZ("vpcmpeqd",VEX_RMrX,16),	INVALID,
840ab47273Edward Gillett/*  [78]  */	INVALID,		INVALID,		INVALID,		INVALID,
841ab47273Edward Gillett/*  [7C]  */	TNSZ("vhaddpd",VEX_RMrX,16),	TNSZ("vhsubpd",VEX_RMrX,16),	TNSZ("vmovd",VEX_RR,4),	TNSZ("vmovdqa",VEX_RX,16),
842ab47273Edward Gillett
843ab47273Edward Gillett/*  [80]  */	INVALID,		INVALID,		INVALID,		INVALID,
844ab47273Edward Gillett/*  [84]  */	INVALID,		INVALID,		INVALID,		INVALID,
845ab47273Edward Gillett/*  [88]  */	INVALID,		INVALID,		INVALID,		INVALID,
846ab47273Edward Gillett/*  [8C]  */	INVALID,		INVALID,		INVALID,		INVALID,
847ab47273Edward Gillett
848a4e73d5Jerry Jelinek/*  [90]  */	TSvo("kmov",VEX_KRM),	TSvo("kmov",VEX_KMR),	TSvo("kmov",VEX_KRR),		TSvo("kmov",VEX_MR),
849ab47273Edward Gillett/*  [94]  */	INVALID,		INVALID,		INVALID,		INVALID,
850a4e73d5Jerry Jelinek/*  [98]  */	TSvo("kortest",VEX_MX),	TSvo("ktest",VEX_MX),	INVALID,		INVALID,
851ab47273Edward Gillett/*  [9C]  */	INVALID,		INVALID,		INVALID,		INVALID,
852ab47273Edward Gillett
853ab47273Edward Gillett/*  [A0]  */	INVALID,		INVALID,		INVALID,		INVALID,
854ab47273Edward Gillett/*  [A4]  */	INVALID,		INVALID,		INVALID,		INVALID,
855ab47273Edward Gillett/*  [A8]  */	INVALID,		INVALID,		INVALID,		INVALID,
856ab47273Edward Gillett/*  [AC]  */	INVALID,		INVALID,		INVALID,		INVALID,
857ab47273Edward Gillett
858ab47273Edward Gillett/*  [B0]  */	INVALID,		INVALID,		INVALID,		INVALID,
859ab47273Edward Gillett/*  [B4]  */	INVALID,		INVALID,		INVALID,		INVALID,
860ab47273Edward Gillett/*  [B8]  */	INVALID,		INVALID,		INVALID,		INVALID,
861ab47273Edward Gillett/*  [BC]  */	INVALID,		INVALID,		INVALID,		INVALID,
862ab47273Edward Gillett
863ab47273Edward Gillett/*  [C0]  */	INVALID,		INVALID,		TNSZ("vcmppd",VEX_RMRX,16),	INVALID,
864ab47273Edward Gillett/*  [C4]  */	TNSZ("vpinsrw",VEX_RMRX,2),TNS("vpextrw",VEX_MR),	TNSZ("vshufpd",VEX_RMRX,16),	INVALID,
865ab47273Edward Gillett/*  [C8]  */	INVALID,		INVALID,		INVALID,		INVALID,
866ab47273Edward Gillett/*  [CC]  */	INVALID,		INVALID,		INVALID,		INVALID,
867ab47273Edward Gillett
868ab47273Edward Gillett/*  [D0]  */	TNSZ("vaddsubpd",VEX_RMrX,16),TNSZ("vpsrlw",VEX_RMrX,16),	TNSZ("vpsrld",VEX_RMrX,16),	TNSZ("vpsrlq",VEX_RMrX,16),
869ab47273Edward Gillett/*  [D4]  */	TNSZ("vpaddq",VEX_RMrX,16),	TNSZ("vpmullw",VEX_RMrX,16),	TNSZ("vmovq",VEX_RX,8),	TNS("vpmovmskb",VEX_MR),
870ab47273Edward Gillett/*  [D8]  */	TNSZ("vpsubusb",VEX_RMrX,16),	TNSZ("vpsubusw",VEX_RMrX,16),	TNSZ("vpminub",VEX_RMrX,16),	TNSZ("vpand",VEX_RMrX,16),
871ab47273Edward Gillett/*  [DC]  */	TNSZ("vpaddusb",VEX_RMrX,16),	TNSZ("vpaddusw",VEX_RMrX,16),	TNSZ("vpmaxub",VEX_RMrX,16),	TNSZ("vpandn",VEX_RMrX,16),
872ab47273Edward Gillett
873ab47273Edward Gillett/*  [E0]  */	TNSZ("vpavgb",VEX_RMrX,16),	TNSZ("vpsraw",VEX_RMrX,16),	TNSZ("vpsrad",VEX_RMrX,16),	TNSZ("vpavgw",VEX_RMrX,16),
874ab47273Edward Gillett/*  [E4]  */	TNSZ("vpmulhuw",VEX_RMrX,16),	TNSZ("vpmulhw",VEX_RMrX,16),	TNSZ("vcvttpd2dq",VEX_MX,16),TNSZ("vmovntdq",VEX_RM,16),
875ab47273Edward Gillett/*  [E8]  */	TNSZ("vpsubsb",VEX_RMrX,16),	TNSZ("vpsubsw",VEX_RMrX,16),	TNSZ("vpminsw",VEX_RMrX,16),	TNSZ("vpor",VEX_RMrX,16),
876ab47273Edward Gillett/*  [EC]  */	TNSZ("vpaddsb",VEX_RMrX,16),	TNSZ("vpaddsw",VEX_RMrX,16),	TNSZ("vpmaxsw",VEX_RMrX,16),	TNSZ("vpxor",VEX_RMrX,16),
877ab47273Edward Gillett
878ab47273Edward Gillett/*  [F0]  */	INVALID,		TNSZ("vpsllw",VEX_RMrX,16),	TNSZ("vpslld",VEX_RMrX,16),	TNSZ("vpsllq",VEX_RMrX,16),
879ab47273Edward Gillett/*  [F4]  */	TNSZ("vpmuludq",VEX_RMrX,16),	TNSZ("vpmaddwd",VEX_RMrX,16),	TNSZ("vpsadbw",VEX_RMrX,16),	TNS("vmaskmovdqu",VEX_MX),
880ab47273Edward Gillett/*  [F8]  */	TNSZ("vpsubb",VEX_RMrX,16),	TNSZ("vpsubw",VEX_RMrX,16),	TNSZ("vpsubd",VEX_RMrX,16),	TNSZ("vpsubq",VEX_RMrX,16),
881ab47273Edward Gillett/*  [FC]  */	TNSZ("vpaddb",VEX_RMrX,16),	TNSZ("vpaddw",VEX_RMrX,16),	TNSZ("vpaddd",VEX_RMrX,16),	INVALID,
882ab47273Edward Gillett};
883ab47273Edward Gillett
8847c478bdstevel@tonic-gate/*
8857c478bdstevel@tonic-gate *	Decode table for SIMD instructions with the repnz (0xf2) prefix.
8867c478bdstevel@tonic-gate */
8877c478bdstevel@tonic-gateconst instable_t dis_opSIMDrepnz[256] = {
8887c478bdstevel@tonic-gate/*  [00]  */	INVALID,		INVALID,		INVALID,		INVALID,
8897c478bdstevel@tonic-gate/*  [04]  */	INVALID,		INVALID,		INVALID,		INVALID,
8907c478bdstevel@tonic-gate/*  [08]  */	INVALID,		INVALID,		INVALID,		INVALID,
8917c478bdstevel@tonic-gate/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
8927c478bdstevel@tonic-gate
893d4c899eRobert Mustacchi/*  [10]  */	TNSZ("movsd",XMM,8),	TNSZ("movsd",XMMS,8),	TNSZ("movddup",XMM,8),	INVALID,
8947c478bdstevel@tonic-gate/*  [14]  */	INVALID,		INVALID,		INVALID,		INVALID,
8957c478bdstevel@tonic-gate/*  [18]  */	INVALID,		INVALID,		INVALID,		INVALID,
8967c478bdstevel@tonic-gate/*  [1C]  */	INVALID,		INVALID,		INVALID,		INVALID,
8977c478bdstevel@tonic-gate
8987c478bdstevel@tonic-gate/*  [20]  */	INVALID,		INVALID,		INVALID,		INVALID,
8997c478bdstevel@tonic-gate/*  [24]  */	INVALID,		INVALID,		INVALID,		INVALID,
900f880125kk/*  [28]  */	INVALID,		INVALID,		TNSZ("cvtsi2sd",XMM3MX,4),TNSZ("movntsd",XMMMS,8),
9017c478bdstevel@tonic-gate/*  [2C]  */	TNSZ("cvttsd2si",XMMXM3,8),TNSZ("cvtsd2si",XMMXM3,8),INVALID,		INVALID,
9027c478bdstevel@tonic-gate
9037c478bdstevel@tonic-gate/*  [30]  */	INVALID,		INVALID,		INVALID,		INVALID,
9047c478bdstevel@tonic-gate/*  [34]  */	INVALID,		INVALID,		INVALID,		INVALID,
9057c478bdstevel@tonic-gate/*  [38]  */	INVALID,		INVALID,		INVALID,		INVALID,
9067c478bdstevel@tonic-gate/*  [3C]  */	INVALID,		INVALID,		INVALID,		INVALID,
9077c478bdstevel@tonic-gate
9087c478bdstevel@tonic-gate/*  [40]  */	INVALID,		INVALID,		INVALID,		INVALID,
9097c478bdstevel@tonic-gate/*  [44]  */	INVALID,		INVALID,		INVALID,		INVALID,
9107c478bdstevel@tonic-gate/*  [48]  */	INVALID,		INVALID,		INVALID,		INVALID,
9117c478bdstevel@tonic-gate/*  [4C]  */	INVALID,		INVALID,		INVALID,		INVALID,
9127c478bdstevel@tonic-gate
9137c478bdstevel@tonic-gate/*  [50]  */	INVALID,		TNSZ("sqrtsd",XMM,8),	INVALID,		INVALID,
9147c478bdstevel@tonic-gate/*  [54]  */	INVALID,		INVALID,		INVALID,		INVALID,
9157c478bdstevel@tonic-gate/*  [58]  */	TNSZ("addsd",XMM,8),	TNSZ("mulsd",XMM,8),	TNSZ("cvtsd2ss",XMM,8),	INVALID,
9167c478bdstevel@tonic-gate/*  [5C]  */	TNSZ("subsd",XMM,8),	TNSZ("minsd",XMM,8),	TNSZ("divsd",XMM,8),	TNSZ("maxsd",XMM,8),
9177c478bdstevel@tonic-gate
9187c478bdstevel@tonic-gate/*  [60]  */	INVALID,		INVALID,		INVALID,		INVALID,
9197c478bdstevel@tonic-gate/*  [64]  */	INVALID,		INVALID,		INVALID,		INVALID,
9207c478bdstevel@tonic-gate/*  [68]  */	INVALID,		INVALID,		INVALID,		INVALID,
9217c478bdstevel@tonic-gate/*  [6C]  */	INVALID,		INVALID,		INVALID,		INVALID,
9227c478bdstevel@tonic-gate
9237c478bdstevel@tonic-gate/*  [70]  */	TNSZ("pshuflw",XMMP,16),INVALID,		INVALID,		INVALID,
9247c478bdstevel@tonic-gate/*  [74]  */	INVALID,		INVALID,		INVALID,		INVALID,
925f880125kk/*  [78]  */	TNSZ("insertq",XMMX2I,16),TNSZ("insertq",XMM,8),INVALID,		INVALID,
926d4c899eRobert Mustacchi/*  [7C]  */	TNSZ("haddps",XMM,16),	TNSZ("hsubps",XMM,16),	INVALID,		INVALID,
9277c478bdstevel@tonic-gate
9287c478bdstevel@tonic-gate/*  [80]  */	INVALID,		INVALID,		INVALID,		INVALID,
9297c478bdstevel@tonic-gate/*  [84]  */	INVALID,		INVALID,		INVALID,		INVALID,
9307c478bdstevel@tonic-gate/*  [88]  */	INVALID,		INVALID,		INVALID,		INVALID,
9317c478bdstevel@tonic-gate/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
9327c478bdstevel@tonic-gate
9337c478bdstevel@tonic-gate/*  [90]  */	INVALID,		INVALID,		INVALID,		INVALID,
9347c478bdstevel@tonic-gate/*  [94]  */	INVALID,		INVALID,		INVALID,		INVALID,
9357c478bdstevel@tonic-gate/*  [98]  */	INVALID,		INVALID,		INVALID,		INVALID,
9367c478bdstevel@tonic-gate/*  [9C]  */	INVALID,		INVALID,		INVALID,		INVALID,
9377c478bdstevel@tonic-gate
9387c478bdstevel@tonic-gate/*  [A0]  */	INVALID,		INVALID,		INVALID,		INVALID,
9397c478bdstevel@tonic-gate/*  [A4]  */	INVALID,		INVALID,		INVALID,		INVALID,
9407c478bdstevel@tonic-gate/*  [A8]  */	INVALID,		INVALID,		INVALID,		INVALID,
9417c478bdstevel@tonic-gate/*  [AC]  */	INVALID,		INVALID,		INVALID,		INVALID,
9427c478bdstevel@tonic-gate
9437c478bdstevel@tonic-gate/*  [B0]  */	INVALID,		INVALID,		INVALID,		INVALID,
9447c478bdstevel@tonic-gate/*  [B4]  */	INVALID,		INVALID,		INVALID,		INVALID,
9457c478bdstevel@tonic-gate/*  [B8]  */	INVALID,		INVALID,		INVALID,		INVALID,
9467c478bdstevel@tonic-gate/*  [BC]  */	INVALID,		INVALID,		INVALID,		INVALID,
9477c478bdstevel@tonic-gate
9487c478bdstevel@tonic-gate/*  [C0]  */	INVALID,		INVALID,		TNSZ("cmpsd",XMMP,8),	INVALID,
9497c478bdstevel@tonic-gate/*  [C4]  */	INVALID,		INVALID,		INVALID,		INVALID,
9507c478bdstevel@tonic-gate/*  [C8]  */	INVALID,		INVALID,		INVALID,		INVALID,
9517c478bdstevel@tonic-gate/*  [CC]  */	INVALID,		INVALID,		INVALID,		INVALID,
9527c478bdstevel@tonic-gate
953d4c899eRobert Mustacchi/*  [D0]  */	TNSZ("addsubps",XMM,16),INVALID,		INVALID,		INVALID,
9547c478bdstevel@tonic-gate/*  [D4]  */	INVALID,		INVALID,		TNS("movdq2q",XMMXM),	INVALID,
9557c478bdstevel@tonic-gate/*  [D8]  */	INVALID,		INVALID,		INVALID,		INVALID,
9567c478bdstevel@tonic-gate/*  [DC]  */	INVALID,		INVALID,		INVALID,		INVALID,
9577c478bdstevel@tonic-gate
9587c478bdstevel@tonic-gate/*  [E0]  */	INVALID,		INVALID,		INVALID,		INVALID,
9597c478bdstevel@tonic-gate/*  [E4]  */	INVALID,		INVALID,		TNSZ("cvtpd2dq",XMM,16),INVALID,
9607c478bdstevel@tonic-gate/*  [E8]  */	INVALID,		INVALID,		INVALID,		INVALID,
9617c478bdstevel@tonic-gate/*  [EC]  */	INVALID,		INVALID,		INVALID,		INVALID,
9627c478bdstevel@tonic-gate
963d4c899eRobert Mustacchi/*  [F0]  */	TNS("lddqu",XMMM),	INVALID,		INVALID,		INVALID,
9647c478bdstevel@tonic-gate/*  [F4]  */	INVALID,		INVALID,		INVALID,		INVALID,
9657c478bdstevel@tonic-gate/*  [F8]  */	INVALID,		INVALID,		INVALID,		INVALID,
9667c478bdstevel@tonic-gate/*  [FC]  */	INVALID,		INVALID,		INVALID,		INVALID,
9677c478bdstevel@tonic-gate};
9687c478bdstevel@tonic-gate
969ab47273Edward Gillettconst instable_t dis_opAVXF20F[256] = {
970ab47273Edward Gillett/*  [00]  */	INVALID,		INVALID,		INVALID,		INVALID,
971ab47273Edward Gillett/*  [04]  */	INVALID,		INVALID,		INVALID,		INVALID,
972ab47273Edward Gillett/*  [08]  */	INVALID,		INVALID,		INVALID,		INVALID,
973ab47273Edward Gillett/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
974ab47273Edward Gillett
975ab47273Edward Gillett/*  [10]  */	TNSZ("vmovsd",VEX_RMrX,8),	TNSZ("vmovsd",VEX_RRX,8),	TNSZ("vmovddup",VEX_MX,8),	INVALID,
976ab47273Edward Gillett/*  [14]  */	INVALID,		INVALID,		INVALID,		INVALID,
977ab47273Edward Gillett/*  [18]  */	INVALID,		INVALID,		INVALID,		INVALID,
978ab47273Edward Gillett/*  [1C]  */	INVALID,		INVALID,		INVALID,		INVALID,
979ab47273Edward Gillett
980ab47273Edward Gillett/*  [20]  */	INVALID,		INVALID,		INVALID,		INVALID,
981ab47273Edward Gillett/*  [24]  */	INVALID,		INVALID,		INVALID,		INVALID,
982ab47273Edward Gillett/*  [28]  */	INVALID,		INVALID,		TNSZ("vcvtsi2sd",VEX_RMrX,4),INVALID,
983ab47273Edward Gillett/*  [2C]  */	TNSZ("vcvttsd2si",VEX_MR,8),TNSZ("vcvtsd2si",VEX_MR,8),INVALID,		INVALID,
984ab47273Edward Gillett
985ab47273Edward Gillett/*  [30]  */	INVALID,		INVALID,		INVALID,		INVALID,
986ab47273Edward Gillett/*  [34]  */	INVALID,		INVALID,		INVALID,		INVALID,
987ab47273Edward Gillett/*  [38]  */	INVALID,		INVALID,		INVALID,		INVALID,
988ab47273Edward Gillett/*  [3C]  */	INVALID,		INVALID,		INVALID,		INVALID,
989ab47273Edward Gillett
990ab47273Edward Gillett/*  [40]  */	INVALID,		INVALID,		INVALID,		INVALID,
991ab47273Edward Gillett/*  [44]  */	INVALID,		INVALID,		INVALID,		INVALID,
992ab47273Edward Gillett/*  [48]  */	INVALID,		INVALID,		INVALID,		INVALID,
993ab47273Edward Gillett/*  [4C]  */	INVALID,		INVALID,		INVALID,		INVALID,
994ab47273Edward Gillett
995ab47273Edward Gillett/*  [50]  */	INVALID,		TNSZ("vsqrtsd",VEX_RMrX,8),	INVALID,		INVALID,
996ab47273Edward Gillett/*  [54]  */	INVALID,		INVALID,		INVALID,		INVALID,
997ab47273Edward Gillett/*  [58]  */	TNSZ("vaddsd",VEX_RMrX,8),	TNSZ("vmulsd",VEX_RMrX,8),	TNSZ("vcvtsd2ss",VEX_RMrX,8),	INVALID,
998ab47273Edward Gillett/*  [5C]  */	TNSZ("vsubsd",VEX_RMrX,8),	TNSZ("vminsd",VEX_RMrX,8),	TNSZ("vdivsd",VEX_RMrX,8),	TNSZ("vmaxsd",VEX_RMrX,8),
999ab47273Edward Gillett
1000ab47273Edward Gillett/*  [60]  */	INVALID,		INVALID,		INVALID,		INVALID,
1001ab47273Edward Gillett/*  [64]  */	INVALID,		INVALID,		INVALID,		INVALID,
1002ab47273Edward Gillett/*  [68]  */	INVALID,		INVALID,		INVALID,		INVALID,
1003ab47273Edward Gillett/*  [6C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1004ab47273Edward Gillett
1005ab47273Edward Gillett/*  [70]  */	TNSZ("vpshuflw",VEX_MXI,16),INVALID,		INVALID,		INVALID,
1006ab47273Edward Gillett/*  [74]  */	INVALID,		INVALID,		INVALID,		INVALID,
1007ab47273Edward Gillett/*  [78]  */	INVALID,		INVALID,		INVALID,		INVALID,
1008ab47273Edward Gillett/*  [7C]  */	TNSZ("vhaddps",VEX_RMrX,8),	TNSZ("vhsubps",VEX_RMrX,8),	INVALID,		INVALID,
1009ab47273Edward Gillett
1010ab47273Edward Gillett/*  [80]  */	INVALID,		INVALID,		INVALID,		INVALID,
1011ab47273Edward Gillett/*  [84]  */	INVALID,		INVALID,		INVALID,		INVALID,
1012ab47273Edward Gillett/*  [88]  */	INVALID,		INVALID,		INVALID,		INVALID,
1013ab47273Edward Gillett/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1014ab47273Edward Gillett
1015a4e73d5Jerry Jelinek/*  [90]  */	INVALID,		INVALID,		TSvo("kmov",VEX_KRR),		TSvo("kmov",VEX_MR),
1016ab47273Edward Gillett/*  [94]  */	INVALID,		INVALID,		INVALID,		INVALID,
1017ab47273Edward Gillett/*  [98]  */	INVALID,		INVALID,		INVALID,		INVALID,
1018ab47273Edward Gillett/*  [9C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1019ab47273Edward Gillett
1020ab47273Edward Gillett/*  [A0]  */	INVALID,		INVALID,		INVALID,		INVALID,
1021ab47273Edward Gillett/*  [A4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1022ab47273Edward Gillett/*  [A8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1023ab47273Edward Gillett/*  [AC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1024ab47273Edward Gillett
1025ab47273Edward Gillett/*  [B0]  */	INVALID,		INVALID,		INVALID,		INVALID,
1026ab47273Edward Gillett/*  [B4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1027ab47273Edward Gillett/*  [B8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1028ab47273Edward Gillett/*  [BC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1029ab47273Edward Gillett
1030ab47273Edward Gillett/*  [C0]  */	INVALID,		INVALID,		TNSZ("vcmpsd",VEX_RMRX,8),	INVALID,
1031ab47273Edward Gillett/*  [C4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1032ab47273Edward Gillett/*  [C8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1033ab47273Edward Gillett/*  [CC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1034ab47273Edward Gillett
1035ab47273Edward Gillett/*  [D0]  */	TNSZ("vaddsubps",VEX_RMrX,8),	INVALID,		INVALID,		INVALID,
1036ab47273Edward Gillett/*  [D4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1037ab47273Edward Gillett/*  [D8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1038ab47273Edward Gillett/*  [DC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1039ab47273Edward Gillett
1040ab47273Edward Gillett/*  [E0]  */	INVALID,		INVALID,		INVALID,		INVALID,
1041ab47273Edward Gillett/*  [E4]  */	INVALID,		INVALID,		TNSZ("vcvtpd2dq",VEX_MX,16),INVALID,
1042ab47273Edward Gillett/*  [E8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1043ab47273Edward Gillett/*  [EC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1044ab47273Edward Gillett
1045ab47273Edward Gillett/*  [F0]  */	TNSZ("vlddqu",VEX_MX,16),	INVALID,		INVALID,		INVALID,
1046ab47273Edward Gillett/*  [F4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1047ab47273Edward Gillett/*  [F8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1048ab47273Edward Gillett/*  [FC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1049ab47273Edward Gillett};
1050ab47273Edward Gillett
1051245ac94Robert Mustacchiconst instable_t dis_opAVXF20F3A[256] = {
1052245ac94Robert Mustacchi/*  [00]  */	INVALID,		INVALID,		INVALID,		INVALID,
1053245ac94Robert Mustacchi/*  [04]  */	INVALID,		INVALID,		INVALID,		INVALID,
1054245ac94Robert Mustacchi/*  [08]  */	INVALID,		INVALID,		INVALID,		INVALID,
1055245ac94Robert Mustacchi/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1056245ac94Robert Mustacchi
1057245ac94Robert Mustacchi/*  [10]  */	INVALID,		INVALID,		INVALID,		INVALID,
1058245ac94Robert Mustacchi/*  [14]  */	INVALID,		INVALID,		INVALID,		INVALID,
1059245ac94Robert Mustacchi/*  [18]  */	INVALID,		INVALID,		INVALID,		INVALID,
1060245ac94Robert Mustacchi/*  [1C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1061245ac94Robert Mustacchi
1062245ac94Robert Mustacchi/*  [20]  */	INVALID,		INVALID,		INVALID,		INVALID,
1063245ac94Robert Mustacchi/*  [24]  */	INVALID,		INVALID,		INVALID,		INVALID,
1064245ac94Robert Mustacchi/*  [28]  */	INVALID,		INVALID,		INVALID,		INVALID,
1065245ac94Robert Mustacchi/*  [2C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1066245ac94Robert Mustacchi
1067245ac94Robert Mustacchi/*  [30]  */	INVALID,		INVALID,		INVALID,		INVALID,
1068245ac94Robert Mustacchi/*  [34]  */	INVALID,		INVALID,		INVALID,		INVALID,
1069245ac94Robert Mustacchi/*  [38]  */	INVALID,		INVALID,		INVALID,		INVALID,
1070245ac94Robert Mustacchi/*  [3C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1071245ac94Robert Mustacchi
1072245ac94Robert Mustacchi/*  [40]  */	INVALID,		INVALID,		INVALID,		INVALID,
1073245ac94Robert Mustacchi/*  [44]  */	INVALID,		INVALID,		INVALID,		INVALID,
1074245ac94Robert Mustacchi/*  [48]  */	INVALID,		INVALID,		INVALID,		INVALID,
1075245ac94Robert Mustacchi/*  [4C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1076245ac94Robert Mustacchi
1077245ac94Robert Mustacchi/*  [50]  */	INVALID,		INVALID,		INVALID,		INVALID,
1078245ac94Robert Mustacchi/*  [54]  */	INVALID,		INVALID,		INVALID,		INVALID,
1079245ac94Robert Mustacchi/*  [58]  */	INVALID,		INVALID,		INVALID,		INVALID,
1080245ac94Robert Mustacchi/*  [5C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1081245ac94Robert Mustacchi
1082245ac94Robert Mustacchi/*  [60]  */	INVALID,		INVALID,		INVALID,		INVALID,
1083245ac94Robert Mustacchi/*  [64]  */	INVALID,		INVALID,		INVALID,		INVALID,
1084245ac94Robert Mustacchi/*  [68]  */	INVALID,		INVALID,		INVALID,		INVALID,
1085245ac94Robert Mustacchi/*  [6C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1086245ac94Robert Mustacchi
1087245ac94Robert Mustacchi/*  [70]  */	INVALID,		INVALID,		INVALID,		INVALID,
1088245ac94Robert Mustacchi/*  [74]  */	INVALID,		INVALID,		INVALID,		INVALID,
1089245ac94Robert Mustacchi/*  [78]  */	INVALID,		INVALID,		INVALID,		INVALID,
1090245ac94Robert Mustacchi/*  [7C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1091245ac94Robert Mustacchi
1092245ac94Robert Mustacchi/*  [80]  */	INVALID,		INVALID,		INVALID,		INVALID,
1093245ac94Robert Mustacchi/*  [84]  */	INVALID,		INVALID,		INVALID,		INVALID,
1094245ac94Robert Mustacchi/*  [88]  */	INVALID,		INVALID,		INVALID,		INVALID,
1095245ac94Robert Mustacchi/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1096245ac94Robert Mustacchi
1097245ac94Robert Mustacchi/*  [90]  */	INVALID,		INVALID,		INVALID,		INVALID,
1098245ac94Robert Mustacchi/*  [94]  */	INVALID,		INVALID,		INVALID,		INVALID,
1099245ac94Robert Mustacchi/*  [98]  */	INVALID,		INVALID,		INVALID,		INVALID,
1100245ac94Robert Mustacchi/*  [9C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1101245ac94Robert Mustacchi
1102245ac94Robert Mustacchi/*  [A0]  */	INVALID,		INVALID,		INVALID,		INVALID,
1103245ac94Robert Mustacchi/*  [A4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1104245ac94Robert Mustacchi/*  [A8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1105245ac94Robert Mustacchi/*  [AC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1106245ac94Robert Mustacchi
1107245ac94Robert Mustacchi/*  [B0]  */	INVALID,		INVALID,		INVALID,		INVALID,
1108245ac94Robert Mustacchi/*  [B4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1109245ac94Robert Mustacchi/*  [B8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1110245ac94Robert Mustacchi/*  [BC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1111245ac94Robert Mustacchi
1112245ac94Robert Mustacchi/*  [C0]  */	INVALID,		INVALID,		INVALID,		INVALID,
1113245ac94Robert Mustacchi/*  [C4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1114245ac94Robert Mustacchi/*  [C8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1115245ac94Robert Mustacchi/*  [CC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1116245ac94Robert Mustacchi
1117245ac94Robert Mustacchi/*  [D0]  */	INVALID,		INVALID,		INVALID,		INVALID,
1118245ac94Robert Mustacchi/*  [D4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1119245ac94Robert Mustacchi/*  [D8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1120245ac94Robert Mustacchi/*  [DC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1121245ac94Robert Mustacchi
1122245ac94Robert Mustacchi/*  [E0]  */	INVALID,		INVALID,		INVALID,		INVALID,
1123245ac94Robert Mustacchi/*  [E4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1124245ac94Robert Mustacchi/*  [E8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1125245ac94Robert Mustacchi/*  [EC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1126245ac94Robert Mustacchi
1127245ac94Robert Mustacchi/*  [F0]  */	TNSZvr("rorx",VEX_MXI,6),INVALID,		INVALID,		INVALID,
1128245ac94Robert Mustacchi/*  [F4]  */	INVALID,		INVALID,		INVALID,		INVALID,
1129245ac94Robert Mustacchi/*  [F8]  */	INVALID,		INVALID,		INVALID,		INVALID,
1130245ac94Robert Mustacchi/*  [FC]  */	INVALID,		INVALID,		INVALID,		INVALID,
1131245ac94Robert Mustacchi};
1132245ac94Robert Mustacchi
1133245ac94Robert Mustacchiconst instable_t dis_opAVXF20F38[256] = {
1134245ac94Robert Mustacchi/*  [00]  */	INVALID,		INVALID,		INVALID,		INVALID,
1135245ac94Robert Mustacchi/*  [04]  */	INVALID,		INVALID,		INVALID,		INVALID,
1136245ac94Robert Mustacchi/*  [08]  */	INVALID,		INVALID,		INVALID,		INVALID,
1137245ac94Robert Mustacchi/*  [0C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1138245ac94Robert Mustacchi
1139245ac94Robert Mustacchi/*  [10]  */	INVALID,		INVALID,		INVALID,		INVALID,
1140245ac94Robert Mustacchi/*  [14]  */	INVALID,		INVALID,		INVALID,		INVALID,
1141245ac94Robert Mustacchi/*  [18]  */	INVALID,		INVALID,		INVALID,		INVALID,
1142245ac94Robert Mustacchi/*  [1C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1143245ac94Robert Mustacchi
1144245ac94Robert Mustacchi/*  [20]  */	INVALID,		INVALID,		INVALID,		INVALID,
1145245ac94Robert Mustacchi/*  [24]  */	INVALID,		INVALID,		INVALID,		INVALID,
1146245ac94Robert Mustacchi/*  [28]  */	INVALID,		INVALID,		INVALID,		INVALID,
1147245ac94Robert Mustacchi/*  [2C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1148245ac94Robert Mustacchi
1149245ac94Robert Mustacchi/*  [30]  */	INVALID,		INVALID,		INVALID,		INVALID,
1150245ac94Robert Mustacchi/*  [34]  */	INVALID,		INVALID,		INVALID,		INVALID,
1151245ac94Robert Mustacchi/*  [38]  */	INVALID,		INVALID,		INVALID,		INVALID,
1152245ac94Robert Mustacchi/*  [3C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1153245ac94Robert Mustacchi
1154245ac94Robert Mustacchi/*  [40]  */	INVALID,		INVALID,		INVALID,		INVALID,
1155245ac94Robert Mustacchi/*  [44]  */	INVALID,		INVALID,		INVALID,		INVALID,
1156245ac94Robert Mustacchi/*  [48]  */	INVALID,		INVALID,		INVALID,		INVALID,
1157245ac94Robert Mustacchi/*  [4C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1158245ac94Robert Mustacchi
1159245ac94Robert Mustacchi/*  [50]  */	INVALID,		INVALID,		INVALID,		INVALID,
1160245ac94Robert Mustacchi/*  [54]  */	INVALID,		INVALID,		INVALID,		INVALID,
1161245ac94Robert Mustacchi/*  [58]  */	INVALID,		INVALID,		INVALID,		INVALID,
1162245ac94Robert Mustacchi/*  [5C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1163245ac94Robert Mustacchi
1164245ac94Robert Mustacchi/*  [60]  */	INVALID,		INVALID,		INVALID,		INVALID,
1165245ac94Robert Mustacchi/*  [64]  */	INVALID,		INVALID,		INVALID,		INVALID,
1166245ac94Robert Mustacchi/*  [68]  */	INVALID,		INVALID,		INVALID,		INVALID,
1167245ac94Robert Mustacchi/*  [6C]  */	INVALID,		INVALID,		INVALID,		INVALID,
1168245ac94Robert Mustacchi
1169245ac94Robert Mustacchi/*  [70]  */	INVALID,		INVALID,		INVALID,		INVALID,
1170245ac94Robert Mustacchi/*  [74]  */	INVALID,		INVALID,		INVALID,		INVALID,
1171245ac94Robert Mustacchi/*  [78]  */	INVALID,		INVALID,		INVALID,		INVALID,
1172