xref: /aosp_15_r20/external/llvm/test/CodeGen/SystemZ/branch-03.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test all condition-code masks that are relevant for unsigned integer
2*9880d681SAndroid Build Coastguard Worker; comparisons.
3*9880d681SAndroid Build Coastguard Worker;
4*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5*9880d681SAndroid Build Coastguard Workerdefine void @f1(i32 *%src, i32 %target) {
6*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f1:
7*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
8*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
9*9880d681SAndroid Build Coastguard Worker; CHECK: cl %r3, 0(%r2)
10*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jle .L[[LABEL]]
11*9880d681SAndroid Build Coastguard Worker  br label %loop
12*9880d681SAndroid Build Coastguard Workerloop:
13*9880d681SAndroid Build Coastguard Worker  %val = load volatile i32 , i32 *%src
14*9880d681SAndroid Build Coastguard Worker  %cond = icmp ule i32 %target, %val
15*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
16*9880d681SAndroid Build Coastguard Workerexit:
17*9880d681SAndroid Build Coastguard Worker  ret void
18*9880d681SAndroid Build Coastguard Worker}
19*9880d681SAndroid Build Coastguard Worker
20*9880d681SAndroid Build Coastguard Workerdefine void @f2(i32 *%src, i32 %target) {
21*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f2:
22*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
23*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
24*9880d681SAndroid Build Coastguard Worker; CHECK: cl %r3, 0(%r2)
25*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jl .L[[LABEL]]
26*9880d681SAndroid Build Coastguard Worker  br label %loop
27*9880d681SAndroid Build Coastguard Workerloop:
28*9880d681SAndroid Build Coastguard Worker  %val = load volatile i32 , i32 *%src
29*9880d681SAndroid Build Coastguard Worker  %cond = icmp ult i32 %target, %val
30*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
31*9880d681SAndroid Build Coastguard Workerexit:
32*9880d681SAndroid Build Coastguard Worker  ret void
33*9880d681SAndroid Build Coastguard Worker}
34*9880d681SAndroid Build Coastguard Worker
35*9880d681SAndroid Build Coastguard Workerdefine void @f3(i32 *%src, i32 %target) {
36*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f3:
37*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
38*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
39*9880d681SAndroid Build Coastguard Worker; CHECK: cl %r3, 0(%r2)
40*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jh .L[[LABEL]]
41*9880d681SAndroid Build Coastguard Worker  br label %loop
42*9880d681SAndroid Build Coastguard Workerloop:
43*9880d681SAndroid Build Coastguard Worker  %val = load volatile i32 , i32 *%src
44*9880d681SAndroid Build Coastguard Worker  %cond = icmp ugt i32 %target, %val
45*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
46*9880d681SAndroid Build Coastguard Workerexit:
47*9880d681SAndroid Build Coastguard Worker  ret void
48*9880d681SAndroid Build Coastguard Worker}
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard Workerdefine void @f4(i32 *%src, i32 %target) {
51*9880d681SAndroid Build Coastguard Worker; CHECK-LABEL: f4:
52*9880d681SAndroid Build Coastguard Worker; CHECK: .cfi_startproc
53*9880d681SAndroid Build Coastguard Worker; CHECK: .L[[LABEL:.*]]:
54*9880d681SAndroid Build Coastguard Worker; CHECK: cl %r3, 0(%r2)
55*9880d681SAndroid Build Coastguard Worker; CHECK-NEXT: jhe .L[[LABEL]]
56*9880d681SAndroid Build Coastguard Worker  br label %loop
57*9880d681SAndroid Build Coastguard Workerloop:
58*9880d681SAndroid Build Coastguard Worker  %val = load volatile i32 , i32 *%src
59*9880d681SAndroid Build Coastguard Worker  %cond = icmp uge i32 %target, %val
60*9880d681SAndroid Build Coastguard Worker  br i1 %cond, label %loop, label %exit
61*9880d681SAndroid Build Coastguard Workerexit:
62*9880d681SAndroid Build Coastguard Worker  ret void
63*9880d681SAndroid Build Coastguard Worker}
64