1 ; Test SETCC for every integer condition. The tests here assume that
2 ; RISBLG isn't available.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
6 ; Test CC in { 0 }, with 3 don't care.
7 define i32 @f1(i32 %a, i32 %b) {
10 ; CHECK-NEXT: afi %r2, -268435456
11 ; CHECK-NEXT: srl %r2, 31
13 %cond = icmp eq i32 %a, %b
14 %res = zext i1 %cond to i32
18 ; Test CC in { 1 }, with 3 don't care.
19 define i32 @f2(i32 %a, i32 %b) {
21 ; CHECK: ipm [[REG:%r[0-5]]]
22 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 36
24 %cond = icmp slt i32 %a, %b
25 %res = zext i1 %cond to i32
29 ; Test CC in { 0, 1 }, with 3 don't care.
30 define i32 @f3(i32 %a, i32 %b) {
33 ; CHECK-NEXT: afi %r2, -536870912
34 ; CHECK-NEXT: srl %r2, 31
36 %cond = icmp sle i32 %a, %b
37 %res = zext i1 %cond to i32
41 ; Test CC in { 2 }, with 3 don't care.
42 define i32 @f4(i32 %a, i32 %b) {
44 ; CHECK: ipm [[REG:%r[0-5]]]
45 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 35
47 %cond = icmp sgt i32 %a, %b
48 %res = zext i1 %cond to i32
52 ; Test CC in { 0, 2 }, with 3 don't care.
53 define i32 @f5(i32 %a, i32 %b) {
55 ; CHECK: ipm [[REG:%r[0-5]]]
56 ; CHECK-NEXT: xilf [[REG]], 4294967295
57 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 36
59 %cond = icmp sge i32 %a, %b
60 %res = zext i1 %cond to i32
64 ; Test CC in { 1, 2 }, with 3 don't care.
65 define i32 @f6(i32 %a, i32 %b) {
68 ; CHECK-NEXT: afi %r2, 1879048192
69 ; CHECK-NEXT: srl %r2, 31
71 %cond = icmp ne i32 %a, %b
72 %res = zext i1 %cond to i32