[llvm-commits] [llvm] r74295 - in /llvm/trunk/test/CodeGen/Thumb2: thumb2-add2.ll thumb2-add3.ll thumb2-add4.ll thumb2-add5.ll thumb2-add6.ll thumb2-bic.ll thumb2-cmp.ll thumb2-cmp2.ll thumb2-mla.ll thumb2-mls.ll thumb2-orn.ll thumb2-rsb.ll
David Goodwin
david_goodwin at apple.com
Fri Jun 26 11:10:31 PDT 2009
Author: david_goodwin
Date: Fri Jun 26 13:10:30 2009
New Revision: 74295
URL: http://llvm.org/viewvc/llvm-project?rev=74295&view=rev
Log:
Add Thumb-2 tests.
Added:
llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-add3.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-mla.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-mls.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb.ll
Modified:
llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll
llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add2.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,38 @@
+; RUN: llvm-as < %s | llc | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#510} | Count 5
+
+target triple = "thumbv7-apple-darwin"
+
+; 171 = 0x000000ab
+define i32 @f1(i32 %a) {
+ %tmp = add i32 %a, 171
+ ret i32 %tmp
+}
+
+; 1179666 = 0x00120012
+define i32 @f2(i32 %a) {
+ %tmp = add i32 %a, 1179666
+ ret i32 %tmp
+}
+
+; 872428544 = 0x34003400
+define i32 @f3(i32 %a) {
+ %tmp = add i32 %a, 872428544
+ ret i32 %tmp
+}
+
+; 1448498774 = 0x56565656
+define i32 @f4(i32 %a) {
+ %tmp = add i32 %a, 1448498774
+ ret i32 %tmp
+}
+
+; 510 = 0x000001fe
+define i32 @f5(i32 %a) {
+ %tmp = add i32 %a, 510
+ ret i32 %tmp
+}
+
+define i32 @f6(i32 %a) {
+ %tmp = add i32 %a, 4095
+ ret i32 %tmp
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-add3.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add3.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add3.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add3.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llc | grep {addw\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#4095} | Count 1
+
+target triple = "thumbv7-apple-darwin"
+
+define i32 @f1(i32 %a) {
+ %tmp = add i32 %a, 4095
+ ret i32 %tmp
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add4.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,33 @@
+; RUN: llvm-as < %s | llc | grep {adds\\W*r\[0-9\],\\W*r\[0-9\],\\W*#\[0-9\]*} | grep {#171\\|#1179666\\|#872428544\\|#1448498774\\|#66846720} | Count 5
+
+target triple = "thumbv7-apple-darwin"
+
+; 171 = 0x000000ab
+define i64 @f1(i64 %a) {
+ %tmp = add i64 %a, 171
+ ret i64 %tmp
+}
+
+; 1179666 = 0x00120012
+define i64 @f2(i64 %a) {
+ %tmp = add i64 %a, 1179666
+ ret i64 %tmp
+}
+
+; 872428544 = 0x34003400
+define i64 @f3(i64 %a) {
+ %tmp = add i64 %a, 872428544
+ ret i64 %tmp
+}
+
+; 1448498774 = 0x56565656
+define i64 @f4(i64 %a) {
+ %tmp = add i64 %a, 1448498774
+ ret i64 %tmp
+}
+
+; 66846720 = 0x03fc0000
+define i64 @f5(i64 %a) {
+ %tmp = add i64 %a, 66846720
+ ret i64 %tmp
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add5.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {add\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | Count 1
+
+define i32 @f1(i32 %a, i32 %b) {
+ %tmp = add i32 %a, %b
+ ret i32 %tmp
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-add6.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,6 @@
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {adds\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | Count 1
+
+define i64 @f1(i64 %a, i64 %b) {
+ %tmp = add i64 %a, %b
+ ret i64 %tmp
+}
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll?rev=74295&r1=74294&r2=74295&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-bic.ll Fri Jun 26 13:10:30 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 2
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {bic\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 4
define i32 @f1(i32 %a, i32 %b) {
%tmp = xor i32 %b, 4294967295
@@ -11,3 +11,15 @@
%tmp1 = and i32 %tmp, %a
ret i32 %tmp1
}
+
+define i32 @f3(i32 %a, i32 %b) {
+ %tmp = xor i32 4294967295, %b
+ %tmp1 = and i32 %a, %tmp
+ ret i32 %tmp1
+}
+
+define i32 @f4(i32 %a, i32 %b) {
+ %tmp = xor i32 4294967295, %b
+ %tmp1 = and i32 %tmp, %a
+ ret i32 %tmp1
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,31 @@
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep "cmp " | grep {#187\\|#11141290\\|#3422604288\\|#1114112\\|#3722304989} | Count 5
+
+; 0x000000bb = 187
+define i1 @f1(i32 %a) {
+ %tmp = icmp ne i32 %a, 187
+ ret i1 %tmp
+}
+
+; 0x00aa00aa = 11141290
+define i1 @f2(i32 %a) {
+ %tmp = icmp eq i32 %a, 11141290
+ ret i1 %tmp
+}
+
+; 0xcc00cc00 = 3422604288
+define i1 @f3(i32 %a) {
+ %tmp = icmp ne i32 %a, 3422604288
+ ret i1 %tmp
+}
+
+; 0xdddddddd = 3722304989
+define i1 @f4(i32 %a) {
+ %tmp = icmp ne i32 %a, 3722304989
+ ret i1 %tmp
+}
+
+; 0x00110000 = 1114112
+define i1 @f5(i32 %a) {
+ %tmp = icmp eq i32 %a, 1114112
+ ret i1 %tmp
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-cmp2.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,11 @@
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmp\\W*r\[0-9\],\\W*r\[0-9\]} | Count 2
+
+define i1 @f1(i32 %a, i32 %b) {
+ %tmp = icmp ne i32 %a, %b
+ ret i1 %tmp
+}
+
+define i1 @f2(i32 %a, i32 %b) {
+ %tmp = icmp eq i32 %a, %b
+ ret i1 %tmp
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-mla.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-mla.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-mla.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-mla.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,13 @@
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mla\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | Count 2
+
+define i32 @f1(i32 %a, i32 %b, i32 %c) {
+ %tmp1 = mul i32 %a, %b
+ %tmp2 = add i32 %c, %tmp1
+ ret i32 %tmp2
+}
+
+define i32 @f2(i32 %a, i32 %b, i32 %c) {
+ %tmp1 = mul i32 %a, %b
+ %tmp2 = add i32 %tmp1, %c
+ ret i32 %tmp2
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-mls.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-mls.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-mls.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-mls.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,14 @@
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {mls\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]} | Count 1
+
+define i32 @f1(i32 %a, i32 %b, i32 %c) {
+ %tmp1 = mul i32 %a, %b
+ %tmp2 = sub i32 %c, %tmp1
+ ret i32 %tmp2
+}
+
+; sub doesn't commute, so no mls for this one
+define i32 @f2(i32 %a, i32 %b, i32 %c) {
+ %tmp1 = mul i32 %a, %b
+ %tmp2 = sub i32 %tmp1, %c
+ ret i32 %tmp2
+}
Modified: llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll?rev=74295&r1=74294&r2=74295&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-orn.ll Fri Jun 26 13:10:30 2009
@@ -1,4 +1,4 @@
-; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 2
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {orn\\W*r\[0-9\]*,\\W*r\[0-9\]*,\\W*r\[0-9\]*} | count 4
define i32 @f1(i32 %a, i32 %b) {
%tmp = xor i32 %b, 4294967295
@@ -11,3 +11,15 @@
%tmp1 = or i32 %tmp, %a
ret i32 %tmp1
}
+
+define i32 @f3(i32 %a, i32 %b) {
+ %tmp = xor i32 4294967295, %b
+ %tmp1 = or i32 %a, %tmp
+ ret i32 %tmp1
+}
+
+define i32 @f4(i32 %a, i32 %b) {
+ %tmp = xor i32 4294967295, %b
+ %tmp1 = or i32 %tmp, %a
+ ret i32 %tmp1
+}
Added: llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb.ll?rev=74295&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb.ll (added)
+++ llvm/trunk/test/CodeGen/Thumb2/thumb2-rsb.ll Fri Jun 26 13:10:30 2009
@@ -0,0 +1,9 @@
+; XFAIL: *
+; this will match as "sub" until we get register shifting
+
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {rsb\\W*r\[0-9\],\\W*r\[0-9\],\\W*r\[0-9\]*} | Count 1
+
+define i32 @f1(i32 %a, i32 %b) {
+ %tmp = sub i32 %b, %a
+ ret i32 %tmp
+}
More information about the llvm-commits
mailing list