<div dir="ltr">Actually, my problem is about the formal parameters. It adds 4 to base address.<div><br></div><div>C Code:</div><div><div>void foo(int *dst,int *src){</div><div><span class="" style="white-space:pre"> </span>dst[0] = src[0] + src[1];</div>
<div>}</div></div><div><br></div><div>Assembly Code:</div><div><div>! BB#0:</div><div><span class="" style="white-space:pre"> </span>addi<span class="" style="white-space:pre"> </span>$R2, $RSP, #4</div><div><span class="" style="white-space:pre"> </span>stram<span class="" style="white-space:pre"> </span>$R2, $R60</div>
<div><span class="" style="white-space:pre"> </span>addi<span class="" style="white-space:pre"> </span>$R3, $RSP, #0</div><div><span class="" style="white-space:pre"> </span>stram<span class="" style="white-space:pre"> </span>$R3, $R61</div>
<div><span class="" style="white-space:pre"> </span>addi<span class="" style="white-space:pre"> </span>$R3, $R61, #4</div><div><span class="" style="white-space:pre"> </span>ldram<span class="" style="white-space:pre"> </span>$R3, $R3</div>
<div><span class="" style="white-space:pre"> </span>ldram<span class="" style="white-space:pre"> </span>$R4, $R61</div><div><span class="" style="white-space:pre"> </span>add<span class="" style="white-space:pre"> </span>$R3, $R4, $R3</div>
<div><span class="" style="white-space:pre"> </span>ldram<span class="" style="white-space:pre"> </span>$R2, $R2</div><div><span class="" style="white-space:pre"> </span>stram<span class="" style="white-space:pre"> </span>$R2, $R3</div>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-20 17:41 GMT+03:00 Tom Stellard <span dir="ltr"><<a href="mailto:tom@stellard.net" target="_blank">tom@stellard.net</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Fri, Jun 20, 2014 at 05:07:47PM +0300, Ramin Guner wrote:<br>
> Hi all,<br>
><br>
> All of the data types are 32 bits and the pointer is 32 bit. Therefore, I<br>
> need word adressing instead of byte adressing to use 8 GB memory.<br>
><br>
> I was told that R600 uses word adressing and I looked at its codes but I<br>
> could not find where the backends handles word adressing.<br>
><br>
> Do you have any ideas about it?<br>
><br>
<br>
</div></div>See the function R600TargetLowering::LowerSTORE() in R600ISelLowering.cpp.<br>
<br>
The lowering on R600 looks like this:<br>
<br>
(store $val, $ptr) -> (store $val (DWORDADDR (srl $ptr, 2)))<br>
<br>
DWORDADDR is just a placeholder node to indicate that the pointer has<br>
already been converted to dword addressing. It is discarded during<br>
instruction selection.<br>
<br>
-Tom<br>
<br>
> Thanks in advance.<br>
<br>
> _______________________________________________<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" target="_blank">http://llvm.cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br>
</blockquote></div><br></div>