public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Tamar Christina <tamar.christina@arm.com>
Cc: nd@arm.com, Richard.Earnshaw@arm.com, marcus.shawcroft@arm.com,
	binutils@sourceware.org
Subject: Re: [PATCH][Binutils]AArch64 gas: relax ordering constriants on enabling and disabling feature extensions
Date: Thu, 2 Feb 2023 12:29:49 +0100	[thread overview]
Message-ID: <7c6e61f4-b61c-a451-ba13-914c2e7f0dcf@suse.com> (raw)
In-Reply-To: <patch-16852-tamar@arm.com>

On 01.02.2023 20:25, Tamar Christina via Binutils wrote:
> At the beginning of the port it was decided that enabling features should always
> come before disabling features. i.e. +foo should always be before any +nofoo.
> 
> For years now this has been relaxed in GCC but binutils has remained rather
> strict.  This removes the restriction from gas as well giving users less
> friction.

Hmm, specifying negative before positive settings may mean the negative ones
don't take effect at all (because of feature dependencies). While the same
of course is true the other way around as well, silently accepting
supposedly disabled insns is imo quite a bit more risky than complaining
about supposedly enabled ones: The programmer may unknowingly produce a bad
binary. This is even more so that the dependencies can't be considered set
in stone - bugs may be found which require adjustments to them.

There actually is an example of something which may want adjusting: Both
F32MM and F64MM take SVE as prereq. While SVE can't easily be a prereq to
I8MM (because there are also SIMD insn forms), it's unclear why SIMD
- itself being a prereq to SVE - isn't a prereq to I8MM.

> @@ -10269,31 +10265,20 @@ aarch64_parse_features (const char *str, const aarch64_feature_set **opt_p,
>  
>        if (optlen >= 2 && startswith (str, "no"))
>  	{
> -	  if (adding_value != 0)
> -	    adding_value = 0;
> +	  adding_value = 0;
>  	  optlen -= 2;
>  	  str += 2;
>  	}
>        else if (optlen > 0)
>  	{
> -	  if (adding_value == -1)
> -	    adding_value = 1;
> -	  else if (adding_value != 1)
> -	    {
> -	      as_bad (_("must specify extensions to add before specifying "
> -			"those to remove"));
> -	      return false;
> -	    }
> +	  adding_value = 1;
>  	}
> -
> -      if (optlen == 0)
> +      else if (optlen == 0)
>  	{
>  	  as_bad (_("missing architectural extension"));
>  	  return 0;
>  	}


This "if" -> "else if" transformation looks not only unrelated to me, but
actually slightly wrong: The message now won't trigger anymore when there
just "+no" was specified.

Jan

  reply	other threads:[~2023-02-02 11:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01 19:25 Tamar Christina
2023-02-02 11:29 ` Jan Beulich [this message]
2023-02-02 12:13   ` Tamar Christina
2023-02-02 12:25     ` Jan Beulich
2023-02-02 13:21   ` [PATCH]AArch64 " Richard Sandiford
2023-02-03  7:13     ` Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7c6e61f4-b61c-a451-ba13-914c2e7f0dcf@suse.com \
    --to=jbeulich@suse.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=binutils@sourceware.org \
    --cc=marcus.shawcroft@arm.com \
    --cc=nd@arm.com \
    --cc=tamar.christina@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).