1 ; Test all condition-code masks that are relevant for signed integer
2 ; comparisons, in cases where a separate branch is better than COMPARE
5 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
7 define void @f1(ptr %src, i32 %target) {
9 ; CHECK: .cfi_startproc
10 ; CHECK: .L[[LABEL:.*]]:
11 ; CHECK: c %r3, 0(%r2)
12 ; CHECK-NEXT: je .L[[LABEL]]
15 %val = load volatile i32, ptr %src
16 %cond = icmp eq i32 %target, %val
17 br i1 %cond, label %loop, label %exit
22 define void @f2(ptr %src, i32 %target) {
24 ; CHECK: .cfi_startproc
25 ; CHECK: .L[[LABEL:.*]]:
26 ; CHECK: c %r3, 0(%r2)
27 ; CHECK-NEXT: jlh .L[[LABEL]]
30 %val = load volatile i32, ptr %src
31 %cond = icmp ne i32 %target, %val
32 br i1 %cond, label %loop, label %exit
37 define void @f3(ptr %src, i32 %target) {
39 ; CHECK: .cfi_startproc
40 ; CHECK: .L[[LABEL:.*]]:
41 ; CHECK: c %r3, 0(%r2)
42 ; CHECK-NEXT: jle .L[[LABEL]]
45 %val = load volatile i32, ptr %src
46 %cond = icmp sle i32 %target, %val
47 br i1 %cond, label %loop, label %exit
52 define void @f4(ptr %src, i32 %target) {
54 ; CHECK: .cfi_startproc
55 ; CHECK: .L[[LABEL:.*]]:
56 ; CHECK: c %r3, 0(%r2)
57 ; CHECK-NEXT: jl .L[[LABEL]]
60 %val = load volatile i32, ptr %src
61 %cond = icmp slt i32 %target, %val
62 br i1 %cond, label %loop, label %exit
67 define void @f5(ptr %src, i32 %target) {
69 ; CHECK: .cfi_startproc
70 ; CHECK: .L[[LABEL:.*]]:
71 ; CHECK: c %r3, 0(%r2)
72 ; CHECK-NEXT: jh .L[[LABEL]]
75 %val = load volatile i32, ptr %src
76 %cond = icmp sgt i32 %target, %val
77 br i1 %cond, label %loop, label %exit
82 define void @f6(ptr %src, i32 %target) {
84 ; CHECK: .cfi_startproc
85 ; CHECK: .L[[LABEL:.*]]:
86 ; CHECK: c %r3, 0(%r2)
87 ; CHECK-NEXT: jhe .L[[LABEL]]
90 %val = load volatile i32, ptr %src
91 %cond = icmp sge i32 %target, %val
92 br i1 %cond, label %loop, label %exit