[PATCH v2 1/2] config/arm: strict use of -mcpu for supported CPUs
Thomas Monjalon
thomas at monjalon.net
Mon Nov 11 15:12:42 CET 2024
Please check the CI results, there are some failures.
29/10/2024 02:59, Wathsala Vithanage:
> Arm recommends using -mcpu over -march and march-extensions when the
> compiler supports the target CPU (neoverse-n1 etc.). Arm build so far
> has been an amalgam of -mcpu and -march. When march is in use, it has
> been the case so far to silently fall back to a downgraded march when
> the compiler does not support the requested march. This is unnecessary
> and confusing to an end user who could be building DPDK with a
> particular ISA version and performance expectations in mind.
>
> This patch aims to rectify both the above issues. For part numbers that
> has a corresponding -mcpu, this patch removes all references to march
> and march_features from meson.build. For those SOCs that do not have a
> corresponding -mcpu, a pseudo cpu name in the format mcpu_<soc_name> is
> introduced and referenced in the mcpu field in the part number
> dictionary of the part_number_config dictionary. The definition of the
> mcpu_<soc_name> must be provided in the mcpu_defs dictionary.
> Each mcpu_<soc_name> dictionary in the mcpu_defs have a march field and
> a march_extensions field to construct the optimal compiler setting for
> an SOC that has no corresponding -mcpu value. This patch alters the
> behavior of the build system such that it will no longer silently fall
> back to an older ISA version, it will only perform what's specified in
> the build dictionaries, if the compiler does not support the specified
> configuration it will fail with an error message.
>
> How to add a new SOC to the build system with these changes?
> If compiler supports mcpu follow the usual practice but without march
> and march_features fields in the part number dictionary. If mcpu is not
> available or buggy (misses certain features) for some reason follow the
> same process but set mcpu field to a string in the form 'mcpu_foo'
> (pseudo mcpu mentioned earlier). Then in the mcpu_defs dictionary add
> mcpu_foo dictionary as shown.
>
> 'mcpu_foo': {
> 'march': 'armv8.2-a',
> 'march_extensions': [rcpc]
> }
>
> march_extensions is a comma separated list of march extensions supported
> by the compiler such as sve, crypto etc. Empty match_extensions allowed
> as use of such extensions are optional.
>
> Signed-off-by: Wathsala Vithanage <wathsala.vithanage at arm.com>
> Reviewed-by: Dhruv Tripathi <dhruv.tripathi at arm.com>
More information about the dev
mailing list