1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -verify-machineinstrs -show-mc-encoding | FileCheck %s
4 target triple = "x86_64-unknown-unknown"
6 @g64 = external dso_local global i64, align 8
7 @g32 = external dso_local global i32, align 4
8 @g16 = external dso_local global i16, align 2
9 @g8 = external dso_local global i8, align 1
11 declare dso_local void @a()
12 declare dso_local void @b()
14 define void @add64_imm32_br() nounwind {
15 ; CHECK-LABEL: add64_imm32_br:
16 ; CHECK: # %bb.0: # %entry
17 ; CHECK-NEXT: addq $16777214, g64(%rip) # encoding: [0x48,0x81,0x05,A,A,A,A,0xfe,0xff,0xff,0x00]
18 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
19 ; CHECK-NEXT: # imm = 0xFFFFFE
20 ; CHECK-NEXT: jns b # TAILCALL
21 ; CHECK-NEXT: # encoding: [0x79,A]
22 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
23 ; CHECK-NEXT: # %bb.1: # %a
24 ; CHECK-NEXT: jmp a # TAILCALL
25 ; CHECK-NEXT: # encoding: [0xeb,A]
26 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
28 %load1 = load i64, ptr @g64
29 ; Add 0x00FFFFFE, a positive immediate requiring 24-bits.
30 %add = add i64 %load1, 16777214
31 store i64 %add, ptr @g64
32 %cond = icmp slt i64 %add, 0
33 br i1 %cond, label %a, label %b
44 define void @add64_sext_imm32_br() nounwind {
45 ; CHECK-LABEL: add64_sext_imm32_br:
46 ; CHECK: # %bb.0: # %entry
47 ; CHECK-NEXT: addq $-2147483648, g64(%rip) # encoding: [0x48,0x81,0x05,A,A,A,A,0x00,0x00,0x00,0x80]
48 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
49 ; CHECK-NEXT: # imm = 0x80000000
50 ; CHECK-NEXT: jns b # TAILCALL
51 ; CHECK-NEXT: # encoding: [0x79,A]
52 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
53 ; CHECK-NEXT: # %bb.1: # %a
54 ; CHECK-NEXT: jmp a # TAILCALL
55 ; CHECK-NEXT: # encoding: [0xeb,A]
56 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
58 %load1 = load i64, ptr @g64
59 ; Add -0x80000000, which requires sign-extended 32 bits.
60 %add = add i64 %load1, -2147483648
61 store i64 %add, ptr @g64
62 %cond = icmp slt i64 %add, 0
63 br i1 %cond, label %a, label %b
74 define void @add64_imm32_via_sub_br() nounwind {
75 ; CHECK-LABEL: add64_imm32_via_sub_br:
76 ; CHECK: # %bb.0: # %entry
77 ; CHECK-NEXT: subq $-2147483648, g64(%rip) # encoding: [0x48,0x81,0x2d,A,A,A,A,0x00,0x00,0x00,0x80]
78 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
79 ; CHECK-NEXT: # imm = 0x80000000
80 ; CHECK-NEXT: jns b # TAILCALL
81 ; CHECK-NEXT: # encoding: [0x79,A]
82 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
83 ; CHECK-NEXT: # %bb.1: # %a
84 ; CHECK-NEXT: jmp a # TAILCALL
85 ; CHECK-NEXT: # encoding: [0xeb,A]
86 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
88 %load1 = load i64, ptr @g64
89 ; Add 0x80000000, which cannot fit in a sign extended 32-bit immediate. This
90 ; get's folded because we can instead subtract -0x80000000.
91 %add = add i64 %load1, 2147483648
92 store i64 %add, ptr @g64
93 %cond = icmp slt i64 %add, 0
94 br i1 %cond, label %a, label %b
105 define void @add64_no_imm32_via_sub_due_to_cf_br() nounwind {
106 ; CHECK-LABEL: add64_no_imm32_via_sub_due_to_cf_br:
107 ; CHECK: # %bb.0: # %entry
108 ; CHECK-NEXT: movl $2147483648, %eax # encoding: [0xb8,0x00,0x00,0x00,0x80]
109 ; CHECK-NEXT: # imm = 0x80000000
110 ; CHECK-NEXT: addq %rax, g64(%rip) # encoding: [0x48,0x01,0x05,A,A,A,A]
111 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
112 ; CHECK-NEXT: jae b # TAILCALL
113 ; CHECK-NEXT: # encoding: [0x73,A]
114 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
115 ; CHECK-NEXT: # %bb.1: # %a
116 ; CHECK-NEXT: jmp a # TAILCALL
117 ; CHECK-NEXT: # encoding: [0xeb,A]
118 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
120 %load1 = load i64, ptr @g64
121 ; Add 0x80000000, which cannot fit in a sign extended 32-bit immediate, but
122 ; could in theory be folded into an immediate operand of a sub. However, we
123 ; use the CF flag here and so shouldn't make that transformation.
124 %add = add i64 %load1, 2147483648
125 store i64 %add, ptr @g64
126 %cond = icmp ult i64 %add, 2147483648
127 br i1 %cond, label %a, label %b
138 define void @add64_too_large_imm32_br() nounwind {
139 ; CHECK-LABEL: add64_too_large_imm32_br:
140 ; CHECK: # %bb.0: # %entry
141 ; CHECK-NEXT: movl $2147483649, %eax # encoding: [0xb8,0x01,0x00,0x00,0x80]
142 ; CHECK-NEXT: # imm = 0x80000001
143 ; CHECK-NEXT: addq %rax, g64(%rip) # encoding: [0x48,0x01,0x05,A,A,A,A]
144 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
145 ; CHECK-NEXT: jns b # TAILCALL
146 ; CHECK-NEXT: # encoding: [0x79,A]
147 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
148 ; CHECK-NEXT: # %bb.1: # %a
149 ; CHECK-NEXT: jmp a # TAILCALL
150 ; CHECK-NEXT: # encoding: [0xeb,A]
151 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
153 %load1 = load i64, ptr @g64
154 ; Add 0x80000001, which cannot fit in a sign extended 32-bit immediate. This
155 ; should not get folded into an immediate.
156 %add = add i64 %load1, 2147483649
157 store i64 %add, ptr @g64
158 %cond = icmp slt i64 %add, 0
159 br i1 %cond, label %a, label %b
170 define void @add64_imm8_via_sub_br() nounwind {
171 ; CHECK-LABEL: add64_imm8_via_sub_br:
172 ; CHECK: # %bb.0: # %entry
173 ; CHECK-NEXT: subq $-128, g64(%rip) # encoding: [0x48,0x83,0x2d,A,A,A,A,0x80]
174 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
175 ; CHECK-NEXT: jns b # TAILCALL
176 ; CHECK-NEXT: # encoding: [0x79,A]
177 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
178 ; CHECK-NEXT: # %bb.1: # %a
179 ; CHECK-NEXT: jmp a # TAILCALL
180 ; CHECK-NEXT: # encoding: [0xeb,A]
181 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
183 %load1 = load i64, ptr @g64
184 ; Add 0x80 which can't quite fit into an imm8 because it would be sign
185 ; extended, but which can fit if we convert to a sub and negate the value.
186 %add = add i64 %load1, 128
187 store i64 %add, ptr @g64
188 %cond = icmp slt i64 %add, 0
189 br i1 %cond, label %a, label %b
200 define void @add64_imm8_br() nounwind {
201 ; CHECK-LABEL: add64_imm8_br:
202 ; CHECK: # %bb.0: # %entry
203 ; CHECK-NEXT: addq $42, g64(%rip) # encoding: [0x48,0x83,0x05,A,A,A,A,0x2a]
204 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
205 ; CHECK-NEXT: jns b # TAILCALL
206 ; CHECK-NEXT: # encoding: [0x79,A]
207 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
208 ; CHECK-NEXT: # %bb.1: # %a
209 ; CHECK-NEXT: jmp a # TAILCALL
210 ; CHECK-NEXT: # encoding: [0xeb,A]
211 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
213 %load1 = load i64, ptr @g64
214 %add = add i64 %load1, 42
215 store i64 %add, ptr @g64
216 %cond = icmp slt i64 %add, 0
217 br i1 %cond, label %a, label %b
228 define void @add64_imm8_neg_br() nounwind {
229 ; CHECK-LABEL: add64_imm8_neg_br:
230 ; CHECK: # %bb.0: # %entry
231 ; CHECK-NEXT: addq $-42, g64(%rip) # encoding: [0x48,0x83,0x05,A,A,A,A,0xd6]
232 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
233 ; CHECK-NEXT: jns b # TAILCALL
234 ; CHECK-NEXT: # encoding: [0x79,A]
235 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
236 ; CHECK-NEXT: # %bb.1: # %a
237 ; CHECK-NEXT: jmp a # TAILCALL
238 ; CHECK-NEXT: # encoding: [0xeb,A]
239 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
241 %load1 = load i64, ptr @g64
242 %add = add i64 %load1, -42
243 store i64 %add, ptr @g64
244 %cond = icmp slt i64 %add, 0
245 br i1 %cond, label %a, label %b
256 define void @add32_imm_br() nounwind {
257 ; CHECK-LABEL: add32_imm_br:
258 ; CHECK: # %bb.0: # %entry
259 ; CHECK-NEXT: addl $-2147483648, g32(%rip) # encoding: [0x81,0x05,A,A,A,A,0x00,0x00,0x00,0x80]
260 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-8, kind: reloc_riprel_4byte
261 ; CHECK-NEXT: # imm = 0x80000000
262 ; CHECK-NEXT: jns b # TAILCALL
263 ; CHECK-NEXT: # encoding: [0x79,A]
264 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
265 ; CHECK-NEXT: # %bb.1: # %a
266 ; CHECK-NEXT: jmp a # TAILCALL
267 ; CHECK-NEXT: # encoding: [0xeb,A]
268 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
270 %load1 = load i32, ptr @g32
271 ; Add 0x80000000, a positive number requiring 32 bits of immediate.
272 %add = add i32 %load1, 2147483648
273 store i32 %add, ptr @g32
274 %cond = icmp slt i32 %add, 0
275 br i1 %cond, label %a, label %b
286 define void @add32_imm8_br() nounwind {
287 ; CHECK-LABEL: add32_imm8_br:
288 ; CHECK: # %bb.0: # %entry
289 ; CHECK-NEXT: addl $42, g32(%rip) # encoding: [0x83,0x05,A,A,A,A,0x2a]
290 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
291 ; CHECK-NEXT: jns b # TAILCALL
292 ; CHECK-NEXT: # encoding: [0x79,A]
293 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
294 ; CHECK-NEXT: # %bb.1: # %a
295 ; CHECK-NEXT: jmp a # TAILCALL
296 ; CHECK-NEXT: # encoding: [0xeb,A]
297 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
299 %load1 = load i32, ptr @g32
300 %add = add i32 %load1, 42
301 store i32 %add, ptr @g32
302 %cond = icmp slt i32 %add, 0
303 br i1 %cond, label %a, label %b
314 define void @add32_imm8_neg_br() nounwind {
315 ; CHECK-LABEL: add32_imm8_neg_br:
316 ; CHECK: # %bb.0: # %entry
317 ; CHECK-NEXT: addl $-42, g32(%rip) # encoding: [0x83,0x05,A,A,A,A,0xd6]
318 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
319 ; CHECK-NEXT: jns b # TAILCALL
320 ; CHECK-NEXT: # encoding: [0x79,A]
321 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
322 ; CHECK-NEXT: # %bb.1: # %a
323 ; CHECK-NEXT: jmp a # TAILCALL
324 ; CHECK-NEXT: # encoding: [0xeb,A]
325 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
327 %load1 = load i32, ptr @g32
328 %add = add i32 %load1, -42
329 store i32 %add, ptr @g32
330 %cond = icmp slt i32 %add, 0
331 br i1 %cond, label %a, label %b
342 define void @add16_imm_br() nounwind {
343 ; CHECK-LABEL: add16_imm_br:
344 ; CHECK: # %bb.0: # %entry
345 ; CHECK-NEXT: addw $-32768, g16(%rip) # encoding: [0x66,0x81,0x05,A,A,A,A,0x00,0x80]
346 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-6, kind: reloc_riprel_4byte
347 ; CHECK-NEXT: # imm = 0x8000
348 ; CHECK-NEXT: jns b # TAILCALL
349 ; CHECK-NEXT: # encoding: [0x79,A]
350 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
351 ; CHECK-NEXT: # %bb.1: # %a
352 ; CHECK-NEXT: jmp a # TAILCALL
353 ; CHECK-NEXT: # encoding: [0xeb,A]
354 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
356 %load1 = load i16, ptr @g16
357 ; Add 0x8000, a positive number requiring 16 bits of immediate.
358 %add = add i16 %load1, 32768
359 store i16 %add, ptr @g16
360 %cond = icmp slt i16 %add, 0
361 br i1 %cond, label %a, label %b
372 define void @add16_imm8_br() nounwind {
373 ; CHECK-LABEL: add16_imm8_br:
374 ; CHECK: # %bb.0: # %entry
375 ; CHECK-NEXT: addw $42, g16(%rip) # encoding: [0x66,0x83,0x05,A,A,A,A,0x2a]
376 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
377 ; CHECK-NEXT: jns b # TAILCALL
378 ; CHECK-NEXT: # encoding: [0x79,A]
379 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
380 ; CHECK-NEXT: # %bb.1: # %a
381 ; CHECK-NEXT: jmp a # TAILCALL
382 ; CHECK-NEXT: # encoding: [0xeb,A]
383 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
385 %load1 = load i16, ptr @g16
386 %add = add i16 %load1, 42
387 store i16 %add, ptr @g16
388 %cond = icmp slt i16 %add, 0
389 br i1 %cond, label %a, label %b
400 define void @add16_imm8_neg_br() nounwind {
401 ; CHECK-LABEL: add16_imm8_neg_br:
402 ; CHECK: # %bb.0: # %entry
403 ; CHECK-NEXT: addw $-42, g16(%rip) # encoding: [0x66,0x83,0x05,A,A,A,A,0xd6]
404 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
405 ; CHECK-NEXT: jns b # TAILCALL
406 ; CHECK-NEXT: # encoding: [0x79,A]
407 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
408 ; CHECK-NEXT: # %bb.1: # %a
409 ; CHECK-NEXT: jmp a # TAILCALL
410 ; CHECK-NEXT: # encoding: [0xeb,A]
411 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
413 %load1 = load i16, ptr @g16
414 %add = add i16 %load1, -42
415 store i16 %add, ptr @g16
416 %cond = icmp slt i16 %add, 0
417 br i1 %cond, label %a, label %b
428 define void @add8_imm_br() nounwind {
429 ; CHECK-LABEL: add8_imm_br:
430 ; CHECK: # %bb.0: # %entry
431 ; CHECK-NEXT: addb $-2, g8(%rip) # encoding: [0x80,0x05,A,A,A,A,0xfe]
432 ; CHECK-NEXT: # fixup A - offset: 2, value: g8-5, kind: reloc_riprel_4byte
433 ; CHECK-NEXT: jns b # TAILCALL
434 ; CHECK-NEXT: # encoding: [0x79,A]
435 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
436 ; CHECK-NEXT: # %bb.1: # %a
437 ; CHECK-NEXT: jmp a # TAILCALL
438 ; CHECK-NEXT: # encoding: [0xeb,A]
439 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
441 %load1 = load i8, ptr @g8
442 %add = add i8 %load1, -2
443 store i8 %add, ptr @g8
444 %cond = icmp slt i8 %add, 0
445 br i1 %cond, label %a, label %b
456 define void @add64_reg_br(i64 %arg) nounwind {
457 ; CHECK-LABEL: add64_reg_br:
458 ; CHECK: # %bb.0: # %entry
459 ; CHECK-NEXT: addq %rdi, g64(%rip) # encoding: [0x48,0x01,0x3d,A,A,A,A]
460 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
461 ; CHECK-NEXT: jns b # TAILCALL
462 ; CHECK-NEXT: # encoding: [0x79,A]
463 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
464 ; CHECK-NEXT: # %bb.1: # %a
465 ; CHECK-NEXT: jmp a # TAILCALL
466 ; CHECK-NEXT: # encoding: [0xeb,A]
467 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
469 %load1 = load i64, ptr @g64
470 %add = add i64 %load1, %arg
471 store i64 %add, ptr @g64
472 %cond = icmp slt i64 %add, 0
473 br i1 %cond, label %a, label %b
484 define void @add32_reg_br(i32 %arg) nounwind {
485 ; CHECK-LABEL: add32_reg_br:
486 ; CHECK: # %bb.0: # %entry
487 ; CHECK-NEXT: addl %edi, g32(%rip) # encoding: [0x01,0x3d,A,A,A,A]
488 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-4, kind: reloc_riprel_4byte
489 ; CHECK-NEXT: jns b # TAILCALL
490 ; CHECK-NEXT: # encoding: [0x79,A]
491 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
492 ; CHECK-NEXT: # %bb.1: # %a
493 ; CHECK-NEXT: jmp a # TAILCALL
494 ; CHECK-NEXT: # encoding: [0xeb,A]
495 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
497 %load1 = load i32, ptr @g32
498 %add = add i32 %load1, %arg
499 store i32 %add, ptr @g32
500 %cond = icmp slt i32 %add, 0
501 br i1 %cond, label %a, label %b
512 define void @add16_reg_br(i16 %arg) nounwind {
513 ; CHECK-LABEL: add16_reg_br:
514 ; CHECK: # %bb.0: # %entry
515 ; CHECK-NEXT: addw %di, g16(%rip) # encoding: [0x66,0x01,0x3d,A,A,A,A]
516 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-4, kind: reloc_riprel_4byte
517 ; CHECK-NEXT: jns b # TAILCALL
518 ; CHECK-NEXT: # encoding: [0x79,A]
519 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
520 ; CHECK-NEXT: # %bb.1: # %a
521 ; CHECK-NEXT: jmp a # TAILCALL
522 ; CHECK-NEXT: # encoding: [0xeb,A]
523 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
525 %load1 = load i16, ptr @g16
526 %add = add i16 %load1, %arg
527 store i16 %add, ptr @g16
528 %cond = icmp slt i16 %add, 0
529 br i1 %cond, label %a, label %b
540 define void @add8_reg_br(i8 %arg) nounwind {
541 ; CHECK-LABEL: add8_reg_br:
542 ; CHECK: # %bb.0: # %entry
543 ; CHECK-NEXT: addb %dil, g8(%rip) # encoding: [0x40,0x00,0x3d,A,A,A,A]
544 ; CHECK-NEXT: # fixup A - offset: 3, value: g8-4, kind: reloc_riprel_4byte
545 ; CHECK-NEXT: jns b # TAILCALL
546 ; CHECK-NEXT: # encoding: [0x79,A]
547 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
548 ; CHECK-NEXT: # %bb.1: # %a
549 ; CHECK-NEXT: jmp a # TAILCALL
550 ; CHECK-NEXT: # encoding: [0xeb,A]
551 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
553 %load1 = load i8, ptr @g8
554 %add = add i8 %load1, %arg
555 store i8 %add, ptr @g8
556 %cond = icmp slt i8 %add, 0
557 br i1 %cond, label %a, label %b
568 define void @sub64_imm32_br() nounwind {
569 ; CHECK-LABEL: sub64_imm32_br:
570 ; CHECK: # %bb.0: # %entry
571 ; CHECK-NEXT: subq $-2147483648, g64(%rip) # encoding: [0x48,0x81,0x2d,A,A,A,A,0x00,0x00,0x00,0x80]
572 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
573 ; CHECK-NEXT: # imm = 0x80000000
574 ; CHECK-NEXT: jns b # TAILCALL
575 ; CHECK-NEXT: # encoding: [0x79,A]
576 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
577 ; CHECK-NEXT: # %bb.1: # %a
578 ; CHECK-NEXT: jmp a # TAILCALL
579 ; CHECK-NEXT: # encoding: [0xeb,A]
580 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
582 %load1 = load i64, ptr @g64
583 ; Subtract -0x80000000, which can't be negated into a sign-extended 32-bit
584 ; immediate, so that we have to select sub here.
585 %sub = sub i64 %load1, -2147483648
586 store i64 %sub, ptr @g64
587 %cond = icmp slt i64 %sub, 0
588 br i1 %cond, label %a, label %b
599 define void @sub64_too_large_imm32_br() nounwind {
600 ; CHECK-LABEL: sub64_too_large_imm32_br:
601 ; CHECK: # %bb.0: # %entry
602 ; CHECK-NEXT: movabsq $-4294967295, %rax # encoding: [0x48,0xb8,0x01,0x00,0x00,0x00,0xff,0xff,0xff,0xff]
603 ; CHECK-NEXT: # imm = 0xFFFFFFFF00000001
604 ; CHECK-NEXT: addq %rax, g64(%rip) # encoding: [0x48,0x01,0x05,A,A,A,A]
605 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
606 ; CHECK-NEXT: jns b # TAILCALL
607 ; CHECK-NEXT: # encoding: [0x79,A]
608 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
609 ; CHECK-NEXT: # %bb.1: # %a
610 ; CHECK-NEXT: jmp a # TAILCALL
611 ; CHECK-NEXT: # encoding: [0xeb,A]
612 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
614 %load1 = load i64, ptr @g64
615 ; Subtract 0xFFFFFFFF, which cannot fit in a sign extended 32-bit immediate,
616 ; even if negated and sign extended as an add.
617 %sub = sub i64 %load1, 4294967295
618 store i64 %sub, ptr @g64
619 %cond = icmp slt i64 %sub, 0
620 br i1 %cond, label %a, label %b
631 define void @sub64_imm8_br() nounwind {
632 ; CHECK-LABEL: sub64_imm8_br:
633 ; CHECK: # %bb.0: # %entry
634 ; CHECK-NEXT: subq $-128, g64(%rip) # encoding: [0x48,0x83,0x2d,A,A,A,A,0x80]
635 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
636 ; CHECK-NEXT: jns b # TAILCALL
637 ; CHECK-NEXT: # encoding: [0x79,A]
638 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
639 ; CHECK-NEXT: # %bb.1: # %a
640 ; CHECK-NEXT: jmp a # TAILCALL
641 ; CHECK-NEXT: # encoding: [0xeb,A]
642 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
644 %load1 = load i64, ptr @g64
645 ; Subtract -0x80, which can be done with an 8-bit immediate but only as
646 ; a subtract where that immediate can be negative.
647 %sub = sub i64 %load1, -128
648 store i64 %sub, ptr @g64
649 %cond = icmp slt i64 %sub, 0
650 br i1 %cond, label %a, label %b
661 define void @sub32_imm_br() nounwind {
662 ; CHECK-LABEL: sub32_imm_br:
663 ; CHECK: # %bb.0: # %entry
664 ; CHECK-NEXT: addl $-2147483648, g32(%rip) # encoding: [0x81,0x05,A,A,A,A,0x00,0x00,0x00,0x80]
665 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-8, kind: reloc_riprel_4byte
666 ; CHECK-NEXT: # imm = 0x80000000
667 ; CHECK-NEXT: jns b # TAILCALL
668 ; CHECK-NEXT: # encoding: [0x79,A]
669 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
670 ; CHECK-NEXT: # %bb.1: # %a
671 ; CHECK-NEXT: jmp a # TAILCALL
672 ; CHECK-NEXT: # encoding: [0xeb,A]
673 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
675 %load1 = load i32, ptr @g32
676 ; Subtract -0x80000000, which requires 32 bits of immediate but still gets
678 %sub = sub i32 %load1, -2147483648
679 store i32 %sub, ptr @g32
680 %cond = icmp slt i32 %sub, 0
681 br i1 %cond, label %a, label %b
692 define void @sub32_imm8_br() nounwind {
693 ; CHECK-LABEL: sub32_imm8_br:
694 ; CHECK: # %bb.0: # %entry
695 ; CHECK-NEXT: subl $-128, g32(%rip) # encoding: [0x83,0x2d,A,A,A,A,0x80]
696 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
697 ; CHECK-NEXT: jns b # TAILCALL
698 ; CHECK-NEXT: # encoding: [0x79,A]
699 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
700 ; CHECK-NEXT: # %bb.1: # %a
701 ; CHECK-NEXT: jmp a # TAILCALL
702 ; CHECK-NEXT: # encoding: [0xeb,A]
703 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
705 %load1 = load i32, ptr @g32
706 ; Subtract -0x80, which can be done with an 8-bit immediate but only as
707 ; a subtract where that immediate can be negative.
708 %sub = sub i32 %load1, -128
709 store i32 %sub, ptr @g32
710 %cond = icmp slt i32 %sub, 0
711 br i1 %cond, label %a, label %b
722 define void @sub16_imm_br() nounwind {
723 ; CHECK-LABEL: sub16_imm_br:
724 ; CHECK: # %bb.0: # %entry
725 ; CHECK-NEXT: addw $-32768, g16(%rip) # encoding: [0x66,0x81,0x05,A,A,A,A,0x00,0x80]
726 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-6, kind: reloc_riprel_4byte
727 ; CHECK-NEXT: # imm = 0x8000
728 ; CHECK-NEXT: jns b # TAILCALL
729 ; CHECK-NEXT: # encoding: [0x79,A]
730 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
731 ; CHECK-NEXT: # %bb.1: # %a
732 ; CHECK-NEXT: jmp a # TAILCALL
733 ; CHECK-NEXT: # encoding: [0xeb,A]
734 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
736 %load1 = load i16, ptr @g16
737 ; Subtract -0x8000, which requires a 16 bits of immediate but still gets
739 %sub = sub i16 %load1, -32768
740 store i16 %sub, ptr @g16
741 %cond = icmp slt i16 %sub, 0
742 br i1 %cond, label %a, label %b
753 define void @sub16_imm8_br() nounwind {
754 ; CHECK-LABEL: sub16_imm8_br:
755 ; CHECK: # %bb.0: # %entry
756 ; CHECK-NEXT: subw $-128, g16(%rip) # encoding: [0x66,0x83,0x2d,A,A,A,A,0x80]
757 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
758 ; CHECK-NEXT: jns b # TAILCALL
759 ; CHECK-NEXT: # encoding: [0x79,A]
760 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
761 ; CHECK-NEXT: # %bb.1: # %a
762 ; CHECK-NEXT: jmp a # TAILCALL
763 ; CHECK-NEXT: # encoding: [0xeb,A]
764 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
766 %load1 = load i16, ptr @g16
767 ; Subtract -0x80, which can be done with an 8-bit immediate but only as
768 ; a subtract where that immediate can be negative.
769 %sub = sub i16 %load1, -128
770 store i16 %sub, ptr @g16
771 %cond = icmp slt i16 %sub, 0
772 br i1 %cond, label %a, label %b
783 define void @sub8_imm_br() nounwind {
784 ; CHECK-LABEL: sub8_imm_br:
785 ; CHECK: # %bb.0: # %entry
786 ; CHECK-NEXT: addb $-128, g8(%rip) # encoding: [0x80,0x05,A,A,A,A,0x80]
787 ; CHECK-NEXT: # fixup A - offset: 2, value: g8-5, kind: reloc_riprel_4byte
788 ; CHECK-NEXT: jns b # TAILCALL
789 ; CHECK-NEXT: # encoding: [0x79,A]
790 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
791 ; CHECK-NEXT: # %bb.1: # %a
792 ; CHECK-NEXT: jmp a # TAILCALL
793 ; CHECK-NEXT: # encoding: [0xeb,A]
794 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
796 %load1 = load i8, ptr @g8
797 ; Subtract -0x80, which requires an 8-bit immediate but still gets lowered as
799 %sub = sub i8 %load1, -128
800 store i8 %sub, ptr @g8
801 %cond = icmp slt i8 %sub, 0
802 br i1 %cond, label %a, label %b
813 define void @sub64_reg_br(i64 %arg) nounwind {
814 ; CHECK-LABEL: sub64_reg_br:
815 ; CHECK: # %bb.0: # %entry
816 ; CHECK-NEXT: subq %rdi, g64(%rip) # encoding: [0x48,0x29,0x3d,A,A,A,A]
817 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
818 ; CHECK-NEXT: jns b # TAILCALL
819 ; CHECK-NEXT: # encoding: [0x79,A]
820 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
821 ; CHECK-NEXT: # %bb.1: # %a
822 ; CHECK-NEXT: jmp a # TAILCALL
823 ; CHECK-NEXT: # encoding: [0xeb,A]
824 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
826 %load1 = load i64, ptr @g64
827 %sub = sub i64 %load1, %arg
828 store i64 %sub, ptr @g64
829 %cond = icmp slt i64 %sub, 0
830 br i1 %cond, label %a, label %b
841 define void @sub32_reg_br(i32 %arg) nounwind {
842 ; CHECK-LABEL: sub32_reg_br:
843 ; CHECK: # %bb.0: # %entry
844 ; CHECK-NEXT: subl %edi, g32(%rip) # encoding: [0x29,0x3d,A,A,A,A]
845 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-4, kind: reloc_riprel_4byte
846 ; CHECK-NEXT: jns b # TAILCALL
847 ; CHECK-NEXT: # encoding: [0x79,A]
848 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
849 ; CHECK-NEXT: # %bb.1: # %a
850 ; CHECK-NEXT: jmp a # TAILCALL
851 ; CHECK-NEXT: # encoding: [0xeb,A]
852 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
854 %load1 = load i32, ptr @g32
855 %sub = sub i32 %load1, %arg
856 store i32 %sub, ptr @g32
857 %cond = icmp slt i32 %sub, 0
858 br i1 %cond, label %a, label %b
869 define void @sub16_reg_br(i16 %arg) nounwind {
870 ; CHECK-LABEL: sub16_reg_br:
871 ; CHECK: # %bb.0: # %entry
872 ; CHECK-NEXT: subw %di, g16(%rip) # encoding: [0x66,0x29,0x3d,A,A,A,A]
873 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-4, kind: reloc_riprel_4byte
874 ; CHECK-NEXT: jns b # TAILCALL
875 ; CHECK-NEXT: # encoding: [0x79,A]
876 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
877 ; CHECK-NEXT: # %bb.1: # %a
878 ; CHECK-NEXT: jmp a # TAILCALL
879 ; CHECK-NEXT: # encoding: [0xeb,A]
880 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
882 %load1 = load i16, ptr @g16
883 %sub = sub i16 %load1, %arg
884 store i16 %sub, ptr @g16
885 %cond = icmp slt i16 %sub, 0
886 br i1 %cond, label %a, label %b
897 define void @sub8_reg_br(i8 %arg) nounwind {
898 ; CHECK-LABEL: sub8_reg_br:
899 ; CHECK: # %bb.0: # %entry
900 ; CHECK-NEXT: subb %dil, g8(%rip) # encoding: [0x40,0x28,0x3d,A,A,A,A]
901 ; CHECK-NEXT: # fixup A - offset: 3, value: g8-4, kind: reloc_riprel_4byte
902 ; CHECK-NEXT: jns b # TAILCALL
903 ; CHECK-NEXT: # encoding: [0x79,A]
904 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
905 ; CHECK-NEXT: # %bb.1: # %a
906 ; CHECK-NEXT: jmp a # TAILCALL
907 ; CHECK-NEXT: # encoding: [0xeb,A]
908 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
910 %load1 = load i8, ptr @g8
911 %sub = sub i8 %load1, %arg
912 store i8 %sub, ptr @g8
913 %cond = icmp slt i8 %sub, 0
914 br i1 %cond, label %a, label %b
925 define void @and64_imm32_br() nounwind {
926 ; CHECK-LABEL: and64_imm32_br:
927 ; CHECK: # %bb.0: # %entry
928 ; CHECK-NEXT: andq $16777215, g64(%rip) # encoding: [0x48,0x81,0x25,A,A,A,A,0xff,0xff,0xff,0x00]
929 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
930 ; CHECK-NEXT: # imm = 0xFFFFFF
931 ; CHECK-NEXT: jne b # TAILCALL
932 ; CHECK-NEXT: # encoding: [0x75,A]
933 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
934 ; CHECK-NEXT: # %bb.1: # %a
935 ; CHECK-NEXT: jmp a # TAILCALL
936 ; CHECK-NEXT: # encoding: [0xeb,A]
937 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
939 %load1 = load i64, ptr @g64
940 ; And 0x00FFFFFF, a positive immediate requiring 24-bits.
941 %and = and i64 %load1, 16777215
942 store i64 %and, ptr @g64
943 %cond = icmp eq i64 %and, 0
944 br i1 %cond, label %a, label %b
955 define void @and64_sext_imm32_br() nounwind {
956 ; CHECK-LABEL: and64_sext_imm32_br:
957 ; CHECK: # %bb.0: # %entry
958 ; CHECK-NEXT: andq $-2147483648, g64(%rip) # encoding: [0x48,0x81,0x25,A,A,A,A,0x00,0x00,0x00,0x80]
959 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
960 ; CHECK-NEXT: # imm = 0x80000000
961 ; CHECK-NEXT: jne b # TAILCALL
962 ; CHECK-NEXT: # encoding: [0x75,A]
963 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
964 ; CHECK-NEXT: # %bb.1: # %a
965 ; CHECK-NEXT: jmp a # TAILCALL
966 ; CHECK-NEXT: # encoding: [0xeb,A]
967 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
969 %load1 = load i64, ptr @g64
970 ; And -0x80000000, which requires sign-extended 32 bits.
971 %and = and i64 %load1, -2147483648
972 store i64 %and, ptr @g64
973 %cond = icmp eq i64 %and, 0
974 br i1 %cond, label %a, label %b
985 define void @and64_imm8_br() nounwind {
986 ; CHECK-LABEL: and64_imm8_br:
987 ; CHECK: # %bb.0: # %entry
988 ; CHECK-NEXT: andq $15, g64(%rip) # encoding: [0x48,0x83,0x25,A,A,A,A,0x0f]
989 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
990 ; CHECK-NEXT: jne b # TAILCALL
991 ; CHECK-NEXT: # encoding: [0x75,A]
992 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
993 ; CHECK-NEXT: # %bb.1: # %a
994 ; CHECK-NEXT: jmp a # TAILCALL
995 ; CHECK-NEXT: # encoding: [0xeb,A]
996 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
998 %load1 = load i64, ptr @g64
999 %and = and i64 %load1, 15
1000 store i64 %and, ptr @g64
1001 %cond = icmp eq i64 %and, 0
1002 br i1 %cond, label %a, label %b
1013 define void @and64_imm8_neg_br() nounwind {
1014 ; CHECK-LABEL: and64_imm8_neg_br:
1015 ; CHECK: # %bb.0: # %entry
1016 ; CHECK-NEXT: andq $-4, g64(%rip) # encoding: [0x48,0x83,0x25,A,A,A,A,0xfc]
1017 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
1018 ; CHECK-NEXT: jne b # TAILCALL
1019 ; CHECK-NEXT: # encoding: [0x75,A]
1020 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1021 ; CHECK-NEXT: # %bb.1: # %a
1022 ; CHECK-NEXT: jmp a # TAILCALL
1023 ; CHECK-NEXT: # encoding: [0xeb,A]
1024 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1026 %load1 = load i64, ptr @g64
1027 %and = and i64 %load1, -4
1028 store i64 %and, ptr @g64
1029 %cond = icmp eq i64 %and, 0
1030 br i1 %cond, label %a, label %b
1041 define void @and32_imm_br() nounwind {
1042 ; CHECK-LABEL: and32_imm_br:
1043 ; CHECK: # %bb.0: # %entry
1044 ; CHECK-NEXT: andl $-2147483648, g32(%rip) # encoding: [0x81,0x25,A,A,A,A,0x00,0x00,0x00,0x80]
1045 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-8, kind: reloc_riprel_4byte
1046 ; CHECK-NEXT: # imm = 0x80000000
1047 ; CHECK-NEXT: jne b # TAILCALL
1048 ; CHECK-NEXT: # encoding: [0x75,A]
1049 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1050 ; CHECK-NEXT: # %bb.1: # %a
1051 ; CHECK-NEXT: jmp a # TAILCALL
1052 ; CHECK-NEXT: # encoding: [0xeb,A]
1053 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1055 %load1 = load i32, ptr @g32
1056 ; And 0x80000000, a positive number requiring 32 bits of immediate.
1057 %and = and i32 %load1, 2147483648
1058 store i32 %and, ptr @g32
1059 %cond = icmp eq i32 %and, 0
1060 br i1 %cond, label %a, label %b
1071 define void @and32_imm8_br() nounwind {
1072 ; CHECK-LABEL: and32_imm8_br:
1073 ; CHECK: # %bb.0: # %entry
1074 ; CHECK-NEXT: andl $15, g32(%rip) # encoding: [0x83,0x25,A,A,A,A,0x0f]
1075 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
1076 ; CHECK-NEXT: jne b # TAILCALL
1077 ; CHECK-NEXT: # encoding: [0x75,A]
1078 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1079 ; CHECK-NEXT: # %bb.1: # %a
1080 ; CHECK-NEXT: jmp a # TAILCALL
1081 ; CHECK-NEXT: # encoding: [0xeb,A]
1082 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1084 %load1 = load i32, ptr @g32
1085 %and = and i32 %load1, 15
1086 store i32 %and, ptr @g32
1087 %cond = icmp eq i32 %and, 0
1088 br i1 %cond, label %a, label %b
1099 define void @and32_imm8_neg_br() nounwind {
1100 ; CHECK-LABEL: and32_imm8_neg_br:
1101 ; CHECK: # %bb.0: # %entry
1102 ; CHECK-NEXT: andl $-4, g32(%rip) # encoding: [0x83,0x25,A,A,A,A,0xfc]
1103 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
1104 ; CHECK-NEXT: jne b # TAILCALL
1105 ; CHECK-NEXT: # encoding: [0x75,A]
1106 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1107 ; CHECK-NEXT: # %bb.1: # %a
1108 ; CHECK-NEXT: jmp a # TAILCALL
1109 ; CHECK-NEXT: # encoding: [0xeb,A]
1110 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1112 %load1 = load i32, ptr @g32
1113 %and = and i32 %load1, -4
1114 store i32 %and, ptr @g32
1115 %cond = icmp eq i32 %and, 0
1116 br i1 %cond, label %a, label %b
1127 define void @and16_imm_br() nounwind {
1128 ; CHECK-LABEL: and16_imm_br:
1129 ; CHECK: # %bb.0: # %entry
1130 ; CHECK-NEXT: andw $-32768, g16(%rip) # encoding: [0x66,0x81,0x25,A,A,A,A,0x00,0x80]
1131 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-6, kind: reloc_riprel_4byte
1132 ; CHECK-NEXT: # imm = 0x8000
1133 ; CHECK-NEXT: jne b # TAILCALL
1134 ; CHECK-NEXT: # encoding: [0x75,A]
1135 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1136 ; CHECK-NEXT: # %bb.1: # %a
1137 ; CHECK-NEXT: jmp a # TAILCALL
1138 ; CHECK-NEXT: # encoding: [0xeb,A]
1139 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1141 %load1 = load i16, ptr @g16
1142 %and = and i16 %load1, 32768
1143 store i16 %and, ptr @g16
1144 %cond = icmp eq i16 %and, 0
1145 br i1 %cond, label %a, label %b
1156 define void @and16_imm8_br() nounwind {
1157 ; CHECK-LABEL: and16_imm8_br:
1158 ; CHECK: # %bb.0: # %entry
1159 ; CHECK-NEXT: andw $15, g16(%rip) # encoding: [0x66,0x83,0x25,A,A,A,A,0x0f]
1160 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
1161 ; CHECK-NEXT: jne b # TAILCALL
1162 ; CHECK-NEXT: # encoding: [0x75,A]
1163 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1164 ; CHECK-NEXT: # %bb.1: # %a
1165 ; CHECK-NEXT: jmp a # TAILCALL
1166 ; CHECK-NEXT: # encoding: [0xeb,A]
1167 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1169 %load1 = load i16, ptr @g16
1170 %and = and i16 %load1, 15
1171 store i16 %and, ptr @g16
1172 %cond = icmp eq i16 %and, 0
1173 br i1 %cond, label %a, label %b
1184 define void @and16_imm8_neg_br() nounwind {
1185 ; CHECK-LABEL: and16_imm8_neg_br:
1186 ; CHECK: # %bb.0: # %entry
1187 ; CHECK-NEXT: andw $-4, g16(%rip) # encoding: [0x66,0x83,0x25,A,A,A,A,0xfc]
1188 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
1189 ; CHECK-NEXT: jne b # TAILCALL
1190 ; CHECK-NEXT: # encoding: [0x75,A]
1191 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1192 ; CHECK-NEXT: # %bb.1: # %a
1193 ; CHECK-NEXT: jmp a # TAILCALL
1194 ; CHECK-NEXT: # encoding: [0xeb,A]
1195 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1197 %load1 = load i16, ptr @g16
1198 %and = and i16 %load1, -4
1199 store i16 %and, ptr @g16
1200 %cond = icmp eq i16 %and, 0
1201 br i1 %cond, label %a, label %b
1212 define void @and8_imm_br() nounwind {
1213 ; CHECK-LABEL: and8_imm_br:
1214 ; CHECK: # %bb.0: # %entry
1215 ; CHECK-NEXT: andb $-4, g8(%rip) # encoding: [0x80,0x25,A,A,A,A,0xfc]
1216 ; CHECK-NEXT: # fixup A - offset: 2, value: g8-5, kind: reloc_riprel_4byte
1217 ; CHECK-NEXT: jne b # TAILCALL
1218 ; CHECK-NEXT: # encoding: [0x75,A]
1219 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1220 ; CHECK-NEXT: # %bb.1: # %a
1221 ; CHECK-NEXT: jmp a # TAILCALL
1222 ; CHECK-NEXT: # encoding: [0xeb,A]
1223 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1225 %load1 = load i8, ptr @g8
1226 %and = and i8 %load1, -4
1227 store i8 %and, ptr @g8
1228 %cond = icmp eq i8 %and, 0
1229 br i1 %cond, label %a, label %b
1240 define void @and64_reg_br(i64 %arg) nounwind {
1241 ; CHECK-LABEL: and64_reg_br:
1242 ; CHECK: # %bb.0: # %entry
1243 ; CHECK-NEXT: andq %rdi, g64(%rip) # encoding: [0x48,0x21,0x3d,A,A,A,A]
1244 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
1245 ; CHECK-NEXT: jne b # TAILCALL
1246 ; CHECK-NEXT: # encoding: [0x75,A]
1247 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1248 ; CHECK-NEXT: # %bb.1: # %a
1249 ; CHECK-NEXT: jmp a # TAILCALL
1250 ; CHECK-NEXT: # encoding: [0xeb,A]
1251 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1253 %load1 = load i64, ptr @g64
1254 %and = and i64 %load1, %arg
1255 store i64 %and, ptr @g64
1256 %cond = icmp eq i64 %and, 0
1257 br i1 %cond, label %a, label %b
1268 define void @and32_reg_br(i32 %arg) nounwind {
1269 ; CHECK-LABEL: and32_reg_br:
1270 ; CHECK: # %bb.0: # %entry
1271 ; CHECK-NEXT: andl %edi, g32(%rip) # encoding: [0x21,0x3d,A,A,A,A]
1272 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-4, kind: reloc_riprel_4byte
1273 ; CHECK-NEXT: jne b # TAILCALL
1274 ; CHECK-NEXT: # encoding: [0x75,A]
1275 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1276 ; CHECK-NEXT: # %bb.1: # %a
1277 ; CHECK-NEXT: jmp a # TAILCALL
1278 ; CHECK-NEXT: # encoding: [0xeb,A]
1279 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1281 %load1 = load i32, ptr @g32
1282 %and = and i32 %load1, %arg
1283 store i32 %and, ptr @g32
1284 %cond = icmp eq i32 %and, 0
1285 br i1 %cond, label %a, label %b
1296 define void @and16_reg_br(i16 %arg) nounwind {
1297 ; CHECK-LABEL: and16_reg_br:
1298 ; CHECK: # %bb.0: # %entry
1299 ; CHECK-NEXT: andw %di, g16(%rip) # encoding: [0x66,0x21,0x3d,A,A,A,A]
1300 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-4, kind: reloc_riprel_4byte
1301 ; CHECK-NEXT: jne b # TAILCALL
1302 ; CHECK-NEXT: # encoding: [0x75,A]
1303 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1304 ; CHECK-NEXT: # %bb.1: # %a
1305 ; CHECK-NEXT: jmp a # TAILCALL
1306 ; CHECK-NEXT: # encoding: [0xeb,A]
1307 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1309 %load1 = load i16, ptr @g16
1310 %and = and i16 %load1, %arg
1311 store i16 %and, ptr @g16
1312 %cond = icmp eq i16 %and, 0
1313 br i1 %cond, label %a, label %b
1324 define void @and8_reg_br(i8 %arg) nounwind {
1325 ; CHECK-LABEL: and8_reg_br:
1326 ; CHECK: # %bb.0: # %entry
1327 ; CHECK-NEXT: andb %dil, g8(%rip) # encoding: [0x40,0x20,0x3d,A,A,A,A]
1328 ; CHECK-NEXT: # fixup A - offset: 3, value: g8-4, kind: reloc_riprel_4byte
1329 ; CHECK-NEXT: jne b # TAILCALL
1330 ; CHECK-NEXT: # encoding: [0x75,A]
1331 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1332 ; CHECK-NEXT: # %bb.1: # %a
1333 ; CHECK-NEXT: jmp a # TAILCALL
1334 ; CHECK-NEXT: # encoding: [0xeb,A]
1335 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1337 %load1 = load i8, ptr @g8
1338 %and = and i8 %load1, %arg
1339 store i8 %and, ptr @g8
1340 %cond = icmp eq i8 %and, 0
1341 br i1 %cond, label %a, label %b
1352 define void @or64_imm32_br() nounwind {
1353 ; CHECK-LABEL: or64_imm32_br:
1354 ; CHECK: # %bb.0: # %entry
1355 ; CHECK-NEXT: orq $16777215, g64(%rip) # encoding: [0x48,0x81,0x0d,A,A,A,A,0xff,0xff,0xff,0x00]
1356 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
1357 ; CHECK-NEXT: # imm = 0xFFFFFF
1358 ; CHECK-NEXT: jne b # TAILCALL
1359 ; CHECK-NEXT: # encoding: [0x75,A]
1360 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1361 ; CHECK-NEXT: # %bb.1: # %a
1362 ; CHECK-NEXT: jmp a # TAILCALL
1363 ; CHECK-NEXT: # encoding: [0xeb,A]
1364 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1366 %load1 = load i64, ptr @g64
1367 ; Or 0x00FFFFFF, a positive immediate requiring 24-bits.
1368 %or = or i64 %load1, 16777215
1369 store i64 %or, ptr @g64
1370 %cond = icmp eq i64 %or, 0
1371 br i1 %cond, label %a, label %b
1382 define void @or64_sext_imm32_br() nounwind {
1383 ; CHECK-LABEL: or64_sext_imm32_br:
1384 ; CHECK: # %bb.0: # %entry
1385 ; CHECK-NEXT: orq $-2147483648, g64(%rip) # encoding: [0x48,0x81,0x0d,A,A,A,A,0x00,0x00,0x00,0x80]
1386 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
1387 ; CHECK-NEXT: # imm = 0x80000000
1388 ; CHECK-NEXT: jne b # TAILCALL
1389 ; CHECK-NEXT: # encoding: [0x75,A]
1390 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1391 ; CHECK-NEXT: # %bb.1: # %a
1392 ; CHECK-NEXT: jmp a # TAILCALL
1393 ; CHECK-NEXT: # encoding: [0xeb,A]
1394 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1396 %load1 = load i64, ptr @g64
1397 ; Or -0x80000000, which requires sign-extended 32 bits.
1398 %or = or i64 %load1, -2147483648
1399 store i64 %or, ptr @g64
1400 %cond = icmp eq i64 %or, 0
1401 br i1 %cond, label %a, label %b
1412 define void @or64_imm8_br() nounwind {
1413 ; CHECK-LABEL: or64_imm8_br:
1414 ; CHECK: # %bb.0: # %entry
1415 ; CHECK-NEXT: orq $15, g64(%rip) # encoding: [0x48,0x83,0x0d,A,A,A,A,0x0f]
1416 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
1417 ; CHECK-NEXT: jne b # TAILCALL
1418 ; CHECK-NEXT: # encoding: [0x75,A]
1419 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1420 ; CHECK-NEXT: # %bb.1: # %a
1421 ; CHECK-NEXT: jmp a # TAILCALL
1422 ; CHECK-NEXT: # encoding: [0xeb,A]
1423 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1425 %load1 = load i64, ptr @g64
1426 %or = or i64 %load1, 15
1427 store i64 %or, ptr @g64
1428 %cond = icmp eq i64 %or, 0
1429 br i1 %cond, label %a, label %b
1440 define void @or64_imm8_neg_br() nounwind {
1441 ; CHECK-LABEL: or64_imm8_neg_br:
1442 ; CHECK: # %bb.0: # %entry
1443 ; CHECK-NEXT: orq $-4, g64(%rip) # encoding: [0x48,0x83,0x0d,A,A,A,A,0xfc]
1444 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
1445 ; CHECK-NEXT: jne b # TAILCALL
1446 ; CHECK-NEXT: # encoding: [0x75,A]
1447 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1448 ; CHECK-NEXT: # %bb.1: # %a
1449 ; CHECK-NEXT: jmp a # TAILCALL
1450 ; CHECK-NEXT: # encoding: [0xeb,A]
1451 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1453 %load1 = load i64, ptr @g64
1454 %or = or i64 %load1, -4
1455 store i64 %or, ptr @g64
1456 %cond = icmp eq i64 %or, 0
1457 br i1 %cond, label %a, label %b
1468 define void @or32_imm_br() nounwind {
1469 ; CHECK-LABEL: or32_imm_br:
1470 ; CHECK: # %bb.0: # %entry
1471 ; CHECK-NEXT: orl $-2147483648, g32(%rip) # encoding: [0x81,0x0d,A,A,A,A,0x00,0x00,0x00,0x80]
1472 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-8, kind: reloc_riprel_4byte
1473 ; CHECK-NEXT: # imm = 0x80000000
1474 ; CHECK-NEXT: jne b # TAILCALL
1475 ; CHECK-NEXT: # encoding: [0x75,A]
1476 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1477 ; CHECK-NEXT: # %bb.1: # %a
1478 ; CHECK-NEXT: jmp a # TAILCALL
1479 ; CHECK-NEXT: # encoding: [0xeb,A]
1480 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1482 %load1 = load i32, ptr @g32
1483 ; Or 0x80000000, a positive number requiring 32 bits of immediate.
1484 %or = or i32 %load1, 2147483648
1485 store i32 %or, ptr @g32
1486 %cond = icmp eq i32 %or, 0
1487 br i1 %cond, label %a, label %b
1498 define void @or32_imm8_br() nounwind {
1499 ; CHECK-LABEL: or32_imm8_br:
1500 ; CHECK: # %bb.0: # %entry
1501 ; CHECK-NEXT: orl $15, g32(%rip) # encoding: [0x83,0x0d,A,A,A,A,0x0f]
1502 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
1503 ; CHECK-NEXT: jne b # TAILCALL
1504 ; CHECK-NEXT: # encoding: [0x75,A]
1505 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1506 ; CHECK-NEXT: # %bb.1: # %a
1507 ; CHECK-NEXT: jmp a # TAILCALL
1508 ; CHECK-NEXT: # encoding: [0xeb,A]
1509 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1511 %load1 = load i32, ptr @g32
1512 %or = or i32 %load1, 15
1513 store i32 %or, ptr @g32
1514 %cond = icmp eq i32 %or, 0
1515 br i1 %cond, label %a, label %b
1526 define void @or32_imm8_neg_br() nounwind {
1527 ; CHECK-LABEL: or32_imm8_neg_br:
1528 ; CHECK: # %bb.0: # %entry
1529 ; CHECK-NEXT: orl $-4, g32(%rip) # encoding: [0x83,0x0d,A,A,A,A,0xfc]
1530 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
1531 ; CHECK-NEXT: jne b # TAILCALL
1532 ; CHECK-NEXT: # encoding: [0x75,A]
1533 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1534 ; CHECK-NEXT: # %bb.1: # %a
1535 ; CHECK-NEXT: jmp a # TAILCALL
1536 ; CHECK-NEXT: # encoding: [0xeb,A]
1537 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1539 %load1 = load i32, ptr @g32
1540 %or = or i32 %load1, -4
1541 store i32 %or, ptr @g32
1542 %cond = icmp eq i32 %or, 0
1543 br i1 %cond, label %a, label %b
1554 define void @or16_imm_br() nounwind {
1555 ; CHECK-LABEL: or16_imm_br:
1556 ; CHECK: # %bb.0: # %entry
1557 ; CHECK-NEXT: orw $-32768, g16(%rip) # encoding: [0x66,0x81,0x0d,A,A,A,A,0x00,0x80]
1558 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-6, kind: reloc_riprel_4byte
1559 ; CHECK-NEXT: # imm = 0x8000
1560 ; CHECK-NEXT: jne b # TAILCALL
1561 ; CHECK-NEXT: # encoding: [0x75,A]
1562 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1563 ; CHECK-NEXT: # %bb.1: # %a
1564 ; CHECK-NEXT: jmp a # TAILCALL
1565 ; CHECK-NEXT: # encoding: [0xeb,A]
1566 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1568 %load1 = load i16, ptr @g16
1569 %or = or i16 %load1, 32768
1570 store i16 %or, ptr @g16
1571 %cond = icmp eq i16 %or, 0
1572 br i1 %cond, label %a, label %b
1583 define void @or16_imm8_br() nounwind {
1584 ; CHECK-LABEL: or16_imm8_br:
1585 ; CHECK: # %bb.0: # %entry
1586 ; CHECK-NEXT: orw $15, g16(%rip) # encoding: [0x66,0x83,0x0d,A,A,A,A,0x0f]
1587 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
1588 ; CHECK-NEXT: jne b # TAILCALL
1589 ; CHECK-NEXT: # encoding: [0x75,A]
1590 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1591 ; CHECK-NEXT: # %bb.1: # %a
1592 ; CHECK-NEXT: jmp a # TAILCALL
1593 ; CHECK-NEXT: # encoding: [0xeb,A]
1594 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1596 %load1 = load i16, ptr @g16
1597 %or = or i16 %load1, 15
1598 store i16 %or, ptr @g16
1599 %cond = icmp eq i16 %or, 0
1600 br i1 %cond, label %a, label %b
1611 define void @or16_imm8_neg_br() nounwind {
1612 ; CHECK-LABEL: or16_imm8_neg_br:
1613 ; CHECK: # %bb.0: # %entry
1614 ; CHECK-NEXT: orw $-4, g16(%rip) # encoding: [0x66,0x83,0x0d,A,A,A,A,0xfc]
1615 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
1616 ; CHECK-NEXT: jne b # TAILCALL
1617 ; CHECK-NEXT: # encoding: [0x75,A]
1618 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1619 ; CHECK-NEXT: # %bb.1: # %a
1620 ; CHECK-NEXT: jmp a # TAILCALL
1621 ; CHECK-NEXT: # encoding: [0xeb,A]
1622 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1624 %load1 = load i16, ptr @g16
1625 %or = or i16 %load1, -4
1626 store i16 %or, ptr @g16
1627 %cond = icmp eq i16 %or, 0
1628 br i1 %cond, label %a, label %b
1639 define void @or8_imm_br() nounwind {
1640 ; CHECK-LABEL: or8_imm_br:
1641 ; CHECK: # %bb.0: # %entry
1642 ; CHECK-NEXT: orb $-4, g8(%rip) # encoding: [0x80,0x0d,A,A,A,A,0xfc]
1643 ; CHECK-NEXT: # fixup A - offset: 2, value: g8-5, kind: reloc_riprel_4byte
1644 ; CHECK-NEXT: jne b # TAILCALL
1645 ; CHECK-NEXT: # encoding: [0x75,A]
1646 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1647 ; CHECK-NEXT: # %bb.1: # %a
1648 ; CHECK-NEXT: jmp a # TAILCALL
1649 ; CHECK-NEXT: # encoding: [0xeb,A]
1650 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1652 %load1 = load i8, ptr @g8
1653 %or = or i8 %load1, -4
1654 store i8 %or, ptr @g8
1655 %cond = icmp eq i8 %or, 0
1656 br i1 %cond, label %a, label %b
1667 define void @or64_reg_br(i64 %arg) nounwind {
1668 ; CHECK-LABEL: or64_reg_br:
1669 ; CHECK: # %bb.0: # %entry
1670 ; CHECK-NEXT: orq %rdi, g64(%rip) # encoding: [0x48,0x09,0x3d,A,A,A,A]
1671 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
1672 ; CHECK-NEXT: jne b # TAILCALL
1673 ; CHECK-NEXT: # encoding: [0x75,A]
1674 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1675 ; CHECK-NEXT: # %bb.1: # %a
1676 ; CHECK-NEXT: jmp a # TAILCALL
1677 ; CHECK-NEXT: # encoding: [0xeb,A]
1678 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1680 %load1 = load i64, ptr @g64
1681 %or = or i64 %load1, %arg
1682 store i64 %or, ptr @g64
1683 %cond = icmp eq i64 %or, 0
1684 br i1 %cond, label %a, label %b
1695 define void @or32_reg_br(i32 %arg) nounwind {
1696 ; CHECK-LABEL: or32_reg_br:
1697 ; CHECK: # %bb.0: # %entry
1698 ; CHECK-NEXT: orl %edi, g32(%rip) # encoding: [0x09,0x3d,A,A,A,A]
1699 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-4, kind: reloc_riprel_4byte
1700 ; CHECK-NEXT: jne b # TAILCALL
1701 ; CHECK-NEXT: # encoding: [0x75,A]
1702 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1703 ; CHECK-NEXT: # %bb.1: # %a
1704 ; CHECK-NEXT: jmp a # TAILCALL
1705 ; CHECK-NEXT: # encoding: [0xeb,A]
1706 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1708 %load1 = load i32, ptr @g32
1709 %or = or i32 %load1, %arg
1710 store i32 %or, ptr @g32
1711 %cond = icmp eq i32 %or, 0
1712 br i1 %cond, label %a, label %b
1723 define void @or16_reg_br(i16 %arg) nounwind {
1724 ; CHECK-LABEL: or16_reg_br:
1725 ; CHECK: # %bb.0: # %entry
1726 ; CHECK-NEXT: orw %di, g16(%rip) # encoding: [0x66,0x09,0x3d,A,A,A,A]
1727 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-4, kind: reloc_riprel_4byte
1728 ; CHECK-NEXT: jne b # TAILCALL
1729 ; CHECK-NEXT: # encoding: [0x75,A]
1730 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1731 ; CHECK-NEXT: # %bb.1: # %a
1732 ; CHECK-NEXT: jmp a # TAILCALL
1733 ; CHECK-NEXT: # encoding: [0xeb,A]
1734 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1736 %load1 = load i16, ptr @g16
1737 %or = or i16 %load1, %arg
1738 store i16 %or, ptr @g16
1739 %cond = icmp eq i16 %or, 0
1740 br i1 %cond, label %a, label %b
1751 define void @or8_reg_br(i8 %arg) nounwind {
1752 ; CHECK-LABEL: or8_reg_br:
1753 ; CHECK: # %bb.0: # %entry
1754 ; CHECK-NEXT: orb %dil, g8(%rip) # encoding: [0x40,0x08,0x3d,A,A,A,A]
1755 ; CHECK-NEXT: # fixup A - offset: 3, value: g8-4, kind: reloc_riprel_4byte
1756 ; CHECK-NEXT: jne b # TAILCALL
1757 ; CHECK-NEXT: # encoding: [0x75,A]
1758 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1759 ; CHECK-NEXT: # %bb.1: # %a
1760 ; CHECK-NEXT: jmp a # TAILCALL
1761 ; CHECK-NEXT: # encoding: [0xeb,A]
1762 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1764 %load1 = load i8, ptr @g8
1765 %or = or i8 %load1, %arg
1766 store i8 %or, ptr @g8
1767 %cond = icmp eq i8 %or, 0
1768 br i1 %cond, label %a, label %b
1779 define void @xor64_imm32_br() nounwind {
1780 ; CHECK-LABEL: xor64_imm32_br:
1781 ; CHECK: # %bb.0: # %entry
1782 ; CHECK-NEXT: xorq $16777215, g64(%rip) # encoding: [0x48,0x81,0x35,A,A,A,A,0xff,0xff,0xff,0x00]
1783 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
1784 ; CHECK-NEXT: # imm = 0xFFFFFF
1785 ; CHECK-NEXT: jne b # TAILCALL
1786 ; CHECK-NEXT: # encoding: [0x75,A]
1787 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1788 ; CHECK-NEXT: # %bb.1: # %a
1789 ; CHECK-NEXT: jmp a # TAILCALL
1790 ; CHECK-NEXT: # encoding: [0xeb,A]
1791 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1793 %load1 = load i64, ptr @g64
1794 ; Xor 0x00FFFFFF, a positive immediate requiring 24-bits.
1795 %xor = xor i64 %load1, 16777215
1796 store i64 %xor, ptr @g64
1797 %cond = icmp eq i64 %xor, 0
1798 br i1 %cond, label %a, label %b
1809 define void @xor64_sext_imm32_br() nounwind {
1810 ; CHECK-LABEL: xor64_sext_imm32_br:
1811 ; CHECK: # %bb.0: # %entry
1812 ; CHECK-NEXT: xorq $-2147483648, g64(%rip) # encoding: [0x48,0x81,0x35,A,A,A,A,0x00,0x00,0x00,0x80]
1813 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-8, kind: reloc_riprel_4byte
1814 ; CHECK-NEXT: # imm = 0x80000000
1815 ; CHECK-NEXT: jne b # TAILCALL
1816 ; CHECK-NEXT: # encoding: [0x75,A]
1817 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1818 ; CHECK-NEXT: # %bb.1: # %a
1819 ; CHECK-NEXT: jmp a # TAILCALL
1820 ; CHECK-NEXT: # encoding: [0xeb,A]
1821 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1823 %load1 = load i64, ptr @g64
1824 ; Xor -0x80000000, which requires sign-extended 32 bits.
1825 %xor = xor i64 %load1, -2147483648
1826 store i64 %xor, ptr @g64
1827 %cond = icmp eq i64 %xor, 0
1828 br i1 %cond, label %a, label %b
1839 define void @xor64_imm8_br() nounwind {
1840 ; CHECK-LABEL: xor64_imm8_br:
1841 ; CHECK: # %bb.0: # %entry
1842 ; CHECK-NEXT: xorq $15, g64(%rip) # encoding: [0x48,0x83,0x35,A,A,A,A,0x0f]
1843 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
1844 ; CHECK-NEXT: jne b # TAILCALL
1845 ; CHECK-NEXT: # encoding: [0x75,A]
1846 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1847 ; CHECK-NEXT: # %bb.1: # %a
1848 ; CHECK-NEXT: jmp a # TAILCALL
1849 ; CHECK-NEXT: # encoding: [0xeb,A]
1850 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1852 %load1 = load i64, ptr @g64
1853 %xor = xor i64 %load1, 15
1854 store i64 %xor, ptr @g64
1855 %cond = icmp eq i64 %xor, 0
1856 br i1 %cond, label %a, label %b
1867 define void @xor64_imm8_neg_br() nounwind {
1868 ; CHECK-LABEL: xor64_imm8_neg_br:
1869 ; CHECK: # %bb.0: # %entry
1870 ; CHECK-NEXT: xorq $-4, g64(%rip) # encoding: [0x48,0x83,0x35,A,A,A,A,0xfc]
1871 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-5, kind: reloc_riprel_4byte
1872 ; CHECK-NEXT: jne b # TAILCALL
1873 ; CHECK-NEXT: # encoding: [0x75,A]
1874 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1875 ; CHECK-NEXT: # %bb.1: # %a
1876 ; CHECK-NEXT: jmp a # TAILCALL
1877 ; CHECK-NEXT: # encoding: [0xeb,A]
1878 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1880 %load1 = load i64, ptr @g64
1881 %xor = xor i64 %load1, -4
1882 store i64 %xor, ptr @g64
1883 %cond = icmp eq i64 %xor, 0
1884 br i1 %cond, label %a, label %b
1895 define void @xor32_imm_br() nounwind {
1896 ; CHECK-LABEL: xor32_imm_br:
1897 ; CHECK: # %bb.0: # %entry
1898 ; CHECK-NEXT: xorl $-2147483648, g32(%rip) # encoding: [0x81,0x35,A,A,A,A,0x00,0x00,0x00,0x80]
1899 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-8, kind: reloc_riprel_4byte
1900 ; CHECK-NEXT: # imm = 0x80000000
1901 ; CHECK-NEXT: jne b # TAILCALL
1902 ; CHECK-NEXT: # encoding: [0x75,A]
1903 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1904 ; CHECK-NEXT: # %bb.1: # %a
1905 ; CHECK-NEXT: jmp a # TAILCALL
1906 ; CHECK-NEXT: # encoding: [0xeb,A]
1907 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1909 %load1 = load i32, ptr @g32
1910 ; Xor 0x80000000, a positive number requiring 32 bits of immediate.
1911 %xor = xor i32 %load1, 2147483648
1912 store i32 %xor, ptr @g32
1913 %cond = icmp eq i32 %xor, 0
1914 br i1 %cond, label %a, label %b
1925 define void @xor32_imm8_br() nounwind {
1926 ; CHECK-LABEL: xor32_imm8_br:
1927 ; CHECK: # %bb.0: # %entry
1928 ; CHECK-NEXT: xorl $15, g32(%rip) # encoding: [0x83,0x35,A,A,A,A,0x0f]
1929 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
1930 ; CHECK-NEXT: jne b # TAILCALL
1931 ; CHECK-NEXT: # encoding: [0x75,A]
1932 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1933 ; CHECK-NEXT: # %bb.1: # %a
1934 ; CHECK-NEXT: jmp a # TAILCALL
1935 ; CHECK-NEXT: # encoding: [0xeb,A]
1936 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1938 %load1 = load i32, ptr @g32
1939 %xor = xor i32 %load1, 15
1940 store i32 %xor, ptr @g32
1941 %cond = icmp eq i32 %xor, 0
1942 br i1 %cond, label %a, label %b
1953 define void @xor32_imm8_neg_br() nounwind {
1954 ; CHECK-LABEL: xor32_imm8_neg_br:
1955 ; CHECK: # %bb.0: # %entry
1956 ; CHECK-NEXT: xorl $-4, g32(%rip) # encoding: [0x83,0x35,A,A,A,A,0xfc]
1957 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-5, kind: reloc_riprel_4byte
1958 ; CHECK-NEXT: jne b # TAILCALL
1959 ; CHECK-NEXT: # encoding: [0x75,A]
1960 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1961 ; CHECK-NEXT: # %bb.1: # %a
1962 ; CHECK-NEXT: jmp a # TAILCALL
1963 ; CHECK-NEXT: # encoding: [0xeb,A]
1964 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1966 %load1 = load i32, ptr @g32
1967 %xor = xor i32 %load1, -4
1968 store i32 %xor, ptr @g32
1969 %cond = icmp eq i32 %xor, 0
1970 br i1 %cond, label %a, label %b
1981 define void @xor16_imm_br() nounwind {
1982 ; CHECK-LABEL: xor16_imm_br:
1983 ; CHECK: # %bb.0: # %entry
1984 ; CHECK-NEXT: xorw $-32768, g16(%rip) # encoding: [0x66,0x81,0x35,A,A,A,A,0x00,0x80]
1985 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-6, kind: reloc_riprel_4byte
1986 ; CHECK-NEXT: # imm = 0x8000
1987 ; CHECK-NEXT: jne b # TAILCALL
1988 ; CHECK-NEXT: # encoding: [0x75,A]
1989 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
1990 ; CHECK-NEXT: # %bb.1: # %a
1991 ; CHECK-NEXT: jmp a # TAILCALL
1992 ; CHECK-NEXT: # encoding: [0xeb,A]
1993 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
1995 %load1 = load i16, ptr @g16
1996 %xor = xor i16 %load1, 32768
1997 store i16 %xor, ptr @g16
1998 %cond = icmp eq i16 %xor, 0
1999 br i1 %cond, label %a, label %b
2010 define void @xor16_imm8_br() nounwind {
2011 ; CHECK-LABEL: xor16_imm8_br:
2012 ; CHECK: # %bb.0: # %entry
2013 ; CHECK-NEXT: xorw $15, g16(%rip) # encoding: [0x66,0x83,0x35,A,A,A,A,0x0f]
2014 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
2015 ; CHECK-NEXT: jne b # TAILCALL
2016 ; CHECK-NEXT: # encoding: [0x75,A]
2017 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2018 ; CHECK-NEXT: # %bb.1: # %a
2019 ; CHECK-NEXT: jmp a # TAILCALL
2020 ; CHECK-NEXT: # encoding: [0xeb,A]
2021 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2023 %load1 = load i16, ptr @g16
2024 %xor = xor i16 %load1, 15
2025 store i16 %xor, ptr @g16
2026 %cond = icmp eq i16 %xor, 0
2027 br i1 %cond, label %a, label %b
2038 define void @xor16_imm8_neg_br() nounwind {
2039 ; CHECK-LABEL: xor16_imm8_neg_br:
2040 ; CHECK: # %bb.0: # %entry
2041 ; CHECK-NEXT: xorw $-4, g16(%rip) # encoding: [0x66,0x83,0x35,A,A,A,A,0xfc]
2042 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-5, kind: reloc_riprel_4byte
2043 ; CHECK-NEXT: jne b # TAILCALL
2044 ; CHECK-NEXT: # encoding: [0x75,A]
2045 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2046 ; CHECK-NEXT: # %bb.1: # %a
2047 ; CHECK-NEXT: jmp a # TAILCALL
2048 ; CHECK-NEXT: # encoding: [0xeb,A]
2049 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2051 %load1 = load i16, ptr @g16
2052 %xor = xor i16 %load1, -4
2053 store i16 %xor, ptr @g16
2054 %cond = icmp eq i16 %xor, 0
2055 br i1 %cond, label %a, label %b
2066 define void @xor8_imm_br() nounwind {
2067 ; CHECK-LABEL: xor8_imm_br:
2068 ; CHECK: # %bb.0: # %entry
2069 ; CHECK-NEXT: xorb $-4, g8(%rip) # encoding: [0x80,0x35,A,A,A,A,0xfc]
2070 ; CHECK-NEXT: # fixup A - offset: 2, value: g8-5, kind: reloc_riprel_4byte
2071 ; CHECK-NEXT: jne b # TAILCALL
2072 ; CHECK-NEXT: # encoding: [0x75,A]
2073 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2074 ; CHECK-NEXT: # %bb.1: # %a
2075 ; CHECK-NEXT: jmp a # TAILCALL
2076 ; CHECK-NEXT: # encoding: [0xeb,A]
2077 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2079 %load1 = load i8, ptr @g8
2080 %xor = xor i8 %load1, -4
2081 store i8 %xor, ptr @g8
2082 %cond = icmp eq i8 %xor, 0
2083 br i1 %cond, label %a, label %b
2094 define void @xor64_reg_br(i64 %arg) nounwind {
2095 ; CHECK-LABEL: xor64_reg_br:
2096 ; CHECK: # %bb.0: # %entry
2097 ; CHECK-NEXT: xorq %rdi, g64(%rip) # encoding: [0x48,0x31,0x3d,A,A,A,A]
2098 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
2099 ; CHECK-NEXT: jne b # TAILCALL
2100 ; CHECK-NEXT: # encoding: [0x75,A]
2101 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2102 ; CHECK-NEXT: # %bb.1: # %a
2103 ; CHECK-NEXT: jmp a # TAILCALL
2104 ; CHECK-NEXT: # encoding: [0xeb,A]
2105 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2107 %load1 = load i64, ptr @g64
2108 %xor = xor i64 %load1, %arg
2109 store i64 %xor, ptr @g64
2110 %cond = icmp eq i64 %xor, 0
2111 br i1 %cond, label %a, label %b
2122 define void @xor32_reg_br(i32 %arg) nounwind {
2123 ; CHECK-LABEL: xor32_reg_br:
2124 ; CHECK: # %bb.0: # %entry
2125 ; CHECK-NEXT: xorl %edi, g32(%rip) # encoding: [0x31,0x3d,A,A,A,A]
2126 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-4, kind: reloc_riprel_4byte
2127 ; CHECK-NEXT: jne b # TAILCALL
2128 ; CHECK-NEXT: # encoding: [0x75,A]
2129 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2130 ; CHECK-NEXT: # %bb.1: # %a
2131 ; CHECK-NEXT: jmp a # TAILCALL
2132 ; CHECK-NEXT: # encoding: [0xeb,A]
2133 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2135 %load1 = load i32, ptr @g32
2136 %xor = xor i32 %load1, %arg
2137 store i32 %xor, ptr @g32
2138 %cond = icmp eq i32 %xor, 0
2139 br i1 %cond, label %a, label %b
2150 define void @xor16_reg_br(i16 %arg) nounwind {
2151 ; CHECK-LABEL: xor16_reg_br:
2152 ; CHECK: # %bb.0: # %entry
2153 ; CHECK-NEXT: xorw %di, g16(%rip) # encoding: [0x66,0x31,0x3d,A,A,A,A]
2154 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-4, kind: reloc_riprel_4byte
2155 ; CHECK-NEXT: jne b # TAILCALL
2156 ; CHECK-NEXT: # encoding: [0x75,A]
2157 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2158 ; CHECK-NEXT: # %bb.1: # %a
2159 ; CHECK-NEXT: jmp a # TAILCALL
2160 ; CHECK-NEXT: # encoding: [0xeb,A]
2161 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2163 %load1 = load i16, ptr @g16
2164 %xor = xor i16 %load1, %arg
2165 store i16 %xor, ptr @g16
2166 %cond = icmp eq i16 %xor, 0
2167 br i1 %cond, label %a, label %b
2178 define void @xor8_reg_br(i8 %arg) nounwind {
2179 ; CHECK-LABEL: xor8_reg_br:
2180 ; CHECK: # %bb.0: # %entry
2181 ; CHECK-NEXT: xorb %dil, g8(%rip) # encoding: [0x40,0x30,0x3d,A,A,A,A]
2182 ; CHECK-NEXT: # fixup A - offset: 3, value: g8-4, kind: reloc_riprel_4byte
2183 ; CHECK-NEXT: jne b # TAILCALL
2184 ; CHECK-NEXT: # encoding: [0x75,A]
2185 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2186 ; CHECK-NEXT: # %bb.1: # %a
2187 ; CHECK-NEXT: jmp a # TAILCALL
2188 ; CHECK-NEXT: # encoding: [0xeb,A]
2189 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2191 %load1 = load i8, ptr @g8
2192 %xor = xor i8 %load1, %arg
2193 store i8 %xor, ptr @g8
2194 %cond = icmp eq i8 %xor, 0
2195 br i1 %cond, label %a, label %b
2206 define void @neg64_br() nounwind {
2207 ; CHECK-LABEL: neg64_br:
2208 ; CHECK: # %bb.0: # %entry
2209 ; CHECK-NEXT: negq g64(%rip) # encoding: [0x48,0xf7,0x1d,A,A,A,A]
2210 ; CHECK-NEXT: # fixup A - offset: 3, value: g64-4, kind: reloc_riprel_4byte
2211 ; CHECK-NEXT: jns b # TAILCALL
2212 ; CHECK-NEXT: # encoding: [0x79,A]
2213 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2214 ; CHECK-NEXT: # %bb.1: # %a
2215 ; CHECK-NEXT: jmp a # TAILCALL
2216 ; CHECK-NEXT: # encoding: [0xeb,A]
2217 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2219 %load1 = load i64, ptr @g64
2220 %sub = sub i64 0, %load1
2221 store i64 %sub, ptr @g64
2222 %cond = icmp slt i64 %sub, 0
2223 br i1 %cond, label %a, label %b
2234 define void @neg32_br() nounwind {
2235 ; CHECK-LABEL: neg32_br:
2236 ; CHECK: # %bb.0: # %entry
2237 ; CHECK-NEXT: negl g32(%rip) # encoding: [0xf7,0x1d,A,A,A,A]
2238 ; CHECK-NEXT: # fixup A - offset: 2, value: g32-4, kind: reloc_riprel_4byte
2239 ; CHECK-NEXT: jns b # TAILCALL
2240 ; CHECK-NEXT: # encoding: [0x79,A]
2241 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2242 ; CHECK-NEXT: # %bb.1: # %a
2243 ; CHECK-NEXT: jmp a # TAILCALL
2244 ; CHECK-NEXT: # encoding: [0xeb,A]
2245 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2247 %load1 = load i32, ptr @g32
2248 %sub = sub i32 0, %load1
2249 store i32 %sub, ptr @g32
2250 %cond = icmp slt i32 %sub, 0
2251 br i1 %cond, label %a, label %b
2262 define void @neg16_br() nounwind {
2263 ; CHECK-LABEL: neg16_br:
2264 ; CHECK: # %bb.0: # %entry
2265 ; CHECK-NEXT: negw g16(%rip) # encoding: [0x66,0xf7,0x1d,A,A,A,A]
2266 ; CHECK-NEXT: # fixup A - offset: 3, value: g16-4, kind: reloc_riprel_4byte
2267 ; CHECK-NEXT: jns b # TAILCALL
2268 ; CHECK-NEXT: # encoding: [0x79,A]
2269 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2270 ; CHECK-NEXT: # %bb.1: # %a
2271 ; CHECK-NEXT: jmp a # TAILCALL
2272 ; CHECK-NEXT: # encoding: [0xeb,A]
2273 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2275 %load1 = load i16, ptr @g16
2276 %sub = sub i16 0, %load1
2277 store i16 %sub, ptr @g16
2278 %cond = icmp slt i16 %sub, 0
2279 br i1 %cond, label %a, label %b
2290 define void @neg8_br() nounwind {
2291 ; CHECK-LABEL: neg8_br:
2292 ; CHECK: # %bb.0: # %entry
2293 ; CHECK-NEXT: negb g8(%rip) # encoding: [0xf6,0x1d,A,A,A,A]
2294 ; CHECK-NEXT: # fixup A - offset: 2, value: g8-4, kind: reloc_riprel_4byte
2295 ; CHECK-NEXT: jns b # TAILCALL
2296 ; CHECK-NEXT: # encoding: [0x79,A]
2297 ; CHECK-NEXT: # fixup A - offset: 1, value: b-1, kind: FK_PCRel_1
2298 ; CHECK-NEXT: # %bb.1: # %a
2299 ; CHECK-NEXT: jmp a # TAILCALL
2300 ; CHECK-NEXT: # encoding: [0xeb,A]
2301 ; CHECK-NEXT: # fixup A - offset: 1, value: a-1, kind: FK_PCRel_1
2303 %load1 = load i8, ptr @g8
2304 %sub = sub i8 0, %load1
2305 store i8 %sub, ptr @g8
2306 %cond = icmp slt i8 %sub, 0
2307 br i1 %cond, label %a, label %b