[PATCH] D141404: [AArch64][Clang] Adjust default features for v8.9-A/v9.4-A in clang driver
Lucas Prates via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 10 09:10:41 PST 2023
pratlucas created this revision.
Herald added a subscriber: kristof.beyls.
Herald added a project: All.
pratlucas requested review of this revision.
Herald added subscribers: cfe-commits, MaskRay.
Herald added a project: clang.
Update the clang driver to include the following features as default for
the v8.9-A/v9.4-A architecture versions:
- FEAT_SPECRES2
- FEAT_CSSC
- FEAT_RASv2
Patch by Sam Elliott.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D141404
Files:
clang/lib/Driver/ToolChains/Arch/AArch64.cpp
clang/test/Driver/aarch64-cssc.c
Index: clang/test/Driver/aarch64-cssc.c
===================================================================
--- clang/test/Driver/aarch64-cssc.c
+++ clang/test/Driver/aarch64-cssc.c
@@ -1,12 +1,13 @@
// Test that target feature cssc is implemented and available correctly
+// FEAT_CSSC is a required part of v8.9a/v9.4a and optional from v8.7a/v9.3a onwards.
// RUN: %clang -### -target aarch64-none-none-eabi %s 2>&1 | FileCheck %s --check-prefix=ABSENT_CSSC
-// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.8-a+cssc %s 2>&1 | FileCheck %s
-// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.9-a %s 2>&1 | FileCheck %s --check-prefix=ABSENT_CSSC
-// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.8-a+cssc %s 2>&1 | FileCheck %s
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.7-a+cssc %s 2>&1 | FileCheck %s
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.9-a %s 2>&1 | FileCheck %s
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.9-a+cssc %s 2>&1 | FileCheck %s
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv8.9-a+nocssc %s 2>&1 | FileCheck %s --check-prefix=NO_CSSC
-// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.3-a+cssc %s 2>&1 | FileCheck %s
-// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.4-a %s 2>&1 | FileCheck %s --check-prefix=ABSENT_CSSC
-// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.3-a+cssc %s 2>&1 | FileCheck %s
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.2-a+cssc %s 2>&1 | FileCheck %s
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.4-a %s 2>&1 | FileCheck %s
+// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.4-a+cssc %s 2>&1 | FileCheck %s
// RUN: %clang -### -target aarch64-none-none-eabi -march=armv9.4-a+nocssc %s 2>&1 | FileCheck %s --check-prefix=NO_CSSC
// CHECK: "-target-feature" "+cssc"
Index: clang/lib/Driver/ToolChains/Arch/AArch64.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Arch/AArch64.cpp
+++ clang/lib/Driver/ToolChains/Arch/AArch64.cpp
@@ -498,6 +498,11 @@
Features.insert(std::next(Features.begin() + ArchFeatPos),
{"+hbc", "+mops"});
+ // Default features for Armv8.9-a/Armv9.4-a or later.
+ if (V8Version >= 9 || V9Version >= 4)
+ Features.insert(std::next(Features.begin() + ArchFeatPos),
+ {"+specres2", "+cssc", "+rasv2"});
+
if (Arg *A = Args.getLastArg(options::OPT_mno_unaligned_access,
options::OPT_munaligned_access)) {
if (A->getOption().matches(options::OPT_mno_unaligned_access))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141404.487837.patch
Type: text/x-patch
Size: 2779 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230110/ea9f4ef3/attachment-0001.bin>
More information about the cfe-commits
mailing list