aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/inat.h32
-rw-r--r--arch/x86/include/asm/insn.h43
-rw-r--r--arch/x86/lib/inat.c12
-rw-r--r--arch/x86/lib/insn.c52
-rw-r--r--arch/x86/lib/x86-opcode-map.txt431
-rw-r--r--arch/x86/tools/gen-insn-attr-x86.awk94
6 files changed, 431 insertions, 233 deletions
diff --git a/arch/x86/include/asm/inat.h b/arch/x86/include/asm/inat.h
index c2487d2aca25..205b063e3e32 100644
--- a/arch/x86/include/asm/inat.h
+++ b/arch/x86/include/asm/inat.h
@@ -32,8 +32,8 @@
32 32
33/* Legacy last prefixes */ 33/* Legacy last prefixes */
34#define INAT_PFX_OPNDSZ 1 /* 0x66 */ /* LPFX1 */ 34#define INAT_PFX_OPNDSZ 1 /* 0x66 */ /* LPFX1 */
35#define INAT_PFX_REPNE 2 /* 0xF2 */ /* LPFX2 */ 35#define INAT_PFX_REPE 2 /* 0xF3 */ /* LPFX2 */
36#define INAT_PFX_REPE 3 /* 0xF3 */ /* LPFX3 */ 36#define INAT_PFX_REPNE 3 /* 0xF2 */ /* LPFX3 */
37/* Other Legacy prefixes */ 37/* Other Legacy prefixes */
38#define INAT_PFX_LOCK 4 /* 0xF0 */ 38#define INAT_PFX_LOCK 4 /* 0xF0 */
39#define INAT_PFX_CS 5 /* 0x2E */ 39#define INAT_PFX_CS 5 /* 0x2E */
@@ -45,6 +45,9 @@
45#define INAT_PFX_ADDRSZ 11 /* 0x67 */ 45#define INAT_PFX_ADDRSZ 11 /* 0x67 */
46/* x86-64 REX prefix */ 46/* x86-64 REX prefix */
47#define INAT_PFX_REX 12 /* 0x4X */ 47#define INAT_PFX_REX 12 /* 0x4X */
48/* AVX VEX prefixes */
49#define INAT_PFX_VEX2 13 /* 2-bytes VEX prefix */
50#define INAT_PFX_VEX3 14 /* 3-bytes VEX prefix */
48 51
49#define INAT_LSTPFX_MAX 3 52#define INAT_LSTPFX_MAX 3
50#define INAT_LGCPFX_MAX 11 53#define INAT_LGCPFX_MAX 11
@@ -84,6 +87,8 @@
84#define INAT_SCNDIMM (1 << (INAT_FLAG_OFFS + 2)) 87#define INAT_SCNDIMM (1 << (INAT_FLAG_OFFS + 2))
85#define INAT_MOFFSET (1 << (INAT_FLAG_OFFS + 3)) 88#define INAT_MOFFSET (1 << (INAT_FLAG_OFFS + 3))
86#define INAT_VARIANT (1 << (INAT_FLAG_OFFS + 4)) 89#define INAT_VARIANT (1 << (INAT_FLAG_OFFS + 4))
90#define INAT_VEXOK (1 << (INAT_FLAG_OFFS + 5))
91#define INAT_VEXONLY (1 << (INAT_FLAG_OFFS + 6))
87/* Attribute making macros for attribute tables */ 92/* Attribute making macros for attribute tables */
88#define INAT_MAKE_PREFIX(pfx) (pfx << INAT_PFX_OFFS) 93#define INAT_MAKE_PREFIX(pfx) (pfx << INAT_PFX_OFFS)
89#define INAT_MAKE_ESCAPE(esc) (esc << INAT_ESC_OFFS) 94#define INAT_MAKE_ESCAPE(esc) (esc << INAT_ESC_OFFS)
@@ -98,6 +103,9 @@ extern insn_attr_t inat_get_escape_attribute(insn_byte_t opcode,
98extern insn_attr_t inat_get_group_attribute(insn_byte_t modrm, 103extern insn_attr_t inat_get_group_attribute(insn_byte_t modrm,
99 insn_byte_t last_pfx, 104 insn_byte_t last_pfx,
100 insn_attr_t esc_attr); 105 insn_attr_t esc_attr);
106extern insn_attr_t inat_get_avx_attribute(insn_byte_t opcode,
107 insn_byte_t vex_m,
108 insn_byte_t vex_pp);
101 109
102/* Attribute checking functions */ 110/* Attribute checking functions */
103static inline int inat_is_legacy_prefix(insn_attr_t attr) 111static inline int inat_is_legacy_prefix(insn_attr_t attr)
@@ -129,6 +137,17 @@ static inline int inat_last_prefix_id(insn_attr_t attr)
129 return attr & INAT_PFX_MASK; 137 return attr & INAT_PFX_MASK;
130} 138}
131 139
140static inline int inat_is_vex_prefix(insn_attr_t attr)
141{
142 attr &= INAT_PFX_MASK;
143 return attr == INAT_PFX_VEX2 || attr == INAT_PFX_VEX3;
144}
145
146static inline int inat_is_vex3_prefix(insn_attr_t attr)
147{
148 return (attr & INAT_PFX_MASK) == INAT_PFX_VEX3;
149}
150
132static inline int inat_is_escape(insn_attr_t attr) 151static inline int inat_is_escape(insn_attr_t attr)
133{ 152{
134 return attr & INAT_ESC_MASK; 153 return attr & INAT_ESC_MASK;
@@ -189,4 +208,13 @@ static inline int inat_has_variant(insn_attr_t attr)
189 return attr & INAT_VARIANT; 208 return attr & INAT_VARIANT;
190} 209}
191 210
211static inline int inat_accept_vex(insn_attr_t attr)
212{
213 return attr & INAT_VEXOK;
214}
215
216static inline int inat_must_vex(insn_attr_t attr)
217{
218 return attr & INAT_VEXONLY;
219}
192#endif 220#endif
diff --git a/arch/x86/include/asm/insn.h b/arch/x86/include/asm/insn.h
index 12b4e3751d3f..96c2e0ad04ca 100644
--- a/arch/x86/include/asm/insn.h
+++ b/arch/x86/include/asm/insn.h
@@ -39,6 +39,7 @@ struct insn {
39 * prefixes.bytes[3]: last prefix 39 * prefixes.bytes[3]: last prefix
40 */ 40 */
41 struct insn_field rex_prefix; /* REX prefix */ 41 struct insn_field rex_prefix; /* REX prefix */
42 struct insn_field vex_prefix; /* VEX prefix */
42 struct insn_field opcode; /* 43 struct insn_field opcode; /*
43 * opcode.bytes[0]: opcode1 44 * opcode.bytes[0]: opcode1
44 * opcode.bytes[1]: opcode2 45 * opcode.bytes[1]: opcode2
@@ -80,6 +81,19 @@ struct insn {
80#define X86_REX_X(rex) ((rex) & 2) 81#define X86_REX_X(rex) ((rex) & 2)
81#define X86_REX_B(rex) ((rex) & 1) 82#define X86_REX_B(rex) ((rex) & 1)
82 83
84/* VEX bit flags */
85#define X86_VEX_W(vex) ((vex) & 0x80) /* VEX3 Byte2 */
86#define X86_VEX_R(vex) ((vex) & 0x80) /* VEX2/3 Byte1 */
87#define X86_VEX_X(vex) ((vex) & 0x40) /* VEX3 Byte1 */
88#define X86_VEX_B(vex) ((vex) & 0x20) /* VEX3 Byte1 */
89#define X86_VEX_L(vex) ((vex) & 0x04) /* VEX3 Byte2, VEX2 Byte1 */
90/* VEX bit fields */
91#define X86_VEX3_M(vex) ((vex) & 0x1f) /* VEX3 Byte1 */
92#define X86_VEX2_M 1 /* VEX2.M always 1 */
93#define X86_VEX_V(vex) (((vex) & 0x78) >> 3) /* VEX3 Byte2, VEX2 Byte1 */
94#define X86_VEX_P(vex) ((vex) & 0x03) /* VEX3 Byte2, VEX2 Byte1 */
95#define X86_VEX_M_MAX 0x1f /* VEX3.M Maximum value */
96
83/* The last prefix is needed for two-byte and three-byte opcodes */ 97/* The last prefix is needed for two-byte and three-byte opcodes */
84static inline insn_byte_t insn_last_prefix(struct insn *insn) 98static inline insn_byte_t insn_last_prefix(struct insn *insn)
85{ 99{
@@ -114,15 +128,42 @@ static inline void kernel_insn_init(struct insn *insn, const void *kaddr)
114#endif 128#endif
115} 129}
116 130
131static inline int insn_is_avx(struct insn *insn)
132{
133 if (!insn->prefixes.got)
134 insn_get_prefixes(insn);
135 return (insn->vex_prefix.value != 0);
136}
137
138static inline insn_byte_t insn_vex_m_bits(struct insn *insn)
139{
140 if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */
141 return X86_VEX2_M;
142 else
143 return X86_VEX3_M(insn->vex_prefix.bytes[1]);
144}
145
146static inline insn_byte_t insn_vex_p_bits(struct insn *insn)
147{
148 if (insn->vex_prefix.nbytes == 2) /* 2 bytes VEX */
149 return X86_VEX_P(insn->vex_prefix.bytes[1]);
150 else
151 return X86_VEX_P(insn->vex_prefix.bytes[2]);
152}
153
117/* Offset of each field from kaddr */ 154/* Offset of each field from kaddr */
118static inline int insn_offset_rex_prefix(struct insn *insn) 155static inline int insn_offset_rex_prefix(struct insn *insn)
119{ 156{
120 return insn->prefixes.nbytes; 157 return insn->prefixes.nbytes;
121} 158}
122static inline int insn_offset_opcode(struct insn *insn) 159static inline int insn_offset_vex_prefix(struct insn *insn)
123{ 160{
124 return insn_offset_rex_prefix(insn) + insn->rex_prefix.nbytes; 161 return insn_offset_rex_prefix(insn) + insn->rex_prefix.nbytes;
125} 162}
163static inline int insn_offset_opcode(struct insn *insn)
164{
165 return insn_offset_vex_prefix(insn) + insn->vex_prefix.nbytes;
166}
126static inline int insn_offset_modrm(struct insn *insn) 167static inline int insn_offset_modrm(struct insn *insn)
127{ 168{
128 return insn_offset_opcode(insn) + insn->opcode.nbytes; 169 return insn_offset_opcode(insn) + insn->opcode.nbytes;
diff --git a/arch/x86/lib/inat.c b/arch/x86/lib/inat.c
index 3fb5998b823e..46fc4ee09fc4 100644
--- a/arch/x86/lib/inat.c
+++ b/arch/x86/lib/inat.c
@@ -76,3 +76,15 @@ insn_attr_t inat_get_group_attribute(insn_byte_t modrm, insn_byte_t last_pfx,
76 inat_group_common_attribute(grp_attr); 76 inat_group_common_attribute(grp_attr);
77} 77}
78 78
79insn_attr_t inat_get_avx_attribute(insn_byte_t opcode, insn_byte_t vex_m,
80 insn_byte_t vex_p)
81{
82 const insn_attr_t *table;
83 if (vex_m > X86_VEX_M_MAX || vex_p > INAT_LSTPFX_MAX)
84 return 0;
85 table = inat_avx_tables[vex_m][vex_p];
86 if (!table)
87 return 0;
88 return table[opcode];
89}
90
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c
index 9f483179a8a6..9f33b984d0ef 100644
--- a/arch/x86/lib/insn.c
+++ b/arch/x86/lib/insn.c
@@ -28,6 +28,9 @@
28#define peek_next(t, insn) \ 28#define peek_next(t, insn) \
29 ({t r; r = *(t*)insn->next_byte; r; }) 29 ({t r; r = *(t*)insn->next_byte; r; })
30 30
31#define peek_nbyte_next(t, insn, n) \
32 ({t r; r = *(t*)((insn)->next_byte + n); r; })
33
31/** 34/**
32 * insn_init() - initialize struct insn 35 * insn_init() - initialize struct insn
33 * @insn: &struct insn to be initialized 36 * @insn: &struct insn to be initialized
@@ -107,6 +110,7 @@ found:
107 insn->prefixes.bytes[3] = lb; 110 insn->prefixes.bytes[3] = lb;
108 } 111 }
109 112
113 /* Decode REX prefix */
110 if (insn->x86_64) { 114 if (insn->x86_64) {
111 b = peek_next(insn_byte_t, insn); 115 b = peek_next(insn_byte_t, insn);
112 attr = inat_get_opcode_attribute(b); 116 attr = inat_get_opcode_attribute(b);
@@ -120,6 +124,39 @@ found:
120 } 124 }
121 } 125 }
122 insn->rex_prefix.got = 1; 126 insn->rex_prefix.got = 1;
127
128 /* Decode VEX prefix */
129 b = peek_next(insn_byte_t, insn);
130 attr = inat_get_opcode_attribute(b);
131 if (inat_is_vex_prefix(attr)) {
132 insn_byte_t b2 = peek_nbyte_next(insn_byte_t, insn, 1);
133 if (!insn->x86_64) {
134 /*
135 * In 32-bits mode, if the [7:6] bits (mod bits of
136 * ModRM) on the second byte are not 11b, it is
137 * LDS or LES.
138 */
139 if (X86_MODRM_MOD(b2) != 3)
140 goto vex_end;
141 }
142 insn->vex_prefix.bytes[0] = b;
143 insn->vex_prefix.bytes[1] = b2;
144 if (inat_is_vex3_prefix(attr)) {
145 b2 = peek_nbyte_next(insn_byte_t, insn, 2);
146 insn->vex_prefix.bytes[2] = b2;
147 insn->vex_prefix.nbytes = 3;
148 insn->next_byte += 3;
149 if (insn->x86_64 && X86_VEX_W(b2))
150 /* VEX.W overrides opnd_size */
151 insn->opnd_bytes = 8;
152 } else {
153 insn->vex_prefix.nbytes = 2;
154 insn->next_byte += 2;
155 }
156 }
157vex_end:
158 insn->vex_prefix.got = 1;
159
123 prefixes->got = 1; 160 prefixes->got = 1;
124 return; 161 return;
125} 162}
@@ -147,6 +184,18 @@ void insn_get_opcode(struct insn *insn)
147 op = get_next(insn_byte_t, insn); 184 op = get_next(insn_byte_t, insn);
148 opcode->bytes[0] = op; 185 opcode->bytes[0] = op;
149 opcode->nbytes = 1; 186 opcode->nbytes = 1;
187
188 /* Check if there is VEX prefix or not */
189 if (insn_is_avx(insn)) {
190 insn_byte_t m, p;
191 m = insn_vex_m_bits(insn);
192 p = insn_vex_p_bits(insn);
193 insn->attr = inat_get_avx_attribute(op, m, p);
194 if (!inat_accept_vex(insn->attr))
195 insn->attr = 0; /* This instruction is bad */
196 goto end; /* VEX has only 1 byte for opcode */
197 }
198
150 insn->attr = inat_get_opcode_attribute(op); 199 insn->attr = inat_get_opcode_attribute(op);
151 while (inat_is_escape(insn->attr)) { 200 while (inat_is_escape(insn->attr)) {
152 /* Get escaped opcode */ 201 /* Get escaped opcode */
@@ -155,6 +204,9 @@ void insn_get_opcode(struct insn *insn)
155 pfx = insn_last_prefix(insn); 204 pfx = insn_last_prefix(insn);
156 insn->attr = inat_get_escape_attribute(op, pfx, insn->attr); 205 insn->attr = inat_get_escape_attribute(op, pfx, insn->attr);
157 } 206 }
207 if (inat_must_vex(insn->attr))
208 insn->attr = 0; /* This instruction is bad */
209end:
158 opcode->got = 1; 210 opcode->got = 1;
159} 211}
160 212
diff --git a/arch/x86/lib/x86-opcode-map.txt b/arch/x86/lib/x86-opcode-map.txt
index 1f41246e6e3c..9887bfeeb2db 100644
--- a/arch/x86/lib/x86-opcode-map.txt
+++ b/arch/x86/lib/x86-opcode-map.txt
@@ -3,6 +3,7 @@
3#<Opcode maps> 3#<Opcode maps>
4# Table: table-name 4# Table: table-name
5# Referrer: escaped-name 5# Referrer: escaped-name
6# AVXcode: avx-code
6# opcode: mnemonic|GrpXXX [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...] 7# opcode: mnemonic|GrpXXX [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
7# (or) 8# (or)
8# opcode: escape # escaped-name 9# opcode: escape # escaped-name
@@ -13,9 +14,16 @@
13# reg: mnemonic [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...] 14# reg: mnemonic [operand1[,operand2...]] [(extra1)[,(extra2)...] [| 2nd-mnemonic ...]
14# EndTable 15# EndTable
15# 16#
17# AVX Superscripts
18# (VEX): this opcode can accept VEX prefix.
19# (oVEX): this opcode requires VEX prefix.
20# (o128): this opcode only supports 128bit VEX.
21# (o256): this opcode only supports 256bit VEX.
22#
16 23
17Table: one byte opcode 24Table: one byte opcode
18Referrer: 25Referrer:
26AVXcode:
19# 0x00 - 0x0f 27# 0x00 - 0x0f
2000: ADD Eb,Gb 2800: ADD Eb,Gb
2101: ADD Ev,Gv 2901: ADD Ev,Gv
@@ -225,8 +233,8 @@ c0: Grp2 Eb,Ib (1A)
225c1: Grp2 Ev,Ib (1A) 233c1: Grp2 Ev,Ib (1A)
226c2: RETN Iw (f64) 234c2: RETN Iw (f64)
227c3: RETN 235c3: RETN
228c4: LES Gz,Mp (i64) 236c4: LES Gz,Mp (i64) | 3bytes-VEX (Prefix)
229c5: LDS Gz,Mp (i64) 237c5: LDS Gz,Mp (i64) | 2bytes-VEX (Prefix)
230c6: Grp11 Eb,Ib (1A) 238c6: Grp11 Eb,Ib (1A)
231c7: Grp11 Ev,Iz (1A) 239c7: Grp11 Ev,Iz (1A)
232c8: ENTER Iw,Ib 240c8: ENTER Iw,Ib
@@ -290,8 +298,9 @@ fe: Grp4 (1A)
290ff: Grp5 (1A) 298ff: Grp5 (1A)
291EndTable 299EndTable
292 300
293Table: 2-byte opcode # First Byte is 0x0f 301Table: 2-byte opcode (0x0f)
294Referrer: 2-byte escape 302Referrer: 2-byte escape
303AVXcode: 1
295# 0x0f 0x00-0x0f 304# 0x0f 0x00-0x0f
29600: Grp6 (1A) 30500: Grp6 (1A)
29701: Grp7 (1A) 30601: Grp7 (1A)
@@ -311,14 +320,14 @@ Referrer: 2-byte escape
311# 3DNow! uses the last imm byte as opcode extension. 320# 3DNow! uses the last imm byte as opcode extension.
3120f: 3DNow! Pq,Qq,Ib 3210f: 3DNow! Pq,Qq,Ib
313# 0x0f 0x10-0x1f 322# 0x0f 0x10-0x1f
31410: movups Vps,Wps | movss Vss,Wss (F3) | movupd Vpd,Wpd (66) | movsd Vsd,Wsd (F2) 32310: movups Vps,Wps (VEX) | movss Vss,Wss (F3),(VEX),(o128) | movupd Vpd,Wpd (66),(VEX) | movsd Vsd,Wsd (F2),(VEX),(o128)
31511: movups Wps,Vps | movss Wss,Vss (F3) | movupd Wpd,Vpd (66) | movsd Wsd,Vsd (F2) 32411: movups Wps,Vps (VEX) | movss Wss,Vss (F3),(VEX),(o128) | movupd Wpd,Vpd (66),(VEX) | movsd Wsd,Vsd (F2),(VEX),(o128)
31612: movlps Vq,Mq | movlpd Vq,Mq (66) | movhlps Vq,Uq | movddup Vq,Wq (F2) | movsldup Vq,Wq (F3) 32512: movlps Vq,Mq (VEX),(o128) | movlpd Vq,Mq (66),(VEX),(o128) | movhlps Vq,Uq (VEX),(o128) | movddup Vq,Wq (F2),(VEX) | movsldup Vq,Wq (F3),(VEX)
31713: mpvlps Mq,Vq | movlpd Mq,Vq (66) 32613: mpvlps Mq,Vq (VEX),(o128) | movlpd Mq,Vq (66),(VEX),(o128)
31814: unpcklps Vps,Wq | unpcklpd Vpd,Wq (66) 32714: unpcklps Vps,Wq (VEX) | unpcklpd Vpd,Wq (66),(VEX)
31915: unpckhps Vps,Wq | unpckhpd Vpd,Wq (66) 32815: unpckhps Vps,Wq (VEX) | unpckhpd Vpd,Wq (66),(VEX)
32016: movhps Vq,Mq | movhpd Vq,Mq (66) | movlsps Vq,Uq | movshdup Vq,Wq (F3) 32916: movhps Vq,Mq (VEX),(o128) | movhpd Vq,Mq (66),(VEX),(o128) | movlsps Vq,Uq (VEX),(o128) | movshdup Vq,Wq (F3),(VEX)
32117: movhps Mq,Vq | movhpd Mq,Vq (66) 33017: movhps Mq,Vq (VEX),(o128) | movhpd Mq,Vq (66),(VEX),(o128)
32218: Grp16 (1A) 33118: Grp16 (1A)
32319: 33219:
3241a: 3331a:
@@ -336,14 +345,14 @@ Referrer: 2-byte escape
33625: 34525:
33726: 34626:
33827: 34727:
33928: movaps Vps,Wps | movapd Vpd,Wpd (66) 34828: movaps Vps,Wps (VEX) | movapd Vpd,Wpd (66),(VEX)
34029: movaps Wps,Vps | movapd Wpd,Vpd (66) 34929: movaps Wps,Vps (VEX) | movapd Wpd,Vpd (66),(VEX)
3412a: cvtpi2ps Vps,Qpi | cvtsi2ss Vss,Ed/q (F3) | cvtpi2pd Vpd,Qpi (66) | cvtsi2sd Vsd,Ed/q (F2) 3502a: cvtpi2ps Vps,Qpi | cvtsi2ss Vss,Ed/q (F3),(VEX),(o128) | cvtpi2pd Vpd,Qpi (66) | cvtsi2sd Vsd,Ed/q (F2),(VEX),(o128)
3422b: movntps Mps,Vps | movntpd Mpd,Vpd (66) 3512b: movntps Mps,Vps (VEX) | movntpd Mpd,Vpd (66),(VEX)
3432c: cvttps2pi Ppi,Wps | cvttss2si Gd/q,Wss (F3) | cvttpd2pi Ppi,Wpd (66) | cvttsd2si Gd/q,Wsd (F2) 3522c: cvttps2pi Ppi,Wps | cvttss2si Gd/q,Wss (F3),(VEX),(o128) | cvttpd2pi Ppi,Wpd (66) | cvttsd2si Gd/q,Wsd (F2),(VEX),(o128)
3442d: cvtps2pi Ppi,Wps | cvtss2si Gd/q,Wss (F3) | cvtpd2pi Qpi,Wpd (66) | cvtsd2si Gd/q,Wsd (F2) 3532d: cvtps2pi Ppi,Wps | cvtss2si Gd/q,Wss (F3),(VEX),(o128) | cvtpd2pi Qpi,Wpd (66) | cvtsd2si Gd/q,Wsd (F2),(VEX),(o128)
3452e: ucomiss Vss,Wss | ucomisd Vsd,Wsd (66) 3542e: ucomiss Vss,Wss (VEX),(o128) | ucomisd Vsd,Wsd (66),(VEX),(o128)
3462f: comiss Vss,Wss | comisd Vsd,Wsd (66) 3552f: comiss Vss,Wss (VEX),(o128) | comisd Vsd,Wsd (66),(VEX),(o128)
347# 0x0f 0x30-0x3f 356# 0x0f 0x30-0x3f
34830: WRMSR 35730: WRMSR
34931: RDTSC 35831: RDTSC
@@ -379,56 +388,56 @@ Referrer: 2-byte escape
3794e: CMOVLE/NG Gv,Ev 3884e: CMOVLE/NG Gv,Ev
3804f: CMOVNLE/G Gv,Ev 3894f: CMOVNLE/G Gv,Ev
381# 0x0f 0x50-0x5f 390# 0x0f 0x50-0x5f
38250: movmskps Gd/q,Ups | movmskpd Gd/q,Upd (66) 39150: movmskps Gd/q,Ups (VEX) | movmskpd Gd/q,Upd (66),(VEX)
38351: sqrtps Vps,Wps | sqrtss Vss,Wss (F3) | sqrtpd Vpd,Wpd (66) | sqrtsd Vsd,Wsd (F2) 39251: sqrtps Vps,Wps (VEX) | sqrtss Vss,Wss (F3),(VEX),(o128) | sqrtpd Vpd,Wpd (66),(VEX) | sqrtsd Vsd,Wsd (F2),(VEX),(o128)
38452: rsqrtps Vps,Wps | rsqrtss Vss,Wss (F3) 39352: rsqrtps Vps,Wps (VEX) | rsqrtss Vss,Wss (F3),(VEX),(o128)
38553: rcpps Vps,Wps | rcpss Vss,Wss (F3) 39453: rcpps Vps,Wps (VEX) | rcpss Vss,Wss (F3),(VEX),(o128)
38654: andps Vps,Wps | andpd Vpd,Wpd (66) 39554: andps Vps,Wps (VEX) | andpd Vpd,Wpd (66),(VEX)
38755: andnps Vps,Wps | andnpd Vpd,Wpd (66) 39655: andnps Vps,Wps (VEX) | andnpd Vpd,Wpd (66),(VEX)
38856: orps Vps,Wps | orpd Vpd,Wpd (66) 39756: orps Vps,Wps (VEX) | orpd Vpd,Wpd (66),(VEX)
38957: xorps Vps,Wps | xorpd Vpd,Wpd (66) 39857: xorps Vps,Wps (VEX) | xorpd Vpd,Wpd (66),(VEX)
39058: addps Vps,Wps | addss Vss,Wss (F3) | addpd Vpd,Wpd (66) | addsd Vsd,Wsd (F2) 39958: addps Vps,Wps (VEX) | addss Vss,Wss (F3),(VEX),(o128) | addpd Vpd,Wpd (66),(VEX) | addsd Vsd,Wsd (F2),(VEX),(o128)
39159: mulps Vps,Wps | mulss Vss,Wss (F3) | mulpd Vpd,Wpd (66) | mulsd Vsd,Wsd (F2) 40059: mulps Vps,Wps (VEX) | mulss Vss,Wss (F3),(VEX),(o128) | mulpd Vpd,Wpd (66),(VEX) | mulsd Vsd,Wsd (F2),(VEX),(o128)
3925a: cvtps2pd Vpd,Wps | cvtss2sd Vsd,Wss (F3) | cvtpd2ps Vps,Wpd (66) | cvtsd2ss Vsd,Wsd (F2) 4015a: cvtps2pd Vpd,Wps (VEX) | cvtss2sd Vsd,Wss (F3),(VEX),(o128) | cvtpd2ps Vps,Wpd (66),(VEX) | cvtsd2ss Vsd,Wsd (F2),(VEX),(o128)
3935b: cvtdq2ps Vps,Wdq | cvtps2dq Vdq,Wps (66) | cvttps2dq Vdq,Wps (F3) 4025b: cvtdq2ps Vps,Wdq (VEX) | cvtps2dq Vdq,Wps (66),(VEX) | cvttps2dq Vdq,Wps (F3),(VEX)
3945c: subps Vps,Wps | subss Vss,Wss (F3) | subpd Vpd,Wpd (66) | subsd Vsd,Wsd (F2) 4035c: subps Vps,Wps (VEX) | subss Vss,Wss (F3),(VEX),(o128) | subpd Vpd,Wpd (66),(VEX) | subsd Vsd,Wsd (F2),(VEX),(o128)
3955d: minps Vps,Wps | minss Vss,Wss (F3) | minpd Vpd,Wpd (66) | minsd Vsd,Wsd (F2) 4045d: minps Vps,Wps (VEX) | minss Vss,Wss (F3),(VEX),(o128) | minpd Vpd,Wpd (66),(VEX) | minsd Vsd,Wsd (F2),(VEX),(o128)
3965e: divps Vps,Wps | divss Vss,Wss (F3) | divpd Vpd,Wpd (66) | divsd Vsd,Wsd (F2) 4055e: divps Vps,Wps (VEX) | divss Vss,Wss (F3),(VEX),(o128) | divpd Vpd,Wpd (66),(VEX) | divsd Vsd,Wsd (F2),(VEX),(o128)
3975f: maxps Vps,Wps | maxss Vss,Wss (F3) | maxpd Vpd,Wpd (66) | maxsd Vsd,Wsd (F2) 4065f: maxps Vps,Wps (VEX) | maxss Vss,Wss (F3),(VEX),(o128) | maxpd Vpd,Wpd (66),(VEX) | maxsd Vsd,Wsd (F2),(VEX),(o128)
398# 0x0f 0x60-0x6f 407# 0x0f 0x60-0x6f
39960: punpcklbw Pq,Qd | punpcklbw Vdq,Wdq (66) 40860: punpcklbw Pq,Qd | punpcklbw Vdq,Wdq (66),(VEX),(o128)
40061: punpcklwd Pq,Qd | punpcklwd Vdq,Wdq (66) 40961: punpcklwd Pq,Qd | punpcklwd Vdq,Wdq (66),(VEX),(o128)
40162: punpckldq Pq,Qd | punpckldq Vdq,Wdq (66) 41062: punpckldq Pq,Qd | punpckldq Vdq,Wdq (66),(VEX),(o128)
40263: packsswb Pq,Qq | packsswb Vdq,Wdq (66) 41163: packsswb Pq,Qq | packsswb Vdq,Wdq (66),(VEX),(o128)
40364: pcmpgtb Pq,Qq | pcmpgtb Vdq,Wdq (66) 41264: pcmpgtb Pq,Qq | pcmpgtb Vdq,Wdq (66),(VEX),(o128)
40465: pcmpgtw Pq,Qq | pcmpgtw Vdq,Wdq (66) 41365: pcmpgtw Pq,Qq | pcmpgtw Vdq,Wdq (66),(VEX),(o128)
40566: pcmpgtd Pq,Qq | pcmpgtd Vdq,Wdq (66) 41466: pcmpgtd Pq,Qq | pcmpgtd Vdq,Wdq (66),(VEX),(o128)
40667: packuswb Pq,Qq | packuswb Vdq,Wdq (66) 41567: packuswb Pq,Qq | packuswb Vdq,Wdq (66),(VEX),(o128)
40768: punpckhbw Pq,Qd | punpckhbw Vdq,Wdq (66) 41668: punpckhbw Pq,Qd | punpckhbw Vdq,Wdq (66),(VEX),(o128)
40869: punpckhwd Pq,Qd | punpckhwd Vdq,Wdq (66) 41769: punpckhwd Pq,Qd | punpckhwd Vdq,Wdq (66),(VEX),(o128)
4096a: punpckhdq Pq,Qd | punpckhdq Vdq,Wdq (66) 4186a: punpckhdq Pq,Qd | punpckhdq Vdq,Wdq (66),(VEX),(o128)
4106b: packssdw Pq,Qd | packssdw Vdq,Wdq (66) 4196b: packssdw Pq,Qd | packssdw Vdq,Wdq (66),(VEX),(o128)
4116c: punpcklqdq Vdq,Wdq (66) 4206c: punpcklqdq Vdq,Wdq (66),(VEX),(o128)
4126d: punpckhqdq Vdq,Wdq (66) 4216d: punpckhqdq Vdq,Wdq (66),(VEX),(o128)
4136e: movd/q/ Pd,Ed/q | movd/q Vdq,Ed/q (66) 4226e: movd/q/ Pd,Ed/q | movd/q Vdq,Ed/q (66),(VEX),(o128)
4146f: movq Pq,Qq | movdqa Vdq,Wdq (66) | movdqu Vdq,Wdq (F3) 4236f: movq Pq,Qq | movdqa Vdq,Wdq (66),(VEX) | movdqu Vdq,Wdq (F3),(VEX)
415# 0x0f 0x70-0x7f 424# 0x0f 0x70-0x7f
41670: pshufw Pq,Qq,Ib | pshufd Vdq,Wdq,Ib (66) | pshufhw Vdq,Wdq,Ib (F3) | pshuflw VdqWdq,Ib (F2) 42570: pshufw Pq,Qq,Ib | pshufd Vdq,Wdq,Ib (66),(VEX),(o128) | pshufhw Vdq,Wdq,Ib (F3),(VEX),(o128) | pshuflw VdqWdq,Ib (F2),(VEX),(o128)
41771: Grp12 (1A) 42671: Grp12 (1A)
41872: Grp13 (1A) 42772: Grp13 (1A)
41973: Grp14 (1A) 42873: Grp14 (1A)
42074: pcmpeqb Pq,Qq | pcmpeqb Vdq,Wdq (66) 42974: pcmpeqb Pq,Qq | pcmpeqb Vdq,Wdq (66),(VEX),(o128)
42175: pcmpeqw Pq,Qq | pcmpeqw Vdq,Wdq (66) 43075: pcmpeqw Pq,Qq | pcmpeqw Vdq,Wdq (66),(VEX),(o128)
42276: pcmpeqd Pq,Qq | pcmpeqd Vdq,Wdq (66) 43176: pcmpeqd Pq,Qq | pcmpeqd Vdq,Wdq (66),(VEX),(o128)
42377: emms 43277: emms/vzeroupper/vzeroall (VEX)
42478: VMREAD Ed/q,Gd/q 43378: VMREAD Ed/q,Gd/q
42579: VMWRITE Gd/q,Ed/q 43479: VMWRITE Gd/q,Ed/q
4267a: 4357a:
4277b: 4367b:
4287c: haddps Vps,Wps (F2) | haddpd Vpd,Wpd (66) 4377c: haddps Vps,Wps (F2),(VEX) | haddpd Vpd,Wpd (66),(VEX)
4297d: hsubps Vps,Wps (F2) | hsubpd Vpd,Wpd (66) 4387d: hsubps Vps,Wps (F2),(VEX) | hsubpd Vpd,Wpd (66),(VEX)
4307e: movd/q Ed/q,Pd | movd/q Ed/q,Vdq (66) | movq Vq,Wq (F3) 4397e: movd/q Ed/q,Pd | movd/q Ed/q,Vdq (66),(VEX),(o128) | movq Vq,Wq (F3),(VEX),(o128)
4317f: movq Qq,Pq | movdqa Wdq,Vdq (66) | movdqu Wdq,Vdq (F3) 4407f: movq Qq,Pq | movdqa Wdq,Vdq (66),(VEX) | movdqu Wdq,Vdq (F3),(VEX)
432# 0x0f 0x80-0x8f 441# 0x0f 0x80-0x8f
43380: JO Jz (f64) 44280: JO Jz (f64)
43481: JNO Jz (f64) 44381: JNO Jz (f64)
@@ -500,11 +509,11 @@ bf: MOVSX Gv,Ew
500# 0x0f 0xc0-0xcf 509# 0x0f 0xc0-0xcf
501c0: XADD Eb,Gb 510c0: XADD Eb,Gb
502c1: XADD Ev,Gv 511c1: XADD Ev,Gv
503c2: cmpps Vps,Wps,Ib | cmpss Vss,Wss,Ib (F3) | cmppd Vpd,Wpd,Ib (66) | cmpsd Vsd,Wsd,Ib (F2) 512c2: cmpps Vps,Wps,Ib (VEX) | cmpss Vss,Wss,Ib (F3),(VEX),(o128) | cmppd Vpd,Wpd,Ib (66),(VEX) | cmpsd Vsd,Wsd,Ib (F2),(VEX)
504c3: movnti Md/q,Gd/q 513c3: movnti Md/q,Gd/q
505c4: pinsrw Pq,Rd/q/Mw,Ib | pinsrw Vdq,Rd/q/Mw,Ib (66) 514c4: pinsrw Pq,Rd/q/Mw,Ib | pinsrw Vdq,Rd/q/Mw,Ib (66),(VEX),(o128)
506c5: pextrw Gd,Nq,Ib | pextrw Gd,Udq,Ib (66) 515c5: pextrw Gd,Nq,Ib | pextrw Gd,Udq,Ib (66),(VEX),(o128)
507c6: shufps Vps,Wps,Ib | shufpd Vpd,Wpd,Ib (66) 516c6: shufps Vps,Wps,Ib (VEX) | shufpd Vpd,Wpd,Ib (66),(VEX)
508c7: Grp9 (1A) 517c7: Grp9 (1A)
509c8: BSWAP RAX/EAX/R8/R8D 518c8: BSWAP RAX/EAX/R8/R8D
510c9: BSWAP RCX/ECX/R9/R9D 519c9: BSWAP RCX/ECX/R9/R9D
@@ -515,77 +524,78 @@ cd: BSWAP RBP/EBP/R13/R13D
515ce: BSWAP RSI/ESI/R14/R14D 524ce: BSWAP RSI/ESI/R14/R14D
516cf: BSWAP RDI/EDI/R15/R15D 525cf: BSWAP RDI/EDI/R15/R15D
517# 0x0f 0xd0-0xdf 526# 0x0f 0xd0-0xdf
518d0: addsubps Vps,Wps (F2) | addsubpd Vpd,Wpd (66) 527d0: addsubps Vps,Wps (F2),(VEX) | addsubpd Vpd,Wpd (66),(VEX)
519d1: psrlw Pq,Qq | psrlw Vdq,Wdq (66) 528d1: psrlw Pq,Qq | psrlw Vdq,Wdq (66),(VEX),(o128)
520d2: psrld Pq,Qq | psrld Vdq,Wdq (66) 529d2: psrld Pq,Qq | psrld Vdq,Wdq (66),(VEX),(o128)
521d3: psrlq Pq,Qq | psrlq Vdq,Wdq (66) 530d3: psrlq Pq,Qq | psrlq Vdq,Wdq (66),(VEX),(o128)
522d4: paddq Pq,Qq | paddq Vdq,Wdq (66) 531d4: paddq Pq,Qq | paddq Vdq,Wdq (66),(VEX),(o128)
523d5: pmullw Pq,Qq | pmullw Vdq,Wdq (66) 532d5: pmullw Pq,Qq | pmullw Vdq,Wdq (66),(VEX),(o128)
524d6: movq Wq,Vq (66) | movq2dq Vdq,Nq (F3) | movdq2q Pq,Uq (F2) 533d6: movq Wq,Vq (66),(VEX),(o128) | movq2dq Vdq,Nq (F3) | movdq2q Pq,Uq (F2)
525d7: pmovmskb Gd,Nq | pmovmskb Gd,Udq (66) 534d7: pmovmskb Gd,Nq | pmovmskb Gd,Udq (66),(VEX),(o128)
526d8: psubusb Pq,Qq | psubusb Vdq,Wdq (66) 535d8: psubusb Pq,Qq | psubusb Vdq,Wdq (66),(VEX),(o128)
527d9: psubusw Pq,Qq | psubusw Vdq,Wdq (66) 536d9: psubusw Pq,Qq | psubusw Vdq,Wdq (66),(VEX),(o128)
528da: pminub Pq,Qq | pminub Vdq,Wdq (66) 537da: pminub Pq,Qq | pminub Vdq,Wdq (66),(VEX),(o128)
529db: pand Pq,Qq | pand Vdq,Wdq (66) 538db: pand Pq,Qq | pand Vdq,Wdq (66),(VEX),(o128)
530dc: paddusb Pq,Qq | paddusb Vdq,Wdq (66) 539dc: paddusb Pq,Qq | paddusb Vdq,Wdq (66),(VEX),(o128)
531dd: paddusw Pq,Qq | paddusw Vdq,Wdq (66) 540dd: paddusw Pq,Qq | paddusw Vdq,Wdq (66),(VEX),(o128)
532de: pmaxub Pq,Qq | pmaxub Vdq,Wdq (66) 541de: pmaxub Pq,Qq | pmaxub Vdq,Wdq (66),(VEX),(o128)
533df: pandn Pq,Qq | pandn Vdq,Wdq (66) 542df: pandn Pq,Qq | pandn Vdq,Wdq (66),(VEX),(o128)
534# 0x0f 0xe0-0xef 543# 0x0f 0xe0-0xef
535e0: pavgb Pq,Qq | pavgb Vdq,Wdq (66) 544e0: pavgb Pq,Qq | pavgb Vdq,Wdq (66),(VEX),(o128)
536e1: psraw Pq,Qq | psraw Vdq,Wdq (66) 545e1: psraw Pq,Qq | psraw Vdq,Wdq (66),(VEX),(o128)
537e2: psrad Pq,Qq | psrad Vdq,Wdq (66) 546e2: psrad Pq,Qq | psrad Vdq,Wdq (66),(VEX),(o128)
538e3: pavgw Pq,Qq | pavgw Vdq,Wdq (66) 547e3: pavgw Pq,Qq | pavgw Vdq,Wdq (66),(VEX),(o128)
539e4: pmulhuw Pq,Qq | pmulhuw Vdq,Wdq (66) 548e4: pmulhuw Pq,Qq | pmulhuw Vdq,Wdq (66),(VEX),(o128)
540e5: pmulhw Pq,Qq | pmulhw Vdq,Wdq (66) 549e5: pmulhw Pq,Qq | pmulhw Vdq,Wdq (66),(VEX),(o128)
541e6: cvtpd2dq Vdq,Wpd (F2) | cvttpd2dq Vdq,Wpd (66) | cvtdq2pd Vpd,Wdq (F3) 550e6: cvtpd2dq Vdq,Wpd (F2),(VEX) | cvttpd2dq Vdq,Wpd (66),(VEX) | cvtdq2pd Vpd,Wdq (F3),(VEX)
542e7: movntq Mq,Pq | movntdq Mdq,Vdq (66) 551e7: movntq Mq,Pq | movntdq Mdq,Vdq (66),(VEX)
543e8: psubsb Pq,Qq | psubsb Vdq,Wdq (66) 552e8: psubsb Pq,Qq | psubsb Vdq,Wdq (66),(VEX),(o128)
544e9: psubsw Pq,Qq | psubsw Vdq,Wdq (66) 553e9: psubsw Pq,Qq | psubsw Vdq,Wdq (66),(VEX),(o128)
545ea: pminsw Pq,Qq | pminsw Vdq,Wdq (66) 554ea: pminsw Pq,Qq | pminsw Vdq,Wdq (66),(VEX),(o128)
546eb: por Pq,Qq | por Vdq,Wdq (66) 555eb: por Pq,Qq | por Vdq,Wdq (66),(VEX),(o128)
547ec: paddsb Pq,Qq | paddsb Vdq,Wdq (66) 556ec: paddsb Pq,Qq | paddsb Vdq,Wdq (66),(VEX),(o128)
548ed: paddsw Pq,Qq | paddsw Vdq,Wdq (66) 557ed: paddsw Pq,Qq | paddsw Vdq,Wdq (66),(VEX),(o128)
549ee: pmaxsw Pq,Qq | pmaxsw Vdq,Wdq (66) 558ee: pmaxsw Pq,Qq | pmaxsw Vdq,Wdq (66),(VEX),(o128)
550ef: pxor Pq,Qq | pxor Vdq,Wdq (66) 559ef: pxor Pq,Qq | pxor Vdq,Wdq (66),(VEX),(o128)
551# 0x0f 0xf0-0xff 560# 0x0f 0xf0-0xff
552f0: lddqu Vdq,Mdq (F2) 561f0: lddqu Vdq,Mdq (F2),(VEX)
553f1: psllw Pq,Qq | psllw Vdq,Wdq (66) 562f1: psllw Pq,Qq | psllw Vdq,Wdq (66),(VEX),(o128)
554f2: pslld Pq,Qq | pslld Vdq,Wdq (66) 563f2: pslld Pq,Qq | pslld Vdq,Wdq (66),(VEX),(o128)
555f3: psllq Pq,Qq | psllq Vdq,Wdq (66) 564f3: psllq Pq,Qq | psllq Vdq,Wdq (66),(VEX),(o128)
556f4: pmuludq Pq,Qq | pmuludq Vdq,Wdq (66) 565f4: pmuludq Pq,Qq | pmuludq Vdq,Wdq (66),(VEX),(o128)
557f5: pmaddwd Pq,Qq | pmaddwd Vdq,Wdq (66) 566f5: pmaddwd Pq,Qq | pmaddwd Vdq,Wdq (66),(VEX),(o128)
558f6: psadbw Pq,Qq | psadbw Vdq,Wdq (66) 567f6: psadbw Pq,Qq | psadbw Vdq,Wdq (66),(VEX),(o128)
559f7: maskmovq Pq,Nq | maskmovdqu Vdq,Udq (66) 568f7: maskmovq Pq,Nq | maskmovdqu Vdq,Udq (66),(VEX),(o128)
560f8: psubb Pq,Qq | psubb Vdq,Wdq (66) 569f8: psubb Pq,Qq | psubb Vdq,Wdq (66),(VEX),(o128)
561f9: psubw Pq,Qq | psubw Vdq,Wdq (66) 570f9: psubw Pq,Qq | psubw Vdq,Wdq (66),(VEX),(o128)
562fa: psubd Pq,Qq | psubd Vdq,Wdq (66) 571fa: psubd Pq,Qq | psubd Vdq,Wdq (66),(VEX),(o128)
563fb: psubq Pq,Qq | psubq Vdq,Wdq (66) 572fb: psubq Pq,Qq | psubq Vdq,Wdq (66),(VEX),(o128)
564fc: paddb Pq,Qq | paddb Vdq,Wdq (66) 573fc: paddb Pq,Qq | paddb Vdq,Wdq (66),(VEX),(o128)
565fd: paddw Pq,Qq | paddw Vdq,Wdq (66) 574fd: paddw Pq,Qq | paddw Vdq,Wdq (66),(VEX),(o128)
566fe: paddd Pq,Qq | paddd Vdq,Wdq (66) 575fe: paddd Pq,Qq | paddd Vdq,Wdq (66),(VEX),(o128)
567ff: 576ff:
568EndTable 577EndTable
569 578
570Table: 3-byte opcode 1 (0x0f 0x38) 579Table: 3-byte opcode 1 (0x0f 0x38)
571Referrer: 3-byte escape 1 580Referrer: 3-byte escape 1
581AVXcode: 2
572# 0x0f 0x38 0x00-0x0f 582# 0x0f 0x38 0x00-0x0f
57300: pshufb Pq,Qq | pshufb Vdq,Wdq (66) 58300: pshufb Pq,Qq | pshufb Vdq,Wdq (66),(VEX),(o128)
57401: phaddw Pq,Qq | phaddw Vdq,Wdq (66) 58401: phaddw Pq,Qq | phaddw Vdq,Wdq (66),(VEX),(o128)
57502: phaddd Pq,Qq | phaddd Vdq,Wdq (66) 58502: phaddd Pq,Qq | phaddd Vdq,Wdq (66),(VEX),(o128)
57603: phaddsw Pq,Qq | phaddsw Vdq,Wdq (66) 58603: phaddsw Pq,Qq | phaddsw Vdq,Wdq (66),(VEX),(o128)
57704: pmaddubsw Pq,Qq | pmaddubsw Vdq,Wdq (66) 58704: pmaddubsw Pq,Qq | pmaddubsw Vdq,Wdq (66),(VEX),(o128)
57805: phsubw Pq,Qq | phsubw Vdq,Wdq (66) 58805: phsubw Pq,Qq | phsubw Vdq,Wdq (66),(VEX),(o128)
57906: phsubd Pq,Qq | phsubd Vdq,Wdq (66) 58906: phsubd Pq,Qq | phsubd Vdq,Wdq (66),(VEX),(o128)
58007: phsubsw Pq,Qq | phsubsw Vdq,Wdq (66) 59007: phsubsw Pq,Qq | phsubsw Vdq,Wdq (66),(VEX),(o128)
58108: psignb Pq,Qq | psignb Vdq,Wdq (66) 59108: psignb Pq,Qq | psignb Vdq,Wdq (66),(VEX),(o128)
58209: psignw Pq,Qq | psignw Vdq,Wdq (66) 59209: psignw Pq,Qq | psignw Vdq,Wdq (66),(VEX),(o128)
5830a: psignd Pq,Qq | psignd Vdq,Wdq (66) 5930a: psignd Pq,Qq | psignd Vdq,Wdq (66),(VEX),(o128)
5840b: pmulhrsw Pq,Qq | pmulhrsw Vdq,Wdq (66) 5940b: pmulhrsw Pq,Qq | pmulhrsw Vdq,Wdq (66),(VEX),(o128)
5850c: 5950c: Vpermilps /r (66),(oVEX)
5860d: 5960d: Vpermilpd /r (66),(oVEX)
5870e: 5970e: vtestps /r (66),(oVEX)
5880f: 5980f: vtestpd /r (66),(oVEX)
589# 0x0f 0x38 0x10-0x1f 599# 0x0f 0x38 0x10-0x1f
59010: pblendvb Vdq,Wdq (66) 60010: pblendvb Vdq,Wdq (66)
59111: 60111:
@@ -594,90 +604,99 @@ Referrer: 3-byte escape 1
59414: blendvps Vdq,Wdq (66) 60414: blendvps Vdq,Wdq (66)
59515: blendvpd Vdq,Wdq (66) 60515: blendvpd Vdq,Wdq (66)
59616: 60616:
59717: ptest Vdq,Wdq (66) 60717: ptest Vdq,Wdq (66),(VEX)
59818: 60818: vbroadcastss /r (66),(oVEX)
59919: 60919: vbroadcastsd /r (66),(oVEX),(o256)
6001a: 6101a: vbroadcastf128 /r (66),(oVEX),(o256)
6011b: 6111b:
6021c: pabsb Pq,Qq | pabsb Vdq,Wdq (66) 6121c: pabsb Pq,Qq | pabsb Vdq,Wdq (66),(VEX),(o128)
6031d: pabsw Pq,Qq | pabsw Vdq,Wdq (66) 6131d: pabsw Pq,Qq | pabsw Vdq,Wdq (66),(VEX),(o128)
6041e: pabsd Pq,Qq | pabsd Vdq,Wdq (66) 6141e: pabsd Pq,Qq | pabsd Vdq,Wdq (66),(VEX),(o128)
6051f: 6151f:
606# 0x0f 0x38 0x20-0x2f 616# 0x0f 0x38 0x20-0x2f
60720: pmovsxbw Vdq,Udq/Mq (66) 61720: pmovsxbw Vdq,Udq/Mq (66),(VEX),(o128)
60821: pmovsxbd Vdq,Udq/Md (66) 61821: pmovsxbd Vdq,Udq/Md (66),(VEX),(o128)
60922: pmovsxbq Vdq,Udq/Mw (66) 61922: pmovsxbq Vdq,Udq/Mw (66),(VEX),(o128)
61023: pmovsxwd Vdq,Udq/Mq (66) 62023: pmovsxwd Vdq,Udq/Mq (66),(VEX),(o128)
61124: pmovsxwq Vdq,Udq/Md (66) 62124: pmovsxwq Vdq,Udq/Md (66),(VEX),(o128)
61225: pmovsxdq Vdq,Udq/Mq (66) 62225: pmovsxdq Vdq,Udq/Mq (66),(VEX),(o128)
61326: 62326:
61427: 62427:
61528: pmuldq Vdq,Wdq (66) 62528: pmuldq Vdq,Wdq (66),(VEX),(o128)
61629: pcmpeqq Vdq,Wdq (66) 62629: pcmpeqq Vdq,Wdq (66),(VEX),(o128)
6172a: movntdqa Vdq,Mdq (66) 6272a: movntdqa Vdq,Mdq (66),(VEX),(o128)
6182b: packusdw Vdq,Wdq (66) 6282b: packusdw Vdq,Wdq (66),(VEX),(o128)
6192c: 6292c: vmaskmovps(ld) /r (66),(oVEX)
6202d: 6302d: vmaskmovpd(ld) /r (66),(oVEX)
6212e: 6312e: vmaskmovps(st) /r (66),(oVEX)
6222f: 6322f: vmaskmovpd(st) /r (66),(oVEX)
623# 0x0f 0x38 0x30-0x3f 633# 0x0f 0x38 0x30-0x3f
62430: pmovzxbw Vdq,Udq/Mq (66) 63430: pmovzxbw Vdq,Udq/Mq (66),(VEX),(o128)
62531: pmovzxbd Vdq,Udq/Md (66) 63531: pmovzxbd Vdq,Udq/Md (66),(VEX),(o128)
62632: pmovzxbq Vdq,Udq/Mw (66) 63632: pmovzxbq Vdq,Udq/Mw (66),(VEX),(o128)
62733: pmovzxwd Vdq,Udq/Mq (66) 63733: pmovzxwd Vdq,Udq/Mq (66),(VEX),(o128)
62834: pmovzxwq Vdq,Udq/Md (66) 63834: pmovzxwq Vdq,Udq/Md (66),(VEX),(o128)
62935: pmovzxdq Vdq,Udq/Mq (66) 63935: pmovzxdq Vdq,Udq/Mq (66),(VEX),(o128)
63036: 64036:
63137: pcmpgtq Vdq,Wdq (66) 64137: pcmpgtq Vdq,Wdq (66),(VEX),(o128)
63238: pminsb Vdq,Wdq (66) 64238: pminsb Vdq,Wdq (66),(VEX),(o128)
63339: pminsd Vdq,Wdq (66) 64339: pminsd Vdq,Wdq (66),(VEX),(o128)
6343a: pminuw Vdq,Wdq (66) 6443a: pminuw Vdq,Wdq (66),(VEX),(o128)
6353b: pminud Vdq,Wdq (66) 6453b: pminud Vdq,Wdq (66),(VEX),(o128)
6363c: pmaxsb Vdq,Wdq (66) 6463c: pmaxsb Vdq,Wdq (66),(VEX),(o128)
6373d: pmaxsd Vdq,Wdq (66) 6473d: pmaxsd Vdq,Wdq (66),(VEX),(o128)
6383e: pmaxuw Vdq,Wdq (66) 6483e: pmaxuw Vdq,Wdq (66),(VEX),(o128)
6393f: pmaxud Vdq,Wdq (66) 6493f: pmaxud Vdq,Wdq (66),(VEX),(o128)
640# 0x0f 0x38 0x4f-0xff 650# 0x0f 0x38 0x4f-0xff
64140: pmulld Vdq,Wdq (66) 65140: pmulld Vdq,Wdq (66),(VEX),(o128)
64241: phminposuw Vdq,Wdq (66) 65241: phminposuw Vdq,Wdq (66),(VEX),(o128)
64380: INVEPT Gd/q,Mdq (66) 65380: INVEPT Gd/q,Mdq (66)
64481: INVPID Gd/q,Mdq (66) 65481: INVPID Gd/q,Mdq (66)
645db: aesimc Vdq,Wdq (66) 655db: aesimc Vdq,Wdq (66),(VEX),(o128)
646dc: aesenc Vdq,Wdq (66) 656dc: aesenc Vdq,Wdq (66),(VEX),(o128)
647dd: aesenclast Vdq,Wdq (66) 657dd: aesenclast Vdq,Wdq (66),(VEX),(o128)
648de: aesdec Vdq,Wdq (66) 658de: aesdec Vdq,Wdq (66),(VEX),(o128)
649df: aesdeclast Vdq,Wdq (66) 659df: aesdeclast Vdq,Wdq (66),(VEX),(o128)
650f0: MOVBE Gv,Mv | CRC32 Gd,Eb (F2) 660f0: MOVBE Gv,Mv | CRC32 Gd,Eb (F2)
651f1: MOVBE Mv,Gv | CRC32 Gd,Ev (F2) 661f1: MOVBE Mv,Gv | CRC32 Gd,Ev (F2)
652EndTable 662EndTable
653 663
654Table: 3-byte opcode 2 (0x0f 0x3a) 664Table: 3-byte opcode 2 (0x0f 0x3a)
655Referrer: 3-byte escape 2 665Referrer: 3-byte escape 2
666AVXcode: 3
656# 0x0f 0x3a 0x00-0xff 667# 0x0f 0x3a 0x00-0xff
65708: roundps Vdq,Wdq,Ib (66) 66804: vpermilps /r,Ib (66),(oVEX)
65809: roundpd Vdq,Wdq,Ib (66) 66905: vpermilpd /r,Ib (66),(oVEX)
6590a: roundss Vss,Wss,Ib (66) 67006: vperm2f128 /r,Ib (66),(oVEX),(o256)
6600b: roundsd Vsd,Wsd,Ib (66) 67108: roundps Vdq,Wdq,Ib (66),(VEX)
6610c: blendps Vdq,Wdq,Ib (66) 67209: roundpd Vdq,Wdq,Ib (66),(VEX)
6620d: blendpd Vdq,Wdq,Ib (66) 6730a: roundss Vss,Wss,Ib (66),(VEX),(o128)
6630e: pblendw Vdq,Wdq,Ib (66) 6740b: roundsd Vsd,Wsd,Ib (66),(VEX),(o128)
6640f: palignr Pq,Qq,Ib | palignr Vdq,Wdq,Ib (66) 6750c: blendps Vdq,Wdq,Ib (66),(VEX)
66514: pextrb Rd/Mb,Vdq,Ib (66) 6760d: blendpd Vdq,Wdq,Ib (66),(VEX)
66615: pextrw Rd/Mw,Vdq,Ib (66) 6770e: pblendw Vdq,Wdq,Ib (66),(VEX),(o128)
66716: pextrd/pextrq Ed/q,Vdq,Ib (66) 6780f: palignr Pq,Qq,Ib | palignr Vdq,Wdq,Ib (66),(VEX),(o128)
66817: extractps Ed,Vdq,Ib (66) 67914: pextrb Rd/Mb,Vdq,Ib (66),(VEX),(o128)
66920: pinsrb Vdq,Rd/q/Mb,Ib (66) 68015: pextrw Rd/Mw,Vdq,Ib (66),(VEX),(o128)
67021: insertps Vdq,Udq/Md,Ib (66) 68116: pextrd/pextrq Ed/q,Vdq,Ib (66),(VEX),(o128)
67122: pinsrd/pinsrq Vdq,Ed/q,Ib (66) 68217: extractps Ed,Vdq,Ib (66),(VEX),(o128)
67240: dpps Vdq,Wdq,Ib (66) 68318: vinsertf128 /r,Ib (66),(oVEX),(o256)
67341: dppd Vdq,Wdq,Ib (66) 68419: vextractf128 /r,Ib (66),(oVEX),(o256)
67442: mpsadbw Vdq,Wdq,Ib (66) 68520: pinsrb Vdq,Rd/q/Mb,Ib (66),(VEX),(o128)
67544: pclmulq Vdq,Wdq,Ib (66) 68621: insertps Vdq,Udq/Md,Ib (66),(VEX),(o128)
67660: pcmpestrm Vdq,Wdq,Ib (66) 68722: pinsrd/pinsrq Vdq,Ed/q,Ib (66),(VEX),(o128)
67761: pcmpestri Vdq,Wdq,Ib (66) 68840: dpps Vdq,Wdq,Ib (66),(VEX)
67862: pcmpistrm Vdq,Wdq,Ib (66) 68941: dppd Vdq,Wdq,Ib (66),(VEX),(o128)
67963: pcmpistri Vdq,Wdq,Ib (66) 69042: mpsadbw Vdq,Wdq,Ib (66),(VEX),(o128)
680df: aeskeygenassist Vdq,Wdq,Ib (66) 69144: pclmulq Vdq,Wdq,Ib (66),(VEX),(o128)
6924a: vblendvps /r,Ib (66),(oVEX)
6934b: vblendvpd /r,Ib (66),(oVEX)
6944c: vpblendvb /r,Ib (66),(oVEX),(o128)
69560: pcmpestrm Vdq,Wdq,Ib (66),(VEX),(o128)
69661: pcmpestri Vdq,Wdq,Ib (66),(VEX),(o128)
69762: pcmpistrm Vdq,Wdq,Ib (66),(VEX),(o128)
69863: pcmpistri Vdq,Wdq,Ib (66),(VEX),(o128)
699df: aeskeygenassist Vdq,Wdq,Ib (66),(VEX),(o128)
681EndTable 700EndTable
682 701
683GrpTable: Grp1 702GrpTable: Grp1
@@ -785,29 +804,29 @@ GrpTable: Grp11
785EndTable 804EndTable
786 805
787GrpTable: Grp12 806GrpTable: Grp12
7882: psrlw Nq,Ib (11B) | psrlw Udq,Ib (66),(11B) 8072: psrlw Nq,Ib (11B) | psrlw Udq,Ib (66),(11B),(VEX),(o128)
7894: psraw Nq,Ib (11B) | psraw Udq,Ib (66),(11B) 8084: psraw Nq,Ib (11B) | psraw Udq,Ib (66),(11B),(VEX),(o128)
7906: psllw Nq,Ib (11B) | psllw Udq,Ib (66),(11B) 8096: psllw Nq,Ib (11B) | psllw Udq,Ib (66),(11B),(VEX),(o128)
791EndTable 810EndTable
792 811
793GrpTable: Grp13 812GrpTable: Grp13
7942: psrld Nq,Ib (11B) | psrld Udq,Ib (66),(11B) 8132: psrld Nq,Ib (11B) | psrld Udq,Ib (66),(11B),(VEX),(o128)
7954: psrad Nq,Ib (11B) | psrad Udq,Ib (66),(11B) 8144: psrad Nq,Ib (11B) | psrad Udq,Ib (66),(11B),(VEX),(o128)
7966: pslld Nq,Ib (11B) | pslld Udq,Ib (66),(11B) 8156: pslld Nq,Ib (11B) | pslld Udq,Ib (66),(11B),(VEX),(o128)
797EndTable 816EndTable
798 817
799GrpTable: Grp14 818GrpTable: Grp14
8002: psrlq Nq,Ib (11B) | psrlq Udq,Ib (66),(11B) 8192: psrlq Nq,Ib (11B) | psrlq Udq,Ib (66),(11B),(VEX),(o128)
8013: psrldq Udq,Ib (66),(11B) 8203: psrldq Udq,Ib (66),(11B),(VEX),(o128)
8026: psllq Nq,Ib (11B) | psllq Udq,Ib (66),(11B) 8216: psllq Nq,Ib (11B) | psllq Udq,Ib (66),(11B),(VEX),(o128)
8037: pslldq Udq,Ib (66),(11B) 8227: pslldq Udq,Ib (66),(11B),(VEX),(o128)
804EndTable 823EndTable
805 824
806GrpTable: Grp15 825GrpTable: Grp15
8070: fxsave 8260: fxsave
8081: fxstor 8271: fxstor
8092: ldmxcsr 8282: ldmxcsr (VEX)
8103: stmxcsr 8293: stmxcsr (VEX)
8114: XSAVE 8304: XSAVE
8125: XRSTOR | lfence (11B) 8315: XRSTOR | lfence (11B)
8136: mfence (11B) 8326: mfence (11B)
diff --git a/arch/x86/tools/gen-insn-attr-x86.awk b/arch/x86/tools/gen-insn-attr-x86.awk
index 7d5492951e22..e34e92a28eb6 100644
--- a/arch/x86/tools/gen-insn-attr-x86.awk
+++ b/arch/x86/tools/gen-insn-attr-x86.awk
@@ -13,6 +13,18 @@ function check_awk_implement() {
13 return "" 13 return ""
14} 14}
15 15
16# Clear working vars
17function clear_vars() {
18 delete table
19 delete lptable2
20 delete lptable1
21 delete lptable3
22 eid = -1 # escape id
23 gid = -1 # group id
24 aid = -1 # AVX id
25 tname = ""
26}
27
16BEGIN { 28BEGIN {
17 # Implementation error checking 29 # Implementation error checking
18 awkchecked = check_awk_implement() 30 awkchecked = check_awk_implement()
@@ -24,11 +36,15 @@ BEGIN {
24 36
25 # Setup generating tables 37 # Setup generating tables
26 print "/* x86 opcode map generated from x86-opcode-map.txt */" 38 print "/* x86 opcode map generated from x86-opcode-map.txt */"
27 print "/* Do not change this code. */" 39 print "/* Do not change this code. */\n"
28 ggid = 1 40 ggid = 1
29 geid = 1 41 geid = 1
42 gaid = 0
43 delete etable
44 delete gtable
45 delete atable
30 46
31 opnd_expr = "^[[:alpha:]]" 47 opnd_expr = "^[[:alpha:]/]"
32 ext_expr = "^\\(" 48 ext_expr = "^\\("
33 sep_expr = "^\\|$" 49 sep_expr = "^\\|$"
34 group_expr = "^Grp[[:alnum:]]+" 50 group_expr = "^Grp[[:alnum:]]+"
@@ -46,19 +62,19 @@ BEGIN {
46 imm_flag["Ob"] = "INAT_MOFFSET" 62 imm_flag["Ob"] = "INAT_MOFFSET"
47 imm_flag["Ov"] = "INAT_MOFFSET" 63 imm_flag["Ov"] = "INAT_MOFFSET"
48 64
49 modrm_expr = "^([CDEGMNPQRSUVW][[:lower:]]+|NTA|T[012])" 65 modrm_expr = "^([CDEGMNPQRSUVW/][[:lower:]]+|NTA|T[012])"
50 force64_expr = "\\([df]64\\)" 66 force64_expr = "\\([df]64\\)"
51 rex_expr = "^REX(\\.[XRWB]+)*" 67 rex_expr = "^REX(\\.[XRWB]+)*"
52 fpu_expr = "^ESC" # TODO 68 fpu_expr = "^ESC" # TODO
53 69
54 lprefix1_expr = "\\(66\\)" 70 lprefix1_expr = "\\(66\\)"
55 delete lptable1 71 lprefix2_expr = "\\(F3\\)"
56 lprefix2_expr = "\\(F2\\)" 72 lprefix3_expr = "\\(F2\\)"
57 delete lptable2
58 lprefix3_expr = "\\(F3\\)"
59 delete lptable3
60 max_lprefix = 4 73 max_lprefix = 4
61 74
75 vexok_expr = "\\(VEX\\)"
76 vexonly_expr = "\\(oVEX\\)"
77
62 prefix_expr = "\\(Prefix\\)" 78 prefix_expr = "\\(Prefix\\)"
63 prefix_num["Operand-Size"] = "INAT_PFX_OPNDSZ" 79 prefix_num["Operand-Size"] = "INAT_PFX_OPNDSZ"
64 prefix_num["REPNE"] = "INAT_PFX_REPNE" 80 prefix_num["REPNE"] = "INAT_PFX_REPNE"
@@ -71,12 +87,10 @@ BEGIN {
71 prefix_num["SEG=GS"] = "INAT_PFX_GS" 87 prefix_num["SEG=GS"] = "INAT_PFX_GS"
72 prefix_num["SEG=SS"] = "INAT_PFX_SS" 88 prefix_num["SEG=SS"] = "INAT_PFX_SS"
73 prefix_num["Address-Size"] = "INAT_PFX_ADDRSZ" 89 prefix_num["Address-Size"] = "INAT_PFX_ADDRSZ"
90 prefix_num["2bytes-VEX"] = "INAT_PFX_VEX2"
91 prefix_num["3bytes-VEX"] = "INAT_PFX_VEX3"
74 92
75 delete table 93 clear_vars()
76 delete etable
77 delete gtable
78 eid = -1
79 gid = -1
80} 94}
81 95
82function semantic_error(msg) { 96function semantic_error(msg) {
@@ -97,14 +111,12 @@ function array_size(arr, i,c) {
97 111
98/^Table:/ { 112/^Table:/ {
99 print "/* " $0 " */" 113 print "/* " $0 " */"
114 if (tname != "")
115 semantic_error("Hit Table: before EndTable:.");
100} 116}
101 117
102/^Referrer:/ { 118/^Referrer:/ {
103 if (NF == 1) { 119 if (NF != 1) {
104 # primary opcode table
105 tname = "inat_primary_table"
106 eid = -1
107 } else {
108 # escape opcode table 120 # escape opcode table
109 ref = "" 121 ref = ""
110 for (i = 2; i <= NF; i++) 122 for (i = 2; i <= NF; i++)
@@ -114,6 +126,19 @@ function array_size(arr, i,c) {
114 } 126 }
115} 127}
116 128
129/^AVXcode:/ {
130 if (NF != 1) {
131 # AVX/escape opcode table
132 aid = $2
133 if (gaid <= aid)
134 gaid = aid + 1
135 if (tname == "") # AVX only opcode table
136 tname = sprintf("inat_avx_table_%d", $2)
137 }
138 if (aid == -1 && eid == -1) # primary opcode table
139 tname = "inat_primary_table"
140}
141
117/^GrpTable:/ { 142/^GrpTable:/ {
118 print "/* " $0 " */" 143 print "/* " $0 " */"
119 if (!($2 in group)) 144 if (!($2 in group))
@@ -162,30 +187,33 @@ function print_table(tbl,name,fmt,n)
162 print_table(table, tname "[INAT_OPCODE_TABLE_SIZE]", 187 print_table(table, tname "[INAT_OPCODE_TABLE_SIZE]",
163 "0x%02x", 256) 188 "0x%02x", 256)
164 etable[eid,0] = tname 189 etable[eid,0] = tname
190 if (aid >= 0)
191 atable[aid,0] = tname
165 } 192 }
166 if (array_size(lptable1) != 0) { 193 if (array_size(lptable1) != 0) {
167 print_table(lptable1,tname "_1[INAT_OPCODE_TABLE_SIZE]", 194 print_table(lptable1,tname "_1[INAT_OPCODE_TABLE_SIZE]",
168 "0x%02x", 256) 195 "0x%02x", 256)
169 etable[eid,1] = tname "_1" 196 etable[eid,1] = tname "_1"
197 if (aid >= 0)
198 atable[aid,1] = tname "_1"
170 } 199 }
171 if (array_size(lptable2) != 0) { 200 if (array_size(lptable2) != 0) {
172 print_table(lptable2,tname "_2[INAT_OPCODE_TABLE_SIZE]", 201 print_table(lptable2,tname "_2[INAT_OPCODE_TABLE_SIZE]",
173 "0x%02x", 256) 202 "0x%02x", 256)
174 etable[eid,2] = tname "_2" 203 etable[eid,2] = tname "_2"
204 if (aid >= 0)
205 atable[aid,2] = tname "_2"
175 } 206 }
176 if (array_size(lptable3) != 0) { 207 if (array_size(lptable3) != 0) {
177 print_table(lptable3,tname "_3[INAT_OPCODE_TABLE_SIZE]", 208 print_table(lptable3,tname "_3[INAT_OPCODE_TABLE_SIZE]",
178 "0x%02x", 256) 209 "0x%02x", 256)
179 etable[eid,3] = tname "_3" 210 etable[eid,3] = tname "_3"
211 if (aid >= 0)
212 atable[aid,3] = tname "_3"
180 } 213 }
181 } 214 }
182 print "" 215 print ""
183 delete table 216 clear_vars()
184 delete lptable1
185 delete lptable2
186 delete lptable3
187 gid = -1
188 eid = -1
189} 217}
190 218
191function add_flags(old,new) { 219function add_flags(old,new) {
@@ -284,6 +312,14 @@ function convert_operands(opnd, i,imm,mod)
284 if (match(opcode, fpu_expr)) 312 if (match(opcode, fpu_expr))
285 flags = add_flags(flags, "INAT_MODRM") 313 flags = add_flags(flags, "INAT_MODRM")
286 314
315 # check VEX only code
316 if (match(ext, vexonly_expr))
317 flags = add_flags(flags, "INAT_VEXOK | INAT_VEXONLY")
318
319 # check VEX only code
320 if (match(ext, vexok_expr))
321 flags = add_flags(flags, "INAT_VEXOK")
322
287 # check prefixes 323 # check prefixes
288 if (match(ext, prefix_expr)) { 324 if (match(ext, prefix_expr)) {
289 if (!prefix_num[opcode]) 325 if (!prefix_num[opcode])
@@ -330,5 +366,15 @@ END {
330 for (j = 0; j < max_lprefix; j++) 366 for (j = 0; j < max_lprefix; j++)
331 if (gtable[i,j]) 367 if (gtable[i,j])
332 print " ["i"]["j"] = "gtable[i,j]"," 368 print " ["i"]["j"] = "gtable[i,j]","
369 print "};\n"
370 # print AVX opcode map's array
371 print "/* AVX opcode map array */"
372 print "const insn_attr_t const *inat_avx_tables[X86_VEX_M_MAX + 1]"\
373 "[INAT_LSTPFX_MAX + 1] = {"
374 for (i = 0; i < gaid; i++)
375 for (j = 0; j < max_lprefix; j++)
376 if (atable[i,j])
377 print " ["i"]["j"] = "atable[i,j]","
333 print "};" 378 print "};"
334} 379}
380