VOGONS


First post, by retro100

User metadata
Rank Newbie
Rank
Newbie

I would like to ask if an integration of an emulated CPU via Unicorn could be useful.
Unicorn is a CPU emulation framework based on QEMU's TCG (Tiny Code Generator) CPU emulator.
https://github.com/unicorn-engine/unicorn
https://www.unicorn-engine.org/

Unicorn uses the CPU part from Qemu without the rest of any peripherals, components or dependencies.
In my opinion, the integration of Unicorn could increase the performance for execute Dosbox on non-Intel hardware like ARM or PowerPC. This could be a new additional mode beside auto, dynamic, normal, simple.
For example "tcg" mode 😉

I made some performance tests with dosbox dynamic mode vs qemu with tcg (qemu started with -machine accel=tcg) on different hardware platforms.
Assuming that Dosbox with a Unicorn CPU would achieve similar values as Qemu's TCG.
For the tests I use PCPBench.

Tested with PCPBench on following platforms/hardware:
1) Intel 64bit 2.6GHz i7-6600U on Linux 64bit with current dosbox SVN r4454 vs qemu-system-i386 ver. 4.2.1
2) Powerbook G4 - PowerBook3,3 - 550 MHz PowerPC G4 (7450) with dosbox SVN r4301 with @jmarsh PPC patches vs qemu-system-i386 ver. 5.2.0
3) *Emulated PPC on Intel notebook. Dosbox SVN r4301 with jmarsh PPC patches on Qemu PPC vs qemu-system-i386 on Qemu PPC
4) Raspberry Pi 3 Model B 1200 MHz Arm Cortex-A53 with current dosbox SVN r4454 vs qemu-system-i386 ver. 3.1.0
5) **Emulated Armhf on Intel notebook. Dosbox SVN r4454 on Qemu Arm vs qemu-system-i386 on Qemu Arm

                 |          |          |           |           |  normal  |  normal  | dynrec   |
| normal | dynrec | dyn-x86 | qemu-tcg | vs dynrec| vs qemu | vs qemu |
-----------------o----------o----------o-----------o-----------o----------o----------o----------o
== HW x64 == | | | | | | | |
2.6GHz i7-6600U | 25.9 FPS | 57.8 FPS | 133.7 FPS | 214.7 FPS | 1 : 2.23 | 1 : 8.29 | 1 : 3.72 |
| | | | | | | |
== HW PowerPC == | | | | | | | |
Powerbook G4 | 0.8 FPS | 2.3 FPS | n/a | 7.5 FPS | 1 : 2.88 | 1 : 9.38 | 1 : 3.26 |
Emulated PPC * | 0.7 FPS | 3.0 FPS | n/a | 10.4 FPS | 1 : 4.29 | 1 : 14.9 | 1 : 3.47 |
| | | | | | | |
== HW ARM HF == | | | | | | | |
Raspberry Pi 3 | 2.0 FPS | 8.5 FPS | n/a | 22.5 FPS | 1 : 4.25 | 1 : 11.3 | 1 : 2.65 |
Emulated ARM ** | 1.9 FPS | 3.6 FPS | n/a | 19.2 FPS | 1 : 1.90 | 1 : 10.1 | 1 : 5.33 |
| | | | | | | |

Dosbox has a special dynamic mode when running on x86 hardware. Therefore, on x86 hardware Unicorn would have only a limited advantage.
But, for example, if dosbox is running on ARM or PowerPC then there could possibly be a factor 3 of performance gain with Unicorn.

I currently provide a dosbox SVN version r4301 with the great PPC patches from jmarsh for Wii (https://github.com/retro100/dosbox-wii).
With Unicorn integration maybe a Pentium 90Mhz would be possible on the Wii *g*. (inoffiziell PPC support for unicorn is available https://github.com/unicorn-engine/unicorn/pull/1270)

I think my current knowledge is too little to do the integration of Unicorn.

On all CPU dosbox specialists. Would a Unicorn integration make any sense?

I don't think Unicorn should replace the current dynrec, but should be another alternative for particularly CPU intensive DOS games running on non-x86 hardware like ARM, PowerPC, etc.

best regards
retro100

Reply 1 of 1, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

DOSBox is for games so any comparisons need to be done with games and any setup should match as much as possible. 32bit vs 32bit or 64bit vs 64bit, same emulator settings, same game settings, etc etc.
The last comparison I did between Qemu TCG and DOSBox in DOS gaming, DOSBox was far ahead. Of course qemu compatiblity issues didn't help.....

There is nothing magical about TCG so if TCG is significantly faster without breaking DOS game compatibility then there is no reason DOSBox couldn't be improved without using TCG.

Wow that 6600U is sloooowww 😉

How To Ask Questions The Smart Way
Make your games work offline