Add support for aarch64 / apple silicon

This commit is contained in:
Jeff Hutchinson 2021-05-08 22:18:45 -04:00
parent ce79101cb3
commit e981fd2cc3
8 changed files with 20 additions and 5 deletions

View file

@ -34,21 +34,29 @@ static MRandomLCG sgPlatRandom;
U32 Platform::getMathControlState()
{
#ifdef TORQUE_CPU_X86
U16 cw;
asm("fstcw %0" : "=m" (cw) :);
return cw;
#else
return 0;
#endif
}
void Platform::setMathControlState(U32 state)
{
#ifdef TORQUE_CPU_X86
U16 cw = state;
asm("fldcw %0" : : "m" (cw));
#endif
}
void Platform::setMathControlStateKnown()
{
#ifdef TORQUE_CPU_X86
U16 cw = 0x27F;
asm("fldcw %0" : : "m" (cw));
#endif
}
//--------------------------------------