jacobly0 / llvm-project

This fork of the canonical git mirror of the LLVM subversion repository adds (e)Z80 targets. Please refer to the wiki for important build instructions.
https://github.com/jacobly0/llvm-project/wiki
123 stars 15 forks source link

Support for GB Z80? #29

Closed gabriel-francischini closed 2 years ago

gabriel-francischini commented 2 years ago

It's been a long time since I researched this, but IIRC the z80 family is classified in 5 or 6 different archs in the GCC source code, most of them being plain z80 with the notable exception of a 32-bit (?) one for TI-80-ish calculator and a gbz80 one (that lacks IX and IY registers, IIRC).

Is there support for gbz80, given that it's a plain z80 minus a few registers?

jacobly0 commented 2 years ago

Well the gbz80 also has a handful of unique instructions, so while I have spent time adding and predicating all of the z80 specific instructions, none of the gbz80 specific instructions have been added (nor gbz80 specific stack behavior) and there's no existing predicate for disabling (e)z80 instructions that don't exist on a gbz80 or even accounting for differing flag behavior etc. I also don't own any hardware, although I understand that many details are surprisingly well documented. Only closing because I have no plans to work on it myself, anyone else who does is free to submit a PR.

slorquet commented 2 years ago

Hello, just for information, sdcc has renamed gbz80 to sm83 to better reflect the actual core name.

This is a Sharp core that was also used in a handful of other devices:

https://sourceforge.net/p/sdcc/wiki/SM83%20devices/

IoIxD commented 2 years ago

There is another port of LLVM to gbz80 should it interest one, although it is a port of an older version. https://github.com/Bevinsky/llvm-gbz80

f4grx commented 2 years ago

And it was done in the main branch of the fork, which will make it hard to carve out for inclusion in the official upstream project.

IoIxD commented 2 years ago

Wasn't suggesting a merge, just suggesting it for anyone who needs it.

f4grx commented 2 years ago

Sorry if that sounded too nerdy.

Whats important here is that so many people are interested by 8 bit CPUs that we have at least 3 modern compilers for z80/gbz80 and that is supercool, thanks for sharing this project.