Skip to content

Commit 276e342

Browse files
committed
[AArch64] Remove Automatic Enablement of FEAT_F32MM
When `+sve` is passed in the command line, if the Architecture being targeted is V8.6A/V9.1A or later, `+f32mm` is also added. This enables FEAT_32MM, however at the time of writing no CPU's support this. This leads to the FEAT_32MM instructions being compiled for CPU's that do not support them. This commit removes the automatic enablement, however the option is still able to be used by passing `+f32mm`.
1 parent afec257 commit 276e342

File tree

5 files changed

+10
-22
lines changed

5 files changed

+10
-22
lines changed

clang/test/Driver/aarch64-sve.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
// RUN: %clang --target=aarch64 -march=armv8.6a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV8A-NOSVE %s
77
// GENERICV8A-NOSVE-NOT: "-target-feature" "+sve"
88

9-
// The 32-bit floating point matrix multiply extension is enabled by default
10-
// for armv8.6-a targets (or later) with SVE, and can optionally be enabled for
11-
// any target from armv8.2a onwards (we don't enforce not using it with earlier
12-
// targets).
9+
// The 32-bit floating point matrix multiply extension is an optional feature
10+
// that can be used for any target from armv8.2a and onwards. This can be
11+
// enabled using the `+f32mm` option.`.
1312
// RUN: %clang --target=aarch64 -march=armv8.6a -### -c %s 2>&1 | FileCheck -check-prefix=NO-F32MM %s
14-
// RUN: %clang --target=aarch64 -march=armv8.6a+sve -### -c %s 2>&1 | FileCheck -check-prefix=F32MM %s
13+
// RUN: %clang --target=aarch64 -march=armv8.6a+sve+f32mm -### -c %s 2>&1 | FileCheck -check-prefix=F32MM %s
1514
// RUN: %clang --target=aarch64 -march=armv8.5a+f32mm -### -c %s 2>&1 | FileCheck -check-prefix=F32MM %s
1615
// NO-F32MM-NOT: "-target-feature" "+f32mm"
1716
// F32MM: "-target-feature" "+f32mm"

clang/test/Preprocessor/aarch64-target-features.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@
196196
// CHECK-8_6-NOT: __ARM_FEATURE_SHA3 1
197197
// CHECK-8_6-NOT: __ARM_FEATURE_SM4 1
198198

199-
// RUN: %clang -target aarch64-none-linux-gnu -march=armv8.6-a+sve -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE-8_6 %s
199+
// RUN: %clang -target aarch64-none-linux-gnu -march=armv8.6-a+sve+f32mm -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE-8_6 %s
200200
// CHECK-SVE-8_6: __ARM_FEATURE_SVE 1
201201
// CHECK-SVE-8_6: __ARM_FEATURE_SVE_BF16 1
202202
// CHECK-SVE-8_6: __ARM_FEATURE_SVE_MATMUL_FP32 1

llvm/docs/ReleaseNotes.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ Changes to the AMDGPU Backend
7474

7575
Changes to the ARM Backend
7676
--------------------------
77+
* FEAT_F32MM is no longer activated by default when using `+sve` on v8.6-A or greater. The feature is still availble and can be using by adding `+f32mm` to the command line options.
7778

7879
Changes to the AVR Backend
7980
--------------------------

llvm/lib/TargetParser/AArch64TargetParser.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,6 @@ void AArch64::ExtensionSet::enable(ArchExtKind E) {
186186
// Special cases for dependencies which vary depending on the base
187187
// architecture version.
188188
if (BaseArch) {
189-
// +sve implies +f32mm if the base architecture is v8.6A+ or v9.1A+
190-
// It isn't the case in general that sve implies both f64mm and f32mm
191-
if (E == AEK_SVE && BaseArch->is_superset(ARMV8_6A))
192-
enable(AEK_F32MM);
193-
194189
// +fp16 implies +fp16fml for v8.4A+, but not v9.0-A+
195190
if (E == AEK_FP16 && BaseArch->is_superset(ARMV8_4A) &&
196191
!BaseArch->is_superset(ARMV9A))

llvm/unittests/TargetParser/TargetParserTest.cpp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2314,13 +2314,6 @@ AArch64ExtensionDependenciesBaseArchTestParams
23142314
{},
23152315
{"aes", "sha2", "sha3", "sm4"}},
23162316

2317-
// +sve implies +f32mm if the base architecture is v8.6A+ or v9.1A+, but
2318-
// not earlier architectures.
2319-
{AArch64::ARMV8_5A, {"sve"}, {"sve"}, {"f32mm"}},
2320-
{AArch64::ARMV9A, {"sve"}, {"sve"}, {"f32mm"}},
2321-
{AArch64::ARMV8_6A, {"sve"}, {"sve", "f32mm"}, {}},
2322-
{AArch64::ARMV9_1A, {"sve"}, {"sve", "f32mm"}, {}},
2323-
23242317
// +fp16 implies +fp16fml for v8.4A+, but not v9.0-A+
23252318
{AArch64::ARMV8_3A, {"fp16"}, {"fullfp16"}, {"fp16fml"}},
23262319
{AArch64::ARMV9A, {"fp16"}, {"fullfp16"}, {"fp16fml"}},
@@ -2487,10 +2480,10 @@ AArch64ExtensionDependenciesBaseCPUTestParams
24872480
{}},
24882481
{"cortex-a520",
24892482
{},
2490-
{"v9.2a", "bf16", "crc", "dotprod", "f32mm", "flagm",
2491-
"fp-armv8", "fullfp16", "fp16fml", "i8mm", "lse", "mte",
2492-
"pauth", "perfmon", "predres", "ras", "rcpc", "rdm",
2493-
"sb", "neon", "ssbs", "sve", "sve2-bitperm", "sve2"},
2483+
{"v9.2a", "bf16", "crc", "dotprod", "flagm", "fp-armv8",
2484+
"fullfp16", "fp16fml", "i8mm", "lse", "mte", "pauth",
2485+
"perfmon", "predres", "ras", "rcpc", "rdm", "sb",
2486+
"neon", "ssbs", "sve", "sve2-bitperm", "sve2"},
24942487
{}},
24952488

24962489
// Negative modifiers

0 commit comments

Comments
 (0)