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