summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoerg Sonnenberger <joerg@bec.de>2014-02-02 21:18:36 +0000
committerJoerg Sonnenberger <joerg@bec.de>2014-02-02 21:18:36 +0000
commit25b48d54c643b74e6eb8415e4e22cbe91e095cf8 (patch)
tree14e114cb309f22ada210a01146a1e6f5a32a8943 /lib
parent640dd7695da3a3bc232c2dba7acc143878348917 (diff)
downloadllvm-25b48d54c643b74e6eb8415e4e22cbe91e095cf8.tar.gz
llvm-25b48d54c643b74e6eb8415e4e22cbe91e095cf8.tar.bz2
llvm-25b48d54c643b74e6eb8415e4e22cbe91e095cf8.tar.xz
Unaligned access is supported on ARMv6 and ARMv7 for the NetBSD target.
Patch from Matt Thomas. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200654 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMSubtarget.cpp7
-rw-r--r--lib/Target/ARM/ARMSubtarget.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/Target/ARM/ARMSubtarget.cpp b/lib/Target/ARM/ARMSubtarget.cpp
index e804de5c90..a240d1916f 100644
--- a/lib/Target/ARM/ARMSubtarget.cpp
+++ b/lib/Target/ARM/ARMSubtarget.cpp
@@ -237,9 +237,10 @@ void ARMSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
// Linux targets support unaligned accesses. The same goes for NaCl.
//
// The above behavior is consistent with GCC.
- AllowsUnalignedMem = (
- (hasV7Ops() && (isTargetLinux() || isTargetNaCl())) ||
- (hasV6Ops() && isTargetMachO()));
+ AllowsUnalignedMem =
+ (hasV7Ops() && (isTargetLinux() || isTargetNaCl() ||
+ isTargetNetBSD())) ||
+ (hasV6Ops() && (isTargetMachO() || isTargetNetBSD()));
break;
case StrictAlign:
AllowsUnalignedMem = false;
diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
index ef49e6db07..1d80d1b370 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
@@ -311,6 +311,9 @@ public:
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
+ bool isTargetNetBSD() const {
+ return TargetTriple.getOS() == Triple::NetBSD;
+ }
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }