[LLVMdev] promotion of return value.

Rafael Espindola espindola at google.com
Wed Apr 1 01:14:10 PDT 2009


> I still don't think llvm needs to do this.  We had the discussion on
> http://groups.google.com/group/ia32-abi/browse_thread/thread/f47e0106b21d9269
>
> The conclusion:
>
> ---
> I think callers need to assume that return value is in %al and that
> the upper bits of %eax are undefined.  If the caller needs a 32-bit
> sign- or zero-extended value, it needs to do the extend itself.  I
> believe GCC, ICC, and MSVC all behave this way.
>
> Given that, it shouldn't matter how the callee handles the upper
> bits.  It should do whatever is most convenient.


Exactly. Note that y returns a short, and z  wants an int. It is
z's responsibility to do a sign extension. The example claims that a
sign extension is not necessary.

> ---
>
> Andrew.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047




More information about the llvm-dev mailing list