aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Thumb2/thumb2-sbc.ll
diff options
context:
space:
mode:
authorAndrew Trick <atrick@apple.com>2011-04-23 03:55:32 +0000
committerAndrew Trick <atrick@apple.com>2011-04-23 03:55:32 +0000
commit1c3af779fc6b184204efd7e98dc16e475c251e7f (patch)
treed9ca1d20f7c3930939492236cac207ad0c5e0fc9 /test/CodeGen/Thumb2/thumb2-sbc.ll
parent1611bcd6acd685052eae9927f3ffbbfc917f1233 (diff)
downloadexternal_llvm-1c3af779fc6b184204efd7e98dc16e475c251e7f.zip
external_llvm-1c3af779fc6b184204efd7e98dc16e475c251e7f.tar.gz
external_llvm-1c3af779fc6b184204efd7e98dc16e475c251e7f.tar.bz2
Thumb2 and ARM add/subtract with carry fixes.
Fixes Thumb2 ADCS and SBCS lowering: <rdar://problem/9275821>. t2ADCS/t2SBCS are now pseudo instructions, consistent with ARM, so the assembly printer correctly prints the 's' suffix. Fixes Thumb2 adde -> SBC matching to check for live/dead carry flags. Fixes the internal ARM machine opcode mnemonic for ADCS/SBCS. Fixes ARM SBC lowering to check for live carry (potential bug). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-sbc.ll')
-rw-r--r--test/CodeGen/Thumb2/thumb2-sbc.ll15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-sbc.ll b/test/CodeGen/Thumb2/thumb2-sbc.ll
index 09e3fdd..f8d8d27 100644
--- a/test/CodeGen/Thumb2/thumb2-sbc.ll
+++ b/test/CodeGen/Thumb2/thumb2-sbc.ll
@@ -52,3 +52,18 @@ define i64 @f6(i64 %a) {
ret i64 %tmp
}
+; Example from numerics code that manually computes wider-than-64 values.
+;
+; CHECK: _livecarry:
+; CHECK: adds
+; CHECK: adcs
+; CHECK: adc
+define i64 @livecarry(i64 %carry, i32 %digit) nounwind {
+ %ch = lshr i64 %carry, 32
+ %cl = and i64 %carry, 4294967295
+ %truncdigit = zext i32 %digit to i64
+ %prod = add i64 %cl, %truncdigit
+ %ph = lshr i64 %prod, 32
+ %carryresult = add i64 %ch, %ph
+ ret i64 %carryresult
+}