<soum...@nvidia.com> writes:
> +/* Mapping structure for enum-to-string conversion.  */
> +template <typename EnumType> struct enum_mapping
> +{
> +  const char *name;
> +  EnumType value;
> +};
> +
> +static const enum_mapping<tune_params::aarch64_autoprefetch_model>
> +  autoprefetcher_model_mappings[]
> +  = {{"AUTOPREFETCHER_OFF", tune_params::AUTOPREFETCHER_OFF},
> +     {"AUTOPREFETCHER_WEAK", tune_params::AUTOPREFETCHER_WEAK},
> +     {"AUTOPREFETCHER_STRONG", tune_params::AUTOPREFETCHER_STRONG}};
> +
> +static const enum_mapping<aarch64_ldp_stp_policy> ldp_policy_model_mappings[]
> +  = {{"AARCH64_LDP_STP_POLICY_DEFAULT", AARCH64_LDP_STP_POLICY_DEFAULT},
> +     {"AARCH64_LDP_STP_POLICY_ALIGNED", AARCH64_LDP_STP_POLICY_ALIGNED},
> +     {"AARCH64_LDP_STP_POLICY_ALWAYS", AARCH64_LDP_STP_POLICY_ALWAYS},
> +     {"AARCH64_LDP_STP_POLICY_NEVER", AARCH64_LDP_STP_POLICY_NEVER}};
> +
> +static const enum_mapping<aarch64_ldp_stp_policy> stp_policy_model_mappings[]
> +  = {{"AARCH64_LDP_STP_POLICY_DEFAULT", AARCH64_LDP_STP_POLICY_DEFAULT},
> +     {"AARCH64_LDP_STP_POLICY_ALIGNED", AARCH64_LDP_STP_POLICY_ALIGNED},
> +     {"AARCH64_LDP_STP_POLICY_ALWAYS", AARCH64_LDP_STP_POLICY_ALWAYS},
> +     {"AARCH64_LDP_STP_POLICY_NEVER", AARCH64_LDP_STP_POLICY_NEVER}};

I agree with Andrew that it would be nice in principle to be able
to autogenerate this.  I'm personally happy without that while it
remains this small, but I think it would at least be worth sharing
this between the parsing and serialising code, rather than having
separate lists for each.

> diff --git a/gcc/config/aarch64/aarch64.opt b/gcc/config/aarch64/aarch64.opt
> index 9ca753e6a88..830da394493 100644
> --- a/gcc/config/aarch64/aarch64.opt
> +++ b/gcc/config/aarch64/aarch64.opt
> @@ -188,6 +188,10 @@ mabi=
>  Target RejectNegative Joined Enum(aarch64_abi) Var(aarch64_abi) 
> Init(AARCH64_ABI_DEFAULT)
>  Generate code that conforms to the specified ABI.
>  
> +fdump-tuning-model=
> +Target RejectNegative Negative(fdump-tuning-model=) ToLower Joined 
> Var(fdump_tuning_model)

Could you explain the reason for Negative(fdump-tuning-model=) and ToLower?

The option should be documented in invoke.texi, or marked Undocumented if
we really don't want to put it in the manual.

Thanks,
Richard

> +Dump current tuning model to a JSON file.
> +
>  moverride=
>  Target RejectNegative ToLower Joined Var(aarch64_override_tune_string) Save
>  -moverride=<string>  Power users only! Override CPU optimization parameters.
> diff --git a/gcc/config/aarch64/t-aarch64 b/gcc/config/aarch64/t-aarch64
> index 38a8c063725..2378767780e 100644
> --- a/gcc/config/aarch64/t-aarch64
> +++ b/gcc/config/aarch64/t-aarch64
> @@ -208,6 +208,15 @@ aarch64-ldp-fusion.o: 
> $(srcdir)/config/aarch64/aarch64-ldp-fusion.cc \
>       $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
>               $(srcdir)/config/aarch64/aarch64-ldp-fusion.cc
>  
> +aarch64-json-tunings-printer.o: 
> $(srcdir)/config/aarch64/aarch64-json-tunings-printer.cc \
> +    $(CONFIG_H) $(SYSTEM_H) $(CORETYPES_H) $(TM_H) $(DIAGNOSTIC_CORE_H) \
> +    $(PRETTY_PRINT_H) json.h \
> +    $(srcdir)/config/aarch64/aarch64-json-tunings-printer.h \
> +    $(srcdir)/config/aarch64/aarch64-protos.h \
> +    $(srcdir)/config/arm/aarch-common-protos.h
> +     $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> +             $(srcdir)/config/aarch64/aarch64-json-tunings-printer.cc
> +
>  comma=,
>  MULTILIB_OPTIONS    = $(subst $(comma),/, $(patsubst %, mabi=%, $(subst 
> $(comma),$(comma)mabi=,$(TM_MULTILIB_CONFIG))))
>  MULTILIB_DIRNAMES   = $(subst $(comma), ,$(TM_MULTILIB_CONFIG))

Reply via email to