MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / doCOMIntTest

Function doCOMIntTest

source/test/testFPU.cpp:2257–2289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2255}
2256
2257static 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
2291void testFCOMInt(bool pop) {
2292 doCOMIntTest(2.0, 2, 0x4000, pop);

Callers 1

testFCOMIntFunction · 0.85

Calls 12

newInstructionFunction · 0.85
fpu_initFunction · 0.85
fldf32Function · 0.85
pushCode8Function · 0.85
rmFunction · 0.85
pushCode32Function · 0.85
pushCode16Function · 0.85
writeTopFloatFunction · 0.85
runTestCPUFunction · 0.85
assertTrueFunction · 0.85
writedMethod · 0.45
readdMethod · 0.45

Tested by

no test coverage detected