| 2225 | } |
| 2226 | |
| 2227 | static void doFUCOMPPTest(float val1, float val2, U32 swResult) { |
| 2228 | struct FPU_Float result; |
| 2229 | |
| 2230 | newInstruction(0); |
| 2231 | fpu_init(); |
| 2232 | fldf32(100.0f, 1); |
| 2233 | fldf32(val1, 2); |
| 2234 | fldf32(val2, 3); |
| 2235 | pushCode8(0xda); |
| 2236 | pushCode8(rm(false, 5, 1)); |
| 2237 | writeTopFloat(4); |
| 2238 | |
| 2239 | // FNSTSW AX |
| 2240 | pushCode8(0xdf); |
| 2241 | pushCode8(0xe0); |
| 2242 | |
| 2243 | runTestCPU(); |
| 2244 | result.i = memory->readd(HEAP_ADDRESS + 4 * 4); |
| 2245 | assertTrue(result.f == 100.0f); // stack popped twice, val1 and val2 were popped off and 100.0 is now on top |
| 2246 | assertTrue((AX & 0x4700) == swResult); |
| 2247 | } |
| 2248 | |
| 2249 | void testFUCOMPP() { |
| 2250 | doFUCOMPPTest(2.0, 2.0, 0x4000); |
no test coverage detected