Home | Forums | What's new | Resources | |
Ccsh |
vbt - Jul 14, 2007 |
RockinB | Jul 14, 2007 | |||
Of course it's worth to be published, even if it's only for historical purpose. Maybe todays gcc has surpassed that older cc, maybe not. The thing which would make it interesting for me would be some Saturn specific options. Like the SGL uses a register for a pointer to the SGL data structures (WORKAREA), a register that's not used for other stuff and thus does not need to be saved and restored. |
antime | Jul 14, 2007 | |||
The compiler is available in the Psy-Q package on my site (and I assume the package of the same name in the developer tools section here). It might be of interest to archivalists, but is unlikely to be of any practical value. |
antime | Jul 14, 2007 | |||||||||||
There's a section in the GCC manual on how to create a global register variable. However AFAIK there is no way to make GCC use GBR-indexed addressing which I guess is what you're really after. For example, when you compile this:
Code:
Code:
|
mrkotfw | Aug 5, 2007 | |||
Thanks for clearing that up antime. So the GBR register is just an address that is commonly used within a program? |
antime | Aug 5, 2007 | |||||||
GBR is an index register that is intended to be used as a pointer to global data (the full name is after all Global Base Register). However it only has a single addressing mode and a limited range which reduces its usefulness. It would however be a pretty good fit for something like a pointer to the SGL workarea, though even that struct may be too large. Digging a little further, I was incorrect regarding GCC. It can use GBR for thread-local storage, but is still unable to generate GBR-indexed addressing modes. The SuperH TLS spec... says that thread-local objects are accessed via address variables generated by the linker, so there may not be much motivation to implement the feature. Here's a modified example:
Code:
Code:
I don't know if using TLS requires some special support from the runtime if you do want to use the feature. |