diff --git a/clang/lib/Basic/Targets/ARM.cpp b/clang/lib/Basic/Targets/ARM.cpp --- a/clang/lib/Basic/Targets/ARM.cpp +++ b/clang/lib/Basic/Targets/ARM.cpp @@ -884,6 +884,75 @@ if (Opts.UnsafeFPMath) Builder.defineMacro("__ARM_FP_FAST", "1"); + // Macros for enabling co-proc intrinsics + if ((ArchKind == llvm::ARM::ArchKind::ARMV4 || + ArchKind == llvm::ARM::ArchKind::ARMV4T) && + !isThumb()) { + Builder.defineMacro("__ARM_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_COPROC_V4", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV5T && !isThumb()) { + Builder.defineMacro("__ARM_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_COPROC_V5", "1"); + } + + if ((ArchKind == llvm::ARM::ArchKind::ARMV5TE || + ArchKind == llvm::ARM::ArchKind::ARMV5TEJ) && + !isThumb()) { + Builder.defineMacro("__ARM_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_COPROC_V5TE", "1"); + } + + if ((ArchKind == llvm::ARM::ArchKind::ARMV6 || + ArchKind == llvm::ARM::ArchKind::ARMV6K || + ArchKind == llvm::ARM::ArchKind::ARMV6KZ) && + !isThumb()) { + Builder.defineMacro("__ARM_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_COPROC_V6", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV6T2) { + Builder.defineMacro("__ARM_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_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_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_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) { + Builder.defineMacro("__ARM_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_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) { + Builder.defineMacro("__ARM_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_COPROC_V9", "1"); + } + + if (ArchKind == llvm::ARM::ArchKind::ARMV8MMainline) { + Builder.defineMacro("__ARM_TARGET_COPROC", "1"); + Builder.defineMacro("__ARM_TARGET_COPROC_V8M", "1"); + } + // Armv8.2-A FP16 vector intrinsic if ((FPU & NeonFPU) && HasLegalHalfType) Builder.defineMacro("__ARM_FEATURE_FP16_VECTOR_ARITHMETIC", "1"); diff --git a/clang/lib/Headers/arm_acle.h b/clang/lib/Headers/arm_acle.h --- a/clang/lib/Headers/arm_acle.h +++ b/clang/lib/Headers/arm_acle.h @@ -730,6 +730,67 @@ #define __arm_mte_ptrdiff(__ptra, __ptrb) __builtin_arm_subp(__ptra, __ptrb) #endif +/* Co-proc intrinsics */ +#if __ARM_TARGET_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 __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 --- /dev/null +++ b/clang/test/CodeGen/arm-acle-coproc.c @@ -0,0 +1,350 @@ +// 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 armv8.6a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple armv8.7a %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 thumbv8.6a %s -E -dD -o - | FileCheck --check-prefix=CHECK-V8 %s +// RUN: %clang_cc1 -triple thumbv8.7a %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 + +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 --- a/clang/test/Preprocessor/aarch64-target-features.c +++ b/clang/test/Preprocessor/aarch64-target-features.c @@ -43,6 +43,7 @@ // CHECK-NOT: __ARM_PCS_VFP 1 // CHECK-NOT: __ARM_SIZEOF_MINIMAL_ENUM 1 // CHECK-NOT: __ARM_SIZEOF_WCHAR_T 2 +// CHECK-NOT: __ARM_TARGET_COPROC 1 // CHECK-NOT: __ARM_FEATURE_SVE // CHECK-NOT: __ARM_FEATURE_DOTPROD // CHECK-NOT: __ARM_FEATURE_PAC_DEFAULT