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

Function doFCOS_inst

source/test/testFPU.cpp:1650–1684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1648}
1649
1650void doFCOS_inst(FPU_Float* st0, FPU_Float* st0Result) {
1651#if defined (BOXEDWINE_MSVC) && !defined (BOXEDWINE_64)
1652 {
1653 float f1 = st0->f;
1654 struct FPU_Float result;
1655
1656 __asm {
1657 finit;
1658 fld f1;
1659 fcos;
1660 fstp result.f;
1661 }
1662 if (st0Result->i == FLOAT_QUIET_NAN_BITS) {
1663 assertTrue(isnan(result.f));
1664 } else {
1665 assertFloat(result.f, st0Result->f);
1666 }
1667 }
1668#endif
1669 struct FPU_Float result;
1670
1671 newInstruction(0);
1672 fpu_init();
1673 fldf32(st0->f, 1);
1674 pushCode8(0xd9);
1675 pushCode8(rm(false, 7, 7));
1676 writeTopFloat(2);
1677 runTestCPU();
1678 result.i = memory->readd(HEAP_ADDRESS + 4 * 2);
1679 if (st0Result->i == FLOAT_QUIET_NAN_BITS) {
1680 assertTrue(isnan(result.f));
1681 } else {
1682 assertFloat(result.f, st0Result->f);
1683 }
1684}
1685
1686void testFCOS() {
1687 FPU_Float st0;

Callers 1

testFCOSFunction · 0.85

Calls 10

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

Tested by

no test coverage detected