aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/SystemZ/asm-18.ll
diff options
context:
space:
mode:
authorRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-10-01 15:00:44 +0000
committerRichard Sandiford <rsandifo@linux.vnet.ibm.com>2013-10-01 15:00:44 +0000
commite22c56d6d81b84d6f4ba24c2f5b0b203e7ddffe9 (patch)
tree2cb11c268f8f3373416cf3fc1400a62ba4701ba3 /test/CodeGen/SystemZ/asm-18.ll
parent185ef05ad6fdcaad1e831020b1f88d0046dd15d6 (diff)
downloadexternal_llvm-e22c56d6d81b84d6f4ba24c2f5b0b203e7ddffe9.zip
external_llvm-e22c56d6d81b84d6f4ba24c2f5b0b203e7ddffe9.tar.gz
external_llvm-e22c56d6d81b84d6f4ba24c2f5b0b203e7ddffe9.tar.bz2
[SystemZ] Add comparisons of high words and memory
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191777 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/SystemZ/asm-18.ll')
-rw-r--r--test/CodeGen/SystemZ/asm-18.ll40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/CodeGen/SystemZ/asm-18.ll b/test/CodeGen/SystemZ/asm-18.ll
index d39de6d..d60654b 100644
--- a/test/CodeGen/SystemZ/asm-18.ll
+++ b/test/CodeGen/SystemZ/asm-18.ll
@@ -703,3 +703,43 @@ define i32 @f32() {
%sel2 = select i1 %cmp2, i32 0, i32 1
ret i32 %sel2
}
+
+; Test memory comparison involving high registers.
+define void @f33(i32 *%ptr1, i32 *%ptr2) {
+; CHECK-LABEL: f33:
+; CHECK: stepa [[REG1:%r[0-5]]]
+; CHECK: chf [[REG1]], 0(%r2)
+; CHECK: stepb [[REG2:%r[0-5]]]
+; CHECK: clhf [[REG2]], 0(%r3)
+; CHECK: br %r14
+ %res1 = call i32 asm "stepa $0", "=h"()
+ %load1 = load i32 *%ptr1
+ %cmp1 = icmp sle i32 %res1, %load1
+ %sel1 = select i1 %cmp1, i32 0, i32 1
+ %res2 = call i32 asm "stepb $0, $1", "=h,r"(i32 %sel1)
+ %load2 = load i32 *%ptr2
+ %cmp2 = icmp ule i32 %res2, %load2
+ %sel2 = select i1 %cmp2, i32 0, i32 1
+ store i32 %sel2, i32 *%ptr1
+ ret void
+}
+
+; Test memory comparison involving low registers.
+define void @f34(i32 *%ptr1, i32 *%ptr2) {
+; CHECK-LABEL: f34:
+; CHECK: stepa [[REG1:%r[0-5]]]
+; CHECK: c [[REG1]], 0(%r2)
+; CHECK: stepb [[REG2:%r[0-5]]]
+; CHECK: cl [[REG2]], 0(%r3)
+; CHECK: br %r14
+ %res1 = call i32 asm "stepa $0", "=r"()
+ %load1 = load i32 *%ptr1
+ %cmp1 = icmp sle i32 %res1, %load1
+ %sel1 = select i1 %cmp1, i32 0, i32 1
+ %res2 = call i32 asm "stepb $0, $1", "=r,r"(i32 %sel1)
+ %load2 = load i32 *%ptr2
+ %cmp2 = icmp ule i32 %res2, %load2
+ %sel2 = select i1 %cmp2, i32 0, i32 1
+ store i32 %sel2, i32 *%ptr1
+ ret void
+}