I did GCC too, https://github.com/puppeh/vc4-toolchain .
Yeah, I saw, I haven't looked at it in detail but I think yours probably works better than mine since you did comprehensive testing. My only tests involved compiling my own firmware code, but from what I can tell, it works well, I haven't ran into any bugs yet aside from what I outlined in the README. The assembler/linker I'm using is not ideal, I want to get MC code emission working eventually. I saw that you mentio…
LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
51–54 of 54 posts
Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
#52It bugs me that LLVM targets are not properly 'plug in'. LLVM backends can be in a plugin, but you have to tell the frontend which target to use (so it can use the correct data-layout etc). Its the frontends that don't support plug-in targets. Clang, for example, hardcodes the supported targets. A combination of using enums as a 'target triple' and lack of dynamic target registration conspire against easy-to-use out-…
Out-of-tree targets for LLVM are generally a bad idea given how fast LLVM is changed. Every change could break the out-of-tree target, and being out-of-tree, there's no way the upstream developers could notice that.
I wish we had a more stable API (maybe with a transformation layer) for the backends that may not probably need much of the new features. If LLVM had a maintained transformation layer from the "current" SelectionDAG to a stable one, it would have helped a lot.
Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
#53Earlier quoted context omitted.
Why is this beneficial? It means you need to change several repositories to add one target triple. This may be a win in terms of in-tree stability, but it reduces accessibility to everyone else.
It is beneficial in that it discourages proprietary backends to LLVM which are not contributed back to LLVM. It is the same benefit GCC enjoys by using GPL.
Hardware companies are very touchy about the patents, and not publishing an ISA-related work may often be the only way to protect from the trolls.
Such companies would often encourage (privately or publicly) clean room 3rd party backends, and I'm pretty sure that the one we're discussing here is exactly of this kind. But they would be scared to death to allow any of their employees to even send a tiny patch to a compiler backend, if it could expose some microarchitecture knowledge that was not published.
Re: LLVM Backend for the VideoCore4, Raspberry Pi 2 VPU
#54Earlier quoted context omitted.
Thanks for making this work! I'd given up on the LLVM backend completely due to showstopping issues I couldn't resolve, and had assumed it had vanished into the aether. Glad to know you found it useful! Regarding the boot loader, have you seen my piface boot loader? http://cowlark.com/piface/ It sounds like what you have is way more sophisticated, as I never got SDRAM init working properly, but you never know --- the…
Yeah I looked at it, my firmware mostly just aims at bringing up enough stuff to be able to boot ARM, which is essentially just: - Setting up exception vectors and enabling exceptions - Reclocking VPU from PLLC - UART initialization - SDRAM initialization - Copying an ARM blinker stub to 0x0 - ARM power domain initialization - PLLB initialization - Enabling passthrough mapping for ARM - ARM AXI interface initilaizati…
Random question: how did you do 64 bit arithmetic? I couldn't find any kind of add-with-carry or subtract-with-carry instruction. I was semi-resigning myself to have to do a compare-and-test as well as the add, which would have more than doubled the amount of work.
Also, nice work reverse engineering the ARM controller --- how did you get the info?