English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 19 June 2018, 17:37   #1
PeterK
Registered User
 
Join Date: Apr 2005
Location: digital hell, Germany, after 1984, but worse
Posts: 3,365
Some x87 FPU source range restrictions are not regarded by the Jit yet

When looking into the Intel Vol2 instruction set manual I was just remembered that some x87 FPU instructions have limitations for the valid range of the source operands, which is not handled by the Jit code yet. It would make many functions a lot more complex, if all operands were checked and reduced to the supported range. Just one example, FSIN:
Quote:
This instruction calculates the sine of the source operand in register ST(0) and stores the result in ST(0). The source operand must be given in radians and must be within the range -2^63 to +2^63.

If the source operand is outside the acceptable range, the C2 flag in the FPU status word is set, and the value in register ST(0) remains unchanged. The instruction does not raise an exception when the source operand is out of range. It is up to the program to check the C2 flag for out of range conditions. Source values outside the range -2^63 to +2^63 can be reduced to the range of the instruction by subtracting an appropriate integer multiple of 2*Pi or by using the FPREM instruction with a divisor of 2*Pi.
The Amiga Programmers Reference Manual says:
Quote:
If the source operand is not in the range of [–2*Pi ... +2*Pi], the argument is reduced to within that range before the sine is calculated.
No idea, if it's worth to support values out of range?

Update:
Thought about it last night: No, it's not worth to care about larger operands. Even with a 63 bit mantissa you are losing all the remaining exactness if you multiply it with more than 2^63. So, you would start dealing with integer numbers and that's like pointing to random spots on the 2*Pi circle. I think it won't get exact anymore when you reduce the number with FPREM(2*Pi, x). Or what's the trick behind Intel's suggestion? I don't get it. I guess, the reduction only makes it possible to get pointless results instead of nothing.

Last edited by PeterK; 20 June 2018 at 06:40.
PeterK is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Imagine (JIT) FPU problem bernd roesch support.WinUAE 28 21 October 2019 21:36
Bordersprites restrictions (AGA chipset) dissident Coders. Asm / Hardware 22 01 February 2019 23:37
WinUAE: Disable JIT/FPU AMIGASYSTEM support.WinUAE 11 30 November 2017 14:10
JIT FPU support problem ! amilo3438 support.WinUAE 65 17 December 2016 21:35
Copper color-changing restrictions? Dan Locke Coders. General 24 01 February 2010 03:00

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 13:57.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06836 seconds with 13 queries