On Tue, Nov 16, 2021 at 11:12:35AM -0600, Bill Schmidt via Gcc-patches wrote:
> Hi! During a previous patch review, Segher asked that I provide better
> messages when builtins are unavailable because they require both a minimum
> CPU and the enablement of VSX instructions. This patch does just that.
...
> gcc/
> * config/rs6000/rs6000-call.c (rs6000_invalid_new_builtin): Change
> error messages for ENB_P8V and ENB_P9V.
> ---
> gcc/config/rs6000/rs6000-call.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/gcc/config/rs6000/rs6000-call.c b/gcc/config/rs6000/rs6000-call.c
> index 85fec80c6d7..035266eb001 100644
> --- a/gcc/config/rs6000/rs6000-call.c
> +++ b/gcc/config/rs6000/rs6000-call.c
> @@ -11943,7 +11943,8 @@ rs6000_invalid_new_builtin (enum rs6000_gen_builtins
> fncode)
> error ("%qs requires the %qs option", name, "-mcpu=power8");
> break;
> case ENB_P8V:
> - error ("%qs requires the %qs option", name, "-mpower8-vector");
> + error ("%qs requires the %qs and %qs options", name, "-mcpu=power8",
> + "-mvsx");
"-mcpu=power8" itself enables "-mvsx", doesn't it?
> break;
> case ENB_P9:
> error ("%qs requires the %qs option", name, "-mcpu=power9");
> @@ -11953,7 +11954,8 @@ rs6000_invalid_new_builtin (enum rs6000_gen_builtins
> fncode)
> name, "-mcpu=power9", "-m64", "-mpowerpc64");
> break;
> case ENB_P9V:
> - error ("%qs requires the %qs option", name, "-mpower9-vector");
> + error ("%qs requires the %qs and %qs options", name, "-mcpu=power9",
> + "-mvsx");
Similarly, "-mcpu=power9" itself enables "-mvsx", doesn't it?
Are you trying to also say "don't use -mno-vsx"? If so, maybe s/and/with/
would be slightly less confusing? This is going to be awkward unless it can
be more precise, like two messages depending on actual context:
- with "-mcpu=power8 -mno-vsx: "...requires -mvsx".
- without "-mcpu=power8": "...requires -mcpu=power8".
PC