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

Function testFpuCmov

source/test/testFPU.cpp:2201–2225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2199}
2200
2201void testFpuCmov(U8 group, U8 flags) {
2202 struct FPU_Float result;
2203
2204 newInstruction(0);
2205 fpu_init();
2206 fldf32(2.0f, 1);
2207 fldf32(3.0f, 2);
2208 pushCode8(0xda);
2209 pushCode8(rm(false, group, 1)); // cmov top-1 to top
2210 writeTopFloat(3);
2211 runTestCPU();
2212 result.i = memory->readd(HEAP_ADDRESS + 4 * 3);
2213 assertTrue(result.f == 3.0f); // top didn't change
2214
2215 newInstruction(flags);
2216 fpu_init();
2217 fldf32(2.0f, 1);
2218 fldf32(3.0f, 2);
2219 pushCode8(0xda);
2220 pushCode8(rm(false, group, 1)); // cmov top-1 to top
2221 writeTopFloat(3);
2222 runTestCPU();
2223 result.i = memory->readd(HEAP_ADDRESS + 4 * 3);
2224 assertTrue(result.f == 2.0f); // top changed
2225}
2226
2227static void doFUCOMPPTest(float val1, float val2, U32 swResult) {
2228 struct FPU_Float result;

Callers 1

testFPUDAFunction · 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