This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][AArch64][2/2] Add sve_width -moverride tunable
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: "Kyrill Tkachov" <kyrylo dot tkachov at foss dot arm dot com>
- Cc: "gcc-patches\@gcc.gnu.org" <gcc-patches at gcc dot gnu dot org>, Marcus Shawcroft <marcus dot shawcroft at arm dot com>, "Richard Earnshaw \(lists\)" <richard dot earnshaw at arm dot com>, James Greenhalgh <james dot greenhalgh at arm dot com>
- Date: Fri, 07 Dec 2018 16:32:37 +0000
- Subject: Re: [PATCH][AArch64][2/2] Add sve_width -moverride tunable
- References: <5C0A9563.2030201@foss.arm.com>
"Kyrill Tkachov" <kyrylo.tkachov@foss.arm.com> writes:
> @@ -10834,6 +10836,34 @@ aarch64_parse_tune_string (const char *tune_string,
> "tune=");
> }
>
> +/* Parse the sve_width tuning moverride string in TUNE_STRING.
> + Accept the valid SVE vector widths allowed by
> + aarch64_sve_vector_bits_enum and use it to override sve_width
> + in TUNE. */
> +
> +static void
> +aarch64_parse_sve_width_string (const char *tune_string,
> + struct tune_params *tune)
> +{
> + int width = -1;
> +
> + int n = sscanf (tune_string, "%d", &width);
> + if (n == EOF)
> + error ("invalid format for sve_width");
Should probably return here, otherwise we'll report a second
error for width == -1.
> + switch (width)
> + {
> + case SVE_128:
> + case SVE_256:
> + case SVE_512:
> + case SVE_1024:
> + case SVE_2048:
> + break;
> + default:
> + error ("invalid sve_width value: %d", width);
> + }
> + tune->sve_width = (enum aarch64_sve_vector_bits_enum) width;
> +}
Formatting nit: cases should line up with the "{".
OK with those changes, thanks.
Richard