Hi, For a call like this, %tmp6 = call i32 (...)* bitcast (i32 (i8*, i8, i8**)* @ssplit to i32 (...)*)(i8* %tmp599, i32 46, i8** %domainv3) nounwind ; <i32> does the 2nd argument get zero extended or sign extended? Thanks, Arushi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110404/aff5ff6d/attachment.html>
Hi Arushi,> For a call like this, > > %tmp6 = call i32 (...)* bitcast (i32 (i8*, i8, i8**)* @ssplit to i32 (...)*)(i8* > %tmp599, i32 46, i8** %domainv3) nounwind ; <i32> > > does the 2nd argument get zero extended or sign extended?neither since it does not have the zext or sext attribute. Ciao, Duncan.
On Tue, Apr 5, 2011 at 2:35 AM, Arushi Aggarwal <arushi987 at gmail.com> wrote:> For a call like this, > %tmp6 = call i32 (...)* bitcast (i32 (i8*, i8, i8**)* @ssplit to i32 > (...)*)(i8* %tmp599, i32 46, i8** %domainv3) nounwind ; <i32> > does the 2nd argument get zero extended or sign extended?Since you're passing an i32 to a function expecting an i8 I'd actually expect it to get truncated. However, other outcomes are possible. For example, on 16-bit machines[1], this might actually cause the parameters to fail to line up, so while the second parameter would likely be either 0 or 46 there's no telling what the *third* parameter would wind up being. (I'm not sure if LLVM actually supports any such machines though) [1]: In this case meaning machines where a C 'int' is 16 bits, since this depends on the C calling convention for the machine in question.
%tmp63 = call %struct.TypHeader* (...)* bitcast (%struct.TypHeader* (%struct.TypHeader*, i64, i64)* @Cyclotomic to %struct.TypHeader* (...)*)(%struct.TypHeader* %tmp62, i64 %tmp24, i32 1) nounwind, !dbg !907 ; <%struct.TypHeader*> [#uses=1] the 3rd parameter is now used in an srem statement. How do we know what value is used? Does this use decide whether the value is sign extended or zero extended? Arushi On Tue, Apr 5, 2011 at 1:35 AM, Duncan Sands <baldrick at free.fr> wrote:> Hi Arushi, > > > For a call like this, > > > > %tmp6 = call i32 (...)* bitcast (i32 (i8*, i8, i8**)* @ssplit to i32 > (...)*)(i8* > > %tmp599, i32 46, i8** %domainv3) nounwind ; <i32> > > > > does the 2nd argument get zero extended or sign extended? > > neither since it does not have the zext or sext attribute. > > Ciao, Duncan. > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20110405/49028314/attachment.html>