Skip to content

Commit bb9fa77

Browse files
authored
[ARM][Driver] Fix i8mm feature string (llvm#137771)
llvm#137595 changed the behaviour for SIMD on ARM to ensure it is enabled and disabled correctly depending on the options used by the user. In this, the functionality to disable all features that depend on SIMD was added. However, there was a spelling error for the i8mm feature, which caused the `+nosimd` command to fail. This fixes the error, and allows the command to work again.
1 parent 014ab73 commit bb9fa77

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

clang/lib/Driver/ToolChains/Arch/ARM.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -795,7 +795,7 @@ llvm::ARM::FPUKind arm::getARMTargetFeatures(const Driver &D,
795795
HasSimd = ItSimd->starts_with("+");
796796
if (!HasSimd && FPUSupportsNeon)
797797
Features.insert(Features.end(),
798-
{"-sha2", "-aes", "-crypto", "-dotprod", "-bf16", "-imm8"});
798+
{"-sha2", "-aes", "-crypto", "-dotprod", "-bf16", "-i8mm"});
799799

800800
// For Arch >= ARMv8.0 && A or R profile: crypto = sha2 + aes
801801
// Rather than replace within the feature vector, determine whether each

clang/test/Driver/arm-features.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,13 @@
105105
// RUN: %clang -target arm-none-none-eabi -march=armv8-r+bf16 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NEON-ENABLED-WITH-FEATURE %s
106106
// RUN: %clang -target arm-none-none-eabi -march=armv8-r+i8mm -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NEON-ENABLED-WITH-FEATURE %s
107107
// CHECK-NEON-ENABLED-WITH-FEATURE: "-target-feature" "+neon"
108+
109+
// Check that disabling NEON disables all features associated with this
110+
// RUN: %clang -target arm-none-none-eabi -march=armv8-a+nosimd -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES %s
111+
// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-neon"
112+
// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-dotprod"
113+
// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-bf16"
114+
// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-i8mm"
115+
// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-crypto"
116+
// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-sha2"
117+
// CHECK-NEON-DISABLED-DISABLES-ALL-DEPENDENCIES: "-target-feature" "-aes"

0 commit comments

Comments
 (0)