1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=x86_64-unknown-windows-msvc19.11.0 | FileCheck %s
4 ; This matches the code produced by clang/lib/CodeGen/bittest-intrin.c
6 @sink = global i8 0, align 1
8 define void @test32(ptr %base, i32 %idx) {
10 ; CHECK: # %bb.0: # %entry
12 ; CHECK-NEXT: btl %edx, (%rcx)
14 ; CHECK-NEXT: setb sink(%rip)
16 ; CHECK-NEXT: btcl %edx, (%rcx)
18 ; CHECK-NEXT: setb sink(%rip)
20 ; CHECK-NEXT: btrl %edx, (%rcx)
22 ; CHECK-NEXT: setb sink(%rip)
24 ; CHECK-NEXT: btsl %edx, (%rcx)
26 ; CHECK-NEXT: setb sink(%rip)
28 ; CHECK-NEXT: lock btrl %edx, (%rcx)
30 ; CHECK-NEXT: setb sink(%rip)
32 ; CHECK-NEXT: lock btsl %edx, (%rcx)
34 ; CHECK-NEXT: setb sink(%rip)
36 ; CHECK-NEXT: lock btsl %edx, (%rcx)
38 ; CHECK-NEXT: setb sink(%rip)
41 %0 = tail call i8 asm sideeffect "btl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i32 %idx)
42 store volatile i8 %0, ptr @sink, align 1
43 %1 = tail call i8 asm sideeffect "btcl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i32 %idx)
44 store volatile i8 %1, ptr @sink, align 1
45 %2 = tail call i8 asm sideeffect "btrl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i32 %idx)
46 store volatile i8 %2, ptr @sink, align 1
47 %3 = tail call i8 asm sideeffect "btsl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i32 %idx)
48 store volatile i8 %3, ptr @sink, align 1
49 %4 = tail call i8 asm sideeffect "lock btrl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i32 %idx)
50 store volatile i8 %4, ptr @sink, align 1
51 %5 = tail call i8 asm sideeffect "lock btsl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i32 %idx)
52 store volatile i8 %5, ptr @sink, align 1
53 %6 = tail call i8 asm sideeffect "lock btsl $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i32 %idx)
54 store volatile i8 %6, ptr @sink, align 1
58 ; Function Attrs: nounwind uwtable
59 define void @test64(ptr %base, i64 %idx) {
60 ; CHECK-LABEL: test64:
61 ; CHECK: # %bb.0: # %entry
63 ; CHECK-NEXT: btq %rdx, (%rcx)
65 ; CHECK-NEXT: setb sink(%rip)
67 ; CHECK-NEXT: btcq %rdx, (%rcx)
69 ; CHECK-NEXT: setb sink(%rip)
71 ; CHECK-NEXT: btrq %rdx, (%rcx)
73 ; CHECK-NEXT: setb sink(%rip)
75 ; CHECK-NEXT: btsq %rdx, (%rcx)
77 ; CHECK-NEXT: setb sink(%rip)
79 ; CHECK-NEXT: lock btrq %rdx, (%rcx)
81 ; CHECK-NEXT: setb sink(%rip)
83 ; CHECK-NEXT: lock btsq %rdx, (%rcx)
85 ; CHECK-NEXT: setb sink(%rip)
88 %0 = tail call i8 asm sideeffect "btq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i64 %idx)
89 store volatile i8 %0, ptr @sink, align 1
90 %1 = tail call i8 asm sideeffect "btcq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i64 %idx)
91 store volatile i8 %1, ptr @sink, align 1
92 %2 = tail call i8 asm sideeffect "btrq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i64 %idx)
93 store volatile i8 %2, ptr @sink, align 1
94 %3 = tail call i8 asm sideeffect "btsq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i64 %idx)
95 store volatile i8 %3, ptr @sink, align 1
96 %4 = tail call i8 asm sideeffect "lock btrq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i64 %idx)
97 store volatile i8 %4, ptr @sink, align 1
98 %5 = tail call i8 asm sideeffect "lock btsq $2, ($1)", "={@ccc},r,r,~{cc},~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %base, i64 %idx)
99 store volatile i8 %5, ptr @sink, align 1