-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Add Macro for CSSC Feature #143148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Macro for CSSC Feature #143148
Conversation
Add a new __ARM_FEATURE_CSSC macro that can be utilized during the preprocessing stage. __ARM_FEATURE_CSSC is defined to 1 if there is hardware support for CSSC. Implements the ACLE change: ARM-software/acle#394
Thank you for submitting a Pull Request (PR) to the LLVM Project! This PR will be automatically labeled and the relevant teams will be notified. If you wish to, you can add reviewers by using the "Reviewers" section on this page. If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers. If you have further questions, they may be answered by the LLVM GitHub User Guide. You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums. |
@llvm/pr-subscribers-clang @llvm/pr-subscribers-backend-aarch64 Author: Martin Wehking (MartinWehking) ChangesAdd a new __ARM_FEATURE_CSSC macro that can be utilized during the preprocessing stage. __ARM_FEATURE_CSSC is defined to 1 if there is hardware support for CSSC. Implements the ACLE change: Full diff: https://github.com/llvm/llvm-project/pull/143148.diff 3 Files Affected:
diff --git a/clang/lib/Basic/Targets/AArch64.cpp b/clang/lib/Basic/Targets/AArch64.cpp
index e8abdf9aafd82..124b340b62d9f 100644
--- a/clang/lib/Basic/Targets/AArch64.cpp
+++ b/clang/lib/Basic/Targets/AArch64.cpp
@@ -625,6 +625,9 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
if (HasCRC)
Builder.defineMacro("__ARM_FEATURE_CRC32", "1");
+ if (HasCSSC)
+ Builder.defineMacro("__ARM_FEATURE_CSSC", "1");
+
if (HasRCPC3)
Builder.defineMacro("__ARM_FEATURE_RCPC", "3");
else if (HasRCPC)
@@ -874,6 +877,7 @@ bool AArch64TargetInfo::hasFeature(StringRef Feature) const {
.Case("rdm", HasRDM)
.Case("lse", HasLSE)
.Case("crc", HasCRC)
+ .Case("cssc", HasCSSC)
.Case("sha2", HasSHA2)
.Case("sha3", HasSHA3)
.Cases("aes", "pmull", HasAES)
@@ -1249,6 +1253,8 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
HasPAuthLR = true;
HasPAuth = true;
}
+ if (Feature == "+cssc")
+ HasCSSC = true;
}
// Check features that are manually disabled by command line options.
diff --git a/clang/lib/Basic/Targets/AArch64.h b/clang/lib/Basic/Targets/AArch64.h
index a4c65361105e4..1951e0679d2ec 100644
--- a/clang/lib/Basic/Targets/AArch64.h
+++ b/clang/lib/Basic/Targets/AArch64.h
@@ -66,6 +66,7 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
unsigned FPU = FPUMode;
bool HasCRC = false;
+ bool HasCSSC = false;
bool HasAES = false;
bool HasSHA2 = false;
bool HasSHA3 = false;
diff --git a/clang/test/Preprocessor/aarch64-target-features.c b/clang/test/Preprocessor/aarch64-target-features.c
index 4cb9b6ce53b0d..fd83e4b689a2a 100644
--- a/clang/test/Preprocessor/aarch64-target-features.c
+++ b/clang/test/Preprocessor/aarch64-target-features.c
@@ -744,7 +744,10 @@
// CHECK-SMEB16B16: __ARM_FEATURE_SME2 1
// CHECK-SMEB16B16: __ARM_FEATURE_SME_B16B16 1
// CHECK-SMEB16B16: __ARM_FEATURE_SVE_B16B16 1
-//
+
+// RUN: %clang --target=aarch64 -march=armv9-a+cssc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-CSSC %s
+// CHECK-CSSC: __ARM_FEATURE_CSSC 1
+
// RUN: %clang --target=aarch64 -march=armv9-a+fp8 -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-FP8 %s
// CHECK-FP8: __ARM_FEATURE_FP8 1
|
@MartinWehking Congratulations on having your first Pull Request (PR) merged into the LLVM Project! Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR. Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues. How to do this, and the rest of the post-merge process, is covered in detail here. If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again. If you don't get any reports, no action is required from you. Your changes are working as expected, well done! |
Add a new __ARM_FEATURE_CSSC macro that can be utilized during the preprocessing stage. __ARM_FEATURE_CSSC is defined to 1 if there is hardware support for CSSC. Implements the ACLE change: ARM-software/acle#394
Add a new __ARM_FEATURE_CSSC macro that can be utilized during the preprocessing stage. __ARM_FEATURE_CSSC is defined to 1 if there is hardware support for CSSC. Implements the ACLE change: ARM-software/acle#394
Add a new __ARM_FEATURE_CSSC macro that can be utilized during the preprocessing stage.
__ARM_FEATURE_CSSC is defined to 1 if there is hardware support for CSSC.
Implements the ACLE change:
ARM-software/acle#394