Thanks for the suggestions.

On 14/03/2025 21:43, Andrew Carlotti wrote:
On Thu, Mar 13, 2025 at 05:10:07PM +0000, Andre Vieira (lists) wrote:
Apologies for the delay, had been waiting on some other relevant patches to
go in to make sure we didn't break any valid existing behaviours. It should
all be working properly now. I think I've also addressed all your comments.
Most notable change is that it now uses the 'sorry' mechanism.

Bootstrapped and regression tested on aarch64-none-linux-gnu.


aarch64: remove SVE2 requirement from SME and diagnose it as unsupported

I find this line hard to understand, but I struggled to find a better wording
when you posted the first version.  I think something better would be:

  aarch64: Remove +sme -> +sve2 feature flag dependency
I prefer your subject line..


  We don't yet support SME without SVE2, so bail out with a 'sorry' if we
  encounter this configuration.
But using a slightly different text underneath.

...

diff --git a/gcc/config/aarch64/aarch64-option-extensions.def 
b/gcc/config/aarch64/aarch64-option-extensions.def
index 
aa8d315c240fbd25b49008b131cc09f04001eb80..8603836de01588b8db417289f842f911567288ea
 100644
--- a/gcc/config/aarch64/aarch64-option-extensions.def
+++ b/gcc/config/aarch64/aarch64-option-extensions.def
@@ -207,7 +207,7 @@ AARCH64_FMV_FEATURE("sve2-sm4", SVE_SM4, (SVE2_SM4))
AARCH64_OPT_EXTENSION("sve2p1", SVE2p1, (SVE2), (), (), "sve2p1") -AARCH64_OPT_FMV_EXTENSION("sme", SME, (BF16, SVE2), (), (), "sme")
+AARCH64_OPT_FMV_EXTENSION("sme", SME, (BF16, FCMA, F16FML), (), (), "sme")

Have you deliberately changed other dependenciesi?  As well as removing SVE and
SVE2 from +sme, this would also remove FP16 and add F16FML (which does
nothing by itself if FP16 isn't also enabled).

Didn't realize the dependency wasn't implied, even though +fp16fml implies +fp16, somewhat confusing... but I'm sure there's a good reason for it. I'll add F16 to the requires list thanks for spotting that.

AARCH64_OPT_EXTENSION("memtag", MEMTAG, (), (), (), "") diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 
36b65df50c57267d9c18e430665c411f1bf3cc24..c9f37bd70cbccef70f383f873c97b2be58c938dc
 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -18886,6 +18886,9 @@ aarch64_override_options_internal (struct gcc_options 
*opts)
      SET_OPTION_IF_UNSET (opts, &global_options_set, param_fully_pipelined_fma,
                         1);
+ if (TARGET_SME && !TARGET_SVE2)
+    sorry ("no support for %qs without %qs", "sme", "sve2");
+
    aarch64_override_options_after_change_1 (opts);
  }
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 
4fbb4cda101ebd14891a3ad80aa5b1bc069b45c6..3754e468a05b3ae554b71adb4cf60068d5249507
 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -22068,7 +22068,8 @@ Enable the Pointer Authentication Extension.
  @item cssc
  Enable the Common Short Sequence Compression instructions.
  @item sme
-Enable the Scalable Matrix Extension.
+Enable the Scalable Matrix Extension.  This can only be used with the sve2
+extension.

How about "This is only supported when SVE2 is also enabled"?  I think that
would make it clearer that it's a lack of (gcc) support, not a fundamental
requirement.

Sure.

Reply via email to