The z80 speed vs today’s modern processors

صفحة 2/5
1 | | 3 | 4 | 5

بواسطة ducasp

Paladin (677)

صورة ducasp

17-01-2023, 16:17

smx wrote:

Mine is just an observation that the emulation despite faster processors and still behind. It is no coincidence that we talk about FPGAs as the future for this sector

The only point where software emulation through Open MSX is worse than FPGA is input lag... In all other respects it is way, waaaaay more accurate, especially when we talk about FM sound (it uses Nuked OPLL) and VDP (yeah, OCM has quite a few bugs and not fully accurate timing wise), and notice, I'm not bashing anyone work, being OCM the solo journey of KdL and great contributions by Hara-san and only minor help from others like myself, it is no wonder it is behind, OpenMSX has quite a lot devs contributing to it, and contributing with lots of time.

Even input lag can be mitigated through run-ahead emulation and other features (not sure if OpenMSX implement any of those, never cared to look for it). I really dig FPGA implementations and love my SM-X and my MC2+ that I use a lot for most of my MSX activities, but I must recognize that OpenMSX is quite a bit more accurate. Try to run Quarth on OpenMSX and on FPGA as an example.

Again, not bashing, for how many hours of people working into it, OCM is a wonderful marvel and that progressed impressively. Just that saying it is more accurate, it is not fair. It has some advantages like inherent lower input lag (0 if you use analog monitor) and due to FPGA design synchronizing each piece is a non issue (but it has quite a lot of other challenges, i.e.: did you know that there is a single bank of memory that is shared for all, CPU ram, Mappers, Video Ram, and that even though it is fast, latency might play into some issue and it has to be shared across different devices, so it is delicate balance to have it working properly and not missing ram accesses?), but OpenMSX team work must be acknowledge, it is impressive how much accurate it is, might be a little bit heavy for small CPUs as it might emulate some stuff down to pixel clock accuracy, others to line accuracy, but it is really impressive.

بواسطة ducasp

Paladin (677)

صورة ducasp

17-01-2023, 16:31

Bengalack wrote:

Yes, young people today would possibly use the web as a baseline for comparison, but I think I'd have to try to get measures that does not include network latency. Of course it is hard, the full ram of MSX fits into the cache on the CPUs today, haha. But still, I thought it could be possible to get some numbers. Some kind of standard test written in C (and maybe where each C-compiler could have some kind of "effectiveness-factor" to adjust the results for poor compilers). Then one could do single-core comparisons. Maybe Drystone-MIPS and Grauw's tiger-comparisons is sufficient for me.

I think the challenge with any benchmark that can run on z80 and on a modern processor, is that it will be comparing only a small subset of what modern processors offer and on that small subset performance metric can be X times faster, but then you figure out that even a basic ARM SOC has cryptography acceleration, FPU, and other operations that would make that gap of X times faster even larger. It is a whole new universe, like trying to compare a z80 to an ENIAC Tongue But I got your idea/needs and I think there were great ideas here on what to do, probably nothing ready made, but things that can be done with not much effort... I've seen a guy on youtube just create a simple benchmark for his needs where he made a simple code that would add to a number several times and then tell how much time elapsed during those calculations, he used that to compare some devices... He acknowledge that this was just a simple metric and that the most capable systems could do thinks unimaginable to the old platform due to the auxiliary chips and larger instruction set, if I just could remember that video name I could link it oO

بواسطة Daemos

Prophet (2050)

صورة Daemos

17-01-2023, 17:19

When I explain the Z80 to my students I use the following example:

Imagine this so called Z80 chip and clock it to 3,58 GHz that means the chip will run a thousand times faster than it actually should and in the same clockspeed as modern CPU's. Even then the performance will only be a fraction of the intel Celeron D. Yes that CPU can at least boot the full kernel and run applications. It is so slow that a modern CPU can run a MSX game while: Running a linux virtual machine in a linux machine and in that virtual machine run vmware and in that vmware run virtualbox in which we run windows 7 and in that windows xp and in there openmsx and still the MSX game will run. We could even run multiple instances of MSX software and it would still run.

بواسطة Manuel

Ascended (19298)

صورة Manuel

17-01-2023, 21:10

smx wrote:

Mine is just an observation that the emulation despite faster processors and still behind.

What is behind exactly? Please be more specific.

بواسطة Bengalack

Paladin (721)

صورة Bengalack

17-01-2023, 22:36

Awesome guys. Lots of ideas for me to play with. Thank you all.

بواسطة Edevaldo

Master (154)

صورة Edevaldo

18-01-2023, 00:09

It is hard to come up with a number that show the difference between a modern CPU and a Z80. There are a few things that contribute to the difference looking more like a range. A modern CPU may execute something like 10 operations per clock cycle while the Z80 in an MSX may take about 11 cycles for the average instruction. And a modern CPU may run at clock speeds that are about 1000x the one of the Z80 in the MSX. And each one of those individual operations are in average about 3x the complexity of a regular Z80 operation, but this could really be in a range from 1 (nop, simple moves) to thousands more work done by an operation (think a vector floating point unity spiting tens of ops per cycle, while on a Z80 each such operation could need thousands of cycles to execute).

So if you compare Dhrystones... You may find that the Z80 is about 500.000x slower than a modern high end cpu CORE. But if you make a benchmark that only moves and increments bytes and does not access more than 64k often, so you do not have to page memory and does not do a lot of pointer arithmetic or multiplications and divisions, then the Z80 may perform a lot better. Lets say 100.000.

But if you need something that really requires 32/64 bit operations & pointers, has complex data structures, uses floating point, encryption and you would need to emulate all that in z80 asm, then the difference can be in the billions easily. Ray tracing may be such example.

There is a situation though, where the Z80 could show its might against a modern CPU. It is something that could cause a lot of cache trashing and require most operations to go directly to memory. Let's say you unroll all loops and make your program and data do not fit the caches, make all the branches in ways the CPU mispredicts, etc. In that case, if you could connect the Z80 to gigabytes of memory, then it could be only 100x-1000x slower or so.

It is hilarious just to think that you could take a high end AMD/Intel/Apple/IBM... cpu and clock it at 3,579545MHz and still get something that 100x-1000x faster per core. It may take hundreds of clock cycles to perform the first operation though.

بواسطة st1mpy

Paladin (901)

صورة st1mpy

18-01-2023, 00:18

There must be some stats/bench marks comparing a 8086 to a modern processor.
And then look at 8086 vs z80.

بواسطة santiontanon

Paragon (1768)

صورة santiontanon

18-01-2023, 02:52

I just found this doc that has Dhrystone results for several CPUs, including a Z80 (at 2.5MHz) and an intel 286:

Table (with just the relevant rows of Z80 or intel CPUs):

*----------------DHRYSTONE VERSION 1.1 RESULTS BEGIN--------------------------
 * --------------------------	------------	-----------	---------------
 * -		Z80-2.5Mhz	CPM-80 v2.2	Aztec CII v1.05g  91	  91
 * -		8086-8Mhz	RMX86 V6	Intel C-86 V2.0	 197	 203LM??
 * IBM PC/XT	8088-4.77Mhz	COHERENT 2.3.43	Mark Wiiliams	 259	 275
 * -		8086-8Mhz	RMX86 V6	Intel C-86 V2.0	 287	 304 ??
 * IBM PC/AT    80286-7.5Mhz    Venix/286 SVR2  cc              1159    1254 *15
 * Compaq II	80286-8Mhz	MSDOS 3.1	MS C 3.0 	1190	1282 MM
 * Compaq II	80286-8Mhz	MSDOS 3.1	MS C 3.0 	1351	1428

بواسطة Edevaldo

Master (154)

صورة Edevaldo

18-01-2023, 03:25

It is pretty easy to compile and run Drhystone. The Z80 cpm binary can be found in the internet also. Because of the wait state on M1 cycles the MSX will scores about 0.129 DMIPS. Removing the wait state should result in about 0.142DMIPS. A modern CPU will score up to 50000 DMIPS on a single core. My CPU is a core i9 9980HK and does ~28000 DMIPS.

The conversion factor between DMIPS and Dhrystones is 1757. If I recall correctly. The wikipedia page for the topic lists many CPUs.

Motorola gave DMIPS numbers for the 68k that would result in about 1DMIPS @ 6MHz. A 286 is believed to be able to achieve that around 8MHz. But with wait states and different compilers results vary quite a bit. Those are best case numbers.

The "problem" with Dhrystone is that it is still a a very simple algorithm. Simple arithmetic and string operations (that gives margin to some libc implementation dependence). Not really a good representation of modern CPUs capability. Z80 performs relatively well on Dhrystone also, substantially better than a 6502. It really shows the limitations of the CPU for 16bit math and beyond, string and higher level language constructs, like manipulating the stack frames in C or indexing a matrix.

On the other side if all you want is move bytes around, increment and decrement them, compare to fixed boundaries, the 6502 is hard to beat. Read simple games.

بواسطة smx

Expert (72)

صورة smx

18-01-2023, 08:24


Mine is just a note on the fact that I would expect a very close to perfect emulation without having to resort to the FPGA. If a modern processor is 100/1000/10000 times faster than the machines of the 80s, there is enough computational capacity to overcome any problem. I am referring to pure performance, not so much to the fact that something is not emulated because the details are not yet known.
Graphical glitches, sound issues. dithering and so on should be completely overcome.
But perhaps the problem lies in operating systems that are not meant for this purpose and steal huge resources.
I'm not referring to openmsx, mine is a general discourse and involves almost all emulators.
I'm thinking of VICE for C64 for example, which needs a light OS (Bare Metal OS) to run well.

What do you think?

صفحة 2/5
1 | | 3 | 4 | 5