named address spaces

Hello,

If my understand is correct, LLVM supports the address_space qualifier; however, how I can add custom address spaces. Where I can declare them? For clang (x86), I saw that address spaces #256 and #257 works well (I see the generated code with the ‘gs’ and ‘fs’), but when I select different ones, I don’t see any different.

Thanks in advance,

Address spaces are target specific. The 256/257 address spaces on x86 are implemented in the X86 backend, for example.

-Chris

Hello,

If I want implement other address spaces (for x86), can I modify my back-end (clang) to support other address spaces (at least two data segments, two heaps, and two stacks?

How will be the mechanism? For example, for256/257, I see two reference points (FS and GP). Would I need to specify a different reference to each memory region? Where is the best site to add the modifications?

Thanks in advance,

Juan Carlos

I don't know what changes you'll need off hand. I think you just refer to them (assigning a magic number) and handle them as the come through the IR.

-Chris