This patch looks fine to me.

在 2010年10月8日 下午7:04,Chen, Rui (Roger, TSG-GDCC-SH) <rui.c...@hp.com>写道:

> I modified the patch a little bit, defined a PU_HAS_APPLY_ARGS flag in
> symtab_defs.h, and set this flag in wgen. So I don’t need to traverse the
> whole WHIRL tree later.
>
>
>
> Pls help to review the changes.
>
>
>
> Regards,
>
> Roger
>
>
>
> *From:* Chen, Rui (Roger, TSG-GDCC-SH)
> *Sent:* 2010年9月25日 14:23
> *To:* open64-devel@lists.sourceforge.net
> *Subject:* Review request for implement three gcc builtin functions
>
>
>
> Hi all,
>
>
>
> This is a fix for bug 598 (https://bugs.open64.net/show_bug.cgi?id=598):
> implement 3 gcc builtin functions on x86-64: __builtin_apply_args /
> __builtin_apply / __builtin_return.
>
>
>
> Here are the descriptions of those 3 functions:
>
>
>
> Constructing Function Calls
>
>
>
> Using the built-in functions described below, you can record the arguments
> a
>
> function received, and call another function with the same arguments,
> without
>
> knowing the number or types of the arguments.
>
>
>
> You can also record the return value of that function call, and later
> return
>
> that value, without knowing what data type the function tried to return (as
>
> long as your caller expects that data type).
>
>
>
>     * __builtin_apply_args
>
>     * __builtin_apply
>
>     * __builtin_return
>
>
>
> __builtin_apply_args
>
>
>
> void *__builtin_apply_args (void);
>
>
>
> This built-in function returns a pointer to data describing how to perform
> a
>
> call with the same arguments as were passed to the current function.
>
>
>
> The function saves the arg pointer register, structure value address, and
> all
>
> registers that might be used to pass arguments to a function into a block
> of
>
> memory allocated on the stack. Then it returns the address of that block.
>
> __builtin_apply
>
>
>
> void *__builtin_apply (void (*fnc)(), void *args, int size);
>
>
>
> This built-in function invokes function with a copy of the parameters
> described
>
> by arguments and size.
>
>
>
> The value of arguments should be the value returned by
> __builtin_apply_args.
>
> The argument size specifies the size of the stack argument data, in bytes.
>
>
>
> This function returns a pointer to data describing how to return whatever
> value
>
> was returned by function. The data is saved in a block of memory allocated
> on
>
> the stack.
>
>
>
> It is not always simple to compute the proper value for size. The value is
> used
>
> by __builtin_apply to compute the amount of data that should be pushed on
> the
>
> stack and copied from the incoming argument area.
>
> __builtin_return
>
>
>
> void __builtin_return (void *result);
>
>
>
> This built-in function returns the value described by result from the
>
> containing function. You should specify, for result, a value returned by
>
> __builtin_apply.
>
>
>
> I attached the diff file and test case. Could someone please review this
> change?
>
>
>
> Regards,
>
> Roger
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> Open64-devel mailing list
> Open64-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/open64-devel
>
>


-- 
Regards,
Lai Jian-Xin
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel

Reply via email to