[PATCH] D127798: [AArch64] Define __ARM_FEATURE_RCPC

Mingming Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 14 14:14:59 PDT 2022


mingmingl created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
mingmingl requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

This patch implements the definition of __ARM_FEATURE_RCPC when clang commands specifies +rcpc.


Repository:
  rG LLVM Github Monorepo

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
@@ -19,6 +19,7 @@
 // CHECK-NOT: __ARM_FEATURE_BIG_ENDIAN
 // CHECK: __ARM_FEATURE_CLZ 1
 // CHECK-NOT: __ARM_FEATURE_CRC32 1
+// CHECK-NOT: __ARM_FEATURE_RCPC 1
 // CHECK-NOT: __ARM_FEATURE_CRYPTO 1
 // CHECK: __ARM_FEATURE_DIRECTED_ROUNDING 1
 // CHECK: __ARM_FEATURE_DIV 1
@@ -561,3 +562,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-none-linux-gnu -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)
@@ -544,6 +547,7 @@
   HasMatmulFP32 = false;
   HasLSE = false;
   HasMOPS = false;
+  HasRCPC = false;
 
   ArchKind = llvm::AArch64::ArchKind::INVALID;
 
@@ -593,6 +597,8 @@
     }
     if (Feature == "+crc")
       HasCRC = true;
+    if (Feature == "+rcpc")
+      HasRCPC = true;
     if (Feature == "+aes")
       HasAES = true;
     if (Feature == "+sha2")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127798.436939.patch
Type: text/x-patch
Size: 2019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220614/b1ccedc2/attachment.bin>


More information about the cfe-commits mailing list