Quote:
Originally Posted by Toni Wilen
I did the same to 80-bit when using multi-instruction code (trigonometric/logaritmic) because "wrong" mid instruction rounding would cause side-effects. ...
It is not going to work because regs.fpcr content would become JIT compile time constant. It needs to be pointer to regs.fpcr.
|
Ok, so it would be better to remove the if clauses completely and also use a pointer to regs.fpcr when setting the mode to "round to nearest":
Code:
case 0x1c: /* FACOS */
#if USE_X86_FPUCW
{
mov_l_rm (S1, uae_p32(®s.fpcr));
and_l_ri (S1, 0xC0); /* use round to nearest */
fldcw_m_indexed (S1, uae_p32(x86_fpucw));
facos_rr (dreg, sreg);
mov_l_rm (S1, uae_p32(®s.fpcr));
and_l_ri (S1, 0xf0); /* restore control word */
fldcw_m_indexed (S1, uae_p32(x86_fpucw));
break;
}
#endif
facos_rr (dreg, sreg);
break;
... and you could also remove the already disabled if(0)/else clauses and the dead code from FINTRZ where I wrote the comment that the conditions are checked at compilation time.