Skip to content

Commit 8286566

Browse files
committed
[AArch64] Add command-line options for ARMv8.2-A
This adds new values for the -march option (armv8.2a and armv8.2-a, which are aliases of each other), and new suffixes for the -march and -mcpu options (+fp16 and +nofp16), to allow targeting the ARMv8.2-A architecture and it's optional half-precision floating-point extension. Differential Revision: http://reviews.llvm.org/D15022 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254160 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent f4db326 commit 8286566

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

lib/Driver/Tools.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -2031,10 +2031,12 @@ static bool DecodeAArch64Features(const Driver &D, StringRef text,
20312031
.Case("simd", "+neon")
20322032
.Case("crc", "+crc")
20332033
.Case("crypto", "+crypto")
2034+
.Case("fp16", "+fullfp16")
20342035
.Case("nofp", "-fp-armv8")
20352036
.Case("nosimd", "-neon")
20362037
.Case("nocrc", "-crc")
20372038
.Case("nocrypto", "-crypto")
2039+
.Case("nofp16", "-fullfp16")
20382040
.Default(nullptr);
20392041
if (result)
20402042
Features.push_back(result);
@@ -2080,6 +2082,8 @@ getAArch64ArchFeaturesFromMarch(const Driver &D, StringRef March,
20802082
// ok, no additional features.
20812083
} else if (Split.first == "armv8.1-a" || Split.first == "armv8.1a") {
20822084
Features.push_back("+v8.1a");
2085+
} else if (Split.first == "armv8.2-a" || Split.first == "armv8.2a" ) {
2086+
Features.push_back("+v8.2a");
20832087
} else {
20842088
return false;
20852089
}

test/Driver/aarch64-cpus.c

+12
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@
114114
// RUN: %clang -target aarch64 -mbig-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s
115115
// RUN: %clang -target aarch64_be -mbig-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s
116116
// RUN: %clang -target aarch64_be -mbig-endian -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s
117+
118+
// RUN: %clang -target aarch64 -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s
119+
// RUN: %clang -target aarch64 -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s
120+
// RUN: %clang -target aarch64 -mlittle-endian -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s
121+
// RUN: %clang -target aarch64 -mlittle-endian -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s
122+
// RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.2a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s
123+
// RUN: %clang -target aarch64_be -mlittle-endian -march=armv8.2-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A %s
124+
// GENERICV82A: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a"
125+
126+
// RUN: %clang -target aarch64 -march=armv8.2-a+fp16 -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV82A-FP16 %s
127+
// GENERICV82A-FP16: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" "-target-feature" "+neon" "-target-feature" "+v8.2a" "-target-feature" "+fullfp16"
128+
117129
// ================== Check whether -march accepts mixed-case values.
118130
// RUN: %clang -target aarch64_be -march=ARMV8.1A -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s
119131
// RUN: %clang -target aarch64_be -march=ARMV8.1-A -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A-BE %s

0 commit comments

Comments
 (0)