1 ; Test 64-bit inequality comparisons in which the second operand is a constant.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 ; Check comparisons with 0.
6 define double @f1(double %a, double %b, i64 %i1) {
12 %cond = icmp ne i64 %i1, 0
13 %res = select i1 %cond, double %a, double %b
17 ; Check the high end of the CGHI range.
18 define double @f2(double %a, double %b, i64 %i1) {
20 ; CHECK: cghi %r2, 32767
24 %cond = icmp ne i64 %i1, 32767
25 %res = select i1 %cond, double %a, double %b
29 ; Check the next value up, which must use CGFI.
30 define double @f3(double %a, double %b, i64 %i1) {
32 ; CHECK: cgfi %r2, 32768
36 %cond = icmp ne i64 %i1, 32768
37 %res = select i1 %cond, double %a, double %b
41 ; Check the high end of the CGFI range.
42 define double @f4(double %a, double %b, i64 %i1) {
44 ; CHECK: cgfi %r2, 2147483647
48 %cond = icmp ne i64 %i1, 2147483647
49 %res = select i1 %cond, double %a, double %b
53 ; Check the next value up, which should use CLGFI instead.
54 define double @f5(double %a, double %b, i64 %i1) {
56 ; CHECK: clgfi %r2, 2147483648
60 %cond = icmp ne i64 %i1, 2147483648
61 %res = select i1 %cond, double %a, double %b
65 ; Check the high end of the CLGFI range.
66 define double @f6(double %a, double %b, i64 %i1) {
68 ; CHECK: clgfi %r2, 4294967295
72 %cond = icmp ne i64 %i1, 4294967295
73 %res = select i1 %cond, double %a, double %b
77 ; Check the next value up, which must use a register comparison.
78 define double @f7(double %a, double %b, i64 %i1) {
83 %cond = icmp ne i64 %i1, 4294967296
84 %res = select i1 %cond, double %a, double %b
88 ; Check the high end of the negative CGHI range.
89 define double @f8(double %a, double %b, i64 %i1) {
95 %cond = icmp ne i64 %i1, -1
96 %res = select i1 %cond, double %a, double %b
100 ; Check the low end of the CGHI range.
101 define double @f9(double %a, double %b, i64 %i1) {
103 ; CHECK: cghi %r2, -32768
105 ; CHECK: ldr %f0, %f2
107 %cond = icmp ne i64 %i1, -32768
108 %res = select i1 %cond, double %a, double %b
112 ; Check the next value down, which must use CGFI instead.
113 define double @f10(double %a, double %b, i64 %i1) {
115 ; CHECK: cgfi %r2, -32769
117 ; CHECK: ldr %f0, %f2
119 %cond = icmp ne i64 %i1, -32769
120 %res = select i1 %cond, double %a, double %b
124 ; Check the low end of the CGFI range.
125 define double @f11(double %a, double %b, i64 %i1) {
127 ; CHECK: cgfi %r2, -2147483648
129 ; CHECK: ldr %f0, %f2
131 %cond = icmp ne i64 %i1, -2147483648
132 %res = select i1 %cond, double %a, double %b
136 ; Check the next value down, which must use register comparison.
137 define double @f12(double %a, double %b, i64 %i1) {
140 ; CHECK: ldr %f0, %f2
142 %cond = icmp ne i64 %i1, -2147483649
143 %res = select i1 %cond, double %a, double %b