mingmingl updated this revision to Diff 461588. mingmingl added a comment. It has been a while since this patch was updated, rebase for review now that the Github PR was accepted.
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127798/new/ https://reviews.llvm.org/D127798 Files: clang/lib/Basic/Targets/AArch64.cpp clang/lib/Basic/Targets/AArch64.h clang/test/Preprocessor/aarch64-target-features.c Index: clang/test/Preprocessor/aarch64-target-features.c =================================================================== --- clang/test/Preprocessor/aarch64-target-features.c +++ clang/test/Preprocessor/aarch64-target-features.c @@ -26,6 +26,7 @@ // CHECK: __ARM_FEATURE_IDIV 1 // CHECK: __ARM_FEATURE_LDREX 0xF // CHECK: __ARM_FEATURE_NUMERIC_MAXMIN 1 +// CHECK-NOT: __ARM_FEATURE_RCPC 1 // CHECK-NOT: __ARM_FEATURE_SHA2 1 // CHECK-NOT: __ARM_FEATURE_SHA3 1 // CHECK-NOT: __ARM_FEATURE_SHA512 1 @@ -560,3 +561,6 @@ // CHECK-BEFORE-V83-NOT: __ARM_FEATURE_COMPLEX 1 // CHECK-BEFORE-V83-NOT: __ARM_FEATURE_JCVT 1 // CHECK-BEFORE-V85-NOT: __ARM_FEATURE_FRINT 1 + +// RUN: %clang --target=aarch64 -march=armv8.2-a+rcpc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-RCPC %s +// CHECK-RCPC: __ARM_FEATURE_RCPC 1 Index: clang/lib/Basic/Targets/AArch64.h =================================================================== --- clang/lib/Basic/Targets/AArch64.h +++ clang/lib/Basic/Targets/AArch64.h @@ -54,6 +54,7 @@ bool HasLSE; bool HasFlagM; bool HasMOPS; + bool HasRCPC; llvm::AArch64::ArchKind ArchKind; Index: clang/lib/Basic/Targets/AArch64.cpp =================================================================== --- clang/lib/Basic/Targets/AArch64.cpp +++ clang/lib/Basic/Targets/AArch64.cpp @@ -341,6 +341,9 @@ if (HasCRC) Builder.defineMacro("__ARM_FEATURE_CRC32", "1"); + if (HasRCPC) + Builder.defineMacro("__ARM_FEATURE_RCPC", "1"); + // The __ARM_FEATURE_CRYPTO is deprecated in favor of finer grained feature // macros for AES, SHA2, SHA3 and SM4 if (HasAES && HasSHA2) @@ -551,6 +554,7 @@ HasMatmulFP32 = false; HasLSE = false; HasMOPS = false; + HasRCPC = false; ArchKind = llvm::AArch64::ArchKind::INVALID; @@ -600,6 +604,8 @@ } if (Feature == "+crc") HasCRC = true; + if (Feature == "+rcpc") + HasRCPC = true; if (Feature == "+aes") HasAES = true; if (Feature == "+sha2")
Index: clang/test/Preprocessor/aarch64-target-features.c =================================================================== --- clang/test/Preprocessor/aarch64-target-features.c +++ clang/test/Preprocessor/aarch64-target-features.c @@ -26,6 +26,7 @@ // CHECK: __ARM_FEATURE_IDIV 1 // CHECK: __ARM_FEATURE_LDREX 0xF // CHECK: __ARM_FEATURE_NUMERIC_MAXMIN 1 +// CHECK-NOT: __ARM_FEATURE_RCPC 1 // CHECK-NOT: __ARM_FEATURE_SHA2 1 // CHECK-NOT: __ARM_FEATURE_SHA3 1 // CHECK-NOT: __ARM_FEATURE_SHA512 1 @@ -560,3 +561,6 @@ // CHECK-BEFORE-V83-NOT: __ARM_FEATURE_COMPLEX 1 // CHECK-BEFORE-V83-NOT: __ARM_FEATURE_JCVT 1 // CHECK-BEFORE-V85-NOT: __ARM_FEATURE_FRINT 1 + +// RUN: %clang --target=aarch64 -march=armv8.2-a+rcpc -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-RCPC %s +// CHECK-RCPC: __ARM_FEATURE_RCPC 1 Index: clang/lib/Basic/Targets/AArch64.h =================================================================== --- clang/lib/Basic/Targets/AArch64.h +++ clang/lib/Basic/Targets/AArch64.h @@ -54,6 +54,7 @@ bool HasLSE; bool HasFlagM; bool HasMOPS; + bool HasRCPC; llvm::AArch64::ArchKind ArchKind; Index: clang/lib/Basic/Targets/AArch64.cpp =================================================================== --- clang/lib/Basic/Targets/AArch64.cpp +++ clang/lib/Basic/Targets/AArch64.cpp @@ -341,6 +341,9 @@ if (HasCRC) Builder.defineMacro("__ARM_FEATURE_CRC32", "1"); + if (HasRCPC) + Builder.defineMacro("__ARM_FEATURE_RCPC", "1"); + // The __ARM_FEATURE_CRYPTO is deprecated in favor of finer grained feature // macros for AES, SHA2, SHA3 and SM4 if (HasAES && HasSHA2) @@ -551,6 +554,7 @@ HasMatmulFP32 = false; HasLSE = false; HasMOPS = false; + HasRCPC = false; ArchKind = llvm::AArch64::ArchKind::INVALID; @@ -600,6 +604,8 @@ } if (Feature == "+crc") HasCRC = true; + if (Feature == "+rcpc") + HasRCPC = true; if (Feature == "+aes") HasAES = true; if (Feature == "+sha2")
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits