]> granicus.if.org Git - clang/commitdiff
Explain why layout prefers 32 for small types on Thumb.
authorSandeep Patel <deeppatel1987@gmail.com>
Mon, 4 Apr 2011 22:58:12 +0000 (22:58 +0000)
committerSandeep Patel <deeppatel1987@gmail.com>
Mon, 4 Apr 2011 22:58:12 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128850 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp

index 00c8657e2bbe48e7667b5f0b5be0d37e8f691cb8..973518312dbead4399966ad0274908a7965ff2cd 100644 (file)
@@ -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");