Index: cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td =================================================================== --- cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td +++ cfe/trunk/include/clang/Basic/DiagnosticDriverKinds.td @@ -263,6 +263,9 @@ def err_analyzer_config_multiple_values : Error< "analyzer-config option '%0' should contain only one '='">; +def err_drv_invalid_hvx_length : Error< + "-mhvx-length is not supported without a -mhvx/-mhvx= flag">; + def err_drv_modules_validate_once_requires_timestamp : Error< "option '-fmodules-validate-once-per-build-session' requires " "'-fbuild-session-timestamp=' or '-fbuild-session-file='">; Index: cfe/trunk/include/clang/Driver/Options.td =================================================================== --- cfe/trunk/include/clang/Driver/Options.td +++ cfe/trunk/include/clang/Driver/Options.td @@ -139,6 +139,10 @@ Group, DocName<"ARM">; def m_hexagon_Features_Group : OptionGroup<"">, Group, DocName<"Hexagon">; +// The features added by this group will not be added to target features. +// These are explicitly handled. +def m_hexagon_Features_HVX_Group : OptionGroup<"">, + Group, DocName<"Hexagon">; def m_ppc_Features_Group : OptionGroup<"">, Group, DocName<"PowerPC">; def m_wasm_Features_Group : OptionGroup<"">, @@ -2495,14 +2499,26 @@ Alias, AliasArgs<["hexagonv60"]>; def mv62 : Flag<["-"], "mv62">, Group, Alias, AliasArgs<["hexagonv62"]>; -def mhexagon_hvx : Flag<["-"], "mhvx">, Group, - Flags<[CC1Option]>, HelpText<"Enable Hexagon Vector eXtensions">; -def mno_hexagon_hvx : Flag<["-"], "mno-hvx">, Group, - Flags<[CC1Option]>, HelpText<"Disable Hexagon Vector eXtensions">; -def mhexagon_hvx_double : Flag<["-"], "mhvx-double">, Group, - Flags<[CC1Option]>, HelpText<"Enable Hexagon Double Vector eXtensions">; -def mno_hexagon_hvx_double : Flag<["-"], "mno-hvx-double">, Group, - Flags<[CC1Option]>, HelpText<"Disable Hexagon Double Vector eXtensions">; +def mhexagon_hvx : Flag<[ "-" ], "mhvx">, + Group, + HelpText<"Enable Hexagon Vector eXtensions">; +def mhexagon_hvx_EQ : Joined<[ "-" ], "mhvx=">, + Group, + HelpText<"Enable Hexagon Vector eXtensions">; +def mno_hexagon_hvx : Flag<[ "-" ], "mno-hvx">, + Group, + HelpText<"Disable Hexagon Vector eXtensions">; +def mhexagon_hvx_length_EQ : Joined<[ "-" ], "mhvx-length=">, + Group, + HelpText<"Set Hexagon Vector Length">, Values<"64B,128B">; +// hvx-double deprecrated flag. +def mhexagon_hvx_double : Flag<[ "-" ], "mhvx-double">, + Group, + HelpText<"Enable Hexagon Double Vector eXtensions">; +def mno_hexagon_hvx_double + : Flag<[ "-" ], "mno-hvx-double">, + Group, + HelpText<"Disable Hexagon Double Vector eXtensions">; // These are legacy user-facing driver-level option spellings. They are always // aliases for options that are spelled using the more common Unix / GNU flag Index: cfe/trunk/lib/Basic/Targets/Hexagon.h =================================================================== --- cfe/trunk/lib/Basic/Targets/Hexagon.h +++ cfe/trunk/lib/Basic/Targets/Hexagon.h @@ -29,8 +29,11 @@ static const char *const GCCRegNames[]; static const TargetInfo::GCCRegAlias GCCRegAliases[]; std::string CPU; - bool HasHVX, HasHVXDouble; - bool UseLongCalls; + std::string HVXVersion; + bool HasHVX = false; + bool HasHVX64B = false; + bool HasHVX128B = false; + bool UseLongCalls = false; public: HexagonTargetInfo(const llvm::Triple &Triple, const TargetOptions &) @@ -54,8 +57,6 @@ LargeArrayAlign = 64; UseBitFieldTypeAlignment = true; ZeroLengthBitfieldBoundary = 32; - HasHVX = HasHVXDouble = false; - UseLongCalls = false; } ArrayRef getTargetBuiltins() const override; @@ -95,15 +96,12 @@ bool handleTargetFeatures(std::vector &Features, DiagnosticsEngine &Diags) override; - void setFeatureEnabled(llvm::StringMap &Features, StringRef Name, - bool Enabled) const override; - BuiltinVaListKind getBuiltinVaListKind() const override { return TargetInfo::CharPtrBuiltinVaList; } ArrayRef getGCCRegNames() const override; - + ArrayRef getGCCRegAliases() const override; const char *getClobbers() const override { return ""; } Index: cfe/trunk/lib/Basic/Targets/Hexagon.cpp =================================================================== --- cfe/trunk/lib/Basic/Targets/Hexagon.cpp +++ cfe/trunk/lib/Basic/Targets/Hexagon.cpp @@ -54,18 +54,24 @@ Builder.defineMacro("__HEXAGON_ARCH__", "62"); } - if (hasFeature("hvx")) { + if (hasFeature("hvx-length64b")) { Builder.defineMacro("__HVX__"); - if (hasFeature("hvx-double")) - Builder.defineMacro("__HVXDBL__"); + Builder.defineMacro("__HVX_ARCH__", HVXVersion); + Builder.defineMacro("__HVX_LENGTH__", "64"); + } + + if (hasFeature("hvx-length128b")) { + Builder.defineMacro("__HVX__"); + Builder.defineMacro("__HVX_ARCH__", HVXVersion); + Builder.defineMacro("__HVX_LENGTH__", "128"); + // FIXME: This macro is deprecated. + Builder.defineMacro("__HVXDBL__"); } } bool HexagonTargetInfo::initFeatureMap( llvm::StringMap &Features, DiagnosticsEngine &Diags, StringRef CPU, const std::vector &FeaturesVec) const { - // Default for v60: -hvx, -hvx-double. - Features["hvx"] = false; Features["hvx-double"] = false; Features["long-calls"] = false; @@ -75,16 +81,16 @@ bool HexagonTargetInfo::handleTargetFeatures(std::vector &Features, DiagnosticsEngine &Diags) { for (auto &F : Features) { - if (F == "+hvx") + if (F == "+hvx-length64b") + HasHVX = HasHVX64B = true; + else if (F == "+hvx-length128b") + HasHVX = HasHVX128B = true; + else if (F.find("+hvxv") != std::string::npos) { HasHVX = true; - else if (F == "-hvx") - HasHVX = HasHVXDouble = false; - else if (F == "+hvx-double") - HasHVX = HasHVXDouble = true; - else if (F == "-hvx-double") - HasHVXDouble = false; - - if (F == "+long-calls") + HVXVersion = F.substr(std::string("+hvxv").length()); + } else if (F == "-hvx") + HasHVX = HasHVX64B = HasHVX128B = false; + else if (F == "+long-calls") UseLongCalls = true; else if (F == "-long-calls") UseLongCalls = false; @@ -92,18 +98,6 @@ return true; } -void HexagonTargetInfo::setFeatureEnabled(llvm::StringMap &Features, - StringRef Name, bool Enabled) const { - if (Enabled) { - if (Name == "hvx-double") - Features["hvx"] = true; - } else { - if (Name == "hvx") - Features["hvx-double"] = false; - } - Features[Name] = Enabled; -} - const char *const HexagonTargetInfo::GCCRegNames[] = { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "r16", "r17", @@ -138,7 +132,8 @@ return llvm::StringSwitch(Feature) .Case("hexagon", true) .Case("hvx", HasHVX) - .Case("hvx-double", HasHVXDouble) + .Case("hvx-length64b", HasHVX64B) + .Case("hvx-length128b", HasHVX128B) .Case("long-calls", UseLongCalls) .Default(false); } Index: cfe/trunk/lib/Driver/ToolChains/Clang.cpp =================================================================== --- cfe/trunk/lib/Driver/ToolChains/Clang.cpp +++ cfe/trunk/lib/Driver/ToolChains/Clang.cpp @@ -334,7 +334,7 @@ x86::getX86TargetFeatures(D, Triple, Args, Features); break; case llvm::Triple::hexagon: - hexagon::getHexagonTargetFeatures(Args, Features); + hexagon::getHexagonTargetFeatures(D, Args, Features); break; case llvm::Triple::wasm32: case llvm::Triple::wasm64: Index: cfe/trunk/lib/Driver/ToolChains/Hexagon.h =================================================================== --- cfe/trunk/lib/Driver/ToolChains/Hexagon.h +++ cfe/trunk/lib/Driver/ToolChains/Hexagon.h @@ -51,7 +51,7 @@ const char *LinkingOutput) const override; }; -void getHexagonTargetFeatures(const llvm::opt::ArgList &Args, +void getHexagonTargetFeatures(const Driver &D, const llvm::opt::ArgList &Args, std::vector &Features); } // end namespace hexagon. Index: cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp =================================================================== --- cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp +++ cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp @@ -27,8 +27,83 @@ using namespace clang; using namespace llvm::opt; +// Default hvx-length for various versions. +static std::string getDefaultHvxLength(const StringRef &Cpu) { + return llvm::StringSwitch(Cpu) + .Case("v60", "64b") + .Case("v62", "64b") + .Default("128b"); +} + +static void handleHVXWarnings(const Driver &D, const ArgList &Args) { + // Handle deprecated HVX double warnings. + if (Arg *A = Args.getLastArg(options::OPT_mhexagon_hvx_double)) + D.Diag(diag::warn_drv_deprecated_arg) + << A->getAsString(Args) << "-mhvx-length=128B"; + if (Arg *A = Args.getLastArg(options::OPT_mno_hexagon_hvx_double)) + D.Diag(diag::warn_drv_deprecated_arg) << A->getAsString(Args) << "-mno-hvx"; + // Handle the unsupported values passed to mhvx-length. + if (Arg *A = Args.getLastArg(options::OPT_mhexagon_hvx_length_EQ)) { + StringRef Val = A->getValue(); + if (Val != "64B" && Val != "128B") + D.Diag(diag::err_drv_unsupported_option_argument) + << A->getOption().getName() << Val; + } +} + +// Handle hvx target features explicitly. +static void handleHVXTargetFeatures(const Driver &D, const ArgList &Args, + std::vector &Features, + bool &HasHVX) { + // Handle HVX warnings. + handleHVXWarnings(D, Args); + + // Add the +hvx* features based on commandline flags. + StringRef HVXFeature, HVXLength; + StringRef Cpu(toolchains::HexagonToolChain::GetTargetCPUVersion(Args)); + + // Handle -mhvx, -mhvx=, -mno-hvx, -mno-hvx-double. + if (Arg *A = Args.getLastArg( + options::OPT_mno_hexagon_hvx, options::OPT_mno_hexagon_hvx_double, + options::OPT_mhexagon_hvx, options::OPT_mhexagon_hvx_EQ)) { + if (A->getOption().matches(options::OPT_mno_hexagon_hvx) || + A->getOption().matches(options::OPT_mno_hexagon_hvx_double)) { + return; + } else if (A->getOption().matches(options::OPT_mhexagon_hvx_EQ)) { + HasHVX = true; + HVXFeature = Cpu = A->getValue(); + HVXFeature = Args.MakeArgString(llvm::Twine("+hvx") + HVXFeature.lower()); + } else if (A->getOption().matches(options::OPT_mhexagon_hvx)) { + HasHVX = true; + HVXFeature = Args.MakeArgString(llvm::Twine("+hvx") + Cpu); + } + Features.push_back(HVXFeature); + } + + // Handle -mhvx-length=, -mhvx-double. + if (Arg *A = Args.getLastArg(options::OPT_mhexagon_hvx_length_EQ, + options::OPT_mhexagon_hvx_double)) { + // These falgs are valid only if HVX in enabled. + if (!HasHVX) + D.Diag(diag::err_drv_invalid_hvx_length); + else if (A->getOption().matches(options::OPT_mhexagon_hvx_length_EQ)) + HVXLength = A->getValue(); + else if (A->getOption().matches(options::OPT_mhexagon_hvx_double)) + HVXLength = "128b"; + } + // Default hvx-length based on Cpu. + else if (HasHVX) + HVXLength = StringRef(getDefaultHvxLength(Cpu)); + + if (!HVXLength.empty()) { + HVXFeature = + Args.MakeArgString(llvm::Twine("+hvx-length") + HVXLength.lower()); + Features.push_back(HVXFeature); + } +} + // Hexagon target features. -void hexagon::getHexagonTargetFeatures(const ArgList &Args, +void hexagon::getHexagonTargetFeatures(const Driver &D, const ArgList &Args, std::vector &Features) { handleTargetFeaturesGroup(Args, Features, options::OPT_m_hexagon_Features_Group); @@ -41,6 +116,9 @@ } Features.push_back(UseLongCalls ? "+long-calls" : "-long-calls"); + + bool HasHVX(false); + handleHVXTargetFeatures(D, Args, Features, HasHVX); } // Hexagon tools start. Index: cfe/trunk/test/CodeGen/hexagon-inline-asm.c =================================================================== --- cfe/trunk/test/CodeGen/hexagon-inline-asm.c +++ cfe/trunk/test/CodeGen/hexagon-inline-asm.c @@ -1,4 +1,4 @@ -// RUN: %clang_cc1 -triple hexagon-unknown-elf -target-feature +hvx -emit-llvm -o - %s | FileCheck %s +// RUN: %clang_cc1 -triple hexagon-unknown-elf -target-feature +hvx -target-feature +hvx-length64b -emit-llvm -o - %s | FileCheck %s typedef int v64 __attribute__((__vector_size__(64))) __attribute__((aligned(64))); Index: cfe/trunk/test/Driver/hexagon-hvx.c =================================================================== --- cfe/trunk/test/Driver/hexagon-hvx.c +++ cfe/trunk/test/Driver/hexagon-hvx.c @@ -0,0 +1,90 @@ +// ----------------------------------------------------------------------------- +// Tests for the hvx features and warnings. +// ----------------------------------------------------------------------------- + +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECKHVX162 %s +// CHECKHVX162: "-target-feature" "+hvxv62" + +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \ +// RUN: -mhvx-double 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s + +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx \ +// RUN: -mhvx-length=128B 2>&1 | FileCheck -check-prefix=CHECKHVX2 %s +// CHECKHVX2-NOT: "-target-feature" "+hvx-length64b" +// CHECKHVX2: "-target-feature" "+hvx-length128b" + +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 2>&1 \ +// RUN: | FileCheck -check-prefix=CHECKHVX3 %s +// CHECKHVX3-NOT: "-target-feature" "+hvx + +// -mhvx-double is deprecated. +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx-double \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-DEPRECATED %s +// CHECK-DEPRECATED: warning: argument '-mhvx-double' is deprecated, use '-mhvx-length=128B' instead [-Wdeprecated] + +// -mno-hvx-double is deprecated. +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mno-hvx-double \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NODEPRECATED %s +// CHECK-NODEPRECATED: warning: argument '-mno-hvx-double' is deprecated, use '-mno-hvx' instead [-Wdeprecated] + +// No hvx target feature must be added if -mno-hvx/-mno-hvx-double occurs last +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mno-hvx \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NOHVX %s +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mno-hvx \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NOHVX %s +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mno-hvx-double \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-NOHVX %s +// CHECK-NOHVX-NOT: "-target-feature" "+hvx + +// Hvx target feature should be added if -mno-hvx doesnot occur last +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mno-hvx -mhvx\ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXFEAT %s +// CHECK-HVXFEAT: "-target-feature" "+hvxv62" + +// With -mhvx, the version of hvx defaults to Cpu +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVX-DEFAULT %s +// CHECK-HVX-DEFAULT: "-target-feature" "+hvxv60" + +// Test -mhvx= flag +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx=v62 \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ %s +// CHECK-HVXEQ: "-target-feature" "+hvxv62" + +// Honor the last occured -mhvx=, -mhvx flag. +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx=v62 -mhvx\ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ-PRE %s +// CHECK-HVXEQ-PRE-NOT: "-target-feature" "+hvxv62" +// CHECK-HVXEQ-PRE: "-target-feature" "+hvxv60" +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx -mhvx=v62\ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXEQ-PRE2 %s +// CHECK-HVXEQ-PRE2-NOT: "-target-feature" "+hvxv60" +// CHECK-HVXEQ-PRE2: "-target-feature" "+hvxv62" + +// Test -mhvx-length flag +// The default mode on v60,v62 is 64B. +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx -mhvx-length=64B\ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s +// CHECK-HVXLENGTH-64B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length64b" +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv62 -mhvx -mhvx-length=128B\ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-128B %s +// CHECK-HVXLENGTH-128B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length128b" + +// Bail out if -mhvx-length is specified without HVX enabled +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx-length=64B \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-ERROR %s +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx-length=128B \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-ERROR %s +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx-double \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-ERROR %s +// CHECK-HVXLENGTH-ERROR: error: -mhvx-length is not supported without a -mhvx/-mhvx= flag + +// Error out if an unsupported value is passed to -mhvx-length. +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx -mhvx-length=B \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-VALUE-ERROR %s +// RUN: %clang -c %s -### -target hexagon-unknown-elf -mhvx -mhvx-length=128 \ +// RUN: 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-VALUE-ERROR %s +// CHECK-HVXLENGTH-VALUE-ERROR: error: unsupported argument '{{.*}}' to option 'mhvx-length=' Index: cfe/trunk/test/Preprocessor/hexagon-predefines.c =================================================================== --- cfe/trunk/test/Preprocessor/hexagon-predefines.c +++ cfe/trunk/test/Preprocessor/hexagon-predefines.c @@ -1,32 +1,43 @@ // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv5 %s | FileCheck %s -check-prefix CHECK-V5 - // CHECK-V5: #define __HEXAGON_ARCH__ 5 // CHECK-V5: #define __HEXAGON_V5__ 1 +// CHECK-V5-NOT: #define __HVX_LENGTH__ +// CHECK-V5-NOT: #define __HVX__ 1 // CHECK-V5: #define __hexagon__ 1 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv55 %s | FileCheck %s -check-prefix CHECK-V55 - // CHECK-V55: #define __HEXAGON_ARCH__ 55 // CHECK-V55: #define __HEXAGON_V55__ 1 +// CHECK-V55-NOT: #define __HVX_LENGTH__ +// CHECK-V55-NOT: #define __HVX__ 1 // CHECK-V55: #define __hexagon__ 1 // RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 %s | FileCheck %s -check-prefix CHECK-V60 - // CHECK-V60: #define __HEXAGON_ARCH__ 60 // CHECK-V60: #define __HEXAGON_V60__ 1 +// CHECK-V60-NOT: #define __HVX_LENGTH__ +// CHECK-V60-NOT: #define __HVX__ 1 // CHECK-V60: #define __hexagon__ 1 -// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 -target-feature +hvx %s | FileCheck %s -check-prefix CHECK-V60HVX - -// CHECK-V60HVX: #define __HEXAGON_ARCH__ 60 -// CHECK-V60HVX: #define __HEXAGON_V60__ 1 -// CHECK-V60HVX: #define __HVX__ 1 - -// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 -target-feature +hvx-double %s | FileCheck %s -check-prefix CHECK-V60HVXD - -// CHECK-V60HVXD: #define __HEXAGON_ARCH__ 60 -// CHECK-V60HVXD: #define __HEXAGON_V60__ 1 -// CHECK-V60HVXD: #define __HVXDBL__ 1 -// CHECK-V60HVXD: #define __HVX__ 1 -// CHECK-V60HVXD: #define __hexagon__ 1 - +// The HVX flags are explicitly defined by the driver. +// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 \ +// RUN: -target-feature +hvxv60 -target-feature +hvx-length64b %s | FileCheck \ +// RUN: %s -check-prefix CHECK-V60HVX-64B +// CHECK-V60HVX-64B: #define __HEXAGON_ARCH__ 60 +// CHECK-V60HVX-64B: #define __HEXAGON_V60__ 1 +// CHECK-V60HVX-64B-NOT: #define __HVXDBL__ 1 +// CHECK-V60HVX-64B: #define __HVX_ARCH__ 60 +// CHECK-V60HVX-64B: #define __HVX_LENGTH__ 64 +// CHECK-V60HVX-64B: #define __HVX__ 1 +// CHECK-V60HVX-64B: #define __hexagon__ 1 + +// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv60 \ +// RUN: -target-feature +hvxv60 -target-feature +hvx-length128b %s | FileCheck \ +// RUN: %s -check-prefix CHECK-V60HVX-128B +// CHECK-V60HVX-128B: #define __HEXAGON_ARCH__ 60 +// CHECK-V60HVX-128B: #define __HEXAGON_V60__ 1 +// CHECK-V60HVX-128B: #define __HVXDBL__ 1 +// CHECK-V60HVX-128B: #define __HVX_ARCH__ 60 +// CHECK-V60HVX-128B: #define __HVX_LENGTH__ 128 +// CHECK-V60HVX-128B: #define __HVX__ 1 +// CHECK-V60HVX-128B: #define __hexagon__ 1