https://github.com/hstk30-hw updated https://github.com/llvm/llvm-project/pull/75440
>From 5a746e97989ba795264d20aef4f056db0c17bc2c Mon Sep 17 00:00:00 2001 From: hstk30-hw <hanwe...@huawei.com> Date: Thu, 14 Dec 2023 15:40:03 +0800 Subject: [PATCH] feat: arm_acle.h add Coprocessor Instrinsics --- clang/lib/Basic/Targets/ARM.cpp | 72 ++++ clang/lib/Headers/arm_acle.h | 53 +++ clang/test/CodeGen/arm-acle-coproc.c | 346 ++++++++++++++++++ .../Preprocessor/aarch64-target-features.c | 1 + 4 files changed, 472 insertions(+) create mode 100644 clang/test/CodeGen/arm-acle-coproc.c diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp index ce7e4d4639ceac..c7962210e4563b 100644 --- a/clang/lib/Basic/Targets/ARM.cpp +++ b/clang/lib/Basic/Targets/ARM.cpp @@ -836,6 +836,78 @@ void ARMTargetInfo::getTargetDefines(const LangOptions &Opts, if (Opts.RWPI) Builder.defineMacro("__ARM_RWPI", "1"); + // Macros for enabling co-proc intrinsics + if ((ArchKind == llvm::ARM::ArchKind::ARMV4 || + ArchKind == llvm::ARM::ArchKind::ARMV4T) && + !isThumb()) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V4", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV5T && + !isThumb()) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V5", "1"); + } + + if ((ArchKind == llvm::ARM::ArchKind::ARMV5TE || + ArchKind == llvm::ARM::ArchKind::ARMV5TEJ) && + !isThumb()) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V5TE", "1"); + } + + if ((ArchKind == llvm::ARM::ArchKind::ARMV6 || + ArchKind == llvm::ARM::ArchKind::ARMV6K || + ArchKind == llvm::ARM::ArchKind::ARMV6KZ) && + !isThumb()) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V6", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV6T2) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V6", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV7A || + ArchKind == llvm::ARM::ArchKind::ARMV7R || + ArchKind == llvm::ARM::ArchKind::ARMV7M || + ArchKind == llvm::ARM::ArchKind::ARMV7S || + ArchKind == llvm::ARM::ArchKind::ARMV7EM) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V7", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV8A || + ArchKind == llvm::ARM::ArchKind::ARMV8R || + ArchKind == llvm::ARM::ArchKind::ARMV8_1A || + ArchKind == llvm::ARM::ArchKind::ARMV8_2A || + ArchKind == llvm::ARM::ArchKind::ARMV8_3A || + ArchKind == llvm::ARM::ArchKind::ARMV8_4A || + ArchKind == llvm::ARM::ArchKind::ARMV8_5A || + ArchKind == llvm::ARM::ArchKind::ARMV8_6A || + ArchKind == llvm::ARM::ArchKind::ARMV8_7A || + ArchKind == llvm::ARM::ArchKind::ARMV8_8A || + ArchKind == llvm::ARM::ArchKind::ARMV8_9A) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V8", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV9A || + ArchKind == llvm::ARM::ArchKind::ARMV9_1A || + ArchKind == llvm::ARM::ArchKind::ARMV9_2A || + ArchKind == llvm::ARM::ArchKind::ARMV9_3A || + ArchKind == llvm::ARM::ArchKind::ARMV9_4A) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V9", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV8MMainline) { + Builder.defineMacro("__ARM_FEATURE_COPROC", "1"); + Builder.defineMacro("__ARM_FEATURE_COPROC_V8M", "1"); + } + if (ArchKind == llvm::ARM::ArchKind::XSCALE) Builder.defineMacro("__XSCALE__"); diff --git a/clang/lib/Headers/arm_acle.h b/clang/lib/Headers/arm_acle.h index 61d80258d166a1..6852337c38038b 100644 --- a/clang/lib/Headers/arm_acle.h +++ b/clang/lib/Headers/arm_acle.h @@ -756,6 +756,59 @@ __arm_st64bv0(void *__addr, data512_t __value) { __builtin_arm_mops_memset_tag(__tagged_address, __value, __size) #endif +/* Coprocessor Intrinsics */ +#if __ARM_FEATURE_COPROC + +#ifndef __ARM_TARGET_COPROC_V8 +#define __arm_cdp(coproc, opc1, CRd, CRn, CRm, opc2) __builtin_arm_cdp(coproc, opc1, CRd, CRn, CRm, opc2) +#endif + +#define __arm_ldc(coproc, CRd, p) __builtin_arm_ldc(coproc, CRd, p) +#define __arm_stc(coproc, CRd, p) __builtin_arm_stc(coproc, CRd, p) + +#if !defined(__ARM_TARGET_COPROC_V4) && !defined(__ARM_TARGET_COPROC_V8) +#define __arm_ldcl(coproc, CRd, p) __builtin_arm_ldcl(coproc, CRd, p) +#define __arm_stcl(coproc, CRd, p) __builtin_arm_stcl(coproc, CRd, p) +#endif + + +#define __arm_mcr(coproc, opc1, value, CRn, CRm, opc2) __builtin_arm_mcr(coproc, opc1, value, CRn, CRm, opc2) +#define __arm_mrc(coproc, opc1, CRn, CRm, opc2) __builtin_arm_mrc(coproc, opc1, CRn, CRm, opc2) + +#if !defined(__ARM_TARGET_COPROC_V4) && !defined(__ARM_TARGET_COPROC_V8) +#define __arm_cdp2(coproc, opc1, CRd, CRn, CRm, opc2) __builtin_arm_cdp2(coproc, opc1, CRd, CRn, CRm, opc2) + +#define __arm_ldc2(coproc, CRd, p) __builtin_arm_ldc2(coproc, CRd, p) +#define __arm_ldc2l(coproc, CRd, p) __builtin_arm_ldc2l(coproc, CRd, p) +#define __arm_stc2(coproc, CRd, p) __builtin_arm_stc2(coproc, CRd, p) +#define __arm_stc2l(coproc, CRd, p) __builtin_arm_stc2l(coproc, CRd, p) + +#define __arm_mcr2(coproc, opc1, value, CRn, CRm, opc2) __builtin_arm_mcr2(coproc, opc1, value, CRn, CRm, opc2) +#define __arm_mrc2(coproc, opc1, CRn, CRm, opc2) __builtin_arm_mrc2(coproc, opc1, CRn, CRm, opc2) + +#ifndef __ARM_TARGET_COPROC_V5 + +#define __arm_mcrr(coproc, opc1, value, CRm) __builtin_arm_mcrr(coproc, opc1, value, CRm) +#define __arm_mrrc(coproc, opc1, CRm) __builtin_arm_mrrc(coproc, opc1, CRm) + +#ifndef __ARM_TARGET_COPROC_V5TE +#define __arm_mcrr2(coproc, opc1, value, CRm) __builtin_arm_mcrr2(coproc, opc1, value, CRm) +#define __arm_mrrc2(coproc, opc1, CRm) __builtin_arm_mrrc2(coproc, opc1, CRm) +#endif // __ARM_TARGET_COPROC_V5TE + +#endif // __ARM_TARGET_COPROC_V5 + +#endif // __ARM_TARGET_COPROC_V4 && __ARM_TARGET_COPROC_V8 + +#ifdef __ARM_TARGET_COPROC_V8 + +#define __arm_mcrr(coproc, opc1, value, CRm) __builtin_arm_mcrr(coproc, opc1, value, CRm) +#define __arm_mrrc(coproc, opc1, CRm) __builtin_arm_mrrc(coproc, opc1, CRm) + +#endif // __ARM_TARGET_COPROC_V8 + +#endif // __ARM_TARGET_COPROC + /* Transactional Memory Extension (TME) Intrinsics */ #if defined(__ARM_FEATURE_TME) && __ARM_FEATURE_TME diff --git a/clang/test/CodeGen/arm-acle-coproc.c b/clang/test/CodeGen/arm-acle-coproc.c new file mode 100644 index 00000000000000..e8a8c78bd4bc5a --- /dev/null +++ b/clang/test/CodeGen/arm-acle-coproc.c @@ -0,0 +1,346 @@ +// RUN: %clang_cc1 -triple armv4 %s -E -dD -o - | FileCheck --check-prefix=CHECK-V4 %s +// RUN: %clang_cc1 -triple armv4t %s -E -dD -o - | FileCheck --check-prefix=CHECK-V4 %s +// RUN: %clang_cc1 -triple armv5 %s -E -dD -o - | FileCheck --check-prefix=CHECK-V5 %s +// RUN: %clang_cc1 -triple armv5te %s -E -dD -o - | FileCheck --check-prefix=CHECK-V5-TE %s +// RUN: %clang_cc1 -triple armv5tej %s -E -dD -o - | FileCheck --check-prefix=CHECK-V5-TE %s +// RUN: %clang_cc1 -triple armv6 %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6 %s +// RUN: %clang_cc1 -triple armv6m %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6M %s +// RUN: %clang_cc1 -triple armv7a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s +// RUN: %clang_cc1 -triple armv7r %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s +// RUN: %clang_cc1 -triple armv7m %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s +// RUN: %clang_cc1 -triple armv8a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple armv8r %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple armv8.1a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple armv8.2a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple armv8.3a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple armv8.4a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple armv8.5a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv4 %s -E -dD -o - | FileCheck --check-prefix=CHECK-V4-THUMB %s +// RUN: %clang_cc1 -triple thumbv4t %s -E -dD -o - | FileCheck --check-prefix=CHECK-V4-THUMB %s +// RUN: %clang_cc1 -triple thumbv5 %s -E -dD -o - | FileCheck --check-prefix=CHECK-V5-THUMB %s +// RUN: %clang_cc1 -triple thumbv5te %s -E -dD -o - | FileCheck --check-prefix=CHECK-V5-TE-THUMB %s +// RUN: %clang_cc1 -triple thumbv5tej %s -E -dD -o - | FileCheck --check-prefix=CHECK-V5-TE-THUMB %s +// RUN: %clang_cc1 -triple thumbv6 %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6-THUMB %s +// RUN: %clang_cc1 -triple thumbv6k %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6-THUMB %s +// RUN: %clang_cc1 -triple thumbv6kz %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6-THUMB %s +// RUN: %clang_cc1 -triple thumbv6m %s -E -dD -o - | FileCheck --check-prefix=CHECK-V6M %s +// RUN: %clang_cc1 -triple thumbv7a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s +// RUN: %clang_cc1 -triple thumbv7r %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s +// RUN: %clang_cc1 -triple thumbv7m %s -E -dD -o - | FileCheck --check-prefix=CHECK-V7 %s +// RUN: %clang_cc1 -triple thumbv8a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv8.1a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv8.2a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv8.3a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv8.4a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv8.5a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv8r %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv8m.base %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8-BASE %s +// RUN: %clang_cc1 -triple thumbv8m.main %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8-MAIN %s + +#include <arm_acle.h> + +void cdp() { + __arm_cdp(1, 2, 3, 4, 5, 6); + // CHECK-V4: __builtin_arm_cdp + // CHECK-V4-THUMB-NOT: __builtin_arm_cdp + // CHECK-V5: __builtin_arm_cdp + // CHECK-V5-TE: __builtin_arm_cdp + // CHECK-V5-THUMB-NOT: __builtin_arm_cdp + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_cdp + // CHECK-V6: __builtin_arm_cdp + // CHECK-V6-THUMB-NOT: __builtin_arm_cdp + // CHECK-V6M-NOT: __builtin_arm_cdp + // CHECK-V7: __builtin_arm_cdp + // CHECK-V8-NOT: __builtin_arm_cdp + // CHECK-V8-BASE-NOT: __builtin_arm_cdp + // CHECK-V8-MAIN: __builtin_arm_cdp +} + +void cdp2() { + __arm_cdp2(1, 2, 3, 4, 5, 6); + // CHECK-V4-NOT: __builtin_arm_cdp2 + // CHECK-V4-THUMB-NOT: __builtin_arm_cdp2 + // CHECK-V5: __builtin_arm_cdp2 + // CHECK-V5-TE: __builtin_arm_cdp2 + // CHECK-V5-THUMB-NOT: __builtin_arm_cdp2 + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_cdp2 + // CHECK-V6: __builtin_arm_cdp2 + // CHECK-V6-THUMB-NOT: __builtin_arm_cdp2 + // CHECK-V6M-NOT: __builtin_arm_cdp2 + // CHECK-V7: __builtin_arm_cdp2 + // CHECK-V8-NOT: __builtin_arm_cdp2 + // CHECK-V8-BASE-NOT: __builtin_arm_cdp2 + // CHECK-V8-MAIN: __builtin_arm_cdp2 +} + +void ldc(int i) { + __arm_ldc(1, 2, &i); + // CHECK-V4: __builtin_arm_ldc + // CHECK-V4-NOT: __builtin_arm_ldc + // CHECK-V5: __builtin_arm_ldc + // CHECK-V5-TE: __builtin_arm_ldc + // CHECK-V5-THUMB-NOT: __builtin_arm_ldc + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_ldc + // CHECK-V6: __builtin_arm_ldc + // CHECK-V6-THUMB-NOT: __builtin_arm_ldc + // CHECK-V6M-NOT: __builtin_arm_ldc + // CHECK-V7: __builtin_arm_ldc + // CHECK-V8: __builtin_arm_ldc + // CHECK-V8-BASE-NOT: __builtin_arm_ldc + // CHECK-V8-MAIN: __builtin_arm_ldc +} + +void ldcl(int i) { + __arm_ldcl(1, 2, &i); + // CHECK-V4-NOT: __builtin_arm_ldcl + // CHECK-V4-THUMB-NOT: __builtin_arm_ldcl + // CHECK-V5: __builtin_arm_ldcl + // CHECK-V5-TE: __builtin_arm_ldcl + // CHECK-V5-THUMB-NOT: __builtin_arm_ldcl + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_ldcl + // CHECK-V6: __builtin_arm_ldcl + // CHECK-V6-THUMB-NOT: __builtin_arm_ldcl + // CHECK-V6M-NOT: __builtin_arm_ldcl + // CHECK-V7: __builtin_arm_ldcl + // CHECK-V8-NOT: __builtin_arm_ldcl + // CHECK-V8-BASE-NOT: __builtin_arm_ldcl + // CHECK-V8-MAIN: __builtin_arm_ldcl +} + +void ldc2(int i) { + __arm_ldc2(1, 2, &i); + // CHECK-V4-NOT: __builtin_arm_ldc2 + // CHECK-V4-THUMB-NOT: __builtin_arm_ldc2 + // CHECK-V5: __builtin_arm_ldc2 + // CHECK-V5-TE: __builtin_arm_ldc2 + // CHECK-V5-THUMB-NOT: __builtin_arm_ldc2 + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_ldc2 + // CHECK-V6: __builtin_arm_ldc2 + // CHECK-V6-THUMB-NOT: __builtin_arm_ldc2 + // CHECK-V6M-NOT: __builtin_arm_ldc2 + // CHECK-V7: __builtin_arm_ldc2 + // CHECK-V8-NOT: __builtin_arm_ldc2 + // CHECK-V8-BASE-NOT: __builtin_arm_ldc2 + // CHECK-V8-MAIN: __builtin_arm_ldc2 +} + +void ldc2l(int i) { + __arm_ldc2l(1, 2, &i); + // CHECK-V4-NOT: __builtin_arm_ldc2l + // CHECK-V4-THUMB-NOT: __builtin_arm_ldc2l + // CHECK-V5: __builtin_arm_ldc2l + // CHECK-V5-TE: __builtin_arm_ldc2l + // CHECK-V5-THUMB-NOT: __builtin_arm_ldc2l + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_ldc2l + // CHECK-V6: __builtin_arm_ldc2l + // CHECK-V6-THUMB-NOT: __builtin_arm_ldc2l + // CHECK-V6M-NOT: __builtin_arm_ldc2l + // CHECK-V7: __builtin_arm_ldc2l + // CHECK-V8-NOT: __builtin_arm_ldc2l + // CHECK-V8-BASE-NOT: __builtin_arm_ldc2l + // CHECK-V8-MAIN: __builtin_arm_ldc2l +} + +void stc(int i) { + __arm_stc(1, 2, &i); + // CHECK-V4: __builtin_arm_stc + // CHECK-V4-THUMB-NOT: __builtin_arm_stc + // CHECK-V5: __builtin_arm_stc + // CHECK-V5-TE: __builtin_arm_stc + // CHECK-V5-THUMB-NOT: __builtin_arm_stc + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_stc + // CHECK-V6: __builtin_arm_stc + // CHECK-V6-THUMB-NOT: __builtin_arm_stc + // CHECK-V6M-NOT: __builtin_arm_stc + // CHECK-V7: __builtin_arm_stc + // CHECK-V8: __builtin_arm_stc + // CHECK-V8-BASE-NOT: __builtin_arm_stc + // CHECK-V8-MAIN: __builtin_arm_stc +} + +void stcl(int i) { + __arm_stcl(1, 2, &i); + // CHECK-V4-NOT: __builtin_arm_stcl + // CHECK-V4-THUMB-NOT: __builtin_arm_stcl + // CHECK-V5: __builtin_arm_stcl + // CHECK-V5-TE: __builtin_arm_stcl + // CHECK-V5-THUMB-NOT: __builtin_arm_stcl + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_stcl + // CHECK-V6: __builtin_arm_stcl + // CHECK-V6-THUMB-NOT: __builtin_arm_stcl + // CHECK-V6M-NOT: __builtin_arm_stcl + // CHECK-V7: __builtin_arm_stcl + // CHECK-V8-NOT: __builtin_arm_stcl + // CHECK-V8-BASE-NOT: __builtin_arm_stcl + // CHECK-V8-MAIN: __builtin_arm_stcl +} + +void stc2(int i) { + __arm_stc2(1, 2, &i); + // CHECK-V4-NOT: __builtin_arm_stc2 + // CHECK-V4-THUMB-NOT: __builtin_arm_stc2 + // CHECK-V5: __builtin_arm_stc2 + // CHECK-V5-TE: __builtin_arm_stc2 + // CHECK-V5-THUMB-NOT: __builtin_arm_stc2 + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_stc2 + // CHECK-V6: __builtin_arm_stc2 + // CHECK-V6-THUMB-NOT: __builtin_arm_stc2 + // CHECK-V6M-NOT: __builtin_arm_stc2 + // CHECK-V7: __builtin_arm_stc2 + // CHECK-V8-NOT: __builtin_arm_stc2 + // CHECK-V8-BASE-NOT: __builtin_arm_stc2 + // CHECK-V8-MAIN: __builtin_arm_stc2 +} + +void stc2l(int i) { + __arm_stc2l(1, 2, &i); + // CHECK-V4-NOT: __builtin_arm_stc2l + // CHECK-V4-THUMB-NOT: __builtin_arm_stc2l + // CHECK-V5: __builtin_arm_stc2l + // CHECK-V5-TE: __builtin_arm_stc2l + // CHECK-V5-THUMB-NOT: __builtin_arm_stc2l + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_stc2l + // CHECK-V6: __builtin_arm_stc2l + // CHECK-V6-THUMB-NOT: __builtin_arm_stc2l + // CHECK-V6M-NOT: __builtin_arm_stc2l + // CHECK-V7: __builtin_arm_stc2l + // CHECK-V8-NOT: __builtin_arm_stc2l + // CHECK-V8-BASE-NOT: __builtin_arm_stc2l + // CHECK-V8-MAIN: __builtin_arm_stc2l +} + +void mcr() { + __arm_mcr(1, 2, 3, 4, 5, 6); + // CHECK-V4: __builtin_arm_mcr + // CHECK-V4-THUMB-NOT: __builtin_arm_mcr + // CHECK-V5: __builtin_arm_mcr + // CHECK-V5-TE: __builtin_arm_mcr + // CHECK-V5-THUMB-NOT: __builtin_arm_mcr + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_mcr + // CHECK-V6: __builtin_arm_mcr + // CHECK-V6-THUMB-NOT: __builtin_arm_mcr + // CHECK-V6M-NOT: __builtin_arm_mcr + // CHECK-V7: __builtin_arm_mcr + // CHECK-V8: __builtin_arm_mcr + // CHECK-V8-BASE-NOT: __builtin_arm_mcr + // CHECK-V8-MAIN: __builtin_arm_mcr +} + +void mcr2() { + __arm_mcr2(1, 2, 3, 4, 5, 6); + // CHECK-V4-NOT: __builtin_arm_mcr2 + // CHECK-V4-THUMB-NOT: __builtin_arm_mcr2 + // CHECK-V5: __builtin_arm_mcr2 + // CHECK-V5-TE: __builtin_arm_mcr2 + // CHECK-V5-THUMB-NOT: __builtin_arm_mcr2 + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_mcr2 + // CHECK-V6: __builtin_arm_mcr2 + // CHECK-V6-THUMB-NOT: __builtin_arm_mcr2 + // CHECK-V6M-NOT: __builtin_arm_mcr2 + // CHECK-V7: __builtin_arm_mcr2 + // CHECK-V8-NOT: __builtin_arm_mcr2 + // CHECK-V8-BASE-NOT: __builtin_arm_mcr2 + // CHECK-V8-MAIN: __builtin_arm_mcr2 +} + +void mrc() { + __arm_mrc(1, 2, 3, 4, 5); + // CHECK-V4: __builtin_arm_mrc + // CHECK-V4-THUMB-NOT: __builtin_arm_mrc + // CHECK-V5: __builtin_arm_mrc + // CHECK-V5-TE: __builtin_arm_mrc + // CHECK-V5-THUMB-NOT: __builtin_arm_mrc + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_mrc + // CHECK-V6: __builtin_arm_mrc + // CHECK-V6-THUMB-NOT: __builtin_arm_mrc + // CHECK-V6M-NOT: __builtin_arm_mrc + // CHECK-V7: __builtin_arm_mrc + // CHECK-V8: __builtin_arm_mrc + // CHECK-V8-BASE-NOT: __builtin_arm_mrc + // CHECK-V8-MAIN: __builtin_arm_mrc +} + +void mrc2() { + __arm_mrc2(1, 2, 3, 4, 5); + // CHECK-V4-NOT: __builtin_arm_mrc2 + // CHECK-V4-THUMB-NOT: __builtin_arm_mrc2 + // CHECK-V5: __builtin_arm_mrc2 + // CHECK-V5-TE: __builtin_arm_mrc2 + // CHECK-V5-THUMB-NOT: __builtin_arm_mrc2 + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_mrc2 + // CHECK-V6: __builtin_arm_mrc2 + // CHECK-V6-THUMB-NOT: __builtin_arm_mrc2 + // CHECK-V6M-NOT: __builtin_arm_mrc2 + // CHECK-V7: __builtin_arm_mrc2 + // CHECK-V8-NOT: __builtin_arm_mrc2 + // CHECK-V8-BASE-NOT: __builtin_arm_mrc2 + // CHECK-V8-MAIN: __builtin_arm_mrc2 +} + +void mcrr() { + __arm_mcrr(1, 2, 3, 4); + // CHECK-V4-NOT: __builtin_arm_mcrr + // CHECK-V4-THUMB-NOT: __builtin_arm_mcrr + // CHECK-V5-NOT: __builtin_arm_mcrr + // CHECK-V5-TE: __builtin_arm_mcrr + // CHECK-V5-THUMB-NOT: __builtin_arm_mcrr + // CHECK-V5-THUMB-NOT: __builtin_arm_mcrr + // CHECK-V6: __builtin_arm_mcrr + // CHECK-V6-THUMB-NOT: __builtin_arm_mcrr + // CHECK-V6M-NOT: __builtin_arm_mcrr + // CHECK-V7: __builtin_arm_mcrr + // CHECK-V8: __builtin_arm_mcrr + // CHECK-V8-BASE-NOT: __builtin_arm_mcrr + // CHECK-V8-MAIN: __builtin_arm_mcrr +} + +void mcrr2() { + __arm_mcrr2(1, 2, 3, 4); + // CHECK-V4-NOT: __builtin_arm_mcrr2 + // CHECK-V4-THUMB-NOT: __builtin_arm_mcrr2 + // CHECK-V5-NOT: __builtin_arm_mcrr2 + // CHECK-V5-TE-NOT: __builtin_arm_mcrr2 + // CHECK-V5-THUMB-NOT: __builtin_arm_mcrr2 + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_mcrr2 + // CHECK-V6: __builtin_arm_mcrr2 + // CHECK-V6-THUMB-NOT: __builtin_arm_mcrr2 + // CHECK-V6M-NOT: __builtin_arm_mcrr2 + // CHECK-V7: __builtin_arm_mcrr2 + // CHECK-V8-NOT: __builtin_arm_mcrr2 + // CHECK-V8-BASE-NOT: __builtin_arm_mcrr2 + // CHECK-V8-MAIN: __builtin_arm_mcrr2 +} + +void mrrc() { + __arm_mrrc(1, 2, 3); + // CHECK-V4-NOT: __builtin_arm_mrrc + // CHECK-V4-THUMB-NOT: __builtin_arm_mrrc + // CHECK-V5-NOT: __builtin_arm_mrrc + // CHECK-V5-TE: __builtin_arm_mrrc + // CHECK-V5-THUMB-NOT: __builtin_arm_mrrc + // CHECK-V5-THUMB-TE: __builtin_arm_mrrc + // CHECK-V6: __builtin_arm_mrrc + // CHECK-V6-THUMB-NOT: __builtin_arm_mrrc + // CHECK-V6M-NOT: __builtin_arm_mrrc + // CHECK-V7: __builtin_arm_mrrc + // CHECK-V8: __builtin_arm_mrrc + // CHECK-V8-BASE-NOT: __builtin_arm_mrrc + // CHECK-V8-MAIN: __builtin_arm_mrrc +} + +void mrrc2() { + __arm_mrrc2(1, 2, 3); + // CHECK-V4-NOT: __builtin_arm_mrrc2 + // CHECK-V4-THUMB-NOT: __builtin_arm_mrrc2 + // CHECK-V5-NOT: __builtin_arm_mrrc2 + // CHECK-V5-TE-NOT: __builtin_arm_mrrc2 + // CHECK-V5-THUMB-NOT: __builtin_arm_mrrc2 + // CHECK-V5-TE-THUMB-NOT: __builtin_arm_mrrc2 + // CHECK-V6: __builtin_arm_mrrc2 + // CHECK-V6-THUMB-NOT: __builtin_arm_mrrc2 + // CHECK-V6M-NOT: __builtin_arm_mrrc2 + // CHECK-V7: __builtin_arm_mrrc2 + // CHECK-V8-NOT: __builtin_arm_mrrc2 + // CHECK-V8-BASE-NOT: __builtin_arm_mrrc2 + // CHECK-V8-MAIN: __builtin_arm_mrrc2 +} diff --git a/clang/test/Preprocessor/aarch64-target-features.c b/clang/test/Preprocessor/aarch64-target-features.c index db89aa7b608ad5..45208735920d00 100644 --- a/clang/test/Preprocessor/aarch64-target-features.c +++ b/clang/test/Preprocessor/aarch64-target-features.c @@ -45,6 +45,7 @@ // CHECK-NOT: __ARM_PCS_VFP 1 // CHECK-NOT: __ARM_SIZEOF_MINIMAL_ENUM 1 // CHECK-NOT: __ARM_SIZEOF_WCHAR_T 2 +// CHECK-NOT: __ARM_FEATURE_COPROC // CHECK-NOT: __ARM_FEATURE_SVE // CHECK-NOT: __ARM_FEATURE_DOTPROD // CHECK-NOT: __ARM_FEATURE_PAC_DEFAULT _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits