<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div>The address qualifier is stored in the type of %result.  From that operand, you can get the Value and then call getType.  The type for result  should be a PointerType which you cast to a PointerType and get the getAddressSpace e.g. <span class="Apple-style-span" style="font-family: Monaco; font-size: 10px; ">cast<<span style="color: #3f6e74">PointerType</span>>(<span style="color: #3f6e74">Ty</span>)->getAddressSpace()</span><div><div><br></div><div>-- Mon Ping</div><div><br></div><div><div><div><div><br><div><div>On Sep 17, 2008, at 1:06 PM, Villmow, Micah wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="Street">
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="City">
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="place">
<o:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="address">
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
@font-face
        {font-family:"\@MS Mincho";
        panose-1:2 2 6 9 4 2 5 8 3 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>



<div lang="EN-US" link="blue" vlink="purple">

<div class="Section1"><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">How do I access the address qualifier from the store instruction.<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Given the following code:<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">define void @test_unary_op_anegate(float %x, float
addrspace(11)* %result) nounwind  {<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">entry:<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">        %neg = sub float
-0.000000e+000,
%x             ;
<float> [#uses=1]<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">        store float %neg,
float addrspace(11)* %result<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">        ret void<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">}<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">When I attempt to generate this code, I’m aborting on.<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Cannot yet select: 017E8230: ch = store 017E7DF0, 017E8098,
017E8010, 017E81A8 <0035A078:0> alignment=4<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">So I am doing a custom Store function.<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">In my LowerStore function, I get an SDValue w/ opcode of
119(store) and 4 child Operands<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Operand 0 is the entry token which I assume I can ignore<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Operand 1 is the source data(%neg), which I finally can
handle correctly thanks to Eli<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Operand 2 is the dst location with two children, an
EntryToken and Register(%result I’m guessing)<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Operand 3 is undef<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">So, how do I find out the address space? The reason being
different address spaces are accessed with different registers.<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Thanks,<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><o:p> </o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Micah Villmow<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Systems Engineer<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Advanced Technology & Performance<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">Advanced Micro Devices Inc.<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><ns7:street w:insauthor="Micah Villmow" w:insdate="2008-09-17T12:57:00Z" w:endinsauthor="Micah Villmow" w:endinsdate="2008-09-17T12:57:00Z"><ns7:address w:insauthor="Micah Villmow" w:insdate="2008-09-17T12:57:00Z" w:endinsauthor="Micah Villmow" w:endinsdate="2008-09-17T12:57:00Z"><st1:street w:st="on"><st1:address w:st="on">4555
    Great America Pkwy</st1:address></st1:street></ns7:address></ns7:street>,<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial"><ns7:place w:insauthor="Micah Villmow" w:insdate="2008-09-17T12:57:00Z" w:endinsauthor="Micah Villmow" w:endinsdate="2008-09-17T12:57:00Z"><ns7:city w:insauthor="Micah Villmow" w:insdate="2008-09-17T12:57:00Z" w:endinsauthor="Micah Villmow" w:endinsdate="2008-09-17T12:57:00Z"><st1:city w:st="on"><st1:place w:st="on">Santa
    Clara</st1:place></st1:city></ns7:city></ns7:place>, CA. 95054<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">P: 408-572-6219<o:p></o:p></span></font></p><p class="MsoNormal"><font size="2" face="Arial"><span style="font-size:10.0pt;
font-family:Arial">F: 408-572-6596</span></font><font size="2" face="Arial"><span style="font-size:10.0pt;font-family:Arial"><o:p></o:p></span></font></p><p class="MsoNormal"><font size="3" face="Times New Roman"><span style="font-size:
12.0pt"><o:p> </o:p></span></font></p>

</div>

</div>


_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></o:smarttagtype></o:smarttagtype></o:smarttagtype></o:smarttagtype></blockquote></div><br></div></div></div></div></div></body></html>