[LLVMdev] Troubling promotion of return value to Integer ...

Duncan Sands baldrick at free.fr
Fri May 16 15:00:29 PDT 2008


> >> If you are using a non-C ABI, then you may not need to do the
> >> promotion at all. However, if you do need to do the promotion, you
> >> need to know the type of "int".
> >
> > how does this work for parameters.  Suppose I have an i1 parameter.
> > The AMD64 ABI says it is passed in one of %rsi, %rdx, %rcx, %r8 and
> > %r9 registers.  In the case of _Bool (i1) it says that the upper 63
> > bits will be zero.  How does this work?  I thought i1 would be  
> > legalized
> > to i8 (which is legal, right?).  Due to being marked zext, the upper
> > 7 bits of the i8 will be zero.  But where does it get extended to
> > an i64 with upper 63 bits zero?
> 
> X86ISelLowering will promote the i8 parameters to i32.

OK, so why doesn't it work the same for return values?

Ciao,

Duncan.



More information about the llvm-dev mailing list