View Single Post
Old 06 July 2018, 16:24   #16
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,380
Quote:
Originally Posted by Toni Wilen View Post
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(&regs.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(&regs.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.
PeterK is offline  
 
Page generated in 0.04347 seconds with 11 queries