FPU Emulator

General Discussion, STOS.

Moderator: troed

User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: FPU Emulator

Post by stephen_usher »

mikro wrote: Mon Jul 11, 2022 8:27 am
stephen_usher wrote: Sun Jul 10, 2022 9:47 pm

Might be useful to allow a full ST emulation on a TT or Falcon though for games.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ THIS!

To make it a bit more specific, there are two huge areas of interest to explore:

- cycle non-exact (Win)UAE (i.e. taking m68k instructions as they are) (think of modern AGA demos)
- cycle non-exact Hatari (with, say, cache disabled and perhaps some stack frame fixes) (think of dirty games overwriting memory, using disk images etc)

I'm following this project with great interest but MacOS is totally alien to me. Amiga/Atari OS on the other hand... :)
What you could probably do is allow all non-priviledged instructions run normally, catching access to hardware. Priviledged code would have its own sandbox with only the privileged instructions emulated. Exception stack frames would therefore be written by the hypervisor as 68000 stack frames.

Remember, this isn't an emulation like UAE or Hatari, it's a virtual machine running the code on a real CPU, like VMware or VirtualBox on an Intel box.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
Steve
Posts: 2570
Joined: Fri Sep 15, 2017 11:49 am

Re: FPU Emulator

Post by Steve »

You guys do realise you're both talking in the wrong thread, this is the fpu emulator thread.
User avatar
stephen_usher
Posts: 5580
Joined: Mon Nov 13, 2017 7:19 pm
Location: Oxford, UK.
Contact:

Re: FPU Emulator

Post by stephen_usher »

It derived from the way that the FPU emulator may go in the future, to allow complete emulation.

But yes, it is a divergence from the core.
Intro retro computers since before they were retro...
ZX81->Spectrum->Memotech MTX->Sinclair QL->520STM->BBC Micro->TT030->PCs & Sun Workstations.
Added code to the MiNT kernel (still there the last time I checked) + put together MiNTOS.
Collection now with added Macs, Amigas, Suns and Acorns.
User avatar
agranlund
Posts: 777
Joined: Sun Aug 18, 2019 10:43 pm
Location: Sweden
Contact:

Re: FPU Emulator

Post by agranlund »

A newer version:
http://www.happydaze.se/wp-content/uplo ... 220711.zip


Changelog:
- compiled with optimisations enabled this time (oops... :oops: )
- partially implemented fsave / frestore instructions (ftrapcc is still unimplemented)
- implemented VBR masking


This version should fool most types of direct-hardware tests.
If you put it before Mint.prg in the auto folder it'll fool it too.

IMG_6350 copy.jpg
IMG_6350 copy.jpg (77.56 KiB) Viewed 1423 times

The only thing that would break the illusion is if something else moves the VBR too. I know some HDD game patches from some group I can't remember does that kind of stuff.


Still not sure if it's a great idea. Perhaps I should build two different versions.
Or maybe a .CPX module for settings (I've been looking for a reason to learn how to do those things anyway)
User avatar
frank.lukas
Posts: 660
Joined: Fri Jan 19, 2018 11:52 am

Re: FPU Emulator

Post by frank.lukas »

Nice ...
User avatar
agranlund
Posts: 777
Joined: Sun Aug 18, 2019 10:43 pm
Location: Sweden
Contact:

Re: FPU Emulator

Post by agranlund »

mikro wrote: Mon Jul 11, 2022 8:31 am While this is a nice project (and it certainly has some use), this particular problem (-m68020-60 requiring FPU even if it doesn't really use it) is a bigger problem to solve and this "fix" would just replace it with another problem -- instead of people complaining that their software is showing the strange error message people would report sudden and random slowness.

Much easier to explain one error message than a flood of random bug reports.
I'm a 100% with you on this @mikro. This is a workaround more than a proper long term solution.
The thought did cross my mind if this thing would do more harm than good. It'll be hard for a user to know if random slowness, or even crashes, are due to the fpu emulator is kicking in. This could easily cause unnecessary and wrongly directed bug reports toward Mint..

Not sure how I feel about that, but it'd also feel weird not to share code with people.

In any case, it's an interesting and fun small project as a bit of a break from Basilisk :)
User avatar
frank.lukas
Posts: 660
Joined: Fri Jan 19, 2018 11:52 am

Re: FPU Emulator

Post by frank.lukas »

User avatar
Badwolf
Posts: 2231
Joined: Tue Nov 19, 2019 12:09 pm

Re: FPU Emulator

Post by Badwolf »

agranlund wrote: Sun Jul 10, 2022 1:14 am So.. I couldn't resist :lol:

Here's a software FPU emulator for Atari:
http://www.happydaze.se/wp-content/uplo ... /fpemu.zip
Yes!!

This is great. Many thanks, Anders.

How well an accelerator card with no FPU does with Linpack may very well be the next big benchmarking trend. :lol:

BW
DFB1 Open source 50MHz 030 and TT-RAM accelerator for the Falcon
DSTB1 Open source 16Mhz 68k and AltRAM accelerator for the ST
Smalliermouse ST-optimised USB mouse adapter based on SmallyMouse2
FrontBench The Frontier: Elite 2 intro as a benchmark
User avatar
agranlund
Posts: 777
Joined: Sun Aug 18, 2019 10:43 pm
Location: Sweden
Contact:

Re: FPU Emulator

Post by agranlund »

Badwolf wrote: Tue Jul 12, 2022 1:04 pm
Yes!!

This is great. Many thanks, Anders.

How well an accelerator card with no FPU does with Linpack may very well be the next big benchmarking trend. :lol:

BW
The FPU test in Gembench takes 5minutes+ so it’ll be a slow race indeed :)
Kronos test is a lot shorter though.

Comparing the NestBSD vs Linux implementation I have a feeling the Linux one might be quicker. But i dont have that one working enough to know.
They’ll both be incredibly slow in the grand scheme of things so maybe readable code is preffered.

The NetBSD one is a lot easier to work with since it’s all C except for the new Atari specific entry/exit code.
I’m sure there is a lot of room for hand optimization.

I think it’s cool though and I very much enjoy making stuff work in unintended ways through the magic of software :)
czietz
Posts: 548
Joined: Sun Jan 14, 2018 1:02 pm

Re: FPU Emulator

Post by czietz »

I agree it's a very cool idea. I can contribute some benchmark results from my TT:

Atari TT030 @ 48 MHz            FPEMU_220712    Real 68882      Factor
-----------------------------------------------------------------------
LINPACK 100: kFLOPS             1.59            281             177x
NemBench:
Float multiply: MFLOPS          0.006           0.811           135x
Float divide: MFLOPS            0.002           0.526           263x
Linear stalled float: MFLOPS    0.008           1.338           167x
Interleaved piped float: MFLOPS 0.007           1.336           191x

Note: TT needs to run EmuTOS. Atari TOS 3.06 will not boot without FPU.
Post Reply

Return to “SOFTWARE”