Sync with trunk r63270.
[reactos.git] / lib / fast486 / fpu.c
1 /*
2 * Fast486 386/486 CPU Emulation Library
3 * fpu.c
4 *
5 * Copyright (C) 2013 Aleksandar Andrejevic <theflash AT sdf DOT lonestar DOT org>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21
22 /* INCLUDES *******************************************************************/
23
24 #include <windef.h>
25
26 // #define NDEBUG
27 #include <debug.h>
28
29 #include <fast486.h>
30 #include "common.h"
31 #include "opcodes.h"
32 #include "fpu.h"
33
34 /* PUBLIC FUNCTIONS ***********************************************************/
35
36 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD8)
37 {
38 FAST486_MOD_REG_RM ModRegRm;
39 BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
40
41 /* Get the operands */
42 if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
43 {
44 /* Exception occurred */
45 return FALSE;
46 }
47
48 FPU_CHECK();
49
50 #ifndef FAST486_NO_FPU
51 // TODO: NOT IMPLEMENTED
52 UNIMPLEMENTED;
53
54 return FALSE;
55 #else
56 /* Do nothing */
57 return TRUE;
58 #endif
59 }
60
61 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeD9)
62 {
63 FAST486_MOD_REG_RM ModRegRm;
64 BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
65
66 /* Get the operands */
67 if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
68 {
69 /* Exception occurred */
70 return FALSE;
71 }
72
73 FPU_CHECK();
74
75 #ifndef FAST486_NO_FPU
76 // TODO: NOT IMPLEMENTED
77 UNIMPLEMENTED;
78
79 return FALSE;
80 #else
81 /* Do nothing */
82 return TRUE;
83 #endif
84 }
85
86 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDA)
87 {
88 FAST486_MOD_REG_RM ModRegRm;
89 BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
90
91 /* Get the operands */
92 if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
93 {
94 /* Exception occurred */
95 return FALSE;
96 }
97
98 FPU_CHECK();
99
100 #ifndef FAST486_NO_FPU
101 // TODO: NOT IMPLEMENTED
102 UNIMPLEMENTED;
103
104 return FALSE;
105 #else
106 /* Do nothing */
107 return TRUE;
108 #endif
109 }
110
111 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDB)
112 {
113 FAST486_MOD_REG_RM ModRegRm;
114 BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
115
116 /* Get the operands */
117 if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
118 {
119 /* Exception occurred */
120 return FALSE;
121 }
122
123 FPU_CHECK();
124
125 #ifndef FAST486_NO_FPU
126 // TODO: NOT IMPLEMENTED
127 UNIMPLEMENTED;
128
129 return FALSE;
130 #else
131 /* Do nothing */
132 return TRUE;
133 #endif
134 }
135
136 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDC)
137 {
138 FAST486_MOD_REG_RM ModRegRm;
139 BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
140
141 /* Get the operands */
142 if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
143 {
144 /* Exception occurred */
145 return FALSE;
146 }
147
148 FPU_CHECK();
149
150 #ifndef FAST486_NO_FPU
151 // TODO: NOT IMPLEMENTED
152 UNIMPLEMENTED;
153
154 return FALSE;
155 #else
156 /* Do nothing */
157 return TRUE;
158 #endif
159 }
160
161 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDD)
162 {
163 FAST486_MOD_REG_RM ModRegRm;
164 BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
165
166 /* Get the operands */
167 if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
168 {
169 /* Exception occurred */
170 return FALSE;
171 }
172
173 FPU_CHECK();
174
175 #ifndef FAST486_NO_FPU
176 // TODO: NOT IMPLEMENTED
177 UNIMPLEMENTED;
178
179 return FALSE;
180 #else
181 /* Do nothing */
182 return TRUE;
183 #endif
184 }
185
186 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDE)
187 {
188 FAST486_MOD_REG_RM ModRegRm;
189 BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
190
191 /* Get the operands */
192 if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
193 {
194 /* Exception occurred */
195 return FALSE;
196 }
197
198 FPU_CHECK();
199
200 #ifndef FAST486_NO_FPU
201 // TODO: NOT IMPLEMENTED
202 UNIMPLEMENTED;
203
204 return FALSE;
205 #else
206 /* Do nothing */
207 return TRUE;
208 #endif
209 }
210
211 FAST486_OPCODE_HANDLER(Fast486FpuOpcodeDF)
212 {
213 FAST486_MOD_REG_RM ModRegRm;
214 BOOLEAN AddressSize = State->SegmentRegs[FAST486_REG_CS].Size;
215
216 /* Get the operands */
217 if (!Fast486ParseModRegRm(State, AddressSize, &ModRegRm))
218 {
219 /* Exception occurred */
220 return FALSE;
221 }
222
223 FPU_CHECK();
224
225 #ifndef FAST486_NO_FPU
226 // TODO: NOT IMPLEMENTED
227 UNIMPLEMENTED;
228
229 return FALSE;
230 #else
231 /* Do nothing */
232 return TRUE;
233 #endif
234 }
235
236 /* EOF */