| 2255 | } |
| 2256 | |
| 2257 | static void doCOMIntTest(float val1, U32 val2, U32 swResult, bool pop, bool checkValue = true) { |
| 2258 | struct FPU_Float result; |
| 2259 | |
| 2260 | newInstruction(0); |
| 2261 | fpu_init(); |
| 2262 | fldf32(100.0f, 1); |
| 2263 | fldf32(val1, 2); |
| 2264 | |
| 2265 | memory->writed(HEAP_ADDRESS + 4 * 3, val2); |
| 2266 | |
| 2267 | pushCode8(0xda); |
| 2268 | pushCode8(rm(true, pop ? 3 : 2, cpu->big ? 5 : 6)); |
| 2269 | if (cpu->big) { |
| 2270 | pushCode32(4 * 3); |
| 2271 | } else { |
| 2272 | pushCode16(4 * 3); |
| 2273 | } |
| 2274 | |
| 2275 | writeTopFloat(4); |
| 2276 | |
| 2277 | // FNSTSW AX |
| 2278 | pushCode8(0xdf); |
| 2279 | pushCode8(0xe0); |
| 2280 | |
| 2281 | runTestCPU(); |
| 2282 | result.i = memory->readd(HEAP_ADDRESS + 4 * 4); |
| 2283 | if (pop) { |
| 2284 | assertTrue(result.f == 100.0f); |
| 2285 | } else if (checkValue) { |
| 2286 | assertTrue(result.f == val1); |
| 2287 | } |
| 2288 | assertTrue((AX & 0x4700) == swResult); |
| 2289 | } |
| 2290 | |
| 2291 | void testFCOMInt(bool pop) { |
| 2292 | doCOMIntTest(2.0, 2, 0x4000, pop); |
no test coverage detected