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

Function doFUCOMPPTest

source/test/testFPU.cpp:2227–2247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2225}
2226
2227static 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
2249void testFUCOMPP() {
2250 doFUCOMPPTest(2.0, 2.0, 0x4000);

Callers 1

testFUCOMPPFunction · 0.85

Calls 9

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

Tested by

no test coverage detected