Index: lib/Basic/Targets/AArch64.h =================================================================== --- lib/Basic/Targets/AArch64.h +++ lib/Basic/Targets/AArch64.h @@ -33,6 +33,7 @@ unsigned Crypto; unsigned Unaligned; unsigned HasFullFP16; + unsigned HasDotProd; llvm::AArch64::ArchKind ArchKind; static const Builtin::Info BuiltinInfo[]; Index: lib/Basic/Targets/AArch64.cpp =================================================================== --- lib/Basic/Targets/AArch64.cpp +++ lib/Basic/Targets/AArch64.cpp @@ -193,6 +193,9 @@ if (HasFullFP16) Builder.defineMacro("__ARM_FEATURE_FP16_SCALAR_ARITHMETIC", "1"); + if (HasDotProd) + Builder.defineMacro("__ARM_FEATURE_DOTPROD", "1"); + switch (ArchKind) { default: break; @@ -248,6 +251,8 @@ ArchKind = llvm::AArch64::ArchKind::ARMV8_2A; if (Feature == "+fullfp16") HasFullFP16 = 1; + if (Feature == "+dotprod") + HasDotProd = 1; } setDataLayout(); Index: test/Preprocessor/aarch64-target-features.c =================================================================== --- test/Preprocessor/aarch64-target-features.c +++ test/Preprocessor/aarch64-target-features.c @@ -89,6 +89,10 @@ // RUN: %clang -target aarch64-none-linux-gnu -march=armv8-a+sve -x c -E -dM %s -o - | FileCheck --check-prefix=CHECK-SVE %s // CHECK-SVE: __ARM_FEATURE_SVE 1 +// RUN: %clang -target aarch64-none-linux-gnu -march=armv8.2a+dotprod -x c -E +// -dM %s -o - | FileCheck --check-prefix=CHECK-DOTPROD %s +// CHECK-DOTPROD: __ARM_FEATURE_DOTPROD 1 + // RUN: %clang -target aarch64-none-linux-gnueabi -march=armv8.2a+fp16 -x c -E -dM %s -o - | FileCheck -match-full-lines --check-prefix=CHECK-FULLFP16-VECTOR-SCALAR %s // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_SCALAR_ARITHMETIC 1 // CHECK-FULLFP16-VECTOR-SCALAR: #define __ARM_FEATURE_FP16_VECTOR_ARITHMETIC 1