summaryrefslogtreecommitdiff
path: root/lib/Target/ARM/README-Thumb.txt
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-02-07 00:06:56 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-02-07 00:06:56 +0000
commit8e59ea998f1357768aa43cb00187e6c1c1a1cc7e (patch)
tree9faddd5219816cb2829887a41040b7d1a7ad5f5d /lib/Target/ARM/README-Thumb.txt
parentc67da0cf13e2d671061449e8da4ffe102e5fc848 (diff)
downloadllvm-8e59ea998f1357768aa43cb00187e6c1c1a1cc7e.tar.gz
llvm-8e59ea998f1357768aa43cb00187e6c1c1a1cc7e.tar.bz2
llvm-8e59ea998f1357768aa43cb00187e6c1c1a1cc7e.tar.xz
Spill / restore should avoid modifying the condition register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/README-Thumb.txt')
-rw-r--r--lib/Target/ARM/README-Thumb.txt17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Target/ARM/README-Thumb.txt b/lib/Target/ARM/README-Thumb.txt
index 3bb8695b3a..6c2cb710ab 100644
--- a/lib/Target/ARM/README-Thumb.txt
+++ b/lib/Target/ARM/README-Thumb.txt
@@ -124,3 +124,20 @@ L12:
.align 2
L11:
.long 642
+
+//===---------------------------------------------------------------------===//
+
+When spilling in thumb mode and the sp offset is too large to fit in the ldr /
+str offset field, we load the offset from a constpool entry and add it to sp:
+
+ldr r2, LCPI
+add r2, sp
+ldr r2, [r2]
+
+These instructions preserve the condition code which is important if the spill
+is between a cmp and a bcc instruction. However, we can use the (potentially)
+cheaper sequnce if we know it's ok to clobber the condition register.
+
+add r2, sp, #255 * 4
+add r2, #132
+ldr r2, [r2, #7 * 4]