<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>Thank you for the prompt response, Matt.</div><br><div><div>On Jan 20, 2014, at 3:03 PM, Matt Arsenault <<a href="mailto:Matthew.Arsenault@amd.com">Matthew.Arsenault@amd.com</a>> wrote:</div><blockquote type="cite"><div text="#000000" bgcolor="#FFFFFF">Since 3.4 you need to use the addrspacecast instruction to cast
    between address spaces. It's possible there are still some places
    left that haven't been fixed yet to use it instead of creating
    bit casts.<br></div></blockquote><div><br></div><div><div>Are you saying you think this is a bug and it should in fact be generating an addrspacecast? I will be looking into making this change, and if it would be accepted as a bug fix, I’d be happy to submit it.</div></div><br><blockquote type="cite"><div text="#000000" bgcolor="#FFFFFF"><blockquote cite="mid:4B51F3E8-6ED6-43DF-ACF6-E6C65E29E600@cs.washington.edu" type="cite"><div>2. Is there a way to create methods that can be called with
        pointers to different address spaces? It seems there is no way
        to declare these in C++ using GNU attributes, and addrspace()
        seems to not be supported by C++11 attribute syntax, which could
        possibly express this.</div>
    </blockquote>
    You can use __attribute__((address_space(N))<br></div></blockquote><div><br></div><div>I have already been using that syntax to annotate pointer declarations. However I don’t think it can be applied to methods the way I was thinking. At least it doesn’t actually change them:</div><div><br></div><div><div style="font-size: 11px;"><font face="Inconsolata LGC">struct Foo {</font></div><div style="font-size: 11px;"><font face="Inconsolata LGC">  long x;</font></div><div style="font-size: 11px;"><font face="Inconsolata LGC">  </font></div><div style="font-size: 11px;"><font face="Inconsolata LGC">  __attribute__((address_space(7))) void bar(long y) {</font></div><div style="font-size: 11px;"><font face="Inconsolata LGC">    printf("%ld %ld\n", x, y);</font></div><div style="font-size: 11px;"><font face="Inconsolata LGC">  }</font></div><div style="font-size: 11px;"><font face="Inconsolata LGC">};</font></div><div><br></div><div>Generates this declaration still:</div><div><br></div><div style="font-size: 11px;"><font face="Inconsolata LGC">define linkonce_odr void @_ZN3Foo3barEl(%struct.Foo* %this, i64 %y) ssp uwtable align 2</font></div></div><div><br></div><div>Though I think desired behavior would be:</div><div><br></div><div style="font-size: 11px;"><font face="Inconsolata LGC">define linkonce_odr void @_ZN3Foo3barEl(%struct.Foo <u>addrspace(7)</u>* %this, i64 %y) ssp uwtable align 2</font></div><div><br></div><div>(actually I think it’s more tricky because the address_space attribute could be applying to the return type. I’d think the correct way to specify the attribute on “this” would be to put it where “const” goes, after the parentheses)</div><div><br></div></div><br></body></html>