summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-02 01:30:03 +0000
committerLauro Ramos Venancio <lauro.venancio@gmail.com>2007-04-02 01:30:03 +0000
commit6be85337b03e564c9d6a0443d7eabd82db1ed3f5 (patch)
tree8c633d6c07d3bdbc50a75e11bd894313e4cc36bb /llvm/test
parent7c773e685041ce64b32d86b8071a18b5983d8144 (diff)
downloadbcm5719-llvm-6be85337b03e564c9d6a0443d7eabd82db1ed3f5.tar.gz
bcm5719-llvm-6be85337b03e564c9d6a0443d7eabd82db1ed3f5.zip
- Divides the comparisons in two types: comparisons that only use N and Z
flags (ARMISD::CMPNZ) and comparisons that use all flags (ARMISD::CMP). - Defines the instructions: TST, TEQ (ARM) and TST (Thumb). llvm-svn: 35573
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/CodeGen/ARM/tst_teq.ll21
1 files changed, 21 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/ARM/tst_teq.ll b/llvm/test/CodeGen/ARM/tst_teq.ll
new file mode 100644
index 00000000000..fb2f73be14e
--- /dev/null
+++ b/llvm/test/CodeGen/ARM/tst_teq.ll
@@ -0,0 +1,21 @@
+; RUN: llvm-as < %s | llc -march=arm &&
+; RUN: llvm-as < %s | llc -march=thumb &&
+; RUN: llvm-as < %s | llc -march=arm | grep "tst" &&
+; RUN: llvm-as < %s | llc -march=arm | grep "teq" &&
+; RUN: llvm-as < %s | llc -march=thumb | grep "tst"
+
+define i32 @f(i32 %a) {
+entry:
+ %tmp2 = and i32 %a, 255 ; <i32> [#uses=1]
+ icmp eq i32 %tmp2, 0 ; <i1>:0 [#uses=1]
+ %retval = select i1 %0, i32 20, i32 10 ; <i32> [#uses=1]
+ ret i32 %retval
+}
+
+define i32 @g(i32 %a) {
+entry:
+ %tmp2 = xor i32 %a, 255
+ icmp eq i32 %tmp2, 0 ; <i1>:0 [#uses=1]
+ %retval = select i1 %0, i32 20, i32 10 ; <i32> [#uses=1]
+ ret i32 %retval
+}
OpenPOWER on IntegriCloud