<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div>Hello,</div><div><br></div><div>As I understand, in LLVM IR it cannot be determined whether a register of type int is signed or unsigned.</div><div>If one wants to convert an integer to a double, which instruction should be used: <span><span class="llvm_keyword">"uitofp" or </span></span><span><span class="llvm_keyword">"sitofp" ?</span></span></div><div><br><span><span class="llvm_keyword"></span></span></div><div><br><span><span class="llvm_keyword"></span></span></div><div><span><span class="llvm_keyword">We track the values taken by all load instructions and we process them using a function. If the value is a pointer, we use int64 as the type of the function argument.</span></span></div><div><span><span class="llvm_keyword">But in case the load instruction loads from a scalar, we need to convert it to a unique type, which
we chose to be DoubleTy and use a function that expects a double as parameter.<br></span></span></div><div><span><span class="llvm_keyword">Hence, we need to convert integers of various sizes to double. Is it possible to detect which instruction should be used (</span></span><span><span class="llvm_keyword">"uitofp" or </span></span><span><span class="llvm_keyword">"sitofp" </span></span><span><span class="llvm_keyword">) ?</span></span></div><div><br><span><span class="llvm_keyword"></span></span></div><div><span><span class="llvm_keyword">Thank you,</span></span></div><div><span><span class="llvm_keyword">Alexandra<br></span></span></div><div><br><span><span class="llvm_keyword"></span></span></div><div><span><span class="llvm_keyword"><br></span></span></div></div></body></html>