diff options
author | Andrey Turetskiy <andrey.turetskiy@gmail.com> | 2016-02-10 11:57:06 +0000 |
---|---|---|
committer | Andrey Turetskiy <andrey.turetskiy@gmail.com> | 2016-02-10 11:57:06 +0000 |
commit | 2396c38a8a9962d23f66357b0932cf2795b0f360 (patch) | |
tree | 1956ac7118a4a4383014b13bf843c691c167dd67 /llvm/lib/Target | |
parent | d985edaa6eedcb9d2d37fda45890a7a28aa2f884 (diff) | |
download | bcm5719-llvm-2396c38a8a9962d23f66357b0932cf2795b0f360.tar.gz bcm5719-llvm-2396c38a8a9962d23f66357b0932cf2795b0f360.zip |
[X86] Fix stack alignment for MCU target, by Anton Nadolskiy.
This patch fixes stack alignments for MCU (should be aligned to 4 bytes).
Differential Revision: http://reviews.llvm.org/D15646
llvm-svn: 260375
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r-- | llvm/lib/Target/X86/X86TargetMachine.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86TargetMachine.cpp b/llvm/lib/Target/X86/X86TargetMachine.cpp index 0e7e4c0c84a..9441daf44da 100644 --- a/llvm/lib/Target/X86/X86TargetMachine.cpp +++ b/llvm/lib/Target/X86/X86TargetMachine.cpp @@ -73,17 +73,22 @@ static std::string computeDataLayout(const Triple &TT) { // Some ABIs align 64 bit integers and doubles to 64 bits, others to 32. if (TT.isArch64Bit() || TT.isOSWindows() || TT.isOSNaCl()) Ret += "-i64:64"; + else if (TT.isOSIAMCU()) + Ret += "-i64:32-f64:32"; else Ret += "-f64:32:64"; // Some ABIs align long double to 128 bits, others to 32. - if (TT.isOSNaCl()) + if (TT.isOSNaCl() || TT.isOSIAMCU()) ; // No f80 else if (TT.isArch64Bit() || TT.isOSDarwin()) Ret += "-f80:128"; else Ret += "-f80:32"; + if (TT.isOSIAMCU()) + Ret += "-f128:32"; + // The registers can hold 8, 16, 32 or, in x86-64, 64 bits. if (TT.isArch64Bit()) Ret += "-n8:16:32:64"; @@ -91,7 +96,7 @@ static std::string computeDataLayout(const Triple &TT) { Ret += "-n8:16:32"; // The stack is aligned to 32 bits on some ABIs and 128 bits on others. - if (!TT.isArch64Bit() && TT.isOSWindows()) + if ((!TT.isArch64Bit() && TT.isOSWindows()) || TT.isOSIAMCU()) Ret += "-a:0:32-S32"; else Ret += "-S128"; |