-
Notifications
You must be signed in to change notification settings - Fork 86
Introduce gas-sh4dsp-prizm target for fx-CG[10|20/50] calculators #175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
The main problems as of now are the lack of division/modulo (there are instructions to do it, but its better to deal with them via intrisics or something similar, due to code repetition)
Also made some add-in icon assets à la va-vite :3
The main (visible) ones I've seen were the following: - Lack of a malloc function (which could be implemented via existing syscalls) - Tests which *should* fail on this platform (i.e: assembly tests) On a more invisible side, array indexing is surprisingly broken as of now.
colon tree
Most tests here do build properly (except for one due to PCrel issues), although I'd probably need to setup a proper basic SH-4 "emulator" to be completely sure. |
Instead of being located at the end of a function, literals now litter your code to be as close as possible. This also now brings the buildable tests to pretty much every single one which aren't designed to be platform-specific! I just need a test SH4 runner, so if anyone wants to contribute, feel free.
I hate them.
i hate delay slots |
This has the bare minimum to be running B programs, and, infact, runs all tests properly :D
literals still won't work due to libb not being complete
(with all the talk going around about SSA, I may as well start to prepare :p)
Also removes the dependency on objcopy, as the linker script now just emits a raw binary to be fed into fxgxa
It does seem like tests are building, but my local runners show a runtime error(?!)
This looks fun. Absolutely random remarks, may help, may not: linker script ROM size 2 MB, nothing "new" there any more, RAM always 512 kB (mapped by MMU), the small offset is related to data the OS puts in there but you can ignore it. All SH reads from memory are sign-extended and immediate-mov is too. PC-relative moves and branches in delay slots is an exception, if you trust your compiler to produce correct code there's no need to worry about it. The
No need for Please ping if you get something fun to work 👀 |
@seija-amanojaku sorry that it's taking so long to come to any conclusion on this PR. It's extremely cool, but depends on too much of exotic stuff. It either has to become more self-contained, or I need to finish decoupling the codegens from the compiler so we can put it in a separate repo. I'm slowly working on the decoupling. |
I should start decoupling work
now its time to get rid of the GNU dependency
There is also bytecode in #184 for that |
This PR introduces a backend to compile freestanding and "libb-ful" B programs for fx-CG10/20/50 calculators (with CPUs based on a FPUless SH4).
EDIT: Division and modulo are implemented as calls to
intrisic_div
andintrisic_mod
. To be completely frank, I think this is the best way to pull things off, since the SH-4 architecture is designed in such a way that division is best kept as an external routine.It also effectively requires a working SuperH crosscompiler/
fxgxa
to generate a.g3a
executable.