summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtyom Skrobov <Artyom.Skrobov@arm.com>2015-09-30 17:25:52 +0000
committerArtyom Skrobov <Artyom.Skrobov@arm.com>2015-09-30 17:25:52 +0000
commit72ca6b8f3fcc2f8936ec675969f036521fabc63f (patch)
tree5319f00cc41a3cfe9e7f1ff5ed620c38cf65c59c
parentf7c5fbb1ca982eebad6000d2ca53d8ad2cb922ff (diff)
downloadbcm5719-llvm-72ca6b8f3fcc2f8936ec675969f036521fabc63f.tar.gz
bcm5719-llvm-72ca6b8f3fcc2f8936ec675969f036521fabc63f.zip
[ARM] Support for ARMv6-Z / ARMv6-ZK missing
As Richard Barton observed at http://reviews.llvm.org/D12937#inline-107121 TargetParser in LLVM has insufficient support for ARMv6Z and ARMv6ZK. In particular, there were no tests for TrustZone being supported in these architectures. The patch clears a FIXME: left by Saleem Abdulrasool in r201471, and fixes his test case which hadn't really been testing what it was claiming to test. Differential Revision: http://reviews.llvm.org/D13236 llvm-svn: 248921
-rw-r--r--llvm/include/llvm/Support/ARMTargetParser.def4
-rw-r--r--llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp3
-rw-r--r--llvm/test/MC/ARM/directive-arch_extension-sec.s13
3 files changed, 12 insertions, 8 deletions
diff --git a/llvm/include/llvm/Support/ARMTargetParser.def b/llvm/include/llvm/Support/ARMTargetParser.def
index 6c9110e3f0e..39979d01fd6 100644
--- a/llvm/include/llvm/Support/ARMTargetParser.def
+++ b/llvm/include/llvm/Support/ARMTargetParser.def
@@ -71,9 +71,9 @@ ARM_ARCH("armv6k", AK_ARMV6K, "6K", "v6k", ARMBuildAttrs::CPUArch::v6K,
ARM_ARCH("armv6t2", AK_ARMV6T2, "6T2", "v6t2", ARMBuildAttrs::CPUArch::v6T2,
AEK_DSP)
ARM_ARCH("armv6z", AK_ARMV6Z, "6Z", "v6z", ARMBuildAttrs::CPUArch::v6KZ,
- AEK_DSP)
+ (AEK_SEC | AEK_DSP))
ARM_ARCH("armv6zk", AK_ARMV6ZK, "6ZK", "v6zk", ARMBuildAttrs::CPUArch::v6KZ,
- AEK_DSP)
+ (AEK_SEC | AEK_DSP))
ARM_ARCH("armv6-m", AK_ARMV6M, "6-M", "v6m", ARMBuildAttrs::CPUArch::v6_M,
AEK_NONE)
ARM_ARCH("armv6s-m", AK_ARMV6SM, "6S-M", "v6sm", ARMBuildAttrs::CPUArch::v6S_M,
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index d8cf5813bdc..68188b13137 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -9902,8 +9902,7 @@ static const struct {
{ARM::FeatureHWDiv, ARM::FeatureHWDivARM} },
{ ARM::AEK_MP, Feature_HasV7 | Feature_IsNotMClass, {ARM::FeatureMP} },
{ ARM::AEK_SIMD, Feature_HasV8, {ARM::FeatureNEON, ARM::FeatureFPARMv8} },
- // FIXME: Also available in ARMv6-K
- { ARM::AEK_SEC, Feature_HasV7, {ARM::FeatureTrustZone} },
+ { ARM::AEK_SEC, Feature_HasV6K, {ARM::FeatureTrustZone} },
// FIXME: Only available in A-class, isel not predicated
{ ARM::AEK_VIRT, Feature_HasV7, {ARM::FeatureVirtualization} },
// FIXME: Unsupported extensions.
diff --git a/llvm/test/MC/ARM/directive-arch_extension-sec.s b/llvm/test/MC/ARM/directive-arch_extension-sec.s
index 55ead8506ab..645da0f75d3 100644
--- a/llvm/test/MC/ARM/directive-arch_extension-sec.s
+++ b/llvm/test/MC/ARM/directive-arch_extension-sec.s
@@ -1,11 +1,13 @@
@ RUN: not llvm-mc -triple armv6-eabi -filetype asm -o /dev/null 2>&1 %s \
-@ RUN: | FileCheck %s -check-prefix CHECK-ARMv6 -check-prefix CHECK-V6
+@ RUN: | FileCheck %s -check-prefix CHECK-V6
+@ RUN: not llvm-mc -triple armv6k-eabi -filetype asm -o /dev/null 2>&1 %s \
+@ RUN: | FileCheck %s -check-prefix CHECK-V7
@ RUN: not llvm-mc -triple armv7-eabi -filetype asm -o /dev/null 2>&1 %s \
-@ RUN: | FileCheck %s -check-prefix CHECK-ARMv7 -check-prefix CHECK-V7
+@ RUN: | FileCheck %s -check-prefix CHECK-V7
@ RUN: not llvm-mc -triple thumbv6-eabi -filetype asm -o /dev/null 2>&1 %s \
-@ RUN: | FileCheck %s -check-prefix CHECK-THUMBv6 -check-prefix CHECK-V6
+@ RUN: | FileCheck %s -check-prefix CHECK-V6
@ RUN: not llvm-mc -triple thumbv7-eabi -filetype asm -o /dev/null 2>&1 %s \
-@ RUN: | FileCheck %s -check-prefix CHECK-THUMBv7 -check-prefix CHECK-V7
+@ RUN: | FileCheck %s -check-prefix CHECK-V7
.syntax unified
@@ -13,6 +15,7 @@
@ CHECK-V6: error: architectural extension 'sec' is not allowed for the current base architecture
@ CHECK-V6-NEXT: .arch_extension sec
@ CHECK-V6-NEXT: ^
+@ CHECK-V7-NOT: error: architectural extension 'sec' is not allowed for the current base architecture
.type sec,%function
sec:
@@ -23,9 +26,11 @@ sec:
@ CHECK-V6: error: architectural extension 'sec' is not allowed for the current base architecture
@ CHECK-V6-NEXT: .arch_extension nosec
@ CHECK-V6-NEXT: ^
+@ CHECK-V7-NOT: error: architectural extension 'sec' is not allowed for the current base architecture
.type nosec,%function
nosec:
smc #0
@ CHECK-V7: error: instruction requires: TrustZone
+@ CHECK-V7-NOT: error: instruction requires: TrustZone
OpenPOWER on IntegriCloud