1 ; Test SETCC with an i32 result for every integer condition.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z10 | FileCheck %s
5 ; Test CC in { 0 }, with 3 don't care.
6 define i64 @f1(i32 %a, i32 %b) {
8 ; CHECK: ipm [[REG:%r[0-5]]]
9 ; CHECK-NEXT: afi [[REG]], -268435456
10 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
12 %cond = icmp eq i32 %a, %b
13 %res = zext i1 %cond to i64
17 ; Test CC in { 1 }, with 3 don't care.
18 define i64 @f2(i32 %a, i32 %b) {
20 ; CHECK: ipm [[REG:%r[0-5]]]
21 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 36
23 %cond = icmp slt i32 %a, %b
24 %res = zext i1 %cond to i64
28 ; Test CC in { 0, 1 }, with 3 don't care.
29 define i64 @f3(i32 %a, i32 %b) {
31 ; CHECK: ipm [[REG:%r[0-5]]]
32 ; CHECK-NEXT: afi [[REG]], -536870912
33 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
35 %cond = icmp sle i32 %a, %b
36 %res = zext i1 %cond to i64
40 ; Test CC in { 2 }, with 3 don't care.
41 define i64 @f4(i32 %a, i32 %b) {
43 ; CHECK: ipm [[REG:%r[0-5]]]
44 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 35
46 %cond = icmp sgt i32 %a, %b
47 %res = zext i1 %cond to i64
51 ; Test CC in { 0, 2 }, with 3 don't care.
52 define i64 @f5(i32 %a, i32 %b) {
54 ; CHECK: ipm [[REG:%r[0-5]]]
55 ; CHECK-NEXT: xilf [[REG]], 4294967295
56 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 36
58 %cond = icmp sge i32 %a, %b
59 %res = zext i1 %cond to i64
63 ; Test CC in { 1, 2 }, with 3 don't care.
64 define i64 @f6(i32 %a, i32 %b) {
66 ; CHECK: ipm [[REG:%r[0-5]]]
67 ; CHECK-NEXT: afi [[REG]], 1879048192
68 ; CHECK-NEXT: risbg %r2, [[REG]], 63, 191, 33
70 %cond = icmp ne i32 %a, %b
71 %res = zext i1 %cond to i64