1 /****************************************************************************
3 * Realmode X86 Emulator Library
5 * Copyright (C) 1996-1999 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 ****************************************************************************/
40 #include "x86emu/x86emui.h"
42 /*----------------------------- Implementation ----------------------------*/
46 x86emuOp_esc_coprocess_d8(u8
X86EMU_UNUSED(op1
))
49 DECODE_PRINTF("ESC D8\n");
50 DECODE_CLEAR_SEGOVR();
51 END_OF_INSTR_NO_TRACE();
56 static const char *x86emu_fpu_op_d9_tab
[] = {
57 "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
58 "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
60 "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
61 "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
63 "FLD\tDWORD PTR ", "ESC_D9\t", "FST\tDWORD PTR ", "FSTP\tDWORD PTR ",
64 "FLDENV\t", "FLDCW\t", "FSTENV\t", "FSTCW\t",
67 static const char *x86emu_fpu_op_d9_tab1
[] = {
68 "FLD\t", "FLD\t", "FLD\t", "FLD\t",
69 "FLD\t", "FLD\t", "FLD\t", "FLD\t",
71 "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
72 "FXCH\t", "FXCH\t", "FXCH\t", "FXCH\t",
74 "FNOP", "ESC_D9", "ESC_D9", "ESC_D9",
75 "ESC_D9", "ESC_D9", "ESC_D9", "ESC_D9",
77 "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
78 "FSTP\t", "FSTP\t", "FSTP\t", "FSTP\t",
80 "FCHS", "FABS", "ESC_D9", "ESC_D9",
81 "FTST", "FXAM", "ESC_D9", "ESC_D9",
83 "FLD1", "FLDL2T", "FLDL2E", "FLDPI",
84 "FLDLG2", "FLDLN2", "FLDZ", "ESC_D9",
86 "F2XM1", "FYL2X", "FPTAN", "FPATAN",
87 "FXTRACT", "ESC_D9", "FDECSTP", "FINCSTP",
89 "FPREM", "FYL2XP1", "FSQRT", "ESC_D9",
90 "FRNDINT", "FSCALE", "ESC_D9", "ESC_D9",
97 x86emuOp_esc_coprocess_d9(u8
X86EMU_UNUSED(op1
))
104 FETCH_DECODE_MODRM(mod
, rh
, rl
);
107 DECODE_PRINTINSTR32(x86emu_fpu_op_d9_tab
, mod
, rh
, rl
);
110 DECODE_PRINTF(x86emu_fpu_op_d9_tab1
[(rh
<< 3) + rl
]);
115 destoffset
= decode_rm00_address(rl
);
119 destoffset
= decode_rm01_address(rl
);
123 destoffset
= decode_rm10_address(rl
);
126 case 3: /* register to register */
129 DECODE_PRINTF2("ST(%d)\n", stkelem
);
136 #ifdef X86EMU_FPU_PRESENT
142 x86emu_fpu_R_fld(X86EMU_FPU_STKTOP
, stkelem
);
145 x86emu_fpu_R_fxch(X86EMU_FPU_STKTOP
, stkelem
);
153 x86emu_fpu_illegal();
157 x86emu_fpu_R_fstp(X86EMU_FPU_STKTOP
, stkelem
);
162 x86emu_fpu_R_fchs(X86EMU_FPU_STKTOP
);
165 x86emu_fpu_R_fabs(X86EMU_FPU_STKTOP
);
168 x86emu_fpu_R_ftst(X86EMU_FPU_STKTOP
);
171 x86emu_fpu_R_fxam(X86EMU_FPU_STKTOP
);
175 x86emu_fpu_illegal();
183 x86emu_fpu_R_fld1(X86EMU_FPU_STKTOP
);
186 x86emu_fpu_R_fldl2t(X86EMU_FPU_STKTOP
);
189 x86emu_fpu_R_fldl2e(X86EMU_FPU_STKTOP
);
192 x86emu_fpu_R_fldpi(X86EMU_FPU_STKTOP
);
195 x86emu_fpu_R_fldlg2(X86EMU_FPU_STKTOP
);
198 x86emu_fpu_R_fldln2(X86EMU_FPU_STKTOP
);
201 x86emu_fpu_R_fldz(X86EMU_FPU_STKTOP
);
205 x86emu_fpu_illegal();
213 x86emu_fpu_R_f2xm1(X86EMU_FPU_STKTOP
);
216 x86emu_fpu_R_fyl2x(X86EMU_FPU_STKTOP
);
219 x86emu_fpu_R_fptan(X86EMU_FPU_STKTOP
);
222 x86emu_fpu_R_fpatan(X86EMU_FPU_STKTOP
);
225 x86emu_fpu_R_fxtract(X86EMU_FPU_STKTOP
);
228 x86emu_fpu_illegal();
231 x86emu_fpu_R_decstp();
234 x86emu_fpu_R_incstp();
242 x86emu_fpu_R_fprem(X86EMU_FPU_STKTOP
);
245 x86emu_fpu_R_fyl2xp1(X86EMU_FPU_STKTOP
);
248 x86emu_fpu_R_fsqrt(X86EMU_FPU_STKTOP
);
251 x86emu_fpu_illegal();
254 x86emu_fpu_R_frndint(X86EMU_FPU_STKTOP
);
257 x86emu_fpu_R_fscale(X86EMU_FPU_STKTOP
);
262 x86emu_fpu_illegal();
270 x86emu_fpu_M_fld(X86EMU_FPU_FLOAT
, destoffset
);
273 x86emu_fpu_illegal();
276 x86emu_fpu_M_fst(X86EMU_FPU_FLOAT
, destoffset
);
279 x86emu_fpu_M_fstp(X86EMU_FPU_FLOAT
, destoffset
);
282 x86emu_fpu_M_fldenv(X86EMU_FPU_WORD
, destoffset
);
285 x86emu_fpu_M_fldcw(X86EMU_FPU_WORD
, destoffset
);
288 x86emu_fpu_M_fstenv(X86EMU_FPU_WORD
, destoffset
);
291 x86emu_fpu_M_fstcw(X86EMU_FPU_WORD
, destoffset
);
299 #endif /* X86EMU_FPU_PRESENT */
300 DECODE_CLEAR_SEGOVR();
301 END_OF_INSTR_NO_TRACE();
306 static const char *x86emu_fpu_op_da_tab
[] = {
307 "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
308 "FICOMP\tDWORD PTR ",
309 "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
310 "FIDIVR\tDWORD PTR ",
312 "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
313 "FICOMP\tDWORD PTR ",
314 "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
315 "FIDIVR\tDWORD PTR ",
317 "FIADD\tDWORD PTR ", "FIMUL\tDWORD PTR ", "FICOM\tDWORD PTR ",
318 "FICOMP\tDWORD PTR ",
319 "FISUB\tDWORD PTR ", "FISUBR\tDWORD PTR ", "FIDIV\tDWORD PTR ",
320 "FIDIVR\tDWORD PTR ",
322 "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
323 "ESC_DA ", "ESC_DA ", "ESC_DA ", "ESC_DA ",
330 x86emuOp_esc_coprocess_da(u8
X86EMU_UNUSED(op1
))
337 FETCH_DECODE_MODRM(mod
, rh
, rl
);
338 DECODE_PRINTINSTR32(x86emu_fpu_op_da_tab
, mod
, rh
, rl
);
341 destoffset
= decode_rm00_address(rl
);
345 destoffset
= decode_rm01_address(rl
);
349 destoffset
= decode_rm10_address(rl
);
352 case 3: /* register to register */
354 DECODE_PRINTF2("\tST(%d),ST\n", stkelem
);
357 #ifdef X86EMU_FPU_PRESENT
360 x86emu_fpu_illegal();
365 x86emu_fpu_M_iadd(X86EMU_FPU_SHORT
, destoffset
);
368 x86emu_fpu_M_imul(X86EMU_FPU_SHORT
, destoffset
);
371 x86emu_fpu_M_icom(X86EMU_FPU_SHORT
, destoffset
);
374 x86emu_fpu_M_icomp(X86EMU_FPU_SHORT
, destoffset
);
377 x86emu_fpu_M_isub(X86EMU_FPU_SHORT
, destoffset
);
380 x86emu_fpu_M_isubr(X86EMU_FPU_SHORT
, destoffset
);
383 x86emu_fpu_M_idiv(X86EMU_FPU_SHORT
, destoffset
);
386 x86emu_fpu_M_idivr(X86EMU_FPU_SHORT
, destoffset
);
394 DECODE_CLEAR_SEGOVR();
395 END_OF_INSTR_NO_TRACE();
400 static const char *x86emu_fpu_op_db_tab
[] = {
401 "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
402 "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
404 "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
405 "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
407 "FILD\tDWORD PTR ", "ESC_DB\t19", "FIST\tDWORD PTR ", "FISTP\tDWORD PTR ",
408 "ESC_DB\t1C", "FLD\tTBYTE PTR ", "ESC_DB\t1E", "FSTP\tTBYTE PTR ",
415 x86emuOp_esc_coprocess_db(u8
X86EMU_UNUSED(op1
))
421 FETCH_DECODE_MODRM(mod
, rh
, rl
);
424 DECODE_PRINTINSTR32(x86emu_fpu_op_db_tab
, mod
, rh
, rl
);
426 else if (rh
== 4) { /* === 11 10 0 nnn */
429 DECODE_PRINTF("FENI\n");
432 DECODE_PRINTF("FDISI\n");
435 DECODE_PRINTF("FCLEX\n");
438 DECODE_PRINTF("FINIT\n");
443 DECODE_PRINTF2("ESC_DB %0x\n", (mod
<< 6) + (rh
<< 3) + (rl
));
448 destoffset
= decode_rm00_address(rl
);
451 destoffset
= decode_rm01_address(rl
);
454 destoffset
= decode_rm10_address(rl
);
456 case 3: /* register to register */
459 #ifdef X86EMU_FPU_PRESENT
470 x86emu_fpu_R_fdisi();
473 x86emu_fpu_R_fclex();
476 x86emu_fpu_R_finit();
479 x86emu_fpu_illegal();
484 x86emu_fpu_illegal();
491 x86emu_fpu_M_fild(X86EMU_FPU_SHORT
, destoffset
);
494 x86emu_fpu_illegal();
497 x86emu_fpu_M_fist(X86EMU_FPU_SHORT
, destoffset
);
500 x86emu_fpu_M_fistp(X86EMU_FPU_SHORT
, destoffset
);
503 x86emu_fpu_illegal();
506 x86emu_fpu_M_fld(X86EMU_FPU_LDBL
, destoffset
);
509 x86emu_fpu_illegal();
512 x86emu_fpu_M_fstp(X86EMU_FPU_LDBL
, destoffset
);
519 DECODE_CLEAR_SEGOVR();
520 END_OF_INSTR_NO_TRACE();
524 static const char *x86emu_fpu_op_dc_tab
[] = {
525 "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
527 "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
530 "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
532 "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
535 "FADD\tQWORD PTR ", "FMUL\tQWORD PTR ", "FCOM\tQWORD PTR ",
537 "FSUB\tQWORD PTR ", "FSUBR\tQWORD PTR ", "FDIV\tQWORD PTR ",
540 "FADD\t", "FMUL\t", "FCOM\t", "FCOMP\t",
541 "FSUBR\t", "FSUB\t", "FDIVR\t", "FDIV\t",
547 x86emuOp_esc_coprocess_dc(u8
X86EMU_UNUSED(op1
))
554 FETCH_DECODE_MODRM(mod
, rh
, rl
);
555 DECODE_PRINTINSTR32(x86emu_fpu_op_dc_tab
, mod
, rh
, rl
);
558 destoffset
= decode_rm00_address(rl
);
562 destoffset
= decode_rm01_address(rl
);
566 destoffset
= decode_rm10_address(rl
);
569 case 3: /* register to register */
571 DECODE_PRINTF2("\tST(%d),ST\n", stkelem
);
574 #ifdef X86EMU_FPU_PRESENT
580 x86emu_fpu_R_fadd(stkelem
, X86EMU_FPU_STKTOP
);
583 x86emu_fpu_R_fmul(stkelem
, X86EMU_FPU_STKTOP
);
586 x86emu_fpu_R_fcom(stkelem
, X86EMU_FPU_STKTOP
);
589 x86emu_fpu_R_fcomp(stkelem
, X86EMU_FPU_STKTOP
);
592 x86emu_fpu_R_fsubr(stkelem
, X86EMU_FPU_STKTOP
);
595 x86emu_fpu_R_fsub(stkelem
, X86EMU_FPU_STKTOP
);
598 x86emu_fpu_R_fdivr(stkelem
, X86EMU_FPU_STKTOP
);
601 x86emu_fpu_R_fdiv(stkelem
, X86EMU_FPU_STKTOP
);
608 x86emu_fpu_M_fadd(X86EMU_FPU_DOUBLE
, destoffset
);
611 x86emu_fpu_M_fmul(X86EMU_FPU_DOUBLE
, destoffset
);
614 x86emu_fpu_M_fcom(X86EMU_FPU_DOUBLE
, destoffset
);
617 x86emu_fpu_M_fcomp(X86EMU_FPU_DOUBLE
, destoffset
);
620 x86emu_fpu_M_fsub(X86EMU_FPU_DOUBLE
, destoffset
);
623 x86emu_fpu_M_fsubr(X86EMU_FPU_DOUBLE
, destoffset
);
626 x86emu_fpu_M_fdiv(X86EMU_FPU_DOUBLE
, destoffset
);
629 x86emu_fpu_M_fdivr(X86EMU_FPU_DOUBLE
, destoffset
);
637 DECODE_CLEAR_SEGOVR();
638 END_OF_INSTR_NO_TRACE();
643 static const char *x86emu_fpu_op_dd_tab
[] = {
644 "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
645 "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
647 "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
648 "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
650 "FLD\tQWORD PTR ", "ESC_DD\t29,", "FST\tQWORD PTR ", "FSTP\tQWORD PTR ",
651 "FRSTOR\t", "ESC_DD\t2D,", "FSAVE\t", "FSTSW\t",
653 "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
654 "ESC_DD\t2C,", "ESC_DD\t2D,", "ESC_DD\t2E,", "ESC_DD\t2F,",
661 x86emuOp_esc_coprocess_dd(u8
X86EMU_UNUSED(op1
))
668 FETCH_DECODE_MODRM(mod
, rh
, rl
);
669 DECODE_PRINTINSTR32(x86emu_fpu_op_dd_tab
, mod
, rh
, rl
);
672 destoffset
= decode_rm00_address(rl
);
676 destoffset
= decode_rm01_address(rl
);
680 destoffset
= decode_rm10_address(rl
);
683 case 3: /* register to register */
685 DECODE_PRINTF2("\tST(%d),ST\n", stkelem
);
688 #ifdef X86EMU_FPU_PRESENT
693 x86emu_fpu_R_ffree(stkelem
);
696 x86emu_fpu_R_fxch(stkelem
);
699 x86emu_fpu_R_fst(stkelem
); /* register version */
702 x86emu_fpu_R_fstp(stkelem
); /* register version */
705 x86emu_fpu_illegal();
712 x86emu_fpu_M_fld(X86EMU_FPU_DOUBLE
, destoffset
);
715 x86emu_fpu_illegal();
718 x86emu_fpu_M_fst(X86EMU_FPU_DOUBLE
, destoffset
);
721 x86emu_fpu_M_fstp(X86EMU_FPU_DOUBLE
, destoffset
);
724 x86emu_fpu_M_frstor(X86EMU_FPU_WORD
, destoffset
);
727 x86emu_fpu_illegal();
730 x86emu_fpu_M_fsave(X86EMU_FPU_WORD
, destoffset
);
733 x86emu_fpu_M_fstsw(X86EMU_FPU_WORD
, destoffset
);
741 DECODE_CLEAR_SEGOVR();
742 END_OF_INSTR_NO_TRACE();
747 static const char *x86emu_fpu_op_de_tab
[] = {
748 "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
750 "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
753 "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
755 "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
758 "FIADD\tWORD PTR ", "FIMUL\tWORD PTR ", "FICOM\tWORD PTR ",
760 "FISUB\tWORD PTR ", "FISUBR\tWORD PTR ", "FIDIV\tWORD PTR ",
763 "FADDP\t", "FMULP\t", "FCOMP\t", "FCOMPP\t",
764 "FSUBRP\t", "FSUBP\t", "FDIVRP\t", "FDIVP\t",
771 x86emuOp_esc_coprocess_de(u8
X86EMU_UNUSED(op1
))
778 FETCH_DECODE_MODRM(mod
, rh
, rl
);
779 DECODE_PRINTINSTR32(x86emu_fpu_op_de_tab
, mod
, rh
, rl
);
782 destoffset
= decode_rm00_address(rl
);
786 destoffset
= decode_rm01_address(rl
);
790 destoffset
= decode_rm10_address(rl
);
793 case 3: /* register to register */
795 DECODE_PRINTF2("\tST(%d),ST\n", stkelem
);
798 #ifdef X86EMU_FPU_PRESENT
803 x86emu_fpu_R_faddp(stkelem
, X86EMU_FPU_STKTOP
);
806 x86emu_fpu_R_fmulp(stkelem
, X86EMU_FPU_STKTOP
);
809 x86emu_fpu_R_fcomp(stkelem
, X86EMU_FPU_STKTOP
);
813 x86emu_fpu_R_fcompp(stkelem
, X86EMU_FPU_STKTOP
);
815 x86emu_fpu_illegal();
818 x86emu_fpu_R_fsubrp(stkelem
, X86EMU_FPU_STKTOP
);
821 x86emu_fpu_R_fsubp(stkelem
, X86EMU_FPU_STKTOP
);
824 x86emu_fpu_R_fdivrp(stkelem
, X86EMU_FPU_STKTOP
);
827 x86emu_fpu_R_fdivp(stkelem
, X86EMU_FPU_STKTOP
);
834 x86emu_fpu_M_fiadd(X86EMU_FPU_WORD
, destoffset
);
837 x86emu_fpu_M_fimul(X86EMU_FPU_WORD
, destoffset
);
840 x86emu_fpu_M_ficom(X86EMU_FPU_WORD
, destoffset
);
843 x86emu_fpu_M_ficomp(X86EMU_FPU_WORD
, destoffset
);
846 x86emu_fpu_M_fisub(X86EMU_FPU_WORD
, destoffset
);
849 x86emu_fpu_M_fisubr(X86EMU_FPU_WORD
, destoffset
);
852 x86emu_fpu_M_fidiv(X86EMU_FPU_WORD
, destoffset
);
855 x86emu_fpu_M_fidivr(X86EMU_FPU_WORD
, destoffset
);
863 DECODE_CLEAR_SEGOVR();
864 END_OF_INSTR_NO_TRACE();
869 static const char *x86emu_fpu_op_df_tab
[] = {
871 "FILD\tWORD PTR ", "ESC_DF\t39\n", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
872 "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
876 "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
877 "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
881 "FILD\tWORD PTR ", "ESC_DF\t39 ", "FIST\tWORD PTR ", "FISTP\tWORD PTR ",
882 "FBLD\tTBYTE PTR ", "FILD\tQWORD PTR ", "FBSTP\tTBYTE PTR ",
886 "FFREE\t", "FXCH\t", "FST\t", "FSTP\t",
887 "ESC_DF\t3C,", "ESC_DF\t3D,", "ESC_DF\t3E,", "ESC_DF\t3F,"
894 x86emuOp_esc_coprocess_df(u8
X86EMU_UNUSED(op1
))
901 FETCH_DECODE_MODRM(mod
, rh
, rl
);
902 DECODE_PRINTINSTR32(x86emu_fpu_op_df_tab
, mod
, rh
, rl
);
905 destoffset
= decode_rm00_address(rl
);
909 destoffset
= decode_rm01_address(rl
);
913 destoffset
= decode_rm10_address(rl
);
916 case 3: /* register to register */
918 DECODE_PRINTF2("\tST(%d)\n", stkelem
);
921 #ifdef X86EMU_FPU_PRESENT
926 x86emu_fpu_R_ffree(stkelem
);
929 x86emu_fpu_R_fxch(stkelem
);
932 x86emu_fpu_R_fst(stkelem
); /* register version */
935 x86emu_fpu_R_fstp(stkelem
); /* register version */
938 x86emu_fpu_illegal();
945 x86emu_fpu_M_fild(X86EMU_FPU_WORD
, destoffset
);
948 x86emu_fpu_illegal();
951 x86emu_fpu_M_fist(X86EMU_FPU_WORD
, destoffset
);
954 x86emu_fpu_M_fistp(X86EMU_FPU_WORD
, destoffset
);
957 x86emu_fpu_M_fbld(X86EMU_FPU_BSD
, destoffset
);
960 x86emu_fpu_M_fild(X86EMU_FPU_LONG
, destoffset
);
963 x86emu_fpu_M_fbstp(X86EMU_FPU_BSD
, destoffset
);
966 x86emu_fpu_M_fistp(X86EMU_FPU_LONG
, destoffset
);
974 DECODE_CLEAR_SEGOVR();
975 END_OF_INSTR_NO_TRACE();