Can I use address space indices in Rust-llvm?

Hi, I want to use "Memory references off the GS segment" in Rust.
Below is an example of it in clang.

#define GS_RELATIVE __attribute__((address_space(256)))
int foo(int GS_RELATIVE *P) {
return *P;
Which compiles to (on X86-32):
movl 4(%esp), %eax
movl %gs:(%eax), %eax

Check on page 128

i don't think this is currently possible without using (inline) assembly

for AMDGCN (GPU) there has been some work on supporting address spaces:, but this was never merged not even unstable

proposals to make it easier to 'punch through' LLVM attributes tend to be rejected because of not wanting to tie the language too closely to LLVM:

FYI, supporting the Atmel AVR family of µCs is also blocked on the need for properly supporting address spaces.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.