Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/SystemZ/int-cmp-30.ll @ 147:c2174574ed3a
LLVM 10
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 16:55:33 +0900 |
parents | 1172e4bd9c6f |
children |
comparison
equal
deleted
inserted
replaced
134:3a76565eade5 | 147:c2174574ed3a |
---|---|
8 define double @f1(double %a, double %b, i16 *%ptr) { | 8 define double @f1(double %a, double %b, i16 *%ptr) { |
9 ; CHECK-LABEL: f1: | 9 ; CHECK-LABEL: f1: |
10 ; CHECK: clhhsi 0(%r2), 1 | 10 ; CHECK: clhhsi 0(%r2), 1 |
11 ; CHECK-NEXT: bhr %r14 | 11 ; CHECK-NEXT: bhr %r14 |
12 ; CHECK: br %r14 | 12 ; CHECK: br %r14 |
13 %val = load i16 , i16 *%ptr | 13 %val = load i16, i16 *%ptr |
14 %ext = zext i16 %val to i32 | 14 %ext = zext i16 %val to i32 |
15 %cond = icmp ugt i32 %ext, 1 | 15 %cond = icmp ugt i32 %ext, 1 |
16 %res = select i1 %cond, double %a, double %b | 16 %res = select i1 %cond, double %a, double %b |
17 ret double %res | 17 ret double %res |
18 } | 18 } |
22 define double @f2(double %a, double %b, i16 *%ptr) { | 22 define double @f2(double %a, double %b, i16 *%ptr) { |
23 ; CHECK-LABEL: f2: | 23 ; CHECK-LABEL: f2: |
24 ; CHECK: clhhsi 0(%r2), 1 | 24 ; CHECK: clhhsi 0(%r2), 1 |
25 ; CHECK-NEXT: bhr %r14 | 25 ; CHECK-NEXT: bhr %r14 |
26 ; CHECK: br %r14 | 26 ; CHECK: br %r14 |
27 %val = load i16 , i16 *%ptr | 27 %val = load i16, i16 *%ptr |
28 %ext = sext i16 %val to i32 | 28 %ext = sext i16 %val to i32 |
29 %cond = icmp ugt i32 %ext, 1 | 29 %cond = icmp ugt i32 %ext, 1 |
30 %res = select i1 %cond, double %a, double %b | 30 %res = select i1 %cond, double %a, double %b |
31 ret double %res | 31 ret double %res |
32 } | 32 } |
36 define double @f3(double %a, double %b, i16 *%ptr) { | 36 define double @f3(double %a, double %b, i16 *%ptr) { |
37 ; CHECK-LABEL: f3: | 37 ; CHECK-LABEL: f3: |
38 ; CHECK: clhhsi 0(%r2), 65534 | 38 ; CHECK: clhhsi 0(%r2), 65534 |
39 ; CHECK-NEXT: blr %r14 | 39 ; CHECK-NEXT: blr %r14 |
40 ; CHECK: br %r14 | 40 ; CHECK: br %r14 |
41 %val = load i16 , i16 *%ptr | 41 %val = load i16, i16 *%ptr |
42 %ext = zext i16 %val to i32 | 42 %ext = zext i16 %val to i32 |
43 %cond = icmp ult i32 %ext, 65534 | 43 %cond = icmp ult i32 %ext, 65534 |
44 %res = select i1 %cond, double %a, double %b | 44 %res = select i1 %cond, double %a, double %b |
45 ret double %res | 45 ret double %res |
46 } | 46 } |
50 define double @f4(double %a, double %b, i16 *%ptr) { | 50 define double @f4(double %a, double %b, i16 *%ptr) { |
51 ; CHECK-LABEL: f4: | 51 ; CHECK-LABEL: f4: |
52 ; CHECK: clhhsi 0(%r2), 65534 | 52 ; CHECK: clhhsi 0(%r2), 65534 |
53 ; CHECK-NEXT: blr %r14 | 53 ; CHECK-NEXT: blr %r14 |
54 ; CHECK: br %r14 | 54 ; CHECK: br %r14 |
55 %val = load i16 , i16 *%ptr | 55 %val = load i16, i16 *%ptr |
56 %ext = sext i16 %val to i32 | 56 %ext = sext i16 %val to i32 |
57 %cond = icmp ult i32 %ext, -2 | 57 %cond = icmp ult i32 %ext, -2 |
58 %res = select i1 %cond, double %a, double %b | 58 %res = select i1 %cond, double %a, double %b |
59 ret double %res | 59 ret double %res |
60 } | 60 } |
63 ; extension. The condition is always true. | 63 ; extension. The condition is always true. |
64 define double @f5(double %a, double %b, i16 *%ptr) { | 64 define double @f5(double %a, double %b, i16 *%ptr) { |
65 ; CHECK-LABEL: f5: | 65 ; CHECK-LABEL: f5: |
66 ; CHECK-NOT: clhhsi | 66 ; CHECK-NOT: clhhsi |
67 ; CHECK: br %r14 | 67 ; CHECK: br %r14 |
68 %val = load i16 , i16 *%ptr | 68 %val = load i16, i16 *%ptr |
69 %ext = zext i16 %val to i32 | 69 %ext = zext i16 %val to i32 |
70 %cond = icmp ult i32 %ext, 65536 | 70 %cond = icmp ult i32 %ext, 65536 |
71 %res = select i1 %cond, double %a, double %b | 71 %res = select i1 %cond, double %a, double %b |
72 ret double %res | 72 ret double %res |
73 } | 73 } |
80 ; range. | 80 ; range. |
81 define double @f6(double %a, double %b, i16 *%ptr) { | 81 define double @f6(double %a, double %b, i16 *%ptr) { |
82 ; CHECK-LABEL: f6: | 82 ; CHECK-LABEL: f6: |
83 ; CHECK-NOT: clhhsi | 83 ; CHECK-NOT: clhhsi |
84 ; CHECK: br %r14 | 84 ; CHECK: br %r14 |
85 %val = load i16 , i16 *%ptr | 85 %val = load i16, i16 *%ptr |
86 %ext = sext i16 %val to i32 | 86 %ext = sext i16 %val to i32 |
87 %cond = icmp ult i32 %ext, 32768 | 87 %cond = icmp ult i32 %ext, 32768 |
88 %res = select i1 %cond, double %a, double %b | 88 %res = select i1 %cond, double %a, double %b |
89 ret double %res | 89 ret double %res |
90 } | 90 } |
92 ; ...and then the high end. | 92 ; ...and then the high end. |
93 define double @f7(double %a, double %b, i16 *%ptr) { | 93 define double @f7(double %a, double %b, i16 *%ptr) { |
94 ; CHECK-LABEL: f7: | 94 ; CHECK-LABEL: f7: |
95 ; CHECK-NOT: clhhsi | 95 ; CHECK-NOT: clhhsi |
96 ; CHECK: br %r14 | 96 ; CHECK: br %r14 |
97 %val = load i16 , i16 *%ptr | 97 %val = load i16, i16 *%ptr |
98 %ext = sext i16 %val to i32 | 98 %ext = sext i16 %val to i32 |
99 %cond = icmp ult i32 %ext, -32769 | 99 %cond = icmp ult i32 %ext, -32769 |
100 %res = select i1 %cond, double %a, double %b | 100 %res = select i1 %cond, double %a, double %b |
101 ret double %res | 101 ret double %res |
102 } | 102 } |
106 define double @f8(double %a, double %b, i16 *%ptr) { | 106 define double @f8(double %a, double %b, i16 *%ptr) { |
107 ; CHECK-LABEL: f8: | 107 ; CHECK-LABEL: f8: |
108 ; CHECK: clhhsi 0(%r2), 1 | 108 ; CHECK: clhhsi 0(%r2), 1 |
109 ; CHECK-NEXT: bhr %r14 | 109 ; CHECK-NEXT: bhr %r14 |
110 ; CHECK: br %r14 | 110 ; CHECK: br %r14 |
111 %val = load i16 , i16 *%ptr | 111 %val = load i16, i16 *%ptr |
112 %ext = zext i16 %val to i32 | 112 %ext = zext i16 %val to i32 |
113 %cond = icmp sgt i32 %ext, 1 | 113 %cond = icmp sgt i32 %ext, 1 |
114 %res = select i1 %cond, double %a, double %b | 114 %res = select i1 %cond, double %a, double %b |
115 ret double %res | 115 ret double %res |
116 } | 116 } |
120 define double @f9(double %a, double %b, i16 *%ptr) { | 120 define double @f9(double %a, double %b, i16 *%ptr) { |
121 ; CHECK-LABEL: f9: | 121 ; CHECK-LABEL: f9: |
122 ; CHECK: chhsi 0(%r2), 1 | 122 ; CHECK: chhsi 0(%r2), 1 |
123 ; CHECK-NEXT: bhr %r14 | 123 ; CHECK-NEXT: bhr %r14 |
124 ; CHECK: br %r14 | 124 ; CHECK: br %r14 |
125 %val = load i16 , i16 *%ptr | 125 %val = load i16, i16 *%ptr |
126 %ext = sext i16 %val to i32 | 126 %ext = sext i16 %val to i32 |
127 %cond = icmp sgt i32 %ext, 1 | 127 %cond = icmp sgt i32 %ext, 1 |
128 %res = select i1 %cond, double %a, double %b | 128 %res = select i1 %cond, double %a, double %b |
129 ret double %res | 129 ret double %res |
130 } | 130 } |
134 define double @f10(double %a, double %b, i16 *%ptr) { | 134 define double @f10(double %a, double %b, i16 *%ptr) { |
135 ; CHECK-LABEL: f10: | 135 ; CHECK-LABEL: f10: |
136 ; CHECK: clhhsi 0(%r2), 65534 | 136 ; CHECK: clhhsi 0(%r2), 65534 |
137 ; CHECK-NEXT: blr %r14 | 137 ; CHECK-NEXT: blr %r14 |
138 ; CHECK: br %r14 | 138 ; CHECK: br %r14 |
139 %val = load i16 , i16 *%ptr | 139 %val = load i16, i16 *%ptr |
140 %ext = zext i16 %val to i32 | 140 %ext = zext i16 %val to i32 |
141 %cond = icmp slt i32 %ext, 65534 | 141 %cond = icmp slt i32 %ext, 65534 |
142 %res = select i1 %cond, double %a, double %b | 142 %res = select i1 %cond, double %a, double %b |
143 ret double %res | 143 ret double %res |
144 } | 144 } |
148 define double @f11(double %a, double %b, i16 *%ptr) { | 148 define double @f11(double %a, double %b, i16 *%ptr) { |
149 ; CHECK-LABEL: f11: | 149 ; CHECK-LABEL: f11: |
150 ; CHECK: chhsi 0(%r2), -2 | 150 ; CHECK: chhsi 0(%r2), -2 |
151 ; CHECK-NEXT: blr %r14 | 151 ; CHECK-NEXT: blr %r14 |
152 ; CHECK: br %r14 | 152 ; CHECK: br %r14 |
153 %val = load i16 , i16 *%ptr | 153 %val = load i16, i16 *%ptr |
154 %ext = sext i16 %val to i32 | 154 %ext = sext i16 %val to i32 |
155 %cond = icmp slt i32 %ext, -2 | 155 %cond = icmp slt i32 %ext, -2 |
156 %res = select i1 %cond, double %a, double %b | 156 %res = select i1 %cond, double %a, double %b |
157 ret double %res | 157 ret double %res |
158 } | 158 } |
161 ; extension. The condition is always true. | 161 ; extension. The condition is always true. |
162 define double @f12(double %a, double %b, i16 *%ptr) { | 162 define double @f12(double %a, double %b, i16 *%ptr) { |
163 ; CHECK-LABEL: f12: | 163 ; CHECK-LABEL: f12: |
164 ; CHECK-NOT: cli | 164 ; CHECK-NOT: cli |
165 ; CHECK: br %r14 | 165 ; CHECK: br %r14 |
166 %val = load i16 , i16 *%ptr | 166 %val = load i16, i16 *%ptr |
167 %ext = zext i16 %val to i32 | 167 %ext = zext i16 %val to i32 |
168 %cond = icmp slt i32 %ext, 65536 | 168 %cond = icmp slt i32 %ext, 65536 |
169 %res = select i1 %cond, double %a, double %b | 169 %res = select i1 %cond, double %a, double %b |
170 ret double %res | 170 ret double %res |
171 } | 171 } |
175 define double @f13(double %a, double %b, i16 *%ptr) { | 175 define double @f13(double %a, double %b, i16 *%ptr) { |
176 ; CHECK-LABEL: f13: | 176 ; CHECK-LABEL: f13: |
177 ; CHECK: chhsi 0(%r2), 32766 | 177 ; CHECK: chhsi 0(%r2), 32766 |
178 ; CHECK-NEXT: blr %r14 | 178 ; CHECK-NEXT: blr %r14 |
179 ; CHECK: br %r14 | 179 ; CHECK: br %r14 |
180 %val = load i16 , i16 *%ptr | 180 %val = load i16, i16 *%ptr |
181 %ext = sext i16 %val to i32 | 181 %ext = sext i16 %val to i32 |
182 %cond = icmp slt i32 %ext, 32766 | 182 %cond = icmp slt i32 %ext, 32766 |
183 %res = select i1 %cond, double %a, double %b | 183 %res = select i1 %cond, double %a, double %b |
184 ret double %res | 184 ret double %res |
185 } | 185 } |
188 ; extension. This condition is always true. | 188 ; extension. This condition is always true. |
189 define double @f14(double %a, double %b, i16 *%ptr) { | 189 define double @f14(double %a, double %b, i16 *%ptr) { |
190 ; CHECK-LABEL: f14: | 190 ; CHECK-LABEL: f14: |
191 ; CHECK-NOT: chhsi | 191 ; CHECK-NOT: chhsi |
192 ; CHECK: br %r14 | 192 ; CHECK: br %r14 |
193 %val = load i16 , i16 *%ptr | 193 %val = load i16, i16 *%ptr |
194 %ext = sext i16 %val to i32 | 194 %ext = sext i16 %val to i32 |
195 %cond = icmp slt i32 %ext, 32768 | 195 %cond = icmp slt i32 %ext, 32768 |
196 %res = select i1 %cond, double %a, double %b | 196 %res = select i1 %cond, double %a, double %b |
197 ret double %res | 197 ret double %res |
198 } | 198 } |
202 define double @f15(double %a, double %b, i16 *%ptr) { | 202 define double @f15(double %a, double %b, i16 *%ptr) { |
203 ; CHECK-LABEL: f15: | 203 ; CHECK-LABEL: f15: |
204 ; CHECK: chhsi 0(%r2), -32767 | 204 ; CHECK: chhsi 0(%r2), -32767 |
205 ; CHECK-NEXT: bhr %r14 | 205 ; CHECK-NEXT: bhr %r14 |
206 ; CHECK: br %r14 | 206 ; CHECK: br %r14 |
207 %val = load i16 , i16 *%ptr | 207 %val = load i16, i16 *%ptr |
208 %ext = sext i16 %val to i32 | 208 %ext = sext i16 %val to i32 |
209 %cond = icmp sgt i32 %ext, -32767 | 209 %cond = icmp sgt i32 %ext, -32767 |
210 %res = select i1 %cond, double %a, double %b | 210 %res = select i1 %cond, double %a, double %b |
211 ret double %res | 211 ret double %res |
212 } | 212 } |
215 ; extension. This condition is always true. | 215 ; extension. This condition is always true. |
216 define double @f16(double %a, double %b, i16 *%ptr) { | 216 define double @f16(double %a, double %b, i16 *%ptr) { |
217 ; CHECK-LABEL: f16: | 217 ; CHECK-LABEL: f16: |
218 ; CHECK-NOT: chhsi | 218 ; CHECK-NOT: chhsi |
219 ; CHECK: br %r14 | 219 ; CHECK: br %r14 |
220 %val = load i16 , i16 *%ptr | 220 %val = load i16, i16 *%ptr |
221 %ext = sext i16 %val to i32 | 221 %ext = sext i16 %val to i32 |
222 %cond = icmp sgt i32 %ext, -32769 | 222 %cond = icmp sgt i32 %ext, -32769 |
223 %res = select i1 %cond, double %a, double %b | 223 %res = select i1 %cond, double %a, double %b |
224 ret double %res | 224 ret double %res |
225 } | 225 } |