<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Ryan Taylor</b> <span dir="ltr"><<a href="mailto:ryta1203@gmail.com">ryta1203@gmail.com</a>></span><br>Date: Mon, Dec 12, 2011 at 4:58 PM<br>
Subject: Re: [LLVMdev] GetElementPtr<br>To: Eli Friedman <<a href="mailto:eli.friedman@gmail.com">eli.friedman@gmail.com</a>><br><br><br>Sorry,<br><br>  So what I'm trying to ask is are the widths given (32, 64) for the index and the offset the widths of the index and offset values or the width of the type they are offsetting and indexing or both?<br>
<br>
  I apologize if you already answered this and I didn't get it.<div class="HOEnZb"><div class="h5"><br><br><div class="gmail_quote">On Mon, Dec 12, 2011 at 4:50 PM, Eli Friedman <span dir="ltr"><<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Mon, Dec 12, 2011 at 4:46 PM, Ryan Taylor <<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>> wrote:<br>


> So in the second example I gave, why is the pointer type 32 but the index<br>
> type is 64?<br>
<br>
</div>Because that's what the frontend chose the generate?  I'm not sure<br>
what you're trying to ask.<br>
<span><font color="#888888"><br>
-Eli<br>
</font></span><div><div><br>
> On Mon, Dec 12, 2011 at 4:43 PM, Eli Friedman <<a href="mailto:eli.friedman@gmail.com" target="_blank">eli.friedman@gmail.com</a>><br>
> wrote:<br>
>><br>
>> On Mon, Dec 12, 2011 at 4:38 PM, Ryan Taylor <<a href="mailto:ryta1203@gmail.com" target="_blank">ryta1203@gmail.com</a>> wrote:<br>
>> > By LLVM do you mean the backend? I'm not using the backend, so is that<br>
>> > i32<br>
>> > on the 0 index the type of the index value or the type of the value to<br>
>> > which<br>
>> > exists at that index?<br>
>> ><br>
>> > it seems the pointer itself has no width, it's arbitrary and is handled<br>
>> > in<br>
>> > the lowering and is target dependent on the bus width.<br>
>> ><br>
>> > Basically, when I am computing offset I need to know the sizes for add.<br>
>> > The<br>
>> > size of the pointer (dedicated by bus width) and the size of the index.<br>
>><br>
>> The size of the index is simply its type.  You would normally<br>
>> sign-extend or truncate to the width of a pointer to do arithmetic,<br>
>> though.<br>
>><br>
>> You can grab the pointer size from TargetData::getPointerSizeInBits().<br>
>><br>
>> -Eli<br>
><br>
><br>
</div></div></blockquote></div><br>
</div></div></div><br>