mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Add math control state functions for intel
This commit is contained in:
parent
47d5d80e80
commit
a3f8227541
2 changed files with 42 additions and 13 deletions
|
|
@ -34,17 +34,21 @@ static MRandomLCG sgPlatRandom;
|
||||||
|
|
||||||
U32 Platform::getMathControlState()
|
U32 Platform::getMathControlState()
|
||||||
{
|
{
|
||||||
return 0;
|
U16 cw;
|
||||||
}
|
asm("fstcw %0" : "=m" (cw) :);
|
||||||
|
return cw;
|
||||||
void Platform::setMathControlStateKnown()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform::setMathControlState(U32 state)
|
void Platform::setMathControlState(U32 state)
|
||||||
{
|
{
|
||||||
|
U16 cw = state;
|
||||||
|
asm("fldcw %0" : : "m" (cw));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Platform::setMathControlStateKnown()
|
||||||
|
{
|
||||||
|
U16 cw = 0x27F;
|
||||||
|
asm("fldcw %0" : : "m" (cw));
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -130,17 +130,42 @@ F32 Platform::getRandom()
|
||||||
return sgPlatRandom.randF();
|
return sgPlatRandom.randF();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(i386) || defined(__x86_64__)
|
||||||
|
|
||||||
|
U32 Platform::getMathControlState()
|
||||||
|
{
|
||||||
|
U16 cw;
|
||||||
|
asm("fstcw %0" : "=m" (cw) :);
|
||||||
|
return cw;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Platform::setMathControlState(U32 state)
|
||||||
|
{
|
||||||
|
U16 cw = state;
|
||||||
|
asm("fldcw %0" : : "m" (cw));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Platform::setMathControlStateKnown()
|
||||||
|
{
|
||||||
|
U16 cw = 0x27F;
|
||||||
|
asm("fldcw %0" : : "m" (cw));
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
U32 Platform::getMathControlState()
|
U32 Platform::getMathControlState()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Platform::setMathControlStateKnown()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void Platform::setMathControlState(U32 state)
|
void Platform::setMathControlState(U32 state)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Platform::setMathControlStateKnown()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue