unsigned HasAArch64SVETypes : 1;
+ unsigned ARMCDECoprocMask : 8;
+
// TargetInfo Constructor. Default initializes all fields.
TargetInfo(const llvm::Triple &T);
/// available on this target.
bool hasAArch64SVETypes() const { return HasAArch64SVETypes; }
+ /// For ARM targets returns a mask defining which coprocessors are configured
+ /// as Custom Datapath.
+ uint32_t getARMCDECoprocMask() const { return ARMCDECoprocMask; }
+
/// Returns whether the passed in string is a valid clobber in an
/// inline asm statement.
///
HasBuiltinMSVaList = false;
IsRenderScriptTarget = false;
HasAArch64SVETypes = false;
+ ARMCDECoprocMask = 0;
// Default to no types using fpret.
RealTypeUsesObjCFPRet = 0;
return hasMVE() && (MVE & MVE_FP);
}
+bool ARMTargetInfo::hasCDE() const { return getARMCDECoprocMask() != 0; }
+
bool ARMTargetInfo::isThumb() const {
return ArchISA == llvm::ARM::ISAKind::THUMB;
}
HWDiv = 0;
DotProd = 0;
HasFloat16 = true;
+ ARMCDECoprocMask = 0;
// This does not diagnose illegal cases like having both
// "+vfpv2" and "+vfpv3" or having "+neon" and "-fp64".
FPU |= FPARMV8;
MVE |= MVE_INT | MVE_FP;
HW_FP |= HW_FP_SP | HW_FP_HP;
+ } else if (Feature.size() == strlen("+cdecp0") && Feature >= "+cdecp0" &&
+ Feature <= "+cdecp7") {
+ unsigned Coproc = Feature.back() - '0';
+ ARMCDECoprocMask |= (1U << Coproc);
}
}
Builder.defineMacro("__ARM_FEATURE_MVE", hasMVEFloat() ? "3" : "1");
}
+ if (hasCDE()) {
+ Builder.defineMacro("__ARM_FEATURE_CDE", "1");
+ Builder.defineMacro("__ARM_FEATURE_CDE_COPROC",
+ "0x" + Twine::utohexstr(getARMCDECoprocMask()));
+ }
+
Builder.defineMacro("__ARM_SIZEOF_WCHAR_T",
Twine(Opts.WCharSize ? Opts.WCharSize : 4));
bool supportsThumb2() const;
bool hasMVE() const;
bool hasMVEFloat() const;
+ bool hasCDE() const;
StringRef getCPUAttr() const;
StringRef getCPUProfile() const;
// CHECK-V81M-MVE-NODSP-NOT: #define __ARM_FEATURE_MVE
// CHECK-V81M-MVE-NODSP-NOT: #define __ARM_FEATURE_DSP
+// Test CDE (Custom Datapath Extension) feature test macros
+
+// RUN: %clang -target arm-arm-none-eabi -march=armv8m.main -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-V8M-NOCDE %s
+// CHECK-V8M-NOCDE-NOT: #define __ARM_FEATURE_CDE
+// CHECK-V8M-NOCDE-NOT: #define __ARM_FEATURE_CDE_COPROC
+// RUN: %clang -target arm-arm-none-eabi -march=armv8m.main+cdecp0+cdecp1+cdecp7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8M-CDE-MASK1 %s
+// CHECK-V8M-CDE-MASK1: #define __ARM_FEATURE_CDE 1
+// CHECK-V8M-CDE-MASK1: #define __ARM_FEATURE_CDE_COPROC 0x83
+// RUN: %clang -target arm-arm-none-eabi -march=armv8m.main+cdecp0+cdecp1+cdecp2+cdecp3+cdecp4+cdecp5+cdecp6+cdecp7 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V8M-CDE-MASK2 %s
+// CHECK-V8M-CDE-MASK2: #define __ARM_FEATURE_CDE 1
+// CHECK-V8M-CDE-MASK2: #define __ARM_FEATURE_CDE_COPROC 0xff
+
// RUN: %clang -target armv8.1a-none-none-eabi -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-V81A %s
// CHECK-V81A: #define __ARM_ARCH 8
// CHECK-V81A: #define __ARM_ARCH_8_1A__ 1