1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -verify-machineinstrs -mtriple=x86_64-unknown-unknown --show-mc-encoding -mattr=+cmpccxadd | FileCheck %s
4 define dso_local i32 @test_cmpbexadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
5 ; CHECK-LABEL: test_cmpbexadd32:
6 ; CHECK: # %bb.0: # %entry
7 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
8 ; CHECK-NEXT: cmpoxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe0,0x07]
9 ; CHECK-NEXT: retq # encoding: [0xc3]
11 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 0)
15 declare i32 @llvm.x86.cmpccxadd32(ptr, i32, i32, i32 immarg)
17 define dso_local i64 @test_cmpbexadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
18 ; CHECK-LABEL: test_cmpbexadd64:
19 ; CHECK: # %bb.0: # %entry
20 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
21 ; CHECK-NEXT: cmpoxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe0,0x07]
22 ; CHECK-NEXT: retq # encoding: [0xc3]
24 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 0)
28 declare i64 @llvm.x86.cmpccxadd64(ptr, i64, i64, i32 immarg)
30 define dso_local i32 @test_cmpbxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
31 ; CHECK-LABEL: test_cmpbxadd32:
32 ; CHECK: # %bb.0: # %entry
33 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
34 ; CHECK-NEXT: cmpnoxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe1,0x07]
35 ; CHECK-NEXT: retq # encoding: [0xc3]
37 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 1)
41 define dso_local i64 @test_cmpbxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
42 ; CHECK-LABEL: test_cmpbxadd64:
43 ; CHECK: # %bb.0: # %entry
44 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
45 ; CHECK-NEXT: cmpnoxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe1,0x07]
46 ; CHECK-NEXT: retq # encoding: [0xc3]
48 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 1)
52 define dso_local i32 @test_cmplexadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
53 ; CHECK-LABEL: test_cmplexadd32:
54 ; CHECK: # %bb.0: # %entry
55 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
56 ; CHECK-NEXT: cmpbxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe2,0x07]
57 ; CHECK-NEXT: retq # encoding: [0xc3]
59 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 2)
63 define dso_local i64 @test_cmplexadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
64 ; CHECK-LABEL: test_cmplexadd64:
65 ; CHECK: # %bb.0: # %entry
66 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
67 ; CHECK-NEXT: cmpbxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe2,0x07]
68 ; CHECK-NEXT: retq # encoding: [0xc3]
70 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 2)
74 define dso_local i32 @test_cmplxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
75 ; CHECK-LABEL: test_cmplxadd32:
76 ; CHECK: # %bb.0: # %entry
77 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
78 ; CHECK-NEXT: cmpnbxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe3,0x07]
79 ; CHECK-NEXT: retq # encoding: [0xc3]
81 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 3)
85 define dso_local i64 @test_cmplxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
86 ; CHECK-LABEL: test_cmplxadd64:
87 ; CHECK: # %bb.0: # %entry
88 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
89 ; CHECK-NEXT: cmpnbxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe3,0x07]
90 ; CHECK-NEXT: retq # encoding: [0xc3]
92 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 3)
96 define dso_local i32 @test_cmpnbexadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
97 ; CHECK-LABEL: test_cmpnbexadd32:
98 ; CHECK: # %bb.0: # %entry
99 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
100 ; CHECK-NEXT: cmpzxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe4,0x07]
101 ; CHECK-NEXT: retq # encoding: [0xc3]
103 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 4)
107 define dso_local i64 @test_cmpnbexadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
108 ; CHECK-LABEL: test_cmpnbexadd64:
109 ; CHECK: # %bb.0: # %entry
110 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
111 ; CHECK-NEXT: cmpzxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe4,0x07]
112 ; CHECK-NEXT: retq # encoding: [0xc3]
114 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 4)
118 define dso_local i32 @test_cmpnbxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
119 ; CHECK-LABEL: test_cmpnbxadd32:
120 ; CHECK: # %bb.0: # %entry
121 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
122 ; CHECK-NEXT: cmpnzxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe5,0x07]
123 ; CHECK-NEXT: retq # encoding: [0xc3]
125 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 5)
129 define dso_local i64 @test_cmpnbxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
130 ; CHECK-LABEL: test_cmpnbxadd64:
131 ; CHECK: # %bb.0: # %entry
132 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
133 ; CHECK-NEXT: cmpnzxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe5,0x07]
134 ; CHECK-NEXT: retq # encoding: [0xc3]
136 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 5)
140 define dso_local i32 @test_cmpnlexadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
141 ; CHECK-LABEL: test_cmpnlexadd32:
142 ; CHECK: # %bb.0: # %entry
143 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
144 ; CHECK-NEXT: cmpbexadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe6,0x07]
145 ; CHECK-NEXT: retq # encoding: [0xc3]
147 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 6)
151 define dso_local i64 @test_cmpnlexadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
152 ; CHECK-LABEL: test_cmpnlexadd64:
153 ; CHECK: # %bb.0: # %entry
154 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
155 ; CHECK-NEXT: cmpbexadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe6,0x07]
156 ; CHECK-NEXT: retq # encoding: [0xc3]
158 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 6)
162 define dso_local i32 @test_cmpnlxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
163 ; CHECK-LABEL: test_cmpnlxadd32:
164 ; CHECK: # %bb.0: # %entry
165 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
166 ; CHECK-NEXT: cmpnbexadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe7,0x07]
167 ; CHECK-NEXT: retq # encoding: [0xc3]
169 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 7)
173 define dso_local i64 @test_cmpnlxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
174 ; CHECK-LABEL: test_cmpnlxadd64:
175 ; CHECK: # %bb.0: # %entry
176 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
177 ; CHECK-NEXT: cmpnbexadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe7,0x07]
178 ; CHECK-NEXT: retq # encoding: [0xc3]
180 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 7)
184 define dso_local i32 @test_cmpnoxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
185 ; CHECK-LABEL: test_cmpnoxadd32:
186 ; CHECK: # %bb.0: # %entry
187 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
188 ; CHECK-NEXT: cmpsxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe8,0x07]
189 ; CHECK-NEXT: retq # encoding: [0xc3]
191 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 8)
195 define dso_local i64 @test_cmpnoxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
196 ; CHECK-LABEL: test_cmpnoxadd64:
197 ; CHECK: # %bb.0: # %entry
198 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
199 ; CHECK-NEXT: cmpsxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe8,0x07]
200 ; CHECK-NEXT: retq # encoding: [0xc3]
202 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 8)
206 define dso_local i32 @test_cmpnpxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
207 ; CHECK-LABEL: test_cmpnpxadd32:
208 ; CHECK: # %bb.0: # %entry
209 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
210 ; CHECK-NEXT: cmpnsxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xe9,0x07]
211 ; CHECK-NEXT: retq # encoding: [0xc3]
213 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 9)
217 define dso_local i64 @test_cmpnpxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
218 ; CHECK-LABEL: test_cmpnpxadd64:
219 ; CHECK: # %bb.0: # %entry
220 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
221 ; CHECK-NEXT: cmpnsxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xe9,0x07]
222 ; CHECK-NEXT: retq # encoding: [0xc3]
224 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 9)
228 define dso_local i32 @test_cmpnsxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
229 ; CHECK-LABEL: test_cmpnsxadd32:
230 ; CHECK: # %bb.0: # %entry
231 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
232 ; CHECK-NEXT: cmppxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xea,0x07]
233 ; CHECK-NEXT: retq # encoding: [0xc3]
235 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 10)
239 define dso_local i64 @test_cmpnsxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
240 ; CHECK-LABEL: test_cmpnsxadd64:
241 ; CHECK: # %bb.0: # %entry
242 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
243 ; CHECK-NEXT: cmppxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xea,0x07]
244 ; CHECK-NEXT: retq # encoding: [0xc3]
246 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 10)
250 define dso_local i32 @test_cmpnzxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
251 ; CHECK-LABEL: test_cmpnzxadd32:
252 ; CHECK: # %bb.0: # %entry
253 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
254 ; CHECK-NEXT: cmpnpxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xeb,0x07]
255 ; CHECK-NEXT: retq # encoding: [0xc3]
257 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 11)
261 define dso_local i64 @test_cmpnzxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
262 ; CHECK-LABEL: test_cmpnzxadd64:
263 ; CHECK: # %bb.0: # %entry
264 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
265 ; CHECK-NEXT: cmpnpxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xeb,0x07]
266 ; CHECK-NEXT: retq # encoding: [0xc3]
268 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 11)
272 define dso_local i32 @test_cmpoxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
273 ; CHECK-LABEL: test_cmpoxadd32:
274 ; CHECK: # %bb.0: # %entry
275 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
276 ; CHECK-NEXT: cmplxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xec,0x07]
277 ; CHECK-NEXT: retq # encoding: [0xc3]
279 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 12)
283 define dso_local i64 @test_cmpoxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
284 ; CHECK-LABEL: test_cmpoxadd64:
285 ; CHECK: # %bb.0: # %entry
286 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
287 ; CHECK-NEXT: cmplxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xec,0x07]
288 ; CHECK-NEXT: retq # encoding: [0xc3]
290 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 12)
294 define dso_local i32 @test_cmppxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
295 ; CHECK-LABEL: test_cmppxadd32:
296 ; CHECK: # %bb.0: # %entry
297 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
298 ; CHECK-NEXT: cmpnlxadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xed,0x07]
299 ; CHECK-NEXT: retq # encoding: [0xc3]
301 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 13)
305 define dso_local i64 @test_cmppxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
306 ; CHECK-LABEL: test_cmppxadd64:
307 ; CHECK: # %bb.0: # %entry
308 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
309 ; CHECK-NEXT: cmpnlxadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xed,0x07]
310 ; CHECK-NEXT: retq # encoding: [0xc3]
312 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 13)
316 define dso_local i32 @test_cmpsxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
317 ; CHECK-LABEL: test_cmpsxadd32:
318 ; CHECK: # %bb.0: # %entry
319 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
320 ; CHECK-NEXT: cmplexadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xee,0x07]
321 ; CHECK-NEXT: retq # encoding: [0xc3]
323 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 14)
327 define dso_local i64 @test_cmpsxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
328 ; CHECK-LABEL: test_cmpsxadd64:
329 ; CHECK: # %bb.0: # %entry
330 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
331 ; CHECK-NEXT: cmplexadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xee,0x07]
332 ; CHECK-NEXT: retq # encoding: [0xc3]
334 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 14)
338 define dso_local i32 @test_cmpzxadd32(ptr %__A, i32 %__B, i32 %__C) nounwind {
339 ; CHECK-LABEL: test_cmpzxadd32:
340 ; CHECK: # %bb.0: # %entry
341 ; CHECK-NEXT: movl %esi, %eax # encoding: [0x89,0xf0]
342 ; CHECK-NEXT: cmpnlexadd %edx, %eax, (%rdi) # encoding: [0xc4,0xe2,0x69,0xef,0x07]
343 ; CHECK-NEXT: retq # encoding: [0xc3]
345 %0 = tail call i32 @llvm.x86.cmpccxadd32(ptr %__A, i32 %__B, i32 %__C, i32 15)
349 define dso_local i64 @test_cmpzxadd64(ptr %__A, i64 %__B, i64 %__C) nounwind {
350 ; CHECK-LABEL: test_cmpzxadd64:
351 ; CHECK: # %bb.0: # %entry
352 ; CHECK-NEXT: movq %rsi, %rax # encoding: [0x48,0x89,0xf0]
353 ; CHECK-NEXT: cmpnlexadd %rdx, %rax, (%rdi) # encoding: [0xc4,0xe2,0xe9,0xef,0x07]
354 ; CHECK-NEXT: retq # encoding: [0xc3]
356 %0 = tail call i64 @llvm.x86.cmpccxadd64(ptr %__A, i64 %__B, i64 %__C, i32 15)