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][AArch64][2/2] Add sve_width -moverride tunable


"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


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