mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-15 20:51:35 +00:00
[Hexagon] Add support for Hexagon V66
llvm-svn: 348415
This commit is contained in:
parent
962b3ae659
commit
85393b28f9
@ -2708,6 +2708,8 @@ def mv62 : Flag<["-"], "mv62">, Group<m_hexagon_Features_Group>,
|
||||
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=">,
|
||||
|
@ -48,6 +48,9 @@ void HexagonTargetInfo::getTargetDefines(const LangOptions &Opts,
|
||||
} 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) {
|
||||
|
@ -32,6 +32,7 @@ static StringRef getDefaultHvxLength(StringRef Cpu) {
|
||||
.Case("v60", "64b")
|
||||
.Case("v62", "64b")
|
||||
.Case("v65", "64b")
|
||||
.Case("v66", "128b")
|
||||
.Default("128b");
|
||||
}
|
||||
|
||||
|
@ -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"
|
||||
|
@ -99,19 +99,27 @@
|
||||
|
||||
// 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 \
|
||||
// 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=CHECK027 %s
|
||||
// CHECK027-NOT: "-ffp-contract=fast"
|
||||
// CHECK027: {{hexagon-link|ld}}
|
||||
// RUN: | FileCheck -check-prefix=CHECK028 %s
|
||||
// CHECK028-NOT: "-ffp-contract=fast"
|
||||
// CHECK028: {{hexagon-link|ld}}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// Test Linker related args
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user