1 /****************************************************************************
3 * Realmode X86 Emulator Library
5 * Copyright (C) 1991-2004 SciTech Software, Inc.
6 * Copyright (C) David Mosberger-Tang
7 * Copyright (C) 1999 Egbert Eich
9 * ========================================================================
11 * Permission to use, copy, modify, distribute, and sell this software and
12 * its documentation for any purpose is hereby granted without fee,
13 * provided that the above copyright notice appear in all copies and that
14 * both that copyright notice and this permission notice appear in
15 * supporting documentation, and that the name of the authors not be used
16 * in advertising or publicity pertaining to distribution of the software
17 * without specific, written prior permission. The authors makes no
18 * representations about the suitability of this software for any purpose.
19 * It is provided "as is" without express or implied warranty.
21 * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
22 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
23 * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
24 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
25 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
26 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
27 * PERFORMANCE OF THIS SOFTWARE.
29 * ========================================================================
33 * Developer: Kendall Bennett
35 * Description: This file contains the code to implement the decoding and
36 * emulation of the FPU instructions.
38 ****************************************************************************/
42 /*----------------------------- Implementation ----------------------------*/
45 void x86emuOp_esc_coprocess_d8(u8
X86EMU_UNUSED(op1
))
48 DECODE_PRINTF("ESC D8\n");
49 DECODE_CLEAR_SEGOVR();
50 END_OF_INSTR_NO_TRACE();
53 #ifdef X86EMU_FPU_PRESENT
54 #define X86EMU_FPU_ONLY(x) x
56 #define X86EMU_FPU_ONLY(x) X86EMU_UNUSED(x)
61 static const char *x86emu_fpu_op_d9_tab
[] = {
62 "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
63 "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
65 "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
66 "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
68 "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
69 "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
72 static const char *x86emu_fpu_op_d9_tab1
[] = {
73 "FLD\t", "FLD\t", "FLD\t", "FLD\t",
74 "FLD\t", "FLD\t", "FLD\t", "FLD\t",
76 "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
77 "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
79 "FNOP", "ESC_D9", "ESC_D9", "ESC_D9",
80 "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9",
82 "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
83 "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
85 "FCHS", "FABS", "ESC_D9", "ESC_D9",
86 "FTST", "FXAM", "ESC_D9", "ESC_D9",
88 "FLD1", "FLDL2T", "FLDL2E", "FLDPI",
89 "FLDLG2", "FLDLN2", "FLDZ", "ESC_D9",
91 "F2XM1", "FYL2X", "FPTAN", "FPATAN",
92 "FXTRACT", "ESC_D9", "FDECSTP", "FINCSTP",
94 "FPREM", "FYL2XP1", "FSQRT", "ESC_D9",
95 "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9",
101 void x86emuOp_esc_coprocess_d9(u8
X86EMU_UNUSED(op1
))
104 uint
X86EMU_FPU_ONLY(destoffset
);
105 u8
X86EMU_FPU_ONLY(stkelem
);
108 FETCH_DECODE_MODRM(mod
, rh
, rl
);
111 DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab
, mod
, rh
, rl
);
113 DECODE_PRINTF(x86emu_fpu_op_d9_tab1
[(rh
<< 3) + rl
]);
118 destoffset
= decode_rm00_address(rl
);
122 destoffset
= decode_rm01_address(rl
);
126 destoffset
= decode_rm10_address(rl
);
129 case 3: /* register to register */
132 DECODE_PRINTF2("ST(%d)\n", stkelem
);
138 #ifdef X86EMU_FPU_PRESENT
144 x86emu_fpu_R_fld(X86EMU_FPU_STKTOP
, stkelem
);
147 x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP
, stkelem
);
155 x86emu_fpu_illegal();
159 x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP
, stkelem
);
164 x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP
);
167 x86emu_fpu_R_fabs(X86EMU_FPU_STKTOP
);
170 x86emu_fpu_R_ftst(X86EMU_FPU_STKTOP
);
173 x86emu_fpu_R_fxam(X86EMU_FPU_STKTOP
);
177 x86emu_fpu_illegal();
185 x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP
);
188 x86emu_fpu_R_fldl2t(X86EMU_FPU_STKTOP
);
191 x86emu_fpu_R_fldl2e(X86EMU_FPU_STKTOP
);
194 x86emu_fpu_R_fldpi(X86EMU_FPU_STKTOP
);
197 x86emu_fpu_R_fldlg2(X86EMU_FPU_STKTOP
);
200 x86emu_fpu_R_fldln2(X86EMU_FPU_STKTOP
);
203 x86emu_fpu_R_fldz(X86EMU_FPU_STKTOP
);
207 x86emu_fpu_illegal();
215 x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP
);
218 x86emu_fpu_R_fyl2x(X86EMU_FPU_STKTOP
);
221 x86emu_fpu_R_fptan(X86EMU_FPU_STKTOP
);
224 x86emu_fpu_R_fpatan(X86EMU_FPU_STKTOP
);
227 x86emu_fpu_R_fxtract(X86EMU_FPU_STKTOP
);
230 x86emu_fpu_illegal();
233 x86emu_fpu_R_decstp();
236 x86emu_fpu_R_incstp();
244 x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP
);
247 x86emu_fpu_R_fyl2xp1(X86EMU_FPU_STKTOP
);
250 x86emu_fpu_R_fsqrt(X86EMU_FPU_STKTOP
);
253 x86emu_fpu_illegal();
256 x86emu_fpu_R_frndint(X86EMU_FPU_STKTOP
);
259 x86emu_fpu_R_fscale(X86EMU_FPU_STKTOP
);
264 x86emu_fpu_illegal();
272 x86emu_fpu_M_fld(X86EMU_FPU_FLOAT
, destoffset
);
275 x86emu_fpu_illegal();
278 x86emu_fpu_M_fst(X86EMU_FPU_FLOAT
, destoffset
);
281 x86emu_fpu_M_fstp(X86EMU_FPU_FLOAT
, destoffset
);
284 x86emu_fpu_M_fldenv(X86EMU_FPU_WORD
, destoffset
);
287 x86emu_fpu_M_fldcw(X86EMU_FPU_WORD
, destoffset
);
290 x86emu_fpu_M_fstenv(X86EMU_FPU_WORD
, destoffset
);
293 x86emu_fpu_M_fstcw(X86EMU_FPU_WORD
, destoffset
);
298 #endif /* X86EMU_FPU_PRESENT */
299 DECODE_CLEAR_SEGOVR();
300 END_OF_INSTR_NO_TRACE();
305 static const char *x86emu_fpu_op_da_tab
[] = {
306 "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
307 "FICOMP\tDWORD PTR ",
308 "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
309 "FIDIVR\tDWORD PTR ",
311 "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
312 "FICOMP\tDWORD PTR ",
313 "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
314 "FIDIVR\tDWORD PTR ",
316 "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
317 "FICOMP\tDWORD PTR ",
318 "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
319 "FIDIVR\tDWORD PTR ",
321 "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
322 "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
328 void x86emuOp_esc_coprocess_da(u8
X86EMU_UNUSED(op1
))
331 uint
X86EMU_FPU_ONLY(destoffset
);
332 u8
X86EMU_FPU_ONLY(stkelem
);
335 FETCH_DECODE_MODRM(mod
, rh
, rl
);
336 DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab
, mod
, rh
, rl
);
339 destoffset
= decode_rm00_address(rl
);
343 destoffset
= decode_rm01_address(rl
);
347 destoffset
= decode_rm10_address(rl
);
350 case 3: /* register to register */
352 DECODE_PRINTF2("\tST(%d),ST\n", stkelem
);
355 #ifdef X86EMU_FPU_PRESENT
358 x86emu_fpu_illegal();
363 x86emu_fpu_M_iadd(X86EMU_FPU_SHORT
, destoffset
);
366 x86emu_fpu_M_imul(X86EMU_FPU_SHORT
, destoffset
);
369 x86emu_fpu_M_icom(X86EMU_FPU_SHORT
, destoffset
);
372 x86emu_fpu_M_icomp(X86EMU_FPU_SHORT
, destoffset
);
375 x86emu_fpu_M_isub(X86EMU_FPU_SHORT
, destoffset
);
378 x86emu_fpu_M_isubr(X86EMU_FPU_SHORT
, destoffset
);
381 x86emu_fpu_M_idiv(X86EMU_FPU_SHORT
, destoffset
);
384 x86emu_fpu_M_idivr(X86EMU_FPU_SHORT
, destoffset
);
389 DECODE_CLEAR_SEGOVR();
390 END_OF_INSTR_NO_TRACE();
395 static const char *x86emu_fpu_op_db_tab
[] = {
396 "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
397 "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
399 "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
400 "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
402 "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
403 "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
409 void x86emuOp_esc_coprocess_db(u8
X86EMU_UNUSED(op1
))
412 uint
X86EMU_FPU_ONLY(destoffset
);
415 FETCH_DECODE_MODRM(mod
, rh
, rl
);
418 DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab
, mod
, rh
, rl
);
419 } else if (rh
== 4) { /* === 11 10 0 nnn */
422 DECODE_PRINTF("FENI\n");
425 DECODE_PRINTF("FDISI\n");
428 DECODE_PRINTF("FCLEX\n");
431 DECODE_PRINTF("FINIT\n");
435 DECODE_PRINTF2("ESC_DB %0x\n", (mod
<< 6) + (rh
<< 3) + (rl
));
440 destoffset
= decode_rm00_address(rl
);
443 destoffset
= decode_rm01_address(rl
);
446 destoffset
= decode_rm10_address(rl
);
448 case 3: /* register to register */
451 #ifdef X86EMU_FPU_PRESENT
462 x86emu_fpu_R_fdisi();
465 x86emu_fpu_R_fclex();
468 x86emu_fpu_R_finit();
471 x86emu_fpu_illegal();
476 x86emu_fpu_illegal();
483 x86emu_fpu_M_fild(X86EMU_FPU_SHORT
, destoffset
);
486 x86emu_fpu_illegal();
489 x86emu_fpu_M_fist(X86EMU_FPU_SHORT
, destoffset
);
492 x86emu_fpu_M_fistp(X86EMU_FPU_SHORT
, destoffset
);
495 x86emu_fpu_illegal();
498 x86emu_fpu_M_fld(X86EMU_FPU_LDBL
, destoffset
);
501 x86emu_fpu_illegal();
504 x86emu_fpu_M_fstp(X86EMU_FPU_LDBL
, destoffset
);
509 DECODE_CLEAR_SEGOVR();
510 END_OF_INSTR_NO_TRACE();
514 static const char *x86emu_fpu_op_dc_tab
[] = {
515 "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
517 "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
520 "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
522 "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
525 "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
527 "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
530 "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t",
531 "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t",
536 void x86emuOp_esc_coprocess_dc(u8
X86EMU_UNUSED(op1
))
539 uint
X86EMU_FPU_ONLY(destoffset
);
540 u8
X86EMU_FPU_ONLY(stkelem
);
543 FETCH_DECODE_MODRM(mod
, rh
, rl
);
544 DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab
, mod
, rh
, rl
);
547 destoffset
= decode_rm00_address(rl
);
551 destoffset
= decode_rm01_address(rl
);
555 destoffset
= decode_rm10_address(rl
);
558 case 3: /* register to register */
560 DECODE_PRINTF2("\tST(%d),ST\n", stkelem
);
563 #ifdef X86EMU_FPU_PRESENT
569 x86emu_fpu_R_fadd(stkelem
, X86EMU_FPU_STKTOP
);
572 x86emu_fpu_R_fmul(stkelem
, X86EMU_FPU_STKTOP
);
575 x86emu_fpu_R_fcom(stkelem
, X86EMU_FPU_STKTOP
);
578 x86emu_fpu_R_fcomp(stkelem
, X86EMU_FPU_STKTOP
);
581 x86emu_fpu_R_fsubr(stkelem
, X86EMU_FPU_STKTOP
);
584 x86emu_fpu_R_fsub(stkelem
, X86EMU_FPU_STKTOP
);
587 x86emu_fpu_R_fdivr(stkelem
, X86EMU_FPU_STKTOP
);
590 x86emu_fpu_R_fdiv(stkelem
, X86EMU_FPU_STKTOP
);
597 x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE
, destoffset
);
600 x86emu_fpu_M_fmul(X86EMU_FPU_DOUBLE
, destoffset
);
603 x86emu_fpu_M_fcom(X86EMU_FPU_DOUBLE
, destoffset
);
606 x86emu_fpu_M_fcomp(X86EMU_FPU_DOUBLE
, destoffset
);
609 x86emu_fpu_M_fsub(X86EMU_FPU_DOUBLE
, destoffset
);
612 x86emu_fpu_M_fsubr(X86EMU_FPU_DOUBLE
, destoffset
);
615 x86emu_fpu_M_fdiv(X86EMU_FPU_DOUBLE
, destoffset
);
618 x86emu_fpu_M_fdivr(X86EMU_FPU_DOUBLE
, destoffset
);
623 DECODE_CLEAR_SEGOVR();
624 END_OF_INSTR_NO_TRACE();
629 static const char *x86emu_fpu_op_dd_tab
[] = {
630 "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
631 "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
633 "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
634 "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
636 "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
637 "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
639 "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
640 "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,",
646 void x86emuOp_esc_coprocess_dd(u8
X86EMU_UNUSED(op1
))
649 uint
X86EMU_FPU_ONLY(destoffset
);
650 u8
X86EMU_FPU_ONLY(stkelem
);
653 FETCH_DECODE_MODRM(mod
, rh
, rl
);
654 DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab
, mod
, rh
, rl
);
657 destoffset
= decode_rm00_address(rl
);
661 destoffset
= decode_rm01_address(rl
);
665 destoffset
= decode_rm10_address(rl
);
668 case 3: /* register to register */
670 DECODE_PRINTF2("\tST(%d),ST\n", stkelem
);
673 #ifdef X86EMU_FPU_PRESENT
678 x86emu_fpu_R_ffree(stkelem
);
681 x86emu_fpu_R_fxch(stkelem
);
684 x86emu_fpu_R_fst(stkelem
); /* register version */
687 x86emu_fpu_R_fstp(stkelem
); /* register version */
690 x86emu_fpu_illegal();
697 x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE
, destoffset
);
700 x86emu_fpu_illegal();
703 x86emu_fpu_M_fst(X86EMU_FPU_DOUBLE
, destoffset
);
706 x86emu_fpu_M_fstp(X86EMU_FPU_DOUBLE
, destoffset
);
709 x86emu_fpu_M_frstor(X86EMU_FPU_WORD
, destoffset
);
712 x86emu_fpu_illegal();
715 x86emu_fpu_M_fsave(X86EMU_FPU_WORD
, destoffset
);
718 x86emu_fpu_M_fstsw(X86EMU_FPU_WORD
, destoffset
);
723 DECODE_CLEAR_SEGOVR();
724 END_OF_INSTR_NO_TRACE();
729 static const char *x86emu_fpu_op_de_tab
[] =
731 "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
733 "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
736 "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
738 "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
741 "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
743 "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
746 "FADDP\t", "FMULP\t", "FCOMP\t", "FCOMPP\t",
747 "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t",
753 void x86emuOp_esc_coprocess_de(u8
X86EMU_UNUSED(op1
))
756 uint
X86EMU_FPU_ONLY(destoffset
);
757 u8
X86EMU_FPU_ONLY(stkelem
);
760 FETCH_DECODE_MODRM(mod
, rh
, rl
);
761 DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab
, mod
, rh
, rl
);
764 destoffset
= decode_rm00_address(rl
);
768 destoffset
= decode_rm01_address(rl
);
772 destoffset
= decode_rm10_address(rl
);
775 case 3: /* register to register */
777 DECODE_PRINTF2("\tST(%d),ST\n", stkelem
);
780 #ifdef X86EMU_FPU_PRESENT
785 x86emu_fpu_R_faddp(stkelem
, X86EMU_FPU_STKTOP
);
788 x86emu_fpu_R_fmulp(stkelem
, X86EMU_FPU_STKTOP
);
791 x86emu_fpu_R_fcomp(stkelem
, X86EMU_FPU_STKTOP
);
795 x86emu_fpu_R_fcompp(stkelem
, X86EMU_FPU_STKTOP
);
797 x86emu_fpu_illegal();
800 x86emu_fpu_R_fsubrp(stkelem
, X86EMU_FPU_STKTOP
);
803 x86emu_fpu_R_fsubp(stkelem
, X86EMU_FPU_STKTOP
);
806 x86emu_fpu_R_fdivrp(stkelem
, X86EMU_FPU_STKTOP
);
809 x86emu_fpu_R_fdivp(stkelem
, X86EMU_FPU_STKTOP
);
816 x86emu_fpu_M_fiadd(X86EMU_FPU_WORD
, destoffset
);
819 x86emu_fpu_M_fimul(X86EMU_FPU_WORD
, destoffset
);
822 x86emu_fpu_M_ficom(X86EMU_FPU_WORD
, destoffset
);
825 x86emu_fpu_M_ficomp(X86EMU_FPU_WORD
, destoffset
);
828 x86emu_fpu_M_fisub(X86EMU_FPU_WORD
, destoffset
);
831 x86emu_fpu_M_fisubr(X86EMU_FPU_WORD
, destoffset
);
834 x86emu_fpu_M_fidiv(X86EMU_FPU_WORD
, destoffset
);
837 x86emu_fpu_M_fidivr(X86EMU_FPU_WORD
, destoffset
);
842 DECODE_CLEAR_SEGOVR();
843 END_OF_INSTR_NO_TRACE();
848 static const char *x86emu_fpu_op_df_tab
[] = {
850 "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
851 "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
855 "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
856 "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
860 "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
861 "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
865 "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
866 "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F,"
872 void x86emuOp_esc_coprocess_df(u8
X86EMU_UNUSED(op1
))
875 uint
X86EMU_FPU_ONLY(destoffset
);
876 u8
X86EMU_FPU_ONLY(stkelem
);
879 FETCH_DECODE_MODRM(mod
, rh
, rl
);
880 DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab
, mod
, rh
, rl
);
883 destoffset
= decode_rm00_address(rl
);
887 destoffset
= decode_rm01_address(rl
);
891 destoffset
= decode_rm10_address(rl
);
894 case 3: /* register to register */
896 DECODE_PRINTF2("\tST(%d)\n", stkelem
);
899 #ifdef X86EMU_FPU_PRESENT
904 x86emu_fpu_R_ffree(stkelem
);
907 x86emu_fpu_R_fxch(stkelem
);
910 x86emu_fpu_R_fst(stkelem
); /* register version */
913 x86emu_fpu_R_fstp(stkelem
); /* register version */
916 x86emu_fpu_illegal();
923 x86emu_fpu_M_fild(X86EMU_FPU_WORD
, destoffset
);
926 x86emu_fpu_illegal();
929 x86emu_fpu_M_fist(X86EMU_FPU_WORD
, destoffset
);
932 x86emu_fpu_M_fistp(X86EMU_FPU_WORD
, destoffset
);
935 x86emu_fpu_M_fbld(X86EMU_FPU_BSD
, destoffset
);
938 x86emu_fpu_M_fild(X86EMU_FPU_LONG
, destoffset
);
941 x86emu_fpu_M_fbstp(X86EMU_FPU_BSD
, destoffset
);
944 x86emu_fpu_M_fistp(X86EMU_FPU_LONG
, destoffset
);
949 DECODE_CLEAR_SEGOVR();
950 END_OF_INSTR_NO_TRACE();