looks good to me. Can you change the comments regarding AMD_64 ABI to
X86_64 ABI?
Thx!
Sun

On Sat, Jun 18, 2011 at 5:44 AM, David Coakley <dcoak...@gmail.com> wrote:
> The attached patch is a revision of a patch I had posted a few weeks
> ago ("patch for better AMD64 ABI compatibility").  Most of the code
> related to ABI compatibility has been committed in r3652.  The
> motivation for the patch is to reduce unnecessary copying of structs,
> especially when used as return values in C++.
>
> We have generalized the patch to remove ABI-dependent code from wgen
> and retested; Need_Hidden_Parameter() is no longer needed.
>
> Here is the proposed commit message:
>
> Avoid unnecessary struct copies.
>
> For the following code, the compiler generated unnecessary struct copies
> for a return value that has a size too big to be passed in registers.
>
>  typedef struct { char big[1024]; } C;
>  C gc;
>  extern C bar9 (void);
>  extern C check9 (void) { return bar9 (); }
>
> In this case there were two copies and one temporary variable generated.
> After this change the compiler does not generate any extra copies.
>
> The change handles the similar cases of initialization by function
> call ("C c = bar9();") and assignment to a pointer ("*cp = bar9()").
>
> For struct return values, the patch also includes a fix to follow the
> AMD64 ABI: the caller provides space for the return value in a hidden
> first argument and this address is returned in %rax or %eax for a
> 32-bit target.  Previously the compiler was not following this rule.
>
>
> Could a gatekeeper please review the changes?  Yin, please let us know
> if the revision addresses your concerns.
>
> -David Coakley / AMD Open Source Compiler Engineering
>
> ------------------------------------------------------------------------------
> EditLive Enterprise is the world's most technically advanced content
> authoring tool. Experience the power of Track Changes, Inline Image
> Editing and ensure content is compliant with Accessibility Checking.
> http://p.sf.net/sfu/ephox-dev2dev
> _______________________________________________
> Open64-devel mailing list
> Open64-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open64-devel
>
>

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to