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
This commit is contained in:
Joerg Sonnenberger 2014-02-02 21:18:36 +00:00
parent 640dd7695d
commit 25b48d54c6
2 changed files with 7 additions and 3 deletions

View File

@ -237,9 +237,10 @@ void ARMSubtarget::resetSubtargetFeatures(StringRef CPU, StringRef FS) {
// Linux targets support unaligned accesses. The same goes for NaCl. // Linux targets support unaligned accesses. The same goes for NaCl.
// //
// The above behavior is consistent with GCC. // The above behavior is consistent with GCC.
AllowsUnalignedMem = ( AllowsUnalignedMem =
(hasV7Ops() && (isTargetLinux() || isTargetNaCl())) || (hasV7Ops() && (isTargetLinux() || isTargetNaCl() ||
(hasV6Ops() && isTargetMachO())); isTargetNetBSD())) ||
(hasV6Ops() && (isTargetMachO() || isTargetNetBSD()));
break; break;
case StrictAlign: case StrictAlign:
AllowsUnalignedMem = false; AllowsUnalignedMem = false;

View File

@ -311,6 +311,9 @@ public:
bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); } bool isTargetDarwin() const { return TargetTriple.isOSDarwin(); }
bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); } bool isTargetNaCl() const { return TargetTriple.isOSNaCl(); }
bool isTargetLinux() const { return TargetTriple.isOSLinux(); } bool isTargetLinux() const { return TargetTriple.isOSLinux(); }
bool isTargetNetBSD() const {
return TargetTriple.getOS() == Triple::NetBSD;
}
bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); } bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); } bool isTargetMachO() const { return TargetTriple.isOSBinFormatMachO(); }