summaryrefslogtreecommitdiff
path: root/test/CodeGen/Thumb2/thumb2-cmn.ll
diff options
context:
space:
mode:
authorDavid Goodwin <david_goodwin@apple.com>2009-06-29 15:33:01 +0000
committerDavid Goodwin <david_goodwin@apple.com>2009-06-29 15:33:01 +0000
commitc0309b48b560f119982c02a81416c8c1fd208648 (patch)
treea7b8bc2c834150ae47d5c49d46e14959f07cb91a /test/CodeGen/Thumb2/thumb2-cmn.ll
parentcd1267d2d68f03026aed21e22f7e28efd510ec5f (diff)
downloadllvm-c0309b48b560f119982c02a81416c8c1fd208648.tar.gz
llvm-c0309b48b560f119982c02a81416c8c1fd208648.tar.bz2
llvm-c0309b48b560f119982c02a81416c8c1fd208648.tar.xz
Rename ARMcmpNZ to ARMcmpZ and use it to represent comparisons that set only the Z flag (i.e. eq and ne). Make ARMcmpZ commutative.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74423 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/Thumb2/thumb2-cmn.ll')
-rw-r--r--test/CodeGen/Thumb2/thumb2-cmn.ll25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/CodeGen/Thumb2/thumb2-cmn.ll b/test/CodeGen/Thumb2/thumb2-cmn.ll
new file mode 100644
index 0000000000..1f3ef1b014
--- /dev/null
+++ b/test/CodeGen/Thumb2/thumb2-cmn.ll
@@ -0,0 +1,25 @@
+; RUN: llvm-as < %s | llc -march=thumb -mattr=+thumb2 | grep {cmn\\W*r\[0-9\],\\W*r\[0-9\]} | count 4
+
+define i1 @f1(i32 %a, i32 %b) {
+ %nb = sub i32 0, %b
+ %tmp = icmp ne i32 %a, %nb
+ ret i1 %tmp
+}
+
+define i1 @f2(i32 %a, i32 %b) {
+ %nb = sub i32 0, %b
+ %tmp = icmp ne i32 %nb, %a
+ ret i1 %tmp
+}
+
+define i1 @f3(i32 %a, i32 %b) {
+ %nb = sub i32 0, %b
+ %tmp = icmp eq i32 %a, %nb
+ ret i1 %tmp
+}
+
+define i1 @f4(i32 %a, i32 %b) {
+ %nb = sub i32 0, %b
+ %tmp = icmp eq i32 %nb, %a
+ ret i1 %tmp
+}