[PATCH RFC 1/3] Hookize PROMOTE_FUNCTION_MODE with provision for ARM HFmode

H.J. Lu hjl.tools@gmail.com
Sun Aug 2 02:09:00 GMT 2009


On Tue, Apr 21, 2009 at 6:04 AM, Paolo Bonzini<bonzini@gnu.org> wrote:
> The aim of this series is to cleanup uses of promote_mode and to
> turn all three hooks PROMOTE_FUNCTION_MODE, TARGET_PROMOTE_FUNCTION_RETURN
> and TARGET_PROMOTE_FUNCTION_ARGS into a single hook.  This, among other
> things, should make it simpler to distinguish the passing of HFmode
> values for libcalls and ordinary functions for the ARM.
>
> This first part introduces two new functions.  One is promote_function_mode,
> a low-level function whose semantics and signature are the same as the
> intended target hook.
>
> The second is promote_decl_mode, which wraps the low-level promote_mode
> and promote_function_mode so that it can be used most of the time.
>
> Overall, the series does not succeed in deleting more lines than it adds :-)
> but the result is strictly more powerful, as it allows tweaking the
> promotions *per argument and per function*.  Right now, if a function
> does not want to promote something, it cannot promoting everything.
>
> The patch is being bootstrapped right now on i686-pc-linux-gnu; I
> have already built the relevant targets.
>
> Paolo
>
> 2009-04-17  Paolo Bonzini  <bonzini@gnu.org>
>
>        * expr.c (store_constructor): Use promote_decl_mode.  Remove
>        now write-only variable unsignedp.
>        (expand_expr_real_1): Use promote_decl_mode.
>        * expr.h (promote_function_mode, promote_decl_mode): New.
>        (promote_mode): Remove last argument.
>        * function.c (assign_temp): Drop last argument of promote_mode.
>        (assign_parm_find_data_types): Use promote_function_mode.
>        (assign_parm_setup_reg): Likewise.
>        (expand_function_end): Use promote_function_mode.
>        * calls.c (initialize_argument_information): Use promote_function_mode.
>        (precompute_arguments): Use promote_mode instead of checking if
>        only PROMOTE_FUNCTION_MODE is defined.
>        (expand_call): When making sibcall decisions, use promote_function_mode.
>        Below, remove an if for targetm.calls.promote_function_return and
>        and use promote_function_mode.
>        (emit_library_call_value_1): Use promote_function_mode, fix bug
>        where promote_mode was passed FOR_CALL == 0 for a return value in an
>        assertion.
>        * cfgexpand.c (expand_one_register_var): Use promote_decl_mode.
>        * explow.c (promote_function_mode, promote_decl_mode): New.
>        (promote_mode): Keep only the FOR_CALL == 0 case.
>        * combine.c (setup_incoming_promotion): Remove test of
>        promote_function_args.  Use promote_function_mode.
>        * stmt.c (expand_value_return): Use promote_decl_mode.
>        (expand_decl): Use promote_decl_mode.
>

This series of patches caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40937



-- 
H.J.



More information about the Gcc-patches mailing list