From: Sandeep Patel Date: Mon, 4 Apr 2011 22:58:12 +0000 (+0000) Subject: Explain why layout prefers 32 for small types on Thumb. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a41d145e4e1e363637eba892c2be8582efe2178;p=clang Explain why layout prefers 32 for small types on Thumb. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128850 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Basic/Targets.cpp b/lib/Basic/Targets.cpp index 00c8657e2b..973518312d 100644 --- a/lib/Basic/Targets.cpp +++ b/lib/Basic/Targets.cpp @@ -1729,6 +1729,8 @@ public: // FIXME: Should we just treat this as a feature? IsThumb = getTriple().getArchName().startswith("thumb"); if (IsThumb) { + // Thumb1 add sp, #imm requires the immediate value be multiple of 4, + // so set preferred for small types to 32. DescriptionString = ("e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-" "i64:64:64-f32:32:32-f64:64:64-" "v64:64:64-v128:64:128-a0:0:32-n32"); @@ -1758,6 +1760,8 @@ public: UseBitFieldTypeAlignment = false; if (IsThumb) { + // Thumb1 add sp, #imm requires the immediate value be multiple of 4, + // so set preferred for small types to 32. DescriptionString = ("e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-" "i64:32:32-f32:32:32-f64:32:32-" "v64:32:64-v128:32:128-a0:0:32-n32");