<div dir="ltr">Hi Tim,<div><br></div><div>Thank you for reply.</div><div><br></div><div><span style="color:rgb(80,0,80);font-size:12.8000001907349px">> llvm::Value *intermediateValue = LLVMIRBuilder->CreateLShr(</span><span style="color:rgb(80,0,80);font-size:12.8000001907349px">x64BitValue, 32);</span><br style="color:rgb(80,0,80);font-size:12.8000001907349px"></div><div><font color="#500050"><span style="font-size:12.8000001907349px">Now I am using below to calculate upper 32bits, I think this is OK,</span></font></div><div><font color="#500050"><span style="font-size:12.8000001907349px"><div style=""><span class="" style="white-space:pre">        </span>llvm::Value *intermediateValue = LLVMIRBuilder->CreateAnd(x64BitValue, 0xFFFFFFFF00000000); </div><div style=""><span class="" style="white-space:pre">        </span>intermediateValue = LLVMIRBuilder->CreateLShr(intermediateValue, 32); </div><div style="">    //cast value to 32 bit</div><div style="">    intermediateValue = castValueByOpSize(intermediateValue, 32);</div><div style=""><br></div><div style=""><br></div><div style="">Regards,</div><div style="">Deep</div></span></font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 25, 2015 at 7:12 PM, Tim Northover <span dir="ltr"><<a href="mailto:t.p.northover@gmail.com" target="_blank">t.p.northover@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 24 September 2015 at 22:12, Sandeep Kumar Singh via llvm-dev<br>
<span class=""><<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> I need to fetch lower and higher 32bits from 64bit value. I found<br>
> "CreateLShr" function to fetch lower 32bits,<br>
> llvm::Value *intermediateValue = LLVMIRBuilder->CreateLShr(x64BitValue, 32);<br>
<br>
</span>That would give you the upper bits, I think.<br>
<span class=""><br>
> What function I need to use for fetching upper 32bits from 64bit value.<br>
<br>
</span>There's multiple ways to get the other half: "x & 0xffffffff" is the<br>
canonical one (LLVM's optimisers will convert the others into that if<br>
they can).<br>
<br>
Cheers.<br>
<span class="HOEnZb"><font color="#888888"><br>
Tim.<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><br>Thanks and Regards,<br>Sandeep Kumar Singh</div>
</div>