aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/Mips
diff options
context:
space:
mode:
authorAkira Hatanaka <ahatanaka@mips.com>2012-01-25 03:01:35 +0000
committerAkira Hatanaka <ahatanaka@mips.com>2012-01-25 03:01:35 +0000
commit57fa38225cfeded40a38770a2cc52e10a4e7268d (patch)
treecf4f75ebce9c25938d502f29b29d7cade4c080ad /test/CodeGen/Mips
parent1ab525e857463ff0ab702b50a97fb9c7811f0ac7 (diff)
Lower 64-bit immediates using MipsAnalyzeImmediate that has just been added.
Add a test case to show fewer instructions are needed to load an immediate with the new way of loading immediates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Mips')
-rw-r--r--test/CodeGen/Mips/mips64imm.ll23
1 files changed, 16 insertions, 7 deletions
diff --git a/test/CodeGen/Mips/mips64imm.ll b/test/CodeGen/Mips/mips64imm.ll
index 8cec536c25..1fc8636c48 100644
--- a/test/CodeGen/Mips/mips64imm.ll
+++ b/test/CodeGen/Mips/mips64imm.ll
@@ -12,7 +12,7 @@ define i64 @foo3() nounwind readnone {
entry:
; CHECK: foo3
; CHECK: lui $[[R0:[0-9]+]], 4660
-; CHECK: ori ${{[0-9]+}}, $[[R0]], 22136
+; CHECK: daddiu ${{[0-9]+}}, $[[R0]], 22136
ret i64 305419896
}
@@ -33,11 +33,20 @@ entry:
define i64 @foo9() nounwind readnone {
entry:
; CHECK: foo9
-; CHECK: lui $[[R0:[0-9]+]], 4660
-; CHECK: ori $[[R1:[0-9]+]], $[[R0]], 22136
-; CHECK: dsll $[[R2:[0-9]+]], $[[R1]], 16
-; CHECK: ori $[[R3:[0-9]+]], $[[R2]], 36882
-; CHECK: dsll $[[R4:[0-9]+]], $[[R3]], 16
-; CHECK: ori ${{[0-9]+}}, $[[R4]], 13398
+; CHECK: lui $[[R0:[0-9]+]], 583
+; CHECK: daddiu $[[R1:[0-9]+]], $[[R0]], -30001
+; CHECK: dsll $[[R2:[0-9]+]], $[[R1]], 18
+; CHECK: daddiu $[[R3:[0-9]+]], $[[R2]], 18441
+; CHECK: dsll $[[R4:[0-9]+]], $[[R3]], 17
+; CHECK: daddiu ${{[0-9]+}}, $[[R4]], 13398
ret i64 1311768467284833366
}
+
+define i64 @foo10() nounwind readnone {
+entry:
+; CHECK: foo10
+; CHECK: lui $[[R0:[0-9]+]], 34661
+; CHECK: daddiu ${{[0-9]+}}, $[[R0]], 17185
+ ret i64 -8690466096928522240
+}
+