This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, ARM] New feature to minimize the literal load for armv7-m target


On 21/11/13 02:53, Terry Guo wrote:
> BR,
> Terry
> 
> 2013-11-21  Terry Guo  <terry.guo@arm.com>
> 
>                  * doc/invoke.texi (-mslow-flash-data): Document new option.
>                  * config/arm/arm.opt (mslow-flash-data): New option.
>                  * config/arm/arm-protos.h
> (arm_max_const_double_inline_cost): Declare it.
>                  * config/arm/arm.h (TARGET_USE_MOVT): Always true when
>                  literal pools are disabled.
>                  (arm_disable_literal_pool): Declare it.
>                  * config/arm/arm.c (arm_disable_literal_pool): New
> variable.
>                  (arm_option_override): Handle new option.
>                  (thumb2_legitimate_address_p): Invalidate memory operand
>                  (mem (symbol_ref "")) to avoid the use of literal pools
> when literal
>                  pools are disabled.
Don't allow symbol references when literal pools are disabled.

>                  (arm_max_const_double_inline_cost): New function.
>                  * config/arm/arm.md (types.md): Include it before ...
>                  (use_literal_pool): New attribute.
>                  (enabled): Use new attribute.
>                  (split pattern): Replace symbol+offset with MOVW/MOVT.
> 
> 

> diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
> index 0d68f01..f453309 100644
> --- a/gcc/config/arm/arm.c
> +++ b/gcc/config/arm/arm.c
> @@ -869,6 +869,9 @@ int arm_arch_thumb_hwdiv;
>     than core registers.  */
>  int prefer_neon_for_64bits = 0;
>  
> +/* Nonzero if we shouldn't use literal pools.  */
> +bool arm_disable_literal_pool = 0;
> +

Use false, not 0.

> @@ -2573,6 +2576,16 @@ arm_option_override (void)
>    if (TARGET_APCS_FRAME)
>      flag_shrink_wrap = false;
>  
> +  /* We only support -mslow-flash-data on armv7-m targets.  */
> +  if (target_slow_flash_data
> +      && ((!(arm_arch7 && !arm_arch_notm) && !arm_arch7em)
> +	  || (TARGET_THUMB1 || flag_pic || TARGET_NEON)))
> +    error ("-mslow-flash-data only supports non-pic code on armv7-m targets");
> +
> +  /* Currently, for slow flash data, we just disable literal pools.  */
> +  if (target_slow_flash_data)
> +    arm_disable_literal_pool = 1;
> +

Use true.

> diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
> index 6fc56b9..071e0c5 100644
> --- a/gcc/doc/invoke.texi
> +++ b/gcc/doc/invoke.texi
> @@ -12326,6 +12327,13 @@ Enables using Neon to handle scalar 64-bits operations. This is
>  disabled by default since the cost of moving data from core registers
>  to Neon is high.
>  
> +@item -mslow-flash-data
> +@opindex mslow-flash-data
> +The v7 m-profile only option.

This option is only supported when compiling for ARMv7 M-profile.

OK with those changes.

R.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]