Skip to content

Commit cd3798d

Browse files
authored
[FMV][AArch64] Add feature CSSC and detect on linux platform. (#132727)
Also removes priority bits for unused features predres and ls64. Added to ACLE with ARM-software/acle#390
1 parent 73f487d commit cd3798d

File tree

8 files changed

+209
-185
lines changed

8 files changed

+209
-185
lines changed

clang/test/CodeGen/AArch64/fmv-dependencies.c

+4
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ __attribute__((target_version("sve2-sm4"))) int fmv(void) { return 0; }
135135
// CHECK: define dso_local i32 @fmv._Mwfxt() #[[wfxt:[0-9]+]] {
136136
__attribute__((target_version("wfxt"))) int fmv(void) { return 0; }
137137

138+
// CHECK: define dso_local i32 @fmv._Mcssc() #[[cssc:[0-9]+]] {
139+
__attribute__((target_version("cssc"))) int fmv(void) { return 0; }
140+
138141
// CHECK-NOT: define dso_local i32 @fmv._M{{.*}}
139142
__attribute__((target_version("non_existent_extension"))) int fmv(void);
140143

@@ -188,3 +191,4 @@ int caller() {
188191
// CHECK: attributes #[[sve2_sha3]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sha2,+sha3,+sve,+sve2,+sve2-sha3,+v8a"
189192
// CHECK: attributes #[[sve2_sm4]] = { {{.*}} "target-features"="+fp-armv8,+fullfp16,+neon,+outline-atomics,+sm4,+sve,+sve2,+sve2-sm4,+v8a"
190193
// CHECK: attributes #[[wfxt]] = { {{.*}} "target-features"="+fp-armv8,+neon,+outline-atomics,+v8a,+wfxt"
194+
// CHECK: attributes #[[cssc]] = { {{.*}} "target-features"="+cssc,+fp-armv8,+neon,+outline-atomics,+v8a"

clang/test/CodeGen/AArch64/fmv-detection.c

+195-180
Large diffs are not rendered by default.

compiler-rt/lib/builtins/cpu_model/AArch64CPUFeatures.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ enum CPUFeatures {
3333
FEAT_FP,
3434
FEAT_SIMD,
3535
FEAT_CRC,
36-
RESERVED_FEAT_SHA1, // previously used and now ABI legacy
36+
FEAT_CSSC,
3737
FEAT_SHA2,
3838
FEAT_SHA3,
3939
RESERVED_FEAT_AES, // previously used and now ABI legacy

compiler-rt/lib/builtins/cpu_model/aarch64/fmv/mrs.inc

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ static void __init_cpu_features_constructor(unsigned long hwcap,
8181
setCPUFeature(FEAT_SME_F64);
8282
if (hwcap2 & HWCAP2_MOPS)
8383
setCPUFeature(FEAT_MOPS);
84+
if (hwcap2 & HWCAP2_CSSC)
85+
setCPUFeature(FEAT_CSSC);
8486
if (hwcap & HWCAP_FP) {
8587
setCPUFeature(FEAT_FP);
8688
// FP and AdvSIMD fields have the same value

compiler-rt/lib/builtins/cpu_model/aarch64/hwcap.inc

+3
Original file line numberDiff line numberDiff line change
@@ -187,3 +187,6 @@
187187
#ifndef HWCAP2_LRCPC3
188188
#define HWCAP2_LRCPC3 (1UL << 46)
189189
#endif
190+
#ifndef HWCAP2_CSSC
191+
#define HWCAP2_CSSC (1UL << 34)
192+
#endif

llvm/include/llvm/TargetParser/AArch64CPUFeatures.inc

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ enum CPUFeatures {
3333
FEAT_FP,
3434
FEAT_SIMD,
3535
FEAT_CRC,
36-
RESERVED_FEAT_SHA1, // previously used and now ABI legacy
36+
FEAT_CSSC,
3737
FEAT_SHA2,
3838
FEAT_SHA3,
3939
RESERVED_FEAT_AES, // previously used and now ABI legacy

llvm/include/llvm/TargetParser/AArch64FeatPriorities.inc

+2-3
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,14 @@ enum FeatPriorities {
5252
PRIOR_SME,
5353
PRIOR_MEMTAG2,
5454
PRIOR_SB,
55-
PRIOR_PREDRES,
5655
PRIOR_SSBS2,
5756
PRIOR_BTI,
58-
PRIOR_LS64_ACCDATA,
5957
PRIOR_WFXT,
6058
PRIOR_SME_F64,
6159
PRIOR_SME_I64,
6260
PRIOR_SME2,
63-
PRIOR_MOPS
61+
PRIOR_MOPS,
62+
PRIOR_CSSC
6463
};
6564

6665
#endif

llvm/lib/Target/AArch64/AArch64FMV.td

+1
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,4 @@ def : FMVExtension<"sve2-bitperm", "SVE_BITPERM">;
8282
def : FMVExtension<"sve2-sha3", "SVE_SHA3">;
8383
def : FMVExtension<"sve2-sm4", "SVE_SM4">;
8484
def : FMVExtension<"wfxt", "WFXT">;
85+
def : FMVExtension<"cssc", "CSSC">;

0 commit comments

Comments
 (0)