x87.isa (10043:301f2c0b3423) x87.isa (10044:42e058cae3d0)
1// Copyright (c) 2007 The Hewlett-Packard Development Company
2// Copyright (c) 2012-13 Mark D. Hill and David A. Wood
3// All rights reserved.
4//
5// The license below extends only to copyright in the software and shall
6// not be construed as granting a license to any other intellectual
7// property including but not limited to intellectual property relating
8// to a hardware implementation of the functionality of the software
9// licensed hereunder. You may use the software subject to the license
10// terms below provided that you ensure that this notice is replicated
11// unmodified and in its entirety in all distributions of the software,
12// modified or unmodified, in source code or in binary form.
13//
14// Redistribution and use in source and binary forms, with or without
15// modification, are permitted provided that the following conditions are
16// met: redistributions of source code must retain the above copyright
17// notice, this list of conditions and the following disclaimer;
18// redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution;
21// neither the name of the copyright holders nor the names of its
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Authors: Gabe Black
38// Nilay Vaish
39
40format WarnUnimpl {
41 0x1B: decode OPCODE_OP_BOTTOM3 {
1// Copyright (c) 2007 The Hewlett-Packard Development Company
2// Copyright (c) 2012-13 Mark D. Hill and David A. Wood
3// All rights reserved.
4//
5// The license below extends only to copyright in the software and shall
6// not be construed as granting a license to any other intellectual
7// property including but not limited to intellectual property relating
8// to a hardware implementation of the functionality of the software
9// licensed hereunder. You may use the software subject to the license
10// terms below provided that you ensure that this notice is replicated
11// unmodified and in its entirety in all distributions of the software,
12// modified or unmodified, in source code or in binary form.
13//
14// Redistribution and use in source and binary forms, with or without
15// modification, are permitted provided that the following conditions are
16// met: redistributions of source code must retain the above copyright
17// notice, this list of conditions and the following disclaimer;
18// redistributions in binary form must reproduce the above copyright
19// notice, this list of conditions and the following disclaimer in the
20// documentation and/or other materials provided with the distribution;
21// neither the name of the copyright holders nor the names of its
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Authors: Gabe Black
38// Nilay Vaish
39
40format WarnUnimpl {
41 0x1B: decode OPCODE_OP_BOTTOM3 {
42 //0x0: esc0();
43 0x0: decode MODRM_REG {
42 0x0: decode MODRM_REG {
44 // ST(0) = ST(0) + 32-bit Mem
45 0x0: fadd();
43 0x0: decode MODRM_MOD {
44 0x3: Inst::FADD1(Eq);
45 // 32-bit memory operand
46 default: Inst::FADD1(Md);
47 }
46 0x1: fmul();
47 0x2: fcom();
48 0x3: fcomp();
48 0x1: fmul();
49 0x2: fcom();
50 0x3: fcomp();
49 0x4: fsub();
51 0x4: decode MODRM_MOD {
52 0x3: Inst::FSUB1(Eq);
53 default: Inst::FSUB1(Md);
54 }
50 0x5: fsubr();
51 0x6: fdiv();
52 0x7: fdivr();
53 }
55 0x5: fsubr();
56 0x6: fdiv();
57 0x7: fdivr();
58 }
54 //0x1: esc1();
55 0x1: decode MODRM_REG {
56 0x0: decode MODRM_MOD {
57 0x3: Inst::FLD(Eq);
58 // 32-bit load
59 default: Inst::FLD(Md);
60 }
61 0x1: decode MODRM_MOD {
62 0x3: Inst::FXCH(Eq);
63 default: Inst::UD2();
64 }
65 0x2: decode MODRM_MOD {
66 0x3: decode MODRM_RM {
67 0x0: fnop();
68 default: Inst::UD2();
69 }
70 default: Inst::FST(Ed);
71 }
72 0x3: decode MODRM_MOD {
73 0x3: Inst::UD2();
74 default: Inst::FSTP(Ed);
75 }
76 0x4: decode MODRM_MOD {
77 0x3: decode MODRM_RM {
78 0x0: Inst::FCHS();
79 0x1: Inst::FABS();
80 0x4: ftst();
81 0x5: fxam();
82 default: Inst::UD2();
83 }
84 default: Inst::FLDENV(M);
85 }
86 0x5: decode MODRM_MOD {
87 0x3: decode MODRM_RM {
88 0x0: Inst::FLD1();
89 0x1: Inst::FLDL2T();
90 0x2: Inst::FLDL2E();
91 0x3: Inst::FLDPI();
92 0x4: Inst::FLDLG2();
93 0x5: Inst::FLDLN2();
94 0x6: Inst::FLDZ();
95 }
96 default: Inst::FLDCW(Mw);
97 }
98 0x6: decode MODRM_MOD {
99 0x3: decode MODRM_RM {
100 0x0: f2xm1();
101 0x1: Inst::FYL2X();
102 0x2: Inst::FPTAN();
103 0x3: fpatan();
104 0x4: fxtract();
105 0x5: Inst::FPREM1();
106 0x6: fdecstp();
107 0x7: fincstp();
108 }
109 default: Inst::FNSTENV(M);
110 }
111 0x7: decode MODRM_MOD {
112 0x3: decode MODRM_RM {
113 0x0: Inst::FPREM();
114 0x1: fyl2xp1();
115 0x2: fsqrt();
116 0x3: Inst::FSINCOS();
117 0x4: frndint();
118 0x5: fscale();
119 0x6: Inst::FSIN();
120 0x7: Inst::FCOS();
121 }
122 default: Inst::FNSTCW(Mw);
123 }
124 }
125 //0x2: esc2();
126 0x2: decode MODRM_REG {
127 0x0: decode MODRM_MOD {
128 0x3: fcmovb();
129 default: fiadd();
130 }
131 0x1: decode MODRM_MOD {
132 0x3: fcmove();
133 default: fimul();
134 }
135 0x2: decode MODRM_MOD {
136 0x3: fcmovbe();
137 default: ficom();
138 }
139 0x3: decode MODRM_MOD {
140 0x3: fcmovu();
141 default: ficomp();
142 }
143 0x4: decode MODRM_MOD {
144 0x3: Inst::UD2();
145 default: fisub();
146 }
147 0x5: decode MODRM_MOD {
148 0x3: decode MODRM_RM {
149 0x1: fucompp();
150 default: Inst::UD2();
151 }
152 default: fisubr();
153 }
154 0x6: decode MODRM_MOD {
155 0x3: Inst::UD2();
156 default: fidiv();
157 }
158 0x7: decode MODRM_MOD {
159 0x3: Inst::UD2();
160 default: fidivr();
161 }
162 }
163 //0x3: esc3();
164 0x3: decode MODRM_REG {
165 0x0: decode MODRM_MOD {
166 0x3: fcmovnb();
167 default: fild();
168 }
169 0x1: decode MODRM_MOD {
170 0x3: fcmovne();
171 default: fisttp();
172 }
173 0x2: decode MODRM_MOD {
174 0x3: fcmovnbe();
175 default: fist();
176 }
177 0x3: decode MODRM_MOD {
178 0x3: fcmovnu();
179 default: fistp();
180 }
181 0x4: decode MODRM_MOD {
182 0x3: decode MODRM_RM {
183 0x2: fnclex();
184 0x3: fninit();
185 default: Inst::UD2();
186 }
187 default: Inst::UD2();
188 }
189 0x5: decode MODRM_MOD {
190 0x3: fucomi();
191 // 80-bit load
192 default: Inst::FLD80(M);
193 }
194 0x6: decode MODRM_MOD {
195 0x3: fcomi();
196 default: Inst::UD2();
197 }
198 0x7: decode MODRM_MOD {
199 0x3: Inst::UD2();
200 default: Inst::FST80P(M);
201 }
202 }
203 //0x4: esc4();
204 0x4: decode MODRM_REG {
59 0x1: decode MODRM_REG {
60 0x0: decode MODRM_MOD {
61 0x3: Inst::FLD(Eq);
62 // 32-bit load
63 default: Inst::FLD(Md);
64 }
65 0x1: decode MODRM_MOD {
66 0x3: Inst::FXCH(Eq);
67 default: Inst::UD2();
68 }
69 0x2: decode MODRM_MOD {
70 0x3: decode MODRM_RM {
71 0x0: fnop();
72 default: Inst::UD2();
73 }
74 default: Inst::FST(Ed);
75 }
76 0x3: decode MODRM_MOD {
77 0x3: Inst::UD2();
78 default: Inst::FSTP(Ed);
79 }
80 0x4: decode MODRM_MOD {
81 0x3: decode MODRM_RM {
82 0x0: Inst::FCHS();
83 0x1: Inst::FABS();
84 0x4: ftst();
85 0x5: fxam();
86 default: Inst::UD2();
87 }
88 default: Inst::FLDENV(M);
89 }
90 0x5: decode MODRM_MOD {
91 0x3: decode MODRM_RM {
92 0x0: Inst::FLD1();
93 0x1: Inst::FLDL2T();
94 0x2: Inst::FLDL2E();
95 0x3: Inst::FLDPI();
96 0x4: Inst::FLDLG2();
97 0x5: Inst::FLDLN2();
98 0x6: Inst::FLDZ();
99 }
100 default: Inst::FLDCW(Mw);
101 }
102 0x6: decode MODRM_MOD {
103 0x3: decode MODRM_RM {
104 0x0: f2xm1();
105 0x1: Inst::FYL2X();
106 0x2: Inst::FPTAN();
107 0x3: fpatan();
108 0x4: fxtract();
109 0x5: Inst::FPREM1();
110 0x6: fdecstp();
111 0x7: fincstp();
112 }
113 default: Inst::FNSTENV(M);
114 }
115 0x7: decode MODRM_MOD {
116 0x3: decode MODRM_RM {
117 0x0: Inst::FPREM();
118 0x1: fyl2xp1();
119 0x2: fsqrt();
120 0x3: Inst::FSINCOS();
121 0x4: frndint();
122 0x5: fscale();
123 0x6: Inst::FSIN();
124 0x7: Inst::FCOS();
125 }
126 default: Inst::FNSTCW(Mw);
127 }
128 }
129 //0x2: esc2();
130 0x2: decode MODRM_REG {
131 0x0: decode MODRM_MOD {
132 0x3: fcmovb();
133 default: fiadd();
134 }
135 0x1: decode MODRM_MOD {
136 0x3: fcmove();
137 default: fimul();
138 }
139 0x2: decode MODRM_MOD {
140 0x3: fcmovbe();
141 default: ficom();
142 }
143 0x3: decode MODRM_MOD {
144 0x3: fcmovu();
145 default: ficomp();
146 }
147 0x4: decode MODRM_MOD {
148 0x3: Inst::UD2();
149 default: fisub();
150 }
151 0x5: decode MODRM_MOD {
152 0x3: decode MODRM_RM {
153 0x1: fucompp();
154 default: Inst::UD2();
155 }
156 default: fisubr();
157 }
158 0x6: decode MODRM_MOD {
159 0x3: Inst::UD2();
160 default: fidiv();
161 }
162 0x7: decode MODRM_MOD {
163 0x3: Inst::UD2();
164 default: fidivr();
165 }
166 }
167 //0x3: esc3();
168 0x3: decode MODRM_REG {
169 0x0: decode MODRM_MOD {
170 0x3: fcmovnb();
171 default: fild();
172 }
173 0x1: decode MODRM_MOD {
174 0x3: fcmovne();
175 default: fisttp();
176 }
177 0x2: decode MODRM_MOD {
178 0x3: fcmovnbe();
179 default: fist();
180 }
181 0x3: decode MODRM_MOD {
182 0x3: fcmovnu();
183 default: fistp();
184 }
185 0x4: decode MODRM_MOD {
186 0x3: decode MODRM_RM {
187 0x2: fnclex();
188 0x3: fninit();
189 default: Inst::UD2();
190 }
191 default: Inst::UD2();
192 }
193 0x5: decode MODRM_MOD {
194 0x3: fucomi();
195 // 80-bit load
196 default: Inst::FLD80(M);
197 }
198 0x6: decode MODRM_MOD {
199 0x3: fcomi();
200 default: Inst::UD2();
201 }
202 0x7: decode MODRM_MOD {
203 0x3: Inst::UD2();
204 default: Inst::FST80P(M);
205 }
206 }
207 //0x4: esc4();
208 0x4: decode MODRM_REG {
205 0x0: fadd();
209 0x0: decode MODRM_MOD {
210 0x3: Inst::FADD2(Eq);
211 default: Inst::FADD2(Mq);
212 }
206 0x1: fmul();
207 0x2: decode MODRM_MOD {
208 0x3: Inst::UD2();
209 default: fcom();
210 }
211 0x3: decode MODRM_MOD {
212 0x3: Inst::UD2();
213 default: fcomp();
214 }
215 0x4: decode MODRM_MOD {
216 0x3: fsubr();
213 0x1: fmul();
214 0x2: decode MODRM_MOD {
215 0x3: Inst::UD2();
216 default: fcom();
217 }
218 0x3: decode MODRM_MOD {
219 0x3: Inst::UD2();
220 default: fcomp();
221 }
222 0x4: decode MODRM_MOD {
223 0x3: fsubr();
217 default: fsub();
224 default: Inst::FSUB2(Mq);
218 }
219 0x5: decode MODRM_MOD {
225 }
226 0x5: decode MODRM_MOD {
220 0x3: fsub();
227 0x3: Inst::FSUB2(Eq);
221 default: fsubr();
222 }
223 0x6: decode MODRM_MOD {
224 0x3: fdivr();
225 default: fdiv();
226 }
227 0x7: decode MODRM_MOD {
228 0x3: fdiv();
229 default: fdivr();
230 }
231 }
232 //0x5: esc5();
233 0x5: decode MODRM_REG {
234 0x0: decode MODRM_MOD {
235 0x3: ffree();
236 // 64-bit load
237 default: Inst::FLD(Mq);
238 }
239 0x1: decode MODRM_MOD {
240 0x3: Inst::UD2();
241 default: fisttp();
242 }
243 0x2: decode MODRM_MOD {
244 0x3: Inst::FST(Eq);
245 default: Inst::FST(Mq);
246 }
247 0x3: decode MODRM_MOD {
248 0x3: Inst::FSTP(Eq);
249 default: Inst::FSTP(Mq);
250 }
251 0x4: decode MODRM_MOD {
252 0x3: fucom();
253 default: frstor();
254 }
255 0x5: decode MODRM_MOD {
256 0x3: fucomp();
257 default: Inst::UD2();
258 }
259 0x6: decode MODRM_MOD {
260 0x3: Inst::UD2();
261 default: fnsave();
262 }
263 0x7: decode MODRM_MOD {
264 0x3: Inst::UD2();
265 default: Inst::FNSTSW(Mw);
266 }
267 }
268 //0x6: esc6();
269 0x6: decode MODRM_REG {
270 0x0: decode MODRM_MOD {
228 default: fsubr();
229 }
230 0x6: decode MODRM_MOD {
231 0x3: fdivr();
232 default: fdiv();
233 }
234 0x7: decode MODRM_MOD {
235 0x3: fdiv();
236 default: fdivr();
237 }
238 }
239 //0x5: esc5();
240 0x5: decode MODRM_REG {
241 0x0: decode MODRM_MOD {
242 0x3: ffree();
243 // 64-bit load
244 default: Inst::FLD(Mq);
245 }
246 0x1: decode MODRM_MOD {
247 0x3: Inst::UD2();
248 default: fisttp();
249 }
250 0x2: decode MODRM_MOD {
251 0x3: Inst::FST(Eq);
252 default: Inst::FST(Mq);
253 }
254 0x3: decode MODRM_MOD {
255 0x3: Inst::FSTP(Eq);
256 default: Inst::FSTP(Mq);
257 }
258 0x4: decode MODRM_MOD {
259 0x3: fucom();
260 default: frstor();
261 }
262 0x5: decode MODRM_MOD {
263 0x3: fucomp();
264 default: Inst::UD2();
265 }
266 0x6: decode MODRM_MOD {
267 0x3: Inst::UD2();
268 default: fnsave();
269 }
270 0x7: decode MODRM_MOD {
271 0x3: Inst::UD2();
272 default: Inst::FNSTSW(Mw);
273 }
274 }
275 //0x6: esc6();
276 0x6: decode MODRM_REG {
277 0x0: decode MODRM_MOD {
271 0x3: faddp();
278 0x3: decode MODRM_RM {
279 0x1: Inst::FADDP();
280 default: Inst::FADDP(Eq);
281 }
272 default: fiadd();
273 }
274 0x1: decode MODRM_MOD {
275 0x3: fmulp();
276 default: fimul();
277 }
278 0x2: decode MODRM_MOD {
279 0x3: Inst::UD2();
280 default: ficom();
281 }
282 0x3: decode MODRM_MOD {
283 0x3: decode MODRM_RM {
284 0x1: fcompp();
285 default: Inst::UD2();
286 }
287 default: ficomp();
288 }
289 0x4: decode MODRM_MOD {
290 0x3: fsubrp();
291 default: fisub();
292 }
293 0x5: decode MODRM_MOD {
282 default: fiadd();
283 }
284 0x1: decode MODRM_MOD {
285 0x3: fmulp();
286 default: fimul();
287 }
288 0x2: decode MODRM_MOD {
289 0x3: Inst::UD2();
290 default: ficom();
291 }
292 0x3: decode MODRM_MOD {
293 0x3: decode MODRM_RM {
294 0x1: fcompp();
295 default: Inst::UD2();
296 }
297 default: ficomp();
298 }
299 0x4: decode MODRM_MOD {
300 0x3: fsubrp();
301 default: fisub();
302 }
303 0x5: decode MODRM_MOD {
294 0x3: fsubp();
304 0x3: decode MODRM_RM {
305 0x1: Inst::FSUBP();
306 default: Inst::FSUBP(Eq);
307 }
295 default: fisubr();
296 }
297 0x6: decode MODRM_MOD {
298 0x3: fdivrp();
299 default: fidiv();
300 }
301 0x7: decode MODRM_MOD {
302 0x3: fdivp();
303 default: fidivr();
304 }
305 }
306 //0x7: esc7();
307 0x7: decode MODRM_REG {
308 0x0: decode MODRM_MOD {
309 // The ffreep instruction isn't entirely real. It should work
310 // the same as ffree but then also pop the register stack.
311 0x3: ffreep();
312 default: fild();
313 }
314 0x1: decode MODRM_MOD {
315 0x3: Inst::UD2();
316 default: fisttp();
317 }
318 0x2: decode MODRM_MOD {
319 0x3: Inst::UD2();
320 default: fist();
321 }
322 0x3: decode MODRM_MOD {
323 0x3: Inst::UD2();
324 default: fistp();
325 }
326 0x4: decode MODRM_MOD {
327 0x3: decode MODRM_RM {
328 0x0: Inst::FNSTSW(rAw);
329 default: Inst::UD2();
330 }
331 default: fbld();
332 }
333 0x5: decode MODRM_MOD {
334 0x3: fucomip();
335 default: fild();
336 }
337 0x6: decode MODRM_MOD {
338 0x3: fcomip();
339 default: fbstp();
340 }
341 0x7: decode MODRM_MOD {
342 0x3: Inst::UD2();
343 default: fistp();
344 }
345 }
346 }
347}
308 default: fisubr();
309 }
310 0x6: decode MODRM_MOD {
311 0x3: fdivrp();
312 default: fidiv();
313 }
314 0x7: decode MODRM_MOD {
315 0x3: fdivp();
316 default: fidivr();
317 }
318 }
319 //0x7: esc7();
320 0x7: decode MODRM_REG {
321 0x0: decode MODRM_MOD {
322 // The ffreep instruction isn't entirely real. It should work
323 // the same as ffree but then also pop the register stack.
324 0x3: ffreep();
325 default: fild();
326 }
327 0x1: decode MODRM_MOD {
328 0x3: Inst::UD2();
329 default: fisttp();
330 }
331 0x2: decode MODRM_MOD {
332 0x3: Inst::UD2();
333 default: fist();
334 }
335 0x3: decode MODRM_MOD {
336 0x3: Inst::UD2();
337 default: fistp();
338 }
339 0x4: decode MODRM_MOD {
340 0x3: decode MODRM_RM {
341 0x0: Inst::FNSTSW(rAw);
342 default: Inst::UD2();
343 }
344 default: fbld();
345 }
346 0x5: decode MODRM_MOD {
347 0x3: fucomip();
348 default: fild();
349 }
350 0x6: decode MODRM_MOD {
351 0x3: fcomip();
352 default: fbstp();
353 }
354 0x7: decode MODRM_MOD {
355 0x3: Inst::UD2();
356 default: fistp();
357 }
358 }
359 }
360}