Hi,
On 11/12/17 16:13, Vijay Kiran Kamuju wrote:
- __asm__ __volatile__( "vmrs %0, fpscr" : "=r" (fpword) );
- if (fpword & 0x1) flags |= MSVCRT__EM_INVALID;
- if (fpword & 0x2) flags |= MSVCRT__EM_ZERODIVIDE;
- if (fpword & 0x4) flags |= MSVCRT__EM_OVERFLOW;
- if (fpword & 0x8) flags |= MSVCRT__EM_UNDERFLOW;
- if (fpword & 0x10) flags |= MSVCRT__EM_INEXACT;
The fpword&0x1f seems to be used for status word. The exception trap enable bits are in fpword&0x1f00. The meaning of flag being set on arm is different then on i386 (enable trap vs mask).
- if (fpword & 0x80) flags |= MSVCRT__EM_DENORMAL;
As far as I can see ARM doesn't support _EM_DENORMAL. The documentation says that 0x80 bit of fpword should not be modified unless you know what VFP coprocessor is used. Some other bits should also not be modified (like e.g. status word).
switch (flags & MSVCRT__MCW_RC)
{
case MSVCRT__RC_UP|MSVCRT__RC_DOWN: fpword |= 0xc00000; break;
case MSVCRT__RC_DOWN: fpword |= 0x800000; break;
case MSVCRT__RC_UP: fpword |= 0x200000; break;
The _RC_UP case is broken.
Thanks, Piotr