Skip to content

Commit 8475349

Browse files
stuijtstellar
authored andcommitted
[AARCH64] ssbs should be enabled by default for cortex-x1, cortex-x1c, cortex-a77
Reviewed By: amilendra Differential Revision: https://reviews.llvm.org/D121206
1 parent d4e3c50 commit 8475349

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

clang/test/Driver/aarch64-ssbs.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+ssbs %s 2>&1 | FileCheck %s
2+
// RUN: %clang -### -target aarch64-none-none-eabi -mcpu=cortex-x1 %s 2>&1 | FileCheck %s
3+
// RUN: %clang -### -target aarch64-none-none-eabi -mcpu=cortex-x1c %s 2>&1 | FileCheck %s
4+
// RUN: %clang -### -target aarch64-none-none-eabi -mcpu=cortex-a77 %s 2>&1 | FileCheck %s
25
// CHECK: "-target-feature" "+ssbs"
36

47
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8a+nossbs %s 2>&1 | FileCheck %s --check-prefix=NOSSBS
8+
// RUN: %clang -### -target aarch64-none-none-eabi -mcpu=cortex-x1c+nossbs %s 2>&1 | FileCheck %s --check-prefix=NOSSBS
59
// NOSSBS: "-target-feature" "-ssbs"
610

711
// RUN: %clang -### -target aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENTSSBS

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@
285285
// CHECK-MCPU-A57: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
286286
// CHECK-MCPU-A72: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
287287
// CHECK-MCPU-CORTEX-A73: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
288-
// CHECK-MCPU-CORTEX-R82: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8r" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+dotprod" "-target-feature" "+fp16fml" "-target-feature" "+ras" "-target-feature" "+lse" "-target-feature" "+rdm" "-target-feature" "+rcpc" "-target-feature" "+fullfp16"
288+
// CHECK-MCPU-CORTEX-R82: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8r" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+dotprod" "-target-feature" "+fp16fml" "-target-feature" "+ras" "-target-feature" "+lse" "-target-feature" "+rdm" "-target-feature" "+rcpc" "-target-feature" "+ssbs" "-target-feature" "+fullfp16"
289289
// CHECK-MCPU-M3: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"
290290
// CHECK-MCPU-M4: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto" "-target-feature" "+dotprod" "-target-feature" "+fullfp16"
291291
// CHECK-MCPU-KRYO: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-feature" "+v8a" "-target-feature" "+fp-armv8" "-target-feature" "+neon" "-target-feature" "+crc" "-target-feature" "+crypto"

llvm/lib/Support/AArch64TargetParser.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ bool AArch64::getExtensionFeatures(uint64_t Extensions,
120120
Features.push_back("+mops");
121121
if (Extensions & AArch64::AEK_PERFMON)
122122
Features.push_back("+perfmon");
123+
if (Extensions & AArch64::AEK_SSBS)
124+
Features.push_back("+ssbs");
123125

124126
return true;
125127
}

llvm/lib/Target/AArch64/AArch64.td

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ def ProcessorFeatures {
953953
FeatureRCPC, FeatureSSBS];
954954
list<SubtargetFeature> A77 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
955955
FeatureNEON, FeatureFullFP16, FeatureDotProd,
956-
FeatureRCPC];
956+
FeatureRCPC, FeatureSSBS];
957957
list<SubtargetFeature> A78 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
958958
FeatureNEON, FeatureFullFP16, FeatureDotProd,
959959
FeatureRCPC, FeaturePerfMon, FeatureSPE,
@@ -971,11 +971,12 @@ def ProcessorFeatures {
971971
FeatureSB, FeatureSpecRestrict];
972972
list<SubtargetFeature> X1 = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
973973
FeatureNEON, FeatureRCPC, FeaturePerfMon,
974-
FeatureSPE, FeatureFullFP16, FeatureDotProd];
974+
FeatureSPE, FeatureFullFP16, FeatureDotProd,
975+
FeatureSSBS];
975976
list<SubtargetFeature> X1C = [HasV8_2aOps, FeatureCrypto, FeatureFPARMv8,
976977
FeatureNEON, FeatureRCPC, FeaturePerfMon,
977978
FeatureSPE, FeatureFullFP16, FeatureDotProd,
978-
FeaturePAuth];
979+
FeaturePAuth, FeatureSSBS];
979980
list<SubtargetFeature> X2 = [HasV9_0aOps, FeatureNEON, FeaturePerfMon,
980981
FeatureMatMulInt8, FeatureBF16, FeatureAM,
981982
FeatureMTE, FeatureETE, FeatureSVE2BitPerm,

0 commit comments

Comments
 (0)