English Amiga Board


Go Back   English Amiga Board > Support > support.WinUAE

 
 
Thread Tools
Old 26 September 2018, 03:35   #1
JimDrew
Registered User

 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 600
FPU bug

There is a common bug in the 68881, 68882, 68040 and 68060 FPU emulation, but I am not sure where/what it is or even how to help you find it. I can describe what occurs and what I can do to reproduce it reliably and also prove that's FPU related...

If you run my Mac emulation FUSION under WinUAE, with a 68030 w/68881 or 68882, 68040 or 68060 CPU w/FPU (I have tried all setting options in all possible combinations) the Mac OS window sliders do not work. The Mac OS uses the FPU (when available) for calculating everything from window positions to the slider positions. Simply setting the FPU to NONE makes the sliders work fine because the Mac OS at that point uses integer routines for these calculations. On a real 68030/040/060 w/FPU setup there is no problem like this. When using WinUAE's "softfloat" option, it actually crashes WinUAE completely (requires task manager to close it) when a slider is attempted to be moved. All other options yield sliders that don't work.

I noticed this problem while comparing FUSION with WinUAE, the Vampire board, and the Replay w/060 daughter board. The Replay w/060 is the only one of the threee where the sliders work. My real A3000 with (and without) PP&S 68040 also works correctly. FUSION-PC (PC version of FUSION) also works correctly because I emulate the FPU using the PC's FPU. I fully expected the Vampire to have problems because it is missing a bunch of FPU functions, but I was surprised that WinUAE didn't work correctly. The Mac OS uses 80 bit or 96 bit precision for everything.

Like I said, I am not sure how I can help you debug something like this - but there is definitely something broken somewhere. If you have any ideas I would be certainly happy to help.
JimDrew is offline  
Old 26 September 2018, 09:05   #2
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,019
Does it also happen if you use 68040/060 and untick "Unimplemented FPU emu"? (=unimplemented FPU instructions in 68040 are really unimplemented and generate exceptions like real 68040/060). It at least narrows down which kind of instruction causes the problem.

Softfloat hang sounds like some FPU instruction interation gets in infinite loop. In this case select create dump file from task manager and upload the dump file somewhere. (Must use final or official beta versions)

Second option: create hdf with all the required files and upload it somewhere private.
Toni Wilen is offline  
Old 26 September 2018, 22:10   #3
JimDrew
Registered User

 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 600
There is no change in the behavior when unticking the "unimplemented FPU emu" box. I believe I have tried every possible combination of tick box and drop down option.

I will look at how to generate a log file for you.

Creating an .hdf with the complete setup will be a big task as this is my development setup and I would have to strip hundreds of megs of source code. I will look at setting a new one from scratch as I am sure that will be quicker.
JimDrew is offline  
Old 27 September 2018, 11:39   #4
Gilloo
Registered User
 
Join Date: Nov 2010
Location: Grenoble, Isère, Rhône-Alpes, France, Europe, Earth
Posts: 178
I've notice some problems with WinUAE / ShapeShifter and Photoshop.
I don't know if it is the same problem...
"Hardware"/"CPU and FPU"
68030 JIT checked
68881
"Advanced JIT settings" "FPU support" checked

Photoshop refuses to load (its extensions...)
If we uncheck "FPU support", it works !
The same issue and solution exist with the Basilisk emulator.
Gilloo is offline  
Old 27 September 2018, 11:55   #5
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,019
JIT FPU = different problem and also not my problem.
Toni Wilen is offline  
Old 27 September 2018, 15:52   #6
PeterK
Registered User
 
Join Date: Apr 2005
Location: Hangover
Posts: 2,385
Try also without Jit, with 64 or 80 bit FPU or SoftFloat.

The WinUAE Jit FPU has no support for any FPU error exceptions. I don't know about non-Jit FPU or SoftFloat, but maybe your Mac emulators are expecting FPU error exceptions, like "division by zero". They are all disabled and the Intel FPU returns simply the most likely result, like +/- infinity for devision by zero, without generating an exception. Of course, there could also be other hidden bugs in the Jit FPU code.
PeterK is offline  
Old 27 September 2018, 17:55   #7
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,019
JIT does no exceptions.
Non-JIT in 80bit mode support m68k/x86 compatible exceptions like divide by zero and overflows.
Softfloat supports everything and is designed to be bit perfect accurate.
Toni Wilen is offline  
Old 28 September 2018, 04:45   #8
JimDrew
Registered User

 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 600
I am not using JIT (CPU or FPU) with WinUAE myself. I am sure that every Mac emulation will have a problem when there is a FPU present.
JimDrew is offline  
Old 28 September 2018, 10:15   #9
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,019
There is another (but bit annoying) debug method: I can add extra logging that logs all executed FPU instructions (opcode numbers, full parameter values probably are a bit too complex to add). If it really gets in infinite loop in some softfloat function, last logged opcode should be the buggy one
Toni Wilen is offline  
Old 28 September 2018, 17:15   #10
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,019
Logging added: http://www.winuae.net/files/b/winuae2.7z Run it in windowed mode, use -log command line parameter to see it in real time (file logging may lost last few lines if hang/crash).
Toni Wilen is offline  
Old 28 September 2018, 21:03   #11
JimDrew
Registered User

 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 600
I will give it a shot, Toni!
JimDrew is offline  
Old 28 September 2018, 21:09   #12
JimDrew
Registered User

 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 600
Hey Toni! This version works perfectly with the softfloat option selected in the pull-down menu! No crash or hanging. I have been using 4.0.1.0. I see this version is 4.1.0.0.

How can I save the log file? When I click on the slider I can see a slew of FPU commands being issued in the log window. I would like to share that with you.

Last edited by JimDrew; 28 September 2018 at 21:18.
JimDrew is offline  
Old 28 September 2018, 22:08   #13
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,019
Quote:
Originally Posted by JimDrew View Post
Hey Toni! This version works perfectly with the softfloat option selected in the pull-down menu! No crash or hanging. I have been using 4.0.1.0. I see this version is 4.1.0.0.

How can I save the log file? When I click on the slider I can see a slew of FPU commands being issued in the log window. I would like to share that with you.
Log won't help if it works and does not hang

EDIT: I missed you mentioned both versions. Strange because there is no FPU related updates in recent versions..

Does 4.1.0 betas also work or crash? Unofficial betas are not compiled with full optimization which could explain the difference.
Toni Wilen is offline  
Old 29 September 2018, 09:29   #14
JimDrew
Registered User

 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 600
I have not tried the 4.1.0 beta. I will go grab it and test it out.

There is no way to capture the console output as a text file? I guess I could try to record the screen output. It might be handy to know what instruction(s) are being emulated incorrectly, just in case you can add support in the 80 bit non-softfloat option.
JimDrew is offline  
Old 29 September 2018, 09:43   #15
JimDrew
Registered User

 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 600
Ok, so beta 6 works perfectly! I tried 4.0.1.0 again and most of the time it crashes where I have kill it with the task manager. In all cases, as soon as I click on a Mac window's slider button the screen goes completely black. I am using the same Amiga configuration, just launch either winuae64.exe (v4.0.1.0) or winuae_b6.exe (the beta) from the same directory.
JimDrew is offline  
Old 29 September 2018, 10:58   #16
Toni Wilen
WinUAE developer
 
Join Date: Aug 2001
Location: Hämeenlinna/Finland
Age: 43
Posts: 22,019
It sounds like it isn't directly FPU related but some side-effect or similar.

You can get log file if you tick logging option in misc panel (winuaelog.txt) but if it crashes, you also need to add -log -logflush command line parameters (without logflush last few log lines are not flushed to a file if it crashes). But it most likely won't help much.

I recompiled winuae2.7z with full optimizations (same settings as official betas). Does it crash/hang now?

Does same happen with both 32-bit and 64-bit versions?
Toni Wilen is offline  
Old 29 September 2018, 13:37   #17
jotd
Cat freak
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 47
Posts: 2,627
Basilisk uses a very old version of UAE emulation core. No wonder why there are similar issues. It also has missing FPU instructions, some with the wrong size, and TRAPLE opcodes are buggy (don't fetch the user argument properly), but that hardly matters in a Macintosh context since you need supervisor mode to be able to use/handle them, and the ROM doesn't use them so...
jotd is online now  
Old 29 September 2018, 21:15   #18
JimDrew
Registered User

 
Join Date: Dec 2013
Location: Lake Havasu City, AZ
Posts: 600
OK, the new winuae2.7z works fine. I am using a 64 bit machine, running 64 bit versions of software (when possible). I have not tried the 32 bit version of 4.0.1.0.

Thanks for the info on the logging. I will see if I can figure out which FPU instruction(s) is causing the problem where you need to use the "softfloat" option.
JimDrew 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
Bug in x64 file requester and bug in Blizzard PPC ROM filesize headkase support.WinUAE 5 26 June 2016 15:17
Possible FPU emulation bug in 2.5.1? Zoltar support.WinUAE 13 05 January 2013 15:52
TotalCalc and EC020 FPU bug? Leandro Jardim support.WinUAE 5 25 February 2012 21:25
FPU bug found WinUAE 2.3.1 beta 7 Cosmos support.WinUAE 5 18 December 2010 01:57
Fpu emulation bug cefa68000 support.WinUAE 2 09 February 2007 20:14

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 23:16.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.08998 seconds with 15 queries