Skip to content

Commit

Permalink
[ARM][AArch64] Require appropriate features for crypto algorithms
Browse files Browse the repository at this point in the history
This patch changes the AArch32 crypto instructions (sha2 and aes) to
require the specific sha2 or aes features. These features have
already been implemented and can be controlled through the command
line, but do not have the expected result (i.e. `+noaes` will not
disable aes instructions). The crypto feature retains its existing
meaning of both sha2 and aes.

Several small changes are included due to the knock-on effect this has:

- The AArch32 driver has been modified to ensure sha2/aes is correctly
  set based on arch/cpu/fpu selection and feature ordering.
- Crypto extensions are permitted for AArch32 v8-R profile, but not
  enabled by default.
- ACLE feature macros have been updated with the fine grained crypto
  algorithms. These are also used by AArch64.
- Various tests updated due to the change in feature lists and macros.

Reviewed By: lenary

Differential Revision: https://reviews.llvm.org/D99079
  • Loading branch information
dcandler committed Apr 28, 2021
1 parent 511ffe1 commit b8baa2a
Show file tree
Hide file tree
Showing 27 changed files with 480 additions and 231 deletions.
13 changes: 12 additions & 1 deletion clang/include/clang/Basic/arm_neon.td
Original file line number Diff line number Diff line change
Expand Up @@ -1117,12 +1117,14 @@ def VEXT_A64 : WInst<"vext", "...I", "dQdPlQPl">;

////////////////////////////////////////////////////////////////////////////////
// Crypto
let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_CRYPTO)" in {
let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_AES)" in {
def AESE : SInst<"vaese", "...", "QUc">;
def AESD : SInst<"vaesd", "...", "QUc">;
def AESMC : SInst<"vaesmc", "..", "QUc">;
def AESIMC : SInst<"vaesimc", "..", "QUc">;
}

let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_SHA2)" in {
def SHA1H : SInst<"vsha1h", "11", "Ui">;
def SHA1SU1 : SInst<"vsha1su1", "...", "QUi">;
def SHA256SU0 : SInst<"vsha256su0", "...", "QUi">;
Expand All @@ -1134,28 +1136,37 @@ def SHA1SU0 : SInst<"vsha1su0", "....", "QUi">;
def SHA256H : SInst<"vsha256h", "....", "QUi">;
def SHA256H2 : SInst<"vsha256h2", "....", "QUi">;
def SHA256SU1 : SInst<"vsha256su1", "....", "QUi">;
}

let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_SHA3) && defined(__aarch64__)" in {
def BCAX : SInst<"vbcax", "....", "QUcQUsQUiQUlQcQsQiQl">;
def EOR3 : SInst<"veor3", "....", "QUcQUsQUiQUlQcQsQiQl">;
def RAX1 : SInst<"vrax1", "...", "QUl">;

let isVXAR = 1 in {
def XAR : SInst<"vxar", "...I", "QUl">;
}
}

let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_SHA512) && defined(__aarch64__)" in {

def SHA512SU0 : SInst<"vsha512su0", "...", "QUl">;
def SHA512su1 : SInst<"vsha512su1", "....", "QUl">;
def SHA512H : SInst<"vsha512h", "....", "QUl">;
def SHA512H2 : SInst<"vsha512h2", "....", "QUl">;
}

let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_SM3) && defined(__aarch64__)" in {
def SM3SS1 : SInst<"vsm3ss1", "....", "QUi">;
def SM3TT1A : SInst<"vsm3tt1a", "....I", "QUi">;
def SM3TT1B : SInst<"vsm3tt1b", "....I", "QUi">;
def SM3TT2A : SInst<"vsm3tt2a", "....I", "QUi">;
def SM3TT2B : SInst<"vsm3tt2b", "....I", "QUi">;
def SM3PARTW1 : SInst<"vsm3partw1", "....", "QUi">;
def SM3PARTW2 : SInst<"vsm3partw2", "....", "QUi">;
}

let ArchGuard = "__ARM_ARCH >= 8 && defined(__ARM_FEATURE_SM4) && defined(__aarch64__)" in {
def SM4E : SInst<"vsm4e", "...", "QUi">;
def SM4EKEY : SInst<"vsm4ekey", "...", "QUi">;
}
Expand Down
34 changes: 33 additions & 1 deletion clang/lib/Basic/Targets/AArch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,27 @@ void AArch64TargetInfo::getTargetDefines(const LangOptions &Opts,
if (HasCRC)
Builder.defineMacro("__ARM_FEATURE_CRC32", "1");

if (HasCrypto)
// The __ARM_FEATURE_CRYPTO is deprecated in favor of finer grained feature
// macros for AES, SHA2, SHA3 and SM4
if (HasCrypto || (HasAES && HasSHA2))
Builder.defineMacro("__ARM_FEATURE_CRYPTO", "1");

if (HasAES)
Builder.defineMacro("__ARM_FEATURE_AES", "1");

if (HasSHA2)
Builder.defineMacro("__ARM_FEATURE_SHA2", "1");

if (HasSHA3) {
Builder.defineMacro("__ARM_FEATURE_SHA3", "1");
Builder.defineMacro("__ARM_FEATURE_SHA512", "1");
}

if (HasSM4) {
Builder.defineMacro("__ARM_FEATURE_SM3", "1");
Builder.defineMacro("__ARM_FEATURE_SM4", "1");
}

if (HasUnaligned)
Builder.defineMacro("__ARM_FEATURE_UNALIGNED", "1");

Expand Down Expand Up @@ -421,6 +439,10 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
FPU = FPUMode;
HasCRC = false;
HasCrypto = false;
HasAES = false;
HasSHA2 = false;
HasSHA3 = false;
HasSM4 = false;
HasUnaligned = true;
HasFullFP16 = false;
HasDotProd = false;
Expand Down Expand Up @@ -490,6 +512,16 @@ bool AArch64TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
HasCRC = true;
if (Feature == "+crypto")
HasCrypto = true;
if (Feature == "+aes")
HasAES = true;
if (Feature == "+sha2")
HasSHA2 = true;
if (Feature == "+sha3") {
HasSHA2 = true;
HasSHA3 = true;
}
if (Feature == "+sm4")
HasSM4 = true;
if (Feature == "+strict-align")
HasUnaligned = false;
if (Feature == "+v8.1a")
Expand Down
4 changes: 4 additions & 0 deletions clang/lib/Basic/Targets/AArch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class LLVM_LIBRARY_VISIBILITY AArch64TargetInfo : public TargetInfo {
unsigned FPU;
bool HasCRC;
bool HasCrypto;
bool HasAES;
bool HasSHA2;
bool HasSHA3;
bool HasSM4;
bool HasUnaligned;
bool HasFullFP16;
bool HasDotProd;
Expand Down
14 changes: 13 additions & 1 deletion clang/lib/Basic/Targets/ARM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,8 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
MVE = 0;
CRC = 0;
Crypto = 0;
SHA2 = 0;
AES = 0;
DSP = 0;
Unaligned = 1;
SoftFloat = false;
Expand Down Expand Up @@ -478,6 +480,10 @@ bool ARMTargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
CRC = 1;
} else if (Feature == "+crypto") {
Crypto = 1;
} else if (Feature == "+sha2") {
SHA2 = 1;
} else if (Feature == "+aes") {
AES = 1;
} else if (Feature == "+dsp") {
DSP = 1;
} else if (Feature == "+fp64") {
Expand Down Expand Up @@ -641,8 +647,14 @@ void ARMTargetInfo::getTargetDefines(const LangOptions &Opts,

if (ArchVersion >= 8) {
// ACLE 6.5.7 Crypto Extension
if (Crypto)
// The __ARM_FEATURE_CRYPTO is deprecated in favor of finer grained
// feature macros for AES and SHA2
if (Crypto || (SHA2 && AES))
Builder.defineMacro("__ARM_FEATURE_CRYPTO", "1");
if (SHA2)
Builder.defineMacro("__ARM_FEATURE_SHA2", "1");
if (AES)
Builder.defineMacro("__ARM_FEATURE_AES", "1");
// ACLE 6.5.8 CRC32 Extension
if (CRC)
Builder.defineMacro("__ARM_FEATURE_CRC32", "1");
Expand Down
2 changes: 2 additions & 0 deletions clang/lib/Basic/Targets/ARM.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class LLVM_LIBRARY_VISIBILITY ARMTargetInfo : public TargetInfo {

unsigned CRC : 1;
unsigned Crypto : 1;
unsigned SHA2 : 1;
unsigned AES : 1;
unsigned DSP : 1;
unsigned Unaligned : 1;
unsigned DotProd : 1;
Expand Down
93 changes: 68 additions & 25 deletions clang/lib/Driver/ToolChains/Arch/ARM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,14 @@ void arm::getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple,
if (!llvm::ARM::getFPUFeatures(FPUID, Features))
D.Diag(clang::diag::err_drv_clang_unsupported)
<< std::string("-mfpu=") + AndroidFPU;
} else {
if (!ForAS) {
std::string CPU = arm::getARMTargetCPU(CPUName, ArchName, Triple);
llvm::ARM::ArchKind ArchKind =
arm::getLLVMArchKindForARM(CPU, ArchName, Triple);
FPUID = llvm::ARM::getDefaultFPU(CPU, ArchKind);
(void)llvm::ARM::getFPUFeatures(FPUID, Features);
}
}

// Now we've finished accumulating features from arch, cpu and fpu,
Expand Down Expand Up @@ -618,34 +626,69 @@ void arm::getARMTargetFeatures(const Driver &D, const llvm::Triple &Triple,
Features.push_back("-crc");
}

// For Arch >= ARMv8.0 && A profile: crypto = sha2 + aes
// For Arch >= ARMv8.0 && A or R profile: crypto = sha2 + aes
// Rather than replace within the feature vector, determine whether each
// algorithm is enabled and append this to the end of the vector.
// The algorithms can be controlled by their specific feature or the crypto
// feature, so their status can be determined by the last occurance of
// either in the vector. This allows one to supercede the other.
// e.g. +crypto+noaes in -march/-mcpu should enable sha2, but not aes
// FIXME: this needs reimplementation after the TargetParser rewrite
auto CryptoIt = llvm::find_if(llvm::reverse(Features), [](const StringRef F) {
return F.contains("crypto");
});
if (CryptoIt != Features.rend()) {
if (CryptoIt->take_front() == "+") {
StringRef ArchSuffix = arm::getLLVMArchSuffixForARM(
arm::getARMTargetCPU(CPUName, ArchName, Triple), ArchName, Triple);
if (llvm::ARM::parseArchVersion(ArchSuffix) >= 8 &&
llvm::ARM::parseArchProfile(ArchSuffix) ==
llvm::ARM::ProfileKind::A) {
if (ArchName.find_lower("+nosha2") == StringRef::npos &&
CPUName.find_lower("+nosha2") == StringRef::npos)
Features.push_back("+sha2");
if (ArchName.find_lower("+noaes") == StringRef::npos &&
CPUName.find_lower("+noaes") == StringRef::npos)
Features.push_back("+aes");
} else {
bool HasSHA2 = false;
bool HasAES = false;
const auto ItSHA2 =
llvm::find_if(llvm::reverse(Features), [](const StringRef F) {
return F.contains("crypto") || F.contains("sha2");
});
const auto ItAES =
llvm::find_if(llvm::reverse(Features), [](const StringRef F) {
return F.contains("crypto") || F.contains("aes");
});
const bool FoundSHA2 = ItSHA2 != Features.rend();
const bool FoundAES = ItAES != Features.rend();
if (FoundSHA2)
HasSHA2 = ItSHA2->take_front() == "+";
if (FoundAES)
HasAES = ItAES->take_front() == "+";
if (FoundSHA2 || FoundAES) {
if (HasSHA2 && HasAES)
Features.push_back("+crypto");
else
Features.push_back("-crypto");
if (HasSHA2)
Features.push_back("+sha2");
else
Features.push_back("-sha2");
if (HasAES)
Features.push_back("+aes");
else
Features.push_back("-aes");
}

if (HasSHA2 || HasAES) {
StringRef ArchSuffix = arm::getLLVMArchSuffixForARM(
arm::getARMTargetCPU(CPUName, ArchName, Triple), ArchName, Triple);
llvm::ARM::ProfileKind ArchProfile =
llvm::ARM::parseArchProfile(ArchSuffix);
if (!((llvm::ARM::parseArchVersion(ArchSuffix) >= 8) &&
(ArchProfile == llvm::ARM::ProfileKind::A ||
ArchProfile == llvm::ARM::ProfileKind::R))) {
if (HasSHA2)
D.Diag(clang::diag::warn_target_unsupported_extension)
<< "sha2"
<< llvm::ARM::getArchName(llvm::ARM::parseArch(ArchSuffix));
if (HasAES)
D.Diag(clang::diag::warn_target_unsupported_extension)
<< "crypto"
<< "aes"
<< llvm::ARM::getArchName(llvm::ARM::parseArch(ArchSuffix));
// With -fno-integrated-as -mfpu=crypto-neon-fp-armv8 some assemblers such as the GNU assembler
// will permit the use of crypto instructions as the fpu will override the architecture.
// We keep the crypto feature in this case to preserve compatibility.
// In all other cases we remove the crypto feature.
if (!Args.hasArg(options::OPT_fno_integrated_as))
Features.push_back("-crypto");
// With -fno-integrated-as -mfpu=crypto-neon-fp-armv8 some assemblers such
// as the GNU assembler will permit the use of crypto instructions as the
// fpu will override the architecture. We keep the crypto feature in this
// case to preserve compatibility. In all other cases we remove the crypto
// feature.
if (!Args.hasArg(options::OPT_fno_integrated_as)) {
Features.push_back("-sha2");
Features.push_back("-aes");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/aarch64-neon-range-checks.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +crypto -verify %s
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon -target-feature +sha3 -target-feature +sm4 -verify %s

#include <arm_neon.h>

Expand Down
2 changes: 1 addition & 1 deletion clang/test/CodeGen/aarch64-neon-sha3.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon \
// RUN: -target-feature +crypto -S -emit-llvm -o - %s \
// RUN: -target-feature +sha3 -S -emit-llvm -o - %s \
// RUN: | FileCheck %s

#include <arm_neon.h>
Expand Down
5 changes: 1 addition & 4 deletions clang/test/CodeGen/aarch64-neon-sm4-sm3.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// RUN: %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon \
// RUN: -target-feature +crypto -S -emit-llvm -o - %s \
// RUN: -target-feature +sm4 -S -emit-llvm -o - %s \
// RUN: | FileCheck %s

// RUN: not %clang_cc1 -triple aarch64-linux-gnu -target-feature +neon \
// RUN: -S -emit-llvm -o - %s 2>&1 | FileCheck --check-prefix=CHECK-NO-CRYPTO %s

//The front-end requires the addition of both +crypto and +sm4 in the
// command line, however the back-end requires only +sm4 (includes sm4&sm3)

#include <arm_neon.h>

void test_vsm3partw1(uint32x4_t a, uint32x4_t b, uint32x4_t c) {
Expand Down
6 changes: 3 additions & 3 deletions clang/test/CodeGen/arm-target-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a72 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu cortex-a73 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m3 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8
// CHECK-BASIC-V8: "target-features"="+armv8-a,+crc,+crypto,+d32,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
// CHECK-BASIC-V8: "target-features"="+aes,+armv8-a,+crc,+d32,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+sha2,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"

// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m4 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V82
// RUN: %clang_cc1 -triple thumbv8-linux-gnueabihf -target-cpu exynos-m5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V82
// CHECK-BASIC-V82: "target-features"="+armv8.2-a,+crc,+crypto,+d32,+dotprod,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+fullfp16,+hwdiv,+hwdiv-arm,+neon,+ras,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"
// CHECK-BASIC-V82: "target-features"="+aes,+armv8.2-a,+crc,+d32,+dotprod,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+fullfp16,+hwdiv,+hwdiv-arm,+neon,+ras,+sha2,+thumb-mode,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp"

// RUN: %clang_cc1 -triple armv8-linux-gnueabi -target-cpu cortex-a53 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-BASIC-V8-ARM
// CHECK-BASIC-V8-ARM: "target-features"="+armv8-a,+crc,+crypto,+d32,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-thumb-mode"
// CHECK-BASIC-V8-ARM: "target-features"="+aes,+armv8-a,+crc,+d32,+dsp,+fp-armv8,+fp-armv8d16,+fp-armv8d16sp,+fp-armv8sp,+fp16,+fp64,+hwdiv,+hwdiv-arm,+neon,+sha2,+vfp2,+vfp2sp,+vfp3,+vfp3d16,+vfp3d16sp,+vfp3sp,+vfp4,+vfp4d16,+vfp4d16sp,+vfp4sp,-thumb-mode"

// RUN: %clang_cc1 -triple thumbv7-linux-gnueabi -target-cpu cortex-r5 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-VFP3-D16-DIV
// CHECK-VFP3-D16-DIV: "target-features"="+armv7-r,+dsp,+fp64,+hwdiv,+hwdiv-arm,+thumb-mode,+vfp2,+vfp2sp,+vfp3d16,+vfp3d16sp"
Expand Down
4 changes: 2 additions & 2 deletions clang/test/CodeGen/arm64_crypto.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// RUN: %clang_cc1 -triple arm64-apple-ios7.0 -target-feature +neon -target-feature +crypto -ffreestanding -Os -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple arm64-apple-ios7.0 -target-feature +neon -target-feature +crypto -ffreestanding -fexperimental-new-pass-manager -Os -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple arm64-apple-ios7.0 -target-feature +neon -target-feature +aes -target-feature +sha2 -ffreestanding -Os -S -o - %s | FileCheck %s
// RUN: %clang_cc1 -triple arm64-apple-ios7.0 -target-feature +neon -target-feature +aes -target-feature +sha2 -ffreestanding -fexperimental-new-pass-manager -Os -S -o - %s | FileCheck %s
// REQUIRES: aarch64-registered-target

#include <arm_neon.h>
Expand Down
6 changes: 4 additions & 2 deletions clang/test/CodeGen/neon-crypto.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// RUN: %clang_cc1 -triple arm-none-linux-gnueabi -target-feature +neon \
// RUN: -target-feature +crypto -target-cpu cortex-a57 -emit-llvm -O1 -o - %s | FileCheck %s
// RUN: -target-feature +sha2 -target-feature +aes \
// RUN: -target-cpu cortex-a57 -emit-llvm -O1 -o - %s | FileCheck %s

// RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
// RUN: -target-feature +crypto -emit-llvm -O1 -o - %s | FileCheck %s
// RUN: -target-feature +sha2 -target-feature +aes \
// RUN: -emit-llvm -O1 -o - %s | FileCheck %s
// RUN: not %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
// RUN: -S -O3 -o - %s 2>&1 | FileCheck --check-prefix=CHECK-NO-CRYPTO %s

Expand Down
6 changes: 0 additions & 6 deletions clang/test/Driver/aarch64-cpus.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,12 +483,6 @@
// MCPU-MTUNE-THUNDERX2T99: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "thunderx2t99"
// MCPU-MTUNE-THUNDERX3T110: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "thunderx3t110"

// RUN: %clang -target armv8a-arm-none-eabi -mcpu=cortex-a78c -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CORTEX-A78C %s
// RUN: %clang -target armv8a-arm-none-eabi -mcpu=cortex-a78c -mfpu=crypto-neon-fp-armv8 -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CORTEX-A78C-MFPU %s
// CHECK-CORTEX-A78C: "-cc1"{{.*}} "-triple" "armv8.2a-{{.*}} "-target-cpu" "cortex-a78c"
// CHECK-CORTEX-A78C-MFPU: "-cc1"{{.*}} "-target-feature" "+fp-armv8"
// CHECK-CORTEX-A78C-MFPU: "-target-feature" "+crypto"

// RUN: %clang -target aarch64 -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s
// RUN: %clang -target aarch64 -march=armv8.1-a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s
// RUN: %clang -target aarch64 -mlittle-endian -march=armv8.1a -### -c %s 2>&1 | FileCheck -check-prefix=GENERICV81A %s
Expand Down
Loading

0 comments on commit b8baa2a

Please sign in to comment.