r348415 - [Hexagon] Add support for Hexagon V66

Krzysztof Parzyszek via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 5 13:38:35 PST 2018


Author: kparzysz
Date: Wed Dec  5 13:38:35 2018
New Revision: 348415

URL: http://llvm.org/viewvc/llvm-project?rev=348415&view=rev
Log:
[Hexagon] Add support for Hexagon V66

Modified:
    cfe/trunk/include/clang/Driver/Options.td
    cfe/trunk/lib/Basic/Targets/Hexagon.cpp
    cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp
    cfe/trunk/test/Driver/hexagon-hvx.c
    cfe/trunk/test/Driver/hexagon-toolchain-elf.c
    cfe/trunk/test/Preprocessor/hexagon-predefines.c

Modified: cfe/trunk/include/clang/Driver/Options.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Driver/Options.td?rev=348415&r1=348414&r2=348415&view=diff
==============================================================================
--- cfe/trunk/include/clang/Driver/Options.td (original)
+++ cfe/trunk/include/clang/Driver/Options.td Wed Dec  5 13:38:35 2018
@@ -2708,6 +2708,8 @@ def mv62 : Flag<["-"], "mv62">, Group<m_
   Alias<mcpu_EQ>, AliasArgs<["hexagonv62"]>;
 def mv65 : Flag<["-"], "mv65">, Group<m_hexagon_Features_Group>,
   Alias<mcpu_EQ>, AliasArgs<["hexagonv65"]>;
+def mv66 : Flag<["-"], "mv66">, Group<m_hexagon_Features_Group>,
+  Alias<mcpu_EQ>, AliasArgs<["hexagonv66"]>;
 def mhexagon_hvx : Flag<["-"], "mhvx">, Group<m_hexagon_Features_HVX_Group>,
   HelpText<"Enable Hexagon Vector eXtensions">;
 def mhexagon_hvx_EQ : Joined<["-"], "mhvx=">,

Modified: cfe/trunk/lib/Basic/Targets/Hexagon.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets/Hexagon.cpp?rev=348415&r1=348414&r2=348415&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets/Hexagon.cpp (original)
+++ cfe/trunk/lib/Basic/Targets/Hexagon.cpp Wed Dec  5 13:38:35 2018
@@ -48,6 +48,9 @@ void HexagonTargetInfo::getTargetDefines
   } else if (CPU == "hexagonv65") {
     Builder.defineMacro("__HEXAGON_V65__");
     Builder.defineMacro("__HEXAGON_ARCH__", "65");
+  } else if (CPU == "hexagonv66") {
+    Builder.defineMacro("__HEXAGON_V66__");
+    Builder.defineMacro("__HEXAGON_ARCH__", "66");
   }
 
   if (hasFeature("hvx-length64b")) {
@@ -145,7 +148,7 @@ struct CPUSuffix {
 static constexpr CPUSuffix Suffixes[] = {
     {{"hexagonv5"},  {"5"}},  {{"hexagonv55"}, {"55"}},
     {{"hexagonv60"}, {"60"}}, {{"hexagonv62"}, {"62"}},
-    {{"hexagonv65"}, {"65"}},
+    {{"hexagonv65"}, {"65"}}, {{"hexagonv66"}, {"66"}},
 };
 
 const char *HexagonTargetInfo::getHexagonCPUSuffix(StringRef Name) {

Modified: cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp?rev=348415&r1=348414&r2=348415&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains/Hexagon.cpp Wed Dec  5 13:38:35 2018
@@ -32,6 +32,7 @@ static StringRef getDefaultHvxLength(Str
       .Case("v60", "64b")
       .Case("v62", "64b")
       .Case("v65", "64b")
+      .Case("v66", "128b")
       .Default("128b");
 }
 

Modified: cfe/trunk/test/Driver/hexagon-hvx.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/hexagon-hvx.c?rev=348415&r1=348414&r2=348415&view=diff
==============================================================================
--- cfe/trunk/test/Driver/hexagon-hvx.c (original)
+++ cfe/trunk/test/Driver/hexagon-hvx.c Wed Dec  5 13:38:35 2018
@@ -2,6 +2,10 @@
 // Tests for the hvx features and warnings.
 // -----------------------------------------------------------------------------
 
+// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv66 -mhvx \
+// RUN:  2>&1 | FileCheck -check-prefix=CHECKHVX166 %s
+// CHECKHVX166: "-target-feature" "+hvxv66"
+
 // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv65 -mhvx \
 // RUN:  2>&1 | FileCheck -check-prefix=CHECKHVX165 %s
 // CHECKHVX165: "-target-feature" "+hvxv65"
@@ -69,6 +73,9 @@
 // RUN: %clang -c %s -### -target hexagon-unknown-elf -mv60 -mhvx \
 // RUN:  -mhvx-length=64B 2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-64B %s
 // CHECK-HVXLENGTH-64B: "-target-feature" "+hvx{{.*}}" "-target-feature" "+hvx-length64b"
+// The default mode on v66 and future archs is 128B.
+// RUN: %clang -c %s -### -target hexagon-unknown-elf -mv66 -mhvx \
+// RUN:  2>&1 | FileCheck -check-prefix=CHECK-HVXLENGTH-128B %s
 // 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"

Modified: cfe/trunk/test/Driver/hexagon-toolchain-elf.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Driver/hexagon-toolchain-elf.c?rev=348415&r1=348414&r2=348415&view=diff
==============================================================================
--- cfe/trunk/test/Driver/hexagon-toolchain-elf.c (original)
+++ cfe/trunk/test/Driver/hexagon-toolchain-elf.c Wed Dec  5 13:38:35 2018
@@ -99,20 +99,28 @@
 
 // RUN: %clang -### -target hexagon-unknown-elf \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
-// RUN:   -O3 \
+// RUN:   -mcpu=hexagonv66 \
 // RUN:   %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK026 %s
-// CHECK026-NOT: "-ffp-contract=fast"
-// CHECK026: {{hexagon-link|ld}}
+// CHECK026: "-cc1" {{.*}} "-target-cpu" "hexagonv66"
+// CHECK026: {{hexagon-link|ld}}{{.*}}/Inputs/hexagon_tree/Tools/bin/../target/hexagon/lib/v66/crt0
 
 // RUN: %clang -### -target hexagon-unknown-elf \
 // RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
-// RUN:   -O3 -ffp-contract=off \
+// RUN:   -O3 \
 // RUN:   %s 2>&1 \
 // RUN:   | FileCheck -check-prefix=CHECK027 %s
 // CHECK027-NOT: "-ffp-contract=fast"
 // CHECK027: {{hexagon-link|ld}}
 
+// RUN: %clang -### -target hexagon-unknown-elf \
+// RUN:   -ccc-install-dir %S/Inputs/hexagon_tree/Tools/bin \
+// RUN:   -O3 -ffp-contract=off \
+// RUN:   %s 2>&1 \
+// RUN:   | FileCheck -check-prefix=CHECK028 %s
+// CHECK028-NOT: "-ffp-contract=fast"
+// CHECK028: {{hexagon-link|ld}}
+
 // -----------------------------------------------------------------------------
 // Test Linker related args
 // -----------------------------------------------------------------------------

Modified: cfe/trunk/test/Preprocessor/hexagon-predefines.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Preprocessor/hexagon-predefines.c?rev=348415&r1=348414&r2=348415&view=diff
==============================================================================
--- cfe/trunk/test/Preprocessor/hexagon-predefines.c (original)
+++ cfe/trunk/test/Preprocessor/hexagon-predefines.c Wed Dec  5 13:38:35 2018
@@ -34,6 +34,8 @@
 // CHECK-V65: #define __hexagon__ 1
 
 // The HVX flags are explicitly defined by the driver.
+// For v60,v62,v65 - 64B mode is default
+// For v66 and future archs - 128B is default
 // 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
@@ -55,3 +57,25 @@
 // CHECK-V60HVX-128B: #define __HVX_LENGTH__ 128
 // CHECK-V60HVX-128B: #define __HVX__ 1
 // CHECK-V60HVX-128B: #define __hexagon__ 1
+
+// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv66 \
+// RUN: -target-feature +hvxv66 -target-feature +hvx-length64b %s | FileCheck \
+// RUN: %s -check-prefix CHECK-V66HVX-64B
+// CHECK-V66HVX-64B: #define __HEXAGON_ARCH__ 66
+// CHECK-V66HVX-64B: #define __HEXAGON_V66__ 1
+// CHECK-V66HVX-64B-NOT: #define __HVXDBL__ 1
+// CHECK-V66HVX-64B: #define __HVX_ARCH__ 66
+// CHECK-V66HVX-64B: #define __HVX_LENGTH__ 64
+// CHECK-V66HVX-64B: #define __HVX__ 1
+// CHECK-V66HVX-64B: #define __hexagon__ 1
+
+// RUN: %clang_cc1 -E -dM -triple hexagon-unknown-elf -target-cpu hexagonv66 \
+// RUN: -target-feature +hvxv66 -target-feature +hvx-length128b %s | FileCheck \
+// RUN: %s -check-prefix CHECK-V66HVX-128B
+// CHECK-V66HVX-128B: #define __HEXAGON_ARCH__ 66
+// CHECK-V66HVX-128B: #define __HEXAGON_V66__ 1
+// CHECK-V66HVX-128B: #define __HVXDBL__ 1
+// CHECK-V66HVX-128B: #define __HVX_ARCH__ 66
+// CHECK-V66HVX-128B: #define __HVX_LENGTH__ 128
+// CHECK-V66HVX-128B: #define __HVX__ 1
+// CHECK-V66HVX-128B: #define __hexagon__ 1




More information about the cfe-commits mailing list