Am Mittwoch, dem 05.07.2023 um 07:26 +0200 schrieb Rafał Pietrak: > Hi, > > W dniu 5.07.2023 o 00:57, Martin Uecker pisze: > > Am Dienstag, dem 04.07.2023 um 16:46 +0200 schrieb Rafał Pietrak:... > [--------] > > > > > > Yes. named address spaces would be great. And for code, too. > > > > > > > While certainly some work, implementation effort for > > new kinds of named address spaces does not seem to be > > terrible at first glance: > > > > https://gcc.gnu.org/onlinedocs/gccint/target-macros/adding-support-for-named-address-spaces.html > > Oh! I see. this is good news. Although that internals documentation is > complete black magic to me and I cannot tell heads from tails in it, the > surrounding comments sound promising... like GCC-13 actually had the > internal "machinery" supporting named address spaces and just > cpu-platform specific code is missing (for all but "SPU port"). Is that > right?
It seems like this. I would need to do more research. > > And if it's so ... there is no mention of how does it show up for > "simple user" of the GCC (instead of the use of that "machinery" by > creators of particular GCC port). In other words: how the sources should > look like for the compiler to do "the thing"? > Not sure I understand the question. You would add a name space to an object as a qualifier and then the object would be allocated in a special (small) region of memory. Pointers known to point into that special region of memory (which is encoded into the type) would then be smaller. At least, this is my understanding of how it could work. Martin